@useinsider/guido 3.21.2-beta.b6f3ef8 → 3.21.2-beta.ccc7173

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.
@@ -1,55 +1,44 @@
1
- import { useActionsApi as H } from "./useActionsApi.js";
2
- import { useBlocksConfig as N } from "./useBlocksConfig.js";
3
- import { useConfig as j } from "./useConfig.js";
4
- import { useCustomInterfaceAppearance as _ } from "./useCustomInterfaceAppearance.js";
5
- import { useEditorOpenMetrics as z } from "./useEditorOpenMetrics.js";
6
- import { useFullStoryBridge as $ } from "./useFullStoryBridge.js";
7
- import { useModuleRepair as G } from "./useModuleRepair.js";
8
- import { useStripoEventHandler as X } from "./useStripoEventHandler.js";
9
- import { useStripoNotifications as J } from "./useStripoNotifications.js";
10
- import { useToaster as K } from "./useToaster.js";
11
- import { localePatch as Q } from "../config/i18n/index.js";
12
- import { en as B } from "../config/i18n/en/index.js";
13
- import { ToasterTypeOptions as W } from "../enums/toaster.js";
14
- import { useStripoApi as Y } from "../services/stripoApi.js";
15
- import Z from "../static/styles/customEditorStyle.css.js";
16
- import { useEditorStore as M } from "../stores/editor.js";
17
- import { buildMergeTagEntries as ee, flattenDynamicContentList as te } from "../utils/genericUtil.js";
18
- import { getStripoRuntimeBaseUrl as oe } from "../utils/stripoRuntime.js";
19
- let d = null, v = !1;
20
- const be = () => {
21
- const { features: u, template: m, isFeatureEnabled: p } = j(), { handleError: f, showToaster: T } = K(), { getToken: F, getCustomFonts: A, getSyncModulesStatus: P } = Y(), { handleEvent: R } = X(), { handleModuleAdd: U } = G(), { getStripoBlocksConfig: V } = N(), { getStripoNotifications: D } = J(), e = z(), g = () => d || (d = new Promise((s, a) => {
1
+ import { useActionsApi as L } from "./useActionsApi.js";
2
+ import { useBlocksConfig as O } from "./useBlocksConfig.js";
3
+ import { useConfig as H } from "./useConfig.js";
4
+ import { useCustomInterfaceAppearance as w } from "./useCustomInterfaceAppearance.js";
5
+ import { useFullStoryBridge as N } from "./useFullStoryBridge.js";
6
+ import { useModuleRepair as j } from "./useModuleRepair.js";
7
+ import { useStripoEventHandler as z } from "./useStripoEventHandler.js";
8
+ import { useStripoNotifications as $ } from "./useStripoNotifications.js";
9
+ import { useToaster as G } from "./useToaster.js";
10
+ import { localePatch as J } from "../config/i18n/index.js";
11
+ import { en as b } from "../config/i18n/en/index.js";
12
+ import { ToasterTypeOptions as X } from "../enums/toaster.js";
13
+ import { useStripoApi as K } from "../services/stripoApi.js";
14
+ import Q from "../static/styles/customEditorStyle.css.js";
15
+ import { useEditorStore as k } from "../stores/editor.js";
16
+ import { buildMergeTagEntries as W, flattenDynamicContentList as Y } from "../utils/genericUtil.js";
17
+ import Z from "../package.json.js";
18
+ let n = null;
19
+ const he = () => {
20
+ const { features: c, template: u, isFeatureEnabled: p } = H(), { handleError: m, showToaster: v } = G(), { getToken: B, getCustomFonts: M, getSyncModulesStatus: T } = K(), { handleEvent: F } = z(), { handleModuleAdd: A } = j(), { getStripoBlocksConfig: V } = O(), { getStripoNotifications: _ } = $(), f = () => n || (n = new Promise((r, s) => {
21
+ var d;
22
22
  if (document.getElementById("UiEditorScript")) {
23
- s();
23
+ r();
24
24
  return;
25
25
  }
26
- const i = oe();
27
- if (!i) {
28
- a(
29
- new Error("guido.stripo.version is not set in package.json. Please configure the Stripo version.")
30
- );
31
- return;
32
- }
33
- const n = `${i}UIEditor.js`, t = document.createElement("script");
34
- t.id = "UiEditorScript", t.type = "module", t.src = n, t.onload = () => {
35
- v = !0, s();
36
- }, t.onerror = () => {
37
- t.remove(), a(new Error(`Failed to load Stripo UIEditor script from S3: ${n}`));
38
- }, document.body.appendChild(t);
39
- }), d.catch(() => {
40
- d = null;
41
- }), d), I = async (s, a, i, n = [], t = !1) => {
42
- var C, w, k, b;
43
- const o = M(), { html: c, css: S } = s, { baseBlocks: y, extensions: L } = await V();
44
- e.mark("blocks_config_ready");
45
- const E = ((C = u.value) == null ? void 0 : C.displayConditions) ?? !0, O = ((w = u.value) == null ? void 0 : w.modulesDisabled) ?? !1, h = !!c || (((k = m.value) == null ? void 0 : k.forceRecreate) ?? !1), q = "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com";
46
- e.setTemplate({ html: c, css: S, forceRecreate: h }), _().importCss(), e.mark("init_editor"), await window.UIEditor.initEditor(
26
+ const o = Z.guido, i = `https://email-static.useinsider.com/guido/${(d = o == null ? void 0 : o.stripo) == null ? void 0 : d.version}/UIEditor.js`, e = document.createElement("script");
27
+ e.id = "UiEditorScript", e.type = "module", e.src = i, e.onload = () => r(), e.onerror = () => {
28
+ e.remove(), s(new Error(`Failed to load Stripo UIEditor script from S3: ${i}`));
29
+ }, document.body.appendChild(e);
30
+ }), n.catch(() => {
31
+ n = null;
32
+ }), n), D = async (r, s, o, a = [], i = !1) => {
33
+ var y, E, h, C;
34
+ const e = k(), { html: d, css: P } = r, { baseBlocks: g, extensions: R } = await V(), S = ((y = c.value) == null ? void 0 : y.displayConditions) ?? !0, U = ((E = c.value) == null ? void 0 : E.modulesDisabled) ?? !1, I = !!d || (((h = u.value) == null ? void 0 : h.forceRecreate) ?? !1), q = "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com";
35
+ w().importCss(), await window.UIEditor.initEditor(
47
36
  document.querySelector("#guido-editor"),
48
37
  {
49
- metadata: a,
50
- html: c,
51
- css: S,
52
- forceRecreate: h,
38
+ metadata: s,
39
+ html: d,
40
+ css: P,
41
+ forceRecreate: I,
53
42
  locale: "en",
54
43
  undoButtonSelector: "#guido__undo-button",
55
44
  redoButtonSelector: "#guido__redo-button",
@@ -59,12 +48,12 @@ const be = () => {
59
48
  customAppearanceMergetags: !p("liquidSyntax"),
60
49
  customAppearanceMergetagsBorderColor: "#f1f3fe",
61
50
  customAppearanceMergetagsBackgroundColor: "#f1f3fe",
62
- customViewStyles: Z,
63
- conditionsEnabled: E,
64
- customConditionsEnabled: E,
51
+ customViewStyles: Q,
52
+ conditionsEnabled: S,
53
+ customConditionsEnabled: S,
65
54
  enableXSSSecurity: !0,
66
- modulesDisabled: O,
67
- syncModulesEnabled: t,
55
+ modulesDisabled: U,
56
+ syncModulesEnabled: i,
68
57
  messageSettingsEnabled: !0,
69
58
  displayGmailAnnotations: !0,
70
59
  displayHiddenPreheader: !1,
@@ -75,55 +64,54 @@ const be = () => {
75
64
  selectElementAfterDrop: !0,
76
65
  sameFontSizeForOutlook: !0,
77
66
  allowedScriptSourceDomains: q,
78
- ...y ? { baseBlocks: y } : {},
67
+ ...g ? { baseBlocks: g } : {},
79
68
  editorFonts: {
80
69
  showDefaultStandardFonts: !0,
81
70
  showDefaultNotStandardFonts: !0,
82
- customFonts: n
71
+ customFonts: a
83
72
  },
84
73
  mergeTags: [
85
74
  {
86
- entries: ee(
87
- i.preselectedDynamicContentList,
88
- te((b = m.value) == null ? void 0 : b.dynamicContentList),
75
+ entries: W(
76
+ o.preselectedDynamicContentList,
77
+ Y((C = u.value) == null ? void 0 : C.dynamicContentList),
89
78
  p("liquidSyntax")
90
79
  )
91
80
  }
92
81
  ],
93
- async onTokenRefreshRequest(r) {
82
+ async onTokenRefreshRequest(t) {
94
83
  try {
95
- e.mark("token_start");
96
- const l = await F();
97
- e.mark("token_end"), r(l);
84
+ const l = await B();
85
+ t(l);
98
86
  } catch (l) {
99
- f(l, "Failed to refresh token");
87
+ m(l, "Failed to refresh token");
100
88
  }
101
89
  },
102
90
  onTemplateLoaded() {
103
91
  try {
104
- const { activateCustomViewStyles: r, updateTimerInClonedTemplate: l } = H(), { injectFullStory: x } = $();
105
- _().importCss(), r(), x(), l(), i.onReady(), o.isStripoInitialized = !0, o.loadingStatus = !1, setTimeout(() => {
106
- o.hasChanges = !1;
107
- }, 1e3), e.markReady();
108
- } catch (r) {
109
- f(r, "Failed to load custom interface appearance");
92
+ const { activateCustomViewStyles: t, updateTimerInClonedTemplate: l } = L(), { injectFullStory: x } = N();
93
+ w().importCss(), t(), x(), l(), o.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
94
+ e.hasChanges = !1;
95
+ }, 1e3);
96
+ } catch (t) {
97
+ m(t, "Failed to load custom interface appearance");
110
98
  }
111
99
  },
112
- onCodeEditorVisibilityChanged(r) {
113
- o.isCodeEditorOpen = r;
100
+ onCodeEditorVisibilityChanged(t) {
101
+ e.isCodeEditorOpen = t;
114
102
  },
115
- onEditorVisualModeChanged(r) {
116
- o.editorVisualMode = r.toLowerCase();
103
+ onEditorVisualModeChanged(t) {
104
+ e.editorVisualMode = t.toLowerCase();
117
105
  },
118
- onVersionHistoryVisibilityChanged(r) {
119
- o.isVersionHistoryOpen = r;
106
+ onVersionHistoryVisibilityChanged(t) {
107
+ e.isVersionHistoryOpen = t;
120
108
  },
121
109
  onDataChanged() {
122
- o.hasChanges = !0, o.changeSeq += 1;
110
+ e.hasChanges = !0, e.changeSeq += 1;
123
111
  },
124
- onEvent: R,
125
- onModuleAdd: U,
126
- notifications: D(),
112
+ onEvent: F,
113
+ onModuleAdd: A,
114
+ notifications: _(),
127
115
  // Stripo deselects the block on any click outside the canvas, so every surface
128
116
  // that belongs to the block's own flow has to be listed here (SD-153273).
129
117
  ignoreClickOutsideSelectors: [
@@ -133,35 +121,35 @@ const be = () => {
133
121
  ".in-modal-v2-wrapper",
134
122
  ".in-toasts-wrapper"
135
123
  ],
136
- extensions: L,
137
- localePatch: Q
124
+ extensions: R,
125
+ localePatch: J
138
126
  }
139
127
  );
140
128
  };
141
- return { initPlugin: async (s, a, i) => {
142
- const n = M();
129
+ return { initPlugin: async (r, s, o) => {
130
+ const a = k();
143
131
  try {
144
- e.mark("plugin_start"), e.setScriptPreloaded(v), await g(), e.mark("script_ready");
145
- const [t, o] = await Promise.all([
146
- A(),
147
- P()
132
+ await f();
133
+ const [i, e] = await Promise.all([
134
+ M(),
135
+ T()
148
136
  ]);
149
- e.mark("fonts_sync_ready"), n.syncModulesEnabled = o, await I(s, a, i, t, o);
137
+ a.syncModulesEnabled = e, await D(r, s, o, i, e);
150
138
  } catch {
151
- n.loadingStatus = !1, T({
152
- type: W.Error,
153
- message: B["An error has occurred. Please report the error code to support."],
139
+ a.loadingStatus = !1, v({
140
+ type: X.Error,
141
+ message: b["An error has occurred. Please report the error code to support."],
154
142
  actionButton: {
155
- text: B["Reload page"],
143
+ text: b["Reload page"],
156
144
  onClick: () => window.location.reload()
157
145
  }
158
- }), e.markFailed();
146
+ });
159
147
  }
160
148
  }, preloadRuntime: () => {
161
- g().catch(() => {
149
+ f().catch(() => {
162
150
  });
163
151
  } };
164
152
  };
165
153
  export {
166
- be as useStripo
154
+ he as useStripo
167
155
  };
package/dist/guido.css CHANGED
@@ -1 +1 @@
1
- @charset "UTF-8";.auth-error-modal[data-v-b4d7ae51]{position:relative;z-index:145}.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-b8f24f34] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-baf7a5dd]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.validation-error-list[data-v-e48cebe9]{gap:16px}.validation-error-row[data-v-e48cebe9]{gap:8px;padding:24px;border:1px solid #E1E1E1;border-radius:8px}.validation-error-row__icon[data-v-e48cebe9]{flex-shrink:0;font-size:24px;line-height:0}.validation-error-row__text[data-v-e48cebe9]{font-size:13px;line-height:16px;color:#292929;word-break:break-word}.guido-editor__wrapper[data-v-1a3ddd48]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-1a3ddd48]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-1a3ddd48]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-91a26acd]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-91a26acd]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-91a26acd]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-91a26acd]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-91a26acd]{object-fit:cover;transform:scale(1)}[data-v-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-cf946232]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-cf946232]{min-height:504px}.iframe-wrapper[data-v-f255b2bb]{width:258px}.iframe-scaled[data-v-f255b2bb]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-f16f20f8] .vueperslides__bullets{pointer-events:none!important}[data-v-f16f20f8] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-bb3cca55] .vueperslides__bullets{pointer-events:none!important}[data-v-bb3cca55] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-19d8cb42] .vueperslides__bullets,[data-v-ec2027ff] .vueperslides__bullets,[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd]{width:100%;max-width:none}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-skeleton{width:100%!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-dropdown-box__container{width:413px}.assign-strategy-drawer .spaced-dot-sep{background-image:linear-gradient(90deg,#91949f 20%,#fff0 0);background-position:center bottom;background-repeat:repeat-x;background-size:5px 1px}.assign-strategy-drawer .spaced-dot-sep--top{background-position:center top}.assign-strategy-drawer .spaced-dot-sep--fc-n:first-child{background:none}.legacy-strategy-updated-modal[data-v-da2225a1]{position:relative;z-index:145}
1
+ @charset "UTF-8";.auth-error-modal[data-v-b4d7ae51]{position:relative;z-index:145}.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-b8f24f34] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-baf7a5dd]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.validation-error-list[data-v-e48cebe9]{gap:16px}.validation-error-row[data-v-e48cebe9]{gap:8px;padding:24px;border:1px solid #E1E1E1;border-radius:8px}.validation-error-row__icon[data-v-e48cebe9]{flex-shrink:0;font-size:24px;line-height:0}.validation-error-row__text[data-v-e48cebe9]{font-size:13px;line-height:16px;color:#292929;word-break:break-word}.guido-editor__wrapper[data-v-c5146fc5]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-c5146fc5]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-c5146fc5]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-bdc41157]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-bdc41157]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-bdc41157]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-bdc41157]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-bdc41157]{object-fit:cover;transform:scale(1)}[data-v-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-cf946232]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-cf946232]{min-height:504px}.iframe-wrapper[data-v-f255b2bb]{width:258px}.iframe-scaled[data-v-f255b2bb]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-f16f20f8] .vueperslides__bullets{pointer-events:none!important}[data-v-f16f20f8] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-bb3cca55] .vueperslides__bullets{pointer-events:none!important}[data-v-bb3cca55] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-19d8cb42] .vueperslides__bullets,[data-v-ec2027ff] .vueperslides__bullets,[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd]{width:100%;max-width:none}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-skeleton{width:100%!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-dropdown-box__container{width:413px}.assign-strategy-drawer .spaced-dot-sep{background-image:linear-gradient(90deg,#91949f 20%,#fff0 0);background-position:center bottom;background-repeat:repeat-x;background-size:5px 1px}.assign-strategy-drawer .spaced-dot-sep--top{background-position:center top}.assign-strategy-drawer .spaced-dot-sep--fc-n:first-child{background:none}.legacy-strategy-updated-modal[data-v-da2225a1]{position:relative;z-index:145}
package/dist/library.js CHANGED
@@ -1,22 +1,20 @@
1
1
  import { default as a } from "./components/Guido.vue.js";
2
- import { MessageType as t, ProductType as f } from "./@types/config/schemas.js";
2
+ import { MessageType as t, ProductType as d } from "./@types/config/schemas.js";
3
3
  import "./@types/config/defaults.js";
4
- import { getValidationErrors as p, isValidConfig as s, parseConfig as m, parseConfigSafe as g, validateConfig as n } from "./@types/config/validator.js";
5
- import { assignTrackingIds as l, readTrackFloor as x, readTrackSeq as c } from "./utils/linkTrackingIds.js";
4
+ import { getValidationErrors as s, isValidConfig as p, parseConfig as g, parseConfigSafe as m, validateConfig as n } from "./@types/config/validator.js";
5
+ import { assignTrackingIds as u, readTrackFloor as x, readTrackSeq as T } from "./utils/linkTrackingIds.js";
6
6
  import { useGuidoEmailEditorStore as C } from "./stores/guido-email-editor.js";
7
- import { prefetchGuidoRuntime as E } from "./utils/runtimePrefetch.js";
8
7
  export {
9
8
  a as Guido,
10
9
  t as MessageType,
11
- f as ProductType,
12
- l as assignTrackingIds,
13
- p as getValidationErrors,
14
- s as isValidConfig,
15
- m as parseConfig,
16
- g as parseConfigSafe,
17
- E as prefetchGuidoRuntime,
10
+ d as ProductType,
11
+ u as assignTrackingIds,
12
+ s as getValidationErrors,
13
+ p as isValidConfig,
14
+ g as parseConfig,
15
+ m as parseConfigSafe,
18
16
  x as readTrackFloor,
19
- c as readTrackSeq,
17
+ T as readTrackSeq,
20
18
  C as useGuidoEmailEditorStore,
21
19
  n as validateConfig
22
20
  };
@@ -1,9 +1,7 @@
1
- const o = "3.21.2-beta.b6f3ef8", s = { stripo: { version: "2.81.1" } }, e = {
2
- version: o,
3
- guido: s
1
+ const o = { stripo: { version: "2.81.1" } }, s = {
2
+ guido: o
4
3
  };
5
4
  export {
6
- e as default,
7
- s as guido,
8
- o as version
5
+ s as default,
6
+ o as guido
9
7
  };
@@ -4,6 +4,5 @@ export { validateConfig, parseConfig, parseConfigSafe, isValidConfig, getValidat
4
4
  export { assignTrackingIds, readTrackFloor, readTrackSeq } from './public/trackingIds';
5
5
  export { useGuidoEmailEditorStore } from './public/editorState';
6
6
  export type { GuidoEmailEditorState } from './public/editorState';
7
- export { prefetchGuidoRuntime } from './public/prefetchRuntime';
8
7
  export type { StripoEventType } from './@types/events';
9
8
  export type { PositionData, DynamicContentEvent, MergeTagClickEvent, MergeTag, BaseDynamicContent, DynamicContentNode, DynamicContentList, TooltipOptions, TextValueObject, L10n, } from './@types/generic';
@@ -26,6 +26,7 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
26
26
  createdAt: string;
27
27
  updatedAt: string;
28
28
  status: number;
29
+ isDefault?: boolean | undefined;
29
30
  }[];
30
31
  selectedTemplates: Record<number, number>;
31
32
  selectedUnsubscribePages: number[];
@@ -51,6 +52,7 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
51
52
  createdAt: string;
52
53
  updatedAt: string;
53
54
  status: number;
55
+ isDefault?: boolean | undefined;
54
56
  }[];
55
57
  selectedTemplates: Record<number, number>;
56
58
  selectedUnsubscribePages: number[];
@@ -76,6 +78,7 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
76
78
  createdAt: string;
77
79
  updatedAt: string;
78
80
  status: number;
81
+ isDefault?: boolean | undefined;
79
82
  }[];
80
83
  selectedTemplates: Record<number, number>;
81
84
  selectedUnsubscribePages: number[];
@@ -99,6 +102,7 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
99
102
  createdAt: string;
100
103
  updatedAt: string;
101
104
  status: number;
105
+ isDefault?: boolean | undefined;
102
106
  }[];
103
107
  getThumbnailByTemplateId: (state: {
104
108
  templates: {
@@ -113,6 +117,7 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
113
117
  createdAt: string;
114
118
  updatedAt: string;
115
119
  status: number;
120
+ isDefault?: boolean | undefined;
116
121
  }[];
117
122
  selectedTemplates: Record<number, number>;
118
123
  selectedUnsubscribePages: number[];
@@ -138,6 +143,7 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
138
143
  createdAt: string;
139
144
  updatedAt: string;
140
145
  status: number;
146
+ isDefault?: boolean | undefined;
141
147
  }[];
142
148
  selectedTemplates: Record<number, number>;
143
149
  selectedUnsubscribePages: number[];
@@ -163,6 +169,7 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
163
169
  createdAt: string;
164
170
  updatedAt: string;
165
171
  status: number;
172
+ isDefault?: boolean | undefined;
166
173
  }[];
167
174
  selectedTemplates: Record<number, number>;
168
175
  selectedUnsubscribePages: number[];
@@ -188,6 +195,7 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
188
195
  createdAt: string;
189
196
  updatedAt: string;
190
197
  status: number;
198
+ isDefault?: boolean | undefined;
191
199
  }[];
192
200
  selectedTemplates: Record<number, number>;
193
201
  selectedUnsubscribePages: number[];
@@ -213,6 +221,7 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
213
221
  createdAt: string;
214
222
  updatedAt: string;
215
223
  status: number;
224
+ isDefault?: boolean | undefined;
216
225
  }[];
217
226
  selectedTemplates: Record<number, number>;
218
227
  selectedUnsubscribePages: number[];
@@ -238,6 +247,7 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
238
247
  createdAt: string;
239
248
  updatedAt: string;
240
249
  status: number;
250
+ isDefault?: boolean | undefined;
241
251
  }[];
242
252
  selectedTemplates: Record<number, number>;
243
253
  selectedUnsubscribePages: number[];
@@ -1,23 +1,27 @@
1
- import { TYPE_COLLECTIONS as i, PAGE_TYPES as p } from "../enums/unsubscribe.js";
1
+ import { TYPE_COLLECTIONS as c, PAGE_TYPES as r } from "../enums/unsubscribe.js";
2
2
  import { useUnsubscribeApi as d } from "../services/unsubscribeApi.js";
3
3
  import { defineStore as u } from "pinia";
4
4
  let o = null;
5
- const r = () => ({
5
+ const p = () => ({
6
6
  templates: [],
7
7
  selectedTemplates: {},
8
8
  selectedUnsubscribePages: [],
9
- selectedCollectionType: p.GLOBAL_UNSUBSCRIBE,
10
- activeType: p.GLOBAL_UNSUBSCRIBE,
9
+ selectedCollectionType: r.GLOBAL_UNSUBSCRIBE,
10
+ activeType: r.GLOBAL_UNSUBSCRIBE,
11
11
  pageSelectionUpdateStatus: !1,
12
12
  pageSelectionDrawerStatus: !1,
13
13
  typeSelectionDrawerStatus: !1,
14
14
  isGlobalUnsubscribeDisabled: !1,
15
15
  isSubscriptionPreferencesCenterDisabled: !1,
16
16
  pendingBlockId: null
17
- }), b = u("guidoUnsubscribe", {
18
- state: () => r(),
17
+ });
18
+ function h(e) {
19
+ return [...e].sort((t, l) => +!!l.isDefault - +!!t.isDefault);
20
+ }
21
+ const f = u("guidoUnsubscribe", {
22
+ state: () => p(),
19
23
  getters: {
20
- getSelectedCollection: (e) => i[e.selectedCollectionType],
24
+ getSelectedCollection: (e) => c[e.selectedCollectionType],
21
25
  getSelectedTemplateByActiveType: (e) => e.selectedTemplates[e.activeType],
22
26
  getTemplatesByActiveType: (e) => e.templates.filter((t) => t.type === e.activeType),
23
27
  getThumbnailByTemplateId: (e) => (t) => {
@@ -25,31 +29,31 @@ const r = () => ({
25
29
  return ((l = e.templates.find((s) => s.id === t)) == null ? void 0 : l.thumbnail) ?? "";
26
30
  },
27
31
  getSelectedUnsubscribePagesByCollection: (e) => (t) => {
28
- const l = i[t];
32
+ const l = c[t];
29
33
  if (!l)
30
34
  return [];
31
35
  const s = /* @__PURE__ */ new Map();
32
36
  e.templates.forEach((n) => {
33
37
  s.set(n.id, n.type);
34
38
  });
35
- const c = new Set(l);
39
+ const i = new Set(l);
36
40
  return e.selectedUnsubscribePages.filter((n) => {
37
41
  const a = s.get(n);
38
- return a !== void 0 && c.has(a);
42
+ return a !== void 0 && i.has(a);
39
43
  });
40
44
  },
41
45
  isActiveTypeFirstInCollection: (e) => {
42
- const t = i[e.selectedCollectionType] ?? [];
46
+ const t = c[e.selectedCollectionType] ?? [];
43
47
  return e.activeType === t[0];
44
48
  },
45
49
  isActiveTypeLastInCollection: (e) => {
46
- const t = i[e.selectedCollectionType] ?? [];
50
+ const t = c[e.selectedCollectionType] ?? [];
47
51
  return e.activeType === t[t.length - 1];
48
52
  },
49
53
  hasTemplatesByCollectionType: (e) => {
50
54
  const t = {};
51
- return (i[e.selectedCollectionType] ?? []).forEach((s) => {
52
- t[s] = e.templates.some((c) => c.type === s);
55
+ return (c[e.selectedCollectionType] ?? []).forEach((s) => {
56
+ t[s] = e.templates.some((i) => i.type === s);
53
57
  }), t;
54
58
  },
55
59
  unsubscribePagesStatus: (e) => e.selectedUnsubscribePages.length > 0
@@ -58,7 +62,7 @@ const r = () => ({
58
62
  $reset() {
59
63
  const { templates: e, selectedUnsubscribePages: t } = this;
60
64
  Object.assign(this, {
61
- ...r(),
65
+ ...p(),
62
66
  templates: e,
63
67
  selectedUnsubscribePages: t
64
68
  });
@@ -66,28 +70,28 @@ const r = () => ({
66
70
  async fetchTemplates(e = !1) {
67
71
  !e && this.templates.length || ((e || !o) && (o = (async () => {
68
72
  const { getUnsubscribePages: t } = d();
69
- this.templates = await t();
73
+ this.templates = h(await t());
70
74
  })().finally(() => {
71
75
  o = null;
72
76
  })), await o);
73
77
  },
74
78
  setCollection(e) {
75
79
  this.selectedCollectionType = e;
76
- const t = i[e];
80
+ const t = c[e];
77
81
  if (t && t.length > 0) {
78
82
  [this.activeType] = t;
79
83
  const l = { ...this.selectedTemplates };
80
84
  t.forEach((s) => {
81
85
  if (!l[s]) {
82
- const c = this.templates.find((n) => n.type === s);
83
- c && (l[s] = c.id);
86
+ const i = this.templates.find((n) => n.type === s);
87
+ i && (l[s] = i.id);
84
88
  }
85
89
  }), this.selectedTemplates = l;
86
90
  }
87
91
  },
88
92
  setCollectionWithoutAutoSelection(e) {
89
93
  this.selectedCollectionType = e;
90
- const t = i[e];
94
+ const t = c[e];
91
95
  t && t.length > 0 && ([this.activeType] = t);
92
96
  },
93
97
  setSelectedTemplate(e) {
@@ -107,12 +111,12 @@ const r = () => ({
107
111
  loadSelectedTemplates(e) {
108
112
  const t = new Map(this.templates.map((s) => [s.id, s.type])), l = { ...this.selectedTemplates };
109
113
  e.forEach((s) => {
110
- const c = t.get(s);
111
- c !== void 0 && (l[c] = s);
114
+ const i = t.get(s);
115
+ i !== void 0 && (l[i] = s);
112
116
  }), this.selectedTemplates = l;
113
117
  },
114
118
  getSelectedTemplatesByCollection(e) {
115
- const t = i[e], l = [];
119
+ const t = c[e], l = [];
116
120
  return t.forEach((s) => {
117
121
  this.selectedTemplates[s] && l.push(this.selectedTemplates[s]);
118
122
  }), l;
@@ -129,5 +133,5 @@ const r = () => ({
129
133
  }
130
134
  });
131
135
  export {
132
- b as useUnsubscribeStore
136
+ f as useUnsubscribeStore
133
137
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.21.2-beta.b6f3ef8",
3
+ "version": "3.21.2-beta.ccc7173",
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",
@@ -22,10 +22,6 @@
22
22
  "types": "./dist/src/public/editorState.d.ts",
23
23
  "import": "./dist/public/editorState.js"
24
24
  },
25
- "./prefetch": {
26
- "types": "./dist/src/public/prefetchRuntime.d.ts",
27
- "import": "./dist/public/prefetchRuntime.js"
28
- },
29
25
  "./style": "./dist/guido.css"
30
26
  },
31
27
  "scripts": {
@@ -49,7 +45,6 @@
49
45
  "coverage:e2e:report": "nyc report --reporter=lcov --reporter=text-summary --report-dir=coverage/e2e",
50
46
  "test:mutation": "stryker run",
51
47
  "test:mutation:since": "CHANGED=$(git diff --name-only --diff-filter=AMR origin/develop...HEAD -- 'src/**/*.ts' ':(glob)src/components/organisms/onboarding/**/*.vue' ':(glob)src/components/organisms/header/**/*.vue' ':(glob)src/components/organisms/unsubscribe/**/*.vue' ':(glob)src/components/organisms/save-as-template/**/*.vue' ':(glob)src/components/organisms/email-preview/**/*.vue' ':(glob)src/components/wrappers/**/*.vue' 'src/components/Guido.vue' ':(exclude)src/**/*.test.ts' ':(exclude)src/**/index.ts' ':(exclude)src/@types/**' ':(exclude)src/enums/**' ':(exclude)src/mock/**' ':(exclude)src/**/_Boilerplate/**' | paste -sd, -); if [ -n \"$CHANGED\" ]; then stryker run --incremental --mutate \"$CHANGED\"; else echo \"No changed mutatable src files vs origin/develop\"; fi",
52
- "stripo:manifest": "node scripts/stripo-runtime-manifest.mjs",
53
48
  "prepare": "husky",
54
49
  "preinstall": "rm -rf ./node_modules/.vite"
55
50
  },