@useinsider/guido 2.0.0-beta.5b1fb5a → 2.0.0-beta.5c09f2c
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 +2 -0
- package/dist/@types/config/schemas.js +55 -39
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +15 -17
- package/dist/components/organisms/email-preview/PreviewContainer.vue.js +3 -3
- package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.js +6 -6
- package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue2.js +17 -13
- package/dist/components/organisms/email-preview/amp/AmpToggle.vue.js +6 -6
- package/dist/components/organisms/email-preview/amp/AmpToggle.vue2.js +14 -12
- package/dist/components/organisms/email-preview/desktop-preview/DesktopBrowserHeader.vue.js +18 -0
- package/dist/components/organisms/email-preview/desktop-preview/DesktopBrowserHeader.vue2.js +15 -0
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +10 -14
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +14 -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 +11 -10
- package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.js +12 -10
- 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/EditorActions.vue.js +21 -0
- package/dist/components/organisms/header/EditorActions.vue2.js +41 -0
- package/dist/components/organisms/header/EditorToolbar.vue.js +18 -0
- package/dist/components/organisms/header/EditorToolbar.vue2.js +17 -0
- package/dist/components/organisms/header/HeaderWrapper.vue.js +6 -5
- package/dist/components/organisms/header/LeftSlot.vue.js +11 -11
- package/dist/components/organisms/header/LeftSlot.vue2.js +11 -12
- package/dist/components/organisms/header/MiddleSlot.vue.js +7 -7
- package/dist/components/organisms/header/MiddleSlot.vue2.js +11 -15
- package/dist/components/organisms/header/RightSlot.vue.js +11 -14
- package/dist/components/organisms/header/RightSlot.vue2.js +13 -30
- package/dist/components/organisms/header/version-history/VersionHistory.vue.js +5 -5
- 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/useActionsApi.js +33 -30
- package/dist/composables/useConfig.js +29 -27
- package/dist/composables/useSave.js +13 -11
- package/dist/composables/useStripo.js +40 -40
- package/dist/config/migrator/recommendationMigrator.js +2 -2
- 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/Recommendation/block.js +40 -6
- package/dist/extensions/Blocks/Recommendation/constants/blockIds.js +4 -0
- package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +4 -0
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +64 -0
- package/dist/extensions/Blocks/Recommendation/constants/layout.js +20 -0
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +19 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/index.js +64 -0
- package/dist/extensions/Blocks/Recommendation/controls/cardBackground/index.js +80 -0
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +232 -0
- package/dist/extensions/Blocks/Recommendation/controls/image/index.js +19 -0
- package/dist/extensions/Blocks/Recommendation/controls/layout/index.js +96 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +110 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/currency.js +204 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/filters.js +54 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +201 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/locale.js +74 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +118 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/shuffle.js +71 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +286 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/index.js +46 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +76 -0
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/index.js +44 -0
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.js +48 -0
- package/dist/extensions/Blocks/Recommendation/controls/{omnibusDiscountTextAfterControl.js → omnibusDiscount/textAfter.js} +16 -14
- package/dist/extensions/Blocks/Recommendation/controls/{omnibusDiscountTextBeforeControl.js → omnibusDiscount/textBefore.js} +16 -14
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/index.js +48 -0
- package/dist/extensions/Blocks/Recommendation/controls/{omnibusPriceTextAfterControl.js → omnibusPrice/textAfter.js} +16 -14
- package/dist/extensions/Blocks/Recommendation/controls/{omnibusPriceTextBeforeControl.js → omnibusPrice/textBefore.js} +14 -12
- package/dist/extensions/Blocks/Recommendation/controls/price/index.js +44 -0
- package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +222 -0
- package/dist/extensions/Blocks/Recommendation/extension.js +40 -17
- package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +19 -3
- package/dist/extensions/Blocks/Recommendation/recommendation.css.js +13 -4
- package/dist/extensions/Blocks/Recommendation/services/configService.js +239 -0
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +21 -10
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +41 -36
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +233 -0
- package/dist/extensions/Blocks/Recommendation/templates/grid/migration.js +251 -0
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +69 -0
- package/dist/extensions/Blocks/Recommendation/templates/index.js +12 -0
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +174 -0
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +73 -0
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +121 -0
- package/dist/extensions/Blocks/Recommendation/types/nodeConfig.js +6 -0
- package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +9 -9
- package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +27 -16
- package/dist/extensions/Blocks/Recommendation/utils/priceFormatter.js +29 -0
- package/dist/extensions/Blocks/Recommendation/utils/tagName.js +46 -0
- package/dist/extensions/Blocks/Unsubscribe/extension.js +9 -9
- package/dist/extensions/Blocks/common-control.js +6 -7
- package/dist/extensions/Blocks/controlFactories.js +155 -121
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +223 -169
- package/dist/services/recommendationApi.js +10 -9
- package/dist/services/stripoApi.js +6 -10
- package/dist/src/@types/config/index.d.ts +2 -2
- package/dist/src/@types/config/schemas.d.ts +30 -0
- package/dist/src/@types/config/types.d.ts +7 -1
- package/dist/src/components/organisms/email-preview/desktop-preview/DesktopBrowserHeader.vue.d.ts +2 -0
- package/dist/src/components/organisms/header/EditorActions.vue.d.ts +4 -0
- package/dist/src/components/organisms/header/EditorToolbar.vue.d.ts +2 -0
- package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -1
- package/dist/src/components/wrappers/WpDrawer.vue.d.ts +1 -1
- package/dist/src/composables/useActionsApi.d.ts +1 -0
- package/dist/src/composables/useConfig.d.ts +8 -0
- 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/Recommendation/block.d.ts +34 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/blockIds.d.ts +13 -0
- package/dist/src/extensions/Blocks/Recommendation/{constants.d.ts → constants/controlIds.d.ts} +0 -24
- package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +49 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +13 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/layout.d.ts +35 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +31 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/index.d.ts +143 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/{cardBackgroundColorControl.d.ts → cardBackground/index.d.ts} +9 -3
- package/dist/src/extensions/Blocks/Recommendation/{cardCompositionControl.d.ts → controls/cardComposition/index.d.ts} +23 -3
- package/dist/src/extensions/Blocks/Recommendation/controls/image/index.d.ts +35 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +21 -589
- package/dist/src/extensions/Blocks/Recommendation/controls/layout/index.d.ts +37 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/algorithm.d.ts +29 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/currency.d.ts +45 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/filters.d.ts +22 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +56 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/locale.d.ts +24 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/productLayout.d.ts +42 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/shuffle.d.ts +23 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +214 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/index.d.ts +97 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/{nameTextTrimControl.d.ts → name/textTrim.d.ts} +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/index.d.ts +95 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.d.ts +100 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/{omnibusDiscountTextAfterControl.d.ts → omnibusDiscount/textAfter.d.ts} +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/{omnibusDiscountTextBeforeControl.d.ts → omnibusDiscount/textBefore.d.ts} +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/index.d.ts +100 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/{omnibusPriceTextAfterControl.d.ts → omnibusPrice/textAfter.d.ts} +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/{omnibusPriceTextBeforeControl.d.ts → omnibusPrice/textBefore.d.ts} +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/price/index.d.ts +95 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/{spacingControl.d.ts → spacing/index.d.ts} +33 -10
- package/dist/src/extensions/Blocks/Recommendation/extension.d.ts +9 -0
- package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +151 -0
- package/dist/src/extensions/Blocks/Recommendation/services/index.d.ts +6 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +17 -16
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/elementRenderer.d.ts +20 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/{migrationTemplate.d.ts → grid/migration.d.ts} +11 -4
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +33 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/index.d.ts +39 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/list/elementRenderer.d.ts +8 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/list/migration.d.ts +25 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +18 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +54 -0
- package/dist/src/extensions/Blocks/Recommendation/types/index.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +154 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/priceFormatter.d.ts +33 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/stylePreserver.d.ts +113 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/tagName.d.ts +77 -0
- package/dist/src/extensions/Blocks/common-control.d.ts +1 -1
- package/dist/src/stores/config.d.ts +164 -1
- package/dist/src/stores/editor.d.ts +21 -0
- 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/static/styles/components/wide-panel.css.js +1 -1
- package/dist/static/styles/customEditorStyle.css.js +25 -2
- package/dist/stores/config.js +7 -0
- package/dist/stores/editor.js +1 -0
- package/dist/utils/templatePreparation.js +17 -17
- package/package.json +1 -1
- 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/extensions/Blocks/Recommendation/cardCompositionControl.js +0 -187
- package/dist/extensions/Blocks/Recommendation/constants.js +0 -13
- package/dist/extensions/Blocks/Recommendation/control.js +0 -336
- package/dist/extensions/Blocks/Recommendation/controls/cardBackgroundColorControl.js +0 -68
- package/dist/extensions/Blocks/Recommendation/controls/index.js +0 -245
- package/dist/extensions/Blocks/Recommendation/controls/nameTextTrimControl.js +0 -74
- package/dist/extensions/Blocks/Recommendation/controls/spacingControl.js +0 -188
- package/dist/extensions/Blocks/Recommendation/templates/blockTemplate.js +0 -181
- package/dist/extensions/Blocks/Recommendation/templates/migrationTemplate.js +0 -189
- package/dist/extensions/Blocks/Recommendation/templates/templateUtils.js +0 -209
- package/dist/src/extensions/Blocks/Recommendation/control.d.ts +0 -38
- package/dist/src/extensions/Blocks/Recommendation/templates/blockTemplate.d.ts +0 -16
- package/dist/src/extensions/Blocks/Recommendation/templates/templateUtils.d.ts +0 -52
- package/dist/static/assets/inbox-mockup.svg.js +0 -4
- package/dist/static/assets/phone-mockup.svg.js +0 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { useHttp as
|
|
2
|
-
import { URLS as
|
|
3
|
-
const
|
|
4
|
-
const { get: o } =
|
|
1
|
+
import { useHttp as a } from "../composables/useHttp.js";
|
|
2
|
+
import { URLS as s } from "../enums/extensions/recommendationBlock.js";
|
|
3
|
+
const u = () => {
|
|
4
|
+
const { get: o } = a();
|
|
5
5
|
return {
|
|
6
6
|
fetchRecommendationCreateData: async () => {
|
|
7
7
|
try {
|
|
@@ -18,14 +18,15 @@ const R = () => {
|
|
|
18
18
|
throw console.error("fetchRecommendationFilters error:", e), e;
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
|
-
fetchRecommendationProducts: async (e,
|
|
21
|
+
fetchRecommendationProducts: async (e, c) => {
|
|
22
|
+
var n;
|
|
22
23
|
try {
|
|
23
|
-
const t = decodeURIComponent(new URLSearchParams(Object.entries(
|
|
24
|
+
const t = decodeURIComponent(new URLSearchParams(Object.entries(c)).toString());
|
|
24
25
|
console.debug("🏁 Recommendation API Query:", t);
|
|
25
26
|
const r = await o(
|
|
26
|
-
`${
|
|
27
|
+
`${s.RECOMMENDATION_API_URL}/v2/${e}?${t}`
|
|
27
28
|
);
|
|
28
|
-
return (r == null ? void 0 : r.data) ?? [];
|
|
29
|
+
return ((n = r == null ? void 0 : r.data) == null ? void 0 : n.data) ?? [];
|
|
29
30
|
} catch (t) {
|
|
30
31
|
throw console.error("fetchRecommendationProducts error:", t), t;
|
|
31
32
|
}
|
|
@@ -33,5 +34,5 @@ const R = () => {
|
|
|
33
34
|
};
|
|
34
35
|
};
|
|
35
36
|
export {
|
|
36
|
-
|
|
37
|
+
u as useRecommendationApi
|
|
37
38
|
};
|
|
@@ -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 i } from "../composables/useToaster.js";
|
|
3
|
+
import { MAX_DEFAULT_TEMPLATE_ID as p } from "../enums/defaults.js";
|
|
4
4
|
const y = () => {
|
|
5
|
-
const { get: r } = m(), { handleError: o } =
|
|
5
|
+
const { get: r } = m(), { handleError: o } = i();
|
|
6
6
|
return {
|
|
7
7
|
getToken: async () => {
|
|
8
8
|
try {
|
|
@@ -26,17 +26,13 @@ const y = () => {
|
|
|
26
26
|
getDefaultTemplate: async () => {
|
|
27
27
|
const t = {
|
|
28
28
|
html: "",
|
|
29
|
-
css: ""
|
|
30
|
-
forceRecreate: !0
|
|
29
|
+
css: ""
|
|
31
30
|
};
|
|
32
31
|
try {
|
|
33
|
-
const c = new URLSearchParams(window.location.search).get("default-template"), s = c ? parseInt(c) : 0, l = s >= 1 && s <=
|
|
32
|
+
const c = new URLSearchParams(window.location.search).get("default-template"), s = c ? parseInt(c) : 0, l = s >= 1 && s <= p ? s : 0, { data: n } = await r(
|
|
34
33
|
`/stripo/default-template/${l}`
|
|
35
34
|
), a = typeof n == "string" ? JSON.parse(n) : n;
|
|
36
|
-
return !a || typeof a != "object" || !("html" in a) || !("css" in a) ? t :
|
|
37
|
-
...a,
|
|
38
|
-
forceRecreate: !0
|
|
39
|
-
};
|
|
35
|
+
return !a || typeof a != "object" || !("html" in a) || !("css" in a) ? t : a;
|
|
40
36
|
} catch (e) {
|
|
41
37
|
return o(e, "Failed to fetch default template"), t;
|
|
42
38
|
}
|
|
@@ -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, 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';
|
|
10
|
+
export { MessageType, ProductType, GuidoConfigSchema, IdentitySchema, PartnerSchema, TemplateSchema, EditorSchema, UISchema, FeaturesSchema, BlocksSchema, CompilerSchema, CallbacksSchema, 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, CallbacksConfig, CallbacksConfigInput, ExternalValidationHandler, 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,7 +5,14 @@
|
|
|
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';
|
|
8
9
|
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>;
|
|
9
16
|
/**
|
|
10
17
|
* Message type constants for email templates
|
|
11
18
|
*/
|
|
@@ -90,6 +97,8 @@ export declare const TemplateSchema: v.ObjectSchema<{
|
|
|
90
97
|
}, undefined>, undefined>, readonly []>;
|
|
91
98
|
/** Selected unsubscribe page IDs */
|
|
92
99
|
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>;
|
|
93
102
|
}, undefined>;
|
|
94
103
|
/**
|
|
95
104
|
* Email header configuration (sender name and subject)
|
|
@@ -344,6 +353,16 @@ export declare const CompilerSchema: v.ObjectSchema<{
|
|
|
344
353
|
/** Skip default compiler rules */
|
|
345
354
|
readonly ignoreDefaultRules: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
346
355
|
}, 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>;
|
|
347
366
|
/**
|
|
348
367
|
* Complete Guido configuration schema
|
|
349
368
|
*
|
|
@@ -356,6 +375,7 @@ export declare const CompilerSchema: v.ObjectSchema<{
|
|
|
356
375
|
* - features: Feature toggles
|
|
357
376
|
* - blocks: Block configuration
|
|
358
377
|
* - compiler: HTML compilation
|
|
378
|
+
* - callbacks: Event handlers and hooks
|
|
359
379
|
*/
|
|
360
380
|
export declare const GuidoConfigSchema: v.ObjectSchema<{
|
|
361
381
|
/** Identity configuration (required) */
|
|
@@ -400,6 +420,8 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
|
|
|
400
420
|
}, undefined>, undefined>, readonly []>;
|
|
401
421
|
/** Selected unsubscribe page IDs */
|
|
402
422
|
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>;
|
|
403
425
|
}, undefined>, {}>;
|
|
404
426
|
/** Editor settings */
|
|
405
427
|
readonly editor: v.OptionalSchema<v.ObjectSchema<{
|
|
@@ -506,4 +528,12 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
|
|
|
506
528
|
/** Skip default compiler rules */
|
|
507
529
|
readonly ignoreDefaultRules: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
508
530
|
}, 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>, {}>;
|
|
509
539
|
}, 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, DynamicContentSchema, EmailHeaderSchema, CompilerRuleSchema, ReplaceRuleSchema, RegexRuleSchema, RemoveRuleSchema, CustomRuleSchema, DefaultBlockTypeSchema, CustomBlockTypeSchema } from './schemas';
|
|
8
|
+
import type { GuidoConfigSchema, IdentitySchema, PartnerSchema, TemplateSchema, EditorSchema, UISchema, FeaturesSchema, BlocksSchema, CompilerSchema, CallbacksSchema, DynamicContentSchema, EmailHeaderSchema, CompilerRuleSchema, ReplaceRuleSchema, RegexRuleSchema, RemoveRuleSchema, CustomRuleSchema, DefaultBlockTypeSchema, CustomBlockTypeSchema, ExternalValidationHandler } from './schemas';
|
|
9
9
|
import type * as v from 'valibot';
|
|
10
10
|
/**
|
|
11
11
|
* Complete validated Guido configuration.
|
|
@@ -41,6 +41,10 @@ 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 };
|
|
44
48
|
/** Email header configuration (senderName, subject) */
|
|
45
49
|
export type EmailHeader = v.InferOutput<typeof EmailHeaderSchema>;
|
|
46
50
|
/** Dynamic content item */
|
|
@@ -85,6 +89,8 @@ export type FeaturesConfigInput = v.InferInput<typeof FeaturesSchema>;
|
|
|
85
89
|
export type BlocksConfigInput = v.InferInput<typeof BlocksSchema>;
|
|
86
90
|
/** Input type for compiler configuration */
|
|
87
91
|
export type CompilerConfigInput = v.InferInput<typeof CompilerSchema>;
|
|
92
|
+
/** Input type for callbacks configuration */
|
|
93
|
+
export type CallbacksConfigInput = v.InferInput<typeof CallbacksSchema>;
|
|
88
94
|
/** Default Stripo block types */
|
|
89
95
|
export type DefaultBlockType = v.InferOutput<typeof DefaultBlockTypeSchema>;
|
|
90
96
|
/** Custom Guido block types */
|
package/dist/src/components/organisms/email-preview/desktop-preview/DesktopBrowserHeader.vue.d.ts
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {
|
|
2
|
+
handleSave: (isSilent: boolean) => Promise<import("../../../@types/stripo").SavedTemplateDetails | undefined>;
|
|
3
|
+
}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
2
|
+
export default _default;
|
|
@@ -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> | 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;
|
|
@@ -33,8 +33,8 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<
|
|
|
33
33
|
descriptionStatus: boolean;
|
|
34
34
|
descriptionText: string;
|
|
35
35
|
}>>>, {
|
|
36
|
-
className: string;
|
|
37
36
|
size: "small" | "medium" | "large";
|
|
37
|
+
className: string;
|
|
38
38
|
closeOnOutsideClick: boolean;
|
|
39
39
|
descriptionStatus: boolean;
|
|
40
40
|
descriptionText: string;
|
|
@@ -7,4 +7,5 @@ export declare const useActionsApi: () => {
|
|
|
7
7
|
getPreviewData: (options?: CompileEmailOptions) => Promise<CompiledEmailResult>;
|
|
8
8
|
updateTimerInClonedTemplate: () => Promise<string | null>;
|
|
9
9
|
updateHtmlAndCss: (html: string, css: string) => void;
|
|
10
|
+
editorSave: () => void;
|
|
10
11
|
};
|
|
@@ -31,6 +31,7 @@ export declare const useConfig: () => {
|
|
|
31
31
|
} | undefined;
|
|
32
32
|
}[];
|
|
33
33
|
selectedUnsubscribePages: number[];
|
|
34
|
+
forceRecreate: boolean;
|
|
34
35
|
};
|
|
35
36
|
editor: {
|
|
36
37
|
locale: string;
|
|
@@ -90,6 +91,9 @@ export declare const useConfig: () => {
|
|
|
90
91
|
})[];
|
|
91
92
|
ignoreDefaultRules: boolean;
|
|
92
93
|
};
|
|
94
|
+
callbacks: {
|
|
95
|
+
externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
|
|
96
|
+
};
|
|
93
97
|
} | null>;
|
|
94
98
|
initialized: import("vue").Ref<boolean>;
|
|
95
99
|
identity: import("vue").ComputedRef<{
|
|
@@ -116,6 +120,7 @@ export declare const useConfig: () => {
|
|
|
116
120
|
} | undefined;
|
|
117
121
|
}[];
|
|
118
122
|
selectedUnsubscribePages: number[];
|
|
123
|
+
forceRecreate: boolean;
|
|
119
124
|
} | null>;
|
|
120
125
|
editor: import("vue").ComputedRef<{
|
|
121
126
|
locale: string;
|
|
@@ -175,6 +180,9 @@ export declare const useConfig: () => {
|
|
|
175
180
|
})[];
|
|
176
181
|
ignoreDefaultRules: boolean;
|
|
177
182
|
} | null>;
|
|
183
|
+
callbacks: import("vue").ComputedRef<{
|
|
184
|
+
externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
|
|
185
|
+
} | null>;
|
|
178
186
|
templateId: import("vue").ComputedRef<string>;
|
|
179
187
|
userId: import("vue").ComputedRef<string>;
|
|
180
188
|
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.insiderone.com//docs/email-drag-and-drop-editor";
|
|
9
|
+
readonly GLOBAL_UNSUBSCRIBE: "https://academy.insiderone.com//docs/global-unsubscribe-preference-center";
|
|
10
|
+
readonly AMP_FOR_EMAILS: "https://academy.insiderone.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;
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recommendation Block
|
|
3
|
+
*
|
|
4
|
+
* Main block class for the Recommendation extension.
|
|
5
|
+
* Handles block lifecycle including configuration initialization and migration.
|
|
6
|
+
*/
|
|
7
|
+
import type { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
1
8
|
import { Block, BlockCompositionType } from '@stripoinc/ui-editor-extensions';
|
|
2
9
|
export declare const BLOCK_ID = "recommendation-block";
|
|
3
10
|
export declare class RecommendationBlock extends Block {
|
|
@@ -8,4 +15,31 @@ export declare class RecommendationBlock extends Block {
|
|
|
8
15
|
getName(): string;
|
|
9
16
|
getDescription(): string;
|
|
10
17
|
getTemplate(): string;
|
|
18
|
+
/**
|
|
19
|
+
* Called when a new block is dropped into the template
|
|
20
|
+
*
|
|
21
|
+
* Initializes the block with default configuration stored via node config.
|
|
22
|
+
* This ensures the configuration persists with the template.
|
|
23
|
+
* @param node - The newly created block node
|
|
24
|
+
*/
|
|
25
|
+
onCreated(node: ImmutableHtmlNode): void;
|
|
26
|
+
/**
|
|
27
|
+
* Called when the document changes or template is loaded
|
|
28
|
+
*
|
|
29
|
+
* Handles migration from legacy templates that don't have node config.
|
|
30
|
+
* Also handles config version upgrades for future migrations.
|
|
31
|
+
* @param node - The block node that may need migration
|
|
32
|
+
*/
|
|
33
|
+
onDocumentChanged(node: ImmutableHtmlNode): void;
|
|
34
|
+
/**
|
|
35
|
+
* Migrate configuration from legacy format
|
|
36
|
+
*
|
|
37
|
+
* Legacy templates may store configuration in:
|
|
38
|
+
* - data-attributes (data-layout, data-card-composition, etc.)
|
|
39
|
+
* - Pinia store (lost on reload - this is what we're fixing)
|
|
40
|
+
*
|
|
41
|
+
* This method reads what we can from the DOM and initializes proper node config.
|
|
42
|
+
* @param node - The block node to migrate
|
|
43
|
+
*/
|
|
44
|
+
private _migrateFromLegacy;
|
|
11
45
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Block IDs used in the Recommendation Extension
|
|
3
|
+
* These IDs are used in the esd-extension-block-id attribute to identify specific blocks
|
|
4
|
+
*/
|
|
5
|
+
export declare enum RecommendationBlockId {
|
|
6
|
+
BUTTON = "recommendation-block-button",
|
|
7
|
+
NAME = "recommendation-block-name",
|
|
8
|
+
PRICE = "recommendation-block-price",
|
|
9
|
+
OLD_PRICE = "recommendation-block-old-price",
|
|
10
|
+
OMNIBUS_PRICE = "recommendation-block-omnibus-price",
|
|
11
|
+
OMNIBUS_DISCOUNT = "recommendation-block-omnibus-discount",
|
|
12
|
+
IMAGE = "recommendation-block-image"
|
|
13
|
+
}
|
package/dist/src/extensions/Blocks/Recommendation/{constants.d.ts → constants/controlIds.d.ts}
RENAMED
|
@@ -1,27 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Attribute type constants used in templates
|
|
3
|
-
* These are used as keys in ElementRenderer and composition arrays
|
|
4
|
-
*/
|
|
5
|
-
export declare const ATTR_PRODUCT_IMAGE = "productImage";
|
|
6
|
-
export declare const ATTR_PRODUCT_NAME = "productName";
|
|
7
|
-
export declare const ATTR_PRODUCT_PRICE = "productPrice";
|
|
8
|
-
export declare const ATTR_PRODUCT_OLD_PRICE = "productOldPrice";
|
|
9
|
-
export declare const ATTR_PRODUCT_OMNIBUS_PRICE = "productOmnibusPrice";
|
|
10
|
-
export declare const ATTR_PRODUCT_OMNIBUS_DISCOUNT = "productOmnibusDiscount";
|
|
11
|
-
export declare const ATTR_PRODUCT_BUTTON = "productButton";
|
|
12
|
-
/**
|
|
13
|
-
* Block IDs used in the Recommendation Extension
|
|
14
|
-
* These IDs are used in the esd-extension-block-id attribute to identify specific blocks
|
|
15
|
-
*/
|
|
16
|
-
export declare enum RecommendationBlockId {
|
|
17
|
-
BUTTON = "recommendation-block-button",
|
|
18
|
-
NAME = "recommendation-block-name",
|
|
19
|
-
PRICE = "recommendation-block-price",
|
|
20
|
-
OLD_PRICE = "recommendation-block-old-price",
|
|
21
|
-
OMNIBUS_PRICE = "recommendation-block-omnibus-price",
|
|
22
|
-
OMNIBUS_DISCOUNT = "recommendation-block-omnibus-discount",
|
|
23
|
-
IMAGE = "recommendation-block-image"
|
|
24
|
-
}
|
|
25
1
|
/**
|
|
26
2
|
* Control IDs used in the Recommendation Extension
|
|
27
3
|
* These IDs are returned by the getId() method of each control
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default Configuration for Recommendation Block
|
|
3
|
+
*
|
|
4
|
+
* This module provides the default values for RecommendationNodeConfig.
|
|
5
|
+
* These values are used when:
|
|
6
|
+
* - A new block is dropped into the template
|
|
7
|
+
* - Migrating legacy templates without stored config
|
|
8
|
+
* - Merging partial updates with existing config
|
|
9
|
+
*/
|
|
10
|
+
import type { RecommendationNodeConfig, CurrencyConfig, OmnibusTextConfig } from '../types/nodeConfig';
|
|
11
|
+
/**
|
|
12
|
+
* Default currency configuration
|
|
13
|
+
* Uses USD as the base currency with standard formatting
|
|
14
|
+
* Note: symbol stores the currency code (e.g., 'USD'), not the symbol character ('$')
|
|
15
|
+
* This matches the Currency Symbol dropdown which shows currency codes
|
|
16
|
+
*/
|
|
17
|
+
export declare const DEFAULT_CURRENCY: CurrencyConfig;
|
|
18
|
+
/**
|
|
19
|
+
* Default omnibus price text configuration
|
|
20
|
+
* Pre-filled with common EU Omnibus Directive text
|
|
21
|
+
*/
|
|
22
|
+
export declare const DEFAULT_OMNIBUS_PRICE: OmnibusTextConfig;
|
|
23
|
+
/**
|
|
24
|
+
* Default omnibus discount text configuration
|
|
25
|
+
*/
|
|
26
|
+
export declare const DEFAULT_OMNIBUS_DISCOUNT: OmnibusTextConfig;
|
|
27
|
+
/**
|
|
28
|
+
* Default card composition order
|
|
29
|
+
* Defines the visual order of elements in product cards
|
|
30
|
+
*/
|
|
31
|
+
export declare const DEFAULT_COMPOSITION: string[];
|
|
32
|
+
/**
|
|
33
|
+
* Default visibility settings for card elements
|
|
34
|
+
* Omnibus elements are hidden by default (not all regions require them)
|
|
35
|
+
*/
|
|
36
|
+
export declare const DEFAULT_VISIBILITY: Record<string, boolean>;
|
|
37
|
+
/**
|
|
38
|
+
* Complete default configuration for Recommendation Block
|
|
39
|
+
*
|
|
40
|
+
* This is the single source of truth for default values.
|
|
41
|
+
* All other code should import and use this constant.
|
|
42
|
+
*/
|
|
43
|
+
export declare const DEFAULT_NODE_CONFIG: RecommendationNodeConfig;
|
|
44
|
+
/**
|
|
45
|
+
* Current configuration version
|
|
46
|
+
* Increment this when making breaking changes to the schema
|
|
47
|
+
* Used for migration detection
|
|
48
|
+
*/
|
|
49
|
+
export declare const CURRENT_CONFIG_VERSION = 1;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recommendation Extension Constants
|
|
3
|
+
*
|
|
4
|
+
* This module re-exports all constants for the Recommendation extension.
|
|
5
|
+
* Import from this file for cleaner imports.
|
|
6
|
+
* @example
|
|
7
|
+
* import { RecommendationBlockId, CONTAINER_SELECTOR } from './constants';
|
|
8
|
+
*/
|
|
9
|
+
export { RecommendationBlockId } from './blockIds';
|
|
10
|
+
export { RecommendationControlId } from './controlIds';
|
|
11
|
+
export { CONTAINER_SELECTOR, CURRENCY_ATTR, ATTR_PRODUCT_IMAGE, ATTR_PRODUCT_NAME, ATTR_PRODUCT_PRICE, ATTR_PRODUCT_OLD_PRICE, ATTR_PRODUCT_OMNIBUS_PRICE, ATTR_PRODUCT_OMNIBUS_DISCOUNT, ATTR_PRODUCT_BUTTON, } from './selectors';
|
|
12
|
+
export { LAYOUT_VALUES, LAYOUT_OPTIONS, DEFAULT_PRODUCTS_PER_ROW, DEFAULT_CARDS_IN_ROW, MAX_PRODUCT_COUNT, MIN_PRODUCT_COUNT, MAX_PRODUCTS_PER_ROW, MIN_PRODUCTS_PER_ROW, DEFAULT_COLUMN_SPACING, DEFAULT_ROW_SPACING, MIN_SPACING, MAX_SPACING, SPACING_STEP, } from './layout';
|
|
13
|
+
export { DEFAULT_NODE_CONFIG, DEFAULT_CURRENCY, DEFAULT_COMPOSITION, DEFAULT_VISIBILITY, CURRENT_CONFIG_VERSION, } from './defaultConfig';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/** Type-safe layout orientation values */
|
|
2
|
+
export declare const LAYOUT_VALUES: {
|
|
3
|
+
GRID: "grid";
|
|
4
|
+
LIST: "list";
|
|
5
|
+
};
|
|
6
|
+
/** Layout options for radio button UI control */
|
|
7
|
+
export declare const LAYOUT_OPTIONS: ({
|
|
8
|
+
icon: string;
|
|
9
|
+
value: "grid";
|
|
10
|
+
} | {
|
|
11
|
+
icon: string;
|
|
12
|
+
value: "list";
|
|
13
|
+
})[];
|
|
14
|
+
/** Default number of products displayed per row in grid layout */
|
|
15
|
+
export declare const DEFAULT_PRODUCTS_PER_ROW = 3;
|
|
16
|
+
/** Default number of cards in a row (used in store initialization) */
|
|
17
|
+
export declare const DEFAULT_CARDS_IN_ROW = 3;
|
|
18
|
+
/** Maximum number of products that can be displayed */
|
|
19
|
+
export declare const MAX_PRODUCT_COUNT = 9;
|
|
20
|
+
/** Minimum number of products that can be displayed */
|
|
21
|
+
export declare const MIN_PRODUCT_COUNT = 1;
|
|
22
|
+
/** Maximum number of products per row in grid layout */
|
|
23
|
+
export declare const MAX_PRODUCTS_PER_ROW = 4;
|
|
24
|
+
/** Minimum number of products per row in grid layout */
|
|
25
|
+
export declare const MIN_PRODUCTS_PER_ROW = 1;
|
|
26
|
+
/** Default column spacing between product cards (5px on each side = 10px total) */
|
|
27
|
+
export declare const DEFAULT_COLUMN_SPACING = 10;
|
|
28
|
+
/** Default row spacing between product rows */
|
|
29
|
+
export declare const DEFAULT_ROW_SPACING = 20;
|
|
30
|
+
/** Minimum spacing value */
|
|
31
|
+
export declare const MIN_SPACING = 0;
|
|
32
|
+
/** Maximum spacing value */
|
|
33
|
+
export declare const MAX_SPACING = 50;
|
|
34
|
+
/** Spacing adjustment step */
|
|
35
|
+
export declare const SPACING_STEP = 5;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CSS selectors and data attributes used across the Recommendation extension
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Container selector for the product container element
|
|
6
|
+
* Used across controls to target elements within the recommendation block
|
|
7
|
+
*/
|
|
8
|
+
export declare const CONTAINER_SELECTOR = ".ins-recommendation-product-container";
|
|
9
|
+
/**
|
|
10
|
+
* Currency HTML attributes set on the block element
|
|
11
|
+
* These are read by the HTML compiler at runtime to format prices
|
|
12
|
+
*/
|
|
13
|
+
export declare const CURRENCY_ATTR: {
|
|
14
|
+
readonly CURRENCY: "currency";
|
|
15
|
+
readonly SYMBOL: "currency-symbol";
|
|
16
|
+
readonly ALIGNMENT: "currency-alignment";
|
|
17
|
+
readonly THOUSAND_SEPARATOR: "currency-thousand-separator";
|
|
18
|
+
readonly DECIMAL_SEPARATOR: "currency-decimal-separator";
|
|
19
|
+
readonly DECIMAL_COUNT: "currency-decimal-count";
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Attribute type constants used in templates
|
|
23
|
+
* These are used as keys in ElementRenderer and composition arrays
|
|
24
|
+
*/
|
|
25
|
+
export declare const ATTR_PRODUCT_IMAGE = "productImage";
|
|
26
|
+
export declare const ATTR_PRODUCT_NAME = "productName";
|
|
27
|
+
export declare const ATTR_PRODUCT_PRICE = "productPrice";
|
|
28
|
+
export declare const ATTR_PRODUCT_OLD_PRICE = "productOldPrice";
|
|
29
|
+
export declare const ATTR_PRODUCT_OMNIBUS_PRICE = "productOmnibusPrice";
|
|
30
|
+
export declare const ATTR_PRODUCT_OMNIBUS_DISCOUNT = "productOmnibusDiscount";
|
|
31
|
+
export declare const ATTR_PRODUCT_BUTTON = "productButton";
|