diff --git a/WORKLOG.md b/WORKLOG.md index 925f5e094..9fb827502 100644 --- a/WORKLOG.md +++ b/WORKLOG.md @@ -8,6 +8,26 @@ Changed `:root { color-scheme: light dark; }` → `color-scheme: light;` and `.d ## 2026-07-09 +### nx/blocks/secure-org — migrate secure-org block to nx2 + +Added `'secure-org'` to `NX_BLOCKS` in `nx2/scripts/nx.js`. Block stays in `nx/blocks/secure-org/` per migration convention. + +Import updates in `secure-org.js`: +- Dropped `getConfig` from nexter.js; icon URLs built via `new URL('../../public/icons/...', import.meta.url).href` (icons live only in nx1) +- `../../utils/ims.js` `loadIms` → `../../../nx2/utils/ims.js` +- `../../utils/styles.js` default `getStyle` → `{ loadStyle }` from `../../../nx2/utils/utils.js` +- `../../utils/svg.js` `getSvg` → default `loadIcons` from `../../../nx2/utils/svg.js` + +Import updates in `utils.js`: +- `../../public/utils/constants.js` (DA_ORIGIN) → `../../../nx2/public/utils/constants.js` +- `../../utils/daFetch.js` (daFetch) → `../../../nx2/utils/api.js`; call site updated from positional `daFetch(url, opts)` to destructured `daFetch({ url, opts })` + +CSS variables in `secure-org.css`: +- `--grid-container-width` → `--se-grid-container-width` with nx1 fallback +- `--spacing-800` → `--s2-spacing-800` with nx1 fallback + +Verified live at `/apps/sandbox?nx=local` — block renders correctly (nx-path input, orange warning alert with AlertDiamond icon), no console errors. + ### nx/blocks/bulk — migrate bulk operations block to nx2 Added `'bulk'` to `NX_BLOCKS` in `nx2/scripts/nx.js`. Block stays in `nx/blocks/bulk/` per migration convention. diff --git a/nx/blocks/secure-org/secure-org.css b/nx/blocks/secure-org/secure-org.css index 7266b4aa6..20b639a44 100644 --- a/nx/blocks/secure-org/secure-org.css +++ b/nx/blocks/secure-org/secure-org.css @@ -1,11 +1,7 @@ :host { display: block; - max-width: var(--grid-container-width); - margin: var(--spacing-800) auto var(--spacing-800) auto; - - > svg { - display: none; - } + max-width: var(--se-grid-container-width, var(--grid-container-width)); + margin: var(--s2-spacing-800, var(--spacing-800)) auto var(--s2-spacing-800, var(--spacing-800)) auto; nx-path { display: block; diff --git a/nx/blocks/secure-org/secure-org.js b/nx/blocks/secure-org/secure-org.js index 9a800aad7..4d105e407 100644 --- a/nx/blocks/secure-org/secure-org.js +++ b/nx/blocks/secure-org/secure-org.js @@ -1,25 +1,14 @@ import { html, LitElement, nothing } from 'da-lit'; -import { getConfig } from '../../scripts/nexter.js'; -import { loadIms } from '../../utils/ims.js'; -import getStyle from '../../utils/styles.js'; -import { getSvg } from '../../utils/svg.js'; +import { loadIms } from '../../../nx2/utils/ims.js'; +import { loadStyle } from '../../../nx2/utils/utils.js'; import { loadConfig, saveConfig } from './utils.js'; import '../../public/sl/components.js'; import '../shared/path/path.js'; -const { nxBase: nx } = getConfig(); - -const ICONS = [ - `${nx}/public/icons/S2_Icon_InfoCircle_20_N.svg`, - `${nx}/public/icons/S2_Icon_AlertDiamond_20_N.svg`, - `${nx}/public/icons/S2_Icon_CheckmarkCircle_20_N.svg`, -]; - const EL_NAME = 'nx-secure-org'; -const styles = await getStyle(import.meta.url); -const icons = await getSvg({ paths: ICONS }); +const styles = await loadStyle(import.meta.url); class SecureOrg extends LitElement { static properties = { @@ -35,7 +24,6 @@ class SecureOrg extends LitElement { connectedCallback() { super.connectedCallback(); this.shadowRoot.adoptedStyleSheets = [styles]; - this.shadowRoot.append(...icons); this.resetDefaults(); } @@ -100,14 +88,15 @@ class SecureOrg extends LitElement { if (!this._alert) return nothing; const type2icon = { - info: 'InfoCircle', - warning: 'AlertDiamond', - success: 'CheckmarkCircle', + info: 'infocircle', + warning: 'alertdiamond', + success: 'checkmarkcircle', }; + const type = this._alert.type || 'info'; return html` -
${this._alert.message}