@useinsider/guido 3.2.0-beta.ec6228c → 3.2.0-beta.ecc7c6c

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/README.md +1 -24
  2. package/dist/@types/config/schemas.js +36 -38
  3. package/dist/components/Guido.vue.js +4 -4
  4. package/dist/components/Guido.vue2.js +34 -35
  5. package/dist/components/organisms/header/RightSlot.vue.js +8 -8
  6. package/dist/components/organisms/header/RightSlot.vue2.js +8 -9
  7. package/dist/components/organisms/onboarding/AMPOnboarding.vue2.js +51 -31
  8. package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +1 -1
  9. package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +23 -22
  10. package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +1 -1
  11. package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +37 -39
  12. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +3 -3
  13. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +30 -41
  14. package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +15 -14
  15. package/dist/composables/useHtmlValidator.js +41 -36
  16. package/dist/composables/useRibbonOffset.js +21 -0
  17. package/dist/composables/useSave.js +21 -18
  18. package/dist/composables/useStripo.js +14 -16
  19. package/dist/composables/validators/useCouponBlockValidator.js +24 -0
  20. package/dist/config/compiler/recommendationCompilerRules.js +27 -27
  21. package/dist/config/compiler/unsubscribeCompilerRules.js +40 -37
  22. package/dist/config/migrator/radioButtonMigrator.js +64 -44
  23. package/dist/enums/onboarding.js +7 -2
  24. package/dist/enums/unsubscribe.js +34 -27
  25. package/dist/extensions/Blocks/RadioButton/template.js +1 -1
  26. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +18 -9
  27. package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +33 -0
  28. package/dist/guido.css +1 -1
  29. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +258 -235
  30. package/dist/package.json.js +1 -1
  31. package/dist/services/templateLibraryApi.js +5 -4
  32. package/dist/src/@types/config/schemas.d.ts +0 -4
  33. package/dist/src/composables/useConfig.d.ts +0 -2
  34. package/dist/src/composables/useRibbonOffset.d.ts +4 -0
  35. package/dist/src/composables/validators/useCouponBlockValidator.d.ts +3 -0
  36. package/dist/src/enums/onboarding.d.ts +6 -0
  37. package/dist/src/enums/unsubscribe.d.ts +5 -0
  38. package/dist/src/extensions/Blocks/RadioButton/template.d.ts +1 -1
  39. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +7 -1
  40. package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +21 -0
  41. package/dist/src/stores/config.d.ts +0 -18
  42. package/dist/src/stores/onboarding.d.ts +4 -0
  43. package/dist/stores/onboarding.js +4 -0
  44. package/dist/utils/pairProductVariables.js +89 -88
  45. package/package.json +3 -3
  46. package/dist/components/organisms/AutoSaveController.vue.js +0 -17
  47. package/dist/components/organisms/AutoSaveController.vue2.js +0 -13
  48. package/dist/components/organisms/header/AutoSaveToggle.vue.js +0 -22
  49. package/dist/components/organisms/header/AutoSaveToggle.vue2.js +0 -19
  50. package/dist/composables/useAutoSave.js +0 -68
  51. package/dist/enums/displayConditions.js +0 -80
  52. package/dist/src/components/organisms/AutoSaveController.vue.d.ts +0 -2
  53. package/dist/src/components/organisms/header/AutoSaveToggle.vue.d.ts +0 -2
  54. package/dist/src/composables/useAutoSave.d.ts +0 -3
  55. package/dist/src/enums/displayConditions.d.ts +0 -2
  56. package/dist/src/stores/autosave.d.ts +0 -6
  57. package/dist/src/utils/timeUtil.d.ts +0 -8
  58. package/dist/stores/autosave.js +0 -11
  59. package/dist/utils/timeUtil.js +0 -19
@@ -1,4 +1,4 @@
1
- const o = { stripo: { version: "2.60.0" } }, s = {
1
+ const o = { stripo: { version: "2.62.0" } }, s = {
2
2
  guido: o
3
3
  };
4
4
  export {
@@ -1,7 +1,7 @@
1
1
  import { useConfig as w } from "../composables/useConfig.js";
2
2
  import { useHttp as b } from "../composables/useHttp.js";
3
- import { useToaster as h } from "../composables/useToaster.js";
4
- import { useTranslations as C } from "../composables/useTranslations.js";
3
+ import { useToaster as C } from "../composables/useToaster.js";
4
+ import { useTranslations as h } from "../composables/useTranslations.js";
5
5
  import { useLiquidValidator as S } from "../composables/validators/useLiquidValidator.js";
6
6
  import { EditorType as v } from "../enums/defaults.js";
7
7
  import { useRecommendationExtensionStore as N } from "../extensions/Blocks/Recommendation/store/recommendation.js";
@@ -9,7 +9,7 @@ import { useSaveAsTemplateStore as x } from "../stores/save-as-template.js";
9
9
  import { base64EncodeWithSpecialChars as r } from "../utils/base64.js";
10
10
  import { useTemplatePreparation as A } from "../utils/templatePreparation.js";
11
11
  const $ = () => {
12
- const { get: n, post: m } = b(), { handleError: o, showToaster: l } = h(), { config: c, isFeatureEnabled: p } = w(), { validateLiquidSyntax: g } = S(), u = C();
12
+ const { get: n, post: m } = b(), { handleError: o, showToaster: l } = C(), { config: c, isFeatureEnabled: p } = w(), { validateLiquidSyntax: g } = S(), u = h();
13
13
  return {
14
14
  getCategories: async () => {
15
15
  try {
@@ -62,7 +62,8 @@ const $ = () => {
62
62
  stripoConfig: r({
63
63
  editor: "stripo",
64
64
  html: a.rawHtml,
65
- css: a.css
65
+ css: a.css,
66
+ dynamicContentList: a.dynamicContentList
66
67
  })
67
68
  }, { data: { type: T } } = await m(
68
69
  "/newsletter/template-library/create-template",
@@ -178,8 +178,6 @@ export declare const FeaturesSchema: v.ObjectSchema<{
178
178
  readonly modulesDisabled: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
179
179
  /** Enable Liquid template syntax */
180
180
  readonly liquidSyntax: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
181
- /** Enable autosave (2-min interval + tab-hide). User toggles on/off from the header. */
182
- readonly autosave: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
183
181
  }, undefined>;
184
182
  /**
185
183
  * Default block types available in Stripo
@@ -503,8 +501,6 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
503
501
  readonly modulesDisabled: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
504
502
  /** Enable Liquid template syntax */
505
503
  readonly liquidSyntax: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
506
- /** Enable autosave (2-min interval + tab-hide). User toggles on/off from the header. */
507
- readonly autosave: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
508
504
  }, undefined>, {}>;
509
505
  /** Block configuration */
510
506
  readonly blocks: v.OptionalSchema<v.ObjectSchema<{
@@ -62,7 +62,6 @@ export declare const useConfig: () => {
62
62
  unsubscribe: boolean;
63
63
  modulesDisabled: boolean;
64
64
  liquidSyntax: boolean;
65
- autosave: boolean;
66
65
  };
67
66
  blocks: {
68
67
  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")[];
@@ -160,7 +159,6 @@ export declare const useConfig: () => {
160
159
  unsubscribe: boolean;
161
160
  modulesDisabled: boolean;
162
161
  liquidSyntax: boolean;
163
- autosave: boolean;
164
162
  } | null>;
165
163
  blocks: import("vue").ComputedRef<{
166
164
  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")[];
@@ -0,0 +1,4 @@
1
+ export declare const useRibbonOffset: () => {
2
+ ribbonOffset: import("vue").Ref<number>;
3
+ getTopPosition: (baseTop: number) => string;
4
+ };
@@ -0,0 +1,3 @@
1
+ export declare const useCouponBlockValidator: () => {
2
+ validateCouponBlockTags: (html: string) => boolean;
3
+ };
@@ -3,3 +3,9 @@ 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 DYNAMIC_CONTENT_BUTTON_SELECTOR = "#guido__btn-add-dynamic-content";
7
+ export declare const AMP_TOGGLE_BUTTON_SELECTOR = ".guido__amp-toggle-html";
8
+ export declare const AMP_TOGGLE_WRAPPER_SELECTOR = ".in-segments-wrapper";
9
+ export declare const HEADER_SELECTOR = "[data-testid=\"guido-header\"]";
10
+ export declare const POPOVER_LEFT_OFFSET = 158;
11
+ export declare const POPOVER_TOP_GAP = 10;
@@ -12,6 +12,11 @@ export declare const URLS: {
12
12
  UNSUBSCRIBE_URL: string;
13
13
  PREFERENCES_URL: string;
14
14
  };
15
+ export declare const PRODUCT_TYPE_URL_SEGMENTS: {
16
+ readonly 60: "email";
17
+ readonly 49: "journey";
18
+ readonly 97: "email";
19
+ };
15
20
  export declare const INSIDER_ID = "iid";
16
21
  export declare const DEFAULT_UNSUBSCRIBE_GROUP: {
17
22
  readonly name: "Global Unsubscribe";
@@ -1,4 +1,4 @@
1
- declare const migrationTemplate = "\n <td\n align=\"left\"\n esd-extension-block-id=\"radio-button-block\"\n esd-handler-name=\"esd-extension-RadioButtonBlock\"\n class=\"\n radio-button\n radio-button-v2\n esd-block-ra\n esd-radio-button-block\n esd-extension-block\n es-p10t\n es-p10b\n es-p30r\n es-p30l\"\n >\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n <td align=\"left\" width=\"70%\" style=\"vertical-align: top;\">\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n {-{-TITLE-}-}\n </tr>\n <tr>\n {-{-DESCRIPTION-}-}\n </tr>\n </tbody>\n </table>\n </td>\n <td align=\"right\" width=\"30%\" style=\"vertical-align: middle;\">\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n <td width=\"50%\">\n <table width=\"100%\">\n <tr>\n <td width=\"24\">\n <input\n type=\"radio\"\n id=\"radioYes\"\n name=\"unsubscribe\"\n data-cke-editable=\"1\"\n style=\"margin: 0px; vertical-align: middle;>\n </td>\n {-{-YES-}-}\n </tr>\n </table>\n </td>\n <td width=\"50%\">\n <table width=\"100%\">\n <tr>\n <td width=\"24\">\n <input\n type=\"radio\"\n id=\"radioNo\"\n name=\"unsubscribe\"\n data-cke-editable=\"1\"\n style=\"margin: 0px; vertical-align: middle;\">\n </td>\n {-{-NO-}-}\n </tr>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n";
1
+ declare const migrationTemplate = "\n <td\n align=\"left\"\n esd-extension-block-id=\"radio-button-block\"\n esd-handler-name=\"esd-extension-RadioButtonBlock\"\n class=\"\n radio-button\n radio-button-v2\n esd-block-ra\n esd-radio-button-block\n esd-extension-block\n es-p10t\n es-p10b\n es-p30r\n es-p30l\"\n >\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n <td align=\"left\" width=\"70%\" style=\"vertical-align: top;\">\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n {-{-TITLE-}-}\n </tr>\n <tr>\n {-{-DESCRIPTION-}-}\n </tr>\n </tbody>\n </table>\n </td>\n <td align=\"right\" width=\"30%\" style=\"vertical-align: middle;\">\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n <td width=\"50%\">\n <table width=\"100%\">\n <tr>\n <td width=\"24\">\n <input\n type=\"radio\"\n id=\"radioYes\"\n name=\"unsubscribe\"\n data-cke-editable=\"1\"\n style=\"margin: 0px; vertical-align: middle;\">\n </td>\n {-{-YES-}-}\n </tr>\n </table>\n </td>\n <td width=\"50%\">\n <table width=\"100%\">\n <tr>\n <td width=\"24\">\n <input\n type=\"radio\"\n id=\"radioNo\"\n name=\"unsubscribe\"\n data-cke-editable=\"1\"\n style=\"margin: 0px; vertical-align: middle;\">\n </td>\n {-{-NO-}-}\n </tr>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n";
2
2
  /**
3
3
  * @returns The template for the default checkbox block
4
4
  */
@@ -1,5 +1,5 @@
1
1
  import type { Orientation, Languages, Currency, NumericSeparator, FiltersResponse, Filter, RecommendationProduct } from '@@/Types/recommendation';
2
- interface PerBlockConfigs {
2
+ export interface PerBlockConfigs {
3
3
  cardsInRow: number;
4
4
  currencySettings: {
5
5
  name: string;
@@ -238,6 +238,12 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
238
238
  deleteFilter(filter: Filter): void;
239
239
  addFilter(filter: Filter): void;
240
240
  generateFilterQuery(): string;
241
+ /**
242
+ * Validation-only check invoked at save-CTA time. Defined as an action
243
+ * (not a getter) so reading it does not register reactive tracking on
244
+ * every block's recommendationConfigs across user edits.
245
+ */
246
+ hasInvalidBlock(): boolean;
241
247
  fetchRecommendationProducts(): Promise<void>;
242
248
  _doFetchProducts(): Promise<void>;
243
249
  }>;
@@ -0,0 +1,21 @@
1
+ import type { PerBlockConfigs } from '../store/recommendation';
2
+ import type { Currency, Languages } from '@@/Types/recommendation';
3
+ /**
4
+ * Structural slice of the recommendation extension store that descriptors may read.
5
+ * Add new fields here when a future descriptor needs them.
6
+ */
7
+ export interface ExtensionStoreSlice {
8
+ languages: Languages;
9
+ currencyList: Currency[];
10
+ }
11
+ interface RequiredField {
12
+ key: string;
13
+ getValue: (config: PerBlockConfigs) => string;
14
+ getAvailableOptions?: (store: ExtensionStoreSlice) => string[];
15
+ condition?: (config: PerBlockConfigs) => boolean;
16
+ }
17
+ export declare const REQUIRED_RECOMMENDATION_FIELDS: RequiredField[];
18
+ export declare const RecommendationRequiredFieldsKey = "newsletter.recommendation-fill-required-fields";
19
+ export declare function getInvalidFields(config: PerBlockConfigs, store: ExtensionStoreSlice): string[];
20
+ export declare function isConfigValid(config: PerBlockConfigs, store: ExtensionStoreSlice): boolean;
21
+ export {};
@@ -67,7 +67,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
67
67
  unsubscribe: boolean;
68
68
  modulesDisabled: boolean;
69
69
  liquidSyntax: boolean;
70
- autosave: boolean;
71
70
  };
72
71
  blocks: {
73
72
  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")[];
@@ -171,7 +170,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
171
170
  unsubscribe: boolean;
172
171
  modulesDisabled: boolean;
173
172
  liquidSyntax: boolean;
174
- autosave: boolean;
175
173
  };
176
174
  blocks: {
177
175
  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")[];
@@ -275,7 +273,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
275
273
  unsubscribe: boolean;
276
274
  modulesDisabled: boolean;
277
275
  liquidSyntax: boolean;
278
- autosave: boolean;
279
276
  };
280
277
  blocks: {
281
278
  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")[];
@@ -379,7 +376,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
379
376
  unsubscribe: boolean;
380
377
  modulesDisabled: boolean;
381
378
  liquidSyntax: boolean;
382
- autosave: boolean;
383
379
  };
384
380
  blocks: {
385
381
  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")[];
@@ -483,7 +479,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
483
479
  unsubscribe: boolean;
484
480
  modulesDisabled: boolean;
485
481
  liquidSyntax: boolean;
486
- autosave: boolean;
487
482
  };
488
483
  blocks: {
489
484
  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")[];
@@ -587,7 +582,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
587
582
  unsubscribe: boolean;
588
583
  modulesDisabled: boolean;
589
584
  liquidSyntax: boolean;
590
- autosave: boolean;
591
585
  };
592
586
  blocks: {
593
587
  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")[];
@@ -691,7 +685,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
691
685
  unsubscribe: boolean;
692
686
  modulesDisabled: boolean;
693
687
  liquidSyntax: boolean;
694
- autosave: boolean;
695
688
  };
696
689
  blocks: {
697
690
  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")[];
@@ -795,7 +788,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
795
788
  unsubscribe: boolean;
796
789
  modulesDisabled: boolean;
797
790
  liquidSyntax: boolean;
798
- autosave: boolean;
799
791
  };
800
792
  blocks: {
801
793
  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")[];
@@ -899,7 +891,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
899
891
  unsubscribe: boolean;
900
892
  modulesDisabled: boolean;
901
893
  liquidSyntax: boolean;
902
- autosave: boolean;
903
894
  };
904
895
  blocks: {
905
896
  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")[];
@@ -1003,7 +994,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1003
994
  unsubscribe: boolean;
1004
995
  modulesDisabled: boolean;
1005
996
  liquidSyntax: boolean;
1006
- autosave: boolean;
1007
997
  };
1008
998
  blocks: {
1009
999
  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")[];
@@ -1107,7 +1097,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1107
1097
  unsubscribe: boolean;
1108
1098
  modulesDisabled: boolean;
1109
1099
  liquidSyntax: boolean;
1110
- autosave: boolean;
1111
1100
  };
1112
1101
  blocks: {
1113
1102
  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")[];
@@ -1211,7 +1200,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1211
1200
  unsubscribe: boolean;
1212
1201
  modulesDisabled: boolean;
1213
1202
  liquidSyntax: boolean;
1214
- autosave: boolean;
1215
1203
  };
1216
1204
  blocks: {
1217
1205
  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")[];
@@ -1315,7 +1303,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1315
1303
  unsubscribe: boolean;
1316
1304
  modulesDisabled: boolean;
1317
1305
  liquidSyntax: boolean;
1318
- autosave: boolean;
1319
1306
  };
1320
1307
  blocks: {
1321
1308
  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")[];
@@ -1419,7 +1406,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1419
1406
  unsubscribe: boolean;
1420
1407
  modulesDisabled: boolean;
1421
1408
  liquidSyntax: boolean;
1422
- autosave: boolean;
1423
1409
  };
1424
1410
  blocks: {
1425
1411
  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")[];
@@ -1523,7 +1509,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1523
1509
  unsubscribe: boolean;
1524
1510
  modulesDisabled: boolean;
1525
1511
  liquidSyntax: boolean;
1526
- autosave: boolean;
1527
1512
  };
1528
1513
  blocks: {
1529
1514
  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")[];
@@ -1627,7 +1612,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1627
1612
  unsubscribe: boolean;
1628
1613
  modulesDisabled: boolean;
1629
1614
  liquidSyntax: boolean;
1630
- autosave: boolean;
1631
1615
  };
1632
1616
  blocks: {
1633
1617
  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")[];
@@ -1731,7 +1715,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1731
1715
  unsubscribe: boolean;
1732
1716
  modulesDisabled: boolean;
1733
1717
  liquidSyntax: boolean;
1734
- autosave: boolean;
1735
1718
  };
1736
1719
  blocks: {
1737
1720
  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")[];
@@ -1835,7 +1818,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1835
1818
  unsubscribe: boolean;
1836
1819
  modulesDisabled: boolean;
1837
1820
  liquidSyntax: boolean;
1838
- autosave: boolean;
1839
1821
  };
1840
1822
  blocks: {
1841
1823
  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")[];
@@ -1392,6 +1392,10 @@ export declare const useOnboardingStore: import("pinia").StoreDefinition<"guidoO
1392
1392
  close(type: OnboardingType): Promise<void>;
1393
1393
  next(type: OnboardingType): void;
1394
1394
  previous(type: OnboardingType): void;
1395
+ updateCardPosition(type: OnboardingType, cardIndex: number, position: {
1396
+ top: string;
1397
+ position: string;
1398
+ }): void;
1395
1399
  setConfig(type: OnboardingType, config: OnboardingCardConfig[]): void;
1396
1400
  onDiscoverNowClicked(): Promise<void>;
1397
1401
  onRemindMeLater(): void;
@@ -71,6 +71,10 @@ const t = () => ({
71
71
  previous(n) {
72
72
  this.onboardings[n].cardIndex > 0 && this.onboardings[n].cardIndex--;
73
73
  },
74
+ updateCardPosition(n, i, o) {
75
+ const s = this.onboardings[n].config[i];
76
+ s && (s.top = o.top, s.position = o.position);
77
+ },
74
78
  setConfig(n, i) {
75
79
  this.onboardings[n].config = i ?? [], this.onboardings[n].cardIndex >= this.onboardings[n].config.length && (this.onboardings[n].cardIndex = 0);
76
80
  },
@@ -1,84 +1,85 @@
1
- import { productPairs as P } from "../extensions/Blocks/Items/enums/productEnums.js";
2
- function L(F) {
3
- const R = F.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->"), $ = new DOMParser().parseFromString(R, "text/html"), y = P.PAIRS_FOR_EXTENSION;
4
- Object.entries(y).forEach(([n, l]) => {
5
- $.querySelectorAll(".ins-product-td").forEach((c) => {
6
- const E = c.getAttribute("data-number") || "1", T = c.getAttribute("data-type") || "CART_ITEMS";
7
- c.querySelectorAll(`[product-attr="${n}"]`).forEach((e) => {
8
- var H;
9
- const b = e.getAttribute("data-type") || T, u = e.getAttribute("data-number") || E, p = l[b];
10
- if (p)
11
- switch (n) {
1
+ import { productPairs as L } from "../extensions/Blocks/Items/enums/productEnums.js";
2
+ function q(w) {
3
+ const y = w.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->"), T = new DOMParser().parseFromString(y, "text/html"), C = L.PAIRS_FOR_EXTENSION;
4
+ Object.entries(C).forEach(([r, f]) => {
5
+ T.querySelectorAll(".ins-product-td").forEach((o) => {
6
+ const A = o.getAttribute("data-number") || "1", b = o.getAttribute("data-type") || "CART_ITEMS";
7
+ o.querySelectorAll(`[product-attr="${r}"]`).forEach((e) => {
8
+ var k, F, I;
9
+ const $ = e.getAttribute("data-type") || b, d = e.getAttribute("data-number") || A, u = f[$];
10
+ if (u)
11
+ switch (r) {
12
12
  case "imageSrc": {
13
- let t = null, o = null;
14
- if (e.tagName === "IMG" ? (t = e, o = t.closest("a")) : (t = e.querySelector("img"), o = e.querySelector("a") || e.closest("a")), !t)
13
+ let t = null, i = null;
14
+ if (e.tagName === "IMG" ? (t = e, i = t.closest("a")) : (t = e.querySelector("img"), i = e.querySelector("a") || e.closest("a")), !t)
15
15
  break;
16
- const i = p.DEFAULT, a = p.ATTR;
17
- if (i && t.src) {
18
- const r = t.src;
19
- i.some((f) => {
20
- const s = f.split("/").pop() || "", _ = r.split("/").pop() || "";
21
- return r.includes(f) || r.includes(s) || _ === s;
22
- }) && (t.src = `{{${a}_${u}}}`);
16
+ const a = u.DEFAULT, s = u.ATTR;
17
+ if (a && t.src) {
18
+ const c = t.src;
19
+ a.some((h) => {
20
+ const l = h.split("/").pop() || "", g = c.split("/").pop() || "";
21
+ return c.includes(h) || c.includes(l) || g === l;
22
+ }) && (t.src = `{{${s}_${d}}}`);
23
23
  }
24
- if (o) {
25
- const r = (H = y.itemLink) == null ? void 0 : H[b];
26
- if (r) {
27
- const d = r.HREF, f = r.DEFAULT_HREF || "#!", s = o.href;
28
- (s === "#" || s === "" || s.endsWith("#!") || s.endsWith(f) || s === `${window.location.href}${f}` || !s || s === window.location.href) && (o.href = `{{${d}_${u}}}`);
24
+ const n = (F = (k = C.name) == null ? void 0 : k[$]) == null ? void 0 : F.ATTR;
25
+ if (n && t.setAttribute("alt", `{{${n}_${d}}}`), i) {
26
+ const c = (I = C.itemLink) == null ? void 0 : I[$];
27
+ if (c) {
28
+ const E = c.HREF, h = c.DEFAULT_HREF || "#!", l = i.href;
29
+ (l === "#" || l === "" || l.endsWith("#!") || l.endsWith(h) || l === `${window.location.href}${h}` || !l || l === window.location.href) && (i.href = `{{${E}_${d}}}`);
29
30
  }
30
31
  }
31
32
  break;
32
33
  }
33
34
  case "name": {
34
- const t = p, o = t.ATTR, i = t.DEFAULT_HREF || "#!", a = t.HREF;
35
- e.textContent && (e.textContent = `{{${o}_${u}}}`);
36
- const r = e.closest("a") || (e.tagName === "A" ? e : null);
37
- if (r && a) {
38
- const d = r.href, f = `${window.location.href}${i}`;
39
- (d === f || d.endsWith(i)) && (r.href = `{{${a}_${u}}}`);
35
+ const t = u, i = t.ATTR, a = t.DEFAULT_HREF || "#!", s = t.HREF;
36
+ e.textContent && (e.textContent = `{{${i}_${d}}}`);
37
+ const n = e.closest("a") || (e.tagName === "A" ? e : null);
38
+ if (n && s) {
39
+ const c = n.href, E = `${window.location.href}${a}`;
40
+ (c === E || c.endsWith(a)) && (n.href = `{{${s}_${d}}}`);
40
41
  }
41
42
  break;
42
43
  }
43
44
  case "price":
44
45
  case "originalPrice": {
45
- const t = p, o = e.getAttribute("data-formated"), i = e.getAttribute("data-single_price"), a = o === "true", r = i === "true", d = e.getAttribute("data-curency") || "before";
46
- let f;
47
- r ? f = a ? t.SINGLE_PRICE_FORMATTED : t.SINGLE_PRICE : f = a ? t.PRICE_FORMATTED : t.PRICE;
48
- const s = t.CURRENCY;
49
- let _ = `{{${f}_${u}}}`;
50
- if (s) {
51
- const k = `{{${s}_${u}}}`;
52
- _ = d === "after" ? `${_} ${k}` : `${k} ${_}`;
46
+ const t = u, i = e.getAttribute("data-formated"), a = e.getAttribute("data-single_price"), s = i === "true", n = a === "true", c = e.getAttribute("data-curency") || "before";
47
+ let E;
48
+ n ? E = s ? t.SINGLE_PRICE_FORMATTED : t.SINGLE_PRICE : E = s ? t.PRICE_FORMATTED : t.PRICE;
49
+ const h = t.CURRENCY;
50
+ let l = `{{${E}_${d}}}`;
51
+ if (h) {
52
+ const g = `{{${h}_${d}}}`;
53
+ l = c === "after" ? `${l} ${g}` : `${g} ${l}`;
53
54
  }
54
- e.textContent = _;
55
+ e.textContent = l;
55
56
  break;
56
57
  }
57
58
  case "quantity": {
58
- const t = p, o = t.ATTR, i = t.DEFAULT;
59
- e.textContent && e.textContent.trim() === i && (e.textContent = `{{${o}_${u}}}`);
59
+ const t = u, i = t.ATTR, a = t.DEFAULT;
60
+ e.textContent && e.textContent.trim() === a && (e.textContent = `{{${i}_${d}}}`);
60
61
  break;
61
62
  }
62
63
  case "button": {
63
- const t = p, o = t.HREF, i = t.DEFAULT_HREF || "#!", a = e.tagName === "A" ? e : e.querySelector("a");
64
- if (a) {
65
- const r = a.href || "", d = `${window.location.href}${i}`;
66
- (r === "" || r === "#" || r === d || r.endsWith(i) || r.endsWith("#!") || r === window.location.href) && (a.href = `{{${o}_${u}}}`);
64
+ const t = u, i = t.HREF, a = t.DEFAULT_HREF || "#!", s = e.tagName === "A" ? e : e.querySelector("a");
65
+ if (s) {
66
+ const n = s.href || "", c = `${window.location.href}${a}`;
67
+ (n === "" || n === "#" || n === c || n.endsWith(a) || n.endsWith("#!") || n === window.location.href) && (s.href = `{{${i}_${d}}}`);
67
68
  }
68
69
  break;
69
70
  }
70
71
  case "itemLink": {
71
- const t = p, o = t.HREF, i = t.DEFAULT_HREF || "#!", a = e;
72
- if (a.href) {
73
- const r = a.href, d = `${window.location.href}${i}`;
74
- (r === d || r.endsWith(i)) && (a.href = `{{${o}_${u}}}`);
72
+ const t = u, i = t.HREF, a = t.DEFAULT_HREF || "#!", s = e;
73
+ if (s.href) {
74
+ const n = s.href, c = `${window.location.href}${a}`;
75
+ (n === c || n.endsWith(a)) && (s.href = `{{${i}_${d}}}`);
75
76
  }
76
77
  break;
77
78
  }
78
79
  default: {
79
- if ("ATTR" in p) {
80
- const t = p.ATTR;
81
- e.textContent && (e.textContent = `{{${t}_${u}}}`);
80
+ if ("ATTR" in u) {
81
+ const t = u.ATTR;
82
+ e.textContent && (e.textContent = `{{${t}_${d}}}`);
82
83
  }
83
84
  break;
84
85
  }
@@ -86,55 +87,55 @@ function L(F) {
86
87
  });
87
88
  });
88
89
  });
89
- const S = R.match(/<!DOCTYPE[^>]*>/i), I = S ? `${S[0]}
90
- ` : "", w = $.querySelectorAll(".ins-product-td"), m = [];
91
- w.forEach((n) => {
92
- const l = n.getAttribute("data-type") || "CART_ITEMS", A = n.getAttribute("data-number") || "1", c = n.getAttribute("data-nodup"), E = n.outerHTML;
93
- m.push({
94
- element: n,
95
- outerHtml: E,
96
- type: l,
97
- number: A,
98
- nodup: c || void 0
90
+ const S = y.match(/<!DOCTYPE[^>]*>/i), M = S ? `${S[0]}
91
+ ` : "", P = T.querySelectorAll(".ins-product-td"), H = [];
92
+ P.forEach((r) => {
93
+ const f = r.getAttribute("data-type") || "CART_ITEMS", p = r.getAttribute("data-number") || "1", o = r.getAttribute("data-nodup"), A = r.outerHTML;
94
+ H.push({
95
+ element: r,
96
+ outerHtml: A,
97
+ type: f,
98
+ number: p,
99
+ nodup: o || void 0
99
100
  });
100
101
  });
101
- let h = I + $.documentElement.outerHTML;
102
- m.reverse().forEach(({ outerHtml: n, type: l, number: A }) => {
103
- let c = "";
104
- switch (l) {
102
+ let _ = M + T.documentElement.outerHTML;
103
+ H.reverse().forEach(({ outerHtml: r, type: f, number: p }) => {
104
+ let o = "";
105
+ switch (f) {
105
106
  case "CART_ITEMS":
106
- c = "ins_apr_total_product_kind";
107
+ o = "ins_apr_total_product_kind";
107
108
  break;
108
109
  case "BROWSED_ITEMS":
109
- c = "browsed_item_total_product_kind";
110
+ o = "browsed_item_total_product_kind";
110
111
  break;
111
112
  case "PURCHASED_ITEMS":
112
- c = "purchased_item_total_product_kind";
113
+ o = "purchased_item_total_product_kind";
113
114
  break;
114
115
  }
115
- if (c) {
116
- const T = parseInt(A) - 1, b = `${`{% if ${c} > ${T} %}`}${n}{% endif %}`;
117
- h = h.replace(n, b);
116
+ if (o) {
117
+ const b = parseInt(p) - 1, $ = `${`{% if ${o} > ${b} %}`}${r}{% endif %}`;
118
+ _ = _.replace(r, $);
118
119
  }
119
120
  });
120
- const M = $.querySelectorAll('[product-attr="originalPrice"][data-type="CART_ITEMS"]'), g = [];
121
- return M.forEach((n) => {
122
- const l = n.getAttribute("data-number"), A = n.getAttribute("data-type");
123
- if (!l || A !== "CART_ITEMS")
121
+ const D = T.querySelectorAll('[product-attr="originalPrice"][data-type="CART_ITEMS"]'), R = [];
122
+ return D.forEach((r) => {
123
+ const f = r.getAttribute("data-number"), p = r.getAttribute("data-type");
124
+ if (!f || p !== "CART_ITEMS")
124
125
  return;
125
- const c = n.closest(".product-original-price-class");
126
- if (c) {
127
- const E = c.outerHTML;
128
- g.some((C) => C.tdOuterHtml === E) || g.push({ tdOuterHtml: E, number: l });
126
+ const o = r.closest(".product-original-price-class");
127
+ if (o) {
128
+ const A = o.outerHTML;
129
+ R.some((m) => m.tdOuterHtml === A) || R.push({ tdOuterHtml: A, number: f });
129
130
  }
130
- }), g.reverse().forEach(({ tdOuterHtml: n, number: l }) => {
131
- const A = `{% if ins_apr_price_${l} != ins_apr_originalprice_${l} %}`;
132
- if (!h.includes(A) && !n.includes("{% if")) {
133
- const E = `${A}${n}{% endif %}`;
134
- h = h.replace(n, E);
131
+ }), R.reverse().forEach(({ tdOuterHtml: r, number: f }) => {
132
+ const p = `{% if ins_apr_price_${f} != ins_apr_originalprice_${f} %}`;
133
+ if (!_.includes(p) && !r.includes("{% if")) {
134
+ const A = `${p}${r}{% endif %}`;
135
+ _ = _.replace(r, A);
135
136
  }
136
- }), h.replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("&lt;!--{%", "{%").replaceAll("%}--&gt;", "%}");
137
+ }), _.replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("&lt;!--{%", "{%").replaceAll("%}--&gt;", "%}");
137
138
  }
138
139
  export {
139
- L as pairProductVariables
140
+ q as pairProductVariables
140
141
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.2.0-beta.ec6228c",
3
+ "version": "3.2.0-beta.ecc7c6c",
4
4
  "description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
5
5
  "main": "./dist/guido.umd.cjs",
6
6
  "module": "./dist/library.js",
@@ -32,7 +32,7 @@
32
32
  "author": "",
33
33
  "license": "ISC",
34
34
  "dependencies": {
35
- "@stripoinc/ui-editor-extensions": "3.7.0",
35
+ "@stripoinc/ui-editor-extensions": "3.8.0",
36
36
  "@useinsider/design-system-vue": "1.1.0-beta.73ec2fa",
37
37
  "@vueuse/core": "11.3.0",
38
38
  "lodash-es": "4.17.21",
@@ -86,7 +86,7 @@
86
86
  },
87
87
  "guido": {
88
88
  "stripo": {
89
- "version": "2.60.0"
89
+ "version": "2.62.0"
90
90
  }
91
91
  }
92
92
  }
@@ -1,17 +0,0 @@
1
- import n from "./AutoSaveController.vue2.js";
2
- import t from "../../_virtual/_plugin-vue2_normalizer.js";
3
- var o = function() {
4
- var r = this, e = r._self._c;
5
- return r._self._setupProxy, e("div", { staticClass: "d-n" });
6
- }, s = [], _ = /* @__PURE__ */ t(
7
- n,
8
- o,
9
- s,
10
- !1,
11
- null,
12
- null
13
- );
14
- const f = _.exports;
15
- export {
16
- f as default
17
- };