@useinsider/guido 3.30.0-beta.232ea3c → 3.30.0-beta.23d415d

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.
package/README.md CHANGED
@@ -173,6 +173,7 @@ const config: GuidoConfigInput = {
173
173
  allowlistEnabled?: boolean, // Default: false - Pre-save domain-allowlist check (opt-in). Guido self-serves the block toaster (role lookup, deep-link, copy from window.trans).
174
174
  allowSaveWithErrors?: boolean, // Default: true - Allow the validation drawer's "Save and Continue" soft-save. Set false to hard-block invalid saves (transactional + unsubscribe pages).
175
175
  reusableRecommendationStrategy?: boolean, // Default: false - Assign an RRS strategy to recommendation blocks instead of per-block algorithm/filters/shuffle/product-count settings.
176
+ dynamicContentSpecialLinks?: boolean, // Default: false - List the catalogue's URL attributes (token ends in `url` or `url_<n>`) and every Call an API variable as Stripo special links (Personalization tab of the link type selector)
176
177
  legacyUnsubscribeConversion?: boolean, // Default: false - Convert legacy unsubscribe blocks that have no unsubscribe link into text blocks (on load and on module drop/copy) and show a warning modal.
177
178
  accessibilityTesting?: boolean, // Default: false - Show the Accessibility Test entry in the header kebab menu (Stripo's checker: contrast, image alternatives, colour-vision simulation) and the tab-bar onboarding tour that points at it.
178
179
  itemsPriceFormatting?: boolean, // Default: false - Items block price formatting: thousand/decimal separator + decimal count on the block root, raw price tags in the export (formatted at send time).
@@ -690,6 +691,22 @@ const closeModal = () => {
690
691
  </script>
691
692
  ```
692
693
 
694
+ ### Special links in the link type selector
695
+
696
+ Behind `features.dynamicContentSpecialLinks` (default `false`). Guido passes the `template.dynamicContentList`
697
+ catalogue to Stripo as `specialLinks`, one group per top-level category, keeping only the attributes whose
698
+ token ends in `url` or `url_<n>` (`last_visited_product_url`, `ins_apr_url_1`), each entry valued `{{token}}`.
699
+ Call an API variables are the exception: their tokens are id-based (`call_an_api_response_<id>`) and carry no
700
+ usable type, so the whole category is listed as its own group regardless of suffix. The link type dropdown of
701
+ link fields gains a **Personalization** tab with those groups and a search box; picking an entry writes the
702
+ token into the URL field and the dropdown label shows the entry's label.
703
+
704
+ - When no attribute matches (or the host passes no catalogue), `specialLinks` is not passed and the tab is not shown.
705
+ - Link fields only: the image path, alt text and button text are not covered; they keep Stripo's native
706
+ merge-tag dropdown fed by `mergeTags`.
707
+ - The list is fixed at editor init and the host picker is not involved, so nothing is added to the selected
708
+ list; `template.customFieldAttributes` must list every token for save validation.
709
+
693
710
  ### Saved-module token repair
694
711
 
695
712
  Legacy or hand-written **saved modules** may carry tokens by display label
@@ -1,5 +1,5 @@
1
1
  import { ModuleFolderDefaults as y } from "../../enums/defaults.js";
2
- import { object as o, number as c, optional as e, string as t, picklist as m, pipe as r, minLength as p, custom as k, boolean as a, array as n, transform as S, unknown as i, record as g, fallback as R, literal as u, lazy as T, looseObject as C, variant as I, union as h } from "../../node_modules/valibot/dist/index.js";
2
+ import { object as o, number as c, optional as e, string as t, picklist as m, pipe as r, minLength as p, custom as h, boolean as a, array as n, transform as S, unknown as i, record as g, fallback as R, literal as u, lazy as T, looseObject as C, variant as I, union as k } from "../../node_modules/valibot/dist/index.js";
3
3
  const b = {
4
4
  /** Promotional/marketing emails */
5
5
  PROMOTIONAL: 1,
@@ -91,7 +91,7 @@ const b = {
91
91
  /** Block ID (matches the dictionary key and the legacy HTML element id) */
92
92
  id: e(c()),
93
93
  /** Decimal places for price display (legacy data may use string or number) */
94
- decimalCount: e(h([t(), c()])),
94
+ decimalCount: e(k([t(), c()])),
95
95
  /** Pinned product IDs (empty array when filter-driven) */
96
96
  productIds: e(n(i())),
97
97
  /** Whether the block requested live products at send time */
@@ -125,7 +125,7 @@ const b = {
125
125
  /** Block type marker used by some legacy variants */
126
126
  blockType: e(t()),
127
127
  /** Size variant marker (legacy data may use string or number) */
128
- size: e(h([t(), c()])),
128
+ size: e(k([t(), c()])),
129
129
  /** Vertical responsiveness flag (legacy size=1 variants) */
130
130
  verticalResponsiveness: e(a()),
131
131
  /** Legacy "Move to next line" price placement toggle (cardPricePlacement.js) */
@@ -247,6 +247,8 @@ const b = {
247
247
  /** Allow persisting a template that still has validation errors (drawer "Save and Continue" soft-save). Host sets false for transactional + unsubscribe. */
248
248
  allowSaveWithErrors: e(a(), !0),
249
249
  reusableRecommendationStrategy: e(a(), !1),
250
+ /** List the dynamic-content catalogue as Stripo special links in the link type selector */
251
+ dynamicContentSpecialLinks: e(a(), !1),
250
252
  /** Convert linkless legacy unsubscribe blocks into text blocks and warn with a modal (opt-in) */
251
253
  legacyUnsubscribeConversion: e(a(), !1),
252
254
  /** Items block: Recommendation-style price formatting (root currency-* attrs, raw price tags). Released dark. */
@@ -320,7 +322,7 @@ const b = {
320
322
  ...d.entries,
321
323
  type: u("custom"),
322
324
  /** Custom processor function */
323
- processor: k(
325
+ processor: h(
324
326
  (s) => typeof s == "function",
325
327
  "processor must be a function"
326
328
  )
@@ -340,7 +342,7 @@ const b = {
340
342
  * Return false to cancel the save operation.
341
343
  */
342
344
  externalValidation: e(
343
- k(
345
+ h(
344
346
  (s) => typeof s == "function",
345
347
  "externalValidation must be a function"
346
348
  )
@@ -12,7 +12,7 @@ var n = function() {
12
12
  t,
13
13
  !1,
14
14
  null,
15
- "0c5f11a1"
15
+ "da8cab7f"
16
16
  );
17
17
  const u = s.exports;
18
18
  export {
@@ -1,21 +1,21 @@
1
1
  import { defineComponent as Se, defineAsyncComponent as a, ref as W, computed as l, watch as $, onMounted as he, onUnmounted as Ee } from "vue";
2
2
  import { useCortexBlueprintBridge as Ce } from "../composables/useCortexBlueprintBridge.js";
3
3
  import { useEditorLock as De } from "../composables/useEditorLock.js";
4
- import { startEditorOpenMetrics as we } from "../composables/useEditorOpenMetrics.js";
4
+ import { startEditorOpenMetrics as ke } from "../composables/useEditorOpenMetrics.js";
5
5
  import { provideGuidoActions as Te } from "../composables/useGuidoActions.js";
6
- import { useGuidoStateBridge as ke } from "../composables/useGuidoStateBridge.js";
6
+ import { useGuidoStateBridge as we } from "../composables/useGuidoStateBridge.js";
7
7
  import { usePartner as Fe } from "../composables/usePartner.js";
8
8
  import { useSaveValidationRollout as Me } from "../composables/useSaveValidationRollout.js";
9
- import { useStripo as Ie } from "../composables/useStripo.js";
10
- import { useTimerClone as Le } from "../composables/useTimerClone.js";
9
+ import { useStripo as Le } from "../composables/useStripo.js";
10
+ import { useTimerClone as Ie } from "../composables/useTimerClone.js";
11
11
  import { useToaster as Re } from "../composables/useToaster.js";
12
12
  import { useTranslations as Oe } from "../composables/useTranslations.js";
13
13
  import { migrate as Ue } from "../config/migrator/index.js";
14
14
  import { ModuleFolderDefaults as G } from "../enums/defaults.js";
15
15
  import { RIBBON_SELECTOR as Ae } from "../enums/onboarding.js";
16
16
  import { ToasterTypeOptions as Ne } from "../enums/toaster.js";
17
- import { useRecommendationExtensionStore as z, disposeStrategyPageReturnListeners as _e } from "../extensions/Blocks/Recommendation/store/recommendation.js";
18
- import { disposeUnsubscribeListeners as Pe } from "../extensions/Blocks/Unsubscribe/block.js";
17
+ import { useRecommendationExtensionStore as z, disposeStrategyPageReturnListeners as Pe } from "../extensions/Blocks/Recommendation/store/recommendation.js";
18
+ import { disposeUnsubscribeListeners as _e } from "../extensions/Blocks/Unsubscribe/block.js";
19
19
  import { disposeDisplayConditionRequest as xe } from "../extensions/DisplayConditions/bridge.js";
20
20
  import Be from "./organisms/AutoSaveController.vue.js";
21
21
  import He from "./organisms/base/AuthErrorModal.vue.js";
@@ -36,8 +36,9 @@ import { usePreviewStore as Ye } from "../stores/preview.js";
36
36
  import { useSaveValidationStore as Ze } from "../stores/save-validation.js";
37
37
  import { useTemplateStore as et } from "../stores/template.js";
38
38
  import { useUnsubscribeStore as tt } from "../stores/unsubscribe.js";
39
+ import { disposeLinkTokenPaste as ot } from "../utils/linkTokenPaste.js";
39
40
  import { readTrackFloor as K } from "../utils/linkTrackingIds.js";
40
- const Vt = /* @__PURE__ */ Se({
41
+ const $t = /* @__PURE__ */ Se({
41
42
  __name: "Guido",
42
43
  props: {
43
44
  config: null,
@@ -45,7 +46,7 @@ const Vt = /* @__PURE__ */ Se({
45
46
  },
46
47
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
47
48
  setup(j, { expose: J, emit: i }) {
48
- const c = j, r = we(), Q = a(
49
+ const c = j, r = ke(), Q = a(
49
50
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
50
51
  ), X = a(
51
52
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
@@ -61,22 +62,22 @@ const Vt = /* @__PURE__ */ Se({
61
62
  () => import("./organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.js")
62
63
  ), ne = a(
63
64
  () => import("./organisms/dynamic-content/AmbiguousDynamicContentModal.vue.js")
64
- ), y = W(), g = Qe(), w = tt(), re = q(), o = Je();
65
+ ), y = W(), g = Qe(), k = tt(), re = q(), o = Je();
65
66
  c.ready && o.init(c.config);
66
- const d = C(), ie = Ye(), p = l(() => d.hasChanges), { isTestPartner: se } = Fe(), { isEnabled: ae, loadRollout: T } = Me(), { showToaster: k } = Re(), F = Oe(), M = () => {
67
+ const d = C(), ie = Ye(), p = l(() => d.hasChanges), { isTestPartner: se } = Fe(), { isEnabled: ae, loadRollout: T } = Me(), { showToaster: w } = Re(), F = Oe(), M = () => {
67
68
  var t;
68
69
  if (d.isVersionHistoryOpen) {
69
- console.debug("guido:save:silent:blocked", { isVersionHistoryOpen: !0 }), k({
70
+ console.debug("guido:save:silent:blocked", { isVersionHistoryOpen: !0 }), w({
70
71
  type: Ne.Warning,
71
72
  message: F("email-editor.save-blocked-outside-editor")
72
73
  });
73
74
  return;
74
75
  }
75
76
  return (t = D.value) == null ? void 0 : t.saveSilent();
76
- }, I = (t) => {
77
+ }, L = (t) => {
77
78
  d.loadingStatus = t;
78
79
  };
79
- Ce(), ke();
80
+ Ce(), we();
80
81
  const b = () => {
81
82
  var t, e;
82
83
  return {
@@ -87,9 +88,9 @@ const Vt = /* @__PURE__ */ Se({
87
88
  savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || G.SAVED_MODULES,
88
89
  defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || G.DEFAULT_MODULES
89
90
  };
90
- }, { initPlugin: L, preloadRuntime: R } = Ie(r), { runExclusive: O, beginMount: U, isCurrentMount: v } = De();
91
+ }, { initPlugin: I, preloadRuntime: R } = Le(r), { runExclusive: O, beginMount: U, isCurrentMount: v } = De();
91
92
  let f = 0;
92
- const { getDefaultTemplate: A } = je(), { cloneTimersOnSave: N, hasTimerBlocks: _ } = Le(), ce = l(() => {
93
+ const { getDefaultTemplate: A } = je(), { cloneTimersOnSave: N, hasTimerBlocks: P } = Ie(), ce = l(() => {
93
94
  var t;
94
95
  return !((t = o.ui) != null && t.showHeader);
95
96
  }), de = l(() => o.isFeatureEnabled("reusableRecommendationStrategy")), me = l(() => o.externalDisplayConditions), le = l(
@@ -112,7 +113,7 @@ const Vt = /* @__PURE__ */ Se({
112
113
  console.debug("guido:test-email:click"), i("test-email:click");
113
114
  }
114
115
  });
115
- const P = (t) => {
116
+ const _ = (t) => {
116
117
  console.debug("dynamic-content:close", t), g.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
117
118
  }, x = () => {
118
119
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
@@ -140,7 +141,7 @@ const Vt = /* @__PURE__ */ Se({
140
141
  variationId: o.variationId
141
142
  });
142
143
  const e = o.template, s = (e == null ? void 0 : e.html) || "", u = (e == null ? void 0 : e.css) || "", B = (e == null ? void 0 : e.preselectedDynamicContent) || [];
143
- w.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
144
+ k.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
144
145
  const pe = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, H = o.isFeatureEnabled("linkTrackingIds"), fe = {
145
146
  partnerName: o.partnerName,
146
147
  campaignUrls: e == null ? void 0 : e.recommendationCampaignUrls,
@@ -157,14 +158,14 @@ const Vt = /* @__PURE__ */ Se({
157
158
  };
158
159
  n.html || (n = await r.timed("default_template", () => A()), n.html = await V(n.html));
159
160
  const ge = H ? K(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
160
- _(n.html) && (n.html = await r.timed("timer_clone", () => N(n.html))), H && (d.trackIdSessionFloor = Math.max(ge, K(n.html)));
161
+ P(n.html) && (n.html = await r.timed("timer_clone", () => N(n.html))), H && (d.trackIdSessionFloor = Math.max(ge, K(n.html)));
161
162
  const be = {
162
163
  preselectedDynamicContentList: B,
163
164
  onReady: () => {
164
165
  console.debug("guido:ready"), i("ready");
165
166
  }
166
167
  };
167
- f = U(), await L(n, b(), be, n.html !== s), g.selectedDynamicContentList = B;
168
+ f = U(), await I(n, b(), be, n.html !== s), g.selectedDynamicContentList = B;
168
169
  } catch (e) {
169
170
  console.error("Failed to initialize Stripo editor:", e), r.markFailed();
170
171
  }
@@ -182,8 +183,8 @@ const Vt = /* @__PURE__ */ Se({
182
183
  }
183
184
  document.addEventListener("dynamic-content:open", S);
184
185
  }), Ee(() => {
185
- if (Pe(), _e(), r.dispose(), m == null || m.disconnect(), document.removeEventListener("dynamic-content:open", S), v(f)) {
186
- xe();
186
+ if (_e(), Pe(), r.dispose(), m == null || m.disconnect(), document.removeEventListener("dynamic-content:open", S), v(f)) {
187
+ xe(), ot();
187
188
  try {
188
189
  const t = C();
189
190
  t.isStripoInitialized = !1, t.isAccessibilityTestingOpen = !1, t.imagesHidden = !1, t.colorVisionDeficiency = "";
@@ -201,15 +202,15 @@ const Vt = /* @__PURE__ */ Se({
201
202
  }), o.reset();
202
203
  }), J({
203
204
  dynamicContent: {
204
- insert: P,
205
+ insert: _,
205
206
  close: x
206
207
  },
207
208
  hasChanges: p,
208
209
  saveSilent: M,
209
- setLoading: I
210
- }), { __sfc: !0, openMetrics: r, PreviewContainer: Q, OnboardingWrapper: X, AssignStrategyDrawer: Y, RemoveStrategyModal: Z, DisplayConditionsHost: ee, autoSaveControllerRef: D, LegacyStrategyUpdatedModal: te, LegacyUnsubscribeConvertedModal: oe, AmbiguousDynamicContentModal: ne, wrapperRef: y, dynamicContentStore: g, unsubscribeStore: w, moduleDynamicContentStore: re, props: c, configStore: o, editorStore: d, previewStore: ie, hasChanges: p, isTestPartner: se, isSaveValidationEnabled: ae, loadRollout: T, showToaster: k, trans: F, saveSilent: M, setLoading: I, emit: i, buildMetadata: b, initPlugin: L, preloadRuntime: R, runExclusive: O, beginMount: U, isCurrentMount: v, mountGeneration: f, getDefaultTemplate: A, cloneTimersOnSave: N, hasTimerBlocks: _, noHeader: ce, isRrsEnabled: de, isExternalDisplayConditionsEnabled: me, isLegacyUnsubscribeConversionEnabled: le, hasAssignedStrategy: ue, insertDynamicContent: P, closeDynamicContent: x, handleDynamicContentOpen: S, ribbonObserver: m, updateRibbonOffset: h, startEditor: E, AutoSaveController: Be, AuthErrorModal: He, Toaster: Ve, FilterSelectionDrawer: We, HeaderWrapper: $e, LoadingWrapper: Ge, SaveAsTemplateDrawer: ze, UnsubscribeWrapper: qe, ValidationErrorDrawer: Ke };
210
+ setLoading: L
211
+ }), { __sfc: !0, openMetrics: r, PreviewContainer: Q, OnboardingWrapper: X, AssignStrategyDrawer: Y, RemoveStrategyModal: Z, DisplayConditionsHost: ee, autoSaveControllerRef: D, LegacyStrategyUpdatedModal: te, LegacyUnsubscribeConvertedModal: oe, AmbiguousDynamicContentModal: ne, wrapperRef: y, dynamicContentStore: g, unsubscribeStore: k, moduleDynamicContentStore: re, props: c, configStore: o, editorStore: d, previewStore: ie, hasChanges: p, isTestPartner: se, isSaveValidationEnabled: ae, loadRollout: T, showToaster: w, trans: F, saveSilent: M, setLoading: L, emit: i, buildMetadata: b, initPlugin: I, preloadRuntime: R, runExclusive: O, beginMount: U, isCurrentMount: v, mountGeneration: f, getDefaultTemplate: A, cloneTimersOnSave: N, hasTimerBlocks: P, noHeader: ce, isRrsEnabled: de, isExternalDisplayConditionsEnabled: me, isLegacyUnsubscribeConversionEnabled: le, hasAssignedStrategy: ue, insertDynamicContent: _, closeDynamicContent: x, handleDynamicContentOpen: S, ribbonObserver: m, updateRibbonOffset: h, startEditor: E, AutoSaveController: Be, AuthErrorModal: He, Toaster: Ve, FilterSelectionDrawer: We, HeaderWrapper: $e, LoadingWrapper: Ge, SaveAsTemplateDrawer: ze, UnsubscribeWrapper: qe, ValidationErrorDrawer: Ke };
211
212
  }
212
213
  });
213
214
  export {
214
- Vt as default
215
+ $t as default
215
216
  };
@@ -8,8 +8,8 @@ import { socialCompilerRules as H } from "../config/compiler/socialCompilerRules
8
8
  import { unsubscribeCompilerRules as b } from "../config/compiler/unsubscribeCompilerRules.js";
9
9
  import { createHtmlCompiler as n } from "../utils/htmlCompiler.js";
10
10
  import { computed as p } from "vue";
11
- import { useConfig as x } from "./useConfig.js";
12
- const A = /* @__PURE__ */ new Set([
11
+ import { useConfig as k } from "./useConfig.js";
12
+ const x = /* @__PURE__ */ new Set([
13
13
  // URL/tag encoding fixes — keep merge-tag and placeholder integrity intact.
14
14
  "fix-url-encoding-start",
15
15
  "fix-url-encoding-end",
@@ -31,6 +31,8 @@ const A = /* @__PURE__ */ new Set([
31
31
  "add-universal-link-flags",
32
32
  // Coupon placeholder replacement (only present when liquidSyntax is enabled).
33
33
  "liquid-coupon-code",
34
+ // Liquid only: swaps the quotes inside {{ }} of href/src values, attribute-value edit only.
35
+ "liquid-single-quote-links",
34
36
  // Pongo only: collapses line breaks inside {% %} tags, which pongo2 cannot parse in AMP either.
35
37
  "pongo-single-line-tags",
36
38
  // Editor-only attribute strip — AMP4EMAIL has no `contenteditable`, so leaving
@@ -38,29 +40,29 @@ const A = /* @__PURE__ */ new Set([
38
40
  "remove-contenteditable",
39
41
  "remove-dc-pending-marker"
40
42
  ]), M = () => {
41
- const { compiler: i, isFeatureEnabled: a, partner: u } = x(), c = p(() => {
42
- var t, l;
43
- const e = ((t = i.value) == null ? void 0 : t.customRules) || [];
43
+ const { compiler: m, isFeatureEnabled: u, partner: a } = k(), c = p(() => {
44
+ var i, l;
45
+ const e = ((i = m.value) == null ? void 0 : i.customRules) || [];
44
46
  return [
45
- ...!!((l = i.value) != null && l.ignoreDefaultRules) ? [] : d,
47
+ ...!!((l = m.value) != null && l.ignoreDefaultRules) ? [] : d,
46
48
  ...C,
47
49
  ...b,
48
50
  ...f,
49
51
  ...R,
50
52
  ...H,
51
- ...a("liquidSyntax") ? g : v,
52
- ...e.map((m, o) => ({
53
- ...m,
54
- priority: m.priority + 1e3 + o
53
+ ...u("liquidSyntax") ? g : v,
54
+ ...e.map((t, o) => ({
55
+ ...t,
56
+ priority: t.priority + 1e3 + o
55
57
  // Ensure additional rules run after default rules
56
58
  }))
57
59
  ];
58
60
  }), r = p(() => {
59
- var m;
60
- const e = c.value, s = n(e), t = n(e.filter((o) => A.has(o.id))), l = (m = u.value) == null ? void 0 : m.fallbackFont;
61
+ var t;
62
+ const e = c.value, s = n(e), i = n(e.filter((o) => x.has(o.id))), l = (t = a.value) == null ? void 0 : t.fallbackFont;
61
63
  return {
62
64
  compileHtml: (o) => s.compile(o, void 0, l),
63
- compileAmpHtml: (o) => t.compile(o, void 0, l)
65
+ compileAmpHtml: (o) => i.compile(o, void 0, l)
64
66
  };
65
67
  });
66
68
  return { compileHtml: (e) => r.value.compileHtml(e), compileAmpHtml: (e) => r.value.compileAmpHtml(e) };
@@ -1,29 +1,30 @@
1
- import { useActionsApi as j } from "./useActionsApi.js";
2
- import { useAmbiguousDynamicContent as z } from "./useAmbiguousDynamicContent.js";
3
- import { useBlocksConfig as $ } from "./useBlocksConfig.js";
4
- import { useConfig as G } from "./useConfig.js";
5
- import { useCustomInterfaceAppearance as v } from "./useCustomInterfaceAppearance.js";
6
- import { useFullStoryBridge as X } from "./useFullStoryBridge.js";
7
- import { useModuleRepair as J } from "./useModuleRepair.js";
8
- import { useStripoEventHandler as K } from "./useStripoEventHandler.js";
9
- import { useStripoNotifications as Q } from "./useStripoNotifications.js";
10
- import { useToaster as W } from "./useToaster.js";
11
- import { localePatch as Y } from "../config/i18n/index.js";
12
- import { en as B } from "../config/i18n/en/index.js";
13
- import { ToasterTypeOptions as Z } from "../enums/toaster.js";
14
- import { useStripoApi as ee } from "../services/stripoApi.js";
15
- import te from "../static/styles/customEditorStyle.css.js";
16
- import { useEditorStore as T } from "../stores/editor.js";
17
- import { buildMergeTagEntries as oe, flattenDynamicContentList as re } from "../utils/genericUtil.js";
18
- import { getStripoRuntimeBaseUrl as ie } from "../utils/stripoRuntime.js";
19
- let d = null, F = !1;
20
- const ve = (t) => {
21
- const { features: u, template: m, isFeatureEnabled: p } = G(), { handleError: f, showToaster: A } = W(), { getToken: P, getCustomFonts: R, getSyncModulesStatus: D } = ee(), { handleEvent: U } = K(), { handleModuleAdd: V } = J(), { restorePending: I } = z(), { getStripoBlocksConfig: L } = $(), { getStripoNotifications: q } = Q(), g = () => d || (d = new Promise((n, s) => {
1
+ import { useActionsApi as G } from "./useActionsApi.js";
2
+ import { useAmbiguousDynamicContent as $ } from "./useAmbiguousDynamicContent.js";
3
+ import { useBlocksConfig as X } from "./useBlocksConfig.js";
4
+ import { useConfig as J } from "./useConfig.js";
5
+ import { useCustomInterfaceAppearance as B } from "./useCustomInterfaceAppearance.js";
6
+ import { useFullStoryBridge as K } from "./useFullStoryBridge.js";
7
+ import { useModuleRepair as Q } from "./useModuleRepair.js";
8
+ import { useStripoEventHandler as W } from "./useStripoEventHandler.js";
9
+ import { useStripoNotifications as Y } from "./useStripoNotifications.js";
10
+ import { useToaster as Z } from "./useToaster.js";
11
+ import { localePatch as ee } from "../config/i18n/index.js";
12
+ import { en as F } from "../config/i18n/en/index.js";
13
+ import { ToasterTypeOptions as te } from "../enums/toaster.js";
14
+ import { useStripoApi as oe } from "../services/stripoApi.js";
15
+ import re from "../static/styles/customEditorStyle.css.js";
16
+ import { useEditorStore as A } from "../stores/editor.js";
17
+ import { buildSpecialLinkGroups as ie, buildMergeTagEntries as ne, flattenDynamicContentList as se } from "../utils/genericUtil.js";
18
+ import { listenForLinkTokenPaste as ae } from "../utils/linkTokenPaste.js";
19
+ import { getStripoRuntimeBaseUrl as de } from "../utils/stripoRuntime.js";
20
+ let d = null, P = !1;
21
+ const Pe = (t) => {
22
+ const { features: p, template: u, isFeatureEnabled: c } = J(), { handleError: f, showToaster: L } = Z(), { getToken: R, getCustomFonts: D, getSyncModulesStatus: U } = oe(), { handleEvent: V } = W(), { handleModuleAdd: I } = Q(), { restorePending: q } = $(), { getStripoBlocksConfig: x } = X(), { getStripoNotifications: O } = Y(), g = () => d || (d = new Promise((n, s) => {
22
23
  if (document.getElementById("UiEditorScript")) {
23
24
  n();
24
25
  return;
25
26
  }
26
- const i = ie();
27
+ const i = de();
27
28
  if (!i) {
28
29
  s(
29
30
  new Error("guido.stripo.version is not set in package.json. Please configure the Stripo version.")
@@ -32,38 +33,39 @@ const ve = (t) => {
32
33
  }
33
34
  const a = `${i}UIEditor.js`, e = document.createElement("script");
34
35
  e.id = "UiEditorScript", e.type = "module", e.src = a, e.onload = () => {
35
- F = !0, n();
36
+ P = !0, n();
36
37
  }, e.onerror = () => {
37
38
  e.remove(), s(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
38
39
  }, document.body.appendChild(e);
39
40
  }), d.catch(() => {
40
41
  d = null;
41
- }), d), x = async (n, s, i, a = [], e = !1, c = !1) => {
42
- var w, k, b, _;
43
- const o = T(), { html: S, css: y } = n, { baseBlocks: E, extensions: O } = await L();
42
+ }), d), H = async (n, s, i, a = [], e = !1, m = !1) => {
43
+ var w, b, _, v, T;
44
+ const o = A(), { html: S, css: y } = n, { baseBlocks: E, extensions: M } = await x();
44
45
  t.mark("blocks_config_ready");
45
- const h = ((w = u.value) == null ? void 0 : w.displayConditions) ?? !0, H = ((k = u.value) == null ? void 0 : k.modulesDisabled) ?? !1, C = c || (((b = m.value) == null ? void 0 : b.forceRecreate) ?? !1), M = "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com";
46
- t.setTemplate({ html: S, css: y, forceRecreate: C }), v().importCss(), t.mark("init_editor"), await window.UIEditor.initEditor(
46
+ const C = ((w = p.value) == null ? void 0 : w.displayConditions) ?? !0, N = ((b = p.value) == null ? void 0 : b.modulesDisabled) ?? !1, h = c("dynamicContentSpecialLinks") ? ie((_ = u.value) == null ? void 0 : _.dynamicContentList, c("liquidSyntax")) : [], k = m || (((v = u.value) == null ? void 0 : v.forceRecreate) ?? !1), j = "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com";
47
+ t.setTemplate({ html: S, css: y, forceRecreate: k }), B().importCss(), t.mark("init_editor"), await window.UIEditor.initEditor(
47
48
  document.querySelector("#guido-editor"),
48
49
  {
49
50
  metadata: s,
50
51
  html: S,
51
52
  css: y,
52
- forceRecreate: C,
53
+ forceRecreate: k,
53
54
  locale: "en",
54
55
  undoButtonSelector: "#guido__undo-button",
55
56
  redoButtonSelector: "#guido__redo-button",
56
57
  mobileViewButtonSelector: ".guido__view-option-selection-mobile",
57
58
  desktopViewButtonSelector: ".guido__view-option-selection-desktop",
58
59
  codeEditorButtonSelector: "#guido__code-button",
59
- customAppearanceMergetags: !p("liquidSyntax"),
60
+ customAppearanceMergetags: !c("liquidSyntax"),
60
61
  customAppearanceMergetagsBorderColor: "#f1f3fe",
61
62
  customAppearanceMergetagsBackgroundColor: "#f1f3fe",
62
- customViewStyles: te,
63
- conditionsEnabled: h,
64
- customConditionsEnabled: h,
63
+ ...h.length > 0 ? { specialLinks: h } : {},
64
+ customViewStyles: re,
65
+ conditionsEnabled: C,
66
+ customConditionsEnabled: C,
65
67
  enableXSSSecurity: !0,
66
- modulesDisabled: H,
68
+ modulesDisabled: N,
67
69
  syncModulesEnabled: e,
68
70
  messageSettingsEnabled: !0,
69
71
  displayGmailAnnotations: !0,
@@ -74,7 +76,7 @@ const ve = (t) => {
74
76
  copyPasteEnabled: !1,
75
77
  selectElementAfterDrop: !0,
76
78
  sameFontSizeForOutlook: !0,
77
- allowedScriptSourceDomains: M,
79
+ allowedScriptSourceDomains: j,
78
80
  ...E ? { baseBlocks: E } : {},
79
81
  editorFonts: {
80
82
  showDefaultStandardFonts: !0,
@@ -83,17 +85,17 @@ const ve = (t) => {
83
85
  },
84
86
  mergeTags: [
85
87
  {
86
- entries: oe(
88
+ entries: ne(
87
89
  i.preselectedDynamicContentList,
88
- re((_ = m.value) == null ? void 0 : _.dynamicContentList),
89
- p("liquidSyntax")
90
+ se((T = u.value) == null ? void 0 : T.dynamicContentList),
91
+ c("liquidSyntax")
90
92
  )
91
93
  }
92
94
  ],
93
95
  async onTokenRefreshRequest(r) {
94
96
  try {
95
97
  t.mark("token_start");
96
- const l = await P();
98
+ const l = await R();
97
99
  t.mark("token_end"), r(l);
98
100
  } catch (l) {
99
101
  f(l, "Failed to refresh token");
@@ -101,8 +103,8 @@ const ve = (t) => {
101
103
  },
102
104
  onTemplateLoaded() {
103
105
  try {
104
- const { activateCustomViewStyles: r, updateTimerInClonedTemplate: l } = j(), { injectFullStory: N } = X();
105
- v().importCss(), r(), N(), I(), l(), i.onReady(), o.isStripoInitialized = !0, o.loadingStatus = !1, setTimeout(() => {
106
+ const { activateCustomViewStyles: r, updateTimerInClonedTemplate: l } = G(), { injectFullStory: z } = K();
107
+ B().importCss(), r(), z(), ae(), q(), l(), i.onReady(), o.isStripoInitialized = !0, o.loadingStatus = !1, setTimeout(() => {
106
108
  o.hasChanges = !1;
107
109
  }, 1e3), t.markReady();
108
110
  } catch (r) {
@@ -121,9 +123,9 @@ const ve = (t) => {
121
123
  onDataChanged() {
122
124
  o.hasChanges = !0, o.changeSeq += 1;
123
125
  },
124
- onEvent: U,
125
- onModuleAdd: V,
126
- notifications: q(),
126
+ onEvent: V,
127
+ onModuleAdd: I,
128
+ notifications: O(),
127
129
  // Stripo deselects the block on any click outside the canvas, so every surface
128
130
  // that belongs to the block's own flow has to be listed here (SD-153273).
129
131
  ignoreClickOutsideSelectors: [
@@ -133,26 +135,26 @@ const ve = (t) => {
133
135
  ".in-modal-v2-wrapper",
134
136
  ".in-toasts-wrapper"
135
137
  ],
136
- extensions: O,
137
- localePatch: Y
138
+ extensions: M,
139
+ localePatch: ee
138
140
  }
139
141
  );
140
142
  };
141
143
  return { initPlugin: async (n, s, i, a = !1) => {
142
- const e = T();
144
+ const e = A();
143
145
  try {
144
- t.mark("plugin_start"), t.setScriptPreloaded(F), await g(), t.mark("script_ready");
145
- const [c, o] = await Promise.all([
146
- R(),
147
- D()
146
+ t.mark("plugin_start"), t.setScriptPreloaded(P), await g(), t.mark("script_ready");
147
+ const [m, o] = await Promise.all([
148
+ D(),
149
+ U()
148
150
  ]);
149
- t.mark("fonts_sync_ready"), e.syncModulesEnabled = o, await x(n, s, i, c, o, a);
151
+ t.mark("fonts_sync_ready"), e.syncModulesEnabled = o, await H(n, s, i, m, o, a);
150
152
  } catch {
151
- e.loadingStatus = !1, A({
152
- type: Z.Error,
153
- message: B["An error has occurred. Please report the error code to support."],
153
+ e.loadingStatus = !1, L({
154
+ type: te.Error,
155
+ message: F["An error has occurred. Please report the error code to support."],
154
156
  actionButton: {
155
- text: B["Reload page"],
157
+ text: F["Reload page"],
156
158
  onClick: () => window.location.reload()
157
159
  }
158
160
  }), t.markFailed();
@@ -163,5 +165,5 @@ const ve = (t) => {
163
165
  } };
164
166
  };
165
167
  export {
166
- ve as useStripo
168
+ Pe as useStripo
167
169
  };
@@ -1,15 +1,23 @@
1
- import { COUPON_PLACEHOLDER_LIQUID as e, COUPON_PLACEHOLDER_DEFAULT as i } from "../../extensions/Blocks/CouponBlock/template.js";
2
- const o = [
1
+ import { COUPON_PLACEHOLDER_LIQUID as i, COUPON_PLACEHOLDER_DEFAULT as o } from "../../extensions/Blocks/CouponBlock/template.js";
2
+ import { singleQuoteLiquidLinks as r } from "../../utils/liquidLinkQuotes.js";
3
+ const s = [
3
4
  {
4
5
  id: "liquid-coupon-code",
5
6
  description: "Replace legacy coupon placeholder with liquid syntax",
6
7
  type: "replace",
7
- search: i,
8
- replacement: e,
8
+ search: o,
9
+ replacement: i,
9
10
  replaceAll: !0,
10
11
  priority: 50
12
+ },
13
+ {
14
+ id: "liquid-single-quote-links",
15
+ description: "Replace &quot; string literals with single quotes inside {{ }} tags of href and src values",
16
+ type: "custom",
17
+ processor: (e) => r(e),
18
+ priority: 60
11
19
  }
12
20
  ];
13
21
  export {
14
- o as liquidCompilerRules
22
+ s as liquidCompilerRules
15
23
  };
@@ -1,37 +1,40 @@
1
1
  var c = Object.defineProperty;
2
- var g = (o, s, t) => s in o ? c(o, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[s] = t;
3
- var r = (o, s, t) => g(o, typeof s != "symbol" ? s + "" : s, t);
4
- import { useConfig as d } from "../../composables/useConfig.js";
5
- import { findEditorShadowRoot as m } from "../../utils/editorShadowRoot.js";
6
- import { mergeTagToDynamicContent as u, dynamicContentToMergeTags as h } from "../../utils/genericUtil.js";
7
- import { UIElement as T, UIElementType as a, UEAttr as y, UIElementTagRegistry as C } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
8
- import { ExternalMergeTagsLibrary as E } from "./dynamic-content-modal.js";
9
- const l = "external-dynamic-content-ui-element", L = "button-add-dynamic-content";
10
- class B extends C {
11
- registerUiElements(s) {
12
- s[a.MERGETAGS] = l;
2
+ var d = (o, r, t) => r in o ? c(o, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[r] = t;
3
+ var s = (o, r, t) => d(o, typeof r != "symbol" ? r + "" : r, t);
4
+ import { useConfig as g } from "../../composables/useConfig.js";
5
+ import { clipboardHtmlToPlainText as m } from "../../utils/clipboardText.js";
6
+ import { findEditorShadowRoot as u } from "../../utils/editorShadowRoot.js";
7
+ import { mergeTagToDynamicContent as h, dynamicContentToMergeTags as T } from "../../utils/genericUtil.js";
8
+ import { UIElement as p, UIElementType as l, UEAttr as C, UIElementTagRegistry as y } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
9
+ import { ExternalMergeTagsLibrary as L } from "./dynamic-content-modal.js";
10
+ const a = "external-dynamic-content-ui-element", E = "button-add-dynamic-content";
11
+ class v extends y {
12
+ registerUiElements(r) {
13
+ r[l.MERGETAGS] = a;
13
14
  }
14
15
  }
15
- class x extends T {
16
+ class P extends p {
16
17
  constructor() {
17
18
  super(...arguments);
18
- r(this, "mergeTagsButton", null);
19
- r(this, "mergeTagsLibrary", null);
20
- r(this, "clickListener", null);
21
- r(this, "lastClickedElement", null);
22
- r(this, "lastClickedFrame", null);
23
- r(this, "mousedownListener", null);
19
+ s(this, "mergeTagsButton", null);
20
+ s(this, "mergeTagsLibrary", null);
21
+ s(this, "clickListener", null);
22
+ s(this, "lastClickedElement", null);
23
+ s(this, "lastClickedFrame", null);
24
+ s(this, "mousedownListener", null);
25
+ s(this, "clipboardWindow", null);
26
+ s(this, "clipboardListener", (t) => this._writeTokenAsPlainText(t));
24
27
  }
25
28
  getId() {
26
- return l;
29
+ return a;
27
30
  }
28
31
  onRender(t) {
29
32
  var e;
30
- this.mergeTagsButton = t.querySelector("#guido__btn-add-dynamic-content"), this.clickListener = this._onClick.bind(this), (e = this.mergeTagsButton) == null || e.addEventListener("click", this.clickListener), this._setupCoordinateTracking();
33
+ this.mergeTagsButton = t.querySelector("#guido__btn-add-dynamic-content"), this.clickListener = this._onClick.bind(this), (e = this.mergeTagsButton) == null || e.addEventListener("click", this.clickListener), this._setupCoordinateTracking(), this._setupClipboardTracking();
31
34
  }
32
35
  onDestroy() {
33
36
  var t;
34
- this.clickListener && ((t = this.mergeTagsButton) == null || t.removeEventListener("click", this.clickListener)), this._cleanupCoordinateTracking(), this.mergeTagsButton = null, this.clickListener = null, this.lastClickedElement = null, this.lastClickedFrame = null;
37
+ this.clickListener && ((t = this.mergeTagsButton) == null || t.removeEventListener("click", this.clickListener)), this._cleanupCoordinateTracking(), this._cleanupClipboardTracking(), this.mergeTagsButton = null, this.clickListener = null, this.lastClickedElement = null, this.lastClickedFrame = null;
35
38
  }
36
39
  _onClick() {
37
40
  this.openMergeTagLibrary();
@@ -45,7 +48,7 @@ class x extends T {
45
48
  onAttributeUpdated(t, e) {
46
49
  if (t !== "mergeTag" || !(e != null && e.value))
47
50
  return;
48
- const n = u(e), i = this._getLastClickedPosition();
51
+ const n = h(e), i = this._getLastClickedPosition();
49
52
  this.lastClickedElement = null, this.lastClickedFrame = null, this._openDynamicContentLibrary(n, i);
50
53
  }
51
54
  openMergeTagLibrary() {
@@ -57,12 +60,12 @@ class x extends T {
57
60
  * Dispatches event with dynamic content data and position
58
61
  */
59
62
  _openDynamicContentLibrary(t, e) {
60
- this.mergeTagsLibrary || (this.mergeTagsLibrary = new E()), this.mergeTagsLibrary.openMergeTagsLibrary(
63
+ this.mergeTagsLibrary || (this.mergeTagsLibrary = new L()), this.mergeTagsLibrary.openMergeTagsLibrary(
61
64
  t,
62
65
  (n) => {
63
66
  if (n.text && n.value) {
64
- const { isFeatureEnabled: i } = d();
65
- this.api.triggerValueChange(h([n], i("liquidSyntax"))[0]);
67
+ const { isFeatureEnabled: i } = g();
68
+ this.api.triggerValueChange(T([n], i("liquidSyntax"))[0]);
66
69
  } else
67
70
  this.api.triggerValueChange(null);
68
71
  },
@@ -91,12 +94,32 @@ class x extends T {
91
94
  i && (this.lastClickedElement = i, this.lastClickedFrame = t);
92
95
  }, t.contentWindow.document.addEventListener("mousedown", this.mousedownListener));
93
96
  }
97
+ /**
98
+ * Listens on the canvas window so it runs after Stripo's own copy handler
99
+ */
100
+ _setupClipboardTracking() {
101
+ var e;
102
+ this._cleanupClipboardTracking();
103
+ const t = (e = this._getEditorFrame()) == null ? void 0 : e.contentWindow;
104
+ t && (this.clipboardWindow = t, t.addEventListener("copy", this.clipboardListener), t.addEventListener("cut", this.clipboardListener));
105
+ }
106
+ _cleanupClipboardTracking() {
107
+ var t, e;
108
+ (t = this.clipboardWindow) == null || t.removeEventListener("copy", this.clipboardListener), (e = this.clipboardWindow) == null || e.removeEventListener("cut", this.clipboardListener), this.clipboardWindow = null;
109
+ }
110
+ /**
111
+ * Link and image fields paste the plain flavour, where Stripo puts the chip label
112
+ */
113
+ _writeTokenAsPlainText({ clipboardData: t }) {
114
+ const e = m((t == null ? void 0 : t.getData("text/html")) ?? "");
115
+ e !== null && (t == null || t.setData("text/plain", e));
116
+ }
94
117
  /**
95
118
  * Gets the editor iframe element
96
119
  */
97
120
  _getEditorFrame() {
98
121
  var e, n;
99
- const t = (e = m()) == null ? void 0 : e.querySelector("iframe");
122
+ const t = (e = u()) == null ? void 0 : e.querySelector("iframe");
100
123
  return (n = t == null ? void 0 : t.contentWindow) != null && n.document ? t : null;
101
124
  }
102
125
  /**
@@ -142,18 +165,18 @@ class x extends T {
142
165
  getTemplate() {
143
166
  return `
144
167
  <div>
145
- <${a.BUTTON}
168
+ <${l.BUTTON}
146
169
  id="guido__btn-add-dynamic-content"
147
170
  class="btn btn-primary"
148
- ${y.BUTTON.name}="${L}">
149
- <${a.ICON} src="plus" class="icon icon-button color-primary">
150
- </${a.ICON}>
171
+ ${C.BUTTON.name}="${E}">
172
+ <${l.ICON} src="plus" class="icon icon-button color-primary">
173
+ </${l.ICON}>
151
174
  ${this.api.translate("Add Dynamic Content")}
152
- </${a.BUTTON}>
175
+ </${l.BUTTON}>
153
176
  </div>`;
154
177
  }
155
178
  }
156
179
  export {
157
- B as DynamicContentTagRegistry,
158
- x as DynamicContentUiElementExtension
180
+ v as DynamicContentTagRegistry,
181
+ P as DynamicContentUiElementExtension
159
182
  };
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-9d988e4b] .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}.color-vision-select__dropdown[data-v-64cb50da]{z-index:20;width:387px}.accessibility-toolbar[data-v-391019bc]{gap:16px}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button svg{margin-right:0}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button .clearfix:after{content:none}.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}.editor-actions-menu__dropdown[data-v-bdb3b37a]{z-index:20;width:222px}.editor-actions[data-v-9a028d08]{gap:16px}.editor-actions__divider[data-v-9a028d08]{width:1px;height:40px;background-color:#e1e1e1}.right-slot[data-v-77451c9a]{gap:16px}.header-wrapper[data-v-3c713746]{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-0c5f11a1]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-0c5f11a1]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-0c5f11a1]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-eaf8e461]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-eaf8e461]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-eaf8e461]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-eaf8e461]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-eaf8e461]{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}.guido-tab-bar-onboarding[data-v-219b4f7c]{z-index:21}[data-v-fcba7e99] .vueperslides__bullets{pointer-events:none!important}[data-v-fcba7e99] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-1a34025a] .vueperslides__bullets{pointer-events:none!important}[data-v-1a34025a] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-8fc96a58] .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 .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}.guido-display-condition-create__separator[data-v-929822bc]{height:1px;margin:0 0 24px;background-image:linear-gradient(to right,currentColor 1px,transparent 1px);background-size:5px 1px}.guido-display-condition-create__methods[data-v-929822bc]{gap:16px}.guido-display-condition-select-root[data-v-0d740001] .in-drawer__footer{justify-content:flex-start}.guido-display-condition-select__delete-modal[data-v-0d740001]{position:relative;z-index:145}.guido-display-condition-select__delete-modal[data-v-0d740001] .in-modal-v2-wrapper__header-title{margin-bottom:0}.guido-display-condition-select-root[data-v-0d740001] .in-drawer__content>div{display:flex;flex-direction:column;min-height:100%}.guido-display-condition-select__list[data-v-0d740001]{display:flex;flex-direction:column;gap:24px;margin:0;padding:0;list-style:none}.guido-display-condition-card__header[data-v-0d740001]{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:15px}.guido-display-condition-card__text[data-v-0d740001]{min-width:0}.guido-display-condition-card__name[data-v-0d740001],.guido-display-condition-card__description[data-v-0d740001]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.guido-display-condition-card__actions[data-v-0d740001]{display:flex;flex-shrink:0;align-items:center;gap:16px}.guido-display-condition-card__split[data-v-0d740001]{position:relative;display:flex;gap:1px}.guido-display-condition-card__menu[data-v-0d740001]{z-index:2;min-width:115px}.guido-display-condition-card__divider[data-v-0d740001]{width:1px;height:24px}.guido-display-condition-card__code[data-v-0d740001]{margin:1px 15px 15px;padding:8px;font-family:inherit;white-space:pre-wrap;word-break:break-word}.legacy-strategy-updated-modal[data-v-da2225a1]{position:relative;z-index:145}.ambiguous-dynamic-content-modal__content[data-v-2643213c]{padding-bottom:150px}
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-9d988e4b] .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}.color-vision-select__dropdown[data-v-64cb50da]{z-index:20;width:387px}.accessibility-toolbar[data-v-391019bc]{gap:16px}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button svg{margin-right:0}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button .clearfix:after{content:none}.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}.editor-actions-menu__dropdown[data-v-bdb3b37a]{z-index:20;width:222px}.editor-actions[data-v-9a028d08]{gap:16px}.editor-actions__divider[data-v-9a028d08]{width:1px;height:40px;background-color:#e1e1e1}.right-slot[data-v-77451c9a]{gap:16px}.header-wrapper[data-v-3c713746]{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-da8cab7f]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-da8cab7f]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-da8cab7f]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-eaf8e461]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-eaf8e461]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-eaf8e461]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-eaf8e461]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-eaf8e461]{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}.guido-tab-bar-onboarding[data-v-219b4f7c]{z-index:21}[data-v-fcba7e99] .vueperslides__bullets{pointer-events:none!important}[data-v-fcba7e99] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-1a34025a] .vueperslides__bullets{pointer-events:none!important}[data-v-1a34025a] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-8fc96a58] .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 .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}.guido-display-condition-create__separator[data-v-929822bc]{height:1px;margin:0 0 24px;background-image:linear-gradient(to right,currentColor 1px,transparent 1px);background-size:5px 1px}.guido-display-condition-create__methods[data-v-929822bc]{gap:16px}.guido-display-condition-select-root[data-v-0d740001] .in-drawer__footer{justify-content:flex-start}.guido-display-condition-select__delete-modal[data-v-0d740001]{position:relative;z-index:145}.guido-display-condition-select__delete-modal[data-v-0d740001] .in-modal-v2-wrapper__header-title{margin-bottom:0}.guido-display-condition-select-root[data-v-0d740001] .in-drawer__content>div{display:flex;flex-direction:column;min-height:100%}.guido-display-condition-select__list[data-v-0d740001]{display:flex;flex-direction:column;gap:24px;margin:0;padding:0;list-style:none}.guido-display-condition-card__header[data-v-0d740001]{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:15px}.guido-display-condition-card__text[data-v-0d740001]{min-width:0}.guido-display-condition-card__name[data-v-0d740001],.guido-display-condition-card__description[data-v-0d740001]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.guido-display-condition-card__actions[data-v-0d740001]{display:flex;flex-shrink:0;align-items:center;gap:16px}.guido-display-condition-card__split[data-v-0d740001]{position:relative;display:flex;gap:1px}.guido-display-condition-card__menu[data-v-0d740001]{z-index:2;min-width:115px}.guido-display-condition-card__divider[data-v-0d740001]{width:1px;height:24px}.guido-display-condition-card__code[data-v-0d740001]{margin:1px 15px 15px;padding:8px;font-family:inherit;white-space:pre-wrap;word-break:break-word}.legacy-strategy-updated-modal[data-v-da2225a1]{position:relative;z-index:145}.ambiguous-dynamic-content-modal__content[data-v-2643213c]{padding-bottom:150px}
@@ -1,9 +1,9 @@
1
- const o = "3.30.0-beta.232ea3c", s = { stripo: { version: "2.87.0" } }, e = {
1
+ const o = "3.30.0-beta.23d415d", s = { stripo: { version: "2.87.0" } }, t = {
2
2
  version: o,
3
3
  guido: s
4
4
  };
5
5
  export {
6
- e as default,
6
+ t as default,
7
7
  s as guido,
8
8
  o as version
9
9
  };
@@ -417,6 +417,8 @@ export declare const FeaturesSchema: v.ObjectSchema<{
417
417
  /** Allow persisting a template that still has validation errors (drawer "Save and Continue" soft-save). Host sets false for transactional + unsubscribe. */
418
418
  readonly allowSaveWithErrors: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
419
419
  readonly reusableRecommendationStrategy: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
420
+ /** List the dynamic-content catalogue as Stripo special links in the link type selector */
421
+ readonly dynamicContentSpecialLinks: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
420
422
  /** Convert linkless legacy unsubscribe blocks into text blocks and warn with a modal (opt-in) */
421
423
  readonly legacyUnsubscribeConversion: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
422
424
  /** Items block: Recommendation-style price formatting (root currency-* attrs, raw price tags). Released dark. */
@@ -844,6 +846,8 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
844
846
  /** Allow persisting a template that still has validation errors (drawer "Save and Continue" soft-save). Host sets false for transactional + unsubscribe. */
845
847
  readonly allowSaveWithErrors: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
846
848
  readonly reusableRecommendationStrategy: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
849
+ /** List the dynamic-content catalogue as Stripo special links in the link type selector */
850
+ readonly dynamicContentSpecialLinks: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
847
851
  /** Convert linkless legacy unsubscribe blocks into text blocks and warn with a modal (opt-in) */
848
852
  readonly legacyUnsubscribeConversion: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
849
853
  /** Items block: Recommendation-style price formatting (root currency-* attrs, raw price tags). Released dark. */
@@ -22,6 +22,8 @@ export type DynamicContentNode = {
22
22
  text?: string;
23
23
  tag_text?: string;
24
24
  value?: string;
25
+ description?: string;
26
+ type?: string;
25
27
  children?: DynamicContentNode[];
26
28
  select_items?: DynamicContentNode[];
27
29
  };
@@ -44,6 +46,14 @@ export type MergeTag = BaseDynamicContent & {
44
46
  selEnd?: number;
45
47
  hidden?: boolean;
46
48
  };
49
+ export type SpecialLinkGroup = {
50
+ category: string;
51
+ entries: {
52
+ label: string;
53
+ value: string;
54
+ hidden?: boolean;
55
+ }[];
56
+ };
47
57
  export type PositionData = {
48
58
  x: number;
49
59
  y: number;
@@ -106,6 +106,7 @@ export declare const useConfig: () => {
106
106
  linkTrackingIds: boolean;
107
107
  allowSaveWithErrors: boolean;
108
108
  reusableRecommendationStrategy: boolean;
109
+ dynamicContentSpecialLinks: boolean;
109
110
  legacyUnsubscribeConversion: boolean;
110
111
  itemsPriceFormatting: boolean;
111
112
  blockUnsubscribeLinks: boolean;
@@ -250,6 +251,7 @@ export declare const useConfig: () => {
250
251
  linkTrackingIds: boolean;
251
252
  allowSaveWithErrors: boolean;
252
253
  reusableRecommendationStrategy: boolean;
254
+ dynamicContentSpecialLinks: boolean;
253
255
  legacyUnsubscribeConversion: boolean;
254
256
  itemsPriceFormatting: boolean;
255
257
  blockUnsubscribeLinks: boolean;
@@ -10,6 +10,8 @@ export declare class DynamicContentUiElementExtension extends UIElement {
10
10
  private lastClickedElement;
11
11
  private lastClickedFrame;
12
12
  private mousedownListener;
13
+ private clipboardWindow;
14
+ private readonly clipboardListener;
13
15
  getId(): string;
14
16
  onRender(container: HTMLElement): void;
15
17
  onDestroy(): void;
@@ -37,6 +39,15 @@ export declare class DynamicContentUiElementExtension extends UIElement {
37
39
  * Workaround from Stripo intercepting click events - tracks mousedown events instead
38
40
  */
39
41
  private _setupCoordinateTracking;
42
+ /**
43
+ * Listens on the canvas window so it runs after Stripo's own copy handler
44
+ */
45
+ private _setupClipboardTracking;
46
+ private _cleanupClipboardTracking;
47
+ /**
48
+ * Link and image fields paste the plain flavour, where Stripo puts the chip label
49
+ */
50
+ private _writeTokenAsPlainText;
40
51
  /**
41
52
  * Gets the editor iframe element
42
53
  */
@@ -111,6 +111,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
111
111
  linkTrackingIds: boolean;
112
112
  allowSaveWithErrors: boolean;
113
113
  reusableRecommendationStrategy: boolean;
114
+ dynamicContentSpecialLinks: boolean;
114
115
  legacyUnsubscribeConversion: boolean;
115
116
  itemsPriceFormatting: boolean;
116
117
  blockUnsubscribeLinks: boolean;
@@ -261,6 +262,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
261
262
  linkTrackingIds: boolean;
262
263
  allowSaveWithErrors: boolean;
263
264
  reusableRecommendationStrategy: boolean;
265
+ dynamicContentSpecialLinks: boolean;
264
266
  legacyUnsubscribeConversion: boolean;
265
267
  itemsPriceFormatting: boolean;
266
268
  blockUnsubscribeLinks: boolean;
@@ -411,6 +413,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
411
413
  linkTrackingIds: boolean;
412
414
  allowSaveWithErrors: boolean;
413
415
  reusableRecommendationStrategy: boolean;
416
+ dynamicContentSpecialLinks: boolean;
414
417
  legacyUnsubscribeConversion: boolean;
415
418
  itemsPriceFormatting: boolean;
416
419
  blockUnsubscribeLinks: boolean;
@@ -561,6 +564,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
561
564
  linkTrackingIds: boolean;
562
565
  allowSaveWithErrors: boolean;
563
566
  reusableRecommendationStrategy: boolean;
567
+ dynamicContentSpecialLinks: boolean;
564
568
  legacyUnsubscribeConversion: boolean;
565
569
  itemsPriceFormatting: boolean;
566
570
  blockUnsubscribeLinks: boolean;
@@ -711,6 +715,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
711
715
  linkTrackingIds: boolean;
712
716
  allowSaveWithErrors: boolean;
713
717
  reusableRecommendationStrategy: boolean;
718
+ dynamicContentSpecialLinks: boolean;
714
719
  legacyUnsubscribeConversion: boolean;
715
720
  itemsPriceFormatting: boolean;
716
721
  blockUnsubscribeLinks: boolean;
@@ -861,6 +866,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
861
866
  linkTrackingIds: boolean;
862
867
  allowSaveWithErrors: boolean;
863
868
  reusableRecommendationStrategy: boolean;
869
+ dynamicContentSpecialLinks: boolean;
864
870
  legacyUnsubscribeConversion: boolean;
865
871
  itemsPriceFormatting: boolean;
866
872
  blockUnsubscribeLinks: boolean;
@@ -1011,6 +1017,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1011
1017
  linkTrackingIds: boolean;
1012
1018
  allowSaveWithErrors: boolean;
1013
1019
  reusableRecommendationStrategy: boolean;
1020
+ dynamicContentSpecialLinks: boolean;
1014
1021
  legacyUnsubscribeConversion: boolean;
1015
1022
  itemsPriceFormatting: boolean;
1016
1023
  blockUnsubscribeLinks: boolean;
@@ -1161,6 +1168,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1161
1168
  linkTrackingIds: boolean;
1162
1169
  allowSaveWithErrors: boolean;
1163
1170
  reusableRecommendationStrategy: boolean;
1171
+ dynamicContentSpecialLinks: boolean;
1164
1172
  legacyUnsubscribeConversion: boolean;
1165
1173
  itemsPriceFormatting: boolean;
1166
1174
  blockUnsubscribeLinks: boolean;
@@ -1311,6 +1319,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1311
1319
  linkTrackingIds: boolean;
1312
1320
  allowSaveWithErrors: boolean;
1313
1321
  reusableRecommendationStrategy: boolean;
1322
+ dynamicContentSpecialLinks: boolean;
1314
1323
  legacyUnsubscribeConversion: boolean;
1315
1324
  itemsPriceFormatting: boolean;
1316
1325
  blockUnsubscribeLinks: boolean;
@@ -1461,6 +1470,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1461
1470
  linkTrackingIds: boolean;
1462
1471
  allowSaveWithErrors: boolean;
1463
1472
  reusableRecommendationStrategy: boolean;
1473
+ dynamicContentSpecialLinks: boolean;
1464
1474
  legacyUnsubscribeConversion: boolean;
1465
1475
  itemsPriceFormatting: boolean;
1466
1476
  blockUnsubscribeLinks: boolean;
@@ -1611,6 +1621,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1611
1621
  linkTrackingIds: boolean;
1612
1622
  allowSaveWithErrors: boolean;
1613
1623
  reusableRecommendationStrategy: boolean;
1624
+ dynamicContentSpecialLinks: boolean;
1614
1625
  legacyUnsubscribeConversion: boolean;
1615
1626
  itemsPriceFormatting: boolean;
1616
1627
  blockUnsubscribeLinks: boolean;
@@ -1761,6 +1772,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1761
1772
  linkTrackingIds: boolean;
1762
1773
  allowSaveWithErrors: boolean;
1763
1774
  reusableRecommendationStrategy: boolean;
1775
+ dynamicContentSpecialLinks: boolean;
1764
1776
  legacyUnsubscribeConversion: boolean;
1765
1777
  itemsPriceFormatting: boolean;
1766
1778
  blockUnsubscribeLinks: boolean;
@@ -1911,6 +1923,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1911
1923
  linkTrackingIds: boolean;
1912
1924
  allowSaveWithErrors: boolean;
1913
1925
  reusableRecommendationStrategy: boolean;
1926
+ dynamicContentSpecialLinks: boolean;
1914
1927
  legacyUnsubscribeConversion: boolean;
1915
1928
  itemsPriceFormatting: boolean;
1916
1929
  blockUnsubscribeLinks: boolean;
@@ -2061,6 +2074,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
2061
2074
  linkTrackingIds: boolean;
2062
2075
  allowSaveWithErrors: boolean;
2063
2076
  reusableRecommendationStrategy: boolean;
2077
+ dynamicContentSpecialLinks: boolean;
2064
2078
  legacyUnsubscribeConversion: boolean;
2065
2079
  itemsPriceFormatting: boolean;
2066
2080
  blockUnsubscribeLinks: boolean;
@@ -2211,6 +2225,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
2211
2225
  linkTrackingIds: boolean;
2212
2226
  allowSaveWithErrors: boolean;
2213
2227
  reusableRecommendationStrategy: boolean;
2228
+ dynamicContentSpecialLinks: boolean;
2214
2229
  legacyUnsubscribeConversion: boolean;
2215
2230
  itemsPriceFormatting: boolean;
2216
2231
  blockUnsubscribeLinks: boolean;
@@ -2361,6 +2376,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
2361
2376
  linkTrackingIds: boolean;
2362
2377
  allowSaveWithErrors: boolean;
2363
2378
  reusableRecommendationStrategy: boolean;
2379
+ dynamicContentSpecialLinks: boolean;
2364
2380
  legacyUnsubscribeConversion: boolean;
2365
2381
  itemsPriceFormatting: boolean;
2366
2382
  blockUnsubscribeLinks: boolean;
@@ -2511,6 +2527,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
2511
2527
  linkTrackingIds: boolean;
2512
2528
  allowSaveWithErrors: boolean;
2513
2529
  reusableRecommendationStrategy: boolean;
2530
+ dynamicContentSpecialLinks: boolean;
2514
2531
  legacyUnsubscribeConversion: boolean;
2515
2532
  itemsPriceFormatting: boolean;
2516
2533
  blockUnsubscribeLinks: boolean;
@@ -2673,6 +2690,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
2673
2690
  linkTrackingIds: boolean;
2674
2691
  allowSaveWithErrors: boolean;
2675
2692
  reusableRecommendationStrategy: boolean;
2693
+ dynamicContentSpecialLinks: boolean;
2676
2694
  legacyUnsubscribeConversion: boolean;
2677
2695
  itemsPriceFormatting: boolean;
2678
2696
  blockUnsubscribeLinks: boolean;
@@ -2823,6 +2841,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
2823
2841
  linkTrackingIds: boolean;
2824
2842
  allowSaveWithErrors: boolean;
2825
2843
  reusableRecommendationStrategy: boolean;
2844
+ dynamicContentSpecialLinks: boolean;
2826
2845
  legacyUnsubscribeConversion: boolean;
2827
2846
  itemsPriceFormatting: boolean;
2828
2847
  blockUnsubscribeLinks: boolean;
@@ -2973,6 +2992,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
2973
2992
  linkTrackingIds: boolean;
2974
2993
  allowSaveWithErrors: boolean;
2975
2994
  reusableRecommendationStrategy: boolean;
2995
+ dynamicContentSpecialLinks: boolean;
2976
2996
  legacyUnsubscribeConversion: boolean;
2977
2997
  itemsPriceFormatting: boolean;
2978
2998
  blockUnsubscribeLinks: boolean;
@@ -3125,6 +3145,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
3125
3145
  linkTrackingIds: boolean;
3126
3146
  allowSaveWithErrors: boolean;
3127
3147
  reusableRecommendationStrategy: boolean;
3148
+ dynamicContentSpecialLinks: boolean;
3128
3149
  legacyUnsubscribeConversion: boolean;
3129
3150
  itemsPriceFormatting: boolean;
3130
3151
  blockUnsubscribeLinks: boolean;
@@ -0,0 +1 @@
1
+ export declare const clipboardHtmlToPlainText: (html: string) => string | null;
@@ -1,4 +1,4 @@
1
- import type { DynamicContent, DynamicContentCandidate, DynamicContentList, MergeTag } from '@@/Types/generic';
1
+ import type { DynamicContent, DynamicContentCandidate, DynamicContentList, MergeTag, SpecialLinkGroup } from '@@/Types/generic';
2
2
  export declare const mergeTagToDynamicContent: (mergeTag: MergeTag) => DynamicContent;
3
3
  export declare const dynamicContentToMergeTags: (dynamicContentList: DynamicContent[], liquidSyntax?: boolean) => MergeTag[];
4
4
  /**
@@ -14,6 +14,11 @@ export declare const flattenDynamicContentList: (list: DynamicContentList | unde
14
14
  * token — including ones repaired on module drop — render as a chip.
15
15
  */
16
16
  export declare const buildMergeTagEntries: (preselected: DynamicContent[], available: DynamicContent[], liquidSyntax?: boolean) => MergeTag[];
17
+ /**
18
+ * Groups the active partner's URL attributes and every Call an API variable under
19
+ * their top-level category for Stripo's `specialLinks` option.
20
+ */
21
+ export declare const buildSpecialLinkGroups: (list: DynamicContentList | undefined | null, liquidSyntax?: boolean) => SpecialLinkGroup[];
17
22
  export declare const getCsrfToken: () => string;
18
23
  /**
19
24
  * URL Parameter utilities
@@ -0,0 +1,3 @@
1
+ export declare const isBareToken: (text: string) => boolean;
2
+ export declare const disposeLinkTokenPaste: () => void;
3
+ export declare const listenForLinkTokenPaste: () => void;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * The Liquid engine reads the raw HTML, where a link's `"` is the `&quot;` it cannot parse.
3
+ */
4
+ export declare function singleQuoteLiquidLinks(html: string): string;
@@ -0,0 +1,31 @@
1
+ const i = "p, div, li, h1, h2, h3, h4, h5, h6, td", d = "style, script", l = /\u200B/g, o = (e) => {
2
+ const n = e.replace(/[ \t]+$/, "");
3
+ return n && !n.endsWith(`
4
+ `) ? `${n}
5
+ ` : n;
6
+ }, E = (e, n) => {
7
+ const r = n.replace(l, "").replace(/[ \t]*[\r\n]\s*/g, " ");
8
+ return e + (e === "" || e.endsWith(`
9
+ `) ? r.replace(/^[ \t]+/, "") : r);
10
+ }, s = (e, n) => {
11
+ if (n.nodeType === Node.TEXT_NODE)
12
+ return E(e, n.textContent ?? "");
13
+ if (n.nodeType !== Node.ELEMENT_NODE)
14
+ return e;
15
+ const r = n;
16
+ if (r.matches(d))
17
+ return e;
18
+ if (r.matches("br"))
19
+ return `${e}
20
+ `;
21
+ const t = r.matches(i), c = Array.from(r.childNodes).reduce(s, t ? o(e) : e);
22
+ return t ? o(c) : c;
23
+ }, N = (e) => {
24
+ if (!e.includes("{{"))
25
+ return null;
26
+ const { body: n } = new DOMParser().parseFromString(e, "text/html"), r = Array.from(n.childNodes).reduce(s, "").trim();
27
+ return r.includes("{{") ? r : null;
28
+ };
29
+ export {
30
+ N as clipboardHtmlToPlainText
31
+ };
@@ -1,78 +1,88 @@
1
- import { formatToLiquidFilter as y, liquidFilterToFormat as g, quoteArgument as m } from "./liquidDynamicContent.js";
2
- const v = (t) => {
1
+ import { formatToLiquidFilter as g, liquidFilterToFormat as p, quoteArgument as y } from "./liquidDynamicContent.js";
2
+ const m = (t) => {
3
3
  if (!t.includes("="))
4
4
  return null;
5
- const [r, e] = t.split("=");
6
- return { key: r.trim(), value: e.trim() };
7
- }, u = "default:", i = (t) => {
5
+ const [a, e] = t.split("=");
6
+ return { key: a.trim(), value: e.trim() };
7
+ }, u = "default:", b = (t) => {
8
8
  if (!t.startsWith(u))
9
9
  return t;
10
- const r = t.slice(u.length).trim(), e = (n) => r.length >= 2 && r.startsWith(n) && r.endsWith(n);
11
- return e('"') || e("'") ? r.slice(1, -1) : r;
12
- }, $ = (t) => {
13
- const e = t.value.match(/\{\{([^}]+)\}\}/)[1].split("|").map((a) => a.trim()), [n] = e, s = {
10
+ const a = t.slice(u.length).trim(), e = (r) => a.length >= 2 && a.startsWith(r) && a.endsWith(r);
11
+ return e('"') || e("'") ? a.slice(1, -1) : a;
12
+ }, A = (t) => {
13
+ const e = t.value.match(/\{\{([^}]+)\}\}/)[1].split("|").map((n) => n.trim()), [r] = e, l = {
14
14
  text: t.label,
15
- value: n || ""
15
+ value: r || ""
16
16
  };
17
17
  if (e.length >= 2) {
18
- const [, a, o] = e;
19
- if (a.startsWith(u))
20
- s.fallback = i(a);
18
+ const [, n, c] = e;
19
+ if (n.startsWith(u))
20
+ l.fallback = b(n);
21
21
  else {
22
- const l = g(a) ?? v(a);
23
- l ? s.format = l : o || (s.fallback = a), o && (s.fallback = i(o));
22
+ const s = p(n) ?? m(n);
23
+ s ? l.format = s : c || (l.fallback = n), c && (l.fallback = b(c));
24
24
  }
25
25
  }
26
- return s;
27
- }, h = (t) => {
28
- const e = !Number.isNaN(Number(t)) && t.trim() !== "" ? t : m(t);
26
+ return l;
27
+ }, d = (t) => {
28
+ const e = !Number.isNaN(Number(t)) && t.trim() !== "" ? t : y(t);
29
29
  return e === null ? null : `${u} ${e}`;
30
- }, p = (t) => {
31
- const r = t.format ? y(t.format) : null, e = t.fallback ? h(t.fallback) : null, n = [t.value, r, e].filter(Boolean);
30
+ }, v = (t) => {
31
+ const a = t.format ? g(t.format) : null, e = t.fallback ? d(t.fallback) : null, r = [t.value, a, e].filter(Boolean);
32
32
  return {
33
- label: [t.text, r, e && t.fallback].filter(Boolean).join(" | "),
34
- value: `{{ ${n.join(" | ")} }}`
33
+ label: [t.text, a, e && t.fallback].filter(Boolean).join(" | "),
34
+ value: `{{ ${r.join(" | ")} }}`
35
35
  };
36
- }, b = (t, r = !1) => t.map((e) => r ? p(e) : e.format ? {
36
+ }, i = (t, a = !1) => t.map((e) => a ? v(e) : e.format ? {
37
37
  label: `${e.text} | ${e.format.key}=${e.format.value}`,
38
38
  value: `{{${e.value}|${e.format.key}=${e.format.value}}}`
39
39
  } : {
40
40
  label: e.fallback ? `${e.text} | ${e.fallback}` : e.text,
41
41
  value: e.fallback ? `{{${e.value}|${e.fallback}}}` : `{{${e.value}}}`
42
- }), k = (t) => {
43
- const r = [], e = /* @__PURE__ */ new Set(), n = (a, o) => {
44
- Array.isArray(a) && a.forEach((l) => {
45
- const f = [...l.children ?? [], ...l.select_items ?? []], c = l.text || l.tag_text;
42
+ }), T = (t) => {
43
+ const a = [], e = /* @__PURE__ */ new Set(), r = (n, c) => {
44
+ Array.isArray(n) && n.forEach((s) => {
45
+ const f = [...s.children ?? [], ...s.select_items ?? []], o = s.text || s.tag_text;
46
46
  if (f.length > 0) {
47
- n(f, c ? [...o, c] : o);
47
+ r(f, o ? [...c, o] : c);
48
48
  return;
49
49
  }
50
- c && l.value && !e.has(l.value) && (e.add(l.value), r.push({ value: l.value, text: c, tagText: l.tag_text || c, path: o }));
50
+ o && s.value && !e.has(s.value) && (e.add(s.value), a.push({ value: s.value, text: o, tagText: s.tag_text || o, path: c }));
51
51
  });
52
- }, [s] = Object.values(t ?? {});
53
- return n(s, []), r;
54
- }, x = (t) => k(t).map(({ text: r, value: e }) => ({ text: r, value: e })), T = (t, r, e = !1) => {
55
- const n = new Set(t.map((a) => a.value)), s = r.filter((a) => n.has(a.value) ? !1 : (n.add(a.value), !0));
52
+ }, [l] = Object.values(t ?? {});
53
+ return r(l, []), a;
54
+ }, h = (t) => T(t).map(({ text: a, value: e }) => ({ text: a, value: e })), L = (t, a, e = !1) => {
55
+ const r = new Set(t.map((n) => n.value)), l = a.filter((n) => r.has(n.value) ? !1 : (r.add(n.value), !0));
56
56
  return [
57
- ...b(t, e),
58
- ...b(s, e)
57
+ ...i(t, e),
58
+ ...i(l, e)
59
59
  ];
60
+ }, k = /url(_\d+)?$/i, _ = /^call_an_api_response_/, $ = (t) => k.test(t) || _.test(t), P = (t, a = !1) => {
61
+ const [e] = Object.values(t ?? {});
62
+ return (e ?? []).map((r) => {
63
+ const l = h({ node: [r] }).filter((n) => $(n.value));
64
+ return {
65
+ category: r.text || r.tag_text || "",
66
+ entries: i(l, a).map(({ label: n, value: c }) => ({ label: n, value: c }))
67
+ };
68
+ }).filter((r) => r.category && r.entries.length > 0);
60
69
  }, F = () => {
61
70
  var t;
62
71
  return ((t = document.head.querySelector('meta[name="csrf-token"]')) == null ? void 0 : t.getAttribute("content")) ?? "";
63
- }, P = (t) => typeof t == "string" ? t : typeof t == "number" ? String(t) : "", j = (t) => {
72
+ }, N = (t) => typeof t == "string" ? t : typeof t == "number" ? String(t) : "", C = (t) => {
64
73
  if (t === null || typeof t != "object" || Array.isArray(t))
65
74
  return !1;
66
- const r = Object.getPrototypeOf(t);
67
- return r === Object.prototype || r === null;
75
+ const a = Object.getPrototypeOf(t);
76
+ return a === Object.prototype || a === null;
68
77
  };
69
78
  export {
70
- P as asText,
71
- T as buildMergeTagEntries,
72
- b as dynamicContentToMergeTags,
73
- k as flattenDynamicContentCandidates,
74
- x as flattenDynamicContentList,
79
+ N as asText,
80
+ L as buildMergeTagEntries,
81
+ P as buildSpecialLinkGroups,
82
+ i as dynamicContentToMergeTags,
83
+ T as flattenDynamicContentCandidates,
84
+ h as flattenDynamicContentList,
75
85
  F as getCsrfToken,
76
- j as isPlainObject,
77
- $ as mergeTagToDynamicContent
86
+ C as isPlainObject,
87
+ A as mergeTagToDynamicContent
78
88
  };
@@ -0,0 +1,28 @@
1
+ import { findEditorShadowRoot as a } from "./editorShadowRoot.js";
2
+ const l = ".e2e-link-input .contenteditable-input", c = "https://", p = /^\{\{[^{}]+\}\}$/;
3
+ let e = null;
4
+ const d = (t) => p.test(t), u = (t) => {
5
+ var i;
6
+ const n = t instanceof Element ? t.closest(l) : null;
7
+ return ((i = n == null ? void 0 : n.textContent) == null ? void 0 : i.trim()) === c ? n : null;
8
+ }, r = (t) => {
9
+ var o, s;
10
+ const n = ((o = t.clipboardData) == null ? void 0 : o.getData("text/plain").trim()) ?? "", i = d(n) ? u(t.target) : null;
11
+ if (!i)
12
+ return;
13
+ (s = window.getSelection()) == null || s.selectAllChildren(i), !i.dispatchEvent(new InputEvent("beforeinput", {
14
+ inputType: "insertFromPaste",
15
+ data: n,
16
+ bubbles: !0,
17
+ cancelable: !0
18
+ })) && (t.preventDefault(), t.stopImmediatePropagation());
19
+ }, E = () => {
20
+ e == null || e.removeEventListener("paste", r, !0), e = null;
21
+ }, m = () => {
22
+ E(), e = a(), e == null || e.addEventListener("paste", r, !0);
23
+ };
24
+ export {
25
+ E as disposeLinkTokenPaste,
26
+ d as isBareToken,
27
+ m as listenForLinkTokenPaste
28
+ };
@@ -0,0 +1,10 @@
1
+ const o = /\s([\w:-]+)\s*=\s*(?:"[^"]*"|'[^']*')/g, E = /^(?:href|src)$/i, e = /\{\{[^{}]*\}\}/g, c = /'[^']*'|&#39;.*?&#39;|&quot;(.*?)&quot;/gs, i = /'|&#39;|&#x27;|&apos;|&#34;|&#x22;/i, T = (t) => t.replace(
2
+ c,
3
+ (n, s) => s === void 0 || i.test(s) || s.startsWith("//") ? n : `'${s}'`
4
+ );
5
+ function r(t) {
6
+ return t.includes("&quot;") ? t.replace(o, (n, s) => E.test(s) && n.endsWith('"') ? n.replace(e, T) : n) : t;
7
+ }
8
+ export {
9
+ r as singleQuoteLiquidLinks
10
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.30.0-beta.232ea3c",
3
+ "version": "3.30.0-beta.23d415d",
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",