feat(form): integrate sc into ew/nx2#508
Open
kozmaadrian wants to merge 22 commits into
Open
Conversation
|
Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch.
|
kozmaadrian
commented
Jun 12, 2026
kozmaadrian
commented
Jun 12, 2026
| * @param {{ aemPath: string, action: 'preview' | 'publish' }} params | ||
| * @returns {string | null} e.g. https://da-sc.adobeaem.workers.dev/preview/kozmaadrian/da-sc/forms/x | ||
| */ | ||
| export function buildScRendererUrl({ aemPath, action }) { |
Contributor
Author
There was a problem hiding this comment.
Member
There was a problem hiding this comment.
This file location should be scoped to the SC block. It looks to be purely for SC.
The filename is also a bit misleading as it looks like it implies overlap with api.js.
Contributor
There was a problem hiding this comment.
Yes lets move this to the block 👍
mhaack
reviewed
Jun 23, 2026
10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Port the structured-content form block into nx2
Summary
Ports the schema-driven form block from
nx/blocks/form(v1) intonx2/blocks/form, rebuilt to nx2 conventions and Spectrum 2 design.How it was ported
Engine — vendored
da-sc-sdk. The structured-content engine is vendored intonx2/deps/da-sc-sdk(with abuild:da-sc-sdk:nx2script).Utils — cloned onto the nx2 api. The form's
utils/(context,da-api,persistence,schemas) were brought over and adapted to the nx2 utility/api layer (loadStyle,hashChange,daFetch, …).Fields — rebuilt as Spectrum 2 web components. Each field is its own Lit element module under
fields/:sl-input,sl-picker,sl-checkbox,sl-button(accent/secondary variants),sl-number-field.defaultsmodule supplies the common field chrome (label, required marker, error text, description slot), adopted alongside each field's own stylesheet viaadoptedStyleSheets+ theloadStyle(import.meta.url)convention.--s2-*tokens (per AGENTS.md: "Spectrum design, not Spectrum libraries").picker+buttonit uses) — no central barrel.Views — cloned with S2 styling.
editor,sidebar, andpreview, plus the array UI (array-menu,reorder), restyled to Spectrum 2.Icons load from
.svgfiles through the themeableicon()helper (currentColor), matching the nx2 icon convention.Shell — ctx-driven
nx-form.form.jsis a thin Lit shell: it reads the hash, resolves schema/document context, instantiates the engine, wires editor/sidebar/preview, and attaches persistence (cleaned up on teardown).Preview / publish open at the structured-content renderer URL (via the
ew-actionsintegration).Conventions followed
firstUpdated, null-checked usage).--s2-*tokens; light/dark throughlight-dark().Test url: https://da.live/formnx2?nx=form-ew#/exp-workspace/frescopa/forms/ai-evolution
The chat window is gated by the ew.enabled flag.
Screen 0: Chat deactivated
Screen 1: Select Schema
Screen 2: Empty document
Screen 3: Existing document