@aquera/nile-elements 2.0.21 → 2.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/README.md +4 -0
  2. package/dist/index.js +120 -47
  3. package/dist/nile-empty-state/nile-empty-state.cjs.js +1 -1
  4. package/dist/nile-empty-state/nile-empty-state.cjs.js.map +1 -1
  5. package/dist/nile-empty-state/nile-empty-state.esm.js +4 -4
  6. package/dist/nile-wysiwyg-editor/index.cjs.js +1 -1
  7. package/dist/nile-wysiwyg-editor/index.esm.js +1 -1
  8. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.cjs.js +1 -1
  9. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.cjs.js.map +1 -1
  10. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.css.cjs.js +1 -1
  11. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.css.cjs.js.map +1 -1
  12. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.css.esm.js +73 -1
  13. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.esm.js +3 -2
  14. package/dist/nile-wysiwyg-editor/types.cjs.js +1 -1
  15. package/dist/nile-wysiwyg-editor/types.cjs.js.map +1 -1
  16. package/dist/nile-wysiwyg-editor/types.esm.js +1 -1
  17. package/dist/src/nile-empty-state/nile-empty-state.d.ts +5 -0
  18. package/dist/src/nile-empty-state/nile-empty-state.js +11 -2
  19. package/dist/src/nile-empty-state/nile-empty-state.js.map +1 -1
  20. package/dist/src/nile-empty-state/nile-empty-state.test.js +31 -0
  21. package/dist/src/nile-empty-state/nile-empty-state.test.js.map +1 -1
  22. package/dist/src/nile-wysiwyg-editor/index.d.ts +2 -1
  23. package/dist/src/nile-wysiwyg-editor/index.js +1 -1
  24. package/dist/src/nile-wysiwyg-editor/index.js.map +1 -1
  25. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.js +75 -0
  26. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.js.map +1 -1
  27. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.d.ts +20 -0
  28. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.js +37 -1
  29. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.js.map +1 -1
  30. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.test.js +108 -0
  31. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.test.js.map +1 -1
  32. package/dist/src/nile-wysiwyg-editor/types.d.ts +8 -0
  33. package/dist/src/nile-wysiwyg-editor/types.js +50 -0
  34. package/dist/src/nile-wysiwyg-editor/types.js.map +1 -1
  35. package/dist/src/version.js +1 -1
  36. package/dist/src/version.js.map +1 -1
  37. package/dist/tsconfig.tsbuildinfo +1 -1
  38. package/package.json +1 -1
  39. package/src/nile-empty-state/nile-empty-state.test.ts +24 -0
  40. package/src/nile-empty-state/nile-empty-state.ts +12 -2
  41. package/src/nile-wysiwyg-editor/index.ts +2 -1
  42. package/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.ts +76 -0
  43. package/src/nile-wysiwyg-editor/nile-wysiwyg-editor.test.ts +132 -0
  44. package/src/nile-wysiwyg-editor/nile-wysiwyg-editor.ts +40 -1
  45. package/src/nile-wysiwyg-editor/types.ts +52 -0
  46. package/vscode-html-custom-data.json +23 -2
@@ -5,4 +5,54 @@ export const DEFAULT_TOOLBAR = 'undo redo findReplace | heading | bold italic un
5
5
  '>> mergeField template | ' +
6
6
  'formatPainter caseChange clearFormatting pastePlainText showBlocks sourceView | ' +
7
7
  'importMarkdown importWord exportInlineHtml exportWord exportPdf | shortcutHelp fullscreen';
8
+ /** Content components that `no-theme-components` can keep on light colours. */
9
+ export const NO_THEME_COMPONENTS = [
10
+ 'all',
11
+ 'mentions',
12
+ 'merge-fields',
13
+ 'links',
14
+ 'math',
15
+ 'code',
16
+ 'blockquote',
17
+ 'table',
18
+ 'task-list',
19
+ 'images',
20
+ ];
21
+ /**
22
+ * Normalises a `no-theme-components` value: a JSON array, or a comma/space
23
+ * separated list, or an unquoted `[a, b]`. Lower-cases, de-duplicates and drops unknown names.
24
+ */
25
+ export function parseNoThemeComponents(value) {
26
+ if (value == null)
27
+ return [];
28
+ let names = [];
29
+ if (Array.isArray(value)) {
30
+ names = value;
31
+ }
32
+ else {
33
+ const text = String(value).trim();
34
+ if (text.startsWith('[')) {
35
+ try {
36
+ const parsed = JSON.parse(text);
37
+ names = Array.isArray(parsed) ? parsed : [];
38
+ }
39
+ catch {
40
+ // Unquoted form, e.g. [mentions, table]
41
+ names = text.replace(/^\[|\]$/g, '').split(/[\s,'"]+/);
42
+ }
43
+ }
44
+ else {
45
+ names = text.split(/[\s,]+/);
46
+ }
47
+ }
48
+ const known = new Set(NO_THEME_COMPONENTS);
49
+ const out = [];
50
+ for (const n of names) {
51
+ const name = typeof n === 'string' ? n.trim().toLowerCase() : '';
52
+ if (known.has(name) && !out.includes(name)) {
53
+ out.push(name);
54
+ }
55
+ }
56
+ return out;
57
+ }
8
58
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/nile-wysiwyg-editor/types.ts"],"names":[],"mappings":"AA6EA,MAAM,CAAC,MAAM,eAAe,GAC1B,0HAA0H;IAC1H,sEAAsE;IACtE,wEAAwE;IACxE,mFAAmF;IACnF,2BAA2B;IAC3B,kFAAkF;IAClF,2FAA2F,CAAC","sourcesContent":["import type { CommandAttrs, CommandName } from './engine/commands';\n\n/**\n * Toolbar configuration. The string form uses space-separated item names with\n * `|` as a group divider, e.g. `\"bold italic | heading | link\"`. A `>>` marker\n * moves every item after it into a collapsible 3-dot \"more\" menu, e.g.\n * `\"bold italic | heading >> link image | sourceView\"`. `\"none\"` hides the\n * toolbar entirely.\n */\nexport type ToolbarConfig = string;\n\n/** Pseudo-commands handled by the host chrome rather than the registry. */\nexport type UiCommandName =\n | 'openLink'\n | 'openImage'\n | 'openEmbed'\n | 'openBookmark'\n | 'toggleSource'\n | 'togglePastePlainText'\n | 'toggleFullscreen'\n | 'toggleShowBlocks'\n | 'openShortcutHelp'\n | 'openSpecialChars'\n | 'openEmoji'\n | 'openFind'\n | 'exportPdf'\n | 'exportWord'\n | 'exportInlineHtml'\n | 'importWord'\n | 'toggleFormatPainter'\n | 'openMergeField'\n | 'openTemplate'\n | 'openMath'\n | 'openMarkdown';\n\n/** Detail payload of the internal `wysiwyg-command` event (toolbar → host). */\nexport interface WysiwygCommandDetail {\n name: CommandName | UiCommandName;\n attrs?: CommandAttrs;\n}\n\n/** Mention configuration: trigger character → items. Same shape as the\n * legacy nile-rich-text-editor. */\nexport type MentionsConfig = Record<string, { key: string; label: string }[]>;\n\n/** Reusable content snippet, offered through the \"/\" menu. */\nexport interface SnippetConfig {\n key: string;\n label: string;\n html: string;\n}\n\n/** A mail-merge / personalization placeholder offered in the merge-field picker. */\nexport interface MergeFieldConfig {\n /** Stable identifier substituted at render time (e.g. `first_name`). */\n id: string;\n /** Human-readable label shown in the chip and picker. */\n label: string;\n}\n\n/** A predefined content structure offered in the template picker. */\nexport interface TemplateConfig {\n label: string;\n /** Optional secondary line shown under the label in the picker. */\n description?: string;\n /** HTML inserted at the cursor when chosen. */\n html: string;\n}\n\n/** Detail payload of `nile-change` / `nile-input`. */\nexport interface WysiwygChangeDetail {\n value: string;\n json: Record<string, unknown>;\n /** Alias of `value` for drop-in parity with nile-rich-text-editor. */\n content: string;\n}\n\nexport const DEFAULT_TOOLBAR =\n 'undo redo findReplace | heading | bold italic underline strike subscript superscript | fontFamily fontSize lineHeight | ' +\n 'textColor bgColor | alignLeft alignCenter alignRight alignJustify | ' +\n 'bulletList orderedList taskList listStyle indent outdent blockquote | ' +\n 'link bookmark table image embed codeBlock math horizontalRule specialChars emoji ' +\n '>> mergeField template | ' +\n 'formatPainter caseChange clearFormatting pastePlainText showBlocks sourceView | ' +\n 'importMarkdown importWord exportInlineHtml exportWord exportPdf | shortcutHelp fullscreen';\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/nile-wysiwyg-editor/types.ts"],"names":[],"mappings":"AA6EA,MAAM,CAAC,MAAM,eAAe,GAC1B,0HAA0H;IAC1H,sEAAsE;IACtE,wEAAwE;IACxE,mFAAmF;IACnF,2BAA2B;IAC3B,kFAAkF;IAClF,2FAA2F,CAAC;AAE9F,+EAA+E;AAC/E,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,KAAK;IACL,UAAU;IACV,cAAc;IACd,OAAO;IACP,MAAM;IACN,MAAM;IACN,YAAY;IACZ,OAAO;IACP,WAAW;IACX,QAAQ;CACA,CAAC;AAIX;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CACpC,KAAoD;IAEpD,IAAI,KAAK,IAAI,IAAI;QAAE,OAAO,EAAE,CAAC;IAC7B,IAAI,KAAK,GAAc,EAAE,CAAC;IAC1B,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,KAAK,GAAG,KAAK,CAAC;IAChB,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;QAClC,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACzB,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBAChC,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;YAC9C,CAAC;YAAC,MAAM,CAAC;gBACP,wCAAwC;gBACxC,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;YACzD,CAAC;QACH,CAAC;aAAM,CAAC;YACN,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAC/B,CAAC;IACH,CAAC;IACD,MAAM,KAAK,GAAG,IAAI,GAAG,CAAS,mBAAmB,CAAC,CAAC;IACnD,MAAM,GAAG,GAAuB,EAAE,CAAC;IACnC,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;QACtB,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACjE,IAAI,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAwB,CAAC,EAAE,CAAC;YAC/D,GAAG,CAAC,IAAI,CAAC,IAAwB,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["import type { CommandAttrs, CommandName } from './engine/commands';\n\n/**\n * Toolbar configuration. The string form uses space-separated item names with\n * `|` as a group divider, e.g. `\"bold italic | heading | link\"`. A `>>` marker\n * moves every item after it into a collapsible 3-dot \"more\" menu, e.g.\n * `\"bold italic | heading >> link image | sourceView\"`. `\"none\"` hides the\n * toolbar entirely.\n */\nexport type ToolbarConfig = string;\n\n/** Pseudo-commands handled by the host chrome rather than the registry. */\nexport type UiCommandName =\n | 'openLink'\n | 'openImage'\n | 'openEmbed'\n | 'openBookmark'\n | 'toggleSource'\n | 'togglePastePlainText'\n | 'toggleFullscreen'\n | 'toggleShowBlocks'\n | 'openShortcutHelp'\n | 'openSpecialChars'\n | 'openEmoji'\n | 'openFind'\n | 'exportPdf'\n | 'exportWord'\n | 'exportInlineHtml'\n | 'importWord'\n | 'toggleFormatPainter'\n | 'openMergeField'\n | 'openTemplate'\n | 'openMath'\n | 'openMarkdown';\n\n/** Detail payload of the internal `wysiwyg-command` event (toolbar → host). */\nexport interface WysiwygCommandDetail {\n name: CommandName | UiCommandName;\n attrs?: CommandAttrs;\n}\n\n/** Mention configuration: trigger character → items. Same shape as the\n * legacy nile-rich-text-editor. */\nexport type MentionsConfig = Record<string, { key: string; label: string }[]>;\n\n/** Reusable content snippet, offered through the \"/\" menu. */\nexport interface SnippetConfig {\n key: string;\n label: string;\n html: string;\n}\n\n/** A mail-merge / personalization placeholder offered in the merge-field picker. */\nexport interface MergeFieldConfig {\n /** Stable identifier substituted at render time (e.g. `first_name`). */\n id: string;\n /** Human-readable label shown in the chip and picker. */\n label: string;\n}\n\n/** A predefined content structure offered in the template picker. */\nexport interface TemplateConfig {\n label: string;\n /** Optional secondary line shown under the label in the picker. */\n description?: string;\n /** HTML inserted at the cursor when chosen. */\n html: string;\n}\n\n/** Detail payload of `nile-change` / `nile-input`. */\nexport interface WysiwygChangeDetail {\n value: string;\n json: Record<string, unknown>;\n /** Alias of `value` for drop-in parity with nile-rich-text-editor. */\n content: string;\n}\n\nexport const DEFAULT_TOOLBAR =\n 'undo redo findReplace | heading | bold italic underline strike subscript superscript | fontFamily fontSize lineHeight | ' +\n 'textColor bgColor | alignLeft alignCenter alignRight alignJustify | ' +\n 'bulletList orderedList taskList listStyle indent outdent blockquote | ' +\n 'link bookmark table image embed codeBlock math horizontalRule specialChars emoji ' +\n '>> mergeField template | ' +\n 'formatPainter caseChange clearFormatting pastePlainText showBlocks sourceView | ' +\n 'importMarkdown importWord exportInlineHtml exportWord exportPdf | shortcutHelp fullscreen';\n\n/** Content components that `no-theme-components` can keep on light colours. */\nexport const NO_THEME_COMPONENTS = [\n 'all',\n 'mentions',\n 'merge-fields',\n 'links',\n 'math',\n 'code',\n 'blockquote',\n 'table',\n 'task-list',\n 'images',\n] as const;\n\nexport type NoThemeComponent = (typeof NO_THEME_COMPONENTS)[number];\n\n/**\n * Normalises a `no-theme-components` value: a JSON array, or a comma/space\n * separated list, or an unquoted `[a, b]`. Lower-cases, de-duplicates and drops unknown names.\n */\nexport function parseNoThemeComponents(\n value: string | readonly string[] | null | undefined\n): NoThemeComponent[] {\n if (value == null) return [];\n let names: unknown[] = [];\n if (Array.isArray(value)) {\n names = value;\n } else {\n const text = String(value).trim();\n if (text.startsWith('[')) {\n try {\n const parsed = JSON.parse(text);\n names = Array.isArray(parsed) ? parsed : [];\n } catch {\n // Unquoted form, e.g. [mentions, table]\n names = text.replace(/^\\[|\\]$/g, '').split(/[\\s,'\"]+/);\n }\n } else {\n names = text.split(/[\\s,]+/);\n }\n }\n const known = new Set<string>(NO_THEME_COMPONENTS);\n const out: NoThemeComponent[] = [];\n for (const n of names) {\n const name = typeof n === 'string' ? n.trim().toLowerCase() : '';\n if (known.has(name) && !out.includes(name as NoThemeComponent)) {\n out.push(name as NoThemeComponent);\n }\n }\n return out;\n}\n"]}
@@ -12,7 +12,7 @@
12
12
  // @aquera/nile/lib/version.js into dist/index.js, so on the CDN build it is
13
13
  // frozen at this package's build time. The stylesheet is the live source.
14
14
  import { NILE_VERSION as BUILT_IN_NILE_VERSION } from '@aquera/nile/lib/version.js';
15
- export const NILE_ELEMENTS_VERSION = '2.0.21';
15
+ export const NILE_ELEMENTS_VERSION = '2.0.22';
16
16
  function readStylesheetNileVersion() {
17
17
  if (typeof window === 'undefined' || typeof getComputedStyle !== 'function') {
18
18
  return null;
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,mBAAmB;AACnB,EAAE;AACF,+EAA+E;AAC/E,gDAAgD;AAChD,EAAE;AACF,8EAA8E;AAC9E,6EAA6E;AAC7E,qEAAqE;AACrE,EAAE;AACF,0EAA0E;AAC1E,kEAAkE;AAClE,4EAA4E;AAC5E,0EAA0E;AAC1E,OAAO,EAAE,YAAY,IAAI,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEpF,MAAM,CAAC,MAAM,qBAAqB,GAAG,2BAA2B,CAAC;AAEjE,SAAS,yBAAyB;IAChC,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,gBAAgB,KAAK,UAAU,EAAE,CAAC;QAC5E,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,gBAAgB,CAAC,QAAQ,CAAC,eAAe,CAAC;aACrD,gBAAgB,CAAC,gBAAgB,CAAC;aAClC,IAAI,EAAE;aACN,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;QAE/B,OAAO,KAAK,IAAI,IAAI,CAAC;IACvB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO,yBAAyB,EAAE,IAAI,qBAAqB,CAAC;AAC9D,CAAC;AAED,yCAAyC;AACzC,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;IACjC,MAAc,CAAC,mBAAmB,GAAG,qBAAqB,CAAC;IAE5D,yEAAyE;IACzE,yEAAyE;IACzE,IAAI,QAAQ,GAAkB,IAAI,CAAC;IACnC,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,aAAa,EAAE;QAC3C,YAAY,EAAE,IAAI;QAClB,GAAG,EAAE,GAAG,EAAE,CAAC,QAAQ,IAAI,cAAc,EAAE;QACvC,GAAG,EAAE,CAAC,KAAa,EAAE,EAAE;YACrB,QAAQ,GAAG,KAAK,CAAC;QACnB,CAAC;KACF,CAAC,CAAC;IAEF,MAAc,CAAC,OAAO,GAAI,MAAc,CAAC,OAAO,IAAI;QACnD,GAAG,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE;KAChC,CAAC;AACJ,CAAC","sourcesContent":["// Version utility.\n//\n// NILE_ELEMENTS_VERSION is this package's own version and is still substituted\n// at build time by scripts/replace-version.cjs.\n//\n// The tokens version is read from the loaded Nile stylesheet's --nile-version\n// custom property (stamped by @aquera/nile's scripts/stamp-css-version.mjs),\n// falling back to the @aquera/nile installed alongside this package.\n//\n// Reading the stylesheet is what makes a tokens-only release visible. The\n// imported constant alone is not enough: rollup.config.js bundles\n// @aquera/nile/lib/version.js into dist/index.js, so on the CDN build it is\n// frozen at this package's build time. The stylesheet is the live source.\nimport { NILE_VERSION as BUILT_IN_NILE_VERSION } from '@aquera/nile/lib/version.js';\n\nexport const NILE_ELEMENTS_VERSION = '2.0.21';\n\nfunction readStylesheetNileVersion(): string | null {\n if (typeof window === 'undefined' || typeof getComputedStyle !== 'function') {\n return null;\n }\n\n try {\n const value = getComputedStyle(document.documentElement)\n .getPropertyValue('--nile-version')\n .trim()\n .replace(/^[\"']|[\"']$/g, '');\n\n return value || null;\n } catch {\n return null;\n }\n}\n\n/**\n * The version of @aquera/nile (tokens/stylesheets) whose CSS is loaded in the\n * page, falling back to the @aquera/nile bundled into this package when no\n * stamped stylesheet is present.\n *\n * This is the canonical runtime API. It resolves on every call rather than\n * caching, so it is correct even when the Nile stylesheet is added to the page\n * after this module evaluates - which is the common case, and why no\n * module-evaluation-time snapshot of it is exported.\n */\nexport function getNileVersion(): string {\n return readStylesheetNileVersion() ?? BUILT_IN_NILE_VERSION;\n}\n\n// Set global versions for runtime access\nif (typeof window !== 'undefined') {\n (window as any).nileElementsVersion = NILE_ELEMENTS_VERSION;\n\n // A getter rather than a value, so window.nileVersion reflects whichever\n // stylesheet is loaded at read time regardless of script/style ordering.\n let override: string | null = null;\n Object.defineProperty(window, 'nileVersion', {\n configurable: true,\n get: () => override ?? getNileVersion(),\n set: (value: string) => {\n override = value;\n },\n });\n\n (window as any).process = (window as any).process || {\n env: { NODE_ENV: 'production' },\n };\n}\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,mBAAmB;AACnB,EAAE;AACF,+EAA+E;AAC/E,gDAAgD;AAChD,EAAE;AACF,8EAA8E;AAC9E,6EAA6E;AAC7E,qEAAqE;AACrE,EAAE;AACF,0EAA0E;AAC1E,kEAAkE;AAClE,4EAA4E;AAC5E,0EAA0E;AAC1E,OAAO,EAAE,YAAY,IAAI,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEpF,MAAM,CAAC,MAAM,qBAAqB,GAAG,2BAA2B,CAAC;AAEjE,SAAS,yBAAyB;IAChC,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,gBAAgB,KAAK,UAAU,EAAE,CAAC;QAC5E,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,gBAAgB,CAAC,QAAQ,CAAC,eAAe,CAAC;aACrD,gBAAgB,CAAC,gBAAgB,CAAC;aAClC,IAAI,EAAE;aACN,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;QAE/B,OAAO,KAAK,IAAI,IAAI,CAAC;IACvB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO,yBAAyB,EAAE,IAAI,qBAAqB,CAAC;AAC9D,CAAC;AAED,yCAAyC;AACzC,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;IACjC,MAAc,CAAC,mBAAmB,GAAG,qBAAqB,CAAC;IAE5D,yEAAyE;IACzE,yEAAyE;IACzE,IAAI,QAAQ,GAAkB,IAAI,CAAC;IACnC,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,aAAa,EAAE;QAC3C,YAAY,EAAE,IAAI;QAClB,GAAG,EAAE,GAAG,EAAE,CAAC,QAAQ,IAAI,cAAc,EAAE;QACvC,GAAG,EAAE,CAAC,KAAa,EAAE,EAAE;YACrB,QAAQ,GAAG,KAAK,CAAC;QACnB,CAAC;KACF,CAAC,CAAC;IAEF,MAAc,CAAC,OAAO,GAAI,MAAc,CAAC,OAAO,IAAI;QACnD,GAAG,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE;KAChC,CAAC;AACJ,CAAC","sourcesContent":["// Version utility.\n//\n// NILE_ELEMENTS_VERSION is this package's own version and is still substituted\n// at build time by scripts/replace-version.cjs.\n//\n// The tokens version is read from the loaded Nile stylesheet's --nile-version\n// custom property (stamped by @aquera/nile's scripts/stamp-css-version.mjs),\n// falling back to the @aquera/nile installed alongside this package.\n//\n// Reading the stylesheet is what makes a tokens-only release visible. The\n// imported constant alone is not enough: rollup.config.js bundles\n// @aquera/nile/lib/version.js into dist/index.js, so on the CDN build it is\n// frozen at this package's build time. The stylesheet is the live source.\nimport { NILE_VERSION as BUILT_IN_NILE_VERSION } from '@aquera/nile/lib/version.js';\n\nexport const NILE_ELEMENTS_VERSION = '2.0.22';\n\nfunction readStylesheetNileVersion(): string | null {\n if (typeof window === 'undefined' || typeof getComputedStyle !== 'function') {\n return null;\n }\n\n try {\n const value = getComputedStyle(document.documentElement)\n .getPropertyValue('--nile-version')\n .trim()\n .replace(/^[\"']|[\"']$/g, '');\n\n return value || null;\n } catch {\n return null;\n }\n}\n\n/**\n * The version of @aquera/nile (tokens/stylesheets) whose CSS is loaded in the\n * page, falling back to the @aquera/nile bundled into this package when no\n * stamped stylesheet is present.\n *\n * This is the canonical runtime API. It resolves on every call rather than\n * caching, so it is correct even when the Nile stylesheet is added to the page\n * after this module evaluates - which is the common case, and why no\n * module-evaluation-time snapshot of it is exported.\n */\nexport function getNileVersion(): string {\n return readStylesheetNileVersion() ?? BUILT_IN_NILE_VERSION;\n}\n\n// Set global versions for runtime access\nif (typeof window !== 'undefined') {\n (window as any).nileElementsVersion = NILE_ELEMENTS_VERSION;\n\n // A getter rather than a value, so window.nileVersion reflects whichever\n // stylesheet is loaded at read time regardless of script/style ordering.\n let override: string | null = null;\n Object.defineProperty(window, 'nileVersion', {\n configurable: true,\n get: () => override ?? getNileVersion(),\n set: (value: string) => {\n override = value;\n },\n });\n\n (window as any).process = (window as any).process || {\n env: { NODE_ENV: 'production' },\n };\n}\n"]}