@useinsider/guido 3.2.0-beta.e01b42a → 3.2.0-beta.e69fb3b
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 -0
- package/dist/@types/config/schemas.js +66 -54
- package/dist/@types/config/validator.js +27 -34
- package/dist/components/Guido.vue.js +4 -4
- package/dist/components/Guido.vue2.js +87 -82
- package/dist/components/organisms/base/Toaster.vue2.js +10 -11
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +12 -12
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +7 -7
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +12 -20
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue2.js +6 -6
- package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue2.js +9 -15
- package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +31 -40
- package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +19 -20
- package/dist/components/organisms/extensions/recommendation/Filters.vue2.js +11 -14
- package/dist/components/organisms/header/EditorActions.vue.js +12 -13
- package/dist/components/organisms/header/EditorActions.vue2.js +51 -40
- package/dist/components/organisms/header/HeaderWrapper.vue2.js +12 -15
- package/dist/components/organisms/header/LeftSlot.vue2.js +16 -19
- package/dist/components/organisms/header/MiddleSlot.vue2.js +14 -11
- package/dist/components/organisms/header/RightSlot.vue.js +10 -10
- package/dist/components/organisms/header/RightSlot.vue2.js +13 -13
- package/dist/components/organisms/onboarding/AMPOnboarding.vue.js +11 -12
- package/dist/components/organisms/onboarding/AMPOnboarding.vue2.js +49 -31
- package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +12 -13
- package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +36 -38
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +12 -13
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +47 -51
- package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +18 -21
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +27 -31
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +12 -13
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +33 -46
- package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue.js +11 -12
- package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +20 -21
- package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +18 -18
- package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.js +9 -10
- package/dist/composables/useActionsApi.js +37 -38
- package/dist/composables/useBlocksConfig.js +26 -26
- package/dist/composables/useFullStoryBridge.js +13 -0
- package/dist/composables/useHtmlCompiler.js +34 -24
- package/dist/composables/useHtmlValidator.js +91 -97
- package/dist/composables/useHttp.js +30 -30
- package/dist/composables/usePartner.js +1 -1
- package/dist/composables/usePreviewMode.js +20 -16
- package/dist/composables/useRecommendation.js +14 -15
- package/dist/composables/useRibbonOffset.js +21 -0
- package/dist/composables/useSave.js +23 -16
- package/dist/composables/useStripo.js +55 -47
- package/dist/composables/useSyncModuleExtractor.js +31 -29
- package/dist/composables/useTimerClone.js +24 -25
- package/dist/composables/useTranslations.js +2 -3
- package/dist/composables/useValidation.js +7 -8
- package/dist/composables/validators/useLiquidValidator.js +42 -0
- package/dist/config/compiler/liquidCompilerRules.js +15 -0
- package/dist/config/compiler/recommendationCompilerRules.js +162 -43
- package/dist/config/compiler/unsubscribeCompilerRules.js +45 -44
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +51 -46
- package/dist/config/migrator/checkboxMigrator.js +23 -22
- package/dist/config/migrator/couponBlockMigrator.js +18 -19
- package/dist/config/migrator/itemsBlockMigrator.js +87 -89
- package/dist/config/migrator/radioButtonMigrator.js +19 -18
- package/dist/config/migrator/recommendationMigrator.js +107 -110
- package/dist/config/migrator/unsubscribeMigrator.js +10 -11
- package/dist/enums/extensions/recommendationBlock.js +14 -11
- package/dist/enums/onboarding.js +7 -2
- package/dist/enums/recommendation.js +2 -2
- package/dist/enums/unsubscribe.js +33 -27
- package/dist/extensions/Blocks/CouponBlock/template.js +24 -13
- package/dist/extensions/Blocks/Items/block.js +9 -9
- package/dist/extensions/Blocks/Items/controls/button/link.js +14 -14
- package/dist/extensions/Blocks/Items/controls/cardComposition.js +89 -97
- package/dist/extensions/Blocks/Items/controls/image/link.js +14 -14
- package/dist/extensions/Blocks/Items/controls/name/trimming.js +23 -24
- package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +13 -14
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +44 -47
- package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +38 -38
- package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +11 -11
- package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +38 -40
- package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +35 -35
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +155 -162
- package/dist/extensions/Blocks/Items/enums/productEnums.js +21 -14
- package/dist/extensions/Blocks/Items/template.js +210 -210
- package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +27 -11
- package/dist/extensions/Blocks/Recommendation/controls/button/index.js +36 -36
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +208 -200
- package/dist/extensions/Blocks/Recommendation/controls/customAttribute/index.js +23 -20
- package/dist/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.js +99 -0
- package/dist/extensions/Blocks/Recommendation/controls/image/index.js +9 -9
- package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +19 -20
- package/dist/extensions/Blocks/Recommendation/controls/main/filters.js +4 -6
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +84 -90
- package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +18 -18
- package/dist/extensions/Blocks/Recommendation/controls/main/productCount.js +4 -4
- package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +35 -36
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +127 -126
- package/dist/extensions/Blocks/Recommendation/controls/name/index.js +24 -24
- package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +27 -57
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/index.js +24 -24
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.js +24 -24
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textAfter.js +4 -4
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textBefore.js +4 -4
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/index.js +24 -24
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textAfter.js +4 -4
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textBefore.js +4 -4
- package/dist/extensions/Blocks/Recommendation/controls/price/index.js +24 -24
- package/dist/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.js +14 -0
- package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +50 -50
- package/dist/extensions/Blocks/Recommendation/controls/syncInfoMessage.js +18 -20
- package/dist/extensions/Blocks/Recommendation/extension.js +31 -32
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +25 -32
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +72 -69
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +24 -23
- package/dist/extensions/Blocks/Recommendation/templates/grid/migration.js +10 -10
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +28 -27
- package/dist/extensions/Blocks/Recommendation/templates/index.js +9 -9
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +26 -25
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +21 -21
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +53 -48
- package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +17 -14
- package/dist/extensions/Blocks/Recommendation/validation/filterSchema.js +13 -16
- package/dist/extensions/Blocks/Unsubscribe/block.js +11 -11
- package/dist/extensions/Blocks/Unsubscribe/control.js +11 -13
- package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +16 -18
- package/dist/extensions/Blocks/common-control.js +25 -26
- package/dist/extensions/DynamicContent/dynamic-content.js +59 -59
- package/dist/guido.css +1 -1
- package/dist/library.js +11 -12
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +232 -210
- package/dist/node_modules/lodash-es/_getValue.js +1 -1
- package/dist/node_modules/valibot/dist/index.js +122 -126
- package/dist/package.json.js +1 -1
- package/dist/services/recommendationApi.js +12 -15
- package/dist/services/stripoApi.js +9 -9
- package/dist/services/templateLibraryApi.js +49 -48
- package/dist/src/@types/config/index.d.ts +1 -1
- package/dist/src/@types/config/schemas.d.ts +28 -0
- package/dist/src/@types/config/types.d.ts +3 -1
- package/dist/src/@types/generic.d.ts +0 -1
- package/dist/src/@types/save-as-template.d.ts +1 -0
- package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
- package/dist/src/composables/useActionsApi.d.ts +1 -1
- package/dist/src/composables/useConfig.d.ts +12 -0
- package/dist/src/composables/useFullStoryBridge.d.ts +11 -0
- package/dist/src/composables/useHtmlCompiler.d.ts +1 -2
- package/dist/src/composables/useRibbonOffset.d.ts +4 -0
- package/dist/src/composables/validators/useLiquidValidator.d.ts +3 -0
- package/dist/src/config/compiler/liquidCompilerRules.d.ts +2 -0
- package/dist/src/config/compiler/utils/recommendationCompilerUtils.d.ts +1 -1
- package/dist/src/enums/extensions/recommendationBlock.d.ts +3 -0
- package/dist/src/enums/onboarding.d.ts +6 -0
- package/dist/src/enums/unsubscribe.d.ts +5 -0
- package/dist/src/extensions/Blocks/CouponBlock/template.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/index.d.ts +3 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.d.ts +35 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/textTrim.d.ts +3 -20
- package/dist/src/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.d.ts +29 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +4 -4
- package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +3 -3
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +20 -3
- package/dist/src/extensions/Blocks/Recommendation/utils/tagName.d.ts +3 -3
- package/dist/src/services/templateLibraryApi.d.ts +1 -1
- package/dist/src/stores/config.d.ts +108 -0
- package/dist/src/stores/dynamic-content.d.ts +3 -3
- package/dist/src/stores/onboarding.d.ts +4 -0
- package/dist/src/stores/preview.d.ts +3 -0
- package/dist/src/utils/genericUtil.d.ts +1 -1
- package/dist/src/utils/htmlCompiler.d.ts +2 -1
- package/dist/static/styles/base.css.js +7 -2
- package/dist/static/styles/components/button.css.js +3 -2
- package/dist/static/styles/components/loader.css.js +4 -0
- package/dist/stores/config.js +25 -81
- package/dist/stores/dynamic-content.js +6 -11
- package/dist/stores/onboarding.js +5 -1
- package/dist/stores/preview.js +8 -10
- package/dist/stores/unsubscribe.js +1 -4
- package/dist/utils/dateUtil.js +7 -10
- package/dist/utils/genericUtil.js +39 -20
- package/dist/utils/htmlCompiler.js +48 -41
- package/dist/utils/pairProductVariables.js +13 -14
- package/dist/utils/templatePreparation.js +36 -25
- package/dist/utils/tooltipUtils.js +4 -5
- package/package.json +9 -4
- package/dist/node_modules/lodash-es/_DataView.js +0 -6
- package/dist/node_modules/lodash-es/_Promise.js +0 -6
- package/dist/node_modules/lodash-es/_Set.js +0 -6
- package/dist/node_modules/lodash-es/_SetCache.js +0 -13
- package/dist/node_modules/lodash-es/_Stack.js +0 -18
- package/dist/node_modules/lodash-es/_Uint8Array.js +0 -5
- package/dist/node_modules/lodash-es/_WeakMap.js +0 -6
- package/dist/node_modules/lodash-es/_arrayFilter.js +0 -10
- package/dist/node_modules/lodash-es/_arrayLikeKeys.js +0 -20
- package/dist/node_modules/lodash-es/_arrayMap.js +0 -8
- package/dist/node_modules/lodash-es/_arrayPush.js +0 -8
- package/dist/node_modules/lodash-es/_arraySome.js +0 -9
- package/dist/node_modules/lodash-es/_baseEach.js +0 -6
- package/dist/node_modules/lodash-es/_baseFlatten.js +0 -13
- package/dist/node_modules/lodash-es/_baseFor.js +0 -5
- package/dist/node_modules/lodash-es/_baseForOwn.js +0 -8
- package/dist/node_modules/lodash-es/_baseGet.js +0 -11
- package/dist/node_modules/lodash-es/_baseGetAllKeys.js +0 -9
- package/dist/node_modules/lodash-es/_baseHasIn.js +0 -6
- package/dist/node_modules/lodash-es/_baseIsArguments.js +0 -9
- package/dist/node_modules/lodash-es/_baseIsEqual.js +0 -8
- package/dist/node_modules/lodash-es/_baseIsEqualDeep.js +0 -32
- package/dist/node_modules/lodash-es/_baseIsMatch.js +0 -29
- package/dist/node_modules/lodash-es/_baseIsTypedArray.js +0 -12
- package/dist/node_modules/lodash-es/_baseIteratee.js +0 -11
- package/dist/node_modules/lodash-es/_baseKeys.js +0 -14
- package/dist/node_modules/lodash-es/_baseMap.js +0 -11
- package/dist/node_modules/lodash-es/_baseMatches.js +0 -12
- package/dist/node_modules/lodash-es/_baseMatchesProperty.js +0 -17
- package/dist/node_modules/lodash-es/_baseProperty.js +0 -8
- package/dist/node_modules/lodash-es/_basePropertyDeep.js +0 -9
- package/dist/node_modules/lodash-es/_baseRange.js +0 -9
- package/dist/node_modules/lodash-es/_baseTimes.js +0 -8
- package/dist/node_modules/lodash-es/_baseToString.js +0 -18
- package/dist/node_modules/lodash-es/_baseTrim.js +0 -8
- package/dist/node_modules/lodash-es/_baseUnary.js +0 -8
- package/dist/node_modules/lodash-es/_cacheHas.js +0 -6
- package/dist/node_modules/lodash-es/_castPath.js +0 -10
- package/dist/node_modules/lodash-es/_createBaseEach.js +0 -15
- package/dist/node_modules/lodash-es/_createBaseFor.js +0 -13
- package/dist/node_modules/lodash-es/_createRange.js +0 -11
- package/dist/node_modules/lodash-es/_equalArrays.js +0 -40
- package/dist/node_modules/lodash-es/_equalByTag.js +0 -45
- package/dist/node_modules/lodash-es/_equalObjects.js +0 -36
- package/dist/node_modules/lodash-es/_getAllKeys.js +0 -9
- package/dist/node_modules/lodash-es/_getMatchData.js +0 -12
- package/dist/node_modules/lodash-es/_getSymbols.js +0 -10
- package/dist/node_modules/lodash-es/_getTag.js +0 -28
- package/dist/node_modules/lodash-es/_hasPath.js +0 -19
- package/dist/node_modules/lodash-es/_isFlattenable.js +0 -10
- package/dist/node_modules/lodash-es/_isIndex.js +0 -8
- package/dist/node_modules/lodash-es/_isIterateeCall.js +0 -13
- package/dist/node_modules/lodash-es/_isKey.js +0 -12
- package/dist/node_modules/lodash-es/_isPrototype.js +0 -8
- package/dist/node_modules/lodash-es/_isStrictComparable.js +0 -7
- package/dist/node_modules/lodash-es/_mapToArray.js +0 -9
- package/dist/node_modules/lodash-es/_matchesStrictComparable.js +0 -8
- package/dist/node_modules/lodash-es/_memoizeCapped.js +0 -11
- package/dist/node_modules/lodash-es/_nativeKeys.js +0 -5
- package/dist/node_modules/lodash-es/_nodeUtil.js +0 -11
- package/dist/node_modules/lodash-es/_overArg.js +0 -8
- package/dist/node_modules/lodash-es/_setCacheAdd.js +0 -7
- package/dist/node_modules/lodash-es/_setCacheHas.js +0 -6
- package/dist/node_modules/lodash-es/_setToArray.js +0 -9
- package/dist/node_modules/lodash-es/_stackClear.js +0 -7
- package/dist/node_modules/lodash-es/_stackDelete.js +0 -7
- package/dist/node_modules/lodash-es/_stackGet.js +0 -6
- package/dist/node_modules/lodash-es/_stackHas.js +0 -6
- package/dist/node_modules/lodash-es/_stackSet.js +0 -17
- package/dist/node_modules/lodash-es/_stringToPath.js +0 -10
- package/dist/node_modules/lodash-es/_toKey.js +0 -10
- package/dist/node_modules/lodash-es/_trimmedEndIndex.js +0 -9
- package/dist/node_modules/lodash-es/flatMap.js +0 -8
- package/dist/node_modules/lodash-es/get.js +0 -8
- package/dist/node_modules/lodash-es/hasIn.js +0 -8
- package/dist/node_modules/lodash-es/identity.js +0 -6
- package/dist/node_modules/lodash-es/isArguments.js +0 -10
- package/dist/node_modules/lodash-es/isArray.js +0 -4
- package/dist/node_modules/lodash-es/isArrayLike.js +0 -8
- package/dist/node_modules/lodash-es/isBuffer.js +0 -6
- package/dist/node_modules/lodash-es/isLength.js +0 -7
- package/dist/node_modules/lodash-es/isObjectLike.js +0 -6
- package/dist/node_modules/lodash-es/isSymbol.js +0 -9
- package/dist/node_modules/lodash-es/isTypedArray.js +0 -7
- package/dist/node_modules/lodash-es/keys.js +0 -9
- package/dist/node_modules/lodash-es/map.js +0 -11
- package/dist/node_modules/lodash-es/property.js +0 -10
- package/dist/node_modules/lodash-es/range.js +0 -5
- package/dist/node_modules/lodash-es/stubArray.js +0 -6
- package/dist/node_modules/lodash-es/stubFalse.js +0 -6
- package/dist/node_modules/lodash-es/toFinite.js +0 -14
- package/dist/node_modules/lodash-es/toNumber.js +0 -22
- package/dist/node_modules/lodash-es/toString.js +0 -7
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useBlocksConfig as
|
|
3
|
-
import { useConfig as
|
|
4
|
-
import { useCustomInterfaceAppearance as
|
|
1
|
+
import { useActionsApi as v } from "./useActionsApi.js";
|
|
2
|
+
import { useBlocksConfig as M } from "./useBlocksConfig.js";
|
|
3
|
+
import { useConfig as A } from "./useConfig.js";
|
|
4
|
+
import { useCustomInterfaceAppearance as D } from "./useCustomInterfaceAppearance.js";
|
|
5
|
+
import { useFullStoryBridge as I } from "./useFullStoryBridge.js";
|
|
5
6
|
import { useStripoEventHandler as P } from "./useStripoEventHandler.js";
|
|
6
7
|
import { useToaster as U } from "./useToaster.js";
|
|
7
|
-
import { localePatch as
|
|
8
|
-
import { displayConditions as
|
|
9
|
-
import { useStripoApi as
|
|
10
|
-
import
|
|
11
|
-
import { useEditorStore as
|
|
12
|
-
import { dynamicContentToMergeTags as
|
|
13
|
-
import
|
|
14
|
-
const
|
|
15
|
-
const { features: l, template:
|
|
16
|
-
|
|
17
|
-
const e = S(), { html: m, css: a } = i, { baseBlocks: o, extensions: d } = await T(), p = ((f = l.value) == null ? void 0 : f.displayConditions) ?? !0, B = ((g = l.value) == null ? void 0 : g.modulesDisabled) ?? !1, v = ((y = E.value) == null ? void 0 : y.forceRecreate) ?? !1;
|
|
8
|
+
import { localePatch as q } from "../config/i18n/index.js";
|
|
9
|
+
import { displayConditions as R } from "../enums/displayConditions.js";
|
|
10
|
+
import { useStripoApi as x } from "../services/stripoApi.js";
|
|
11
|
+
import H from "../static/styles/customEditorStyle.css.js";
|
|
12
|
+
import { useEditorStore as g } from "../stores/editor.js";
|
|
13
|
+
import { dynamicContentToMergeTags as O } from "../utils/genericUtil.js";
|
|
14
|
+
import j from "../package.json.js";
|
|
15
|
+
const ne = (S, c) => {
|
|
16
|
+
const { features: l, template: y, isFeatureEnabled: u } = A(), { handleError: m } = U(), { getToken: C, getCustomFonts: h, getSyncModulesStatus: E } = x(), { handleEvent: w } = P(), { getStripoBlocksConfig: b } = M(), k = async (i, n = [], r = !1) => {
|
|
17
|
+
const e = g(), { html: p, css: d } = i, { baseBlocks: o, extensions: s } = await b(), f = l.value?.displayConditions ?? !0, T = l.value?.modulesDisabled ?? !1, V = y.value?.forceRecreate ?? !1;
|
|
18
18
|
window.UIEditor.initEditor(
|
|
19
19
|
document.querySelector("#guido-editor"),
|
|
20
20
|
{
|
|
21
|
-
metadata:
|
|
22
|
-
html:
|
|
23
|
-
css:
|
|
24
|
-
forceRecreate:
|
|
21
|
+
metadata: S,
|
|
22
|
+
html: p,
|
|
23
|
+
css: d,
|
|
24
|
+
forceRecreate: V,
|
|
25
25
|
locale: "en",
|
|
26
26
|
undoButtonSelector: "#guido__undo-button",
|
|
27
27
|
redoButtonSelector: "#guido__redo-button",
|
|
28
28
|
mobileViewButtonSelector: ".guido__view-option-selection-mobile",
|
|
29
29
|
desktopViewButtonSelector: ".guido__view-option-selection-desktop",
|
|
30
30
|
codeEditorButtonSelector: "#guido__code-button",
|
|
31
|
-
customAppearanceMergetags: !
|
|
31
|
+
customAppearanceMergetags: !u("liquidSyntax"),
|
|
32
32
|
customAppearanceMergetagsBorderColor: "#f1f3fe",
|
|
33
33
|
customAppearanceMergetagsBackgroundColor: "#f1f3fe",
|
|
34
|
-
customViewStyles:
|
|
35
|
-
conditionsEnabled:
|
|
36
|
-
customConditionsEnabled:
|
|
37
|
-
conditionCategories:
|
|
34
|
+
customViewStyles: H,
|
|
35
|
+
conditionsEnabled: f,
|
|
36
|
+
customConditionsEnabled: f,
|
|
37
|
+
conditionCategories: R,
|
|
38
38
|
enableXSSSecurity: !0,
|
|
39
|
-
modulesDisabled:
|
|
39
|
+
modulesDisabled: T,
|
|
40
40
|
syncModulesEnabled: r,
|
|
41
41
|
messageSettingsEnabled: !0,
|
|
42
42
|
displayGmailAnnotations: !0,
|
|
@@ -44,6 +44,7 @@ const oe = (C, c) => {
|
|
|
44
44
|
displayTitle: !1,
|
|
45
45
|
displayUTM: !1,
|
|
46
46
|
selectElementAfterDrop: !0,
|
|
47
|
+
allowedScriptSourceDomains: "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com",
|
|
47
48
|
...o ? { baseBlocks: o } : {},
|
|
48
49
|
editorFonts: {
|
|
49
50
|
showDefaultStandardFonts: !0,
|
|
@@ -52,25 +53,28 @@ const oe = (C, c) => {
|
|
|
52
53
|
},
|
|
53
54
|
mergeTags: [
|
|
54
55
|
{
|
|
55
|
-
entries:
|
|
56
|
+
entries: O(
|
|
57
|
+
c.preselectedDynamicContentList,
|
|
58
|
+
u("liquidSyntax")
|
|
59
|
+
)
|
|
56
60
|
}
|
|
57
61
|
],
|
|
58
62
|
async onTokenRefreshRequest(t) {
|
|
59
63
|
try {
|
|
60
|
-
const
|
|
61
|
-
t(
|
|
62
|
-
} catch (
|
|
63
|
-
|
|
64
|
+
const a = await C();
|
|
65
|
+
t(a);
|
|
66
|
+
} catch (a) {
|
|
67
|
+
m(a, "Failed to refresh token");
|
|
64
68
|
}
|
|
65
69
|
},
|
|
66
70
|
onTemplateLoaded() {
|
|
67
71
|
try {
|
|
68
|
-
const { importCss: t } =
|
|
69
|
-
t(),
|
|
72
|
+
const { importCss: t } = D(), { activateCustomViewStyles: a, updateTimerInClonedTemplate: _ } = v(), { injectFullStory: F } = I();
|
|
73
|
+
t(), a(), F(), _(), c.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
|
|
70
74
|
e.hasChanges = !1;
|
|
71
75
|
}, 1e3);
|
|
72
76
|
} catch (t) {
|
|
73
|
-
|
|
77
|
+
m(t, "Failed to load custom interface appearance");
|
|
74
78
|
}
|
|
75
79
|
},
|
|
76
80
|
onCodeEditorVisibilityChanged(t) {
|
|
@@ -85,39 +89,43 @@ const oe = (C, c) => {
|
|
|
85
89
|
onDataChanged() {
|
|
86
90
|
e.hasChanges = !0;
|
|
87
91
|
},
|
|
88
|
-
onEvent:
|
|
92
|
+
onEvent: w,
|
|
89
93
|
ignoreClickOutsideSelectors: [
|
|
90
94
|
"#guido-dynamic-content-modal",
|
|
91
95
|
".in-on-board-wrapper",
|
|
92
96
|
".in-drawer__container"
|
|
93
97
|
],
|
|
94
|
-
extensions:
|
|
95
|
-
localePatch:
|
|
98
|
+
extensions: s,
|
|
99
|
+
localePatch: q
|
|
96
100
|
}
|
|
97
101
|
);
|
|
98
|
-
},
|
|
99
|
-
var d;
|
|
102
|
+
}, B = (i) => new Promise((n, r) => {
|
|
100
103
|
if (document.getElementById("UiEditorScript")) {
|
|
101
104
|
i(), n();
|
|
102
105
|
return;
|
|
103
106
|
}
|
|
104
|
-
const
|
|
105
|
-
|
|
107
|
+
const d = `https://email-static.useinsider.com/guido/${j.guido?.stripo?.version}/UIEditor.js`;
|
|
108
|
+
if (!document.querySelector('link[href="https://email-static.useinsider.com"]')) {
|
|
109
|
+
const s = document.createElement("link");
|
|
110
|
+
s.rel = "preconnect", s.href = "https://email-static.useinsider.com", document.head.appendChild(s);
|
|
111
|
+
}
|
|
112
|
+
const o = document.createElement("script");
|
|
113
|
+
o.id = "UiEditorScript", o.type = "module", o.src = d, o.onload = () => {
|
|
106
114
|
i(), n();
|
|
107
115
|
}, o.onerror = () => {
|
|
108
|
-
r(new Error(`Failed to load Stripo UIEditor script from S3: ${
|
|
116
|
+
r(new Error(`Failed to load Stripo UIEditor script from S3: ${d}`));
|
|
109
117
|
}, document.body.appendChild(o);
|
|
110
118
|
});
|
|
111
119
|
return { initPlugin: async (i) => {
|
|
112
|
-
await
|
|
113
|
-
const n =
|
|
114
|
-
|
|
115
|
-
|
|
120
|
+
await B(async () => {
|
|
121
|
+
const n = g(), [r, e] = await Promise.all([
|
|
122
|
+
h(),
|
|
123
|
+
E()
|
|
116
124
|
]);
|
|
117
|
-
n.syncModulesEnabled = e, await
|
|
125
|
+
n.syncModulesEnabled = e, await k(i, r, e);
|
|
118
126
|
});
|
|
119
127
|
} };
|
|
120
128
|
};
|
|
121
129
|
export {
|
|
122
|
-
|
|
130
|
+
ne as useStripo
|
|
123
131
|
};
|
|
@@ -1,45 +1,47 @@
|
|
|
1
|
-
import { UNSUBSCRIBE_SYNC_MODULE_TYPES as
|
|
2
|
-
import { DATA_ATTRIBUTES as
|
|
3
|
-
import { useEditorStore as
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { UNSUBSCRIBE_SYNC_MODULE_TYPES as A } from "../enums/unsubscribe.js";
|
|
2
|
+
import { DATA_ATTRIBUTES as E } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
|
|
3
|
+
import { useEditorStore as _ } from "../stores/editor.js";
|
|
4
|
+
const M = ".esd-synchronizable-module", g = '[esd-extension-block-id="unsubscribe-block"]', D = "esd-custom-block-id";
|
|
5
|
+
let S = "", e = null;
|
|
6
|
+
const I = (t) => (t === S && e || (e = new DOMParser().parseFromString(t, "text/html"), S = t), e), L = () => {
|
|
7
|
+
const t = _();
|
|
8
|
+
return { extractSyncModuleData: (m) => {
|
|
9
|
+
const f = {
|
|
8
10
|
unsubscribePayload: [],
|
|
9
11
|
stripoModules: []
|
|
10
12
|
};
|
|
11
|
-
if (!
|
|
12
|
-
return
|
|
13
|
-
const
|
|
14
|
-
return
|
|
15
|
-
const
|
|
16
|
-
if (!
|
|
13
|
+
if (!t.syncModulesEnabled)
|
|
14
|
+
return f;
|
|
15
|
+
const T = I(m).querySelectorAll(M), o = [], n = [];
|
|
16
|
+
return T.forEach((c) => {
|
|
17
|
+
const r = c.getAttribute(D);
|
|
18
|
+
if (!r)
|
|
17
19
|
return;
|
|
18
|
-
const
|
|
19
|
-
if (
|
|
20
|
-
|
|
20
|
+
const u = c.querySelectorAll(g);
|
|
21
|
+
if (u.length === 0) {
|
|
22
|
+
n.push(Number(r));
|
|
21
23
|
return;
|
|
22
24
|
}
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
if (!
|
|
25
|
+
u.forEach((i) => {
|
|
26
|
+
const l = i.getAttribute(E.PAGE_LIST), a = i.getAttribute(E.PAGE_TYPE);
|
|
27
|
+
if (!l || !a)
|
|
26
28
|
return;
|
|
27
|
-
const
|
|
28
|
-
if (!
|
|
29
|
+
const y = parseInt(a), p = A[y];
|
|
30
|
+
if (!p)
|
|
29
31
|
return;
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
stripoModuleId:
|
|
33
|
-
unsubscriptionPreferencePages:
|
|
34
|
-
type:
|
|
32
|
+
const d = l.split(",").map((s) => parseInt(s.trim())).filter((s) => !Number.isNaN(s));
|
|
33
|
+
d.length !== 0 && o.push({
|
|
34
|
+
stripoModuleId: r,
|
|
35
|
+
unsubscriptionPreferencePages: d,
|
|
36
|
+
type: p
|
|
35
37
|
});
|
|
36
38
|
});
|
|
37
39
|
}), {
|
|
38
|
-
unsubscribePayload:
|
|
39
|
-
stripoModules:
|
|
40
|
+
unsubscribePayload: o,
|
|
41
|
+
stripoModules: n
|
|
40
42
|
};
|
|
41
43
|
} };
|
|
42
44
|
};
|
|
43
45
|
export {
|
|
44
|
-
|
|
46
|
+
L as useSyncModuleExtractor
|
|
45
47
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useHttp as
|
|
3
|
-
import { useToaster as
|
|
4
|
-
import { useStripoApi as
|
|
5
|
-
const
|
|
6
|
-
const { handleError:
|
|
1
|
+
import { useActionsApi as d } from "./useActionsApi.js";
|
|
2
|
+
import { useHttp as l } from "./useHttp.js";
|
|
3
|
+
import { useToaster as T } from "./useToaster.js";
|
|
4
|
+
import { useStripoApi as f } from "../services/stripoApi.js";
|
|
5
|
+
const C = () => {
|
|
6
|
+
const { handleError: i } = T(), { getToken: c } = f(), { post: m } = l(), { updateHtmlAndCss: p } = d(), n = (t) => /esd-timer-id="(\d+)"/.test(t), o = async (t, e) => {
|
|
7
7
|
try {
|
|
8
|
-
return (await
|
|
8
|
+
return (await m(
|
|
9
9
|
"https://plugins.stripo.email/api/v1/timers/clone",
|
|
10
10
|
{ html: t },
|
|
11
11
|
{
|
|
@@ -16,38 +16,37 @@ const O = () => {
|
|
|
16
16
|
}
|
|
17
17
|
)).data.html;
|
|
18
18
|
} catch (r) {
|
|
19
|
-
return
|
|
19
|
+
return i(r, "Failed to clone timer IDs"), null;
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
22
|
return {
|
|
23
|
-
hasTimerBlocks:
|
|
24
|
-
cloneTimersInHtml:
|
|
23
|
+
hasTimerBlocks: n,
|
|
24
|
+
cloneTimersInHtml: o,
|
|
25
25
|
cloneTimersOnSave: async (t) => {
|
|
26
|
-
if (!
|
|
26
|
+
if (!n(t))
|
|
27
27
|
return t;
|
|
28
|
-
const e = await
|
|
29
|
-
return e && await
|
|
28
|
+
const e = await c();
|
|
29
|
+
return e && await o(t, e) || t;
|
|
30
30
|
},
|
|
31
31
|
updateTimersOnLoad: async (t) => {
|
|
32
|
-
var e, r, o, m;
|
|
33
32
|
try {
|
|
34
|
-
const
|
|
35
|
-
if (!
|
|
33
|
+
const e = window.UIEditor?.getHtml?.();
|
|
34
|
+
if (!e || !n(e))
|
|
36
35
|
return;
|
|
37
|
-
const
|
|
38
|
-
if (!
|
|
36
|
+
const a = await t();
|
|
37
|
+
if (!a)
|
|
39
38
|
return;
|
|
40
|
-
const
|
|
41
|
-
if (!
|
|
39
|
+
const s = await o(e, a);
|
|
40
|
+
if (!s || s === e)
|
|
42
41
|
return;
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
} catch (
|
|
46
|
-
|
|
42
|
+
const u = window.UIEditor?.getCss?.() || "";
|
|
43
|
+
p(s, u);
|
|
44
|
+
} catch (e) {
|
|
45
|
+
i(e, "Failed to update timer blocks");
|
|
47
46
|
}
|
|
48
47
|
}
|
|
49
48
|
};
|
|
50
49
|
};
|
|
51
50
|
export {
|
|
52
|
-
|
|
51
|
+
C as useTimerClone
|
|
53
52
|
};
|
|
@@ -2,11 +2,10 @@ import memoize from "../node_modules/lodash-es/memoize.js";
|
|
|
2
2
|
import { ref } from "vue";
|
|
3
3
|
import { useConfig } from "./useConfig.js";
|
|
4
4
|
const useTranslations = () => {
|
|
5
|
-
|
|
6
|
-
const { config } = useConfig(), translationsPath = ((e = (o = config.value) == null ? void 0 : o.editor) == null ? void 0 : e.translationsPath) || "window.trans.en", translations = ref(eval(translationsPath)), trans = (n, t) => {
|
|
5
|
+
const { config } = useConfig(), translationsPath = config.value?.editor?.translationsPath || "window.trans.en", translations = ref(eval(translationsPath)), trans = (n, t) => {
|
|
7
6
|
const r = translations.value[n];
|
|
8
7
|
return r ? t ? Object.entries(t).reduce(
|
|
9
|
-
(
|
|
8
|
+
(o, [e, s]) => o.replace(new RegExp(`{${e}}`, "g"), String(s)),
|
|
10
9
|
r
|
|
11
10
|
) : r : (console.warn(`Translation key not found: ${n}`), n);
|
|
12
11
|
};
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { safeParseAsync as
|
|
2
|
-
import { unref as
|
|
3
|
-
function
|
|
1
|
+
import { safeParseAsync as t } from "../node_modules/valibot/dist/index.js";
|
|
2
|
+
import { unref as a } from "vue";
|
|
3
|
+
function n(s, e) {
|
|
4
4
|
return {
|
|
5
5
|
schema: e,
|
|
6
6
|
validate: async () => {
|
|
7
|
-
|
|
8
|
-
const r = await i(e, n(o), { abortPipeEarly: !0 });
|
|
7
|
+
const r = await t(e, a(s), { abortPipeEarly: !0 });
|
|
9
8
|
return {
|
|
10
9
|
...r,
|
|
11
|
-
error:
|
|
12
|
-
errorMessage:
|
|
10
|
+
error: r.issues?.[0],
|
|
11
|
+
errorMessage: r.issues?.[0]?.message || ""
|
|
13
12
|
};
|
|
14
13
|
}
|
|
15
14
|
};
|
|
16
15
|
}
|
|
17
16
|
export {
|
|
18
|
-
|
|
17
|
+
n as useAsyncValidation
|
|
19
18
|
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ToasterTypeOptions as r } from "../../enums/toaster.js";
|
|
2
|
+
import { base64EncodeWithSpecialChars as u } from "../../utils/base64.js";
|
|
3
|
+
import { useHttp as d } from "../useHttp.js";
|
|
4
|
+
import { useToaster as c } from "../useToaster.js";
|
|
5
|
+
import { useTranslations as p } from "../useTranslations.js";
|
|
6
|
+
const v = () => {
|
|
7
|
+
const { post: n } = d(), { showToaster: e } = c(), a = p();
|
|
8
|
+
return { validateLiquidSyntax: async (i) => {
|
|
9
|
+
try {
|
|
10
|
+
const t = await n("/newsletter/contents/validate-syntax", [{
|
|
11
|
+
identifier: "default",
|
|
12
|
+
syntax: "liquid",
|
|
13
|
+
contents: {
|
|
14
|
+
subject: null,
|
|
15
|
+
preheader: null,
|
|
16
|
+
html: u(i),
|
|
17
|
+
ampHtml: null
|
|
18
|
+
}
|
|
19
|
+
}]);
|
|
20
|
+
if (!Array.isArray(t.data)) {
|
|
21
|
+
const l = t.data;
|
|
22
|
+
return e({
|
|
23
|
+
type: r.Warning,
|
|
24
|
+
message: l.message ?? a("journey-builder.liquid-validation-failed")
|
|
25
|
+
}), !1;
|
|
26
|
+
}
|
|
27
|
+
const [o] = t.data, s = Object.values(o?.errors ?? {});
|
|
28
|
+
return s.length ? (e({
|
|
29
|
+
type: r.Warning,
|
|
30
|
+
message: s[0].replace(/^line \d+:\s*/, "")
|
|
31
|
+
}), !1) : !0;
|
|
32
|
+
} catch {
|
|
33
|
+
return e({
|
|
34
|
+
type: r.Alert,
|
|
35
|
+
message: a("journey-builder.liquid-validation-failed")
|
|
36
|
+
}), !1;
|
|
37
|
+
}
|
|
38
|
+
} };
|
|
39
|
+
};
|
|
40
|
+
export {
|
|
41
|
+
v as useLiquidValidator
|
|
42
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { COUPON_PLACEHOLDER_LIQUID as e, COUPON_PLACEHOLDER_DEFAULT as i } from "../../extensions/Blocks/CouponBlock/template.js";
|
|
2
|
+
const o = [
|
|
3
|
+
{
|
|
4
|
+
id: "liquid-coupon-code",
|
|
5
|
+
description: "Replace legacy coupon placeholder with liquid syntax",
|
|
6
|
+
type: "replace",
|
|
7
|
+
search: i,
|
|
8
|
+
replacement: e,
|
|
9
|
+
replaceAll: !0,
|
|
10
|
+
priority: 50
|
|
11
|
+
}
|
|
12
|
+
];
|
|
13
|
+
export {
|
|
14
|
+
o as liquidCompilerRules
|
|
15
|
+
};
|