@ikas/bp-storefront 1.4.0-beta.14 → 1.4.0-beta.141

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/dist/functions/api/product/index.js +1 -1
  2. package/dist/functions/models/image/index.d.ts +65 -20
  3. package/dist/functions/models/image/index.js +1 -1
  4. package/dist/functions/models/product/variant/index.d.ts +96 -6
  5. package/dist/functions/models/product/variant/index.js +1 -1
  6. package/dist/functions/models/product-list/index.js +1 -1
  7. package/dist/functions/models/validator/address/index.d.ts +70 -2
  8. package/dist/functions/stores/cart/index.js +1 -1
  9. package/dist/functions/stores/customer/index.d.ts +29 -23
  10. package/dist/index.d.ts +3 -0
  11. package/dist/index.js +1 -1
  12. package/dist/packages/storefront-config/src/index.js +1 -1
  13. package/dist/packages/storefront-config/src/theme-globals.js +1 -0
  14. package/dist/storefront-config/src/index.d.ts +4 -0
  15. package/dist/storefront-config/src/theme-globals.d.ts +305 -0
  16. package/dist/storefront-models/src/index.d.ts +1 -0
  17. package/dist/storefront-models/src/models/blueprint/prop-value/color.d.ts +2 -0
  18. package/dist/storefront-models/src/models/product/campaign/data/index.d.ts +2 -0
  19. package/dist/storefront-models/src/models/product/campaign/filter/index.d.ts +1 -1
  20. package/dist/storefront-models/src/models/product/campaign/product-tiered-discount/index.d.ts +13 -0
  21. package/dist/storefront-models/src/models/product/variant/index.d.ts +17 -0
  22. package/dist/theme/settings/index.d.ts +48 -0
  23. package/dist/theme/settings/index.js +1 -0
  24. package/dist/utils/component-renderer.js +1 -1
  25. package/dist/utils/pay-with-ikas.d.ts +552 -0
  26. package/dist/utils/pay-with-ikas.js +1 -0
  27. package/dist/utils/svg.d.ts +15 -0
  28. package/dist/utils/svg.js +1 -0
  29. package/package.json +1 -1
@@ -0,0 +1,305 @@
1
+ export declare function cssVarCamelCase(str: string): string;
2
+ /**
3
+ * Shared "theme globals" contract — the serialized, runtime-readable form of the editor's
4
+ * global theme settings (the left "Styles" panel): global variables + design tokens
5
+ * (colors, typography, breakpoints, keyframes, color schemes).
6
+ *
7
+ * This is packed into `IkasStorefrontConfig.themeGlobals` and read by the
8
+ * `@ikas/bp-storefront` runtime API (getThemeSetting / getThemeColors / ...). The same
9
+ * payload is produced for SSR, client hydration, and the editor canvas via
10
+ * {@link serializeThemeGlobals}, and returned by the CLI/MCP `list-theme-globals` reader.
11
+ */
12
+ /** Global-variable value kinds, mirrored from the editor sidebar `GlobalVariableType`. */
13
+ export type GlobalVariableType = "TEXT" | "RICH_TEXT" | "IMAGE" | "COLOR" | "NUMBER" | "BOOLEAN" | "BORDER" | "SHADOW";
14
+ /** A theme "global variable" (Theme Settings panel). `name` is the stable runtime key. */
15
+ export type ThemeSetting = {
16
+ /** Stable runtime key — the variable's `variableName` (e.g. `_6Q0KV7VGGM`). */
17
+ name: string;
18
+ /** Human-facing label. */
19
+ displayName: string;
20
+ type: GlobalVariableType;
21
+ /**
22
+ * Concrete value, discriminated by `type`:
23
+ * - TEXT/RICH_TEXT → string · NUMBER → number · BOOLEAN → boolean · COLOR → hex string.
24
+ * - IMAGE → an IkasImage REFERENCE, e.g. `{ id: "theme-images/<uuid>" }`. It has NO
25
+ * `.url` field — resolve to a URL with `getDefaultSrc(value)` / `getSrc(value, size)`
26
+ * from `@ikas/bp-storefront`, never read `value.url`.
27
+ * - BORDER/SHADOW → object, or `null` when unset.
28
+ */
29
+ value: any;
30
+ };
31
+ /** A single-value design token (color). `cssVar` resolves the live, scheme-aware value. */
32
+ export type DesignToken = {
33
+ id: string;
34
+ name: string;
35
+ /** Resolved base/default value (e.g. a hex string), or null when unset. */
36
+ resolved: string | null;
37
+ /** CSS custom-property reference, e.g. `var(--primaryColor)`. */
38
+ cssVar: string;
39
+ };
40
+ /** A typography token (text style). Apply `className` to an element to use it. */
41
+ export type TypographyToken = {
42
+ id: string;
43
+ name: string;
44
+ /** Resolved CSS values keyed by camelCased CSS property (e.g. `fontSize`, `fontWeight`). */
45
+ resolved: Record<string, string>;
46
+ /** Class selector the editor emits for this text style, e.g. `_<id>`. */
47
+ className: string;
48
+ /** True when this is the theme's default/global text style (the editor's "Make Default Style"). */
49
+ isDefault: boolean;
50
+ };
51
+ export type BreakpointToken = {
52
+ id: string;
53
+ name: string;
54
+ width: number;
55
+ };
56
+ /** A resolved CSS style entry, e.g. { property: "animation-duration", value: "1.4s" }. */
57
+ export type StyleEntry = {
58
+ property: string;
59
+ value: string;
60
+ };
61
+ export type KeyframeToken = {
62
+ id: string;
63
+ name: string;
64
+ type: string;
65
+ /** CSS reference — the animation name / class the editor emits, e.g. `_<id>`. */
66
+ ref: string;
67
+ /**
68
+ * Keyframe-level animation "settings" (the editor's Settings popover). These are CSS
69
+ * animation/transition properties and DIFFER BY TYPE: a `keyframe` carries
70
+ * animation-duration/-iteration-count/-play-state/-delay/-timing-function/-direction/
71
+ * -fill-mode/-timeline/-range + transform-origin; a `transition` carries `transition`.
72
+ * Both may carry backface-visibility. Empty when none are set.
73
+ */
74
+ settings?: StyleEntry[];
75
+ /** Animation points; each point may carry its own resolved styles. */
76
+ points?: {
77
+ point: string;
78
+ styles?: StyleEntry[];
79
+ }[];
80
+ };
81
+ /**
82
+ * A color SLOT — one entry of the top-level `getThemeColorSchemes().schemes` list. It is a
83
+ * label only (`id` + display `name`); the actual colors for the slot live in each palette's
84
+ * `colorsByScheme[id]`.
85
+ */
86
+ export type ColorSchemeSlot = {
87
+ id: string;
88
+ name: string;
89
+ };
90
+ /**
91
+ * A color palette (one entry of `getThemeColorSchemes().values`). Its colors live in
92
+ * `colorsByScheme` — the top-level `schemes` list holds only slot id→name labels.
93
+ */
94
+ export type ColorSchemeToken = {
95
+ id: string;
96
+ name: string;
97
+ isDefault: boolean;
98
+ /** Class selector to activate this scheme value, e.g. `_<id>`. */
99
+ className: string;
100
+ /**
101
+ * This palette's colors, keyed by color-SLOT id (the ids in
102
+ * `getThemeColorSchemes().schemes`). THIS — not the top-level `schemes` array — is
103
+ * the source of truth for swatch colors; iterate it to render a palette. Prefer
104
+ * `cssVar` for live, in-editor reactivity; `resolved` is a render-time snapshot.
105
+ */
106
+ colorsByScheme: Record<string, {
107
+ resolved: string | null;
108
+ cssVar: string;
109
+ }>;
110
+ };
111
+ export type ThemeGlobals = {
112
+ settings: Record<string, ThemeSetting>;
113
+ colors: DesignToken[];
114
+ typography: TypographyToken[];
115
+ breakpoints: BreakpointToken[];
116
+ keyframes: KeyframeToken[];
117
+ colorSchemes: {
118
+ schemes: ColorSchemeSlot[];
119
+ values: ColorSchemeToken[];
120
+ };
121
+ };
122
+ /**
123
+ * Stamps a theme-token type as its RUNTIME view (what the `@ikas/bp-storefront` getters return).
124
+ * `name` is authoring-only: it is non-unique (two design assets can ship the same one) and
125
+ * non-stable (renaming must not break references), so matching a token by name is unsafe.
126
+ * Identify one by its STABLE `id` instead — color → `cssVar` (`var(--<id>)`), typography &
127
+ * keyframe → `className` / `ref` (`_<id>`), color-scheme slot → a `colorsByScheme` key. Need a
128
+ * human-readable label? Read `list_theme_globals` (MCP/CLI) or the editor's Styles panel.
129
+ *
130
+ * `name` is REMOVED outright rather than re-added as a documented `@deprecated never`: that was
131
+ * tried first and only yields a soft strikethrough, so `getThemeTypography().find(t => t.name ===
132
+ * "…")` still compiled and agents wrote it anyway. A hard `Omit` makes it a compile error, and
133
+ * `ikas-component build` runs `tsc --noEmit` and exits non-zero on it — so such a component cannot
134
+ * be built or shipped at all.
135
+ *
136
+ * The full {@link ThemeGlobals} (with real names) is still what the config holds and what the
137
+ * CLI/MCP `list-theme-globals` AUTHORING read returns — that is how an agent resolves "the token
138
+ * named X" to its id. `name` is hidden only at these runtime getter return types.
139
+ */
140
+ type RuntimeView<T> = Omit<T, "name">;
141
+ export type RuntimeDesignToken = RuntimeView<DesignToken>;
142
+ export type RuntimeTypographyToken = RuntimeView<TypographyToken>;
143
+ export type RuntimeBreakpointToken = RuntimeView<BreakpointToken>;
144
+ export type RuntimeKeyframeToken = RuntimeView<KeyframeToken>;
145
+ export type RuntimeColorSchemeToken = RuntimeView<ColorSchemeToken>;
146
+ export type RuntimeColorSchemeSlot = RuntimeView<ColorSchemeSlot>;
147
+ /**
148
+ * Runtime view of {@link ThemeGlobals.colorSchemes} (returned by `getThemeColorSchemes`). The
149
+ * slot list carries only `{ id }`: slot display LABELS (the slot `name`) are authoring-only —
150
+ * read them via the CLI/MCP `list-theme-globals` or the editor, not at runtime. Render a palette
151
+ * by iterating each value's `colorsByScheme`, keyed by slot id.
152
+ */
153
+ export type RuntimeThemeColorSchemes = {
154
+ schemes: RuntimeColorSchemeSlot[];
155
+ values: RuntimeColorSchemeToken[];
156
+ };
157
+ export declare const EMPTY_THEME_GLOBALS: ThemeGlobals;
158
+ type StyleValueLike = {
159
+ value?: any;
160
+ patternValueId?: string;
161
+ keyframeValueId?: string;
162
+ colorSchemeId?: string;
163
+ };
164
+ type StyleConditionLike = {
165
+ value?: StyleValueLike;
166
+ };
167
+ type ElementStyleLike = {
168
+ property: string;
169
+ value?: StyleValueLike | StyleConditionLike[];
170
+ };
171
+ type PatternValueLike = {
172
+ id: string;
173
+ name?: string;
174
+ style?: ElementStyleLike;
175
+ };
176
+ type PatternElementLike = {
177
+ id: string;
178
+ name?: string;
179
+ styles?: ElementStyleLike[];
180
+ isDefault?: boolean;
181
+ };
182
+ type ColorSchemeLike = {
183
+ id: string;
184
+ name?: string;
185
+ };
186
+ type ColorSchemeValueColorLike = {
187
+ colorSchemeId: string;
188
+ style?: StyleValueLike;
189
+ };
190
+ type ColorSchemeValueLike = {
191
+ id: string;
192
+ name?: string;
193
+ isDefault?: boolean;
194
+ /** Set when this scheme belongs to an installed design asset; groups the default fallback. */
195
+ designAssetId?: string;
196
+ colors?: ColorSchemeValueColorLike[];
197
+ };
198
+ type BreakpointLike = {
199
+ id: string;
200
+ name?: string;
201
+ width?: number;
202
+ };
203
+ type KeyframePointLike = {
204
+ point: string;
205
+ styles?: ElementStyleLike[];
206
+ };
207
+ type KeyframeLike = {
208
+ id: string;
209
+ name?: string;
210
+ type?: string;
211
+ styles?: ElementStyleLike[];
212
+ points?: KeyframePointLike[];
213
+ };
214
+ type VariableLike = {
215
+ id?: string;
216
+ variableName?: string;
217
+ displayName?: string;
218
+ variableType?: string;
219
+ defaultValue?: any;
220
+ isGlobal?: boolean;
221
+ };
222
+ export type SerializableProject = {
223
+ globalsBlueprint?: {
224
+ module?: {
225
+ variables?: VariableLike[];
226
+ };
227
+ };
228
+ theme?: {
229
+ breakpoints?: BreakpointLike[];
230
+ keyframes?: KeyframeLike[];
231
+ pattern?: {
232
+ values?: PatternValueLike[];
233
+ elements?: PatternElementLike[];
234
+ colorSchemes?: ColorSchemeLike[];
235
+ colorSchemeValues?: ColorSchemeValueLike[];
236
+ };
237
+ };
238
+ };
239
+ export declare const cssVarRef: (id: string) => string;
240
+ export declare const rawClassRef: (id: string) => string;
241
+ /**
242
+ * CSS function-style token a code component writes to reference a theme breakpoint's width.
243
+ * Breakpoints can't ship as `var(--…)` because the CSS spec forbids `var()` in a media-query
244
+ * condition — and a `var()` there fails SILENTLY (it parses as valid-looking CSS but the whole
245
+ * query is dropped). So a code component writes a deliberately non-standard `bp(<breakpointId>)`
246
+ * token inside its OWN `min-width` / `max-width` condition; it resolves to a concrete `<width>px`
247
+ * at render time against the LIVE theme (see {@link resolveBreakpointMediaTokens}). The author
248
+ * picks the direction, so there is no implicit boundary magic:
249
+ * `@media (max-width: bp(_mob))` -> `@media (max-width: 767px)`
250
+ * `@media (min-width: bp(_mob))` -> `@media (min-width: 767px)`
251
+ * id-based, never a human name (the id is stable across renames). The id comes from
252
+ * `list-theme-globals` / `getThemeBreakpoints()`.
253
+ */
254
+ export declare const breakpointCssToken: (id: string) => string;
255
+ /**
256
+ * Coerce a theme's breakpoint list into the `{ id, width }` shape {@link resolveBreakpointMediaTokens}
257
+ * needs, defaulting a missing/non-numeric width to 0. Shared by both render sites so the coercion
258
+ * rule lives in one place; the editor passes `breakpoints.map(b => b.toJSON())` (Yjs → plain) first.
259
+ */
260
+ export declare const toResolverBreakpoints: (breakpoints: {
261
+ id: string;
262
+ width?: number | string;
263
+ }[]) => {
264
+ id: string;
265
+ width: number;
266
+ }[];
267
+ /**
268
+ * Replace breakpoint width tokens (`bp(<id>)`) in a CSS string with the breakpoint's concrete
269
+ * `<width>px`, using the given theme breakpoints. Pure text substitution — the single place
270
+ * breakpoint resolution lives, called at every render-time CC-CSS composition site
271
+ * (code-generator, editor canvas). Unknown ids are left untouched (the partner dependency
272
+ * collector ships referenced breakpoints into the target theme, so a real token always resolves).
273
+ * The `bp(<id>)` literal carries its own `)` boundary, so one id is never matched inside another.
274
+ *
275
+ * A `calc()` containing a bp token (e.g. the documented exclusive boundary
276
+ * `calc(bp(<id>) + 1px)`, but any pure px arithmetic: `calc(bp(a) * 2 + 10px)`,
277
+ * `calc(bp(a) - bp(b))`, `-webkit-calc(...)`, …) is folded to a single computed `<width>px`
278
+ * literal, never emitted as `calc()`: csso — the code-generator's minifier for inline/base
279
+ * page styles — silently drops a media block whose condition contains `calc()`, and older
280
+ * browsers (e.g. Safari < 16.4) don't evaluate `calc()` in media conditions either.
281
+ *
282
+ * Folding limits (an out-of-limit calc degrades to plain token substitution, keeping its
283
+ * `calc()` form — which csso will still drop from a media condition): bodies longer than
284
+ * CALC_SCAN_LIMIT chars; an uppercase `CALC(` keyword (the scan is lowercase, matching every
285
+ * compiled-CSS emitter); `calc(` inside a string/comment can confuse the plain-text scan.
286
+ */
287
+ export declare function resolveBreakpointMediaTokens(css: string, breakpoints: {
288
+ id: string;
289
+ width: number;
290
+ }[]): string;
291
+ /**
292
+ * True for system/reserved global variables (e.g. `__breakpointsVar__`) — internal
293
+ * constructs that live in `module.variables` but are NOT user-facing theme settings.
294
+ * Single source of truth for the `__name__` reserved-id convention; consumers (theme
295
+ * serialization here, partner publish dependency collection) share it so a new
296
+ * synthetic var is excluded everywhere at once.
297
+ */
298
+ export declare const isReservedVariableId: (id?: string | null) => boolean;
299
+ /**
300
+ * Build the {@link ThemeGlobals} payload from a project's theme. Pure and dependency-free
301
+ * (works on plain JSON), so the same function serves SSR (`IProject`) and the editor canvas
302
+ * (`YjsProject.toJSON()`).
303
+ */
304
+ export declare function serializeThemeGlobals(project?: SerializableProject | null): ThemeGlobals;
305
+ export {};
@@ -157,6 +157,7 @@ export * from "./models/product/campaign/filter";
157
157
  export * from "./models/product/campaign/product-buyx-then-gety";
158
158
  export * from "./models/product/campaign/product-campaign-date-range-field";
159
159
  export * from "./models/product/campaign/product-fixed-discount";
160
+ export * from "./models/product/campaign/product-tiered-discount";
160
161
  export * from "./models/product/campaign-offer";
161
162
  export * from "./models/product/filter";
162
163
  export * from "./models/product/group";
@@ -1,3 +1,5 @@
1
1
  export interface IBlueprintColorPropValue {
2
2
  value: string;
3
+ patternValueId?: string;
4
+ colorSchemeId?: string;
3
5
  }
@@ -1,6 +1,7 @@
1
1
  import { IkasProductBuyXThenGetY } from "../product-buyx-then-gety";
2
2
  import { IkasProductCampaignDateRangeField } from "../product-campaign-date-range-field";
3
3
  import { IkasProductFixedDiscount } from "../product-fixed-discount";
4
+ import { IkasProductTieredDiscount } from "../product-tiered-discount";
4
5
  export type IkasProductCampaignData = {
5
6
  applicableCustomerGroupIds: string[] | null;
6
7
  applicableCustomerIds: string[] | null;
@@ -21,6 +22,7 @@ export type IkasProductCampaignData = {
21
22
  usageCount: number;
22
23
  usageLimit: number | null;
23
24
  usageLimitPerCustomer: number | null;
25
+ tieredDiscount: IkasProductTieredDiscount | null;
24
26
  };
25
27
  export type IkasCampaignApplicablePrice = "DISCOUNT_PRICE" | "SELL_PRICE";
26
28
  export type IkasCampaignCreatedFor = "ABANDONED_CHECKOUT" | "CART" | "CUSTOMER_REVIEW";
@@ -2,4 +2,4 @@ export type IkasProductCampaignFilter = {
2
2
  idList: string[];
3
3
  type: IkasCampaignFilterType;
4
4
  };
5
- export type IkasCampaignFilterType = "CATEGORY" | "PRODUCT" | "PRODUCT_BRAND" | "PRODUCT_TAG" | "VARIANT";
5
+ export type IkasCampaignFilterType = "CATEGORY" | "PRODUCT" | "PRODUCT_BRAND" | "PRODUCT_TAG" | "VARIANT" | "PRODUCT_AND_VARIANT";
@@ -0,0 +1,13 @@
1
+ import { IkasProductCampaignFilter } from "../filter";
2
+ import { IkasCampaignMinMaxRangeField } from "../product-fixed-discount";
3
+ export type IkasProductTieredDiscountRule = {
4
+ amount: number | null;
5
+ lineItemQuantityRange: IkasCampaignMinMaxRangeField | null;
6
+ priceRange: IkasCampaignMinMaxRangeField | null;
7
+ };
8
+ export type IkasProductTieredDiscount = {
9
+ filters: IkasProductCampaignFilter[] | null;
10
+ isApplyByCartAmount: boolean | null;
11
+ rules: IkasProductTieredDiscountRule[];
12
+ shouldMatchAllConditions: boolean | null;
13
+ };
@@ -29,3 +29,20 @@ export type IkasAppliedCampaignAmount = {
29
29
  formattedPrice: string | null;
30
30
  discountPercentage: string | null;
31
31
  };
32
+ export type IkasTieredDiscountProduct = {
33
+ amount: number | null;
34
+ lineItemQuantityRange: {
35
+ min: number;
36
+ max: number;
37
+ };
38
+ type: IkasCampaignType;
39
+ sellPrice: number;
40
+ finalPrice: number;
41
+ sellPriceWithQuantity: number;
42
+ finalPriceWithQuantity: number;
43
+ formattedSellPrice: string;
44
+ formattedSellPriceWithQuantity: string;
45
+ formattedFinalPrice: string;
46
+ formattedFinalPriceWithQuantity: string;
47
+ salesChannelIds: string[] | null;
48
+ };
@@ -0,0 +1,48 @@
1
+ import { RuntimeBreakpointToken, RuntimeDesignToken, RuntimeKeyframeToken, RuntimeThemeColorSchemes, RuntimeTypographyToken, ThemeSetting } from "../../storefront-config/src";
2
+ /**
3
+ * Register the live global-variable object (`_g_`) so `getThemeSetting`/`getThemeSettings`
4
+ * return actual runtime values (constants, computed getters, and in-editor edits) instead
5
+ * of the serialized design-time defaults. Called by generated code, not by component authors.
6
+ */
7
+ export declare function registerThemeSettingValues(values: Record<string, any> | null): void;
8
+ /** All global variables (Theme Settings) defined for the theme. */
9
+ export declare function getThemeSettings(): ThemeSetting[];
10
+ /**
11
+ * A single global variable by its stable key (`variableName`, e.g. `_6Q0KV7VGGM`).
12
+ * Discover keys via {@link getThemeSettings} (each item carries a human `displayName`).
13
+ * The returned `value` is the live blueprint value when available, else the default.
14
+ * Its shape is discriminated by `type` (see {@link ThemeSetting.value}); note an
15
+ * IMAGE setting's value is an image REFERENCE (no `.url`) — resolve with
16
+ * `getDefaultSrc`/`getSrc`.
17
+ */
18
+ export declare function getThemeSetting(name: string): ThemeSetting | undefined;
19
+ /** Convenience: the resolved value of a global variable, or `undefined` if not found. */
20
+ export declare function getThemeSettingValue(name: string): any;
21
+ /** Theme color tokens. Each carries a resolved value and a `var(--id)` CSS reference. */
22
+ export declare function getThemeColors(): RuntimeDesignToken[];
23
+ /** Theme typography tokens (text styles). Apply `className` or read `resolved` CSS values. */
24
+ export declare function getThemeTypography(): RuntimeTypographyToken[];
25
+ /** Theme responsive breakpoints (`{ id, width }`). */
26
+ export declare function getThemeBreakpoints(): RuntimeBreakpointToken[];
27
+ /** Theme keyframe/transition animations. Use `ref` as the CSS animation name. */
28
+ export declare function getThemeKeyframes(): RuntimeKeyframeToken[];
29
+ /**
30
+ * Theme color schemes (palettes). Returns two PARALLEL lists with different jobs:
31
+ * - `schemes`: the color SLOTS as `{ id }` only — no colors and no display label live here at
32
+ * runtime. A slot's human name is authoring-only (read it via the CLI/MCP `list-theme-globals`
33
+ * or the editor); at runtime identify a slot solely by its `id`.
34
+ * - `values`: the actual palettes. A palette's colors live in its `colorsByScheme`
35
+ * map, keyed by slot id → `{ resolved, cssVar }`.
36
+ *
37
+ * To render swatches, iterate `values[].colorsByScheme` (the source of truth for
38
+ * colors), NOT the top-level `schemes` array — `schemes` carries slot ids only, so
39
+ * iterating it renders empty:
40
+ *
41
+ * const { values } = getThemeColorSchemes();
42
+ * values.forEach(palette =>
43
+ * Object.entries(palette.colorsByScheme).forEach(([slotId, { resolved, cssVar }]) => {
44
+ * // slotId → stable slot key, cssVar → live var() ref (prefer this), resolved → hex snapshot
45
+ * })
46
+ * );
47
+ */
48
+ export declare function getThemeColorSchemes(): RuntimeThemeColorSchemes;
@@ -0,0 +1 @@
1
+ import{__assign as o}from'./../../ext/tslib/tslib.es6.mjs.js';import{IkasStorefrontConfig as l}from"../../packages/storefront-config/src/index.js";var n=null;function e(o){n=o}function i(l){return n&&l.name in n?o(o({},l),{value:n[l.name]}):l}function r(){var o,n;return Object.values(null!==(n=null===(o=l.themeGlobals)||void 0===o?void 0:o.settings)&&void 0!==n?n:{}).map(i)}function t(o){var n,e,r=null===(e=null===(n=l.themeGlobals)||void 0===n?void 0:n.settings)||void 0===e?void 0:e[o];return r?i(r):void 0}function u(o){var l;return null===(l=t(o))||void 0===l?void 0:l.value}function v(){var o,n;return null!==(n=null===(o=l.themeGlobals)||void 0===o?void 0:o.colors)&&void 0!==n?n:[]}function s(){var o,n;return null!==(n=null===(o=l.themeGlobals)||void 0===o?void 0:o.typography)&&void 0!==n?n:[]}function a(){var o,n;return null!==(n=null===(o=l.themeGlobals)||void 0===o?void 0:o.breakpoints)&&void 0!==n?n:[]}function d(){var o,n;return null!==(n=null===(o=l.themeGlobals)||void 0===o?void 0:o.keyframes)&&void 0!==n?n:[]}function m(){var o,n;return null!==(n=null===(o=l.themeGlobals)||void 0===o?void 0:o.colorSchemes)&&void 0!==n?n:{schemes:[],values:[]}}export{a as getThemeBreakpoints,m as getThemeColorSchemes,v as getThemeColors,d as getThemeKeyframes,t as getThemeSetting,u as getThemeSettingValue,r as getThemeSettings,s as getThemeTypography,e as registerThemeSettingValues};
@@ -1 +1 @@
1
- import{__assign as r}from'./../ext/tslib/tslib.es6.mjs.js';import{createElement as t}from'./../ext/preact/dist/preact.mjs.js';import{useRef as n,useEffect as e,useMemo as o}from'./../ext/preact/hooks/dist/hooks.mjs.js';var c={};function u(r,t){for(var n=[],e=r;e;){var o=e.getAttribute("id");o&&n.unshift(o),e=e.parentElement}var c=n.map(function(r){return'[id="'.concat(r,'"]')}).join(" ");return c?"".concat(c,' [id="').concat(t,'"]'):'[id="'.concat(t,'"]')}function a(a){var s=a.id,i=a.components,f=a.style,l=a.className,m=a.parentProps,d=void 0===m?c:m,p=a.map,v=void 0===p?c:p,h=n([]),j=n(d),y=n(v),g=n(null);j.current=d,y.current=v,e(function(){if(i&&0!==i.length){h.current.forEach(function(r){return r()}),h.current=[];for(var t=0;t<i.length;t++){var n=i[t];if(n.l){var e="".concat(s,"-").concat(t),o=u(g.current,e),c=n.l(o,r(r({},j.current),y.current),{},{id:e,key:e});"function"==typeof c&&h.current.push(c)}}return function(){h.current.forEach(function(r){return r()}),h.current=[]}}},[i,s]);var E=o(function(){return i&&0!==i.length?i.map(function(t,n){var e="".concat(s,"-").concat(n);return t.r(r(r({},j.current),y.current),{},{id:e,key:e})}).join(""):""},[i,s]);return i&&0!==i.length?t("div",{id:s,ref:g,dangerouslySetInnerHTML:{__html:E},style:r({display:"contents"},f),className:l}):null}export{a as IkasComponentRenderer};
1
+ import{__assign as t}from'./../ext/tslib/tslib.es6.mjs.js';import{createElement as r}from'./../ext/preact/dist/preact.mjs.js';import{useRef as n,useMemo as e,useEffect as c}from'./../ext/preact/hooks/dist/hooks.mjs.js';var o={},a="data-ikas-ccr",u=0;function i(t,r){if(!t)return function(t,r){for(var n=[],e=t;e;){var c=e.getAttribute("id");c&&n.unshift(c),e=e.parentElement}var o=n.map(function(t){return'[id="'.concat(t,'"]')}).join(" ");return o?"".concat(o,' [id="').concat(r,'"]'):'[id="'.concat(r,'"]')}(t,r);var n=t.getAttribute(a);return n||(n="r".concat(++u),t.setAttribute(a,n)),"[".concat(a,'="').concat(n,'"] > [id="').concat(r,'"]')}function s(a){var u=a.id,s=a.components,f=a.style,l=a.className,d=a.parentProps,m=void 0===d?o:d,p=a.map,v=void 0===p?o:p,h=n([]),y=n(m),j=n(v),g=n(null);y.current=m,j.current=v;var b=e(function(){return(Array.isArray(s)?s:s?[s]:[]).flat().filter(Boolean)},[s]);c(function(){if(0!==b.length){h.current.forEach(function(t){return t()}),h.current=[];for(var r=0;r<b.length;r++){var n=b[r];if(n.l){var e="".concat(u,"-").concat(r),c=i(g.current,e),o=n.l(c,t(t({},y.current),j.current),{},{id:e,key:e});"function"==typeof o&&h.current.push(o)}}return function(){h.current.forEach(function(t){return t()}),h.current=[]}}},[b,u]);var k=e(function(){return 0===b.length?"":b.map(function(r,n){var e="".concat(u,"-").concat(n);return r.r(t(t({},y.current),j.current),{},{id:e,key:e})}).join("")},[b,u]);return 0===b.length?null:r("div",{id:u,ref:g,dangerouslySetInnerHTML:{__html:k},style:t({display:"contents"},f),className:l})}export{s as IkasComponentRenderer};