@akinon/theme-contract 2.0.164-rc.1 → 2.0.164

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/CHANGELOG.md CHANGED
@@ -1,8 +1,10 @@
1
1
  # @akinon/theme-contract
2
2
 
3
- ## 2.0.164-rc.1
3
+ ## 2.0.164
4
4
 
5
- ## 2.0.164-rc.0
5
+ ### Patch Changes
6
+
7
+ - 64548e48: ZERO-5483: Render the redesigned theme settings on the storefront. The theme's colour roles (`linkColor`, `headingColor`, `textColor`, `footerBackgroundColor`, `borderColor`), custom colours and the typography styles managed by the new settings page are published as `--theme-*` variables (server `<style>` and live in the designer, with deleted keys removed) and, only for keys that are set, as low-specificity defaults inside text-block rich text and the composed footer, so a theme that never touches the new settings renders as before. `pageUpEnabled` turns on a back-to-top button mounted by `ThemeModals` (also exported as `ThemePageUp`; icon from `pageUpIcon`, else the theme's `up-arrow` icon, rendered as an image; lifted above fixed bottom bars and floating buttons in its corner, or by `--pz-bottom-overlay-offset`). Breadcrumb blocks without their own separator use `breadcrumbSeparator`; the social icons list can opt into the theme's `socialNetworks` with `useThemeSocialNetworks`, and `x` draws the X mark. `@akinon/theme-contract` types the new settings keys and typography fields. projectzeronext's stock header uses the theme's `logo`, `brandName` and `logoWidthDesktop`/`logoWidthMobile`, and the root layout adds the theme's `favicon` next to the PWA icons.
6
8
 
7
9
  ## 2.0.163
8
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akinon/theme-contract",
3
- "version": "2.0.164-rc.1",
3
+ "version": "2.0.164",
4
4
  "description": "Shared wire contract between the theme editor (pz-theme-editor) and the storefront renderer (@akinon/pz-theme): theme types, postMessage envelope, runtime validation and origin helpers.",
5
5
  "license": "MIT",
6
6
  "main": "src/index.ts",
package/src/types.ts CHANGED
@@ -143,6 +143,8 @@ export interface ThemeCustomFont {
143
143
  sources: ThemeCustomFontSource[];
144
144
  }
145
145
 
146
+ export type ThemeTextTransform = 'none' | 'uppercase' | 'lowercase';
147
+
146
148
  export interface ThemeTypographyVariant {
147
149
  key: string;
148
150
  label?: string;
@@ -152,8 +154,43 @@ export interface ThemeTypographyVariant {
152
154
  fontSize: number;
153
155
  color: string;
154
156
  styles: string[];
157
+ /**
158
+ * Px, written by the redesigned Web Theme Settings. A finite
159
+ * `lineHeight` marks the variant as managed by that UI: only then does the
160
+ * storefront emit its size/weight/line-height/letter-spacing/transform
161
+ * variables and the rich-text element defaults for it.
162
+ */
163
+ lineHeight?: number;
164
+ /** px, may be negative */
165
+ letterSpacing?: number;
166
+ textTransform?: ThemeTextTransform;
167
+ /** A merchant-created style (`custom-<id>`), not one of the built-in keys. */
168
+ custom?: boolean;
169
+ }
170
+
171
+ /** A "+ RENK EKLE" row; its CSS variable is `--theme-${id}`. */
172
+ export interface ThemeCustomColor {
173
+ /** Matches /^custom-[a-z0-9]+$/. */
174
+ id: string;
175
+ name: string;
176
+ /** #RRGGBB */
177
+ value: string;
155
178
  }
156
179
 
180
+ /** One `socialNetworks` entry, keyed by network. */
181
+ export interface ThemeSocialNetwork {
182
+ url?: string;
183
+ /** SVG markup or an image URL. */
184
+ icon?: string;
185
+ }
186
+
187
+ /**
188
+ * Per-component style overrides (`componentStyles`). Editor-only
189
+ * for now; the storefront does not consume them yet, so the shape stays loose.
190
+ */
191
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
192
+ export type ThemeComponentStyle = Record<string, any>;
193
+
157
194
  export interface ThemeSettings {
158
195
  colors?: {
159
196
  primary?: string;
@@ -161,6 +198,43 @@ export interface ThemeSettings {
161
198
  };
162
199
  typography?: ThemeTypographyVariant[];
163
200
  customFonts?: ThemeCustomFont[];
201
+ // The keys the redesigned Web Theme Settings reads and writes.
202
+ // All optional and additive; "unset" means the key is absent.
203
+ logo?: string;
204
+ favicon?: string;
205
+ brandName?: string;
206
+ /** px */
207
+ logoWidthDesktop?: number;
208
+ /** px; falls back to `logoWidthDesktop` */
209
+ logoWidthMobile?: number;
210
+ pageUpEnabled?: boolean;
211
+ /** SVG markup or an image URL; unset means the built-in up arrow. */
212
+ pageUpIcon?: string;
213
+ breadcrumbSeparator?: string;
214
+ mainMenuSticky?: boolean;
215
+ backgroundColor?: string;
216
+ primaryColor?: string;
217
+ secondaryColor?: string;
218
+ color3?: string;
219
+ color4?: string;
220
+ linkColor?: string;
221
+ headingColor?: string;
222
+ textColor?: string;
223
+ footerBackgroundColor?: string;
224
+ borderColor?: string;
225
+ /** Editor display labels, keyed by colour storage key. */
226
+ colorNames?: Record<string, string>;
227
+ /** Editor display list only; the storefront keys off value presence. */
228
+ hiddenColors?: string[];
229
+ customColors?: ThemeCustomColor[];
230
+ /** Editor-only quick-access swatches. */
231
+ quickColors?: string[];
232
+ /** Google Font families added in the editor; never loaded by the storefront. */
233
+ typefaces?: string[];
234
+ componentStyles?: Record<string, ThemeComponentStyle>;
235
+ socialNetworks?: Record<string, ThemeSocialNetwork>;
236
+ /** Icon overrides: icon key → SVG markup. */
237
+ icons?: Record<string, string>;
164
238
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
165
239
  [key: string]: any;
166
240
  }