@useinsider/guido 3.2.0-beta.565bfaf → 3.2.0-beta.570fb6d
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/dist/@types/config/schemas.js +1 -1
- package/dist/@types/config/validator.js +27 -34
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +76 -81
- 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/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 +11 -12
- package/dist/components/organisms/header/EditorActions.vue2.js +18 -22
- 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.vue2.js +14 -17
- package/dist/components/organisms/onboarding/AMPOnboarding.vue.js +11 -12
- package/dist/components/organisms/onboarding/AMPOnboarding.vue2.js +20 -22
- package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +11 -12
- package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +38 -41
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +11 -12
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +38 -43
- 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 +11 -12
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +27 -29
- package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue.js +11 -12
- package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +19 -21
- package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +8 -9
- 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 -26
- package/dist/composables/useHtmlValidator.js +101 -109
- package/dist/composables/useHttp.js +30 -30
- package/dist/composables/usePartner.js +1 -1
- package/dist/composables/useRecommendation.js +14 -15
- package/dist/composables/useSave.js +21 -22
- package/dist/composables/useStripo.js +47 -42
- package/dist/composables/useSyncModuleExtractor.js +31 -29
- package/dist/composables/useTimerClone.js +24 -25
- package/dist/composables/useTranslations.js +23 -16
- package/dist/composables/useValidation.js +7 -8
- package/dist/composables/validators/useLiquidValidator.js +13 -13
- package/dist/config/compiler/recommendationCompilerRules.js +72 -67
- package/dist/config/compiler/unsubscribeCompilerRules.js +38 -37
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +36 -34
- package/dist/config/migrator/checkboxMigrator.js +20 -21
- package/dist/config/migrator/couponBlockMigrator.js +18 -19
- package/dist/config/migrator/itemsBlockMigrator.js +87 -89
- package/dist/config/migrator/radioButtonMigrator.js +12 -13
- package/dist/config/migrator/recommendationMigrator.js +107 -110
- package/dist/config/migrator/unsubscribeMigrator.js +10 -11
- package/dist/enums/displayConditions.js +78 -82
- package/dist/enums/extensions/recommendationBlock.js +41 -95
- package/dist/enums/unsubscribe.js +35 -30
- package/dist/extensions/Blocks/Checkbox/control.js +23 -23
- 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/RadioButton/control.js +15 -15
- package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/controls/button/index.js +36 -36
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +128 -133
- 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 +134 -135
- 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 +32 -32
- 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 +22 -23
- package/dist/extensions/Blocks/Recommendation/templates/grid/migration.js +10 -10
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +10 -10
- package/dist/extensions/Blocks/Recommendation/templates/index.js +6 -6
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +24 -25
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +11 -11
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +45 -47
- 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 +53 -58
- package/dist/guido.css +1 -1
- package/dist/library.js +11 -12
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +272 -167
- package/dist/node_modules/valibot/dist/index.js +122 -126
- package/dist/package.json.js +1 -1
- package/dist/services/recommendationApi.js +14 -17
- package/dist/services/templateLibraryApi.js +37 -38
- package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
- package/dist/src/composables/useActionsApi.d.ts +1 -1
- package/dist/src/composables/useFullStoryBridge.d.ts +11 -0
- package/dist/src/composables/useHtmlCompiler.d.ts +1 -2
- package/dist/src/composables/useTranslations.d.ts +1 -1
- package/dist/src/enums/displayConditions.d.ts +1 -5
- package/dist/src/enums/extensions/recommendationBlock.d.ts +1 -5
- package/dist/src/enums/unsubscribe.d.ts +8 -8
- package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +1 -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/stores/dynamic-content.d.ts +3 -3
- package/dist/static/styles/components/button.css.js +16 -9
- package/dist/static/styles/components/loader.css.js +4 -0
- package/dist/static/styles/components/narrow-panel.css.js +52 -0
- package/dist/stores/config.js +25 -81
- package/dist/stores/dynamic-content.js +6 -11
- package/dist/stores/onboarding.js +5 -5
- package/dist/stores/preview.js +6 -9
- package/dist/stores/unsubscribe.js +1 -4
- package/dist/utils/dateUtil.js +7 -10
- package/dist/utils/genericUtil.js +10 -13
- package/dist/utils/pairProductVariables.js +13 -14
- package/package.json +8 -5
- package/dist/node_modules/lodash-es/_DataView.js +0 -6
- package/dist/node_modules/lodash-es/_Hash.js +0 -20
- package/dist/node_modules/lodash-es/_ListCache.js +0 -20
- package/dist/node_modules/lodash-es/_Map.js +0 -6
- package/dist/node_modules/lodash-es/_MapCache.js +0 -20
- 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/_Symbol.js +0 -5
- 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/_assocIndexOf.js +0 -10
- 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/_baseGetTag.js +0 -10
- 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/_baseIsNative.js +0 -16
- 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/_coreJsData.js +0 -5
- 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/_freeGlobal.js +0 -4
- package/dist/node_modules/lodash-es/_getAllKeys.js +0 -9
- package/dist/node_modules/lodash-es/_getMapData.js +0 -8
- package/dist/node_modules/lodash-es/_getMatchData.js +0 -12
- package/dist/node_modules/lodash-es/_getNative.js +0 -9
- package/dist/node_modules/lodash-es/_getRawTag.js +0 -15
- 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/_getValue.js +0 -6
- package/dist/node_modules/lodash-es/_hasPath.js +0 -19
- package/dist/node_modules/lodash-es/_hashClear.js +0 -7
- package/dist/node_modules/lodash-es/_hashDelete.js +0 -7
- package/dist/node_modules/lodash-es/_hashGet.js +0 -13
- package/dist/node_modules/lodash-es/_hashHas.js +0 -9
- package/dist/node_modules/lodash-es/_hashSet.js +0 -9
- 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/_isKeyable.js +0 -7
- package/dist/node_modules/lodash-es/_isMasked.js +0 -11
- 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/_listCacheClear.js +0 -6
- package/dist/node_modules/lodash-es/_listCacheDelete.js +0 -12
- package/dist/node_modules/lodash-es/_listCacheGet.js +0 -8
- package/dist/node_modules/lodash-es/_listCacheHas.js +0 -7
- package/dist/node_modules/lodash-es/_listCacheSet.js +0 -8
- package/dist/node_modules/lodash-es/_mapCacheClear.js +0 -13
- package/dist/node_modules/lodash-es/_mapCacheDelete.js +0 -8
- package/dist/node_modules/lodash-es/_mapCacheGet.js +0 -7
- package/dist/node_modules/lodash-es/_mapCacheHas.js +0 -7
- package/dist/node_modules/lodash-es/_mapCacheSet.js +0 -8
- 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/_nativeCreate.js +0 -5
- 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/_objectToString.js +0 -7
- package/dist/node_modules/lodash-es/_overArg.js +0 -8
- package/dist/node_modules/lodash-es/_root.js +0 -5
- 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/_toSource.js +0 -17
- package/dist/node_modules/lodash-es/_trimmedEndIndex.js +0 -9
- package/dist/node_modules/lodash-es/eq.js +0 -6
- 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/isFunction.js +0 -12
- package/dist/node_modules/lodash-es/isLength.js +0 -7
- package/dist/node_modules/lodash-es/isObject.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/memoize.js +0 -18
- 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,10 +1,10 @@
|
|
|
1
|
+
import { useRecommendationExtensionStore as p } from "../../store/recommendation.js";
|
|
2
|
+
import { formatPrice as b } from "../../utils/priceFormatter.js";
|
|
3
|
+
import { sanitizeImageUrl as u, CUSTOM_CELL_HTML as m } from "../utils.js";
|
|
4
|
+
import { ATTR_PRODUCT_ATTR as g, ATTR_PRODUCT_BUTTON as i, ATTR_PRODUCT_IMAGE as c, ATTR_PRODUCT_OMNIBUS_DISCOUNT as f, ATTR_PRODUCT_OMNIBUS_PRICE as T, ATTR_PRODUCT_OLD_PRICE as x, ATTR_PRODUCT_PRICE as _, ATTR_PRODUCT_NAME as R } from "../../constants/selectors.js";
|
|
1
5
|
import { RecommendationBlockId as o } from "../../constants/blockIds.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { formatPrice as R } from "../../utils/priceFormatter.js";
|
|
5
|
-
import { sanitizeImageUrl as C, CUSTOM_CELL_HTML as y } from "../utils.js";
|
|
6
|
-
function p() {
|
|
7
|
-
const t = _(), { currencySettings: e } = t.recommendationConfigs;
|
|
6
|
+
function l() {
|
|
7
|
+
const t = p(), { currencySettings: e } = t.recommendationConfigs;
|
|
8
8
|
return {
|
|
9
9
|
code: e.value,
|
|
10
10
|
symbol: e.symbol,
|
|
@@ -15,29 +15,29 @@ function p() {
|
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
17
|
function s(t, e = "price") {
|
|
18
|
-
const n =
|
|
19
|
-
return
|
|
18
|
+
const n = l(), r = t[e], a = r?.[n.code] ?? Object.values(r ?? {})[0] ?? 0;
|
|
19
|
+
return b({
|
|
20
20
|
price: a,
|
|
21
21
|
currency: n
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
|
-
const
|
|
24
|
+
const P = {
|
|
25
25
|
/**
|
|
26
26
|
* Image cell - left column (120px fixed width)
|
|
27
27
|
* Has recommendation-attribute-row class and data attributes for Card Composition control
|
|
28
28
|
*/
|
|
29
|
-
[
|
|
29
|
+
[c]: (t) => `
|
|
30
30
|
<td
|
|
31
31
|
width="120"
|
|
32
32
|
class="esd-block-image product-image-cell recommendation-attribute-row es-p5"
|
|
33
33
|
esd-extension-block-id="${o.IMAGE}"
|
|
34
|
-
data-attribute-type="${
|
|
34
|
+
data-attribute-type="${c}"
|
|
35
35
|
data-visibility="1"
|
|
36
36
|
align="center"
|
|
37
37
|
valign="middle">
|
|
38
38
|
<a target="_blank" href="${t.url}">
|
|
39
39
|
<img
|
|
40
|
-
src="${
|
|
40
|
+
src="${u(t.image_url)}"
|
|
41
41
|
alt="${t.name}"
|
|
42
42
|
style="display: block; max-width: 100%; height: auto;"
|
|
43
43
|
class="adapt-img product-image">
|
|
@@ -47,7 +47,7 @@ const I = {
|
|
|
47
47
|
/**
|
|
48
48
|
* Name element - row for info cell table
|
|
49
49
|
*/
|
|
50
|
-
[
|
|
50
|
+
[R]: (t) => `
|
|
51
51
|
<tr>
|
|
52
52
|
<td
|
|
53
53
|
class="esd-block-text product-name"
|
|
@@ -62,7 +62,7 @@ const I = {
|
|
|
62
62
|
/**
|
|
63
63
|
* Price element - row for info cell table
|
|
64
64
|
*/
|
|
65
|
-
[
|
|
65
|
+
[_]: (t) => `
|
|
66
66
|
<tr>
|
|
67
67
|
<td
|
|
68
68
|
class="esd-block-text product-price"
|
|
@@ -77,7 +77,7 @@ const I = {
|
|
|
77
77
|
/**
|
|
78
78
|
* Old price element - row for info cell table
|
|
79
79
|
*/
|
|
80
|
-
[
|
|
80
|
+
[x]: (t) => `
|
|
81
81
|
<tr>
|
|
82
82
|
<td
|
|
83
83
|
class="esd-block-text product-old-price"
|
|
@@ -94,7 +94,7 @@ const I = {
|
|
|
94
94
|
/**
|
|
95
95
|
* Omnibus price element - row for info cell table
|
|
96
96
|
*/
|
|
97
|
-
[
|
|
97
|
+
[T]: (t) => `
|
|
98
98
|
<tr>
|
|
99
99
|
<td
|
|
100
100
|
class="esd-block-text product-omnibus-price"
|
|
@@ -113,9 +113,8 @@ const I = {
|
|
|
113
113
|
/**
|
|
114
114
|
* Omnibus discount element - row for info cell table
|
|
115
115
|
*/
|
|
116
|
-
[
|
|
117
|
-
|
|
118
|
-
const e = p(), n = ((i = t.original_price) == null ? void 0 : i[e.code]) ?? Object.values(t.original_price ?? {})[0] ?? 0, r = ((c = t.price) == null ? void 0 : c[e.code]) ?? Object.values(t.price ?? {})[0] ?? 0, a = n > 0 ? Math.round((n - r) / n * 100) : 0, b = a > 0 ? `-${a}%` : "0%";
|
|
116
|
+
[f]: (t) => {
|
|
117
|
+
const e = l(), n = t.original_price?.[e.code] ?? Object.values(t.original_price ?? {})[0] ?? 0, r = t.price?.[e.code] ?? Object.values(t.price ?? {})[0] ?? 0, a = n > 0 ? Math.round((n - r) / n * 100) : 0, d = a > 0 ? `-${a}%` : "0%";
|
|
119
118
|
return `
|
|
120
119
|
<tr>
|
|
121
120
|
<td
|
|
@@ -126,7 +125,7 @@ const I = {
|
|
|
126
125
|
align="left">
|
|
127
126
|
<p contenteditable="false" style="font-size: 12px; color: #666666; margin: 0;">
|
|
128
127
|
<span class="omnibus-text-before"></span>
|
|
129
|
-
<span class="omnibus-discount-value">${
|
|
128
|
+
<span class="omnibus-discount-value">${d}</span>
|
|
130
129
|
<span class="omnibus-text-after"></span>
|
|
131
130
|
</p>
|
|
132
131
|
</td>
|
|
@@ -137,12 +136,12 @@ const I = {
|
|
|
137
136
|
* Button cell - right column (100px fixed width)
|
|
138
137
|
* Has recommendation-attribute-row class and data attributes for Card Composition control
|
|
139
138
|
*/
|
|
140
|
-
[
|
|
139
|
+
[i]: (t) => `
|
|
141
140
|
<td
|
|
142
141
|
width="100"
|
|
143
142
|
class="esd-block-button button-cell recommendation-attribute-row product-button es-p5l es-p5r"
|
|
144
143
|
esd-extension-block-id="${o.BUTTON}"
|
|
145
|
-
data-attribute-type="${
|
|
144
|
+
data-attribute-type="${i}"
|
|
146
145
|
data-visibility="1"
|
|
147
146
|
align="center"
|
|
148
147
|
valign="middle">
|
|
@@ -169,10 +168,10 @@ const I = {
|
|
|
169
168
|
* @param productAttrValue - Resolved product-attr value (e.g., "brand" for default, "product_attribute.rating_star" for custom)
|
|
170
169
|
* @param content - Display content for the cell
|
|
171
170
|
*/
|
|
172
|
-
[
|
|
171
|
+
[m]: (t, e) => `
|
|
173
172
|
<tr>
|
|
174
173
|
<td
|
|
175
|
-
${
|
|
174
|
+
${g}="${t}"
|
|
176
175
|
class="esd-block-text product-custom-attribute"
|
|
177
176
|
esd-extension-block-id="${o.CUSTOM_ATTRIBUTE}"
|
|
178
177
|
align="left">
|
|
@@ -182,5 +181,5 @@ const I = {
|
|
|
182
181
|
`
|
|
183
182
|
};
|
|
184
183
|
export {
|
|
185
|
-
|
|
184
|
+
P as listElementRenderer
|
|
186
185
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
function
|
|
1
|
+
import { DEFAULT_CARD_COMPOSITION as b, spacer as m, buildElementRenderer as C, DEFAULT_CARD_VISIBILITY as T } from "../utils.js";
|
|
2
|
+
import { listElementRenderer as f } from "./elementRenderer.js";
|
|
3
|
+
import { ATTR_PRODUCT_IMAGE as a, ATTR_PRODUCT_BUTTON as d } from "../../constants/selectors.js";
|
|
4
|
+
function R(r, n, l) {
|
|
5
5
|
const t = l ? "" : ' style="display: none;"', o = r.replace(/<tr>/, "").replace(/<\/tr>/, "");
|
|
6
6
|
return `<tr
|
|
7
7
|
class="recommendation-attribute-row"
|
|
@@ -26,26 +26,26 @@ const y = `
|
|
|
26
26
|
</td>
|
|
27
27
|
</tr>
|
|
28
28
|
`;
|
|
29
|
-
function O(r, n =
|
|
30
|
-
const t =
|
|
29
|
+
function O(r, n = b, l = {}) {
|
|
30
|
+
const t = C(f, n, l), o = t[a](r), c = `
|
|
31
31
|
<td class="product-info-cell" valign="middle" style="padding: 15px;">
|
|
32
|
-
<table cellpadding="0" cellspacing="0" role="presentation" width="100%">
|
|
32
|
+
<table cellpadding="0" cellspacing="0" role="presentation" width="100%" style="table-layout: fixed;">
|
|
33
33
|
<tbody>
|
|
34
|
-
${n.filter((e) => e !==
|
|
34
|
+
${n.filter((e) => e !== a && e !== d).filter((e) => t[e]).map((e) => {
|
|
35
35
|
const u = T[e] ?? !0;
|
|
36
|
-
return
|
|
36
|
+
return R(t[e](r), e, u);
|
|
37
37
|
}).join(`
|
|
38
38
|
`)}
|
|
39
39
|
</tbody>
|
|
40
40
|
</table>
|
|
41
41
|
</td>
|
|
42
|
-
`, s = t[
|
|
42
|
+
`, s = t[d](r), p = o + c + s;
|
|
43
43
|
return y.replace("{-{-PRODUCT_CONTENT-}-}", p);
|
|
44
44
|
}
|
|
45
45
|
function D(r, n, l = {}) {
|
|
46
46
|
return r.map((t, o) => {
|
|
47
47
|
const i = O(t, n, l);
|
|
48
|
-
return o > 0 ?
|
|
48
|
+
return o > 0 ? m + i : i;
|
|
49
49
|
}).join("");
|
|
50
50
|
}
|
|
51
51
|
export {
|
|
@@ -1,60 +1,58 @@
|
|
|
1
|
-
import { ATTR_PRODUCT_IMAGE as
|
|
2
|
-
function
|
|
1
|
+
import { ATTR_PRODUCT_IMAGE as u, ATTR_PRODUCT_NAME as m, ATTR_PRODUCT_OLD_PRICE as b, ATTR_PRODUCT_PRICE as T, ATTR_PRODUCT_OMNIBUS_PRICE as _, ATTR_PRODUCT_OMNIBUS_DISCOUNT as g, ATTR_PRODUCT_BUTTON as C, ATTR_CUSTOM_PREFIX as p } from "../constants/selectors.js";
|
|
2
|
+
function O(t) {
|
|
3
3
|
return t.replace(/_/g, " ").replace(/\b\w/g, (e) => e.toUpperCase());
|
|
4
4
|
}
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
return (n == null ? void 0 : n.type) === "defaultAttribute";
|
|
5
|
+
function f(t, e) {
|
|
6
|
+
return Object.values(e).find((r) => r.attributeName === t)?.type === "defaultAttribute";
|
|
8
7
|
}
|
|
9
|
-
function
|
|
10
|
-
return
|
|
8
|
+
function U(t, e) {
|
|
9
|
+
return f(t, e) ? t : `product_attribute.${t}`;
|
|
11
10
|
}
|
|
12
|
-
const
|
|
13
|
-
function
|
|
14
|
-
const r = t[
|
|
11
|
+
const y = Symbol("customCellHtml");
|
|
12
|
+
function E(t, e, n = {}) {
|
|
13
|
+
const r = t[y];
|
|
15
14
|
if (!r)
|
|
16
15
|
return { ...t };
|
|
17
16
|
const l = { ...t };
|
|
18
|
-
return e.filter((o) => o.startsWith(
|
|
19
|
-
const s = o.substring(
|
|
17
|
+
return e.filter((o) => o.startsWith(p) && !l[o]).forEach((o) => {
|
|
18
|
+
const s = o.substring(p.length), a = O(s), A = U(s, n), D = f(s, n);
|
|
20
19
|
l[o] = (d) => {
|
|
21
|
-
|
|
22
|
-
const i = O ? d[s] : (p = d.product_attributes) == null ? void 0 : p[s];
|
|
20
|
+
const i = D ? d[s] : d.product_attributes?.[s];
|
|
23
21
|
let c = a;
|
|
24
|
-
return typeof i == "string" ? c = i : typeof i == "number" && (c = String(i)), r(
|
|
22
|
+
return typeof i == "string" ? c = i : typeof i == "number" && (c = String(i)), r(A, c);
|
|
25
23
|
};
|
|
26
24
|
}), l;
|
|
27
25
|
}
|
|
28
|
-
const
|
|
26
|
+
const S = {
|
|
29
27
|
TITLE: "You May Also Like!"
|
|
30
|
-
},
|
|
28
|
+
}, L = [
|
|
29
|
+
u,
|
|
31
30
|
m,
|
|
32
31
|
b,
|
|
33
32
|
T,
|
|
34
33
|
_,
|
|
35
34
|
g,
|
|
36
|
-
C
|
|
37
|
-
|
|
38
|
-
],
|
|
35
|
+
C
|
|
36
|
+
], M = {
|
|
37
|
+
[u]: !0,
|
|
39
38
|
[m]: !0,
|
|
40
|
-
[b]: !0,
|
|
41
|
-
[_]: !0,
|
|
42
39
|
[T]: !0,
|
|
40
|
+
[b]: !0,
|
|
41
|
+
[_]: !1,
|
|
43
42
|
[g]: !1,
|
|
44
|
-
[C]: !
|
|
45
|
-
|
|
46
|
-
}, h = `
|
|
43
|
+
[C]: !0
|
|
44
|
+
}, P = `
|
|
47
45
|
<tr>
|
|
48
46
|
<td class="spacer" style="height: 10px;"></td>
|
|
49
47
|
</tr>
|
|
50
|
-
`,
|
|
51
|
-
function
|
|
52
|
-
return !t || typeof t != "string" || t.trim() === "" ?
|
|
48
|
+
`, R = "https://email-static.useinsider.com/stripo/modules/email-recommendation-v3/assets/images/image-placeholder.png";
|
|
49
|
+
function $(t) {
|
|
50
|
+
return !t || typeof t != "string" || t.trim() === "" ? R : t.startsWith("http://") ? t.replace("http://", "https://") : t;
|
|
53
51
|
}
|
|
54
|
-
function
|
|
52
|
+
function h(t) {
|
|
55
53
|
return {
|
|
56
54
|
name: "Product Name",
|
|
57
|
-
image_url:
|
|
55
|
+
image_url: R,
|
|
58
56
|
price: { USD: 18 },
|
|
59
57
|
original_price: { USD: 20 },
|
|
60
58
|
discount: { USD: 2 },
|
|
@@ -66,13 +64,13 @@ function I(t) {
|
|
|
66
64
|
category: []
|
|
67
65
|
};
|
|
68
66
|
}
|
|
69
|
-
function
|
|
67
|
+
function w(t = 6) {
|
|
70
68
|
return Array.from(
|
|
71
69
|
{ length: t },
|
|
72
|
-
(e, n) =>
|
|
70
|
+
(e, n) => h(String(n + 1))
|
|
73
71
|
);
|
|
74
72
|
}
|
|
75
|
-
function
|
|
73
|
+
function N(t = "grid", e) {
|
|
76
74
|
const n = t === "list" ? `
|
|
77
75
|
data-layout="list"` : "", r = e ? ` ${e}` : "";
|
|
78
76
|
return `
|
|
@@ -110,7 +108,7 @@ function k(t = "grid", e) {
|
|
|
110
108
|
</table>
|
|
111
109
|
</td>
|
|
112
110
|
</tr>
|
|
113
|
-
${
|
|
111
|
+
${P}
|
|
114
112
|
<tr>
|
|
115
113
|
<td>
|
|
116
114
|
<table
|
|
@@ -149,17 +147,17 @@ function k(t = "grid", e) {
|
|
|
149
147
|
`;
|
|
150
148
|
}
|
|
151
149
|
export {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
150
|
+
y as CUSTOM_CELL_HTML,
|
|
151
|
+
S as DEFAULTS,
|
|
152
|
+
L as DEFAULT_CARD_COMPOSITION,
|
|
153
|
+
M as DEFAULT_CARD_VISIBILITY,
|
|
154
|
+
R as PLACEHOLDER_IMAGE,
|
|
155
|
+
E as buildElementRenderer,
|
|
156
|
+
N as createBlockTemplate,
|
|
157
|
+
w as getDefaultProducts,
|
|
158
|
+
f as isDefaultAttribute,
|
|
159
|
+
U as resolveProductAttrValue,
|
|
160
|
+
$ as sanitizeImageUrl,
|
|
161
|
+
P as spacer,
|
|
162
|
+
O as toDisplayName
|
|
165
163
|
};
|
|
@@ -1,28 +1,31 @@
|
|
|
1
1
|
function l(t) {
|
|
2
2
|
if (t.length === 0)
|
|
3
3
|
return "";
|
|
4
|
-
const o = t.sort((r, e) => r.filterNumber - e.filterNumber),
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
const o = t.sort((r, e) => r.filterNumber - e.filterNumber), u = o.map((r) => {
|
|
5
|
+
const e = r.operator === "||", a = e ? "=" : r.operator, c = e ? decodeURIComponent(r.value).split(",").join("||") : r.value;
|
|
6
|
+
return `[${r.attribute}][${a}][${c}]`;
|
|
7
|
+
}), [s, ...p] = u;
|
|
8
|
+
let n = s;
|
|
9
|
+
for (let r = 0; r < p.length; r++) {
|
|
7
10
|
const e = o[r].innerGroupOperator;
|
|
8
|
-
|
|
11
|
+
n += `${e}${p[r]}`;
|
|
9
12
|
}
|
|
10
|
-
return `(${
|
|
13
|
+
return `(${n})`;
|
|
11
14
|
}
|
|
12
|
-
function
|
|
15
|
+
function G(t) {
|
|
13
16
|
if (!t || t.length === 0)
|
|
14
17
|
return "";
|
|
15
|
-
const o = t.reduce((r, e) => (r[e.filterGroup] || (r[e.filterGroup] = []), r[e.filterGroup].push(e), r), {}),
|
|
18
|
+
const o = t.reduce((r, e) => (r[e.filterGroup] || (r[e.filterGroup] = []), r[e.filterGroup].push(e), r), {}), u = Object.keys(o).map(Number).sort((r, e) => r - e), s = u.map((r) => {
|
|
16
19
|
const e = o[r];
|
|
17
20
|
return l(e);
|
|
18
|
-
}), [
|
|
19
|
-
let
|
|
20
|
-
for (let r = 0; r <
|
|
21
|
-
const e =
|
|
22
|
-
|
|
21
|
+
}), [p, ...n] = s;
|
|
22
|
+
let i = p;
|
|
23
|
+
for (let r = 0; r < n.length; r++) {
|
|
24
|
+
const e = u[r + 1], c = o[e][0].outerGroupOperator;
|
|
25
|
+
i += `${c}${n[r]}`;
|
|
23
26
|
}
|
|
24
|
-
return
|
|
27
|
+
return i.trim();
|
|
25
28
|
}
|
|
26
29
|
export {
|
|
27
|
-
|
|
30
|
+
G as generateCompleteFilterQuery
|
|
28
31
|
};
|
|
@@ -1,29 +1,26 @@
|
|
|
1
|
-
import { safeParse as
|
|
2
|
-
const e =
|
|
1
|
+
import { safeParse as i, object as a, boolean as p, number as n, pipe as l, minLength as c, string as f } from "../../../../node_modules/valibot/dist/index.js";
|
|
2
|
+
const e = l(f(), c(1)), o = a({
|
|
3
3
|
type: e,
|
|
4
4
|
attribute: e,
|
|
5
5
|
operator: e,
|
|
6
6
|
innerGroupOperator: e,
|
|
7
7
|
outerGroupOperator: e,
|
|
8
8
|
value: e,
|
|
9
|
-
filterGroup:
|
|
10
|
-
filterNumber:
|
|
11
|
-
isValid:
|
|
9
|
+
filterGroup: n(),
|
|
10
|
+
filterNumber: n(),
|
|
11
|
+
isValid: p()
|
|
12
12
|
});
|
|
13
|
-
function
|
|
14
|
-
return o
|
|
13
|
+
function b(t) {
|
|
14
|
+
return i(o, t).success;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
const r = o
|
|
16
|
+
function g(t) {
|
|
17
|
+
const r = i(o, t);
|
|
18
18
|
return r.success ? /* @__PURE__ */ new Set() : new Set(
|
|
19
|
-
r.issues.flatMap((u) =>
|
|
20
|
-
var n;
|
|
21
|
-
return ((n = u.path) == null ? void 0 : n.map((a) => String(a.key))) ?? [];
|
|
22
|
-
})
|
|
19
|
+
r.issues.flatMap((s) => s.path?.map((u) => String(u.key)) ?? [])
|
|
23
20
|
);
|
|
24
21
|
}
|
|
25
22
|
export {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
o as FilterSchema,
|
|
24
|
+
g as getInvalidFilterFields,
|
|
25
|
+
b as isFilterValid
|
|
29
26
|
};
|
|
@@ -3,15 +3,15 @@ var h = (n, i, e) => i in n ? d(n, i, { enumerable: !0, configurable: !0, writab
|
|
|
3
3
|
var u = (n, i, e) => h(n, typeof i != "symbol" ? i + "" : i, e);
|
|
4
4
|
import { PAGE_TYPES as E } from "../../../enums/unsubscribe.js";
|
|
5
5
|
import { useUnsubscribeStore as c } from "../../../stores/unsubscribe.js";
|
|
6
|
-
import { Block as _, BlockCompositionType as S, ModificationDescription as b } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
7
|
-
import { getDefaultTemplate as
|
|
6
|
+
import { Block as _, BlockCompositionType as S, BlockType as L, ModificationDescription as b } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
7
|
+
import { getDefaultTemplate as v } from "./template.js";
|
|
8
8
|
import { UNSUBSCRIBE_EVENTS as a, DATA_ATTRIBUTES as o } from "./utils/constants.js";
|
|
9
9
|
import { parsePageList as p } from "./utils/utils.js";
|
|
10
|
-
const
|
|
10
|
+
const g = "unsubscribe-block", T = 'a[data-unsubscribe-link="true"]', f = ".unsubscribe-block-v2", B = "{{ins-unsubscribe-link}}", C = {
|
|
11
11
|
[E.GLOBAL_UNSUBSCRIBE]: "{{ins-global-unsubscribe-link}}",
|
|
12
12
|
[E.SUBSCRIPTION_PREFERENCE_CENTER]: "{{ins-preferences-unsubscribe-link}}"
|
|
13
13
|
};
|
|
14
|
-
class
|
|
14
|
+
class I extends _ {
|
|
15
15
|
constructor() {
|
|
16
16
|
super();
|
|
17
17
|
u(this, "selectEventListener", null);
|
|
@@ -19,7 +19,7 @@ class R extends _ {
|
|
|
19
19
|
u(this, "currentNode");
|
|
20
20
|
}
|
|
21
21
|
getId() {
|
|
22
|
-
return
|
|
22
|
+
return g;
|
|
23
23
|
}
|
|
24
24
|
getIcon() {
|
|
25
25
|
return "unsubscribe-icon";
|
|
@@ -34,7 +34,7 @@ class R extends _ {
|
|
|
34
34
|
return this.api.translate("Unsubscribe Block Description");
|
|
35
35
|
}
|
|
36
36
|
getTemplate() {
|
|
37
|
-
return
|
|
37
|
+
return v();
|
|
38
38
|
}
|
|
39
39
|
onSelect(e) {
|
|
40
40
|
this.currentNode = e, !("getAttribute" in e && e.getAttribute("data-migration")) && (this._resetStoreState(), this._loadBlockState(e), this._setupSelectEventListener(), this._setupCancelEventListener(), this._checkExistingBlocks(), this._openDrawer());
|
|
@@ -66,7 +66,7 @@ class R extends _ {
|
|
|
66
66
|
try {
|
|
67
67
|
if (!this.currentNode)
|
|
68
68
|
return;
|
|
69
|
-
this.api.getDocumentModifier().modifyHtml(this.currentNode).
|
|
69
|
+
this.api.getDocumentModifier().modifyHtml(this.currentNode).replaceWith(`<${L.EMPTY_CONTAINER}/>`).apply(new b("Removed unsubscribe block due to cancel"));
|
|
70
70
|
} catch (e) {
|
|
71
71
|
console.warn("[UnsubscribeBlock] Failed to remove unsubscribe block:", e);
|
|
72
72
|
}
|
|
@@ -77,14 +77,14 @@ class R extends _ {
|
|
|
77
77
|
_updateBlock(e, r) {
|
|
78
78
|
if (!this.currentNode || !("querySelector" in this.currentNode))
|
|
79
79
|
return;
|
|
80
|
-
const s = this.currentNode.querySelector(
|
|
80
|
+
const s = this.currentNode.querySelector(T);
|
|
81
81
|
if (!s)
|
|
82
82
|
return;
|
|
83
83
|
const t = this._getMergeTag(e);
|
|
84
84
|
this.api.getDocumentModifier().modifyHtml(s).setAttribute("href", t).apply(new b(`Updated unsubscribe link to ${t}`)), this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute(o.PAGE_TYPE, e.toString()).setAttribute(o.PAGE_LIST, r).apply(new b("Updated unsubscribe block metadata"));
|
|
85
85
|
}
|
|
86
86
|
_getMergeTag(e) {
|
|
87
|
-
return
|
|
87
|
+
return C[e] ?? B;
|
|
88
88
|
}
|
|
89
89
|
_openDrawer() {
|
|
90
90
|
if (!(this.currentNode && this.currentNode.getAttribute("data-unsubscribe-page-type")))
|
|
@@ -130,6 +130,6 @@ class R extends _ {
|
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
export {
|
|
133
|
-
|
|
134
|
-
|
|
133
|
+
g as UNSUBSCRIBE_BLOCK_ID,
|
|
134
|
+
I as UnsubscribeBlock
|
|
135
135
|
};
|
|
@@ -47,8 +47,7 @@ class B extends T {
|
|
|
47
47
|
}), this.valueChangeHandlers = [], this.currentNode = void 0, this.currentPages = void 0, this.currentPreviewIndex = 0, this.lastParsedAttribute = void 0;
|
|
48
48
|
}
|
|
49
49
|
get totalTemplates() {
|
|
50
|
-
|
|
51
|
-
return ((e = this.currentPages) == null ? void 0 : e.length) ?? 0;
|
|
50
|
+
return this.currentPages?.length ?? 0;
|
|
52
51
|
}
|
|
53
52
|
_listenToFormUpdates() {
|
|
54
53
|
this.valueChangeHandlers.push(
|
|
@@ -77,24 +76,23 @@ class B extends T {
|
|
|
77
76
|
await l().fetchTemplates(), this._updatePreview(), this._updateCounter();
|
|
78
77
|
}
|
|
79
78
|
_updatePreview() {
|
|
80
|
-
|
|
81
|
-
if ((e = this.currentPages) != null && e.length)
|
|
79
|
+
if (this.currentPages?.length)
|
|
82
80
|
try {
|
|
83
|
-
const
|
|
81
|
+
const e = this.currentPages[this.currentPreviewIndex], o = l().getThumbnailByTemplateId(e);
|
|
84
82
|
if (!o) {
|
|
85
|
-
console.warn("[UnsubscribeControl] No thumbnail found for page:",
|
|
83
|
+
console.warn("[UnsubscribeControl] No thumbnail found for page:", e);
|
|
86
84
|
return;
|
|
87
85
|
}
|
|
88
86
|
this.api.updateValues({
|
|
89
87
|
[r.PREVIEW_IMAGE]: o
|
|
90
88
|
});
|
|
91
|
-
} catch (
|
|
92
|
-
console.error("[UnsubscribeControl] Failed to update preview:",
|
|
89
|
+
} catch (e) {
|
|
90
|
+
console.error("[UnsubscribeControl] Failed to update preview:", e);
|
|
93
91
|
}
|
|
94
92
|
}
|
|
95
93
|
_updateCounter() {
|
|
96
|
-
const e = this.currentPreviewIndex + 1, t = this.totalTemplates,
|
|
97
|
-
this.api.setUIEAttribute(r.PREV_BUTTON, i.BUTTON.disabled,
|
|
94
|
+
const e = this.currentPreviewIndex + 1, t = this.totalTemplates, o = this.currentPreviewIndex === 0, c = this.currentPreviewIndex >= t - 1;
|
|
95
|
+
this.api.setUIEAttribute(r.PREV_BUTTON, i.BUTTON.disabled, o), this.api.setUIEAttribute(r.NEXT_BUTTON, i.BUTTON.disabled, c), this.api.setUIEAttribute(
|
|
98
96
|
r.COUNTER_TEXT,
|
|
99
97
|
i.LABEL.text,
|
|
100
98
|
`${this.api.translate("Showing")} ${e} ${this.api.translate("of")} ${t}`
|
|
@@ -135,14 +133,14 @@ class B extends T {
|
|
|
135
133
|
</${n.LABEL}>
|
|
136
134
|
`;
|
|
137
135
|
}
|
|
138
|
-
_getIconButton(e, t,
|
|
139
|
-
const
|
|
136
|
+
_getIconButton(e, t, o) {
|
|
137
|
+
const c = o ? `${i.BUTTON.disabled}="true"` : "";
|
|
140
138
|
return `
|
|
141
139
|
<${n.BUTTON}
|
|
142
140
|
id="${e}"
|
|
143
141
|
class="flat-inline flat-white"
|
|
144
142
|
${i.BUTTON.name}="${e}"
|
|
145
|
-
${
|
|
143
|
+
${c}
|
|
146
144
|
>
|
|
147
145
|
<${n.ICON}
|
|
148
146
|
src="${t}"
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { UIElement as
|
|
5
|
-
const
|
|
6
|
-
class
|
|
1
|
+
var r = Object.defineProperty;
|
|
2
|
+
var n = (s, e, i) => e in s ? r(s, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : s[e] = i;
|
|
3
|
+
var t = (s, e, i) => n(s, typeof e != "symbol" ? e + "" : e, i);
|
|
4
|
+
import { UIElement as m } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
5
|
+
const l = "unsubscribe-preview", E = "img", c = "Unsubscribe page preview", a = "is-loaded";
|
|
6
|
+
class u extends m {
|
|
7
7
|
constructor() {
|
|
8
8
|
super(...arguments);
|
|
9
|
-
|
|
9
|
+
t(this, "imgElement");
|
|
10
10
|
}
|
|
11
11
|
getId() {
|
|
12
|
-
return
|
|
12
|
+
return l;
|
|
13
13
|
}
|
|
14
14
|
getTemplate() {
|
|
15
15
|
return `
|
|
@@ -17,28 +17,26 @@ class d extends l {
|
|
|
17
17
|
<div class="unsubscribe-preview-loader"></div>
|
|
18
18
|
<img
|
|
19
19
|
src=""
|
|
20
|
-
alt="${
|
|
20
|
+
alt="${c}"
|
|
21
21
|
class="unsubscribe-preview-image"
|
|
22
22
|
/>
|
|
23
23
|
</div>
|
|
24
24
|
`;
|
|
25
25
|
}
|
|
26
|
-
onRender(
|
|
27
|
-
this.imgElement =
|
|
26
|
+
onRender(i) {
|
|
27
|
+
this.imgElement = i.querySelector(E);
|
|
28
28
|
}
|
|
29
|
-
setValue(
|
|
30
|
-
|
|
31
|
-
this.imgElement && (this.imgElement.src = e, (t = this.imgElement.parentElement) == null || t.classList.add(g));
|
|
29
|
+
setValue(i) {
|
|
30
|
+
this.imgElement && (this.imgElement.src = i, this.imgElement.parentElement?.classList.add(a));
|
|
32
31
|
}
|
|
33
32
|
getValue() {
|
|
34
|
-
|
|
35
|
-
return ((e = this.imgElement) == null ? void 0 : e.src) ?? "";
|
|
33
|
+
return this.imgElement?.src ?? "";
|
|
36
34
|
}
|
|
37
35
|
onDestroy() {
|
|
38
36
|
this.imgElement = void 0;
|
|
39
37
|
}
|
|
40
38
|
}
|
|
41
39
|
export {
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
l as PREVIEW_UI_ELEMENT_ID,
|
|
41
|
+
u as PreviewUIElement
|
|
44
42
|
};
|