@wix/web5-core 1.60.0 → 1.62.0
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.
- package/dist/cjs/client/applyThemeOverrides.js +32 -13
- package/dist/cjs/client/applyThemeOverrides.js.map +1 -1
- package/dist/cjs/index.js +9 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/styles/base-tokens.css +8 -27
- package/dist/cjs/styles/tailwind-theme.css +0 -17
- package/dist/cjs/theme/tokenContract.js +163 -0
- package/dist/cjs/theme/tokenContract.js.map +1 -0
- package/dist/esm/client/applyThemeOverrides.js +32 -13
- package/dist/esm/client/applyThemeOverrides.js.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/styles/base-tokens.css +8 -27
- package/dist/esm/styles/tailwind-theme.css +0 -17
- package/dist/esm/theme/tokenContract.js +163 -0
- package/dist/esm/theme/tokenContract.js.map +1 -0
- package/dist/types/client/applyThemeOverrides.d.ts +8 -6
- package/dist/types/client/applyThemeOverrides.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/theme/tokenContract.d.ts +103 -0
- package/dist/types/theme/tokenContract.d.ts.map +1 -0
- package/package.json +2 -2
- package/src/styles/base-tokens.css +8 -27
- package/src/styles/tailwind-theme.css +0 -17
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The theme-token contract (DL #193).
|
|
3
|
+
*
|
|
4
|
+
* One home for the answer to "who is allowed to set this token, and who wins
|
|
5
|
+
* when more than one of them does". Three things need that answer and must not
|
|
6
|
+
* each keep their own copy:
|
|
7
|
+
*
|
|
8
|
+
* - **`applyThemeOverrides`** decides, per key, whether to write the real
|
|
9
|
+
* token or its `--web5-host-*` alias.
|
|
10
|
+
* - **the seed's `validate-templates`** fails a template that sets a brand
|
|
11
|
+
* token.
|
|
12
|
+
* - **the shop owner's panel** renders a control per `editable` entry.
|
|
13
|
+
*
|
|
14
|
+
* A leaf module beside `hostScope.ts`, and for the same reason: both are data
|
|
15
|
+
* that several packages must agree on, and both have to be readable from plain
|
|
16
|
+
* Node tooling. Requiring this package's ENTRY from Node fails — the CSS import
|
|
17
|
+
* in it is a syntax error to the CJS loader, which is what `scope-css.ts`
|
|
18
|
+
* documents — but a deep import of a leaf like this one works, so the seed's
|
|
19
|
+
* validator can read it without loading a component library.
|
|
20
|
+
*
|
|
21
|
+
* It was briefly its own package. That was justified by `embed-loader` needing
|
|
22
|
+
* the list without taking core's eleven dependencies — and the loader turned
|
|
23
|
+
* out not to need it at all, because `applyThemeOverrides` has owned runtime
|
|
24
|
+
* token injection here since DL #131.
|
|
25
|
+
*
|
|
26
|
+
* ## The two buckets
|
|
27
|
+
*
|
|
28
|
+
* The split is about who WINS, not about what may be imported. A platform
|
|
29
|
+
* adapter is free to read anything the store states; the bucket decides what
|
|
30
|
+
* happens when a template has an opinion about the same token.
|
|
31
|
+
*
|
|
32
|
+
* - `brand` — the store's identity: colour roles and font families. The
|
|
33
|
+
* imported value is written as the real token, last, so it wins
|
|
34
|
+
* unconditionally. A template is not permitted to set these.
|
|
35
|
+
* - `host` — the store's shape: corner radius today. The imported value is
|
|
36
|
+
* written as `--web5-host-<name>` and consumed by core as a `var()`
|
|
37
|
+
* fallback, so a template stating the real token beats it and a template
|
|
38
|
+
* that stays silent inherits the store's.
|
|
39
|
+
*
|
|
40
|
+
* A token absent from this map is treated as `host`. That is deliberate and
|
|
41
|
+
* safe: an alias nothing consumes renders nothing, so an adapter that learns
|
|
42
|
+
* to read a token core has never heard of cannot override a template by
|
|
43
|
+
* accident. The wiring line in core is the real gate for a host token, not the
|
|
44
|
+
* entry here.
|
|
45
|
+
*
|
|
46
|
+
* ## Why all but one are brand
|
|
47
|
+
*
|
|
48
|
+
* This is not a new taxonomy. Twenty of these are the set
|
|
49
|
+
* `web50-shopify-adapter` already emits, with a bucket attached; the
|
|
50
|
+
* twenty-first, `--heading`, has been in core's catalogue since DL #131 and is
|
|
51
|
+
* consumed by the seed, but no adapter fills it yet. Exactly one token changes
|
|
52
|
+
* hands relative to the behaviour before DL #193 — `--radius`, which used to
|
|
53
|
+
* win against the template that had chosen a different one. That single
|
|
54
|
+
* misfiling is the whole of the bug this contract exists to fix.
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
/** How a value is spelled, which is what makes validation possible. */
|
|
58
|
+
|
|
59
|
+
/** Which layer wins when both a store and a template state this token. */
|
|
60
|
+
|
|
61
|
+
const brandColor = label => ({
|
|
62
|
+
bucket: 'brand',
|
|
63
|
+
type: 'color-hsl',
|
|
64
|
+
editable: false,
|
|
65
|
+
...(label === undefined ? {} : {
|
|
66
|
+
label
|
|
67
|
+
})
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Every token a platform adapter may meaningfully emit today.
|
|
72
|
+
*
|
|
73
|
+
* Growth is adapter-driven on purpose: a token joins when an adapter can
|
|
74
|
+
* actually read it, not on spec. `theme_overrides` is capped at 32 entries by
|
|
75
|
+
* its proto, so there are twelve slots left and no reason to spend them on
|
|
76
|
+
* speculation. `--spacing` is the tempting next one and should be resisted —
|
|
77
|
+
* it scales every `p-*`, `m-*` and `gap-*` in the bundle from one number.
|
|
78
|
+
*/
|
|
79
|
+
export const THEME_TOKEN_CONTRACT = Object.freeze({
|
|
80
|
+
// ── brand · colour roles (18) ────────────────────────────────────────────
|
|
81
|
+
'--background': brandColor(),
|
|
82
|
+
'--foreground': brandColor(),
|
|
83
|
+
'--card': brandColor(),
|
|
84
|
+
'--card-foreground': brandColor(),
|
|
85
|
+
'--popover': brandColor(),
|
|
86
|
+
'--popover-foreground': brandColor(),
|
|
87
|
+
'--primary': brandColor(),
|
|
88
|
+
'--primary-foreground': brandColor(),
|
|
89
|
+
'--secondary': brandColor(),
|
|
90
|
+
'--secondary-foreground': brandColor(),
|
|
91
|
+
'--muted': brandColor(),
|
|
92
|
+
'--muted-foreground': brandColor(),
|
|
93
|
+
'--accent': brandColor(),
|
|
94
|
+
'--accent-foreground': brandColor(),
|
|
95
|
+
'--border': brandColor(),
|
|
96
|
+
'--input': brandColor(),
|
|
97
|
+
'--ring': brandColor(),
|
|
98
|
+
/**
|
|
99
|
+
* Brand-shaped and supported end to end, but no adapter fills it yet: the
|
|
100
|
+
* seed consumes it (`--color-heading-fg: hsl(var(--heading, var(--foreground)))`)
|
|
101
|
+
* and core has catalogued it since DL #131, while `web50-shopify-adapter`
|
|
102
|
+
* emits the other twenty. A store that states a distinct heading colour has
|
|
103
|
+
* somewhere for it to go the moment an adapter learns to read one.
|
|
104
|
+
*/
|
|
105
|
+
'--heading': brandColor(),
|
|
106
|
+
// ── brand · type (2) ─────────────────────────────────────────────────────
|
|
107
|
+
'--font-sans': {
|
|
108
|
+
bucket: 'brand',
|
|
109
|
+
type: 'font-stack',
|
|
110
|
+
editable: false
|
|
111
|
+
},
|
|
112
|
+
'--font-display': {
|
|
113
|
+
bucket: 'brand',
|
|
114
|
+
type: 'font-stack',
|
|
115
|
+
editable: false
|
|
116
|
+
},
|
|
117
|
+
// ── host · shape (1) ─────────────────────────────────────────────────────
|
|
118
|
+
/**
|
|
119
|
+
* The one token whose bucket changed, and the reason this contract exists.
|
|
120
|
+
* Editable because it is the one value a store and a template are known to
|
|
121
|
+
* disagree about in a way a merchant can see and wants to settle.
|
|
122
|
+
*/
|
|
123
|
+
'--radius': {
|
|
124
|
+
bucket: 'host',
|
|
125
|
+
type: 'length',
|
|
126
|
+
editable: true,
|
|
127
|
+
label: 'Corner rounding'
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* The tokens written directly, which is the only question the loader has to
|
|
133
|
+
* answer per key — everything else takes the alias path.
|
|
134
|
+
*/
|
|
135
|
+
export const BRAND_TOKENS = Object.freeze(new Set(Object.entries(THEME_TOKEN_CONTRACT).filter(_ref => {
|
|
136
|
+
let [, entry] = _ref;
|
|
137
|
+
return entry.bucket === 'brand';
|
|
138
|
+
}).map(_ref2 => {
|
|
139
|
+
let [token] = _ref2;
|
|
140
|
+
return token;
|
|
141
|
+
})));
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* A token name we are willing to compose into a CSS declaration.
|
|
145
|
+
*
|
|
146
|
+
* The keys reaching the loader came out of a backend map, which came out of an
|
|
147
|
+
* adapter reading a merchant's theme file. A key carrying `:` or `;` would
|
|
148
|
+
* write arbitrary declarations onto the mount, so the shape is checked where
|
|
149
|
+
* the declaration is built rather than trusted from the source.
|
|
150
|
+
*/
|
|
151
|
+
export const TOKEN_NAME_PATTERN = /^--[a-z0-9-]+$/;
|
|
152
|
+
|
|
153
|
+
/** `--radius` → `--web5-host-radius`. Derived, never stored: one fewer thing to get wrong. */
|
|
154
|
+
export function hostAliasFor(token) {
|
|
155
|
+
return `--web5-host-${token.slice(2)}`;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/** Whether this token is written directly (brand) or as an alias (host, and anything unknown). */
|
|
159
|
+
export function bucketOf(token) {
|
|
160
|
+
var _THEME_TOKEN_CONTRACT;
|
|
161
|
+
return ((_THEME_TOKEN_CONTRACT = THEME_TOKEN_CONTRACT[token]) == null ? void 0 : _THEME_TOKEN_CONTRACT.bucket) ?? 'host';
|
|
162
|
+
}
|
|
163
|
+
//# sourceMappingURL=tokenContract.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["brandColor","label","bucket","type","editable","undefined","THEME_TOKEN_CONTRACT","Object","freeze","BRAND_TOKENS","Set","entries","filter","_ref","entry","map","_ref2","token","TOKEN_NAME_PATTERN","hostAliasFor","slice","bucketOf","_THEME_TOKEN_CONTRACT"],"sources":["../../../src/theme/tokenContract.ts"],"sourcesContent":["/**\n * The theme-token contract (DL #193).\n *\n * One home for the answer to \"who is allowed to set this token, and who wins\n * when more than one of them does\". Three things need that answer and must not\n * each keep their own copy:\n *\n * - **`applyThemeOverrides`** decides, per key, whether to write the real\n * token or its `--web5-host-*` alias.\n * - **the seed's `validate-templates`** fails a template that sets a brand\n * token.\n * - **the shop owner's panel** renders a control per `editable` entry.\n *\n * A leaf module beside `hostScope.ts`, and for the same reason: both are data\n * that several packages must agree on, and both have to be readable from plain\n * Node tooling. Requiring this package's ENTRY from Node fails — the CSS import\n * in it is a syntax error to the CJS loader, which is what `scope-css.ts`\n * documents — but a deep import of a leaf like this one works, so the seed's\n * validator can read it without loading a component library.\n *\n * It was briefly its own package. That was justified by `embed-loader` needing\n * the list without taking core's eleven dependencies — and the loader turned\n * out not to need it at all, because `applyThemeOverrides` has owned runtime\n * token injection here since DL #131.\n *\n * ## The two buckets\n *\n * The split is about who WINS, not about what may be imported. A platform\n * adapter is free to read anything the store states; the bucket decides what\n * happens when a template has an opinion about the same token.\n *\n * - `brand` — the store's identity: colour roles and font families. The\n * imported value is written as the real token, last, so it wins\n * unconditionally. A template is not permitted to set these.\n * - `host` — the store's shape: corner radius today. The imported value is\n * written as `--web5-host-<name>` and consumed by core as a `var()`\n * fallback, so a template stating the real token beats it and a template\n * that stays silent inherits the store's.\n *\n * A token absent from this map is treated as `host`. That is deliberate and\n * safe: an alias nothing consumes renders nothing, so an adapter that learns\n * to read a token core has never heard of cannot override a template by\n * accident. The wiring line in core is the real gate for a host token, not the\n * entry here.\n *\n * ## Why all but one are brand\n *\n * This is not a new taxonomy. Twenty of these are the set\n * `web50-shopify-adapter` already emits, with a bucket attached; the\n * twenty-first, `--heading`, has been in core's catalogue since DL #131 and is\n * consumed by the seed, but no adapter fills it yet. Exactly one token changes\n * hands relative to the behaviour before DL #193 — `--radius`, which used to\n * win against the template that had chosen a different one. That single\n * misfiling is the whole of the bug this contract exists to fix.\n */\n\n/** How a value is spelled, which is what makes validation possible. */\nexport type TokenType =\n /** An HSL triplet with no `hsl()` wrapper — `0 0% 9%`. The core bridge wraps it. */\n | 'color-hsl'\n /** A CSS font stack — `'Poppins', ui-sans-serif, sans-serif`. */\n | 'font-stack'\n /** A CSS length. MUST carry a unit: a bare `0` turns `calc(var(--radius) - 4px)`\n * into a type error and takes the derived radius scale out entirely. */\n | 'length';\n\n/** Which layer wins when both a store and a template state this token. */\nexport type TokenBucket = 'brand' | 'host';\n\nexport interface TokenContractEntry {\n bucket: TokenBucket;\n type: TokenType;\n /** May the shop owner set this from the panel? */\n editable: boolean;\n /** Shown in the owner's panel. Absent for entries that are not editable. */\n label?: string;\n}\n\nconst brandColor = (label?: string): TokenContractEntry => ({\n bucket: 'brand',\n type: 'color-hsl',\n editable: false,\n ...(label === undefined ? {} : { label }),\n});\n\n/**\n * Every token a platform adapter may meaningfully emit today.\n *\n * Growth is adapter-driven on purpose: a token joins when an adapter can\n * actually read it, not on spec. `theme_overrides` is capped at 32 entries by\n * its proto, so there are twelve slots left and no reason to spend them on\n * speculation. `--spacing` is the tempting next one and should be resisted —\n * it scales every `p-*`, `m-*` and `gap-*` in the bundle from one number.\n */\nexport const THEME_TOKEN_CONTRACT: Readonly<Record<string, TokenContractEntry>> =\n Object.freeze({\n // ── brand · colour roles (18) ────────────────────────────────────────────\n '--background': brandColor(),\n '--foreground': brandColor(),\n '--card': brandColor(),\n '--card-foreground': brandColor(),\n '--popover': brandColor(),\n '--popover-foreground': brandColor(),\n '--primary': brandColor(),\n '--primary-foreground': brandColor(),\n '--secondary': brandColor(),\n '--secondary-foreground': brandColor(),\n '--muted': brandColor(),\n '--muted-foreground': brandColor(),\n '--accent': brandColor(),\n '--accent-foreground': brandColor(),\n '--border': brandColor(),\n '--input': brandColor(),\n '--ring': brandColor(),\n\n /**\n * Brand-shaped and supported end to end, but no adapter fills it yet: the\n * seed consumes it (`--color-heading-fg: hsl(var(--heading, var(--foreground)))`)\n * and core has catalogued it since DL #131, while `web50-shopify-adapter`\n * emits the other twenty. A store that states a distinct heading colour has\n * somewhere for it to go the moment an adapter learns to read one.\n */\n '--heading': brandColor(),\n\n // ── brand · type (2) ─────────────────────────────────────────────────────\n '--font-sans': { bucket: 'brand', type: 'font-stack', editable: false },\n '--font-display': { bucket: 'brand', type: 'font-stack', editable: false },\n\n // ── host · shape (1) ─────────────────────────────────────────────────────\n /**\n * The one token whose bucket changed, and the reason this contract exists.\n * Editable because it is the one value a store and a template are known to\n * disagree about in a way a merchant can see and wants to settle.\n */\n '--radius': {\n bucket: 'host',\n type: 'length',\n editable: true,\n label: 'Corner rounding',\n },\n });\n\n/**\n * The tokens written directly, which is the only question the loader has to\n * answer per key — everything else takes the alias path.\n */\nexport const BRAND_TOKENS: ReadonlySet<string> = Object.freeze(\n new Set(\n Object.entries(THEME_TOKEN_CONTRACT)\n .filter(([, entry]) => entry.bucket === 'brand')\n .map(([token]) => token),\n ),\n) as ReadonlySet<string>;\n\n/**\n * A token name we are willing to compose into a CSS declaration.\n *\n * The keys reaching the loader came out of a backend map, which came out of an\n * adapter reading a merchant's theme file. A key carrying `:` or `;` would\n * write arbitrary declarations onto the mount, so the shape is checked where\n * the declaration is built rather than trusted from the source.\n */\nexport const TOKEN_NAME_PATTERN = /^--[a-z0-9-]+$/;\n\n/** `--radius` → `--web5-host-radius`. Derived, never stored: one fewer thing to get wrong. */\nexport function hostAliasFor(token: string): string {\n return `--web5-host-${token.slice(2)}`;\n}\n\n/** Whether this token is written directly (brand) or as an alias (host, and anything unknown). */\nexport function bucketOf(token: string): TokenBucket {\n return THEME_TOKEN_CONTRACT[token]?.bucket ?? 'host';\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;;AAEA;;AAUA;;AAYA,MAAMA,UAAU,GAAIC,KAAc,KAA0B;EAC1DC,MAAM,EAAE,OAAO;EACfC,IA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;IACVF,MAAM,EAAE,MAAM;IACdC,IAAI,EAAE,QAAQ;IACdC,QAAQ,EAAE,IAAI;IACdH,KAAK,EAAE;EACT;AACF,CAAC,CAAC;;AAEJ;AACA;AACA;AACA;AACA,OAAO,MAAMQ,YAAiC,GAAGF,MAAM,CAACC,MAAM,CAC5D,IAAIE,GAAG,CACLH,MAAM,CAACI,OAAO,CAACL,oBAAoB,CAAC,CACjCM,MAAM,CAACC,IAAA;EAAA,IAAC,GAAGC,KAAK,CAAC,GAAAD,IAAA;EAAA,OAAKC,KAAK,CAACZ,MAAM,KAAK,OAAO;AAAA,EAAC,CAC/Ca,GAAG,CAACC,KAAA;EAAA,IAAC,CAACC,KAAK,CAAC,GAAAD,KAAA;EAAA,OAAKC,KAAK;AAAA,EAC3B,CACF,CAAwB;;AAExB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,kBAAkB,GAAG,gBAAgB;;AAElD;AACA,OAAO,SAASC,YAAYA,CAACF,KAAa,EAAU;EAClD,OAAO,eAAeA,KAAK,CAACG,KAAK,CAAC,CAAC,CAAC,EAAE;AACxC;;AAEA;AACA,OAAO,SAASC,QAAQA,CAACJ,KAAa,EAAe;EAAA,IAAAK,qBAAA;EACnD,OAAO,EAAAA,qBAAA,GAAAhB,oBAAoB,CAACW,KAAK,CAAC,qBAA3BK,qBAAA,CAA6BpB,MAAM,KAAI,MAAM;AACtD","ignoreList":[]}
|
|
@@ -7,12 +7,14 @@ export type ThemeOverrideKey = `--${string}`;
|
|
|
7
7
|
*/
|
|
8
8
|
export type ThemeOverrides = Record<ThemeOverrideKey, string>;
|
|
9
9
|
/**
|
|
10
|
-
* The known token catalog
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
10
|
+
* The known token catalog. GUIDANCE, NOT A GATE — `applyThemeOverrides` still
|
|
11
|
+
* applies any well-formed custom property, so the vocabulary can grow without a
|
|
12
|
+
* release here.
|
|
13
|
+
*
|
|
14
|
+
* Derived from `@wix/web5-token-contract` rather than restated, because two
|
|
15
|
+
* hand-maintained copies of one list is how they drift. The contract also
|
|
16
|
+
* carries what this Set cannot: which bucket each token is in, and therefore
|
|
17
|
+
* who wins when a store and a template disagree.
|
|
16
18
|
*/
|
|
17
19
|
export declare const THEME_OVERRIDE_TOKENS: ReadonlySet<string>;
|
|
18
20
|
export declare function applyThemeOverrides(overrides?: Record<string, string> | null): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applyThemeOverrides.d.ts","sourceRoot":"","sources":["../../../src/client/applyThemeOverrides.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"applyThemeOverrides.d.ts","sourceRoot":"","sources":["../../../src/client/applyThemeOverrides.ts"],"names":[],"mappings":"AA2CA,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;AAOF,wBAAgB,mBAAmB,CACjC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,GACxC,IAAI,CA0CN"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -75,6 +75,7 @@ export { getClientBundleOverride, isTrustedBundleHost, } from './client/clientBu
|
|
|
75
75
|
export { TEMPLATES_CDN_BASE, TEMPLATES_MANIFEST_URL, getTemplateOverride, isTemplatePickerRequested, isValidTemplateId, resolveClientBundleUrl, } from './client/clientBundleUrl';
|
|
76
76
|
export { mergeClientConfig, type DeepPartial } from './client/mergeClientConfig';
|
|
77
77
|
export { applyThemeOverrides, THEME_OVERRIDE_TOKENS, type ThemeOverrideKey, type ThemeOverrides, } from './client/applyThemeOverrides';
|
|
78
|
+
export { THEME_TOKEN_CONTRACT, BRAND_TOKENS, TOKEN_NAME_PATTERN, bucketOf, hostAliasFor, type TokenBucket, type TokenContractEntry, type TokenType, } from './theme/tokenContract';
|
|
78
79
|
export { PlacementResponseRenderer, PlacementSmoothHeight, type PlacementResponseRendererProps, type PlacementSection, type PlacementVariant, } from './components/placement/PlacementResponseRenderer';
|
|
79
80
|
export { buildPlacementDependencies, type BuildPlacementDependenciesOptions, } from './components/placement/buildPlacementDependencies';
|
|
80
81
|
export { PlacementPayloadProvider, usePlacementPayload, type PlacementPayloadContextValue, } from './components/placement/PlacementPayloadContext';
|
|
@@ -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,EACL,KAAK,QAAQ,EACb,KAAK,IAAI,EACT,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,cAAc,EACd,aAAa,EACb,YAAY,EACZ,UAAU,EACV,SAAS,EACT,QAAQ,EACR,cAAc,EACd,sBAAsB,EACtB,UAAU,GACX,MAAM,eAAe,CAAC;AAGvB,YAAY,EACV,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,wBAAwB,EACxB,aAAa,EACb,eAAe,EACf,cAAc,EACd,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,oBAAoB,EACpB,o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AAe,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,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The theme-token contract (DL #193).
|
|
3
|
+
*
|
|
4
|
+
* One home for the answer to "who is allowed to set this token, and who wins
|
|
5
|
+
* when more than one of them does". Three things need that answer and must not
|
|
6
|
+
* each keep their own copy:
|
|
7
|
+
*
|
|
8
|
+
* - **`applyThemeOverrides`** decides, per key, whether to write the real
|
|
9
|
+
* token or its `--web5-host-*` alias.
|
|
10
|
+
* - **the seed's `validate-templates`** fails a template that sets a brand
|
|
11
|
+
* token.
|
|
12
|
+
* - **the shop owner's panel** renders a control per `editable` entry.
|
|
13
|
+
*
|
|
14
|
+
* A leaf module beside `hostScope.ts`, and for the same reason: both are data
|
|
15
|
+
* that several packages must agree on, and both have to be readable from plain
|
|
16
|
+
* Node tooling. Requiring this package's ENTRY from Node fails — the CSS import
|
|
17
|
+
* in it is a syntax error to the CJS loader, which is what `scope-css.ts`
|
|
18
|
+
* documents — but a deep import of a leaf like this one works, so the seed's
|
|
19
|
+
* validator can read it without loading a component library.
|
|
20
|
+
*
|
|
21
|
+
* It was briefly its own package. That was justified by `embed-loader` needing
|
|
22
|
+
* the list without taking core's eleven dependencies — and the loader turned
|
|
23
|
+
* out not to need it at all, because `applyThemeOverrides` has owned runtime
|
|
24
|
+
* token injection here since DL #131.
|
|
25
|
+
*
|
|
26
|
+
* ## The two buckets
|
|
27
|
+
*
|
|
28
|
+
* The split is about who WINS, not about what may be imported. A platform
|
|
29
|
+
* adapter is free to read anything the store states; the bucket decides what
|
|
30
|
+
* happens when a template has an opinion about the same token.
|
|
31
|
+
*
|
|
32
|
+
* - `brand` — the store's identity: colour roles and font families. The
|
|
33
|
+
* imported value is written as the real token, last, so it wins
|
|
34
|
+
* unconditionally. A template is not permitted to set these.
|
|
35
|
+
* - `host` — the store's shape: corner radius today. The imported value is
|
|
36
|
+
* written as `--web5-host-<name>` and consumed by core as a `var()`
|
|
37
|
+
* fallback, so a template stating the real token beats it and a template
|
|
38
|
+
* that stays silent inherits the store's.
|
|
39
|
+
*
|
|
40
|
+
* A token absent from this map is treated as `host`. That is deliberate and
|
|
41
|
+
* safe: an alias nothing consumes renders nothing, so an adapter that learns
|
|
42
|
+
* to read a token core has never heard of cannot override a template by
|
|
43
|
+
* accident. The wiring line in core is the real gate for a host token, not the
|
|
44
|
+
* entry here.
|
|
45
|
+
*
|
|
46
|
+
* ## Why all but one are brand
|
|
47
|
+
*
|
|
48
|
+
* This is not a new taxonomy. Twenty of these are the set
|
|
49
|
+
* `web50-shopify-adapter` already emits, with a bucket attached; the
|
|
50
|
+
* twenty-first, `--heading`, has been in core's catalogue since DL #131 and is
|
|
51
|
+
* consumed by the seed, but no adapter fills it yet. Exactly one token changes
|
|
52
|
+
* hands relative to the behaviour before DL #193 — `--radius`, which used to
|
|
53
|
+
* win against the template that had chosen a different one. That single
|
|
54
|
+
* misfiling is the whole of the bug this contract exists to fix.
|
|
55
|
+
*/
|
|
56
|
+
/** How a value is spelled, which is what makes validation possible. */
|
|
57
|
+
export type TokenType =
|
|
58
|
+
/** An HSL triplet with no `hsl()` wrapper — `0 0% 9%`. The core bridge wraps it. */
|
|
59
|
+
'color-hsl'
|
|
60
|
+
/** A CSS font stack — `'Poppins', ui-sans-serif, sans-serif`. */
|
|
61
|
+
| 'font-stack'
|
|
62
|
+
/** A CSS length. MUST carry a unit: a bare `0` turns `calc(var(--radius) - 4px)`
|
|
63
|
+
* into a type error and takes the derived radius scale out entirely. */
|
|
64
|
+
| 'length';
|
|
65
|
+
/** Which layer wins when both a store and a template state this token. */
|
|
66
|
+
export type TokenBucket = 'brand' | 'host';
|
|
67
|
+
export interface TokenContractEntry {
|
|
68
|
+
bucket: TokenBucket;
|
|
69
|
+
type: TokenType;
|
|
70
|
+
/** May the shop owner set this from the panel? */
|
|
71
|
+
editable: boolean;
|
|
72
|
+
/** Shown in the owner's panel. Absent for entries that are not editable. */
|
|
73
|
+
label?: string;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Every token a platform adapter may meaningfully emit today.
|
|
77
|
+
*
|
|
78
|
+
* Growth is adapter-driven on purpose: a token joins when an adapter can
|
|
79
|
+
* actually read it, not on spec. `theme_overrides` is capped at 32 entries by
|
|
80
|
+
* its proto, so there are twelve slots left and no reason to spend them on
|
|
81
|
+
* speculation. `--spacing` is the tempting next one and should be resisted —
|
|
82
|
+
* it scales every `p-*`, `m-*` and `gap-*` in the bundle from one number.
|
|
83
|
+
*/
|
|
84
|
+
export declare const THEME_TOKEN_CONTRACT: Readonly<Record<string, TokenContractEntry>>;
|
|
85
|
+
/**
|
|
86
|
+
* The tokens written directly, which is the only question the loader has to
|
|
87
|
+
* answer per key — everything else takes the alias path.
|
|
88
|
+
*/
|
|
89
|
+
export declare const BRAND_TOKENS: ReadonlySet<string>;
|
|
90
|
+
/**
|
|
91
|
+
* A token name we are willing to compose into a CSS declaration.
|
|
92
|
+
*
|
|
93
|
+
* The keys reaching the loader came out of a backend map, which came out of an
|
|
94
|
+
* adapter reading a merchant's theme file. A key carrying `:` or `;` would
|
|
95
|
+
* write arbitrary declarations onto the mount, so the shape is checked where
|
|
96
|
+
* the declaration is built rather than trusted from the source.
|
|
97
|
+
*/
|
|
98
|
+
export declare const TOKEN_NAME_PATTERN: RegExp;
|
|
99
|
+
/** `--radius` → `--web5-host-radius`. Derived, never stored: one fewer thing to get wrong. */
|
|
100
|
+
export declare function hostAliasFor(token: string): string;
|
|
101
|
+
/** Whether this token is written directly (brand) or as an alias (host, and anything unknown). */
|
|
102
|
+
export declare function bucketOf(token: string): TokenBucket;
|
|
103
|
+
//# sourceMappingURL=tokenContract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokenContract.d.ts","sourceRoot":"","sources":["../../../src/theme/tokenContract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AAEH,uEAAuE;AACvE,MAAM,MAAM,SAAS;AACnB,oFAAoF;AAClF,WAAW;AACb,iEAAiE;GAC/D,YAAY;AACd;yEACyE;GACvE,QAAQ,CAAC;AAEb,0EAA0E;AAC1E,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,MAAM,CAAC;AAE3C,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,WAAW,CAAC;IACpB,IAAI,EAAE,SAAS,CAAC;IAChB,kDAAkD;IAClD,QAAQ,EAAE,OAAO,CAAC;IAClB,4EAA4E;IAC5E,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AASD;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CA8C1E,CAAC;AAEL;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,WAAW,CAAC,MAAM,CAMrB,CAAC;AAEzB;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,QAAmB,CAAC;AAEnD,8FAA8F;AAC9F,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAElD;AAED,kGAAkG;AAClG,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,CAEnD"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/web5-core",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.62.0",
|
|
5
5
|
"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": "
|
|
103
|
+
"falconPackageHash": "6796550854d3a51bfecb2ebb957ef475051e33aae7c4e8f71812d718"
|
|
104
104
|
}
|
|
@@ -26,23 +26,6 @@
|
|
|
26
26
|
--input: 0 0% 89.8%;
|
|
27
27
|
--ring: 0 0% 3.9%;
|
|
28
28
|
|
|
29
|
-
/* Chart colors */
|
|
30
|
-
--chart-1: 180 60% 65%;
|
|
31
|
-
--chart-2: 120 50% 60%;
|
|
32
|
-
--chart-3: 40 50% 70%;
|
|
33
|
-
--chart-4: 200 70% 60%;
|
|
34
|
-
--chart-5: 320 60% 70%;
|
|
35
|
-
|
|
36
|
-
/* Sidebar colors */
|
|
37
|
-
--sidebar: 0 0% 100%;
|
|
38
|
-
--sidebar-foreground: 0 0% 3.9%;
|
|
39
|
-
--sidebar-primary: 0 0% 9%;
|
|
40
|
-
--sidebar-primary-foreground: 0 0% 98%;
|
|
41
|
-
--sidebar-accent: 0 0% 96.1%;
|
|
42
|
-
--sidebar-accent-foreground: 0 0% 9%;
|
|
43
|
-
--sidebar-border: 0 0% 89.8%;
|
|
44
|
-
--sidebar-ring: 0 0% 3.9%;
|
|
45
|
-
|
|
46
29
|
/* Typography tokens */
|
|
47
30
|
--font-sans: ui-sans-serif, system-ui, sans-serif;
|
|
48
31
|
--font-serif: serif;
|
|
@@ -53,7 +36,14 @@
|
|
|
53
36
|
--font-display: var(--font-sans);
|
|
54
37
|
|
|
55
38
|
/* Spacing & shape tokens */
|
|
56
|
-
|
|
39
|
+
/* Shape follows the host page unless a template states its own (DL #193).
|
|
40
|
+
* `embed-loader` writes `--web5-host-radius` from the store's imported theme;
|
|
41
|
+
* a template declaring `--radius` outright beats this fallback, and with
|
|
42
|
+
* neither present the seed default applies exactly as before. The whole
|
|
43
|
+
* derived scale rides on it — `--radius-sm/md/lg/xl` in tailwind-theme.css
|
|
44
|
+
* are live `var()`/`calc()` references, so one value reaches all 48
|
|
45
|
+
* `rounded-*` call sites. */
|
|
46
|
+
--radius: var(--web5-host-radius, 0.5rem);
|
|
57
47
|
--tracking-normal: -0.02em;
|
|
58
48
|
--spacing: 0.25rem;
|
|
59
49
|
|
|
@@ -140,13 +130,4 @@
|
|
|
140
130
|
--border: 0 0% 14.9%;
|
|
141
131
|
--input: 0 0% 14.9%;
|
|
142
132
|
--ring: 0 0% 83.1%;
|
|
143
|
-
|
|
144
|
-
--sidebar: 0 0% 3.9%;
|
|
145
|
-
--sidebar-foreground: 0 0% 98%;
|
|
146
|
-
--sidebar-primary: 0 0% 98%;
|
|
147
|
-
--sidebar-primary-foreground: 0 0% 9%;
|
|
148
|
-
--sidebar-accent: 0 0% 14.9%;
|
|
149
|
-
--sidebar-accent-foreground: 0 0% 98%;
|
|
150
|
-
--sidebar-border: 0 0% 14.9%;
|
|
151
|
-
--sidebar-ring: 0 0% 83.1%;
|
|
152
133
|
}
|
|
@@ -47,22 +47,6 @@
|
|
|
47
47
|
--color-text-accent-hover: var(--text-accent-hover);
|
|
48
48
|
--color-accent-border: var(--accent-border);
|
|
49
49
|
|
|
50
|
-
--color-chart-1: hsl(var(--chart-1));
|
|
51
|
-
--color-chart-2: hsl(var(--chart-2));
|
|
52
|
-
--color-chart-3: hsl(var(--chart-3));
|
|
53
|
-
--color-chart-4: hsl(var(--chart-4));
|
|
54
|
-
--color-chart-5: hsl(var(--chart-5));
|
|
55
|
-
|
|
56
|
-
--color-sidebar: hsl(var(--sidebar));
|
|
57
|
-
--color-sidebar-foreground: hsl(var(--sidebar-foreground));
|
|
58
|
-
--color-sidebar-primary: hsl(var(--sidebar-primary));
|
|
59
|
-
--color-sidebar-primary-foreground: hsl(var(--sidebar-primary-foreground));
|
|
60
|
-
--color-sidebar-accent: hsl(var(--sidebar-accent));
|
|
61
|
-
--color-sidebar-accent-foreground: hsl(var(--sidebar-accent-foreground));
|
|
62
|
-
--color-sidebar-border: hsl(var(--sidebar-border));
|
|
63
|
-
--color-sidebar-ring: hsl(var(--sidebar-ring));
|
|
64
|
-
|
|
65
|
-
|
|
66
50
|
--radius-sm: calc(var(--radius) - 4px);
|
|
67
51
|
--radius-md: calc(var(--radius) - 2px);
|
|
68
52
|
--radius-lg: var(--radius);
|
|
@@ -76,7 +60,6 @@
|
|
|
76
60
|
--shadow-lg: var(--shadow-lg);
|
|
77
61
|
--shadow-xl: var(--shadow-xl);
|
|
78
62
|
--shadow-2xl: var(--shadow-2xl);
|
|
79
|
-
--shadow-sticky-header: var(--shadow-sticky-header);
|
|
80
63
|
|
|
81
64
|
--tracking-tighter: calc(var(--tracking-normal) - 0.05em);
|
|
82
65
|
--tracking-tight: calc(var(--tracking-normal) - 0.025em);
|