@useinsider/guido 1.0.0-beta.6ecc044 → 1.0.0-beta.71a8dc6
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 +410 -21
- package/dist/@types/generic.d.ts +35 -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 +20 -3
- package/dist/components/Guido.vue.js +7 -7
- package/dist/components/Guido.vue2.js +78 -29
- 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 +31 -18
- 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/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 +3 -0
- package/dist/composables/useActionsApi.js +62 -34
- 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 +35 -20
- 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/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 +53 -30
- package/dist/composables/useTranslations.js +3 -2
- 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.js +14 -5
- 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/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/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/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/_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/services/stripoApi.d.ts +2 -1
- package/dist/services/stripoApi.js +27 -7
- 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 +135 -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 +1 -1
- package/dist/stores/editor.js +4 -4
- package/dist/stores/preview.d.ts +46 -0
- package/dist/stores/preview.js +53 -0
- package/dist/utils/arrayUtil.d.ts +1 -0
- package/dist/utils/arrayUtil.js +10 -0
- package/dist/utils/genericUtil.d.ts +2 -0
- package/dist/utils/genericUtil.js +7 -0
- package/dist/utils/htmlCompiler.d.ts +12 -0
- package/dist/utils/htmlCompiler.js +70 -0
- package/dist/utils/tooltipUtils.d.ts +2 -0
- package/dist/utils/tooltipUtils.js +11 -0
- package/package.json +6 -5
- package/dist/components/organisms/base/ModalWrapper.vue.d.ts +0 -72
- package/dist/components/organisms/base/ModalWrapper.vue.js +0 -19
- package/dist/components/organisms/base/ModalWrapper.vue2.js +0 -43
- package/dist/components/organisms/save-template/SaveTemplateModal.vue.d.ts +0 -20
- package/dist/components/organisms/save-template/SaveTemplateModal.vue.js +0 -19
- package/dist/components/organisms/save-template/SaveTemplateModal.vue2.js +0 -66
- package/dist/composables/useTemplateValidation.d.ts +0 -13
- package/dist/composables/useTemplateValidation.js +0 -57
- 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
- /package/dist/mock/api/{template-library.d.ts → default-template.d.ts} +0 -0
|
@@ -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
|
+
};
|
|
@@ -1,74 +1,97 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { useActionsApi as g } from "./useActionsApi.js";
|
|
2
|
+
import { useCustomInterfaceAppearance as f } from "./useCustomInterfaceAppearance.js";
|
|
3
|
+
import { useToaster as y } from "./useToaster.js";
|
|
4
|
+
import { displayConditions as C } from "../enums/displayConditions.js";
|
|
5
|
+
import E from "../extensions/DynamicContent/extension.js";
|
|
6
|
+
import { useStripoApi as S } from "../services/stripoApi.js";
|
|
7
|
+
import { useEditorStore as w } from "../stores/editor.js";
|
|
8
|
+
import { dynamicContentToMergeTags as b } from "../utils/genericUtil.js";
|
|
9
|
+
const M = (d) => {
|
|
10
|
+
const { handleError: c } = y(), { getToken: a, getCustomFonts: u } = S(), l = (e, r = []) => {
|
|
11
|
+
const i = w(), { html: t, css: s, forceRecreate: p } = e;
|
|
8
12
|
window.UIEditor.initEditor(
|
|
9
13
|
document.querySelector("#guido-editor"),
|
|
10
14
|
{
|
|
11
|
-
metadata:
|
|
15
|
+
metadata: d,
|
|
12
16
|
html: t,
|
|
13
|
-
css:
|
|
17
|
+
css: s,
|
|
18
|
+
forceRecreate: p,
|
|
14
19
|
locale: "en",
|
|
15
20
|
undoButtonSelector: "#guido__undo-button",
|
|
16
21
|
redoButtonSelector: "#guido__redo-button",
|
|
17
22
|
mobileViewButtonSelector: ".guido__view-option-selection-mobile",
|
|
18
23
|
desktopViewButtonSelector: ".guido__view-option-selection-desktop",
|
|
19
24
|
codeEditorButtonSelector: "#guido__code-button",
|
|
25
|
+
customAppearanceMergetags: !0,
|
|
26
|
+
customAppearanceMergetagsBorderColor: "#f1f3fe",
|
|
27
|
+
customAppearanceMergetagsBackgroundColor: "#f1f3fe",
|
|
28
|
+
customViewStyles: `
|
|
29
|
+
.esd-x, .esd-merge-tag {color: #0a2ecc !important; box-shadow: none !important;}
|
|
30
|
+
.esd-merge-tag {border: 1px solid #b5c1f1; border-radius: 4px !important;}
|
|
31
|
+
`,
|
|
32
|
+
conditionsEnabled: !0,
|
|
33
|
+
customConditionsEnabled: !0,
|
|
34
|
+
conditionCategories: C,
|
|
35
|
+
messageSettingsEnabled: !1,
|
|
20
36
|
editorFonts: {
|
|
21
37
|
showDefaultStandardFonts: !0,
|
|
22
38
|
showDefaultNotStandardFonts: !0,
|
|
23
|
-
customFonts:
|
|
39
|
+
customFonts: r
|
|
24
40
|
},
|
|
41
|
+
mergeTags: [
|
|
42
|
+
{
|
|
43
|
+
entries: b(d.preselectedDynamicContentList)
|
|
44
|
+
}
|
|
45
|
+
],
|
|
25
46
|
async onTokenRefreshRequest(o) {
|
|
26
47
|
try {
|
|
27
|
-
const
|
|
28
|
-
o(
|
|
29
|
-
} catch (
|
|
30
|
-
|
|
48
|
+
const n = await a();
|
|
49
|
+
o(n);
|
|
50
|
+
} catch (n) {
|
|
51
|
+
c(n, "Failed to refresh token");
|
|
31
52
|
}
|
|
32
53
|
},
|
|
33
54
|
onTemplateLoaded() {
|
|
34
55
|
try {
|
|
35
|
-
const { importCss: o } =
|
|
36
|
-
o();
|
|
56
|
+
const { importCss: o } = f(), { activateCustomViewStyles: n } = g();
|
|
57
|
+
o(), n();
|
|
37
58
|
} catch (o) {
|
|
38
|
-
|
|
59
|
+
c(o, "Failed to load custom interface appearance");
|
|
39
60
|
}
|
|
40
61
|
},
|
|
41
62
|
onCodeEditorVisibilityChanged(o) {
|
|
42
|
-
|
|
63
|
+
i.isCodeEditorOpen = o;
|
|
43
64
|
},
|
|
44
65
|
onEditorVisualModeChanged(o) {
|
|
45
|
-
|
|
66
|
+
i.editorVisualMode = o.toLowerCase();
|
|
46
67
|
},
|
|
47
68
|
onVersionHistoryVisibilityChanged(o) {
|
|
48
|
-
|
|
49
|
-
}
|
|
69
|
+
i.isVersionHistoryOpen = o;
|
|
70
|
+
},
|
|
71
|
+
ignoreClickOutsideSelectors: ["#guido-dynamic-content-modal"],
|
|
72
|
+
extensions: [E]
|
|
50
73
|
}
|
|
51
74
|
);
|
|
52
|
-
},
|
|
75
|
+
}, m = (e) => new Promise((r, i) => {
|
|
53
76
|
if (document.getElementById("UiEditorScript")) {
|
|
54
|
-
e(),
|
|
77
|
+
e(), r();
|
|
55
78
|
return;
|
|
56
79
|
}
|
|
57
80
|
const t = document.createElement("script");
|
|
58
81
|
t.id = "UiEditorScript", t.type = "module", t.src = "https://plugins.stripo.email/resources/uieditor/latest/UIEditor.js", t.onload = () => {
|
|
59
|
-
e(),
|
|
82
|
+
e(), r();
|
|
60
83
|
}, t.onerror = () => {
|
|
61
|
-
const
|
|
62
|
-
|
|
84
|
+
const s = new Error("Failed to load Stripo UIEditor script");
|
|
85
|
+
i(s);
|
|
63
86
|
}, document.body.appendChild(t);
|
|
64
87
|
});
|
|
65
88
|
return { initPlugin: async (e) => {
|
|
66
|
-
await
|
|
67
|
-
const
|
|
68
|
-
l(e,
|
|
89
|
+
await m(async () => {
|
|
90
|
+
const r = await u();
|
|
91
|
+
l(e, r);
|
|
69
92
|
});
|
|
70
93
|
} };
|
|
71
94
|
};
|
|
72
95
|
export {
|
|
73
|
-
|
|
96
|
+
M as useStripo
|
|
74
97
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import memoize from "../node_modules/lodash-es/memoize.js";
|
|
2
2
|
import { ref } from "vue";
|
|
3
|
+
import { useConfig } from "./useConfig.js";
|
|
3
4
|
const useTranslations = () => {
|
|
4
|
-
const translations = ref(eval(
|
|
5
|
+
const { config } = useConfig(), translations = ref(eval(config.translationsPath)), trans = (n, t) => {
|
|
5
6
|
const r = translations.value[n];
|
|
6
7
|
return r ? t ? Object.entries(t).reduce(
|
|
7
|
-
(e, [o,
|
|
8
|
+
(e, [o, s]) => e.replace(new RegExp(`{${o}}`, "g"), String(s)),
|
|
8
9
|
r
|
|
9
10
|
) : r : (console.warn(`Translation key not found: ${n}`), n);
|
|
10
11
|
};
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
const a = [
|
|
2
|
+
{
|
|
3
|
+
id: "fix-url-encoding-start",
|
|
4
|
+
description: "Replace {%22 with %7B%22 to fix URL encoding",
|
|
5
|
+
type: "replace",
|
|
6
|
+
search: "{%22",
|
|
7
|
+
replacement: "%7B%22",
|
|
8
|
+
replaceAll: !0,
|
|
9
|
+
priority: 10
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
id: "fix-url-encoding-end",
|
|
13
|
+
description: "Replace %22} with %22%7D to fix URL encoding",
|
|
14
|
+
type: "replace",
|
|
15
|
+
search: "%22}",
|
|
16
|
+
replacement: "%22%7D",
|
|
17
|
+
replaceAll: !0,
|
|
18
|
+
priority: 10
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
id: "fix-tags-start",
|
|
22
|
+
description: "Replace %7B%7B with {{ to fix URL encoding",
|
|
23
|
+
type: "replace",
|
|
24
|
+
search: "%7B%7B",
|
|
25
|
+
replacement: "{{",
|
|
26
|
+
replaceAll: !0,
|
|
27
|
+
priority: 11
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
id: "fix-tags-end",
|
|
31
|
+
description: "Replace %7D%7D with }} to fix URL encoding",
|
|
32
|
+
type: "replace",
|
|
33
|
+
search: "%7D%7D",
|
|
34
|
+
replacement: "}}",
|
|
35
|
+
replaceAll: !0,
|
|
36
|
+
priority: 12
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: "unescape-inequality-operators-start",
|
|
40
|
+
description: "Replace < with < to fix URL encoding",
|
|
41
|
+
type: "replace",
|
|
42
|
+
search: "<",
|
|
43
|
+
replacement: "<",
|
|
44
|
+
replaceAll: !0,
|
|
45
|
+
priority: 13
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: "unescape-inequality-operators-end",
|
|
49
|
+
description: "Replace > with > to fix URL encoding",
|
|
50
|
+
type: "replace",
|
|
51
|
+
search: ">",
|
|
52
|
+
replacement: ">",
|
|
53
|
+
replaceAll: !0,
|
|
54
|
+
priority: 14
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
id: "remove-apty-iframe",
|
|
58
|
+
description: "Cleanup Apty Iframe Code",
|
|
59
|
+
type: "remove",
|
|
60
|
+
targets: [
|
|
61
|
+
'<iframe src="about:blank" id="letznav-iframe-script" allowtransparency="true" style="width:1px;height:1px"></iframe>',
|
|
62
|
+
'src="about:blank" id="letznav-iframe-script" allowtransparency="true" style="width:1px;height:1px"></iframe>'
|
|
63
|
+
],
|
|
64
|
+
priority: 20
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
id: "remove-apty-styles",
|
|
68
|
+
description: "Removing Apty Styles",
|
|
69
|
+
type: "regex",
|
|
70
|
+
pattern: '<styles*data-styles="apty_styles"s* type="text/css"s*>((s|.)*?)</style>',
|
|
71
|
+
replacement: "",
|
|
72
|
+
flags: "g",
|
|
73
|
+
priority: 21
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
id: "remove-mso-conditions",
|
|
77
|
+
description: "Removing MSO Conditions",
|
|
78
|
+
type: "remove",
|
|
79
|
+
targets: [
|
|
80
|
+
/<!--\[if\s\(mso 16\)\]>\s*<style\s*\S*>\s*a\s*\{\s*text-decoration\s*:\s*none\s*;*\s*\}\s*<\/style>\s*<!\[endif\]-->/g,
|
|
81
|
+
/<!--\[if\sgte mso 9\]>\s*<style\s*\S*>\s*sup\s*\{\s*font-size\s*:\s*100%\s*!important\s*;*\s*\}\s*<\/style>\s*<!\[endif\]-->/g,
|
|
82
|
+
/<!--\[if\sgte mso 9\]>\s*<noscript>\s*<xml>\s*<o:OfficeDocumentSettings>\s*<o:AllowPNG>\s*<\/o:AllowPNG>\s*<o:PixelsPerInch>\d+<\/o:PixelsPerInch>\s*<\/o:OfficeDocumentSettings>\s*<\/xml>\s*<\/noscript>\s*<!\[endif\]-->/g,
|
|
83
|
+
/<!--\[if mso\]>\s*<xml>\s*<w:WordDocument\s+xmlns:w="urn:schemas-microsoft-com:office:word">\s*<w:DontUseAdvancedTypographyReadingMail><\/w:DontUseAdvancedTypographyReadingMail>\s*<\/w:WordDocument>\s*<\/xml>\s*<!\[endif\]-->/g,
|
|
84
|
+
/<\!--\[if \!mso\]><\!--\s*\d*\s*-->\s*<\!--\[if \!mso\]><\!--\s*\d*\s*-->\s*<\!--<!\[endif\]-->/g,
|
|
85
|
+
/<!--\[if\s\!mso\]>\s*<!-- \d -->/g
|
|
86
|
+
],
|
|
87
|
+
priority: 22
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
id: "add-mso-conditions",
|
|
91
|
+
description: "Adding MSO Conditions",
|
|
92
|
+
type: "custom",
|
|
93
|
+
processor: (e) => {
|
|
94
|
+
const t = [
|
|
95
|
+
`<!--[if gte mso 9]>
|
|
96
|
+
<style>sup {
|
|
97
|
+
font-size: 100% !important;
|
|
98
|
+
}</style><![endif]-->`,
|
|
99
|
+
`<!--[if gte mso 9]>
|
|
100
|
+
<noscript>
|
|
101
|
+
<xml>
|
|
102
|
+
<o:OfficeDocumentSettings>
|
|
103
|
+
<o:AllowPNG></o:AllowPNG>
|
|
104
|
+
<o:PixelsPerInch>96</o:PixelsPerInch>
|
|
105
|
+
</o:OfficeDocumentSettings>
|
|
106
|
+
</xml>
|
|
107
|
+
</noscript><![endif]-->`,
|
|
108
|
+
`<!--[if mso]>
|
|
109
|
+
<xml>
|
|
110
|
+
<w:WordDocument xmlns:w="urn:schemas-microsoft-com:office:word">
|
|
111
|
+
<w:DontUseAdvancedTypographyReadingMail></w:DontUseAdvancedTypographyReadingMail>
|
|
112
|
+
</w:WordDocument>
|
|
113
|
+
</xml><![endif]-->`
|
|
114
|
+
], s = /<head>([\S\s]*)<\/head>/, o = new RegExp(s);
|
|
115
|
+
if (!e.match(o))
|
|
116
|
+
return e;
|
|
117
|
+
let i = e;
|
|
118
|
+
return t.forEach((r) => {
|
|
119
|
+
i = i.replace("</head>", `${r}</head>`);
|
|
120
|
+
}), i;
|
|
121
|
+
},
|
|
122
|
+
priority: 30
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
id: "replace-old-image-domain",
|
|
126
|
+
description: "Replacing old image domains",
|
|
127
|
+
type: "replace",
|
|
128
|
+
search: "stripo-editor-image.s3-eu-west-1.amazonaws.com",
|
|
129
|
+
replacement: "email-static.useinsider.com",
|
|
130
|
+
replaceAll: !0,
|
|
131
|
+
priority: 40
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
id: "replace-old-v2-image-domain",
|
|
135
|
+
description: "Replacing old image domains",
|
|
136
|
+
type: "replace",
|
|
137
|
+
search: "email.static.useinsider.com",
|
|
138
|
+
replacement: "email-static.useinsider.com",
|
|
139
|
+
replaceAll: !0,
|
|
140
|
+
priority: 41
|
|
141
|
+
}
|
|
142
|
+
];
|
|
143
|
+
export {
|
|
144
|
+
a as defaultHtmlCompilerRules
|
|
145
|
+
};
|
|
File without changes
|
package/dist/enums/defaults.js
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
|
-
const
|
|
2
|
-
translationsPath: "window.trans.en"
|
|
3
|
-
|
|
1
|
+
const e = {
|
|
2
|
+
translationsPath: "window.trans.en",
|
|
3
|
+
emailHeader: {
|
|
4
|
+
senderName: "",
|
|
5
|
+
subject: ""
|
|
6
|
+
},
|
|
7
|
+
features: {
|
|
8
|
+
dynamicContent: !0,
|
|
9
|
+
saveAsTemplate: !0,
|
|
10
|
+
versionHistory: !0
|
|
11
|
+
}
|
|
12
|
+
}, t = "newsletter", n = "Guido User";
|
|
4
13
|
export {
|
|
5
|
-
|
|
6
|
-
|
|
14
|
+
e as DefaultGuidoConfig,
|
|
15
|
+
t as DefaultProductType,
|
|
7
16
|
n as DefaultUsername
|
|
8
17
|
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
const e = [
|
|
2
|
+
{
|
|
3
|
+
category: "Demographics",
|
|
4
|
+
conditions: [
|
|
5
|
+
{
|
|
6
|
+
id: 1,
|
|
7
|
+
name: "Language",
|
|
8
|
+
description: "Users who are in the English will see the banner",
|
|
9
|
+
beforeScript: '{% if language == "en_US" %}',
|
|
10
|
+
afterScript: "{% endif %}"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
id: 2,
|
|
14
|
+
name: "Country",
|
|
15
|
+
description: "Only people who live in Australia will see the banner",
|
|
16
|
+
beforeScript: '{% if country == "Australia" %}',
|
|
17
|
+
afterScript: "{% endif %}"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
id: 3,
|
|
21
|
+
name: "Country & City",
|
|
22
|
+
description: "Only people who are located in that country and city",
|
|
23
|
+
beforeScript: '{% if country == "United Kingdom" and city == "London" %}',
|
|
24
|
+
afterScript: "{% endif %}"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
id: 4,
|
|
28
|
+
name: "Age (Less than operator)",
|
|
29
|
+
description: "Users whose age is less than 18",
|
|
30
|
+
beforeScript: "{% if age < 18 %}",
|
|
31
|
+
afterScript: "{% endif %}"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: 5,
|
|
35
|
+
name: "Age (Equal and greater than operator)",
|
|
36
|
+
description: "Users whose age is equal or greater than 25",
|
|
37
|
+
beforeScript: "{% if age >= 25 %}",
|
|
38
|
+
afterScript: "{% endif %}"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id: 6,
|
|
42
|
+
name: "Age (Greater than & less than operators)",
|
|
43
|
+
description: "Users whose age is between 18 and 25",
|
|
44
|
+
beforeScript: "{% if age > 18 and age < 25 %}",
|
|
45
|
+
afterScript: "{% endif %}"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: 7,
|
|
49
|
+
name: "Gender",
|
|
50
|
+
description: "Users whose gender is Female",
|
|
51
|
+
beforeScript: '{% if gender == "Female" %}',
|
|
52
|
+
afterScript: "{% endif %}"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
id: 8,
|
|
56
|
+
name: "State",
|
|
57
|
+
description: "Users whose state is one of the followings. c_state is a custom attribute. Use this condition if you have the attribute with the same naming. ",
|
|
58
|
+
beforeScript: '{% if c_state == "VIC" or c_state == "NSW" or c_state == "QLD" %}',
|
|
59
|
+
afterScript: "{% endif %}"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
id: 9,
|
|
63
|
+
name: "VIP User",
|
|
64
|
+
description: "Users who are VIP users for that brand. c_is_vip_user = true. c_is_vip_user is a custom attribute. Use this condition if you have the attribute with the same naming.",
|
|
65
|
+
beforeScript: "{% if c_is_vip_user %}",
|
|
66
|
+
afterScript: "{% endif %}"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
id: 10,
|
|
70
|
+
name: "Membership Type",
|
|
71
|
+
description: "Users who belong to gold or silver membership type. c_is_gold_member = true, c_is_silver_member = true. These are custom attributes. Use this condition if you have the attribute with the same naming.",
|
|
72
|
+
beforeScript: "{% if c_is_gold_member or c_is_silver_member %}",
|
|
73
|
+
afterScript: "{% endif %}"
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
];
|
|
78
|
+
export {
|
|
79
|
+
e as displayConditions
|
|
80
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const ResponsivePreviewConfig: {
|
|
2
|
+
DEFAULT_WIDTH: number;
|
|
3
|
+
MIN_SCALE: number;
|
|
4
|
+
RESIZE_DEBOUNCE_MS: number;
|
|
5
|
+
};
|
|
6
|
+
export declare const ResponsivePreviewRegex: {
|
|
7
|
+
INLINE_WIDTH: RegExp;
|
|
8
|
+
TABLE_WIDTH: RegExp;
|
|
9
|
+
META_VIEWPORT: RegExp;
|
|
10
|
+
};
|
|
11
|
+
export declare const ResponsivePreviewSelectors: {
|
|
12
|
+
CONTAINERS: string[];
|
|
13
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const e = {
|
|
2
|
+
DEFAULT_WIDTH: 600,
|
|
3
|
+
MIN_SCALE: 0.2,
|
|
4
|
+
RESIZE_DEBOUNCE_MS: 100
|
|
5
|
+
}, i = {
|
|
6
|
+
INLINE_WIDTH: /width\s*:\s*(\d+(\.\d+)?)px/i,
|
|
7
|
+
TABLE_WIDTH: /^(\d+(\.\d+)?)(px)?$/i,
|
|
8
|
+
META_VIEWPORT: /width\s*=\s*device-width/i
|
|
9
|
+
}, n = {
|
|
10
|
+
CONTAINERS: [
|
|
11
|
+
".wrapper",
|
|
12
|
+
".container",
|
|
13
|
+
"#wrapper",
|
|
14
|
+
"#container",
|
|
15
|
+
"[data-email-container]",
|
|
16
|
+
'[role="presentation"]'
|
|
17
|
+
]
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
e as ResponsivePreviewConfig,
|
|
21
|
+
i as ResponsivePreviewRegex,
|
|
22
|
+
n as ResponsivePreviewSelectors
|
|
23
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { DynamicContent } from '@@/Types/generic';
|
|
2
|
+
export declare class ExternalMergeTagsLibrary {
|
|
3
|
+
selectedDynamicContent: DynamicContent | null;
|
|
4
|
+
dataSelectCallback: (data: DynamicContent) => void;
|
|
5
|
+
openMergeTagsLibrary(dynamicContent: DynamicContent, onDataSelectCallback: (data: DynamicContent) => void): void;
|
|
6
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
var i = Object.defineProperty;
|
|
2
|
+
var d = (t, e, n) => e in t ? i(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var a = (t, e, n) => d(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
class y {
|
|
5
|
+
constructor() {
|
|
6
|
+
a(this, "selectedDynamicContent", null);
|
|
7
|
+
a(this, "dataSelectCallback", () => {
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
openMergeTagsLibrary(e, n) {
|
|
11
|
+
this.dataSelectCallback = n, this.selectedDynamicContent = e;
|
|
12
|
+
const s = new CustomEvent("dynamic-content:open", {
|
|
13
|
+
detail: {
|
|
14
|
+
attribute: e
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
document.dispatchEvent(s);
|
|
18
|
+
const o = (l) => {
|
|
19
|
+
const c = l.detail;
|
|
20
|
+
this.selectedDynamicContent = c, c.text && c.value && this.dataSelectCallback(c), document.removeEventListener("dynamic-content:close", o);
|
|
21
|
+
};
|
|
22
|
+
document.addEventListener("dynamic-content:close", o);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
y as ExternalMergeTagsLibrary
|
|
27
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const n = `
|
|
2
|
+
#guido__btn-add-dynamic-content {
|
|
3
|
+
background-color: transparent;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
#guido__btn-add-dynamic-content > button {
|
|
7
|
+
color: var(--guido-color-primary-500);
|
|
8
|
+
background-color: transparent;
|
|
9
|
+
box-shadow: none;
|
|
10
|
+
padding: 0;
|
|
11
|
+
border: none;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
#guido__btn-add-dynamic-content > button:hover {
|
|
15
|
+
text-decoration: underline;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.color-primary {
|
|
19
|
+
color: var(--guido-color-primary-500) !important;
|
|
20
|
+
}
|
|
21
|
+
`;
|
|
22
|
+
export {
|
|
23
|
+
n as default
|
|
24
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { UIElementType, UIElement, UIElementTagRegistry } from '@stripoinc/ui-editor-extensions';
|
|
2
|
+
export declare class DynamicContentTagRegistry extends UIElementTagRegistry {
|
|
3
|
+
registerUiElements(uiElementsTagsMap: Record<UIElementType, string>): void;
|
|
4
|
+
}
|
|
5
|
+
export declare class DynamicContentUiElementExtension extends UIElement {
|
|
6
|
+
private mergeTagsButton;
|
|
7
|
+
private listener;
|
|
8
|
+
private mergeTagsLibrary;
|
|
9
|
+
private selectedDynamicContent;
|
|
10
|
+
getId(): string;
|
|
11
|
+
onRender(container: HTMLElement): void;
|
|
12
|
+
onDestroy(): void;
|
|
13
|
+
_onClick(): void;
|
|
14
|
+
openMergeTagLibrary(): void;
|
|
15
|
+
getTemplate(): string;
|
|
16
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
var o = Object.defineProperty;
|
|
2
|
+
var m = (i, t, e) => t in i ? o(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
|
+
var r = (i, t, e) => m(i, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { dynamicContentToMergeTags as l } from "../../utils/genericUtil.js";
|
|
5
|
+
import { d as n } from "../../_virtual/index.js";
|
|
6
|
+
import { ExternalMergeTagsLibrary as g } from "./dynamic-content-modal.js";
|
|
7
|
+
const a = "external-dynamic-content-ui-element", c = "button-add-dynamic-content";
|
|
8
|
+
class p extends n.UIElementTagRegistry {
|
|
9
|
+
registerUiElements(t) {
|
|
10
|
+
t[n.UIElementType.MERGETAGS] = a;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
class u extends n.UIElement {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
r(this, "mergeTagsButton", null);
|
|
17
|
+
r(this, "listener", () => {
|
|
18
|
+
});
|
|
19
|
+
r(this, "mergeTagsLibrary", null);
|
|
20
|
+
r(this, "selectedDynamicContent", { value: "", text: "" });
|
|
21
|
+
}
|
|
22
|
+
getId() {
|
|
23
|
+
return a;
|
|
24
|
+
}
|
|
25
|
+
onRender(e) {
|
|
26
|
+
var s;
|
|
27
|
+
this.listener = this._onClick.bind(this), this.mergeTagsButton = e.querySelector("#guido__btn-add-dynamic-content"), (s = this.mergeTagsButton) == null || s.addEventListener("click", this.listener);
|
|
28
|
+
}
|
|
29
|
+
onDestroy() {
|
|
30
|
+
var e;
|
|
31
|
+
(e = this.mergeTagsButton) == null || e.removeEventListener("click", this.listener);
|
|
32
|
+
}
|
|
33
|
+
_onClick() {
|
|
34
|
+
this.openMergeTagLibrary();
|
|
35
|
+
}
|
|
36
|
+
openMergeTagLibrary() {
|
|
37
|
+
this.mergeTagsLibrary || (this.mergeTagsLibrary = new g()), this.mergeTagsLibrary.openMergeTagsLibrary(
|
|
38
|
+
this.selectedDynamicContent,
|
|
39
|
+
(e) => {
|
|
40
|
+
this.api.onValueChanged(l([e])[0]);
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
getTemplate() {
|
|
45
|
+
return `
|
|
46
|
+
<div>
|
|
47
|
+
<${n.UIElementType.BUTTON}
|
|
48
|
+
id="guido__btn-add-dynamic-content"
|
|
49
|
+
class="btn btn-primary"
|
|
50
|
+
${n.UEAttr.BUTTON.name}="${c}">
|
|
51
|
+
<${n.UIElementType.ICON} src="plus" class="icon icon-button color-primary">
|
|
52
|
+
</${n.UIElementType.ICON}>
|
|
53
|
+
${this.api.translate("Add Dynamic Content")}
|
|
54
|
+
</${n.UIElementType.BUTTON}>
|
|
55
|
+
</div>`;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
export {
|
|
59
|
+
p as DynamicContentTagRegistry,
|
|
60
|
+
u as DynamicContentUiElementExtension
|
|
61
|
+
};
|