@useinsider/guido 1.0.2-beta.585f2fc → 1.0.2-beta.73c3522

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 (145) hide show
  1. package/README.md +1 -1
  2. package/dist/_virtual/AddCustomFont.js +4 -0
  3. package/dist/_virtual/AiAssistantValueType.js +4 -0
  4. package/dist/_virtual/BackgroundColorBuiltInControl.js +4 -0
  5. package/dist/_virtual/BackgroundImageBuiltInControl.js +4 -0
  6. package/dist/_virtual/Block.js +4 -0
  7. package/dist/_virtual/BlockAttributes.js +4 -0
  8. package/dist/_virtual/BlockCompositionType.js +4 -0
  9. package/dist/_virtual/BlockPaddingsBuiltInControl.js +4 -0
  10. package/dist/_virtual/BlockRenderer.js +4 -0
  11. package/dist/_virtual/BlockType.js +4 -0
  12. package/dist/_virtual/BlocksPanel.js +4 -0
  13. package/dist/_virtual/BuiltInControl.js +4 -0
  14. package/dist/_virtual/BuiltInControlTypes.js +4 -0
  15. package/dist/_virtual/ButtonBorderBuiltInControl.js +4 -0
  16. package/dist/_virtual/ButtonColorBuiltInControl.js +4 -0
  17. package/dist/_virtual/ButtonFontColorBuiltInControl.js +4 -0
  18. package/dist/_virtual/ButtonInternalIndentsBuiltInControl.js +4 -0
  19. package/dist/_virtual/ButtonTextBuiltInControl.js +4 -0
  20. package/dist/_virtual/ContextAction.js +4 -0
  21. package/dist/_virtual/ContextActionType.js +4 -0
  22. package/dist/_virtual/Control.js +4 -0
  23. package/dist/_virtual/EditorStatePropertyType.js +4 -0
  24. package/dist/_virtual/Extension.js +4 -0
  25. package/dist/_virtual/ExtensionBuilder.js +4 -0
  26. package/dist/_virtual/FontFamilyBuiltInControl.js +4 -0
  27. package/dist/_virtual/LinkColorBuiltInControl.js +4 -0
  28. package/dist/_virtual/ModificationDescription.js +4 -0
  29. package/dist/_virtual/PanelPosition.js +4 -0
  30. package/dist/_virtual/PreviewDeviceMode.js +4 -0
  31. package/dist/_virtual/SettingsPanelRegistry.js +4 -0
  32. package/dist/_virtual/SettingsPanelTab.js +4 -0
  33. package/dist/_virtual/SettingsTab.js +4 -0
  34. package/dist/_virtual/StructureBorderBuiltInControl.js +4 -0
  35. package/dist/_virtual/StructurePaddingsBuiltInControl.js +4 -0
  36. package/dist/_virtual/TextColorBuiltInControl.js +4 -0
  37. package/dist/_virtual/TextLineSpacingBuiltInControl.js +4 -0
  38. package/dist/_virtual/TextSizeBuiltInControl.js +4 -0
  39. package/dist/_virtual/TextStyleBuiltInControl.js +4 -0
  40. package/dist/_virtual/UIElement.js +4 -0
  41. package/dist/_virtual/UIElementTagRegistry.js +4 -0
  42. package/dist/_virtual/UIElementType.js +4 -0
  43. package/dist/_virtual/UIElementsAttributes.js +4 -0
  44. package/dist/_virtual/index.js +5 -0
  45. package/dist/_virtual/index2.js +4 -0
  46. package/dist/components/Guido.vue.js +5 -5
  47. package/dist/components/Guido.vue2.js +50 -51
  48. package/dist/components/organisms/email-preview/amp/AmpToggle.vue.js +2 -3
  49. package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +5 -5
  50. package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +2 -2
  51. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +5 -5
  52. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +28 -40
  53. package/dist/composables/useCustomInterfaceAppearance.js +18 -22
  54. package/dist/composables/useHtmlValidator.d.ts +1 -2
  55. package/dist/composables/useHtmlValidator.js +94 -122
  56. package/dist/composables/useSave.js +6 -6
  57. package/dist/composables/useStripo.js +26 -32
  58. package/dist/extensions/DynamicContent/dynamic-content.js +27 -41
  59. package/dist/extensions/DynamicContent/extension.js +6 -18
  60. package/dist/guido.css +1 -1
  61. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/Extension.js +48 -72
  62. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ExtensionBuilder.js +49 -74
  63. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/Block.js +38 -120
  64. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/BlockRenderer.js +18 -0
  65. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/BlocksPanel.js +32 -0
  66. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/ContextAction.js +18 -0
  67. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/AddCustomFont.js +8 -0
  68. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/AiAssistantValueType.js +11 -5
  69. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockAttributes.js +34 -0
  70. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockCompositionType.js +11 -5
  71. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockType.js +11 -5
  72. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BuiltInControlTypes.js +101 -116
  73. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/ContextActionType.js +11 -5
  74. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/EditorStatePropertyType.js +11 -5
  75. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PanelPosition.js +11 -5
  76. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PreviewDeviceMode.js +11 -5
  77. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/SettingsTab.js +11 -5
  78. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementType.js +11 -5
  79. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementsAttributes.js +43 -22
  80. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BackgroundColorBuiltInControl.js +43 -0
  81. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BackgroundImageBuiltInControl.js +46 -0
  82. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BlockPaddingsBuiltInControl.js +44 -0
  83. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BuiltInControl.js +22 -0
  84. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonBorderBuiltInControl.js +46 -0
  85. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonColorBuiltInControl.js +46 -0
  86. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonFontColorBuiltInControl.js +45 -0
  87. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonInternalIndentsBuiltInControl.js +45 -0
  88. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonTextBuiltInControl.js +45 -0
  89. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/Control.js +17 -21
  90. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/FontFamilyBuiltInControl.js +43 -0
  91. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/LinkColorBuiltInControl.js +45 -0
  92. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelRegistry.js +15 -8
  93. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelTab.js +29 -30
  94. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/StructureBorderBuiltInControl.js +46 -0
  95. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/StructurePaddingsBuiltInControl.js +44 -0
  96. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextColorBuiltInControl.js +43 -0
  97. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextLineSpacingBuiltInControl.js +43 -0
  98. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextSizeBuiltInControl.js +45 -0
  99. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextStyleBuiltInControl.js +43 -0
  100. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/index.js +266 -0
  101. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/modifications/ModificationDescription.js +23 -19
  102. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElement.js +19 -37
  103. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElementTagRegistry.js +15 -2
  104. package/dist/static/styles/components/alert-message.css.js +2 -32
  105. package/dist/static/styles/components/button.css.js +2 -32
  106. package/dist/static/styles/components/wide-panel.css.js +1 -5
  107. package/dist/static/styles/customEditorStyle.css.js +0 -6
  108. package/dist/static/styles/variables.css.js +0 -10
  109. package/package.json +2 -2
  110. package/dist/config/migrator/checkboxMigrator.d.ts +0 -1
  111. package/dist/config/migrator/checkboxMigrator.js +0 -83
  112. package/dist/config/migrator/index.d.ts +0 -1
  113. package/dist/config/migrator/index.js +0 -9
  114. package/dist/config/migrator/radioButtonMigrator.d.ts +0 -1
  115. package/dist/config/migrator/radioButtonMigrator.js +0 -86
  116. package/dist/extensions/Blocks/Checkbox/block.d.ts +0 -10
  117. package/dist/extensions/Blocks/Checkbox/block.js +0 -39
  118. package/dist/extensions/Blocks/Checkbox/control.d.ts +0 -22
  119. package/dist/extensions/Blocks/Checkbox/control.js +0 -104
  120. package/dist/extensions/Blocks/Checkbox/extension.d.ts +0 -2
  121. package/dist/extensions/Blocks/Checkbox/extension.js +0 -20
  122. package/dist/extensions/Blocks/Checkbox/settingsPanel.d.ts +0 -4
  123. package/dist/extensions/Blocks/Checkbox/settingsPanel.js +0 -38
  124. package/dist/extensions/Blocks/Checkbox/template.d.ts +0 -6
  125. package/dist/extensions/Blocks/Checkbox/template.js +0 -75
  126. package/dist/extensions/Blocks/RadioButton/block.d.ts +0 -10
  127. package/dist/extensions/Blocks/RadioButton/block.js +0 -39
  128. package/dist/extensions/Blocks/RadioButton/control.d.ts +0 -17
  129. package/dist/extensions/Blocks/RadioButton/control.js +0 -104
  130. package/dist/extensions/Blocks/RadioButton/extension.d.ts +0 -2
  131. package/dist/extensions/Blocks/RadioButton/extension.js +0 -20
  132. package/dist/extensions/Blocks/RadioButton/settingsPanel.d.ts +0 -4
  133. package/dist/extensions/Blocks/RadioButton/settingsPanel.js +0 -39
  134. package/dist/extensions/Blocks/RadioButton/template.d.ts +0 -6
  135. package/dist/extensions/Blocks/RadioButton/template.js +0 -160
  136. package/dist/extensions/Blocks/_Boilerplate/block.d.ts +0 -10
  137. package/dist/extensions/Blocks/_Boilerplate/control.d.ts +0 -17
  138. package/dist/extensions/Blocks/_Boilerplate/extension.d.ts +0 -2
  139. package/dist/extensions/Blocks/_Boilerplate/settingsPanel.d.ts +0 -4
  140. package/dist/extensions/Blocks/_Boilerplate/template.d.ts +0 -6
  141. package/dist/mock/api/unsubscribe.d.ts +0 -2
  142. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockName.js +0 -12
  143. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/Popover.js +0 -12
  144. package/dist/static/styles/components/notification.css.js +0 -55
  145. package/dist/static/styles/components/popup.css.js +0 -68
@@ -1,35 +1,23 @@
1
- import { defineComponent as u, computed as a, watch as b } from "vue";
2
- import { useTranslations as m } from "../../../composables/useTranslations.js";
3
- import { useOnboardingStore as k } from "../../../stores/onboarding.js";
4
- import { InOnboard as B } from "@useinsider/design-system-vue";
5
- const y = /* @__PURE__ */ u({
1
+ import { defineComponent as s, computed as r, watch as l } from "vue";
2
+ import { useTranslations as x } from "../../../composables/useTranslations.js";
3
+ import { useOnboardingStore as g } from "../../../stores/onboarding.js";
4
+ import { InOnboard as b } from "@useinsider/design-system-vue";
5
+ const C = /* @__PURE__ */ s({
6
6
  __name: "TextBlockOnboarding",
7
- setup(h) {
8
- const i = m(), o = k(), e = a(() => {
9
- const n = window.innerHeight - 128, r = Math.max(90, n * 0.15), s = Math.max(490, n * 0.71), d = 200, g = 40;
10
- return {
11
- settings: {
12
- top: `${r}px`,
13
- position: r + d + g > n ? "Right Bottom" : "Right Top"
14
- },
15
- dynamic: {
16
- top: `${s}px`,
17
- position: s + d + g > n ? "Right Bottom" : "Right Top"
18
- }
19
- };
20
- }), c = a(() => [
7
+ setup(p) {
8
+ const n = x(), o = g(), i = r(() => [
21
9
  {
22
10
  classes: "guido-text-block-onboarding-settings",
23
11
  right: "450px",
24
- top: e.value.settings.top,
25
- position: e.value.settings.position,
26
- title: i("email-editor.onboarding-text-block-title"),
27
- description: i("email-editor.onboarding-text-block-description"),
12
+ top: "90px",
13
+ position: "Right Top",
14
+ title: n("email-editor.onboarding-text-block-title"),
15
+ description: n("email-editor.onboarding-text-block-description"),
28
16
  imageSource: "",
29
17
  backButtonClick: () => {
30
18
  },
31
19
  nextButtonType: "text",
32
- nextButtonText: i("products.next"),
20
+ nextButtonText: n("products.next"),
33
21
  nextButtonClick: () => {
34
22
  o.next("textBlockOnboarding");
35
23
  }
@@ -37,38 +25,38 @@ const y = /* @__PURE__ */ u({
37
25
  {
38
26
  classes: "guido-text-block-onboarding-dynamic",
39
27
  right: "450px",
40
- top: e.value.dynamic.top,
41
- position: e.value.dynamic.position,
42
- title: i("email-editor.onboarding-dynamic-content-title"),
43
- description: i("email-editor.onboarding-dynamic-content-description"),
28
+ top: "594px",
29
+ position: "Right Top",
30
+ title: n("email-editor.onboarding-dynamic-content-title"),
31
+ description: n("email-editor.onboarding-dynamic-content-description"),
44
32
  imageSource: "",
45
33
  backButtonType: "text",
46
- backButtonText: i("ds-steps.back"),
34
+ backButtonText: n("ds-steps.back"),
47
35
  backButtonClick: () => {
48
36
  o.previous("textBlockOnboarding");
49
37
  },
50
38
  nextButtonType: "text",
51
- nextButtonText: i("action-builder.ok"),
39
+ nextButtonText: n("action-builder.ok"),
52
40
  nextButtonClick: () => {
53
41
  o.close("textBlockOnboarding");
54
42
  }
55
43
  }
56
- ]), l = a(() => o.onboardings.textBlockOnboarding.config.length > 0 && o.onboardings.textBlockOnboarding.isActive), p = () => {
57
- var t, n;
58
- (n = (t = o.getTextBlockCurrentCard) == null ? void 0 : t.nextButtonClick) == null || n.call(t);
59
- }, x = () => {
60
- var t, n;
61
- (n = (t = o.getTextBlockCurrentCard) == null ? void 0 : t.backButtonClick) == null || n.call(t);
44
+ ]), c = r(() => o.onboardings.textBlockOnboarding.config.length > 0 && o.onboardings.textBlockOnboarding.isActive), a = () => {
45
+ var t, e;
46
+ (e = (t = o.getTextBlockCurrentCard) == null ? void 0 : t.nextButtonClick) == null || e.call(t);
47
+ }, d = () => {
48
+ var t, e;
49
+ (e = (t = o.getTextBlockCurrentCard) == null ? void 0 : t.backButtonClick) == null || e.call(t);
62
50
  };
63
- return b(
51
+ return l(
64
52
  () => o.isActive("textBlockOnboarding"),
65
53
  (t) => {
66
- t && o.setConfig("textBlockOnboarding", c.value);
54
+ t && o.setConfig("textBlockOnboarding", i.value);
67
55
  },
68
56
  { immediate: !0 }
69
- ), { __sfc: !0, trans: i, onboardingStore: o, dynamicPosition: e, onboardingCardsConfig: c, isVisible: l, handleNext: p, handleBack: x, InOnboard: B };
57
+ ), { __sfc: !0, trans: n, onboardingStore: o, onboardingCardsConfig: i, isVisible: c, handleNext: a, handleBack: d, InOnboard: b };
70
58
  }
71
59
  });
72
60
  export {
73
- y as default
61
+ C as default
74
62
  };
@@ -1,34 +1,32 @@
1
1
  import S from "../static/styles/base.css.js";
2
- import m from "../static/styles/components/alert-message.css.js";
3
- import e from "../static/styles/components/amp-block.css.js";
2
+ import e from "../static/styles/components/alert-message.css.js";
3
+ import m from "../static/styles/components/amp-block.css.js";
4
4
  import i from "../static/styles/components/base-input.css.js";
5
5
  import p from "../static/styles/components/button-group.css.js";
6
6
  import n from "../static/styles/components/button.css.js";
7
- import C from "../static/styles/components/combobox.css.js";
8
- import s from "../static/styles/components/counter.css.js";
7
+ import s from "../static/styles/components/combobox.css.js";
8
+ import C from "../static/styles/components/counter.css.js";
9
9
  import f from "../static/styles/components/dropdown-menu.css.js";
10
10
  import a from "../static/styles/components/loader.css.js";
11
11
  import u from "../static/styles/components/narrow-panel.css.js";
12
- import c from "../static/styles/components/notification.css.js";
13
- import d from "../static/styles/components/popup.css.js";
14
- import l from "../static/styles/components/switcher.css.js";
15
- import h from "../static/styles/components/tabs.css.js";
16
- import w from "../static/styles/components/tools.css.js";
17
- import y from "../static/styles/components/version-history.css.js";
18
- import B from "../static/styles/components/wide-panel.css.js";
19
- import b from "../static/styles/variables.css.js";
20
- const A = [
21
- b,
12
+ import c from "../static/styles/components/switcher.css.js";
13
+ import d from "../static/styles/components/tabs.css.js";
14
+ import l from "../static/styles/components/tools.css.js";
15
+ import h from "../static/styles/components/version-history.css.js";
16
+ import w from "../static/styles/components/wide-panel.css.js";
17
+ import y from "../static/styles/variables.css.js";
18
+ const B = [
19
+ y,
22
20
  // Must be on top
23
21
  S,
24
22
  // Must be on top
25
- m,
26
23
  e,
24
+ m,
27
25
  i,
28
26
  p,
29
27
  n,
30
- C,
31
28
  s,
29
+ C,
32
30
  f,
33
31
  a,
34
32
  u,
@@ -36,14 +34,12 @@ const A = [
36
34
  d,
37
35
  l,
38
36
  h,
39
- w,
40
- y,
41
- B
37
+ w
42
38
  ].join(`
43
39
 
44
- `), F = () => ({ importCss: () => {
40
+ `), R = () => ({ importCss: () => {
45
41
  const o = new CSSStyleSheet();
46
- o.replaceSync(A);
42
+ o.replaceSync(B);
47
43
  const r = document.querySelector("ui-editor");
48
44
  if (!r)
49
45
  return;
@@ -51,5 +47,5 @@ const A = [
51
47
  t && (t.adoptedStyleSheets = [o]);
52
48
  } });
53
49
  export {
54
- F as useCustomInterfaceAppearance
50
+ R as useCustomInterfaceAppearance
55
51
  };
@@ -1,4 +1,3 @@
1
- import type { DynamicContent } from '@@/Types/generic';
2
1
  export declare const useHtmlValidator: () => {
3
- validateHtml: (html: string, customFields: DynamicContent[], isOnSaveValidation?: boolean) => Promise<boolean>;
2
+ validateHtml: (html: string, customFields: string[], isOnSaveValidation?: boolean) => Promise<boolean>;
4
3
  };
@@ -1,148 +1,120 @@
1
- import { useConfig as H } from "./useConfig.js";
2
- import { TemplateTypes as V } from "../enums/defaults.js";
3
- import { DISPLAY_CONDITIONS_REGEX as D, DISPLAY_CONDITIONS_EXCEPTIONS_REGEX as P, CampaignCouldNotBeSavedKey as R, CanNotMakeAnyChangesForRunningKey as _ } from "../enums/html-validator.js";
4
- import { ToasterTypeOptions as l } from "../enums/toaster.js";
5
- import { useRecommendationStore as G } from "../stores/recommendation.js";
6
- import { base64EncodeWithSpecialChars as $ } from "../utils/base64.js";
7
- import { useHttp as j } from "./useHttp.js";
8
- import { useToaster as q } from "./useToaster.js";
9
- import { useTranslations as M } from "./useTranslations.js";
10
- const se = () => {
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
11
  var d;
12
- const { showToaster: c } = q(), { post: y } = j(), { config: h } = H(), a = M(), m = G(), u = ((d = h.partner) == null ? void 0 : d.messageType) === V.transactional, v = async (e) => {
13
- const t = await y(
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
14
  "/newsletter/template-library/check-template-html-body",
15
- { html: $(e) }
16
- ), { status: n, message: r } = t.data;
17
- return n || c({
18
- type: l.Alert,
19
- message: n === void 0 ? r : a("newsletter.invalid-url-link-for-toaster")
20
- }), a(R), r === a(_) && c({
21
- type: l.Alert,
22
- message: a("newsletter.already-in-progress")
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
23
  }), n;
24
- }, C = (e) => !["if", "endif", "else", "elif", "now"].includes(e.toLowerCase()), w = (e) => ["if", "endif"].includes(e.toLowerCase()), S = (e, s) => {
25
- const t = e.match(/({%(.*?)%})/g);
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
26
  let n = !0;
27
- return t !== null && !u && t.forEach((r) => {
28
- const o = r.slice(2, -2).trim().match(/(".*?"|[^"\s]+)(?=\s*|\s*$)/g);
27
+ return e !== null && !f && e.forEach((c) => {
28
+ const o = c.slice(2, -2).trim().match(/(".*?"|[^"\s]+)(?=\s*|\s*$)/g);
29
29
  if (o && o.length > 0) {
30
- const [i] = o;
31
- C(i) && !s.includes(i) && (c({
32
- type: l.Warning,
33
- message: a("custom-fields.invalid-custom-fields")
30
+ const [l] = o;
31
+ v(l) && !s.includes(l) && (a({
32
+ type: r.Warning,
33
+ message: i("custom-fields.invalid-custom-fields")
34
34
  }), n = !1);
35
35
  }
36
36
  }), n;
37
- }, b = async (e, s, t) => {
38
- const n = t ? await v(e) : !0;
39
- return S(e, s) && n;
40
- }, E = (e) => e.length > 0 ? !0 : (c({
41
- type: l.Warning,
42
- message: a("newsletter.html-content-is-empty")
43
- }), !1), A = (e) => {
44
- const s = (e.match(/{/gm) || []).length, t = (e.match(/}/gm) || []).length;
45
- return s > t && c({
46
- type: l.Warning,
47
- message: a("custom-fields.missing-closing-braces")
48
- }), s < t && c({
49
- type: l.Warning,
50
- message: a("custom-fields.missing-opening-braces")
51
- }), s === t;
52
- }, x = (e) => {
53
- const s = e.match(/{{\s*(\w+\s+((\w+\|\w+)|(\w+)))\s*}}/gm) === null;
54
- return s || c({
55
- type: l.Warning,
56
- message: a("custom-fields.invalid-custom-fields")
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
57
  }), s;
58
- }, k = (e, s) => {
59
- const t = e.match(/{{([a-zA-Z0-9_\s]*)}}/gm);
60
- if (t && !u) {
61
- const n = new Set(s.map((o) => o.toLowerCase())), r = [];
62
- if (t.forEach((o) => {
63
- const i = o.slice(2, -2).trim().toLowerCase();
64
- (!n.has(i) || i === "") && r.push(i);
65
- }), r.length > 0) {
66
- const o = `
67
- <ul>
68
- ${r.map((i) => `<li>${i}</li>`).join("")}
69
- </ul>
70
- `;
71
- return c({
72
- type: l.Alert,
73
- message: a("custom-fields.invalid-custom-fields") + o
74
- }), !1;
75
- }
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;
76
69
  }
77
70
  return !0;
78
- }, T = (e) => {
79
- const s = e.match(/{%(.*?)%}/g), t = [];
71
+ }, x = (t) => {
72
+ const s = t.match(/{%(.*?)%}/g), e = [];
80
73
  let n = !0;
81
- if (s && s.forEach((r) => {
82
- const o = r.match(D), i = r.match(P), B = (o == null ? void 0 : o.join("")) || "";
83
- (!o || r !== B) && !i && (c({
84
- type: l.Alert,
85
- message: a("newsletter.display-conditions-invalid-syntax")
86
- }), n = !1), o && o.forEach((f) => {
87
- f.trim() === "=" && (c({
88
- type: l.Alert,
89
- message: a("custom-conditions.wrong-equality-operators")
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")
90
83
  }), n = !1);
91
- const g = f.match(/^[a-zA-Z]*$/g);
84
+ const g = u.match(/^[a-zA-Z]*$/g);
92
85
  g && g.forEach((p) => {
93
- w(p) && t.push(p);
86
+ w(p) && e.push(p);
94
87
  });
95
88
  });
96
- }), t.length) {
97
- const r = t.filter((i) => i === "if"), o = t.filter((i) => i === "endif");
98
- r.length !== o.length && (c({
99
- type: l.Alert,
100
- message: a("custom-conditions.missing-if-endif-tag")
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")
101
94
  }), n = !1);
102
95
  }
103
96
  return n;
104
- }, F = (e) => {
105
- const s = (e.match(/{% /gm) || []).length, t = (e.match(/ %}/gm) || []).length, n = s === t;
106
- return n || c({
107
- type: l.Warning,
108
- message: a("custom-conditions.no-space-after-braces")
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")
109
102
  }), n;
110
- }, I = (e) => (e.match(/({%(.*?)%})/g) || []).filter((t) => t.includes("if")).map((t) => (t.match(/{{.*}}/gm) || []).length).reduce((t, n) => t + n, 0) > 0 ? (c({
111
- type: l.Warning,
112
- message: a("custom-conditions.no-braces-inside-if-tag")
113
- }), !1) : !0, W = () => m.recommendationConfigs && Object.values(m.recommendationConfigs).find((s) => s.filters.find((t) => t.value === "")) !== void 0 ? (c({
114
- type: l.Alert,
115
- message: a("newsletter.fill-all-necessary-fields")
116
- }), !1) : !0, L = (e) => {
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) => {
117
110
  const s = /src="[^"]*\.(svg|pst)"/gm;
118
- return e.match(s) === null ? !0 : (c({
119
- type: l.Alert,
120
- message: a("newsletter.invalid-image-type")
111
+ return t.match(s) === null ? !0 : (a({
112
+ type: r.Alert,
113
+ message: i("newsletter.invalid-image-type")
121
114
  }), !1);
122
- }, N = (e) => {
123
- const n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".checkbox-block-v2");
124
- return Array.from(n).find((o) => {
125
- var i;
126
- return !((i = o.id) != null && i.trim());
127
- }) ? (c({
128
- type: l.Alert,
129
- message: a("unsubscribe-templates.select-checkbox-groups")
130
- }), !1) : !0;
131
- }, O = (e) => {
132
- const n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".radio-button-v2");
133
- return Array.from(n).find((o) => {
134
- var i;
135
- return !((i = o.id) != null && i.trim());
136
- }) ? (c({
137
- type: l.Alert,
138
- message: a("unsubscribe-templates.select-radio-button-groups")
139
- }), !1) : !0;
140
115
  };
141
- return { validateHtml: async (e, s, t = !1) => {
142
- const n = s.map((o) => o.value);
143
- return await b(e, n, t) && E(e) && A(e) && x(e) && k(e, n) && T(e) && F(e) && I(e) && W() && L(e) && N(e) && O(e);
144
- } };
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) };
145
117
  };
146
118
  export {
147
- se as useHtmlValidator
119
+ tt as useHtmlValidator
148
120
  };
@@ -1,12 +1,12 @@
1
- import { useSaveStart as i, useSaveComplete as m } from "./useGuidoActions.js";
2
- import { useTemplatePreparation as n } from "../utils/templatePreparation.js";
3
- import { useHtmlValidator as l } from "./useHtmlValidator.js";
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
4
  const f = () => {
5
- const e = i(), a = m(), { validateHtml: s } = l();
5
+ const e = i(), a = l(), { validateHtml: s } = n();
6
6
  return { save: async (o = !1) => {
7
7
  e();
8
- const { prepareTemplateDetails: r } = n(), t = await r();
9
- if (await s(t.compiledHtml, t.dynamicContentList, !0))
8
+ const { prepareTemplateDetails: r } = m(), t = await r();
9
+ if (await s(t.compiledHtml, [], !0))
10
10
  return o || a(t), t;
11
11
  } };
12
12
  };
@@ -1,23 +1,21 @@
1
1
  import { useActionsApi as f } from "./useActionsApi.js";
2
2
  import { useCustomInterfaceAppearance as S } from "./useCustomInterfaceAppearance.js";
3
- import { useStripoEventHandler as E } from "./useStripoEventHandler.js";
4
- import { useToaster as C } from "./useToaster.js";
3
+ import { useStripoEventHandler as C } from "./useStripoEventHandler.js";
4
+ import { useToaster as E } from "./useToaster.js";
5
5
  import { displayConditions as y } from "../enums/displayConditions.js";
6
- import h from "../extensions/Blocks/Checkbox/extension.js";
7
- import w from "../extensions/Blocks/RadioButton/extension.js";
8
- import b from "../extensions/DynamicContent/extension.js";
9
- import { useStripoApi as k } from "../services/stripoApi.js";
10
- import B from "../static/styles/customEditorStyle.css.js";
6
+ import h from "../extensions/DynamicContent/extension.js";
7
+ import { useStripoApi as w } from "../services/stripoApi.js";
8
+ import b from "../static/styles/customEditorStyle.css.js";
11
9
  import { useEditorStore as V } from "../stores/editor.js";
12
10
  import { dynamicContentToMergeTags as _ } from "../utils/genericUtil.js";
13
- const q = (s) => {
14
- const { handleError: d } = C(), { getToken: c, getCustomFonts: u } = k(), { handleEvent: l } = E(), m = (r, i = []) => {
15
- const o = V(), { html: e, css: a, forceRecreate: g } = r;
11
+ const R = (s) => {
12
+ const { handleError: d } = E(), { getToken: c, getCustomFonts: u } = w(), { handleEvent: l } = C(), p = (r, i = []) => {
13
+ const e = V(), { html: o, css: a, forceRecreate: g } = r;
16
14
  window.UIEditor.initEditor(
17
15
  document.querySelector("#guido-editor"),
18
16
  {
19
17
  metadata: s,
20
- html: e,
18
+ html: o,
21
19
  css: a,
22
20
  forceRecreate: g,
23
21
  locale: "en",
@@ -29,7 +27,7 @@ const q = (s) => {
29
27
  customAppearanceMergetags: !0,
30
28
  customAppearanceMergetagsBorderColor: "#f1f3fe",
31
29
  customAppearanceMergetagsBackgroundColor: "#f1f3fe",
32
- customViewStyles: B,
30
+ customViewStyles: b,
33
31
  conditionsEnabled: !0,
34
32
  customConditionsEnabled: !0,
35
33
  conditionCategories: y,
@@ -57,54 +55,50 @@ const q = (s) => {
57
55
  onTemplateLoaded() {
58
56
  try {
59
57
  const { importCss: t } = S(), { activateCustomViewStyles: n } = f();
60
- t(), n(), s.onReady(), o.isStripoInitialized = !0, o.loadingStatus = !1, setTimeout(() => {
61
- o.hasChanges = !1;
58
+ t(), n(), s.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
59
+ e.hasChanges = !1;
62
60
  }, 1e3);
63
61
  } catch (t) {
64
62
  d(t, "Failed to load custom interface appearance");
65
63
  }
66
64
  },
67
65
  onCodeEditorVisibilityChanged(t) {
68
- o.isCodeEditorOpen = t;
66
+ e.isCodeEditorOpen = t;
69
67
  },
70
68
  onEditorVisualModeChanged(t) {
71
- o.editorVisualMode = t.toLowerCase();
69
+ e.editorVisualMode = t.toLowerCase();
72
70
  },
73
71
  onVersionHistoryVisibilityChanged(t) {
74
- o.isVersionHistoryOpen = t;
72
+ e.isVersionHistoryOpen = t;
75
73
  },
76
74
  onDataChanged() {
77
- o.hasChanges = !0;
75
+ e.hasChanges = !0;
78
76
  },
79
77
  onEvent: l,
80
78
  ignoreClickOutsideSelectors: ["#guido-dynamic-content-modal", ".in-on-board-wrapper"],
81
- extensions: [
82
- b,
83
- h,
84
- w
85
- ]
79
+ extensions: [h]
86
80
  }
87
81
  );
88
- }, p = (r) => new Promise((i, o) => {
82
+ }, m = (r) => new Promise((i, e) => {
89
83
  if (document.getElementById("UiEditorScript")) {
90
84
  r(), i();
91
85
  return;
92
86
  }
93
- const e = document.createElement("script");
94
- e.id = "UiEditorScript", e.type = "module", e.src = "https://plugins.stripo.email/resources/uieditor/latest/UIEditor.js", e.onload = () => {
87
+ const o = document.createElement("script");
88
+ o.id = "UiEditorScript", o.type = "module", o.src = "https://plugins.stripo.email/resources/uieditor/latest/UIEditor.js", o.onload = () => {
95
89
  r(), i();
96
- }, e.onerror = () => {
90
+ }, o.onerror = () => {
97
91
  const a = new Error("Failed to load Stripo UIEditor script");
98
- o(a);
99
- }, document.body.appendChild(e);
92
+ e(a);
93
+ }, document.body.appendChild(o);
100
94
  });
101
95
  return { initPlugin: async (r) => {
102
- await p(async () => {
96
+ await m(async () => {
103
97
  const i = await u();
104
- m(r, i);
98
+ p(r, i);
105
99
  });
106
100
  } };
107
101
  };
108
102
  export {
109
- q as useStripo
103
+ R as useStripo
110
104
  };