@useinsider/guido 3.30.0 → 3.30.1-beta.34bc10d
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/dist/@types/config/schemas.js +4 -4
- package/dist/@types/email-be/html-validation.js +1 -1
- package/dist/@types/email-be/templates.js +15 -0
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +11 -16
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +11 -11
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +51 -51
- package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue.js +2 -2
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +3 -3
- package/dist/composables/useExport.js +8 -7
- package/dist/composables/useHtmlValidator.js +102 -100
- package/dist/composables/useToaster.js +11 -10
- package/dist/composables/useVersionHistoryApi.js +22 -21
- package/dist/composables/validators/useLiquidValidator.js +26 -24
- package/dist/config/migrator/itemsBlockMigrator.js +164 -161
- package/dist/enums/defaults.js +4 -5
- package/dist/enums/email-be.js +20 -9
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +148 -141
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +53 -53
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +40 -39
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +27 -26
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +33 -32
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +23 -22
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +79 -78
- package/dist/extensions/Blocks/Recommendation/utils/compositionKeys.js +50 -41
- package/dist/guido.css +1 -1
- package/dist/node_modules/valibot/dist/index.js +95 -90
- package/dist/package.json.js +2 -2
- package/dist/services/emailBe/errors/ApiError.js +27 -26
- package/dist/services/emailBe/templates/TemplateService.js +149 -0
- package/dist/services/emailBe/templates/index.js +6 -0
- package/dist/services/templateLibraryApi.js +59 -87
- package/dist/src/@types/email-be/templates.d.ts +40 -0
- package/dist/src/@types/save-as-template.d.ts +1 -23
- package/dist/src/enums/email-be.d.ts +11 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/compositionKeys.d.ts +2 -0
- package/dist/src/services/emailBe/templates/TemplateService.d.ts +13 -0
- package/dist/src/services/emailBe/templates/index.d.ts +2 -0
- package/dist/src/stores/preview.d.ts +3 -0
- package/dist/src/utils/ampPreviewSanitizer.d.ts +5 -0
- package/dist/src/utils/htmlEscape.d.ts +5 -0
- package/dist/stores/preview.js +21 -15
- package/dist/utils/ampPreviewSanitizer.js +46 -0
- package/dist/utils/htmlEscape.js +5 -1
- package/dist/utils/pairProductVariables.js +98 -108
- package/package.json +1 -1
|
@@ -1,98 +1,107 @@
|
|
|
1
|
-
import { ATTR_CUSTOM_PREFIX as o, ATTR_PRODUCT_PRICE as
|
|
1
|
+
import { ATTR_CUSTOM_PREFIX as o, ATTR_PRODUCT_PRICE as _, ATTR_PRODUCT_OLD_PRICE as C, PRODUCT_ATTRIBUTE_PREFIX as f, ATTR_DATA_ATTRIBUTE_TYPE as a, ATTR_PRODUCT_ATTR as c, SELECTOR_ATTRIBUTE_ROW as y } from "../constants/selectors.js";
|
|
2
2
|
function q(t) {
|
|
3
|
-
return !t.startsWith(
|
|
3
|
+
return !t.startsWith(f);
|
|
4
4
|
}
|
|
5
5
|
function $(t) {
|
|
6
|
-
return t.startsWith(
|
|
6
|
+
return t.startsWith(f) ? t.substring(f.length) : t;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function T(t) {
|
|
9
9
|
return t.startsWith(o) ? t.substring(o.length) : t;
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function A(t) {
|
|
12
12
|
return `${o}${t}`;
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
const g = /[<>"`]/;
|
|
15
|
+
function m(t) {
|
|
16
|
+
return !g.test(t);
|
|
17
|
+
}
|
|
18
|
+
function O(t) {
|
|
19
|
+
return t.filter((r) => !r.startsWith(o) || m(T(r)));
|
|
16
20
|
}
|
|
17
|
-
function h(t
|
|
21
|
+
function h(t) {
|
|
22
|
+
return t.type === "defaultAttribute" ? t.attributeName : `${f}${t.attributeName}`;
|
|
23
|
+
}
|
|
24
|
+
function S(t, r) {
|
|
18
25
|
const n = Object.values(r).filter((e) => e.attributeName === t);
|
|
19
26
|
return n.find((e) => e.type === "defaultAttribute") ?? n[0];
|
|
20
27
|
}
|
|
21
28
|
function l(t, r) {
|
|
22
29
|
return t && "getAttribute" in t ? t.getAttribute(r) : null;
|
|
23
30
|
}
|
|
24
|
-
function
|
|
31
|
+
function E(t, r, n = {}) {
|
|
25
32
|
const e = `${o}${t}`, u = r == null ? void 0 : r.querySelector(
|
|
26
|
-
`${y}[${
|
|
33
|
+
`${y}[${a}="${e}"]`
|
|
27
34
|
), i = l(u, c) ?? l(u == null ? void 0 : u.querySelector(`[${c}]`), c);
|
|
28
35
|
if (i)
|
|
29
36
|
return i;
|
|
30
|
-
const s =
|
|
31
|
-
return s ?
|
|
37
|
+
const s = S(t, n);
|
|
38
|
+
return s ? h(s) : t;
|
|
32
39
|
}
|
|
33
40
|
function P(t, r, n = {}) {
|
|
34
|
-
return t.startsWith(
|
|
41
|
+
return t.startsWith(f) ? t : E(t, r, n);
|
|
35
42
|
}
|
|
36
|
-
function
|
|
43
|
+
function U(t, r, n = {}) {
|
|
37
44
|
return t.map((e) => {
|
|
38
45
|
if (!e.startsWith(o))
|
|
39
46
|
return e;
|
|
40
|
-
const u =
|
|
41
|
-
return
|
|
47
|
+
const u = T(e);
|
|
48
|
+
return A(P(u, r, n));
|
|
42
49
|
});
|
|
43
50
|
}
|
|
44
|
-
function
|
|
51
|
+
function D(t, r, n = {}) {
|
|
45
52
|
return t.map((e) => P(e, r, n));
|
|
46
53
|
}
|
|
47
54
|
function b(t) {
|
|
48
|
-
const r = l(t,
|
|
55
|
+
const r = l(t, a);
|
|
49
56
|
if (!(r != null && r.startsWith(o)))
|
|
50
57
|
return r;
|
|
51
58
|
const n = "querySelector" in t ? t.querySelector(`[${c}]`) : void 0, e = l(n, c);
|
|
52
|
-
return e ?
|
|
59
|
+
return e ? A(e) : r;
|
|
53
60
|
}
|
|
54
|
-
function
|
|
61
|
+
function p(t) {
|
|
55
62
|
return !!(t && "querySelector" in t && t.querySelector(".product-price") && t.querySelector(".product-old-price"));
|
|
56
63
|
}
|
|
57
|
-
function
|
|
64
|
+
function I(t) {
|
|
58
65
|
const r = b(t);
|
|
59
|
-
return r ?
|
|
66
|
+
return r ? p(t) ? [_, C] : [r] : [];
|
|
60
67
|
}
|
|
61
68
|
function R(t, r, n) {
|
|
62
69
|
const e = l(t, c), u = l(t.querySelector(`[${c}]`), c), i = e ?? u;
|
|
63
70
|
return i === null ? n : i === r;
|
|
64
71
|
}
|
|
65
|
-
function
|
|
66
|
-
const n = (
|
|
67
|
-
`${y}[${
|
|
72
|
+
function v(t, r) {
|
|
73
|
+
const n = (d) => t.querySelector(
|
|
74
|
+
`${y}[${a}="${d}"]`
|
|
68
75
|
);
|
|
69
76
|
if (!r.startsWith(o))
|
|
70
77
|
return n(r) ?? null;
|
|
71
|
-
const e =
|
|
78
|
+
const e = T(r), u = n(r);
|
|
72
79
|
if (u && R(u, e, !0))
|
|
73
80
|
return u;
|
|
74
|
-
const i =
|
|
81
|
+
const i = A($(e)), s = i === r ? void 0 : n(i);
|
|
75
82
|
return s && R(s, e, !1) ? s : null;
|
|
76
83
|
}
|
|
77
|
-
function
|
|
78
|
-
const n =
|
|
84
|
+
function B(t, r) {
|
|
85
|
+
const n = T(r), e = A($(n));
|
|
79
86
|
return e === r ? t : t.replace(
|
|
80
|
-
`${
|
|
81
|
-
`${
|
|
87
|
+
`${a}="${e}"`,
|
|
88
|
+
`${a}="${r}"`
|
|
82
89
|
);
|
|
83
90
|
}
|
|
84
91
|
export {
|
|
85
92
|
$ as bareAttributeName,
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
93
|
+
T as compositionKeyToProductAttr,
|
|
94
|
+
O as dropMalformedCompositionKeys,
|
|
95
|
+
h as filterToProductAttrValue,
|
|
96
|
+
v as findAttributeRow,
|
|
97
|
+
S as findFilterByBareName,
|
|
90
98
|
q as isDefaultProductAttr,
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
99
|
+
p as isMergedInlinePriceRow,
|
|
100
|
+
m as isWellFormedProductAttr,
|
|
101
|
+
U as normalizeCompositionKeys,
|
|
102
|
+
D as normalizeCustomAttrValues,
|
|
103
|
+
A as productAttrToCompositionKey,
|
|
95
104
|
b as resolveRowCompositionKey,
|
|
96
|
-
|
|
97
|
-
|
|
105
|
+
I as resolveRowVisibilityKeys,
|
|
106
|
+
B as rewriteLegacyRowKeyHtml
|
|
98
107
|
};
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.auth-error-modal[data-v-b4d7ae51]{position:relative;z-index:145}.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-9d988e4b] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.color-vision-select__dropdown[data-v-64cb50da]{z-index:20;width:387px}.accessibility-toolbar[data-v-391019bc]{gap:16px}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button svg{margin-right:0}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button .clearfix:after{content:none}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-actions-menu__dropdown[data-v-bdb3b37a]{z-index:20;width:222px}.editor-actions[data-v-9a028d08]{gap:16px}.editor-actions__divider[data-v-9a028d08]{width:1px;height:40px;background-color:#e1e1e1}.right-slot[data-v-77451c9a]{gap:16px}.header-wrapper[data-v-3c713746]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.validation-error-list[data-v-
|
|
1
|
+
@charset "UTF-8";.auth-error-modal[data-v-b4d7ae51]{position:relative;z-index:145}.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-9d988e4b] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.color-vision-select__dropdown[data-v-64cb50da]{z-index:20;width:387px}.accessibility-toolbar[data-v-391019bc]{gap:16px}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button svg{margin-right:0}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button .clearfix:after{content:none}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-actions-menu__dropdown[data-v-bdb3b37a]{z-index:20;width:222px}.editor-actions[data-v-9a028d08]{gap:16px}.editor-actions__divider[data-v-9a028d08]{width:1px;height:40px;background-color:#e1e1e1}.right-slot[data-v-77451c9a]{gap:16px}.header-wrapper[data-v-3c713746]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.validation-error-list[data-v-c8351f74]{gap:16px}.validation-error-row[data-v-c8351f74]{gap:8px;padding:24px;border:1px solid #E1E1E1;border-radius:8px}.validation-error-row__icon[data-v-c8351f74]{flex-shrink:0;font-size:24px;line-height:0}.validation-error-row__text[data-v-c8351f74]{font-size:13px;line-height:16px;color:#292929;word-break:break-word}.guido-editor__wrapper[data-v-0c5f11a1]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-0c5f11a1]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-0c5f11a1]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-eaf8e461]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-eaf8e461]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-eaf8e461]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-eaf8e461]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-eaf8e461]{object-fit:cover;transform:scale(1)}[data-v-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-f5ff6219]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-f5ff6219]{min-height:504px}.iframe-wrapper[data-v-a7102458]{width:258px}.iframe-scaled[data-v-a7102458]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.guido-tab-bar-onboarding[data-v-219b4f7c]{z-index:21}[data-v-fcba7e99] .vueperslides__bullets{pointer-events:none!important}[data-v-fcba7e99] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-1a34025a] .vueperslides__bullets{pointer-events:none!important}[data-v-1a34025a] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-8fc96a58] .vueperslides__bullets,[data-v-ec2027ff] .vueperslides__bullets,[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.assign-strategy-drawer .spaced-dot-sep{background-image:linear-gradient(90deg,#91949f 20%,#fff0 0);background-position:center bottom;background-repeat:repeat-x;background-size:5px 1px}.assign-strategy-drawer .spaced-dot-sep--top{background-position:center top}.assign-strategy-drawer .spaced-dot-sep--fc-n:first-child{background:none}.guido-display-condition-create__separator[data-v-929822bc]{height:1px;margin:0 0 24px;background-image:linear-gradient(to right,currentColor 1px,transparent 1px);background-size:5px 1px}.guido-display-condition-create__methods[data-v-929822bc]{gap:16px}.guido-display-condition-select-root[data-v-0d740001] .in-drawer__footer{justify-content:flex-start}.guido-display-condition-select__delete-modal[data-v-0d740001]{position:relative;z-index:145}.guido-display-condition-select__delete-modal[data-v-0d740001] .in-modal-v2-wrapper__header-title{margin-bottom:0}.guido-display-condition-select-root[data-v-0d740001] .in-drawer__content>div{display:flex;flex-direction:column;min-height:100%}.guido-display-condition-select__list[data-v-0d740001]{display:flex;flex-direction:column;gap:24px;margin:0;padding:0;list-style:none}.guido-display-condition-card__header[data-v-0d740001]{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:15px}.guido-display-condition-card__text[data-v-0d740001]{min-width:0}.guido-display-condition-card__name[data-v-0d740001],.guido-display-condition-card__description[data-v-0d740001]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.guido-display-condition-card__actions[data-v-0d740001]{display:flex;flex-shrink:0;align-items:center;gap:16px}.guido-display-condition-card__split[data-v-0d740001]{position:relative;display:flex;gap:1px}.guido-display-condition-card__menu[data-v-0d740001]{z-index:2;min-width:115px}.guido-display-condition-card__divider[data-v-0d740001]{width:1px;height:24px}.guido-display-condition-card__code[data-v-0d740001]{margin:1px 15px 15px;padding:8px;font-family:inherit;white-space:pre-wrap;word-break:break-word}.legacy-strategy-updated-modal[data-v-da2225a1]{position:relative;z-index:145}.ambiguous-dynamic-content-modal__content[data-v-2643213c]{padding-bottom:150px}
|
|
@@ -30,21 +30,21 @@ function D(n) {
|
|
|
30
30
|
const r = typeof n;
|
|
31
31
|
return r === "string" ? `"${n}"` : r === "number" || r === "bigint" || r === "boolean" ? `${n}` : r === "object" || r === "function" ? (n && ((s = (e = Object.getPrototypeOf(n)) == null ? void 0 : e.constructor) == null ? void 0 : s.name)) ?? "null" : r;
|
|
32
32
|
}
|
|
33
|
-
function f(n, r, e, s,
|
|
34
|
-
const l =
|
|
33
|
+
function f(n, r, e, s, u) {
|
|
34
|
+
const l = u && "input" in u ? u.input : e.value, t = (u == null ? void 0 : u.expected) ?? n.expects ?? null, p = (u == null ? void 0 : u.received) ?? /* @__PURE__ */ D(l), i = {
|
|
35
35
|
kind: n.kind,
|
|
36
36
|
type: n.type,
|
|
37
37
|
input: l,
|
|
38
|
-
expected:
|
|
38
|
+
expected: t,
|
|
39
39
|
received: p,
|
|
40
|
-
message: `Invalid ${r}: ${
|
|
40
|
+
message: `Invalid ${r}: ${t ? `Expected ${t} but r` : "R"}eceived ${p}`,
|
|
41
41
|
requirement: n.requirement,
|
|
42
|
-
path:
|
|
43
|
-
issues:
|
|
42
|
+
path: u == null ? void 0 : u.path,
|
|
43
|
+
issues: u == null ? void 0 : u.issues,
|
|
44
44
|
lang: s.lang,
|
|
45
45
|
abortEarly: s.abortEarly,
|
|
46
46
|
abortPipeEarly: s.abortPipeEarly
|
|
47
|
-
}, c = n.kind === "schema", a = (
|
|
47
|
+
}, c = n.kind === "schema", a = (u == null ? void 0 : u.message) ?? n.message ?? /* @__PURE__ */ q(n.reference, i.lang) ?? (c ? /* @__PURE__ */ V(i.lang) : null) ?? s.message ?? /* @__PURE__ */ I(i.lang);
|
|
48
48
|
a !== void 0 && (i.message = typeof a == "function" ? a(i) : a), c && (e.typed = !1), e.issues ? e.issues.push(i) : e.issues = [i];
|
|
49
49
|
}
|
|
50
50
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -188,11 +188,11 @@ function ie(n, r) {
|
|
|
188
188
|
return /* @__PURE__ */ o(this);
|
|
189
189
|
},
|
|
190
190
|
"~run"(e, s) {
|
|
191
|
-
const
|
|
192
|
-
return
|
|
191
|
+
const u = n["~run"](e, s);
|
|
192
|
+
return u.issues ? {
|
|
193
193
|
typed: !0,
|
|
194
|
-
value: /* @__PURE__ */ P(this,
|
|
195
|
-
} :
|
|
194
|
+
value: /* @__PURE__ */ P(this, u, s)
|
|
195
|
+
} : u;
|
|
196
196
|
}
|
|
197
197
|
};
|
|
198
198
|
}
|
|
@@ -201,6 +201,10 @@ function k(n, r, e) {
|
|
|
201
201
|
return typeof n.default == "function" ? n.default(r, e) : n.default;
|
|
202
202
|
}
|
|
203
203
|
// @__NO_SIDE_EFFECTS__
|
|
204
|
+
function le(n, r) {
|
|
205
|
+
return !n["~run"]({ value: r }, { abortEarly: !0 }).issues;
|
|
206
|
+
}
|
|
207
|
+
// @__NO_SIDE_EFFECTS__
|
|
204
208
|
function R(n, r) {
|
|
205
209
|
return {
|
|
206
210
|
kind: "schema",
|
|
@@ -215,17 +219,17 @@ function R(n, r) {
|
|
|
215
219
|
},
|
|
216
220
|
"~run"(e, s) {
|
|
217
221
|
var l;
|
|
218
|
-
const
|
|
219
|
-
if (Array.isArray(
|
|
222
|
+
const u = e.value;
|
|
223
|
+
if (Array.isArray(u)) {
|
|
220
224
|
e.typed = !0, e.value = [];
|
|
221
|
-
for (let
|
|
222
|
-
const p = t
|
|
225
|
+
for (let t = 0; t < u.length; t++) {
|
|
226
|
+
const p = u[t], i = this.item["~run"]({ value: p }, s);
|
|
223
227
|
if (i.issues) {
|
|
224
228
|
const c = {
|
|
225
229
|
type: "array",
|
|
226
230
|
origin: "value",
|
|
227
|
-
input:
|
|
228
|
-
key:
|
|
231
|
+
input: u,
|
|
232
|
+
key: t,
|
|
229
233
|
value: p
|
|
230
234
|
};
|
|
231
235
|
for (const a of i.issues)
|
|
@@ -327,19 +331,19 @@ function T(n, r) {
|
|
|
327
331
|
},
|
|
328
332
|
"~run"(e, s) {
|
|
329
333
|
var l;
|
|
330
|
-
const
|
|
331
|
-
if (
|
|
334
|
+
const u = e.value;
|
|
335
|
+
if (u && typeof u == "object") {
|
|
332
336
|
e.typed = !0, e.value = {};
|
|
333
|
-
for (const
|
|
334
|
-
const p = this.entries[
|
|
335
|
-
if (
|
|
336
|
-
const i =
|
|
337
|
+
for (const t in this.entries) {
|
|
338
|
+
const p = this.entries[t];
|
|
339
|
+
if (t in u || (p.type === "exact_optional" || p.type === "optional" || p.type === "nullish") && p.default !== void 0) {
|
|
340
|
+
const i = t in u ? u[t] : /* @__PURE__ */ k(p), c = p["~run"]({ value: i }, s);
|
|
337
341
|
if (c.issues) {
|
|
338
342
|
const a = {
|
|
339
343
|
type: "object",
|
|
340
344
|
origin: "value",
|
|
341
|
-
input:
|
|
342
|
-
key:
|
|
345
|
+
input: u,
|
|
346
|
+
key: t,
|
|
343
347
|
value: i
|
|
344
348
|
};
|
|
345
349
|
for (const y of c.issues)
|
|
@@ -349,23 +353,23 @@ function T(n, r) {
|
|
|
349
353
|
break;
|
|
350
354
|
}
|
|
351
355
|
}
|
|
352
|
-
c.typed || (e.typed = !1), e.value[
|
|
353
|
-
} else if (p.fallback !== void 0) e.value[
|
|
356
|
+
c.typed || (e.typed = !1), e.value[t] = c.value;
|
|
357
|
+
} else if (p.fallback !== void 0) e.value[t] = /* @__PURE__ */ P(p);
|
|
354
358
|
else if (p.type !== "exact_optional" && p.type !== "optional" && p.type !== "nullish" && (f(this, "key", e, s, {
|
|
355
359
|
input: void 0,
|
|
356
|
-
expected: `"${
|
|
360
|
+
expected: `"${t}"`,
|
|
357
361
|
path: [{
|
|
358
362
|
type: "object",
|
|
359
363
|
origin: "key",
|
|
360
|
-
input:
|
|
361
|
-
key:
|
|
362
|
-
value: t
|
|
364
|
+
input: u,
|
|
365
|
+
key: t,
|
|
366
|
+
value: u[t]
|
|
363
367
|
}]
|
|
364
368
|
}), s.abortEarly))
|
|
365
369
|
break;
|
|
366
370
|
}
|
|
367
371
|
if (!e.issues || !s.abortEarly)
|
|
368
|
-
for (const
|
|
372
|
+
for (const t in u) /* @__PURE__ */ S(u, t) && !(t in this.entries) && (e.value[t] = u[t]);
|
|
369
373
|
} else f(this, "type", e, s);
|
|
370
374
|
return e;
|
|
371
375
|
}
|
|
@@ -439,19 +443,19 @@ function Y(n, r) {
|
|
|
439
443
|
},
|
|
440
444
|
"~run"(e, s) {
|
|
441
445
|
var l;
|
|
442
|
-
const
|
|
443
|
-
if (
|
|
446
|
+
const u = e.value;
|
|
447
|
+
if (u && typeof u == "object") {
|
|
444
448
|
e.typed = !0, e.value = {};
|
|
445
|
-
for (const
|
|
446
|
-
const p = this.entries[
|
|
447
|
-
if (
|
|
448
|
-
const i =
|
|
449
|
+
for (const t in this.entries) {
|
|
450
|
+
const p = this.entries[t];
|
|
451
|
+
if (t in u || (p.type === "exact_optional" || p.type === "optional" || p.type === "nullish") && p.default !== void 0) {
|
|
452
|
+
const i = t in u ? u[t] : /* @__PURE__ */ k(p), c = p["~run"]({ value: i }, s);
|
|
449
453
|
if (c.issues) {
|
|
450
454
|
const a = {
|
|
451
455
|
type: "object",
|
|
452
456
|
origin: "value",
|
|
453
|
-
input:
|
|
454
|
-
key:
|
|
457
|
+
input: u,
|
|
458
|
+
key: t,
|
|
455
459
|
value: i
|
|
456
460
|
};
|
|
457
461
|
for (const y of c.issues)
|
|
@@ -461,17 +465,17 @@ function Y(n, r) {
|
|
|
461
465
|
break;
|
|
462
466
|
}
|
|
463
467
|
}
|
|
464
|
-
c.typed || (e.typed = !1), e.value[
|
|
465
|
-
} else if (p.fallback !== void 0) e.value[
|
|
468
|
+
c.typed || (e.typed = !1), e.value[t] = c.value;
|
|
469
|
+
} else if (p.fallback !== void 0) e.value[t] = /* @__PURE__ */ P(p);
|
|
466
470
|
else if (p.type !== "exact_optional" && p.type !== "optional" && p.type !== "nullish" && (f(this, "key", e, s, {
|
|
467
471
|
input: void 0,
|
|
468
|
-
expected: `"${
|
|
472
|
+
expected: `"${t}"`,
|
|
469
473
|
path: [{
|
|
470
474
|
type: "object",
|
|
471
475
|
origin: "key",
|
|
472
|
-
input:
|
|
473
|
-
key:
|
|
474
|
-
value: t
|
|
476
|
+
input: u,
|
|
477
|
+
key: t,
|
|
478
|
+
value: u[t]
|
|
475
479
|
}]
|
|
476
480
|
}), s.abortEarly))
|
|
477
481
|
break;
|
|
@@ -531,13 +535,13 @@ function ee(n, r, e) {
|
|
|
531
535
|
get "~standard"() {
|
|
532
536
|
return /* @__PURE__ */ o(this);
|
|
533
537
|
},
|
|
534
|
-
"~run"(s,
|
|
535
|
-
var
|
|
538
|
+
"~run"(s, u) {
|
|
539
|
+
var t, p;
|
|
536
540
|
const l = s.value;
|
|
537
541
|
if (l && typeof l == "object") {
|
|
538
542
|
s.typed = !0, s.value = {};
|
|
539
543
|
for (const i in l) if (/* @__PURE__ */ S(l, i)) {
|
|
540
|
-
const c = l[i], a = this.key["~run"]({ value: i },
|
|
544
|
+
const c = l[i], a = this.key["~run"]({ value: i }, u);
|
|
541
545
|
if (a.issues) {
|
|
542
546
|
const b = {
|
|
543
547
|
type: "object",
|
|
@@ -547,13 +551,13 @@ function ee(n, r, e) {
|
|
|
547
551
|
value: c
|
|
548
552
|
};
|
|
549
553
|
for (const h of a.issues)
|
|
550
|
-
h.path = [b], (
|
|
551
|
-
if (s.issues || (s.issues = a.issues),
|
|
554
|
+
h.path = [b], (t = s.issues) == null || t.push(h);
|
|
555
|
+
if (s.issues || (s.issues = a.issues), u.abortEarly) {
|
|
552
556
|
s.typed = !1;
|
|
553
557
|
break;
|
|
554
558
|
}
|
|
555
559
|
}
|
|
556
|
-
const y = this.value["~run"]({ value: c },
|
|
560
|
+
const y = this.value["~run"]({ value: c }, u);
|
|
557
561
|
if (y.issues) {
|
|
558
562
|
const b = {
|
|
559
563
|
type: "object",
|
|
@@ -564,14 +568,14 @@ function ee(n, r, e) {
|
|
|
564
568
|
};
|
|
565
569
|
for (const h of y.issues)
|
|
566
570
|
h.path ? h.path.unshift(b) : h.path = [b], (p = s.issues) == null || p.push(h);
|
|
567
|
-
if (s.issues || (s.issues = y.issues),
|
|
571
|
+
if (s.issues || (s.issues = y.issues), u.abortEarly) {
|
|
568
572
|
s.typed = !1;
|
|
569
573
|
break;
|
|
570
574
|
}
|
|
571
575
|
}
|
|
572
576
|
(!a.typed || !y.typed) && (s.typed = !1), a.typed && (s.value[a.value] = y.value);
|
|
573
577
|
}
|
|
574
|
-
} else f(this, "type", s,
|
|
578
|
+
} else f(this, "type", s, u);
|
|
575
579
|
return s;
|
|
576
580
|
}
|
|
577
581
|
};
|
|
@@ -608,17 +612,17 @@ function re(n, r) {
|
|
|
608
612
|
},
|
|
609
613
|
"~run"(e, s) {
|
|
610
614
|
var l;
|
|
611
|
-
const
|
|
612
|
-
if (Array.isArray(
|
|
615
|
+
const u = e.value;
|
|
616
|
+
if (Array.isArray(u)) {
|
|
613
617
|
e.typed = !0, e.value = [];
|
|
614
|
-
for (let
|
|
615
|
-
const p = t
|
|
618
|
+
for (let t = 0; t < this.items.length; t++) {
|
|
619
|
+
const p = u[t], i = this.items[t]["~run"]({ value: p }, s);
|
|
616
620
|
if (i.issues) {
|
|
617
621
|
const c = {
|
|
618
622
|
type: "array",
|
|
619
623
|
origin: "value",
|
|
620
|
-
input:
|
|
621
|
-
key:
|
|
624
|
+
input: u,
|
|
625
|
+
key: t,
|
|
622
626
|
value: p
|
|
623
627
|
};
|
|
624
628
|
for (const a of i.issues)
|
|
@@ -655,34 +659,34 @@ function se(n, r) {
|
|
|
655
659
|
return /* @__PURE__ */ o(this);
|
|
656
660
|
},
|
|
657
661
|
"~run"(e, s) {
|
|
658
|
-
let
|
|
662
|
+
let u, l, t;
|
|
659
663
|
for (const p of this.options) {
|
|
660
664
|
const i = p["~run"]({ value: e.value }, s);
|
|
661
665
|
if (i.typed) if (i.issues) l ? l.push(i) : l = [i];
|
|
662
666
|
else {
|
|
663
|
-
|
|
667
|
+
u = i;
|
|
664
668
|
break;
|
|
665
669
|
}
|
|
666
|
-
else
|
|
670
|
+
else t ? t.push(i) : t = [i];
|
|
667
671
|
}
|
|
668
|
-
if (
|
|
672
|
+
if (u) return u;
|
|
669
673
|
if (l) {
|
|
670
674
|
if (l.length === 1) return l[0];
|
|
671
675
|
f(this, "type", e, s, { issues: /* @__PURE__ */ A(l) }), e.typed = !0;
|
|
672
676
|
} else {
|
|
673
|
-
if ((
|
|
674
|
-
f(this, "type", e, s, { issues: /* @__PURE__ */ A(
|
|
677
|
+
if ((t == null ? void 0 : t.length) === 1) return t[0];
|
|
678
|
+
f(this, "type", e, s, { issues: /* @__PURE__ */ A(t) });
|
|
675
679
|
}
|
|
676
680
|
return e;
|
|
677
681
|
}
|
|
678
682
|
};
|
|
679
683
|
}
|
|
680
684
|
// @__NO_SIDE_EFFECTS__
|
|
681
|
-
function
|
|
685
|
+
function ue() {
|
|
682
686
|
return {
|
|
683
687
|
kind: "schema",
|
|
684
688
|
type: "unknown",
|
|
685
|
-
reference:
|
|
689
|
+
reference: ue,
|
|
686
690
|
expects: "unknown",
|
|
687
691
|
async: !1,
|
|
688
692
|
get "~standard"() {
|
|
@@ -694,11 +698,11 @@ function te() {
|
|
|
694
698
|
};
|
|
695
699
|
}
|
|
696
700
|
// @__NO_SIDE_EFFECTS__
|
|
697
|
-
function
|
|
701
|
+
function te(n, r, e) {
|
|
698
702
|
return {
|
|
699
703
|
kind: "schema",
|
|
700
704
|
type: "variant",
|
|
701
|
-
reference:
|
|
705
|
+
reference: te,
|
|
702
706
|
expects: "Object",
|
|
703
707
|
async: !1,
|
|
704
708
|
key: n,
|
|
@@ -707,10 +711,10 @@ function ue(n, r, e) {
|
|
|
707
711
|
get "~standard"() {
|
|
708
712
|
return /* @__PURE__ */ o(this);
|
|
709
713
|
},
|
|
710
|
-
"~run"(s,
|
|
714
|
+
"~run"(s, u) {
|
|
711
715
|
const l = s.value;
|
|
712
716
|
if (l && typeof l == "object") {
|
|
713
|
-
let
|
|
717
|
+
let t, p = 0, i = this.key, c = [];
|
|
714
718
|
const a = (y, b) => {
|
|
715
719
|
for (const h of y.options) {
|
|
716
720
|
if (h.type === "variant") a(h, new Set(b).add(h.key));
|
|
@@ -728,15 +732,15 @@ function ue(n, r, e) {
|
|
|
728
732
|
g++;
|
|
729
733
|
}
|
|
730
734
|
if (O) {
|
|
731
|
-
const v = h["~run"]({ value: l },
|
|
732
|
-
(!
|
|
735
|
+
const v = h["~run"]({ value: l }, u);
|
|
736
|
+
(!t || !t.typed && v.typed) && (t = v);
|
|
733
737
|
}
|
|
734
738
|
}
|
|
735
|
-
if (
|
|
739
|
+
if (t && !t.issues) break;
|
|
736
740
|
}
|
|
737
741
|
};
|
|
738
|
-
if (a(this, /* @__PURE__ */ new Set([this.key])),
|
|
739
|
-
f(this, "type", s,
|
|
742
|
+
if (a(this, /* @__PURE__ */ new Set([this.key])), t) return t;
|
|
743
|
+
f(this, "type", s, u, {
|
|
740
744
|
input: l[i],
|
|
741
745
|
expected: /* @__PURE__ */ w(c, "|"),
|
|
742
746
|
path: [{
|
|
@@ -747,18 +751,18 @@ function ue(n, r, e) {
|
|
|
747
751
|
value: l[i]
|
|
748
752
|
}]
|
|
749
753
|
});
|
|
750
|
-
} else f(this, "type", s,
|
|
754
|
+
} else f(this, "type", s, u);
|
|
751
755
|
return s;
|
|
752
756
|
}
|
|
753
757
|
};
|
|
754
758
|
}
|
|
755
|
-
function
|
|
759
|
+
function pe(n, r, e) {
|
|
756
760
|
const s = n["~run"]({ value: r }, /* @__PURE__ */ x(e));
|
|
757
761
|
if (s.issues) throw new K(s.issues);
|
|
758
762
|
return s.value;
|
|
759
763
|
}
|
|
760
764
|
// @__NO_SIDE_EFFECTS__
|
|
761
|
-
function
|
|
765
|
+
function ae(...n) {
|
|
762
766
|
return {
|
|
763
767
|
...n[0],
|
|
764
768
|
pipe: n,
|
|
@@ -778,7 +782,7 @@ function pe(...n) {
|
|
|
778
782
|
};
|
|
779
783
|
}
|
|
780
784
|
// @__NO_SIDE_EFFECTS__
|
|
781
|
-
function
|
|
785
|
+
function ce(...n) {
|
|
782
786
|
return {
|
|
783
787
|
...n[0],
|
|
784
788
|
pipe: n,
|
|
@@ -799,7 +803,7 @@ function ae(...n) {
|
|
|
799
803
|
};
|
|
800
804
|
}
|
|
801
805
|
// @__NO_SIDE_EFFECTS__
|
|
802
|
-
function
|
|
806
|
+
function fe(n, r, e) {
|
|
803
807
|
const s = n["~run"]({ value: r }, /* @__PURE__ */ x(e));
|
|
804
808
|
return {
|
|
805
809
|
typed: s.typed,
|
|
@@ -809,7 +813,7 @@ function ce(n, r, e) {
|
|
|
809
813
|
};
|
|
810
814
|
}
|
|
811
815
|
// @__NO_SIDE_EFFECTS__
|
|
812
|
-
async function
|
|
816
|
+
async function oe(n, r, e) {
|
|
813
817
|
const s = await n["~run"]({ value: r }, /* @__PURE__ */ x(e));
|
|
814
818
|
return {
|
|
815
819
|
typed: s.typed,
|
|
@@ -837,6 +841,7 @@ export {
|
|
|
837
841
|
I as getGlobalMessage,
|
|
838
842
|
V as getSchemaMessage,
|
|
839
843
|
q as getSpecificMessage,
|
|
844
|
+
le as is,
|
|
840
845
|
J as lazy,
|
|
841
846
|
Q as literal,
|
|
842
847
|
T as looseObject,
|
|
@@ -848,18 +853,18 @@ export {
|
|
|
848
853
|
X as number,
|
|
849
854
|
Y as object,
|
|
850
855
|
Z as optional,
|
|
851
|
-
|
|
856
|
+
pe as parse,
|
|
852
857
|
$ as picklist,
|
|
853
|
-
|
|
854
|
-
|
|
858
|
+
ae as pipe,
|
|
859
|
+
ce as pipeAsync,
|
|
855
860
|
ee as record,
|
|
856
|
-
|
|
857
|
-
|
|
861
|
+
fe as safeParse,
|
|
862
|
+
oe as safeParseAsync,
|
|
858
863
|
ne as string,
|
|
859
864
|
C as transform,
|
|
860
865
|
F as trim,
|
|
861
866
|
re as tuple,
|
|
862
867
|
se as union,
|
|
863
|
-
|
|
864
|
-
|
|
868
|
+
ue as unknown,
|
|
869
|
+
te as variant
|
|
865
870
|
};
|
package/dist/package.json.js
CHANGED