@ikas/bp-storefront 1.4.0-beta.6 → 1.4.0-beta.61
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/analytics/analytics-functions/helpers.js +1 -1
- package/dist/analytics/analytics.js +1 -1
- package/dist/analytics/google-tag-manager/productView.js +1 -1
- package/dist/analytics/google-tag-manager/viewCategory.js +1 -1
- package/dist/analytics/ikas/analytics.js +1 -1
- package/dist/analytics/utils.js +1 -1
- package/dist/ext/lodash/flatten.js +1 -0
- package/dist/functions/api/cart/index.js +1 -1
- package/dist/functions/models/category/index.js +1 -1
- package/dist/functions/models/product/option-set/index.d.ts +18 -0
- package/dist/functions/models/product/option-set/index.js +1 -1
- package/dist/functions/models/product-list/index.js +1 -1
- package/dist/functions/models/validator/account-info/index.js +1 -1
- package/dist/functions/models/validator/contact-form/index.js +1 -1
- package/dist/functions/models/validator/coupon-code-form/index.js +1 -1
- package/dist/functions/models/validator/customer-review/index.js +1 -1
- package/dist/functions/models/validator/forgot-password/index.js +1 -1
- package/dist/functions/models/validator/login/index.js +1 -1
- package/dist/functions/models/validator/newsletter-subscription/index.js +1 -1
- package/dist/functions/models/validator/order-tracking/index.js +1 -1
- package/dist/functions/models/validator/recover-password/index.js +1 -1
- package/dist/functions/models/validator/register/index.js +1 -1
- package/dist/functions/models/validator/sms-login/index.js +1 -1
- package/dist/functions/models/validator/verify-phone-number/index.js +1 -1
- package/dist/functions/stores/base/index.d.ts +76 -1
- package/dist/functions/stores/base/index.js +1 -1
- package/dist/functions/stores/cart/index.js +1 -1
- package/dist/functions/stores/customer/index.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/packages/storefront-config/src/index.js +1 -1
- package/dist/packages/storefront-config/src/theme-globals.js +1 -0
- package/dist/storefront-config/src/index.d.ts +4 -0
- package/dist/storefront-config/src/theme-globals.d.ts +168 -0
- package/dist/storefront-models/src/models/blueprint/prop-value/index.d.ts +2 -0
- package/dist/storefront-models/src/models/blueprint/prop-value/svg-list.d.ts +3 -0
- package/dist/storefront-models/src/models/blueprint/prop-value/svg.d.ts +3 -0
- package/dist/theme/settings/index.d.ts +33 -0
- package/dist/theme/settings/index.js +1 -0
- package/dist/utils/component-renderer.d.ts +2 -1
- package/dist/utils/component-renderer.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { IkasCustomerReviewSettings, IkasCustomerSettings, IkasIndexPageSeoSetting, IkasLoyaltyProgram, IkasMerchantSettings, IkasProductBackInStockSettings, IkasSalesChannelPaymentGateway, IkasStorefontMetaTemplates, IkasStorefrontB2BSettings, IkasStorefrontPopup, IkasStorefrontRouting, IkasStorefrontType, IkasThemeStockPreference } from "../../storefront-models/src";
|
|
2
|
+
import { ThemeGlobals } from "./theme-globals";
|
|
3
|
+
export * from "./theme-globals";
|
|
2
4
|
export declare class IkasStorefrontConfig {
|
|
3
5
|
static themeId?: string;
|
|
4
6
|
static apiUrl?: string;
|
|
@@ -27,6 +29,7 @@ export declare class IkasStorefrontConfig {
|
|
|
27
29
|
static tiktokPixelId?: string;
|
|
28
30
|
static stockPreference?: IkasThemeStockPreference;
|
|
29
31
|
static translations: Record<string, any>;
|
|
32
|
+
static themeGlobals: ThemeGlobals;
|
|
30
33
|
static storefrontJSScripts: string[];
|
|
31
34
|
static highPriorityStoreFrontJSScripts: string[];
|
|
32
35
|
static customerReviewSettings?: IkasCustomerReviewSettings | null;
|
|
@@ -100,6 +103,7 @@ export type IkasStorefrontConfigParams = {
|
|
|
100
103
|
tiktokPixelId?: string;
|
|
101
104
|
stockPreference?: IkasThemeStockPreference;
|
|
102
105
|
translations: Record<string, any>;
|
|
106
|
+
themeGlobals: ThemeGlobals;
|
|
103
107
|
storefrontJSScripts: string[];
|
|
104
108
|
highPriorityStoreFrontJSScripts: string[];
|
|
105
109
|
customerReviewSettings?: IkasCustomerReviewSettings | null;
|
|
@@ -0,0 +1,168 @@
|
|
|
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
|
+
/** Concrete value (string/number/boolean for primitives, object/null for IMAGE/BORDER/SHADOW). */
|
|
22
|
+
value: any;
|
|
23
|
+
};
|
|
24
|
+
/** A single-value design token (color). `cssVar` resolves the live, scheme-aware value. */
|
|
25
|
+
export type DesignToken = {
|
|
26
|
+
id: string;
|
|
27
|
+
name: string;
|
|
28
|
+
/** Resolved base/default value (e.g. a hex string), or null when unset. */
|
|
29
|
+
resolved: string | null;
|
|
30
|
+
/** CSS custom-property reference, e.g. `var(--primaryColor)`. */
|
|
31
|
+
cssVar: string;
|
|
32
|
+
};
|
|
33
|
+
/** A typography token (text style). Apply `className` to an element to use it. */
|
|
34
|
+
export type TypographyToken = {
|
|
35
|
+
id: string;
|
|
36
|
+
name: string;
|
|
37
|
+
/** Resolved CSS values keyed by camelCased CSS property (e.g. `fontSize`, `fontWeight`). */
|
|
38
|
+
resolved: Record<string, string>;
|
|
39
|
+
/** Class selector the editor emits for this text style, e.g. `_<id>`. */
|
|
40
|
+
className: string;
|
|
41
|
+
};
|
|
42
|
+
export type BreakpointToken = {
|
|
43
|
+
id: string;
|
|
44
|
+
name: string;
|
|
45
|
+
width: number;
|
|
46
|
+
};
|
|
47
|
+
export type KeyframeToken = {
|
|
48
|
+
id: string;
|
|
49
|
+
name: string;
|
|
50
|
+
type: string;
|
|
51
|
+
/** CSS reference — the animation name / class the editor emits, e.g. `_<id>`. */
|
|
52
|
+
ref: string;
|
|
53
|
+
points?: {
|
|
54
|
+
point: string;
|
|
55
|
+
}[];
|
|
56
|
+
};
|
|
57
|
+
export type ColorSchemeToken = {
|
|
58
|
+
id: string;
|
|
59
|
+
name: string;
|
|
60
|
+
isDefault: boolean;
|
|
61
|
+
/** Class selector to activate this scheme value, e.g. `_<id>`. */
|
|
62
|
+
className: string;
|
|
63
|
+
/** Per-scheme color overrides, keyed by color-scheme id. */
|
|
64
|
+
colorsByScheme: Record<string, {
|
|
65
|
+
resolved: string | null;
|
|
66
|
+
cssVar: string;
|
|
67
|
+
}>;
|
|
68
|
+
};
|
|
69
|
+
export type ThemeGlobals = {
|
|
70
|
+
settings: Record<string, ThemeSetting>;
|
|
71
|
+
colors: DesignToken[];
|
|
72
|
+
typography: TypographyToken[];
|
|
73
|
+
breakpoints: BreakpointToken[];
|
|
74
|
+
keyframes: KeyframeToken[];
|
|
75
|
+
colorSchemes: {
|
|
76
|
+
schemes: {
|
|
77
|
+
id: string;
|
|
78
|
+
name: string;
|
|
79
|
+
}[];
|
|
80
|
+
values: ColorSchemeToken[];
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
export declare const EMPTY_THEME_GLOBALS: ThemeGlobals;
|
|
84
|
+
type StyleValueLike = {
|
|
85
|
+
value?: any;
|
|
86
|
+
patternValueId?: string;
|
|
87
|
+
keyframeValueId?: string;
|
|
88
|
+
colorSchemeId?: string;
|
|
89
|
+
};
|
|
90
|
+
type StyleConditionLike = {
|
|
91
|
+
value?: StyleValueLike;
|
|
92
|
+
};
|
|
93
|
+
type ElementStyleLike = {
|
|
94
|
+
property: string;
|
|
95
|
+
value?: StyleValueLike | StyleConditionLike[];
|
|
96
|
+
};
|
|
97
|
+
type PatternValueLike = {
|
|
98
|
+
id: string;
|
|
99
|
+
name?: string;
|
|
100
|
+
style?: ElementStyleLike;
|
|
101
|
+
};
|
|
102
|
+
type PatternElementLike = {
|
|
103
|
+
id: string;
|
|
104
|
+
name?: string;
|
|
105
|
+
styles?: ElementStyleLike[];
|
|
106
|
+
};
|
|
107
|
+
type ColorSchemeLike = {
|
|
108
|
+
id: string;
|
|
109
|
+
name?: string;
|
|
110
|
+
};
|
|
111
|
+
type ColorSchemeValueColorLike = {
|
|
112
|
+
colorSchemeId: string;
|
|
113
|
+
style?: StyleValueLike;
|
|
114
|
+
};
|
|
115
|
+
type ColorSchemeValueLike = {
|
|
116
|
+
id: string;
|
|
117
|
+
name?: string;
|
|
118
|
+
isDefault?: boolean;
|
|
119
|
+
/** Set when this scheme belongs to an installed design asset; groups the default fallback. */
|
|
120
|
+
designAssetId?: string;
|
|
121
|
+
colors?: ColorSchemeValueColorLike[];
|
|
122
|
+
};
|
|
123
|
+
type BreakpointLike = {
|
|
124
|
+
id: string;
|
|
125
|
+
name?: string;
|
|
126
|
+
width?: number;
|
|
127
|
+
};
|
|
128
|
+
type KeyframePointLike = {
|
|
129
|
+
point: string;
|
|
130
|
+
};
|
|
131
|
+
type KeyframeLike = {
|
|
132
|
+
id: string;
|
|
133
|
+
name?: string;
|
|
134
|
+
type?: string;
|
|
135
|
+
points?: KeyframePointLike[];
|
|
136
|
+
};
|
|
137
|
+
type VariableLike = {
|
|
138
|
+
id?: string;
|
|
139
|
+
variableName?: string;
|
|
140
|
+
displayName?: string;
|
|
141
|
+
variableType?: string;
|
|
142
|
+
defaultValue?: any;
|
|
143
|
+
isGlobal?: boolean;
|
|
144
|
+
};
|
|
145
|
+
export type SerializableProject = {
|
|
146
|
+
globalsBlueprint?: {
|
|
147
|
+
module?: {
|
|
148
|
+
variables?: VariableLike[];
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
theme?: {
|
|
152
|
+
breakpoints?: BreakpointLike[];
|
|
153
|
+
keyframes?: KeyframeLike[];
|
|
154
|
+
pattern?: {
|
|
155
|
+
values?: PatternValueLike[];
|
|
156
|
+
elements?: PatternElementLike[];
|
|
157
|
+
colorSchemes?: ColorSchemeLike[];
|
|
158
|
+
colorSchemeValues?: ColorSchemeValueLike[];
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
/**
|
|
163
|
+
* Build the {@link ThemeGlobals} payload from a project's theme. Pure and dependency-free
|
|
164
|
+
* (works on plain JSON), so the same function serves SSR (`IProject`) and the editor canvas
|
|
165
|
+
* (`YjsProject.toJSON()`).
|
|
166
|
+
*/
|
|
167
|
+
export declare function serializeThemeGlobals(project?: SerializableProject | null): ThemeGlobals;
|
|
168
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { BreakpointToken, ColorSchemeToken, DesignToken, KeyframeToken, ThemeSetting, TypographyToken } 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
|
+
*/
|
|
15
|
+
export declare function getThemeSetting(name: string): ThemeSetting | undefined;
|
|
16
|
+
/** Convenience: the resolved value of a global variable, or `undefined` if not found. */
|
|
17
|
+
export declare function getThemeSettingValue(name: string): any;
|
|
18
|
+
/** Theme color tokens. Each carries a resolved value and a `var(--id)` CSS reference. */
|
|
19
|
+
export declare function getThemeColors(): DesignToken[];
|
|
20
|
+
/** Theme typography tokens (text styles). Apply `className` or read `resolved` CSS values. */
|
|
21
|
+
export declare function getThemeTypography(): TypographyToken[];
|
|
22
|
+
/** Theme responsive breakpoints (`{ id, name, width }`). */
|
|
23
|
+
export declare function getThemeBreakpoints(): BreakpointToken[];
|
|
24
|
+
/** Theme keyframe/transition animations. Use `ref` as the CSS animation name. */
|
|
25
|
+
export declare function getThemeKeyframes(): KeyframeToken[];
|
|
26
|
+
/** Theme color schemes — the available schemes plus per-scheme color values. */
|
|
27
|
+
export declare function getThemeColorSchemes(): {
|
|
28
|
+
schemes: {
|
|
29
|
+
id: string;
|
|
30
|
+
name: string;
|
|
31
|
+
}[];
|
|
32
|
+
values: ColorSchemeToken[];
|
|
33
|
+
};
|
|
@@ -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};
|
|
@@ -30,8 +30,9 @@ interface IkasComponentRendererProps {
|
|
|
30
30
|
/** Optional CSS class name applied to the wrapper div. */
|
|
31
31
|
className?: string;
|
|
32
32
|
}
|
|
33
|
-
export declare function IkasComponentRenderer({ id: baseId, components, style, className, parentProps, map, }: IkasComponentRendererProps): import("preact").VNode<import("preact").ClassAttributes<
|
|
33
|
+
export declare function IkasComponentRenderer({ id: baseId, components, style, className, parentProps, map, }: IkasComponentRendererProps): import("preact").VNode<import("preact").ClassAttributes<HTMLDivElement> & {
|
|
34
34
|
id: string;
|
|
35
|
+
ref: import("preact/hooks").MutableRef<HTMLDivElement | null>;
|
|
35
36
|
dangerouslySetInnerHTML: {
|
|
36
37
|
__html: string;
|
|
37
38
|
};
|
|
@@ -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
|
|
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};
|