@useinsider/guido 2.0.0-beta.9b144a9 → 2.0.0-beta.ac3cd4d

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 (26) hide show
  1. package/dist/@types/config/schemas.js +52 -36
  2. package/dist/components/organisms/header/RightSlot.vue2.js +10 -10
  3. package/dist/composables/useConfig.js +29 -27
  4. package/dist/composables/useSave.js +13 -11
  5. package/dist/composables/useStripo.js +51 -50
  6. package/dist/extensions/Blocks/CouponBlock/constants.js +4 -0
  7. package/dist/extensions/Blocks/CouponBlock/controls/index.js +29 -0
  8. package/dist/extensions/Blocks/CouponBlock/extension.js +5 -4
  9. package/dist/extensions/Blocks/CouponBlock/settingsPanel.js +20 -14
  10. package/dist/extensions/Blocks/CouponBlock/template.js +22 -11
  11. package/dist/extensions/Blocks/Unsubscribe/extension.js +9 -9
  12. package/dist/extensions/Blocks/controlFactories.js +122 -111
  13. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +57 -52
  14. package/dist/src/@types/config/index.d.ts +2 -2
  15. package/dist/src/@types/config/schemas.d.ts +30 -0
  16. package/dist/src/@types/config/types.d.ts +7 -1
  17. package/dist/src/composables/useConfig.d.ts +8 -0
  18. package/dist/src/extensions/Blocks/CouponBlock/constants.d.ts +14 -0
  19. package/dist/src/extensions/Blocks/CouponBlock/controls/index.d.ts +108 -0
  20. package/dist/src/extensions/Blocks/CouponBlock/template.d.ts +1 -1
  21. package/dist/src/extensions/Blocks/controlFactories.d.ts +30 -7
  22. package/dist/src/stores/config.d.ts +163 -1
  23. package/dist/static/styles/components/button.css.js +1 -1
  24. package/dist/static/styles/components/narrow-panel.css.js +0 -10
  25. package/dist/stores/config.js +7 -0
  26. package/package.json +1 -1
@@ -1,5 +1,5 @@
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";
2
- const i = {
1
+ import { object as o, number as b, optional as e, string as t, pipe as u, picklist as n, custom as d, boolean as c, array as a, minLength as p, literal as r, variant as S } from "../../node_modules/valibot/dist/index.js";
2
+ const m = {
3
3
  /** Promotional/marketing emails */
4
4
  PROMOTIONAL: 1,
5
5
  /** Transactional/system emails */
@@ -13,22 +13,22 @@ const i = {
13
13
  UNSUBSCRIBE_PAGES: 97
14
14
  }, h = o({
15
15
  /** Unique identifier for the template being edited */
16
- templateId: m(
16
+ templateId: u(
17
17
  t(),
18
- u(1, "templateId is required")
18
+ p(1, "templateId is required")
19
19
  ),
20
20
  /** Unique identifier for the user editing the template */
21
- userId: m(
21
+ userId: u(
22
22
  t(),
23
- u(1, "userId is required")
23
+ p(1, "userId is required")
24
24
  ),
25
25
  /** Optional variation ID for A/B testing */
26
26
  variationId: e(t())
27
27
  }), k = o({
28
28
  /** Partner/organization name (required) */
29
- name: m(
29
+ name: u(
30
30
  t(),
31
- u(1, "partner.name is required")
31
+ p(1, "partner.name is required")
32
32
  ),
33
33
  /** Product type identifier */
34
34
  productType: e(
@@ -41,8 +41,8 @@ const i = {
41
41
  ),
42
42
  /** Message type (promotional or transactional) */
43
43
  messageType: e(
44
- n([i.PROMOTIONAL, i.TRANSACTIONAL]),
45
- i.PROMOTIONAL
44
+ n([m.PROMOTIONAL, m.TRANSACTIONAL]),
45
+ m.PROMOTIONAL
46
46
  ),
47
47
  /** Display name for the current user */
48
48
  username: e(t(), "Guido User")
@@ -60,7 +60,7 @@ const i = {
60
60
  value: t()
61
61
  })
62
62
  )
63
- }), R = o({
63
+ }), C = o({
64
64
  /** Initial HTML content */
65
65
  html: e(t(), ""),
66
66
  /** Initial CSS content */
@@ -71,8 +71,8 @@ const i = {
71
71
  []
72
72
  ),
73
73
  /** Selected unsubscribe page IDs */
74
- selectedUnsubscribePages: e(a(p()), [])
75
- }), C = o({
74
+ selectedUnsubscribePages: e(a(b()), [])
75
+ }), R = o({
76
76
  /** Sender display name */
77
77
  senderName: e(t(), ""),
78
78
  /** Email subject line */
@@ -83,15 +83,15 @@ const i = {
83
83
  /** Path to translations object */
84
84
  translationsPath: e(t(), "window.trans.en"),
85
85
  /** Migration date for template compatibility */
86
- migrationDate: e(p(), 1759696858),
86
+ migrationDate: e(b(), 1759696858),
87
87
  /** Email header settings */
88
- emailHeader: e(C, { senderName: "", subject: "" })
88
+ emailHeader: e(R, { senderName: "", subject: "" })
89
89
  }), T = o({
90
90
  /** Whether to show the header bar */
91
91
  showHeader: e(c(), !0),
92
92
  /** Custom label for back button (if shown) */
93
93
  backButtonLabel: e(t())
94
- }), A = o({
94
+ }), f = o({
95
95
  /** Enable dynamic content insertion */
96
96
  dynamicContent: e(c(), !0),
97
97
  /** Enable save as template functionality */
@@ -103,8 +103,10 @@ const i = {
103
103
  /** Enable display conditions */
104
104
  displayConditions: e(c(), !0),
105
105
  /** Enable unsubscribe block */
106
- unsubscribe: e(c(), !0)
107
- }), f = n([
106
+ unsubscribe: e(c(), !0),
107
+ /** Disable modules panel in the editor */
108
+ modulesDisabled: e(c(), !1)
109
+ }), A = n([
108
110
  "amp-accordion",
109
111
  "amp-carousel",
110
112
  "amp-form-controls",
@@ -129,7 +131,7 @@ const i = {
129
131
  ]), E = o({
130
132
  /** Default blocks to exclude from the editor */
131
133
  excludeDefaults: e(
132
- a(f),
134
+ a(A),
133
135
  []
134
136
  ),
135
137
  /** Custom blocks to include in the editor */
@@ -143,7 +145,7 @@ const i = {
143
145
  /** Human-readable description */
144
146
  description: e(t()),
145
147
  /** Priority for rule ordering (lower = earlier) */
146
- priority: p()
148
+ priority: b()
147
149
  }), N = o({
148
150
  ...l.entries,
149
151
  type: r("replace"),
@@ -172,20 +174,31 @@ const i = {
172
174
  type: r("custom"),
173
175
  /** Custom processor function */
174
176
  processor: d(
175
- (b) => typeof b == "function",
177
+ (i) => typeof i == "function",
176
178
  "processor must be a function"
177
179
  )
178
- }), B = S("type", [
180
+ }), x = S("type", [
179
181
  N,
180
182
  O,
181
183
  L,
182
184
  v
183
- ]), P = o({
185
+ ]), B = o({
184
186
  /** Custom compiler rules to apply */
185
- customRules: e(a(B), []),
187
+ customRules: e(a(x), []),
186
188
  /** Skip default compiler rules */
187
189
  ignoreDefaultRules: e(c(), !1)
188
- }), x = o({
190
+ }), P = o({
191
+ /**
192
+ * External validation handler called before save completes.
193
+ * Return false to cancel the save operation.
194
+ */
195
+ externalValidation: e(
196
+ d(
197
+ (i) => typeof i == "function",
198
+ "externalValidation must be a function"
199
+ )
200
+ )
201
+ }), D = o({
189
202
  // Required sections
190
203
  /** Identity configuration (required) */
191
204
  identity: h,
@@ -193,37 +206,40 @@ const i = {
193
206
  partner: k,
194
207
  // Optional sections (with defaults)
195
208
  /** Template content and presets */
196
- template: e(R, {}),
209
+ template: e(C, {}),
197
210
  /** Editor settings */
198
211
  editor: e(I, {}),
199
212
  /** UI configuration */
200
213
  ui: e(T, {}),
201
214
  /** Feature toggles */
202
- features: e(A, {}),
215
+ features: e(f, {}),
203
216
  /** Block configuration */
204
217
  blocks: e(E, {}),
205
218
  /** Compiler configuration */
206
- compiler: e(P, {})
219
+ compiler: e(B, {}),
220
+ /** Callbacks and event handlers */
221
+ callbacks: e(P, {})
207
222
  });
208
223
  export {
209
224
  E as BlocksSchema,
210
- B as CompilerRuleSchema,
211
- P as CompilerSchema,
225
+ P as CallbacksSchema,
226
+ x as CompilerRuleSchema,
227
+ B as CompilerSchema,
212
228
  g as CustomBlockTypeSchema,
213
229
  v as CustomRuleSchema,
214
- f as DefaultBlockTypeSchema,
230
+ A as DefaultBlockTypeSchema,
215
231
  y as DynamicContentSchema,
216
232
  I as EditorSchema,
217
- C as EmailHeaderSchema,
218
- A as FeaturesSchema,
219
- x as GuidoConfigSchema,
233
+ R as EmailHeaderSchema,
234
+ f as FeaturesSchema,
235
+ D as GuidoConfigSchema,
220
236
  h as IdentitySchema,
221
- i as MessageType,
237
+ m as MessageType,
222
238
  k as PartnerSchema,
223
239
  s as ProductType,
224
240
  O as RegexRuleSchema,
225
241
  L as RemoveRuleSchema,
226
242
  N as ReplaceRuleSchema,
227
- R as TemplateSchema,
243
+ C as TemplateSchema,
228
244
  T as UISchema
229
245
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as H, ref as m, computed as _ } from "vue";
1
+ import { defineComponent as H, ref as c, computed as _ } from "vue";
2
2
  import { useConfig as h } from "../../../composables/useConfig.js";
3
3
  import { useExport as V } from "../../../composables/useExport.js";
4
4
  import { useTestEmailClick as x } from "../../../composables/useGuidoActions.js";
@@ -10,25 +10,25 @@ import { getTooltipOptions as O } from "../../../utils/tooltipUtils.js";
10
10
  import { InButtonV2 as A } from "@useinsider/design-system-vue";
11
11
  const J = /* @__PURE__ */ H({
12
12
  __name: "RightSlot",
13
- setup(k, { expose: c }) {
14
- const { config: u } = h(), { exportHtml: r } = V(), { save: n } = E(), { openVersionHistory: i, closeVersionHistory: a } = w(), o = C(), t = T(), e = m(!1), s = m(!1), f = x(), v = () => {
13
+ setup(k, { expose: u }) {
14
+ const { config: f } = h(), { exportHtml: r } = V(), { save: n } = E(), { openVersionHistory: i, closeVersionHistory: a } = w(), o = C(), t = T(), e = c(!1), s = c(!1), v = x(), d = () => {
15
15
  if (o.isVersionHistoryOpen) {
16
16
  a();
17
17
  return;
18
18
  }
19
19
  i();
20
- }, d = async () => {
20
+ }, y = async () => {
21
21
  e.value = !0, await r(), e.value = !1;
22
- }, y = () => {
22
+ }, S = () => {
23
23
  o.isSaveAsTemplateDrawerOpen = !0;
24
- }, S = _(() => o.isVersionHistoryOpen ? t("newsletter.close-version-history") : t("newsletter.version-history")), l = async (p) => {
24
+ }, g = _(() => o.isVersionHistoryOpen ? t("newsletter.close-version-history") : t("newsletter.version-history")), l = async (p) => {
25
25
  s.value = !0, o.loadingStatus = !0;
26
- const g = await n(p);
27
- return s.value = !1, p && (o.loadingStatus = !1), g;
26
+ const m = await n(p);
27
+ return s.value = !1, (p || !m) && (o.loadingStatus = !1), m;
28
28
  };
29
- return c({
29
+ return u({
30
30
  handleSave: l
31
- }), { __sfc: !0, config: u, exportHtml: r, save: n, openVersionHistory: i, closeVersionHistory: a, editorStore: o, trans: t, isExporting: e, isSaving: s, testEmailClick: f, handleVersionHistory: v, handleExport: d, handleSaveAs: y, versionHistoryTooltipText: S, handleSave: l, getTooltipOptions: O, InButtonV2: A };
31
+ }), { __sfc: !0, config: f, exportHtml: r, save: n, openVersionHistory: i, closeVersionHistory: a, editorStore: o, trans: t, isExporting: e, isSaving: s, testEmailClick: v, handleVersionHistory: d, handleExport: y, handleSaveAs: S, versionHistoryTooltipText: g, handleSave: l, getTooltipOptions: O, InButtonV2: A };
32
32
  }
33
33
  });
34
34
  export {
@@ -1,26 +1,27 @@
1
- import { useConfigStore as F } from "../stores/config.js";
2
- import { storeToRefs as I } from "pinia";
3
- const k = () => {
4
- const e = F(), {
1
+ import { useConfigStore as I } from "../stores/config.js";
2
+ import { storeToRefs as T } from "pinia";
3
+ const w = () => {
4
+ const e = I(), {
5
5
  config: t,
6
6
  initialized: o,
7
7
  identity: r,
8
8
  partner: i,
9
- template: n,
10
- editor: a,
9
+ template: a,
10
+ editor: n,
11
11
  ui: s,
12
- features: u,
13
- blocks: d,
14
- compiler: p,
15
- templateId: c,
12
+ features: c,
13
+ blocks: u,
14
+ compiler: d,
15
+ callbacks: l,
16
+ templateId: p,
16
17
  userId: f,
17
18
  variationId: m,
18
19
  partnerName: g,
19
- productType: l,
20
- messageType: b,
21
- username: C,
22
- showHeader: y
23
- } = I(e);
20
+ productType: b,
21
+ messageType: C,
22
+ username: y,
23
+ showHeader: E
24
+ } = T(e);
24
25
  return {
25
26
  // State refs
26
27
  config: t,
@@ -28,26 +29,27 @@ const k = () => {
28
29
  // Section refs
29
30
  identity: r,
30
31
  partner: i,
31
- template: n,
32
- editor: a,
32
+ template: a,
33
+ editor: n,
33
34
  ui: s,
34
- features: u,
35
- blocks: d,
36
- compiler: p,
35
+ features: c,
36
+ blocks: u,
37
+ compiler: d,
38
+ callbacks: l,
37
39
  // Convenience refs
38
- templateId: c,
40
+ templateId: p,
39
41
  userId: f,
40
42
  variationId: m,
41
43
  partnerName: g,
42
- productType: l,
43
- messageType: b,
44
- username: C,
45
- showHeader: y,
44
+ productType: b,
45
+ messageType: C,
46
+ username: y,
47
+ showHeader: E,
46
48
  // Methods
47
49
  getConfig: () => t.value,
48
- isFeatureEnabled: (E) => e.isFeatureEnabled(E)
50
+ isFeatureEnabled: (F) => e.isFeatureEnabled(F)
49
51
  };
50
52
  };
51
53
  export {
52
- k as useConfig
54
+ w as useConfig
53
55
  };
@@ -1,15 +1,17 @@
1
- import { useSaveStart as i, useSaveComplete as m } from "./useGuidoActions.js";
2
- import { useTemplatePreparation as n } from "../utils/templatePreparation.js";
3
- import { useHtmlValidator as l } from "./useHtmlValidator.js";
4
- const f = () => {
5
- const e = i(), a = m(), { validateHtml: s } = l();
6
- return { save: async (o = !1) => {
7
- e();
8
- const { prepareTemplateDetails: r } = n(), t = await r();
9
- if (await s(t.compiledHtml, t.dynamicContentList, !0))
10
- return o || a(t), t;
1
+ import { useConfig as l } from "./useConfig.js";
2
+ import { useSaveStart as m, useSaveComplete as c } from "./useGuidoActions.js";
3
+ import { useTemplatePreparation as d } from "../utils/templatePreparation.js";
4
+ import { useHtmlValidator as p } from "./useHtmlValidator.js";
5
+ const w = () => {
6
+ const i = m(), s = c(), { validateHtml: o } = p(), { callbacks: a } = l();
7
+ return { save: async (r = !1) => {
8
+ var e;
9
+ i();
10
+ const { prepareTemplateDetails: n } = d(), t = await n();
11
+ if (await o(t.compiledHtml, t.dynamicContentList, !0) && !((e = a.value) != null && e.externalValidation && !await a.value.externalValidation(t)))
12
+ return r || s(t), t;
11
13
  } };
12
14
  };
13
15
  export {
14
- f as useSave
16
+ w as useSave
15
17
  };
@@ -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
  };
@@ -0,0 +1,4 @@
1
+ var t = /* @__PURE__ */ ((c) => (c.TEXT_ALIGN = "coupon-block-text-align-control", c.TEXT_COLOR = "coupon-block-text-color-control", c.TEXT_SIZE = "coupon-block-text-size-control", c.TEXT_STYLE = "coupon-block-text-style-control", c.TEXT_FONT_FAMILY = "coupon-block-text-font-family-control", c.TEXT_BACKGROUND = "coupon-block-text-background-control", c.TEXT_PADDINGS = "coupon-block-text-paddings-control", c.TEXT_LINE_SPACING = "coupon-block-text-line-spacing-control", c))(t || {});
2
+ export {
3
+ t as CouponControlId
4
+ };
@@ -0,0 +1,29 @@
1
+ import { createTextAlignControl as t, createTextColorControl as e, createTextSizeControl as n, createTextStyleControl as r, createTextFontFamilyControl as T, createTextBackgroundColorControl as l, createPaddingsControl as C, createTextLineSpacingControl as c } from "../../controlFactories.js";
2
+ import { CouponControlId as o } from "../constants.js";
3
+ const i = t(
4
+ o.TEXT_ALIGN
5
+ ), E = e(
6
+ o.TEXT_COLOR
7
+ ), s = n(
8
+ o.TEXT_SIZE
9
+ ), S = r(
10
+ o.TEXT_STYLE
11
+ ), _ = T(
12
+ o.TEXT_FONT_FAMILY
13
+ ), g = l(
14
+ o.TEXT_BACKGROUND
15
+ ), X = C(
16
+ o.TEXT_PADDINGS
17
+ ), d = c(
18
+ o.TEXT_LINE_SPACING
19
+ );
20
+ export {
21
+ i as TextAlignControl,
22
+ g as TextBackgroundControl,
23
+ E as TextColorControl,
24
+ _ as TextFontFamilyControl,
25
+ d as TextLineSpacingControl,
26
+ X as TextPaddingsControl,
27
+ s as TextSizeControl,
28
+ S as TextStyleControl
29
+ };
@@ -1,8 +1,9 @@
1
1
  import { ExtensionBuilder as o } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
2
  import { CouponBlock as t } from "./block.js";
3
- import { CouponIconsRegistry as i } from "./iconsRegistry.js";
4
- import { CouponBlockSettings as n } from "./settingsPanel.js";
5
- const p = new o().addBlock(t).withSettingsPanelRegistry(n).withIconsRegistry(i).build();
3
+ import { TextAlignControl as n, TextColorControl as r, TextSizeControl as l, TextStyleControl as d, TextFontFamilyControl as e, TextBackgroundControl as i, TextPaddingsControl as C, TextLineSpacingControl as a } from "./controls/index.js";
4
+ import { CouponIconsRegistry as s } from "./iconsRegistry.js";
5
+ import { CouponBlockSettings as m } from "./settingsPanel.js";
6
+ const u = new o().addBlock(t).withSettingsPanelRegistry(m).addControl(n).addControl(r).addControl(l).addControl(d).addControl(e).addControl(i).addControl(C).addControl(a).withIconsRegistry(s).build();
6
7
  export {
7
- p as default
8
+ u as default
8
9
  };
@@ -1,24 +1,30 @@
1
- import { SettingsPanelRegistry as T, SettingsPanelTab as o, SettingsTab as O, TextControls as t } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
- import { COUPON_BLOCK_ID as N } from "./block.js";
3
- class _ extends T {
1
+ import { SettingsPanelRegistry as n, SettingsPanelTab as o, SettingsTab as t } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
+ import { COUPON_BLOCK_ID as E } from "./block.js";
3
+ import { CouponControlId as T } from "./constants.js";
4
+ class i extends n {
4
5
  registerBlockControls(e) {
5
- e[N] = [
6
+ e[E] = [
6
7
  new o(
7
- O.SETTINGS,
8
+ t.SETTINGS,
8
9
  [
9
- t.FONT_FAMILY,
10
- t.FONT_SIZE,
11
- t.FORMAT,
12
- t.FONT_COLOR,
13
- t.TEXT_BLOCK_BACKGROUND_COLOR,
14
- t.ALIGN,
15
- t.LINE_HEIGHT,
16
- t.INTERNAL_INDENTS
10
+ T.TEXT_STYLE,
11
+ T.TEXT_ALIGN,
12
+ T.TEXT_PADDINGS
13
+ ]
14
+ ),
15
+ new o(
16
+ t.STYLES,
17
+ [
18
+ T.TEXT_BACKGROUND,
19
+ T.TEXT_FONT_FAMILY,
20
+ T.TEXT_LINE_SPACING,
21
+ T.TEXT_SIZE,
22
+ T.TEXT_COLOR
17
23
  ]
18
24
  )
19
25
  ];
20
26
  }
21
27
  }
22
28
  export {
23
- _ as CouponBlockSettings
29
+ i as CouponBlockSettings
24
30
  };
@@ -1,18 +1,29 @@
1
- const o = `
2
- <td class="coupon-block ins-coupon-code esd-block-text coupon-block-v2">
3
- <p class="ins-title" contenteditable="false">{@COUPON_CODE}</p>
4
- </td>`, e = `
5
- <td
6
- class="coupon-block coupon-block-v2 ins-coupon-code esd-block-text esd-extension-block"
7
- esd-extension-block-id="coupon-block"
1
+ import { BlockType as o } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
+ import { COUPON_BLOCK_ID as e } from "./block.js";
3
+ const t = `
4
+ <${o.BLOCK_TEXT}
5
+ class="coupon-block ins-coupon-code coupon-block-v2 es-p10"
6
+ align="center"
7
+ esd-extension-block-id="${e}">
8
+ <p
9
+ path="1"
10
+ contenteditable="false"
11
+ style="font-size: 16px; color: #333333;">
12
+ <strong path="1,0">{@COUPON_CODE}</strong>
13
+ </p>
14
+ </${o.BLOCK_TEXT}>
15
+ `, l = `
16
+ <td
17
+ class="coupon-block coupon-block-v2 ins-coupon-code esd-block-text esd-extension-block"
18
+ esd-extension-block-id="${e}"
8
19
  >
9
20
  <p class="ins-title" contenteditable="false">{@COUPON_CODE}</p>
10
21
  </td>
11
22
  `;
12
- function t() {
13
- return o;
23
+ function s() {
24
+ return t;
14
25
  }
15
26
  export {
16
- e as default,
17
- t as getDefaultTemplate
27
+ l as default,
28
+ s as getDefaultTemplate
18
29
  };