@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,11 +1,16 @@
|
|
|
1
|
-
const
|
|
1
|
+
const n = `.amp-input-list,
|
|
2
2
|
.button,
|
|
3
3
|
.base-input,
|
|
4
4
|
ue-stripe-thumb,
|
|
5
5
|
.ue-stripe-thumb {
|
|
6
6
|
transition: all .5s ease;
|
|
7
7
|
}
|
|
8
|
+
|
|
9
|
+
:host {
|
|
10
|
+
height: 100% !important;
|
|
11
|
+
min-height: 0 !important;
|
|
12
|
+
}
|
|
8
13
|
`;
|
|
9
14
|
export {
|
|
10
|
-
|
|
15
|
+
n as default
|
|
11
16
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const n = `.control-shadow-wrapper:has(.button) {
|
|
2
2
|
border-radius: 0;
|
|
3
3
|
box-shadow: none;
|
|
4
4
|
background-color: transparent;
|
|
@@ -125,6 +125,7 @@ ue-select-text-input .select-text-input-toggle .button {
|
|
|
125
125
|
background-color: transparent !important;
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
+
|
|
128
129
|
.control-shadow-wrapper,
|
|
129
130
|
ue-button:not(.no-shadow,.flat-white),
|
|
130
131
|
ue-toggle:not(.no-shadow,.flat-white),
|
|
@@ -138,5 +139,5 @@ ue-check-button:not(.no-shadow,.flat-white) {
|
|
|
138
139
|
}
|
|
139
140
|
`;
|
|
140
141
|
export {
|
|
141
|
-
|
|
142
|
+
n as default
|
|
142
143
|
};
|
package/dist/stores/config.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import "../@types/config/
|
|
3
|
-
|
|
4
|
-
import { defineStore as o } from "pinia";
|
|
5
|
-
const s = o("guido-config", {
|
|
1
|
+
import { defineStore as n } from "pinia";
|
|
2
|
+
import { parseConfig as t } from "../@types/config/validator.js";
|
|
3
|
+
const a = n("guido-config", {
|
|
6
4
|
state: () => ({
|
|
7
5
|
initialized: !1,
|
|
8
6
|
config: null
|
|
@@ -11,137 +9,83 @@ const s = o("guido-config", {
|
|
|
11
9
|
/**
|
|
12
10
|
* Get the identity configuration
|
|
13
11
|
*/
|
|
14
|
-
identity: (
|
|
15
|
-
var e;
|
|
16
|
-
return ((e = i.config) == null ? void 0 : e.identity) ?? null;
|
|
17
|
-
},
|
|
12
|
+
identity: (e) => e.config?.identity ?? null,
|
|
18
13
|
/**
|
|
19
14
|
* Get the partner configuration
|
|
20
15
|
*/
|
|
21
|
-
partner: (
|
|
22
|
-
var e;
|
|
23
|
-
return ((e = i.config) == null ? void 0 : e.partner) ?? null;
|
|
24
|
-
},
|
|
16
|
+
partner: (e) => e.config?.partner ?? null,
|
|
25
17
|
/**
|
|
26
18
|
* Get the template configuration
|
|
27
19
|
*/
|
|
28
|
-
template: (
|
|
29
|
-
var e;
|
|
30
|
-
return ((e = i.config) == null ? void 0 : e.template) ?? null;
|
|
31
|
-
},
|
|
20
|
+
template: (e) => e.config?.template ?? null,
|
|
32
21
|
/**
|
|
33
22
|
* Get the editor configuration
|
|
34
23
|
*/
|
|
35
|
-
editor: (
|
|
36
|
-
var e;
|
|
37
|
-
return ((e = i.config) == null ? void 0 : e.editor) ?? null;
|
|
38
|
-
},
|
|
24
|
+
editor: (e) => e.config?.editor ?? null,
|
|
39
25
|
/**
|
|
40
26
|
* Get the UI configuration
|
|
41
27
|
*/
|
|
42
|
-
ui: (
|
|
43
|
-
var e;
|
|
44
|
-
return ((e = i.config) == null ? void 0 : e.ui) ?? null;
|
|
45
|
-
},
|
|
28
|
+
ui: (e) => e.config?.ui ?? null,
|
|
46
29
|
/**
|
|
47
30
|
* Get the features configuration
|
|
48
31
|
*/
|
|
49
|
-
features: (
|
|
50
|
-
var e;
|
|
51
|
-
return ((e = i.config) == null ? void 0 : e.features) ?? null;
|
|
52
|
-
},
|
|
32
|
+
features: (e) => e.config?.features ?? null,
|
|
53
33
|
/**
|
|
54
34
|
* Get the blocks configuration
|
|
55
35
|
*/
|
|
56
|
-
blocks: (
|
|
57
|
-
var e;
|
|
58
|
-
return ((e = i.config) == null ? void 0 : e.blocks) ?? null;
|
|
59
|
-
},
|
|
36
|
+
blocks: (e) => e.config?.blocks ?? null,
|
|
60
37
|
/**
|
|
61
38
|
* Get the compiler configuration
|
|
62
39
|
*/
|
|
63
|
-
compiler: (
|
|
64
|
-
var e;
|
|
65
|
-
return ((e = i.config) == null ? void 0 : e.compiler) ?? null;
|
|
66
|
-
},
|
|
40
|
+
compiler: (e) => e.config?.compiler ?? null,
|
|
67
41
|
/**
|
|
68
42
|
* Get the callbacks configuration
|
|
69
43
|
*/
|
|
70
|
-
callbacks: (
|
|
71
|
-
var e;
|
|
72
|
-
return ((e = i.config) == null ? void 0 : e.callbacks) ?? null;
|
|
73
|
-
},
|
|
44
|
+
callbacks: (e) => e.config?.callbacks ?? null,
|
|
74
45
|
/**
|
|
75
46
|
* Get the template ID
|
|
76
47
|
*/
|
|
77
|
-
templateId: (
|
|
78
|
-
var e;
|
|
79
|
-
return ((e = i.config) == null ? void 0 : e.identity.templateId) ?? "";
|
|
80
|
-
},
|
|
48
|
+
templateId: (e) => e.config?.identity.templateId ?? "",
|
|
81
49
|
/**
|
|
82
50
|
* Get the user ID
|
|
83
51
|
*/
|
|
84
|
-
userId: (
|
|
85
|
-
var e;
|
|
86
|
-
return ((e = i.config) == null ? void 0 : e.identity.userId) ?? "";
|
|
87
|
-
},
|
|
52
|
+
userId: (e) => e.config?.identity.userId ?? "",
|
|
88
53
|
/**
|
|
89
54
|
* Get the variation ID
|
|
90
55
|
*/
|
|
91
|
-
variationId: (
|
|
92
|
-
var e;
|
|
93
|
-
return ((e = i.config) == null ? void 0 : e.identity.variationId) ?? "";
|
|
94
|
-
},
|
|
56
|
+
variationId: (e) => e.config?.identity.variationId ?? "",
|
|
95
57
|
/**
|
|
96
58
|
* Get the partner name
|
|
97
59
|
*/
|
|
98
|
-
partnerName: (
|
|
99
|
-
var e;
|
|
100
|
-
return ((e = i.config) == null ? void 0 : e.partner.name) ?? "";
|
|
101
|
-
},
|
|
60
|
+
partnerName: (e) => e.config?.partner.name ?? "",
|
|
102
61
|
/**
|
|
103
62
|
* Get the product type
|
|
104
63
|
*/
|
|
105
|
-
productType: (
|
|
106
|
-
var e;
|
|
107
|
-
return ((e = i.config) == null ? void 0 : e.partner.productType) ?? 60;
|
|
108
|
-
},
|
|
64
|
+
productType: (e) => e.config?.partner.productType ?? 60,
|
|
109
65
|
/**
|
|
110
66
|
* Get the message type
|
|
111
67
|
*/
|
|
112
|
-
messageType: (
|
|
113
|
-
var e;
|
|
114
|
-
return ((e = i.config) == null ? void 0 : e.partner.messageType) ?? 1;
|
|
115
|
-
},
|
|
68
|
+
messageType: (e) => e.config?.partner.messageType ?? 1,
|
|
116
69
|
/**
|
|
117
70
|
* Get the username
|
|
118
71
|
*/
|
|
119
|
-
username: (
|
|
120
|
-
var e;
|
|
121
|
-
return ((e = i.config) == null ? void 0 : e.partner.username) ?? "Guido User";
|
|
122
|
-
},
|
|
72
|
+
username: (e) => e.config?.partner.username ?? "Guido User",
|
|
123
73
|
/**
|
|
124
74
|
* Check if header should be shown
|
|
125
75
|
*/
|
|
126
|
-
showHeader: (
|
|
127
|
-
var e;
|
|
128
|
-
return ((e = i.config) == null ? void 0 : e.ui.showHeader) ?? !0;
|
|
129
|
-
},
|
|
76
|
+
showHeader: (e) => e.config?.ui.showHeader ?? !0,
|
|
130
77
|
/**
|
|
131
78
|
* Check if a specific feature is enabled
|
|
132
79
|
*/
|
|
133
|
-
isFeatureEnabled: (
|
|
134
|
-
var t;
|
|
135
|
-
return ((t = i.config) == null ? void 0 : t.features[e]) ?? !0;
|
|
136
|
-
}
|
|
80
|
+
isFeatureEnabled: (e) => (i) => e.config?.features[i] ?? !0
|
|
137
81
|
},
|
|
138
82
|
actions: {
|
|
139
83
|
/**
|
|
140
84
|
* Initialize the config store with validated configuration
|
|
141
85
|
*/
|
|
142
|
-
init(
|
|
143
|
-
const
|
|
144
|
-
this.config =
|
|
86
|
+
init(e) {
|
|
87
|
+
const i = t(e);
|
|
88
|
+
this.config = i, this.initialized = !0;
|
|
145
89
|
},
|
|
146
90
|
/**
|
|
147
91
|
* Reset the config store
|
|
@@ -152,5 +96,5 @@ const s = o("guido-config", {
|
|
|
152
96
|
}
|
|
153
97
|
});
|
|
154
98
|
export {
|
|
155
|
-
|
|
99
|
+
a as useConfigStore
|
|
156
100
|
};
|
|
@@ -1,22 +1,17 @@
|
|
|
1
|
-
import { removeDuplicatesFromArray as
|
|
2
|
-
import { defineStore as
|
|
3
|
-
const s =
|
|
1
|
+
import { removeDuplicatesFromArray as t } from "../utils/arrayUtil.js";
|
|
2
|
+
import { defineStore as n } from "pinia";
|
|
3
|
+
const s = n("guidoDynamicContent", {
|
|
4
4
|
state: () => ({
|
|
5
5
|
selectedDynamicContent: { text: "", value: "" },
|
|
6
6
|
selectedDynamicContentList: []
|
|
7
7
|
}),
|
|
8
8
|
actions: {
|
|
9
|
-
setSelectedDynamicContent(
|
|
10
|
-
this.selectedDynamicContent =
|
|
9
|
+
setSelectedDynamicContent(e) {
|
|
10
|
+
this.selectedDynamicContent = e, this.selectedDynamicContentList.push(e);
|
|
11
11
|
}
|
|
12
12
|
},
|
|
13
13
|
getters: {
|
|
14
|
-
getSelectedDynamicContentList: (
|
|
15
|
-
text: e.text,
|
|
16
|
-
value: e.value,
|
|
17
|
-
fallback: e.fallback,
|
|
18
|
-
format: e.format
|
|
19
|
-
})) || []
|
|
14
|
+
getSelectedDynamicContentList: (e) => t(e.selectedDynamicContentList)
|
|
20
15
|
}
|
|
21
16
|
});
|
|
22
17
|
export {
|
|
@@ -46,7 +46,7 @@ const t = () => ({
|
|
|
46
46
|
},
|
|
47
47
|
shouldShowOnboarding: (n) => (i) => {
|
|
48
48
|
const o = n.userModalState.Guido;
|
|
49
|
-
return i === "newVersionPopup" &&
|
|
49
|
+
return i === "newVersionPopup" && o?.genericOnboarding ? !1 : o ? !o[i] : !0;
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
52
|
actions: {
|
|
@@ -71,6 +71,10 @@ const t = () => ({
|
|
|
71
71
|
previous(n) {
|
|
72
72
|
this.onboardings[n].cardIndex > 0 && this.onboardings[n].cardIndex--;
|
|
73
73
|
},
|
|
74
|
+
updateCardPosition(n, i, o) {
|
|
75
|
+
const s = this.onboardings[n].config[i];
|
|
76
|
+
s && (s.top = o.top, s.position = o.position);
|
|
77
|
+
},
|
|
74
78
|
setConfig(n, i) {
|
|
75
79
|
this.onboardings[n].config = i ?? [], this.onboardings[n].cardIndex >= this.onboardings[n].config.length && (this.onboardings[n].cardIndex = 0);
|
|
76
80
|
},
|
package/dist/stores/preview.js
CHANGED
|
@@ -1,22 +1,20 @@
|
|
|
1
|
-
import { defineStore as
|
|
2
|
-
const
|
|
1
|
+
import { defineStore as r } from "pinia";
|
|
2
|
+
const e = () => ({
|
|
3
3
|
emailFormat: "html",
|
|
4
4
|
ampHtml: "",
|
|
5
5
|
ampErrors: [],
|
|
6
6
|
templateHtml: "",
|
|
7
7
|
isLoaded: !1,
|
|
8
|
-
isAMPErrorModalVisible: !1
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
isAMPErrorModalVisible: !1,
|
|
9
|
+
emailSizeKB: 0
|
|
10
|
+
}), s = r("guidoPreview", {
|
|
11
|
+
state: () => e(),
|
|
11
12
|
getters: {
|
|
12
13
|
isAMPModeEnabled: (t) => t.emailFormat === "AMP",
|
|
13
14
|
previewHtml() {
|
|
14
15
|
return this.isAMPModeEnabled ? this.ampHtml : this.templateHtml;
|
|
15
16
|
},
|
|
16
|
-
hasAMP: (t) =>
|
|
17
|
-
var r;
|
|
18
|
-
return !!((r = t.ampHtml) != null && r.trim());
|
|
19
|
-
},
|
|
17
|
+
hasAMP: (t) => !!t.ampHtml?.trim(),
|
|
20
18
|
hasAMPErrors: (t) => t.ampErrors.length > 0,
|
|
21
19
|
showAMPErrorButton() {
|
|
22
20
|
return this.isAMPModeEnabled && this.hasAMPErrors;
|
|
@@ -41,5 +39,5 @@ const s = () => ({
|
|
|
41
39
|
}
|
|
42
40
|
});
|
|
43
41
|
export {
|
|
44
|
-
|
|
42
|
+
s as usePreviewStore
|
|
45
43
|
};
|
|
@@ -19,10 +19,7 @@ const r = () => ({
|
|
|
19
19
|
getSelectedCollection: (e) => i[e.selectedCollectionType],
|
|
20
20
|
getSelectedTemplateByActiveType: (e) => e.selectedTemplates[e.activeType],
|
|
21
21
|
getTemplatesByActiveType: (e) => e.templates.filter((t) => t.type === e.activeType),
|
|
22
|
-
getThumbnailByTemplateId: (e) => (t) =>
|
|
23
|
-
var l;
|
|
24
|
-
return ((l = e.templates.find((s) => s.id === t)) == null ? void 0 : l.thumbnail) ?? "";
|
|
25
|
-
},
|
|
22
|
+
getThumbnailByTemplateId: (e) => (t) => e.templates.find((l) => l.id === t)?.thumbnail ?? "",
|
|
26
23
|
getSelectedUnsubscribePagesByCollection: (e) => (t) => {
|
|
27
24
|
const l = i[t];
|
|
28
25
|
if (!l)
|
package/dist/utils/dateUtil.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { DEFAULT_LOCALE as r, DEFAULT as a, DEFAULT_TZ as c } from "../enums/date.js";
|
|
2
2
|
const m = (t) => t ? t instanceof Date ? t : typeof t == "string" ? t.length === 10 ? new Date(Number(t) * 1e3) : new Date(t) : typeof t == "number" ? t.toString().length === 10 ? new Date(t * 1e3) : new Date(t) : /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(), s = () => {
|
|
3
3
|
const t = window.l10n;
|
|
4
|
-
return
|
|
5
|
-
}, u = new Intl.DateTimeFormat().resolvedOptions().timeZone, f = () => {
|
|
6
|
-
const t = window.l10n;
|
|
7
|
-
return (t == null ? void 0 : t.timezone) || u || c;
|
|
8
|
-
}, D = (t, e = s(), n = f()) => {
|
|
4
|
+
return t?.locale === a ? r : t?.locale || r;
|
|
5
|
+
}, u = new Intl.DateTimeFormat().resolvedOptions().timeZone, f = () => window.l10n?.timezone || u || c, l = (t, e = s(), n = f()) => {
|
|
9
6
|
const o = {
|
|
10
7
|
year: "numeric",
|
|
11
8
|
month: "2-digit",
|
|
@@ -13,7 +10,7 @@ const m = (t) => t ? t instanceof Date ? t : typeof t == "string" ? t.length ===
|
|
|
13
10
|
timeZone: n
|
|
14
11
|
}, i = m(t);
|
|
15
12
|
return new Intl.DateTimeFormat(e, o).format(i);
|
|
16
|
-
},
|
|
13
|
+
}, D = (t) => {
|
|
17
14
|
if (!t)
|
|
18
15
|
return "";
|
|
19
16
|
const e = new Date(t);
|
|
@@ -25,12 +22,12 @@ const m = (t) => t ? t instanceof Date ? t : typeof t == "string" ? t.length ===
|
|
|
25
22
|
second: "2-digit",
|
|
26
23
|
hour12: !1
|
|
27
24
|
}).format(e);
|
|
28
|
-
},
|
|
25
|
+
}, T = (t) => t ? Math.floor(Date.now() / 1e3) >= t : !1;
|
|
29
26
|
export {
|
|
30
27
|
m as convertToDateObject,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
D as formatPatchDate,
|
|
29
|
+
l as formatShortDate,
|
|
30
|
+
T as isAfterDate,
|
|
34
31
|
u as localTz,
|
|
35
32
|
s as locale,
|
|
36
33
|
f as timezone
|
|
@@ -1,25 +1,44 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
3
|
-
text:
|
|
4
|
-
value:
|
|
1
|
+
const s = (c) => {
|
|
2
|
+
const a = c.value.match(/\{\{([^}]+)\}\}/)[1].split("|").map((l) => l.trim()), [n] = a, e = {
|
|
3
|
+
text: c.label,
|
|
4
|
+
value: n || ""
|
|
5
5
|
};
|
|
6
|
-
if (
|
|
7
|
-
const [, l,
|
|
8
|
-
|
|
6
|
+
if (a.length >= 2) {
|
|
7
|
+
const [, l, r] = a;
|
|
8
|
+
if (l.startsWith("default:")) {
|
|
9
|
+
let t = l.slice(8).trim();
|
|
10
|
+
t.startsWith('"') && t.endsWith('"') && (t = t.slice(1, -1)), e.fallback = t;
|
|
11
|
+
} else {
|
|
12
|
+
const t = l.includes("=") ? { key: l.split("=")[0].trim(), value: l.split("=")[1].trim() } : null;
|
|
13
|
+
t ? e.format = t : r || (e.fallback = l), r && (e.fallback = r);
|
|
14
|
+
}
|
|
9
15
|
}
|
|
10
16
|
return e;
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
}, u = (c, f = !1) => c.map((a) => {
|
|
18
|
+
if (a.format)
|
|
19
|
+
return {
|
|
20
|
+
label: `${a.text} | ${a.format.key}=${a.format.value}`,
|
|
21
|
+
value: `{{${a.value}|${a.format.key}=${a.format.value}}}`
|
|
22
|
+
};
|
|
23
|
+
if (f) {
|
|
24
|
+
if (!a.fallback)
|
|
25
|
+
return {
|
|
26
|
+
label: a.text,
|
|
27
|
+
value: `{{ ${a.value} }}`
|
|
28
|
+
};
|
|
29
|
+
const e = !Number.isNaN(Number(a.fallback)) && a.fallback.trim() !== "" ? a.fallback : `"${a.fallback}"`;
|
|
30
|
+
return {
|
|
31
|
+
label: `${a.text} | ${a.fallback}`,
|
|
32
|
+
value: `{{ ${a.value} | default: ${e} }}`
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
label: a.fallback ? `${a.text} | ${a.fallback}` : a.text,
|
|
37
|
+
value: a.fallback ? `{{${a.value}|${a.fallback}}}` : `{{${a.value}}}`
|
|
38
|
+
};
|
|
39
|
+
}), o = () => document.head.querySelector('meta[name="csrf-token"]')?.getAttribute("content") ?? "";
|
|
21
40
|
export {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
41
|
+
u as dynamicContentToMergeTags,
|
|
42
|
+
o as getCsrfToken,
|
|
43
|
+
s as mergeTagToDynamicContent
|
|
25
44
|
};
|
|
@@ -1,70 +1,77 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { useToaster as
|
|
5
|
-
|
|
1
|
+
var h = Object.defineProperty;
|
|
2
|
+
var f = (o, e, t) => e in o ? h(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
|
|
3
|
+
var m = (o, e, t) => f(o, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { useToaster as x } from "../composables/useToaster.js";
|
|
5
|
+
const E = /font-family\s*:[^;}"']+/gi;
|
|
6
|
+
class T {
|
|
6
7
|
constructor(e = []) {
|
|
7
|
-
|
|
8
|
+
m(this, "rules");
|
|
8
9
|
this.rules = e;
|
|
9
10
|
}
|
|
10
|
-
compile(e, r) {
|
|
11
|
-
const
|
|
11
|
+
compile(e, t, r) {
|
|
12
|
+
const n = performance.now(), l = e, c = e.length;
|
|
12
13
|
let s = e;
|
|
13
|
-
const
|
|
14
|
-
(
|
|
15
|
-
const
|
|
16
|
-
s = this.applyRule(s,
|
|
14
|
+
const i = [];
|
|
15
|
+
(t || this.rules).sort((p, a) => p.priority - a.priority).forEach((p) => {
|
|
16
|
+
const a = s.length;
|
|
17
|
+
s = this.applyRule(s, p), s.length !== a && i.push(p.id);
|
|
17
18
|
});
|
|
18
|
-
const
|
|
19
|
+
const u = s.length, R = c > 0 ? (c - u) / c * 100 : 0, d = new TextEncoder().encode(s).byteLength;
|
|
20
|
+
let y = 0;
|
|
21
|
+
if (r && r.name && r.family) {
|
|
22
|
+
const p = (s.match(E) || []).length, a = `, ${r.name}, ${r.family}`;
|
|
23
|
+
y = p * new TextEncoder().encode(a).byteLength;
|
|
24
|
+
}
|
|
25
|
+
const g = Math.round((d + y) / 1024);
|
|
19
26
|
return {
|
|
20
|
-
originalHtml:
|
|
27
|
+
originalHtml: l,
|
|
21
28
|
compiledHtml: s,
|
|
22
|
-
appliedRules:
|
|
23
|
-
|
|
29
|
+
appliedRules: i,
|
|
30
|
+
estimatedSizeKB: g,
|
|
24
31
|
stats: {
|
|
25
|
-
originalSize:
|
|
26
|
-
compiledSize:
|
|
32
|
+
originalSize: c,
|
|
33
|
+
compiledSize: u,
|
|
27
34
|
reductionPercentage: R,
|
|
28
|
-
executionTime: performance.now() -
|
|
35
|
+
executionTime: performance.now() - n
|
|
29
36
|
}
|
|
30
37
|
};
|
|
31
38
|
}
|
|
32
|
-
applyRule(e,
|
|
39
|
+
applyRule(e, t) {
|
|
33
40
|
try {
|
|
34
|
-
switch (
|
|
41
|
+
switch (t.type) {
|
|
35
42
|
case "replace":
|
|
36
|
-
return this.applyReplaceRule(e,
|
|
43
|
+
return this.applyReplaceRule(e, t);
|
|
37
44
|
case "regex":
|
|
38
|
-
return this.applyRegexRule(e,
|
|
45
|
+
return this.applyRegexRule(e, t);
|
|
39
46
|
case "remove":
|
|
40
|
-
return this.applyRemoveRule(e,
|
|
47
|
+
return this.applyRemoveRule(e, t);
|
|
41
48
|
case "custom":
|
|
42
|
-
return this.applyCustomRule(e,
|
|
49
|
+
return this.applyCustomRule(e, t);
|
|
43
50
|
default:
|
|
44
51
|
return e;
|
|
45
52
|
}
|
|
46
|
-
} catch (
|
|
47
|
-
const { handleError:
|
|
48
|
-
return
|
|
53
|
+
} catch (r) {
|
|
54
|
+
const { handleError: n } = x();
|
|
55
|
+
return n(r, `Failed to apply rule ${t.id}:`), e;
|
|
49
56
|
}
|
|
50
57
|
}
|
|
51
|
-
applyReplaceRule(e,
|
|
52
|
-
const { search:
|
|
53
|
-
return
|
|
58
|
+
applyReplaceRule(e, t) {
|
|
59
|
+
const { search: r, replacement: n, replaceAll: l = !0 } = t;
|
|
60
|
+
return l ? e.replaceAll(r, n) : e.replace(r, n);
|
|
54
61
|
}
|
|
55
|
-
applyRegexRule(e,
|
|
56
|
-
const { pattern:
|
|
57
|
-
return e.replace(
|
|
62
|
+
applyRegexRule(e, t) {
|
|
63
|
+
const { pattern: r, replacement: n, flags: l = "g" } = t, c = new RegExp(r, l);
|
|
64
|
+
return e.replace(c, n);
|
|
58
65
|
}
|
|
59
|
-
applyRemoveRule(e,
|
|
60
|
-
return
|
|
66
|
+
applyRemoveRule(e, t) {
|
|
67
|
+
return t.targets.reduce((r, n) => n instanceof RegExp ? r.replace(n, "") : r.replaceAll(n, ""), e);
|
|
61
68
|
}
|
|
62
|
-
applyCustomRule(e,
|
|
63
|
-
return
|
|
69
|
+
applyCustomRule(e, t) {
|
|
70
|
+
return t.processor(e);
|
|
64
71
|
}
|
|
65
72
|
}
|
|
66
|
-
const
|
|
73
|
+
const H = (o = []) => new T(o);
|
|
67
74
|
export {
|
|
68
|
-
|
|
69
|
-
|
|
75
|
+
T as HtmlCompilerEngine,
|
|
76
|
+
H as createHtmlCompiler
|
|
70
77
|
};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { productPairs as
|
|
2
|
-
function
|
|
3
|
-
const R =
|
|
1
|
+
import { productPairs as M } from "../extensions/Blocks/Items/enums/productEnums.js";
|
|
2
|
+
function D(k) {
|
|
3
|
+
const R = k.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->"), $ = new DOMParser().parseFromString(R, "text/html"), y = M.PAIRS_FOR_EXTENSION;
|
|
4
4
|
Object.entries(y).forEach(([n, l]) => {
|
|
5
5
|
$.querySelectorAll(".ins-product-td").forEach((c) => {
|
|
6
6
|
const E = c.getAttribute("data-number") || "1", T = c.getAttribute("data-type") || "CART_ITEMS";
|
|
7
7
|
c.querySelectorAll(`[product-attr="${n}"]`).forEach((e) => {
|
|
8
|
-
var H;
|
|
9
8
|
const b = e.getAttribute("data-type") || T, u = e.getAttribute("data-number") || E, p = l[b];
|
|
10
9
|
if (p)
|
|
11
10
|
switch (n) {
|
|
@@ -22,7 +21,7 @@ function L(F) {
|
|
|
22
21
|
}) && (t.src = `{{${a}_${u}}}`);
|
|
23
22
|
}
|
|
24
23
|
if (o) {
|
|
25
|
-
const r =
|
|
24
|
+
const r = y.itemLink?.[b];
|
|
26
25
|
if (r) {
|
|
27
26
|
const d = r.HREF, f = r.DEFAULT_HREF || "#!", s = o.href;
|
|
28
27
|
(s === "#" || s === "" || s.endsWith("#!") || s.endsWith(f) || s === `${window.location.href}${f}` || !s || s === window.location.href) && (o.href = `{{${d}_${u}}}`);
|
|
@@ -48,8 +47,8 @@ function L(F) {
|
|
|
48
47
|
const s = t.CURRENCY;
|
|
49
48
|
let _ = `{{${f}_${u}}}`;
|
|
50
49
|
if (s) {
|
|
51
|
-
const
|
|
52
|
-
_ = d === "after" ? `${_} ${
|
|
50
|
+
const H = `{{${s}_${u}}}`;
|
|
51
|
+
_ = d === "after" ? `${_} ${H}` : `${H} ${_}`;
|
|
53
52
|
}
|
|
54
53
|
e.textContent = _;
|
|
55
54
|
break;
|
|
@@ -86,9 +85,9 @@ function L(F) {
|
|
|
86
85
|
});
|
|
87
86
|
});
|
|
88
87
|
});
|
|
89
|
-
const S = R.match(/<!DOCTYPE[^>]*>/i),
|
|
90
|
-
` : "",
|
|
91
|
-
|
|
88
|
+
const S = R.match(/<!DOCTYPE[^>]*>/i), F = S ? `${S[0]}
|
|
89
|
+
` : "", I = $.querySelectorAll(".ins-product-td"), m = [];
|
|
90
|
+
I.forEach((n) => {
|
|
92
91
|
const l = n.getAttribute("data-type") || "CART_ITEMS", A = n.getAttribute("data-number") || "1", c = n.getAttribute("data-nodup"), E = n.outerHTML;
|
|
93
92
|
m.push({
|
|
94
93
|
element: n,
|
|
@@ -98,7 +97,7 @@ function L(F) {
|
|
|
98
97
|
nodup: c || void 0
|
|
99
98
|
});
|
|
100
99
|
});
|
|
101
|
-
let h =
|
|
100
|
+
let h = F + $.documentElement.outerHTML;
|
|
102
101
|
m.reverse().forEach(({ outerHtml: n, type: l, number: A }) => {
|
|
103
102
|
let c = "";
|
|
104
103
|
switch (l) {
|
|
@@ -117,8 +116,8 @@ function L(F) {
|
|
|
117
116
|
h = h.replace(n, b);
|
|
118
117
|
}
|
|
119
118
|
});
|
|
120
|
-
const
|
|
121
|
-
return
|
|
119
|
+
const w = $.querySelectorAll('[product-attr="originalPrice"][data-type="CART_ITEMS"]'), g = [];
|
|
120
|
+
return w.forEach((n) => {
|
|
122
121
|
const l = n.getAttribute("data-number"), A = n.getAttribute("data-type");
|
|
123
122
|
if (!l || A !== "CART_ITEMS")
|
|
124
123
|
return;
|
|
@@ -136,5 +135,5 @@ function L(F) {
|
|
|
136
135
|
}), h.replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}");
|
|
137
136
|
}
|
|
138
137
|
export {
|
|
139
|
-
|
|
138
|
+
D as pairProductVariables
|
|
140
139
|
};
|