@useinsider/guido 1.0.0-beta.c99b3ab → 1.0.0-beta.cf41937

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 (149) hide show
  1. package/README.md +26 -2
  2. package/dist/@types/generic.d.ts +27 -0
  3. package/dist/components/Guido.vue.d.ts +5 -2
  4. package/dist/components/Guido.vue.js +9 -9
  5. package/dist/components/Guido.vue2.js +50 -37
  6. package/dist/components/organisms/email-preview/PreviewContainer.vue.js +19 -0
  7. package/dist/components/organisms/email-preview/PreviewContainer.vue2.js +19 -0
  8. package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.d.ts +4 -0
  9. package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.js +22 -0
  10. package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue2.js +30 -0
  11. package/dist/components/organisms/email-preview/amp/AmpToggle.vue.d.ts +2 -0
  12. package/dist/components/organisms/email-preview/amp/AmpToggle.vue.js +19 -0
  13. package/dist/components/organisms/email-preview/amp/AmpToggle.vue2.js +29 -0
  14. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.d.ts +2 -0
  15. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +22 -0
  16. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +31 -0
  17. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.d.ts +2 -0
  18. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.js +17 -0
  19. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue2.js +20 -0
  20. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.d.ts +2 -0
  21. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +18 -0
  22. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +25 -0
  23. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.d.ts +4 -0
  24. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +19 -0
  25. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue2.js +23 -0
  26. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.d.ts +4 -0
  27. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.js +20 -0
  28. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue2.js +21 -0
  29. package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.d.ts +2 -0
  30. package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.js +17 -0
  31. package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue2.js +22 -0
  32. package/dist/components/organisms/header/MiddleSlot.vue.js +9 -9
  33. package/dist/components/organisms/header/MiddleSlot.vue2.js +16 -17
  34. package/dist/components/organisms/header/RightSlot.vue.js +11 -10
  35. package/dist/components/organisms/header/RightSlot.vue2.js +26 -24
  36. package/dist/components/organisms/header/ViewOptions.vue.js +8 -8
  37. package/dist/components/organisms/header/ViewOptions.vue2.js +30 -10
  38. package/dist/components/organisms/header/version-history/ViewOptions.vue.js +3 -3
  39. package/dist/components/organisms/header/version-history/ViewOptions.vue2.js +34 -16
  40. package/dist/components/wrappers/{WpDrawer.vue.d.ts → WpModal.vue.d.ts} +29 -27
  41. package/dist/components/wrappers/WpModal.vue.js +27 -0
  42. package/dist/components/wrappers/WpModal.vue2.js +22 -0
  43. package/dist/composables/useActionsApi.d.ts +2 -0
  44. package/dist/composables/useActionsApi.js +62 -36
  45. package/dist/composables/useCodeEditorApi.d.ts +4 -0
  46. package/dist/composables/useCodeEditorApi.js +11 -0
  47. package/dist/composables/useConfig.d.ts +4 -0
  48. package/dist/composables/useConfig.js +7 -0
  49. package/dist/composables/useDebounce.d.ts +4 -0
  50. package/dist/composables/useDebounce.js +12 -0
  51. package/dist/composables/useHtmlCompiler.js +9 -8
  52. package/dist/composables/usePreviewMode.d.ts +5 -0
  53. package/dist/composables/usePreviewMode.js +31 -0
  54. package/dist/composables/useResponsivePreview.d.ts +5 -0
  55. package/dist/composables/useResponsivePreview.js +86 -0
  56. package/dist/composables/useStripo.js +20 -18
  57. package/dist/composables/useTranslations.js +3 -2
  58. package/dist/enums/defaults.js +14 -5
  59. package/dist/enums/preview.d.ts +13 -0
  60. package/dist/enums/preview.js +23 -0
  61. package/dist/extensions/DynamicContent/dynamic-content.js +13 -15
  62. package/dist/guido.css +1 -1
  63. package/dist/node_modules/lodash-es/_Stack.js +18 -0
  64. package/dist/node_modules/lodash-es/_Uint8Array.js +5 -0
  65. package/dist/node_modules/lodash-es/_apply.js +16 -0
  66. package/dist/node_modules/lodash-es/_arrayLikeKeys.js +19 -0
  67. package/dist/node_modules/lodash-es/_assignMergeValue.js +8 -0
  68. package/dist/node_modules/lodash-es/_assignValue.js +10 -0
  69. package/dist/node_modules/lodash-es/_baseAssignValue.js +12 -0
  70. package/dist/node_modules/lodash-es/_baseCreate.js +17 -0
  71. package/dist/node_modules/lodash-es/_baseFor.js +5 -0
  72. package/dist/node_modules/lodash-es/_baseIsArguments.js +9 -0
  73. package/dist/node_modules/lodash-es/_baseIsTypedArray.js +12 -0
  74. package/dist/node_modules/lodash-es/_baseKeysIn.js +15 -0
  75. package/dist/node_modules/lodash-es/_baseMerge.js +20 -0
  76. package/dist/node_modules/lodash-es/_baseMergeDeep.js +31 -0
  77. package/dist/node_modules/lodash-es/_baseRest.js +9 -0
  78. package/dist/node_modules/lodash-es/_baseSetToString.js +14 -0
  79. package/dist/node_modules/lodash-es/_baseTimes.js +8 -0
  80. package/dist/node_modules/lodash-es/_baseUnary.js +8 -0
  81. package/dist/node_modules/lodash-es/_cloneArrayBuffer.js +8 -0
  82. package/dist/node_modules/lodash-es/_cloneBuffer.js +9 -0
  83. package/dist/node_modules/lodash-es/_cloneTypedArray.js +8 -0
  84. package/dist/node_modules/lodash-es/_copyArray.js +9 -0
  85. package/dist/node_modules/lodash-es/_copyObject.js +14 -0
  86. package/dist/node_modules/lodash-es/_createAssigner.js +15 -0
  87. package/dist/node_modules/lodash-es/_createBaseFor.js +13 -0
  88. package/dist/node_modules/lodash-es/_defineProperty.js +11 -0
  89. package/dist/node_modules/lodash-es/_getPrototype.js +5 -0
  90. package/dist/node_modules/lodash-es/_initCloneObject.js +9 -0
  91. package/dist/node_modules/lodash-es/_isIndex.js +8 -0
  92. package/dist/node_modules/lodash-es/_isIterateeCall.js +13 -0
  93. package/dist/node_modules/lodash-es/_isPrototype.js +8 -0
  94. package/dist/node_modules/lodash-es/_nativeKeysIn.js +10 -0
  95. package/dist/node_modules/lodash-es/_nodeUtil.js +11 -0
  96. package/dist/node_modules/lodash-es/_overArg.js +8 -0
  97. package/dist/node_modules/lodash-es/_overRest.js +15 -0
  98. package/dist/node_modules/lodash-es/_safeGet.js +7 -0
  99. package/dist/node_modules/lodash-es/_setToString.js +6 -0
  100. package/dist/node_modules/lodash-es/_shortOut.js +16 -0
  101. package/dist/node_modules/lodash-es/_stackClear.js +7 -0
  102. package/dist/node_modules/lodash-es/_stackDelete.js +7 -0
  103. package/dist/node_modules/lodash-es/_stackGet.js +6 -0
  104. package/dist/node_modules/lodash-es/_stackHas.js +6 -0
  105. package/dist/node_modules/lodash-es/_stackSet.js +17 -0
  106. package/dist/node_modules/lodash-es/constant.js +8 -0
  107. package/dist/node_modules/lodash-es/identity.js +6 -0
  108. package/dist/node_modules/lodash-es/isArguments.js +10 -0
  109. package/dist/node_modules/lodash-es/isArray.js +4 -0
  110. package/dist/node_modules/lodash-es/isArrayLike.js +8 -0
  111. package/dist/node_modules/lodash-es/isArrayLikeObject.js +8 -0
  112. package/dist/node_modules/lodash-es/isBuffer.js +6 -0
  113. package/dist/node_modules/lodash-es/isLength.js +7 -0
  114. package/dist/node_modules/lodash-es/isObjectLike.js +6 -0
  115. package/dist/node_modules/lodash-es/isPlainObject.js +16 -0
  116. package/dist/node_modules/lodash-es/isTypedArray.js +7 -0
  117. package/dist/node_modules/lodash-es/keysIn.js +9 -0
  118. package/dist/node_modules/lodash-es/merge.js +8 -0
  119. package/dist/node_modules/lodash-es/stubFalse.js +6 -0
  120. package/dist/node_modules/lodash-es/toPlainObject.js +8 -0
  121. package/dist/static/assets/inbox-mockup.svg.js +4 -0
  122. package/dist/static/assets/phone-mockup.svg.js +4 -0
  123. package/dist/stores/dynamic-content.d.ts +27 -0
  124. package/dist/stores/dynamic-content.js +23 -0
  125. package/dist/stores/editor.d.ts +1 -2
  126. package/dist/stores/editor.js +4 -5
  127. package/dist/stores/preview.d.ts +46 -0
  128. package/dist/stores/preview.js +53 -0
  129. package/dist/utils/arrayUtil.d.ts +1 -0
  130. package/dist/utils/arrayUtil.js +10 -0
  131. package/dist/utils/genericUtil.d.ts +2 -0
  132. package/dist/utils/genericUtil.js +7 -0
  133. package/dist/utils/tooltipUtils.d.ts +2 -0
  134. package/dist/utils/tooltipUtils.js +11 -0
  135. package/package.json +1 -2
  136. package/dist/@types/save-as-template.d.ts +0 -11
  137. package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue.js +0 -20
  138. package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +0 -58
  139. package/dist/components/wrappers/WpDrawer.vue.js +0 -25
  140. package/dist/components/wrappers/WpDrawer.vue2.js +0 -23
  141. package/dist/composables/useValidation.d.ts +0 -30
  142. package/dist/composables/useValidation.js +0 -19
  143. package/dist/composables/validators/saveAsTemplate.d.ts +0 -26
  144. package/dist/composables/validators/saveAsTemplate.js +0 -21
  145. package/dist/mock/api/template-library.d.ts +0 -2
  146. package/dist/node_modules/valibot/dist/index.js +0 -157
  147. package/dist/stores/save-as-template.d.ts +0 -25
  148. package/dist/stores/save-as-template.js +0 -44
  149. /package/dist/components/organisms/{save-as-template/SaveAsTemplateDrawer.vue.d.ts → email-preview/PreviewContainer.vue.d.ts} +0 -0
package/README.md CHANGED
@@ -57,6 +57,11 @@ export default {
57
57
  translationsPath: 'window.trans.en',
58
58
  htmlCompilerRules: [],
59
59
  ignoreDefaultHtmlCompilerRules: false,
60
+ features: {
61
+ dynamicContent: true,
62
+ saveAsTemplate: true,
63
+ versionHistory: true
64
+ }
60
65
  },
61
66
  dynamicContentModalVisible: false
62
67
  };
@@ -138,8 +143,13 @@ dynamicContent.close();
138
143
  ```typescript
139
144
  interface GuidoConfig {
140
145
  translationsPath: string;
141
- htmlCompilerRules: CompilerRule[];
142
- ignoreDefaultHtmlCompilerRules: boolean;
146
+ htmlCompilerRules?: CompilerRule[];
147
+ ignoreDefaultHtmlCompilerRules?: boolean;
148
+ features: {
149
+ dynamicContent: boolean;
150
+ saveAsTemplate: boolean;
151
+ versionHistory: boolean;
152
+ };
143
153
  }
144
154
  ```
145
155
 
@@ -148,6 +158,10 @@ interface GuidoConfig {
148
158
  | `translationsPath` | `string` | `'window.trans.en'` | JavaScript path to the translations object |
149
159
  | `htmlCompilerRules` | `CompilerRule[]` | `[]` | Additional compiler rules to apply to HTML content. See [HTML Compiler Rules](#-html-compiler-rules) section below |
150
160
  | `ignoreDefaultHtmlCompilerRules` | `boolean` | `false` | Skip default compiler rules and only use custom rules. Default rules: `src/config/compiler/htmlCompilerRules.ts` |
161
+ | `features` | `Features` | `{ dynamicContent: true, saveAsTemplate: true, versionHistory: true }` | Feature flags to enable/disable editor functionality |
162
+ | `features.dynamicContent` | `boolean` | `true` | Enable dynamic content insertion feature |
163
+ | `features.saveAsTemplate` | `boolean` | `true` | Enable save as template feature |
164
+ | `features.versionHistory` | `boolean` | `true` | Enable version history feature |
151
165
 
152
166
  ```typescript
153
167
  interface DynamicContent {
@@ -255,6 +269,11 @@ Define complex transformation logic with a custom processor function.
255
269
  ```typescript
256
270
  const guidoConfig = {
257
271
  translationsPath: 'window.trans.en',
272
+ features: {
273
+ dynamicContent: true,
274
+ saveAsTemplate: true,
275
+ versionHistory: false // Disable version history
276
+ },
258
277
  htmlCompilerRules: [
259
278
  {
260
279
  id: 'replace-domain',
@@ -283,6 +302,11 @@ const guidoConfig = {
283
302
  ```typescript
284
303
  const guidoConfig = {
285
304
  translationsPath: 'window.trans.en',
305
+ features: {
306
+ dynamicContent: true,
307
+ saveAsTemplate: true,
308
+ versionHistory: true
309
+ },
286
310
  ignoreDefaultHtmlCompilerRules: true, // Skip all default rules
287
311
  htmlCompilerRules: [
288
312
  // Only your custom rules will be applied
@@ -1,11 +1,38 @@
1
1
  import type { CompilerRule } from './html-compiler';
2
+ type Features = {
3
+ dynamicContent?: boolean;
4
+ saveAsTemplate?: boolean;
5
+ versionHistory?: boolean;
6
+ };
2
7
  export type GuidoConfig = {
3
8
  translationsPath: string;
4
9
  htmlCompilerRules?: CompilerRule[];
5
10
  ignoreDefaultHtmlCompilerRules?: boolean;
11
+ emailHeader: EmailHeader;
12
+ features?: Features;
6
13
  };
7
14
  export type DynamicContent = {
8
15
  value: string;
9
16
  text: string;
10
17
  fallback?: string;
11
18
  };
19
+ export interface EmailHeader {
20
+ senderName: string;
21
+ subject: string;
22
+ }
23
+ export interface TooltipOptions {
24
+ id: string;
25
+ dynamicPosition: boolean;
26
+ staticPosition: 'top center' | 'top left' | 'top right' | 'bottom center' | 'bottom left' | 'bottom right' | 'right center' | 'right top' | 'right bottom' | 'left center' | 'left top' | 'left bottom';
27
+ iconStatus: boolean;
28
+ offset?: {
29
+ x: number;
30
+ y: number;
31
+ };
32
+ preventXss?: boolean;
33
+ }
34
+ export type MergeTag = {
35
+ label: string;
36
+ value: string;
37
+ };
38
+ export {};
@@ -8,6 +8,7 @@ type __VLS_Props = {
8
8
  username?: string;
9
9
  html?: string;
10
10
  css?: string;
11
+ preselectedDynamicContentList: DynamicContent[];
11
12
  guidoConfig: GuidoConfig;
12
13
  };
13
14
  declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {
@@ -15,12 +16,14 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__
15
16
  insert: (data: DynamicContent) => void;
16
17
  close: () => void;
17
18
  };
18
- hasChanges: import("vue").ComputedRef<boolean>;
19
19
  }, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
20
20
  "dynamic-content:open": (detail: DynamicContent | null) => void;
21
21
  back: () => void;
22
22
  "save:start": () => void;
23
- "save:complete": (template: Omit<Template, "forceRecreate">) => void;
23
+ "save:complete": (data: {
24
+ template: Omit<Template, "forceRecreate">;
25
+ dynamicContentList: DynamicContent[];
26
+ }) => void;
24
27
  }, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
25
28
  export default _default;
26
29
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
@@ -1,18 +1,18 @@
1
1
  import o from "./Guido.vue2.js";
2
2
  /* empty css */
3
- import a from "../_virtual/_plugin-vue2_normalizer.js";
4
- var s = function() {
5
- var e = this, r = e._self._c, t = e._self._setupProxy;
6
- return r("div", { staticClass: "guido-editor__wrapper" }, [r(t.HeaderWrapper), r("div", { staticClass: "guido-editor__container", attrs: { id: "guido-editor" } }), r(t.SaveAsTemplateDrawer)], 1);
7
- }, i = [], _ = /* @__PURE__ */ a(
3
+ import t from "../_virtual/_plugin-vue2_normalizer.js";
4
+ var a = function() {
5
+ var i = this, e = i._self._c, r = i._self._setupProxy;
6
+ return e("div", { staticClass: "guido-editor__wrapper" }, [e(r.HeaderWrapper), r.previewStore.isPreviewModeOpen ? e(r.PreviewContainer) : i._e(), e("div", { directives: [{ name: "show", rawName: "v-show", value: !r.previewStore.isPreviewModeOpen, expression: "!previewStore.isPreviewModeOpen" }], staticClass: "guido-editor__container", attrs: { id: "guido-editor" } })], 1);
7
+ }, s = [], n = /* @__PURE__ */ t(
8
8
  o,
9
+ a,
9
10
  s,
10
- i,
11
11
  !1,
12
12
  null,
13
- "202b6818"
13
+ "baabdaaa"
14
14
  );
15
- const m = _.exports;
15
+ const c = n.exports;
16
16
  export {
17
- m as default
17
+ c as default
18
18
  };
@@ -1,13 +1,14 @@
1
- import { defineComponent as w, computed as D, onMounted as E } from "vue";
1
+ import { defineComponent as L, defineAsyncComponent as E, onMounted as P } from "vue";
2
2
  import { provideGuidoActions as _ } from "../composables/useGuidoActions.js";
3
3
  import { usePartner as G } from "../composables/usePartner.js";
4
4
  import { useStripo as I } from "../composables/useStripo.js";
5
- import { DefaultUsername as T, DefaultGuidoConfig as k } from "../enums/defaults.js";
6
- import P from "./organisms/header/HeaderWrapper.vue.js";
7
- import A from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
5
+ import { DefaultUsername as k, DefaultGuidoConfig as T } from "../enums/defaults.js";
6
+ import A from "./organisms/header/HeaderWrapper.vue.js";
8
7
  import { useStripoApi as N } from "../services/stripoApi.js";
9
- import { useEditorStore as x } from "../stores/editor.js";
10
- const U = /* @__PURE__ */ w({
8
+ import { useDynamicContentStore as x } from "../stores/dynamic-content.js";
9
+ import { usePreviewStore as W } from "../stores/preview.js";
10
+ import z from "../node_modules/lodash-es/merge.js";
11
+ const O = /* @__PURE__ */ L({
11
12
  __name: "Guido",
12
13
  props: {
13
14
  templateId: null,
@@ -17,25 +18,32 @@ const U = /* @__PURE__ */ w({
17
18
  username: null,
18
19
  html: null,
19
20
  css: null,
21
+ preselectedDynamicContentList: null,
20
22
  guidoConfig: null
21
23
  },
22
24
  emits: ["dynamic-content:open", "back", "save:start", "save:complete"],
23
- setup(b, { expose: S, emit: t }) {
24
- const o = b, n = x(), a = D(() => n.hasChanges), { getPartnerName: c, getProductType: s } = G(), {
25
- templateId: r,
26
- userId: i,
27
- guidoConfig: d,
28
- html: l = "",
29
- css: u = "",
30
- partnerName: m = c(),
25
+ setup(S, { expose: b, emit: t }) {
26
+ const o = S, w = E(
27
+ () => import("./organisms/email-preview/PreviewContainer.vue.js")
28
+ ), n = x(), c = o.preselectedDynamicContentList || [], { getPartnerName: i, getProductType: s } = G(), h = W(), {
29
+ templateId: a,
30
+ userId: r,
31
+ guidoConfig: m,
32
+ html: d = "",
33
+ css: l = "",
34
+ partnerName: u = i(),
31
35
  productType: p = s(),
32
- username: g = T
36
+ username: y = k
33
37
  } = o;
34
- window.GuidoConfig = {
35
- ...k,
36
- ...d
37
- };
38
- const { initPlugin: f } = I({ emailId: r, userId: i, username: g, partnerName: m, productType: p }), { getDefaultTemplate: y } = N();
38
+ window.GuidoConfig = z(T, m);
39
+ const { initPlugin: g } = I({
40
+ emailId: a,
41
+ userId: r,
42
+ username: y,
43
+ partnerName: u,
44
+ productType: p,
45
+ preselectedDynamicContentList: c
46
+ }), { getDefaultTemplate: C } = N();
39
47
  _({
40
48
  onBack: () => {
41
49
  console.debug("guido:back"), t("back");
@@ -44,40 +52,45 @@ const U = /* @__PURE__ */ w({
44
52
  console.debug("guido:save:start"), t("save:start");
45
53
  },
46
54
  onSaveComplete: (e) => {
47
- console.debug("guido:save:complete", e), t("save:complete", e);
55
+ console.debug("guido:save:complete", {
56
+ template: e,
57
+ dynamicContentList: n.getSelectedDynamicContentList
58
+ }), t("save:complete", {
59
+ template: e,
60
+ dynamicContentList: n.getSelectedDynamicContentList
61
+ });
48
62
  }
49
63
  });
50
- const v = (e) => {
51
- console.debug("dynamic-content:close", e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
52
- }, C = () => {
64
+ const f = (e) => {
65
+ console.debug("dynamic-content:close", e), n.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
66
+ }, v = () => {
53
67
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
54
68
  };
55
- return E(async () => {
69
+ return P(async () => {
56
70
  console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
57
71
  try {
58
72
  let e = {
59
- html: l,
60
- css: u,
73
+ html: d,
74
+ css: l,
61
75
  forceRecreate: !0
62
76
  // TODO: It should be false for old templates. We will communicate with Stripo
63
77
  };
64
- e.html || (e = await y()), await f(e);
78
+ e.html || (e = await C()), await g(e), n.selectedDynamicContentList = c;
65
79
  } catch (e) {
66
80
  console.error("Failed to initialize Stripo editor:", e);
67
81
  }
68
82
  document.addEventListener("dynamic-content:open", (e) => {
69
- const h = e;
70
- console.debug("dynamic-content:open", h.detail), t("dynamic-content:open", h.detail);
83
+ const D = e;
84
+ console.debug("dynamic-content:open", D.detail), t("dynamic-content:open", D.detail);
71
85
  });
72
- }), S({
86
+ }), b({
73
87
  dynamicContent: {
74
- insert: v,
75
- close: C
76
- },
77
- hasChanges: a
78
- }), { __sfc: !0, props: o, editorStore: n, hasChanges: a, getPartnerName: c, getProductType: s, templateId: r, userId: i, guidoConfig: d, html: l, css: u, partnerName: m, productType: p, username: g, emit: t, initPlugin: f, getDefaultTemplate: y, insertDynamicContent: v, closeDynamicContent: C, HeaderWrapper: P, SaveAsTemplateDrawer: A };
88
+ insert: f,
89
+ close: v
90
+ }
91
+ }), { __sfc: !0, PreviewContainer: w, dynamicContentStore: n, props: o, preselectedDynamicContentList: c, getPartnerName: i, getProductType: s, previewStore: h, templateId: a, userId: r, guidoConfig: m, html: d, css: l, partnerName: u, productType: p, username: y, emit: t, initPlugin: g, getDefaultTemplate: C, insertDynamicContent: f, closeDynamicContent: v, HeaderWrapper: A };
79
92
  }
80
93
  });
81
94
  export {
82
- U as default
95
+ O as default
83
96
  };
@@ -0,0 +1,19 @@
1
+ import i from "./PreviewContainer.vue2.js";
2
+ import o from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var t = function() {
4
+ var s = this, e = s._self._c, r = s._self._setupProxy;
5
+ return e("div", { staticClass: "d-f f-d-c h-1 b-c-5 bor-r-2 pb-5" }, [e("div", { staticClass: "f-g-1 d-f p-5 o-a g-4 min-h-600" }, [r.previewStore.isLoading ? [e("div", { staticClass: "d-f a-i-c j-c-c w-1 h-1 f-g-1" }, [e(r.InLoading, { attrs: { "color-class": "i-c-1", size: "32" } })], 1)] : [e(r.DesktopPreview, { staticClass: "f-g-1 min-w-0" }), e(r.MobilePreview, { staticClass: "f-0 min-w-a" })]], 2), r.previewStore.isAMPErrorModalVisible ? e(r.AmpErrorModal, { on: { close: function(l) {
6
+ return r.previewStore.closeErrorModal();
7
+ } } }) : s._e()], 1);
8
+ }, a = [], n = /* @__PURE__ */ o(
9
+ i,
10
+ t,
11
+ a,
12
+ !1,
13
+ null,
14
+ null
15
+ );
16
+ const d = n.exports;
17
+ export {
18
+ d as default
19
+ };
@@ -0,0 +1,19 @@
1
+ import { defineComponent as r, onMounted as t } from "vue";
2
+ import { usePreviewMode as i } from "../../../composables/usePreviewMode.js";
3
+ import { usePreviewStore as m } from "../../../stores/preview.js";
4
+ import { InLoading as n } from "@useinsider/design-system-vue";
5
+ import p from "./amp/AmpErrorModal.vue.js";
6
+ import f from "./desktop-preview/DesktopPreview.vue.js";
7
+ import s from "./mobile-preview/MobilePreview.vue.js";
8
+ const l = /* @__PURE__ */ r({
9
+ __name: "PreviewContainer",
10
+ setup(a) {
11
+ const { loadPreviewData: o } = i(), e = m();
12
+ return t(() => {
13
+ o();
14
+ }), { __sfc: !0, loadPreviewData: o, previewStore: e, InLoading: n, AmpErrorModal: p, DesktopPreview: f, MobilePreview: s };
15
+ }
16
+ });
17
+ export {
18
+ l as default
19
+ };
@@ -0,0 +1,4 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
2
+ close: () => void;
3
+ }, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
4
+ export default _default;
@@ -0,0 +1,22 @@
1
+ import s from "./AmpErrorModal.vue2.js";
2
+ /* empty css */
3
+ import a from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var n = function() {
5
+ var e = this, r = e._self._c, t = e._self._setupProxy;
6
+ return r(t.WpModal, { attrs: { id: "amp-error-modal", size: "medium", description: t.trans("email-editor.amp-validation-description"), "footer-button-options": t.footerButtonOptions, title: t.trans("email-editor.amp-validation-title") }, on: { close: function(o) {
7
+ return t.emit("close");
8
+ }, "primary-action": t.handleFixInCodeEditor } }, [r("div", { staticClass: "d-f f-d-c" }, [r("div", { staticClass: "mb-3" }, [r("div", { staticClass: "l-s-5 f-s-1 f-w-600 t-c-55 t-t-u" }, [e._v(" " + e._s(t.errorCountText) + " ")])]), r("div", { staticClass: "d-f f-d-c g-13 max-h-21-s o-y-a error-list" }, e._l(t.previewStore.ampErrors, function(o, i) {
9
+ return r(t.InOnPageMessage, { key: i, attrs: { icon: "filled-error-box", size: "medium", type: "alert", text: o } });
10
+ }), 1)])]);
11
+ }, l = [], d = /* @__PURE__ */ a(
12
+ s,
13
+ n,
14
+ l,
15
+ !1,
16
+ null,
17
+ "7a09985c"
18
+ );
19
+ const _ = d.exports;
20
+ export {
21
+ _ as default
22
+ };
@@ -0,0 +1,30 @@
1
+ import { defineComponent as p, ref as m, computed as c } from "vue";
2
+ import d from "../../../wrappers/WpModal.vue.js";
3
+ import { useCodeEditorApi as l } from "../../../../composables/useCodeEditorApi.js";
4
+ import { usePreviewMode as u } from "../../../../composables/usePreviewMode.js";
5
+ import { useTranslations as f } from "../../../../composables/useTranslations.js";
6
+ import { usePreviewStore as _ } from "../../../../stores/preview.js";
7
+ import { InOnPageMessage as g } from "@useinsider/design-system-vue";
8
+ const P = /* @__PURE__ */ p({
9
+ __name: "AmpErrorModal",
10
+ emits: ["close"],
11
+ setup(x, { emit: e }) {
12
+ const o = f(), { closePreviewMode: r } = u(), { openCodeEditor: t } = l(), n = _(), s = m({
13
+ cancelOrBackButton: {
14
+ type: "secondary",
15
+ labelText: o("campaign-builder.cancel"),
16
+ styling: "ghost"
17
+ },
18
+ primaryButton: {
19
+ type: "primary",
20
+ labelText: o("email-editor.amp-validation-fix")
21
+ }
22
+ }), i = () => {
23
+ e("close"), r(), t();
24
+ }, a = c(() => `${o("products.errors")}(${n.ampErrors.length})`);
25
+ return { __sfc: !0, emit: e, trans: o, closePreviewMode: r, openCodeEditor: t, previewStore: n, footerButtonOptions: s, handleFixInCodeEditor: i, errorCountText: a, WpModal: d, InOnPageMessage: g };
26
+ }
27
+ });
28
+ export {
29
+ P as default
30
+ };
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
+ export default _default;
@@ -0,0 +1,19 @@
1
+ import o from "./AmpToggle.vue2.js";
2
+ import n from "../../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var s = function() {
4
+ var r = this, t = r._self._c, e = r._self._setupProxy;
5
+ return t("div", [t("div", { staticClass: "d-f a-i-c ml-3" }, [t(e.InSegments, { attrs: { id: "guido__amp-toggle", "segment-list": e.segmentList, selected: e.previewStore.emailFormat }, on: { click: e.handleFormatChange } }), e.previewStore.showAMPErrorButton ? t(e.InButtonV2, { staticClass: "ml-2 d-f a-i-c b-c-11 b-c-h-11 t-c-4 t-c-h-4 i-c-4 bor-w-1 bor-s-s bor-c-11 bor-r-2", attrs: { id: "guido__amp-error-button", "left-icon": "line-error-box", type: "danger", "label-text-status": !1 }, on: { click: function(c) {
6
+ return e.previewStore.openErrorModal();
7
+ } } }) : r._e()], 1)]);
8
+ }, a = [], i = /* @__PURE__ */ n(
9
+ o,
10
+ s,
11
+ a,
12
+ !1,
13
+ null,
14
+ null
15
+ );
16
+ const d = i.exports;
17
+ export {
18
+ d as default
19
+ };
@@ -0,0 +1,29 @@
1
+ import { defineComponent as m, computed as n } from "vue";
2
+ import { useTranslations as r } from "../../../../composables/useTranslations.js";
3
+ import { usePreviewStore as i } from "../../../../stores/preview.js";
4
+ import { InButtonV2 as s, InSegments as l } from "@useinsider/design-system-vue";
5
+ const _ = /* @__PURE__ */ m({
6
+ __name: "AmpToggle",
7
+ setup(p) {
8
+ const t = i(), e = r(), o = n(() => [
9
+ {
10
+ text: e("dynamic-creatives.html"),
11
+ value: "html"
12
+ },
13
+ {
14
+ text: e("email-editor.amp-html"),
15
+ value: "AMP",
16
+ tooltipText: t.hasAMP ? "" : e("email-editor.preview-amp-unavailable-tooltip"),
17
+ position: "bottom",
18
+ align: "center",
19
+ disable: !t.hasAMP
20
+ }
21
+ ]);
22
+ return { __sfc: !0, previewStore: t, trans: e, segmentList: o, handleFormatChange: (a) => {
23
+ t.setEmailFormat(a);
24
+ }, InSegments: l, InButtonV2: s };
25
+ }
26
+ });
27
+ export {
28
+ _ as default
29
+ };
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
+ export default _default;
@@ -0,0 +1,22 @@
1
+ import o from "./DesktopPreview.vue2.js";
2
+ /* empty css */
3
+ import a from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var s = function() {
5
+ var r = this, t = r._self._c, e = r._self._setupProxy;
6
+ return t("div", { ref: "containerRef", staticStyle: { "min-height": "720px", height: "80vh" } }, [t(e.InContainer, { staticClass: "s-2 m-b-5 desktop-preview-container", attrs: { "full-width-content-status": "", "header-status": "", "border-radius": "bor-r-1", "container-type": "default", "footer-status": !1 }, scopedSlots: r._u([{ key: "headerLeftSlot", fn: function() {
7
+ return [t(e.EmailHeaderInfo)];
8
+ }, proxy: !0 }, { key: "headerRightSlot", fn: function() {
9
+ return [t(e.EmailSizeIndicator)];
10
+ }, proxy: !0 }]) }, [e.isContainerReady ? t("iframe", { staticClass: "email-iframe w-1 bor-w-0", style: { height: e.iframeHeight }, attrs: { sandbox: "allow-same-origin allow-popups allow-forms allow-scripts", srcdoc: e.previewStore.previewHtml } }) : r._e()])], 1);
11
+ }, i = [], n = /* @__PURE__ */ a(
12
+ o,
13
+ s,
14
+ i,
15
+ !1,
16
+ null,
17
+ "2dd60b0c"
18
+ );
19
+ const d = n.exports;
20
+ export {
21
+ d as default
22
+ };
@@ -0,0 +1,31 @@
1
+ import { defineComponent as d, ref as r, onMounted as h, onBeforeUnmount as v, nextTick as g } from "vue";
2
+ import { usePreviewStore as _ } from "../../../../stores/preview.js";
3
+ import { InContainer as I } from "@useinsider/design-system-vue";
4
+ import R from "./EmailHeaderInfo.vue.js";
5
+ import C from "./EmailSizeIndicator.vue.js";
6
+ const B = /* @__PURE__ */ d({
7
+ __name: "DesktopPreview",
8
+ setup(H) {
9
+ const t = r(), i = r("400px"), a = r(!1), m = _(), n = () => {
10
+ if (!t.value)
11
+ return;
12
+ const o = t.value.querySelector(".in-container");
13
+ if (!o)
14
+ return;
15
+ const u = o.getBoundingClientRect(), s = o.querySelector(".in-container__header"), f = s ? s.getBoundingClientRect().height : 0, p = u.height - f;
16
+ i.value = `${p}px`;
17
+ };
18
+ let e = null;
19
+ const c = () => {
20
+ n(), t.value && (e = new ResizeObserver(n), e.observe(t.value), g(() => {
21
+ a.value = !0;
22
+ }));
23
+ }, l = () => {
24
+ e == null || e.disconnect();
25
+ };
26
+ return h(c), v(l), { __sfc: !0, containerRef: t, iframeHeight: i, isContainerReady: a, previewStore: m, calculateIframeHeight: n, resizeObserver: e, initIframe: c, cleanIframe: l, InContainer: I, EmailHeaderInfo: R, EmailSizeIndicator: C };
27
+ }
28
+ });
29
+ export {
30
+ B as default
31
+ };
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
+ export default _default;
@@ -0,0 +1,17 @@
1
+ import e from "./EmailHeaderInfo.vue2.js";
2
+ import c from "../../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var r = function() {
4
+ var t = this, s = t._self._c, a = t._self._setupProxy;
5
+ return s("div", { staticClass: "d-f a-i-c j-c-s-b w-1" }, [s("div", { staticClass: "d-f a-i-c" }, [s("div", { staticClass: "b-c-49 bor-r-100 w-5-s h-5-s d-f a-i-c j-c-c" }, [s(a.InIcons, { attrs: { name: "line-menu-profile" } })], 1), s("div", { staticClass: "d-f f-d-c ml-2" }, [s("p", { staticClass: "t-c-53 f-w-600 f-s-1 l-h-1" }, [t._v(" " + t._s(a.senderName) + " ")]), s("p", { staticClass: "t-c-55 f-w-400 f-s-12 l-h-1" }, [t._v(" " + t._s(a.subject) + " ")])])])]);
6
+ }, i = [], n = /* @__PURE__ */ c(
7
+ e,
8
+ r,
9
+ i,
10
+ !1,
11
+ null,
12
+ null
13
+ );
14
+ const o = n.exports;
15
+ export {
16
+ o as default
17
+ };
@@ -0,0 +1,20 @@
1
+ import { defineComponent as m, computed as o } from "vue";
2
+ import { useConfig as a } from "../../../../composables/useConfig.js";
3
+ import { useTranslations as i } from "../../../../composables/useTranslations.js";
4
+ import { InIcons as c } from "@useinsider/design-system-vue";
5
+ const l = /* @__PURE__ */ m({
6
+ __name: "EmailHeaderInfo",
7
+ setup(f) {
8
+ const { config: t } = a(), n = i(), s = o(() => {
9
+ var e;
10
+ return ((e = t.emailHeader) == null ? void 0 : e.senderName) || n("settings.sender-name");
11
+ }), r = o(() => {
12
+ var e;
13
+ return ((e = t.emailHeader) == null ? void 0 : e.subject) || n("email-editor.default-subject");
14
+ });
15
+ return { __sfc: !0, config: t, trans: n, senderName: s, subject: r, InIcons: c };
16
+ }
17
+ });
18
+ export {
19
+ l as default
20
+ };
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
+ export default _default;
@@ -0,0 +1,18 @@
1
+ import i from "./EmailSizeIndicator.vue2.js";
2
+ /* empty css */
3
+ import r from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var o = function() {
5
+ var s = this, e = s._self._c, t = s._self._setupProxy;
6
+ return e("div", { staticClass: "d-f a-i-c j-c-c" }, [e(t.InProgress, { staticClass: "min-w-15-s", attrs: { id: "email-size-progress", "description-status": "", "description-position": "left", description: t.htmlSize, "max-value": t.MAX_EMAIL_SIZE_IN_KB, type: t.progress.type, value: t.progress.value } }), e(t.InTooltip, { staticClass: "d-f ml-1", attrs: { id: "email-size-tooltip", align: "center", position: "bottom", text: t.trans("email-editor.preview-design-size-tooltip") } })], 1);
7
+ }, a = [], n = /* @__PURE__ */ r(
8
+ i,
9
+ o,
10
+ a,
11
+ !1,
12
+ null,
13
+ "c2adc57d"
14
+ );
15
+ const m = n.exports;
16
+ export {
17
+ m as default
18
+ };
@@ -0,0 +1,25 @@
1
+ import { defineComponent as c, ref as n, computed as l, watch as u } from "vue";
2
+ import { useTranslations as p } from "../../../../composables/useTranslations.js";
3
+ import { usePreviewStore as _ } from "../../../../stores/preview.js";
4
+ import { InTooltip as v, InProgress as f } from "@useinsider/design-system-vue";
5
+ const S = /* @__PURE__ */ c({
6
+ __name: "EmailSizeIndicator",
7
+ setup(w) {
8
+ const t = _(), o = 102, e = n(0), s = n({
9
+ type: "success",
10
+ value: 0
11
+ }), a = l(() => `~${e.value} KB`), r = () => {
12
+ const m = new Blob([t.previewHtml]).size;
13
+ e.value = Math.round(m / 1024), s.value = {
14
+ type: e.value < o ? "success" : "warning",
15
+ value: Math.min(e.value, o)
16
+ };
17
+ }, i = p();
18
+ return u(() => t.previewHtml, () => {
19
+ r();
20
+ }, { immediate: !0 }), { __sfc: !0, previewStore: t, MAX_EMAIL_SIZE_IN_KB: o, htmlKB: e, progress: s, htmlSize: a, calculateProgress: r, trans: i, InProgress: f, InTooltip: v };
21
+ }
22
+ });
23
+ export {
24
+ S as default
25
+ };
@@ -0,0 +1,4 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
2
+ "back-to-inbox": () => void;
3
+ }, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
4
+ export default _default;
@@ -0,0 +1,19 @@
1
+ import n from "./ContentView.vue2.js";
2
+ import e from "../../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var c = function() {
4
+ var a = this, s = a._self._c, t = a._self._setupProxy;
5
+ return s("div", { staticClass: "w-1 h-1 b-c-4 d-f f-d-c" }, [s("div", { staticClass: "d-f j-c-s-b a-i-c p-2 h-6-s" }, [s("div", { staticClass: "d-f a-i-c cur-p", on: { click: function(l) {
6
+ return a.$emit("back-to-inbox");
7
+ } } }, [s(t.InIcons, { staticClass: "f-s-3 i-c-7", attrs: { name: "line-chevron-left" } }), s("span", { staticClass: "ml-2 f-s-1 f-w-400 l-h-1 t-c-7" }, [a._v(a._s(t.trans("newsletter.inbox")))])], 1), s("div", { staticClass: "d-f a-i-c" }, [s(t.InIcons, { staticClass: "i-c-52", attrs: { name: "line-chevron-down" } }), s(t.InIcons, { staticClass: "ml-1 i-c-52", attrs: { name: "line-chevron-up" } })], 1)]), s("iframe", { ref: "iframeRef", staticClass: "f-g-1 w-1 d-b b-c-4 bor-s-n", attrs: { sandbox: "allow-same-origin allow-popups allow-forms allow-scripts", srcdoc: t.previewStore.previewHtml }, on: { load: t.onLoad } })]);
8
+ }, i = [], o = /* @__PURE__ */ e(
9
+ n,
10
+ c,
11
+ i,
12
+ !1,
13
+ null,
14
+ null
15
+ );
16
+ const d = o.exports;
17
+ export {
18
+ d as default
19
+ };