@useinsider/guido 3.24.0-beta.82c2d5e → 3.24.0-beta.8779b29
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 +1 -9
- package/dist/@types/config/schemas.js +14 -14
- package/dist/components/Guido.vue.js +4 -4
- package/dist/components/Guido.vue2.js +88 -90
- package/dist/composables/useModuleRepair.js +23 -30
- package/dist/config/migrator/index.js +16 -16
- package/dist/config/migrator/itemsPriceFormatMigrator.js +20 -0
- package/dist/enums/academy.js +1 -2
- package/dist/extensions/Blocks/Items/block.js +115 -77
- package/dist/extensions/Blocks/Items/constants/currency.js +59 -14
- package/dist/extensions/Blocks/Items/controls/blockBackground/index.js +11 -0
- package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +34 -23
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +62 -51
- package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +18 -17
- package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +42 -31
- package/dist/extensions/Blocks/Items/controls/priceFormat.js +135 -0
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +141 -120
- package/dist/extensions/Blocks/Items/enums/controlEnums.js +2 -2
- package/dist/extensions/Blocks/Items/extension.js +15 -13
- package/dist/extensions/Blocks/Items/items.css.js +19 -0
- package/dist/extensions/Blocks/Items/settingsPanel.js +38 -25
- package/dist/extensions/Blocks/Items/template.js +250 -212
- package/dist/extensions/Blocks/Items/utils/priceFormatOps.js +185 -0
- package/dist/extensions/Blocks/Recommendation/utils/priceFormatter.js +1 -0
- package/dist/extensions/Blocks/controlFactories.js +104 -104
- package/dist/guido.css +1 -1
- package/dist/package.json.js +2 -2
- 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 +11 -2
- package/dist/src/config/migrator/index.d.ts +4 -1
- package/dist/src/config/migrator/itemsPriceFormatMigrator.d.ts +1 -0
- package/dist/src/enums/academy.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/block.d.ts +6 -9
- package/dist/src/extensions/Blocks/Items/constants/currency.d.ts +32 -0
- package/dist/src/extensions/Blocks/Items/controls/blockBackground/index.d.ts +15 -0
- package/dist/src/extensions/Blocks/Items/controls/priceFormat.d.ts +24 -0
- package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +1 -0
- package/dist/src/extensions/Blocks/Items/enums/controlEnums.d.ts +2 -0
- package/dist/src/extensions/Blocks/Items/template.d.ts +4 -1
- package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +3 -0
- package/dist/src/extensions/Blocks/Items/utils/priceFormatOps.d.ts +66 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/priceFormatter.d.ts +12 -0
- package/dist/src/extensions/Blocks/controlFactories.d.ts +1 -1
- package/dist/src/stores/config.d.ts +20 -20
- package/dist/src/stores/editor.d.ts +0 -27
- package/dist/src/utils/itemsCurrencyRepair.d.ts +5 -1
- package/dist/stores/editor.js +0 -1
- package/dist/utils/itemsCurrencyRepair.js +29 -24
- package/dist/utils/pairProductVariables.js +119 -99
- package/package.json +1 -1
- package/dist/components/organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.js +0 -17
- package/dist/components/organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue2.js +0 -30
- package/dist/config/migrator/legacyUnsubscribeTextMigrator.js +0 -16
- package/dist/src/components/organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.d.ts +0 -2
- package/dist/src/config/migrator/legacyUnsubscribeTextMigrator.d.ts +0 -1
- package/dist/src/utils/legacyUnsubscribeConversion.d.ts +0 -10
- package/dist/utils/legacyUnsubscribeConversion.js +0 -49
package/README.md
CHANGED
|
@@ -171,8 +171,8 @@ const config: GuidoConfigInput = {
|
|
|
171
171
|
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).
|
|
172
172
|
allowSaveWithErrors?: boolean, // Default: true - Allow the validation drawer's "Save and Continue" soft-save. Set false to hard-block invalid saves (transactional + unsubscribe pages).
|
|
173
173
|
reusableRecommendationStrategy?: boolean, // Default: false - Assign an RRS strategy to recommendation blocks instead of per-block algorithm/filters/shuffle/product-count settings.
|
|
174
|
-
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.
|
|
175
174
|
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.
|
|
175
|
+
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).
|
|
176
176
|
},
|
|
177
177
|
|
|
178
178
|
// Optional: Callbacks
|
|
@@ -705,14 +705,6 @@ multiple partners (e.g. architect) should key by partner and place the active pa
|
|
|
705
705
|
first. Omit the prop and the repair is a safe no-op — nothing is rewritten and no
|
|
706
706
|
toaster fires (useful before the host has wired the catalog).
|
|
707
707
|
|
|
708
|
-
With `features.legacyUnsubscribeConversion: true`, a dropped or copied module's legacy
|
|
709
|
-
unsubscribe block that has no unsubscribe link (the old editor reused it as plain text,
|
|
710
|
-
e.g. a company address) becomes a plain text block that keeps its content, and a warning
|
|
711
|
-
modal explains it. The same conversion runs when a template is opened. Register these
|
|
712
|
-
keys host-side: `email-editor.legacy-unsubscribe-converted-modal-title`,
|
|
713
|
-
`email-editor.legacy-unsubscribe-converted-modal-message` and
|
|
714
|
-
`email-editor.legacy-unsubscribe-converted-modal-visit-academy` (OK reuses `action-builder.ok`).
|
|
715
|
-
|
|
716
708
|
---
|
|
717
709
|
|
|
718
710
|
## Development
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ModuleFolderDefaults as
|
|
2
|
-
import { object as a, number as s, optional as e, string as t, picklist as m, pipe as i, minLength as b, custom as k, boolean as o, array as c, transform as
|
|
1
|
+
import { ModuleFolderDefaults as S } from "../../enums/defaults.js";
|
|
2
|
+
import { object as a, number as s, optional as e, string as t, picklist as m, pipe as i, minLength as b, custom as k, boolean as o, array as c, transform as y, unknown as r, record as g, fallback as R, literal as u, looseObject as C, variant as T, union as h, lazy as I } from "../../node_modules/valibot/dist/index.js";
|
|
3
3
|
const p = {
|
|
4
4
|
/** Promotional/marketing emails */
|
|
5
5
|
PROMOTIONAL: 1,
|
|
@@ -84,7 +84,7 @@ const p = {
|
|
|
84
84
|
children: e(c(f)),
|
|
85
85
|
// eslint-disable-next-line camelcase -- backend field name
|
|
86
86
|
select_items: e(c(f))
|
|
87
|
-
})),
|
|
87
|
+
})), P = g(
|
|
88
88
|
t(),
|
|
89
89
|
R(c(f), [])
|
|
90
90
|
), N = C({
|
|
@@ -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
|
+
}), v = 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
|
|
@@ -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(P, {}),
|
|
163
163
|
/** Valid custom field attribute names from the partner's categorized fields */
|
|
164
164
|
customFieldAttributes: e(c(t()), []),
|
|
165
165
|
/** Selected unsubscribe page IDs */
|
|
@@ -176,7 +176,7 @@ const p = {
|
|
|
176
176
|
trackIdCounter: e(
|
|
177
177
|
i(
|
|
178
178
|
s(),
|
|
179
|
-
|
|
179
|
+
y((n) => Number.isFinite(n) ? Math.max(0, Math.floor(n)) : 0)
|
|
180
180
|
),
|
|
181
181
|
0
|
|
182
182
|
),
|
|
@@ -190,11 +190,11 @@ const p = {
|
|
|
190
190
|
recommendationCampaignUrls: e(
|
|
191
191
|
i(
|
|
192
192
|
r(),
|
|
193
|
-
|
|
193
|
+
y((n) => n && typeof n == "object" ? { ...n } : void 0)
|
|
194
194
|
)
|
|
195
195
|
),
|
|
196
196
|
/** Migration-only inputs (legacy block configs) */
|
|
197
|
-
migration: e(
|
|
197
|
+
migration: e(v, {})
|
|
198
198
|
}), D = a({
|
|
199
199
|
/** Sender display name */
|
|
200
200
|
senderName: e(t(), ""),
|
|
@@ -210,9 +210,9 @@ const p = {
|
|
|
210
210
|
/** Email header settings */
|
|
211
211
|
emailHeader: e(D, { senderName: "", subject: "" }),
|
|
212
212
|
/** Folder name for user-saved modules (used by Stripo plugin panel for path construction) */
|
|
213
|
-
savedModulesFolderName: e(t(),
|
|
213
|
+
savedModulesFolderName: e(t(), S.SAVED_MODULES),
|
|
214
214
|
/** Folder name for default/prebuilt modules (used by Stripo plugin panel for path construction) */
|
|
215
|
-
defaultModulesFolderName: e(t(),
|
|
215
|
+
defaultModulesFolderName: e(t(), S.DEFAULT_MODULES)
|
|
216
216
|
}), F = a({
|
|
217
217
|
/** Whether to show the header bar */
|
|
218
218
|
showHeader: e(o(), !0),
|
|
@@ -245,8 +245,8 @@ const p = {
|
|
|
245
245
|
/** Allow persisting a template that still has validation errors (drawer "Save and Continue" soft-save). Host sets false for transactional + unsubscribe. */
|
|
246
246
|
allowSaveWithErrors: e(o(), !0),
|
|
247
247
|
reusableRecommendationStrategy: e(o(), !1),
|
|
248
|
-
/**
|
|
249
|
-
|
|
248
|
+
/** Items block: Recommendation-style price formatting (root currency-* attrs, raw price tags). Released dark. */
|
|
249
|
+
itemsPriceFormatting: e(o(), !1)
|
|
250
250
|
}), w = m([
|
|
251
251
|
"amp-accordion",
|
|
252
252
|
"amp-carousel",
|
|
@@ -369,7 +369,7 @@ export {
|
|
|
369
369
|
B as CustomBlockTypeSchema,
|
|
370
370
|
G as CustomRuleSchema,
|
|
371
371
|
w as DefaultBlockTypeSchema,
|
|
372
|
-
|
|
372
|
+
P as DynamicContentListSchema,
|
|
373
373
|
f as DynamicContentNodeSchema,
|
|
374
374
|
M as DynamicContentSchema,
|
|
375
375
|
O as EditorSchema,
|
|
@@ -385,7 +385,7 @@ export {
|
|
|
385
385
|
_ as RegexRuleSchema,
|
|
386
386
|
q as RemoveRuleSchema,
|
|
387
387
|
H as ReplaceRuleSchema,
|
|
388
|
-
|
|
388
|
+
v as TemplateMigrationSchema,
|
|
389
389
|
x as TemplateSchema,
|
|
390
390
|
F as UISchema
|
|
391
391
|
};
|
|
@@ -3,7 +3,7 @@ import o from "./Guido.vue2.js";
|
|
|
3
3
|
import i from "../_virtual/_plugin-vue2_normalizer.js";
|
|
4
4
|
var t = 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), r(e.AutoSaveController, { ref: "autoSaveControllerRef" }), 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), r(e.AutoSaveController, { ref: "autoSaveControllerRef" }), 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(), 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
9
|
}, s = [], n = /* @__PURE__ */ i(
|
|
@@ -12,9 +12,9 @@ var t = function() {
|
|
|
12
12
|
s,
|
|
13
13
|
!1,
|
|
14
14
|
null,
|
|
15
|
-
"
|
|
15
|
+
"98b59f91"
|
|
16
16
|
);
|
|
17
|
-
const
|
|
17
|
+
const c = n.exports;
|
|
18
18
|
export {
|
|
19
|
-
|
|
19
|
+
c as default
|
|
20
20
|
};
|
|
@@ -1,76 +1,74 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as ue, defineAsyncComponent as l, ref as W, computed as f, watch as G, onMounted as pe, onUnmounted as fe } from "vue";
|
|
2
2
|
import { useCortexBlueprintBridge as ge } from "../composables/useCortexBlueprintBridge.js";
|
|
3
|
-
import { useEditorLock as
|
|
3
|
+
import { useEditorLock as ye } from "../composables/useEditorLock.js";
|
|
4
4
|
import { startEditorOpenMetrics as ve } from "../composables/useEditorOpenMetrics.js";
|
|
5
|
-
import { provideGuidoActions as
|
|
6
|
-
import { useGuidoStateBridge as
|
|
7
|
-
import { usePartner as
|
|
8
|
-
import { useSaveValidationRollout as
|
|
5
|
+
import { provideGuidoActions as be } from "../composables/useGuidoActions.js";
|
|
6
|
+
import { useGuidoStateBridge as Se } from "../composables/useGuidoStateBridge.js";
|
|
7
|
+
import { usePartner as he } from "../composables/usePartner.js";
|
|
8
|
+
import { useSaveValidationRollout as Ee } from "../composables/useSaveValidationRollout.js";
|
|
9
9
|
import { useStripo as we } from "../composables/useStripo.js";
|
|
10
10
|
import { useTimerClone as Te } from "../composables/useTimerClone.js";
|
|
11
11
|
import { useToaster as ke } from "../composables/useToaster.js";
|
|
12
|
-
import { useTranslations as
|
|
13
|
-
import { migrate as
|
|
12
|
+
import { useTranslations as Ce } from "../composables/useTranslations.js";
|
|
13
|
+
import { migrate as De } from "../config/migrator/index.js";
|
|
14
14
|
import { ModuleFolderDefaults as $ } from "../enums/defaults.js";
|
|
15
|
-
import { RIBBON_SELECTOR as
|
|
16
|
-
import { ToasterTypeOptions as
|
|
17
|
-
import { useRecommendationExtensionStore as z, disposeStrategyPageReturnListeners as
|
|
15
|
+
import { RIBBON_SELECTOR as Fe } from "../enums/onboarding.js";
|
|
16
|
+
import { ToasterTypeOptions as Ie } from "../enums/toaster.js";
|
|
17
|
+
import { useRecommendationExtensionStore as z, disposeStrategyPageReturnListeners as Me } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
18
18
|
import { disposeUnsubscribeListeners as Re } from "../extensions/Blocks/Unsubscribe/block.js";
|
|
19
|
-
import
|
|
19
|
+
import Le from "./organisms/AutoSaveController.vue.js";
|
|
20
20
|
import Oe from "./organisms/base/AuthErrorModal.vue.js";
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
21
|
+
import Ue from "./organisms/base/Toaster.vue.js";
|
|
22
|
+
import Ne from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
23
|
+
import _e from "./organisms/header/HeaderWrapper.vue.js";
|
|
24
|
+
import Ae from "./organisms/LoadingWrapper.vue.js";
|
|
25
25
|
import Pe from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import { useStripoApi as
|
|
29
|
-
import { useConfigStore as
|
|
30
|
-
import { useDynamicContentStore as
|
|
31
|
-
import { useEditorStore as
|
|
32
|
-
import { usePreviewStore as
|
|
33
|
-
import { useSaveValidationStore as
|
|
34
|
-
import { useTemplateStore as
|
|
35
|
-
import { useUnsubscribeStore as
|
|
26
|
+
import Be from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
27
|
+
import xe from "./organisms/validation/ValidationErrorDrawer.vue.js";
|
|
28
|
+
import { useStripoApi as He } from "../services/stripoApi.js";
|
|
29
|
+
import { useConfigStore as Ve } from "../stores/config.js";
|
|
30
|
+
import { useDynamicContentStore as We } from "../stores/dynamic-content.js";
|
|
31
|
+
import { useEditorStore as w } from "../stores/editor.js";
|
|
32
|
+
import { usePreviewStore as Ge } from "../stores/preview.js";
|
|
33
|
+
import { useSaveValidationStore as $e } from "../stores/save-validation.js";
|
|
34
|
+
import { useTemplateStore as ze } from "../stores/template.js";
|
|
35
|
+
import { useUnsubscribeStore as qe } from "../stores/unsubscribe.js";
|
|
36
36
|
import { readTrackFloor as q } from "../utils/linkTrackingIds.js";
|
|
37
|
-
const
|
|
37
|
+
const Mt = /* @__PURE__ */ ue({
|
|
38
38
|
__name: "Guido",
|
|
39
39
|
props: {
|
|
40
40
|
config: null,
|
|
41
41
|
ready: { type: Boolean, default: !0 }
|
|
42
42
|
},
|
|
43
43
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
44
|
-
setup(K, { expose: j, emit:
|
|
45
|
-
const a = K, n = ve(), J =
|
|
44
|
+
setup(K, { expose: j, emit: i }) {
|
|
45
|
+
const a = K, n = ve(), J = l(
|
|
46
46
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
47
|
-
), Q =
|
|
47
|
+
), Q = l(
|
|
48
48
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
49
|
-
), X =
|
|
49
|
+
), X = l(
|
|
50
50
|
() => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
|
|
51
|
-
), Y =
|
|
51
|
+
), Y = l(
|
|
52
52
|
() => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
|
|
53
|
-
),
|
|
53
|
+
), T = W(), Z = l(
|
|
54
54
|
() => import("./organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js")
|
|
55
|
-
),
|
|
56
|
-
() => import("./organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.js")
|
|
57
|
-
), y = W(), g = Ge(), T = Ke(), o = We();
|
|
55
|
+
), g = W(), y = We(), k = qe(), o = Ve();
|
|
58
56
|
a.ready && o.init(a.config);
|
|
59
|
-
const c =
|
|
57
|
+
const c = w(), ee = Ge(), u = f(() => c.hasChanges), { isTestPartner: te } = he(), { isEnabled: oe, loadRollout: C } = Ee(), { showToaster: D } = ke(), F = Ce(), I = () => {
|
|
60
58
|
var t;
|
|
61
59
|
if (c.isVersionHistoryOpen) {
|
|
62
60
|
console.debug("guido:save:silent:blocked", { isVersionHistoryOpen: !0 }), D({
|
|
63
|
-
type:
|
|
61
|
+
type: Ie.Warning,
|
|
64
62
|
message: F("email-editor.save-blocked-outside-editor")
|
|
65
63
|
});
|
|
66
64
|
return;
|
|
67
65
|
}
|
|
68
|
-
return (t =
|
|
66
|
+
return (t = T.value) == null ? void 0 : t.saveSilent();
|
|
69
67
|
}, M = (t) => {
|
|
70
68
|
c.loadingStatus = t;
|
|
71
69
|
};
|
|
72
|
-
ge(),
|
|
73
|
-
const
|
|
70
|
+
ge(), Se();
|
|
71
|
+
const v = () => {
|
|
74
72
|
var t, e;
|
|
75
73
|
return {
|
|
76
74
|
emailId: o.templateId,
|
|
@@ -80,48 +78,46 @@ const Lt = /* @__PURE__ */ pe({
|
|
|
80
78
|
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || $.SAVED_MODULES,
|
|
81
79
|
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || $.DEFAULT_MODULES
|
|
82
80
|
};
|
|
83
|
-
}, { initPlugin:
|
|
84
|
-
let
|
|
85
|
-
const { getDefaultTemplate: N } =
|
|
81
|
+
}, { initPlugin: R, preloadRuntime: L } = we(n), { runExclusive: O, beginMount: U, isCurrentMount: b } = ye();
|
|
82
|
+
let p = 0;
|
|
83
|
+
const { getDefaultTemplate: N } = He(), { cloneTimersOnSave: _, hasTimerBlocks: A } = Te(), re = f(() => {
|
|
86
84
|
var t;
|
|
87
85
|
return !((t = o.ui) != null && t.showHeader);
|
|
88
|
-
}),
|
|
89
|
-
() => o.isFeatureEnabled("legacyUnsubscribeConversion")
|
|
90
|
-
), ae = u(
|
|
86
|
+
}), ne = f(() => o.isFeatureEnabled("reusableRecommendationStrategy")), ie = f(
|
|
91
87
|
() => !!z().recommendationConfigs.strategyId
|
|
92
88
|
);
|
|
93
|
-
|
|
89
|
+
be({
|
|
94
90
|
onBack: () => {
|
|
95
|
-
console.debug("guido:back"),
|
|
91
|
+
console.debug("guido:back"), i("back");
|
|
96
92
|
},
|
|
97
93
|
onSaveStart: () => {
|
|
98
|
-
console.debug("guido:save:start"),
|
|
94
|
+
console.debug("guido:save:start"), i("save:start");
|
|
99
95
|
},
|
|
100
96
|
onSaveComplete: (t) => {
|
|
101
|
-
const e = { ...t, metadata:
|
|
102
|
-
console.debug("guido:save:complete", e),
|
|
97
|
+
const e = { ...t, metadata: v() };
|
|
98
|
+
console.debug("guido:save:complete", e), i("save:complete", e);
|
|
103
99
|
},
|
|
104
100
|
onTestEmailClick: () => {
|
|
105
|
-
console.debug("guido:test-email:click"),
|
|
101
|
+
console.debug("guido:test-email:click"), i("test-email:click");
|
|
106
102
|
}
|
|
107
103
|
});
|
|
108
|
-
const
|
|
109
|
-
console.debug("dynamic-content:close", t),
|
|
110
|
-
},
|
|
104
|
+
const P = (t) => {
|
|
105
|
+
console.debug("dynamic-content:close", t), y.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
|
|
106
|
+
}, B = () => {
|
|
111
107
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
112
108
|
};
|
|
113
|
-
G(() =>
|
|
114
|
-
|
|
109
|
+
G(() => u.value, () => {
|
|
110
|
+
i("on-change", u.value);
|
|
115
111
|
});
|
|
116
112
|
const S = (t) => {
|
|
117
|
-
const e = t, { attribute:
|
|
118
|
-
console.debug("dynamic-content:open", e.detail),
|
|
113
|
+
const e = t, { attribute: s, position: m } = e.detail;
|
|
114
|
+
console.debug("dynamic-content:open", e.detail), i("dynamic-content:open", s, m);
|
|
119
115
|
};
|
|
120
116
|
let d = null;
|
|
121
117
|
const h = () => {
|
|
122
118
|
var e;
|
|
123
|
-
const t = document.querySelector(
|
|
124
|
-
(e =
|
|
119
|
+
const t = document.querySelector(Fe);
|
|
120
|
+
(e = g.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
|
|
125
121
|
}, E = async () => {
|
|
126
122
|
var t;
|
|
127
123
|
n.mark("host_ready");
|
|
@@ -132,56 +128,58 @@ const Lt = /* @__PURE__ */ pe({
|
|
|
132
128
|
templateId: o.templateId,
|
|
133
129
|
variationId: o.variationId
|
|
134
130
|
});
|
|
135
|
-
const e = o.template,
|
|
136
|
-
|
|
137
|
-
const
|
|
131
|
+
const e = o.template, s = (e == null ? void 0 : e.html) || "", m = (e == null ? void 0 : e.css) || "", x = (e == null ? void 0 : e.preselectedDynamicContent) || [];
|
|
132
|
+
k.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
|
|
133
|
+
const se = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, H = o.isFeatureEnabled("linkTrackingIds"), ae = {
|
|
138
134
|
partnerName: o.partnerName,
|
|
139
135
|
campaignUrls: e == null ? void 0 : e.recommendationCampaignUrls,
|
|
140
136
|
rrsEnabled: o.isFeatureEnabled("reusableRecommendationStrategy")
|
|
141
|
-
},
|
|
137
|
+
}, ce = {
|
|
138
|
+
itemsPriceFormatting: o.isFeatureEnabled("itemsPriceFormatting")
|
|
139
|
+
}, V = (le) => n.timed(
|
|
142
140
|
"migration",
|
|
143
|
-
() =>
|
|
141
|
+
() => De(le, se, ae, ce)
|
|
144
142
|
);
|
|
145
143
|
let r = {
|
|
146
|
-
html:
|
|
147
|
-
css:
|
|
144
|
+
html: s && await V(s),
|
|
145
|
+
css: m
|
|
148
146
|
};
|
|
149
147
|
r.html || (r = await n.timed("default_template", () => N()), r.html = await V(r.html));
|
|
150
|
-
const
|
|
151
|
-
A(r.html) && (r.html = await n.timed("timer_clone", () => _(r.html))), H && (c.trackIdSessionFloor = Math.max(
|
|
152
|
-
const
|
|
148
|
+
const de = H ? q(r.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
|
|
149
|
+
A(r.html) && (r.html = await n.timed("timer_clone", () => _(r.html))), H && (c.trackIdSessionFloor = Math.max(de, q(r.html)));
|
|
150
|
+
const me = {
|
|
153
151
|
preselectedDynamicContentList: x,
|
|
154
152
|
onReady: () => {
|
|
155
|
-
console.debug("guido:ready"),
|
|
153
|
+
console.debug("guido:ready"), i("ready");
|
|
156
154
|
}
|
|
157
155
|
};
|
|
158
|
-
|
|
156
|
+
p = U(), await R(r, v(), me, r.html !== s), y.selectedDynamicContentList = x;
|
|
159
157
|
} catch (e) {
|
|
160
158
|
console.error("Failed to initialize Stripo editor:", e), n.markFailed();
|
|
161
159
|
}
|
|
162
160
|
};
|
|
163
|
-
return
|
|
161
|
+
return pe(async () => {
|
|
164
162
|
var e;
|
|
165
|
-
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), z().$reset(),
|
|
166
|
-
const t = (e =
|
|
167
|
-
if (t && (d = new ResizeObserver(h), d.observe(t)),
|
|
163
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), z().$reset(), w().$reset(), ze().$reset(), $e().$reset(), C(), h();
|
|
164
|
+
const t = (e = g.value) == null ? void 0 : e.parentElement;
|
|
165
|
+
if (t && (d = new ResizeObserver(h), d.observe(t)), L(), a.ready)
|
|
168
166
|
await E();
|
|
169
167
|
else {
|
|
170
|
-
const
|
|
171
|
-
|
|
168
|
+
const s = G(() => a.ready, (m) => {
|
|
169
|
+
m && (s(), E());
|
|
172
170
|
});
|
|
173
171
|
}
|
|
174
172
|
document.addEventListener("dynamic-content:open", S);
|
|
175
|
-
}),
|
|
176
|
-
if (Re(),
|
|
173
|
+
}), fe(() => {
|
|
174
|
+
if (Re(), Me(), n.dispose(), d == null || d.disconnect(), document.removeEventListener("dynamic-content:open", S), b(p))
|
|
177
175
|
try {
|
|
178
|
-
const t =
|
|
176
|
+
const t = w();
|
|
179
177
|
t.isStripoInitialized = !1, t.isAccessibilityTestingOpen = !1, t.imagesHidden = !1, t.colorVisionDeficiency = "";
|
|
180
178
|
} catch (t) {
|
|
181
179
|
console.debug("Failed to close the editor readiness gate on unmount", t);
|
|
182
180
|
}
|
|
183
|
-
|
|
184
|
-
if (
|
|
181
|
+
O(async () => {
|
|
182
|
+
if (b(p))
|
|
185
183
|
try {
|
|
186
184
|
window.UIEditor.removeEditor();
|
|
187
185
|
} catch {
|
|
@@ -190,15 +188,15 @@ const Lt = /* @__PURE__ */ pe({
|
|
|
190
188
|
}), o.reset();
|
|
191
189
|
}), j({
|
|
192
190
|
dynamicContent: {
|
|
193
|
-
insert:
|
|
194
|
-
close:
|
|
191
|
+
insert: P,
|
|
192
|
+
close: B
|
|
195
193
|
},
|
|
196
|
-
hasChanges:
|
|
194
|
+
hasChanges: u,
|
|
197
195
|
saveSilent: I,
|
|
198
196
|
setLoading: M
|
|
199
|
-
}), { __sfc: !0, openMetrics: n, PreviewContainer: J, OnboardingWrapper: Q, AssignStrategyDrawer: X, RemoveStrategyModal: Y, autoSaveControllerRef:
|
|
197
|
+
}), { __sfc: !0, openMetrics: n, PreviewContainer: J, OnboardingWrapper: Q, AssignStrategyDrawer: X, RemoveStrategyModal: Y, autoSaveControllerRef: T, LegacyStrategyUpdatedModal: Z, wrapperRef: g, dynamicContentStore: y, unsubscribeStore: k, props: a, configStore: o, editorStore: c, previewStore: ee, hasChanges: u, isTestPartner: te, isSaveValidationEnabled: oe, loadRollout: C, showToaster: D, trans: F, saveSilent: I, setLoading: M, emit: i, buildMetadata: v, initPlugin: R, preloadRuntime: L, runExclusive: O, beginMount: U, isCurrentMount: b, mountGeneration: p, getDefaultTemplate: N, cloneTimersOnSave: _, hasTimerBlocks: A, noHeader: re, isRrsEnabled: ne, hasAssignedStrategy: ie, insertDynamicContent: P, closeDynamicContent: B, handleDynamicContentOpen: S, ribbonObserver: d, updateRibbonOffset: h, startEditor: E, AutoSaveController: Le, AuthErrorModal: Oe, Toaster: Ue, FilterSelectionDrawer: Ne, HeaderWrapper: _e, LoadingWrapper: Ae, SaveAsTemplateDrawer: Pe, UnsubscribeWrapper: Be, ValidationErrorDrawer: xe };
|
|
200
198
|
}
|
|
201
199
|
});
|
|
202
200
|
export {
|
|
203
|
-
|
|
201
|
+
Mt as default
|
|
204
202
|
};
|
|
@@ -1,42 +1,35 @@
|
|
|
1
|
-
import { useConfig as
|
|
2
|
-
import { useToaster as
|
|
1
|
+
import { useConfig as T } from "./useConfig.js";
|
|
2
|
+
import { useToaster as g } from "./useToaster.js";
|
|
3
3
|
import { useTranslations as C } from "./useTranslations.js";
|
|
4
|
-
import { ToasterTypeOptions as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { flattenDynamicContentList as L } from "../utils/genericUtil.js";
|
|
4
|
+
import { ToasterTypeOptions as D } from "../enums/toaster.js";
|
|
5
|
+
import { buildDynamicContentLookup as f, convertModuleDynamicContent as h } from "../utils/dynamicContentConverter.js";
|
|
6
|
+
import { flattenDynamicContentList as O } from "../utils/genericUtil.js";
|
|
8
7
|
import { repairItemsCurrencyAttributes as M } from "../utils/itemsCurrencyRepair.js";
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var c, l, u;
|
|
8
|
+
const N = "dynamic-content.unresolved-attributes-on-drop", d = () => {
|
|
9
|
+
const { template: p, isFeatureEnabled: s } = T(), { showToaster: a } = g(), y = C();
|
|
10
|
+
return { handleModuleAdd: (e, o) => {
|
|
11
|
+
var c, l, i;
|
|
14
12
|
try {
|
|
15
|
-
if ((
|
|
13
|
+
if ((e == null ? void 0 : e.action) !== "ADD" && (e == null ? void 0 : e.action) !== "COPY")
|
|
16
14
|
return;
|
|
17
|
-
const
|
|
18
|
-
if (!
|
|
15
|
+
const t = (c = o == null ? void 0 : o.getTargetNode) == null ? void 0 : c.call(o), r = (l = t == null ? void 0 : t.getOuterHTML) == null ? void 0 : l.call(t);
|
|
16
|
+
if (!t || typeof r != "string")
|
|
19
17
|
return;
|
|
20
|
-
let
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
let n = M(r, {
|
|
19
|
+
convertToPriceFormat: s("itemsPriceFormatting")
|
|
20
|
+
});
|
|
21
|
+
const u = f(O((i = p.value) == null ? void 0 : i.dynamicContentList));
|
|
23
22
|
let m = [];
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
} catch (g) {
|
|
28
|
-
console.error("Failed to request the legacy unsubscribe modal:", g);
|
|
29
|
-
}
|
|
30
|
-
m.length > 0 && y({
|
|
31
|
-
type: h.Warning,
|
|
32
|
-
message: b(E)
|
|
23
|
+
u.size > 0 && ({ html: n, unresolved: m } = h(n, u, s("liquidSyntax"))), n !== r && o.modifyHtml(t).replaceWith(n), m.length > 0 && a({
|
|
24
|
+
type: D.Warning,
|
|
25
|
+
message: y(N)
|
|
33
26
|
});
|
|
34
|
-
} catch (
|
|
35
|
-
console.error("Failed to repair module on add:",
|
|
27
|
+
} catch (t) {
|
|
28
|
+
console.error("Failed to repair module on add:", t);
|
|
36
29
|
}
|
|
37
30
|
} };
|
|
38
31
|
};
|
|
39
32
|
export {
|
|
40
|
-
|
|
41
|
-
|
|
33
|
+
N as UNRESOLVED_DYNAMIC_CONTENT_ON_DROP_KEY,
|
|
34
|
+
d as useModuleRepair
|
|
42
35
|
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { migrateCheckbox as
|
|
2
|
-
import { migrateCouponBlock as
|
|
3
|
-
import { migrateFullStoryScripts as
|
|
4
|
-
import { migrateItemsBlock as
|
|
5
|
-
import {
|
|
6
|
-
import { migrateProductNameLink as
|
|
7
|
-
import { migrateRadioButton as
|
|
8
|
-
import { migrateRecommendation as
|
|
9
|
-
import { migrateRecommendationPartnerScope as
|
|
10
|
-
import { migrateRecommendationTitle as
|
|
11
|
-
import { migrateSocialIcons as
|
|
12
|
-
import { migrateUnsubscribe as
|
|
13
|
-
const
|
|
14
|
-
let m =
|
|
15
|
-
return m =
|
|
1
|
+
import { migrateCheckbox as e } from "./checkboxMigrator.js";
|
|
2
|
+
import { migrateCouponBlock as a } from "./couponBlockMigrator.js";
|
|
3
|
+
import { migrateFullStoryScripts as c } from "./fullStoryScriptMigrator.js";
|
|
4
|
+
import { migrateItemsBlock as g } from "./itemsBlockMigrator.js";
|
|
5
|
+
import { migrateItemsPriceFormat as n } from "./itemsPriceFormatMigrator.js";
|
|
6
|
+
import { migrateProductNameLink as p } from "./productNameLinkMigrator.js";
|
|
7
|
+
import { migrateRadioButton as f } from "./radioButtonMigrator.js";
|
|
8
|
+
import { migrateRecommendation as l } from "./recommendationMigrator.js";
|
|
9
|
+
import { migrateRecommendationPartnerScope as d } from "./recommendationPartnerMigrator.js";
|
|
10
|
+
import { migrateRecommendationTitle as s } from "./recommendationTitleMigrator.js";
|
|
11
|
+
import { migrateSocialIcons as k } from "./socialIconMigrator.js";
|
|
12
|
+
import { migrateUnsubscribe as P } from "./unsubscribeMigrator.js";
|
|
13
|
+
const H = async (t, i = {}, r, o) => {
|
|
14
|
+
let m = t;
|
|
15
|
+
return m = e(m), m = f(m), m = await P(m), m = a(m), m = l(m, i), r && (m = d(m, r)), m = s(m), m = g(m), o != null && o.itemsPriceFormatting && (m = n(m)), m = p(m), m = k(m), m = c(m), m;
|
|
16
16
|
};
|
|
17
17
|
export {
|
|
18
|
-
|
|
18
|
+
H as migrate
|
|
19
19
|
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ITEMS_PRICE_FORMAT_ATTR as e } from "../../extensions/Blocks/Items/constants/currency.js";
|
|
2
|
+
import { applyPriceFormatOpsToElement as o, planPriceFormatOps as n, snapshotPriceFormatFromElement as c } from "../../extensions/Blocks/Items/utils/priceFormatOps.js";
|
|
3
|
+
import { protectLiquid as i, restoreLiquid as s } from "../../utils/liquidProtection.js";
|
|
4
|
+
const m = `td.ins-product-td.items-block-v2:not([${e.DECIMAL_COUNT}])`, a = (r) => o(
|
|
5
|
+
r,
|
|
6
|
+
n(c(r), { convertLegacy: !0 })
|
|
7
|
+
);
|
|
8
|
+
function T(r) {
|
|
9
|
+
if (typeof r != "string" || !r.includes("ins-product-td"))
|
|
10
|
+
return r;
|
|
11
|
+
try {
|
|
12
|
+
const t = new DOMParser().parseFromString(i(r), "text/html");
|
|
13
|
+
return Array.from(t.querySelectorAll(m)).map(a).includes(!0) ? s(t.documentElement.outerHTML) : r;
|
|
14
|
+
} catch (t) {
|
|
15
|
+
return console.error("ItemsPriceFormatMigrator failed:", t), r;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
T as migrateItemsPriceFormat
|
|
20
|
+
};
|
package/dist/enums/academy.js
CHANGED
|
@@ -2,8 +2,7 @@ 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
|
-
EMAIL_RECOMMENDATION_BLOCK: `${e}/docs/new-editor-email-recommendation-block
|
|
6
|
-
LEGACY_UNSUBSCRIBE_MODULE: `${e}/docs/new-editor-add-unsubscribe-pages-into-emails`
|
|
5
|
+
EMAIL_RECOMMENDATION_BLOCK: `${e}/docs/new-editor-email-recommendation-block`
|
|
7
6
|
};
|
|
8
7
|
export {
|
|
9
8
|
o as ACADEMY_LINKS
|