@useinsider/guido 2.0.0-beta.c13893e → 2.0.0-beta.dd0d492

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,4 +1,4 @@
1
- import { object as o, number as p, optional as e, string as t, pipe as m, picklist as n, boolean as c, array as a, minLength as u, literal as r, custom as d, variant as S } from "../../node_modules/valibot/dist/index.js";
1
+ import { object as o, number as p, optional as e, string as t, pipe as m, picklist as n, boolean as c, array as a, minLength as u, literal as r, custom as b, variant as S } from "../../node_modules/valibot/dist/index.js";
2
2
  const i = {
3
3
  /** Promotional/marketing emails */
4
4
  PROMOTIONAL: 1,
@@ -103,7 +103,9 @@ const i = {
103
103
  /** Enable display conditions */
104
104
  displayConditions: e(c(), !0),
105
105
  /** Enable unsubscribe block */
106
- unsubscribe: e(c(), !0)
106
+ unsubscribe: e(c(), !0),
107
+ /** Disable modules panel in the editor */
108
+ modulesDisabled: e(c(), !1)
107
109
  }), f = n([
108
110
  "amp-accordion",
109
111
  "amp-carousel",
@@ -171,8 +173,8 @@ const i = {
171
173
  ...l.entries,
172
174
  type: r("custom"),
173
175
  /** Custom processor function */
174
- processor: d(
175
- (b) => typeof b == "function",
176
+ processor: b(
177
+ (d) => typeof d == "function",
176
178
  "processor must be a function"
177
179
  )
178
180
  }), B = S("type", [
@@ -1,25 +1,25 @@
1
- import { useActionsApi as b } from "./useActionsApi.js";
2
- import { useBlocksConfig as k } from "./useBlocksConfig.js";
3
- import { useConfig as T } from "./useConfig.js";
4
- import { useCustomInterfaceAppearance as V } from "./useCustomInterfaceAppearance.js";
5
- import { useStripoEventHandler as _ } from "./useStripoEventHandler.js";
6
- import { useToaster as B } from "./useToaster.js";
7
- import { displayConditions as A } from "../enums/displayConditions.js";
8
- import { useStripoApi as v } from "../services/stripoApi.js";
9
- import F from "../static/styles/customEditorStyle.css.js";
10
- import { useEditorStore as I } from "../stores/editor.js";
11
- import { dynamicContentToMergeTags as M } from "../utils/genericUtil.js";
12
- import U from "../package.json.js";
13
- const N = (c) => {
14
- const { features: g } = T(), { handleError: l } = B(), { getToken: f, getCustomFonts: y } = v(), { handleEvent: S } = _(), { getStripoBlocksConfig: C } = k(), E = async (i, r = []) => {
15
- var m;
16
- const e = I(), { html: n, css: u, forceRecreate: a } = i, { baseBlocks: t, extensions: d } = await C(), p = ((m = g.value) == null ? void 0 : m.displayConditions) ?? !0;
1
+ import { useActionsApi as T } from "./useActionsApi.js";
2
+ import { useBlocksConfig as V } from "./useBlocksConfig.js";
3
+ import { useConfig as _ } from "./useConfig.js";
4
+ import { useCustomInterfaceAppearance as B } from "./useCustomInterfaceAppearance.js";
5
+ import { useStripoEventHandler as v } from "./useStripoEventHandler.js";
6
+ import { useToaster as A } from "./useToaster.js";
7
+ import { displayConditions as F } from "../enums/displayConditions.js";
8
+ import { useStripoApi as D } from "../services/stripoApi.js";
9
+ import I from "../static/styles/customEditorStyle.css.js";
10
+ import { useEditorStore as M } from "../stores/editor.js";
11
+ import { dynamicContentToMergeTags as U } from "../utils/genericUtil.js";
12
+ import P from "../package.json.js";
13
+ const K = (c) => {
14
+ const { features: l } = _(), { handleError: u } = A(), { getToken: y, getCustomFonts: S } = D(), { handleEvent: C } = v(), { getStripoBlocksConfig: E } = V(), h = async (i, n = []) => {
15
+ var g, f;
16
+ const o = M(), { html: r, css: p, forceRecreate: a } = i, { baseBlocks: t, extensions: d } = await E(), m = ((g = l.value) == null ? void 0 : g.displayConditions) ?? !0, b = ((f = l.value) == null ? void 0 : f.modulesDisabled) ?? !1;
17
17
  window.UIEditor.initEditor(
18
18
  document.querySelector("#guido-editor"),
19
19
  {
20
20
  metadata: c,
21
- html: n,
22
- css: u,
21
+ html: r,
22
+ css: p,
23
23
  forceRecreate: a,
24
24
  locale: "en",
25
25
  undoButtonSelector: "#guido__undo-button",
@@ -30,11 +30,12 @@ const N = (c) => {
30
30
  customAppearanceMergetags: !0,
31
31
  customAppearanceMergetagsBorderColor: "#f1f3fe",
32
32
  customAppearanceMergetagsBackgroundColor: "#f1f3fe",
33
- customViewStyles: F,
34
- conditionsEnabled: p,
35
- customConditionsEnabled: p,
36
- conditionCategories: A,
33
+ customViewStyles: I,
34
+ conditionsEnabled: m,
35
+ customConditionsEnabled: m,
36
+ conditionCategories: F,
37
37
  enableXSSSecurity: !0,
38
+ modulesDisabled: b,
38
39
  messageSettingsEnabled: !0,
39
40
  displayGmailAnnotations: !0,
40
41
  displayHiddenPreheader: !1,
@@ -45,44 +46,44 @@ const N = (c) => {
45
46
  editorFonts: {
46
47
  showDefaultStandardFonts: !0,
47
48
  showDefaultNotStandardFonts: !0,
48
- customFonts: r
49
+ customFonts: n
49
50
  },
50
51
  mergeTags: [
51
52
  {
52
- entries: M(c.preselectedDynamicContentList)
53
+ entries: U(c.preselectedDynamicContentList)
53
54
  }
54
55
  ],
55
- async onTokenRefreshRequest(o) {
56
+ async onTokenRefreshRequest(e) {
56
57
  try {
57
- const s = await f();
58
- o(s);
58
+ const s = await y();
59
+ e(s);
59
60
  } catch (s) {
60
- l(s, "Failed to refresh token");
61
+ u(s, "Failed to refresh token");
61
62
  }
62
63
  },
63
64
  onTemplateLoaded() {
64
65
  try {
65
- const { importCss: o } = V(), { activateCustomViewStyles: s, updateTimerInClonedTemplate: w } = b();
66
- o(), s(), w(), c.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
67
- e.hasChanges = !1;
66
+ const { importCss: e } = B(), { activateCustomViewStyles: s, updateTimerInClonedTemplate: k } = T();
67
+ e(), s(), k(), c.onReady(), o.isStripoInitialized = !0, o.loadingStatus = !1, setTimeout(() => {
68
+ o.hasChanges = !1;
68
69
  }, 1e3);
69
- } catch (o) {
70
- l(o, "Failed to load custom interface appearance");
70
+ } catch (e) {
71
+ u(e, "Failed to load custom interface appearance");
71
72
  }
72
73
  },
73
- onCodeEditorVisibilityChanged(o) {
74
- e.isCodeEditorOpen = o;
74
+ onCodeEditorVisibilityChanged(e) {
75
+ o.isCodeEditorOpen = e;
75
76
  },
76
- onEditorVisualModeChanged(o) {
77
- e.editorVisualMode = o.toLowerCase();
77
+ onEditorVisualModeChanged(e) {
78
+ o.editorVisualMode = e.toLowerCase();
78
79
  },
79
- onVersionHistoryVisibilityChanged(o) {
80
- e.isVersionHistoryOpen = o;
80
+ onVersionHistoryVisibilityChanged(e) {
81
+ o.isVersionHistoryOpen = e;
81
82
  },
82
83
  onDataChanged() {
83
- e.hasChanges = !0;
84
+ o.hasChanges = !0;
84
85
  },
85
- onEvent: S,
86
+ onEvent: C,
86
87
  ignoreClickOutsideSelectors: [
87
88
  "#guido-dynamic-content-modal",
88
89
  ".in-on-board-wrapper",
@@ -91,26 +92,26 @@ const N = (c) => {
91
92
  extensions: d
92
93
  }
93
94
  );
94
- }, h = (i) => new Promise((r, e) => {
95
+ }, w = (i) => new Promise((n, o) => {
95
96
  var d;
96
97
  if (document.getElementById("UiEditorScript")) {
97
- i(), r();
98
+ i(), n();
98
99
  return;
99
100
  }
100
- const n = U.guido, a = `https://email-static.useinsider.com/guido/${(d = n == null ? void 0 : n.stripo) == null ? void 0 : d.version}/UIEditor.js`, t = document.createElement("script");
101
+ const r = P.guido, a = `https://email-static.useinsider.com/guido/${(d = r == null ? void 0 : r.stripo) == null ? void 0 : d.version}/UIEditor.js`, t = document.createElement("script");
101
102
  t.id = "UiEditorScript", t.type = "module", t.src = a, t.onload = () => {
102
- i(), r();
103
+ i(), n();
103
104
  }, t.onerror = () => {
104
- e(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
105
+ o(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
105
106
  }, document.body.appendChild(t);
106
107
  });
107
108
  return { initPlugin: async (i) => {
108
- await h(async () => {
109
- const r = await y();
110
- await E(i, r);
109
+ await w(async () => {
110
+ const n = await S();
111
+ await h(i, n);
111
112
  });
112
113
  } };
113
114
  };
114
115
  export {
115
- N as useStripo
116
+ K as useStripo
116
117
  };
@@ -146,6 +146,8 @@ export declare const FeaturesSchema: v.ObjectSchema<{
146
146
  readonly displayConditions: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
147
147
  /** Enable unsubscribe block */
148
148
  readonly unsubscribe: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
149
+ /** Disable modules panel in the editor */
150
+ readonly modulesDisabled: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
149
151
  }, undefined>;
150
152
  /**
151
153
  * Default block types available in Stripo
@@ -439,6 +441,8 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
439
441
  readonly displayConditions: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
440
442
  /** Enable unsubscribe block */
441
443
  readonly unsubscribe: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
444
+ /** Disable modules panel in the editor */
445
+ readonly modulesDisabled: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
442
446
  }, undefined>, {}>;
443
447
  /** Block configuration */
444
448
  readonly blocks: v.OptionalSchema<v.ObjectSchema<{
@@ -52,6 +52,7 @@ export declare const useConfig: () => {
52
52
  testMessage: boolean;
53
53
  displayConditions: boolean;
54
54
  unsubscribe: boolean;
55
+ modulesDisabled: boolean;
55
56
  };
56
57
  blocks: {
57
58
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -136,6 +137,7 @@ export declare const useConfig: () => {
136
137
  testMessage: boolean;
137
138
  displayConditions: boolean;
138
139
  unsubscribe: boolean;
140
+ modulesDisabled: boolean;
139
141
  } | null>;
140
142
  blocks: import("vue").ComputedRef<{
141
143
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -57,6 +57,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
57
57
  testMessage: boolean;
58
58
  displayConditions: boolean;
59
59
  unsubscribe: boolean;
60
+ modulesDisabled: boolean;
60
61
  };
61
62
  blocks: {
62
63
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -147,6 +148,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
147
148
  testMessage: boolean;
148
149
  displayConditions: boolean;
149
150
  unsubscribe: boolean;
151
+ modulesDisabled: boolean;
150
152
  };
151
153
  blocks: {
152
154
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -237,6 +239,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
237
239
  testMessage: boolean;
238
240
  displayConditions: boolean;
239
241
  unsubscribe: boolean;
242
+ modulesDisabled: boolean;
240
243
  };
241
244
  blocks: {
242
245
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -327,6 +330,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
327
330
  testMessage: boolean;
328
331
  displayConditions: boolean;
329
332
  unsubscribe: boolean;
333
+ modulesDisabled: boolean;
330
334
  };
331
335
  blocks: {
332
336
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -417,6 +421,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
417
421
  testMessage: boolean;
418
422
  displayConditions: boolean;
419
423
  unsubscribe: boolean;
424
+ modulesDisabled: boolean;
420
425
  };
421
426
  blocks: {
422
427
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -507,6 +512,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
507
512
  testMessage: boolean;
508
513
  displayConditions: boolean;
509
514
  unsubscribe: boolean;
515
+ modulesDisabled: boolean;
510
516
  };
511
517
  blocks: {
512
518
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -597,6 +603,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
597
603
  testMessage: boolean;
598
604
  displayConditions: boolean;
599
605
  unsubscribe: boolean;
606
+ modulesDisabled: boolean;
600
607
  };
601
608
  blocks: {
602
609
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -687,6 +694,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
687
694
  testMessage: boolean;
688
695
  displayConditions: boolean;
689
696
  unsubscribe: boolean;
697
+ modulesDisabled: boolean;
690
698
  };
691
699
  blocks: {
692
700
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -777,6 +785,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
777
785
  testMessage: boolean;
778
786
  displayConditions: boolean;
779
787
  unsubscribe: boolean;
788
+ modulesDisabled: boolean;
780
789
  };
781
790
  blocks: {
782
791
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -867,6 +876,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
867
876
  testMessage: boolean;
868
877
  displayConditions: boolean;
869
878
  unsubscribe: boolean;
879
+ modulesDisabled: boolean;
870
880
  };
871
881
  blocks: {
872
882
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -957,6 +967,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
957
967
  testMessage: boolean;
958
968
  displayConditions: boolean;
959
969
  unsubscribe: boolean;
970
+ modulesDisabled: boolean;
960
971
  };
961
972
  blocks: {
962
973
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -1047,6 +1058,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1047
1058
  testMessage: boolean;
1048
1059
  displayConditions: boolean;
1049
1060
  unsubscribe: boolean;
1061
+ modulesDisabled: boolean;
1050
1062
  };
1051
1063
  blocks: {
1052
1064
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -1137,6 +1149,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1137
1149
  testMessage: boolean;
1138
1150
  displayConditions: boolean;
1139
1151
  unsubscribe: boolean;
1152
+ modulesDisabled: boolean;
1140
1153
  };
1141
1154
  blocks: {
1142
1155
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -1227,6 +1240,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1227
1240
  testMessage: boolean;
1228
1241
  displayConditions: boolean;
1229
1242
  unsubscribe: boolean;
1243
+ modulesDisabled: boolean;
1230
1244
  };
1231
1245
  blocks: {
1232
1246
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -1317,6 +1331,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1317
1331
  testMessage: boolean;
1318
1332
  displayConditions: boolean;
1319
1333
  unsubscribe: boolean;
1334
+ modulesDisabled: boolean;
1320
1335
  };
1321
1336
  blocks: {
1322
1337
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -1407,6 +1422,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1407
1422
  testMessage: boolean;
1408
1423
  displayConditions: boolean;
1409
1424
  unsubscribe: boolean;
1425
+ modulesDisabled: boolean;
1410
1426
  };
1411
1427
  blocks: {
1412
1428
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -1497,6 +1513,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1497
1513
  testMessage: boolean;
1498
1514
  displayConditions: boolean;
1499
1515
  unsubscribe: boolean;
1516
+ modulesDisabled: boolean;
1500
1517
  };
1501
1518
  blocks: {
1502
1519
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -32,16 +32,6 @@ ue-stripe-thumb:hover:not(.disabled),
32
32
  padding: 0 16px 16px;
33
33
  grid-row-gap: 16px;
34
34
  }
35
-
36
- /* TODO: will be removed after we find another way to hide stripo custom modules */
37
- #moduleTab_tab1,
38
- button[aria-label="Default Modules"],
39
- button[aria-controls="moduleTab_tab1_content"],
40
- #moduleTab_tab2,
41
- button[aria-label="Pre-Built AMP"],
42
- button[aria-controls="moduleTab_tab2_content"] {
43
- display: none !important;
44
- }
45
35
  `;
46
36
  export {
47
37
  o as default
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "2.0.0-beta.c13893e",
3
+ "version": "2.0.0-beta.dd0d492",
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",