@useinsider/guido 3.30.0-beta.23d415d → 3.30.0-beta.2d741af
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 +12 -18
- package/dist/@types/config/schemas.js +5 -7
- package/dist/components/Guido.vue.js +5 -5
- package/dist/components/Guido.vue2.js +110 -105
- package/dist/components/organisms/unsubscribe/SfmcUnsubscribeConvertedModal.vue.js +17 -0
- package/dist/components/organisms/unsubscribe/SfmcUnsubscribeConvertedModal.vue2.js +30 -0
- package/dist/composables/useHtmlCompiler.js +13 -15
- package/dist/composables/useModuleRepair.js +56 -50
- package/dist/composables/useStripo.js +85 -79
- package/dist/config/compiler/liquidCompilerRules.js +5 -13
- package/dist/config/migrator/index.js +10 -9
- package/dist/config/migrator/sfmcUnsubscribeTextMigrator.js +20 -0
- package/dist/enums/academy.js +2 -1
- package/dist/extensions/DynamicContent/dynamic-content.js +33 -56
- package/dist/guido.css +1 -1
- package/dist/package.json.js +1 -1
- package/dist/src/@types/config/schemas.d.ts +0 -4
- package/dist/src/@types/generic.d.ts +0 -10
- package/dist/src/components/organisms/unsubscribe/SfmcUnsubscribeConvertedModal.vue.d.ts +2 -0
- package/dist/src/composables/useConfig.d.ts +0 -2
- package/dist/src/composables/useModuleRepair.d.ts +1 -1
- package/dist/src/config/migrator/sfmcUnsubscribeTextMigrator.d.ts +1 -0
- package/dist/src/enums/academy.d.ts +1 -0
- package/dist/src/extensions/DynamicContent/dynamic-content.d.ts +0 -11
- package/dist/src/stores/config.d.ts +0 -21
- package/dist/src/stores/editor.d.ts +54 -0
- package/dist/src/utils/genericUtil.d.ts +1 -6
- package/dist/src/utils/legacyUnsubscribeConversion.d.ts +3 -0
- package/dist/stores/editor.js +2 -0
- package/dist/utils/genericUtil.js +45 -55
- package/dist/utils/legacyUnsubscribeConversion.js +69 -28
- package/package.json +1 -1
- package/dist/src/utils/clipboardText.d.ts +0 -1
- package/dist/src/utils/linkTokenPaste.d.ts +0 -3
- package/dist/src/utils/liquidLinkQuotes.d.ts +0 -4
- package/dist/utils/clipboardText.js +0 -31
- package/dist/utils/linkTokenPaste.js +0 -28
- package/dist/utils/liquidLinkQuotes.js +0 -10
package/README.md
CHANGED
|
@@ -173,11 +173,10 @@ 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)
|
|
177
176
|
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.
|
|
178
177
|
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.
|
|
179
178
|
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).
|
|
180
|
-
blockUnsubscribeLinks?: boolean, // Default: false - Warn on save when the design carries an Insider unsubscribe link or code ({{ins-*-unsubscribe-link}}, <%asm_*_raw_url%>, <%unsub%>): the legacy save is rejected with a warning toaster; with the validation drawer on it is a warning row that "Save and Continue" can skip. Launch blocking is up to the host. Set true for accounts whose unsubscribes are managed outside Insider (SFMC).
|
|
179
|
+
blockUnsubscribeLinks?: boolean, // Default: false - Warn on save when the design carries an Insider unsubscribe link or code ({{ins-*-unsubscribe-link}}, <%asm_*_raw_url%>, <%unsub%>): the legacy save is rejected with a warning toaster; with the validation drawer on it is a warning row that "Save and Continue" can skip. Launch blocking is up to the host. It also converts every unsubscribe block (v2 or legacy, linked or not) into a text block on template load and on module drop/copy, removes the Insider unsubscribe/preferences links inside it (their text stays), and shows an SFMC info modal. Set true for accounts whose unsubscribes are managed outside Insider (SFMC).
|
|
181
180
|
},
|
|
182
181
|
|
|
183
182
|
// Optional: Callbacks
|
|
@@ -691,22 +690,6 @@ const closeModal = () => {
|
|
|
691
690
|
</script>
|
|
692
691
|
```
|
|
693
692
|
|
|
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
|
-
|
|
710
693
|
### Saved-module token repair
|
|
711
694
|
|
|
712
695
|
Legacy or hand-written **saved modules** may carry tokens by display label
|
|
@@ -738,6 +721,17 @@ keys host-side: `email-editor.legacy-unsubscribe-converted-modal-title`,
|
|
|
738
721
|
`email-editor.legacy-unsubscribe-converted-modal-message` and
|
|
739
722
|
`email-editor.legacy-unsubscribe-converted-modal-visit-academy` (OK reuses `action-builder.ok`).
|
|
740
723
|
|
|
724
|
+
With `features.blockUnsubscribeLinks: true`, every unsubscribe block (v2 or legacy, with or
|
|
725
|
+
without a link) becomes a plain text block when a template is opened and when a module is
|
|
726
|
+
dropped or copied. Inside a converted block, a link to an Insider unsubscribe or preferences
|
|
727
|
+
merge tag or code, or an unsubscribe link left with an empty href, is removed and
|
|
728
|
+
keeps its visible text; other links keep their URL and text and only lose the unsubscribe link markers. One info
|
|
729
|
+
modal is shown per template open or per drop that converted a block, and a load-time conversion
|
|
730
|
+
marks the editor as changed so the next save or autosave stores it.
|
|
731
|
+
Register these keys host-side: `email-editor.sfmc-unsubscribe-converted-modal-title`
|
|
732
|
+
and `email-editor.sfmc-unsubscribe-converted-modal-message` (Visit Academy reuses
|
|
733
|
+
`email-editor.legacy-unsubscribe-converted-modal-visit-academy`, OK reuses `action-builder.ok`).
|
|
734
|
+
|
|
741
735
|
---
|
|
742
736
|
|
|
743
737
|
## Development
|
|
@@ -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
|
|
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";
|
|
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(
|
|
94
|
+
decimalCount: e(h([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(
|
|
128
|
+
size: e(h([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,8 +247,6 @@ 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),
|
|
252
250
|
/** Convert linkless legacy unsubscribe blocks into text blocks and warn with a modal (opt-in) */
|
|
253
251
|
legacyUnsubscribeConversion: e(a(), !1),
|
|
254
252
|
/** Items block: Recommendation-style price formatting (root currency-* attrs, raw price tags). Released dark. */
|
|
@@ -322,7 +320,7 @@ const b = {
|
|
|
322
320
|
...d.entries,
|
|
323
321
|
type: u("custom"),
|
|
324
322
|
/** Custom processor function */
|
|
325
|
-
processor:
|
|
323
|
+
processor: k(
|
|
326
324
|
(s) => typeof s == "function",
|
|
327
325
|
"processor must be a function"
|
|
328
326
|
)
|
|
@@ -342,7 +340,7 @@ const b = {
|
|
|
342
340
|
* Return false to cancel the save operation.
|
|
343
341
|
*/
|
|
344
342
|
externalValidation: e(
|
|
345
|
-
|
|
343
|
+
k(
|
|
346
344
|
(s) => typeof s == "function",
|
|
347
345
|
"externalValidation must be a function"
|
|
348
346
|
)
|
|
@@ -3,18 +3,18 @@ import o from "./Guido.vue2.js";
|
|
|
3
3
|
import i from "../_virtual/_plugin-vue2_normalizer.js";
|
|
4
4
|
var n = 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(), e.isLegacyUnsubscribeConversionEnabled ? r(e.LegacyUnsubscribeConvertedModal) : a._e(), e.moduleDynamicContentStore.queue.length > 0 ? r(e.AmbiguousDynamicContentModal) : a._e(), r(e.SaveAsTemplateDrawer), e.isSaveValidationEnabled ? r(e.ValidationErrorDrawer) : a._e(), e.isExternalDisplayConditionsEnabled ? r(e.DisplayConditionsHost) : a._e(), e.isTestPartner() ? a._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(l) {
|
|
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(), e.isLegacyUnsubscribeConversionEnabled ? r(e.LegacyUnsubscribeConvertedModal) : a._e(), e.isBlockUnsubscribeLinksEnabled ? r(e.SfmcUnsubscribeConvertedModal) : a._e(), e.moduleDynamicContentStore.queue.length > 0 ? r(e.AmbiguousDynamicContentModal) : a._e(), r(e.SaveAsTemplateDrawer), e.isSaveValidationEnabled ? r(e.ValidationErrorDrawer) : a._e(), e.isExternalDisplayConditionsEnabled ? r(e.DisplayConditionsHost) : a._e(), e.isTestPartner() ? a._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(l) {
|
|
7
7
|
return e.emit("onboarding:finished");
|
|
8
8
|
} } }), r(e.UnsubscribeWrapper), r(e.LoadingWrapper)], 1);
|
|
9
|
-
},
|
|
9
|
+
}, s = [], t = /* @__PURE__ */ i(
|
|
10
10
|
o,
|
|
11
11
|
n,
|
|
12
|
-
|
|
12
|
+
s,
|
|
13
13
|
!1,
|
|
14
14
|
null,
|
|
15
|
-
"
|
|
15
|
+
"e038bbf8"
|
|
16
16
|
);
|
|
17
|
-
const u =
|
|
17
|
+
const u = t.exports;
|
|
18
18
|
export {
|
|
19
19
|
u as default
|
|
20
20
|
};
|
|
@@ -1,84 +1,85 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useCortexBlueprintBridge as
|
|
3
|
-
import { useEditorLock as
|
|
4
|
-
import { startEditorOpenMetrics as
|
|
1
|
+
import { defineComponent as he, defineAsyncComponent as i, ref as W, computed as c, watch as $, onMounted as Ce, onUnmounted as De } from "vue";
|
|
2
|
+
import { useCortexBlueprintBridge as ke } from "../composables/useCortexBlueprintBridge.js";
|
|
3
|
+
import { useEditorLock as we } from "../composables/useEditorLock.js";
|
|
4
|
+
import { startEditorOpenMetrics as Fe } from "../composables/useEditorOpenMetrics.js";
|
|
5
5
|
import { provideGuidoActions as Te } from "../composables/useGuidoActions.js";
|
|
6
|
-
import { useGuidoStateBridge as
|
|
7
|
-
import { usePartner as
|
|
8
|
-
import { useSaveValidationRollout as
|
|
9
|
-
import { useStripo as
|
|
10
|
-
import { useTimerClone as
|
|
11
|
-
import { useToaster as
|
|
12
|
-
import { useTranslations as
|
|
13
|
-
import { migrate as
|
|
6
|
+
import { useGuidoStateBridge as Le } from "../composables/useGuidoStateBridge.js";
|
|
7
|
+
import { usePartner as Me } from "../composables/usePartner.js";
|
|
8
|
+
import { useSaveValidationRollout as Ue } from "../composables/useSaveValidationRollout.js";
|
|
9
|
+
import { useStripo as Ie } from "../composables/useStripo.js";
|
|
10
|
+
import { useTimerClone as Re } from "../composables/useTimerClone.js";
|
|
11
|
+
import { useToaster as Oe } from "../composables/useToaster.js";
|
|
12
|
+
import { useTranslations as Ae } from "../composables/useTranslations.js";
|
|
13
|
+
import { migrate as Ne } from "../config/migrator/index.js";
|
|
14
14
|
import { ModuleFolderDefaults as G } from "../enums/defaults.js";
|
|
15
|
-
import { RIBBON_SELECTOR as
|
|
16
|
-
import { ToasterTypeOptions as
|
|
15
|
+
import { RIBBON_SELECTOR as _e } from "../enums/onboarding.js";
|
|
16
|
+
import { ToasterTypeOptions as Be } from "../enums/toaster.js";
|
|
17
17
|
import { useRecommendationExtensionStore as z, disposeStrategyPageReturnListeners as Pe } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
18
|
-
import { disposeUnsubscribeListeners as
|
|
19
|
-
import { disposeDisplayConditionRequest as
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import { useStripoApi as
|
|
30
|
-
import { useConfigStore as
|
|
31
|
-
import { useDynamicContentStore as
|
|
18
|
+
import { disposeUnsubscribeListeners as xe } from "../extensions/Blocks/Unsubscribe/block.js";
|
|
19
|
+
import { disposeDisplayConditionRequest as He } from "../extensions/DisplayConditions/bridge.js";
|
|
20
|
+
import Ve from "./organisms/AutoSaveController.vue.js";
|
|
21
|
+
import We from "./organisms/base/AuthErrorModal.vue.js";
|
|
22
|
+
import $e from "./organisms/base/Toaster.vue.js";
|
|
23
|
+
import Ge from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
24
|
+
import ze from "./organisms/header/HeaderWrapper.vue.js";
|
|
25
|
+
import qe from "./organisms/LoadingWrapper.vue.js";
|
|
26
|
+
import Ke from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
27
|
+
import je from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
28
|
+
import Je from "./organisms/validation/ValidationErrorDrawer.vue.js";
|
|
29
|
+
import { useStripoApi as Qe } from "../services/stripoApi.js";
|
|
30
|
+
import { useConfigStore as Xe } from "../stores/config.js";
|
|
31
|
+
import { useDynamicContentStore as Ye } from "../stores/dynamic-content.js";
|
|
32
32
|
import { useEditorStore as C } from "../stores/editor.js";
|
|
33
33
|
import { useModuleDynamicContentStore as q } from "../stores/module-dynamic-content.js";
|
|
34
|
-
import { useOnboardingStore as
|
|
35
|
-
import { usePreviewStore as
|
|
36
|
-
import { useSaveValidationStore as
|
|
37
|
-
import { useTemplateStore as
|
|
38
|
-
import { useUnsubscribeStore as
|
|
39
|
-
import { disposeLinkTokenPaste as ot } from "../utils/linkTokenPaste.js";
|
|
34
|
+
import { useOnboardingStore as Ze } from "../stores/onboarding.js";
|
|
35
|
+
import { usePreviewStore as et } from "../stores/preview.js";
|
|
36
|
+
import { useSaveValidationStore as tt } from "../stores/save-validation.js";
|
|
37
|
+
import { useTemplateStore as ot } from "../stores/template.js";
|
|
38
|
+
import { useUnsubscribeStore as nt } from "../stores/unsubscribe.js";
|
|
40
39
|
import { readTrackFloor as K } from "../utils/linkTrackingIds.js";
|
|
41
|
-
const $t = /* @__PURE__ */
|
|
40
|
+
const $t = /* @__PURE__ */ he({
|
|
42
41
|
__name: "Guido",
|
|
43
42
|
props: {
|
|
44
43
|
config: null,
|
|
45
44
|
ready: { type: Boolean, default: !0 }
|
|
46
45
|
},
|
|
47
46
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
48
|
-
setup(j, { expose: J, emit:
|
|
49
|
-
const
|
|
47
|
+
setup(j, { expose: J, emit: r }) {
|
|
48
|
+
const d = j, s = Fe(), Q = i(
|
|
50
49
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
51
|
-
), X =
|
|
50
|
+
), X = i(
|
|
52
51
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
53
|
-
), Y =
|
|
52
|
+
), Y = i(
|
|
54
53
|
() => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
|
|
55
|
-
), Z =
|
|
54
|
+
), Z = i(
|
|
56
55
|
() => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
|
|
57
|
-
), ee =
|
|
56
|
+
), ee = i(
|
|
58
57
|
() => import("./organisms/display-conditions/DisplayConditionsHost.vue.js")
|
|
59
|
-
), D = W(), te =
|
|
58
|
+
), D = W(), te = i(
|
|
60
59
|
() => import("./organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js")
|
|
61
|
-
), oe =
|
|
60
|
+
), oe = i(
|
|
62
61
|
() => import("./organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.js")
|
|
63
|
-
), ne =
|
|
62
|
+
), ne = i(
|
|
63
|
+
() => import("./organisms/unsubscribe/SfmcUnsubscribeConvertedModal.vue.js")
|
|
64
|
+
), re = i(
|
|
64
65
|
() => import("./organisms/dynamic-content/AmbiguousDynamicContentModal.vue.js")
|
|
65
|
-
), y = W(),
|
|
66
|
-
|
|
67
|
-
const
|
|
66
|
+
), y = W(), b = Ye(), k = nt(), se = q(), o = Xe();
|
|
67
|
+
d.ready && o.init(d.config);
|
|
68
|
+
const m = C(), ie = et(), p = c(() => m.hasChanges), { isTestPartner: ae } = Me(), { isEnabled: ce, loadRollout: w } = Ue(), { showToaster: F } = Oe(), T = Ae(), L = () => {
|
|
68
69
|
var t;
|
|
69
|
-
if (
|
|
70
|
-
console.debug("guido:save:silent:blocked", { isVersionHistoryOpen: !0 }),
|
|
71
|
-
type:
|
|
72
|
-
message:
|
|
70
|
+
if (m.isVersionHistoryOpen) {
|
|
71
|
+
console.debug("guido:save:silent:blocked", { isVersionHistoryOpen: !0 }), F({
|
|
72
|
+
type: Be.Warning,
|
|
73
|
+
message: T("email-editor.save-blocked-outside-editor")
|
|
73
74
|
});
|
|
74
75
|
return;
|
|
75
76
|
}
|
|
76
77
|
return (t = D.value) == null ? void 0 : t.saveSilent();
|
|
77
|
-
},
|
|
78
|
-
|
|
78
|
+
}, M = (t) => {
|
|
79
|
+
m.loadingStatus = t;
|
|
79
80
|
};
|
|
80
|
-
|
|
81
|
-
const
|
|
81
|
+
ke(), Le();
|
|
82
|
+
const g = () => {
|
|
82
83
|
var t, e;
|
|
83
84
|
return {
|
|
84
85
|
emailId: o.templateId,
|
|
@@ -88,103 +89,107 @@ const $t = /* @__PURE__ */ Se({
|
|
|
88
89
|
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || G.SAVED_MODULES,
|
|
89
90
|
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || G.DEFAULT_MODULES
|
|
90
91
|
};
|
|
91
|
-
}, { initPlugin:
|
|
92
|
+
}, { initPlugin: U, preloadRuntime: I } = Ie(s), { runExclusive: R, beginMount: O, isCurrentMount: v } = we();
|
|
92
93
|
let f = 0;
|
|
93
|
-
const { getDefaultTemplate: A } =
|
|
94
|
+
const { getDefaultTemplate: A } = Qe(), { cloneTimersOnSave: N, hasTimerBlocks: _ } = Re(), de = c(() => {
|
|
94
95
|
var t;
|
|
95
96
|
return !((t = o.ui) != null && t.showHeader);
|
|
96
|
-
}),
|
|
97
|
+
}), me = c(() => o.isFeatureEnabled("reusableRecommendationStrategy")), le = c(() => o.externalDisplayConditions), ue = c(
|
|
97
98
|
() => o.isFeatureEnabled("legacyUnsubscribeConversion")
|
|
98
|
-
),
|
|
99
|
+
), pe = c(() => o.isFeatureEnabled("blockUnsubscribeLinks")), fe = c(
|
|
99
100
|
() => !!z().recommendationConfigs.strategyId
|
|
100
101
|
);
|
|
101
102
|
Te({
|
|
102
103
|
onBack: () => {
|
|
103
|
-
console.debug("guido:back"),
|
|
104
|
+
console.debug("guido:back"), r("back");
|
|
104
105
|
},
|
|
105
106
|
onSaveStart: () => {
|
|
106
|
-
console.debug("guido:save:start"),
|
|
107
|
+
console.debug("guido:save:start"), r("save:start");
|
|
107
108
|
},
|
|
108
109
|
onSaveComplete: (t) => {
|
|
109
|
-
const e = { ...t, metadata:
|
|
110
|
-
console.debug("guido:save:complete", e),
|
|
110
|
+
const e = { ...t, metadata: g() };
|
|
111
|
+
console.debug("guido:save:complete", e), r("save:complete", e);
|
|
111
112
|
},
|
|
112
113
|
onTestEmailClick: () => {
|
|
113
|
-
console.debug("guido:test-email:click"),
|
|
114
|
+
console.debug("guido:test-email:click"), r("test-email:click");
|
|
114
115
|
}
|
|
115
116
|
});
|
|
116
|
-
const
|
|
117
|
-
console.debug("dynamic-content:close", t),
|
|
118
|
-
},
|
|
117
|
+
const B = (t) => {
|
|
118
|
+
console.debug("dynamic-content:close", t), b.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
|
|
119
|
+
}, P = () => {
|
|
119
120
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
120
121
|
};
|
|
121
122
|
$(() => p.value, () => {
|
|
122
|
-
|
|
123
|
+
r("on-change", p.value);
|
|
123
124
|
});
|
|
124
125
|
const S = (t) => {
|
|
125
|
-
const e = t, { attribute:
|
|
126
|
-
console.debug("dynamic-content:open", e.detail),
|
|
126
|
+
const e = t, { attribute: a, position: u } = e.detail;
|
|
127
|
+
console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", a, u);
|
|
127
128
|
};
|
|
128
|
-
let
|
|
129
|
-
const
|
|
129
|
+
let l = null;
|
|
130
|
+
const E = () => {
|
|
130
131
|
var e;
|
|
131
|
-
const t = document.querySelector(
|
|
132
|
+
const t = document.querySelector(_e);
|
|
132
133
|
(e = y.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
|
|
133
|
-
},
|
|
134
|
+
}, h = async () => {
|
|
134
135
|
var t;
|
|
135
|
-
|
|
136
|
+
s.mark("host_ready");
|
|
136
137
|
try {
|
|
137
|
-
o.initialized || o.init(
|
|
138
|
+
o.initialized || o.init(d.config), m.templateId = o.templateId, s.setContext({
|
|
138
139
|
partnerName: o.partnerName,
|
|
139
140
|
productType: o.productType,
|
|
140
141
|
templateId: o.templateId,
|
|
141
142
|
variationId: o.variationId
|
|
142
143
|
});
|
|
143
|
-
const e = o.template,
|
|
144
|
+
const e = o.template, a = (e == null ? void 0 : e.html) || "", u = (e == null ? void 0 : e.css) || "", x = (e == null ? void 0 : e.preselectedDynamicContent) || [];
|
|
144
145
|
k.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
|
|
145
|
-
const
|
|
146
|
+
const ye = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, H = o.isFeatureEnabled("linkTrackingIds"), be = {
|
|
146
147
|
partnerName: o.partnerName,
|
|
147
148
|
campaignUrls: e == null ? void 0 : e.recommendationCampaignUrls,
|
|
148
149
|
rrsEnabled: o.isFeatureEnabled("reusableRecommendationStrategy")
|
|
149
|
-
},
|
|
150
|
+
}, ge = {
|
|
150
151
|
itemsPriceFormatting: o.isFeatureEnabled("itemsPriceFormatting")
|
|
151
|
-
}, V = (
|
|
152
|
+
}, V = (Ee) => s.timed(
|
|
152
153
|
"migration",
|
|
153
|
-
() =>
|
|
154
|
+
() => Ne(Ee, ye, be, ge)
|
|
154
155
|
);
|
|
155
156
|
let n = {
|
|
156
|
-
html:
|
|
157
|
+
html: a && await V(a),
|
|
157
158
|
css: u
|
|
158
159
|
};
|
|
159
|
-
n.html || (n = await
|
|
160
|
-
const
|
|
161
|
-
|
|
162
|
-
const
|
|
163
|
-
preselectedDynamicContentList:
|
|
160
|
+
n.html || (n = await s.timed("default_template", () => A()), n.html = await V(n.html));
|
|
161
|
+
const ve = H ? K(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
|
|
162
|
+
_(n.html) && (n.html = await s.timed("timer_clone", () => N(n.html))), H && (m.trackIdSessionFloor = Math.max(ve, K(n.html)));
|
|
163
|
+
const Se = {
|
|
164
|
+
preselectedDynamicContentList: x,
|
|
164
165
|
onReady: () => {
|
|
165
|
-
console.debug("guido:ready"),
|
|
166
|
+
console.debug("guido:ready"), r("ready");
|
|
167
|
+
},
|
|
168
|
+
// The host clears its unsaved flag on ready; a load-time edit may already have set hasChanges, so the watcher stays silent.
|
|
169
|
+
onLoadConversionSettled: () => {
|
|
170
|
+
r("on-change", !0);
|
|
166
171
|
}
|
|
167
172
|
};
|
|
168
|
-
f =
|
|
173
|
+
f = O(), await U(n, g(), Se, n.html !== a), b.selectedDynamicContentList = x;
|
|
169
174
|
} catch (e) {
|
|
170
|
-
console.error("Failed to initialize Stripo editor:", e),
|
|
175
|
+
console.error("Failed to initialize Stripo editor:", e), s.markFailed();
|
|
171
176
|
}
|
|
172
177
|
};
|
|
173
|
-
return
|
|
178
|
+
return Ce(async () => {
|
|
174
179
|
var e;
|
|
175
|
-
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), z().$reset(), C().$reset(),
|
|
180
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), z().$reset(), C().$reset(), ot().$reset(), tt().$reset(), q().$reset(), Ze().resetOnboarding("recommendationLegacyStrategyOnboarding"), w(), E();
|
|
176
181
|
const t = (e = y.value) == null ? void 0 : e.parentElement;
|
|
177
|
-
if (t && (
|
|
178
|
-
await
|
|
182
|
+
if (t && (l = new ResizeObserver(E), l.observe(t)), I(), d.ready)
|
|
183
|
+
await h();
|
|
179
184
|
else {
|
|
180
|
-
const
|
|
181
|
-
u && (
|
|
185
|
+
const a = $(() => d.ready, (u) => {
|
|
186
|
+
u && (a(), h());
|
|
182
187
|
});
|
|
183
188
|
}
|
|
184
189
|
document.addEventListener("dynamic-content:open", S);
|
|
185
|
-
}),
|
|
186
|
-
if (
|
|
187
|
-
|
|
190
|
+
}), De(() => {
|
|
191
|
+
if (xe(), Pe(), s.dispose(), l == null || l.disconnect(), document.removeEventListener("dynamic-content:open", S), v(f)) {
|
|
192
|
+
He();
|
|
188
193
|
try {
|
|
189
194
|
const t = C();
|
|
190
195
|
t.isStripoInitialized = !1, t.isAccessibilityTestingOpen = !1, t.imagesHidden = !1, t.colorVisionDeficiency = "";
|
|
@@ -192,7 +197,7 @@ const $t = /* @__PURE__ */ Se({
|
|
|
192
197
|
console.debug("Failed to close the editor readiness gate on unmount", t);
|
|
193
198
|
}
|
|
194
199
|
}
|
|
195
|
-
|
|
200
|
+
R(async () => {
|
|
196
201
|
if (v(f))
|
|
197
202
|
try {
|
|
198
203
|
window.UIEditor.removeEditor();
|
|
@@ -202,13 +207,13 @@ const $t = /* @__PURE__ */ Se({
|
|
|
202
207
|
}), o.reset();
|
|
203
208
|
}), J({
|
|
204
209
|
dynamicContent: {
|
|
205
|
-
insert:
|
|
206
|
-
close:
|
|
210
|
+
insert: B,
|
|
211
|
+
close: P
|
|
207
212
|
},
|
|
208
213
|
hasChanges: p,
|
|
209
|
-
saveSilent:
|
|
210
|
-
setLoading:
|
|
211
|
-
}), { __sfc: !0, openMetrics:
|
|
214
|
+
saveSilent: L,
|
|
215
|
+
setLoading: M
|
|
216
|
+
}), { __sfc: !0, openMetrics: s, PreviewContainer: Q, OnboardingWrapper: X, AssignStrategyDrawer: Y, RemoveStrategyModal: Z, DisplayConditionsHost: ee, autoSaveControllerRef: D, LegacyStrategyUpdatedModal: te, LegacyUnsubscribeConvertedModal: oe, SfmcUnsubscribeConvertedModal: ne, AmbiguousDynamicContentModal: re, wrapperRef: y, dynamicContentStore: b, unsubscribeStore: k, moduleDynamicContentStore: se, props: d, configStore: o, editorStore: m, previewStore: ie, hasChanges: p, isTestPartner: ae, isSaveValidationEnabled: ce, loadRollout: w, showToaster: F, trans: T, saveSilent: L, setLoading: M, emit: r, buildMetadata: g, initPlugin: U, preloadRuntime: I, runExclusive: R, beginMount: O, isCurrentMount: v, mountGeneration: f, getDefaultTemplate: A, cloneTimersOnSave: N, hasTimerBlocks: _, noHeader: de, isRrsEnabled: me, isExternalDisplayConditionsEnabled: le, isLegacyUnsubscribeConversionEnabled: ue, isBlockUnsubscribeLinksEnabled: pe, hasAssignedStrategy: fe, insertDynamicContent: B, closeDynamicContent: P, handleDynamicContentOpen: S, ribbonObserver: l, updateRibbonOffset: E, startEditor: h, AutoSaveController: Ve, AuthErrorModal: We, Toaster: $e, FilterSelectionDrawer: Ge, HeaderWrapper: ze, LoadingWrapper: qe, SaveAsTemplateDrawer: Ke, UnsubscribeWrapper: je, ValidationErrorDrawer: Je };
|
|
212
217
|
}
|
|
213
218
|
});
|
|
214
219
|
export {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import t from "./SfmcUnsubscribeConvertedModal.vue2.js";
|
|
2
|
+
import r from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
|
+
var n = function() {
|
|
4
|
+
var o = this, s = o._self._c, e = o._self._setupProxy;
|
|
5
|
+
return e.isVisible ? s(e.WpModal, { attrs: { id: "guido__sfmc-unsubscribe-converted-modal", "close-on-outside-click": !1, "footer-button-options": e.footerButtonOptions, title: e.trans("email-editor.sfmc-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.sfmc-unsubscribe-converted-modal-message")))])]) : o._e();
|
|
6
|
+
}, c = [], i = /* @__PURE__ */ r(
|
|
7
|
+
t,
|
|
8
|
+
n,
|
|
9
|
+
c,
|
|
10
|
+
!1,
|
|
11
|
+
null,
|
|
12
|
+
null
|
|
13
|
+
);
|
|
14
|
+
const m = i.exports;
|
|
15
|
+
export {
|
|
16
|
+
m as default
|
|
17
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { defineComponent as n, 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 m } from "../../../stores/editor.js";
|
|
6
|
+
const S = /* @__PURE__ */ n({
|
|
7
|
+
__name: "SfmcUnsubscribeConvertedModal",
|
|
8
|
+
setup(p) {
|
|
9
|
+
const o = a(), e = m(), r = t(
|
|
10
|
+
() => e.isSfmcUnsubscribeModalRequested && e.isStripoInitialized
|
|
11
|
+
), s = t(() => ({
|
|
12
|
+
secondaryButton: {
|
|
13
|
+
type: "subtle-primary",
|
|
14
|
+
labelText: o("email-editor.legacy-unsubscribe-converted-modal-visit-academy")
|
|
15
|
+
},
|
|
16
|
+
primaryButton: {
|
|
17
|
+
type: "primary",
|
|
18
|
+
labelText: o("action-builder.ok")
|
|
19
|
+
}
|
|
20
|
+
}));
|
|
21
|
+
return { __sfc: !0, trans: o, editorStore: e, isVisible: r, footerButtonOptions: s, close: () => {
|
|
22
|
+
e.isSfmcUnsubscribeModalRequested = !1;
|
|
23
|
+
}, openAcademy: () => {
|
|
24
|
+
window.open(c.SFMC_RELAY, "_blank", "noopener,noreferrer");
|
|
25
|
+
}, WpModal: i };
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
export {
|
|
29
|
+
S as default
|
|
30
|
+
};
|
|
@@ -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
|
|
12
|
-
const
|
|
11
|
+
import { useConfig as x } from "./useConfig.js";
|
|
12
|
+
const A = /* @__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,8 +31,6 @@ const x = /* @__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",
|
|
36
34
|
// Pongo only: collapses line breaks inside {% %} tags, which pongo2 cannot parse in AMP either.
|
|
37
35
|
"pongo-single-line-tags",
|
|
38
36
|
// Editor-only attribute strip — AMP4EMAIL has no `contenteditable`, so leaving
|
|
@@ -40,29 +38,29 @@ const x = /* @__PURE__ */ new Set([
|
|
|
40
38
|
"remove-contenteditable",
|
|
41
39
|
"remove-dc-pending-marker"
|
|
42
40
|
]), M = () => {
|
|
43
|
-
const { compiler:
|
|
44
|
-
var
|
|
45
|
-
const e = ((
|
|
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) || [];
|
|
46
44
|
return [
|
|
47
|
-
...!!((l =
|
|
45
|
+
...!!((l = i.value) != null && l.ignoreDefaultRules) ? [] : d,
|
|
48
46
|
...C,
|
|
49
47
|
...b,
|
|
50
48
|
...f,
|
|
51
49
|
...R,
|
|
52
50
|
...H,
|
|
53
|
-
...
|
|
54
|
-
...e.map((
|
|
55
|
-
...
|
|
56
|
-
priority:
|
|
51
|
+
...a("liquidSyntax") ? g : v,
|
|
52
|
+
...e.map((m, o) => ({
|
|
53
|
+
...m,
|
|
54
|
+
priority: m.priority + 1e3 + o
|
|
57
55
|
// Ensure additional rules run after default rules
|
|
58
56
|
}))
|
|
59
57
|
];
|
|
60
58
|
}), r = p(() => {
|
|
61
|
-
var
|
|
62
|
-
const e = c.value, s = n(e),
|
|
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;
|
|
63
61
|
return {
|
|
64
62
|
compileHtml: (o) => s.compile(o, void 0, l),
|
|
65
|
-
compileAmpHtml: (o) =>
|
|
63
|
+
compileAmpHtml: (o) => t.compile(o, void 0, l)
|
|
66
64
|
};
|
|
67
65
|
});
|
|
68
66
|
return { compileHtml: (e) => r.value.compileHtml(e), compileAmpHtml: (e) => r.value.compileAmpHtml(e) };
|