@useinsider/guido 3.20.1-beta.55d63aa → 3.20.1-beta.5d92444
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 +8 -1
- package/dist/@types/config/schemas.js +17 -17
- package/dist/components/Guido.vue.js +8 -8
- package/dist/components/Guido.vue2.js +47 -45
- package/dist/components/organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.js +17 -0
- package/dist/components/organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue2.js +35 -0
- package/dist/composables/useBlocksConfig.js +24 -32
- package/dist/composables/useModuleRepair.js +40 -24
- package/dist/config/migrator/index.js +10 -9
- package/dist/config/migrator/legacyUnsubscribeTextMigrator.js +16 -0
- package/dist/enums/academy.js +2 -2
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +92 -93
- package/dist/node_modules/valibot/dist/index.js +261 -297
- package/dist/src/@types/config/schemas.d.ts +4 -4
- package/dist/src/composables/useConfig.d.ts +2 -2
- package/dist/src/composables/useModuleRepair.d.ts +2 -11
- package/dist/src/config/migrator/legacyUnsubscribeTextMigrator.d.ts +1 -0
- package/dist/src/enums/academy.d.ts +1 -1
- package/dist/src/stores/config.d.ts +20 -20
- package/dist/src/stores/editor.d.ts +25 -0
- package/dist/src/utils/legacyUnsubscribeConversion.d.ts +9 -0
- package/dist/stores/editor.js +16 -15
- package/dist/utils/legacyUnsubscribeConversion.js +86 -0
- package/dist/utils/pairProductVariables.js +14 -15
- package/package.json +1 -1
- package/dist/@types/display-condition.js +0 -25
- package/dist/components/organisms/display-conditions/CodeEditorField.vue.js +0 -20
- package/dist/components/organisms/display-conditions/CodeEditorField.vue2.js +0 -30
- package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.js +0 -30
- package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue2.js +0 -71
- package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.js +0 -34
- package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue2.js +0 -57
- package/dist/components/organisms/display-conditions/DisplayConditionsHost.vue.js +0 -17
- package/dist/components/organisms/display-conditions/DisplayConditionsHost.vue2.js +0 -22
- package/dist/composables/useDisplayConditions.js +0 -111
- package/dist/enums/display-condition.js +0 -12
- package/dist/extensions/DisplayConditions/bridge.js +0 -17
- package/dist/extensions/DisplayConditions/constants.js +0 -17
- package/dist/extensions/DisplayConditions/control.js +0 -169
- package/dist/extensions/DisplayConditions/display-conditions.css.js +0 -201
- package/dist/extensions/DisplayConditions/extension.js +0 -28
- package/dist/extensions/DisplayConditions/iconsRegistry.js +0 -20
- package/dist/extensions/DisplayConditions/library.js +0 -25
- package/dist/extensions/DisplayConditions/settingsPanel.js +0 -17
- package/dist/services/displayConditionApi.js +0 -39
- package/dist/src/@types/display-condition.d.ts +0 -59
- package/dist/src/components/organisms/display-conditions/CodeEditorField.vue.d.ts +0 -43
- package/dist/src/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.d.ts +0 -2
- package/dist/src/components/organisms/display-conditions/DisplayConditionsHost.vue.d.ts +0 -2
- package/dist/src/composables/useDisplayConditions.d.ts +0 -16
- package/dist/src/enums/display-condition.d.ts +0 -15
- package/dist/src/extensions/DisplayConditions/bridge.d.ts +0 -6
- package/dist/src/extensions/DisplayConditions/constants.d.ts +0 -14
- package/dist/src/extensions/DisplayConditions/control.d.ts +0 -21
- package/dist/src/extensions/DisplayConditions/extension.d.ts +0 -2
- package/dist/src/extensions/DisplayConditions/iconsRegistry.d.ts +0 -4
- package/dist/src/extensions/DisplayConditions/library.d.ts +0 -8
- package/dist/src/extensions/DisplayConditions/settingsPanel.d.ts +0 -5
- package/dist/src/mock/api/display-conditions.d.ts +0 -2
- package/dist/src/services/displayConditionApi.d.ts +0 -9
- package/dist/src/stores/display-condition.d.ts +0 -81
- package/dist/src/utils/displayCondition.d.ts +0 -4
- package/dist/src/utils/protectTableText.d.ts +0 -2
- package/dist/stores/display-condition.js +0 -28
- package/dist/utils/displayCondition.js +0 -21
- package/dist/utils/protectTableText.js +0 -22
- /package/dist/src/components/organisms/{display-conditions/DisplayConditionCreateDrawer.vue.d.ts → unsubscribe/LegacyUnsubscribeConvertedModal.vue.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -166,7 +166,7 @@ const config: GuidoConfigInput = {
|
|
|
166
166
|
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).
|
|
167
167
|
allowSaveWithErrors?: boolean, // Default: true - Allow the validation drawer's "Save and Continue" soft-save. Set false to hard-block invalid saves (transactional + unsubscribe pages).
|
|
168
168
|
reusableRecommendationStrategy?: boolean, // Default: false - Assign an RRS strategy to recommendation blocks instead of per-block algorithm/filters/shuffle/product-count settings.
|
|
169
|
-
|
|
169
|
+
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.
|
|
170
170
|
},
|
|
171
171
|
|
|
172
172
|
// Optional: Callbacks
|
|
@@ -668,6 +668,13 @@ multiple partners (e.g. architect) should key by partner and place the active pa
|
|
|
668
668
|
first. Omit the prop and the repair is a safe no-op — nothing is rewritten and no
|
|
669
669
|
toaster fires (useful before the host has wired the catalog).
|
|
670
670
|
|
|
671
|
+
With `features.legacyUnsubscribeConversion: true`, a dropped or copied module's legacy
|
|
672
|
+
unsubscribe block that has no unsubscribe link (the old editor reused it as plain text,
|
|
673
|
+
e.g. a company address) becomes a plain text block that keeps its content, and a warning
|
|
674
|
+
modal explains it. The same conversion runs when a template is opened. Register these
|
|
675
|
+
keys host-side: `email-editor.legacy-unsubscribe-converted-modal-title` and
|
|
676
|
+
`email-editor.legacy-unsubscribe-converted-modal-message`.
|
|
677
|
+
|
|
671
678
|
---
|
|
672
679
|
|
|
673
680
|
## Development
|
|
@@ -84,10 +84,10 @@ const p = {
|
|
|
84
84
|
children: e(n(f)),
|
|
85
85
|
// eslint-disable-next-line camelcase -- backend field name
|
|
86
86
|
select_items: e(n(f))
|
|
87
|
-
})),
|
|
87
|
+
})), v = g(
|
|
88
88
|
t(),
|
|
89
89
|
R(n(f), [])
|
|
90
|
-
),
|
|
90
|
+
), N = C({
|
|
91
91
|
/** Block ID (matches the dictionary key and the legacy HTML element id) */
|
|
92
92
|
id: e(s()),
|
|
93
93
|
/** Decimal places for price display (legacy data may use string or number) */
|
|
@@ -132,7 +132,7 @@ const p = {
|
|
|
132
132
|
isPriceMovedToNextLine: e(o()),
|
|
133
133
|
/** Legacy "Hide if same as discounted" / delete-price-for-zero-sale toggle */
|
|
134
134
|
isPriceDeletedForZeroSale: e(o())
|
|
135
|
-
}),
|
|
135
|
+
}), P = a({
|
|
136
136
|
/**
|
|
137
137
|
* Legacy recommendation block configs keyed by block ID.
|
|
138
138
|
* Pass this when loading a template authored with the v1
|
|
@@ -140,10 +140,10 @@ const p = {
|
|
|
140
140
|
* strategy, currency, locale, and layout data.
|
|
141
141
|
*/
|
|
142
142
|
recommendationConfigs: e(
|
|
143
|
-
g(t(),
|
|
143
|
+
g(t(), N),
|
|
144
144
|
{}
|
|
145
145
|
)
|
|
146
|
-
}),
|
|
146
|
+
}), x = a({
|
|
147
147
|
/** Initial HTML content */
|
|
148
148
|
html: e(t(), ""),
|
|
149
149
|
/** Initial CSS content */
|
|
@@ -159,7 +159,7 @@ const p = {
|
|
|
159
159
|
* (first) partner's leaf attributes into the label→token map that repairs
|
|
160
160
|
* label-form placeholders (`{{ Phone Number }}`) in dropped saved modules.
|
|
161
161
|
*/
|
|
162
|
-
dynamicContentList: e(
|
|
162
|
+
dynamicContentList: e(v, {}),
|
|
163
163
|
/** Valid custom field attribute names from the partner's categorized fields */
|
|
164
164
|
customFieldAttributes: e(n(t()), []),
|
|
165
165
|
/** Selected unsubscribe page IDs */
|
|
@@ -194,8 +194,8 @@ const p = {
|
|
|
194
194
|
)
|
|
195
195
|
),
|
|
196
196
|
/** Migration-only inputs (legacy block configs) */
|
|
197
|
-
migration: e(
|
|
198
|
-
}),
|
|
197
|
+
migration: e(P, {})
|
|
198
|
+
}), D = a({
|
|
199
199
|
/** Sender display name */
|
|
200
200
|
senderName: e(t(), ""),
|
|
201
201
|
/** Email subject line */
|
|
@@ -208,7 +208,7 @@ const p = {
|
|
|
208
208
|
/** Migration date for template compatibility */
|
|
209
209
|
migrationDate: e(s(), 1759696858),
|
|
210
210
|
/** Email header settings */
|
|
211
|
-
emailHeader: e(
|
|
211
|
+
emailHeader: e(D, { senderName: "", subject: "" }),
|
|
212
212
|
/** Folder name for user-saved modules (used by Stripo plugin panel for path construction) */
|
|
213
213
|
savedModulesFolderName: e(t(), S.SAVED_MODULES),
|
|
214
214
|
/** Folder name for default/prebuilt modules (used by Stripo plugin panel for path construction) */
|
|
@@ -244,8 +244,8 @@ const p = {
|
|
|
244
244
|
/** Allow persisting a template that still has validation errors (drawer "Save and Continue" soft-save). Host sets false for transactional + unsubscribe. */
|
|
245
245
|
allowSaveWithErrors: e(o(), !0),
|
|
246
246
|
reusableRecommendationStrategy: e(o(), !1),
|
|
247
|
-
/**
|
|
248
|
-
|
|
247
|
+
/** Convert linkless legacy unsubscribe blocks to text blocks and warn, on load and on module drop/copy (opt-in) */
|
|
248
|
+
legacyUnsubscribeConversion: e(o(), !1)
|
|
249
249
|
}), w = m([
|
|
250
250
|
"amp-accordion",
|
|
251
251
|
"amp-carousel",
|
|
@@ -346,7 +346,7 @@ const p = {
|
|
|
346
346
|
partner: E,
|
|
347
347
|
// Optional sections (with defaults)
|
|
348
348
|
/** Template content and presets */
|
|
349
|
-
template: e(
|
|
349
|
+
template: e(x, {}),
|
|
350
350
|
/** Editor settings */
|
|
351
351
|
editor: e(O, {}),
|
|
352
352
|
/** UI configuration */
|
|
@@ -368,23 +368,23 @@ export {
|
|
|
368
368
|
B as CustomBlockTypeSchema,
|
|
369
369
|
G as CustomRuleSchema,
|
|
370
370
|
w as DefaultBlockTypeSchema,
|
|
371
|
-
|
|
371
|
+
v as DynamicContentListSchema,
|
|
372
372
|
f as DynamicContentNodeSchema,
|
|
373
373
|
M as DynamicContentSchema,
|
|
374
374
|
O as EditorSchema,
|
|
375
|
-
|
|
375
|
+
D as EmailHeaderSchema,
|
|
376
376
|
L as FallbackFontSchema,
|
|
377
377
|
U as FeaturesSchema,
|
|
378
378
|
K as GuidoConfigSchema,
|
|
379
379
|
A as IdentitySchema,
|
|
380
|
-
|
|
380
|
+
N as LegacyRecommendationConfigSchema,
|
|
381
381
|
p as MessageType,
|
|
382
382
|
E as PartnerSchema,
|
|
383
383
|
l as ProductType,
|
|
384
384
|
_ as RegexRuleSchema,
|
|
385
385
|
q as RemoveRuleSchema,
|
|
386
386
|
H as ReplaceRuleSchema,
|
|
387
|
-
|
|
388
|
-
|
|
387
|
+
P as TemplateMigrationSchema,
|
|
388
|
+
x as TemplateSchema,
|
|
389
389
|
F as UISchema
|
|
390
390
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import
|
|
1
|
+
import o from "./Guido.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
var
|
|
3
|
+
import i from "../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var s = function() {
|
|
5
5
|
var a = this, r = a._self._c, e = a._self._setupProxy;
|
|
6
|
-
return r("div", { ref: "wrapperRef", staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), r(e.AutoSaveController), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : a._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.AuthErrorModal), r(e.FilterSelectionDrawer), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.AssignStrategyDrawer) : a._e(), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.RemoveStrategyModal) : a._e(), e.isRrsEnabled ? r(e.LegacyStrategyUpdatedModal) : a._e(),
|
|
6
|
+
return r("div", { ref: "wrapperRef", staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), r(e.AutoSaveController), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : a._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.AuthErrorModal), r(e.FilterSelectionDrawer), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.AssignStrategyDrawer) : a._e(), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.RemoveStrategyModal) : a._e(), e.isRrsEnabled ? r(e.LegacyStrategyUpdatedModal) : a._e(), e.isLegacyUnsubscribeConversionEnabled ? r(e.LegacyUnsubscribeConvertedModal) : a._e(), r(e.SaveAsTemplateDrawer), e.isSaveValidationEnabled ? r(e.ValidationErrorDrawer) : a._e(), e.isTestPartner() ? a._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(_) {
|
|
7
7
|
return e.emit("onboarding:finished");
|
|
8
8
|
} } }), r(e.UnsubscribeWrapper), r(e.LoadingWrapper)], 1);
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
t,
|
|
9
|
+
}, t = [], n = /* @__PURE__ */ i(
|
|
10
|
+
o,
|
|
12
11
|
s,
|
|
12
|
+
t,
|
|
13
13
|
!1,
|
|
14
14
|
null,
|
|
15
|
-
"
|
|
15
|
+
"34bee5bb"
|
|
16
16
|
);
|
|
17
17
|
const v = n.exports;
|
|
18
18
|
export {
|
|
@@ -5,30 +5,30 @@ import { provideGuidoActions as pe } from "../composables/useGuidoActions.js";
|
|
|
5
5
|
import { useGuidoStateBridge as fe } from "../composables/useGuidoStateBridge.js";
|
|
6
6
|
import { usePartner as ye } from "../composables/usePartner.js";
|
|
7
7
|
import { useSaveValidationRollout as ge } from "../composables/useSaveValidationRollout.js";
|
|
8
|
-
import { useStripo as
|
|
8
|
+
import { useStripo as be } from "../composables/useStripo.js";
|
|
9
9
|
import { useTimerClone as ve } from "../composables/useTimerClone.js";
|
|
10
|
-
import { migrate as
|
|
11
|
-
import { ModuleFolderDefaults as
|
|
12
|
-
import { RIBBON_SELECTOR as
|
|
10
|
+
import { migrate as V } from "../config/migrator/index.js";
|
|
11
|
+
import { ModuleFolderDefaults as $ } from "../enums/defaults.js";
|
|
12
|
+
import { RIBBON_SELECTOR as Se } from "../enums/onboarding.js";
|
|
13
13
|
import { useRecommendationExtensionStore as E } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
14
14
|
import he from "./organisms/AutoSaveController.vue.js";
|
|
15
15
|
import Ee from "./organisms/base/AuthErrorModal.vue.js";
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
16
|
+
import we from "./organisms/base/Toaster.vue.js";
|
|
17
|
+
import Ce from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
18
|
+
import De from "./organisms/header/HeaderWrapper.vue.js";
|
|
19
19
|
import ke from "./organisms/LoadingWrapper.vue.js";
|
|
20
20
|
import Fe from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import { useStripoApi as
|
|
24
|
-
import { useConfigStore as
|
|
25
|
-
import { useDynamicContentStore as
|
|
26
|
-
import { useEditorStore as
|
|
27
|
-
import { usePreviewStore as
|
|
21
|
+
import Me from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
22
|
+
import Re from "./organisms/validation/ValidationErrorDrawer.vue.js";
|
|
23
|
+
import { useStripoApi as Le } from "../services/stripoApi.js";
|
|
24
|
+
import { useConfigStore as Te } from "../stores/config.js";
|
|
25
|
+
import { useDynamicContentStore as Ue } from "../stores/dynamic-content.js";
|
|
26
|
+
import { useEditorStore as w } from "../stores/editor.js";
|
|
27
|
+
import { usePreviewStore as Ie } from "../stores/preview.js";
|
|
28
28
|
import { useSaveValidationStore as Ae } from "../stores/save-validation.js";
|
|
29
29
|
import { useTemplateStore as Be } from "../stores/template.js";
|
|
30
30
|
import { useUnsubscribeStore as Ne } from "../stores/unsubscribe.js";
|
|
31
|
-
import { readTrackFloor as
|
|
31
|
+
import { readTrackFloor as z } from "../utils/linkTrackingIds.js";
|
|
32
32
|
const pt = /* @__PURE__ */ ce({
|
|
33
33
|
__name: "Guido",
|
|
34
34
|
props: {
|
|
@@ -36,8 +36,8 @@ const pt = /* @__PURE__ */ ce({
|
|
|
36
36
|
ready: { type: Boolean, default: !0 }
|
|
37
37
|
},
|
|
38
38
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
39
|
-
setup(
|
|
40
|
-
const s =
|
|
39
|
+
setup(H, { expose: q, emit: r }) {
|
|
40
|
+
const s = H, K = c(
|
|
41
41
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
42
42
|
), j = c(
|
|
43
43
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
@@ -46,14 +46,14 @@ const pt = /* @__PURE__ */ ce({
|
|
|
46
46
|
), Q = c(
|
|
47
47
|
() => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
|
|
48
48
|
), X = c(
|
|
49
|
-
() => import("./organisms/display-conditions/DisplayConditionsHost.vue.js")
|
|
50
|
-
), Y = c(
|
|
51
49
|
() => import("./organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js")
|
|
52
|
-
),
|
|
50
|
+
), Y = c(
|
|
51
|
+
() => import("./organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.js")
|
|
52
|
+
), C = W(), f = W(), y = Ue(), D = Ne(), o = Te();
|
|
53
53
|
s.ready && o.init(s.config);
|
|
54
|
-
const d =
|
|
54
|
+
const d = w(), Z = Ie(), u = l(() => d.hasChanges), { isTestPartner: ee } = ye(), { isEnabled: te } = ge(), k = () => {
|
|
55
55
|
var t;
|
|
56
|
-
return (t =
|
|
56
|
+
return (t = C.value) == null ? void 0 : t.handleSave(!0);
|
|
57
57
|
}, F = (t) => {
|
|
58
58
|
d.loadingStatus = t;
|
|
59
59
|
};
|
|
@@ -65,15 +65,17 @@ const pt = /* @__PURE__ */ ce({
|
|
|
65
65
|
userId: o.userId,
|
|
66
66
|
username: o.username,
|
|
67
67
|
partnerName: o.partnerName,
|
|
68
|
-
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) ||
|
|
69
|
-
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) ||
|
|
68
|
+
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || $.SAVED_MODULES,
|
|
69
|
+
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || $.DEFAULT_MODULES
|
|
70
70
|
};
|
|
71
|
-
}, { initPlugin:
|
|
71
|
+
}, { initPlugin: M, preloadRuntime: R } = be(), { runExclusive: L, beginMount: T, isCurrentMount: b } = ue();
|
|
72
72
|
let p = 0;
|
|
73
|
-
const { getDefaultTemplate:
|
|
73
|
+
const { getDefaultTemplate: U } = Le(), { cloneTimersOnSave: I, hasTimerBlocks: A } = ve(), oe = l(() => {
|
|
74
74
|
var t;
|
|
75
75
|
return !((t = o.ui) != null && t.showHeader);
|
|
76
|
-
}), ne = l(() => o.isFeatureEnabled("reusableRecommendationStrategy")), re = l(
|
|
76
|
+
}), ne = l(() => o.isFeatureEnabled("reusableRecommendationStrategy")), re = l(
|
|
77
|
+
() => o.isFeatureEnabled("legacyUnsubscribeConversion")
|
|
78
|
+
), ae = l(
|
|
77
79
|
() => !!E().recommendationConfigs.strategyId
|
|
78
80
|
);
|
|
79
81
|
pe({
|
|
@@ -104,44 +106,44 @@ const pt = /* @__PURE__ */ ce({
|
|
|
104
106
|
console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", a, m);
|
|
105
107
|
};
|
|
106
108
|
let i = null;
|
|
107
|
-
const
|
|
109
|
+
const S = () => {
|
|
108
110
|
var e;
|
|
109
|
-
const t = document.querySelector(
|
|
111
|
+
const t = document.querySelector(Se);
|
|
110
112
|
(e = f.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
|
|
111
113
|
}, h = async () => {
|
|
112
114
|
var t;
|
|
113
115
|
try {
|
|
114
116
|
o.initialized || o.init(s.config), d.templateId = o.templateId;
|
|
115
|
-
const e = o.template, a = (e == null ? void 0 : e.html) || "", m = (e == null ? void 0 : e.css) || "",
|
|
116
|
-
|
|
117
|
-
const
|
|
117
|
+
const e = o.template, a = (e == null ? void 0 : e.html) || "", m = (e == null ? void 0 : e.css) || "", P = (e == null ? void 0 : e.preselectedDynamicContent) || [];
|
|
118
|
+
D.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
|
|
119
|
+
const _ = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, O = o.isFeatureEnabled("linkTrackingIds"), x = {
|
|
118
120
|
partnerName: o.partnerName,
|
|
119
121
|
campaignUrls: e == null ? void 0 : e.recommendationCampaignUrls,
|
|
120
122
|
rrsEnabled: o.isFeatureEnabled("reusableRecommendationStrategy")
|
|
121
123
|
};
|
|
122
124
|
let n = {
|
|
123
|
-
html: a && await
|
|
125
|
+
html: a && await V(a, _, x),
|
|
124
126
|
css: m
|
|
125
127
|
};
|
|
126
|
-
n.html || (n = await
|
|
127
|
-
const se =
|
|
128
|
-
A(n.html) && (n.html = await
|
|
128
|
+
n.html || (n = await U(), n.html = await V(n.html, _, x));
|
|
129
|
+
const se = O ? z(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
|
|
130
|
+
A(n.html) && (n.html = await I(n.html)), O && (d.trackIdSessionFloor = Math.max(se, z(n.html)));
|
|
129
131
|
const ie = {
|
|
130
|
-
preselectedDynamicContentList:
|
|
132
|
+
preselectedDynamicContentList: P,
|
|
131
133
|
onReady: () => {
|
|
132
134
|
console.debug("guido:ready"), r("ready");
|
|
133
135
|
}
|
|
134
136
|
};
|
|
135
|
-
p =
|
|
137
|
+
p = T(), await M(n, g(), ie), y.selectedDynamicContentList = P;
|
|
136
138
|
} catch (e) {
|
|
137
139
|
console.error("Failed to initialize Stripo editor:", e);
|
|
138
140
|
}
|
|
139
141
|
};
|
|
140
142
|
return de(async () => {
|
|
141
143
|
var e;
|
|
142
|
-
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), E().$reset(),
|
|
144
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), E().$reset(), w().$reset(), Be().$reset(), Ae().$reset(), S();
|
|
143
145
|
const t = (e = f.value) == null ? void 0 : e.parentElement;
|
|
144
|
-
if (t && (i = new ResizeObserver(
|
|
146
|
+
if (t && (i = new ResizeObserver(S), i.observe(t)), R(), s.ready)
|
|
145
147
|
await h();
|
|
146
148
|
else {
|
|
147
149
|
const a = G(() => s.ready, (m) => {
|
|
@@ -150,14 +152,14 @@ const pt = /* @__PURE__ */ ce({
|
|
|
150
152
|
}
|
|
151
153
|
document.addEventListener("dynamic-content:open", v);
|
|
152
154
|
}), me(() => {
|
|
153
|
-
if (i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", v), E().disposeStrategyPageReturn(),
|
|
155
|
+
if (i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", v), E().disposeStrategyPageReturn(), b(p))
|
|
154
156
|
try {
|
|
155
|
-
|
|
157
|
+
w().isStripoInitialized = !1;
|
|
156
158
|
} catch (t) {
|
|
157
159
|
console.debug("Failed to close the editor readiness gate on unmount", t);
|
|
158
160
|
}
|
|
159
|
-
|
|
160
|
-
if (
|
|
161
|
+
L(async () => {
|
|
162
|
+
if (b(p))
|
|
161
163
|
try {
|
|
162
164
|
window.UIEditor.removeEditor();
|
|
163
165
|
} catch {
|
|
@@ -172,7 +174,7 @@ const pt = /* @__PURE__ */ ce({
|
|
|
172
174
|
hasChanges: u,
|
|
173
175
|
saveSilent: k,
|
|
174
176
|
setLoading: F
|
|
175
|
-
}), { __sfc: !0, PreviewContainer: K, OnboardingWrapper: j, AssignStrategyDrawer: J, RemoveStrategyModal: Q,
|
|
177
|
+
}), { __sfc: !0, PreviewContainer: K, OnboardingWrapper: j, AssignStrategyDrawer: J, RemoveStrategyModal: Q, LegacyStrategyUpdatedModal: X, LegacyUnsubscribeConvertedModal: Y, headerWrapperRef: C, wrapperRef: f, dynamicContentStore: y, unsubscribeStore: D, props: s, configStore: o, editorStore: d, previewStore: Z, hasChanges: u, isTestPartner: ee, isSaveValidationEnabled: te, saveSilent: k, setLoading: F, emit: r, buildMetadata: g, initPlugin: M, preloadRuntime: R, runExclusive: L, beginMount: T, isCurrentMount: b, mountGeneration: p, getDefaultTemplate: U, cloneTimersOnSave: I, hasTimerBlocks: A, noHeader: oe, isRrsEnabled: ne, isLegacyUnsubscribeConversionEnabled: re, hasAssignedStrategy: ae, insertDynamicContent: B, closeDynamicContent: N, handleDynamicContentOpen: v, ribbonObserver: i, updateRibbonOffset: S, startEditor: h, AutoSaveController: he, AuthErrorModal: Ee, Toaster: we, FilterSelectionDrawer: Ce, HeaderWrapper: De, LoadingWrapper: ke, SaveAsTemplateDrawer: Fe, UnsubscribeWrapper: Me, ValidationErrorDrawer: Re };
|
|
176
178
|
}
|
|
177
179
|
});
|
|
178
180
|
export {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import t from "./LegacyUnsubscribeConvertedModal.vue2.js";
|
|
2
|
+
import n from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
|
+
var r = function() {
|
|
4
|
+
var o = this, s = o._self._c, e = o._self._setupProxy;
|
|
5
|
+
return e.isVisible ? s(e.WpModal, { attrs: { id: "guido__legacy-unsubscribe-converted-modal", size: "small", state: "warning", "close-on-outside-click": !1, "footer-button-options": e.footerButtonOptions, title: e.trans("email-editor.legacy-unsubscribe-converted-modal-title") }, on: { close: e.close, "primary-action": e.close, "secondary-action": e.openAcademy } }, [s("p", [o._v(o._s(e.trans("email-editor.legacy-unsubscribe-converted-modal-message")))])]) : o._e();
|
|
6
|
+
}, a = [], i = /* @__PURE__ */ n(
|
|
7
|
+
t,
|
|
8
|
+
r,
|
|
9
|
+
a,
|
|
10
|
+
!1,
|
|
11
|
+
null,
|
|
12
|
+
null
|
|
13
|
+
);
|
|
14
|
+
const d = i.exports;
|
|
15
|
+
export {
|
|
16
|
+
d as default
|
|
17
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { defineComponent as s, computed as t } from "vue";
|
|
2
|
+
import i from "../../wrappers/WpModal.vue.js";
|
|
3
|
+
import { useTranslations as a } from "../../../composables/useTranslations.js";
|
|
4
|
+
import { ACADEMY_LINKS as c } from "../../../enums/academy.js";
|
|
5
|
+
import { useEditorStore as l } from "../../../stores/editor.js";
|
|
6
|
+
const B = /* @__PURE__ */ s({
|
|
7
|
+
__name: "LegacyUnsubscribeConvertedModal",
|
|
8
|
+
setup(p) {
|
|
9
|
+
const e = a(), o = l(), n = t(
|
|
10
|
+
() => o.isLegacyUnsubscribeModalRequested && o.isStripoInitialized
|
|
11
|
+
), r = t(() => ({
|
|
12
|
+
cancelOrBackButton: {
|
|
13
|
+
type: "secondary",
|
|
14
|
+
styling: "ghost",
|
|
15
|
+
labelText: e("settings.cancel")
|
|
16
|
+
},
|
|
17
|
+
secondaryButton: {
|
|
18
|
+
type: "subtle-primary",
|
|
19
|
+
labelText: e("left-menu.visit-academy")
|
|
20
|
+
},
|
|
21
|
+
primaryButton: {
|
|
22
|
+
type: "primary",
|
|
23
|
+
labelText: e("action-builder.ok")
|
|
24
|
+
}
|
|
25
|
+
}));
|
|
26
|
+
return { __sfc: !0, trans: e, editorStore: o, isVisible: n, footerButtonOptions: r, close: () => {
|
|
27
|
+
o.isLegacyUnsubscribeModalRequested = !1;
|
|
28
|
+
}, openAcademy: () => {
|
|
29
|
+
window.open(c.LEGACY_UNSUBSCRIBE_MODULE, "_blank", "noopener,noreferrer");
|
|
30
|
+
}, WpModal: i };
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
export {
|
|
34
|
+
B as default
|
|
35
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useConfigStore as
|
|
3
|
-
const
|
|
1
|
+
import r from "../extensions/ModulesTabIcons/extension.js";
|
|
2
|
+
import { useConfigStore as l } from "../stores/config.js";
|
|
3
|
+
const a = {
|
|
4
4
|
"amp-accordion": "ampAccordionEnabled",
|
|
5
5
|
"amp-carousel": "ampCarouselEnabled",
|
|
6
6
|
"amp-form-controls": "ampFormControlsEnabled",
|
|
@@ -14,7 +14,7 @@ const s = {
|
|
|
14
14
|
"text-block": "textEnabled",
|
|
15
15
|
"timer-block": "timerEnabled",
|
|
16
16
|
"video-block": "videoEnabled"
|
|
17
|
-
},
|
|
17
|
+
}, s = {
|
|
18
18
|
"dynamic-content": () => import("../extensions/DynamicContent/extension.js"),
|
|
19
19
|
"checkbox-block": () => import("../extensions/Blocks/Checkbox/extension.js"),
|
|
20
20
|
"radio-button-block": () => import("../extensions/Blocks/RadioButton/extension.js"),
|
|
@@ -22,48 +22,40 @@ const s = {
|
|
|
22
22
|
"unsubscribe-block": () => import("../extensions/Blocks/Unsubscribe/extension.js"),
|
|
23
23
|
"coupon-block": () => import("../extensions/Blocks/CouponBlock/extension.js"),
|
|
24
24
|
"items-block": () => import("../extensions/Blocks/Items/extension.js")
|
|
25
|
-
},
|
|
26
|
-
if (!
|
|
25
|
+
}, i = (n) => {
|
|
26
|
+
if (!n || !n.length)
|
|
27
27
|
return {};
|
|
28
28
|
const t = {};
|
|
29
|
-
return
|
|
30
|
-
const e =
|
|
29
|
+
return n.forEach((o) => {
|
|
30
|
+
const e = a[o];
|
|
31
31
|
e && (t[e] = !1);
|
|
32
32
|
}), t;
|
|
33
|
-
}, m = async (
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return n;
|
|
42
|
-
const e = await Promise.all(
|
|
43
|
-
o.map(async (r) => {
|
|
44
|
-
const a = i[r];
|
|
45
|
-
return a ? (await a()).default : null;
|
|
33
|
+
}, b = () => [r], m = async (n) => {
|
|
34
|
+
const t = b();
|
|
35
|
+
if (!n || !n.length)
|
|
36
|
+
return t;
|
|
37
|
+
const o = await Promise.all(
|
|
38
|
+
n.map(async (e) => {
|
|
39
|
+
const c = s[e];
|
|
40
|
+
return c ? (await c()).default : null;
|
|
46
41
|
})
|
|
47
42
|
);
|
|
48
43
|
return [
|
|
49
|
-
...
|
|
50
|
-
...
|
|
44
|
+
...t,
|
|
45
|
+
...o.filter((e) => e !== null)
|
|
51
46
|
];
|
|
52
|
-
},
|
|
53
|
-
const
|
|
47
|
+
}, E = () => {
|
|
48
|
+
const n = l();
|
|
54
49
|
return {
|
|
55
50
|
getStripoBlocksConfig: async () => {
|
|
56
|
-
const
|
|
51
|
+
const o = n.blocks;
|
|
57
52
|
return {
|
|
58
|
-
baseBlocks:
|
|
59
|
-
extensions: await
|
|
60
|
-
n == null ? void 0 : n.includeCustoms,
|
|
61
|
-
o.isFeatureEnabled("externalDisplayConditions")
|
|
62
|
-
)
|
|
53
|
+
baseBlocks: i(o == null ? void 0 : o.excludeDefaults),
|
|
54
|
+
extensions: await m(o == null ? void 0 : o.includeCustoms)
|
|
63
55
|
};
|
|
64
56
|
}
|
|
65
57
|
};
|
|
66
58
|
};
|
|
67
59
|
export {
|
|
68
|
-
|
|
60
|
+
E as useBlocksConfig
|
|
69
61
|
};
|
|
@@ -1,33 +1,49 @@
|
|
|
1
|
-
import { useConfig as
|
|
2
|
-
import { useToaster as
|
|
3
|
-
import { useTranslations as
|
|
4
|
-
import { ToasterTypeOptions as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { useConfig as g } from "./useConfig.js";
|
|
2
|
+
import { useToaster as h } from "./useToaster.js";
|
|
3
|
+
import { useTranslations as C } from "./useTranslations.js";
|
|
4
|
+
import { ToasterTypeOptions as v } from "../enums/toaster.js";
|
|
5
|
+
import { useEditorStore as M } from "../stores/editor.js";
|
|
6
|
+
import { buildDynamicContentLookup as T, convertModuleDynamicContent as D } from "../utils/dynamicContentConverter.js";
|
|
7
|
+
import { flattenDynamicContentList as L } from "../utils/genericUtil.js";
|
|
8
|
+
import { repairItemsCurrencyAttributes as O } from "../utils/itemsCurrencyRepair.js";
|
|
9
|
+
import { convertLegacyUnsubscribeInModuleHtml as E } from "../utils/legacyUnsubscribeConversion.js";
|
|
10
|
+
const N = "dynamic-content.unresolved-attributes-on-drop", W = () => {
|
|
11
|
+
const { template: d, isFeatureEnabled: s } = g(), { showToaster: f } = h(), b = C();
|
|
12
|
+
return { handleModuleAdd: (t, o) => {
|
|
13
|
+
var u, i, a;
|
|
14
|
+
let l = !1, c = !1;
|
|
12
15
|
try {
|
|
13
|
-
if ((
|
|
16
|
+
if ((t == null ? void 0 : t.action) !== "ADD" && (t == null ? void 0 : t.action) !== "COPY")
|
|
14
17
|
return;
|
|
15
|
-
const
|
|
16
|
-
if (!
|
|
18
|
+
const e = (u = o == null ? void 0 : o.getTargetNode) == null ? void 0 : u.call(o), n = (i = e == null ? void 0 : e.getOuterHTML) == null ? void 0 : i.call(e);
|
|
19
|
+
if (!e || typeof n != "string")
|
|
17
20
|
return;
|
|
18
|
-
let
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
} catch (t) {
|
|
26
|
-
console.error("Failed to repair module on add:", t);
|
|
21
|
+
let r = O(n), m = !1;
|
|
22
|
+
s("legacyUnsubscribeConversion") && ({ html: r, converted: m } = E(r));
|
|
23
|
+
const p = T(L((a = d.value) == null ? void 0 : a.dynamicContentList));
|
|
24
|
+
let y = [];
|
|
25
|
+
p.size > 0 && ({ html: r, unresolved: y } = D(r, p, s("liquidSyntax"))), r !== n && o.modifyHtml(e).replaceWith(r), l = m, c = y.length > 0;
|
|
26
|
+
} catch (e) {
|
|
27
|
+
console.error("Failed to repair module on add:", e);
|
|
27
28
|
}
|
|
29
|
+
if (l)
|
|
30
|
+
try {
|
|
31
|
+
M().isLegacyUnsubscribeModalRequested = !0;
|
|
32
|
+
} catch (e) {
|
|
33
|
+
console.error("Failed to request the legacy unsubscribe modal:", e);
|
|
34
|
+
}
|
|
35
|
+
if (c)
|
|
36
|
+
try {
|
|
37
|
+
f({
|
|
38
|
+
type: v.Warning,
|
|
39
|
+
message: b(N)
|
|
40
|
+
});
|
|
41
|
+
} catch (e) {
|
|
42
|
+
console.error("Failed to warn about unresolved dynamic content on add:", e);
|
|
43
|
+
}
|
|
28
44
|
} };
|
|
29
45
|
};
|
|
30
46
|
export {
|
|
31
47
|
N as UNRESOLVED_DYNAMIC_CONTENT_ON_DROP_KEY,
|
|
32
|
-
|
|
48
|
+
W as useModuleRepair
|
|
33
49
|
};
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { migrateCheckbox as i } from "./checkboxMigrator.js";
|
|
2
2
|
import { migrateCouponBlock as e } from "./couponBlockMigrator.js";
|
|
3
3
|
import { migrateItemsBlock as a } from "./itemsBlockMigrator.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
4
|
+
import { migrateLegacyUnsubscribeText as n } from "./legacyUnsubscribeTextMigrator.js";
|
|
5
|
+
import { migrateProductNameLink as c } from "./productNameLinkMigrator.js";
|
|
6
|
+
import { migrateRadioButton as g } from "./radioButtonMigrator.js";
|
|
7
|
+
import { migrateRecommendation as f } from "./recommendationMigrator.js";
|
|
8
|
+
import { migrateRecommendationPartnerScope as p } from "./recommendationPartnerMigrator.js";
|
|
9
|
+
import { migrateRecommendationTitle as s } from "./recommendationTitleMigrator.js";
|
|
9
10
|
import { migrateSocialIcons as d } from "./socialIconMigrator.js";
|
|
10
11
|
import { migrateUnsubscribe as l } from "./unsubscribeMigrator.js";
|
|
11
|
-
const
|
|
12
|
-
let m =
|
|
13
|
-
return m = i(m), m =
|
|
12
|
+
const T = async (o, t = {}, r) => {
|
|
13
|
+
let m = o;
|
|
14
|
+
return m = i(m), m = g(m), m = n(m), m = await l(m), m = e(m), m = f(m, t), r && (m = p(m, r)), m = s(m), m = a(m), m = c(m), m = d(m), m;
|
|
14
15
|
};
|
|
15
16
|
export {
|
|
16
|
-
|
|
17
|
+
T as migrate
|
|
17
18
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useConfigStore as o } from "../../stores/config.js";
|
|
2
|
+
import { useEditorStore as i } from "../../stores/editor.js";
|
|
3
|
+
import { convertLegacyUnsubscribeInDocumentHtml as n } from "../../utils/legacyUnsubscribeConversion.js";
|
|
4
|
+
const a = (e) => {
|
|
5
|
+
try {
|
|
6
|
+
if (!o().isFeatureEnabled("legacyUnsubscribeConversion"))
|
|
7
|
+
return e;
|
|
8
|
+
const { html: r, converted: t } = n(e);
|
|
9
|
+
return t && (i().isLegacyUnsubscribeModalRequested = !0), r;
|
|
10
|
+
} catch (r) {
|
|
11
|
+
return console.error("LegacyUnsubscribeTextMigrator failed:", r), e;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
a as migrateLegacyUnsubscribeText
|
|
16
|
+
};
|
package/dist/enums/academy.js
CHANGED
|
@@ -2,8 +2,8 @@ const e = "https://academy.insiderone.com", o = {
|
|
|
2
2
|
EMAIL_EDITOR: `${e}/docs/email-drag-and-drop-editor`,
|
|
3
3
|
GLOBAL_UNSUBSCRIBE: `${e}/docs/global-unsubscribe-preference-center`,
|
|
4
4
|
AMP_FOR_EMAILS: `${e}/docs/amp-for-emails`,
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
EMAIL_RECOMMENDATION_BLOCK: `${e}/docs/new-editor-email-recommendation-block`,
|
|
6
|
+
LEGACY_UNSUBSCRIBE_MODULE: `${e}/docs/new-editor-add-unsubscribe-pages-into-emails`
|
|
7
7
|
};
|
|
8
8
|
export {
|
|
9
9
|
o as ACADEMY_LINKS
|