@useinsider/guido 1.0.0-beta.f7c239e → 1.0.1-beta.0168eae
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 +422 -21
- package/dist/@types/generic.d.ts +39 -23
- package/dist/@types/save-as-template.d.ts +29 -0
- package/dist/App.vue.d.ts +1 -1
- package/dist/_virtual/AddCustomFont.js +4 -0
- package/dist/_virtual/AiAssistantValueType.js +4 -0
- package/dist/_virtual/BackgroundColorBuiltInControl.js +4 -0
- package/dist/_virtual/BackgroundImageBuiltInControl.js +4 -0
- package/dist/_virtual/Block.js +4 -0
- package/dist/_virtual/BlockAttributes.js +4 -0
- package/dist/_virtual/BlockCompositionType.js +4 -0
- package/dist/_virtual/BlockPaddingsBuiltInControl.js +4 -0
- package/dist/_virtual/BlockRenderer.js +4 -0
- package/dist/_virtual/BlockType.js +4 -0
- package/dist/_virtual/BlocksPanel.js +4 -0
- package/dist/_virtual/BuiltInControl.js +4 -0
- package/dist/_virtual/BuiltInControlTypes.js +4 -0
- package/dist/_virtual/ButtonBorderBuiltInControl.js +4 -0
- package/dist/_virtual/ButtonColorBuiltInControl.js +4 -0
- package/dist/_virtual/ButtonFontColorBuiltInControl.js +4 -0
- package/dist/_virtual/ButtonInternalIndentsBuiltInControl.js +4 -0
- package/dist/_virtual/ButtonTextBuiltInControl.js +4 -0
- package/dist/_virtual/ContextAction.js +4 -0
- package/dist/_virtual/ContextActionType.js +4 -0
- package/dist/_virtual/Control.js +4 -0
- package/dist/_virtual/EditorStatePropertyType.js +4 -0
- package/dist/_virtual/Extension.js +4 -0
- package/dist/_virtual/ExtensionBuilder.js +4 -0
- package/dist/_virtual/FontFamilyBuiltInControl.js +4 -0
- package/dist/_virtual/LinkColorBuiltInControl.js +4 -0
- package/dist/_virtual/ModificationDescription.js +4 -0
- package/dist/_virtual/PanelPosition.js +4 -0
- package/dist/_virtual/PreviewDeviceMode.js +4 -0
- package/dist/_virtual/SettingsPanelRegistry.js +4 -0
- package/dist/_virtual/SettingsPanelTab.js +4 -0
- package/dist/_virtual/SettingsTab.js +4 -0
- package/dist/_virtual/StructureBorderBuiltInControl.js +4 -0
- package/dist/_virtual/StructurePaddingsBuiltInControl.js +4 -0
- package/dist/_virtual/TextColorBuiltInControl.js +4 -0
- package/dist/_virtual/TextLineSpacingBuiltInControl.js +4 -0
- package/dist/_virtual/TextSizeBuiltInControl.js +4 -0
- package/dist/_virtual/TextStyleBuiltInControl.js +4 -0
- package/dist/_virtual/UIElement.js +4 -0
- package/dist/_virtual/UIElementTagRegistry.js +4 -0
- package/dist/_virtual/UIElementType.js +4 -0
- package/dist/_virtual/UIElementsAttributes.js +4 -0
- package/dist/_virtual/index.js +5 -0
- package/dist/_virtual/index2.js +4 -0
- package/dist/components/Guido.vue.d.ts +21 -4
- package/dist/components/Guido.vue.js +12 -12
- package/dist/components/Guido.vue2.js +89 -25
- package/dist/components/organisms/base/Toaster.vue.d.ts +2 -0
- package/dist/components/organisms/base/Toaster.vue.js +17 -0
- package/dist/components/organisms/base/Toaster.vue2.js +15 -0
- package/dist/components/organisms/email-preview/PreviewContainer.vue.d.ts +2 -0
- package/dist/components/organisms/email-preview/PreviewContainer.vue.js +19 -0
- package/dist/components/organisms/email-preview/PreviewContainer.vue2.js +19 -0
- package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.d.ts +4 -0
- package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.js +22 -0
- package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue2.js +30 -0
- package/dist/components/organisms/email-preview/amp/AmpToggle.vue.d.ts +2 -0
- package/dist/components/organisms/email-preview/amp/AmpToggle.vue.js +19 -0
- package/dist/components/organisms/email-preview/amp/AmpToggle.vue2.js +29 -0
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.d.ts +2 -0
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +22 -0
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +31 -0
- package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.d.ts +2 -0
- package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.js +17 -0
- package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue2.js +20 -0
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.d.ts +2 -0
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +18 -0
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +25 -0
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.d.ts +4 -0
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +19 -0
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue2.js +23 -0
- package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.d.ts +4 -0
- package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.js +20 -0
- package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue2.js +21 -0
- package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.d.ts +2 -0
- package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.js +17 -0
- package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue2.js +22 -0
- package/dist/components/organisms/header/LeftSlot.vue.d.ts +1 -1
- package/dist/components/organisms/header/LeftSlot.vue.js +9 -9
- package/dist/components/organisms/header/LeftSlot.vue2.js +10 -6
- package/dist/components/organisms/header/MiddleSlot.vue.js +10 -10
- package/dist/components/organisms/header/MiddleSlot.vue2.js +16 -15
- package/dist/components/organisms/header/RightSlot.vue.js +12 -14
- package/dist/components/organisms/header/RightSlot.vue2.js +30 -17
- package/dist/components/organisms/header/ViewOptions.vue.d.ts +1 -1
- package/dist/components/organisms/header/ViewOptions.vue.js +8 -8
- package/dist/components/organisms/header/ViewOptions.vue2.js +30 -10
- package/dist/components/organisms/header/version-history/RestoreButton.vue.d.ts +2 -0
- package/dist/components/organisms/header/version-history/RestoreButton.vue.js +19 -0
- package/dist/components/organisms/header/version-history/RestoreButton.vue2.js +14 -0
- package/dist/components/organisms/header/version-history/VersionHistory.vue.d.ts +13 -1
- package/dist/components/organisms/header/version-history/VersionHistory.vue.js +7 -7
- package/dist/components/organisms/header/version-history/VersionHistory.vue2.js +13 -10
- package/dist/components/organisms/header/version-history/VersionHistoryItem.vue.d.ts +1 -1
- package/dist/components/organisms/header/version-history/VersionHistoryItem.vue.js +1 -1
- package/dist/components/organisms/header/version-history/ViewOptions.vue.d.ts +1 -1
- package/dist/components/organisms/header/version-history/ViewOptions.vue.js +3 -3
- package/dist/components/organisms/header/version-history/ViewOptions.vue2.js +34 -16
- package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue.d.ts +2 -0
- package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue.js +20 -0
- package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +63 -0
- package/dist/components/wrappers/WpDrawer.vue.d.ts +63 -0
- package/dist/components/wrappers/WpDrawer.vue.js +25 -0
- package/dist/components/wrappers/WpDrawer.vue2.js +23 -0
- package/dist/components/wrappers/WpModal.vue.d.ts +65 -0
- package/dist/components/wrappers/WpModal.vue.js +27 -0
- package/dist/components/wrappers/WpModal.vue2.js +22 -0
- package/dist/composables/useActionsApi.d.ts +5 -1
- package/dist/composables/useActionsApi.js +74 -31
- package/dist/composables/useApiExample.d.ts +6 -4
- package/dist/composables/useCodeEditorApi.d.ts +4 -0
- package/dist/composables/useCodeEditorApi.js +11 -0
- package/dist/composables/useConfig.d.ts +4 -0
- package/dist/composables/useConfig.js +7 -0
- package/dist/composables/useCustomInterfaceAppearance.js +45 -9
- package/dist/composables/useDebounce.d.ts +4 -0
- package/dist/composables/useDebounce.js +12 -0
- package/dist/composables/useExport.d.ts +1 -1
- package/dist/composables/useExport.js +38 -22
- package/dist/composables/useGuidoActions.d.ts +46 -0
- package/dist/composables/useGuidoActions.js +37 -0
- package/dist/composables/useHtmlCompiler.d.ts +4 -0
- package/dist/composables/useHtmlCompiler.js +17 -0
- package/dist/composables/useHttp.d.ts +19 -1
- package/dist/composables/useHttp.js +23 -21
- package/dist/composables/usePartner.d.ts +1 -1
- package/dist/composables/usePartner.js +9 -14
- package/dist/composables/usePreviewMode.d.ts +5 -0
- package/dist/composables/usePreviewMode.js +31 -0
- package/dist/composables/useProvideInject.d.ts +14 -0
- package/dist/composables/useProvideInject.js +17 -0
- package/dist/composables/useResponsivePreview.d.ts +5 -0
- package/dist/composables/useResponsivePreview.js +86 -0
- package/dist/composables/useStripo.js +66 -40
- package/dist/composables/useToaster.d.ts +1 -8
- package/dist/composables/useToaster.js +24 -30
- package/dist/composables/useTranslations.d.ts +4 -1
- package/dist/composables/useTranslations.js +3 -2
- package/dist/composables/useValidation.d.ts +56 -0
- package/dist/composables/useValidation.js +19 -0
- package/dist/composables/useVersionHistoryApi.js +11 -10
- package/dist/composables/validators/saveAsTemplate.d.ts +31 -0
- package/dist/composables/validators/saveAsTemplate.js +24 -0
- package/dist/config/compiler/htmlCompilerRules.d.ts +2 -0
- package/dist/config/compiler/htmlCompilerRules.js +145 -0
- package/dist/config/compiler/outlookCompilerRules.d.ts +0 -0
- package/dist/enums/defaults.d.ts +4 -1
- package/dist/enums/defaults.js +22 -6
- package/dist/enums/displayConditions.d.ts +2 -0
- package/dist/enums/displayConditions.js +80 -0
- package/dist/enums/preview.d.ts +13 -0
- package/dist/enums/preview.js +23 -0
- package/dist/enums/toaster.d.ts +5 -0
- package/dist/enums/toaster.js +4 -0
- package/dist/extensions/DynamicContent/dynamic-content-modal.d.ts +6 -0
- package/dist/extensions/DynamicContent/dynamic-content-modal.js +27 -0
- package/dist/extensions/DynamicContent/dynamic-content.css.js +24 -0
- package/dist/extensions/DynamicContent/dynamic-content.d.ts +16 -0
- package/dist/extensions/DynamicContent/dynamic-content.js +61 -0
- package/dist/extensions/DynamicContent/extension.d.ts +2 -0
- package/dist/extensions/DynamicContent/extension.js +11 -0
- package/dist/guido.css +1 -1
- package/dist/mock/api/default-template.d.ts +2 -0
- package/dist/mock/api/template-library.d.ts +2 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/Extension.js +51 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ExtensionBuilder.js +52 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/Block.js +41 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/BlockRenderer.js +18 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/BlocksPanel.js +32 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/ContextAction.js +18 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/AddCustomFont.js +8 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/AiAssistantValueType.js +13 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockAttributes.js +34 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockCompositionType.js +13 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockType.js +13 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BuiltInControlTypes.js +104 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/ContextActionType.js +13 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/EditorStatePropertyType.js +13 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PanelPosition.js +13 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PreviewDeviceMode.js +13 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/SettingsTab.js +13 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementType.js +13 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementsAttributes.js +45 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BackgroundColorBuiltInControl.js +43 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BackgroundImageBuiltInControl.js +46 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BlockPaddingsBuiltInControl.js +44 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BuiltInControl.js +22 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonBorderBuiltInControl.js +46 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonColorBuiltInControl.js +46 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonFontColorBuiltInControl.js +45 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonInternalIndentsBuiltInControl.js +45 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonTextBuiltInControl.js +45 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/Control.js +20 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/FontFamilyBuiltInControl.js +43 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/LinkColorBuiltInControl.js +45 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelRegistry.js +18 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelTab.js +32 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/StructureBorderBuiltInControl.js +46 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/StructurePaddingsBuiltInControl.js +44 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextColorBuiltInControl.js +43 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextLineSpacingBuiltInControl.js +43 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextSizeBuiltInControl.js +45 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextStyleBuiltInControl.js +43 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/index.js +266 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/modifications/ModificationDescription.js +26 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElement.js +22 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElementTagRegistry.js +18 -0
- package/dist/node_modules/@vueuse/shared/index.js +45 -0
- package/dist/node_modules/lodash-es/_Stack.js +18 -0
- package/dist/node_modules/lodash-es/_Uint8Array.js +5 -0
- package/dist/node_modules/lodash-es/_apply.js +16 -0
- package/dist/node_modules/lodash-es/_arrayLikeKeys.js +19 -0
- package/dist/node_modules/lodash-es/_assignMergeValue.js +8 -0
- package/dist/node_modules/lodash-es/_assignValue.js +10 -0
- package/dist/node_modules/lodash-es/_baseAssignValue.js +12 -0
- package/dist/node_modules/lodash-es/_baseCreate.js +17 -0
- package/dist/node_modules/lodash-es/_baseFor.js +5 -0
- package/dist/node_modules/lodash-es/_baseIsArguments.js +9 -0
- package/dist/node_modules/lodash-es/_baseIsTypedArray.js +12 -0
- package/dist/node_modules/lodash-es/_baseKeysIn.js +15 -0
- package/dist/node_modules/lodash-es/_baseMerge.js +20 -0
- package/dist/node_modules/lodash-es/_baseMergeDeep.js +31 -0
- package/dist/node_modules/lodash-es/_baseRest.js +9 -0
- package/dist/node_modules/lodash-es/_baseSetToString.js +14 -0
- package/dist/node_modules/lodash-es/_baseTimes.js +8 -0
- package/dist/node_modules/lodash-es/_baseUnary.js +8 -0
- package/dist/node_modules/lodash-es/_cloneArrayBuffer.js +8 -0
- package/dist/node_modules/lodash-es/_cloneBuffer.js +9 -0
- package/dist/node_modules/lodash-es/_cloneTypedArray.js +8 -0
- package/dist/node_modules/lodash-es/_copyArray.js +9 -0
- package/dist/node_modules/lodash-es/_copyObject.js +14 -0
- package/dist/node_modules/lodash-es/_createAssigner.js +15 -0
- package/dist/node_modules/lodash-es/_createBaseFor.js +13 -0
- package/dist/node_modules/lodash-es/_defineProperty.js +11 -0
- package/dist/node_modules/lodash-es/_getPrototype.js +5 -0
- package/dist/node_modules/lodash-es/_initCloneObject.js +9 -0
- package/dist/node_modules/lodash-es/_isIndex.js +8 -0
- package/dist/node_modules/lodash-es/_isIterateeCall.js +13 -0
- package/dist/node_modules/lodash-es/_isMasked.js +2 -2
- package/dist/node_modules/lodash-es/_isPrototype.js +8 -0
- package/dist/node_modules/lodash-es/_nativeKeysIn.js +10 -0
- package/dist/node_modules/lodash-es/_nodeUtil.js +11 -0
- package/dist/node_modules/lodash-es/_overArg.js +8 -0
- package/dist/node_modules/lodash-es/_overRest.js +15 -0
- package/dist/node_modules/lodash-es/_safeGet.js +7 -0
- package/dist/node_modules/lodash-es/_setToString.js +6 -0
- package/dist/node_modules/lodash-es/_shortOut.js +16 -0
- package/dist/node_modules/lodash-es/_stackClear.js +7 -0
- package/dist/node_modules/lodash-es/_stackDelete.js +7 -0
- package/dist/node_modules/lodash-es/_stackGet.js +6 -0
- package/dist/node_modules/lodash-es/_stackHas.js +6 -0
- package/dist/node_modules/lodash-es/_stackSet.js +17 -0
- package/dist/node_modules/lodash-es/constant.js +8 -0
- package/dist/node_modules/lodash-es/identity.js +6 -0
- package/dist/node_modules/lodash-es/isArguments.js +10 -0
- package/dist/node_modules/lodash-es/isArray.js +4 -0
- package/dist/node_modules/lodash-es/isArrayLike.js +8 -0
- package/dist/node_modules/lodash-es/isArrayLikeObject.js +8 -0
- package/dist/node_modules/lodash-es/isBuffer.js +6 -0
- package/dist/node_modules/lodash-es/isLength.js +7 -0
- package/dist/node_modules/lodash-es/isObjectLike.js +6 -0
- package/dist/node_modules/lodash-es/isPlainObject.js +16 -0
- package/dist/node_modules/lodash-es/isTypedArray.js +7 -0
- package/dist/node_modules/lodash-es/keysIn.js +9 -0
- package/dist/node_modules/lodash-es/merge.js +8 -0
- package/dist/node_modules/lodash-es/stubFalse.js +6 -0
- package/dist/node_modules/lodash-es/toPlainObject.js +8 -0
- package/dist/node_modules/valibot/dist/index.js +190 -0
- package/dist/node_modules/vue-demi/lib/index.js +7 -0
- package/dist/services/stripoApi.d.ts +6 -7
- package/dist/services/stripoApi.js +44 -23
- package/dist/services/templateLibraryApi.d.ts +7 -0
- package/dist/services/templateLibraryApi.js +87 -0
- package/dist/static/assets/inbox-mockup.svg.js +4 -0
- package/dist/static/assets/phone-mockup.svg.js +4 -0
- package/dist/static/styles/base.css.js +11 -0
- package/dist/static/styles/components/alert-message.css.js +39 -0
- package/dist/static/styles/components/amp-block.css.js +18 -0
- package/dist/static/styles/components/base-input.css.js +47 -0
- package/dist/static/styles/components/button-group.css.js +54 -0
- package/dist/static/styles/components/button.css.js +106 -0
- package/dist/static/styles/components/combobox.css.js +49 -0
- package/dist/static/styles/components/counter.css.js +42 -0
- package/dist/static/styles/components/dropdown-menu.css.js +52 -0
- package/dist/static/styles/components/narrow-panel.css.js +38 -0
- package/dist/static/styles/components/switcher.css.js +11 -0
- package/dist/static/styles/components/tabs.css.js +97 -0
- package/dist/static/styles/components/tools.css.js +23 -0
- package/dist/static/styles/components/version-history.css.js +30 -0
- package/dist/static/styles/components/wide-panel.css.js +144 -0
- package/dist/static/styles/customEditorStyle.css.js +18 -0
- package/dist/static/styles/variables.css.js +23 -0
- package/dist/stores/dynamic-content.d.ts +27 -0
- package/dist/stores/dynamic-content.js +23 -0
- package/dist/stores/editor.d.ts +3 -0
- package/dist/stores/editor.js +6 -3
- package/dist/stores/preview.d.ts +46 -0
- package/dist/stores/preview.js +53 -0
- package/dist/stores/save-as-template.d.ts +73 -0
- package/dist/stores/save-as-template.js +48 -0
- package/dist/stores/toaster.d.ts +18 -0
- package/dist/stores/toaster.js +27 -0
- package/dist/utils/arrayUtil.d.ts +1 -0
- package/dist/utils/arrayUtil.js +10 -0
- package/dist/utils/base64.d.ts +1 -0
- package/dist/utils/base64.js +7 -0
- package/dist/utils/genericUtil.d.ts +3 -0
- package/dist/utils/genericUtil.js +11 -0
- package/dist/utils/htmlCompiler.d.ts +12 -0
- package/dist/utils/htmlCompiler.js +70 -0
- package/dist/utils/templatePreparation.d.ts +4 -0
- package/dist/utils/templatePreparation.js +33 -0
- package/dist/utils/tooltipUtils.d.ts +2 -0
- package/dist/utils/tooltipUtils.js +11 -0
- package/package.json +8 -7
- package/dist/@types/http.d.ts +0 -19
- package/dist/composables/useTemplates.d.ts +0 -5
- package/dist/composables/useTemplates.js +0 -27
- package/dist/static/editor.css.js +0 -232
- package/dist/static/templates/default/index.html.js +0 -5
- package/dist/static/templates/default/style.css.js +0 -119
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
interface User {
|
|
2
|
+
id: number;
|
|
3
|
+
name: string;
|
|
4
|
+
email: string;
|
|
5
|
+
}
|
|
5
6
|
export declare const useApiExample: () => {
|
|
6
7
|
loading: import("vue").ComputedRef<boolean>;
|
|
7
8
|
error: import("vue").ComputedRef<{
|
|
@@ -59,3 +60,4 @@ export declare const useApiExample: () => {
|
|
|
59
60
|
uploadFile: (file: File) => Promise<string>;
|
|
60
61
|
clearError: () => void;
|
|
61
62
|
};
|
|
63
|
+
export {};
|
|
@@ -1,13 +1,49 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import S from "../static/styles/base.css.js";
|
|
2
|
+
import e from "../static/styles/components/alert-message.css.js";
|
|
3
|
+
import m from "../static/styles/components/amp-block.css.js";
|
|
4
|
+
import i from "../static/styles/components/base-input.css.js";
|
|
5
|
+
import p from "../static/styles/components/button-group.css.js";
|
|
6
|
+
import n from "../static/styles/components/button.css.js";
|
|
7
|
+
import s from "../static/styles/components/combobox.css.js";
|
|
8
|
+
import C from "../static/styles/components/counter.css.js";
|
|
9
|
+
import f from "../static/styles/components/dropdown-menu.css.js";
|
|
10
|
+
import a from "../static/styles/components/narrow-panel.css.js";
|
|
11
|
+
import u from "../static/styles/components/switcher.css.js";
|
|
12
|
+
import c from "../static/styles/components/tabs.css.js";
|
|
13
|
+
import d from "../static/styles/components/tools.css.js";
|
|
14
|
+
import l from "../static/styles/components/version-history.css.js";
|
|
15
|
+
import h from "../static/styles/components/wide-panel.css.js";
|
|
16
|
+
import w from "../static/styles/variables.css.js";
|
|
17
|
+
const y = [
|
|
18
|
+
w,
|
|
19
|
+
// Must be on top
|
|
20
|
+
S,
|
|
21
|
+
// Must be on top
|
|
22
|
+
e,
|
|
23
|
+
m,
|
|
24
|
+
i,
|
|
25
|
+
p,
|
|
26
|
+
n,
|
|
27
|
+
s,
|
|
28
|
+
C,
|
|
29
|
+
f,
|
|
30
|
+
a,
|
|
31
|
+
u,
|
|
32
|
+
c,
|
|
33
|
+
d,
|
|
34
|
+
l,
|
|
35
|
+
h
|
|
36
|
+
].join(`
|
|
37
|
+
|
|
38
|
+
`), N = () => ({ importCss: () => {
|
|
39
|
+
const o = new CSSStyleSheet();
|
|
40
|
+
o.replaceSync(y);
|
|
41
|
+
const r = document.querySelector("ui-editor");
|
|
42
|
+
if (!r)
|
|
7
43
|
return;
|
|
8
|
-
const
|
|
9
|
-
|
|
44
|
+
const t = r.shadowRoot;
|
|
45
|
+
t && (t.adoptedStyleSheets = [o]);
|
|
10
46
|
} });
|
|
11
47
|
export {
|
|
12
|
-
|
|
48
|
+
N as useCustomInterfaceAppearance
|
|
13
49
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ref as c } from "vue";
|
|
2
|
+
const r = () => {
|
|
3
|
+
const e = c(void 0);
|
|
4
|
+
return { debounce: (o, u = 150) => {
|
|
5
|
+
e.value && window.clearTimeout(e.value), e.value = window.setTimeout(o, u);
|
|
6
|
+
}, clearDebounce: () => {
|
|
7
|
+
e.value && (window.clearTimeout(e.value), e.value = void 0);
|
|
8
|
+
} };
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
r as useDebounce
|
|
12
|
+
};
|
|
@@ -1,30 +1,46 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { ToasterTypeOptions as a } from "../enums/toaster.js";
|
|
2
|
+
import { useActionsApi as m } from "./useActionsApi.js";
|
|
3
|
+
import { useHtmlCompiler as p } from "./useHtmlCompiler.js";
|
|
4
|
+
import { useToaster as d } from "./useToaster.js";
|
|
5
|
+
const H = () => {
|
|
6
|
+
const l = (s, o, r) => {
|
|
7
|
+
const i = new Blob([s], { type: r }), t = URL.createObjectURL(i), e = document.createElement("a");
|
|
8
|
+
e.href = t, e.download = o, document.body.appendChild(e), e.click(), document.body.removeChild(e), URL.revokeObjectURL(t);
|
|
9
|
+
}, c = (s) => {
|
|
10
|
+
const o = /* @__PURE__ */ new Date(), r = String(o.getDate()).padStart(2, "0"), i = String(o.getMonth() + 1).padStart(2, "0"), t = o.getFullYear(), e = String(o.getHours()).padStart(2, "0"), n = String(o.getMinutes()).padStart(2, "0");
|
|
11
|
+
return `${s}_${r}-${i}-${t}_${e}-${n}.html`;
|
|
10
12
|
};
|
|
11
|
-
return { exportHtml: async () => {
|
|
12
|
-
const { getCompiledEmail:
|
|
13
|
+
return { exportHtml: async (s = !0) => {
|
|
14
|
+
const { getCompiledEmail: o } = m(), { showToaster: r } = d(), { compileHtml: i } = p();
|
|
13
15
|
try {
|
|
14
|
-
const { html:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
const { html: t } = await o();
|
|
17
|
+
if (t) {
|
|
18
|
+
let e = t;
|
|
19
|
+
if (s) {
|
|
20
|
+
const n = i(t);
|
|
21
|
+
e = n.compiledHtml, console.debug("HTML Compilation Stats:", {
|
|
22
|
+
originalSize: n.stats.originalSize,
|
|
23
|
+
compiledSize: n.stats.compiledSize,
|
|
24
|
+
reduction: `${n.stats.reductionPercentage.toFixed(2)}%`,
|
|
25
|
+
appliedRules: n.appliedRules,
|
|
26
|
+
executionTime: `${n.stats.executionTime.toFixed(2)}ms`
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
l(e, c("HTML"), "text/html");
|
|
30
|
+
} else
|
|
31
|
+
r({
|
|
32
|
+
type: a.Alert,
|
|
33
|
+
message: "No HTML content to download"
|
|
34
|
+
});
|
|
35
|
+
} catch (t) {
|
|
36
|
+
const e = t instanceof Error ? t.message : String(t);
|
|
37
|
+
r({
|
|
38
|
+
type: a.Alert,
|
|
39
|
+
message: `Error compiling email: ${e}`
|
|
24
40
|
});
|
|
25
41
|
}
|
|
26
42
|
} };
|
|
27
43
|
};
|
|
28
44
|
export {
|
|
29
|
-
|
|
45
|
+
H as useExport
|
|
30
46
|
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { SavedTemplateDetails } from '@@/Types/stripo';
|
|
2
|
+
import type { InjectionKey } from 'vue';
|
|
3
|
+
export type BackHandler = () => void;
|
|
4
|
+
export type SaveStartHandler = () => void;
|
|
5
|
+
export type SaveCompleteHandler = (template: Omit<SavedTemplateDetails, 'forceRecreate'>) => void;
|
|
6
|
+
export declare const BACK_KEY: InjectionKey<BackHandler>;
|
|
7
|
+
export declare const SAVE_START_KEY: InjectionKey<SaveStartHandler>;
|
|
8
|
+
export declare const SAVE_COMPLETE_KEY: InjectionKey<SaveCompleteHandler>;
|
|
9
|
+
/**
|
|
10
|
+
* Provides Guido action handlers to child components
|
|
11
|
+
*/
|
|
12
|
+
export declare const provideGuidoActions: (actions: {
|
|
13
|
+
onBack: BackHandler;
|
|
14
|
+
onSaveStart: SaveStartHandler;
|
|
15
|
+
onSaveComplete: SaveCompleteHandler;
|
|
16
|
+
}) => void;
|
|
17
|
+
/**
|
|
18
|
+
* Provides individual Guido action handlers
|
|
19
|
+
*/
|
|
20
|
+
export declare const provideBackHandler: (handler: BackHandler) => void;
|
|
21
|
+
export declare const provideSaveStartHandler: (handler: SaveStartHandler) => void;
|
|
22
|
+
export declare const provideSaveCompleteHandler: (handler: SaveCompleteHandler) => void;
|
|
23
|
+
/**
|
|
24
|
+
* Hook to use the back navigation handler
|
|
25
|
+
* @returns Back navigation function
|
|
26
|
+
*/
|
|
27
|
+
export declare const useBack: () => BackHandler;
|
|
28
|
+
/**
|
|
29
|
+
* Hook to use the save start handler
|
|
30
|
+
* @returns Save start function
|
|
31
|
+
*/
|
|
32
|
+
export declare const useSaveStart: () => SaveStartHandler;
|
|
33
|
+
/**
|
|
34
|
+
* Hook to use the save complete handler
|
|
35
|
+
* @returns Save complete function
|
|
36
|
+
*/
|
|
37
|
+
export declare const useSaveComplete: () => SaveCompleteHandler;
|
|
38
|
+
/**
|
|
39
|
+
* Convenience hook to get all Guido actions
|
|
40
|
+
* @returns Object containing all action handlers
|
|
41
|
+
*/
|
|
42
|
+
export declare const useGuidoActions: () => {
|
|
43
|
+
back: BackHandler;
|
|
44
|
+
saveStart: SaveStartHandler;
|
|
45
|
+
saveComplete: SaveCompleteHandler;
|
|
46
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { provideValue as o, useInjectedValue as t } from "./useProvideInject.js";
|
|
2
|
+
const r = Symbol.for("guido.back"), n = Symbol.for("guido.save.start"), a = Symbol.for("guido.save.complete"), s = (e) => {
|
|
3
|
+
o(r, e.onBack), o(n, e.onSaveStart), o(a, e.onSaveComplete);
|
|
4
|
+
}, u = () => {
|
|
5
|
+
try {
|
|
6
|
+
return t(r);
|
|
7
|
+
} catch {
|
|
8
|
+
throw new Error(
|
|
9
|
+
"useBack: No back handler provided. Make sure Guido component is in the component tree."
|
|
10
|
+
);
|
|
11
|
+
}
|
|
12
|
+
}, d = () => {
|
|
13
|
+
try {
|
|
14
|
+
return t(n);
|
|
15
|
+
} catch {
|
|
16
|
+
throw new Error(
|
|
17
|
+
"useSaveStart: No save start handler provided. Make sure Guido component is in the component tree."
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
}, i = () => {
|
|
21
|
+
try {
|
|
22
|
+
return t(a);
|
|
23
|
+
} catch {
|
|
24
|
+
throw new Error(
|
|
25
|
+
"useSaveComplete: No save complete handler provided. Make sure Guido component is in the component tree."
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
r as BACK_KEY,
|
|
31
|
+
a as SAVE_COMPLETE_KEY,
|
|
32
|
+
n as SAVE_START_KEY,
|
|
33
|
+
s as provideGuidoActions,
|
|
34
|
+
u as useBack,
|
|
35
|
+
i as useSaveComplete,
|
|
36
|
+
d as useSaveStart
|
|
37
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defaultHtmlCompilerRules as r } from "../config/compiler/htmlCompilerRules.js";
|
|
2
|
+
import { createHtmlCompiler as p } from "../utils/htmlCompiler.js";
|
|
3
|
+
import { useConfig as s } from "./useConfig.js";
|
|
4
|
+
const R = () => {
|
|
5
|
+
const { config: e } = s(), l = e.htmlCompilerRules || [], t = [
|
|
6
|
+
...!!e.ignoreDefaultHtmlCompilerRules ? [] : r,
|
|
7
|
+
...l.map((o, i) => ({
|
|
8
|
+
...o,
|
|
9
|
+
priority: o.priority + 1e3 + i
|
|
10
|
+
// Ensure additional rules run after default rules
|
|
11
|
+
}))
|
|
12
|
+
], m = p(t);
|
|
13
|
+
return { compileHtml: (o) => m.compile(o) };
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
R as useHtmlCompiler
|
|
17
|
+
};
|
|
@@ -1,4 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
2
|
+
export interface HttpOptions extends Omit<RequestInit, 'method' | 'body'> {
|
|
3
|
+
baseURL?: string;
|
|
4
|
+
timeout?: number;
|
|
5
|
+
retry?: number;
|
|
6
|
+
retryDelay?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface HttpResponse<T = unknown> {
|
|
9
|
+
data: T;
|
|
10
|
+
status: number;
|
|
11
|
+
statusText: string;
|
|
12
|
+
headers: Headers;
|
|
13
|
+
}
|
|
14
|
+
export interface HttpError {
|
|
15
|
+
message: string;
|
|
16
|
+
status?: number;
|
|
17
|
+
statusText?: string;
|
|
18
|
+
response?: Response;
|
|
19
|
+
}
|
|
2
20
|
export declare const useHttp: (defaultOptions?: HttpOptions) => {
|
|
3
21
|
loading: import("vue").ComputedRef<boolean>;
|
|
4
22
|
error: import("vue").ComputedRef<{
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { getCsrfToken as H } from "../utils/genericUtil.js";
|
|
2
|
+
import { ref as p, computed as T } from "vue";
|
|
3
|
+
const k = (b = {}) => {
|
|
4
|
+
const h = p(!1), a = p(null), u = p(null), g = T(() => h.value), y = T(() => a.value !== null), v = {
|
|
4
5
|
baseURL: "",
|
|
5
6
|
timeout: 1e4,
|
|
6
7
|
retry: 0,
|
|
7
8
|
retryDelay: 1e3,
|
|
8
9
|
headers: {
|
|
9
|
-
"Content-Type": "application/json"
|
|
10
|
+
"Content-Type": "application/json",
|
|
11
|
+
"X-CSRF-TOKEN": H()
|
|
10
12
|
},
|
|
11
|
-
...
|
|
13
|
+
...b
|
|
12
14
|
}, w = (e, s) => {
|
|
13
15
|
if (e.startsWith("http://") || e.startsWith("https://"))
|
|
14
16
|
return e;
|
|
15
|
-
const t = s ||
|
|
17
|
+
const t = s || v.baseURL || "";
|
|
16
18
|
return t.endsWith("/") && e.startsWith("/") ? `${t}${e.slice(1)}` : t.endsWith("/") || e.startsWith("/") ? `${t}${e}` : `${t}/${e}`;
|
|
17
19
|
}, P = (e) => new Promise((s, t) => {
|
|
18
20
|
setTimeout(() => {
|
|
@@ -22,20 +24,20 @@ const j = (y = {}) => {
|
|
|
22
24
|
setTimeout(s, e);
|
|
23
25
|
}), i = async (e, s, t, D = {}) => {
|
|
24
26
|
a.value = null, h.value = !0, u.value = new AbortController();
|
|
25
|
-
const n = { ...
|
|
27
|
+
const n = { ...v, ...D }, L = w(s, n.baseURL), c = {
|
|
26
28
|
method: e,
|
|
27
29
|
headers: { ...n.headers },
|
|
28
30
|
signal: u.value.signal,
|
|
29
31
|
...n
|
|
30
32
|
};
|
|
31
33
|
t && ["POST", "PUT", "PATCH"].includes(e) && (t instanceof FormData ? (delete c.headers["Content-Type"], c.body = t) : c.body = JSON.stringify(t));
|
|
32
|
-
const
|
|
34
|
+
const E = async (m = 0) => {
|
|
33
35
|
try {
|
|
34
36
|
const o = [fetch(L, c)];
|
|
35
37
|
n.timeout && o.push(P(n.timeout));
|
|
36
38
|
const r = await Promise.race(o);
|
|
37
39
|
if (!r.ok) {
|
|
38
|
-
const
|
|
40
|
+
const O = `HTTP Error: ${r.status} ${r.statusText}`, d = new Error(O);
|
|
39
41
|
throw d.status = r.status, d.statusText = r.statusText, d.response = r, d;
|
|
40
42
|
}
|
|
41
43
|
let f;
|
|
@@ -49,36 +51,36 @@ const j = (y = {}) => {
|
|
|
49
51
|
} catch (o) {
|
|
50
52
|
const r = o instanceof Error && o.name === "AbortError";
|
|
51
53
|
if (m < (n.retry || 0) && !r)
|
|
52
|
-
return await x(n.retryDelay || 1e3),
|
|
54
|
+
return await x(n.retryDelay || 1e3), E(m + 1);
|
|
53
55
|
throw o instanceof Error ? o.name === "AbortError" ? a.value = { message: "Request was cancelled" } : a.value = { message: o.message } : a.value = o, o;
|
|
54
56
|
}
|
|
55
57
|
};
|
|
56
58
|
try {
|
|
57
|
-
return await
|
|
59
|
+
return await E();
|
|
58
60
|
} finally {
|
|
59
61
|
h.value = !1, u.value = null;
|
|
60
62
|
}
|
|
61
|
-
},
|
|
63
|
+
}, C = (e, s) => i("GET", e, void 0, s), $ = (e, s, t) => i("POST", e, s, t), R = (e, s, t) => i("PUT", e, s, t), U = (e, s, t) => i("PATCH", e, s, t), A = (e, s) => i("DELETE", e, void 0, s), W = (e) => {
|
|
62
64
|
u.value && u.value.abort(e);
|
|
63
65
|
}, q = () => {
|
|
64
66
|
a.value = null;
|
|
65
67
|
};
|
|
66
68
|
return {
|
|
67
69
|
// State
|
|
68
|
-
loading:
|
|
69
|
-
error:
|
|
70
|
-
hasError:
|
|
70
|
+
loading: g,
|
|
71
|
+
error: T(() => a.value),
|
|
72
|
+
hasError: y,
|
|
71
73
|
// Methods
|
|
72
74
|
request: i,
|
|
73
|
-
get:
|
|
74
|
-
post:
|
|
75
|
-
put:
|
|
76
|
-
patch:
|
|
77
|
-
delete:
|
|
75
|
+
get: C,
|
|
76
|
+
post: $,
|
|
77
|
+
put: R,
|
|
78
|
+
patch: U,
|
|
79
|
+
delete: A,
|
|
78
80
|
cancel: W,
|
|
79
81
|
clearError: q
|
|
80
82
|
};
|
|
81
83
|
};
|
|
82
84
|
export {
|
|
83
|
-
|
|
85
|
+
k as useHttp
|
|
84
86
|
};
|
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
import { DefaultProductType as o } from "../enums/defaults.js";
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const t = window.location.pathname.split("/").filter(Boolean)[0] || o;
|
|
10
|
-
return e[t] || t;
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
};
|
|
1
|
+
import { DefaultProductType as e, ProductIds as o } from "../enums/defaults.js";
|
|
2
|
+
const c = () => ({
|
|
3
|
+
getPartnerName: () => window.location.hostname.split(".")[0] || "",
|
|
4
|
+
getProductType: () => {
|
|
5
|
+
const t = window.location.pathname.split("/").filter(Boolean)[0] || e;
|
|
6
|
+
return o[t] || 0;
|
|
7
|
+
}
|
|
8
|
+
});
|
|
14
9
|
export {
|
|
15
|
-
|
|
10
|
+
c as usePartner
|
|
16
11
|
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { useEditorStore as n } from "../stores/editor.js";
|
|
2
|
+
import { usePreviewStore as m } from "../stores/preview.js";
|
|
3
|
+
import { useActionsApi as p } from "./useActionsApi.js";
|
|
4
|
+
import { useCodeEditorApi as l } from "./useCodeEditorApi.js";
|
|
5
|
+
const E = () => {
|
|
6
|
+
const i = n(), e = m(), { closeCodeEditor: s } = l(), { getPreviewData: a } = p(), r = () => {
|
|
7
|
+
e.isPreviewModeOpen = !1, e.$reset();
|
|
8
|
+
};
|
|
9
|
+
return {
|
|
10
|
+
closePreviewMode: r,
|
|
11
|
+
openPreviewMode: () => {
|
|
12
|
+
i.isCodeEditorOpen && s(), e.isPreviewModeOpen = !0;
|
|
13
|
+
},
|
|
14
|
+
loadPreviewData: async () => {
|
|
15
|
+
if (!(e.isLoading || e.isLoaded)) {
|
|
16
|
+
e.isLoading = !0;
|
|
17
|
+
try {
|
|
18
|
+
const { html: o, ampHtml: t, ampErrors: d } = await a();
|
|
19
|
+
e.templateHtml = o || "", e.ampHtml = t || "", e.ampErrors = d || [], e.setEmailFormat(t ? "AMP" : "html"), e.isLoaded = !0;
|
|
20
|
+
} catch (o) {
|
|
21
|
+
console.error("Failed to load preview data:", o), r();
|
|
22
|
+
} finally {
|
|
23
|
+
e.isLoading = !1;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
E as usePreviewMode
|
|
31
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type InjectionKey } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Provides a value using Vue's provide/inject system
|
|
4
|
+
* @param key - The injection key
|
|
5
|
+
* @param value - The value to provide
|
|
6
|
+
*/
|
|
7
|
+
export declare const provideValue: <T>(key: InjectionKey<T>, value: T) => void;
|
|
8
|
+
/**
|
|
9
|
+
* Injects a value using Vue's provide/inject system
|
|
10
|
+
* @param key - The injection key
|
|
11
|
+
* @param defaultValue - Optional default value if injection fails
|
|
12
|
+
* @returns The injected value
|
|
13
|
+
*/
|
|
14
|
+
export declare const useInjectedValue: <T>(key: InjectionKey<T>, defaultValue?: T) => T;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { provide as t, inject as i } from "vue";
|
|
2
|
+
const d = (e, o) => {
|
|
3
|
+
t(e, o);
|
|
4
|
+
}, s = (e, o) => {
|
|
5
|
+
const r = i(e, o);
|
|
6
|
+
if (r === void 0 && o === void 0) {
|
|
7
|
+
const n = e.description || String(e);
|
|
8
|
+
throw new Error(
|
|
9
|
+
`useInjectedValue: No provider found for key "${n}". Make sure a parent component provides this value.`
|
|
10
|
+
);
|
|
11
|
+
}
|
|
12
|
+
return r;
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
d as provideValue,
|
|
16
|
+
s as useInjectedValue
|
|
17
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { useDebounce as p } from "./useDebounce.js";
|
|
2
|
+
import { ResponsivePreviewRegex as c, ResponsivePreviewSelectors as v, ResponsivePreviewConfig as a } from "../enums/preview.js";
|
|
3
|
+
let i = null, l = null;
|
|
4
|
+
const { debounce: y } = p(), h = (t) => {
|
|
5
|
+
if (!t)
|
|
6
|
+
return null;
|
|
7
|
+
const e = t.match(c.TABLE_WIDTH);
|
|
8
|
+
if (!e)
|
|
9
|
+
return null;
|
|
10
|
+
const n = Number(e[1]);
|
|
11
|
+
return Number.isNaN(n) ? null : n;
|
|
12
|
+
}, w = (t) => Array.from(t.querySelectorAll("table[width]")).reduce((e, n) => {
|
|
13
|
+
const o = h(n.getAttribute("width"));
|
|
14
|
+
return o && o > e ? o : e;
|
|
15
|
+
}, 0), f = (t) => Array.from(t.querySelectorAll('[style*="width"]')).reduce((e, n) => {
|
|
16
|
+
const r = (n.getAttribute("style") || "").match(c.INLINE_WIDTH);
|
|
17
|
+
if (!r)
|
|
18
|
+
return e;
|
|
19
|
+
const s = Number(r[1]);
|
|
20
|
+
return !Number.isNaN(s) && s > e ? s : e;
|
|
21
|
+
}, 0), W = (t) => v.CONTAINERS.reduce((e, n) => {
|
|
22
|
+
const o = t.querySelector(n);
|
|
23
|
+
if (!o)
|
|
24
|
+
return e;
|
|
25
|
+
const r = Math.max(o.offsetWidth, o.scrollWidth);
|
|
26
|
+
return r > e ? r : e;
|
|
27
|
+
}, 0), E = (t) => {
|
|
28
|
+
const e = {
|
|
29
|
+
maxTableWidth: w(t),
|
|
30
|
+
maxInlineWidth: f(t),
|
|
31
|
+
maxContainerWidth: W(t)
|
|
32
|
+
}, { maxTableWidth: n, maxInlineWidth: o, maxContainerWidth: r } = e;
|
|
33
|
+
return Math.max(n, o, r) || a.DEFAULT_WIDTH;
|
|
34
|
+
}, b = (t) => {
|
|
35
|
+
const { documentElement: e, body: n } = t;
|
|
36
|
+
e.style.setProperty("overflow-x", "visible", "important"), n.style.setProperty("visibility", "visible", "important");
|
|
37
|
+
}, g = (t) => {
|
|
38
|
+
const { documentElement: e, body: n } = t;
|
|
39
|
+
e.style.removeProperty("transform"), e.style.removeProperty("transform-origin"), e.style.removeProperty("height"), n.style.removeProperty("overflow-x");
|
|
40
|
+
}, S = (t) => {
|
|
41
|
+
const { targetWidth: e, deviceWidth: n, minScale: o, maxScale: r } = t, s = n / e;
|
|
42
|
+
return Math.min(Math.max(s, o), r);
|
|
43
|
+
}, P = (t, e) => {
|
|
44
|
+
const n = E(t), o = S({
|
|
45
|
+
targetWidth: n,
|
|
46
|
+
deviceWidth: e,
|
|
47
|
+
minScale: a.MIN_SCALE,
|
|
48
|
+
maxScale: 1
|
|
49
|
+
}), { documentElement: r, body: s } = t;
|
|
50
|
+
r.style.setProperty("height", "100%", "important"), r.style.setProperty("transform", `scale(${o})`, "important"), r.style.setProperty("transform-origin", "top left", "important"), s.style.setProperty("overflow-x", "hidden", "important");
|
|
51
|
+
}, u = (t) => {
|
|
52
|
+
const e = t.querySelector('meta[name="viewport"]');
|
|
53
|
+
if (!e)
|
|
54
|
+
return !1;
|
|
55
|
+
const n = e.getAttribute("content") || "";
|
|
56
|
+
return c.META_VIEWPORT.test(n);
|
|
57
|
+
}, R = (t) => t.clientWidth || t.getBoundingClientRect().width || 375, d = (t) => {
|
|
58
|
+
const e = t.contentWindow;
|
|
59
|
+
l && e && e.removeEventListener("resize", l), i && window.removeEventListener("resize", i), l = null, i = null;
|
|
60
|
+
}, x = (t, e) => {
|
|
61
|
+
const n = t.contentWindow;
|
|
62
|
+
if (!n)
|
|
63
|
+
return;
|
|
64
|
+
d(t);
|
|
65
|
+
const o = () => y(e, a.RESIZE_DEBOUNCE_MS);
|
|
66
|
+
l = o, n.addEventListener("resize", l), i = o, window.addEventListener("resize", i);
|
|
67
|
+
}, M = () => ({
|
|
68
|
+
setupResponsivePreview: (n) => {
|
|
69
|
+
const o = n.contentDocument, r = n.contentWindow;
|
|
70
|
+
if (!o || !r)
|
|
71
|
+
return;
|
|
72
|
+
b(o);
|
|
73
|
+
const s = () => {
|
|
74
|
+
const m = R(n);
|
|
75
|
+
u(o) ? g(o) : P(o, m);
|
|
76
|
+
};
|
|
77
|
+
s(), x(n, s);
|
|
78
|
+
},
|
|
79
|
+
tearDownEmailResponsiveFit: (n) => {
|
|
80
|
+
d(n);
|
|
81
|
+
},
|
|
82
|
+
hasResponsiveMetaViewport: u
|
|
83
|
+
});
|
|
84
|
+
export {
|
|
85
|
+
M as useResponsivePreview
|
|
86
|
+
};
|