@useinsider/guido 3.12.1-beta.3214ec4 → 3.13.0-beta.ef18f66
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/README.md +16 -1
- package/dist/@types/config/schemas.js +27 -25
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +110 -101
- package/dist/components/organisms/header/ViewOptions.vue.js +3 -3
- package/dist/components/organisms/header/version-history/ViewOptions.vue.js +1 -1
- package/dist/composables/useAllowlist.js +50 -0
- package/dist/composables/useSave.js +42 -23
- package/dist/composables/useStripo.js +72 -69
- package/dist/composables/useUserRole.js +12 -0
- package/dist/enums/roles.js +4 -0
- package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/controls/blockBackground/index.js +10 -0
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textAfter.js +12 -12
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textBefore.js +12 -12
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textAfter.js +12 -12
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textBefore.js +12 -12
- package/dist/extensions/Blocks/Recommendation/extension.js +23 -21
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +41 -40
- package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +7 -7
- package/dist/extensions/Blocks/controlFactories.js +125 -75
- package/dist/guido.css +1 -1
- package/dist/services/allowlistApi.js +15 -0
- package/dist/services/stripoApi.js +18 -18
- package/dist/src/@types/config/schemas.d.ts +10 -0
- package/dist/src/components/Guido.vue.d.ts +18 -2
- package/dist/src/composables/useAllowlist.d.ts +6 -0
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/composables/useStripo.d.ts +3 -2
- package/dist/src/composables/useUserRole.d.ts +3 -0
- package/dist/src/enums/roles.d.ts +9 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/blockBackground/index.d.ts +14 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -0
- package/dist/src/extensions/Blocks/controlFactories.d.ts +36 -0
- package/dist/src/services/allowlistApi.d.ts +4 -0
- package/dist/src/stores/config.d.ts +21 -1
- package/dist/static/styles/components/base-input.css.js +6 -7
- package/dist/stores/config.js +21 -19
- package/dist/utils/pairProductVariables.js +44 -43
- package/dist/{extensions/Blocks/Recommendation/utils → utils}/preserveTextStyles.js +1 -1
- package/package.json +2 -2
- /package/dist/src/{extensions/Blocks/Recommendation/utils → utils}/preserveTextStyles.d.ts +0 -0
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { useHttp as
|
|
2
|
-
import { useToaster as
|
|
3
|
-
import { MAX_DEFAULT_TEMPLATE_ID as
|
|
4
|
-
import { useBlankTemplate as
|
|
5
|
-
const
|
|
6
|
-
|
|
1
|
+
import { useHttp as m } from "../composables/useHttp.js";
|
|
2
|
+
import { useToaster as y } from "../composables/useToaster.js";
|
|
3
|
+
import { MAX_DEFAULT_TEMPLATE_ID as f } from "../enums/defaults.js";
|
|
4
|
+
import { useBlankTemplate as g } from "./blankTemplate.js";
|
|
5
|
+
const l = () => ({
|
|
6
|
+
id: 0,
|
|
7
|
+
stripoId: 0,
|
|
8
|
+
unsubscriptionPreferencePages: []
|
|
9
|
+
}), D = () => {
|
|
10
|
+
const { get: s, post: u } = m(), { handleError: r } = y(), { getBlankTemplate: n } = g();
|
|
7
11
|
return {
|
|
8
12
|
getToken: async () => {
|
|
9
13
|
try {
|
|
@@ -26,13 +30,13 @@ const D = () => {
|
|
|
26
30
|
},
|
|
27
31
|
getDefaultTemplate: async () => {
|
|
28
32
|
try {
|
|
29
|
-
const t = new URLSearchParams(window.location.search), e = t.get("default-template"),
|
|
30
|
-
if (!i && !
|
|
31
|
-
return await
|
|
32
|
-
const
|
|
33
|
-
return !a || typeof a != "object" || !("html" in a) || !("css" in a) ? await
|
|
33
|
+
const t = new URLSearchParams(window.location.search), e = t.get("default-template"), p = t.get("master"), o = e ? parseInt(e) : 0, i = o >= 1 && o <= f ? o : 0;
|
|
34
|
+
if (!i && !p)
|
|
35
|
+
return await n();
|
|
36
|
+
const d = `/stripo/default-template/${i}`, { data: c } = await s(d), a = typeof c == "string" ? JSON.parse(c) : c;
|
|
37
|
+
return !a || typeof a != "object" || !("html" in a) || !("css" in a) ? await n() : a;
|
|
34
38
|
} catch (t) {
|
|
35
|
-
return r(t, "Failed to fetch default template"),
|
|
39
|
+
return r(t, "Failed to fetch default template"), n();
|
|
36
40
|
}
|
|
37
41
|
},
|
|
38
42
|
getSyncModulesStatus: async () => {
|
|
@@ -53,13 +57,9 @@ const D = () => {
|
|
|
53
57
|
getSyncModule: async (t) => {
|
|
54
58
|
try {
|
|
55
59
|
const { data: e } = await s(`/stripo/stripo-modules/${t}/get`);
|
|
56
|
-
return e;
|
|
60
|
+
return Array.isArray(e == null ? void 0 : e.unsubscriptionPreferencePages) ? e : l();
|
|
57
61
|
} catch (e) {
|
|
58
|
-
return r(e, "Failed to get sync module"),
|
|
59
|
-
id: 0,
|
|
60
|
-
stripoId: 0,
|
|
61
|
-
unsubscriptionPreferencePages: []
|
|
62
|
-
};
|
|
62
|
+
return r(e, "Failed to get sync module"), l();
|
|
63
63
|
}
|
|
64
64
|
},
|
|
65
65
|
setSyncModuleUnsubscriptionPages: async (t) => {
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import type { DynamicContentNode } from '../generic';
|
|
9
9
|
import type { SavedTemplateDetails } from '../stripo';
|
|
10
|
+
import type { ActionButton } from '../toaster';
|
|
10
11
|
import * as v from 'valibot';
|
|
11
12
|
/**
|
|
12
13
|
* Handler function for external validation before save
|
|
@@ -14,6 +15,11 @@ import * as v from 'valibot';
|
|
|
14
15
|
* @returns Promise<boolean> - true if valid, false to cancel save
|
|
15
16
|
*/
|
|
16
17
|
export type ExternalValidationHandler = (data: Omit<SavedTemplateDetails, 'metadata'>) => Promise<boolean>;
|
|
18
|
+
/** Content for the domain-allowlist block toaster (self-served by useAllowlist). */
|
|
19
|
+
export interface AllowlistToastContent {
|
|
20
|
+
message: string;
|
|
21
|
+
actionButton?: ActionButton;
|
|
22
|
+
}
|
|
17
23
|
/**
|
|
18
24
|
* Message type constants for email templates
|
|
19
25
|
*/
|
|
@@ -377,6 +383,8 @@ export declare const FeaturesSchema: v.ObjectSchema<{
|
|
|
377
383
|
readonly liquidSyntax: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
378
384
|
/** Enable autosave (3-min interval + tab-hide). User toggles on/off from the header. */
|
|
379
385
|
readonly autosave: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
386
|
+
/** Enable pre-save domain-allowlist validation (opt-in; Guido self-serves the block toaster) */
|
|
387
|
+
readonly allowlistEnabled: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
380
388
|
}, undefined>;
|
|
381
389
|
/**
|
|
382
390
|
* Default block types available in Stripo
|
|
@@ -764,6 +772,8 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
|
|
|
764
772
|
readonly liquidSyntax: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
765
773
|
/** Enable autosave (3-min interval + tab-hide). User toggles on/off from the header. */
|
|
766
774
|
readonly autosave: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
775
|
+
/** Enable pre-save domain-allowlist validation (opt-in; Guido self-serves the block toaster) */
|
|
776
|
+
readonly allowlistEnabled: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
767
777
|
}, undefined>, {}>;
|
|
768
778
|
/** Block configuration */
|
|
769
779
|
readonly blocks: v.OptionalSchema<v.ObjectSchema<{
|
|
@@ -4,8 +4,12 @@ import type { SavedTemplateDetails } from '@@/Types/stripo';
|
|
|
4
4
|
type __VLS_Props = {
|
|
5
5
|
/** Guido configuration object */
|
|
6
6
|
config: GuidoConfigInput;
|
|
7
|
+
/** Host data readiness. Only config init waits; the runtime preloads regardless. */
|
|
8
|
+
ready?: boolean;
|
|
7
9
|
};
|
|
8
|
-
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
10
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
11
|
+
ready: boolean;
|
|
12
|
+
}>, {
|
|
9
13
|
dynamicContent: {
|
|
10
14
|
insert: (data: DynamicContent) => void;
|
|
11
15
|
close: () => void;
|
|
@@ -30,8 +34,17 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__
|
|
|
30
34
|
ready: () => void;
|
|
31
35
|
"onboarding:finished": () => void;
|
|
32
36
|
"test-email:click": () => void;
|
|
33
|
-
}, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props
|
|
37
|
+
}, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
38
|
+
ready: boolean;
|
|
39
|
+
}>>>, {
|
|
40
|
+
ready: boolean;
|
|
41
|
+
}>;
|
|
34
42
|
export default _default;
|
|
43
|
+
type __VLS_WithDefaults<P, D> = {
|
|
44
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
|
|
45
|
+
default: D[K];
|
|
46
|
+
}> : P[K];
|
|
47
|
+
};
|
|
35
48
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
36
49
|
type __VLS_TypePropsToOption<T> = {
|
|
37
50
|
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
@@ -41,3 +54,6 @@ type __VLS_TypePropsToOption<T> = {
|
|
|
41
54
|
required: true;
|
|
42
55
|
};
|
|
43
56
|
};
|
|
57
|
+
type __VLS_PrettifyLocal<T> = {
|
|
58
|
+
[K in keyof T]: T[K];
|
|
59
|
+
} & {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { AllowlistToastContent } from '@@/Types/config/schemas';
|
|
2
|
+
export declare const buildAllowlistSettingsUrl: (value: string) => string;
|
|
3
|
+
export declare const useAllowlist: () => {
|
|
4
|
+
getBlockedDomains: (html: string, css: string) => Promise<string[]>;
|
|
5
|
+
resolveToast: (blockedDomains: string[]) => Promise<AllowlistToastContent>;
|
|
6
|
+
};
|
|
@@ -96,6 +96,7 @@ export declare const useConfig: () => {
|
|
|
96
96
|
modulesDisabled: boolean;
|
|
97
97
|
liquidSyntax: boolean;
|
|
98
98
|
autosave: boolean;
|
|
99
|
+
allowlistEnabled: boolean;
|
|
99
100
|
};
|
|
100
101
|
blocks: {
|
|
101
102
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -227,6 +228,7 @@ export declare const useConfig: () => {
|
|
|
227
228
|
modulesDisabled: boolean;
|
|
228
229
|
liquidSyntax: boolean;
|
|
229
230
|
autosave: boolean;
|
|
231
|
+
allowlistEnabled: boolean;
|
|
230
232
|
} | null>;
|
|
231
233
|
blocks: import("vue").ComputedRef<{
|
|
232
234
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Metadata, Options, Template } from '@@/Types/stripo';
|
|
2
|
-
export declare const useStripo: (
|
|
3
|
-
initPlugin: (template: Template) => Promise<void>;
|
|
2
|
+
export declare const useStripo: () => {
|
|
3
|
+
initPlugin: (template: Template, metadata: Metadata, options: Options) => Promise<void>;
|
|
4
|
+
preloadRuntime: () => void;
|
|
4
5
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Insider user-role aliases — the kebab-case wire values returned by
|
|
3
|
+
* GET /get-user-role-and-email (the same set honey-badger's RoleEnums defines).
|
|
4
|
+
* Only the manage-user role is needed in Guido: it gates the "Add to allowlist"
|
|
5
|
+
* action in the domain-allowlist block toaster. SD-143197.
|
|
6
|
+
*/
|
|
7
|
+
export declare enum RoleEnums {
|
|
8
|
+
MANAGE_USERS = "manage-users"
|
|
9
|
+
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* These IDs are returned by the getId() method of each control
|
|
4
4
|
*/
|
|
5
5
|
export declare enum RecommendationControlId {
|
|
6
|
+
BLOCK_BACKGROUND = "recommendation-block-background-color-control",
|
|
6
7
|
BUTTON_ALIGN = "recommendation-block-button-align-control",
|
|
7
8
|
BUTTON_BORDER = "recommendation-block-button-border-control",
|
|
8
9
|
BUTTON_BORDER_RADIUS = "recommendation-block-button-border-radius-control",
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const BlockBackgroundColorControl: {
|
|
2
|
+
new (): {
|
|
3
|
+
getId(): string;
|
|
4
|
+
getLabels(): {
|
|
5
|
+
title: string;
|
|
6
|
+
};
|
|
7
|
+
getTargetNodes(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode[];
|
|
8
|
+
getAdditionalModifications(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
|
|
9
|
+
getParentControlId(): string;
|
|
10
|
+
api: import("@stripoinc/ui-editor-extensions").ControlApi;
|
|
11
|
+
getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
|
|
12
|
+
isVisible(_node: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): boolean;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -20,6 +20,7 @@ export { ButtonControls } from './button';
|
|
|
20
20
|
export { ImageControls } from './image';
|
|
21
21
|
export { CustomAttributeControls } from './customAttribute';
|
|
22
22
|
export { SpacingControl, SPACING_CONTROL_ID } from './spacing';
|
|
23
|
+
export { BlockBackgroundColorControl } from './blockBackground';
|
|
23
24
|
export { CardBackgroundColorControl, CARD_BACKGROUND_COLOR_CONTROL_ID } from './cardBackground';
|
|
24
25
|
export { RecommendationCardCompositionControl, COMPOSITION_CONTROL_BLOCK_ID } from './cardComposition';
|
|
25
26
|
export { SyncInfoMessageControl, SYNC_INFO_MESSAGE_CONTROL_ID } from './syncInfoMessage';
|
|
@@ -115,6 +115,42 @@ export declare function createTextBackgroundColorControl(controlId: string, targ
|
|
|
115
115
|
isVisible(_node: ImmutableHtmlNode): boolean;
|
|
116
116
|
};
|
|
117
117
|
};
|
|
118
|
+
/**
|
|
119
|
+
* Factory for a background-color control that paints a whole extension block (SD-145082).
|
|
120
|
+
*
|
|
121
|
+
* Base is `ButtonBackgroundColorBuiltInControl` because its `GENERAL.BACKGROUND_COLOR` form key
|
|
122
|
+
* round-trips through `getValues()`; the block-text base (`TextBlockBackgroundBuiltInControl`, the
|
|
123
|
+
* built-in this replaces) reports `textBlockBackgroundColor`, which our read path never sees. That
|
|
124
|
+
* borrowed base targets the block's Buy buttons, so `getTargetNodes` here is a GUARD that keeps it
|
|
125
|
+
* off the buttons — not the write path.
|
|
126
|
+
*
|
|
127
|
+
* The write is entirely ours (`getAdditionalModifications`): Stripo's built-in emits a stylesheet
|
|
128
|
+
* rule that inline styles from regeneration outrank (SD-143023), so it would silently no-op on the
|
|
129
|
+
* next edit. We write inline `background-color` + `bgcolor` on the block `<td>` instead — surviving
|
|
130
|
+
* regeneration and reaching Outlook, matching the migrator's convention.
|
|
131
|
+
*/
|
|
132
|
+
export declare function createBlockBackgroundColorControl(controlId: string, blockRootSelector?: string): {
|
|
133
|
+
new (): {
|
|
134
|
+
getId(): string;
|
|
135
|
+
/** The parent control renders its own generic title; restore the block-level wording. */
|
|
136
|
+
getLabels(): {
|
|
137
|
+
title: string;
|
|
138
|
+
};
|
|
139
|
+
/** Guard: redirect the borrowed button parent onto the block `<td>` so it never paints the Buy buttons. */
|
|
140
|
+
getTargetNodes(root: ImmutableHtmlNode): ImmutableHtmlNode[];
|
|
141
|
+
/**
|
|
142
|
+
* Writes the picked background onto the block as an inline style plus a `bgcolor`
|
|
143
|
+
* attribute. This is the whole mechanism, not a mirror: the parent control's own
|
|
144
|
+
* write never reaches the block element (verified at runtime). `bgcolor` is the
|
|
145
|
+
* channel Outlook honours on a `<td>`, and matches what the migrator emits.
|
|
146
|
+
*/
|
|
147
|
+
getAdditionalModifications(root: ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
|
|
148
|
+
getParentControlId(): string;
|
|
149
|
+
api: import("@stripoinc/ui-editor-extensions").ControlApi;
|
|
150
|
+
getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
|
|
151
|
+
isVisible(_node: ImmutableHtmlNode): boolean;
|
|
152
|
+
};
|
|
153
|
+
};
|
|
118
154
|
/**
|
|
119
155
|
* Factory function to create paddings controls for different block elements
|
|
120
156
|
* When targetBlockId and containerSelector are not provided, applies directly to root
|
|
@@ -101,6 +101,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
101
101
|
modulesDisabled: boolean;
|
|
102
102
|
liquidSyntax: boolean;
|
|
103
103
|
autosave: boolean;
|
|
104
|
+
allowlistEnabled: boolean;
|
|
104
105
|
};
|
|
105
106
|
blocks: {
|
|
106
107
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -238,6 +239,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
238
239
|
modulesDisabled: boolean;
|
|
239
240
|
liquidSyntax: boolean;
|
|
240
241
|
autosave: boolean;
|
|
242
|
+
allowlistEnabled: boolean;
|
|
241
243
|
};
|
|
242
244
|
blocks: {
|
|
243
245
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -375,6 +377,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
375
377
|
modulesDisabled: boolean;
|
|
376
378
|
liquidSyntax: boolean;
|
|
377
379
|
autosave: boolean;
|
|
380
|
+
allowlistEnabled: boolean;
|
|
378
381
|
};
|
|
379
382
|
blocks: {
|
|
380
383
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -512,6 +515,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
512
515
|
modulesDisabled: boolean;
|
|
513
516
|
liquidSyntax: boolean;
|
|
514
517
|
autosave: boolean;
|
|
518
|
+
allowlistEnabled: boolean;
|
|
515
519
|
};
|
|
516
520
|
blocks: {
|
|
517
521
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -649,6 +653,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
649
653
|
modulesDisabled: boolean;
|
|
650
654
|
liquidSyntax: boolean;
|
|
651
655
|
autosave: boolean;
|
|
656
|
+
allowlistEnabled: boolean;
|
|
652
657
|
};
|
|
653
658
|
blocks: {
|
|
654
659
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -786,6 +791,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
786
791
|
modulesDisabled: boolean;
|
|
787
792
|
liquidSyntax: boolean;
|
|
788
793
|
autosave: boolean;
|
|
794
|
+
allowlistEnabled: boolean;
|
|
789
795
|
};
|
|
790
796
|
blocks: {
|
|
791
797
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -923,6 +929,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
923
929
|
modulesDisabled: boolean;
|
|
924
930
|
liquidSyntax: boolean;
|
|
925
931
|
autosave: boolean;
|
|
932
|
+
allowlistEnabled: boolean;
|
|
926
933
|
};
|
|
927
934
|
blocks: {
|
|
928
935
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -1060,6 +1067,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1060
1067
|
modulesDisabled: boolean;
|
|
1061
1068
|
liquidSyntax: boolean;
|
|
1062
1069
|
autosave: boolean;
|
|
1070
|
+
allowlistEnabled: boolean;
|
|
1063
1071
|
};
|
|
1064
1072
|
blocks: {
|
|
1065
1073
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -1197,6 +1205,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1197
1205
|
modulesDisabled: boolean;
|
|
1198
1206
|
liquidSyntax: boolean;
|
|
1199
1207
|
autosave: boolean;
|
|
1208
|
+
allowlistEnabled: boolean;
|
|
1200
1209
|
};
|
|
1201
1210
|
blocks: {
|
|
1202
1211
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -1334,6 +1343,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1334
1343
|
modulesDisabled: boolean;
|
|
1335
1344
|
liquidSyntax: boolean;
|
|
1336
1345
|
autosave: boolean;
|
|
1346
|
+
allowlistEnabled: boolean;
|
|
1337
1347
|
};
|
|
1338
1348
|
blocks: {
|
|
1339
1349
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -1471,6 +1481,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1471
1481
|
modulesDisabled: boolean;
|
|
1472
1482
|
liquidSyntax: boolean;
|
|
1473
1483
|
autosave: boolean;
|
|
1484
|
+
allowlistEnabled: boolean;
|
|
1474
1485
|
};
|
|
1475
1486
|
blocks: {
|
|
1476
1487
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -1608,6 +1619,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1608
1619
|
modulesDisabled: boolean;
|
|
1609
1620
|
liquidSyntax: boolean;
|
|
1610
1621
|
autosave: boolean;
|
|
1622
|
+
allowlistEnabled: boolean;
|
|
1611
1623
|
};
|
|
1612
1624
|
blocks: {
|
|
1613
1625
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -1745,6 +1757,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1745
1757
|
modulesDisabled: boolean;
|
|
1746
1758
|
liquidSyntax: boolean;
|
|
1747
1759
|
autosave: boolean;
|
|
1760
|
+
allowlistEnabled: boolean;
|
|
1748
1761
|
};
|
|
1749
1762
|
blocks: {
|
|
1750
1763
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -1882,6 +1895,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1882
1895
|
modulesDisabled: boolean;
|
|
1883
1896
|
liquidSyntax: boolean;
|
|
1884
1897
|
autosave: boolean;
|
|
1898
|
+
allowlistEnabled: boolean;
|
|
1885
1899
|
};
|
|
1886
1900
|
blocks: {
|
|
1887
1901
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -2019,6 +2033,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2019
2033
|
modulesDisabled: boolean;
|
|
2020
2034
|
liquidSyntax: boolean;
|
|
2021
2035
|
autosave: boolean;
|
|
2036
|
+
allowlistEnabled: boolean;
|
|
2022
2037
|
};
|
|
2023
2038
|
blocks: {
|
|
2024
2039
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -2156,6 +2171,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2156
2171
|
modulesDisabled: boolean;
|
|
2157
2172
|
liquidSyntax: boolean;
|
|
2158
2173
|
autosave: boolean;
|
|
2174
|
+
allowlistEnabled: boolean;
|
|
2159
2175
|
};
|
|
2160
2176
|
blocks: {
|
|
2161
2177
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -2293,6 +2309,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2293
2309
|
modulesDisabled: boolean;
|
|
2294
2310
|
liquidSyntax: boolean;
|
|
2295
2311
|
autosave: boolean;
|
|
2312
|
+
allowlistEnabled: boolean;
|
|
2296
2313
|
};
|
|
2297
2314
|
blocks: {
|
|
2298
2315
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -2336,7 +2353,9 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2336
2353
|
} | null;
|
|
2337
2354
|
} & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => boolean;
|
|
2338
2355
|
/**
|
|
2339
|
-
* Check if a specific feature is enabled
|
|
2356
|
+
* Check if a specific feature is enabled.
|
|
2357
|
+
* Returns false before init (config null) so header controls don't
|
|
2358
|
+
* flash on during loading, then disappear once config resolves.
|
|
2340
2359
|
*/
|
|
2341
2360
|
isFeatureEnabled: (state: {
|
|
2342
2361
|
initialized: boolean;
|
|
@@ -2430,6 +2449,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2430
2449
|
modulesDisabled: boolean;
|
|
2431
2450
|
liquidSyntax: boolean;
|
|
2432
2451
|
autosave: boolean;
|
|
2452
|
+
allowlistEnabled: boolean;
|
|
2433
2453
|
};
|
|
2434
2454
|
blocks: {
|
|
2435
2455
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -3,8 +3,12 @@ const n = `.base-input {
|
|
|
3
3
|
border-radius: 4px;
|
|
4
4
|
background-color: var(--guido-color-gray-0);
|
|
5
5
|
align-items: center;
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
/* 40px is a floor, never a cap: \`.base-input\` is shared by every settings field,
|
|
7
|
+
including Stripo's own auto-height inputs (e.g. the link field) that expand on
|
|
8
|
+
focus. A fixed max-height clamped their inner box; keep 40px only as the floor. */
|
|
9
|
+
min-height: 40px;
|
|
10
|
+
height: auto;
|
|
11
|
+
max-height: none;
|
|
8
12
|
box-sizing: content-box;
|
|
9
13
|
outline: none;
|
|
10
14
|
resize: vertical;
|
|
@@ -36,11 +40,6 @@ ue-contenteditable .base-input {
|
|
|
36
40
|
line-height: 24px;
|
|
37
41
|
}
|
|
38
42
|
|
|
39
|
-
/* Image link input is auto-height; lift the fixed 40px cap so it can grow. */
|
|
40
|
-
ue-contenteditable.link-autoheight-contenteditable .base-input {
|
|
41
|
-
max-height: none;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
43
|
ue-icon-component.icon-button.icon-clear-input {
|
|
45
44
|
right: 2px;
|
|
46
45
|
top: 2px;
|
package/dist/stores/config.js
CHANGED
|
@@ -75,65 +75,67 @@ const f = r("guido-config", {
|
|
|
75
75
|
* Get the template ID
|
|
76
76
|
*/
|
|
77
77
|
templateId: (i) => {
|
|
78
|
-
var e,
|
|
79
|
-
return ((
|
|
78
|
+
var e, n;
|
|
79
|
+
return ((n = (e = i.config) == null ? void 0 : e.identity) == null ? void 0 : n.templateId) ?? "";
|
|
80
80
|
},
|
|
81
81
|
/**
|
|
82
82
|
* Get the user ID
|
|
83
83
|
*/
|
|
84
84
|
userId: (i) => {
|
|
85
|
-
var e,
|
|
86
|
-
return ((
|
|
85
|
+
var e, n;
|
|
86
|
+
return ((n = (e = i.config) == null ? void 0 : e.identity) == null ? void 0 : n.userId) ?? "";
|
|
87
87
|
},
|
|
88
88
|
/**
|
|
89
89
|
* Get the variation ID
|
|
90
90
|
*/
|
|
91
91
|
variationId: (i) => {
|
|
92
|
-
var e,
|
|
93
|
-
return ((
|
|
92
|
+
var e, n;
|
|
93
|
+
return ((n = (e = i.config) == null ? void 0 : e.identity) == null ? void 0 : n.variationId) ?? "";
|
|
94
94
|
},
|
|
95
95
|
/**
|
|
96
96
|
* Get the partner name
|
|
97
97
|
*/
|
|
98
98
|
partnerName: (i) => {
|
|
99
|
-
var e,
|
|
100
|
-
return ((
|
|
99
|
+
var e, n;
|
|
100
|
+
return ((n = (e = i.config) == null ? void 0 : e.partner) == null ? void 0 : n.name) ?? "";
|
|
101
101
|
},
|
|
102
102
|
/**
|
|
103
103
|
* Get the product type
|
|
104
104
|
*/
|
|
105
105
|
productType: (i) => {
|
|
106
|
-
var e,
|
|
107
|
-
return ((
|
|
106
|
+
var e, n;
|
|
107
|
+
return ((n = (e = i.config) == null ? void 0 : e.partner) == null ? void 0 : n.productType) ?? 60;
|
|
108
108
|
},
|
|
109
109
|
/**
|
|
110
110
|
* Get the message type
|
|
111
111
|
*/
|
|
112
112
|
messageType: (i) => {
|
|
113
|
-
var e,
|
|
114
|
-
return ((
|
|
113
|
+
var e, n;
|
|
114
|
+
return ((n = (e = i.config) == null ? void 0 : e.partner) == null ? void 0 : n.messageType) ?? 1;
|
|
115
115
|
},
|
|
116
116
|
/**
|
|
117
117
|
* Get the username
|
|
118
118
|
*/
|
|
119
119
|
username: (i) => {
|
|
120
|
-
var e,
|
|
121
|
-
return ((
|
|
120
|
+
var e, n;
|
|
121
|
+
return ((n = (e = i.config) == null ? void 0 : e.partner) == null ? void 0 : n.username) ?? "Guido User";
|
|
122
122
|
},
|
|
123
123
|
/**
|
|
124
124
|
* Check if header should be shown
|
|
125
125
|
*/
|
|
126
126
|
showHeader: (i) => {
|
|
127
|
-
var e,
|
|
128
|
-
return ((
|
|
127
|
+
var e, n;
|
|
128
|
+
return ((n = (e = i.config) == null ? void 0 : e.ui) == null ? void 0 : n.showHeader) ?? !0;
|
|
129
129
|
},
|
|
130
130
|
/**
|
|
131
|
-
* Check if a specific feature is enabled
|
|
131
|
+
* Check if a specific feature is enabled.
|
|
132
|
+
* Returns false before init (config null) so header controls don't
|
|
133
|
+
* flash on during loading, then disappear once config resolves.
|
|
132
134
|
*/
|
|
133
135
|
// eslint-disable-next-line @stylistic/max-len
|
|
134
136
|
isFeatureEnabled: (i) => (e) => {
|
|
135
|
-
var
|
|
136
|
-
return ((
|
|
137
|
+
var n, t;
|
|
138
|
+
return ((t = (n = i.config) == null ? void 0 : n.features) == null ? void 0 : t[e]) ?? !1;
|
|
137
139
|
}
|
|
138
140
|
},
|
|
139
141
|
actions: {
|