@useinsider/guido 1.0.0-beta.80693fc → 1.0.0-beta.83deaec
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 +12 -265
- package/dist/@types/generic.d.ts +0 -14
- package/dist/App.vue.d.ts +1 -1
- package/dist/components/Guido.vue.d.ts +2 -9
- package/dist/components/Guido.vue.js +8 -8
- package/dist/components/Guido.vue2.js +27 -38
- package/dist/components/organisms/base/ModalWrapper.vue.d.ts +72 -0
- package/dist/components/organisms/base/ModalWrapper.vue.js +19 -0
- package/dist/components/organisms/base/ModalWrapper.vue2.js +43 -0
- package/dist/components/organisms/header/LeftSlot.vue.d.ts +1 -1
- package/dist/components/organisms/header/LeftSlot.vue.js +8 -8
- package/dist/components/organisms/header/LeftSlot.vue2.js +3 -5
- package/dist/components/organisms/header/MiddleSlot.vue.js +8 -8
- package/dist/components/organisms/header/MiddleSlot.vue2.js +15 -19
- package/dist/components/organisms/header/RightSlot.vue.js +13 -10
- package/dist/components/organisms/header/RightSlot.vue2.js +17 -16
- package/dist/components/organisms/header/ViewOptions.vue.d.ts +1 -1
- package/dist/components/organisms/header/version-history/VersionHistory.vue.d.ts +1 -13
- package/dist/components/organisms/header/version-history/VersionHistory.vue.js +7 -7
- package/dist/components/organisms/header/version-history/VersionHistory.vue2.js +10 -13
- 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/save-template/SaveTemplateModal.vue.d.ts +21 -0
- package/dist/components/organisms/save-template/SaveTemplateModal.vue.js +22 -0
- package/dist/components/organisms/save-template/SaveTemplateModal.vue2.js +81 -0
- package/dist/composables/useActionsApi.d.ts +0 -1
- package/dist/composables/useActionsApi.js +12 -14
- package/dist/composables/useCustomInterfaceAppearance.js +9 -45
- package/dist/composables/useExport.d.ts +1 -1
- package/dist/composables/useExport.js +20 -35
- package/dist/composables/useStripo.js +28 -44
- package/dist/composables/useTemplateCategories.d.ts +38 -0
- package/dist/composables/useTemplateCategories.js +80 -0
- package/dist/composables/useTemplateValidation.d.ts +13 -0
- package/dist/composables/useTemplateValidation.js +57 -0
- package/dist/guido.css +1 -1
- package/dist/mock/api/template-library.d.ts +2 -0
- package/dist/static/editor.css.js +232 -0
- package/dist/stores/editor.d.ts +1 -1
- package/dist/stores/editor.js +4 -4
- package/package.json +5 -6
- package/dist/_virtual/AddCustomFont.js +0 -4
- package/dist/_virtual/AiAssistantValueType.js +0 -4
- package/dist/_virtual/BackgroundColorBuiltInControl.js +0 -4
- package/dist/_virtual/BackgroundImageBuiltInControl.js +0 -4
- package/dist/_virtual/Block.js +0 -4
- package/dist/_virtual/BlockAttributes.js +0 -4
- package/dist/_virtual/BlockCompositionType.js +0 -4
- package/dist/_virtual/BlockPaddingsBuiltInControl.js +0 -4
- package/dist/_virtual/BlockRenderer.js +0 -4
- package/dist/_virtual/BlockType.js +0 -4
- package/dist/_virtual/BlocksPanel.js +0 -4
- package/dist/_virtual/BuiltInControl.js +0 -4
- package/dist/_virtual/BuiltInControlTypes.js +0 -4
- package/dist/_virtual/ButtonBorderBuiltInControl.js +0 -4
- package/dist/_virtual/ButtonColorBuiltInControl.js +0 -4
- package/dist/_virtual/ButtonFontColorBuiltInControl.js +0 -4
- package/dist/_virtual/ButtonInternalIndentsBuiltInControl.js +0 -4
- package/dist/_virtual/ButtonTextBuiltInControl.js +0 -4
- package/dist/_virtual/ContextAction.js +0 -4
- package/dist/_virtual/ContextActionType.js +0 -4
- package/dist/_virtual/Control.js +0 -4
- package/dist/_virtual/EditorStatePropertyType.js +0 -4
- package/dist/_virtual/Extension.js +0 -4
- package/dist/_virtual/ExtensionBuilder.js +0 -4
- package/dist/_virtual/FontFamilyBuiltInControl.js +0 -4
- package/dist/_virtual/LinkColorBuiltInControl.js +0 -4
- package/dist/_virtual/ModificationDescription.js +0 -4
- package/dist/_virtual/PanelPosition.js +0 -4
- package/dist/_virtual/PreviewDeviceMode.js +0 -4
- package/dist/_virtual/SettingsPanelRegistry.js +0 -4
- package/dist/_virtual/SettingsPanelTab.js +0 -4
- package/dist/_virtual/SettingsTab.js +0 -4
- package/dist/_virtual/StructureBorderBuiltInControl.js +0 -4
- package/dist/_virtual/StructurePaddingsBuiltInControl.js +0 -4
- package/dist/_virtual/TextColorBuiltInControl.js +0 -4
- package/dist/_virtual/TextLineSpacingBuiltInControl.js +0 -4
- package/dist/_virtual/TextSizeBuiltInControl.js +0 -4
- package/dist/_virtual/TextStyleBuiltInControl.js +0 -4
- package/dist/_virtual/UIElement.js +0 -4
- package/dist/_virtual/UIElementTagRegistry.js +0 -4
- package/dist/_virtual/UIElementType.js +0 -4
- package/dist/_virtual/UIElementsAttributes.js +0 -4
- package/dist/_virtual/index.js +0 -5
- package/dist/_virtual/index2.js +0 -4
- package/dist/components/organisms/header/version-history/RestoreButton.vue.d.ts +0 -2
- package/dist/components/organisms/header/version-history/RestoreButton.vue.js +0 -19
- package/dist/components/organisms/header/version-history/RestoreButton.vue2.js +0 -14
- package/dist/composables/useHtmlCompiler.d.ts +0 -4
- package/dist/composables/useHtmlCompiler.js +0 -16
- package/dist/config/compiler/htmlCompilerRules.d.ts +0 -2
- package/dist/config/compiler/htmlCompilerRules.js +0 -145
- package/dist/config/compiler/outlookCompilerRules.d.ts +0 -0
- package/dist/enums/displayConditions.d.ts +0 -2
- package/dist/enums/displayConditions.js +0 -80
- package/dist/extensions/DynamicContent/dynamic-content-modal.d.ts +0 -6
- package/dist/extensions/DynamicContent/dynamic-content-modal.js +0 -27
- package/dist/extensions/DynamicContent/dynamic-content.css.js +0 -24
- package/dist/extensions/DynamicContent/dynamic-content.d.ts +0 -16
- package/dist/extensions/DynamicContent/dynamic-content.js +0 -63
- package/dist/extensions/DynamicContent/extension.d.ts +0 -2
- package/dist/extensions/DynamicContent/extension.js +0 -11
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/Extension.js +0 -51
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ExtensionBuilder.js +0 -52
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/Block.js +0 -41
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/BlockRenderer.js +0 -18
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/BlocksPanel.js +0 -32
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/ContextAction.js +0 -18
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/AddCustomFont.js +0 -8
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/AiAssistantValueType.js +0 -13
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockAttributes.js +0 -34
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockCompositionType.js +0 -13
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockType.js +0 -13
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BuiltInControlTypes.js +0 -104
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/ContextActionType.js +0 -13
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/EditorStatePropertyType.js +0 -13
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PanelPosition.js +0 -13
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PreviewDeviceMode.js +0 -13
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/SettingsTab.js +0 -13
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementType.js +0 -13
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementsAttributes.js +0 -45
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BackgroundColorBuiltInControl.js +0 -43
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BackgroundImageBuiltInControl.js +0 -46
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BlockPaddingsBuiltInControl.js +0 -44
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BuiltInControl.js +0 -22
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonBorderBuiltInControl.js +0 -46
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonColorBuiltInControl.js +0 -46
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonFontColorBuiltInControl.js +0 -45
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonInternalIndentsBuiltInControl.js +0 -45
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonTextBuiltInControl.js +0 -45
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/Control.js +0 -20
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/FontFamilyBuiltInControl.js +0 -43
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/LinkColorBuiltInControl.js +0 -45
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelRegistry.js +0 -18
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelTab.js +0 -32
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/StructureBorderBuiltInControl.js +0 -46
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/StructurePaddingsBuiltInControl.js +0 -44
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextColorBuiltInControl.js +0 -43
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextLineSpacingBuiltInControl.js +0 -43
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextSizeBuiltInControl.js +0 -45
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextStyleBuiltInControl.js +0 -43
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/index.js +0 -266
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/modifications/ModificationDescription.js +0 -26
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElement.js +0 -22
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElementTagRegistry.js +0 -18
- package/dist/static/styles/base.css.js +0 -11
- package/dist/static/styles/components/alert-message.css.js +0 -39
- package/dist/static/styles/components/amp-block.css.js +0 -18
- package/dist/static/styles/components/base-input.css.js +0 -47
- package/dist/static/styles/components/button-group.css.js +0 -54
- package/dist/static/styles/components/button.css.js +0 -106
- package/dist/static/styles/components/combobox.css.js +0 -49
- package/dist/static/styles/components/counter.css.js +0 -42
- package/dist/static/styles/components/dropdown-menu.css.js +0 -52
- package/dist/static/styles/components/narrow-panel.css.js +0 -38
- package/dist/static/styles/components/switcher.css.js +0 -11
- package/dist/static/styles/components/tabs.css.js +0 -97
- package/dist/static/styles/components/tools.css.js +0 -23
- package/dist/static/styles/components/version-history.css.js +0 -30
- package/dist/static/styles/components/wide-panel.css.js +0 -135
- package/dist/static/styles/variables.css.js +0 -23
- package/dist/utils/htmlCompiler.d.ts +0 -12
- package/dist/utils/htmlCompiler.js +0 -70
- package/dist/utils/tooltipUtils.d.ts +0 -2
- package/dist/utils/tooltipUtils.js +0 -9
|
@@ -1,90 +1,74 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const x = (a) => {
|
|
9
|
-
const { handleError: d } = f(), { getToken: c, getCustomFonts: u } = y(), l = (e, r = []) => {
|
|
10
|
-
const i = C(), { html: t, css: s } = e;
|
|
1
|
+
import { useCustomInterfaceAppearance as m } from "./useCustomInterfaceAppearance.js";
|
|
2
|
+
import { useToaster as g } from "./useToaster.js";
|
|
3
|
+
import { useStripoApi as E } from "../services/stripoApi.js";
|
|
4
|
+
import { useEditorStore as S } from "../stores/editor.js";
|
|
5
|
+
const _ = (c) => {
|
|
6
|
+
const { handleError: d } = g(), { getToken: u, getCustomFonts: a } = E(), l = (e, i = []) => {
|
|
7
|
+
const r = S(), { html: t, css: n } = e;
|
|
11
8
|
window.UIEditor.initEditor(
|
|
12
9
|
document.querySelector("#guido-editor"),
|
|
13
10
|
{
|
|
14
|
-
metadata:
|
|
11
|
+
metadata: c,
|
|
15
12
|
html: t,
|
|
16
|
-
css:
|
|
13
|
+
css: n,
|
|
17
14
|
locale: "en",
|
|
18
15
|
undoButtonSelector: "#guido__undo-button",
|
|
19
16
|
redoButtonSelector: "#guido__redo-button",
|
|
20
17
|
mobileViewButtonSelector: ".guido__view-option-selection-mobile",
|
|
21
18
|
desktopViewButtonSelector: ".guido__view-option-selection-desktop",
|
|
22
19
|
codeEditorButtonSelector: "#guido__code-button",
|
|
23
|
-
customAppearanceMergetags: !0,
|
|
24
|
-
customAppearanceMergetagsBorderColor: "#f1f3fe",
|
|
25
|
-
customAppearanceMergetagsBackgroundColor: "#f1f3fe",
|
|
26
|
-
customViewStyles: `
|
|
27
|
-
.esd-x, .esd-merge-tag {color: #0a2ecc !important; box-shadow: none !important;}
|
|
28
|
-
.esd-merge-tag {border: 1px solid #b5c1f1; border-radius: 4px !important;}
|
|
29
|
-
`,
|
|
30
|
-
conditionsEnabled: !0,
|
|
31
|
-
customConditionsEnabled: !0,
|
|
32
|
-
conditionCategories: E,
|
|
33
|
-
messageSettingsEnabled: !1,
|
|
34
20
|
editorFonts: {
|
|
35
21
|
showDefaultStandardFonts: !0,
|
|
36
22
|
showDefaultNotStandardFonts: !0,
|
|
37
|
-
customFonts:
|
|
23
|
+
customFonts: i
|
|
38
24
|
},
|
|
39
25
|
async onTokenRefreshRequest(o) {
|
|
40
26
|
try {
|
|
41
|
-
const
|
|
42
|
-
o(
|
|
43
|
-
} catch (
|
|
44
|
-
d(
|
|
27
|
+
const s = await u();
|
|
28
|
+
o(s);
|
|
29
|
+
} catch (s) {
|
|
30
|
+
d(s, "Failed to refresh token");
|
|
45
31
|
}
|
|
46
32
|
},
|
|
47
33
|
onTemplateLoaded() {
|
|
48
34
|
try {
|
|
49
|
-
const { importCss: o } =
|
|
50
|
-
o()
|
|
35
|
+
const { importCss: o } = m();
|
|
36
|
+
o();
|
|
51
37
|
} catch (o) {
|
|
52
38
|
d(o, "Failed to load custom interface appearance");
|
|
53
39
|
}
|
|
54
40
|
},
|
|
55
41
|
onCodeEditorVisibilityChanged(o) {
|
|
56
|
-
|
|
42
|
+
r.isCodeEditorOpen = o;
|
|
57
43
|
},
|
|
58
44
|
onEditorVisualModeChanged(o) {
|
|
59
|
-
|
|
45
|
+
r.editorVisualMode = o.toLowerCase();
|
|
60
46
|
},
|
|
61
47
|
onVersionHistoryVisibilityChanged(o) {
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
ignoreClickOutsideSelectors: ["#guido-dynamic-content-modal"],
|
|
65
|
-
extensions: [S]
|
|
48
|
+
r.isVersionHistoryOpen = o;
|
|
49
|
+
}
|
|
66
50
|
}
|
|
67
51
|
);
|
|
68
|
-
}, p = (e) => new Promise((
|
|
52
|
+
}, p = (e) => new Promise((i, r) => {
|
|
69
53
|
if (document.getElementById("UiEditorScript")) {
|
|
70
|
-
e(),
|
|
54
|
+
e(), i();
|
|
71
55
|
return;
|
|
72
56
|
}
|
|
73
57
|
const t = document.createElement("script");
|
|
74
58
|
t.id = "UiEditorScript", t.type = "module", t.src = "https://plugins.stripo.email/resources/uieditor/latest/UIEditor.js", t.onload = () => {
|
|
75
|
-
e(),
|
|
59
|
+
e(), i();
|
|
76
60
|
}, t.onerror = () => {
|
|
77
|
-
const
|
|
78
|
-
|
|
61
|
+
const n = new Error("Failed to load Stripo UIEditor script");
|
|
62
|
+
r(n);
|
|
79
63
|
}, document.body.appendChild(t);
|
|
80
64
|
});
|
|
81
65
|
return { initPlugin: async (e) => {
|
|
82
66
|
await p(async () => {
|
|
83
|
-
const
|
|
84
|
-
l(e,
|
|
67
|
+
const i = await a();
|
|
68
|
+
l(e, i);
|
|
85
69
|
});
|
|
86
70
|
} };
|
|
87
71
|
};
|
|
88
72
|
export {
|
|
89
|
-
|
|
73
|
+
_ as useStripo
|
|
90
74
|
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { TemplateCategory } from '@@/Types/template-categories';
|
|
2
|
+
interface MappedCategory {
|
|
3
|
+
value: string;
|
|
4
|
+
text: string;
|
|
5
|
+
}
|
|
6
|
+
interface GetDataProps {
|
|
7
|
+
getInitialData?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const useTemplateCategories: ({ getInitialData }?: GetDataProps) => {
|
|
10
|
+
data: {
|
|
11
|
+
loading: boolean;
|
|
12
|
+
loadingCreate: boolean;
|
|
13
|
+
categories: {
|
|
14
|
+
id: number;
|
|
15
|
+
name: string;
|
|
16
|
+
partnerId: number;
|
|
17
|
+
isStripo: boolean;
|
|
18
|
+
templatesCount: number;
|
|
19
|
+
}[];
|
|
20
|
+
mappedCategories: {
|
|
21
|
+
value: string;
|
|
22
|
+
text: string;
|
|
23
|
+
}[];
|
|
24
|
+
selectedCategories: {
|
|
25
|
+
value: string;
|
|
26
|
+
text: string;
|
|
27
|
+
}[];
|
|
28
|
+
};
|
|
29
|
+
fetchCategories: () => Promise<void>;
|
|
30
|
+
createCategory: (name: string) => Promise<void>;
|
|
31
|
+
selectCategory: (category: MappedCategory) => void;
|
|
32
|
+
setSelectedCategories: (categories: MappedCategory[]) => void;
|
|
33
|
+
resetSelection: () => void;
|
|
34
|
+
getSelectedCategoryIds: import("vue").ComputedRef<number[]>;
|
|
35
|
+
getCategoryById: (id: number) => TemplateCategory | undefined;
|
|
36
|
+
getCategoryByName: (name: string) => TemplateCategory | undefined;
|
|
37
|
+
};
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { useHttp as x } from "./useHttp.js";
|
|
2
|
+
import { useToaster as v } from "./useToaster.js";
|
|
3
|
+
import { reactive as E, computed as I } from "vue";
|
|
4
|
+
const T = ({ getInitialData: l = !1 } = {}) => {
|
|
5
|
+
const { get: c, post: d } = x(), { handleError: o, showToaster: n } = v(), e = E({
|
|
6
|
+
loading: !1,
|
|
7
|
+
loadingCreate: !1,
|
|
8
|
+
categories: [],
|
|
9
|
+
mappedCategories: [],
|
|
10
|
+
selectedCategories: []
|
|
11
|
+
}), i = async () => {
|
|
12
|
+
e.loading = !0;
|
|
13
|
+
try {
|
|
14
|
+
const a = (await c("/newsletter/template-library/get-template-categories")).data || [];
|
|
15
|
+
e.categories = a, e.mappedCategories = a.map((s) => ({
|
|
16
|
+
value: s.id.toString(),
|
|
17
|
+
text: s.name
|
|
18
|
+
}));
|
|
19
|
+
} catch (t) {
|
|
20
|
+
o(t, "Error fetching template categories:"), e.categories = [], e.mappedCategories = [];
|
|
21
|
+
} finally {
|
|
22
|
+
e.loading = !1;
|
|
23
|
+
}
|
|
24
|
+
}, p = async (t) => {
|
|
25
|
+
try {
|
|
26
|
+
const s = `/newsletter/template-library/category-name-exists?name=${encodeURIComponent(t)}`;
|
|
27
|
+
return (await c(s)).data.status;
|
|
28
|
+
} catch (a) {
|
|
29
|
+
return o(a, "Error checking category name:"), !1;
|
|
30
|
+
}
|
|
31
|
+
}, m = async (t) => {
|
|
32
|
+
e.loadingCreate = !0;
|
|
33
|
+
try {
|
|
34
|
+
if (await p(t)) {
|
|
35
|
+
n({
|
|
36
|
+
type: "error",
|
|
37
|
+
message: "Category name already exists"
|
|
38
|
+
});
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const r = (await d("/newsletter/template-library/create-category", { name: t })).data;
|
|
42
|
+
if (r) {
|
|
43
|
+
e.categories.push(r);
|
|
44
|
+
const g = {
|
|
45
|
+
value: r.id.toString(),
|
|
46
|
+
text: r.name
|
|
47
|
+
};
|
|
48
|
+
e.mappedCategories.push(g), e.selectedCategories.push(g), n({
|
|
49
|
+
type: "success",
|
|
50
|
+
message: "Category created successfully"
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
} catch (a) {
|
|
54
|
+
o(a, "Error creating category:");
|
|
55
|
+
} finally {
|
|
56
|
+
e.loadingCreate = !1;
|
|
57
|
+
}
|
|
58
|
+
}, C = (t) => {
|
|
59
|
+
const a = e.selectedCategories.findIndex((s) => s.value === t.value);
|
|
60
|
+
a === -1 ? e.selectedCategories.push(t) : e.selectedCategories.splice(a, 1);
|
|
61
|
+
}, y = (t) => {
|
|
62
|
+
e.selectedCategories = [...t];
|
|
63
|
+
}, u = () => {
|
|
64
|
+
e.selectedCategories = [];
|
|
65
|
+
}, f = I(() => e.selectedCategories.map((t) => parseInt(t.value))), h = (t) => e.categories.find((a) => a.id === t), w = (t) => e.categories.find((a) => a.name.toLowerCase() === t.toLowerCase());
|
|
66
|
+
return l && i(), {
|
|
67
|
+
data: e,
|
|
68
|
+
fetchCategories: i,
|
|
69
|
+
createCategory: m,
|
|
70
|
+
selectCategory: C,
|
|
71
|
+
setSelectedCategories: y,
|
|
72
|
+
resetSelection: u,
|
|
73
|
+
getSelectedCategoryIds: f,
|
|
74
|
+
getCategoryById: h,
|
|
75
|
+
getCategoryByName: w
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
export {
|
|
79
|
+
T as useTemplateCategories
|
|
80
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface ValidationResult {
|
|
2
|
+
isValid: boolean;
|
|
3
|
+
message: string;
|
|
4
|
+
}
|
|
5
|
+
export declare const useTemplateValidation: () => {
|
|
6
|
+
validationError: import("vue").ComputedRef<string>;
|
|
7
|
+
isValidating: import("vue").ComputedRef<boolean>;
|
|
8
|
+
validateTemplateName: (name: string) => Promise<ValidationResult>;
|
|
9
|
+
clearValidation: () => void;
|
|
10
|
+
VALIDATION_RULES: {
|
|
11
|
+
readonly DEBOUNCE_TIME: 500;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { useHttp as T } from "./useHttp.js";
|
|
2
|
+
import { useToaster as V } from "./useToaster.js";
|
|
3
|
+
import { useTranslations as N } from "./useTranslations.js";
|
|
4
|
+
import { ref as m, computed as u } from "vue";
|
|
5
|
+
const c = {
|
|
6
|
+
DEBOUNCE_TIME: 500
|
|
7
|
+
}, I = () => {
|
|
8
|
+
const { get: d } = T(), { handleError: p } = V(), l = N(), s = m(""), o = m(!1), r = m(null), v = (a) => a.trim() ? {
|
|
9
|
+
isValid: !0,
|
|
10
|
+
message: ""
|
|
11
|
+
} : {
|
|
12
|
+
isValid: !1,
|
|
13
|
+
message: l("validation.required-product-name-to-continue", { product: "template" })
|
|
14
|
+
}, f = async (a) => {
|
|
15
|
+
try {
|
|
16
|
+
const i = `/template-library/template-name-exists?name=${encodeURIComponent(a)}`;
|
|
17
|
+
return (await d(i)).data.status;
|
|
18
|
+
} catch (e) {
|
|
19
|
+
return p(e, "Error checking template name:"), !1;
|
|
20
|
+
}
|
|
21
|
+
}, E = (a) => (r.value && clearTimeout(r.value), new Promise((e) => {
|
|
22
|
+
const i = v(a);
|
|
23
|
+
if (!i.isValid) {
|
|
24
|
+
s.value = i.message, e(i);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
o.value = !0, r.value = setTimeout(async () => {
|
|
28
|
+
try {
|
|
29
|
+
const t = await f(a.trim()), n = {
|
|
30
|
+
isValid: !t,
|
|
31
|
+
message: t ? l("whatsapp-business.template-name-exists") : ""
|
|
32
|
+
};
|
|
33
|
+
s.value = n.message, e(n);
|
|
34
|
+
} catch (t) {
|
|
35
|
+
const n = {
|
|
36
|
+
isValid: !1,
|
|
37
|
+
message: t instanceof Error ? t.message : l("validation.unknown-error")
|
|
38
|
+
};
|
|
39
|
+
s.value = n.message, e(n);
|
|
40
|
+
} finally {
|
|
41
|
+
o.value = !1;
|
|
42
|
+
}
|
|
43
|
+
}, c.DEBOUNCE_TIME);
|
|
44
|
+
})), g = () => {
|
|
45
|
+
s.value = "", o.value = !1, r.value && clearTimeout(r.value);
|
|
46
|
+
};
|
|
47
|
+
return {
|
|
48
|
+
validationError: u(() => s.value),
|
|
49
|
+
isValidating: u(() => o.value),
|
|
50
|
+
validateTemplateName: E,
|
|
51
|
+
clearValidation: g,
|
|
52
|
+
VALIDATION_RULES: c
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
export {
|
|
56
|
+
I as useTemplateValidation
|
|
57
|
+
};
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.version-history-item[data-v-
|
|
1
|
+
.version-history-item[data-v-0e2ff42d]{flex-basis:200px}.version-history-wrapper[data-v-187d41fa]{gap:8px}[data-v-6a2bde67] .guido__verion-history-view-option-selection-desktop svg,[data-v-6a2bde67] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6a2bde67] .in-segments-wrapper__button_selected,[data-v-6a2bde67] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-0fff376c] .guido__view-option-selection-desktop svg,[data-v-0fff376c] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-0fff376c] .in-segments-wrapper__button_selected,[data-v-0fff376c] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.header-right-slot[data-v-78791c47]{gap:16px}.guido-editor__wrapper[data-v-f20b186e],.guido-editor__container[data-v-f20b186e]{width:100%;height:100vh}
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
const n = `:host {
|
|
2
|
+
--guido-color-white: #FFFFFF;
|
|
3
|
+
--guido-color-primary-500: #0A2ECC;
|
|
4
|
+
--guido-color-primary-100: #DAE1FB;
|
|
5
|
+
--guido-color-gray-800: #292929;
|
|
6
|
+
--guido-color-gray-300: #E1E1E1;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.label {
|
|
10
|
+
font-size: 13px;
|
|
11
|
+
color: var(--guido-color-gray-800);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.stacked-panel-title {
|
|
15
|
+
padding: 16px;
|
|
16
|
+
font-size: 16px;
|
|
17
|
+
font-weight: 600;
|
|
18
|
+
color: var(--guido-color-gray-800);
|
|
19
|
+
text-align: left;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.stacked-panel-item {
|
|
23
|
+
border-radius: 4px;
|
|
24
|
+
border: 1px solid #dcdfe6;
|
|
25
|
+
box-shadow: 0 0 0 0 var(--guido-color-gray-300),0 15px 35px -5px rgba(0, 0, 0, .1),0 8px 10px -6px rgba(0, 0, 0, .1);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.container {
|
|
29
|
+
padding: 16px;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.container.parent-container>.container {
|
|
33
|
+
padding: 0 16px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** SEGMENT BUTTON */
|
|
37
|
+
ue-switcher input {
|
|
38
|
+
border-radius: 26px;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
ue-switcher input:before {
|
|
42
|
+
border-radius: 22px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.tabs-header {
|
|
46
|
+
padding: 0;
|
|
47
|
+
column-gap: 0;
|
|
48
|
+
background-color: transparent;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.tabs-header button {
|
|
52
|
+
background-color: #f7f9fa;
|
|
53
|
+
outline: none;
|
|
54
|
+
padding: 8px 16px;
|
|
55
|
+
border: 1px solid #dcdee6;
|
|
56
|
+
height: 42px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.tabs-header button ue-icon-component.icon-button {
|
|
60
|
+
color: var(--guido-color-gray-800);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.tabs-header button:not(:last-child),
|
|
64
|
+
.tabs-header button:not(:first-child) {
|
|
65
|
+
border-radius: 0;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.tabs-header button:first-child {
|
|
69
|
+
border-radius: 4px 0 0 4px;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.tabs-header button:last-child {
|
|
73
|
+
border-radius: 0 4px 4px 0;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.tabs-header button.checked {
|
|
77
|
+
background-color: var(--guido-color-primary-100);
|
|
78
|
+
color: var(--guido-color-primary-500);
|
|
79
|
+
border-color: var(--guido-color-primary-500);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.tabs-header button.checked ue-icon-component.icon-button {
|
|
83
|
+
color: var(--guido-color-primary-500);
|
|
84
|
+
}
|
|
85
|
+
/** SEGMENT BUTTON */
|
|
86
|
+
|
|
87
|
+
/** BUTTON */
|
|
88
|
+
.button:not(:disabled,.disabled):active {
|
|
89
|
+
transform: none !important;
|
|
90
|
+
}
|
|
91
|
+
/** BUTTON */
|
|
92
|
+
|
|
93
|
+
/** BUTTON GROUP */
|
|
94
|
+
.button-group {
|
|
95
|
+
padding: 0;
|
|
96
|
+
column-gap: 0;
|
|
97
|
+
border-radius: 0;
|
|
98
|
+
background-color: transparent;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.button-group .button {
|
|
102
|
+
background-color: #f7f9fa;
|
|
103
|
+
outline: none;
|
|
104
|
+
padding: 8px 12px;
|
|
105
|
+
border: 1px solid #dcdee6;
|
|
106
|
+
box-shadow: none;
|
|
107
|
+
height: 42px;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.button-group .button ue-icon-component.icon-button {
|
|
111
|
+
color: var(--guido-color-gray-800);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.button-group > div:first-of-type .button {
|
|
115
|
+
border-radius: 4px 0 0 4px;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.button-group > *:last-child .button {
|
|
119
|
+
border-radius: 0 4px 4px 0;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
ue-check-buttons input:checked + .button,
|
|
123
|
+
ue-radio-buttons input:checked + .button {
|
|
124
|
+
background-color: var(--guido-color-primary-100);
|
|
125
|
+
color: var(--guido-color-primary-500);
|
|
126
|
+
border-color: var(--guido-color-primary-500);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
ue-check-buttons input:checked + .button ue-icon-component.icon-button,
|
|
130
|
+
ue-radio-buttons input:checked + .button ue-icon-component.icon-button {
|
|
131
|
+
color: var(--guido-color-primary-500);
|
|
132
|
+
}
|
|
133
|
+
/** BUTTON GROUP */
|
|
134
|
+
|
|
135
|
+
/** COMBOBOX */
|
|
136
|
+
.control-shadow-wrapper:has(.button[role="combobox"]) {
|
|
137
|
+
border-radius: 0;
|
|
138
|
+
padding: 0;
|
|
139
|
+
background: transparent;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.button[role="combobox"] {
|
|
143
|
+
background-color: #f9f9f9;
|
|
144
|
+
border: 1px solid var(--guido-color-gray-300);
|
|
145
|
+
border-radius: 4px;
|
|
146
|
+
box-shadow: none;
|
|
147
|
+
min-height: 42px;
|
|
148
|
+
padding: 8px;
|
|
149
|
+
color: var(--guido-color-gray-800);
|
|
150
|
+
text-align: left;
|
|
151
|
+
outline: none;
|
|
152
|
+
white-space: nowrap;
|
|
153
|
+
text-overflow: ellipsis;
|
|
154
|
+
overflow: hidden;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.button[role="combobox"].on {
|
|
158
|
+
background-color: #f9f9f9;
|
|
159
|
+
border-color: var(--guido-color-primary-500);
|
|
160
|
+
box-shadow: 0 0 0 3px #b5c1f1 !important;
|
|
161
|
+
}
|
|
162
|
+
/** COMBOBOX */
|
|
163
|
+
|
|
164
|
+
/** BASE INPUT */
|
|
165
|
+
.base-input {
|
|
166
|
+
border: 1px solid var(--guido-color-gray-300);
|
|
167
|
+
border-radius: 4px;
|
|
168
|
+
background-color: #f9f9f9;
|
|
169
|
+
align-items: center;
|
|
170
|
+
height: 40px;
|
|
171
|
+
max-height: 40px;
|
|
172
|
+
box-sizing: content-box;
|
|
173
|
+
outline: none;
|
|
174
|
+
resize: vertical;
|
|
175
|
+
padding: 8px;
|
|
176
|
+
transition: none !important;
|
|
177
|
+
color: var(--guido-color-gray-800);
|
|
178
|
+
box-shadow: none !important;
|
|
179
|
+
box-sizing: border-box !important;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.base-input:hover:not(:disabled) {
|
|
183
|
+
background-color: #f9f9f9;
|
|
184
|
+
border-color: #7a92f2;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.base-input:focus:not(:disabled) {
|
|
188
|
+
background-color: #f9f9f9;
|
|
189
|
+
border-color: #0a2ecc;
|
|
190
|
+
box-shadow: 0 0 0 3px #b5c1f1 !important;
|
|
191
|
+
}
|
|
192
|
+
/** BASE INPUT */
|
|
193
|
+
|
|
194
|
+
/** COUNTER */
|
|
195
|
+
ue-counter {
|
|
196
|
+
padding: 0 !important;
|
|
197
|
+
background-color: var(--guido-color-white) !important;
|
|
198
|
+
border: 1px solid var(--guido-color-gray-300);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
ue-counter .button {
|
|
202
|
+
width: 40px;
|
|
203
|
+
height: 40px;
|
|
204
|
+
box-shadow: none;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
ue-counter .button .icon-button {
|
|
208
|
+
color: var(--guido-color-primary-500);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
ue-counter ue-button:first-child .button {
|
|
212
|
+
border-right: 1px solid var(--guido-color-gray-300);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
ue-counter ue-button:last-child .button {
|
|
216
|
+
border-left: 1px solid var(--guido-color-gray-300);
|
|
217
|
+
}
|
|
218
|
+
/** COUNTER */
|
|
219
|
+
|
|
220
|
+
/** COLOR */
|
|
221
|
+
ue-color {
|
|
222
|
+
width: 80px;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
ue-color .base-input {
|
|
226
|
+
width: 100%;
|
|
227
|
+
}
|
|
228
|
+
/** COLOR */
|
|
229
|
+
`;
|
|
230
|
+
export {
|
|
231
|
+
n as default
|
|
232
|
+
};
|
package/dist/stores/editor.d.ts
CHANGED
package/dist/stores/editor.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { defineStore as e } from "pinia";
|
|
2
|
-
const
|
|
2
|
+
const t = e("editor", {
|
|
3
3
|
state: () => ({
|
|
4
4
|
isCodeEditorOpen: !1,
|
|
5
5
|
isVersionHistoryOpen: !1,
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
editorVisualMode: "desktop",
|
|
7
|
+
isSaveTemplateModalOpen: !1
|
|
8
8
|
})
|
|
9
9
|
});
|
|
10
10
|
export {
|
|
11
|
-
|
|
11
|
+
t as useEditorStore
|
|
12
12
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.83deaec",
|
|
4
4
|
"description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
|
|
5
5
|
"main": "./dist/guido.umd.cjs",
|
|
6
6
|
"module": "./dist/library.js",
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
],
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
"import": "./dist/library.js",
|
|
14
|
+
"types": "./dist/components/Guido.vue.d.ts",
|
|
15
|
+
"require": "./dist/components/Guido.vue.js"
|
|
16
16
|
},
|
|
17
17
|
"./style": "./dist/guido.css"
|
|
18
18
|
},
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"start": "vite",
|
|
22
22
|
"build": "vite build && vue-tsc --declaration --emitDeclarationOnly --project tsconfig.app.json",
|
|
23
23
|
"preview": "vite preview",
|
|
24
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
24
25
|
"lint": "NODE_OPTIONS=--max-old-space-size=2048 eslint ./ && bun run type-check",
|
|
25
26
|
"lint:fix": "NODE_OPTIONS=--max-old-space-size=2048 eslint --fix ./",
|
|
26
27
|
"type-check": "vue-tsc --noEmit --project tsconfig.config.json && vue-tsc --noEmit --project tsconfig.app.json"
|
|
@@ -29,7 +30,6 @@
|
|
|
29
30
|
"author": "",
|
|
30
31
|
"license": "ISC",
|
|
31
32
|
"dependencies": {
|
|
32
|
-
"@stripoinc/ui-editor-extensions": "^1.0.6",
|
|
33
33
|
"@useinsider/design-system-vue": "0.14.8",
|
|
34
34
|
"@vuelidate/core": "2.0.3",
|
|
35
35
|
"@vuelidate/validators": "2.0.4",
|
|
@@ -42,7 +42,6 @@
|
|
|
42
42
|
"@cspell/eslint-plugin": "8.17.5",
|
|
43
43
|
"@eslint/eslintrc": "3.3.0",
|
|
44
44
|
"@eslint/js": "8.57.1",
|
|
45
|
-
"@playwright/test": "^1.54.2",
|
|
46
45
|
"@stylistic/eslint-plugin": "3.1.0",
|
|
47
46
|
"@stylistic/eslint-plugin-migrate": "3.1.0",
|
|
48
47
|
"@types/eslint": "8.56.12",
|
package/dist/_virtual/Block.js
DELETED