@useinsider/guido 1.0.2-beta.14a3cf5 → 1.0.2-beta.198f9ce

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 (68) hide show
  1. package/README.md +1 -31
  2. package/dist/@types/generic.d.ts +0 -4
  3. package/dist/components/Guido.vue.d.ts +1 -3
  4. package/dist/components/Guido.vue.js +5 -5
  5. package/dist/components/Guido.vue2.js +62 -73
  6. package/dist/components/organisms/LoadingWrapper.vue.js +1 -1
  7. package/dist/components/organisms/email-preview/amp/AmpToggle.vue.js +2 -3
  8. package/dist/components/organisms/header/HeaderWrapper.vue.d.ts +1 -3
  9. package/dist/components/organisms/header/HeaderWrapper.vue.js +6 -6
  10. package/dist/components/organisms/header/HeaderWrapper.vue2.js +9 -15
  11. package/dist/components/organisms/header/RightSlot.vue.d.ts +1 -3
  12. package/dist/components/organisms/header/RightSlot.vue.js +3 -5
  13. package/dist/components/organisms/header/RightSlot.vue2.js +27 -26
  14. package/dist/components/organisms/header/ViewOptions.vue.js +5 -5
  15. package/dist/components/organisms/header/ViewOptions.vue2.js +5 -5
  16. package/dist/components/organisms/header/version-history/ViewOptions.vue.js +5 -5
  17. package/dist/components/organisms/header/version-history/ViewOptions.vue2.js +5 -5
  18. package/dist/components/organisms/onboarding/AMPOnboarding.vue2.js +11 -11
  19. package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +5 -5
  20. package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +8 -8
  21. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +1 -1
  22. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +28 -40
  23. package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +6 -6
  24. package/dist/composables/useCustomInterfaceAppearance.js +18 -22
  25. package/dist/composables/useHtmlCompiler.js +9 -17
  26. package/dist/composables/useStripo.js +25 -27
  27. package/dist/composables/useToaster.js +17 -17
  28. package/dist/config/compiler/outlookCompilerRules.d.ts +0 -2
  29. package/dist/enums/defaults.d.ts +1 -5
  30. package/dist/enums/defaults.js +10 -14
  31. package/dist/guido.css +1 -1
  32. package/dist/static/styles/components/alert-message.css.js +2 -32
  33. package/dist/static/styles/components/button.css.js +2 -32
  34. package/dist/static/styles/components/wide-panel.css.js +1 -5
  35. package/dist/static/styles/customEditorStyle.css.js +0 -6
  36. package/dist/static/styles/variables.css.js +0 -10
  37. package/dist/stores/dynamic-content.d.ts +0 -12
  38. package/dist/stores/dynamic-content.js +6 -7
  39. package/dist/stores/onboarding.d.ts +8 -72
  40. package/dist/utils/genericUtil.js +6 -9
  41. package/dist/utils/templatePreparation.js +14 -21
  42. package/package.json +1 -1
  43. package/dist/composables/useHtmlValidator.d.ts +0 -3
  44. package/dist/composables/useHtmlValidator.js +0 -120
  45. package/dist/composables/useRecommendation.d.ts +0 -19
  46. package/dist/composables/useRecommendation.js +0 -27
  47. package/dist/composables/useSave.d.ts +0 -4
  48. package/dist/composables/useSave.js +0 -15
  49. package/dist/config/compiler/outlookCompilerRules.js +0 -36
  50. package/dist/config/compiler/recommendationCompilerRules.d.ts +0 -2
  51. package/dist/config/compiler/recommendationCompilerRules.js +0 -83
  52. package/dist/config/compiler/socialCompilerRules.d.ts +0 -2
  53. package/dist/config/compiler/socialCompilerRules.js +0 -21
  54. package/dist/config/compiler/unsubscribeCompilerRules.d.ts +0 -2
  55. package/dist/config/compiler/unsubscribeCompilerRules.js +0 -64
  56. package/dist/enums/html-validator.d.ts +0 -6
  57. package/dist/enums/html-validator.js +0 -7
  58. package/dist/enums/recommendation.d.ts +0 -54
  59. package/dist/enums/recommendation.js +0 -56
  60. package/dist/enums/unsubscribe.d.ts +0 -15
  61. package/dist/enums/unsubscribe.js +0 -17
  62. package/dist/mock/api/validator.d.ts +0 -2
  63. package/dist/static/styles/components/notification.css.js +0 -55
  64. package/dist/static/styles/components/popup.css.js +0 -68
  65. package/dist/stores/recommendation.d.ts +0 -10
  66. package/dist/stores/recommendation.js +0 -9
  67. package/dist/stores/unsubscribe.d.ts +0 -8
  68. package/dist/stores/unsubscribe.js +0 -9
@@ -1,4 +1,4 @@
1
- const r = `.alert-message-wrapper {
1
+ const n = `.alert-message-wrapper {
2
2
  box-shadow: none;
3
3
  border: 1px solid var(--guido-color-gray-300);
4
4
  color: var(--guido-color-gray-600);
@@ -16,36 +16,6 @@ const r = `.alert-message-wrapper {
16
16
  color: var(--guido-color-border-onpage-message-info);
17
17
  }
18
18
 
19
- .alert-message-wrapper.warn {
20
- background: var(--guido-color-background-onpage-message-warn);
21
- border-color: var(--guido-color-border-onpage-message-warn);
22
- color: inherit;
23
- }
24
-
25
- .alert-message-wrapper.warn ue-icon-component.icon {
26
- color: var(--guido-color-border-onpage-message-warn);
27
- }
28
-
29
- .alert-message-wrapper.success {
30
- background: var(--guido-color-background-onpage-message-success);
31
- border-color: var(--guido-color-border-onpage-message-success);
32
- color: inherit;
33
- }
34
-
35
- .alert-message-wrapper.success ue-icon-component.icon {
36
- color: var(--guido-color-border-onpage-message-success);
37
- }
38
-
39
- .alert-message-wrapper.error {
40
- background: var(--guido-color-background-onpage-message-error);
41
- border-color: var(--guido-color-border-onpage-message-error);
42
- color: inherit;
43
- }
44
-
45
- .alert-message-wrapper.error ue-icon-component.icon {
46
- color: var(--guido-color-border-onpage-message-error);
47
- }
48
-
49
19
  .alert-message-wrapper ue-button {
50
20
  padding: 0;
51
21
  }
@@ -65,5 +35,5 @@ const r = `.alert-message-wrapper {
65
35
  }
66
36
  `;
67
37
  export {
68
- r as default
38
+ n as default
69
39
  };
@@ -60,28 +60,8 @@ const o = `.control-shadow-wrapper:has(.button) {
60
60
  color: var(--guido-color-primary-500);
61
61
  }
62
62
 
63
- .primary > .button {
64
- border: none;
65
- background-color: var(--guido-color-neutral-200);
66
- color: var(--guido-color-neutral-800);
67
- }
68
-
69
- .primary > .button .icon-button {
70
- color: var(--guido-color-neutral-800);
71
- }
72
-
73
- .primary > .button:hover:not(:disabled,.disabled) {
74
- background-color: var(--guido-color-neutral-100);
75
- }
76
-
77
- .danger > .button {
78
- background-color: var(--guido-color-danger-500);
79
- color: var(--guido-color-white);
80
- border: none;
81
- }
82
-
83
- .danger > .button:hover:not(:disabled,.disabled) {
84
- background-color: var(--guido-color-danger-300);
63
+ .flat-white > .button:hover:not(:disabled,.disabled) {
64
+ color: var(--guido-color-primary-500);
85
65
  }
86
66
 
87
67
  ue-check-button.checked:not(.flat-white) input:checked + label {
@@ -120,16 +100,6 @@ ue-color {
120
100
  ue-color .base-input {
121
101
  width: 100%;
122
102
  }
123
-
124
- ue-select-text-input .select-text-input-toggle {
125
- top: 0;
126
- right: 0;
127
- }
128
-
129
- ue-select-text-input .select-text-input-toggle .button {
130
- justify-content: center;
131
- background-color: transparent !important;
132
- }
133
103
  `;
134
104
  export {
135
105
  o as default
@@ -2,10 +2,6 @@ const n = `ue-wide-panel {
2
2
  width: 425px;
3
3
  }
4
4
 
5
- ue-main-editor-container[panel-position=SETTINGS_BLOCKS] ue-wide-panel {
6
- right: calc(100% - calc(var(--ue-spacing-step, 5px) * 3) - 425px);
7
- }
8
-
9
5
  ue-main-tabs-panel-component .fixed-panel-header {
10
6
  display: none;
11
7
  }
@@ -21,7 +17,7 @@ ue-description a {
21
17
  }
22
18
 
23
19
  .stacked-panel {
24
- overflow: auto;
20
+ overflow: scroll;
25
21
  }
26
22
 
27
23
  .stacked-panel-title {
@@ -12,12 +12,6 @@ const n = `.esd-x,
12
12
  .ue-preview-control-wrapper ue-icon-component:not([disabled=true]):not(.stripo-static-icon):hover {
13
13
  background: none;
14
14
  }
15
-
16
- .ue-email-wrapper-rounded,
17
- .ue-email-wrapper-rounded-top {
18
- border-radius: 0;
19
- box-shadow: none;
20
- }
21
15
  `;
22
16
  export {
23
17
  n as default
@@ -12,20 +12,10 @@ const o = `:host {
12
12
  --guido-color-neutral-800: #222938;
13
13
  --guido-color-neutral-200: #DCDFE6;
14
14
  --guido-color-neutral-100: #EFF2F4;
15
- --guido-color-danger-300: #e84342;
16
15
  --guido-color-danger-500: #DC2A2A;
17
16
  --guido-box-shadow: 0 4px 12px 0 rgba(44,53,70,0.15);
18
17
  --guido-color-background-onpage-message-info: #D3EEF8;
19
18
  --guido-color-border-onpage-message-info: #258DDE;
20
- --guido-color-background-onpage-message-warn: #FCEFE5;
21
- --guido-color-border-onpage-message-warn: #D37400;
22
- --guido-color-background-onpage-message-success: #E9F9EB;
23
- --guido-color-border-onpage-message-success: #128745;
24
- --guido-color-background-onpage-message-error: #FCECEC;
25
- --guido-color-border-onpage-message-error: var(--guido-color-danger-500);
26
- --guido-color-background-toaster-success: #128745;
27
- --guido-color-background-toaster-error: var(--guido-color-danger-500);
28
- --guido-color-background-toaster-warn: #D37400;
29
19
  }
30
20
  `;
31
21
  export {
@@ -8,19 +8,11 @@ export declare const useDynamicContentStore: import("pinia").StoreDefinition<"dy
8
8
  value: string;
9
9
  text: string;
10
10
  fallback?: string | undefined;
11
- format?: {
12
- key: string;
13
- value: string;
14
- } | undefined;
15
11
  };
16
12
  selectedDynamicContentList: {
17
13
  value: string;
18
14
  text: string;
19
15
  fallback?: string | undefined;
20
- format?: {
21
- key: string;
22
- value: string;
23
- } | undefined;
24
16
  }[];
25
17
  } & import("pinia").PiniaCustomStateProperties<{
26
18
  selectedDynamicContent: DynamicContent;
@@ -29,10 +21,6 @@ export declare const useDynamicContentStore: import("pinia").StoreDefinition<"dy
29
21
  text: string;
30
22
  value: string;
31
23
  fallback: string | undefined;
32
- format: {
33
- key: string;
34
- value: string;
35
- } | undefined;
36
24
  }[];
37
25
  }, {
38
26
  setSelectedDynamicContent(dynamicContent: DynamicContent): void;
@@ -6,16 +6,15 @@ const s = a("dynamicContent", {
6
6
  selectedDynamicContentList: []
7
7
  }),
8
8
  actions: {
9
- setSelectedDynamicContent(t) {
10
- this.selectedDynamicContent = t, this.selectedDynamicContentList.push(t);
9
+ setSelectedDynamicContent(e) {
10
+ this.selectedDynamicContent = e, this.selectedDynamicContentList.push(e);
11
11
  }
12
12
  },
13
13
  getters: {
14
- getSelectedDynamicContentList: (t) => n(t.selectedDynamicContentList).map((e) => ({
15
- text: e.text,
16
- value: e.value,
17
- fallback: e.fallback,
18
- format: e.format
14
+ getSelectedDynamicContentList: (e) => n(e.selectedDynamicContentList).map((t) => ({
15
+ text: t.text,
16
+ value: t.value,
17
+ fallback: t.fallback
19
18
  })) || []
20
19
  }
21
20
  });
@@ -108,15 +108,7 @@ export declare const useOnboardingStore: import("pinia").StoreDefinition<"onboar
108
108
  }[];
109
109
  };
110
110
  };
111
- userModalState: {
112
- Guido?: {
113
- newVersionPopup?: boolean | undefined;
114
- genericOnboarding?: boolean | undefined;
115
- textBlockOnboarding?: boolean | undefined;
116
- versionHistoryOnboarding?: boolean | undefined;
117
- ampOnboarding?: boolean | undefined;
118
- } | undefined;
119
- };
111
+ userModalState: Record<string, Record<string, boolean>>;
120
112
  isFetched: boolean;
121
113
  } & import("pinia").PiniaCustomStateProperties<OnboardingStoreState>) => (type: OnboardingType) => {
122
114
  cardIndex: number;
@@ -247,15 +239,7 @@ export declare const useOnboardingStore: import("pinia").StoreDefinition<"onboar
247
239
  }[];
248
240
  };
249
241
  };
250
- userModalState: {
251
- Guido?: {
252
- newVersionPopup?: boolean | undefined;
253
- genericOnboarding?: boolean | undefined;
254
- textBlockOnboarding?: boolean | undefined;
255
- versionHistoryOnboarding?: boolean | undefined;
256
- ampOnboarding?: boolean | undefined;
257
- } | undefined;
258
- };
242
+ userModalState: Record<string, Record<string, boolean>>;
259
243
  isFetched: boolean;
260
244
  } & import("pinia").PiniaCustomStateProperties<OnboardingStoreState>) => (type: OnboardingType) => boolean;
261
245
  getCurrentCard: (state: {
@@ -366,15 +350,7 @@ export declare const useOnboardingStore: import("pinia").StoreDefinition<"onboar
366
350
  }[];
367
351
  };
368
352
  };
369
- userModalState: {
370
- Guido?: {
371
- newVersionPopup?: boolean | undefined;
372
- genericOnboarding?: boolean | undefined;
373
- textBlockOnboarding?: boolean | undefined;
374
- versionHistoryOnboarding?: boolean | undefined;
375
- ampOnboarding?: boolean | undefined;
376
- } | undefined;
377
- };
353
+ userModalState: Record<string, Record<string, boolean>>;
378
354
  isFetched: boolean;
379
355
  } & import("pinia").PiniaCustomStateProperties<OnboardingStoreState>) => (type: OnboardingType) => {
380
356
  classes: string;
@@ -501,15 +477,7 @@ export declare const useOnboardingStore: import("pinia").StoreDefinition<"onboar
501
477
  }[];
502
478
  };
503
479
  };
504
- userModalState: {
505
- Guido?: {
506
- newVersionPopup?: boolean | undefined;
507
- genericOnboarding?: boolean | undefined;
508
- textBlockOnboarding?: boolean | undefined;
509
- versionHistoryOnboarding?: boolean | undefined;
510
- ampOnboarding?: boolean | undefined;
511
- } | undefined;
512
- };
480
+ userModalState: Record<string, Record<string, boolean>>;
513
481
  isFetched: boolean;
514
482
  } & import("pinia").PiniaCustomStateProperties<OnboardingStoreState>) => {
515
483
  classes: string;
@@ -636,15 +604,7 @@ export declare const useOnboardingStore: import("pinia").StoreDefinition<"onboar
636
604
  }[];
637
605
  };
638
606
  };
639
- userModalState: {
640
- Guido?: {
641
- newVersionPopup?: boolean | undefined;
642
- genericOnboarding?: boolean | undefined;
643
- textBlockOnboarding?: boolean | undefined;
644
- versionHistoryOnboarding?: boolean | undefined;
645
- ampOnboarding?: boolean | undefined;
646
- } | undefined;
647
- };
607
+ userModalState: Record<string, Record<string, boolean>>;
648
608
  isFetched: boolean;
649
609
  } & import("pinia").PiniaCustomStateProperties<OnboardingStoreState>) => {
650
610
  classes: string;
@@ -771,15 +731,7 @@ export declare const useOnboardingStore: import("pinia").StoreDefinition<"onboar
771
731
  }[];
772
732
  };
773
733
  };
774
- userModalState: {
775
- Guido?: {
776
- newVersionPopup?: boolean | undefined;
777
- genericOnboarding?: boolean | undefined;
778
- textBlockOnboarding?: boolean | undefined;
779
- versionHistoryOnboarding?: boolean | undefined;
780
- ampOnboarding?: boolean | undefined;
781
- } | undefined;
782
- };
734
+ userModalState: Record<string, Record<string, boolean>>;
783
735
  isFetched: boolean;
784
736
  } & import("pinia").PiniaCustomStateProperties<OnboardingStoreState>) => {
785
737
  classes: string;
@@ -906,15 +858,7 @@ export declare const useOnboardingStore: import("pinia").StoreDefinition<"onboar
906
858
  }[];
907
859
  };
908
860
  };
909
- userModalState: {
910
- Guido?: {
911
- newVersionPopup?: boolean | undefined;
912
- genericOnboarding?: boolean | undefined;
913
- textBlockOnboarding?: boolean | undefined;
914
- versionHistoryOnboarding?: boolean | undefined;
915
- ampOnboarding?: boolean | undefined;
916
- } | undefined;
917
- };
861
+ userModalState: Record<string, Record<string, boolean>>;
918
862
  isFetched: boolean;
919
863
  } & import("pinia").PiniaCustomStateProperties<OnboardingStoreState>) => {
920
864
  classes: string;
@@ -1041,15 +985,7 @@ export declare const useOnboardingStore: import("pinia").StoreDefinition<"onboar
1041
985
  }[];
1042
986
  };
1043
987
  };
1044
- userModalState: {
1045
- Guido?: {
1046
- newVersionPopup?: boolean | undefined;
1047
- genericOnboarding?: boolean | undefined;
1048
- textBlockOnboarding?: boolean | undefined;
1049
- versionHistoryOnboarding?: boolean | undefined;
1050
- ampOnboarding?: boolean | undefined;
1051
- } | undefined;
1052
- };
988
+ userModalState: Record<string, Record<string, boolean>>;
1053
989
  isFetched: boolean;
1054
990
  } & import("pinia").PiniaCustomStateProperties<OnboardingStoreState>) => (type: OnboardingType) => boolean;
1055
991
  }, {
@@ -1,14 +1,11 @@
1
- const e = (l) => l.map((a) => a.format ? {
2
- label: `${a.text} | ${a.format.key}=${a.format.value}`,
3
- value: `{{${a.value}|${a.format.key}=${a.format.value}}}`
4
- } : {
1
+ const l = (e) => e.map((a) => ({
5
2
  label: a.fallback ? `${a.text} | ${a.fallback}` : a.text,
6
3
  value: a.fallback ? `{{${a.value}|${a.fallback}}}` : `{{${a.value}}}`
7
- }), r = () => {
8
- var l;
9
- return ((l = document.head.querySelector('meta[name="csrf-token"]')) == null ? void 0 : l.getAttribute("content")) ?? "";
4
+ })), t = () => {
5
+ var e;
6
+ return ((e = document.head.querySelector('meta[name="csrf-token"]')) == null ? void 0 : e.getAttribute("content")) ?? "";
10
7
  };
11
8
  export {
12
- e as dynamicContentToMergeTags,
13
- r as getCsrfToken
9
+ l as dynamicContentToMergeTags,
10
+ t as getCsrfToken
14
11
  };
@@ -1,28 +1,21 @@
1
- import { useActionsApi as g } from "../composables/useActionsApi.js";
2
- import { useHtmlCompiler as S } from "../composables/useHtmlCompiler.js";
3
- import { useDynamicContentStore as f } from "../stores/dynamic-content.js";
4
- const H = () => {
5
- const t = f(), { getCompiledEmail: i, getTemplateData: o } = g(), { compileHtml: n } = S();
1
+ import { useActionsApi as c } from "../composables/useActionsApi.js";
2
+ import { useDynamicContentStore as l } from "../stores/dynamic-content.js";
3
+ const y = () => {
4
+ const t = l(), { getCompiledEmail: e, getTemplateData: a } = c();
6
5
  return {
7
6
  prepareTemplateDetails: async () => {
8
- const { html: a, ampHtml: s = "", ampErrors: m = [] } = await i({
7
+ const { html: n, ampHtml: s = "", ampErrors: o = [] } = await e({
9
8
  minimize: !0,
10
9
  resetDataSavedFlag: !1
11
- }), { html: r, css: c, syncModulesIds: l = [] } = await o(), { compiledHtml: p, stats: e, appliedRules: d } = n(a), u = t.getSelectedDynamicContentList;
12
- return console.debug("HTML Compilation Stats:", {
13
- originalSize: e.originalSize,
14
- compiledSize: e.compiledSize,
15
- reduction: `${e.reductionPercentage.toFixed(2)}%`,
16
- appliedRules: d,
17
- executionTime: `${e.executionTime.toFixed(2)}ms`
18
- }), {
19
- dynamicContentList: u,
20
- compiledHtml: p,
21
- rawHtml: r,
22
- css: c,
10
+ }), { html: m, css: i, syncModulesIds: r = [] } = await a();
11
+ return {
12
+ dynamicContentList: t.getSelectedDynamicContentList,
13
+ compiledHtml: n,
14
+ rawHtml: m,
15
+ css: i,
23
16
  ampHtml: s,
24
- ampErrors: m,
25
- modules: l,
17
+ ampErrors: o,
18
+ modules: r,
26
19
  recommendation: {
27
20
  campaignUrls: {},
28
21
  configs: {}
@@ -36,5 +29,5 @@ const H = () => {
36
29
  };
37
30
  };
38
31
  export {
39
- H as useTemplatePreparation
32
+ y as useTemplatePreparation
40
33
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "1.0.2-beta.14a3cf5",
3
+ "version": "1.0.2-beta.198f9ce",
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",
@@ -1,3 +0,0 @@
1
- export declare const useHtmlValidator: () => {
2
- validateHtml: (html: string, customFields: string[], isOnSaveValidation?: boolean) => Promise<boolean>;
3
- };
@@ -1,120 +0,0 @@
1
- import { useConfig as V } from "./useConfig.js";
2
- import { TemplateTypes as H } from "../enums/defaults.js";
3
- import { DISPLAY_CONDITIONS_REGEX as O, DISPLAY_CONDITIONS_EXCEPTIONS_REGEX as B, CampaignCouldNotBeSavedKey as _, CanNotMakeAnyChangesForRunningKey as R } from "../enums/html-validator.js";
4
- import { ToasterTypeOptions as r } from "../enums/toaster.js";
5
- import { useRecommendationStore as D } from "../stores/recommendation.js";
6
- import { base64EncodeWithSpecialChars as P } from "../utils/base64.js";
7
- import { useHttp as X } from "./useHttp.js";
8
- import { useToaster as j } from "./useToaster.js";
9
- import { useTranslations as z } from "./useTranslations.js";
10
- const tt = () => {
11
- var d;
12
- const { showToaster: a } = j(), { post: y } = X(), { config: C } = V(), i = z(), m = D(), f = ((d = C.partner) == null ? void 0 : d.messageType) === H.transactional, h = async (t) => {
13
- const e = await y(
14
- "/newsletter/template-library/check-template-html-body",
15
- { html: P(t) }
16
- ), { status: n, message: c } = e.data;
17
- return n || a({
18
- type: r.Alert,
19
- message: n === void 0 ? c : i("newsletter.invalid-url-link-for-toaster")
20
- }), i(_), c === i(R) && a({
21
- type: r.Alert,
22
- message: i("newsletter.already-in-progress")
23
- }), n;
24
- }, v = (t) => !["if", "endif", "else", "elif", "now"].includes(t.toLowerCase()), w = (t) => ["if", "endif"].includes(t.toLowerCase()), S = (t, s) => {
25
- const e = t.match(/({%(.*?)%})/g);
26
- let n = !0;
27
- return e !== null && !f && e.forEach((c) => {
28
- const o = c.slice(2, -2).trim().match(/(".*?"|[^"\s]+)(?=\s*|\s*$)/g);
29
- if (o && o.length > 0) {
30
- const [l] = o;
31
- v(l) && !s.includes(l) && (a({
32
- type: r.Warning,
33
- message: i("custom-fields.invalid-custom-fields")
34
- }), n = !1);
35
- }
36
- }), n;
37
- }, E = async (t, s, e) => {
38
- const n = e ? await h(t) : !0;
39
- return S(t, s) && n;
40
- }, T = (t) => t.length > 0 ? !0 : (a({
41
- type: r.Warning,
42
- message: i("newsletter.html-content-is-empty")
43
- }), !1), I = (t) => {
44
- const s = (t.match(/{/gm) || []).length, e = (t.match(/}/gm) || []).length;
45
- return s > e && a({
46
- type: r.Warning,
47
- message: i("custom-fields.missing-closing-braces")
48
- }), s < e && a({
49
- type: r.Warning,
50
- message: i("custom-fields.missing-opening-braces")
51
- }), s === e;
52
- }, A = (t) => {
53
- const s = t.match(/{{\s*(\w+\s+((\w+\|\w+)|(\w+)))\s*}}/gm) === null;
54
- return s || a({
55
- type: r.Warning,
56
- message: i("custom-fields.invalid-custom-fields")
57
- }), s;
58
- }, W = (t, s) => {
59
- const e = t.match(/{{([a-zA-Z0-9_\s]*)}}/gm);
60
- if (e && !f) {
61
- const n = s.map((o) => o.toLowerCase()), c = e.some((o) => {
62
- const l = o.replace("{{", "").replace("}}", "").trim().toLowerCase();
63
- return !n.includes(l) || l === "";
64
- });
65
- return c && a({
66
- type: r.Warning,
67
- message: i("custom-fields.invalid-custom-fields")
68
- }), !c;
69
- }
70
- return !0;
71
- }, x = (t) => {
72
- const s = t.match(/{%(.*?)%}/g), e = [];
73
- let n = !0;
74
- if (s && s.forEach((c) => {
75
- const o = c.match(O), l = c.match(B), L = (o == null ? void 0 : o.join("")) || "";
76
- (!o || c !== L) && !l && (a({
77
- type: r.Alert,
78
- message: i("newsletter.display-conditions-invalid-syntax")
79
- }), n = !1), o && o.forEach((u) => {
80
- u.trim() === "=" && (a({
81
- type: r.Alert,
82
- message: i("custom-conditions.wrong-equality-operators")
83
- }), n = !1);
84
- const g = u.match(/^[a-zA-Z]*$/g);
85
- g && g.forEach((p) => {
86
- w(p) && e.push(p);
87
- });
88
- });
89
- }), e.length) {
90
- const c = e.filter((l) => l === "if"), o = e.filter((l) => l === "endif");
91
- c.length !== o.length && (a({
92
- type: r.Alert,
93
- message: i("custom-conditions.missing-if-endif-tag")
94
- }), n = !1);
95
- }
96
- return n;
97
- }, b = (t) => {
98
- const s = (t.match(/{% /gm) || []).length, e = (t.match(/ %}/gm) || []).length, n = s === e;
99
- return n || a({
100
- type: r.Warning,
101
- message: i("custom-conditions.no-space-after-braces")
102
- }), n;
103
- }, N = (t) => (t.match(/({%(.*?)%})/g) || []).filter((e) => e.includes("if")).map((e) => (e.match(/{{.*}}/gm) || []).length).reduce((e, n) => e + n, 0) > 0 ? (a({
104
- type: r.Warning,
105
- message: i("custom-conditions.no-braces-inside-if-tag")
106
- }), !1) : !0, k = () => m.recommendationConfigs && Object.values(m.recommendationConfigs).find((s) => s.filters.find((e) => e.value === "")) !== void 0 ? (a({
107
- type: r.Alert,
108
- message: i("newsletter.fill-all-necessary-fields")
109
- }), !1) : !0, F = (t) => {
110
- const s = /src="[^"]*\.(svg|pst)"/gm;
111
- return t.match(s) === null ? !0 : (a({
112
- type: r.Alert,
113
- message: i("newsletter.invalid-image-type")
114
- }), !1);
115
- };
116
- return { validateHtml: async (t, s, e = !1) => await E(t, s, e) && T(t) && I(t) && A(t) && W(t, s) && x(t) && b(t) && N(t) && k() && F(t) };
117
- };
118
- export {
119
- tt as useHtmlValidator
120
- };
@@ -1,19 +0,0 @@
1
- type CardWidthParams = {
2
- mobileLeftPadding: number;
3
- mobileRightPadding: number;
4
- cardsInRow: number;
5
- unresponsive: boolean;
6
- };
7
- interface CampaignData extends CardWidthParams {
8
- textTrimming: boolean;
9
- orientation: string;
10
- priceBeforeTextValue: string;
11
- priceAfterTextValue: string;
12
- discountBeforeTextValue: string;
13
- discountAfterTextValue: string;
14
- }
15
- export declare const useRecommendation: () => {
16
- calculateCardWidth: ({ mobileLeftPadding, mobileRightPadding, cardsInRow, unresponsive, }: CardWidthParams) => number;
17
- getRecommendationCampaignData: (id: string) => CampaignData;
18
- };
19
- export {};
@@ -1,27 +0,0 @@
1
- import { MinDeviceViewport as r, DefaultPadding as c } from "../enums/recommendation.js";
2
- const m = () => ({
3
- calculateCardWidth: ({
4
- mobileLeftPadding: e,
5
- mobileRightPadding: a,
6
- cardsInRow: n,
7
- unresponsive: i
8
- }) => {
9
- const t = i ? n : 1, o = e + a + (t - 1) * c;
10
- return (r - o) / t;
11
- },
12
- getRecommendationCampaignData: (e) => (console.debug(e), {
13
- textTrimming: !1,
14
- orientation: "vertical",
15
- mobileLeftPadding: 0,
16
- mobileRightPadding: 0,
17
- cardsInRow: 2,
18
- unresponsive: !1,
19
- priceBeforeTextValue: "",
20
- priceAfterTextValue: "",
21
- discountBeforeTextValue: "",
22
- discountAfterTextValue: ""
23
- })
24
- });
25
- export {
26
- m as useRecommendation
27
- };
@@ -1,4 +0,0 @@
1
- import { SavedTemplateDetails } from '@@/Types/stripo';
2
- export declare const useSave: () => {
3
- save: (isSilent?: boolean) => Promise<SavedTemplateDetails | undefined>;
4
- };
@@ -1,15 +0,0 @@
1
- import { useSaveStart as i, useSaveComplete as l } from "./useGuidoActions.js";
2
- import { useTemplatePreparation as m } from "../utils/templatePreparation.js";
3
- import { useHtmlValidator as n } from "./useHtmlValidator.js";
4
- const f = () => {
5
- const e = i(), a = l(), { validateHtml: s } = n();
6
- return { save: async (o = !1) => {
7
- e();
8
- const { prepareTemplateDetails: r } = m(), t = await r();
9
- if (await s(t.compiledHtml, [], !0))
10
- return o || a(t), t;
11
- } };
12
- };
13
- export {
14
- f as useSave
15
- };
@@ -1,36 +0,0 @@
1
- const c = `
2
- <!--[if gte mso 9]>
3
- <xml>
4
- <o:OfficeDocumentSettings>
5
- <o:AllowPNG></o:AllowPNG>
6
- <o:PixelsPerInch>96</o:PixelsPerInch>
7
- </o:OfficeDocumentSettings>
8
- </xml>
9
- <![endif]-->`, s = {
10
- xmlns: "http://www.w3.org/1999/xhtml",
11
- "xmlns:o": "urn:schemas-microsoft-com:office:office"
12
- }, r = [
13
- {
14
- id: "append-office-xml",
15
- description: "Appending office XML into the head if it does not exist.",
16
- type: "custom",
17
- processor: (e) => e.includes("<o:OfficeDocumentSettings>") ? e : e.replace("</head>", `${c}</head>`),
18
- priority: 70
19
- },
20
- {
21
- id: "set-html-attributes",
22
- description: "Appending office XML into the head if it does not exist.",
23
- type: "custom",
24
- processor: (e) => {
25
- let t = e;
26
- return Object.entries(s).forEach(([o, i]) => {
27
- const n = new RegExp(`${o}="[^"]*"`);
28
- t.search(n) === -1 && (t = t.replace("<html", `<html ${o}="${i}"`));
29
- }), t;
30
- },
31
- priority: 71
32
- }
33
- ];
34
- export {
35
- r as outlookCompilerRules
36
- };
@@ -1,2 +0,0 @@
1
- import type { CompilerRule } from '@@/Types/html-compiler';
2
- export declare const recommendationCompilerRules: CompilerRule[];