@wix/web5-core 1.63.45 → 1.63.46

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.
@@ -1 +1 @@
1
- {"version":3,"names":["isHslTriplet","THEME_OVERRIDE_KEY_PATTERN","THEME_TOKEN_CONTRACT","SCHEME_COLOR_TOKENS","Object","freeze","Set","entries","filter","_ref","entry","type","map","_ref2","token","SCHEME_COLOR_VALUE","SCHEME_RADIUS_VALUE","SCHEME_LOOSE_VALUE","MAX_SCHEME_VALUE_LENGTH","SCHEME_ANCHOR_TOKENS","MAX_THEME_SCHEMES","SCHEME_ID_PATTERN","MAX_SCHEME_NAME_LENGTH","isPlainObject","value","Array","isArray","isThemeScheme","id","name","origin","tokens","test","undefined","length","values","every","v","resolveActiveScheme","cfg","themeSchemes","schemes","activeId","activeThemeSchemeId","active","find","scheme","TRIPLET","tripletToRgb","triplet","parts","exec","trim","h","Number","s","l","c","Math","abs","x","m","r","g","b","mix","fg","ratio","bg","round","toTriplet","_ref3","rn","gn","bn","max","min","delta","INHERITED_TOKENS","completeScheme","base","anchors","valid","isSchemeColorValue","fromBase","fromAnchor","out","put","background","foreground","bgChanged","fgChanged","derive","inputsChanged","compute","kept","mixOver","over","primaryTriplet","primary","has","isSchemeTokenEntry","schemeDisplayName","index","nextOwnerSchemeId","taken","n","key","_THEME_TOKEN_CONTRACT"],"sources":["../../../src/theme/themeScheme.ts"],"sourcesContent":["/**\n * Named theme schemes on a site configuration, and the one that is active.\n *\n * A store's theme states a SET of palettes rather than one — Dawn and Horizon\n * ship `scheme-1`..`scheme-5` for the page, the cards, the hero band, the\n * footer. The configuration therefore carries a list of schemes plus the id of\n * the active one, beside the flat `themeOverrides` map it has always had:\n *\n * themeSchemes?: [{ id, name?, origin?, tokens: { '--background': '0 0% 100%', … } }]\n * activeThemeSchemeId?: 'scheme-1'\n *\n * A scheme's `tokens` are finished CSS tokens, spelled exactly as\n * `themeOverrides` spells them — and, like `themeOverrides`, the key set is\n * OPEN. Today's writers put the 18 colour roles (`SCHEME_COLOR_TOKENS`) there,\n * sometimes `--radius`; that a palette may carry shape as well as colour is why\n * this is a THEME scheme and not a colour scheme. A new token (a font stack,\n * something the contract has not catalogued yet) needs no release anywhere but\n * its writer. The server checks only the loose shape `themeOverrides` gets (key\n * `THEME_OVERRIDE_KEY_PATTERN`, a value free of `;`, `{`, `}` and control\n * characters, ≤ 256, at most 24 entries); the typed per-token grammar is the\n * CLIENT's contract, enforced by `isSchemeTokenEntry` before the panel writes.\n * Nothing is expanded at apply time: the reader resolves the active entry and\n * hands its map to `applyThemeOverrides`, which layers it between the store map\n * and the owner's overrides, filtered and bucketed exactly like the store map.\n * A configuration with no schemes renders exactly as it did before they existed.\n *\n * A leaf module beside `tokenContract.ts`, and for the same reason that file\n * documents: requiring core's ENTRY from plain Node fails on its CSS import,\n * but a deep import of a zero-CSS leaf works. It imports only its siblings\n * `./tokenContract` and `./colorFormat`, both leaves themselves.\n *\n * ## `completeScheme` — what the owner panel recomputes\n *\n * The owner edits the four anchors. The rest of the palette has to move with\n * them the way `web50-shopify-adapter/src/theme-tokens.ts` would have moved it\n * had the theme stated those anchors, so the arithmetic below is a COPY of the\n * adapter's (`composite`/`mix`/`toTriplet` and the token assignments at the end\n * of `extractThemeOverrides`), integer rounding included. It is copied rather\n * than shared on purpose: the adapter must not import core.\n *\n * | token | role |\n * | ------------------------ | ------------------------------------------------------ |\n * | `--background` | anchor (else inherited from base) |\n * | `--foreground` | anchor (else inherited from base) |\n * | `--card` | anchor; when not given, derived: foreground 4% over background |\n * | `--card-foreground` | anchor; when not given, derived: = foreground |\n * | `--popover` | derived: = background |\n * | `--popover-foreground` | derived: = foreground |\n * | `--muted` | derived: foreground 4% over background |\n * | `--muted-foreground` | derived: foreground 60% over background |\n * | `--secondary` | derived: primary 10% over background |\n * | `--accent` | derived: primary 10% over background |\n * | `--primary` | inherited from base (the theme's button colour) |\n * | `--primary-foreground` | inherited from base (the theme's button label) |\n * | `--secondary-foreground` | inherited from base (the theme's outline-button label) |\n * | `--accent-foreground` | inherited from base; fallback = primary |\n * | `--ring` | inherited from base; fallback = primary |\n * | `--border` | inherited from base (no fallback — see below) |\n * | `--input` | inherited from base (no fallback — see below) |\n * | `--heading` | inherited from base (no adapter fills it) |\n * | any non-colour key | `--radius`, fonts, unknown: copied from base when valid |\n *\n * \"Inherited\" tokens are ones the adapter reads straight off the theme, which\n * no arithmetic over the anchors can recover. Where base lacks one, the\n * adapter's own fallback applies: `--ring` and `--accent-foreground` are the\n * primary colour. `--border`/`--input` have none — the adapter reconstructs a\n * missing border from the theme's `*_border_opacity` setting, which a token map\n * does not carry — so they are omitted, as the adapter omits them.\n *\n * ## Rounding: why an unchanged input keeps base's value\n *\n * The adapter mixes 8-bit channels parsed from the theme's hex; a scheme only\n * has the integer-rounded triplet, and the hex cannot be recovered from it.\n * Re-deriving from triplets therefore lands a point off now and then — Horizon\n * `color_palette`'s `--muted-foreground` comes back `359 83% 68%` against the\n * adapter's `359 84% 68%`. So a derived token is recomputed only when one of\n * its INPUTS differs from base; otherwise base's value stands. A merchant who\n * edits nothing gets the adapter's map back exactly, and one who edits the\n * background gets the family recomputed.\n *\n * When it is recomputed, triplets convert back to RGB WITHOUT rounding to\n * 8-bit first — that would be a second quantisation the adapter never\n * performs, and enough to move smallflower's `--secondary` from `230 38% 94%`\n * to `230 42% 94%`. The mix result is rounded exactly where the adapter\n * rounds it.\n */\nimport { isHslTriplet } from './colorFormat';\nimport {\n THEME_OVERRIDE_KEY_PATTERN,\n THEME_TOKEN_CONTRACT,\n} from './tokenContract';\n\n/** Where a scheme came from. Any other value on the wire reads as unknown. */\nexport type SchemeOrigin = 'UNKNOWN_SCHEME_ORIGIN' | 'THEME' | 'OWNER';\n\n/** One named palette as the configuration carries it. */\nexport interface ThemeScheme {\n /** `^[a-z0-9][a-z0-9-]{0,31}$`, unique within the list. */\n id: string;\n /** Shown in the owner panel; at most 48 characters. */\n name?: string;\n origin?: SchemeOrigin | string;\n /**\n * Token → value, keys as open as `themeOverrides`': colours as bare HSL\n * triplets (`0 0% 100%`), `--radius` as a length (`0.5rem`), anything else\n * in the loose value shape. See `isSchemeTokenEntry`.\n */\n tokens: Record<string, string>;\n}\n\n/** Every colour role in the contract (`type: 'color-hsl'`, `--heading` included). */\nexport const SCHEME_COLOR_TOKENS: ReadonlySet<string> = Object.freeze(\n new Set(\n Object.entries(THEME_TOKEN_CONTRACT)\n .filter(([, entry]) => entry.type === 'color-hsl')\n .map(([token]) => token),\n ),\n) as ReadonlySet<string>;\n\n/**\n * A scheme colour (`type: 'color-hsl'`): `H S% L%`, single-spaced, no `hsl()`\n * wrapper. Saturation and lightness are additionally capped at 100\n * (`isSchemeColorValue`); hue is bounded only by its three digits.\n */\nconst SCHEME_COLOR_VALUE =\n /^(\\d{1,3}(?:\\.\\d+)?) (\\d{1,3}(?:\\.\\d+)?)% (\\d{1,3}(?:\\.\\d+)?)%$/;\n\n/**\n * A scheme length (`type: 'length'`, i.e. `--radius`): px/rem/em, unit REQUIRED\n * (`0px`, not `0`). A bare `0` would turn `calc(var(--radius) - 4px)` into\n * invalid CSS — see the `length` note in `tokenContract.ts`.\n */\nconst SCHEME_RADIUS_VALUE = /^\\d{1,4}(?:\\.\\d+)?(?:px|rem|em)$/;\n\n/**\n * Any other scheme value — a font stack, a key the contract has not catalogued:\n * no `;`, `{`, `}` or control character. The server's `themeOverrides` value\n * shape (`^[^;{}\\p{Cntrl}]{1,256}$`); the length is checked separately in\n * UTF-16 units, as the server counts, since a `u`-flag quantifier counts code\n * points.\n */\nconst SCHEME_LOOSE_VALUE = /^[^;{}\\p{Cc}]+$/u;\nconst MAX_SCHEME_VALUE_LENGTH = 256;\n\n/** The four the owner edits, in panel order. Equal to the contract's editable colour tokens. */\nexport const SCHEME_ANCHOR_TOKENS = [\n '--background',\n '--foreground',\n '--card',\n '--card-foreground',\n] as const;\n\nexport type SchemeAnchorToken = (typeof SCHEME_ANCHOR_TOKENS)[number];\n\n/** Upper bound on schemes per configuration. */\nexport const MAX_THEME_SCHEMES = 16;\n\nconst SCHEME_ID_PATTERN = /^[a-z0-9][a-z0-9-]{0,31}$/;\nconst MAX_SCHEME_NAME_LENGTH = 48;\n\nconst isPlainObject = (value: unknown): value is Record<string, unknown> =>\n typeof value === 'object' && value !== null && !Array.isArray(value);\n\n/**\n * Whether an untrusted value has a scheme's SHAPE.\n *\n * Token content is deliberately not judged here: `applyThemeOverrides` drops a\n * malformed key one entry at a time, exactly as it does for the flat store map\n * (and says so), so one bad token costs that token rather than the whole\n * palette. The typed value grammar is `isSchemeTokenEntry`, checked by writers.\n */\nexport function isThemeScheme(value: unknown): value is ThemeScheme {\n if (!isPlainObject(value)) {\n return false;\n }\n const { id, name, origin, tokens } = value;\n if (typeof id !== 'string' || !SCHEME_ID_PATTERN.test(id)) {\n return false;\n }\n if (\n name !== undefined &&\n (typeof name !== 'string' || name.length > MAX_SCHEME_NAME_LENGTH)\n ) {\n return false;\n }\n if (origin !== undefined && typeof origin !== 'string') {\n return false;\n }\n return (\n isPlainObject(tokens) &&\n Object.values(tokens).every((v) => typeof v === 'string')\n );\n}\n\n/**\n * The active scheme: the entry whose id is `activeThemeSchemeId`, else the\n * first entry, else null. Entries failing `isThemeScheme` are skipped first, so\n * a dangling id or a malformed entry falls through to the first usable one.\n */\nexport function resolveActiveScheme(\n cfg:\n | { themeSchemes?: unknown; activeThemeSchemeId?: string | null }\n | null\n | undefined,\n): ThemeScheme | null {\n if (!cfg || !Array.isArray(cfg.themeSchemes)) {\n return null;\n }\n const schemes = cfg.themeSchemes.filter(isThemeScheme);\n if (schemes.length === 0) {\n return null;\n }\n const activeId = cfg.activeThemeSchemeId;\n const active =\n typeof activeId === 'string'\n ? schemes.find((scheme) => scheme.id === activeId)\n : undefined;\n return active ?? schemes[0];\n}\n\n// ── Arithmetic copied from web50-shopify-adapter/src/theme-tokens.ts ────────\n\ninterface Rgb {\n r: number;\n g: number;\n b: number;\n}\n\nconst TRIPLET = /^(\\d{1,3}(?:\\.\\d+)?)\\s+(\\d{1,3}(?:\\.\\d+)?)%\\s+(\\d{1,3}(?:\\.\\d+)?)%$/;\n\n/**\n * A triplet as RGB in 0–255, NOT rounded to 8-bit — see the module header for\n * why. Same conversion as `colorFormat.hslTripletToHex`, minus its rounding.\n */\nfunction tripletToRgb(triplet: string): Rgb | null {\n const parts = TRIPLET.exec(triplet.trim());\n if (!parts || !isHslTriplet(triplet)) {\n return null;\n }\n const h = Number(parts[1]);\n const s = Number(parts[2]) / 100;\n const l = Number(parts[3]) / 100;\n\n const c = (1 - Math.abs(2 * l - 1)) * s;\n const x = c * (1 - Math.abs(((h / 60) % 2) - 1));\n const m = l - c / 2;\n const [r, g, b] =\n h < 60\n ? [c, x, 0]\n : h < 120\n ? [x, c, 0]\n : h < 180\n ? [0, c, x]\n : h < 240\n ? [0, x, c]\n : h < 300\n ? [x, 0, c]\n : [c, 0, x];\n return { r: (r + m) * 255, g: (g + m) * 255, b: (b + m) * 255 };\n}\n\n/** Adapter `composite` for an opaque-over-opaque mix, via its `mix`: channels rounded to 8-bit. */\nfunction mix(fg: Rgb, ratio: number, bg: Rgb): Rgb {\n return {\n r: Math.round(fg.r * ratio + bg.r * (1 - ratio)),\n g: Math.round(fg.g * ratio + bg.g * (1 - ratio)),\n b: Math.round(fg.b * ratio + bg.b * (1 - ratio)),\n };\n}\n\n/** Adapter `toTriplet`: `\"H S% L%\"`, integer-rounded. */\nfunction toTriplet({ r, g, b }: Rgb): string {\n const rn = r / 255;\n const gn = g / 255;\n const bn = b / 255;\n const max = Math.max(rn, gn, bn);\n const min = Math.min(rn, gn, bn);\n const l = (max + min) / 2;\n const delta = max - min;\n\n let h = 0;\n let s = 0;\n if (delta !== 0) {\n s = l > 0.5 ? delta / (2 - max - min) : delta / (max + min);\n if (max === rn) {\n h = (gn - bn) / delta + (gn < bn ? 6 : 0);\n } else if (max === gn) {\n h = (bn - rn) / delta + 2;\n } else {\n h = (rn - gn) / delta + 4;\n }\n h *= 60;\n }\n return `${Math.round(h)} ${Math.round(s * 100)}% ${Math.round(l * 100)}%`;\n}\n\n/** Tokens the adapter reads off the theme rather than computing from the anchors. */\nconst INHERITED_TOKENS = [\n '--primary',\n '--primary-foreground',\n '--secondary-foreground',\n '--accent-foreground',\n '--ring',\n '--border',\n '--input',\n '--heading',\n] as const;\n\n/**\n * A full colour-token map for a palette whose anchors the owner just edited.\n *\n * `anchors` win; everything the adapter derives from them is recomputed when\n * one of its inputs changed (and kept from `base` when none did — see \"Rounding\"\n * in the module header); everything it reads directly is taken from `base`.\n * Invalid triplets in either input are ignored, and a derived token whose\n * inputs are unavailable keeps `base`'s value, if any.\n *\n * Returns the whole scheme map, not only its colours: every non-colour entry of\n * `base` that passes `isSchemeTokenEntry` — `--radius`, a font stack, a token\n * this module does not know — is copied as is, so customizing a palette keeps\n * everything it states beyond colour. Every output entry passes\n * `isSchemeTokenEntry`.\n */\nexport function completeScheme(\n base: Record<string, string>,\n anchors: Partial<Record<SchemeAnchorToken, string>>,\n): Record<string, string> {\n // Both checks: `isHslTriplet` is what the arithmetic can convert, and the\n // scheme grammar is what a write accepts — failing either would poison a\n // derivation or get the whole save refused.\n const valid = (value: unknown): string | undefined =>\n typeof value === 'string' &&\n isHslTriplet(value) &&\n isSchemeColorValue(value.trim())\n ? value.trim()\n : undefined;\n const fromBase = (token: string): string | undefined => valid(base[token]);\n const fromAnchor = (token: SchemeAnchorToken): string | undefined =>\n valid(anchors[token]);\n\n const out: Record<string, string> = {};\n const put = (token: string, value: string | undefined): void => {\n if (value !== undefined) {\n out[token] = value;\n }\n };\n\n const background = fromAnchor('--background') ?? fromBase('--background');\n const foreground = fromAnchor('--foreground') ?? fromBase('--foreground');\n const bgChanged = background !== fromBase('--background');\n const fgChanged = foreground !== fromBase('--foreground');\n const bg = background === undefined ? null : tripletToRgb(background);\n const fg = foreground === undefined ? null : tripletToRgb(foreground);\n\n /** base's value while the inputs are unchanged, else the recomputation (else base's). */\n const derive = (\n token: string,\n inputsChanged: boolean,\n compute: () => string | undefined,\n ): string | undefined => {\n const kept = fromBase(token);\n return !inputsChanged && kept !== undefined ? kept : compute() ?? kept;\n };\n const mixOver = (over: Rgb | null, ratio: number) => (): string | undefined =>\n over !== null && bg !== null ? toTriplet(mix(over, ratio, bg)) : undefined;\n\n put('--background', background);\n put('--foreground', foreground);\n put(\n '--card',\n fromAnchor('--card') ??\n derive('--card', bgChanged || fgChanged, mixOver(fg, 0.04)),\n );\n put(\n '--card-foreground',\n fromAnchor('--card-foreground') ??\n derive('--card-foreground', fgChanged, () => foreground),\n );\n put('--popover', derive('--popover', bgChanged, () => background));\n put(\n '--popover-foreground',\n derive('--popover-foreground', fgChanged, () => foreground),\n );\n put('--muted', derive('--muted', bgChanged || fgChanged, mixOver(fg, 0.04)));\n put(\n '--muted-foreground',\n derive('--muted-foreground', bgChanged || fgChanged, mixOver(fg, 0.6)),\n );\n\n for (const token of INHERITED_TOKENS) {\n put(token, fromBase(token));\n }\n // Primary is inherited, so of the button family's inputs only the page can change.\n const primaryTriplet = out['--primary'];\n const primary =\n primaryTriplet === undefined ? null : tripletToRgb(primaryTriplet);\n put('--ring', out['--ring'] ?? primaryTriplet);\n put('--accent-foreground', out['--accent-foreground'] ?? primaryTriplet);\n put('--secondary', derive('--secondary', bgChanged, mixOver(primary, 0.1)));\n put('--accent', derive('--accent', bgChanged, mixOver(primary, 0.1)));\n\n // Not colours, so no arithmetic touches them: the palette keeps its shape,\n // its type, and any token a writer added that this module has never heard of.\n for (const [token, value] of Object.entries(base)) {\n if (!SCHEME_COLOR_TOKENS.has(token) && isSchemeTokenEntry(token, value)) {\n out[token] = value;\n }\n }\n\n return out;\n}\n\n/** The label the panel shows: the trimmed name, else `Palette N` (1-based). */\nexport function schemeDisplayName(scheme: ThemeScheme, index: number): string {\n const name = typeof scheme.name === 'string' ? scheme.name.trim() : '';\n return name !== '' ? name : `Palette ${index + 1}`;\n}\n\n/** `owner-N` with the smallest N ≥ 1 not already taken. */\nexport function nextOwnerSchemeId(schemes: readonly { id: string }[]): string {\n const taken = new Set(schemes.map((scheme) => scheme.id));\n let n = 1;\n while (taken.has(`owner-${n}`)) {\n n += 1;\n }\n return `owner-${n}`;\n}\n\n/** A colour value a scheme may hold: `SCHEME_COLOR_VALUE`, with S and L ≤ 100. */\nfunction isSchemeColorValue(value: string): boolean {\n const parts = SCHEME_COLOR_VALUE.exec(value);\n return parts !== null && Number(parts[2]) <= 100 && Number(parts[3]) <= 100;\n}\n\n/**\n * Whether a key/value pair may be written as a scheme token — the CLIENT's\n * contract, checked before the panel writes and by `completeScheme`.\n *\n * There is no allow-list: any key of the `themeOverrides` shape\n * (`THEME_OVERRIDE_KEY_PATTERN`) is a candidate. The value grammar follows the\n * key's contract type: `color-hsl` → an HSL triplet with S and L ≤ 100;\n * `length` → a px/rem/em length with its unit; anything else (font stacks,\n * keys the contract does not know) → the loose `themeOverrides` value shape.\n *\n * The server enforces only that loose shape for every key, so a `0 101% 50%`\n * colour or a unitless radius would be ACCEPTED there — and render wrong. That\n * is why the panel refuses them here. The renderer does not re-check values.\n */\nexport function isSchemeTokenEntry(key: string, value: unknown): boolean {\n if (typeof value !== 'string' || !THEME_OVERRIDE_KEY_PATTERN.test(key)) {\n return false;\n }\n switch (THEME_TOKEN_CONTRACT[key]?.type) {\n case 'color-hsl':\n return isSchemeColorValue(value);\n case 'length':\n return SCHEME_RADIUS_VALUE.test(value);\n default:\n return (\n value.length <= MAX_SCHEME_VALUE_LENGTH &&\n SCHEME_LOOSE_VALUE.test(value)\n );\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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C;EAEpC;AACF","ignoreList":[]}
1
+ {"version":3,"names":["isHslTriplet","THEME_OVERRIDE_KEY_PATTERN","THEME_TOKEN_CONTRACT","SCHEME_COLOR_TOKENS","Object","freeze","Set","entries","filter","_ref","entry","type","map","_ref2","token","SCHEME_COLOR_VALUE","SCHEME_RADIUS_VALUE","SCHEME_LOOSE_VALUE","MAX_SCHEME_VALUE_LENGTH","SCHEME_TOKENS","SCHEME_TOKEN_SET","schemeTokensOf","fromEntries","_ref3","has","SCHEME_ANCHOR_TOKENS","MAX_THEME_SCHEMES","SCHEME_ID_PATTERN","MAX_SCHEME_NAME_LENGTH","isPlainObject","value","Array","isArray","isThemeScheme","id","name","origin","baseSchemeId","tokens","test","undefined","length","values","every","v","resolveActiveScheme","cfg","themeSchemes","schemes","activeId","activeThemeSchemeId","active","find","scheme","TRIPLET","tripletToRgb","triplet","parts","exec","trim","h","Number","s","l","c","Math","abs","x","m","r","g","b","mix","fg","ratio","bg","round","toTriplet","_ref4","rn","gn","bn","max","min","delta","completeScheme","base","anchors","context","valid","isSchemeColorValue","fromBase","fromAnchor","out","put","background","foreground","bgChanged","fgChanged","derive","inputsChanged","compute","kept","mixOver","over","basePrimary","primaryTriplet","primary","primaryChanged","tintChanged","schemeDisplayName","index","nextOwnerSchemeId","taken","n","isSchemeTokenEntry","key","_THEME_TOKEN_CONTRACT"],"sources":["../../../src/theme/themeScheme.ts"],"sourcesContent":["/**\n * Named theme schemes on a site configuration, and the one that is active.\n *\n * A store's theme states a SET of palettes rather than one — Dawn and Horizon\n * ship `scheme-1`..`scheme-5` for the page, the cards, the hero band, the\n * footer. The configuration therefore carries a list of schemes plus the id of\n * the active one, beside the flat `themeOverrides` map it has always had:\n *\n * themeSchemes?: [{ id, name?, origin?, tokens: { '--background': '0 0% 100%', … } }]\n * activeThemeSchemeId?: 'scheme-1'\n *\n * A scheme's `tokens` are finished CSS tokens, spelled exactly as\n * `themeOverrides` spells them — and, like `themeOverrides`, the key set is\n * OPEN. Today's writers put the 18 colour roles (`SCHEME_COLOR_TOKENS`) there,\n * sometimes `--radius`; that a palette may carry shape as well as colour is why\n * this is a THEME scheme and not a colour scheme. A new token (a font stack,\n * something the contract has not catalogued yet) needs no release anywhere but\n * its writer. The server checks only the loose shape `themeOverrides` gets (key\n * `THEME_OVERRIDE_KEY_PATTERN`, a value free of `;`, `{`, `}` and control\n * characters, ≤ 256, at most 24 entries); the typed per-token grammar is the\n * CLIENT's contract, enforced by `isSchemeTokenEntry` before the panel writes.\n * Nothing is expanded at apply time: the reader resolves the active entry and\n * hands its map to `applyThemeOverrides`, which layers it between the store map\n * and the owner's overrides, filtered and bucketed exactly like the store map.\n * A configuration with no schemes renders exactly as it did before they existed.\n *\n * A leaf module beside `tokenContract.ts`, and for the same reason that file\n * documents: requiring core's ENTRY from plain Node fails on its CSS import,\n * but a deep import of a zero-CSS leaf works. It imports only its siblings\n * `./tokenContract` and `./colorFormat`, both leaves themselves.\n *\n * ## What a scheme carries (ADR 0243)\n *\n * A theme scheme is a background and its text, plus the colours mechanically\n * derived from those two: `SCHEME_TOKENS`. Card colours, button colours,\n * radius and fonts are the store's global set (`themeOverrides`) and the\n * owner's global edits (`userThemeOverrides`), applied under and over the\n * scheme respectively — so they survive every scheme switch. Rows written\n * before 0243 may still carry more; readers apply whatever a row holds, and\n * the owner panel writes only `SCHEME_TOKENS` into the rows it creates.\n *\n * An edited THEME scheme is an OWNER row that names it in `baseSchemeId`, so\n * the panel can show the edit on that scheme's tile and revert only that one.\n *\n * ## `completeScheme` — what the owner panel recomputes\n *\n * The owner edits the two anchors. The rest of the scheme has to move with\n * them the way `web50-shopify-adapter/src/theme-tokens.ts` would have moved it\n * had the theme stated those anchors, so the arithmetic below is a COPY of the\n * adapter's (`composite`/`mix`/`toTriplet` and the token assignments at the end\n * of `extractThemeOverrides`), integer rounding included. It is copied rather\n * than shared on purpose: the adapter must not import core.\n *\n * | token | role |\n * | ------------------------ | ------------------------------------------------------ |\n * | `--background` | anchor (else inherited from base) |\n * | `--foreground` | anchor (else inherited from base) |\n * | `--popover` | derived: = background |\n * | `--popover-foreground` | derived: = foreground |\n * | `--muted` | derived: foreground 4% over background |\n * | `--muted-foreground` | derived: foreground 60% over background |\n * | `--secondary` | derived: primary 10% over background |\n * | `--accent` | derived: primary 10% over background |\n * | `--border` | inherited from base (no fallback — see below) |\n * | `--input` | inherited from base (no fallback — see below) |\n *\n * Primary is not a scheme token — it is the store's button colour — so the\n * caller passes it as `context.primary`; without one, base's own `--primary`\n * (a pre-0243 row) is used. `--border`/`--input` are read straight off the\n * theme by the adapter, which reconstructs a missing border from the theme's\n * `*_border_opacity` setting a token map does not carry — so they are\n * inherited from base, and omitted when base lacks them, as the adapter omits\n * them.\n *\n * ## Rounding: why an unchanged input keeps base's value\n *\n * The adapter mixes 8-bit channels parsed from the theme's hex; a scheme only\n * has the integer-rounded triplet, and the hex cannot be recovered from it.\n * Re-deriving from triplets therefore lands a point off now and then — Horizon\n * `color_palette`'s `--muted-foreground` comes back `359 83% 68%` against the\n * adapter's `359 84% 68%`. So a derived token is recomputed only when one of\n * its INPUTS differs from base; otherwise base's value stands. A merchant who\n * edits nothing gets the adapter's map back exactly, and one who edits the\n * background gets the family recomputed.\n *\n * When it is recomputed, triplets convert back to RGB WITHOUT rounding to\n * 8-bit first — that would be a second quantisation the adapter never\n * performs, and enough to move smallflower's `--secondary` from `230 38% 94%`\n * to `230 42% 94%`. The mix result is rounded exactly where the adapter\n * rounds it.\n */\nimport { isHslTriplet } from './colorFormat';\nimport {\n THEME_OVERRIDE_KEY_PATTERN,\n THEME_TOKEN_CONTRACT,\n} from './tokenContract';\n\n/** Where a scheme came from. Any other value on the wire reads as unknown. */\nexport type SchemeOrigin = 'UNKNOWN_SCHEME_ORIGIN' | 'THEME' | 'OWNER';\n\n/** One named palette as the configuration carries it. */\nexport interface ThemeScheme {\n /** `^[a-z0-9][a-z0-9-]{0,31}$`, unique within the list. */\n id: string;\n /** Shown in the owner panel; at most 48 characters. */\n name?: string;\n origin?: SchemeOrigin | string;\n /**\n * On an OWNER row: the id of the THEME scheme it is an edit of. Not the\n * row's own id, unique across rows (at most one edit per scheme), and it may\n * dangle — a theme publish can remove the base, and the edit survives it.\n */\n baseSchemeId?: string;\n /**\n * Token → value, keys as open as `themeOverrides`': colours as bare HSL\n * triplets (`0 0% 100%`), `--radius` as a length (`0.5rem`), anything else\n * in the loose value shape. See `isSchemeTokenEntry`.\n */\n tokens: Record<string, string>;\n}\n\n/** Every colour role in the contract (`type: 'color-hsl'`, `--heading` included). */\nexport const SCHEME_COLOR_TOKENS: ReadonlySet<string> = Object.freeze(\n new Set(\n Object.entries(THEME_TOKEN_CONTRACT)\n .filter(([, entry]) => entry.type === 'color-hsl')\n .map(([token]) => token),\n ),\n) as ReadonlySet<string>;\n\n/**\n * A scheme colour (`type: 'color-hsl'`): `H S% L%`, single-spaced, no `hsl()`\n * wrapper. Saturation and lightness are additionally capped at 100\n * (`isSchemeColorValue`); hue is bounded only by its three digits.\n */\nconst SCHEME_COLOR_VALUE =\n /^(\\d{1,3}(?:\\.\\d+)?) (\\d{1,3}(?:\\.\\d+)?)% (\\d{1,3}(?:\\.\\d+)?)%$/;\n\n/**\n * A scheme length (`type: 'length'`, i.e. `--radius`): px/rem/em, unit REQUIRED\n * (`0px`, not `0`). A bare `0` would turn `calc(var(--radius) - 4px)` into\n * invalid CSS — see the `length` note in `tokenContract.ts`.\n */\nconst SCHEME_RADIUS_VALUE = /^\\d{1,4}(?:\\.\\d+)?(?:px|rem|em)$/;\n\n/**\n * Any other scheme value — a font stack, a key the contract has not catalogued:\n * no `;`, `{`, `}` or control character. The server's `themeOverrides` value\n * shape (`^[^;{}\\p{Cntrl}]{1,256}$`); the length is checked separately in\n * UTF-16 units, as the server counts, since a `u`-flag quantifier counts code\n * points.\n */\nconst SCHEME_LOOSE_VALUE = /^[^;{}\\p{Cc}]+$/u;\nconst MAX_SCHEME_VALUE_LENGTH = 256;\n\n/**\n * What a scheme is (ADR 0243): its background and text, and the colours\n * derived from those two. The panel writes exactly these into the OWNER rows\n * it creates, and mirrors exactly these of the active row into `themeOverrides`.\n */\nexport const SCHEME_TOKENS = [\n '--background',\n '--foreground',\n '--popover',\n '--popover-foreground',\n '--muted',\n '--muted-foreground',\n '--border',\n '--input',\n '--secondary',\n '--accent',\n] as const;\n\nexport type SchemeToken = (typeof SCHEME_TOKENS)[number];\n\nconst SCHEME_TOKEN_SET: ReadonlySet<string> = new Set(SCHEME_TOKENS);\n\n/** Only the `SCHEME_TOKENS` entries of `map`. */\nexport function schemeTokensOf(\n map: Record<string, string> | null | undefined,\n): Record<string, string> {\n return Object.fromEntries(\n Object.entries(map ?? {}).filter(([token]) => SCHEME_TOKEN_SET.has(token)),\n );\n}\n\n/** The two the owner edits on a scheme, in panel order. */\nexport const SCHEME_ANCHOR_TOKENS = ['--background', '--foreground'] as const;\n\nexport type SchemeAnchorToken = (typeof SCHEME_ANCHOR_TOKENS)[number];\n\n/** Upper bound on schemes per configuration. */\nexport const MAX_THEME_SCHEMES = 16;\n\nconst SCHEME_ID_PATTERN = /^[a-z0-9][a-z0-9-]{0,31}$/;\nconst MAX_SCHEME_NAME_LENGTH = 48;\n\nconst isPlainObject = (value: unknown): value is Record<string, unknown> =>\n typeof value === 'object' && value !== null && !Array.isArray(value);\n\n/**\n * Whether an untrusted value has a scheme's SHAPE.\n *\n * Token content is deliberately not judged here: `applyThemeOverrides` drops a\n * malformed key one entry at a time, exactly as it does for the flat store map\n * (and says so), so one bad token costs that token rather than the whole\n * palette. The typed value grammar is `isSchemeTokenEntry`, checked by writers.\n */\nexport function isThemeScheme(value: unknown): value is ThemeScheme {\n if (!isPlainObject(value)) {\n return false;\n }\n const { id, name, origin, baseSchemeId, tokens } = value;\n if (typeof id !== 'string' || !SCHEME_ID_PATTERN.test(id)) {\n return false;\n }\n if (baseSchemeId !== undefined && typeof baseSchemeId !== 'string') {\n return false;\n }\n if (\n name !== undefined &&\n (typeof name !== 'string' || name.length > MAX_SCHEME_NAME_LENGTH)\n ) {\n return false;\n }\n if (origin !== undefined && typeof origin !== 'string') {\n return false;\n }\n return (\n isPlainObject(tokens) &&\n Object.values(tokens).every((v) => typeof v === 'string')\n );\n}\n\n/**\n * The active scheme: the entry whose id is `activeThemeSchemeId`, else the\n * first entry, else null. Entries failing `isThemeScheme` are skipped first, so\n * a dangling id or a malformed entry falls through to the first usable one.\n */\nexport function resolveActiveScheme(\n cfg:\n | { themeSchemes?: unknown; activeThemeSchemeId?: string | null }\n | null\n | undefined,\n): ThemeScheme | null {\n if (!cfg || !Array.isArray(cfg.themeSchemes)) {\n return null;\n }\n const schemes = cfg.themeSchemes.filter(isThemeScheme);\n if (schemes.length === 0) {\n return null;\n }\n const activeId = cfg.activeThemeSchemeId;\n const active =\n typeof activeId === 'string'\n ? schemes.find((scheme) => scheme.id === activeId)\n : undefined;\n return active ?? schemes[0];\n}\n\n// ── Arithmetic copied from web50-shopify-adapter/src/theme-tokens.ts ────────\n\ninterface Rgb {\n r: number;\n g: number;\n b: number;\n}\n\nconst TRIPLET =\n /^(\\d{1,3}(?:\\.\\d+)?)\\s+(\\d{1,3}(?:\\.\\d+)?)%\\s+(\\d{1,3}(?:\\.\\d+)?)%$/;\n\n/**\n * A triplet as RGB in 0–255, NOT rounded to 8-bit — see the module header for\n * why. Same conversion as `colorFormat.hslTripletToHex`, minus its rounding.\n */\nfunction tripletToRgb(triplet: string): Rgb | null {\n const parts = TRIPLET.exec(triplet.trim());\n if (!parts || !isHslTriplet(triplet)) {\n return null;\n }\n const h = Number(parts[1]);\n const s = Number(parts[2]) / 100;\n const l = Number(parts[3]) / 100;\n\n const c = (1 - Math.abs(2 * l - 1)) * s;\n const x = c * (1 - Math.abs(((h / 60) % 2) - 1));\n const m = l - c / 2;\n const [r, g, b] =\n h < 60\n ? [c, x, 0]\n : h < 120\n ? [x, c, 0]\n : h < 180\n ? [0, c, x]\n : h < 240\n ? [0, x, c]\n : h < 300\n ? [x, 0, c]\n : [c, 0, x];\n return { r: (r + m) * 255, g: (g + m) * 255, b: (b + m) * 255 };\n}\n\n/** Adapter `composite` for an opaque-over-opaque mix, via its `mix`: channels rounded to 8-bit. */\nfunction mix(fg: Rgb, ratio: number, bg: Rgb): Rgb {\n return {\n r: Math.round(fg.r * ratio + bg.r * (1 - ratio)),\n g: Math.round(fg.g * ratio + bg.g * (1 - ratio)),\n b: Math.round(fg.b * ratio + bg.b * (1 - ratio)),\n };\n}\n\n/** Adapter `toTriplet`: `\"H S% L%\"`, integer-rounded. */\nfunction toTriplet({ r, g, b }: Rgb): string {\n const rn = r / 255;\n const gn = g / 255;\n const bn = b / 255;\n const max = Math.max(rn, gn, bn);\n const min = Math.min(rn, gn, bn);\n const l = (max + min) / 2;\n const delta = max - min;\n\n let h = 0;\n let s = 0;\n if (delta !== 0) {\n s = l > 0.5 ? delta / (2 - max - min) : delta / (max + min);\n if (max === rn) {\n h = (gn - bn) / delta + (gn < bn ? 6 : 0);\n } else if (max === gn) {\n h = (bn - rn) / delta + 2;\n } else {\n h = (rn - gn) / delta + 4;\n }\n h *= 60;\n }\n return `${Math.round(h)} ${Math.round(s * 100)}% ${Math.round(l * 100)}%`;\n}\n\n/** What `completeScheme` needs from outside the scheme. */\nexport interface SchemeContext {\n /** The store's button colour, which tints `--secondary`/`--accent`. */\n primary?: string;\n}\n\n/**\n * The `SCHEME_TOKENS` of a scheme whose anchors the owner just edited.\n *\n * `anchors` win; everything the adapter derives from them is recomputed when\n * one of its inputs changed (and kept from `base` when none did — see \"Rounding\"\n * in the module header); `--border`/`--input` are taken from `base`. Invalid\n * triplets in any input are ignored, and a derived token whose inputs are\n * unavailable keeps `base`'s value, if any.\n *\n * Returns ONLY `SCHEME_TOKENS`: whatever else `base` carries (a pre-0243 row's\n * card or button colours, its radius) is the store's global set now, not the\n * scheme's, and is dropped. Every output entry passes `isSchemeTokenEntry`.\n */\nexport function completeScheme(\n base: Record<string, string>,\n anchors: Partial<Record<SchemeAnchorToken, string>>,\n context: SchemeContext = {},\n): Record<string, string> {\n // Both checks: `isHslTriplet` is what the arithmetic can convert, and the\n // scheme grammar is what a write accepts — failing either would poison a\n // derivation or get the whole save refused.\n const valid = (value: unknown): string | undefined =>\n typeof value === 'string' &&\n isHslTriplet(value) &&\n isSchemeColorValue(value.trim())\n ? value.trim()\n : undefined;\n const fromBase = (token: string): string | undefined => valid(base[token]);\n const fromAnchor = (token: SchemeAnchorToken): string | undefined =>\n valid(anchors[token]);\n\n const out: Record<string, string> = {};\n const put = (token: string, value: string | undefined): void => {\n if (value !== undefined) {\n out[token] = value;\n }\n };\n\n const background = fromAnchor('--background') ?? fromBase('--background');\n const foreground = fromAnchor('--foreground') ?? fromBase('--foreground');\n const bgChanged = background !== fromBase('--background');\n const fgChanged = foreground !== fromBase('--foreground');\n const bg = background === undefined ? null : tripletToRgb(background);\n const fg = foreground === undefined ? null : tripletToRgb(foreground);\n\n /** base's value while the inputs are unchanged, else the recomputation (else base's). */\n const derive = (\n token: string,\n inputsChanged: boolean,\n compute: () => string | undefined,\n ): string | undefined => {\n const kept = fromBase(token);\n return !inputsChanged && kept !== undefined ? kept : compute() ?? kept;\n };\n const mixOver = (over: Rgb | null, ratio: number) => (): string | undefined =>\n over !== null && bg !== null ? toTriplet(mix(over, ratio, bg)) : undefined;\n\n put('--background', background);\n put('--foreground', foreground);\n put(\n '--popover',\n derive('--popover', bgChanged, () => background),\n );\n put(\n '--popover-foreground',\n derive('--popover-foreground', fgChanged, () => foreground),\n );\n put('--muted', derive('--muted', bgChanged || fgChanged, mixOver(fg, 0.04)));\n put(\n '--muted-foreground',\n derive('--muted-foreground', bgChanged || fgChanged, mixOver(fg, 0.6)),\n );\n\n put('--border', fromBase('--border'));\n put('--input', fromBase('--input'));\n\n // Primary is the store's, not the scheme's. It counts as a changed input only\n // when base states the primary its tints were computed from and the context\n // names a different one; a base without one keeps its tints until the page\n // itself moves.\n const basePrimary = fromBase('--primary');\n const primaryTriplet = valid(context.primary) ?? basePrimary;\n const primaryChanged =\n basePrimary !== undefined &&\n primaryTriplet !== undefined &&\n primaryTriplet !== basePrimary;\n const primary =\n primaryTriplet === undefined ? null : tripletToRgb(primaryTriplet);\n const tintChanged = bgChanged || primaryChanged;\n put('--secondary', derive('--secondary', tintChanged, mixOver(primary, 0.1)));\n put('--accent', derive('--accent', tintChanged, mixOver(primary, 0.1)));\n\n return out;\n}\n\n/** The label the panel shows: the trimmed name, else `Palette N` (1-based). */\nexport function schemeDisplayName(scheme: ThemeScheme, index: number): string {\n const name = typeof scheme.name === 'string' ? scheme.name.trim() : '';\n return name !== '' ? name : `Palette ${index + 1}`;\n}\n\n/** `owner-N` with the smallest N ≥ 1 not already taken. */\nexport function nextOwnerSchemeId(schemes: readonly { id: string }[]): string {\n const taken = new Set(schemes.map((scheme) => scheme.id));\n let n = 1;\n while (taken.has(`owner-${n}`)) {\n n += 1;\n }\n return `owner-${n}`;\n}\n\n/** A colour value a scheme may hold: `SCHEME_COLOR_VALUE`, with S and L ≤ 100. */\nfunction isSchemeColorValue(value: string): boolean {\n const parts = SCHEME_COLOR_VALUE.exec(value);\n return parts !== null && Number(parts[2]) <= 100 && Number(parts[3]) <= 100;\n}\n\n/**\n * Whether a key/value pair may be written as a scheme token — the CLIENT's\n * contract, checked before the panel writes and by `completeScheme`.\n *\n * There is no allow-list: any key of the `themeOverrides` shape\n * (`THEME_OVERRIDE_KEY_PATTERN`) is a candidate. The value grammar follows the\n * key's contract type: `color-hsl` → an HSL triplet with S and L ≤ 100;\n * `length` → a px/rem/em length with its unit; anything else (font stacks,\n * keys the contract does not know) → the loose `themeOverrides` value shape.\n *\n * The server enforces only that loose shape for every key, so a `0 101% 50%`\n * colour or a unitless radius would be ACCEPTED there — and render wrong. That\n * is why the panel refuses them here. The renderer does not re-check values.\n */\nexport function isSchemeTokenEntry(key: string, value: unknown): boolean {\n if (typeof value !== 'string' || !THEME_OVERRIDE_KEY_PATTERN.test(key)) {\n return false;\n }\n switch (THEME_TOKEN_CONTRACT[key]?.type) {\n case 'color-hsl':\n return isSchemeColorValue(value);\n case 'length':\n return SCHEME_RADIUS_VALUE.test(value);\n default:\n return (\n value.length <= MAX_SCHEME_VALUE_LENGTH &&\n SCHEME_LOOSE_VALUE.test(value)\n );\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,YAAY,QAAQ,eAAe;AAC5C,SACEC,0BAA0B,EAC1BC,oBAAoB,QACf,iBAAiB;;AAExB;;AAGA;;AAqBA;AACA,OAAO,MAAMC,mBAAwC,GAAGC,MAAM,CAACC,MAAM,CACnE,IAAIC,GAAG,CACLF,MAAM,CAACG,OAAO,CAACL,oBAAoB,CAAC,CACjCM,MAAM,CAACC,IAAA;EAAA,IAAC,GAAGC,KAAK,CAAC,GAAAD,IAAA;EAAA,OAAKC,KAAK,CAACC,IAAI,KAAK,WAAW;AAAA,EAAC,CACjDC,GAAG,CAACC,KAAA;EAAA,IAAC,CAACC,KAAK,CAAC,GAAAD,KAAA;EAAA,OAAKC,KAAK;AAAA,EAC3B,CACF,CAAwB;;AAExB;AACA;AACA;AACA;AACA;AACA,MAAMC,kBAAkB,GACtB,iEAAiE;;AAEnE;AACA;AACA;AACA;AACA;AACA,MAAMC,mBAAmB,GAAG,kCAAkC;;AAE9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,kB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kBA,CAACC,GAAW,EAAEtF,KAAc,EAAW;EAAA,IAAAuF,qBAAA;EACvE,IAAI,OAAOvF,KAAK,KAAK,QAAQ,IAAI,CAAC7B,0BAA0B,CAACsC,IAAI,CAAC6E,GAAG,CAAC,EAAE;IACtE,OAAO,KAAK;EACd;EACA,SAAAC,qBAAA,GAAQnH,oBAAoB,CAACkH,GAAG,CAAC,qBAAzBC,qBAAA,CAA2B1G,IAAI;IACrC,KAAK,WAAW;MACd,OAAO+E,kBAAkB,CAAC5D,KAAK,CAAC;IAClC,KAAK,QAAQ;MACX,OAAOd,mBAAmB,CAACuB,IAAI,CAACT,KAAK,CAAC;IACxC;MACE,OACEA,KAAK,CAACW,MAAM,IAAIvB,uBAAuB,IACvCD,kBAAkB,CAACsB,IAAI,CAACT,KAAK,CAAC;EAEpC;AACF","ignoreList":[]}
@@ -1,3 +1,4 @@
1
+ import { type AppliedToken } from './themeDebug';
1
2
  /** A themeOverrides key: always a CSS custom property. */
2
3
  export type ThemeOverrideKey = `--${string}`;
3
4
  /**
@@ -17,5 +18,15 @@ export type ThemeOverrides = Record<ThemeOverrideKey, string>;
17
18
  * who wins when a store and a template disagree.
18
19
  */
19
20
  export declare const THEME_OVERRIDE_TOKENS: ReadonlySet<string>;
21
+ /**
22
+ * The declarations the three layers resolve to, in the order they are written:
23
+ * the store map bucketed, then the active scheme bucketed the same way, then
24
+ * the owner's overrides as their real names. Later entries win.
25
+ *
26
+ * Pure apart from the malformed-key warning, so a second writer — the owner
27
+ * panel's live preview — paints exactly what a saved configuration will render
28
+ * rather than a reconstruction of it.
29
+ */
30
+ export declare function themeOverrideDeclarations(overrides?: Record<string, string> | null, userOverrides?: Record<string, string> | null, schemeTokens?: Record<string, string> | null): AppliedToken[];
20
31
  export declare function applyThemeOverrides(overrides?: Record<string, string> | null, userOverrides?: Record<string, string> | null, schemeTokens?: Record<string, string> | null): void;
21
32
  //# sourceMappingURL=applyThemeOverrides.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"applyThemeOverrides.d.ts","sourceRoot":"","sources":["../../../src/client/applyThemeOverrides.ts"],"names":[],"mappings":"AAyEA,0DAA0D;AAC1D,MAAM,MAAM,gBAAgB,GAAG,KAAK,MAAM,EAAE,CAAC;AAE7C;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;AAE9D;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB,EAAE,WAAW,CAAC,MAAM,CAErD,CAAC;AA8BF,wBAAgB,mBAAmB,CACjC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,EACzC,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,EAC7C,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,GAC3C,IAAI,CAyEN"}
1
+ {"version":3,"file":"applyThemeOverrides.d.ts","sourceRoot":"","sources":["../../../src/client/applyThemeOverrides.ts"],"names":[],"mappings":"AA6DA,OAAO,EAAuB,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAQtE,0DAA0D;AAC1D,MAAM,MAAM,gBAAgB,GAAG,KAAK,MAAM,EAAE,CAAC;AAE7C;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;AAE9D;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB,EAAE,WAAW,CAAC,MAAM,CAErD,CAAC;AA8BF;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CACvC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,EACzC,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,EAC7C,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,GAC3C,YAAY,EAAE,CAqChB;AAED,wBAAgB,mBAAmB,CACjC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,EACzC,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,EAC7C,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,GAC3C,IAAI,CA+CN"}
@@ -33,7 +33,7 @@ export { useConversation } from './hooks/useConversation';
33
33
  export { useDebugImageContext } from './hooks/useDebugImageContext';
34
34
  export { useResolvedImageSources } from './hooks/useResolvedImageSources';
35
35
  export { useImageSlot } from './hooks/useImageSlot';
36
- export type { UseImageSlotOptions, ResolvedImage, } from './hooks/useImageSlot';
36
+ export type { UseImageSlotOptions, ResolvedImage } from './hooks/useImageSlot';
37
37
  export { ImageSlotProvider, useImageSlotCollector, } from './context/ImageSlotContext';
38
38
  export type { ImageSlotCollector, ImageSlotProviderProps, } from './context/ImageSlotContext';
39
39
  export { SectionsRuntimeProvider, SectionRuntimeProvider, useCurrentSectionOptions, useCurrentSectionId, } from './context/SectionRuntimeContext';
@@ -88,9 +88,10 @@ export { loadClientBundle } from './client/loadClientBundle';
88
88
  export { getClientBundleOverride, isTrustedBundleHost, } from './client/clientBundleOverride';
89
89
  export { TEMPLATES_CDN_BASE, TEMPLATES_MANIFEST_URL, getTemplateOverride, isTemplatePickerRequested, isValidTemplateId, resolveClientBundleUrl, } from './client/clientBundleUrl';
90
90
  export { mergeClientConfig, type DeepPartial, } from './client/mergeClientConfig';
91
- export { applyThemeOverrides, THEME_OVERRIDE_TOKENS, type ThemeOverrideKey, type ThemeOverrides, } from './client/applyThemeOverrides';
91
+ export { applyThemeOverrides, themeOverrideDeclarations, THEME_OVERRIDE_TOKENS, type ThemeOverrideKey, type ThemeOverrides, } from './client/applyThemeOverrides';
92
92
  export { THEME_TOKEN_CONTRACT, BRAND_TOKENS, EDITABLE_TOKENS, TOKEN_NAME_PATTERN, THEME_OVERRIDE_KEY_PATTERN, bucketOf, hostAliasFor, type TokenBucket, type TokenContractEntry, type TokenType, } from './theme/tokenContract';
93
- export { SCHEME_COLOR_TOKENS, MAX_THEME_SCHEMES, SCHEME_ANCHOR_TOKENS, completeScheme, isThemeScheme, isSchemeTokenEntry, nextOwnerSchemeId, resolveActiveScheme, schemeDisplayName, type ThemeScheme, type SchemeAnchorToken, type SchemeOrigin, } from './theme/themeScheme';
93
+ export { SCHEME_COLOR_TOKENS, MAX_THEME_SCHEMES, SCHEME_ANCHOR_TOKENS, SCHEME_TOKENS, completeScheme, isThemeScheme, isSchemeTokenEntry, nextOwnerSchemeId, resolveActiveScheme, schemeDisplayName, schemeTokensOf, type ThemeScheme, type SchemeAnchorToken, type SchemeContext, type SchemeToken, type SchemeOrigin, } from './theme/themeScheme';
94
+ export { WEB5_CHROME_TOKENS, web5ChromeProperties, web5ChromeProperty, type Web5ChromeToken, } from './theme/chromeTokens';
94
95
  export { isThemeDebugEnabled, THEME_DEBUG_KEY, THEME_DEBUG_QUERY_PARAM, type AppliedToken, type ThemeOverrideSource, } from './client/themeDebug';
95
96
  export { hexToHslTriplet, hslTripletToHex, isHslTriplet, } from './theme/colorFormat';
96
97
  export { PlacementResponseRenderer, PlacementSmoothHeight, type PlacementResponseRendererProps, type PlacementSection, type PlacementVariant, } from './components/placement/PlacementResponseRenderer';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEvD,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACxB,yBAAyB,EACzB,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,uCAAuC,CAAC;AAG/C,YAAY,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAG9D,OAAO,EAC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AoB,CAAC;AACzD,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,mBAAmB,EACnB,aAAa,EACb,oBAAoB,EACpB,aAAa,GACd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EACL,oBAAoB,EACpB,YAAY,EACZ,SAAS,EACT,cAAc,EACd,SAAS,EACT,mBAAmB,GACpB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EACL,yBAAyB,EACzB,iBAAiB,EACjB,iCAAiC,EACjC,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,aAAa,GACnB,MAAM,6BAA6B,CAAC;AACrC,YAAY,EACV,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,0BAA0B,CAAC;AAKlC,OAAO,EACL,YAAY,EACZ,eAAe,EACf,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,KAAK,aAAa,GACnB,MAAM,aAAa,CAAC"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * The owner panel's own chrome colours (`--web5-chrome-*`).
3
+ *
4
+ * The Customize panel edits and previews the store's colour tokens, so its
5
+ * chrome cannot be painted with them: a dark scheme would turn its labels
6
+ * dark-on-dark and a cream card colour would turn the whole panel cream. It
7
+ * takes these instead — light, neutral, and written by nothing the store or the
8
+ * merchant controls.
9
+ *
10
+ * WHY A CONSTANT AND NOT ONLY CSS. `base-tokens.css` declares the same values,
11
+ * but that stylesheet reaches a page through the CLIENT bundle, and every
12
+ * client bundle pins the core version it was built against. A storefront whose
13
+ * template predates these tokens would leave the panel's `hsl(var(...))`
14
+ * invalid — a transparent panel inheriting the scheme's text colour. The panel
15
+ * lives in web50-server-ui, which bundles its own core, so it writes each value
16
+ * as the `var()` fallback (`hsl(var(--web5-chrome-surface, 0 0% 100%))`, see
17
+ * `chrome()` in the TemplatePicker) and never depends on the client's CSS.
18
+ * `chromeTokens.spec.ts` keeps this map and `base-tokens.css` equal.
19
+ *
20
+ * Bare HSL triplets, like every colour token: callers wrap them in `hsl()`.
21
+ * A leaf module (no CSS imports), for the reason `tokenContract.ts` gives.
22
+ */
23
+ /** Token name (without the `--web5-chrome-` prefix) → bare HSL triplet. */
24
+ export declare const WEB5_CHROME_TOKENS: Readonly<{
25
+ readonly surface: "0 0% 100%";
26
+ readonly foreground: "0 0% 18.8%";
27
+ readonly 'muted-foreground': "0 0% 38%";
28
+ readonly 'subtle-foreground': "210 4.5% 56.9%";
29
+ readonly border: "0 0% 89%";
30
+ readonly 'border-strong': "0 0% 71%";
31
+ readonly tint: "0 0% 98%";
32
+ readonly accent: "0 0% 18.8%";
33
+ readonly 'accent-foreground': "0 0% 100%";
34
+ readonly destructive: "9 72.2% 44.9%";
35
+ }>;
36
+ export type Web5ChromeToken = keyof typeof WEB5_CHROME_TOKENS;
37
+ /** `surface` → `--web5-chrome-surface`. */
38
+ export declare const web5ChromeProperty: (token: Web5ChromeToken) => `--web5-chrome-${string}`;
39
+ /**
40
+ * Every chrome token as custom properties, ready to spread into an element's
41
+ * inline style (`style={{ ...web5ChromeProperties(), ... }}`), so the element
42
+ * and everything inside it resolve `var(--web5-chrome-*)` without any
43
+ * stylesheet.
44
+ */
45
+ export declare function web5ChromeProperties(): Record<`--web5-chrome-${string}`, string>;
46
+ //# sourceMappingURL=chromeTokens.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chromeTokens.d.ts","sourceRoot":"","sources":["../../../src/theme/chromeTokens.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,2EAA2E;AAC3E,eAAO,MAAM,kBAAkB;;;;;;;;;;;EAWpB,CAAC;AAEZ,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,kBAAkB,CAAC;AAE9D,2CAA2C;AAC3C,eAAO,MAAM,kBAAkB,UAAW,eAAe,KAAG,iBAAiB,MAAM,EACzD,CAAC;AAE3B;;;;;GAKG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAAC,iBAAiB,MAAM,EAAE,EAAE,MAAM,CAAC,CAMhF"}
@@ -7,6 +7,12 @@ export interface ThemeScheme {
7
7
  /** Shown in the owner panel; at most 48 characters. */
8
8
  name?: string;
9
9
  origin?: SchemeOrigin | string;
10
+ /**
11
+ * On an OWNER row: the id of the THEME scheme it is an edit of. Not the
12
+ * row's own id, unique across rows (at most one edit per scheme), and it may
13
+ * dangle — a theme publish can remove the base, and the edit survives it.
14
+ */
15
+ baseSchemeId?: string;
10
16
  /**
11
17
  * Token → value, keys as open as `themeOverrides`': colours as bare HSL
12
18
  * triplets (`0 0% 100%`), `--radius` as a length (`0.5rem`), anything else
@@ -16,8 +22,17 @@ export interface ThemeScheme {
16
22
  }
17
23
  /** Every colour role in the contract (`type: 'color-hsl'`, `--heading` included). */
18
24
  export declare const SCHEME_COLOR_TOKENS: ReadonlySet<string>;
19
- /** The four the owner edits, in panel order. Equal to the contract's editable colour tokens. */
20
- export declare const SCHEME_ANCHOR_TOKENS: readonly ["--background", "--foreground", "--card", "--card-foreground"];
25
+ /**
26
+ * What a scheme is (ADR 0243): its background and text, and the colours
27
+ * derived from those two. The panel writes exactly these into the OWNER rows
28
+ * it creates, and mirrors exactly these of the active row into `themeOverrides`.
29
+ */
30
+ export declare const SCHEME_TOKENS: readonly ["--background", "--foreground", "--popover", "--popover-foreground", "--muted", "--muted-foreground", "--border", "--input", "--secondary", "--accent"];
31
+ export type SchemeToken = (typeof SCHEME_TOKENS)[number];
32
+ /** Only the `SCHEME_TOKENS` entries of `map`. */
33
+ export declare function schemeTokensOf(map: Record<string, string> | null | undefined): Record<string, string>;
34
+ /** The two the owner edits on a scheme, in panel order. */
35
+ export declare const SCHEME_ANCHOR_TOKENS: readonly ["--background", "--foreground"];
21
36
  export type SchemeAnchorToken = (typeof SCHEME_ANCHOR_TOKENS)[number];
22
37
  /** Upper bound on schemes per configuration. */
23
38
  export declare const MAX_THEME_SCHEMES = 16;
@@ -39,22 +54,25 @@ export declare function resolveActiveScheme(cfg: {
39
54
  themeSchemes?: unknown;
40
55
  activeThemeSchemeId?: string | null;
41
56
  } | null | undefined): ThemeScheme | null;
57
+ /** What `completeScheme` needs from outside the scheme. */
58
+ export interface SchemeContext {
59
+ /** The store's button colour, which tints `--secondary`/`--accent`. */
60
+ primary?: string;
61
+ }
42
62
  /**
43
- * A full colour-token map for a palette whose anchors the owner just edited.
63
+ * The `SCHEME_TOKENS` of a scheme whose anchors the owner just edited.
44
64
  *
45
65
  * `anchors` win; everything the adapter derives from them is recomputed when
46
66
  * one of its inputs changed (and kept from `base` when none did — see "Rounding"
47
- * in the module header); everything it reads directly is taken from `base`.
48
- * Invalid triplets in either input are ignored, and a derived token whose
49
- * inputs are unavailable keeps `base`'s value, if any.
67
+ * in the module header); `--border`/`--input` are taken from `base`. Invalid
68
+ * triplets in any input are ignored, and a derived token whose inputs are
69
+ * unavailable keeps `base`'s value, if any.
50
70
  *
51
- * Returns the whole scheme map, not only its colours: every non-colour entry of
52
- * `base` that passes `isSchemeTokenEntry` `--radius`, a font stack, a token
53
- * this module does not know — is copied as is, so customizing a palette keeps
54
- * everything it states beyond colour. Every output entry passes
55
- * `isSchemeTokenEntry`.
71
+ * Returns ONLY `SCHEME_TOKENS`: whatever else `base` carries (a pre-0243 row's
72
+ * card or button colours, its radius) is the store's global set now, not the
73
+ * scheme's, and is dropped. Every output entry passes `isSchemeTokenEntry`.
56
74
  */
57
- export declare function completeScheme(base: Record<string, string>, anchors: Partial<Record<SchemeAnchorToken, string>>): Record<string, string>;
75
+ export declare function completeScheme(base: Record<string, string>, anchors: Partial<Record<SchemeAnchorToken, string>>, context?: SchemeContext): Record<string, string>;
58
76
  /** The label the panel shows: the trimmed name, else `Palette N` (1-based). */
59
77
  export declare function schemeDisplayName(scheme: ThemeScheme, index: number): string;
60
78
  /** `owner-N` with the smallest N ≥ 1 not already taken. */
@@ -1 +1 @@
1
- {"version":3,"file":"themeScheme.d.ts","sourceRoot":"","sources":["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author": {
6
6
  "name": "tsachis",
7
7
  "email": "tsachis@wix.com"
@@ -100,5 +100,5 @@
100
100
  "wallaby": {
101
101
  "autoDetect": true
102
102
  },
103
- "falconPackageHash": "66d02251395d1958f52f669009563c0b5205283f3a5c75f958279223"
103
+ "falconPackageHash": "e47c6bd14d93504787f5ccf0de580c1ba835fff9e7110c134180d51c"
104
104
  }
@@ -31,6 +31,25 @@
31
31
  --input: 0 0% 89.8%;
32
32
  --ring: 0 0% 3.9%;
33
33
 
34
+ /* Owner chrome tokens — HSL triplets. The Customize panel's own greys (ADR
35
+ * 0243), held apart from the store's palette ON PURPOSE: the panel edits and
36
+ * previews `--background`, `--card` and the rest, so chrome painted with them
37
+ * repaints itself — a dark scheme turned the panel black and its labels
38
+ * unreadable. Nothing writes these: they are not in THEME_TOKEN_CONTRACT, no
39
+ * store import, scheme or owner override carries them, and an unknown key
40
+ * from a flat map lands on its `--web5-host-*` alias, never here. Light only
41
+ * (no `.dark` twin) — admin chrome, not themed. */
42
+ --web5-chrome-surface: 0 0% 100%;
43
+ --web5-chrome-foreground: 0 0% 18.8%;
44
+ --web5-chrome-muted-foreground: 0 0% 38%;
45
+ --web5-chrome-subtle-foreground: 210 4.5% 56.9%;
46
+ --web5-chrome-border: 0 0% 89%;
47
+ --web5-chrome-border-strong: 0 0% 71%;
48
+ --web5-chrome-tint: 0 0% 98%;
49
+ --web5-chrome-accent: 0 0% 18.8%;
50
+ --web5-chrome-accent-foreground: 0 0% 100%;
51
+ --web5-chrome-destructive: 9 72.2% 44.9%;
52
+
34
53
  /* Typography tokens */
35
54
  --font-sans: ui-sans-serif, system-ui, sans-serif;
36
55
  --font-serif: serif;
@@ -47,6 +47,18 @@
47
47
  --color-text-accent-hover: var(--text-accent-hover);
48
48
  --color-accent-border: var(--accent-border);
49
49
 
50
+ /* Owner chrome — the Customize panel's store-independent greys */
51
+ --color-web5-chrome-surface: hsl(var(--web5-chrome-surface));
52
+ --color-web5-chrome-foreground: hsl(var(--web5-chrome-foreground));
53
+ --color-web5-chrome-muted-foreground: hsl(var(--web5-chrome-muted-foreground));
54
+ --color-web5-chrome-subtle-foreground: hsl(var(--web5-chrome-subtle-foreground));
55
+ --color-web5-chrome-border: hsl(var(--web5-chrome-border));
56
+ --color-web5-chrome-border-strong: hsl(var(--web5-chrome-border-strong));
57
+ --color-web5-chrome-tint: hsl(var(--web5-chrome-tint));
58
+ --color-web5-chrome-accent: hsl(var(--web5-chrome-accent));
59
+ --color-web5-chrome-accent-foreground: hsl(var(--web5-chrome-accent-foreground));
60
+ --color-web5-chrome-destructive: hsl(var(--web5-chrome-destructive));
61
+
50
62
  --radius-sm: calc(var(--radius) - 4px);
51
63
  --radius-md: calc(var(--radius) - 2px);
52
64
  --radius-lg: var(--radius);