@useinsider/guido 1.0.0-beta.df613dd → 1.0.0-beta.e08abf8
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 +386 -21
- package/dist/@types/generic.d.ts +8 -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 +16 -3
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +61 -24
- 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 +7 -7
- package/dist/components/organisms/header/MiddleSlot.vue2.js +6 -4
- package/dist/components/organisms/header/RightSlot.vue.js +7 -10
- package/dist/components/organisms/header/RightSlot.vue2.js +27 -16
- package/dist/components/organisms/header/ViewOptions.vue.d.ts +1 -1
- 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/composables/useActionsApi.d.ts +1 -0
- package/dist/composables/useActionsApi.js +14 -12
- package/dist/composables/useCustomInterfaceAppearance.js +45 -9
- 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 +16 -0
- package/dist/composables/useProvideInject.d.ts +14 -0
- package/dist/composables/useProvideInject.js +17 -0
- package/dist/composables/useStripo.js +45 -28
- 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/displayConditions.d.ts +2 -0
- package/dist/enums/displayConditions.js +80 -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 +63 -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/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/services/stripoApi.d.ts +2 -1
- package/dist/services/stripoApi.js +27 -7
- 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/utils/htmlCompiler.d.ts +12 -0
- package/dist/utils/htmlCompiler.js +70 -0
- package/package.json +6 -5
- 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,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
|
};
|
|
@@ -1,30 +1,45 @@
|
|
|
1
1
|
import { useActionsApi as l } from "./useActionsApi.js";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
import { useHtmlCompiler as m } from "./useHtmlCompiler.js";
|
|
3
|
+
import { useToaster as d } from "./useToaster.js";
|
|
4
|
+
const h = () => {
|
|
5
|
+
const a = (s, o, r) => {
|
|
6
|
+
const i = new Blob([s], { type: r }), t = URL.createObjectURL(i), e = document.createElement("a");
|
|
7
|
+
e.href = t, e.download = o, document.body.appendChild(e), e.click(), document.body.removeChild(e), URL.revokeObjectURL(t);
|
|
8
|
+
}, c = (s) => {
|
|
9
|
+
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");
|
|
10
|
+
return `${s}_${r}-${i}-${t}_${e}-${n}.html`;
|
|
10
11
|
};
|
|
11
|
-
return { exportHtml: async () => {
|
|
12
|
-
const { getCompiledEmail:
|
|
12
|
+
return { exportHtml: async (s = !0) => {
|
|
13
|
+
const { getCompiledEmail: o } = l(), { showToaster: r } = d(), { compileHtml: i } = m();
|
|
13
14
|
try {
|
|
14
|
-
const { html:
|
|
15
|
-
|
|
15
|
+
const { html: t } = await o();
|
|
16
|
+
if (t) {
|
|
17
|
+
let e = t;
|
|
18
|
+
if (s) {
|
|
19
|
+
const n = i(t);
|
|
20
|
+
e = n.compiledHtml, console.debug("HTML Compilation Stats:", {
|
|
21
|
+
originalSize: n.stats.originalSize,
|
|
22
|
+
compiledSize: n.stats.compiledSize,
|
|
23
|
+
reduction: `${n.stats.reductionPercentage.toFixed(2)}%`,
|
|
24
|
+
appliedRules: n.appliedRules,
|
|
25
|
+
executionTime: `${n.stats.executionTime.toFixed(2)}ms`
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
a(e, c("HTML"), "text/html");
|
|
29
|
+
} else
|
|
30
|
+
r({
|
|
31
|
+
type: "error",
|
|
32
|
+
message: "No HTML content to download"
|
|
33
|
+
});
|
|
34
|
+
} catch (t) {
|
|
35
|
+
const e = t instanceof Error ? t.message : String(t);
|
|
36
|
+
r({
|
|
16
37
|
type: "error",
|
|
17
|
-
message:
|
|
18
|
-
});
|
|
19
|
-
} catch (e) {
|
|
20
|
-
const n = e instanceof Error ? e.message : String(e);
|
|
21
|
-
t({
|
|
22
|
-
type: "error",
|
|
23
|
-
message: `Error compiling email: ${n}`
|
|
38
|
+
message: `Error compiling email: ${e}`
|
|
24
39
|
});
|
|
25
40
|
}
|
|
26
41
|
} };
|
|
27
42
|
};
|
|
28
43
|
export {
|
|
29
|
-
|
|
44
|
+
h as useExport
|
|
30
45
|
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { Template } 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<Template, '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,16 @@
|
|
|
1
|
+
import { defaultHtmlCompilerRules as r } from "../config/compiler/htmlCompilerRules.js";
|
|
2
|
+
import { createHtmlCompiler as p } from "../utils/htmlCompiler.js";
|
|
3
|
+
const a = () => {
|
|
4
|
+
const e = typeof window < "u" ? window.GuidoConfig : void 0, l = (e == null ? void 0 : e.htmlCompilerRules) || [], t = [
|
|
5
|
+
...!!(e != null && e.ignoreDefaultHtmlCompilerRules) ? [] : r,
|
|
6
|
+
...l.map((o, m) => ({
|
|
7
|
+
...o,
|
|
8
|
+
priority: o.priority + 1e3 + m
|
|
9
|
+
// Ensure additional rules run after default rules
|
|
10
|
+
}))
|
|
11
|
+
], i = p(t);
|
|
12
|
+
return { compileHtml: (o) => i.compile(o) };
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
a as useHtmlCompiler
|
|
16
|
+
};
|
|
@@ -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
|
+
};
|
|
@@ -1,74 +1,91 @@
|
|
|
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 E } from "./useToaster.js";
|
|
4
|
+
import { displayConditions as S } from "../enums/displayConditions.js";
|
|
5
|
+
import y from "../extensions/DynamicContent/extension.js";
|
|
6
|
+
import { useStripoApi as C } from "../services/stripoApi.js";
|
|
7
|
+
import { useEditorStore as w } from "../stores/editor.js";
|
|
8
|
+
const A = (a) => {
|
|
9
|
+
const { handleError: d } = E(), { getToken: c, getCustomFonts: u } = C(), l = (e, r = []) => {
|
|
10
|
+
const i = w(), { html: t, css: s, forceRecreate: m } = e;
|
|
8
11
|
window.UIEditor.initEditor(
|
|
9
12
|
document.querySelector("#guido-editor"),
|
|
10
13
|
{
|
|
11
|
-
metadata:
|
|
14
|
+
metadata: a,
|
|
12
15
|
html: t,
|
|
13
|
-
css:
|
|
16
|
+
css: s,
|
|
17
|
+
forceRecreate: m,
|
|
14
18
|
locale: "en",
|
|
15
19
|
undoButtonSelector: "#guido__undo-button",
|
|
16
20
|
redoButtonSelector: "#guido__redo-button",
|
|
17
21
|
mobileViewButtonSelector: ".guido__view-option-selection-mobile",
|
|
18
22
|
desktopViewButtonSelector: ".guido__view-option-selection-desktop",
|
|
19
23
|
codeEditorButtonSelector: "#guido__code-button",
|
|
24
|
+
customAppearanceMergetags: !0,
|
|
25
|
+
customAppearanceMergetagsBorderColor: "#f1f3fe",
|
|
26
|
+
customAppearanceMergetagsBackgroundColor: "#f1f3fe",
|
|
27
|
+
customViewStyles: `
|
|
28
|
+
.esd-x, .esd-merge-tag {color: #0a2ecc !important; box-shadow: none !important;}
|
|
29
|
+
.esd-merge-tag {border: 1px solid #b5c1f1; border-radius: 4px !important;}
|
|
30
|
+
`,
|
|
31
|
+
conditionsEnabled: !0,
|
|
32
|
+
customConditionsEnabled: !0,
|
|
33
|
+
conditionCategories: S,
|
|
34
|
+
messageSettingsEnabled: !1,
|
|
20
35
|
editorFonts: {
|
|
21
36
|
showDefaultStandardFonts: !0,
|
|
22
37
|
showDefaultNotStandardFonts: !0,
|
|
23
|
-
customFonts:
|
|
38
|
+
customFonts: r
|
|
24
39
|
},
|
|
25
40
|
async onTokenRefreshRequest(o) {
|
|
26
41
|
try {
|
|
27
|
-
const
|
|
28
|
-
o(
|
|
29
|
-
} catch (
|
|
30
|
-
d(
|
|
42
|
+
const n = await c();
|
|
43
|
+
o(n);
|
|
44
|
+
} catch (n) {
|
|
45
|
+
d(n, "Failed to refresh token");
|
|
31
46
|
}
|
|
32
47
|
},
|
|
33
48
|
onTemplateLoaded() {
|
|
34
49
|
try {
|
|
35
|
-
const { importCss: o } =
|
|
36
|
-
o();
|
|
50
|
+
const { importCss: o } = f(), { activateCustomViewStyles: n } = g();
|
|
51
|
+
o(), n();
|
|
37
52
|
} catch (o) {
|
|
38
53
|
d(o, "Failed to load custom interface appearance");
|
|
39
54
|
}
|
|
40
55
|
},
|
|
41
56
|
onCodeEditorVisibilityChanged(o) {
|
|
42
|
-
|
|
57
|
+
i.isCodeEditorOpen = o;
|
|
43
58
|
},
|
|
44
59
|
onEditorVisualModeChanged(o) {
|
|
45
|
-
|
|
60
|
+
i.editorVisualMode = o.toLowerCase();
|
|
46
61
|
},
|
|
47
62
|
onVersionHistoryVisibilityChanged(o) {
|
|
48
|
-
|
|
49
|
-
}
|
|
63
|
+
i.isVersionHistoryOpen = o;
|
|
64
|
+
},
|
|
65
|
+
ignoreClickOutsideSelectors: ["#guido-dynamic-content-modal"],
|
|
66
|
+
extensions: [y]
|
|
50
67
|
}
|
|
51
68
|
);
|
|
52
|
-
}, p = (e) => new Promise((
|
|
69
|
+
}, p = (e) => new Promise((r, i) => {
|
|
53
70
|
if (document.getElementById("UiEditorScript")) {
|
|
54
|
-
e(),
|
|
71
|
+
e(), r();
|
|
55
72
|
return;
|
|
56
73
|
}
|
|
57
74
|
const t = document.createElement("script");
|
|
58
75
|
t.id = "UiEditorScript", t.type = "module", t.src = "https://plugins.stripo.email/resources/uieditor/latest/UIEditor.js", t.onload = () => {
|
|
59
|
-
e(),
|
|
76
|
+
e(), r();
|
|
60
77
|
}, t.onerror = () => {
|
|
61
|
-
const
|
|
62
|
-
|
|
78
|
+
const s = new Error("Failed to load Stripo UIEditor script");
|
|
79
|
+
i(s);
|
|
63
80
|
}, document.body.appendChild(t);
|
|
64
81
|
});
|
|
65
82
|
return { initPlugin: async (e) => {
|
|
66
83
|
await p(async () => {
|
|
67
|
-
const
|
|
68
|
-
l(e,
|
|
84
|
+
const r = await u();
|
|
85
|
+
l(e, r);
|
|
69
86
|
});
|
|
70
87
|
} };
|
|
71
88
|
};
|
|
72
89
|
export {
|
|
73
|
-
|
|
90
|
+
A as useStripo
|
|
74
91
|
};
|
|
@@ -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
|
|
@@ -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,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
|
+
};
|