@useinsider/guido 1.0.0-beta.e760ea9 → 1.0.0-beta.e8ee5f5
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 +159 -23
- package/dist/@types/generic.d.ts +33 -0
- package/dist/@types/save-as-template.d.ts +29 -0
- package/dist/components/Guido.vue.d.ts +6 -3
- package/dist/components/Guido.vue.js +8 -8
- package/dist/components/Guido.vue2.js +60 -38
- package/dist/components/organisms/base/Toaster.vue.d.ts +2 -0
- package/dist/components/organisms/base/Toaster.vue.js +17 -0
- package/dist/components/organisms/base/Toaster.vue2.js +15 -0
- package/dist/components/organisms/email-preview/PreviewContainer.vue.d.ts +2 -0
- package/dist/components/organisms/email-preview/PreviewContainer.vue.js +19 -0
- package/dist/components/organisms/email-preview/PreviewContainer.vue2.js +19 -0
- package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.d.ts +4 -0
- package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.js +22 -0
- package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue2.js +30 -0
- package/dist/components/organisms/email-preview/amp/AmpToggle.vue.d.ts +2 -0
- package/dist/components/organisms/email-preview/amp/AmpToggle.vue.js +19 -0
- package/dist/components/organisms/email-preview/amp/AmpToggle.vue2.js +29 -0
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.d.ts +2 -0
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +22 -0
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +31 -0
- package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.d.ts +2 -0
- package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.js +17 -0
- package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue2.js +20 -0
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.d.ts +2 -0
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +18 -0
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +25 -0
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.d.ts +4 -0
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +19 -0
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue2.js +23 -0
- package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.d.ts +4 -0
- package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.js +20 -0
- package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue2.js +21 -0
- package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.d.ts +2 -0
- package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.js +17 -0
- package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue2.js +22 -0
- package/dist/components/organisms/header/LeftSlot.vue2.js +7 -9
- package/dist/components/organisms/header/MiddleSlot.vue.js +9 -9
- package/dist/components/organisms/header/MiddleSlot.vue2.js +16 -17
- package/dist/components/organisms/header/RightSlot.vue.js +9 -8
- package/dist/components/organisms/header/RightSlot.vue2.js +27 -25
- 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/ViewOptions.vue.js +3 -3
- package/dist/components/organisms/header/version-history/ViewOptions.vue2.js +34 -16
- package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue.d.ts +2 -0
- package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue.js +20 -0
- package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +63 -0
- package/dist/components/wrappers/WpDrawer.vue.d.ts +63 -0
- package/dist/components/wrappers/WpDrawer.vue.js +25 -0
- package/dist/components/wrappers/WpDrawer.vue2.js +23 -0
- package/dist/components/wrappers/WpModal.vue.d.ts +65 -0
- package/dist/components/wrappers/WpModal.vue.js +27 -0
- package/dist/components/wrappers/WpModal.vue2.js +22 -0
- package/dist/composables/useActionsApi.d.ts +4 -1
- package/dist/composables/useActionsApi.js +74 -33
- 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/useDebounce.d.ts +4 -0
- package/dist/composables/useDebounce.js +12 -0
- package/dist/composables/useExport.js +10 -9
- package/dist/composables/useGuidoActions.d.ts +2 -2
- package/dist/composables/useHtmlCompiler.js +9 -8
- package/dist/composables/useHttp.js +23 -21
- package/dist/composables/usePartner.d.ts +1 -1
- package/dist/composables/usePartner.js +9 -14
- package/dist/composables/usePreviewMode.d.ts +5 -0
- package/dist/composables/usePreviewMode.js +31 -0
- package/dist/composables/useResponsivePreview.d.ts +5 -0
- package/dist/composables/useResponsivePreview.js +86 -0
- package/dist/composables/useStripo.js +25 -15
- package/dist/composables/useToaster.d.ts +1 -16
- package/dist/composables/useToaster.js +24 -30
- package/dist/composables/useTranslations.js +3 -2
- package/dist/composables/useValidation.d.ts +56 -0
- package/dist/composables/useValidation.js +19 -0
- package/dist/composables/useVersionHistoryApi.js +11 -10
- package/dist/composables/validators/saveAsTemplate.d.ts +31 -0
- package/dist/composables/validators/saveAsTemplate.js +24 -0
- package/dist/enums/defaults.d.ts +4 -1
- package/dist/enums/defaults.js +21 -6
- package/dist/enums/preview.d.ts +13 -0
- package/dist/enums/preview.js +23 -0
- package/dist/enums/toaster.d.ts +5 -0
- package/dist/enums/toaster.js +4 -0
- package/dist/extensions/DynamicContent/dynamic-content.js +13 -15
- package/dist/guido.css +1 -1
- package/dist/mock/api/template-library.d.ts +2 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/Extension.js +2 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ExtensionBuilder.js +2 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/Block.js +2 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/BlockRenderer.js +2 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/BlocksPanel.js +2 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/ContextAction.js +2 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/AiAssistantValueType.js +2 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockCompositionType.js +2 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockType.js +2 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BuiltInControlTypes.js +2 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/ContextActionType.js +2 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/EditorStatePropertyType.js +2 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PanelPosition.js +2 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PreviewDeviceMode.js +2 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/SettingsTab.js +2 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementType.js +2 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BackgroundColorBuiltInControl.js +4 -4
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BackgroundImageBuiltInControl.js +4 -4
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BlockPaddingsBuiltInControl.js +4 -4
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BuiltInControl.js +2 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonBorderBuiltInControl.js +4 -4
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonColorBuiltInControl.js +4 -4
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonFontColorBuiltInControl.js +4 -4
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonInternalIndentsBuiltInControl.js +4 -4
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonTextBuiltInControl.js +4 -4
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/Control.js +2 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/FontFamilyBuiltInControl.js +4 -4
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/LinkColorBuiltInControl.js +4 -4
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelRegistry.js +2 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelTab.js +2 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/StructureBorderBuiltInControl.js +4 -4
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/StructurePaddingsBuiltInControl.js +4 -4
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextColorBuiltInControl.js +4 -4
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextLineSpacingBuiltInControl.js +4 -4
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextSizeBuiltInControl.js +4 -4
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextStyleBuiltInControl.js +4 -4
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/index.js +2 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/modifications/ModificationDescription.js +2 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElement.js +2 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElementTagRegistry.js +2 -2
- package/dist/node_modules/@vueuse/shared/index.js +45 -0
- package/dist/node_modules/lodash-es/_Stack.js +18 -0
- package/dist/node_modules/lodash-es/_Uint8Array.js +5 -0
- package/dist/node_modules/lodash-es/_apply.js +16 -0
- package/dist/node_modules/lodash-es/_arrayLikeKeys.js +19 -0
- package/dist/node_modules/lodash-es/_assignMergeValue.js +8 -0
- package/dist/node_modules/lodash-es/_assignValue.js +10 -0
- package/dist/node_modules/lodash-es/_baseAssignValue.js +12 -0
- package/dist/node_modules/lodash-es/_baseCreate.js +17 -0
- package/dist/node_modules/lodash-es/_baseFor.js +5 -0
- package/dist/node_modules/lodash-es/_baseIsArguments.js +9 -0
- package/dist/node_modules/lodash-es/_baseIsTypedArray.js +12 -0
- package/dist/node_modules/lodash-es/_baseKeysIn.js +15 -0
- package/dist/node_modules/lodash-es/_baseMerge.js +20 -0
- package/dist/node_modules/lodash-es/_baseMergeDeep.js +31 -0
- package/dist/node_modules/lodash-es/_baseRest.js +9 -0
- package/dist/node_modules/lodash-es/_baseSetToString.js +14 -0
- package/dist/node_modules/lodash-es/_baseTimes.js +8 -0
- package/dist/node_modules/lodash-es/_baseUnary.js +8 -0
- package/dist/node_modules/lodash-es/_cloneArrayBuffer.js +8 -0
- package/dist/node_modules/lodash-es/_cloneBuffer.js +9 -0
- package/dist/node_modules/lodash-es/_cloneTypedArray.js +8 -0
- package/dist/node_modules/lodash-es/_copyArray.js +9 -0
- package/dist/node_modules/lodash-es/_copyObject.js +14 -0
- package/dist/node_modules/lodash-es/_createAssigner.js +15 -0
- package/dist/node_modules/lodash-es/_createBaseFor.js +13 -0
- package/dist/node_modules/lodash-es/_defineProperty.js +11 -0
- package/dist/node_modules/lodash-es/_getPrototype.js +5 -0
- package/dist/node_modules/lodash-es/_initCloneObject.js +9 -0
- package/dist/node_modules/lodash-es/_isIndex.js +8 -0
- package/dist/node_modules/lodash-es/_isIterateeCall.js +13 -0
- package/dist/node_modules/lodash-es/_isMasked.js +2 -2
- package/dist/node_modules/lodash-es/_isPrototype.js +8 -0
- package/dist/node_modules/lodash-es/_nativeKeysIn.js +10 -0
- package/dist/node_modules/lodash-es/_nodeUtil.js +11 -0
- package/dist/node_modules/lodash-es/_overArg.js +8 -0
- package/dist/node_modules/lodash-es/_overRest.js +15 -0
- package/dist/node_modules/lodash-es/_safeGet.js +7 -0
- package/dist/node_modules/lodash-es/_setToString.js +6 -0
- package/dist/node_modules/lodash-es/_shortOut.js +16 -0
- package/dist/node_modules/lodash-es/_stackClear.js +7 -0
- package/dist/node_modules/lodash-es/_stackDelete.js +7 -0
- package/dist/node_modules/lodash-es/_stackGet.js +6 -0
- package/dist/node_modules/lodash-es/_stackHas.js +6 -0
- package/dist/node_modules/lodash-es/_stackSet.js +17 -0
- package/dist/node_modules/lodash-es/constant.js +8 -0
- package/dist/node_modules/lodash-es/identity.js +6 -0
- package/dist/node_modules/lodash-es/isArguments.js +10 -0
- package/dist/node_modules/lodash-es/isArray.js +4 -0
- package/dist/node_modules/lodash-es/isArrayLike.js +8 -0
- package/dist/node_modules/lodash-es/isArrayLikeObject.js +8 -0
- package/dist/node_modules/lodash-es/isBuffer.js +6 -0
- package/dist/node_modules/lodash-es/isLength.js +7 -0
- package/dist/node_modules/lodash-es/isObjectLike.js +6 -0
- package/dist/node_modules/lodash-es/isPlainObject.js +16 -0
- package/dist/node_modules/lodash-es/isTypedArray.js +7 -0
- package/dist/node_modules/lodash-es/keysIn.js +9 -0
- package/dist/node_modules/lodash-es/merge.js +8 -0
- package/dist/node_modules/lodash-es/stubFalse.js +6 -0
- package/dist/node_modules/lodash-es/toPlainObject.js +8 -0
- package/dist/node_modules/valibot/dist/index.js +190 -0
- package/dist/node_modules/vue-demi/lib/index.js +7 -0
- package/dist/services/templateLibraryApi.d.ts +7 -0
- package/dist/services/templateLibraryApi.js +87 -0
- package/dist/static/assets/inbox-mockup.svg.js +4 -0
- package/dist/static/assets/phone-mockup.svg.js +4 -0
- package/dist/stores/dynamic-content.d.ts +27 -0
- package/dist/stores/dynamic-content.js +23 -0
- package/dist/stores/editor.d.ts +3 -0
- package/dist/stores/editor.js +6 -3
- package/dist/stores/preview.d.ts +46 -0
- package/dist/stores/preview.js +53 -0
- package/dist/stores/save-as-template.d.ts +73 -0
- package/dist/stores/save-as-template.js +48 -0
- package/dist/stores/toaster.d.ts +18 -0
- package/dist/stores/toaster.js +27 -0
- package/dist/utils/arrayUtil.d.ts +1 -0
- package/dist/utils/arrayUtil.js +10 -0
- package/dist/utils/base64.d.ts +1 -0
- package/dist/utils/base64.js +7 -0
- package/dist/utils/genericUtil.d.ts +3 -0
- package/dist/utils/genericUtil.js +11 -0
- package/dist/utils/templatePreparation.d.ts +4 -0
- package/dist/utils/templatePreparation.js +33 -0
- package/dist/utils/tooltipUtils.d.ts +2 -0
- package/dist/utils/tooltipUtils.js +11 -0
- package/package.json +3 -3
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ToasterTypeOptions as a } from "../enums/toaster.js";
|
|
2
|
+
import { useActionsApi as m } from "./useActionsApi.js";
|
|
3
|
+
import { useHtmlCompiler as p } from "./useHtmlCompiler.js";
|
|
3
4
|
import { useToaster as d } from "./useToaster.js";
|
|
4
|
-
const
|
|
5
|
-
const
|
|
5
|
+
const H = () => {
|
|
6
|
+
const l = (s, o, r) => {
|
|
6
7
|
const i = new Blob([s], { type: r }), t = URL.createObjectURL(i), e = document.createElement("a");
|
|
7
8
|
e.href = t, e.download = o, document.body.appendChild(e), e.click(), document.body.removeChild(e), URL.revokeObjectURL(t);
|
|
8
9
|
}, c = (s) => {
|
|
@@ -10,7 +11,7 @@ const h = () => {
|
|
|
10
11
|
return `${s}_${r}-${i}-${t}_${e}-${n}.html`;
|
|
11
12
|
};
|
|
12
13
|
return { exportHtml: async (s = !0) => {
|
|
13
|
-
const { getCompiledEmail: o } =
|
|
14
|
+
const { getCompiledEmail: o } = m(), { showToaster: r } = d(), { compileHtml: i } = p();
|
|
14
15
|
try {
|
|
15
16
|
const { html: t } = await o();
|
|
16
17
|
if (t) {
|
|
@@ -25,21 +26,21 @@ const h = () => {
|
|
|
25
26
|
executionTime: `${n.stats.executionTime.toFixed(2)}ms`
|
|
26
27
|
});
|
|
27
28
|
}
|
|
28
|
-
|
|
29
|
+
l(e, c("HTML"), "text/html");
|
|
29
30
|
} else
|
|
30
31
|
r({
|
|
31
|
-
type:
|
|
32
|
+
type: a.Alert,
|
|
32
33
|
message: "No HTML content to download"
|
|
33
34
|
});
|
|
34
35
|
} catch (t) {
|
|
35
36
|
const e = t instanceof Error ? t.message : String(t);
|
|
36
37
|
r({
|
|
37
|
-
type:
|
|
38
|
+
type: a.Alert,
|
|
38
39
|
message: `Error compiling email: ${e}`
|
|
39
40
|
});
|
|
40
41
|
}
|
|
41
42
|
} };
|
|
42
43
|
};
|
|
43
44
|
export {
|
|
44
|
-
|
|
45
|
+
H as useExport
|
|
45
46
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SavedTemplateDetails } from '@@/Types/stripo';
|
|
2
2
|
import type { InjectionKey } from 'vue';
|
|
3
3
|
export type BackHandler = () => void;
|
|
4
4
|
export type SaveStartHandler = () => void;
|
|
5
|
-
export type SaveCompleteHandler = (template: Omit<
|
|
5
|
+
export type SaveCompleteHandler = (template: Omit<SavedTemplateDetails, 'forceRecreate'>) => void;
|
|
6
6
|
export declare const BACK_KEY: InjectionKey<BackHandler>;
|
|
7
7
|
export declare const SAVE_START_KEY: InjectionKey<SaveStartHandler>;
|
|
8
8
|
export declare const SAVE_COMPLETE_KEY: InjectionKey<SaveCompleteHandler>;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { defaultHtmlCompilerRules as r } from "../config/compiler/htmlCompilerRules.js";
|
|
2
2
|
import { createHtmlCompiler as p } from "../utils/htmlCompiler.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import { useConfig as s } from "./useConfig.js";
|
|
4
|
+
const R = () => {
|
|
5
|
+
const { config: e } = s(), l = e.htmlCompilerRules || [], t = [
|
|
6
|
+
...!!e.ignoreDefaultHtmlCompilerRules ? [] : r,
|
|
7
|
+
...l.map((o, i) => ({
|
|
7
8
|
...o,
|
|
8
|
-
priority: o.priority + 1e3 +
|
|
9
|
+
priority: o.priority + 1e3 + i
|
|
9
10
|
// Ensure additional rules run after default rules
|
|
10
11
|
}))
|
|
11
|
-
],
|
|
12
|
-
return { compileHtml: (o) =>
|
|
12
|
+
], m = p(t);
|
|
13
|
+
return { compileHtml: (o) => m.compile(o) };
|
|
13
14
|
};
|
|
14
15
|
export {
|
|
15
|
-
|
|
16
|
+
R as useHtmlCompiler
|
|
16
17
|
};
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { getCsrfToken as H } from "../utils/genericUtil.js";
|
|
2
|
+
import { ref as p, computed as T } from "vue";
|
|
3
|
+
const k = (b = {}) => {
|
|
4
|
+
const h = p(!1), a = p(null), u = p(null), g = T(() => h.value), y = T(() => a.value !== null), v = {
|
|
4
5
|
baseURL: "",
|
|
5
6
|
timeout: 1e4,
|
|
6
7
|
retry: 0,
|
|
7
8
|
retryDelay: 1e3,
|
|
8
9
|
headers: {
|
|
9
|
-
"Content-Type": "application/json"
|
|
10
|
+
"Content-Type": "application/json",
|
|
11
|
+
"X-CSRF-TOKEN": H()
|
|
10
12
|
},
|
|
11
|
-
...
|
|
13
|
+
...b
|
|
12
14
|
}, w = (e, s) => {
|
|
13
15
|
if (e.startsWith("http://") || e.startsWith("https://"))
|
|
14
16
|
return e;
|
|
15
|
-
const t = s ||
|
|
17
|
+
const t = s || v.baseURL || "";
|
|
16
18
|
return t.endsWith("/") && e.startsWith("/") ? `${t}${e.slice(1)}` : t.endsWith("/") || e.startsWith("/") ? `${t}${e}` : `${t}/${e}`;
|
|
17
19
|
}, P = (e) => new Promise((s, t) => {
|
|
18
20
|
setTimeout(() => {
|
|
@@ -22,20 +24,20 @@ const j = (y = {}) => {
|
|
|
22
24
|
setTimeout(s, e);
|
|
23
25
|
}), i = async (e, s, t, D = {}) => {
|
|
24
26
|
a.value = null, h.value = !0, u.value = new AbortController();
|
|
25
|
-
const n = { ...
|
|
27
|
+
const n = { ...v, ...D }, L = w(s, n.baseURL), c = {
|
|
26
28
|
method: e,
|
|
27
29
|
headers: { ...n.headers },
|
|
28
30
|
signal: u.value.signal,
|
|
29
31
|
...n
|
|
30
32
|
};
|
|
31
33
|
t && ["POST", "PUT", "PATCH"].includes(e) && (t instanceof FormData ? (delete c.headers["Content-Type"], c.body = t) : c.body = JSON.stringify(t));
|
|
32
|
-
const
|
|
34
|
+
const E = async (m = 0) => {
|
|
33
35
|
try {
|
|
34
36
|
const o = [fetch(L, c)];
|
|
35
37
|
n.timeout && o.push(P(n.timeout));
|
|
36
38
|
const r = await Promise.race(o);
|
|
37
39
|
if (!r.ok) {
|
|
38
|
-
const
|
|
40
|
+
const O = `HTTP Error: ${r.status} ${r.statusText}`, d = new Error(O);
|
|
39
41
|
throw d.status = r.status, d.statusText = r.statusText, d.response = r, d;
|
|
40
42
|
}
|
|
41
43
|
let f;
|
|
@@ -49,36 +51,36 @@ const j = (y = {}) => {
|
|
|
49
51
|
} catch (o) {
|
|
50
52
|
const r = o instanceof Error && o.name === "AbortError";
|
|
51
53
|
if (m < (n.retry || 0) && !r)
|
|
52
|
-
return await x(n.retryDelay || 1e3),
|
|
54
|
+
return await x(n.retryDelay || 1e3), E(m + 1);
|
|
53
55
|
throw o instanceof Error ? o.name === "AbortError" ? a.value = { message: "Request was cancelled" } : a.value = { message: o.message } : a.value = o, o;
|
|
54
56
|
}
|
|
55
57
|
};
|
|
56
58
|
try {
|
|
57
|
-
return await
|
|
59
|
+
return await E();
|
|
58
60
|
} finally {
|
|
59
61
|
h.value = !1, u.value = null;
|
|
60
62
|
}
|
|
61
|
-
},
|
|
63
|
+
}, C = (e, s) => i("GET", e, void 0, s), $ = (e, s, t) => i("POST", e, s, t), R = (e, s, t) => i("PUT", e, s, t), U = (e, s, t) => i("PATCH", e, s, t), A = (e, s) => i("DELETE", e, void 0, s), W = (e) => {
|
|
62
64
|
u.value && u.value.abort(e);
|
|
63
65
|
}, q = () => {
|
|
64
66
|
a.value = null;
|
|
65
67
|
};
|
|
66
68
|
return {
|
|
67
69
|
// State
|
|
68
|
-
loading:
|
|
69
|
-
error:
|
|
70
|
-
hasError:
|
|
70
|
+
loading: g,
|
|
71
|
+
error: T(() => a.value),
|
|
72
|
+
hasError: y,
|
|
71
73
|
// Methods
|
|
72
74
|
request: i,
|
|
73
|
-
get:
|
|
74
|
-
post:
|
|
75
|
-
put:
|
|
76
|
-
patch:
|
|
77
|
-
delete:
|
|
75
|
+
get: C,
|
|
76
|
+
post: $,
|
|
77
|
+
put: R,
|
|
78
|
+
patch: U,
|
|
79
|
+
delete: A,
|
|
78
80
|
cancel: W,
|
|
79
81
|
clearError: q
|
|
80
82
|
};
|
|
81
83
|
};
|
|
82
84
|
export {
|
|
83
|
-
|
|
85
|
+
k as useHttp
|
|
84
86
|
};
|
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
import { DefaultProductType as o } from "../enums/defaults.js";
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const t = window.location.pathname.split("/").filter(Boolean)[0] || o;
|
|
10
|
-
return e[t] || t;
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
};
|
|
1
|
+
import { DefaultProductType as e, ProductIds as o } from "../enums/defaults.js";
|
|
2
|
+
const c = () => ({
|
|
3
|
+
getPartnerName: () => window.location.hostname.split(".")[0] || "",
|
|
4
|
+
getProductType: () => {
|
|
5
|
+
const t = window.location.pathname.split("/").filter(Boolean)[0] || e;
|
|
6
|
+
return o[t] || 0;
|
|
7
|
+
}
|
|
8
|
+
});
|
|
14
9
|
export {
|
|
15
|
-
|
|
10
|
+
c as usePartner
|
|
16
11
|
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { useEditorStore as n } from "../stores/editor.js";
|
|
2
|
+
import { usePreviewStore as m } from "../stores/preview.js";
|
|
3
|
+
import { useActionsApi as p } from "./useActionsApi.js";
|
|
4
|
+
import { useCodeEditorApi as l } from "./useCodeEditorApi.js";
|
|
5
|
+
const E = () => {
|
|
6
|
+
const i = n(), e = m(), { closeCodeEditor: s } = l(), { getPreviewData: a } = p(), r = () => {
|
|
7
|
+
e.isPreviewModeOpen = !1, e.$reset();
|
|
8
|
+
};
|
|
9
|
+
return {
|
|
10
|
+
closePreviewMode: r,
|
|
11
|
+
openPreviewMode: () => {
|
|
12
|
+
i.isCodeEditorOpen && s(), e.isPreviewModeOpen = !0;
|
|
13
|
+
},
|
|
14
|
+
loadPreviewData: async () => {
|
|
15
|
+
if (!(e.isLoading || e.isLoaded)) {
|
|
16
|
+
e.isLoading = !0;
|
|
17
|
+
try {
|
|
18
|
+
const { html: o, ampHtml: t, ampErrors: d } = await a();
|
|
19
|
+
e.templateHtml = o || "", e.ampHtml = t || "", e.ampErrors = d || [], e.setEmailFormat(t ? "AMP" : "html"), e.isLoaded = !0;
|
|
20
|
+
} catch (o) {
|
|
21
|
+
console.error("Failed to load preview data:", o), r();
|
|
22
|
+
} finally {
|
|
23
|
+
e.isLoading = !1;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
E as usePreviewMode
|
|
31
|
+
};
|
|
@@ -0,0 +1,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,20 +1,21 @@
|
|
|
1
1
|
import { useActionsApi as g } from "./useActionsApi.js";
|
|
2
2
|
import { useCustomInterfaceAppearance as f } from "./useCustomInterfaceAppearance.js";
|
|
3
|
-
import { useToaster as
|
|
4
|
-
import { displayConditions as
|
|
3
|
+
import { useToaster as S } from "./useToaster.js";
|
|
4
|
+
import { displayConditions as C } from "../enums/displayConditions.js";
|
|
5
5
|
import y from "../extensions/DynamicContent/extension.js";
|
|
6
|
-
import { useStripoApi as
|
|
7
|
-
import { useEditorStore as
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
import { useStripoApi as E } from "../services/stripoApi.js";
|
|
7
|
+
import { useEditorStore as h } from "../stores/editor.js";
|
|
8
|
+
import { dynamicContentToMergeTags as w } from "../utils/genericUtil.js";
|
|
9
|
+
const M = (d) => {
|
|
10
|
+
const { handleError: a } = S(), { getToken: c, getCustomFonts: u } = E(), l = (e, r = []) => {
|
|
11
|
+
const i = h(), { html: t, css: s, forceRecreate: p } = e;
|
|
11
12
|
window.UIEditor.initEditor(
|
|
12
13
|
document.querySelector("#guido-editor"),
|
|
13
14
|
{
|
|
14
|
-
metadata:
|
|
15
|
+
metadata: d,
|
|
15
16
|
html: t,
|
|
16
17
|
css: s,
|
|
17
|
-
forceRecreate:
|
|
18
|
+
forceRecreate: p,
|
|
18
19
|
locale: "en",
|
|
19
20
|
undoButtonSelector: "#guido__undo-button",
|
|
20
21
|
redoButtonSelector: "#guido__redo-button",
|
|
@@ -30,19 +31,25 @@ const A = (a) => {
|
|
|
30
31
|
`,
|
|
31
32
|
conditionsEnabled: !0,
|
|
32
33
|
customConditionsEnabled: !0,
|
|
33
|
-
conditionCategories:
|
|
34
|
+
conditionCategories: C,
|
|
35
|
+
enableXSSSecurity: !0,
|
|
34
36
|
messageSettingsEnabled: !1,
|
|
35
37
|
editorFonts: {
|
|
36
38
|
showDefaultStandardFonts: !0,
|
|
37
39
|
showDefaultNotStandardFonts: !0,
|
|
38
40
|
customFonts: r
|
|
39
41
|
},
|
|
42
|
+
mergeTags: [
|
|
43
|
+
{
|
|
44
|
+
entries: w(d.preselectedDynamicContentList)
|
|
45
|
+
}
|
|
46
|
+
],
|
|
40
47
|
async onTokenRefreshRequest(o) {
|
|
41
48
|
try {
|
|
42
49
|
const n = await c();
|
|
43
50
|
o(n);
|
|
44
51
|
} catch (n) {
|
|
45
|
-
|
|
52
|
+
a(n, "Failed to refresh token");
|
|
46
53
|
}
|
|
47
54
|
},
|
|
48
55
|
onTemplateLoaded() {
|
|
@@ -50,7 +57,7 @@ const A = (a) => {
|
|
|
50
57
|
const { importCss: o } = f(), { activateCustomViewStyles: n } = g();
|
|
51
58
|
o(), n();
|
|
52
59
|
} catch (o) {
|
|
53
|
-
|
|
60
|
+
a(o, "Failed to load custom interface appearance");
|
|
54
61
|
}
|
|
55
62
|
},
|
|
56
63
|
onCodeEditorVisibilityChanged(o) {
|
|
@@ -62,11 +69,14 @@ const A = (a) => {
|
|
|
62
69
|
onVersionHistoryVisibilityChanged(o) {
|
|
63
70
|
i.isVersionHistoryOpen = o;
|
|
64
71
|
},
|
|
72
|
+
onDataChanged() {
|
|
73
|
+
i.hasChanges = !0;
|
|
74
|
+
},
|
|
65
75
|
ignoreClickOutsideSelectors: ["#guido-dynamic-content-modal"],
|
|
66
76
|
extensions: [y]
|
|
67
77
|
}
|
|
68
78
|
);
|
|
69
|
-
},
|
|
79
|
+
}, m = (e) => new Promise((r, i) => {
|
|
70
80
|
if (document.getElementById("UiEditorScript")) {
|
|
71
81
|
e(), r();
|
|
72
82
|
return;
|
|
@@ -80,12 +90,12 @@ const A = (a) => {
|
|
|
80
90
|
}, document.body.appendChild(t);
|
|
81
91
|
});
|
|
82
92
|
return { initPlugin: async (e) => {
|
|
83
|
-
await
|
|
93
|
+
await m(async () => {
|
|
84
94
|
const r = await u();
|
|
85
95
|
l(e, r);
|
|
86
96
|
});
|
|
87
97
|
} };
|
|
88
98
|
};
|
|
89
99
|
export {
|
|
90
|
-
|
|
100
|
+
M as useStripo
|
|
91
101
|
};
|
|
@@ -1,20 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
export type ToasterOptions = {
|
|
3
|
-
type?: ToasterType;
|
|
4
|
-
message: string;
|
|
5
|
-
actionButton?: {
|
|
6
|
-
text: string;
|
|
7
|
-
onClick: () => void;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
1
|
+
import type { ToasterOptions } from '@@/Types/toaster';
|
|
10
2
|
export declare const useToaster: () => {
|
|
11
|
-
isToasterVisible: import("vue").Ref<boolean>;
|
|
12
|
-
toasterMessage: import("vue").Ref<string>;
|
|
13
|
-
toasterType: import("vue").Ref<ToasterType>;
|
|
14
|
-
toasterActionButton: import("vue").Ref<({
|
|
15
|
-
text: string;
|
|
16
|
-
onClick: () => void;
|
|
17
|
-
} | undefined)[]>;
|
|
18
3
|
showToaster: (options?: ToasterOptions) => void;
|
|
19
4
|
hideToaster: () => void;
|
|
20
5
|
handleError: (error: unknown, context: string) => void;
|
|
@@ -1,37 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { ToasterTypeOptions as u } from "../enums/toaster.js";
|
|
2
|
+
import { useToasterStore as T } from "../stores/toaster.js";
|
|
3
|
+
import { watch as c, onUnmounted as l } from "vue";
|
|
4
|
+
const p = () => {
|
|
5
|
+
const t = T();
|
|
6
|
+
let s = null;
|
|
7
|
+
const o = () => {
|
|
8
|
+
s && (clearTimeout(s), s = null);
|
|
9
|
+
};
|
|
10
|
+
function r(e = { message: "" }) {
|
|
11
|
+
o(), t.hideToaster(), t.showToaster(e);
|
|
10
12
|
}
|
|
11
|
-
function
|
|
12
|
-
|
|
13
|
+
function n() {
|
|
14
|
+
o(), t.hideToaster();
|
|
13
15
|
}
|
|
14
|
-
function
|
|
16
|
+
function i(e, a) {
|
|
15
17
|
const m = e instanceof Error ? e.message : String(e);
|
|
16
|
-
|
|
17
|
-
type: "error",
|
|
18
|
-
message: `${r}: ${m}`
|
|
19
|
-
});
|
|
18
|
+
r({ type: u.Alert, message: `${a}: ${m}` });
|
|
20
19
|
}
|
|
21
|
-
return
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
toasterActionButton: n,
|
|
30
|
-
showToaster: l,
|
|
31
|
-
hideToaster: u,
|
|
32
|
-
handleError: f
|
|
33
|
-
};
|
|
20
|
+
return c(
|
|
21
|
+
() => t.shouldAutoHide,
|
|
22
|
+
(e) => {
|
|
23
|
+
o(), e && (s = setTimeout(() => {
|
|
24
|
+
t.hideToaster(), o();
|
|
25
|
+
}, 6e3));
|
|
26
|
+
}
|
|
27
|
+
), l(o), { showToaster: r, hideToaster: n, handleError: i };
|
|
34
28
|
};
|
|
35
29
|
export {
|
|
36
|
-
|
|
30
|
+
p as useToaster
|
|
37
31
|
};
|
|
@@ -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,56 @@
|
|
|
1
|
+
import { type BaseIssue, type BaseSchema, type BaseSchemaAsync } from 'valibot';
|
|
2
|
+
import { type Ref } from 'vue';
|
|
3
|
+
type Base = BaseSchema<unknown, unknown, BaseIssue<unknown>>;
|
|
4
|
+
type BaseAsync = BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>;
|
|
5
|
+
type MaybeRefOrGetter<T> = T | Ref<T> | (() => T);
|
|
6
|
+
export declare function useValidation<const Schema extends Base = Base>(input: MaybeRefOrGetter<unknown>, schema: Schema): {
|
|
7
|
+
schema: Schema;
|
|
8
|
+
validate: () => {
|
|
9
|
+
error: import("valibot").InferIssue<Schema> | undefined;
|
|
10
|
+
errorMessage: string;
|
|
11
|
+
typed: true;
|
|
12
|
+
success: true;
|
|
13
|
+
output: import("valibot").InferOutput<Schema>;
|
|
14
|
+
issues: undefined;
|
|
15
|
+
} | {
|
|
16
|
+
error: import("valibot").InferIssue<Schema> | undefined;
|
|
17
|
+
errorMessage: string;
|
|
18
|
+
typed: true;
|
|
19
|
+
success: false;
|
|
20
|
+
output: import("valibot").InferOutput<Schema>;
|
|
21
|
+
issues: [import("valibot").InferIssue<Schema>, ...import("valibot").InferIssue<Schema>[]];
|
|
22
|
+
} | {
|
|
23
|
+
error: import("valibot").InferIssue<Schema> | undefined;
|
|
24
|
+
errorMessage: string;
|
|
25
|
+
typed: false;
|
|
26
|
+
success: false;
|
|
27
|
+
output: unknown;
|
|
28
|
+
issues: [import("valibot").InferIssue<Schema>, ...import("valibot").InferIssue<Schema>[]];
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export declare function useAsyncValidation<const Schema extends BaseAsync = BaseAsync>(input: MaybeRefOrGetter<unknown>, schema: Schema): {
|
|
32
|
+
schema: Schema;
|
|
33
|
+
validate: () => Promise<{
|
|
34
|
+
error: import("valibot").InferIssue<Schema> | undefined;
|
|
35
|
+
errorMessage: string;
|
|
36
|
+
typed: true;
|
|
37
|
+
success: true;
|
|
38
|
+
output: import("valibot").InferOutput<Schema>;
|
|
39
|
+
issues: undefined;
|
|
40
|
+
} | {
|
|
41
|
+
error: import("valibot").InferIssue<Schema> | undefined;
|
|
42
|
+
errorMessage: string;
|
|
43
|
+
typed: true;
|
|
44
|
+
success: false;
|
|
45
|
+
output: import("valibot").InferOutput<Schema>;
|
|
46
|
+
issues: [import("valibot").InferIssue<Schema>, ...import("valibot").InferIssue<Schema>[]];
|
|
47
|
+
} | {
|
|
48
|
+
error: import("valibot").InferIssue<Schema> | undefined;
|
|
49
|
+
errorMessage: string;
|
|
50
|
+
typed: false;
|
|
51
|
+
success: false;
|
|
52
|
+
output: unknown;
|
|
53
|
+
issues: [import("valibot").InferIssue<Schema>, ...import("valibot").InferIssue<Schema>[]];
|
|
54
|
+
}>;
|
|
55
|
+
};
|
|
56
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { safeParseAsync as i } from "../node_modules/valibot/dist/index.js";
|
|
2
|
+
import { unref as n } from "vue";
|
|
3
|
+
function c(o, e) {
|
|
4
|
+
return {
|
|
5
|
+
schema: e,
|
|
6
|
+
validate: async () => {
|
|
7
|
+
var s, t, a;
|
|
8
|
+
const r = await i(e, n(o), { abortPipeEarly: !0 });
|
|
9
|
+
return {
|
|
10
|
+
...r,
|
|
11
|
+
error: (s = r.issues) == null ? void 0 : s[0],
|
|
12
|
+
errorMessage: ((a = (t = r.issues) == null ? void 0 : t[0]) == null ? void 0 : a.message) || ""
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
c as useAsyncValidation
|
|
19
|
+
};
|