fix: make sheet block compatible with nx2#1067
Open
hannessolo wants to merge 7 commits into
Open
Conversation
Switch from nx-v1-only utility paths (utils/styles.js, utils/svg.js, utils/script.js) to nx2-compatible imports via utils/utils.js, with a local inlinesvg fallback for icon loading. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
nx2's loadBlock no longer auto-mounts the block stylesheet, so sheet.js now adopts sheet.css onto document.adoptedStyleSheets explicitly. Apply the same pattern for the jspreadsheet stylesheet in utils/index.js. Update --spacing-* and --body-font-family references to fall through to nx2's --s2-* equivalents while still resolving in nx v1. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Switch loadStyle imports to ${getNx()}/utils/utils.js and adopt the
returned CSSStyleSheet onto document.adoptedStyleSheets — nx2's
loadStyle returns a stylesheet instead of appending a <link> tag.
In da-assets.js route loadScript through utils/utils.js in nx2 mode,
since /utils/script.js only exists under /nx. In da-library.js map the
base back to /nx so /styles/buttons.css resolves in both modes.
Update --body-font-family references with --s2-font-family fallbacks.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
nx2 renamed --grid-container-width to --se-grid-container-width with the same 83.4%/1200px breakpoints. Without the fallback, .da-title-inner and da-content lose their max/explicit width in nx2 and the header loses its horizontal margin between breakpoints. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
mhaack
reviewed
Jul 1, 2026
Comment on lines
+184
to
+186
| const loadScript = isNx2 | ||
| ? (await import(`${nx}/utils/utils.js`)).loadScript | ||
| : (await import(`${nx}/utils/script.js`)).default; |
Contributor
There was a problem hiding this comment.
Is this actually needed? If we load nx2 and we switched. Why the check for old nx?
Contributor
Author
There was a problem hiding this comment.
Ok, removed. However, I'm just wondering if that was smart. This will break once we merge - we need to at the same time change nxver=2 into the pages. That might cause ~1-2 mins DA downtime.
Edit and sheet only target nx2 going forward, so remove the isNx2 ternary in da-assets.js and sheet/utils/index.js and import loadScript directly from utils/utils.js. Delete the nx v1-shaped fixture stubs (styles.js, svg.js, script.js) that nothing imports anymore, and expose loadScript from the utils.js fixture to mirror the nx2 module contract. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
nx2 renamed --s2-radius-300 to --s2-corner-radius-800 (same 16px value). Without the fallback the Cancel/Compare/Restore buttons in the version preview lose their rounded corners. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
https://sheetnx2--da-live--adobe.aem.live/edit?nxver=2#/exp-workspace/frescopa/about-us
https://sheetnx2--da-live--adobe.aem.live/sheet?nxver=2#/exp-workspace/frescopa/test
https://sheetnx2--da-live--adobe.aem.live/config?nxver=2#/exp-workspace/frescopa/