@useinsider/guido 2.0.0-beta.4f6e85f → 2.0.0-beta.522e9d9
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 +0 -2
- package/dist/@types/config/schemas.js +39 -55
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +17 -15
- package/dist/components/organisms/email-preview/PreviewContainer.vue.js +3 -3
- package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.js +8 -8
- package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue2.js +17 -13
- package/dist/components/organisms/email-preview/amp/AmpToggle.vue.js +7 -8
- package/dist/components/organisms/email-preview/amp/AmpToggle.vue2.js +14 -12
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +10 -14
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +18 -22
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +3 -3
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +12 -11
- package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.js +11 -10
- package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue2.js +15 -14
- package/dist/components/organisms/header/LeftSlot.vue.js +9 -9
- package/dist/components/organisms/header/LeftSlot.vue2.js +13 -14
- package/dist/components/organisms/header/MiddleSlot.vue.js +5 -4
- package/dist/components/organisms/header/MiddleSlot.vue2.js +14 -13
- package/dist/components/organisms/header/RightSlot.vue.js +12 -12
- package/dist/components/organisms/header/RightSlot.vue2.js +26 -20
- package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +15 -15
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +1 -1
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +20 -19
- package/dist/composables/useConfig.js +27 -29
- package/dist/composables/useSave.js +11 -13
- package/dist/composables/useStripo.js +40 -40
- package/dist/config/migrator/index.js +8 -9
- package/dist/enums/academy.js +8 -0
- package/dist/enums/onboarding.js +1 -2
- package/dist/enums/unsubscribe.js +20 -21
- package/dist/extensions/Blocks/Items/block.js +40 -39
- package/dist/extensions/Blocks/Items/controls/button/link.js +29 -22
- package/dist/extensions/Blocks/Items/controls/cardComposition.js +46 -66
- package/dist/extensions/Blocks/Items/controls/image/link.js +30 -23
- package/dist/extensions/Blocks/Items/controls/name/trimming.js +25 -25
- package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +17 -19
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +29 -31
- package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +36 -36
- package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +19 -21
- package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +27 -29
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +143 -152
- package/dist/extensions/Blocks/Items/enums/controlEnums.js +2 -2
- package/dist/extensions/Blocks/Items/enums/productEnums.js +45 -43
- package/dist/extensions/Blocks/Items/enums/settingsEnums.js +3 -4
- package/dist/extensions/Blocks/Items/extension.js +6 -7
- package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +49 -58
- package/dist/extensions/Blocks/Items/layouts/vertical.html.js +59 -48
- package/dist/extensions/Blocks/Items/settingsPanel.js +26 -27
- package/dist/extensions/Blocks/Items/store/items-block.js +7 -11
- package/dist/extensions/Blocks/Items/template.js +129 -366
- package/dist/extensions/Blocks/Items/utils/configBlockUtils.js +17 -0
- package/dist/extensions/Blocks/Items/utils/syncAttributeFromConfigBlock.js +28 -0
- package/dist/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.js +76 -0
- package/dist/extensions/Blocks/Items/utils/updateAttributes.js +46 -0
- package/dist/extensions/Blocks/Recommendation/control.js +1 -1
- package/dist/extensions/Blocks/Unsubscribe/extension.js +9 -9
- package/dist/extensions/Blocks/common-control.js +30 -29
- package/dist/extensions/Blocks/controlFactories.js +45 -55
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +285 -364
- package/dist/package.json.js +1 -1
- package/dist/services/stripoApi.js +10 -6
- package/dist/src/@types/config/index.d.ts +2 -2
- package/dist/src/@types/config/schemas.d.ts +0 -30
- package/dist/src/@types/config/types.d.ts +1 -7
- package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -1
- package/dist/src/composables/useConfig.d.ts +0 -8
- package/dist/src/enums/academy.d.ts +12 -0
- package/dist/src/enums/onboarding.d.ts +0 -1
- package/dist/src/enums/unsubscribe.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/controls/button/link.d.ts +2 -0
- package/dist/src/extensions/Blocks/Items/controls/cardComposition.d.ts +0 -9
- package/dist/src/extensions/Blocks/Items/controls/image/link.d.ts +2 -0
- package/dist/src/extensions/Blocks/Items/controls/price/priceOrientation.d.ts +1 -1
- package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +4 -0
- package/dist/src/extensions/Blocks/Items/enums/controlEnums.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +26 -24
- package/dist/src/extensions/Blocks/Items/enums/settingsEnums.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/store/items-block.d.ts +0 -2
- package/dist/src/extensions/Blocks/Items/template.d.ts +1 -22
- package/dist/src/extensions/Blocks/Items/utils/configBlockUtils.d.ts +23 -0
- package/dist/src/extensions/Blocks/Items/utils/syncAttributeFromConfigBlock.d.ts +32 -0
- package/dist/src/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.d.ts +50 -0
- package/dist/src/extensions/Blocks/Items/utils/updateAttributes.d.ts +8 -0
- package/dist/src/extensions/Blocks/common-control.d.ts +10 -9
- package/dist/src/stores/config.d.ts +1 -164
- package/dist/static/assets/desktop/desktop-mockup-center.svg.js +4 -0
- package/dist/static/assets/desktop/desktop-mockup-left.svg.js +4 -0
- package/dist/static/assets/desktop/desktop-mockup-right.svg.js +4 -0
- package/dist/static/assets/mobile/email-mockup.svg.js +4 -0
- package/dist/static/assets/mobile/inbox-mockup.svg.js +4 -0
- package/dist/static/styles/components/button.css.js +1 -1
- package/dist/stores/config.js +0 -7
- package/dist/utils/pairProductVariables.js +58 -61
- package/package.json +3 -3
- package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.js +0 -17
- package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue2.js +0 -20
- package/dist/config/migrator/itemsBlockMigrator.js +0 -342
- package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +0 -93
- package/dist/extensions/Blocks/Items/utils/nodeConfigUtils.js +0 -184
- package/dist/src/config/migrator/itemsBlockMigrator.d.ts +0 -6
- package/dist/src/extensions/Blocks/Items/controls/price/singlePrice.d.ts +0 -18
- package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +0 -73
- package/dist/static/assets/inbox-mockup.svg.js +0 -4
- package/dist/static/assets/phone-mockup.svg.js +0 -4
package/dist/package.json.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useHttp as m } from "../composables/useHttp.js";
|
|
2
|
-
import { useToaster as
|
|
3
|
-
import { MAX_DEFAULT_TEMPLATE_ID as
|
|
2
|
+
import { useToaster as u } from "../composables/useToaster.js";
|
|
3
|
+
import { MAX_DEFAULT_TEMPLATE_ID as i } from "../enums/defaults.js";
|
|
4
4
|
const y = () => {
|
|
5
|
-
const { get: r } = m(), { handleError: o } =
|
|
5
|
+
const { get: r } = m(), { handleError: o } = u();
|
|
6
6
|
return {
|
|
7
7
|
getToken: async () => {
|
|
8
8
|
try {
|
|
@@ -26,13 +26,17 @@ const y = () => {
|
|
|
26
26
|
getDefaultTemplate: async () => {
|
|
27
27
|
const t = {
|
|
28
28
|
html: "",
|
|
29
|
-
css: ""
|
|
29
|
+
css: "",
|
|
30
|
+
forceRecreate: !0
|
|
30
31
|
};
|
|
31
32
|
try {
|
|
32
|
-
const c = new URLSearchParams(window.location.search).get("default-template"), s = c ? parseInt(c) : 0, l = s >= 1 && s <=
|
|
33
|
+
const c = new URLSearchParams(window.location.search).get("default-template"), s = c ? parseInt(c) : 0, l = s >= 1 && s <= i ? s : 0, { data: n } = await r(
|
|
33
34
|
`/stripo/default-template/${l}`
|
|
34
35
|
), a = typeof n == "string" ? JSON.parse(n) : n;
|
|
35
|
-
return !a || typeof a != "object" || !("html" in a) || !("css" in a) ? t :
|
|
36
|
+
return !a || typeof a != "object" || !("html" in a) || !("css" in a) ? t : {
|
|
37
|
+
...a,
|
|
38
|
+
forceRecreate: !0
|
|
39
|
+
};
|
|
36
40
|
} catch (e) {
|
|
37
41
|
return o(e, "Failed to fetch default template"), t;
|
|
38
42
|
}
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* - Default values for optional configuration
|
|
8
8
|
* - Validation utilities
|
|
9
9
|
*/
|
|
10
|
-
export { MessageType, ProductType, GuidoConfigSchema, IdentitySchema, PartnerSchema, TemplateSchema, EditorSchema, UISchema, FeaturesSchema, BlocksSchema, CompilerSchema,
|
|
11
|
-
export type { GuidoConfig, GuidoConfigInput, IdentityConfig, IdentityConfigInput, PartnerConfig, PartnerConfigInput, TemplateConfig, TemplateConfigInput, EditorConfig, EditorConfigInput, UIConfig, UIConfigInput, FeaturesConfig, FeaturesConfigInput, BlocksConfig, BlocksConfigInput, CompilerConfig, CompilerConfigInput,
|
|
10
|
+
export { MessageType, ProductType, GuidoConfigSchema, IdentitySchema, PartnerSchema, TemplateSchema, EditorSchema, UISchema, FeaturesSchema, BlocksSchema, CompilerSchema, DynamicContentSchema, EmailHeaderSchema, DefaultBlockTypeSchema, CustomBlockTypeSchema, CompilerRuleSchema, CompilerRuleTypeSchema, ReplaceRuleSchema, RegexRuleSchema, RemoveRuleSchema, CustomRuleSchema, } from './schemas';
|
|
11
|
+
export type { GuidoConfig, GuidoConfigInput, IdentityConfig, IdentityConfigInput, PartnerConfig, PartnerConfigInput, TemplateConfig, TemplateConfigInput, EditorConfig, EditorConfigInput, UIConfig, UIConfigInput, FeaturesConfig, FeaturesConfigInput, BlocksConfig, BlocksConfigInput, CompilerConfig, CompilerConfigInput, EmailHeader, DynamicContent, DefaultBlockType, CustomBlockType, BlockType, FeatureName, CompilerRule, ReplaceRule, RegexRule, RemoveRule, CustomRule, DeepPartial, ConfigOverrides, } from './types';
|
|
12
12
|
export { DEFAULT_EMAIL_HEADER, DEFAULT_TEMPLATE, DEFAULT_EDITOR, DEFAULT_UI, DEFAULT_FEATURES, DEFAULT_BLOCKS, DEFAULT_COMPILER, DEFAULT_PRODUCT_TYPE, DEFAULT_MESSAGE_TYPE, DEFAULT_USERNAME, EDITOR_TYPE, TEST_PARTNERS, isTestPartner, } from './defaults';
|
|
13
13
|
export { validateConfig, parseConfig, parseConfigSafe, getValidationErrors, isValidConfig, validateIdentity, validatePartner, } from './validator';
|
|
14
14
|
export type { ValidationResult, ValidationError, } from './validator';
|
|
@@ -5,14 +5,7 @@
|
|
|
5
5
|
* All types are inferred from these schemas to ensure single source of truth.
|
|
6
6
|
* @module @types/config/schemas
|
|
7
7
|
*/
|
|
8
|
-
import type { SavedTemplateDetails } from '../stripo';
|
|
9
8
|
import * as v from 'valibot';
|
|
10
|
-
/**
|
|
11
|
-
* Handler function for external validation before save
|
|
12
|
-
* @param data - The template details to validate
|
|
13
|
-
* @returns Promise<boolean> - true if valid, false to cancel save
|
|
14
|
-
*/
|
|
15
|
-
export type ExternalValidationHandler = (data: SavedTemplateDetails) => Promise<boolean>;
|
|
16
9
|
/**
|
|
17
10
|
* Message type constants for email templates
|
|
18
11
|
*/
|
|
@@ -97,8 +90,6 @@ export declare const TemplateSchema: v.ObjectSchema<{
|
|
|
97
90
|
}, undefined>, undefined>, readonly []>;
|
|
98
91
|
/** Selected unsubscribe page IDs */
|
|
99
92
|
readonly selectedUnsubscribePages: v.OptionalSchema<v.ArraySchema<v.NumberSchema<undefined>, undefined>, readonly []>;
|
|
100
|
-
/** Force recreate template in Stripo storage (use true when updating externally modified templates) */
|
|
101
|
-
readonly forceRecreate: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
102
93
|
}, undefined>;
|
|
103
94
|
/**
|
|
104
95
|
* Email header configuration (sender name and subject)
|
|
@@ -353,16 +344,6 @@ export declare const CompilerSchema: v.ObjectSchema<{
|
|
|
353
344
|
/** Skip default compiler rules */
|
|
354
345
|
readonly ignoreDefaultRules: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
355
346
|
}, undefined>;
|
|
356
|
-
/**
|
|
357
|
-
* Callbacks configuration - event handlers and hooks
|
|
358
|
-
*/
|
|
359
|
-
export declare const CallbacksSchema: v.ObjectSchema<{
|
|
360
|
-
/**
|
|
361
|
-
* External validation handler called before save completes.
|
|
362
|
-
* Return false to cancel the save operation.
|
|
363
|
-
*/
|
|
364
|
-
readonly externalValidation: v.OptionalSchema<v.CustomSchema<ExternalValidationHandler, v.ErrorMessage<v.CustomIssue> | undefined>, undefined>;
|
|
365
|
-
}, undefined>;
|
|
366
347
|
/**
|
|
367
348
|
* Complete Guido configuration schema
|
|
368
349
|
*
|
|
@@ -375,7 +356,6 @@ export declare const CallbacksSchema: v.ObjectSchema<{
|
|
|
375
356
|
* - features: Feature toggles
|
|
376
357
|
* - blocks: Block configuration
|
|
377
358
|
* - compiler: HTML compilation
|
|
378
|
-
* - callbacks: Event handlers and hooks
|
|
379
359
|
*/
|
|
380
360
|
export declare const GuidoConfigSchema: v.ObjectSchema<{
|
|
381
361
|
/** Identity configuration (required) */
|
|
@@ -420,8 +400,6 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
|
|
|
420
400
|
}, undefined>, undefined>, readonly []>;
|
|
421
401
|
/** Selected unsubscribe page IDs */
|
|
422
402
|
readonly selectedUnsubscribePages: v.OptionalSchema<v.ArraySchema<v.NumberSchema<undefined>, undefined>, readonly []>;
|
|
423
|
-
/** Force recreate template in Stripo storage (use true when updating externally modified templates) */
|
|
424
|
-
readonly forceRecreate: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
425
403
|
}, undefined>, {}>;
|
|
426
404
|
/** Editor settings */
|
|
427
405
|
readonly editor: v.OptionalSchema<v.ObjectSchema<{
|
|
@@ -528,12 +506,4 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
|
|
|
528
506
|
/** Skip default compiler rules */
|
|
529
507
|
readonly ignoreDefaultRules: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
530
508
|
}, undefined>, {}>;
|
|
531
|
-
/** Callbacks and event handlers */
|
|
532
|
-
readonly callbacks: v.OptionalSchema<v.ObjectSchema<{
|
|
533
|
-
/**
|
|
534
|
-
* External validation handler called before save completes.
|
|
535
|
-
* Return false to cancel the save operation.
|
|
536
|
-
*/
|
|
537
|
-
readonly externalValidation: v.OptionalSchema<v.CustomSchema<ExternalValidationHandler, v.ErrorMessage<v.CustomIssue> | undefined>, undefined>;
|
|
538
|
-
}, undefined>, {}>;
|
|
539
509
|
}, undefined>;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* This ensures type definitions are always in sync with validation.
|
|
6
6
|
* @module @types/config/types
|
|
7
7
|
*/
|
|
8
|
-
import type { GuidoConfigSchema, IdentitySchema, PartnerSchema, TemplateSchema, EditorSchema, UISchema, FeaturesSchema, BlocksSchema, CompilerSchema,
|
|
8
|
+
import type { GuidoConfigSchema, IdentitySchema, PartnerSchema, TemplateSchema, EditorSchema, UISchema, FeaturesSchema, BlocksSchema, CompilerSchema, DynamicContentSchema, EmailHeaderSchema, CompilerRuleSchema, ReplaceRuleSchema, RegexRuleSchema, RemoveRuleSchema, CustomRuleSchema, DefaultBlockTypeSchema, CustomBlockTypeSchema } from './schemas';
|
|
9
9
|
import type * as v from 'valibot';
|
|
10
10
|
/**
|
|
11
11
|
* Complete validated Guido configuration.
|
|
@@ -41,10 +41,6 @@ export type FeaturesConfig = v.InferOutput<typeof FeaturesSchema>;
|
|
|
41
41
|
export type BlocksConfig = v.InferOutput<typeof BlocksSchema>;
|
|
42
42
|
/** Compiler configuration (custom rules, ignore defaults) */
|
|
43
43
|
export type CompilerConfig = v.InferOutput<typeof CompilerSchema>;
|
|
44
|
-
/** Callbacks configuration (event handlers and hooks) */
|
|
45
|
-
export type CallbacksConfig = v.InferOutput<typeof CallbacksSchema>;
|
|
46
|
-
/** Re-export ExternalValidationHandler for convenience */
|
|
47
|
-
export type { ExternalValidationHandler };
|
|
48
44
|
/** Email header configuration (senderName, subject) */
|
|
49
45
|
export type EmailHeader = v.InferOutput<typeof EmailHeaderSchema>;
|
|
50
46
|
/** Dynamic content item */
|
|
@@ -89,8 +85,6 @@ export type FeaturesConfigInput = v.InferInput<typeof FeaturesSchema>;
|
|
|
89
85
|
export type BlocksConfigInput = v.InferInput<typeof BlocksSchema>;
|
|
90
86
|
/** Input type for compiler configuration */
|
|
91
87
|
export type CompilerConfigInput = v.InferInput<typeof CompilerSchema>;
|
|
92
|
-
/** Input type for callbacks configuration */
|
|
93
|
-
export type CallbacksConfigInput = v.InferInput<typeof CallbacksSchema>;
|
|
94
88
|
/** Default Stripo block types */
|
|
95
89
|
export type DefaultBlockType = v.InferOutput<typeof DefaultBlockTypeSchema>;
|
|
96
90
|
/** Custom Guido block types */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<{}, {
|
|
2
|
-
handleSave: (isSilent: boolean) => Promise<import("../../../@types/stripo").SavedTemplateDetails | undefined>;
|
|
2
|
+
handleSave: (isSilent: boolean) => Promise<import("../../../@types/stripo.js").SavedTemplateDetails | undefined>;
|
|
3
3
|
}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
4
4
|
export default _default;
|
|
@@ -31,7 +31,6 @@ export declare const useConfig: () => {
|
|
|
31
31
|
} | undefined;
|
|
32
32
|
}[];
|
|
33
33
|
selectedUnsubscribePages: number[];
|
|
34
|
-
forceRecreate: boolean;
|
|
35
34
|
};
|
|
36
35
|
editor: {
|
|
37
36
|
locale: string;
|
|
@@ -91,9 +90,6 @@ export declare const useConfig: () => {
|
|
|
91
90
|
})[];
|
|
92
91
|
ignoreDefaultRules: boolean;
|
|
93
92
|
};
|
|
94
|
-
callbacks: {
|
|
95
|
-
externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
|
|
96
|
-
};
|
|
97
93
|
} | null>;
|
|
98
94
|
initialized: import("vue").Ref<boolean>;
|
|
99
95
|
identity: import("vue").ComputedRef<{
|
|
@@ -120,7 +116,6 @@ export declare const useConfig: () => {
|
|
|
120
116
|
} | undefined;
|
|
121
117
|
}[];
|
|
122
118
|
selectedUnsubscribePages: number[];
|
|
123
|
-
forceRecreate: boolean;
|
|
124
119
|
} | null>;
|
|
125
120
|
editor: import("vue").ComputedRef<{
|
|
126
121
|
locale: string;
|
|
@@ -180,9 +175,6 @@ export declare const useConfig: () => {
|
|
|
180
175
|
})[];
|
|
181
176
|
ignoreDefaultRules: boolean;
|
|
182
177
|
} | null>;
|
|
183
|
-
callbacks: import("vue").ComputedRef<{
|
|
184
|
-
externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
|
|
185
|
-
} | null>;
|
|
186
178
|
templateId: import("vue").ComputedRef<string>;
|
|
187
179
|
userId: import("vue").ComputedRef<string>;
|
|
188
180
|
variationId: import("vue").ComputedRef<string>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Centralized Academy Links
|
|
3
|
+
*
|
|
4
|
+
* All external academy documentation links should be defined here
|
|
5
|
+
* for easy maintenance and domain migration.
|
|
6
|
+
*/
|
|
7
|
+
export declare const ACADEMY_LINKS: {
|
|
8
|
+
readonly EMAIL_EDITOR: "https://academy.useinsider.com/docs/email-drag-drop-editor";
|
|
9
|
+
readonly GLOBAL_UNSUBSCRIBE: "https://academy.useinsider.com/docs/global-unsubscribe-preference-center";
|
|
10
|
+
readonly AMP_FOR_EMAILS: "https://academy.useinsider.com/docs/amp-for-emails";
|
|
11
|
+
};
|
|
12
|
+
export type AcademyLinkKey = keyof typeof ACADEMY_LINKS;
|
|
@@ -3,4 +3,3 @@ export declare const UI_EDITOR_SELECTOR = "ui-editor";
|
|
|
3
3
|
export declare const CARD_COMPOSITION_TAB_SELECTOR = "button[role=\"tab\"][aria-label=\"Card Composition\"]";
|
|
4
4
|
export declare const SETTINGS_TAB_SELECTOR = "button[role=\"tab\"][aria-label=\"Settings\"]";
|
|
5
5
|
export declare const RIBBON_SELECTOR = ".in-ribbons-wrapper";
|
|
6
|
-
export declare const ACADEMY_LINK = "https://academy.useinsider.com/docs/email-drag-drop-editor";
|
|
@@ -17,7 +17,6 @@ export declare const DEFAULT_UNSUBSCRIBE_GROUP: {
|
|
|
17
17
|
readonly name: "Global Unsubscribe";
|
|
18
18
|
readonly sendGridId: "G";
|
|
19
19
|
};
|
|
20
|
-
export declare const ACADEMY_LINK = "https://academy.useinsider.com/docs/global-unsubscribe-preference-center";
|
|
21
20
|
export declare const UNSUBSCRIBE_PAGES_LINK = "/email/unsubscribe-pages";
|
|
22
21
|
export declare const PAGE_TYPES: {
|
|
23
22
|
GLOBAL_UNSUBSCRIBE: number;
|
|
@@ -29,14 +29,5 @@ export declare class ItemsBlockCardCompositionControl extends CommonControl {
|
|
|
29
29
|
_onProductQuantityChange(value: boolean): void;
|
|
30
30
|
_onProductPriceChange(value: boolean): void;
|
|
31
31
|
_onProductOriginalPriceChange(value: boolean): void;
|
|
32
|
-
/**
|
|
33
|
-
* Updates both price cell widths in vertical layout based on priceOrientation and visibility.
|
|
34
|
-
* - When priceOrientation is 'vertical': both cells are 100% (stacked layout)
|
|
35
|
-
* - When priceOrientation is 'horizontal':
|
|
36
|
-
* - When original price is hidden, price cell expands to 100%
|
|
37
|
-
* - When price is hidden, original price cell expands to 100%
|
|
38
|
-
* - When both are visible, they share 50% each
|
|
39
|
-
*/
|
|
40
|
-
_updatePriceCellWidthsForVerticalLayout(): void;
|
|
41
32
|
_onProductButtonChange(value: boolean): void;
|
|
42
33
|
}
|
|
@@ -9,7 +9,7 @@ export declare class PriceOrientationControl extends CommonControl {
|
|
|
9
9
|
onRender(): void;
|
|
10
10
|
onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
|
|
11
11
|
_onPriceOrientationChange(value: string): void;
|
|
12
|
-
private _updateVerticalLayout;
|
|
13
12
|
private _updateHorizontalLayout;
|
|
13
|
+
private _updateVerticalLayout;
|
|
14
14
|
_getPriceOrientation(): string;
|
|
15
15
|
}
|
|
@@ -31,6 +31,10 @@ export declare class ItemsBlockControl extends CommonControl {
|
|
|
31
31
|
_updatePrice(price: string): void;
|
|
32
32
|
_updateOriginalPrice(originalPrice: string): void;
|
|
33
33
|
_updateQuantity(quantity: string): void;
|
|
34
|
+
/**
|
|
35
|
+
* @todo Optimize template reordering for performance.
|
|
36
|
+
* @description Reorders the template structure based on current orientation and visibility settings.
|
|
37
|
+
*/
|
|
34
38
|
_reOrderTemplate(): void;
|
|
35
39
|
_updateDataTypeAttributes(itemsType: ProductType): void;
|
|
36
40
|
_updateDataNumberAttributes(itemId: string): void;
|
|
@@ -42,7 +42,6 @@ export declare enum ItemsBlockControlId {
|
|
|
42
42
|
PRICE_PADDINGS = "items-block-price-paddings-control",
|
|
43
43
|
PRICE_HIDE_DISCOUNT = "items-block-price-hide-discount-control",
|
|
44
44
|
PRICE_FORMATTED_PRICE = "items-block-price-formatted-price-control",
|
|
45
|
-
PRICE_SINGLE_PRICE = "items-block-price-single-price-control",
|
|
46
45
|
PRICE_CURRENCY_SYMBOL = "items-block-price-currency-symbol-control",
|
|
47
46
|
PRICE_CURRENCY_LOCATION = "items-block-price-currency-location-control",
|
|
48
47
|
PRICE_ORIENTATION = "items-block-price-orientation-control",
|
|
@@ -1,4 +1,30 @@
|
|
|
1
1
|
export declare const templateFirstLine = "<td align=\"center\" class=\"ins-product-td items-block items-block-v2\">";
|
|
2
|
+
export declare const configAttributes: {
|
|
3
|
+
TYPE: string;
|
|
4
|
+
ITEMS_INDEX_SELECT_CONTROL_VALUE: string;
|
|
5
|
+
ORIENTATION: string;
|
|
6
|
+
PRODUCT_NAME_TRIMMING: string;
|
|
7
|
+
PRODUCT_PRICE_HIDE_DISCOUNT: string;
|
|
8
|
+
PRODUCT_PRICE_FORMATTED: string;
|
|
9
|
+
PRODUCT_PRICE_CURRENCY_SYMBOL: string;
|
|
10
|
+
PRODUCT_PRICE_CURRENCY_LOCATION: string;
|
|
11
|
+
PRODUCT_ORIGINAL_PRICE_CONTROL_ORIENTATION: string;
|
|
12
|
+
PRODUCT_BUTTON_LINK: string;
|
|
13
|
+
PRODUCT_IMAGE_LINK: string;
|
|
14
|
+
PRODUCT_NAME_CONTROL_VALUE: string;
|
|
15
|
+
PRODUCT_QUANTITY_CONTROL_VALUE: string;
|
|
16
|
+
PRODUCT_PRICE_CONTROL_VALUE: string;
|
|
17
|
+
BLOCK_INSTANCE_ID: string;
|
|
18
|
+
NAME_CONTROL_ENABLED: string;
|
|
19
|
+
QUANTITY_CONTROL_ENABLED: string;
|
|
20
|
+
PRICE_CONTROL_OPENED: string;
|
|
21
|
+
PRODUCT_IMAGE_VISIBLE: string;
|
|
22
|
+
PRODUCT_NAME_VISIBLE: string;
|
|
23
|
+
PRODUCT_QUANTITY_VISIBLE: string;
|
|
24
|
+
PRODUCT_PRICE_VISIBLE: string;
|
|
25
|
+
PRODUCT_ORIGINAL_PRICE_VISIBLE: string;
|
|
26
|
+
PRODUCT_BUTTON_VISIBLE: string;
|
|
27
|
+
};
|
|
2
28
|
export declare const productPairs: {
|
|
3
29
|
PAIRS_FOR_EXTENSION: {
|
|
4
30
|
imageSrc: {
|
|
@@ -53,37 +79,25 @@ export declare const productPairs: {
|
|
|
53
79
|
CART_ITEMS: {
|
|
54
80
|
PRICE: string;
|
|
55
81
|
PRICE_FORMATTED: string;
|
|
56
|
-
SINGLE_PRICE: string;
|
|
57
|
-
SINGLE_PRICE_FORMATTED: string;
|
|
58
82
|
CURRENCY: string;
|
|
59
83
|
DEFAULT_PRICE: string;
|
|
60
84
|
DEFAULT_PRICE_FORMATTED: string;
|
|
61
|
-
DEFAULT_SINGLE_PRICE: string;
|
|
62
|
-
DEFAULT_SINGLE_PRICE_FORMATTED: string;
|
|
63
85
|
DEFAULT_CURRENCY: string;
|
|
64
86
|
};
|
|
65
87
|
BROWSED_ITEMS: {
|
|
66
88
|
PRICE: string;
|
|
67
89
|
PRICE_FORMATTED: string;
|
|
68
|
-
SINGLE_PRICE: string;
|
|
69
|
-
SINGLE_PRICE_FORMATTED: string;
|
|
70
90
|
CURRENCY: string;
|
|
71
91
|
DEFAULT_PRICE: string;
|
|
72
92
|
DEFAULT_PRICE_FORMATTED: string;
|
|
73
|
-
DEFAULT_SINGLE_PRICE: string;
|
|
74
|
-
DEFAULT_SINGLE_PRICE_FORMATTED: string;
|
|
75
93
|
DEFAULT_CURRENCY: string;
|
|
76
94
|
};
|
|
77
95
|
PURCHASED_ITEMS: {
|
|
78
96
|
PRICE: string;
|
|
79
97
|
PRICE_FORMATTED: string;
|
|
80
|
-
SINGLE_PRICE: string;
|
|
81
|
-
SINGLE_PRICE_FORMATTED: string;
|
|
82
98
|
CURRENCY: string;
|
|
83
99
|
DEFAULT_PRICE: string;
|
|
84
100
|
DEFAULT_PRICE_FORMATTED: string;
|
|
85
|
-
DEFAULT_SINGLE_PRICE: string;
|
|
86
|
-
DEFAULT_SINGLE_PRICE_FORMATTED: string;
|
|
87
101
|
DEFAULT_CURRENCY: string;
|
|
88
102
|
};
|
|
89
103
|
};
|
|
@@ -91,37 +105,25 @@ export declare const productPairs: {
|
|
|
91
105
|
CART_ITEMS: {
|
|
92
106
|
PRICE: string;
|
|
93
107
|
PRICE_FORMATTED: string;
|
|
94
|
-
SINGLE_PRICE: string;
|
|
95
|
-
SINGLE_PRICE_FORMATTED: string;
|
|
96
108
|
CURRENCY: string;
|
|
97
109
|
DEFAULT_PRICE: string;
|
|
98
110
|
DEFAULT_PRICE_FORMATTED: string;
|
|
99
|
-
DEFAULT_SINGLE_PRICE: string;
|
|
100
|
-
DEFAULT_SINGLE_PRICE_FORMATTED: string;
|
|
101
111
|
DEFAULT_CURRENCY: string;
|
|
102
112
|
};
|
|
103
113
|
BROWSED_ITEMS: {
|
|
104
114
|
PRICE: string;
|
|
105
115
|
PRICE_FORMATTED: string;
|
|
106
|
-
SINGLE_PRICE: string;
|
|
107
|
-
SINGLE_PRICE_FORMATTED: string;
|
|
108
116
|
CURRENCY: string;
|
|
109
117
|
DEFAULT_PRICE: string;
|
|
110
118
|
DEFAULT_PRICE_FORMATTED: string;
|
|
111
|
-
DEFAULT_SINGLE_PRICE: string;
|
|
112
|
-
DEFAULT_SINGLE_PRICE_FORMATTED: string;
|
|
113
119
|
DEFAULT_CURRENCY: string;
|
|
114
120
|
};
|
|
115
121
|
PURCHASED_ITEMS: {
|
|
116
122
|
PRICE: string;
|
|
117
123
|
PRICE_FORMATTED: string;
|
|
118
|
-
SINGLE_PRICE: string;
|
|
119
|
-
SINGLE_PRICE_FORMATTED: string;
|
|
120
124
|
CURRENCY: string;
|
|
121
125
|
DEFAULT_PRICE: string;
|
|
122
126
|
DEFAULT_PRICE_FORMATTED: string;
|
|
123
|
-
DEFAULT_SINGLE_PRICE: string;
|
|
124
|
-
DEFAULT_SINGLE_PRICE_FORMATTED: string;
|
|
125
127
|
DEFAULT_CURRENCY: string;
|
|
126
128
|
};
|
|
127
129
|
};
|
|
@@ -10,7 +10,6 @@ interface ItemsBlockState {
|
|
|
10
10
|
currencySymbol: string;
|
|
11
11
|
currencyLocation: string;
|
|
12
12
|
formattedPrice: boolean;
|
|
13
|
-
singlePrice: boolean;
|
|
14
13
|
priceOrientation: 'vertical' | 'horizontal';
|
|
15
14
|
templateData: {
|
|
16
15
|
imageSrc: string;
|
|
@@ -32,7 +31,6 @@ export declare const useItemsBlockStore: import("pinia").StoreDefinition<"guidoI
|
|
|
32
31
|
setCurrencySymbol(currencySymbol: string): void;
|
|
33
32
|
setCurrencyLocation(currencyLocation: string): void;
|
|
34
33
|
setFormattedPrice(formattedPrice: boolean): void;
|
|
35
|
-
setSinglePrice(singlePrice: boolean): void;
|
|
36
34
|
setPriceOrientation(priceOrientation: "vertical" | "horizontal"): void;
|
|
37
35
|
setTemplateData(templateData: ItemsBlockState["templateData"]): void;
|
|
38
36
|
updateFromAttributes(attributes: {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import type { ItemsBlockConfig } from './utils/nodeConfigUtils';
|
|
2
1
|
declare const migrationTemplate = "ADD YOUR MIGRATION HERE";
|
|
3
2
|
type ProductType = 'CART_ITEMS' | 'BROWSED_ITEMS' | 'PURCHASED_ITEMS';
|
|
4
3
|
type OrientationType = 'vertical' | 'horizontal';
|
|
5
|
-
type PriceOrientationType = 'vertical' | 'horizontal';
|
|
6
4
|
type TemplateParameters = {
|
|
7
5
|
orientation: OrientationType;
|
|
8
6
|
itemsType: ProductType;
|
|
@@ -10,25 +8,6 @@ type TemplateParameters = {
|
|
|
10
8
|
currencySymbol?: string;
|
|
11
9
|
currencyLocation?: string;
|
|
12
10
|
formattedPrice?: boolean;
|
|
13
|
-
/** Whether to show single product price (price divided by quantity) */
|
|
14
|
-
singlePrice?: boolean;
|
|
15
|
-
migrate?: boolean;
|
|
16
|
-
/** Legacy config format (data-* attributes for migration) */
|
|
17
|
-
configBlockAttributes?: Record<string, string>;
|
|
18
|
-
/** New config format (Stripo V2 nodeConfig from esd-ext-config) */
|
|
19
|
-
nodeConfig?: Partial<ItemsBlockConfig>;
|
|
20
|
-
/** Extracted styles from a[product-attr="name"] for migration */
|
|
21
|
-
nameStyles?: string;
|
|
22
|
-
/** Extracted styles from a.es-button for migration */
|
|
23
|
-
buttonStyles?: string;
|
|
24
|
-
/** Extracted styles from p[product-attr="price"] for migration */
|
|
25
|
-
priceStyles?: string;
|
|
26
|
-
/** Extracted styles from p[product-attr="originalPrice"] for migration */
|
|
27
|
-
originalPriceStyles?: string;
|
|
28
|
-
/** Extracted styles from p[product-attr="quantity"] for migration */
|
|
29
|
-
quantityStyles?: string;
|
|
30
|
-
/** Price orientation within the card ('vertical' = stacked, 'horizontal' = side-by-side) */
|
|
31
|
-
priceOrientation?: PriceOrientationType;
|
|
32
11
|
};
|
|
33
12
|
/**
|
|
34
13
|
* Generates the default template for the Items Block.
|
|
@@ -41,5 +20,5 @@ type TemplateParameters = {
|
|
|
41
20
|
* @param params.formattedPrice - Whether to use formatted price display
|
|
42
21
|
* @returns HTML template string for the Items Block
|
|
43
22
|
*/
|
|
44
|
-
export declare function getDefaultTemplate({ orientation, itemsType, itemId, currencySymbol, currencyLocation,
|
|
23
|
+
export declare function getDefaultTemplate({ orientation, itemsType, itemId, currencySymbol, currencyLocation, formattedPrice, }: TemplateParameters): string;
|
|
45
24
|
export default migrationTemplate;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ImmutableHtmlElementNode, ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
2
|
+
/**
|
|
3
|
+
* Gets the esd-config-block element from the current node.
|
|
4
|
+
* Searches within the closest .items-block-v2 container.
|
|
5
|
+
* @param currentNode - The current node from the control (usually this.currentNode)
|
|
6
|
+
* @returns The config block element or null if not found
|
|
7
|
+
*/
|
|
8
|
+
export declare function getConfigBlock(currentNode: ImmutableHtmlNode | undefined): ImmutableHtmlElementNode | null;
|
|
9
|
+
/**
|
|
10
|
+
* Converts an attribute value to a boolean.
|
|
11
|
+
* Handles string values '1', 'true', and null/undefined cases.
|
|
12
|
+
* @param value - The attribute value (string or null)
|
|
13
|
+
* @param defaultValue - Default value to return if value is null/undefined (default: false)
|
|
14
|
+
* @returns The boolean value
|
|
15
|
+
*/
|
|
16
|
+
export declare function attributeToBoolean(value: string | null, defaultValue?: boolean): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Gets a string attribute value with a default fallback.
|
|
19
|
+
* @param value - The attribute value (string or null)
|
|
20
|
+
* @param defaultValue - Default value to return if value is null/undefined (default: '')
|
|
21
|
+
* @returns The string value or default
|
|
22
|
+
*/
|
|
23
|
+
export declare function attributeToString(value: string | null, defaultValue?: string): string;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
2
|
+
import { configAttributes } from '../enums/productEnums';
|
|
3
|
+
type StoreSetter<T> = (value: T) => void;
|
|
4
|
+
interface SyncConfig<T> {
|
|
5
|
+
attributeName: keyof typeof configAttributes;
|
|
6
|
+
storeSetter: StoreSetter<T>;
|
|
7
|
+
converter: (value: string | null) => T;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Generic utility to sync an attribute value from esd-config-block to the store.
|
|
11
|
+
* This makes attribute values mutable by syncing them from the DOM.
|
|
12
|
+
* @param currentNode - The current node from the control (usually this.currentNode)
|
|
13
|
+
* @param config - Configuration object with attribute name, store setter, and value converter
|
|
14
|
+
*/
|
|
15
|
+
export declare function syncAttributeFromConfigBlock<T>(currentNode: ImmutableHtmlNode | undefined, config: SyncConfig<T>): void;
|
|
16
|
+
/**
|
|
17
|
+
* Helper to create a sync config for boolean attributes.
|
|
18
|
+
* @param attributeName - The attribute name from configAttributes
|
|
19
|
+
* @param storeSetter - The store setter function
|
|
20
|
+
* @param defaultValue - Default value if attribute is not set (default: false)
|
|
21
|
+
* @returns Sync configuration object
|
|
22
|
+
*/
|
|
23
|
+
export declare function createBooleanSyncConfig(attributeName: keyof typeof configAttributes, storeSetter: StoreSetter<boolean>, defaultValue?: boolean): SyncConfig<boolean>;
|
|
24
|
+
/**
|
|
25
|
+
* Helper to create a sync config for string attributes.
|
|
26
|
+
* @param attributeName - The attribute name from configAttributes
|
|
27
|
+
* @param storeSetter - The store setter function
|
|
28
|
+
* @param defaultValue - Default value if attribute is not set (default: '')
|
|
29
|
+
* @returns Sync configuration object
|
|
30
|
+
*/
|
|
31
|
+
export declare function createStringSyncConfig(attributeName: keyof typeof configAttributes, storeSetter: StoreSetter<string>, defaultValue?: string): SyncConfig<string>;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
2
|
+
/**
|
|
3
|
+
* Reads name trimming value from esd-config-block attribute and updates the store.
|
|
4
|
+
* This makes the trimming value mutable by syncing it from the DOM.
|
|
5
|
+
* @param currentNode - The current node from the control (usually this.currentNode)
|
|
6
|
+
*/
|
|
7
|
+
export declare function syncNameTrimmingFromAttributes(currentNode: ImmutableHtmlNode | undefined): void;
|
|
8
|
+
/**
|
|
9
|
+
* Reads hide discount value from esd-config-block attribute and updates the store.
|
|
10
|
+
* This makes the hide discount value mutable by syncing it from the DOM.
|
|
11
|
+
* @param currentNode - The current node from the control (usually this.currentNode)
|
|
12
|
+
*/
|
|
13
|
+
export declare function syncHideDiscountFromAttributes(currentNode: ImmutableHtmlNode | undefined): void;
|
|
14
|
+
/**
|
|
15
|
+
* Reads formatted price value from esd-config-block attribute and updates the store.
|
|
16
|
+
* This makes the formatted price value mutable by syncing it from the DOM.
|
|
17
|
+
* Defaults to true if not set, since formatted is the default.
|
|
18
|
+
* @param currentNode - The current node from the control (usually this.currentNode)
|
|
19
|
+
*/
|
|
20
|
+
export declare function syncFormattedPriceFromAttributes(currentNode: ImmutableHtmlNode | undefined): void;
|
|
21
|
+
/**
|
|
22
|
+
* Reads currency symbol value from esd-config-block attribute and updates the store.
|
|
23
|
+
* This makes the currency symbol value mutable by syncing it from the DOM.
|
|
24
|
+
* @param currentNode - The current node from the control (usually this.currentNode)
|
|
25
|
+
*/
|
|
26
|
+
export declare function syncCurrencySymbolFromAttributes(currentNode: ImmutableHtmlNode | undefined): void;
|
|
27
|
+
/**
|
|
28
|
+
* Reads currency location value from esd-config-block attribute and updates the store.
|
|
29
|
+
* This makes the currency location value mutable by syncing it from the DOM.
|
|
30
|
+
* @param currentNode - The current node from the control (usually this.currentNode)
|
|
31
|
+
*/
|
|
32
|
+
export declare function syncCurrencyLocationFromAttributes(currentNode: ImmutableHtmlNode | undefined): void;
|
|
33
|
+
/**
|
|
34
|
+
* Reads button link value from esd-config-block attribute and updates the store.
|
|
35
|
+
* This makes the button link value mutable by syncing it from the DOM.
|
|
36
|
+
* @param currentNode - The current node from the control (usually this.currentNode)
|
|
37
|
+
*/
|
|
38
|
+
export declare function syncButtonLinkFromAttributes(currentNode: ImmutableHtmlNode | undefined): void;
|
|
39
|
+
/**
|
|
40
|
+
* Reads image link value from esd-config-block attribute and updates the store.
|
|
41
|
+
* This makes the image link value mutable by syncing it from the DOM.
|
|
42
|
+
* @param currentNode - The current node from the control (usually this.currentNode)
|
|
43
|
+
*/
|
|
44
|
+
export declare function syncImageLinkFromAttributes(currentNode: ImmutableHtmlNode | undefined): void;
|
|
45
|
+
/**
|
|
46
|
+
* Reads price orientation value from esd-config-block attribute and updates the store.
|
|
47
|
+
* This makes the price orientation value mutable by syncing it from the DOM.
|
|
48
|
+
* @param currentNode - The current node from the control (usually this.currentNode)
|
|
49
|
+
*/
|
|
50
|
+
export declare function syncPriceOrientationFromAttributes(currentNode: ImmutableHtmlNode | undefined): void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ImmutableHtmlNode, ControlApi } from '@stripoinc/ui-editor-extensions';
|
|
2
|
+
/**
|
|
3
|
+
* Updates attributes on the esd-config-block element based on current store state.
|
|
4
|
+
* This utility can be called from controls whenever they change values that affect attributes.
|
|
5
|
+
* @param currentNode - The current node from the control (usually this.currentNode)
|
|
6
|
+
* @param api - The API object from the control (usually this.api)
|
|
7
|
+
*/
|
|
8
|
+
export declare function updateConfigBlockAttributes(currentNode: ImmutableHtmlNode | undefined, api: ControlApi): void;
|
|
@@ -56,24 +56,25 @@ export declare abstract class CommonControl extends Control {
|
|
|
56
56
|
onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
|
|
57
57
|
onDestroy(): void;
|
|
58
58
|
/**
|
|
59
|
-
* Gets the
|
|
60
|
-
* @returns The
|
|
59
|
+
* Gets the config block element from the current node.
|
|
60
|
+
* @returns The config block element or null if not found
|
|
61
61
|
*/
|
|
62
|
-
protected
|
|
62
|
+
protected getConfigBlock(): ImmutableHtmlElementNode | null;
|
|
63
63
|
/**
|
|
64
|
-
* Gets the current block instance ID from the
|
|
64
|
+
* Gets the current block instance ID from the config block.
|
|
65
|
+
* @param blockInstanceIdAttribute - The attribute name for block instance ID (default: 'data-block-instance-id')
|
|
65
66
|
* @returns The block instance ID or null if not found
|
|
66
67
|
*/
|
|
67
|
-
protected getBlockInstanceId(): string | null;
|
|
68
|
+
protected getBlockInstanceId(blockInstanceIdAttribute?: string): string | null;
|
|
68
69
|
/**
|
|
69
70
|
* Handles block instance change detection and syncing.
|
|
70
|
-
* This is a helper method for controls that need to sync
|
|
71
|
-
*
|
|
72
|
-
* @param syncFunction - Function to call when block instance changes (to sync from node config)
|
|
71
|
+
* This is a helper method for controls that need to sync attributes when switching between block instances.
|
|
72
|
+
* @param syncFunction - Function to call when block instance changes (to sync from attributes)
|
|
73
73
|
* @param updateUI - Function to call to update the UI (called both on change and when same block)
|
|
74
|
+
* @param blockInstanceIdAttribute - The attribute name for block instance ID (default: 'data-block-instance-id')
|
|
74
75
|
* @returns true if block instance changed, false otherwise
|
|
75
76
|
*/
|
|
76
|
-
protected handleBlockInstanceChange(syncFunction: (node: ImmutableHtmlNode) => void, updateUI: () => void): boolean;
|
|
77
|
+
protected handleBlockInstanceChange(syncFunction: (node: ImmutableHtmlNode) => void, updateUI: () => void, blockInstanceIdAttribute?: string): boolean;
|
|
77
78
|
_GuLabel({ text, name, position }: LabelProps): string;
|
|
78
79
|
_GuToggle(name: string): string;
|
|
79
80
|
_GuSelectItem({ text, value }: {
|