@useinsider/guido 1.4.4-beta.4019f05 → 1.4.4-beta.8b3f647
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.
|
@@ -11,24 +11,24 @@ import { InButtonV2 as A } from "@useinsider/design-system-vue";
|
|
|
11
11
|
const J = /* @__PURE__ */ H({
|
|
12
12
|
__name: "RightSlot",
|
|
13
13
|
setup(k, { expose: u }) {
|
|
14
|
-
const { config: f } = h(), { exportHtml:
|
|
14
|
+
const { config: f } = h(), { exportHtml: r } = V(), { save: n } = E(), { openVersionHistory: i, closeVersionHistory: a } = w(), o = C(), t = T(), e = c(!1), s = c(!1), v = x(), d = () => {
|
|
15
15
|
if (o.isVersionHistoryOpen) {
|
|
16
|
-
|
|
16
|
+
a();
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
i();
|
|
20
20
|
}, y = async () => {
|
|
21
|
-
e.value = !0, await
|
|
21
|
+
e.value = !0, await r(), e.value = !1;
|
|
22
22
|
}, S = () => {
|
|
23
23
|
o.isSaveAsTemplateDrawerOpen = !0;
|
|
24
|
-
}, g = _(() => o.isVersionHistoryOpen ? t("newsletter.close-version-history") : t("newsletter.version-history")),
|
|
24
|
+
}, g = _(() => o.isVersionHistoryOpen ? t("newsletter.close-version-history") : t("newsletter.version-history")), l = async (p) => {
|
|
25
25
|
s.value = !0, o.loadingStatus = !0;
|
|
26
|
-
const
|
|
27
|
-
return
|
|
26
|
+
const m = await n(p);
|
|
27
|
+
return s.value = !1, (p || !m) && (o.loadingStatus = !1), m;
|
|
28
28
|
};
|
|
29
29
|
return u({
|
|
30
|
-
handleSave:
|
|
31
|
-
}), { __sfc: !0, config: f, exportHtml:
|
|
30
|
+
handleSave: l
|
|
31
|
+
}), { __sfc: !0, config: f, exportHtml: r, save: n, openVersionHistory: i, closeVersionHistory: a, editorStore: o, trans: t, isExporting: e, isSaving: s, testEmailClick: v, handleVersionHistory: d, handleExport: y, handleSaveAs: S, versionHistoryTooltipText: g, handleSave: l, getTooltipOptions: O, InButtonV2: A };
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
34
|
export {
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { useConfig as n } from "./useConfig.js";
|
|
2
|
+
import { useSaveStart as l, useSaveComplete as m } from "./useGuidoActions.js";
|
|
3
|
+
import { useTemplatePreparation as c } from "../utils/templatePreparation.js";
|
|
4
|
+
import { useHtmlValidator as p } from "./useHtmlValidator.js";
|
|
5
|
+
const C = () => {
|
|
6
|
+
const e = l(), i = m(), { validateHtml: o } = p(), { config: a } = n();
|
|
7
|
+
return { save: async (r = !1) => {
|
|
7
8
|
e();
|
|
8
|
-
const { prepareTemplateDetails:
|
|
9
|
-
if (await
|
|
10
|
-
return
|
|
9
|
+
const { prepareTemplateDetails: s } = c(), t = await s();
|
|
10
|
+
if (await o(t.compiledHtml, t.dynamicContentList, !0) && !(a.externalValidation && !await a.externalValidation(t)))
|
|
11
|
+
return r || i(t), t;
|
|
11
12
|
} };
|
|
12
13
|
};
|
|
13
14
|
export {
|
|
14
|
-
|
|
15
|
+
C as useSave
|
|
15
16
|
};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { ExtensionBuilder as e } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
2
|
import { UnsubscribeBlock as i } from "./block.js";
|
|
3
3
|
import { UnsubscribeControl as t } from "./control.js";
|
|
4
|
-
import { PreviewUIElement as
|
|
5
|
-
import { UnsubscribeIconsRegistry as
|
|
6
|
-
import { SettingsPanel as
|
|
4
|
+
import { PreviewUIElement as s } from "./elements/preview.js";
|
|
5
|
+
import { UnsubscribeIconsRegistry as o } from "./iconsRegistry.js";
|
|
6
|
+
import { SettingsPanel as r } from "./settingsPanel.js";
|
|
7
7
|
import n from "./styles.css.js";
|
|
8
|
-
import { UnsubscribeTagRegistry as
|
|
9
|
-
const
|
|
8
|
+
import { UnsubscribeTagRegistry as c } from "./tagRegistry.js";
|
|
9
|
+
const g = new e().addBlock(i).withSettingsPanelRegistry(r).addControl(t).addUiElement(s).addStyles(n).withLocalization({
|
|
10
10
|
en: {
|
|
11
|
-
"Unsubscribe Block": "Unsubscribe
|
|
12
|
-
"Unsubscribe Block Description": "
|
|
11
|
+
"Unsubscribe Block": "Unsubscribe",
|
|
12
|
+
"Unsubscribe Block Description": "Unsubscribe lets you add an Unsubscribe Link to direct users to opt out of receiving your messages.",
|
|
13
13
|
"Select Template": "Select Template",
|
|
14
14
|
"Unsubscribe Template": "Unsubscribe Template",
|
|
15
15
|
Showing: "Showing",
|
|
16
16
|
of: "of"
|
|
17
17
|
}
|
|
18
|
-
}).withUiElementTagRegistry(
|
|
18
|
+
}).withUiElementTagRegistry(c).withIconsRegistry(o).build();
|
|
19
19
|
export {
|
|
20
|
-
|
|
20
|
+
g as default
|
|
21
21
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { CompilerRule } from './html-compiler';
|
|
2
|
+
import type { SavedTemplateDetails } from './stripo';
|
|
2
3
|
type Extensions = {
|
|
3
4
|
unsubscribe?: boolean;
|
|
4
5
|
};
|
|
@@ -20,6 +21,7 @@ type BlocksConfig = {
|
|
|
20
21
|
excludeDefaults?: GuidoBlockType[];
|
|
21
22
|
includeCustoms?: GuidoCustomBlockType[];
|
|
22
23
|
};
|
|
24
|
+
export type ExternalValidationHandler = (data: SavedTemplateDetails) => Promise<boolean>;
|
|
23
25
|
export type GuidoConfig = {
|
|
24
26
|
translationsPath: string;
|
|
25
27
|
htmlCompilerRules?: CompilerRule[];
|
|
@@ -32,6 +34,7 @@ export type GuidoConfig = {
|
|
|
32
34
|
features?: Features;
|
|
33
35
|
blocks?: BlocksConfig;
|
|
34
36
|
backButtonLabel?: string;
|
|
37
|
+
externalValidation?: ExternalValidationHandler;
|
|
35
38
|
};
|
|
36
39
|
export type TemplateConfig = {
|
|
37
40
|
preselectedDynamicContentList?: DynamicContent[];
|
|
@@ -85,6 +85,7 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guidoConfi
|
|
|
85
85
|
includeCustoms?: import("@@/Types/generic").GuidoCustomBlockType[] | undefined;
|
|
86
86
|
} | undefined;
|
|
87
87
|
backButtonLabel?: string | undefined;
|
|
88
|
+
externalValidation?: import("@@/Types/generic").ExternalValidationHandler | undefined;
|
|
88
89
|
};
|
|
89
90
|
templateConfig?: {
|
|
90
91
|
preselectedDynamicContentList?: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "1.4.4-beta.
|
|
3
|
+
"version": "1.4.4-beta.8b3f647",
|
|
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",
|