@useinsider/guido 1.0.3-beta.a44b7cd → 1.0.3-beta.a5608d9
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 +152 -632
- package/dist/@types/generic.d.ts +49 -0
- package/dist/{src/components → components}/Guido.vue.d.ts +3 -5
- package/dist/components/Guido.vue.js +9 -11
- package/dist/components/Guido.vue2.js +69 -81
- package/dist/components/organisms/header/LeftSlot.vue.js +1 -1
- package/dist/components/organisms/header/LeftSlot.vue2.js +15 -16
- package/dist/components/organisms/header/RightSlot.vue.js +11 -11
- package/dist/components/organisms/header/RightSlot.vue2.js +22 -23
- package/dist/components/organisms/onboarding/NewVersionPopup.vue.js +9 -9
- package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +17 -30
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +10 -12
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +20 -23
- package/dist/{src/components → components}/wrappers/WpDrawer.vue.d.ts +4 -6
- package/dist/components/wrappers/WpDrawer.vue.js +4 -6
- package/dist/composables/useActionsApi.js +1 -1
- package/dist/{src/composables → composables}/useGuidoActions.d.ts +0 -9
- package/dist/composables/useGuidoActions.js +9 -19
- package/dist/composables/useHtmlCompiler.js +13 -15
- package/dist/composables/useHtmlValidator.js +35 -36
- package/dist/composables/useStripo.js +63 -69
- package/dist/config/compiler/unsubscribeCompilerRules.js +29 -47
- package/dist/config/migrator/index.d.ts +1 -0
- package/dist/config/migrator/index.js +6 -9
- package/dist/enums/defaults.js +9 -20
- package/dist/enums/onboarding.d.ts +1 -0
- package/dist/enums/onboarding.js +2 -7
- package/dist/enums/unsubscribe.d.ts +15 -0
- package/dist/enums/unsubscribe.js +7 -46
- package/dist/{src/extensions → extensions}/Blocks/Checkbox/block.d.ts +0 -2
- package/dist/extensions/Blocks/Checkbox/block.js +24 -18
- package/dist/extensions/Blocks/Checkbox/control.js +65 -54
- package/dist/extensions/Blocks/Checkbox/extension.js +16 -5
- package/dist/extensions/Blocks/Checkbox/settingsPanel.js +25 -12
- package/dist/extensions/Blocks/Checkbox/template.d.ts +6 -0
- package/dist/extensions/Blocks/Checkbox/template.js +21 -15
- package/dist/{src/extensions → extensions}/Blocks/RadioButton/block.d.ts +0 -2
- package/dist/extensions/Blocks/RadioButton/block.js +22 -16
- package/dist/extensions/Blocks/RadioButton/control.js +52 -41
- package/dist/extensions/Blocks/RadioButton/extension.js +15 -4
- package/dist/extensions/Blocks/RadioButton/settingsPanel.js +26 -13
- package/dist/{src/extensions → extensions}/Blocks/RadioButton/template.d.ts +1 -1
- package/dist/extensions/Blocks/RadioButton/template.js +29 -27
- package/dist/{src/extensions → extensions}/Blocks/_Boilerplate/block.d.ts +0 -1
- package/dist/extensions/DynamicContent/dynamic-content-modal.d.ts +6 -0
- package/dist/extensions/DynamicContent/dynamic-content-modal.js +19 -25
- package/dist/extensions/DynamicContent/dynamic-content.d.ts +16 -0
- package/dist/extensions/DynamicContent/dynamic-content.js +44 -125
- package/dist/extensions/DynamicContent/extension.js +18 -6
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/Extension.js +75 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ExtensionBuilder.js +77 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/Block.js +123 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/AiAssistantValueType.js +7 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockCompositionType.js +7 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockName.js +12 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockType.js +7 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BuiltInControlTypes.js +119 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/ContextActionType.js +7 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/EditorStatePropertyType.js +7 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PanelPosition.js +7 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/Popover.js +12 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PreviewDeviceMode.js +7 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/SettingsTab.js +7 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementType.js +7 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementsAttributes.js +24 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/Control.js +24 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelRegistry.js +11 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelTab.js +33 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/modifications/ModificationDescription.js +22 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElement.js +40 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElementTagRegistry.js +5 -0
- package/dist/node_modules/lodash-es/_arrayLikeKeys.js +12 -13
- package/dist/node_modules/lodash-es/keysIn.js +3 -3
- package/dist/services/stripoApi.js +1 -1
- package/dist/static/styles/components/narrow-panel.css.js +0 -10
- package/dist/static/styles/customEditorStyle.css.js +0 -5
- package/dist/{src/stores → stores}/dynamic-content.d.ts +3 -3
- package/dist/stores/dynamic-content.js +2 -2
- package/dist/{src/stores → stores}/editor.d.ts +1 -22
- package/dist/stores/editor.js +2 -3
- package/dist/{src/stores → stores}/onboarding.d.ts +1 -335
- package/dist/stores/onboarding.js +36 -44
- package/dist/{src/stores → stores}/preview.d.ts +1 -1
- package/dist/stores/preview.js +1 -1
- package/dist/{src/stores → stores}/recommendation.d.ts +1 -1
- package/dist/stores/recommendation.js +3 -3
- package/dist/{src/stores → stores}/save-as-template.d.ts +1 -1
- package/dist/stores/save-as-template.js +2 -2
- package/dist/{src/stores → stores}/toaster.d.ts +1 -1
- package/dist/stores/toaster.js +1 -1
- package/dist/stores/unsubscribe.d.ts +8 -0
- package/dist/stores/unsubscribe.js +6 -126
- package/dist/{src/stores → stores}/version-history.d.ts +1 -1
- package/dist/stores/version-history.js +4 -4
- package/dist/utils/dateUtil.d.ts +1 -0
- package/dist/utils/dateUtil.js +3 -24
- package/dist/{src/utils → utils}/genericUtil.d.ts +0 -2
- package/dist/utils/genericUtil.js +6 -17
- package/dist/utils/templatePreparation.js +16 -17
- package/package.json +4 -9
- package/dist/components/organisms/extensions/recommendation/FilterItem.vue.js +0 -28
- package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +0 -38
- package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue.js +0 -17
- package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +0 -37
- package/dist/components/organisms/extensions/recommendation/Filters.vue.js +0 -20
- package/dist/components/organisms/extensions/recommendation/Filters.vue2.js +0 -44
- package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue.js +0 -17
- package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue2.js +0 -27
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +0 -21
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +0 -99
- package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.js +0 -18
- package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue2.js +0 -16
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +0 -24
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +0 -64
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +0 -18
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +0 -107
- package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.js +0 -18
- package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue2.js +0 -12
- package/dist/composables/useBlocksConfig.js +0 -48
- package/dist/config/compiler/itemsCompilerRules.js +0 -14
- package/dist/config/migrator/couponBlockMigrator.js +0 -67
- package/dist/config/migrator/recommendationMigrator.js +0 -293
- package/dist/config/migrator/unsubscribeMigrator.js +0 -124
- package/dist/enums/date.js +0 -6
- package/dist/enums/extensions/recommendationBlock.js +0 -80
- package/dist/extensions/Blocks/Checkbox/iconsRegistry.js +0 -18
- package/dist/extensions/Blocks/CouponBlock/block.js +0 -33
- package/dist/extensions/Blocks/CouponBlock/extension.js +0 -8
- package/dist/extensions/Blocks/CouponBlock/iconsRegistry.js +0 -33
- package/dist/extensions/Blocks/CouponBlock/settingsPanel.js +0 -24
- package/dist/extensions/Blocks/CouponBlock/template.js +0 -18
- package/dist/extensions/Blocks/Items/block.js +0 -67
- package/dist/extensions/Blocks/Items/controls/button/link.js +0 -68
- package/dist/extensions/Blocks/Items/controls/cardComposition.js +0 -193
- package/dist/extensions/Blocks/Items/controls/image/link.js +0 -68
- package/dist/extensions/Blocks/Items/controls/index.js +0 -217
- package/dist/extensions/Blocks/Items/controls/name/trimming.js +0 -70
- package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +0 -107
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +0 -123
- package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +0 -76
- package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +0 -61
- package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +0 -92
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +0 -316
- package/dist/extensions/Blocks/Items/enums/controlEnums.js +0 -5
- package/dist/extensions/Blocks/Items/enums/productEnums.js +0 -274
- package/dist/extensions/Blocks/Items/enums/settingsEnums.js +0 -77
- package/dist/extensions/Blocks/Items/extension.js +0 -20
- package/dist/extensions/Blocks/Items/iconsRegistry.js +0 -32
- package/dist/extensions/Blocks/Items/items.css.js +0 -23
- package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +0 -62
- package/dist/extensions/Blocks/Items/layouts/vertical.html.js +0 -72
- package/dist/extensions/Blocks/Items/settingsPanel.js +0 -132
- package/dist/extensions/Blocks/Items/store/items-block.js +0 -75
- package/dist/extensions/Blocks/Items/template.js +0 -195
- package/dist/extensions/Blocks/Items/utils/configBlockUtils.js +0 -17
- package/dist/extensions/Blocks/Items/utils/syncAttributeFromConfigBlock.js +0 -28
- package/dist/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.js +0 -76
- package/dist/extensions/Blocks/Items/utils/updateAttributes.js +0 -46
- package/dist/extensions/Blocks/RadioButton/iconsRegistry.js +0 -14
- package/dist/extensions/Blocks/Recommendation/block.js +0 -30
- package/dist/extensions/Blocks/Recommendation/cardCompositionControl.js +0 -103
- package/dist/extensions/Blocks/Recommendation/constants.js +0 -5
- package/dist/extensions/Blocks/Recommendation/control.js +0 -306
- package/dist/extensions/Blocks/Recommendation/controls/button/align.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/button/border.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/button/borderRadius.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/button/color.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/button/fitToContent.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/button/fontFamily.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/button/margins.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/button/paddings.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/button/text.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/button/textSize.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/button/textStyleAndFontColor.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/image/margins.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/image/size.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/name/align.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/name/background.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/name/color.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/name/fontFamily.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/name/paddings.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/name/size.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/name/style.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/align.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/background.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/color.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/fontFamily.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/paddings.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/size.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/style.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/price/align.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/price/background.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/price/color.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/price/fontFamily.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/price/paddings.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/price/size.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/price/style.js +0 -13
- package/dist/extensions/Blocks/Recommendation/extension.js +0 -45
- package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +0 -51
- package/dist/extensions/Blocks/Recommendation/recommendation.css.js +0 -19
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +0 -117
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +0 -266
- package/dist/extensions/Blocks/Recommendation/templates/blockTemplate.js +0 -160
- package/dist/extensions/Blocks/Recommendation/templates/migrationTemplate.js +0 -152
- package/dist/extensions/Blocks/Recommendation/templates/templateUtils.js +0 -180
- package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +0 -28
- package/dist/extensions/Blocks/Unsubscribe/block.js +0 -135
- package/dist/extensions/Blocks/Unsubscribe/control.js +0 -167
- package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +0 -42
- package/dist/extensions/Blocks/Unsubscribe/extension.js +0 -21
- package/dist/extensions/Blocks/Unsubscribe/iconsRegistry.js +0 -21
- package/dist/extensions/Blocks/Unsubscribe/settingsPanel.js +0 -35
- package/dist/extensions/Blocks/Unsubscribe/styles.css.js +0 -42
- package/dist/extensions/Blocks/Unsubscribe/tagRegistry.js +0 -10
- package/dist/extensions/Blocks/Unsubscribe/template.js +0 -22
- package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +0 -11
- package/dist/extensions/Blocks/Unsubscribe/utils/utils.js +0 -6
- package/dist/extensions/Blocks/common-control.js +0 -248
- package/dist/extensions/Blocks/controlFactories.js +0 -223
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +0 -911
- package/dist/node_modules/lodash-es/_DataView.js +0 -6
- package/dist/node_modules/lodash-es/_Promise.js +0 -6
- package/dist/node_modules/lodash-es/_Set.js +0 -6
- package/dist/node_modules/lodash-es/_SetCache.js +0 -13
- package/dist/node_modules/lodash-es/_WeakMap.js +0 -6
- package/dist/node_modules/lodash-es/_arrayFilter.js +0 -10
- package/dist/node_modules/lodash-es/_arrayMap.js +0 -8
- package/dist/node_modules/lodash-es/_arrayPush.js +0 -8
- package/dist/node_modules/lodash-es/_arraySome.js +0 -9
- package/dist/node_modules/lodash-es/_baseEach.js +0 -6
- package/dist/node_modules/lodash-es/_baseFlatten.js +0 -13
- package/dist/node_modules/lodash-es/_baseForOwn.js +0 -8
- package/dist/node_modules/lodash-es/_baseGet.js +0 -11
- package/dist/node_modules/lodash-es/_baseGetAllKeys.js +0 -9
- package/dist/node_modules/lodash-es/_baseHasIn.js +0 -6
- package/dist/node_modules/lodash-es/_baseIsEqual.js +0 -8
- package/dist/node_modules/lodash-es/_baseIsEqualDeep.js +0 -32
- package/dist/node_modules/lodash-es/_baseIsMatch.js +0 -29
- package/dist/node_modules/lodash-es/_baseIteratee.js +0 -11
- package/dist/node_modules/lodash-es/_baseKeys.js +0 -14
- package/dist/node_modules/lodash-es/_baseMap.js +0 -11
- package/dist/node_modules/lodash-es/_baseMatches.js +0 -12
- package/dist/node_modules/lodash-es/_baseMatchesProperty.js +0 -17
- package/dist/node_modules/lodash-es/_baseProperty.js +0 -8
- package/dist/node_modules/lodash-es/_basePropertyDeep.js +0 -9
- package/dist/node_modules/lodash-es/_baseRange.js +0 -9
- package/dist/node_modules/lodash-es/_baseToString.js +0 -18
- package/dist/node_modules/lodash-es/_baseTrim.js +0 -8
- package/dist/node_modules/lodash-es/_cacheHas.js +0 -6
- package/dist/node_modules/lodash-es/_castPath.js +0 -10
- package/dist/node_modules/lodash-es/_createBaseEach.js +0 -15
- package/dist/node_modules/lodash-es/_createRange.js +0 -11
- package/dist/node_modules/lodash-es/_equalArrays.js +0 -40
- package/dist/node_modules/lodash-es/_equalByTag.js +0 -45
- package/dist/node_modules/lodash-es/_equalObjects.js +0 -36
- package/dist/node_modules/lodash-es/_getAllKeys.js +0 -9
- package/dist/node_modules/lodash-es/_getMatchData.js +0 -12
- package/dist/node_modules/lodash-es/_getSymbols.js +0 -10
- package/dist/node_modules/lodash-es/_getTag.js +0 -28
- package/dist/node_modules/lodash-es/_hasPath.js +0 -19
- package/dist/node_modules/lodash-es/_isFlattenable.js +0 -10
- package/dist/node_modules/lodash-es/_isKey.js +0 -12
- package/dist/node_modules/lodash-es/_isStrictComparable.js +0 -7
- package/dist/node_modules/lodash-es/_mapToArray.js +0 -9
- package/dist/node_modules/lodash-es/_matchesStrictComparable.js +0 -8
- package/dist/node_modules/lodash-es/_memoizeCapped.js +0 -11
- package/dist/node_modules/lodash-es/_nativeKeys.js +0 -5
- package/dist/node_modules/lodash-es/_setCacheAdd.js +0 -7
- package/dist/node_modules/lodash-es/_setCacheHas.js +0 -6
- package/dist/node_modules/lodash-es/_setToArray.js +0 -9
- package/dist/node_modules/lodash-es/_stringToPath.js +0 -10
- package/dist/node_modules/lodash-es/_toKey.js +0 -10
- package/dist/node_modules/lodash-es/_trimmedEndIndex.js +0 -9
- package/dist/node_modules/lodash-es/flatMap.js +0 -8
- package/dist/node_modules/lodash-es/get.js +0 -8
- package/dist/node_modules/lodash-es/hasIn.js +0 -8
- package/dist/node_modules/lodash-es/isSymbol.js +0 -9
- package/dist/node_modules/lodash-es/keys.js +0 -9
- package/dist/node_modules/lodash-es/map.js +0 -11
- package/dist/node_modules/lodash-es/property.js +0 -10
- package/dist/node_modules/lodash-es/range.js +0 -5
- package/dist/node_modules/lodash-es/stubArray.js +0 -6
- package/dist/node_modules/lodash-es/toFinite.js +0 -14
- package/dist/node_modules/lodash-es/toNumber.js +0 -22
- package/dist/node_modules/lodash-es/toString.js +0 -7
- package/dist/package.json.js +0 -7
- package/dist/services/recommendationApi.js +0 -37
- package/dist/services/unsubscribeApi.js +0 -16
- package/dist/src/@types/generic.d.ts +0 -98
- package/dist/src/components/organisms/extensions/recommendation/FilterItem.vue.d.ts +0 -19
- package/dist/src/components/organisms/extensions/recommendation/LogicAdapter.vue.d.ts +0 -16
- package/dist/src/components/organisms/onboarding/ItemsOnboarding.vue.d.ts +0 -2
- package/dist/src/components/organisms/onboarding/NewVersionPopup.vue.d.ts +0 -4
- package/dist/src/components/organisms/onboarding/OnboardingWrapper.vue.d.ts +0 -4
- package/dist/src/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.d.ts +0 -2
- package/dist/src/components/organisms/unsubscribe/UnsubscribePageSelection.vue.d.ts +0 -2
- package/dist/src/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.d.ts +0 -2
- package/dist/src/components/organisms/unsubscribe/UnsubscribeWrapper.vue.d.ts +0 -2
- package/dist/src/composables/useBlocksConfig.d.ts +0 -11
- package/dist/src/config/compiler/itemsCompilerRules.d.ts +0 -2
- package/dist/src/config/migrator/couponBlockMigrator.d.ts +0 -1
- package/dist/src/config/migrator/index.d.ts +0 -1
- package/dist/src/config/migrator/recommendationMigrator.d.ts +0 -1
- package/dist/src/config/migrator/unsubscribeMigrator.d.ts +0 -1
- package/dist/src/enums/date.d.ts +0 -4
- package/dist/src/enums/extensions/recommendationBlock.d.ts +0 -16
- package/dist/src/enums/onboarding.d.ts +0 -6
- package/dist/src/enums/unsubscribe.d.ts +0 -38
- package/dist/src/extensions/Blocks/Checkbox/iconsRegistry.d.ts +0 -4
- package/dist/src/extensions/Blocks/Checkbox/template.d.ts +0 -6
- package/dist/src/extensions/Blocks/CouponBlock/block.d.ts +0 -12
- package/dist/src/extensions/Blocks/CouponBlock/iconsRegistry.d.ts +0 -4
- package/dist/src/extensions/Blocks/CouponBlock/settingsPanel.d.ts +0 -4
- package/dist/src/extensions/Blocks/CouponBlock/template.d.ts +0 -3
- package/dist/src/extensions/Blocks/Items/block.d.ts +0 -27
- package/dist/src/extensions/Blocks/Items/controls/button/link.d.ts +0 -14
- package/dist/src/extensions/Blocks/Items/controls/cardComposition.d.ts +0 -33
- package/dist/src/extensions/Blocks/Items/controls/image/link.d.ts +0 -14
- package/dist/src/extensions/Blocks/Items/controls/index.d.ts +0 -501
- package/dist/src/extensions/Blocks/Items/controls/name/trimming.d.ts +0 -14
- package/dist/src/extensions/Blocks/Items/controls/price/currencyLocation.d.ts +0 -19
- package/dist/src/extensions/Blocks/Items/controls/price/currencySymbol.d.ts +0 -21
- package/dist/src/extensions/Blocks/Items/controls/price/formattedPrice.d.ts +0 -14
- package/dist/src/extensions/Blocks/Items/controls/price/hideDiscount.d.ts +0 -13
- package/dist/src/extensions/Blocks/Items/controls/price/priceOrientation.d.ts +0 -15
- package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +0 -48
- package/dist/src/extensions/Blocks/Items/enums/controlEnums.d.ts +0 -62
- package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +0 -163
- package/dist/src/extensions/Blocks/Items/enums/settingsEnums.d.ts +0 -50
- package/dist/src/extensions/Blocks/Items/iconsRegistry.d.ts +0 -4
- package/dist/src/extensions/Blocks/Items/store/items-block.d.ts +0 -43
- package/dist/src/extensions/Blocks/Items/template.d.ts +0 -24
- package/dist/src/extensions/Blocks/Items/utils/configBlockUtils.d.ts +0 -23
- package/dist/src/extensions/Blocks/Items/utils/syncAttributeFromConfigBlock.d.ts +0 -32
- package/dist/src/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.d.ts +0 -50
- package/dist/src/extensions/Blocks/Items/utils/updateAttributes.d.ts +0 -8
- package/dist/src/extensions/Blocks/RadioButton/iconsRegistry.d.ts +0 -4
- package/dist/src/extensions/Blocks/Recommendation/block.d.ts +0 -11
- package/dist/src/extensions/Blocks/Recommendation/cardCompositionControl.d.ts +0 -28
- package/dist/src/extensions/Blocks/Recommendation/constants.d.ts +0 -51
- package/dist/src/extensions/Blocks/Recommendation/control.d.ts +0 -35
- package/dist/src/extensions/Blocks/Recommendation/controls/button/align.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/button/border.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/button/borderRadius.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/button/color.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/button/fitToContent.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/button/fontFamily.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/button/margins.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/button/paddings.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/button/text.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/button/textSize.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/button/textStyleAndFontColor.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/image/margins.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/image/size.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/name/align.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/name/background.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/name/color.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/name/fontFamily.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/name/paddings.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/name/size.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/name/style.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/align.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/background.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/color.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/fontFamily.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/paddings.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/size.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/style.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/price/align.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/price/background.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/price/color.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/price/fontFamily.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/price/paddings.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/price/size.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/price/style.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/extension.d.ts +0 -2
- package/dist/src/extensions/Blocks/Recommendation/iconsRegistry.d.ts +0 -4
- package/dist/src/extensions/Blocks/Recommendation/settingsPanel.d.ts +0 -4
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -555
- package/dist/src/extensions/Blocks/Recommendation/templates/blockTemplate.d.ts +0 -16
- package/dist/src/extensions/Blocks/Recommendation/templates/migrationTemplate.d.ts +0 -16
- package/dist/src/extensions/Blocks/Recommendation/templates/templateUtils.d.ts +0 -44
- package/dist/src/extensions/Blocks/Recommendation/utils/filterUtil.d.ts +0 -7
- package/dist/src/extensions/Blocks/Unsubscribe/block.d.ts +0 -31
- package/dist/src/extensions/Blocks/Unsubscribe/control.d.ts +0 -29
- package/dist/src/extensions/Blocks/Unsubscribe/elements/preview.d.ts +0 -11
- package/dist/src/extensions/Blocks/Unsubscribe/extension.d.ts +0 -2
- package/dist/src/extensions/Blocks/Unsubscribe/iconsRegistry.d.ts +0 -4
- package/dist/src/extensions/Blocks/Unsubscribe/settingsPanel.d.ts +0 -4
- package/dist/src/extensions/Blocks/Unsubscribe/tagRegistry.d.ts +0 -4
- package/dist/src/extensions/Blocks/Unsubscribe/template.d.ts +0 -12
- package/dist/src/extensions/Blocks/Unsubscribe/utils/constants.d.ts +0 -9
- package/dist/src/extensions/Blocks/Unsubscribe/utils/utils.d.ts +0 -7
- package/dist/src/extensions/Blocks/_Boilerplate/extension.d.ts +0 -2
- package/dist/src/extensions/Blocks/_Boilerplate/iconsRegistry.d.ts +0 -4
- package/dist/src/extensions/Blocks/_Boilerplate/settingsPanel.d.ts +0 -4
- package/dist/src/extensions/Blocks/common-control.d.ts +0 -124
- package/dist/src/extensions/Blocks/controlFactories.d.ts +0 -312
- package/dist/src/extensions/DynamicContent/dynamic-content-modal.d.ts +0 -13
- package/dist/src/extensions/DynamicContent/dynamic-content.d.ts +0 -66
- package/dist/src/extensions/DynamicContent/extension.d.ts +0 -2
- package/dist/src/mock/api/recommendation.d.ts +0 -2
- package/dist/src/services/recommendationApi.d.ts +0 -6
- package/dist/src/services/unsubscribeApi.d.ts +0 -4
- package/dist/src/stores/config.d.ts +0 -104
- package/dist/src/stores/unsubscribe.d.ts +0 -256
- package/dist/src/utils/dateUtil.d.ts +0 -22
- package/dist/src/utils/environmentUtil.d.ts +0 -5
- package/dist/src/utils/pairProductVariables.d.ts +0 -7
- package/dist/stores/config.js +0 -17
- package/dist/utils/environmentUtil.js +0 -4
- package/dist/utils/pairProductVariables.js +0 -136
- package/dist/{src/@types → @types}/events.d.ts +0 -0
- package/dist/{src/@types → @types}/save-as-template.d.ts +0 -0
- package/dist/{src/App.vue.d.ts → App.vue.d.ts} +0 -0
- package/dist/{src/components → components}/organisms/LoadingWrapper.vue.d.ts +0 -0
- package/dist/{src/components → components}/organisms/base/Toaster.vue.d.ts +0 -0
- package/dist/{src/components → components}/organisms/email-preview/PreviewContainer.vue.d.ts +0 -0
- package/dist/{src/components → components}/organisms/email-preview/amp/AmpErrorModal.vue.d.ts +0 -0
- package/dist/{src/components → components}/organisms/email-preview/amp/AmpToggle.vue.d.ts +0 -0
- package/dist/{src/components → components}/organisms/email-preview/desktop-preview/DesktopPreview.vue.d.ts +0 -0
- package/dist/{src/components → components}/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.d.ts +0 -0
- package/dist/{src/components → components}/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.d.ts +0 -0
- package/dist/{src/components → components}/organisms/email-preview/mobile-preview/ContentView.vue.d.ts +0 -0
- package/dist/{src/components → components}/organisms/email-preview/mobile-preview/InboxView.vue.d.ts +0 -0
- package/dist/{src/components → components}/organisms/email-preview/mobile-preview/MobilePreview.vue.d.ts +0 -0
- package/dist/{src/components → components}/organisms/header/HeaderWrapper.vue.d.ts +0 -0
- package/dist/{src/components → components}/organisms/header/LeftSlot.vue.d.ts +0 -0
- package/dist/{src/components → components}/organisms/header/MiddleSlot.vue.d.ts +0 -0
- package/dist/{src/components → components}/organisms/header/RightSlot.vue.d.ts +0 -0
- package/dist/{src/components → components}/organisms/header/ViewOptions.vue.d.ts +0 -0
- package/dist/{src/components → components}/organisms/header/version-history/RestoreButton.vue.d.ts +0 -0
- package/dist/{src/components → components}/organisms/header/version-history/VersionHistory.vue.d.ts +0 -0
- package/dist/{src/components → components}/organisms/header/version-history/VersionHistoryItem.vue.d.ts +0 -0
- package/dist/{src/components → components}/organisms/header/version-history/ViewOptions.vue.d.ts +0 -0
- package/dist/{src/components → components}/organisms/onboarding/AMPOnboarding.vue.d.ts +0 -0
- package/dist/{src/components → components}/organisms/onboarding/GenericOnboarding.vue.d.ts +0 -0
- package/dist/{src/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue.d.ts → components/organisms/onboarding/NewVersionPopup.vue.d.ts} +0 -0
- package/dist/{src/components/organisms/extensions/recommendation/Filters.vue.d.ts → components/organisms/onboarding/OnboardingWrapper.vue.d.ts} +0 -0
- package/dist/{src/components → components}/organisms/onboarding/TextBlockOnboarding.vue.d.ts +0 -0
- package/dist/{src/components → components}/organisms/onboarding/VersionHistoryOnboarding.vue.d.ts +0 -0
- package/dist/{src/components → components}/organisms/save-as-template/SaveAsTemplateDrawer.vue.d.ts +0 -0
- package/dist/{src/components → components}/wrappers/WpModal.vue.d.ts +1 -1
- /package/dist/{src/composables → composables}/useActionsApi.d.ts +0 -0
- /package/dist/{src/composables → composables}/useApiExample.d.ts +0 -0
- /package/dist/{src/composables → composables}/useCodeEditorApi.d.ts +0 -0
- /package/dist/{src/composables → composables}/useConfig.d.ts +0 -0
- /package/dist/{src/composables → composables}/useCustomInterfaceAppearance.d.ts +0 -0
- /package/dist/{src/composables → composables}/useDebounce.d.ts +0 -0
- /package/dist/{src/composables → composables}/useExport.d.ts +0 -0
- /package/dist/{src/composables → composables}/useHtmlCompiler.d.ts +0 -0
- /package/dist/{src/composables → composables}/useHtmlValidator.d.ts +0 -0
- /package/dist/{src/composables → composables}/useHttp.d.ts +0 -0
- /package/dist/{src/composables → composables}/usePartner.d.ts +0 -0
- /package/dist/{src/composables → composables}/usePreviewMode.d.ts +0 -0
- /package/dist/{src/composables → composables}/useProvideInject.d.ts +0 -0
- /package/dist/{src/composables → composables}/useRecommendation.d.ts +0 -0
- /package/dist/{src/composables → composables}/useResponsivePreview.d.ts +0 -0
- /package/dist/{src/composables → composables}/useSave.d.ts +0 -0
- /package/dist/{src/composables → composables}/useStripo.d.ts +0 -0
- /package/dist/{src/composables → composables}/useStripoEventHandler.d.ts +0 -0
- /package/dist/{src/composables → composables}/useToaster.d.ts +0 -0
- /package/dist/{src/composables → composables}/useTranslations.d.ts +0 -0
- /package/dist/{src/composables → composables}/useValidation.d.ts +0 -0
- /package/dist/{src/composables → composables}/useVersionHistoryApi.d.ts +0 -0
- /package/dist/{src/composables → composables}/validators/saveAsTemplate.d.ts +0 -0
- /package/dist/{src/config → config}/compiler/htmlCompilerRules.d.ts +0 -0
- /package/dist/{src/config → config}/compiler/outlookCompilerRules.d.ts +0 -0
- /package/dist/{src/config → config}/compiler/recommendationCompilerRules.d.ts +0 -0
- /package/dist/{src/config → config}/compiler/socialCompilerRules.d.ts +0 -0
- /package/dist/{src/config → config}/compiler/unsubscribeCompilerRules.d.ts +0 -0
- /package/dist/{src/config → config}/migrator/checkboxMigrator.d.ts +0 -0
- /package/dist/{src/config → config}/migrator/radioButtonMigrator.d.ts +0 -0
- /package/dist/{src/enums → enums}/defaults.d.ts +0 -0
- /package/dist/{src/enums → enums}/displayConditions.d.ts +0 -0
- /package/dist/{src/enums → enums}/html-validator.d.ts +0 -0
- /package/dist/{src/enums → enums}/preview.d.ts +0 -0
- /package/dist/{src/enums → enums}/recommendation.d.ts +0 -0
- /package/dist/{src/enums → enums}/toaster.d.ts +0 -0
- /package/dist/{src/extensions → extensions}/Blocks/Checkbox/control.d.ts +0 -0
- /package/dist/{src/extensions → extensions}/Blocks/Checkbox/extension.d.ts +0 -0
- /package/dist/{src/extensions → extensions}/Blocks/Checkbox/settingsPanel.d.ts +0 -0
- /package/dist/{src/extensions → extensions}/Blocks/RadioButton/control.d.ts +0 -0
- /package/dist/{src/extensions/Blocks/CouponBlock → extensions/Blocks/RadioButton}/extension.d.ts +0 -0
- /package/dist/{src/extensions → extensions}/Blocks/RadioButton/settingsPanel.d.ts +0 -0
- /package/dist/{src/extensions → extensions}/Blocks/_Boilerplate/control.d.ts +0 -0
- /package/dist/{src/extensions/Blocks/Items → extensions/Blocks/_Boilerplate}/extension.d.ts +0 -0
- /package/dist/{src/extensions/Blocks/Items → extensions/Blocks/_Boilerplate}/settingsPanel.d.ts +0 -0
- /package/dist/{src/extensions → extensions}/Blocks/_Boilerplate/template.d.ts +0 -0
- /package/dist/{src/extensions/Blocks/RadioButton → extensions/DynamicContent}/extension.d.ts +0 -0
- /package/dist/{src/library.d.ts → library.d.ts} +0 -0
- /package/dist/{src/main.d.ts → main.d.ts} +0 -0
- /package/dist/{src/mock → mock}/api/auth.d.ts +0 -0
- /package/dist/{src/mock → mock}/api/custom-fonts.d.ts +0 -0
- /package/dist/{src/mock → mock}/api/default-template.d.ts +0 -0
- /package/dist/{src/mock → mock}/api/template-library.d.ts +0 -0
- /package/dist/{src/mock → mock}/api/unsubscribe.d.ts +0 -0
- /package/dist/{src/mock → mock}/api/user-modal-state.d.ts +0 -0
- /package/dist/{src/mock → mock}/api/validator.d.ts +0 -0
- /package/dist/{src/mock → mock}/browser.d.ts +0 -0
- /package/dist/{src/mock → mock}/handlers.d.ts +0 -0
- /package/dist/{src/services → services}/onboardingApi.d.ts +0 -0
- /package/dist/{src/services → services}/stripoApi.d.ts +0 -0
- /package/dist/{src/services → services}/templateLibraryApi.d.ts +0 -0
- /package/dist/{src/utils → utils}/arrayUtil.d.ts +0 -0
- /package/dist/{src/utils → utils}/base64.d.ts +0 -0
- /package/dist/{src/utils → utils}/htmlCompiler.d.ts +0 -0
- /package/dist/{src/utils → utils}/templatePreparation.d.ts +0 -0
- /package/dist/{src/utils → utils}/tooltipUtils.d.ts +0 -0
package/README.md
CHANGED
|
@@ -4,789 +4,309 @@
|
|
|
4
4
|
</a>
|
|
5
5
|
</p>
|
|
6
6
|
|
|
7
|
-
|
|
8
7
|
# @useinsider/guido
|
|
9
8
|
|
|
10
9
|
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.
|
|
11
10
|
|
|
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
|
+
|
|
12
30
|
## 📦 Install
|
|
13
31
|
|
|
14
32
|
```bash
|
|
15
33
|
npm install @useinsider/guido
|
|
16
34
|
```
|
|
35
|
+
|
|
36
|
+
Or using bun:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
bun add @useinsider/guido
|
|
40
|
+
```
|
|
41
|
+
|
|
17
42
|
### Prerequisites
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
43
|
+
|
|
44
|
+
**Required:** Your project must have `pinia` installed.
|
|
45
|
+
|
|
46
|
+
**Bundler Configuration** (required for proper module sharing):
|
|
47
|
+
|
|
48
|
+
<details>
|
|
49
|
+
<summary>Webpack Configuration</summary>
|
|
50
|
+
|
|
51
|
+
```js
|
|
52
|
+
// webpack.config.js or vue.config.js
|
|
53
|
+
{
|
|
27
54
|
shared: {
|
|
28
55
|
vue: { singleton: true },
|
|
29
56
|
pinia: { singleton: true },
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
</details>
|
|
61
|
+
|
|
62
|
+
<details>
|
|
63
|
+
<summary>Vite Configuration</summary>
|
|
33
64
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
// ... Previous Configs
|
|
65
|
+
```js
|
|
66
|
+
// vite.config.js
|
|
67
|
+
{
|
|
38
68
|
resolve: {
|
|
39
69
|
dedupe: ['vue', 'pinia'],
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
## 🚀 Usage
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
</details>
|
|
45
74
|
|
|
46
|
-
|
|
75
|
+
---
|
|
76
|
+
## 🚀 Quick Start
|
|
47
77
|
|
|
48
|
-
```
|
|
78
|
+
```vue
|
|
49
79
|
<template>
|
|
50
|
-
<
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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>
|
|
80
|
+
<Guido
|
|
81
|
+
ref="guidoEditor"
|
|
82
|
+
:template-id="templateId"
|
|
83
|
+
:user-id="userId"
|
|
84
|
+
:guido-config="guidoConfig"
|
|
85
|
+
@save:complete="handleSave"
|
|
86
|
+
/>
|
|
65
87
|
</template>
|
|
66
88
|
|
|
67
89
|
<script lang="ts">
|
|
68
90
|
import { Guido } from '@useinsider/guido';
|
|
91
|
+
import '@useinsider/guido/style';
|
|
69
92
|
|
|
70
93
|
export default {
|
|
71
|
-
components: {
|
|
72
|
-
|
|
73
|
-
},
|
|
94
|
+
components: { Guido },
|
|
95
|
+
|
|
74
96
|
data() {
|
|
75
97
|
return {
|
|
76
98
|
templateId: 'template-123',
|
|
77
99
|
userId: 'user-456',
|
|
78
|
-
migrationDate: 1699488000,
|
|
79
|
-
initialHtml: '<p>Initial HTML content</p>',
|
|
80
|
-
initialCss: 'p { color: #333; }',
|
|
81
100
|
guidoConfig: {
|
|
82
101
|
translationsPath: 'window.trans.en',
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
102
|
+
useHeader: true,
|
|
103
|
+
emailHeader: {
|
|
104
|
+
senderName: 'Your Company',
|
|
105
|
+
subject: 'Email Subject'
|
|
106
|
+
},
|
|
107
|
+
partner: {
|
|
108
|
+
partnerName: 'your-partner',
|
|
109
|
+
productType: 1,
|
|
110
|
+
messageType: 1
|
|
111
|
+
},
|
|
86
112
|
features: {
|
|
87
113
|
dynamicContent: true,
|
|
88
114
|
saveAsTemplate: true,
|
|
89
|
-
versionHistory: true
|
|
90
|
-
testMessage: true
|
|
115
|
+
versionHistory: true
|
|
91
116
|
}
|
|
92
|
-
}
|
|
93
|
-
dynamicContentModalVisible: false
|
|
117
|
+
}
|
|
94
118
|
};
|
|
95
119
|
},
|
|
96
120
|
|
|
97
121
|
methods: {
|
|
98
|
-
|
|
99
|
-
console.log('
|
|
100
|
-
this.dynamicContentModalVisible = true;
|
|
101
|
-
},
|
|
102
|
-
|
|
103
|
-
handleBack() {
|
|
104
|
-
console.log('User clicked back button');
|
|
105
|
-
// Handle navigation back
|
|
106
|
-
},
|
|
107
|
-
|
|
108
|
-
handleSaveStart() {
|
|
109
|
-
console.log('Save process started');
|
|
110
|
-
// Show loading indicator
|
|
111
|
-
},
|
|
112
|
-
|
|
113
|
-
handleSaveComplete(template) {
|
|
114
|
-
console.log('Save completed:', template);
|
|
115
|
-
// Handle saved template data
|
|
116
|
-
},
|
|
117
|
-
|
|
118
|
-
// ⚠️ Your own Dynamic Content Modal should have this id: #guido-dynamic-content-modal
|
|
119
|
-
handleDynamicContentInsert() {
|
|
120
|
-
this.$refs.guidoEditor?.dynamicContent.insert({
|
|
121
|
-
text: 'Display Text',
|
|
122
|
-
value: 'actual-value',
|
|
123
|
-
fallback: 'Fallback Text'
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
this.dynamicContentModalVisible = false;
|
|
127
|
-
},
|
|
128
|
-
|
|
129
|
-
// ⚠️ It's mandatory. There is no way to understand if user closes the modal without selection.
|
|
130
|
-
handleDynamicContentClose() {
|
|
131
|
-
this.$refs.guidoEditor?.dynamicContent.close();
|
|
132
|
-
},
|
|
133
|
-
|
|
134
|
-
// If you need to trigger save manually like leave modal cases, you can use this method.
|
|
135
|
-
save () {
|
|
136
|
-
this.$refs.guidoEditor?.saveSilent();
|
|
122
|
+
handleSave(template) {
|
|
123
|
+
console.log('Template saved:', template);
|
|
137
124
|
}
|
|
138
125
|
}
|
|
139
126
|
};
|
|
140
127
|
</script>
|
|
141
128
|
```
|
|
142
129
|
|
|
143
|
-
|
|
130
|
+
> For complete usage examples including dynamic content, see the [Getting Started Guide](./wiki/Getting-Started.md)
|
|
131
|
+
|
|
132
|
+
## 📚 API Quick Reference
|
|
144
133
|
|
|
145
|
-
###
|
|
134
|
+
### Props
|
|
146
135
|
|
|
147
|
-
| Prop | Type | Required |
|
|
148
|
-
|
|
149
|
-
| `templateId` | `string` | ✅ |
|
|
150
|
-
| `userId` | `string` | ✅ |
|
|
151
|
-
| `guidoConfig` | `GuidoConfig` | ✅ |
|
|
152
|
-
| `
|
|
153
|
-
| `
|
|
154
|
-
| `productType` | `string` | ⚪ | From URL path | Product type identifier |
|
|
155
|
-
| `username` | `string` | ⚪ | `'Guido User'` | Display name for the user |
|
|
156
|
-
| `html` | `string` | ⚪ | `''` | Initial HTML content for the template |
|
|
157
|
-
| `css` | `string` | ⚪ | `''` | Initial CSS styles for the template |
|
|
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
|
+
| `html` | `string` | ⚪ | Initial HTML content |
|
|
142
|
+
| `css` | `string` | ⚪ | Initial CSS styles |
|
|
158
143
|
|
|
159
|
-
###
|
|
144
|
+
### Events
|
|
160
145
|
|
|
161
146
|
| Event | Payload | Description |
|
|
162
147
|
|-------|---------|-------------|
|
|
163
|
-
| `
|
|
164
|
-
| `
|
|
165
|
-
| `
|
|
166
|
-
| `
|
|
167
|
-
| `
|
|
168
|
-
| `
|
|
169
|
-
| `onboarding-finished` | void | Fired when the onboarding popup is dismissed or completed, allowing parent applications to track onboarding state |
|
|
170
|
-
| `test-email:click` | - | Fired when user clicks the test email button in the header |
|
|
171
|
-
|
|
172
|
-
### Guido Exposed Methods
|
|
173
|
-
```typescript
|
|
174
|
-
dynamicContent.insert(DynamicContent);
|
|
175
|
-
dynamicContent.close();
|
|
176
|
-
saveSilent();
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
### Guido Interfaces
|
|
180
|
-
|
|
181
|
-
```typescript
|
|
182
|
-
interface GuidoConfig {
|
|
183
|
-
translationsPath: string;
|
|
184
|
-
htmlCompilerRules?: CompilerRule[];
|
|
185
|
-
ignoreDefaultHtmlCompilerRules?: boolean;
|
|
186
|
-
useHeader: boolean
|
|
187
|
-
emailHeader: {
|
|
188
|
-
senderName: string;
|
|
189
|
-
subject: string;
|
|
190
|
-
};
|
|
191
|
-
partner: {
|
|
192
|
-
partnerName: string;
|
|
193
|
-
productType: number;
|
|
194
|
-
messageType: number;
|
|
195
|
-
};
|
|
196
|
-
features: {
|
|
197
|
-
dynamicContent: boolean;
|
|
198
|
-
saveAsTemplate: boolean;
|
|
199
|
-
versionHistory: boolean;
|
|
200
|
-
testMessage: boolean;
|
|
201
|
-
displayConditions: boolean;
|
|
202
|
-
};
|
|
203
|
-
blocks?: {
|
|
204
|
-
excludeDefaults?: GuidoBlockType[];
|
|
205
|
-
includeCustoms?: GuidoCustomBlockType[];
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
| Property | Type | Default | Description |
|
|
211
|
-
|----------|------|---------|-------------|
|
|
212
|
-
| `translationsPath` | `string` | `'window.trans.en'` | JavaScript path to the translations object |
|
|
213
|
-
| `htmlCompilerRules` | `CompilerRule[]` | `[]` | Additional compiler rules to apply to HTML content. See [HTML Compiler Rules](#-html-compiler-rules) section below |
|
|
214
|
-
| `ignoreDefaultHtmlCompilerRules` | `boolean` | `false` | Skip default compiler rules and only use custom rules. Default rules: `src/config/compiler/htmlCompilerRules.ts` |
|
|
215
|
-
| `useHeader` | `boolean` | `true` | Adds extra spaces to height for adjusting. If you don't use Inone Page header, override as `false` |
|
|
216
|
-
| `features` | `Features` | `{ dynamicContent: true, saveAsTemplate: true, versionHistory: true }` | Feature flags to enable/disable editor functionality |
|
|
217
|
-
| `features.dynamicContent` | `boolean` | `true` | Enable dynamic content insertion feature |
|
|
218
|
-
| `features.saveAsTemplate` | `boolean` | `true` | Enable save as template feature |
|
|
219
|
-
| `features.versionHistory` | `boolean` | `true` | Enable version history feature |
|
|
220
|
-
| `features.displayConditions` | `boolean` | `true` | Enable display conditions |
|
|
221
|
-
| `blocks` | `BlocksConfig` | `{ excludeDefaults: [], includeCustoms: [] }` | Block configuration for excluding default blocks and including custom blocks. See [Blocks Configuration](#-blocks-configuration) section below |
|
|
222
|
-
| `blocks.excludeDefaults` | `GuidoBlockType[]` | `[]` | Array of default Stripo blocks to exclude from the editor |
|
|
223
|
-
| `blocks.includeCustoms` | `GuidoCustomBlockType[]` | `[]` | Array of custom blocks to include in the editor |
|
|
224
|
-
|
|
225
|
-
```typescript
|
|
226
|
-
interface DynamicContent {
|
|
227
|
-
value: string;
|
|
228
|
-
text: string;
|
|
229
|
-
fallback?: string;
|
|
230
|
-
}
|
|
231
|
-
```
|
|
232
|
-
---
|
|
233
|
-
|
|
234
|
-
| Property | Type | Default | Description |
|
|
235
|
-
|----------|------|---------|-------------|
|
|
236
|
-
| `value` | `string` | '' | Value of the dynamic content |
|
|
237
|
-
| `text` | `string` | '' | Visible value of the dynamic content |
|
|
238
|
-
| `fallback?` | `string` | '' | Fallback value of the dynamic content. Optional |
|
|
239
|
-
|
|
240
|
-
## 🧱 Blocks Configuration
|
|
241
|
-
|
|
242
|
-
Guido allows you to customize which blocks are available in the editor. You can exclude default Stripo blocks and selectively include custom blocks to create tailored editing experiences for different product types.
|
|
243
|
-
|
|
244
|
-
### Block Types
|
|
245
|
-
|
|
246
|
-
#### Default Blocks (GuidoBlockType)
|
|
247
|
-
|
|
248
|
-
These are the standard Stripo email editor blocks that can be excluded:
|
|
148
|
+
| `save:complete` | `Template` | Fired when template is saved |
|
|
149
|
+
| `save:start` | - | Fired when save begins |
|
|
150
|
+
| `dynamic-content:open` | `DynamicContent \| null` | Dynamic content requested |
|
|
151
|
+
| `back` | - | Back button clicked |
|
|
152
|
+
| `ready` | - | Editor is ready |
|
|
153
|
+
| `on-change` | - | Template content changed |
|
|
249
154
|
|
|
250
|
-
|
|
251
|
-
type GuidoBlockType =
|
|
252
|
-
| 'amp-accordion' // AMP accordion component
|
|
253
|
-
| 'amp-carousel' // AMP image carousel
|
|
254
|
-
| 'amp-form-controls' // AMP form elements
|
|
255
|
-
| 'banner-block' // Banner/hero section
|
|
256
|
-
| 'button-block' // Call-to-action buttons
|
|
257
|
-
| 'html-block' // Custom HTML
|
|
258
|
-
| 'image-block' // Image elements
|
|
259
|
-
| 'menu-block' // Navigation menu
|
|
260
|
-
| 'social-block' // Social media links
|
|
261
|
-
| 'spacer-block' // Vertical spacing
|
|
262
|
-
| 'text-block' // Text content
|
|
263
|
-
| 'timer-block' // Countdown timer
|
|
264
|
-
| 'video-block' // Video embeds
|
|
265
|
-
```
|
|
266
|
-
|
|
267
|
-
#### Custom Blocks (GuidoCustomBlockType)
|
|
268
|
-
|
|
269
|
-
These are custom blocks that can be selectively included:
|
|
270
|
-
|
|
271
|
-
```typescript
|
|
272
|
-
type GuidoCustomBlockType =
|
|
273
|
-
| 'dynamic-content' // Dynamic content merge tags
|
|
274
|
-
| 'checkbox-block' // Checkbox form input
|
|
275
|
-
| 'radio-button-block' // Radio button form input
|
|
276
|
-
| 'recommendation-block' // Product recommendations
|
|
277
|
-
| 'unsubscribe-block' // Unsubscribe link
|
|
278
|
-
| 'coupon-block' // Coupon/promo code
|
|
279
|
-
| 'items-block' // Cart items display
|
|
280
|
-
```
|
|
281
|
-
|
|
282
|
-
### Configuration Examples
|
|
283
|
-
|
|
284
|
-
#### Example 1: Exclude Specific Default Blocks
|
|
285
|
-
|
|
286
|
-
Disable button, image, and video blocks while keeping all custom blocks:
|
|
287
|
-
|
|
288
|
-
```typescript
|
|
289
|
-
const guidoConfig = {
|
|
290
|
-
translationsPath: 'window.trans.en',
|
|
291
|
-
features: {
|
|
292
|
-
dynamicContent: true,
|
|
293
|
-
saveAsTemplate: true,
|
|
294
|
-
versionHistory: true,
|
|
295
|
-
testMessage: true
|
|
296
|
-
},
|
|
297
|
-
blocks: {
|
|
298
|
-
excludeDefaults: ['button-block', 'image-block', 'video-block']
|
|
299
|
-
}
|
|
300
|
-
};
|
|
301
|
-
```
|
|
302
|
-
|
|
303
|
-
**Result:**
|
|
304
|
-
- Button, Image, Video blocks disabled
|
|
305
|
-
- All other default blocks enabled
|
|
306
|
-
- All custom blocks are disabled.
|
|
307
|
-
|
|
308
|
-
#### Example 2: Include Only Specific Custom Blocks
|
|
309
|
-
|
|
310
|
-
Enable only coupon and recommendation blocks:
|
|
311
|
-
|
|
312
|
-
```typescript
|
|
313
|
-
const guidoConfig = {
|
|
314
|
-
translationsPath: 'window.trans.en',
|
|
315
|
-
features: {
|
|
316
|
-
dynamicContent: true,
|
|
317
|
-
saveAsTemplate: true,
|
|
318
|
-
versionHistory: true,
|
|
319
|
-
testMessage: true
|
|
320
|
-
},
|
|
321
|
-
blocks: {
|
|
322
|
-
includeCustoms: ['coupon-block', 'recommendation-block']
|
|
323
|
-
}
|
|
324
|
-
};
|
|
325
|
-
```
|
|
326
|
-
|
|
327
|
-
**Result:**
|
|
328
|
-
- All default blocks enabled
|
|
329
|
-
- Only Coupon and Recommendation extensions enabled.
|
|
330
|
-
- Other custom blocks are disabled
|
|
331
|
-
|
|
332
|
-
### Default Behavior
|
|
333
|
-
|
|
334
|
-
When `blocks` is not provided or is `undefined`:
|
|
155
|
+
### Exposed Methods
|
|
335
156
|
|
|
336
157
|
```typescript
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
features: {
|
|
340
|
-
dynamicContent: true,
|
|
341
|
-
saveAsTemplate: true,
|
|
342
|
-
versionHistory: true,
|
|
343
|
-
testMessage: true
|
|
344
|
-
},
|
|
345
|
-
// No blocks config
|
|
346
|
-
};
|
|
347
|
-
```
|
|
348
|
-
|
|
349
|
-
**Result:**
|
|
350
|
-
- All 13 default Stripo blocks enabled
|
|
351
|
-
- All custom blocks are disabled.
|
|
158
|
+
// Insert dynamic content
|
|
159
|
+
this.$refs.guidoEditor?.dynamicContent.insert({ value, text, fallback });
|
|
352
160
|
|
|
353
|
-
|
|
161
|
+
// Close dynamic content modal
|
|
162
|
+
this.$refs.guidoEditor?.dynamicContent.close();
|
|
354
163
|
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
excludeDefaults?: GuidoBlockType[];
|
|
358
|
-
includeCustoms?: GuidoCustomBlockType[];
|
|
359
|
-
}
|
|
164
|
+
// Silent save (no notifications)
|
|
165
|
+
this.$refs.guidoEditor?.saveSilent();
|
|
360
166
|
```
|
|
361
167
|
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
The library exports the following TypeScript types:
|
|
365
|
-
|
|
366
|
-
```typescript
|
|
367
|
-
// Main component
|
|
368
|
-
import { Guido } from '@useinsider/guido';
|
|
369
|
-
|
|
370
|
-
// Types
|
|
371
|
-
import type { GuidoConfig } from '@useinsider/guido';
|
|
372
|
-
import type { StripoEventType } from '@useinsider/guido';
|
|
373
|
-
```
|
|
168
|
+
> For complete API documentation, see [API Reference](./wiki/API-Reference.md)
|
|
374
169
|
|
|
375
170
|
## 🔨 HTML Compiler Rules
|
|
376
171
|
|
|
377
|
-
|
|
172
|
+
Transform HTML content with custom rules before saving. Supports 4 rule types:
|
|
378
173
|
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
There are 4 types of compiler rules:
|
|
382
|
-
|
|
383
|
-
#### 1. Replace Rule
|
|
384
|
-
Replace specific strings in HTML content.
|
|
174
|
+
<details>
|
|
175
|
+
<summary><b>1. Replace Rule</b> - String replacement</summary>
|
|
385
176
|
|
|
386
177
|
```typescript
|
|
387
178
|
{
|
|
388
179
|
id: 'fix-encoding',
|
|
389
|
-
description: 'Fix URL encoding issues',
|
|
390
180
|
type: 'replace',
|
|
391
|
-
search: '{%22',
|
|
392
|
-
replacement: '%7B%22',
|
|
393
|
-
|
|
394
|
-
priority: 10 // Execution priority (lower = earlier)
|
|
181
|
+
search: '{%22',
|
|
182
|
+
replacement: '%7B%22',
|
|
183
|
+
priority: 10
|
|
395
184
|
}
|
|
396
185
|
```
|
|
186
|
+
</details>
|
|
397
187
|
|
|
398
|
-
|
|
399
|
-
|
|
188
|
+
<details>
|
|
189
|
+
<summary><b>2. Regex Rule</b> - Pattern matching</summary>
|
|
400
190
|
|
|
401
191
|
```typescript
|
|
402
192
|
{
|
|
403
193
|
id: 'remove-comments',
|
|
404
|
-
description: 'Remove HTML comments',
|
|
405
194
|
type: 'regex',
|
|
406
|
-
pattern: '<!--.*?-->',
|
|
407
|
-
replacement: '',
|
|
408
|
-
flags: 'g',
|
|
195
|
+
pattern: '<!--.*?-->',
|
|
196
|
+
replacement: '',
|
|
197
|
+
flags: 'g',
|
|
409
198
|
priority: 20
|
|
410
199
|
}
|
|
411
200
|
```
|
|
201
|
+
</details>
|
|
412
202
|
|
|
413
|
-
|
|
414
|
-
Remove
|
|
203
|
+
<details>
|
|
204
|
+
<summary><b>3. Remove Rule</b> - Remove content</summary>
|
|
415
205
|
|
|
416
206
|
```typescript
|
|
417
207
|
{
|
|
418
208
|
id: 'cleanup-scripts',
|
|
419
|
-
description: 'Remove unwanted script tags',
|
|
420
209
|
type: 'remove',
|
|
421
|
-
targets: [
|
|
210
|
+
targets: [
|
|
422
211
|
'<script src="unwanted.js"></script>',
|
|
423
212
|
/onclick="[^"]*"/g
|
|
424
213
|
],
|
|
425
214
|
priority: 30
|
|
426
215
|
}
|
|
427
216
|
```
|
|
217
|
+
</details>
|
|
428
218
|
|
|
429
|
-
|
|
430
|
-
|
|
219
|
+
<details>
|
|
220
|
+
<summary><b>4. Custom Rule</b> - Custom processor</summary>
|
|
431
221
|
|
|
432
222
|
```typescript
|
|
433
223
|
{
|
|
434
224
|
id: 'add-meta-tags',
|
|
435
|
-
description: 'Add custom meta tags to head',
|
|
436
225
|
type: 'custom',
|
|
437
226
|
processor: (html: string): string => {
|
|
438
|
-
// Custom transformation logic
|
|
439
227
|
const metaTags = '<meta name="custom" content="value">';
|
|
440
228
|
return html.replace('</head>', `${metaTags}</head>`);
|
|
441
229
|
},
|
|
442
230
|
priority: 40
|
|
443
231
|
}
|
|
444
232
|
```
|
|
233
|
+
</details>
|
|
445
234
|
|
|
446
|
-
###
|
|
447
|
-
|
|
448
|
-
#### Basic Usage with Custom Rules
|
|
235
|
+
### Quick Example
|
|
449
236
|
|
|
450
237
|
```typescript
|
|
451
238
|
const guidoConfig = {
|
|
452
|
-
translationsPath: 'window.trans.en',
|
|
453
|
-
features: {
|
|
454
|
-
dynamicContent: true,
|
|
455
|
-
saveAsTemplate: true,
|
|
456
|
-
versionHistory: false, // Disable version history
|
|
457
|
-
testMessage: true
|
|
458
|
-
},
|
|
459
239
|
htmlCompilerRules: [
|
|
460
240
|
{
|
|
461
241
|
id: 'replace-domain',
|
|
462
|
-
description: 'Replace old domain with new one',
|
|
463
242
|
type: 'replace',
|
|
464
243
|
search: 'old-domain.com',
|
|
465
244
|
replacement: 'new-domain.com',
|
|
466
|
-
replaceAll: true,
|
|
467
245
|
priority: 10
|
|
468
|
-
},
|
|
469
|
-
{
|
|
470
|
-
id: 'remove-tracking',
|
|
471
|
-
description: 'Remove tracking pixels',
|
|
472
|
-
type: 'regex',
|
|
473
|
-
pattern: '<img[^>]*tracking[^>]*>',
|
|
474
|
-
replacement: '',
|
|
475
|
-
flags: 'gi',
|
|
476
|
-
priority: 20
|
|
477
|
-
}
|
|
478
|
-
]
|
|
479
|
-
};
|
|
480
|
-
```
|
|
481
|
-
|
|
482
|
-
#### Ignoring Default Rules
|
|
483
|
-
|
|
484
|
-
```typescript
|
|
485
|
-
const guidoConfig = {
|
|
486
|
-
translationsPath: 'window.trans.en',
|
|
487
|
-
features: {
|
|
488
|
-
dynamicContent: true,
|
|
489
|
-
saveAsTemplate: true,
|
|
490
|
-
versionHistory: true,
|
|
491
|
-
testMessage: true
|
|
492
|
-
},
|
|
493
|
-
ignoreDefaultHtmlCompilerRules: true, // Skip all default rules
|
|
494
|
-
htmlCompilerRules: [
|
|
495
|
-
// Only your custom rules will be applied
|
|
496
|
-
{
|
|
497
|
-
id: 'custom-transformation',
|
|
498
|
-
type: 'replace',
|
|
499
|
-
search: 'old-text',
|
|
500
|
-
replacement: 'new-text',
|
|
501
|
-
priority: 1
|
|
502
246
|
}
|
|
503
247
|
]
|
|
504
248
|
};
|
|
505
249
|
```
|
|
506
250
|
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
Rules are executed in priority order (lower numbers first). Rules with the same priority are executed in array order.
|
|
510
|
-
|
|
511
|
-
- **Priority 1-99**: Reserved for critical transformations
|
|
512
|
-
- **Priority 100-999**: Standard transformations
|
|
513
|
-
- **Priority 1000+**: Additional custom rules (automatically assigned)
|
|
514
|
-
|
|
515
|
-
### Default Rules
|
|
516
|
-
|
|
517
|
-
Guido includes several default rules for common email HTML optimizations:
|
|
518
|
-
|
|
519
|
-
- **URL encoding fixes**: Fixes malformed URL encoding in dynamic content
|
|
520
|
-
- **Template tag restoration**: Restores `{{}}` template tags that got URL encoded
|
|
521
|
-
- **HTML entity decoding**: Converts `<` and `>` back to `<` and `>`
|
|
522
|
-
- **Cleanup rules**: Removes unwanted iframe and style elements
|
|
523
|
-
- **MSO conditions**: Manages Outlook-specific conditional comments
|
|
524
|
-
- **Domain replacement**: Updates old image domains to current ones
|
|
525
|
-
|
|
526
|
-
You can view all default rules in: `src/config/compiler/htmlCompilerRules.ts`
|
|
527
|
-
|
|
528
|
-
### CompilerRule Interface
|
|
529
|
-
|
|
530
|
-
```typescript
|
|
531
|
-
type CompilerRuleType = 'replace' | 'regex' | 'remove' | 'custom';
|
|
532
|
-
|
|
533
|
-
interface BaseCompilerRule {
|
|
534
|
-
id: string;
|
|
535
|
-
description?: string;
|
|
536
|
-
priority: number;
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
interface ReplaceRule extends BaseCompilerRule {
|
|
540
|
-
type: 'replace';
|
|
541
|
-
search: string;
|
|
542
|
-
replacement: string;
|
|
543
|
-
replaceAll?: boolean; // Default: true
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
interface RegexRule extends BaseCompilerRule {
|
|
547
|
-
type: 'regex';
|
|
548
|
-
pattern: string;
|
|
549
|
-
replacement: string;
|
|
550
|
-
flags?: string; // Default: 'g'
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
interface RemoveRule extends BaseCompilerRule {
|
|
554
|
-
type: 'remove';
|
|
555
|
-
targets: (string | RegExp)[]; // Array of strings or RegExp objects
|
|
556
|
-
}
|
|
557
|
-
|
|
558
|
-
interface CustomRule extends BaseCompilerRule {
|
|
559
|
-
type: 'custom';
|
|
560
|
-
processor: (html: string) => string;
|
|
561
|
-
}
|
|
562
|
-
|
|
563
|
-
type CompilerRule = ReplaceRule | RegexRule | RemoveRule | CustomRule;
|
|
564
|
-
```
|
|
251
|
+
> For comprehensive compiler rules documentation, see [HTML Compiler Rules Guide](./wiki/HTML-Compiler-Rules.md)
|
|
565
252
|
|
|
566
253
|
---
|
|
567
254
|
|
|
568
255
|
## 🔧 Development
|
|
569
256
|
|
|
570
|
-
###
|
|
571
|
-
|
|
572
|
-
- 🧄 `Bun` (strongly recommended)
|
|
573
|
-
or
|
|
574
|
-
- NodeJS 18+ & `npm`
|
|
575
|
-
|
|
576
|
-
### Setup
|
|
257
|
+
### Quick Commands
|
|
577
258
|
|
|
578
259
|
```bash
|
|
579
260
|
# Install dependencies
|
|
580
261
|
bun install
|
|
581
262
|
|
|
582
|
-
# Start
|
|
263
|
+
# Start dev server (localhost:3000)
|
|
583
264
|
bun start
|
|
584
265
|
|
|
585
|
-
# Build
|
|
266
|
+
# Build library
|
|
586
267
|
bun run build
|
|
587
268
|
|
|
588
|
-
#
|
|
589
|
-
bun run type-check
|
|
590
|
-
|
|
591
|
-
# Linting
|
|
269
|
+
# Run linting & type checking
|
|
592
270
|
bun run lint
|
|
593
271
|
```
|
|
594
272
|
|
|
595
|
-
###
|
|
596
|
-
|
|
597
|
-
Create a `.env` file with the following variables: (You can get env variables from your senior)
|
|
598
|
-
|
|
599
|
-
```env
|
|
600
|
-
VITE_STRIPO_PLUGIN_ID=your_plugin_id
|
|
601
|
-
VITE_STRIPO_SECRET_KEY=your_secret_key
|
|
602
|
-
VITE_STRIPO_ROLE=your_role
|
|
603
|
-
|
|
604
|
-
# Playwright Test Configuration (Optional - for local debugging only)
|
|
605
|
-
HEADED=false # Set to 'true' to run tests with visible browser
|
|
606
|
-
```
|
|
607
|
-
|
|
608
|
-
### Project Structure
|
|
609
|
-
|
|
610
|
-
```
|
|
611
|
-
src/
|
|
612
|
-
├── components/ # Vue components
|
|
613
|
-
├── composables/ # Vue composables & business logic
|
|
614
|
-
├── services/ # API layer
|
|
615
|
-
├── stores/ # State management
|
|
616
|
-
├── @types/ # TypeScript definitions
|
|
617
|
-
├── static/ # Static assets & templates
|
|
618
|
-
├── utils/ # Utility functions
|
|
619
|
-
├── enums/ # Constants & enums
|
|
620
|
-
├── mock/ # Mock data for development
|
|
621
|
-
├── plugins/ # Vue plugins
|
|
622
|
-
└── library.ts # Main export
|
|
623
|
-
```
|
|
624
|
-
|
|
625
|
-
## 🔌 Provide/Inject Utilities
|
|
626
|
-
|
|
627
|
-
Guido includes type-safe utilities for Vue's provide/inject system to facilitate dependency injection between components.
|
|
628
|
-
|
|
629
|
-
### useProvideInject
|
|
630
|
-
|
|
631
|
-
The `useProvideInject` composable provides two helper functions for type-safe dependency injection:
|
|
632
|
-
|
|
633
|
-
#### Basic Usage
|
|
634
|
-
|
|
635
|
-
```typescript
|
|
636
|
-
// Parent component
|
|
637
|
-
import { provideValue } from '@useinsider/guido';
|
|
638
|
-
import { InjectionKey } from 'vue';
|
|
639
|
-
|
|
640
|
-
// Define a typed injection key
|
|
641
|
-
const MyServiceKey: InjectionKey<MyService> = Symbol('MyService');
|
|
642
|
-
|
|
643
|
-
// Provide the value
|
|
644
|
-
const myService = new MyService();
|
|
645
|
-
provideValue(MyServiceKey, myService);
|
|
646
|
-
|
|
647
|
-
// Child component
|
|
648
|
-
import { useInjectedValue } from '@useinsider/guido';
|
|
649
|
-
|
|
650
|
-
// Inject the value with type safety
|
|
651
|
-
const myService = useInjectedValue(MyServiceKey);
|
|
652
|
-
```
|
|
653
|
-
|
|
654
|
-
#### With Default Value
|
|
655
|
-
|
|
656
|
-
```typescript
|
|
657
|
-
// Inject with a fallback value
|
|
658
|
-
const myService = useInjectedValue(MyServiceKey, new DefaultService());
|
|
659
|
-
```
|
|
660
|
-
|
|
661
|
-
#### Error Handling
|
|
662
|
-
|
|
663
|
-
The `useInjectedValue` function will throw a descriptive error if no provider is found and no default value is provided:
|
|
664
|
-
|
|
665
|
-
```typescript
|
|
666
|
-
// This will throw an error if no provider exists
|
|
667
|
-
try {
|
|
668
|
-
const myService = useInjectedValue(MyServiceKey);
|
|
669
|
-
} catch (error) {
|
|
670
|
-
console.error('No provider found for MyService');
|
|
671
|
-
}
|
|
672
|
-
```
|
|
673
|
-
|
|
674
|
-
### API Reference
|
|
675
|
-
|
|
676
|
-
#### `provideValue`
|
|
677
|
-
|
|
678
|
-
```typescript
|
|
679
|
-
provideValue<T>(key: InjectionKey<T>, value: T): void
|
|
680
|
-
```
|
|
681
|
-
|
|
682
|
-
Provides a value using Vue's provide system with type safety.
|
|
683
|
-
|
|
684
|
-
| Parameter | Type | Description |
|
|
685
|
-
|-----------|------|-------------|
|
|
686
|
-
| `key` | `InjectionKey<T>` | The typed injection key |
|
|
687
|
-
| `value` | `T` | The value to provide |
|
|
688
|
-
|
|
689
|
-
#### `useInjectedValue`
|
|
690
|
-
|
|
691
|
-
```typescript
|
|
692
|
-
useInjectedValue<T>(key: InjectionKey<T>, defaultValue?: T): T
|
|
693
|
-
```
|
|
694
|
-
|
|
695
|
-
Injects a value using Vue's inject system with type safety and error handling.
|
|
696
|
-
|
|
697
|
-
| Parameter | Type | Required | Description |
|
|
698
|
-
|-----------|------|----------|-------------|
|
|
699
|
-
| `key` | `InjectionKey<T>` | ✅ | The typed injection key |
|
|
700
|
-
| `defaultValue` | `T` | ⚪ | Optional fallback value |
|
|
701
|
-
|
|
702
|
-
**Returns:** `T` - The injected value
|
|
703
|
-
|
|
704
|
-
**Throws:** `Error` - When no provider is found and no default value is provided
|
|
705
|
-
|
|
706
|
-
## 🌐 i18n
|
|
707
|
-
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).
|
|
708
|
-
It allows to use production or local translations on your code. 🚀
|
|
709
|
-
Example usage:
|
|
710
|
-
```js
|
|
711
|
-
import { useTranslations } from '@@/Composables/useTranslations';
|
|
712
|
-
|
|
713
|
-
const trans = useTranslations();
|
|
714
|
-
|
|
715
|
-
// use everywhere like this:
|
|
716
|
-
trans('foo.bar')
|
|
717
|
-
```
|
|
718
|
-
|
|
719
|
-
## 📦 Local Building (Recommended)
|
|
273
|
+
### Local Testing
|
|
720
274
|
|
|
721
|
-
|
|
722
|
-
```sh
|
|
723
|
-
bun run build
|
|
724
|
-
```
|
|
725
|
-
|
|
726
|
-
Since bun does not have packaging yet, use npm here: 🥲
|
|
727
|
-
```sh
|
|
728
|
-
npm pack
|
|
729
|
-
```
|
|
275
|
+
Test the package locally before publishing:
|
|
730
276
|
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
```sh
|
|
735
|
-
cp useinsider-guido-1.0.0.tgz ../email-fe
|
|
736
|
-
```
|
|
277
|
+
```bash
|
|
278
|
+
# Build and create tarball
|
|
279
|
+
bun run build && npm pack
|
|
737
280
|
|
|
738
|
-
Install
|
|
739
|
-
|
|
740
|
-
npm i ./useinsider-guido-1.0.0.tgz
|
|
281
|
+
# Install in your project
|
|
282
|
+
npm i ./useinsider-guido-1.0.3.tgz
|
|
741
283
|
```
|
|
742
284
|
|
|
743
|
-
|
|
285
|
+
> For complete development setup, project structure, and contribution guidelines, see [Contributing Guide](./wiki/Contributing.md)
|
|
744
286
|
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
## 📦 Build Output
|
|
748
|
-
|
|
749
|
-
The library builds to multiple formats:
|
|
287
|
+
## 🤝 Contributing
|
|
750
288
|
|
|
751
|
-
|
|
752
|
-
- **CSS**: `dist/guido.css` (custom styles)
|
|
289
|
+
Contributions are welcome! Please follow these guidelines:
|
|
753
290
|
|
|
754
|
-
|
|
291
|
+
- **PR Title Format**: `TASK-ID | EMOJI | Clear Description`
|
|
292
|
+
- Example: `SD-12345 | ✨ | Add new feature`
|
|
293
|
+
- **PR Requirements**:
|
|
294
|
+
- Fill PR labels
|
|
295
|
+
- Assign to yourself
|
|
296
|
+
- Include tests
|
|
297
|
+
- Pass all checks before review
|
|
755
298
|
|
|
756
|
-
|
|
757
|
-
{
|
|
758
|
-
"exports": {
|
|
759
|
-
".": {
|
|
760
|
-
"import": "./dist/library.js",
|
|
761
|
-
"types": "./dist/components/Guido.vue.d.ts",
|
|
762
|
-
"require": "./dist/components/Guido.vue.js"
|
|
763
|
-
},
|
|
764
|
-
"./style": "./dist/guido.css"
|
|
765
|
-
}
|
|
766
|
-
}
|
|
767
|
-
```
|
|
768
|
-
|
|
769
|
-
## 🤝 Contributing
|
|
770
|
-
- PR Titles should be structured like `TASK-ID | 🔥 | Some Clear Task Descriptions`
|
|
771
|
-
- PR Labels should be filled.
|
|
772
|
-
- PR Assignee required.
|
|
773
|
-
- Tests should be covered.
|
|
774
|
-
- All required checks should be passed before sending review request.
|
|
299
|
+
> For detailed contribution guidelines, see [Contributing Guide](./wiki/Contributing.md)
|
|
775
300
|
|
|
776
301
|
## 📄 License
|
|
777
302
|
|
|
778
303
|
ISC License
|
|
779
304
|
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
## 🔗 Related
|
|
305
|
+
## 🔗 Related Resources
|
|
783
306
|
|
|
784
307
|
- [Stripo Email Editor](https://stripo.email/) - The underlying email editor
|
|
785
308
|
- [@useinsider/design-system-vue](https://github.com/useinsider/design-system-vue) - Insider's Vue design system
|
|
786
309
|
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
- Playwright integrationBoilerplate/control.ts
|
|
791
|
-
- Commitlint & Precommit Hooks integration
|
|
792
|
-
- Get Pre-built display conditions from API
|
|
310
|
+
---
|
|
311
|
+
|
|
312
|
+
**Made with ❤️ by the Insider Team**
|