voodoojs 0.4.6 → 0.6.0
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/{chunk-RJUNPXQF.js → chunk-4LR3IFPX.js} +2 -2
- package/dist/{chunk-4HQEOXTK.js → chunk-CNHNFTPC.js} +73 -69
- package/dist/{chunk-5CKGDARU.js → chunk-PHMBDPWH.js} +3 -3
- package/dist/essential.cjs +70 -66
- package/dist/essential.d.cts +1 -1
- package/dist/essential.d.ts +1 -1
- package/dist/essential.js +2 -2
- package/dist/gpu.cjs +18 -18
- package/dist/gpu.js +20 -20
- package/dist/index.cjs +273 -269
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +199 -199
- package/dist/{query-DQFRmu3u.d.ts → query-CC-_z7v0.d.ts} +33 -33
- package/dist/{query-CKJ4oSpG.d.cts → query-sEJXe_cO.d.cts} +33 -33
- package/dist/socket.d.cts +4 -4
- package/dist/socket.d.ts +4 -4
- package/dist/socket.js +3 -3
- package/dist/voodoo.core.js +39 -35
- package/dist/voodoo.core.min.js +15 -15
- package/dist/voodoo.full.js +268 -264
- package/dist/voodoo.full.min.js +74 -74
- package/dist/voodoo.js +71 -67
- package/dist/voodoo.min.js +22 -22
- package/package.json +1 -1
|
@@ -942,5 +942,5 @@ Object.defineProperty(factory, "open", {
|
|
|
942
942
|
var socket = factory;
|
|
943
943
|
|
|
944
944
|
export { ENGINE, SIO, createSocket, decodeEngine, decodeSocketIo, devtoolsBus, encodeSocketIo, engineURL, resolveSocketURL, socket, socketSupported };
|
|
945
|
-
//# sourceMappingURL=chunk-
|
|
946
|
-
//# sourceMappingURL=chunk-
|
|
945
|
+
//# sourceMappingURL=chunk-4LR3IFPX.js.map
|
|
946
|
+
//# sourceMappingURL=chunk-4LR3IFPX.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { http, HttpError, request } from './chunk-PQZEVFVZ.js';
|
|
2
|
-
import { stringify, markInitialized, markSkipChildren, destroy, walk, removeQuietly, evaluateIn, addCleanup, markNodeScope, setComponentMounter, closestDirective, magic, readAttr, hasAttr, componentAliases, Scope, queryDirective, parse, evaluate, parseAttribute, originalAttributes, findScope, VoodooRuntimeError, VoodooSyntaxError, allowedGlobals, clearParseCache, tokenize, getScope, stopObserving, refresh, start, magics, rootScope, isInitialized, restoreAttributes, hasDirectives } from './chunk-
|
|
2
|
+
import { stringify, markInitialized, markSkipChildren, destroy, walk, removeQuietly, evaluateIn, addCleanup, markNodeScope, setComponentMounter, closestDirective, magic, readAttr, hasAttr, componentAliases, Scope, queryDirective, parse, evaluate, parseAttribute, originalAttributes, hasDirective, findScope, VoodooRuntimeError, VoodooSyntaxError, allowedGlobals, clearParseCache, tokenize, getScope, stopObserving, refresh, start, magics, rootScope, isInitialized, restoreAttributes, hasDirectives } from './chunk-PHMBDPWH.js';
|
|
3
3
|
import { ref, reactive, handleError, nextTick, queuePostFlush, warn, watch, EffectScope, computed, effect, toRaw, flushSync, effectScope, stop, unref, markRaw, watchEffect, shallowRef, setErrorHandler } from './chunk-NNU6WOOU.js';
|
|
4
4
|
import { warnDuplicateKey, warn as warn$1, describeElement, warnUnknownComponent, warnAlias, warnRequiredProp } from './chunk-A2UOVQBP.js';
|
|
5
5
|
import { parseDuration, debounce, utils_exports, throttle, uid, device, escapeHtml } from './chunk-234ZLC6W.js';
|
|
@@ -617,7 +617,7 @@ function globalThis_V() {
|
|
|
617
617
|
|
|
618
618
|
// src/store/index.ts
|
|
619
619
|
var stores = /* @__PURE__ */ new Map();
|
|
620
|
-
var
|
|
620
|
+
var version = ref(0);
|
|
621
621
|
var persistHandles = /* @__PURE__ */ new Map();
|
|
622
622
|
function store(name, definition, options = {}) {
|
|
623
623
|
const existing = stores.get(name);
|
|
@@ -634,30 +634,30 @@ function store(name, definition, options = {}) {
|
|
|
634
634
|
return existing;
|
|
635
635
|
}
|
|
636
636
|
const key = typeof options.persist === "string" ? options.persist : `voodoo:store:${name}`;
|
|
637
|
-
const
|
|
638
|
-
const initial = Object.defineProperties({},
|
|
637
|
+
const descriptors = Object.getOwnPropertyDescriptors(definition);
|
|
638
|
+
const initial = Object.defineProperties({}, descriptors);
|
|
639
639
|
if (options.persist && typeof localStorage !== "undefined") {
|
|
640
640
|
try {
|
|
641
641
|
const saved = localStorage.getItem(key);
|
|
642
642
|
if (saved) {
|
|
643
|
-
const
|
|
644
|
-
for (const [
|
|
645
|
-
if (
|
|
646
|
-
initial[
|
|
643
|
+
const parsed = JSON.parse(saved);
|
|
644
|
+
for (const [field, value] of Object.entries(parsed)) {
|
|
645
|
+
if (descriptors[field] && !("value" in descriptors[field])) continue;
|
|
646
|
+
initial[field] = value;
|
|
647
647
|
}
|
|
648
648
|
}
|
|
649
649
|
} catch {
|
|
650
650
|
}
|
|
651
651
|
}
|
|
652
652
|
const created = reactive(initial);
|
|
653
|
-
for (const [prop,
|
|
654
|
-
const value =
|
|
653
|
+
for (const [prop, descriptor] of Object.entries(descriptors)) {
|
|
654
|
+
const value = descriptor.value;
|
|
655
655
|
if (typeof value === "function") {
|
|
656
656
|
created[prop] = (...args) => value.apply(created, args);
|
|
657
657
|
}
|
|
658
658
|
}
|
|
659
659
|
stores.set(name, created);
|
|
660
|
-
|
|
660
|
+
version.value++;
|
|
661
661
|
if (options.persist && typeof localStorage !== "undefined") {
|
|
662
662
|
const stop2 = watch(
|
|
663
663
|
created,
|
|
@@ -675,10 +675,10 @@ function store(name, definition, options = {}) {
|
|
|
675
675
|
}
|
|
676
676
|
function stripFunctions(source) {
|
|
677
677
|
const out = {};
|
|
678
|
-
const
|
|
678
|
+
const descriptors = Object.getOwnPropertyDescriptors(toRaw(source));
|
|
679
679
|
for (const [key, value] of Object.entries(source)) {
|
|
680
680
|
if (typeof value === "function") continue;
|
|
681
|
-
if (
|
|
681
|
+
if (descriptors[key] && !("value" in descriptors[key])) continue;
|
|
682
682
|
out[key] = value;
|
|
683
683
|
}
|
|
684
684
|
return out;
|
|
@@ -687,11 +687,11 @@ var allStores = new Proxy(
|
|
|
687
687
|
{},
|
|
688
688
|
{
|
|
689
689
|
get: (_t, key) => {
|
|
690
|
-
void
|
|
690
|
+
void version.value;
|
|
691
691
|
return stores.get(key);
|
|
692
692
|
},
|
|
693
693
|
has: (_t, key) => {
|
|
694
|
-
void
|
|
694
|
+
void version.value;
|
|
695
695
|
return stores.has(key);
|
|
696
696
|
},
|
|
697
697
|
ownKeys: () => [...stores.keys()],
|
|
@@ -794,6 +794,7 @@ function render(options) {
|
|
|
794
794
|
element.setAttribute("data-type", type);
|
|
795
795
|
element.setAttribute("role", type === "error" ? "alert" : "status");
|
|
796
796
|
element.setAttribute("aria-live", type === "error" ? "assertive" : "polite");
|
|
797
|
+
element.setAttribute("aria-atomic", "true");
|
|
797
798
|
let closed = false;
|
|
798
799
|
let timer = null;
|
|
799
800
|
const close = () => {
|
|
@@ -1114,10 +1115,11 @@ var cache = {
|
|
|
1114
1115
|
}
|
|
1115
1116
|
};
|
|
1116
1117
|
var THEME_KEY = "voodoo:theme";
|
|
1118
|
+
var picked = null;
|
|
1117
1119
|
var theme = {
|
|
1118
1120
|
/** Theme chosen by the user, or `system` when never set. */
|
|
1119
1121
|
get current() {
|
|
1120
|
-
return storage.get(THEME_KEY) ?? "system";
|
|
1122
|
+
return storage.get(THEME_KEY) ?? picked ?? "system";
|
|
1121
1123
|
},
|
|
1122
1124
|
/** Theme effectively applied, resolving `system`. */
|
|
1123
1125
|
get resolved() {
|
|
@@ -1127,6 +1129,7 @@ var theme = {
|
|
|
1127
1129
|
return matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
1128
1130
|
},
|
|
1129
1131
|
set(value) {
|
|
1132
|
+
picked = value;
|
|
1130
1133
|
storage.set(THEME_KEY, value);
|
|
1131
1134
|
this.apply();
|
|
1132
1135
|
},
|
|
@@ -1137,7 +1140,7 @@ var theme = {
|
|
|
1137
1140
|
},
|
|
1138
1141
|
/** `true` once the visitor has actually picked a theme. */
|
|
1139
1142
|
get chosen() {
|
|
1140
|
-
return storage.get(THEME_KEY) != null;
|
|
1143
|
+
return picked !== null || storage.get(THEME_KEY) != null;
|
|
1141
1144
|
},
|
|
1142
1145
|
/** Writes `data-theme` on the root element and notifies the page. */
|
|
1143
1146
|
apply() {
|
|
@@ -1161,7 +1164,8 @@ var theme = {
|
|
|
1161
1164
|
init() {
|
|
1162
1165
|
if (typeof document === "undefined") return;
|
|
1163
1166
|
this.apply();
|
|
1164
|
-
|
|
1167
|
+
if (typeof matchMedia === "undefined") return;
|
|
1168
|
+
matchMedia("(prefers-color-scheme: dark)").addEventListener("change", () => {
|
|
1165
1169
|
if (this.current === "system") this.apply();
|
|
1166
1170
|
});
|
|
1167
1171
|
}
|
|
@@ -1589,8 +1593,8 @@ function transitionOptions(el) {
|
|
|
1589
1593
|
defineDirective("text", ({ el, effect: effect2, evaluate: ev }) => {
|
|
1590
1594
|
effect2(() => {
|
|
1591
1595
|
el.textContent = stringify(ev());
|
|
1592
|
-
const
|
|
1593
|
-
if (
|
|
1596
|
+
const first = el.firstChild;
|
|
1597
|
+
if (first && first.nodeType === 3) markInitialized(first);
|
|
1594
1598
|
});
|
|
1595
1599
|
});
|
|
1596
1600
|
defineDirective("html", (ctx) => {
|
|
@@ -1793,10 +1797,10 @@ defineDirective(
|
|
|
1793
1797
|
next.push({ key, scope: childScope, nodes, data: childScope.data });
|
|
1794
1798
|
});
|
|
1795
1799
|
if (batch.fragment.firstChild) anchor.parentNode?.insertBefore(batch.fragment, anchor);
|
|
1796
|
-
for (const [node,
|
|
1797
|
-
const
|
|
1800
|
+
for (const [node, rowScope] of batch.pending) walk(node, rowScope);
|
|
1801
|
+
const reused = new Set(next);
|
|
1798
1802
|
for (const block2 of blocks) {
|
|
1799
|
-
if (used.has(block2.key) &&
|
|
1803
|
+
if (used.has(block2.key) && reused.has(block2)) continue;
|
|
1800
1804
|
for (const node of block2.nodes) {
|
|
1801
1805
|
destroy(node);
|
|
1802
1806
|
node.remove();
|
|
@@ -1866,7 +1870,7 @@ var BOOLEAN_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
|
1866
1870
|
"novalidate",
|
|
1867
1871
|
"inert"
|
|
1868
1872
|
]);
|
|
1869
|
-
var
|
|
1873
|
+
var URL_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
1870
1874
|
"href",
|
|
1871
1875
|
"src",
|
|
1872
1876
|
"action",
|
|
@@ -1875,15 +1879,15 @@ var ATRIBUTOS_DE_URL = /* @__PURE__ */ new Set([
|
|
|
1875
1879
|
"ping",
|
|
1876
1880
|
"poster"
|
|
1877
1881
|
]);
|
|
1878
|
-
var
|
|
1879
|
-
function
|
|
1880
|
-
const
|
|
1881
|
-
return
|
|
1882
|
+
var SCHEME_NOISE = /[\s\x00-\x1f]/g;
|
|
1883
|
+
function isDangerousUrl(value) {
|
|
1884
|
+
const clean = value.replace(SCHEME_NOISE, "").toLowerCase();
|
|
1885
|
+
return clean.startsWith("javascript:") || clean.startsWith("vbscript:") || clean.startsWith("data:text/html") || clean.startsWith("data:application/xhtml");
|
|
1882
1886
|
}
|
|
1883
|
-
function applyBinding(el, name, value, asProp = false,
|
|
1887
|
+
function applyBinding(el, name, value, asProp = false, allowDangerous = false) {
|
|
1884
1888
|
if (name === "class") return applyClass(el, value);
|
|
1885
1889
|
if (name === "style") return applyStyle(el, value);
|
|
1886
|
-
if (config.sanitizeUrls && !
|
|
1890
|
+
if (config.sanitizeUrls && !allowDangerous && name === "srcdoc") {
|
|
1887
1891
|
warn$1(
|
|
1888
1892
|
`:srcdoc refused in ${describeElement(el)}: the value becomes a document with active script inside the iframe, the same way v-html becomes markup. If the content is trusted, write :srcdoc.dangerous="..."; to turn off this protection on the entire application, set V.config.sanitizeUrls = false.`
|
|
1889
1893
|
);
|
|
@@ -1891,7 +1895,7 @@ function applyBinding(el, name, value, asProp = false, perigoLiberado = false) {
|
|
|
1891
1895
|
return;
|
|
1892
1896
|
}
|
|
1893
1897
|
if (config.sanitizeUrls && !asProp) {
|
|
1894
|
-
if (
|
|
1898
|
+
if (URL_ATTRIBUTES.has(name) && typeof value === "string" && isDangerousUrl(value)) {
|
|
1895
1899
|
warn$1(
|
|
1896
1900
|
`value refused in :${name} of ${describeElement(el)}: "${value.slice(0, 60)}" uses a scheme that executes code. Use an http(s) or relative address. To turn off this protection, set V.config.sanitizeUrls = false.`
|
|
1897
1901
|
);
|
|
@@ -1988,9 +1992,9 @@ defineDirective(
|
|
|
1988
1992
|
}
|
|
1989
1993
|
if (arg === "key") return;
|
|
1990
1994
|
const asProp = !!modifiers.prop;
|
|
1991
|
-
const
|
|
1995
|
+
const allowDangerous = !!modifiers.dangerous;
|
|
1992
1996
|
effect2(() => {
|
|
1993
|
-
applyBinding(el, arg, ev(), asProp,
|
|
1997
|
+
applyBinding(el, arg, ev(), asProp, allowDangerous);
|
|
1994
1998
|
});
|
|
1995
1999
|
},
|
|
1996
2000
|
{ priority: PRIORITY.BIND }
|
|
@@ -2945,11 +2949,11 @@ function data(values) {
|
|
|
2945
2949
|
Object.defineProperties(rootScope.data, Object.getOwnPropertyDescriptors(values));
|
|
2946
2950
|
return rootScope.data;
|
|
2947
2951
|
}
|
|
2948
|
-
var
|
|
2952
|
+
var version2 = "0.4.6";
|
|
2949
2953
|
var core = {
|
|
2950
2954
|
// Utilities first: Voodoo's own names can override.
|
|
2951
2955
|
...utils_exports,
|
|
2952
|
-
version,
|
|
2956
|
+
version: version2,
|
|
2953
2957
|
config,
|
|
2954
2958
|
// Reactivity
|
|
2955
2959
|
reactive,
|
|
@@ -6551,37 +6555,37 @@ defineDirective("offline", ({ el, expression, scope, modifiers, cleanup }) => {
|
|
|
6551
6555
|
|
|
6552
6556
|
// src/forms/validate.ts
|
|
6553
6557
|
var messages = {
|
|
6554
|
-
required: "
|
|
6555
|
-
email: "
|
|
6556
|
-
url: "
|
|
6557
|
-
number: "
|
|
6558
|
-
integer: "
|
|
6559
|
-
decimal: "
|
|
6560
|
-
alpha: "Use
|
|
6561
|
-
alphanumeric: "Use
|
|
6562
|
-
minlength: "Use
|
|
6563
|
-
maxlength: "Use
|
|
6564
|
-
min: "
|
|
6565
|
-
max: "
|
|
6566
|
-
between: "
|
|
6567
|
-
match: "
|
|
6568
|
-
regex: "
|
|
6569
|
-
date: "
|
|
6570
|
-
after: "
|
|
6571
|
-
before: "
|
|
6572
|
-
accepted: "
|
|
6573
|
-
same: "
|
|
6574
|
-
different: "
|
|
6575
|
-
in: "
|
|
6576
|
-
notin: "
|
|
6577
|
-
phone: "
|
|
6578
|
-
cpf: "CPF
|
|
6579
|
-
cnpj: "CNPJ
|
|
6580
|
-
cep: "
|
|
6581
|
-
creditcard: "
|
|
6582
|
-
strongpassword: "Use {param}
|
|
6583
|
-
unique: "
|
|
6584
|
-
invalid: "
|
|
6558
|
+
required: "Please fill in this field.",
|
|
6559
|
+
email: "Enter a valid email address.",
|
|
6560
|
+
url: "Enter a valid URL.",
|
|
6561
|
+
number: "Enter a valid number.",
|
|
6562
|
+
integer: "Enter a whole number.",
|
|
6563
|
+
decimal: "Enter a valid decimal number.",
|
|
6564
|
+
alpha: "Use letters only.",
|
|
6565
|
+
alphanumeric: "Use letters and numbers only.",
|
|
6566
|
+
minlength: "Use at least {param} characters.",
|
|
6567
|
+
maxlength: "Use at most {param} characters.",
|
|
6568
|
+
min: "The smallest allowed value is {param}.",
|
|
6569
|
+
max: "The largest allowed value is {param}.",
|
|
6570
|
+
between: "Enter a value between {min} and {max}.",
|
|
6571
|
+
match: "The fields do not match.",
|
|
6572
|
+
regex: "That format is not valid.",
|
|
6573
|
+
date: "Enter a valid date.",
|
|
6574
|
+
after: "The date has to be later than {param}.",
|
|
6575
|
+
before: "The date has to be earlier than {param}.",
|
|
6576
|
+
accepted: "You have to tick this to continue.",
|
|
6577
|
+
same: "The values have to be the same.",
|
|
6578
|
+
different: "The values have to be different.",
|
|
6579
|
+
in: "Choose one of the allowed options.",
|
|
6580
|
+
notin: "That value is not allowed.",
|
|
6581
|
+
phone: "Enter a valid phone number, including the area code.",
|
|
6582
|
+
cpf: "Invalid CPF.",
|
|
6583
|
+
cnpj: "Invalid CNPJ.",
|
|
6584
|
+
cep: "Invalid postcode.",
|
|
6585
|
+
creditcard: "Invalid card number.",
|
|
6586
|
+
strongpassword: "Use {param} characters or more, with an upper case letter, a lower case letter, a number and a symbol.",
|
|
6587
|
+
unique: "That value is already taken.",
|
|
6588
|
+
invalid: "Invalid value."
|
|
6585
6589
|
};
|
|
6586
6590
|
function formatMessage(template, data2) {
|
|
6587
6591
|
const param = data2.param ?? "";
|
|
@@ -9522,7 +9526,7 @@ function openDialog(request2) {
|
|
|
9522
9526
|
source.remove();
|
|
9523
9527
|
}
|
|
9524
9528
|
sourceAnchors.delete(source);
|
|
9525
|
-
if (source
|
|
9529
|
+
if (hasDirective(source, "modal-content")) {
|
|
9526
9530
|
source.setAttribute("hidden", "");
|
|
9527
9531
|
}
|
|
9528
9532
|
}
|
|
@@ -10267,5 +10271,5 @@ defineDirective(
|
|
|
10267
10271
|
);
|
|
10268
10272
|
|
|
10269
10273
|
export { VoodooCollection, alert, allStores, applyMask, cache, clearErrors, clipboard, confirm, cookie, core, createApp, createResource, defineComponent, dialog, efeitos, ensurePalette, enter, fadeIn, fadeOut, fromHtml, hotkey, instances, leave, mask, masks, messages, modal, mountComponent, network, palette, prompt, query, ready, ready2, registerMask, removeStore, screen, serializeForm, session, showFieldError, showFormErrors, slideDown, slideUp, sound, storage, store, storeNames, theme, toast, unmask, url, validate, validator, viewTransition, whenElement, whenReady };
|
|
10270
|
-
//# sourceMappingURL=chunk-
|
|
10271
|
-
//# sourceMappingURL=chunk-
|
|
10274
|
+
//# sourceMappingURL=chunk-CNHNFTPC.js.map
|
|
10275
|
+
//# sourceMappingURL=chunk-CNHNFTPC.js.map
|
|
@@ -1840,6 +1840,6 @@ function refresh(root) {
|
|
|
1840
1840
|
walk(root ?? document.body, root ? findScope(root.parentNode) : rootScope);
|
|
1841
1841
|
}
|
|
1842
1842
|
|
|
1843
|
-
export { Scope, VoodooRuntimeError, VoodooSyntaxError, addCleanup, allowedGlobals, clearParseCache, closestDirective, collectDirectives, componentAliases, destroy, evaluate, evaluateIn, findScope, getEffectScopes, getScope, hadDirectives, hasAttr, hasDirectives, isInitialized, magic, magics, markInitialized, markNodeScope, markSkipChildren, originalAttributes, parse, parseAttribute, queryDirective, readAttr, refresh, removeQuietly, restoreAttributes, rootScope, setComponentMounter, start, stopObserving, stringify, tokenize, walk };
|
|
1844
|
-
//# sourceMappingURL=chunk-
|
|
1845
|
-
//# sourceMappingURL=chunk-
|
|
1843
|
+
export { Scope, VoodooRuntimeError, VoodooSyntaxError, addCleanup, allowedGlobals, clearParseCache, closestDirective, collectDirectives, componentAliases, destroy, evaluate, evaluateIn, findScope, getEffectScopes, getScope, hadDirectives, hasAttr, hasDirective, hasDirectives, isInitialized, magic, magics, markInitialized, markNodeScope, markSkipChildren, originalAttributes, parse, parseAttribute, queryDirective, readAttr, refresh, removeQuietly, restoreAttributes, rootScope, setComponentMounter, start, stopObserving, stringify, tokenize, walk };
|
|
1844
|
+
//# sourceMappingURL=chunk-PHMBDPWH.js.map
|
|
1845
|
+
//# sourceMappingURL=chunk-PHMBDPWH.js.map
|
package/dist/essential.cjs
CHANGED
|
@@ -3338,7 +3338,7 @@ init_reactivity();
|
|
|
3338
3338
|
// src/store/index.ts
|
|
3339
3339
|
init_reactivity();
|
|
3340
3340
|
var stores = /* @__PURE__ */ new Map();
|
|
3341
|
-
var
|
|
3341
|
+
var version = ref(0);
|
|
3342
3342
|
var persistHandles = /* @__PURE__ */ new Map();
|
|
3343
3343
|
function store(name, definition, options = {}) {
|
|
3344
3344
|
const existing = stores.get(name);
|
|
@@ -3355,30 +3355,30 @@ function store(name, definition, options = {}) {
|
|
|
3355
3355
|
return existing;
|
|
3356
3356
|
}
|
|
3357
3357
|
const key = typeof options.persist === "string" ? options.persist : `voodoo:store:${name}`;
|
|
3358
|
-
const
|
|
3359
|
-
const initial = Object.defineProperties({},
|
|
3358
|
+
const descriptors = Object.getOwnPropertyDescriptors(definition);
|
|
3359
|
+
const initial = Object.defineProperties({}, descriptors);
|
|
3360
3360
|
if (options.persist && typeof localStorage !== "undefined") {
|
|
3361
3361
|
try {
|
|
3362
3362
|
const saved = localStorage.getItem(key);
|
|
3363
3363
|
if (saved) {
|
|
3364
|
-
const
|
|
3365
|
-
for (const [
|
|
3366
|
-
if (
|
|
3367
|
-
initial[
|
|
3364
|
+
const parsed = JSON.parse(saved);
|
|
3365
|
+
for (const [field, value] of Object.entries(parsed)) {
|
|
3366
|
+
if (descriptors[field] && !("value" in descriptors[field])) continue;
|
|
3367
|
+
initial[field] = value;
|
|
3368
3368
|
}
|
|
3369
3369
|
}
|
|
3370
3370
|
} catch {
|
|
3371
3371
|
}
|
|
3372
3372
|
}
|
|
3373
3373
|
const created = reactive(initial);
|
|
3374
|
-
for (const [prop,
|
|
3375
|
-
const value =
|
|
3374
|
+
for (const [prop, descriptor] of Object.entries(descriptors)) {
|
|
3375
|
+
const value = descriptor.value;
|
|
3376
3376
|
if (typeof value === "function") {
|
|
3377
3377
|
created[prop] = (...args) => value.apply(created, args);
|
|
3378
3378
|
}
|
|
3379
3379
|
}
|
|
3380
3380
|
stores.set(name, created);
|
|
3381
|
-
|
|
3381
|
+
version.value++;
|
|
3382
3382
|
if (options.persist && typeof localStorage !== "undefined") {
|
|
3383
3383
|
const stop2 = watch(
|
|
3384
3384
|
created,
|
|
@@ -3396,10 +3396,10 @@ function store(name, definition, options = {}) {
|
|
|
3396
3396
|
}
|
|
3397
3397
|
function stripFunctions(source) {
|
|
3398
3398
|
const out = {};
|
|
3399
|
-
const
|
|
3399
|
+
const descriptors = Object.getOwnPropertyDescriptors(toRaw(source));
|
|
3400
3400
|
for (const [key, value] of Object.entries(source)) {
|
|
3401
3401
|
if (typeof value === "function") continue;
|
|
3402
|
-
if (
|
|
3402
|
+
if (descriptors[key] && !("value" in descriptors[key])) continue;
|
|
3403
3403
|
out[key] = value;
|
|
3404
3404
|
}
|
|
3405
3405
|
return out;
|
|
@@ -3408,11 +3408,11 @@ var allStores = new Proxy(
|
|
|
3408
3408
|
{},
|
|
3409
3409
|
{
|
|
3410
3410
|
get: (_t, key) => {
|
|
3411
|
-
void
|
|
3411
|
+
void version.value;
|
|
3412
3412
|
return stores.get(key);
|
|
3413
3413
|
},
|
|
3414
3414
|
has: (_t, key) => {
|
|
3415
|
-
void
|
|
3415
|
+
void version.value;
|
|
3416
3416
|
return stores.has(key);
|
|
3417
3417
|
},
|
|
3418
3418
|
ownKeys: () => [...stores.keys()],
|
|
@@ -4341,6 +4341,7 @@ function render(options) {
|
|
|
4341
4341
|
element.setAttribute("data-type", type);
|
|
4342
4342
|
element.setAttribute("role", type === "error" ? "alert" : "status");
|
|
4343
4343
|
element.setAttribute("aria-live", type === "error" ? "assertive" : "polite");
|
|
4344
|
+
element.setAttribute("aria-atomic", "true");
|
|
4344
4345
|
let closed = false;
|
|
4345
4346
|
let timer = null;
|
|
4346
4347
|
const close = () => {
|
|
@@ -4661,10 +4662,11 @@ var cache2 = {
|
|
|
4661
4662
|
}
|
|
4662
4663
|
};
|
|
4663
4664
|
var THEME_KEY = "voodoo:theme";
|
|
4665
|
+
var picked = null;
|
|
4664
4666
|
var theme = {
|
|
4665
4667
|
/** Theme chosen by the user, or `system` when never set. */
|
|
4666
4668
|
get current() {
|
|
4667
|
-
return storage.get(THEME_KEY) ?? "system";
|
|
4669
|
+
return storage.get(THEME_KEY) ?? picked ?? "system";
|
|
4668
4670
|
},
|
|
4669
4671
|
/** Theme effectively applied, resolving `system`. */
|
|
4670
4672
|
get resolved() {
|
|
@@ -4674,6 +4676,7 @@ var theme = {
|
|
|
4674
4676
|
return matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
4675
4677
|
},
|
|
4676
4678
|
set(value) {
|
|
4679
|
+
picked = value;
|
|
4677
4680
|
storage.set(THEME_KEY, value);
|
|
4678
4681
|
this.apply();
|
|
4679
4682
|
},
|
|
@@ -4684,7 +4687,7 @@ var theme = {
|
|
|
4684
4687
|
},
|
|
4685
4688
|
/** `true` once the visitor has actually picked a theme. */
|
|
4686
4689
|
get chosen() {
|
|
4687
|
-
return storage.get(THEME_KEY) != null;
|
|
4690
|
+
return picked !== null || storage.get(THEME_KEY) != null;
|
|
4688
4691
|
},
|
|
4689
4692
|
/** Writes `data-theme` on the root element and notifies the page. */
|
|
4690
4693
|
apply() {
|
|
@@ -4708,7 +4711,8 @@ var theme = {
|
|
|
4708
4711
|
init() {
|
|
4709
4712
|
if (typeof document === "undefined") return;
|
|
4710
4713
|
this.apply();
|
|
4711
|
-
|
|
4714
|
+
if (typeof matchMedia === "undefined") return;
|
|
4715
|
+
matchMedia("(prefers-color-scheme: dark)").addEventListener("change", () => {
|
|
4712
4716
|
if (this.current === "system") this.apply();
|
|
4713
4717
|
});
|
|
4714
4718
|
}
|
|
@@ -5143,8 +5147,8 @@ function transitionOptions(el) {
|
|
|
5143
5147
|
defineDirective("text", ({ el, effect: effect2, evaluate: ev }) => {
|
|
5144
5148
|
effect2(() => {
|
|
5145
5149
|
el.textContent = stringify(ev());
|
|
5146
|
-
const
|
|
5147
|
-
if (
|
|
5150
|
+
const first = el.firstChild;
|
|
5151
|
+
if (first && first.nodeType === 3) markInitialized(first);
|
|
5148
5152
|
});
|
|
5149
5153
|
});
|
|
5150
5154
|
defineDirective("html", (ctx) => {
|
|
@@ -5347,10 +5351,10 @@ defineDirective(
|
|
|
5347
5351
|
next.push({ key, scope: childScope, nodes, data: childScope.data });
|
|
5348
5352
|
});
|
|
5349
5353
|
if (batch.fragment.firstChild) anchor.parentNode?.insertBefore(batch.fragment, anchor);
|
|
5350
|
-
for (const [node,
|
|
5351
|
-
const
|
|
5354
|
+
for (const [node, rowScope] of batch.pending) walk(node, rowScope);
|
|
5355
|
+
const reused = new Set(next);
|
|
5352
5356
|
for (const block2 of blocks) {
|
|
5353
|
-
if (used.has(block2.key) &&
|
|
5357
|
+
if (used.has(block2.key) && reused.has(block2)) continue;
|
|
5354
5358
|
for (const node of block2.nodes) {
|
|
5355
5359
|
destroy(node);
|
|
5356
5360
|
node.remove();
|
|
@@ -5420,7 +5424,7 @@ var BOOLEAN_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
|
5420
5424
|
"novalidate",
|
|
5421
5425
|
"inert"
|
|
5422
5426
|
]);
|
|
5423
|
-
var
|
|
5427
|
+
var URL_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
5424
5428
|
"href",
|
|
5425
5429
|
"src",
|
|
5426
5430
|
"action",
|
|
@@ -5429,15 +5433,15 @@ var ATRIBUTOS_DE_URL = /* @__PURE__ */ new Set([
|
|
|
5429
5433
|
"ping",
|
|
5430
5434
|
"poster"
|
|
5431
5435
|
]);
|
|
5432
|
-
var
|
|
5433
|
-
function
|
|
5434
|
-
const
|
|
5435
|
-
return
|
|
5436
|
+
var SCHEME_NOISE = /[\s\x00-\x1f]/g;
|
|
5437
|
+
function isDangerousUrl(value) {
|
|
5438
|
+
const clean = value.replace(SCHEME_NOISE, "").toLowerCase();
|
|
5439
|
+
return clean.startsWith("javascript:") || clean.startsWith("vbscript:") || clean.startsWith("data:text/html") || clean.startsWith("data:application/xhtml");
|
|
5436
5440
|
}
|
|
5437
|
-
function applyBinding(el, name, value, asProp = false,
|
|
5441
|
+
function applyBinding(el, name, value, asProp = false, allowDangerous = false) {
|
|
5438
5442
|
if (name === "class") return applyClass(el, value);
|
|
5439
5443
|
if (name === "style") return applyStyle(el, value);
|
|
5440
|
-
if (config.sanitizeUrls && !
|
|
5444
|
+
if (config.sanitizeUrls && !allowDangerous && name === "srcdoc") {
|
|
5441
5445
|
warn2(
|
|
5442
5446
|
`:srcdoc refused in ${describeElement(el)}: the value becomes a document with active script inside the iframe, the same way v-html becomes markup. If the content is trusted, write :srcdoc.dangerous="..."; to turn off this protection on the entire application, set V.config.sanitizeUrls = false.`
|
|
5443
5447
|
);
|
|
@@ -5445,7 +5449,7 @@ function applyBinding(el, name, value, asProp = false, perigoLiberado = false) {
|
|
|
5445
5449
|
return;
|
|
5446
5450
|
}
|
|
5447
5451
|
if (config.sanitizeUrls && !asProp) {
|
|
5448
|
-
if (
|
|
5452
|
+
if (URL_ATTRIBUTES.has(name) && typeof value === "string" && isDangerousUrl(value)) {
|
|
5449
5453
|
warn2(
|
|
5450
5454
|
`value refused in :${name} of ${describeElement(el)}: "${value.slice(0, 60)}" uses a scheme that executes code. Use an http(s) or relative address. To turn off this protection, set V.config.sanitizeUrls = false.`
|
|
5451
5455
|
);
|
|
@@ -5542,9 +5546,9 @@ defineDirective(
|
|
|
5542
5546
|
}
|
|
5543
5547
|
if (arg === "key") return;
|
|
5544
5548
|
const asProp = !!modifiers.prop;
|
|
5545
|
-
const
|
|
5549
|
+
const allowDangerous = !!modifiers.dangerous;
|
|
5546
5550
|
effect2(() => {
|
|
5547
|
-
applyBinding(el, arg, ev(), asProp,
|
|
5551
|
+
applyBinding(el, arg, ev(), asProp, allowDangerous);
|
|
5548
5552
|
});
|
|
5549
5553
|
},
|
|
5550
5554
|
{ priority: PRIORITY.BIND }
|
|
@@ -6501,11 +6505,11 @@ function data(values) {
|
|
|
6501
6505
|
Object.defineProperties(rootScope.data, Object.getOwnPropertyDescriptors(values));
|
|
6502
6506
|
return rootScope.data;
|
|
6503
6507
|
}
|
|
6504
|
-
var
|
|
6508
|
+
var version2 = "0.4.6";
|
|
6505
6509
|
var core = {
|
|
6506
6510
|
// Utilities first: Voodoo's own names can override.
|
|
6507
6511
|
...utils_exports,
|
|
6508
|
-
version,
|
|
6512
|
+
version: version2,
|
|
6509
6513
|
config,
|
|
6510
6514
|
// Reactivity
|
|
6511
6515
|
reactive,
|
|
@@ -10125,37 +10129,37 @@ init_reactivity();
|
|
|
10125
10129
|
init_registry();
|
|
10126
10130
|
init_style();
|
|
10127
10131
|
var messages = {
|
|
10128
|
-
required: "
|
|
10129
|
-
email: "
|
|
10130
|
-
url: "
|
|
10131
|
-
number: "
|
|
10132
|
-
integer: "
|
|
10133
|
-
decimal: "
|
|
10134
|
-
alpha: "Use
|
|
10135
|
-
alphanumeric: "Use
|
|
10136
|
-
minlength: "Use
|
|
10137
|
-
maxlength: "Use
|
|
10138
|
-
min: "
|
|
10139
|
-
max: "
|
|
10140
|
-
between: "
|
|
10141
|
-
match: "
|
|
10142
|
-
regex: "
|
|
10143
|
-
date: "
|
|
10144
|
-
after: "
|
|
10145
|
-
before: "
|
|
10146
|
-
accepted: "
|
|
10147
|
-
same: "
|
|
10148
|
-
different: "
|
|
10149
|
-
in: "
|
|
10150
|
-
notin: "
|
|
10151
|
-
phone: "
|
|
10152
|
-
cpf: "CPF
|
|
10153
|
-
cnpj: "CNPJ
|
|
10154
|
-
cep: "
|
|
10155
|
-
creditcard: "
|
|
10156
|
-
strongpassword: "Use {param}
|
|
10157
|
-
unique: "
|
|
10158
|
-
invalid: "
|
|
10132
|
+
required: "Please fill in this field.",
|
|
10133
|
+
email: "Enter a valid email address.",
|
|
10134
|
+
url: "Enter a valid URL.",
|
|
10135
|
+
number: "Enter a valid number.",
|
|
10136
|
+
integer: "Enter a whole number.",
|
|
10137
|
+
decimal: "Enter a valid decimal number.",
|
|
10138
|
+
alpha: "Use letters only.",
|
|
10139
|
+
alphanumeric: "Use letters and numbers only.",
|
|
10140
|
+
minlength: "Use at least {param} characters.",
|
|
10141
|
+
maxlength: "Use at most {param} characters.",
|
|
10142
|
+
min: "The smallest allowed value is {param}.",
|
|
10143
|
+
max: "The largest allowed value is {param}.",
|
|
10144
|
+
between: "Enter a value between {min} and {max}.",
|
|
10145
|
+
match: "The fields do not match.",
|
|
10146
|
+
regex: "That format is not valid.",
|
|
10147
|
+
date: "Enter a valid date.",
|
|
10148
|
+
after: "The date has to be later than {param}.",
|
|
10149
|
+
before: "The date has to be earlier than {param}.",
|
|
10150
|
+
accepted: "You have to tick this to continue.",
|
|
10151
|
+
same: "The values have to be the same.",
|
|
10152
|
+
different: "The values have to be different.",
|
|
10153
|
+
in: "Choose one of the allowed options.",
|
|
10154
|
+
notin: "That value is not allowed.",
|
|
10155
|
+
phone: "Enter a valid phone number, including the area code.",
|
|
10156
|
+
cpf: "Invalid CPF.",
|
|
10157
|
+
cnpj: "Invalid CNPJ.",
|
|
10158
|
+
cep: "Invalid postcode.",
|
|
10159
|
+
creditcard: "Invalid card number.",
|
|
10160
|
+
strongpassword: "Use {param} characters or more, with an upper case letter, a lower case letter, a number and a symbol.",
|
|
10161
|
+
unique: "That value is already taken.",
|
|
10162
|
+
invalid: "Invalid value."
|
|
10159
10163
|
};
|
|
10160
10164
|
function formatMessage(template, data2) {
|
|
10161
10165
|
const param = data2.param ?? "";
|
|
@@ -13105,7 +13109,7 @@ function openDialog(request2) {
|
|
|
13105
13109
|
source.remove();
|
|
13106
13110
|
}
|
|
13107
13111
|
sourceAnchors.delete(source);
|
|
13108
|
-
if (source
|
|
13112
|
+
if (hasDirective(source, "modal-content")) {
|
|
13109
13113
|
source.setAttribute("hidden", "");
|
|
13110
13114
|
}
|
|
13111
13115
|
}
|
package/dist/essential.d.cts
CHANGED
package/dist/essential.d.ts
CHANGED
package/dist/essential.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { core, sound, hotkey, palette, registerMask, unmask, applyMask, masks, mask, clearErrors, showFieldError, showFormErrors, messages, serializeForm, validate, validator, dialog, prompt, confirm, alert, modal, VoodooCollection, fromHtml, ready2, query } from './chunk-
|
|
1
|
+
import { core, sound, hotkey, palette, registerMask, unmask, applyMask, masks, mask, clearErrors, showFieldError, showFormErrors, messages, serializeForm, validate, validator, dialog, prompt, confirm, alert, modal, VoodooCollection, fromHtml, ready2, query } from './chunk-CNHNFTPC.js';
|
|
2
2
|
import './chunk-PQZEVFVZ.js';
|
|
3
|
-
import { magic } from './chunk-
|
|
3
|
+
import { magic } from './chunk-PHMBDPWH.js';
|
|
4
4
|
import './chunk-NNU6WOOU.js';
|
|
5
5
|
import './chunk-A2UOVQBP.js';
|
|
6
6
|
import './chunk-234ZLC6W.js';
|