@useinsider/guido 1.0.3-beta.6d7cd41 → 1.0.3-beta.70cf127
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 +32 -0
- package/dist/components/Guido.vue.js +7 -7
- package/dist/components/Guido.vue2.js +36 -35
- package/dist/components/organisms/extensions/recommendation/FilterItem.vue.js +28 -0
- package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +38 -0
- package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue.js +17 -0
- package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +37 -0
- package/dist/components/organisms/extensions/recommendation/Filters.vue.js +20 -0
- package/dist/components/organisms/extensions/recommendation/Filters.vue2.js +44 -0
- package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue.js +17 -0
- package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue2.js +27 -0
- package/dist/composables/useStripo.js +39 -34
- package/dist/enums/extensions/recommendationBlock.js +80 -0
- package/dist/extensions/Blocks/Checkbox/block.js +5 -2
- package/dist/extensions/Blocks/Items/block.js +70 -0
- package/dist/extensions/Blocks/Items/controls/button/link.js +60 -0
- package/dist/extensions/Blocks/Items/controls/cardComposition.js +99 -0
- package/dist/extensions/Blocks/Items/controls/image/link.js +60 -0
- package/dist/extensions/Blocks/Items/controls/index.js +217 -0
- package/dist/extensions/Blocks/Items/controls/name/trimming.js +63 -0
- package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +100 -0
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +113 -0
- package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +69 -0
- package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +38 -0
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +279 -0
- package/dist/extensions/Blocks/Items/enums/controlEnums.js +5 -0
- package/dist/extensions/Blocks/Items/enums/productEnums.js +181 -0
- package/dist/extensions/Blocks/Items/enums/settingsEnums.js +63 -0
- package/dist/extensions/Blocks/Items/extension.js +19 -0
- package/dist/extensions/Blocks/Items/iconsRegistry.js +32 -0
- package/dist/extensions/Blocks/Items/items.css.js +23 -0
- package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +64 -0
- package/dist/extensions/Blocks/Items/layouts/vertical.html.js +66 -0
- package/dist/extensions/Blocks/Items/settingsPanel.js +106 -0
- package/dist/extensions/Blocks/Items/store/items-block.js +67 -0
- package/dist/extensions/Blocks/Items/template.js +108 -0
- package/dist/extensions/Blocks/RadioButton/block.js +5 -2
- package/dist/extensions/Blocks/RadioButton/template.js +6 -6
- package/dist/extensions/Blocks/Recommendation/block.js +27 -0
- package/dist/extensions/Blocks/Recommendation/control.js +277 -0
- package/dist/extensions/Blocks/Recommendation/extension.js +10 -0
- package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +51 -0
- package/dist/extensions/Blocks/Recommendation/recommendation.css.js +19 -0
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +32 -0
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +266 -0
- package/dist/extensions/Blocks/Recommendation/template.js +200 -0
- package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +28 -0
- package/dist/extensions/Blocks/common-control.js +127 -0
- package/dist/extensions/Blocks/controlFactories.js +223 -0
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +319 -95
- package/dist/package.json.js +7 -0
- package/dist/services/recommendationApi.js +37 -0
- package/dist/{@types → src/@types}/generic.d.ts +4 -0
- package/dist/src/components/organisms/extensions/recommendation/FilterItem.vue.d.ts +19 -0
- package/dist/src/components/organisms/extensions/recommendation/LogicAdapter.vue.d.ts +16 -0
- package/dist/src/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.d.ts +2 -0
- package/dist/src/components/organisms/unsubscribe/UnsubscribeWrapper.vue.d.ts +2 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +16 -0
- package/dist/{extensions → src/extensions}/Blocks/Checkbox/block.d.ts +1 -0
- package/dist/src/extensions/Blocks/Items/block.d.ts +12 -0
- package/dist/src/extensions/Blocks/Items/controls/button/link.d.ts +14 -0
- package/dist/src/extensions/Blocks/Items/controls/cardComposition.d.ts +20 -0
- package/dist/src/extensions/Blocks/Items/controls/image/link.d.ts +14 -0
- package/dist/src/extensions/Blocks/Items/controls/index.d.ts +501 -0
- package/dist/src/extensions/Blocks/Items/controls/name/trimming.d.ts +14 -0
- package/dist/src/extensions/Blocks/Items/controls/price/currencyLocation.d.ts +19 -0
- package/dist/src/extensions/Blocks/Items/controls/price/currencySymbol.d.ts +20 -0
- package/dist/src/extensions/Blocks/Items/controls/price/formattedPrice.d.ts +14 -0
- package/dist/src/extensions/Blocks/Items/controls/price/hideDiscount.d.ts +9 -0
- package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +42 -0
- package/dist/src/extensions/Blocks/Items/enums/controlEnums.d.ts +61 -0
- package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +143 -0
- package/dist/src/extensions/Blocks/Items/enums/settingsEnums.d.ts +35 -0
- package/dist/src/extensions/Blocks/Items/iconsRegistry.d.ts +4 -0
- package/dist/src/extensions/Blocks/Items/store/items-block.d.ts +39 -0
- package/dist/src/extensions/Blocks/Items/template.d.ts +16 -0
- package/dist/{extensions → src/extensions}/Blocks/RadioButton/block.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/block.d.ts +10 -0
- package/dist/src/extensions/Blocks/Recommendation/control.d.ts +29 -0
- package/dist/src/extensions/Blocks/Recommendation/iconsRegistry.d.ts +4 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +555 -0
- package/dist/src/extensions/Blocks/Recommendation/template.d.ts +6 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/filterUtil.d.ts +7 -0
- package/dist/src/extensions/Blocks/Unsubscribe/settingsPanel.d.ts +4 -0
- package/dist/src/extensions/Blocks/_Boilerplate/extension.d.ts +2 -0
- package/dist/src/extensions/Blocks/_Boilerplate/settingsPanel.d.ts +4 -0
- package/dist/src/extensions/Blocks/common-control.d.ts +80 -0
- package/dist/src/extensions/Blocks/controlFactories.d.ts +312 -0
- package/dist/src/extensions/DynamicContent/extension.d.ts +2 -0
- package/dist/src/mock/api/validator.d.ts +2 -0
- package/dist/src/services/recommendationApi.d.ts +6 -0
- package/dist/{stores → src/stores}/editor.d.ts +21 -0
- package/dist/{utils → src/utils}/genericUtil.d.ts +1 -0
- package/dist/static/styles/customEditorStyle.css.js +4 -0
- package/dist/stores/editor.js +2 -1
- package/package.json +16 -4
- /package/dist/{@types → src/@types}/events.d.ts +0 -0
- /package/dist/{@types → src/@types}/save-as-template.d.ts +0 -0
- /package/dist/{App.vue.d.ts → src/App.vue.d.ts} +0 -0
- /package/dist/{components → src/components}/Guido.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/LoadingWrapper.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/base/Toaster.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/email-preview/PreviewContainer.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/email-preview/amp/AmpErrorModal.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/email-preview/amp/AmpToggle.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/email-preview/desktop-preview/DesktopPreview.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/email-preview/mobile-preview/ContentView.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/email-preview/mobile-preview/InboxView.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/email-preview/mobile-preview/MobilePreview.vue.d.ts +0 -0
- /package/dist/{components/organisms/header/LeftSlot.vue.d.ts → src/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue.d.ts} +0 -0
- /package/dist/{components/organisms/header/MiddleSlot.vue.d.ts → src/components/organisms/extensions/recommendation/Filters.vue.d.ts} +0 -0
- /package/dist/{components → src/components}/organisms/header/HeaderWrapper.vue.d.ts +0 -0
- /package/dist/{components/organisms/header/ViewOptions.vue.d.ts → src/components/organisms/header/LeftSlot.vue.d.ts} +0 -0
- /package/dist/{components/organisms/header/version-history/RestoreButton.vue.d.ts → src/components/organisms/header/MiddleSlot.vue.d.ts} +0 -0
- /package/dist/{components → src/components}/organisms/header/RightSlot.vue.d.ts +0 -0
- /package/dist/{components/organisms/header/version-history → src/components/organisms/header}/ViewOptions.vue.d.ts +0 -0
- /package/dist/{components/organisms/onboarding/AMPOnboarding.vue.d.ts → src/components/organisms/header/version-history/RestoreButton.vue.d.ts} +0 -0
- /package/dist/{components → src/components}/organisms/header/version-history/VersionHistory.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/header/version-history/VersionHistoryItem.vue.d.ts +0 -0
- /package/dist/{components/organisms/onboarding/GenericOnboarding.vue.d.ts → src/components/organisms/header/version-history/ViewOptions.vue.d.ts} +0 -0
- /package/dist/{components/organisms/onboarding/NewVersionPopup.vue.d.ts → src/components/organisms/onboarding/AMPOnboarding.vue.d.ts} +0 -0
- /package/dist/{components/organisms/onboarding/OnboardingWrapper.vue.d.ts → src/components/organisms/onboarding/GenericOnboarding.vue.d.ts} +0 -0
- /package/dist/{components/organisms/onboarding/TextBlockOnboarding.vue.d.ts → src/components/organisms/onboarding/NewVersionPopup.vue.d.ts} +0 -0
- /package/dist/{components/organisms/onboarding/VersionHistoryOnboarding.vue.d.ts → src/components/organisms/onboarding/OnboardingWrapper.vue.d.ts} +0 -0
- /package/dist/{components/organisms/save-as-template/SaveAsTemplateDrawer.vue.d.ts → src/components/organisms/onboarding/TextBlockOnboarding.vue.d.ts} +0 -0
- /package/dist/{components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.d.ts → src/components/organisms/onboarding/VersionHistoryOnboarding.vue.d.ts} +0 -0
- /package/dist/{components/organisms/unsubscribe/UnsubscribePageSelection.vue.d.ts → src/components/organisms/save-as-template/SaveAsTemplateDrawer.vue.d.ts} +0 -0
- /package/dist/{components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.d.ts → src/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.d.ts} +0 -0
- /package/dist/{components/organisms/unsubscribe/UnsubscribeWrapper.vue.d.ts → src/components/organisms/unsubscribe/UnsubscribePageSelection.vue.d.ts} +0 -0
- /package/dist/{components → src/components}/wrappers/WpDrawer.vue.d.ts +0 -0
- /package/dist/{components → src/components}/wrappers/WpModal.vue.d.ts +0 -0
- /package/dist/{composables → src/composables}/useActionsApi.d.ts +0 -0
- /package/dist/{composables → src/composables}/useApiExample.d.ts +0 -0
- /package/dist/{composables → src/composables}/useCodeEditorApi.d.ts +0 -0
- /package/dist/{composables → src/composables}/useConfig.d.ts +0 -0
- /package/dist/{composables → src/composables}/useCustomInterfaceAppearance.d.ts +0 -0
- /package/dist/{composables → src/composables}/useDebounce.d.ts +0 -0
- /package/dist/{composables → src/composables}/useExport.d.ts +0 -0
- /package/dist/{composables → src/composables}/useGuidoActions.d.ts +0 -0
- /package/dist/{composables → src/composables}/useHtmlCompiler.d.ts +0 -0
- /package/dist/{composables → src/composables}/useHtmlValidator.d.ts +0 -0
- /package/dist/{composables → src/composables}/useHttp.d.ts +0 -0
- /package/dist/{composables → src/composables}/usePartner.d.ts +0 -0
- /package/dist/{composables → src/composables}/usePreviewMode.d.ts +0 -0
- /package/dist/{composables → src/composables}/useProvideInject.d.ts +0 -0
- /package/dist/{composables → src/composables}/useRecommendation.d.ts +0 -0
- /package/dist/{composables → src/composables}/useResponsivePreview.d.ts +0 -0
- /package/dist/{composables → src/composables}/useSave.d.ts +0 -0
- /package/dist/{composables → src/composables}/useStripo.d.ts +0 -0
- /package/dist/{composables → src/composables}/useStripoEventHandler.d.ts +0 -0
- /package/dist/{composables → src/composables}/useToaster.d.ts +0 -0
- /package/dist/{composables → src/composables}/useTranslations.d.ts +0 -0
- /package/dist/{composables → src/composables}/useValidation.d.ts +0 -0
- /package/dist/{composables → src/composables}/useVersionHistoryApi.d.ts +0 -0
- /package/dist/{composables → src/composables}/validators/saveAsTemplate.d.ts +0 -0
- /package/dist/{config → src/config}/compiler/htmlCompilerRules.d.ts +0 -0
- /package/dist/{config → src/config}/compiler/outlookCompilerRules.d.ts +0 -0
- /package/dist/{config → src/config}/compiler/recommendationCompilerRules.d.ts +0 -0
- /package/dist/{config → src/config}/compiler/socialCompilerRules.d.ts +0 -0
- /package/dist/{config → src/config}/compiler/unsubscribeCompilerRules.d.ts +0 -0
- /package/dist/{config → src/config}/migrator/checkboxMigrator.d.ts +0 -0
- /package/dist/{config → src/config}/migrator/couponBlockMigrator.d.ts +0 -0
- /package/dist/{config → src/config}/migrator/index.d.ts +0 -0
- /package/dist/{config → src/config}/migrator/radioButtonMigrator.d.ts +0 -0
- /package/dist/{config → src/config}/migrator/unsubscribeMigrator.d.ts +0 -0
- /package/dist/{enums → src/enums}/defaults.d.ts +0 -0
- /package/dist/{enums → src/enums}/displayConditions.d.ts +0 -0
- /package/dist/{enums → src/enums}/html-validator.d.ts +0 -0
- /package/dist/{enums → src/enums}/onboarding.d.ts +0 -0
- /package/dist/{enums → src/enums}/preview.d.ts +0 -0
- /package/dist/{enums → src/enums}/recommendation.d.ts +0 -0
- /package/dist/{enums → src/enums}/toaster.d.ts +0 -0
- /package/dist/{enums → src/enums}/unsubscribe.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/Checkbox/control.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/Checkbox/extension.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/Checkbox/iconsRegistry.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/Checkbox/settingsPanel.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/Checkbox/template.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/CouponBlock/block.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/CouponBlock/extension.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/CouponBlock/iconsRegistry.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/CouponBlock/settingsPanel.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/CouponBlock/template.d.ts +0 -0
- /package/dist/{extensions/Blocks/RadioButton → src/extensions/Blocks/Items}/extension.d.ts +0 -0
- /package/dist/{extensions/Blocks/Unsubscribe → src/extensions/Blocks/Items}/settingsPanel.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/RadioButton/control.d.ts +0 -0
- /package/dist/{extensions/Blocks/Unsubscribe → src/extensions/Blocks/RadioButton}/extension.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/RadioButton/iconsRegistry.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/RadioButton/settingsPanel.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/RadioButton/template.d.ts +0 -0
- /package/dist/{extensions/Blocks/_Boilerplate → src/extensions/Blocks/Recommendation}/extension.d.ts +0 -0
- /package/dist/{extensions/Blocks/_Boilerplate → src/extensions/Blocks/Recommendation}/settingsPanel.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/Unsubscribe/block.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/Unsubscribe/control.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/Unsubscribe/elements/preview.d.ts +0 -0
- /package/dist/{extensions/DynamicContent → src/extensions/Blocks/Unsubscribe}/extension.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/Unsubscribe/iconsRegistry.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/Unsubscribe/tagRegistry.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/Unsubscribe/template.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/Unsubscribe/utils/constants.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/Unsubscribe/utils/utils.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/_Boilerplate/block.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/_Boilerplate/control.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/_Boilerplate/iconsRegistry.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/_Boilerplate/template.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/DynamicContent/dynamic-content-modal.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/DynamicContent/dynamic-content.d.ts +0 -0
- /package/dist/{library.d.ts → src/library.d.ts} +0 -0
- /package/dist/{main.d.ts → src/main.d.ts} +0 -0
- /package/dist/{mock → src/mock}/api/auth.d.ts +0 -0
- /package/dist/{mock → src/mock}/api/custom-fonts.d.ts +0 -0
- /package/dist/{mock → src/mock}/api/default-template.d.ts +0 -0
- /package/dist/{mock/api/template-library.d.ts → src/mock/api/recommendation.d.ts} +0 -0
- /package/dist/{mock/api/unsubscribe.d.ts → src/mock/api/template-library.d.ts} +0 -0
- /package/dist/{mock/api/user-modal-state.d.ts → src/mock/api/unsubscribe.d.ts} +0 -0
- /package/dist/{mock/api/validator.d.ts → src/mock/api/user-modal-state.d.ts} +0 -0
- /package/dist/{mock → src/mock}/browser.d.ts +0 -0
- /package/dist/{mock → src/mock}/handlers.d.ts +0 -0
- /package/dist/{services → src/services}/onboardingApi.d.ts +0 -0
- /package/dist/{services → src/services}/stripoApi.d.ts +0 -0
- /package/dist/{services → src/services}/templateLibraryApi.d.ts +0 -0
- /package/dist/{services → src/services}/unsubscribeApi.d.ts +0 -0
- /package/dist/{stores → src/stores}/config.d.ts +0 -0
- /package/dist/{stores → src/stores}/dynamic-content.d.ts +0 -0
- /package/dist/{stores → src/stores}/onboarding.d.ts +0 -0
- /package/dist/{stores → src/stores}/preview.d.ts +0 -0
- /package/dist/{stores → src/stores}/recommendation.d.ts +0 -0
- /package/dist/{stores → src/stores}/save-as-template.d.ts +0 -0
- /package/dist/{stores → src/stores}/toaster.d.ts +0 -0
- /package/dist/{stores → src/stores}/unsubscribe.d.ts +0 -0
- /package/dist/{stores → src/stores}/version-history.d.ts +0 -0
- /package/dist/{utils → src/utils}/arrayUtil.d.ts +0 -0
- /package/dist/{utils → src/utils}/base64.d.ts +0 -0
- /package/dist/{utils → src/utils}/dateUtil.d.ts +0 -0
- /package/dist/{utils → src/utils}/htmlCompiler.d.ts +0 -0
- /package/dist/{utils → src/utils}/templatePreparation.d.ts +0 -0
- /package/dist/{utils → src/utils}/tooltipUtils.d.ts +0 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { BlockType as E, BlockAttr as _ } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { ItemsBlockId as n } from "./enums/controlEnums.js";
|
|
3
|
+
import { productPairs as e } from "./enums/productEnums.js";
|
|
4
|
+
import { ItemInCartOptions as N, SETTINGS_ENUMS as r } from "./enums/settingsEnums.js";
|
|
5
|
+
import d from "./layouts/horizontal.html.js";
|
|
6
|
+
import P from "./layouts/vertical.html.js";
|
|
7
|
+
let [s] = e.PAIRS_FOR_EXTENSION.imageSrc.CART_ITEMS.DEFAULT, [A] = e.PAIRS_FOR_EXTENSION.name.CART_ITEMS.DEFAULT, [a] = e.PAIRS_FOR_EXTENSION.price.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [c] = e.PAIRS_FOR_EXTENSION.originalPrice.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [p] = e.PAIRS_FOR_EXTENSION.quantity.CART_ITEMS.DEFAULT;
|
|
8
|
+
const $ = () => `
|
|
9
|
+
<${E.BLOCK_IMAGE}
|
|
10
|
+
${_.BLOCK_IMAGE.src}="${s}"
|
|
11
|
+
${_.BLOCK_IMAGE.alt}="Product Image"
|
|
12
|
+
${_.BLOCK_IMAGE.href}="#"
|
|
13
|
+
${_.BLOCK_IMAGE.width}="70"
|
|
14
|
+
esd-extension-block-id="${n.IMAGE}"
|
|
15
|
+
data-type="CART_ITEMS"
|
|
16
|
+
data-number="1"
|
|
17
|
+
/>
|
|
18
|
+
`, S = () => `
|
|
19
|
+
<${E.BLOCK_TEXT}
|
|
20
|
+
width="100%"
|
|
21
|
+
align="center"
|
|
22
|
+
class="es-p10"
|
|
23
|
+
esd-extension-block-id="${n.NAME}"
|
|
24
|
+
>
|
|
25
|
+
<p
|
|
26
|
+
data-slot-2
|
|
27
|
+
width="100%">
|
|
28
|
+
${A}
|
|
29
|
+
</p>
|
|
30
|
+
</${E.BLOCK_TEXT}>
|
|
31
|
+
`, B = (T, t) => {
|
|
32
|
+
let i = a;
|
|
33
|
+
if (T && T.trim()) {
|
|
34
|
+
const o = ` ${T.trim()} `;
|
|
35
|
+
i = (t || "0") === "1" ? `${a}${o}` : `${o}${a}`;
|
|
36
|
+
}
|
|
37
|
+
return `
|
|
38
|
+
<${E.BLOCK_TEXT}
|
|
39
|
+
esd-extension-block-id="${n.PRICE}"
|
|
40
|
+
class="items-block-price"
|
|
41
|
+
width="100%"
|
|
42
|
+
align="center"
|
|
43
|
+
>
|
|
44
|
+
<p contenteditable="false">
|
|
45
|
+
${i}
|
|
46
|
+
</p>
|
|
47
|
+
</${E.BLOCK_TEXT}>
|
|
48
|
+
`;
|
|
49
|
+
}, F = (T, t) => {
|
|
50
|
+
let i = c;
|
|
51
|
+
if (T && T.trim()) {
|
|
52
|
+
const o = ` ${T.trim()} `;
|
|
53
|
+
i = (t || "0") === "1" ? `${c}${o}` : `${o}${c}`;
|
|
54
|
+
}
|
|
55
|
+
return `
|
|
56
|
+
<${E.BLOCK_TEXT}
|
|
57
|
+
class="items-block-price"
|
|
58
|
+
esd-extension-block-id="${n.ORIGINAL_PRICE}"
|
|
59
|
+
width="100%"
|
|
60
|
+
align="center"
|
|
61
|
+
>
|
|
62
|
+
<p
|
|
63
|
+
contenteditable="false"
|
|
64
|
+
style="color: #cc0000"
|
|
65
|
+
>
|
|
66
|
+
<s>${i}</s>
|
|
67
|
+
</p>
|
|
68
|
+
</${E.BLOCK_TEXT}>
|
|
69
|
+
`;
|
|
70
|
+
}, L = () => `
|
|
71
|
+
<${E.BLOCK_TEXT}
|
|
72
|
+
width="100%"
|
|
73
|
+
align="center"
|
|
74
|
+
class="es-p10"
|
|
75
|
+
esd-extension-block-id="${n.QUANTITY}"
|
|
76
|
+
>
|
|
77
|
+
<p
|
|
78
|
+
data-slot-3
|
|
79
|
+
contenteditable="false"
|
|
80
|
+
width="100%">
|
|
81
|
+
${p}
|
|
82
|
+
</p>
|
|
83
|
+
</${E.BLOCK_TEXT}>
|
|
84
|
+
`, U = () => `
|
|
85
|
+
<${E.BLOCK_BUTTON}
|
|
86
|
+
width="100%"
|
|
87
|
+
class="ins-button"
|
|
88
|
+
name="buy-button"
|
|
89
|
+
caption="Buy"
|
|
90
|
+
align="center"
|
|
91
|
+
esd-extension-block-id="${n.BUTTON}"
|
|
92
|
+
>Buy
|
|
93
|
+
</${E.BLOCK_TEXT}>
|
|
94
|
+
`, R = (T, t, i) => T.replace("{-{-PRODUCT_IMAGE-}-}", $()).replace("{-{-PRODUCT_NAME-}-}", S()).replace("{-{-PRODUCT_PRICE-}-}", B(t, i)).replace("{-{-PRODUCT_ORIGINAL_PRICE-}-}", F(t, i)).replace("{-{-PRODUCT_QUANTITY-}-}", L()).replace("{-{-PRODUCT_BUTTON-}-}", U());
|
|
95
|
+
function k({
|
|
96
|
+
orientation: T,
|
|
97
|
+
itemsType: t = r.ITEMS_TYPE.CART_ITEMS,
|
|
98
|
+
itemId: i,
|
|
99
|
+
currencySymbol: o,
|
|
100
|
+
currencyLocation: I,
|
|
101
|
+
formattedPrice: l = !0
|
|
102
|
+
}) {
|
|
103
|
+
const O = N[t].findIndex((C) => C.value === i);
|
|
104
|
+
return s = e.PAIRS_FOR_EXTENSION.imageSrc[t].DEFAULT[O], A = e.PAIRS_FOR_EXTENSION.name[t].DEFAULT[O], a = l ? e.PAIRS_FOR_EXTENSION.price[t].DEFAULT_PRICE_FORMATTED : e.PAIRS_FOR_EXTENSION.price[t].DEFAULT_PRICE, c = l ? e.PAIRS_FOR_EXTENSION.originalPrice[t].DEFAULT_PRICE_FORMATTED : e.PAIRS_FOR_EXTENSION.originalPrice[t].DEFAULT_PRICE, p = e.PAIRS_FOR_EXTENSION.quantity[t].DEFAULT, T === r.ORIENTATION.VERTICAL ? R(P, o, I) : R(d, o, I);
|
|
105
|
+
}
|
|
106
|
+
export {
|
|
107
|
+
k as getDefaultTemplate
|
|
108
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Block as t, BlockCompositionType as o } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
2
|
import { getDefaultTemplate as e } from "./template.js";
|
|
3
3
|
const r = "radio-button-block";
|
|
4
|
-
class
|
|
4
|
+
class l extends t {
|
|
5
5
|
constructor() {
|
|
6
6
|
super();
|
|
7
7
|
}
|
|
@@ -23,8 +23,11 @@ class c extends t {
|
|
|
23
23
|
getTemplate() {
|
|
24
24
|
return e();
|
|
25
25
|
}
|
|
26
|
+
allowInnerBlocksDND() {
|
|
27
|
+
return !1;
|
|
28
|
+
}
|
|
26
29
|
}
|
|
27
30
|
export {
|
|
28
31
|
r as BLOCK_ID,
|
|
29
|
-
|
|
32
|
+
l as RadioButtonCustomBlock
|
|
30
33
|
};
|
|
@@ -12,12 +12,12 @@ const e = {
|
|
|
12
12
|
<td align="left" width="70%" style="vertical-align: top;">
|
|
13
13
|
<table cellpadding="0" cellspacing="0" role="presentation" width="100%">
|
|
14
14
|
<tbody>
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
<${t.BLOCK_TEXT}>
|
|
16
|
+
{-{-TITLE-}-}
|
|
17
|
+
</${t.BLOCK_TEXT}>
|
|
18
|
+
<${t.BLOCK_TEXT}>
|
|
19
|
+
{-{-DESCRIPTION-}-}
|
|
20
|
+
</${t.BLOCK_TEXT}>
|
|
21
21
|
</tbody>
|
|
22
22
|
</table>
|
|
23
23
|
</td>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Block as e, BlockCompositionType as t } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { getDefaultTemplate as o } from "./template.js";
|
|
3
|
+
const n = "recommendation-block";
|
|
4
|
+
class c extends e {
|
|
5
|
+
getId() {
|
|
6
|
+
return n;
|
|
7
|
+
}
|
|
8
|
+
getIcon() {
|
|
9
|
+
return "recommendation-icon";
|
|
10
|
+
}
|
|
11
|
+
getBlockCompositionType() {
|
|
12
|
+
return t.CONTAINER;
|
|
13
|
+
}
|
|
14
|
+
getName() {
|
|
15
|
+
return this.api.translate("Recommendation Block");
|
|
16
|
+
}
|
|
17
|
+
getDescription() {
|
|
18
|
+
return this.api.translate("Recommendation Block Title Description");
|
|
19
|
+
}
|
|
20
|
+
getTemplate() {
|
|
21
|
+
return o();
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
n as BLOCK_ID,
|
|
26
|
+
c as RecommendationBlock
|
|
27
|
+
};
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
var _ = Object.defineProperty;
|
|
2
|
+
var R = (o, n, e) => n in o ? _(o, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[n] = e;
|
|
3
|
+
var r = (o, n, e) => R(o, typeof n != "symbol" ? n + "" : n, e);
|
|
4
|
+
import { currencyDecimalCounts as c, currencyOperators as a, currencyLocationMaps as l } from "../../../enums/extensions/recommendationBlock.js";
|
|
5
|
+
import { UEAttr as d } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
6
|
+
import { CommonControl as m } from "../common-control.js";
|
|
7
|
+
import { useRecommendationExtensionStore as S } from "./store/recommendation.js";
|
|
8
|
+
const g = "ui-elements-recommendation-block", t = {
|
|
9
|
+
ALGORITHM: "strategy",
|
|
10
|
+
PRODUCT_IDS: "productIds",
|
|
11
|
+
LOCALE: "language",
|
|
12
|
+
CURRENCY: "value",
|
|
13
|
+
CURRENCY_LOCATION: "alignment",
|
|
14
|
+
CURRENCY_SYMBOL: "symbol",
|
|
15
|
+
CURRENCY_THOUSAND_SEPARATOR: "thousandSeparator",
|
|
16
|
+
CURRENCY_DECIMAL_SEPARATOR: "decimalSeparator",
|
|
17
|
+
CURRENCY_DECIMAL_COUNT: "decimalCount",
|
|
18
|
+
FILTERS: "filterStatus",
|
|
19
|
+
PRODUCT_COUNT: "size",
|
|
20
|
+
PRODUCT_IN_ROW: "cardsInRow",
|
|
21
|
+
SHUFFLE_PRODUCTS: "shuffleProducts",
|
|
22
|
+
RESPONSIVE: "unresponsive"
|
|
23
|
+
};
|
|
24
|
+
class p extends m {
|
|
25
|
+
constructor() {
|
|
26
|
+
super(...arguments);
|
|
27
|
+
r(this, "store", S());
|
|
28
|
+
r(this, "storeUnsubscription", () => {
|
|
29
|
+
});
|
|
30
|
+
r(this, "addFilterListener", () => {
|
|
31
|
+
});
|
|
32
|
+
r(this, "addFilterButton", null);
|
|
33
|
+
}
|
|
34
|
+
getId() {
|
|
35
|
+
return g;
|
|
36
|
+
}
|
|
37
|
+
getTemplate() {
|
|
38
|
+
return `
|
|
39
|
+
<div class="recommendation-controls-container">
|
|
40
|
+
${this._getAlgorithms()}
|
|
41
|
+
${this._getLanguages()}
|
|
42
|
+
${this._getCurrency()}
|
|
43
|
+
${this._getFilterStatus()}
|
|
44
|
+
${this._getProductLayout()}
|
|
45
|
+
${this._getShuffleProducts()}
|
|
46
|
+
${this._getResponsive()}
|
|
47
|
+
</div>
|
|
48
|
+
`;
|
|
49
|
+
}
|
|
50
|
+
async onRender() {
|
|
51
|
+
await Promise.all([
|
|
52
|
+
this.store.fetchRecommendationFilters(),
|
|
53
|
+
this.store.fetchRecommendationCreateData(),
|
|
54
|
+
this.store.fetchRecommendationProducts()
|
|
55
|
+
// TODO: We need to change the location. It's just for testing
|
|
56
|
+
]), this._listenStateUpdates(), this._initializeSelectItems(), this._setFormValues(), this._listenToFormUpdates();
|
|
57
|
+
}
|
|
58
|
+
onDestroy() {
|
|
59
|
+
var e;
|
|
60
|
+
(e = this.addFilterButton) == null || e.removeEventListener("click", this.addFilterListener), this.storeUnsubscription();
|
|
61
|
+
}
|
|
62
|
+
_setFormValues() {
|
|
63
|
+
const e = this.store.recommendationConfigs;
|
|
64
|
+
this._setProductIdsVisibility(), this.api.updateValues({
|
|
65
|
+
[t.ALGORITHM]: e.strategy,
|
|
66
|
+
[t.PRODUCT_IDS]: e.productIds.join(","),
|
|
67
|
+
[t.CURRENCY]: e.currencySettings.value,
|
|
68
|
+
[t.LOCALE]: e.language,
|
|
69
|
+
[t.CURRENCY_LOCATION]: e.currencySettings.alignment,
|
|
70
|
+
[t.CURRENCY_SYMBOL]: e.currencySettings.symbol,
|
|
71
|
+
[t.CURRENCY_THOUSAND_SEPARATOR]: e.currencySettings.thousandSeparator,
|
|
72
|
+
[t.CURRENCY_DECIMAL_SEPARATOR]: e.currencySettings.decimalSeparator,
|
|
73
|
+
[t.CURRENCY_DECIMAL_COUNT]: e.currencySettings.decimalCount,
|
|
74
|
+
[t.PRODUCT_COUNT]: e.size,
|
|
75
|
+
[t.PRODUCT_IN_ROW]: e.cardsInRow,
|
|
76
|
+
[t.SHUFFLE_PRODUCTS]: e.shuffleProducts,
|
|
77
|
+
[t.RESPONSIVE]: !e.unresponsive
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
_initializeSelectItems() {
|
|
81
|
+
const { store: e } = this, s = e.getActivePredictiveAlgorithms, i = e.getLanguages, C = {
|
|
82
|
+
[t.ALGORITHM]: s,
|
|
83
|
+
[t.LOCALE]: i,
|
|
84
|
+
[t.CURRENCY]: e.currencyList,
|
|
85
|
+
[t.CURRENCY_LOCATION]: l,
|
|
86
|
+
[t.CURRENCY_SYMBOL]: e.getCurrencySymbolList,
|
|
87
|
+
[t.CURRENCY_THOUSAND_SEPARATOR]: a,
|
|
88
|
+
[t.CURRENCY_DECIMAL_SEPARATOR]: a,
|
|
89
|
+
[t.CURRENCY_DECIMAL_COUNT]: c,
|
|
90
|
+
[t.PRODUCT_COUNT]: Number(e.recommendationConfigs.size),
|
|
91
|
+
[t.PRODUCT_IN_ROW]: e.recommendationConfigs.cardsInRow,
|
|
92
|
+
[t.SHUFFLE_PRODUCTS]: e.recommendationConfigs.shuffleProducts,
|
|
93
|
+
[t.RESPONSIVE]: !e.recommendationConfigs.unresponsive
|
|
94
|
+
};
|
|
95
|
+
Object.entries(C).forEach(([u, h]) => {
|
|
96
|
+
this.api.setUIEAttribute(u, d.SELECTPICKER.items, h);
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
_getAlgorithms() {
|
|
100
|
+
return `
|
|
101
|
+
${this._GuTwoColumns([
|
|
102
|
+
this._GuLabel({ text: "Recommendation Algorithm" }),
|
|
103
|
+
this._GuSelect({
|
|
104
|
+
name: t.ALGORITHM,
|
|
105
|
+
placeholder: "Select Recommendation Algorithm",
|
|
106
|
+
options: this.store.getActivePredictiveAlgorithms
|
|
107
|
+
}),
|
|
108
|
+
this._GuLabel({ text: "Product Ids", name: `${t.PRODUCT_IDS}_label` }),
|
|
109
|
+
this._GuTextInput({
|
|
110
|
+
name: t.PRODUCT_IDS,
|
|
111
|
+
placeholder: "Enter Product Ids",
|
|
112
|
+
className: "es-180w"
|
|
113
|
+
})
|
|
114
|
+
])}
|
|
115
|
+
`;
|
|
116
|
+
}
|
|
117
|
+
_getLanguages() {
|
|
118
|
+
return `
|
|
119
|
+
${this._GuTwoColumns([
|
|
120
|
+
this._GuLabel({ text: "Recommendation Locale" }),
|
|
121
|
+
this._GuSelect({
|
|
122
|
+
name: t.LOCALE,
|
|
123
|
+
placeholder: "Select Recommendation Locale",
|
|
124
|
+
options: this.store.getLanguages
|
|
125
|
+
})
|
|
126
|
+
])}
|
|
127
|
+
`;
|
|
128
|
+
}
|
|
129
|
+
_getCurrency() {
|
|
130
|
+
return `
|
|
131
|
+
${this._GuTwoColumns([
|
|
132
|
+
this._GuLabel({ text: "Currency" }),
|
|
133
|
+
this._GuSelect({
|
|
134
|
+
name: t.CURRENCY,
|
|
135
|
+
placeholder: "Select Currency",
|
|
136
|
+
options: this.store.currencyList
|
|
137
|
+
}),
|
|
138
|
+
this._GuLabel({ text: "Currency Location" }),
|
|
139
|
+
this._GuSelect({
|
|
140
|
+
name: t.CURRENCY_LOCATION,
|
|
141
|
+
placeholder: "Select Currency Location",
|
|
142
|
+
options: l
|
|
143
|
+
}),
|
|
144
|
+
this._GuLabel({ text: "Currency Symbol" }),
|
|
145
|
+
this._GuSelect({
|
|
146
|
+
name: t.CURRENCY_SYMBOL,
|
|
147
|
+
placeholder: "Select Currency Symbol",
|
|
148
|
+
options: this.store.getCurrencySymbolList
|
|
149
|
+
}),
|
|
150
|
+
this._GuLabel({ text: "Thousand Separator" }),
|
|
151
|
+
this._GuSelect({
|
|
152
|
+
name: t.CURRENCY_THOUSAND_SEPARATOR,
|
|
153
|
+
placeholder: "Select Thousand Separator",
|
|
154
|
+
options: a
|
|
155
|
+
}),
|
|
156
|
+
this._GuLabel({ text: "Decimal Separator" }),
|
|
157
|
+
this._GuSelect({
|
|
158
|
+
name: t.CURRENCY_DECIMAL_SEPARATOR,
|
|
159
|
+
placeholder: "Select Decimal Separator",
|
|
160
|
+
options: a
|
|
161
|
+
}),
|
|
162
|
+
this._GuLabel({ text: "Decimal Count" }),
|
|
163
|
+
this._GuSelect({
|
|
164
|
+
name: t.CURRENCY_DECIMAL_COUNT,
|
|
165
|
+
placeholder: "Select Decimal Count",
|
|
166
|
+
options: c
|
|
167
|
+
})
|
|
168
|
+
])}
|
|
169
|
+
`;
|
|
170
|
+
}
|
|
171
|
+
_getProductLayout() {
|
|
172
|
+
return `
|
|
173
|
+
${this._GuTwoColumns([
|
|
174
|
+
this._GuLabel({ text: "Number of Products" }),
|
|
175
|
+
this._GuCounter({ name: t.PRODUCT_COUNT, maxValue: 9 }),
|
|
176
|
+
this._GuLabel({ text: "Products in One Row" }),
|
|
177
|
+
this._GuCounter({ name: t.PRODUCT_IN_ROW, maxValue: 4 })
|
|
178
|
+
])}
|
|
179
|
+
`;
|
|
180
|
+
}
|
|
181
|
+
_getFilterStatus() {
|
|
182
|
+
return `
|
|
183
|
+
${this._GuTwoColumns([
|
|
184
|
+
this._GuLabel({ text: "Filters" }),
|
|
185
|
+
this._GuButton({
|
|
186
|
+
name: t.FILTERS,
|
|
187
|
+
label: "Add Filter",
|
|
188
|
+
id: "guido__btn-add-filter"
|
|
189
|
+
})
|
|
190
|
+
])}
|
|
191
|
+
`;
|
|
192
|
+
}
|
|
193
|
+
_getShuffleProducts() {
|
|
194
|
+
return `
|
|
195
|
+
${this._GuTwoColumns([
|
|
196
|
+
this._GuLabel({ text: "Shuffle Recommended Products" }),
|
|
197
|
+
this._GuToggle(t.SHUFFLE_PRODUCTS)
|
|
198
|
+
])}
|
|
199
|
+
`;
|
|
200
|
+
}
|
|
201
|
+
_getResponsive() {
|
|
202
|
+
return `
|
|
203
|
+
${this._GuTwoColumns([
|
|
204
|
+
this._GuLabel({ text: "Responsive Block" }),
|
|
205
|
+
this._GuToggle(t.RESPONSIVE)
|
|
206
|
+
])}
|
|
207
|
+
`;
|
|
208
|
+
}
|
|
209
|
+
_onFilterChange(e) {
|
|
210
|
+
this.currentNode && this.store.$patch({
|
|
211
|
+
filterStatus: e,
|
|
212
|
+
filterSelectionDrawerStatus: e
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
_onFilterSelectClick() {
|
|
216
|
+
this.store.$patch({
|
|
217
|
+
filterSelectionDrawerStatus: !0
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
_onDataChange(e, s) {
|
|
221
|
+
this.currentNode && this.store.$patch({
|
|
222
|
+
recommendationConfigs: {
|
|
223
|
+
[e]: s
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
_onCurrencyConfigChange(e, s) {
|
|
228
|
+
this.currentNode && this.store.$patch({
|
|
229
|
+
recommendationConfigs: {
|
|
230
|
+
currencySettings: {
|
|
231
|
+
[e]: s
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
_onCurrencyChange(e) {
|
|
237
|
+
const [, s] = e.split(".");
|
|
238
|
+
this.store.$patch({
|
|
239
|
+
recommendationConfigs: {
|
|
240
|
+
currencySettings: {
|
|
241
|
+
name: s,
|
|
242
|
+
value: s
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
_setProductIdsVisibility() {
|
|
248
|
+
const { recommendationConfigs: e } = this.store, s = e.strategy === "manualMerchandising";
|
|
249
|
+
this.api.setVisibility(t.PRODUCT_IDS, s), this.api.setVisibility(`${t.PRODUCT_IDS}_label`, s);
|
|
250
|
+
}
|
|
251
|
+
_listenToFormUpdates() {
|
|
252
|
+
var s;
|
|
253
|
+
this.api.onValueChanged(t.ALGORITHM, (i) => {
|
|
254
|
+
this._onDataChange(t.ALGORITHM, i), this._setProductIdsVisibility();
|
|
255
|
+
}), this.api.onValueChanged(t.PRODUCT_IDS, (i) => this._onDataChange(t.PRODUCT_IDS, i.split(",") || [])), this.api.onValueChanged(t.LOCALE, (i) => this._onDataChange(t.LOCALE, i)), this.api.onValueChanged(t.CURRENCY, (i) => this._onCurrencyChange(i)), [
|
|
256
|
+
t.CURRENCY_LOCATION,
|
|
257
|
+
t.CURRENCY_SYMBOL,
|
|
258
|
+
t.CURRENCY_THOUSAND_SEPARATOR,
|
|
259
|
+
t.CURRENCY_DECIMAL_SEPARATOR,
|
|
260
|
+
t.CURRENCY_DECIMAL_COUNT
|
|
261
|
+
].forEach((i) => {
|
|
262
|
+
this.api.onValueChanged(i, (C) => this._onCurrencyConfigChange(i, C));
|
|
263
|
+
}), this.api.onValueChanged(t.PRODUCT_COUNT, (i) => this._onDataChange(t.PRODUCT_COUNT, i.toString())), this.api.onValueChanged(t.PRODUCT_IN_ROW, (i) => this._onDataChange(t.PRODUCT_IN_ROW, i)), this.api.onValueChanged(t.SHUFFLE_PRODUCTS, (i) => this._onDataChange(t.SHUFFLE_PRODUCTS, i)), this.api.onValueChanged(t.RESPONSIVE, (i) => this._onDataChange(t.RESPONSIVE, i)), this.addFilterListener = this._onFilterSelectClick.bind(this), this.addFilterButton = this.getContainer().querySelector("#guido__btn-add-filter"), (s = this.addFilterButton) == null || s.addEventListener("click", this.addFilterListener);
|
|
264
|
+
}
|
|
265
|
+
_listenStateUpdates() {
|
|
266
|
+
this.storeUnsubscription = this.store.$subscribe((e) => {
|
|
267
|
+
if ("payload" in e) {
|
|
268
|
+
const s = e.payload.recommendationConfigs;
|
|
269
|
+
s && (this.api.updateValues(s), this.store.fetchRecommendationProducts());
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
export {
|
|
275
|
+
g as CONTROL_BLOCK_ID,
|
|
276
|
+
p as RecommendationBlockControl
|
|
277
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ExtensionBuilder as o } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { RecommendationBlock as t } from "./block.js";
|
|
3
|
+
import { RecommendationBlockControl as e } from "./control.js";
|
|
4
|
+
import { RecommendationIconsRegistry as n } from "./iconsRegistry.js";
|
|
5
|
+
import i from "./recommendation.css.js";
|
|
6
|
+
import { SettingsPanel as m } from "./settingsPanel.js";
|
|
7
|
+
const f = new o().addBlock(t).withSettingsPanelRegistry(m).addControl(e).addStyles(i).withIconsRegistry(n).build();
|
|
8
|
+
export {
|
|
9
|
+
f as default
|
|
10
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { IconsRegistry as o } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
class n extends o {
|
|
3
|
+
registerIconsSvg(C) {
|
|
4
|
+
C["recommendation-icon"] = `
|
|
5
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
|
|
6
|
+
<path d="M10 4.4C10 4.73137 9.73012 4.99622 9.40108 5.0355C6.92202 5.33143 5 7.44126 5 10C5 12.5587
|
|
7
|
+
6.92202 14.6686 9.40108 14.9645C9.73012 15.0038 10 15.2686 10 15.6V18.4C10 18.7314 9.73137 19 9.4
|
|
8
|
+
19H9C8.44772 19 8 18.5523 8 18V17.2422C7.99988 16.3514 6.92291 15.9053 6.29297 16.5352L5.75684
|
|
9
|
+
17.0713C5.36633 17.4617 4.73328 17.4617 4.34277 17.0713L2.92871 15.6572C2.53829 15.2667 2.53829
|
|
10
|
+
14.6337 2.92871 14.2432L3.46484 13.707C4.09466 13.0771 3.64858 12.0001 2.75781 12H2C1.44772 12 1
|
|
11
|
+
11.5523 1 11L1 9C1 8.44772 1.44772 8 2 8H2.75684C3.6476 7.99988 4.09369 6.92291 3.46387 6.29297L2.92871
|
|
12
|
+
5.75781C2.53829 5.36731 2.53829 4.73426 2.92871 4.34375L4.34375 2.92871C4.73426 2.53829 5.36731 2.53829
|
|
13
|
+
5.75781 2.92871L6.29297 3.46387C6.92291 4.09368 7.99988 3.6476 8 2.75684V2C8 1.44772 8.44772 1 9 1L9.4
|
|
14
|
+
1C9.73137 1 10 1.26863 10 1.6V4.4ZM11 2C11 1.44786 11.4543 0.987733 11.9893 1.12402C12.1732 1.17098
|
|
15
|
+
12.3541 1.23174 12.5303 1.30469C13.0156 1.50571 13.4567 1.80044 13.8281 2.17187C14.1996 2.54331 14.4943
|
|
16
|
+
2.98442 14.6953 3.46973C14.7058 3.49498 14.716 3.52033 14.7259 3.54577C14.8279 3.80746 15.0733 3.9917
|
|
17
|
+
15.3531 4.01625C15.5539 4.03386 15.7542 4.06671 15.9521 4.11523C16.8954 4.34649 17.723 4.91284 18.2793
|
|
18
|
+
5.70898C18.8354 6.505 19.0827 7.47631 18.9756 8.44141C18.927 8.87824 18.8065 9.30007 18.6231
|
|
19
|
+
9.69186C18.5322 9.88606 18.5322 10.112 18.6231 10.3062C18.7962 10.6759 18.9122 11.0708 18.9658
|
|
20
|
+
11.4775C19.0425 12.0595 18.9901 12.6515 18.8125 13.2109C18.6348 13.7703 18.3358 14.2838 17.9375
|
|
21
|
+
14.7148C17.5393 15.1457 17.0513 15.4839 16.5078 15.7051C16.1381 15.8555 15.7488 15.9484 15.3532
|
|
22
|
+
15.9829C15.0734 16.0073 14.8281 16.1917 14.7262 16.4535C14.7162 16.4792 14.7059 16.5048 14.6953
|
|
23
|
+
16.5303C14.4943 17.0156 14.1996 17.4567 13.8281 17.8281C13.4567 18.1996 13.0156 18.4943 12.5303
|
|
24
|
+
18.6953C12.3541 18.7683 12.1732 18.829 11.9893 18.876C11.4543 19.0123 11 18.5521 11 18V17.7852C11.0001
|
|
25
|
+
17.3515 11.365 17.0136 11.7656 16.8477C12.0082 16.7471 12.2284 16.5997 12.4141 16.4141C12.5997 16.2284
|
|
26
|
+
12.7471 16.0082 12.8477 15.7656C12.9482 15.523 13 15.2626 13 15C13 14.7374 12.9482 14.477 12.8477
|
|
27
|
+
14.2344C12.7471 13.9918 12.5997 13.7716 12.4141 13.5859C12.2284 13.4003 12.0082 13.2529 11.7656
|
|
28
|
+
13.1523C11.365 12.9864 11.0001 12.6485 11 12.2148V12C11 11.4479 11.4543 10.9877 11.9893 11.124C12.1732
|
|
29
|
+
11.171 12.3541 11.2317 12.5303 11.3047C13.0156 11.5057 13.4567 11.8004 13.8281 12.1719C14.1996 12.5433
|
|
30
|
+
14.4943 12.9844 14.6953 13.4697C14.7632 13.6337 14.8195 13.8017 14.8649 13.9725C14.8686 13.9865 14.881
|
|
31
|
+
13.9963 14.8955 13.9971C15.1886 14.0123 15.4821 13.9631 15.7539 13.8525C16.0256 13.742 16.2696 13.5729
|
|
32
|
+
16.4688 13.3574C16.6679 13.1419 16.8174 12.8851 16.9063 12.6055C16.995 12.3259 17.0207 12.0301 16.9824
|
|
33
|
+
11.7393C16.9441 11.4484 16.8427 11.169 16.6846 10.9219C16.5264 10.6747 16.3156 10.4652 16.0674
|
|
34
|
+
10.3086C15.6579 10.0502 15.2974 9.62601 15.3574 9.14551L15.3721 9.02344C15.4406 8.47551 15.949 8.07553
|
|
35
|
+
16.4629 8.27734C16.5364 8.30622 16.609 8.33735 16.6807 8.37063C16.811 8.43113 16.9714 8.36352 16.9873
|
|
36
|
+
8.2207C17.0409 7.73814 16.9177 7.25251 16.6396 6.85449C16.3616 6.45652 15.9481 6.1733 15.4766
|
|
37
|
+
6.05762C15.3327 6.02235 15.1861 6.00292 15.04 6C14.9439 5.99809 14.8572 6.05928 14.8296 6.15143C14.7913
|
|
38
|
+
6.27967 14.7467 6.40615 14.6953 6.53027C14.4943 7.01558 14.1996 7.45669 13.8281 7.82812C13.4567 8.19956
|
|
39
|
+
13.0156 8.49429 12.5303 8.69531C12.3541 8.76826 12.1732 8.82902 11.9893 8.87598C11.4543 9.01227
|
|
40
|
+
11 8.55214 11 8V7.78516C11.0001 7.35151 11.365 7.01362 11.7656 6.84766C12.0082 6.74715 12.2284 6.59971
|
|
41
|
+
12.4141 6.41406C12.5997 6.22841 12.7471 6.00817 12.8477 5.76562C12.9482 5.52297 13 5.26264 13 5C13
|
|
42
|
+
4.73736 12.9482 4.47703 12.8477 4.23437C12.7471 3.99182 12.5997 3.77159 12.4141 3.58594C12.2284
|
|
43
|
+
3.40029 12.0082 3.25285 11.7656 3.15234C11.365 2.98638 11.0001 2.64849 11 2.21484V2Z"
|
|
44
|
+
fill="currentColor"/>
|
|
45
|
+
</svg>
|
|
46
|
+
`;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
export {
|
|
50
|
+
n as RecommendationIconsRegistry
|
|
51
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const n = `/* Utils */
|
|
2
|
+
.es-180w { width: 180px; }
|
|
3
|
+
|
|
4
|
+
/* Recommendation Controls */
|
|
5
|
+
.recommendation-controls-container > .container {
|
|
6
|
+
padding: 16px;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.recommendation-controls-container > .container:first-child {
|
|
10
|
+
padding-top: 0;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.container:has(.recommendation-controls-container) {
|
|
14
|
+
padding: 0
|
|
15
|
+
}
|
|
16
|
+
`;
|
|
17
|
+
export {
|
|
18
|
+
n as default
|
|
19
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { SettingsPanelRegistry as o, SettingsPanelTab as t, SettingsTab as e, ContainerControls as r, TextControls as s } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { BLOCK_ID as T } from "./block.js";
|
|
3
|
+
import { CONTROL_BLOCK_ID as i } from "./control.js";
|
|
4
|
+
class a extends o {
|
|
5
|
+
registerBlockControls(n) {
|
|
6
|
+
n[T] = [
|
|
7
|
+
new t(
|
|
8
|
+
e.SETTINGS,
|
|
9
|
+
[
|
|
10
|
+
i,
|
|
11
|
+
r.EXTERNAL_INDENTS
|
|
12
|
+
]
|
|
13
|
+
),
|
|
14
|
+
new t(
|
|
15
|
+
e.STYLES,
|
|
16
|
+
[
|
|
17
|
+
s.TEXT_BLOCK_BACKGROUND_COLOR
|
|
18
|
+
]
|
|
19
|
+
)
|
|
20
|
+
// TODO: It'll be opened after the card composition is implemented by Stripo team.
|
|
21
|
+
// new SettingsPanelTab(
|
|
22
|
+
// 'Card Composition',
|
|
23
|
+
// [
|
|
24
|
+
// COMPOSITION_CONTROL_BLOCK_ID,
|
|
25
|
+
// ]
|
|
26
|
+
// ).withLabel('Card Composition'),
|
|
27
|
+
];
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
a as SettingsPanel
|
|
32
|
+
};
|