@useinsider/guido 1.0.3-beta.a5608d9 → 1.0.3-beta.a60dd8d
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 +492 -151
- package/dist/components/Guido.vue.js +11 -9
- package/dist/components/Guido.vue2.js +75 -69
- 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/components/organisms/header/RightSlot.vue.js +9 -7
- package/dist/components/organisms/header/RightSlot.vue2.js +23 -22
- package/dist/components/organisms/onboarding/NewVersionPopup.vue.js +9 -9
- package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +30 -17
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +12 -10
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +19 -18
- package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.js +18 -0
- package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue2.js +16 -0
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +24 -0
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +64 -0
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +18 -0
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +107 -0
- package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.js +18 -0
- package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue2.js +12 -0
- package/dist/components/wrappers/WpDrawer.vue.js +6 -4
- package/dist/composables/useStripo.js +59 -48
- package/dist/config/compiler/unsubscribeCompilerRules.js +42 -29
- package/dist/config/migrator/couponBlockMigrator.js +67 -0
- package/dist/config/migrator/index.js +9 -6
- package/dist/config/migrator/recommendationMigrator.js +293 -0
- package/dist/config/migrator/unsubscribeMigrator.js +124 -0
- package/dist/enums/date.js +6 -0
- package/dist/enums/defaults.js +4 -0
- package/dist/enums/extensions/recommendationBlock.js +80 -0
- package/dist/enums/onboarding.js +2 -1
- package/dist/enums/unsubscribe.js +43 -6
- package/dist/extensions/Blocks/Checkbox/block.js +15 -24
- package/dist/extensions/Blocks/Checkbox/control.js +55 -67
- package/dist/extensions/Blocks/Checkbox/extension.js +5 -16
- package/dist/extensions/Blocks/Checkbox/iconsRegistry.js +18 -0
- package/dist/extensions/Blocks/Checkbox/settingsPanel.js +12 -25
- package/dist/extensions/Blocks/Checkbox/template.js +5 -16
- package/dist/extensions/Blocks/CouponBlock/block.js +33 -0
- package/dist/extensions/Blocks/CouponBlock/extension.js +8 -0
- package/dist/extensions/Blocks/CouponBlock/iconsRegistry.js +33 -0
- package/dist/extensions/Blocks/CouponBlock/settingsPanel.js +24 -0
- package/dist/extensions/Blocks/CouponBlock/template.js +18 -0
- package/dist/extensions/Blocks/RadioButton/block.js +13 -22
- package/dist/extensions/Blocks/RadioButton/control.js +40 -52
- package/dist/extensions/Blocks/RadioButton/extension.js +4 -15
- package/dist/extensions/Blocks/RadioButton/iconsRegistry.js +14 -0
- package/dist/extensions/Blocks/RadioButton/settingsPanel.js +13 -26
- package/dist/extensions/Blocks/RadioButton/template.js +13 -24
- package/dist/extensions/Blocks/Recommendation/block.js +30 -0
- package/dist/extensions/Blocks/Recommendation/cardCompositionControl.js +103 -0
- package/dist/extensions/Blocks/Recommendation/constants.js +5 -0
- package/dist/extensions/Blocks/Recommendation/control.js +306 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/align.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/border.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/borderRadius.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/color.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/fitToContent.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/fontFamily.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/margins.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/paddings.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/text.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/textSize.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/textStyleAndFontColor.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/image/margins.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/image/size.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/align.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/background.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/color.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/fontFamily.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/paddings.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/size.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/style.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/align.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/background.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/color.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/fontFamily.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/paddings.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/size.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/style.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/price/align.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/price/background.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/price/color.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/price/fontFamily.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/price/paddings.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/price/size.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/price/style.js +13 -0
- package/dist/extensions/Blocks/Recommendation/extension.js +45 -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 +117 -0
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +266 -0
- package/dist/extensions/Blocks/Recommendation/templates/blockTemplate.js +160 -0
- package/dist/extensions/Blocks/Recommendation/templates/migrationTemplate.js +152 -0
- package/dist/extensions/Blocks/Recommendation/templates/templateUtils.js +180 -0
- package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +28 -0
- package/dist/extensions/Blocks/Unsubscribe/block.js +131 -0
- package/dist/extensions/Blocks/Unsubscribe/control.js +167 -0
- package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +42 -0
- package/dist/extensions/Blocks/Unsubscribe/extension.js +21 -0
- package/dist/extensions/Blocks/Unsubscribe/iconsRegistry.js +21 -0
- package/dist/extensions/Blocks/Unsubscribe/settingsPanel.js +35 -0
- package/dist/extensions/Blocks/Unsubscribe/styles.css.js +42 -0
- package/dist/extensions/Blocks/Unsubscribe/tagRegistry.js +10 -0
- package/dist/extensions/Blocks/Unsubscribe/template.js +22 -0
- package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +11 -0
- package/dist/extensions/Blocks/Unsubscribe/utils/utils.js +6 -0
- package/dist/extensions/Blocks/common-control.js +184 -0
- package/dist/extensions/DynamicContent/dynamic-content.js +31 -45
- package/dist/extensions/DynamicContent/extension.js +6 -18
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +866 -0
- package/dist/package.json.js +7 -0
- package/dist/services/recommendationApi.js +43 -0
- package/dist/services/unsubscribeApi.js +16 -0
- package/dist/{@types → src/@types}/generic.d.ts +19 -0
- package/dist/{components → src/components}/Guido.vue.d.ts +3 -2
- 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/{components → src/components}/organisms/header/RightSlot.vue.d.ts +3 -1
- package/dist/src/components/organisms/onboarding/NewVersionPopup.vue.d.ts +4 -0
- package/dist/src/components/organisms/onboarding/OnboardingWrapper.vue.d.ts +4 -0
- package/dist/src/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.d.ts +2 -0
- package/dist/src/components/organisms/unsubscribe/UnsubscribePageSelection.vue.d.ts +2 -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/{components → src/components}/wrappers/WpDrawer.vue.d.ts +6 -4
- package/dist/src/config/migrator/couponBlockMigrator.d.ts +1 -0
- package/dist/src/config/migrator/index.d.ts +1 -0
- package/dist/src/config/migrator/recommendationMigrator.d.ts +1 -0
- package/dist/src/config/migrator/unsubscribeMigrator.d.ts +1 -0
- package/dist/src/enums/date.d.ts +4 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +16 -0
- package/dist/src/enums/onboarding.d.ts +2 -0
- package/dist/src/enums/unsubscribe.d.ts +38 -0
- package/dist/{extensions → src/extensions}/Blocks/Checkbox/block.d.ts +1 -0
- package/dist/src/extensions/Blocks/Checkbox/iconsRegistry.d.ts +4 -0
- package/dist/src/extensions/Blocks/CouponBlock/block.d.ts +12 -0
- package/dist/src/extensions/Blocks/CouponBlock/iconsRegistry.d.ts +4 -0
- package/dist/src/extensions/Blocks/CouponBlock/settingsPanel.d.ts +4 -0
- package/dist/src/extensions/Blocks/CouponBlock/template.d.ts +3 -0
- package/dist/{extensions → src/extensions}/Blocks/RadioButton/block.d.ts +1 -0
- package/dist/src/extensions/Blocks/RadioButton/iconsRegistry.d.ts +4 -0
- package/dist/src/extensions/Blocks/Recommendation/block.d.ts +11 -0
- package/dist/src/extensions/Blocks/Recommendation/cardCompositionControl.d.ts +28 -0
- package/dist/src/extensions/Blocks/Recommendation/constants.d.ts +51 -0
- package/dist/src/extensions/Blocks/Recommendation/control.d.ts +35 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/align.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/border.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/borderRadius.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/color.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/fitToContent.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/fontFamily.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/margins.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/paddings.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/text.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/textSize.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/textStyleAndFontColor.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/image/margins.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/image/size.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/align.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/background.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/color.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/fontFamily.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/paddings.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/size.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/style.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/align.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/background.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/color.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/fontFamily.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/paddings.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/size.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/style.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/align.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/background.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/color.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/fontFamily.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/paddings.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/size.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/style.d.ts +5 -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/templates/blockTemplate.d.ts +16 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/migrationTemplate.d.ts +16 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/templateUtils.d.ts +44 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/filterUtil.d.ts +7 -0
- package/dist/src/extensions/Blocks/Unsubscribe/block.d.ts +32 -0
- package/dist/src/extensions/Blocks/Unsubscribe/control.d.ts +29 -0
- package/dist/src/extensions/Blocks/Unsubscribe/elements/preview.d.ts +11 -0
- package/dist/src/extensions/Blocks/Unsubscribe/extension.d.ts +2 -0
- package/dist/src/extensions/Blocks/Unsubscribe/iconsRegistry.d.ts +4 -0
- package/dist/src/extensions/Blocks/Unsubscribe/settingsPanel.d.ts +4 -0
- package/dist/src/extensions/Blocks/Unsubscribe/tagRegistry.d.ts +4 -0
- package/dist/src/extensions/Blocks/Unsubscribe/template.d.ts +12 -0
- package/dist/src/extensions/Blocks/Unsubscribe/utils/constants.d.ts +9 -0
- package/dist/src/extensions/Blocks/Unsubscribe/utils/utils.d.ts +7 -0
- package/dist/{extensions → src/extensions}/Blocks/_Boilerplate/block.d.ts +1 -0
- package/dist/src/extensions/Blocks/_Boilerplate/extension.d.ts +2 -0
- package/dist/src/extensions/Blocks/_Boilerplate/iconsRegistry.d.ts +4 -0
- package/dist/src/extensions/Blocks/_Boilerplate/settingsPanel.d.ts +4 -0
- package/dist/src/extensions/Blocks/common-control.d.ts +87 -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/src/services/unsubscribeApi.d.ts +4 -0
- package/dist/src/stores/config.d.ts +97 -0
- package/dist/{stores → src/stores}/editor.d.ts +21 -0
- package/dist/src/stores/unsubscribe.d.ts +256 -0
- package/dist/src/utils/dateUtil.d.ts +22 -0
- package/dist/{utils → src/utils}/genericUtil.d.ts +1 -0
- package/dist/static/styles/customEditorStyle.css.js +5 -0
- package/dist/stores/config.js +17 -0
- package/dist/stores/editor.js +2 -1
- package/dist/stores/unsubscribe.js +126 -6
- package/dist/utils/dateUtil.js +24 -3
- package/dist/utils/genericUtil.js +8 -7
- package/dist/utils/templatePreparation.js +17 -16
- package/package.json +8 -3
- package/dist/config/migrator/index.d.ts +0 -1
- package/dist/enums/onboarding.d.ts +0 -1
- package/dist/enums/unsubscribe.d.ts +0 -15
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/Extension.js +0 -75
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ExtensionBuilder.js +0 -77
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/Block.js +0 -123
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/AiAssistantValueType.js +0 -7
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockCompositionType.js +0 -7
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockName.js +0 -12
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockType.js +0 -7
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BuiltInControlTypes.js +0 -119
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/ContextActionType.js +0 -7
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/EditorStatePropertyType.js +0 -7
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PanelPosition.js +0 -7
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/Popover.js +0 -12
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PreviewDeviceMode.js +0 -7
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/SettingsTab.js +0 -7
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementType.js +0 -7
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementsAttributes.js +0 -24
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/Control.js +0 -24
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelRegistry.js +0 -11
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelTab.js +0 -33
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/modifications/ModificationDescription.js +0 -22
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElement.js +0 -40
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElementTagRegistry.js +0 -5
- package/dist/stores/unsubscribe.d.ts +0 -8
- package/dist/utils/dateUtil.d.ts +0 -1
- /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}/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/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 → src/components}/organisms/onboarding/TextBlockOnboarding.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/onboarding/VersionHistoryOnboarding.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/save-as-template/SaveAsTemplateDrawer.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/radioButtonMigrator.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}/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/{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/settingsPanel.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/Checkbox/template.d.ts +0 -0
- /package/dist/{extensions/Blocks/RadioButton → src/extensions/Blocks/CouponBlock}/extension.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/RadioButton/control.d.ts +0 -0
- /package/dist/{extensions/Blocks/_Boilerplate → src/extensions/Blocks/RadioButton}/extension.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/DynamicContent → 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/_Boilerplate/control.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/{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}/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}/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
package/README.md
CHANGED
|
@@ -4,309 +4,650 @@
|
|
|
4
4
|
</a>
|
|
5
5
|
</p>
|
|
6
6
|
|
|
7
|
+
|
|
7
8
|
# @useinsider/guido
|
|
8
9
|
|
|
9
10
|
Guido is a Vue 2 + TypeScript wrapper for the Stripo Email Editor plugin. Easily embed the professional email editor in your Vue applications with a clean, customizable interface.
|
|
10
11
|
|
|
11
|
-
## 📚 Table of Contents
|
|
12
|
-
|
|
13
|
-
- [Install](#-install)
|
|
14
|
-
- [Quick Start](#-quick-start)
|
|
15
|
-
- [Documentation](#-documentation)
|
|
16
|
-
- [Development](#-development)
|
|
17
|
-
- [Contributing](#-contributing)
|
|
18
|
-
- [License](#-license)
|
|
19
|
-
|
|
20
|
-
## 📖 Documentation
|
|
21
|
-
|
|
22
|
-
**For comprehensive documentation, visit our [Wiki](./wiki/Home.md):**
|
|
23
|
-
|
|
24
|
-
- **[Getting Started Guide](./wiki/Getting-Started.md)** - Installation, setup, and basic usage
|
|
25
|
-
- **[API Reference](./wiki/API-Reference.md)** - Complete API documentation with examples
|
|
26
|
-
- **[HTML Compiler Rules](./wiki/HTML-Compiler-Rules.md)** - Advanced HTML transformation guide
|
|
27
|
-
- **[Architecture](./wiki/Architecture.md)** - Project structure and design patterns
|
|
28
|
-
- **[Contributing Guide](./wiki/Contributing.md)** - Development workflow and coding standards
|
|
29
|
-
|
|
30
12
|
## 📦 Install
|
|
31
13
|
|
|
32
14
|
```bash
|
|
33
15
|
npm install @useinsider/guido
|
|
34
16
|
```
|
|
35
|
-
|
|
36
|
-
Or using bun:
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
bun add @useinsider/guido
|
|
40
|
-
```
|
|
41
|
-
|
|
42
17
|
### Prerequisites
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
// webpack.config.js or vue.config.js
|
|
53
|
-
{
|
|
18
|
+
🍍 Your project should have `pinia`
|
|
19
|
+
You need to be sure those lines added in your config file:
|
|
20
|
+
|
|
21
|
+
ℹ️ It helps to optimize your dependencies and sharing by Guido. This is why Guido pretty fast and tiny.
|
|
22
|
+
|
|
23
|
+
#### For Webpack
|
|
24
|
+
`/webpack.config.js` or `/vue.config.js`
|
|
25
|
+
```js
|
|
26
|
+
// ... Previous Configs
|
|
54
27
|
shared: {
|
|
55
28
|
vue: { singleton: true },
|
|
56
29
|
pinia: { singleton: true },
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
```
|
|
60
|
-
</details>
|
|
61
|
-
|
|
62
|
-
<details>
|
|
63
|
-
<summary>Vite Configuration</summary>
|
|
30
|
+
},
|
|
31
|
+
// ... Upcoming Configs
|
|
32
|
+
```
|
|
64
33
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
34
|
+
##### For Vite:
|
|
35
|
+
`/vite.config.js`
|
|
36
|
+
```js
|
|
37
|
+
// ... Previous Configs
|
|
68
38
|
resolve: {
|
|
69
39
|
dedupe: ['vue', 'pinia'],
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
```
|
|
73
|
-
</details>
|
|
74
|
-
|
|
40
|
+
},
|
|
41
|
+
// ... Upcoming Configs
|
|
42
|
+
```
|
|
75
43
|
---
|
|
76
|
-
## 🚀
|
|
44
|
+
## 🚀 Usage
|
|
45
|
+
|
|
46
|
+
### Basic Usage
|
|
77
47
|
|
|
78
|
-
```
|
|
48
|
+
```html
|
|
79
49
|
<template>
|
|
80
|
-
<
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
50
|
+
<div>
|
|
51
|
+
<Guido
|
|
52
|
+
ref="guidoEditor"
|
|
53
|
+
:template-id="templateId"
|
|
54
|
+
:user-id="userId"
|
|
55
|
+
:migration-date="migrationDate"
|
|
56
|
+
:guido-config="guidoConfig"
|
|
57
|
+
:html="initialHtml"
|
|
58
|
+
:css="initialCss"
|
|
59
|
+
@dynamic-content:open="handleDynamicContentOpen"
|
|
60
|
+
@back="handleBack"
|
|
61
|
+
@save:start="handleSaveStart"
|
|
62
|
+
@save:complete="handleSaveComplete"
|
|
63
|
+
/>
|
|
64
|
+
</div>
|
|
87
65
|
</template>
|
|
88
66
|
|
|
89
67
|
<script lang="ts">
|
|
90
68
|
import { Guido } from '@useinsider/guido';
|
|
91
|
-
import '@useinsider/guido/style';
|
|
92
69
|
|
|
93
70
|
export default {
|
|
94
|
-
components: {
|
|
95
|
-
|
|
71
|
+
components: {
|
|
72
|
+
Guido
|
|
73
|
+
},
|
|
96
74
|
data() {
|
|
97
75
|
return {
|
|
98
76
|
templateId: 'template-123',
|
|
99
77
|
userId: 'user-456',
|
|
78
|
+
migrationDate: 1699488000,
|
|
79
|
+
initialHtml: '<p>Initial HTML content</p>',
|
|
80
|
+
initialCss: 'p { color: #333; }',
|
|
100
81
|
guidoConfig: {
|
|
101
82
|
translationsPath: 'window.trans.en',
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
senderName: 'Your Company',
|
|
105
|
-
subject: 'Email Subject'
|
|
106
|
-
},
|
|
107
|
-
partner: {
|
|
108
|
-
partnerName: 'your-partner',
|
|
109
|
-
productType: 1,
|
|
110
|
-
messageType: 1
|
|
111
|
-
},
|
|
83
|
+
htmlCompilerRules: [],
|
|
84
|
+
ignoreDefaultHtmlCompilerRules: false,
|
|
112
85
|
features: {
|
|
113
86
|
dynamicContent: true,
|
|
114
87
|
saveAsTemplate: true,
|
|
115
88
|
versionHistory: true
|
|
116
89
|
}
|
|
117
|
-
}
|
|
90
|
+
},
|
|
91
|
+
dynamicContentModalVisible: false
|
|
118
92
|
};
|
|
119
93
|
},
|
|
120
94
|
|
|
121
95
|
methods: {
|
|
122
|
-
|
|
123
|
-
console.log('
|
|
96
|
+
handleDynamicContentOpen(detail) {
|
|
97
|
+
console.log('Dynamic content requested:', detail);
|
|
98
|
+
this.dynamicContentModalVisible = true;
|
|
99
|
+
},
|
|
100
|
+
|
|
101
|
+
handleBack() {
|
|
102
|
+
console.log('User clicked back button');
|
|
103
|
+
// Handle navigation back
|
|
104
|
+
},
|
|
105
|
+
|
|
106
|
+
handleSaveStart() {
|
|
107
|
+
console.log('Save process started');
|
|
108
|
+
// Show loading indicator
|
|
109
|
+
},
|
|
110
|
+
|
|
111
|
+
handleSaveComplete(template) {
|
|
112
|
+
console.log('Save completed:', template);
|
|
113
|
+
// Handle saved template data
|
|
114
|
+
},
|
|
115
|
+
|
|
116
|
+
// ⚠️ Your own Dynamic Content Modal should have this id: #guido-dynamic-content-modal
|
|
117
|
+
handleDynamicContentInsert() {
|
|
118
|
+
this.$refs.guidoEditor?.dynamicContent.insert({
|
|
119
|
+
text: 'Display Text',
|
|
120
|
+
value: 'actual-value',
|
|
121
|
+
fallback: 'Fallback Text'
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
this.dynamicContentModalVisible = false;
|
|
125
|
+
},
|
|
126
|
+
|
|
127
|
+
// ⚠️ It's mandatory. There is no way to understand if user closes the modal without selection.
|
|
128
|
+
handleDynamicContentClose() {
|
|
129
|
+
this.$refs.guidoEditor?.dynamicContent.close();
|
|
130
|
+
},
|
|
131
|
+
|
|
132
|
+
// If you need to trigger save manually like leave modal cases, you can use this method.
|
|
133
|
+
save () {
|
|
134
|
+
this.$refs.guidoEditor?.saveSilent();
|
|
124
135
|
}
|
|
125
136
|
}
|
|
126
137
|
};
|
|
127
138
|
</script>
|
|
128
139
|
```
|
|
129
140
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
## 📚 API Quick Reference
|
|
141
|
+
## 📚 API
|
|
133
142
|
|
|
134
|
-
### Props
|
|
143
|
+
### Guido Component Props
|
|
135
144
|
|
|
136
|
-
| Prop | Type | Required | Description |
|
|
137
|
-
|
|
138
|
-
| `templateId` | `string` | ✅ | Unique identifier for the email template |
|
|
139
|
-
| `userId` | `string` | ✅ | Unique identifier for the user |
|
|
140
|
-
| `guidoConfig` | `GuidoConfig` | ✅ | Configuration object for the editor |
|
|
141
|
-
| `
|
|
142
|
-
| `
|
|
145
|
+
| Prop | Type | Required | Default | Description |
|
|
146
|
+
|------|------|----------|---------|-------------|
|
|
147
|
+
| `templateId` | `string` | ✅ | - | Unique identifier for the email template |
|
|
148
|
+
| `userId` | `string` | ✅ | - | Unique identifier for the user |
|
|
149
|
+
| `guidoConfig` | `GuidoConfig` | ✅ | - | Configuration object for the editor |
|
|
150
|
+
| `migrationDate` | `number` | ✅ | - | Stripo migration date in Unix timestamp (seconds). Retrieved from backend `/partner-settings` endpoint as `migrationDate`. Used for onboarding process |
|
|
151
|
+
| `partnerName` | `string` | ⚪ | From URL host | Partner identifier |
|
|
152
|
+
| `productType` | `string` | ⚪ | From URL path | Product type identifier |
|
|
153
|
+
| `username` | `string` | ⚪ | `'Guido User'` | Display name for the user |
|
|
154
|
+
| `html` | `string` | ⚪ | `''` | Initial HTML content for the template |
|
|
155
|
+
| `css` | `string` | ⚪ | `''` | Initial CSS styles for the template |
|
|
143
156
|
|
|
144
|
-
### Events
|
|
157
|
+
### Guido Component Events
|
|
145
158
|
|
|
146
159
|
| Event | Payload | Description |
|
|
147
160
|
|-------|---------|-------------|
|
|
148
|
-
| `
|
|
149
|
-
| `
|
|
150
|
-
| `
|
|
151
|
-
| `
|
|
152
|
-
| `
|
|
153
|
-
| `
|
|
161
|
+
| `dynamic-content:open` | `DynamicContent \| null` | Fired when user requests to insert dynamic content |
|
|
162
|
+
| `back` | - | Fired when user clicks the back button |
|
|
163
|
+
| `save:start` | - | Fired when the save process begins |
|
|
164
|
+
| `save:complete` | `Omit<Template, 'forceRecreate'>` | Fired when template is successfully saved |
|
|
165
|
+
| `on-change` | void | It Fires once for managing leave modal etc. |
|
|
166
|
+
| `ready` | void | Fired when the editor is ready and template is loaded |
|
|
167
|
+
| `onboarding-finished` | void | Fired when the onboarding popup is dismissed or completed, allowing parent applications to track onboarding state |
|
|
168
|
+
| `test-message:open` | void | Fired when user clicks test message button. |
|
|
169
|
+
|
|
170
|
+
### Guido Exposed Methods
|
|
171
|
+
```typescript
|
|
172
|
+
dynamicContent.insert(DynamicContent);
|
|
173
|
+
dynamicContent.close();
|
|
174
|
+
saveSilent();
|
|
175
|
+
```
|
|
154
176
|
|
|
155
|
-
###
|
|
177
|
+
### Guido Interfaces
|
|
156
178
|
|
|
157
179
|
```typescript
|
|
158
|
-
|
|
159
|
-
|
|
180
|
+
interface GuidoConfig {
|
|
181
|
+
translationsPath: string;
|
|
182
|
+
htmlCompilerRules?: CompilerRule[];
|
|
183
|
+
ignoreDefaultHtmlCompilerRules?: boolean;
|
|
184
|
+
useHeader: boolean
|
|
185
|
+
emailHeader: {
|
|
186
|
+
senderName: string;
|
|
187
|
+
subject: string;
|
|
188
|
+
};
|
|
189
|
+
partner: {
|
|
190
|
+
partnerName: string;
|
|
191
|
+
productType: number;
|
|
192
|
+
messageType: number;
|
|
193
|
+
};
|
|
194
|
+
features: {
|
|
195
|
+
dynamicContent: boolean;
|
|
196
|
+
saveAsTemplate: boolean;
|
|
197
|
+
versionHistory: boolean;
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
```
|
|
160
201
|
|
|
161
|
-
|
|
162
|
-
|
|
202
|
+
| Property | Type | Default | Description |
|
|
203
|
+
|----------|------|---------|-------------|
|
|
204
|
+
| `translationsPath` | `string` | `'window.trans.en'` | JavaScript path to the translations object |
|
|
205
|
+
| `htmlCompilerRules` | `CompilerRule[]` | `[]` | Additional compiler rules to apply to HTML content. See [HTML Compiler Rules](#-html-compiler-rules) section below |
|
|
206
|
+
| `ignoreDefaultHtmlCompilerRules` | `boolean` | `false` | Skip default compiler rules and only use custom rules. Default rules: `src/config/compiler/htmlCompilerRules.ts` |
|
|
207
|
+
| `useHeader` | `boolean` | `true` | Adds extra spaces to height for adjusting. If you don't use Inone Page header, override as `false` |
|
|
208
|
+
| `features` | `Features` | `{ dynamicContent: true, saveAsTemplate: true, versionHistory: true }` | Feature flags to enable/disable editor functionality |
|
|
209
|
+
| `features.dynamicContent` | `boolean` | `true` | Enable dynamic content insertion feature |
|
|
210
|
+
| `features.saveAsTemplate` | `boolean` | `true` | Enable save as template feature |
|
|
211
|
+
| `features.versionHistory` | `boolean` | `true` | Enable version history feature |
|
|
163
212
|
|
|
164
|
-
|
|
165
|
-
|
|
213
|
+
```typescript
|
|
214
|
+
interface DynamicContent {
|
|
215
|
+
value: string;
|
|
216
|
+
text: string;
|
|
217
|
+
fallback?: string;
|
|
218
|
+
}
|
|
166
219
|
```
|
|
220
|
+
---
|
|
167
221
|
|
|
168
|
-
|
|
222
|
+
| Property | Type | Default | Description |
|
|
223
|
+
|----------|------|---------|-------------|
|
|
224
|
+
| `value` | `string` | '' | Value of the dynamic content |
|
|
225
|
+
| `text` | `string` | '' | Visible value of the dynamic content |
|
|
226
|
+
| `fallback?` | `string` | '' | Fallback value of the dynamic content. Optional |
|
|
227
|
+
|
|
228
|
+
### TypeScript Types
|
|
229
|
+
|
|
230
|
+
The library exports the following TypeScript types:
|
|
231
|
+
|
|
232
|
+
```typescript
|
|
233
|
+
// Main component
|
|
234
|
+
import { Guido } from '@useinsider/guido';
|
|
235
|
+
|
|
236
|
+
// Types
|
|
237
|
+
import type { GuidoConfig } from '@useinsider/guido';
|
|
238
|
+
import type { StripoEventType } from '@useinsider/guido';
|
|
239
|
+
```
|
|
169
240
|
|
|
170
241
|
## 🔨 HTML Compiler Rules
|
|
171
242
|
|
|
172
|
-
|
|
243
|
+
Guido includes a powerful HTML compiler system that allows you to transform HTML content with custom rules. You can define additional rules and optionally ignore the default rules.
|
|
244
|
+
|
|
245
|
+
### Rule Types
|
|
173
246
|
|
|
174
|
-
|
|
175
|
-
|
|
247
|
+
There are 4 types of compiler rules:
|
|
248
|
+
|
|
249
|
+
#### 1. Replace Rule
|
|
250
|
+
Replace specific strings in HTML content.
|
|
176
251
|
|
|
177
252
|
```typescript
|
|
178
253
|
{
|
|
179
254
|
id: 'fix-encoding',
|
|
255
|
+
description: 'Fix URL encoding issues',
|
|
180
256
|
type: 'replace',
|
|
181
|
-
search: '{%22',
|
|
182
|
-
replacement: '%7B%22',
|
|
183
|
-
|
|
257
|
+
search: '{%22', // String to find
|
|
258
|
+
replacement: '%7B%22', // String to replace with
|
|
259
|
+
replaceAll: true, // Replace all occurrences (default: true)
|
|
260
|
+
priority: 10 // Execution priority (lower = earlier)
|
|
184
261
|
}
|
|
185
262
|
```
|
|
186
|
-
</details>
|
|
187
263
|
|
|
188
|
-
|
|
189
|
-
|
|
264
|
+
#### 2. Regex Rule
|
|
265
|
+
Use regular expressions for complex pattern matching and replacement.
|
|
190
266
|
|
|
191
267
|
```typescript
|
|
192
268
|
{
|
|
193
269
|
id: 'remove-comments',
|
|
270
|
+
description: 'Remove HTML comments',
|
|
194
271
|
type: 'regex',
|
|
195
|
-
pattern: '<!--.*?-->',
|
|
196
|
-
replacement: '',
|
|
197
|
-
flags: 'g',
|
|
272
|
+
pattern: '<!--.*?-->', // Regex pattern
|
|
273
|
+
replacement: '', // Replacement string
|
|
274
|
+
flags: 'g', // Regex flags (default: 'g')
|
|
198
275
|
priority: 20
|
|
199
276
|
}
|
|
200
277
|
```
|
|
201
|
-
</details>
|
|
202
278
|
|
|
203
|
-
|
|
204
|
-
|
|
279
|
+
#### 3. Remove Rule
|
|
280
|
+
Remove specific strings or patterns from HTML content.
|
|
205
281
|
|
|
206
282
|
```typescript
|
|
207
283
|
{
|
|
208
284
|
id: 'cleanup-scripts',
|
|
285
|
+
description: 'Remove unwanted script tags',
|
|
209
286
|
type: 'remove',
|
|
210
|
-
targets: [
|
|
287
|
+
targets: [ // Array of strings or RegExp objects
|
|
211
288
|
'<script src="unwanted.js"></script>',
|
|
212
289
|
/onclick="[^"]*"/g
|
|
213
290
|
],
|
|
214
291
|
priority: 30
|
|
215
292
|
}
|
|
216
293
|
```
|
|
217
|
-
</details>
|
|
218
294
|
|
|
219
|
-
|
|
220
|
-
|
|
295
|
+
#### 4. Custom Rule
|
|
296
|
+
Define complex transformation logic with a custom processor function.
|
|
221
297
|
|
|
222
298
|
```typescript
|
|
223
299
|
{
|
|
224
300
|
id: 'add-meta-tags',
|
|
301
|
+
description: 'Add custom meta tags to head',
|
|
225
302
|
type: 'custom',
|
|
226
303
|
processor: (html: string): string => {
|
|
304
|
+
// Custom transformation logic
|
|
227
305
|
const metaTags = '<meta name="custom" content="value">';
|
|
228
306
|
return html.replace('</head>', `${metaTags}</head>`);
|
|
229
307
|
},
|
|
230
308
|
priority: 40
|
|
231
309
|
}
|
|
232
310
|
```
|
|
233
|
-
</details>
|
|
234
311
|
|
|
235
|
-
###
|
|
312
|
+
### Using HTML Compiler Rules
|
|
313
|
+
|
|
314
|
+
#### Basic Usage with Custom Rules
|
|
236
315
|
|
|
237
316
|
```typescript
|
|
238
317
|
const guidoConfig = {
|
|
318
|
+
translationsPath: 'window.trans.en',
|
|
319
|
+
features: {
|
|
320
|
+
dynamicContent: true,
|
|
321
|
+
saveAsTemplate: true,
|
|
322
|
+
versionHistory: false // Disable version history
|
|
323
|
+
},
|
|
239
324
|
htmlCompilerRules: [
|
|
240
325
|
{
|
|
241
326
|
id: 'replace-domain',
|
|
327
|
+
description: 'Replace old domain with new one',
|
|
242
328
|
type: 'replace',
|
|
243
329
|
search: 'old-domain.com',
|
|
244
330
|
replacement: 'new-domain.com',
|
|
331
|
+
replaceAll: true,
|
|
245
332
|
priority: 10
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
id: 'remove-tracking',
|
|
336
|
+
description: 'Remove tracking pixels',
|
|
337
|
+
type: 'regex',
|
|
338
|
+
pattern: '<img[^>]*tracking[^>]*>',
|
|
339
|
+
replacement: '',
|
|
340
|
+
flags: 'gi',
|
|
341
|
+
priority: 20
|
|
342
|
+
}
|
|
343
|
+
]
|
|
344
|
+
};
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
#### Ignoring Default Rules
|
|
348
|
+
|
|
349
|
+
```typescript
|
|
350
|
+
const guidoConfig = {
|
|
351
|
+
translationsPath: 'window.trans.en',
|
|
352
|
+
features: {
|
|
353
|
+
dynamicContent: true,
|
|
354
|
+
saveAsTemplate: true,
|
|
355
|
+
versionHistory: true
|
|
356
|
+
},
|
|
357
|
+
ignoreDefaultHtmlCompilerRules: true, // Skip all default rules
|
|
358
|
+
htmlCompilerRules: [
|
|
359
|
+
// Only your custom rules will be applied
|
|
360
|
+
{
|
|
361
|
+
id: 'custom-transformation',
|
|
362
|
+
type: 'replace',
|
|
363
|
+
search: 'old-text',
|
|
364
|
+
replacement: 'new-text',
|
|
365
|
+
priority: 1
|
|
246
366
|
}
|
|
247
367
|
]
|
|
248
368
|
};
|
|
249
369
|
```
|
|
250
370
|
|
|
251
|
-
|
|
371
|
+
### Rule Execution Order
|
|
372
|
+
|
|
373
|
+
Rules are executed in priority order (lower numbers first). Rules with the same priority are executed in array order.
|
|
374
|
+
|
|
375
|
+
- **Priority 1-99**: Reserved for critical transformations
|
|
376
|
+
- **Priority 100-999**: Standard transformations
|
|
377
|
+
- **Priority 1000+**: Additional custom rules (automatically assigned)
|
|
378
|
+
|
|
379
|
+
### Default Rules
|
|
380
|
+
|
|
381
|
+
Guido includes several default rules for common email HTML optimizations:
|
|
382
|
+
|
|
383
|
+
- **URL encoding fixes**: Fixes malformed URL encoding in dynamic content
|
|
384
|
+
- **Template tag restoration**: Restores `{{}}` template tags that got URL encoded
|
|
385
|
+
- **HTML entity decoding**: Converts `<` and `>` back to `<` and `>`
|
|
386
|
+
- **Cleanup rules**: Removes unwanted iframe and style elements
|
|
387
|
+
- **MSO conditions**: Manages Outlook-specific conditional comments
|
|
388
|
+
- **Domain replacement**: Updates old image domains to current ones
|
|
389
|
+
|
|
390
|
+
You can view all default rules in: `src/config/compiler/htmlCompilerRules.ts`
|
|
391
|
+
|
|
392
|
+
### CompilerRule Interface
|
|
393
|
+
|
|
394
|
+
```typescript
|
|
395
|
+
type CompilerRuleType = 'replace' | 'regex' | 'remove' | 'custom';
|
|
396
|
+
|
|
397
|
+
interface BaseCompilerRule {
|
|
398
|
+
id: string;
|
|
399
|
+
description?: string;
|
|
400
|
+
priority: number;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
interface ReplaceRule extends BaseCompilerRule {
|
|
404
|
+
type: 'replace';
|
|
405
|
+
search: string;
|
|
406
|
+
replacement: string;
|
|
407
|
+
replaceAll?: boolean; // Default: true
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
interface RegexRule extends BaseCompilerRule {
|
|
411
|
+
type: 'regex';
|
|
412
|
+
pattern: string;
|
|
413
|
+
replacement: string;
|
|
414
|
+
flags?: string; // Default: 'g'
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
interface RemoveRule extends BaseCompilerRule {
|
|
418
|
+
type: 'remove';
|
|
419
|
+
targets: (string | RegExp)[]; // Array of strings or RegExp objects
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
interface CustomRule extends BaseCompilerRule {
|
|
423
|
+
type: 'custom';
|
|
424
|
+
processor: (html: string) => string;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
type CompilerRule = ReplaceRule | RegexRule | RemoveRule | CustomRule;
|
|
428
|
+
```
|
|
252
429
|
|
|
253
430
|
---
|
|
254
431
|
|
|
255
432
|
## 🔧 Development
|
|
256
433
|
|
|
257
|
-
###
|
|
434
|
+
### Prerequisites
|
|
435
|
+
|
|
436
|
+
- 🧄 `Bun` (strongly recommended)
|
|
437
|
+
or
|
|
438
|
+
- NodeJS 18+ & `npm`
|
|
439
|
+
|
|
440
|
+
### Setup
|
|
258
441
|
|
|
259
442
|
```bash
|
|
260
443
|
# Install dependencies
|
|
261
444
|
bun install
|
|
262
445
|
|
|
263
|
-
# Start
|
|
446
|
+
# Start development server
|
|
264
447
|
bun start
|
|
265
448
|
|
|
266
|
-
# Build
|
|
449
|
+
# Build for production
|
|
267
450
|
bun run build
|
|
268
451
|
|
|
269
|
-
#
|
|
452
|
+
# Type checking
|
|
453
|
+
bun run type-check
|
|
454
|
+
|
|
455
|
+
# Linting
|
|
270
456
|
bun run lint
|
|
271
457
|
```
|
|
272
458
|
|
|
273
|
-
###
|
|
459
|
+
### Environment Variables
|
|
274
460
|
|
|
275
|
-
|
|
461
|
+
Create a `.env` file with the following variables: (You can get env variables from your senior)
|
|
276
462
|
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
|
|
463
|
+
```env
|
|
464
|
+
VITE_STRIPO_PLUGIN_ID=your_plugin_id
|
|
465
|
+
VITE_STRIPO_SECRET_KEY=your_secret_key
|
|
466
|
+
VITE_STRIPO_ROLE=your_role
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
### Project Structure
|
|
280
470
|
|
|
281
|
-
|
|
282
|
-
|
|
471
|
+
```
|
|
472
|
+
src/
|
|
473
|
+
├── components/ # Vue components
|
|
474
|
+
├── composables/ # Vue composables & business logic
|
|
475
|
+
├── services/ # API layer
|
|
476
|
+
├── stores/ # State management
|
|
477
|
+
├── @types/ # TypeScript definitions
|
|
478
|
+
├── static/ # Static assets & templates
|
|
479
|
+
├── utils/ # Utility functions
|
|
480
|
+
├── enums/ # Constants & enums
|
|
481
|
+
├── mock/ # Mock data for development
|
|
482
|
+
├── plugins/ # Vue plugins
|
|
483
|
+
└── library.ts # Main export
|
|
283
484
|
```
|
|
284
485
|
|
|
285
|
-
|
|
486
|
+
## 🔌 Provide/Inject Utilities
|
|
286
487
|
|
|
287
|
-
|
|
488
|
+
Guido includes type-safe utilities for Vue's provide/inject system to facilitate dependency injection between components.
|
|
489
|
+
|
|
490
|
+
### useProvideInject
|
|
491
|
+
|
|
492
|
+
The `useProvideInject` composable provides two helper functions for type-safe dependency injection:
|
|
493
|
+
|
|
494
|
+
#### Basic Usage
|
|
495
|
+
|
|
496
|
+
```typescript
|
|
497
|
+
// Parent component
|
|
498
|
+
import { provideValue } from '@useinsider/guido';
|
|
499
|
+
import { InjectionKey } from 'vue';
|
|
500
|
+
|
|
501
|
+
// Define a typed injection key
|
|
502
|
+
const MyServiceKey: InjectionKey<MyService> = Symbol('MyService');
|
|
288
503
|
|
|
289
|
-
|
|
504
|
+
// Provide the value
|
|
505
|
+
const myService = new MyService();
|
|
506
|
+
provideValue(MyServiceKey, myService);
|
|
290
507
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
- **PR Requirements**:
|
|
294
|
-
- Fill PR labels
|
|
295
|
-
- Assign to yourself
|
|
296
|
-
- Include tests
|
|
297
|
-
- Pass all checks before review
|
|
508
|
+
// Child component
|
|
509
|
+
import { useInjectedValue } from '@useinsider/guido';
|
|
298
510
|
|
|
299
|
-
|
|
511
|
+
// Inject the value with type safety
|
|
512
|
+
const myService = useInjectedValue(MyServiceKey);
|
|
513
|
+
```
|
|
514
|
+
|
|
515
|
+
#### With Default Value
|
|
516
|
+
|
|
517
|
+
```typescript
|
|
518
|
+
// Inject with a fallback value
|
|
519
|
+
const myService = useInjectedValue(MyServiceKey, new DefaultService());
|
|
520
|
+
```
|
|
521
|
+
|
|
522
|
+
#### Error Handling
|
|
523
|
+
|
|
524
|
+
The `useInjectedValue` function will throw a descriptive error if no provider is found and no default value is provided:
|
|
525
|
+
|
|
526
|
+
```typescript
|
|
527
|
+
// This will throw an error if no provider exists
|
|
528
|
+
try {
|
|
529
|
+
const myService = useInjectedValue(MyServiceKey);
|
|
530
|
+
} catch (error) {
|
|
531
|
+
console.error('No provider found for MyService');
|
|
532
|
+
}
|
|
533
|
+
```
|
|
534
|
+
|
|
535
|
+
### API Reference
|
|
536
|
+
|
|
537
|
+
#### `provideValue`
|
|
538
|
+
|
|
539
|
+
```typescript
|
|
540
|
+
provideValue<T>(key: InjectionKey<T>, value: T): void
|
|
541
|
+
```
|
|
542
|
+
|
|
543
|
+
Provides a value using Vue's provide system with type safety.
|
|
544
|
+
|
|
545
|
+
| Parameter | Type | Description |
|
|
546
|
+
|-----------|------|-------------|
|
|
547
|
+
| `key` | `InjectionKey<T>` | The typed injection key |
|
|
548
|
+
| `value` | `T` | The value to provide |
|
|
549
|
+
|
|
550
|
+
#### `useInjectedValue`
|
|
551
|
+
|
|
552
|
+
```typescript
|
|
553
|
+
useInjectedValue<T>(key: InjectionKey<T>, defaultValue?: T): T
|
|
554
|
+
```
|
|
555
|
+
|
|
556
|
+
Injects a value using Vue's inject system with type safety and error handling.
|
|
557
|
+
|
|
558
|
+
| Parameter | Type | Required | Description |
|
|
559
|
+
|-----------|------|----------|-------------|
|
|
560
|
+
| `key` | `InjectionKey<T>` | ✅ | The typed injection key |
|
|
561
|
+
| `defaultValue` | `T` | ⚪ | Optional fallback value |
|
|
562
|
+
|
|
563
|
+
**Returns:** `T` - The injected value
|
|
564
|
+
|
|
565
|
+
**Throws:** `Error` - When no provider is found and no default value is provided
|
|
566
|
+
|
|
567
|
+
## 🌐 i18n
|
|
568
|
+
Before running the project, it sends to request to inone.useinsider.com/translations and writes the JSON file into - [trans.json](src/mock/responses/trans.json).
|
|
569
|
+
It allows to use production or local translations on your code. 🚀
|
|
570
|
+
Example usage:
|
|
571
|
+
```js
|
|
572
|
+
import { useTranslations } from '@@/Composables/useTranslations';
|
|
573
|
+
|
|
574
|
+
const trans = useTranslations();
|
|
575
|
+
|
|
576
|
+
// use everywhere like this:
|
|
577
|
+
trans('foo.bar')
|
|
578
|
+
```
|
|
579
|
+
|
|
580
|
+
## 📦 Local Building (Recommended)
|
|
581
|
+
|
|
582
|
+
Run this commands if you want to test the package on your local before sending to NPM.
|
|
583
|
+
```sh
|
|
584
|
+
bun run build
|
|
585
|
+
```
|
|
586
|
+
|
|
587
|
+
Since bun does not have packaging yet, use npm here: 🥲
|
|
588
|
+
```sh
|
|
589
|
+
npm pack
|
|
590
|
+
```
|
|
591
|
+
|
|
592
|
+
It'll crate like `useinsider-guido-1.0.0.tgz` file.
|
|
593
|
+
|
|
594
|
+
Move this file to your project path like: `email-fe` via:
|
|
595
|
+
```sh
|
|
596
|
+
cp useinsider-guido-1.0.0.tgz ../email-fe
|
|
597
|
+
```
|
|
598
|
+
|
|
599
|
+
Install the file to your project:
|
|
600
|
+
```sh
|
|
601
|
+
npm i ./useinsider-guido-1.0.0.tgz
|
|
602
|
+
```
|
|
603
|
+
|
|
604
|
+
Then you just need to rebuild to your project or restart the Container. 🎉
|
|
605
|
+
|
|
606
|
+
For Future, we can create a shell script for it. Feel free to help 🙃
|
|
607
|
+
|
|
608
|
+
## 📦 Build Output
|
|
609
|
+
|
|
610
|
+
The library builds to multiple formats:
|
|
611
|
+
|
|
612
|
+
- **ES Module**: `dist/library.js` (recommended)
|
|
613
|
+
- **CSS**: `dist/guido.css` (custom styles)
|
|
614
|
+
|
|
615
|
+
### Package Exports
|
|
616
|
+
|
|
617
|
+
```json
|
|
618
|
+
{
|
|
619
|
+
"exports": {
|
|
620
|
+
".": {
|
|
621
|
+
"import": "./dist/library.js",
|
|
622
|
+
"types": "./dist/components/Guido.vue.d.ts",
|
|
623
|
+
"require": "./dist/components/Guido.vue.js"
|
|
624
|
+
},
|
|
625
|
+
"./style": "./dist/guido.css"
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
```
|
|
629
|
+
|
|
630
|
+
## 🤝 Contributing
|
|
631
|
+
- PR Titles should be structured like `TASK-ID | 🔥 | Some Clear Task Descriptions`
|
|
632
|
+
- PR Labels should be filled.
|
|
633
|
+
- PR Assignee required.
|
|
634
|
+
- Tests should be covered.
|
|
635
|
+
- All required checks should be passed before sending review request.
|
|
300
636
|
|
|
301
637
|
## 📄 License
|
|
302
638
|
|
|
303
639
|
ISC License
|
|
304
640
|
|
|
305
|
-
|
|
641
|
+
---
|
|
642
|
+
|
|
643
|
+
## 🔗 Related
|
|
306
644
|
|
|
307
645
|
- [Stripo Email Editor](https://stripo.email/) - The underlying email editor
|
|
308
646
|
- [@useinsider/design-system-vue](https://github.com/useinsider/design-system-vue) - Insider's Vue design system
|
|
309
647
|
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
648
|
+
## 🎯 TODO:
|
|
649
|
+
- CSS part should be optimized with variables & `sass-loader`.
|
|
650
|
+
- Master Version Generator should be fixed.
|
|
651
|
+
- Playwright integrationBoilerplate/control.ts
|
|
652
|
+
- Commitlint & Precommit Hooks integration
|
|
653
|
+
- Get Pre-built display conditions from API
|