voodoojs 0.5.0 → 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-ABRZI32G.js → chunk-CNHNFTPC.js} +72 -69
- package/dist/{chunk-34CGORMO.js → chunk-PHMBDPWH.js} +3 -3
- package/dist/essential.cjs +69 -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 +272 -269
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +199 -199
- package/dist/{query-BeYufh-f.d.ts → query-CC-_z7v0.d.ts} +5 -5
- package/dist/{query-Bja83lRJ.d.cts → query-sEJXe_cO.d.cts} +5 -5
- 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 +38 -35
- package/dist/voodoo.core.min.js +15 -15
- package/dist/voodoo.full.js +267 -264
- package/dist/voodoo.full.min.js +74 -74
- package/dist/voodoo.js +70 -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()],
|
|
@@ -1115,10 +1115,11 @@ var cache = {
|
|
|
1115
1115
|
}
|
|
1116
1116
|
};
|
|
1117
1117
|
var THEME_KEY = "voodoo:theme";
|
|
1118
|
+
var picked = null;
|
|
1118
1119
|
var theme = {
|
|
1119
1120
|
/** Theme chosen by the user, or `system` when never set. */
|
|
1120
1121
|
get current() {
|
|
1121
|
-
return storage.get(THEME_KEY) ?? "system";
|
|
1122
|
+
return storage.get(THEME_KEY) ?? picked ?? "system";
|
|
1122
1123
|
},
|
|
1123
1124
|
/** Theme effectively applied, resolving `system`. */
|
|
1124
1125
|
get resolved() {
|
|
@@ -1128,6 +1129,7 @@ var theme = {
|
|
|
1128
1129
|
return matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
1129
1130
|
},
|
|
1130
1131
|
set(value) {
|
|
1132
|
+
picked = value;
|
|
1131
1133
|
storage.set(THEME_KEY, value);
|
|
1132
1134
|
this.apply();
|
|
1133
1135
|
},
|
|
@@ -1138,7 +1140,7 @@ var theme = {
|
|
|
1138
1140
|
},
|
|
1139
1141
|
/** `true` once the visitor has actually picked a theme. */
|
|
1140
1142
|
get chosen() {
|
|
1141
|
-
return storage.get(THEME_KEY) != null;
|
|
1143
|
+
return picked !== null || storage.get(THEME_KEY) != null;
|
|
1142
1144
|
},
|
|
1143
1145
|
/** Writes `data-theme` on the root element and notifies the page. */
|
|
1144
1146
|
apply() {
|
|
@@ -1162,7 +1164,8 @@ var theme = {
|
|
|
1162
1164
|
init() {
|
|
1163
1165
|
if (typeof document === "undefined") return;
|
|
1164
1166
|
this.apply();
|
|
1165
|
-
|
|
1167
|
+
if (typeof matchMedia === "undefined") return;
|
|
1168
|
+
matchMedia("(prefers-color-scheme: dark)").addEventListener("change", () => {
|
|
1166
1169
|
if (this.current === "system") this.apply();
|
|
1167
1170
|
});
|
|
1168
1171
|
}
|
|
@@ -1590,8 +1593,8 @@ function transitionOptions(el) {
|
|
|
1590
1593
|
defineDirective("text", ({ el, effect: effect2, evaluate: ev }) => {
|
|
1591
1594
|
effect2(() => {
|
|
1592
1595
|
el.textContent = stringify(ev());
|
|
1593
|
-
const
|
|
1594
|
-
if (
|
|
1596
|
+
const first = el.firstChild;
|
|
1597
|
+
if (first && first.nodeType === 3) markInitialized(first);
|
|
1595
1598
|
});
|
|
1596
1599
|
});
|
|
1597
1600
|
defineDirective("html", (ctx) => {
|
|
@@ -1794,10 +1797,10 @@ defineDirective(
|
|
|
1794
1797
|
next.push({ key, scope: childScope, nodes, data: childScope.data });
|
|
1795
1798
|
});
|
|
1796
1799
|
if (batch.fragment.firstChild) anchor.parentNode?.insertBefore(batch.fragment, anchor);
|
|
1797
|
-
for (const [node,
|
|
1798
|
-
const
|
|
1800
|
+
for (const [node, rowScope] of batch.pending) walk(node, rowScope);
|
|
1801
|
+
const reused = new Set(next);
|
|
1799
1802
|
for (const block2 of blocks) {
|
|
1800
|
-
if (used.has(block2.key) &&
|
|
1803
|
+
if (used.has(block2.key) && reused.has(block2)) continue;
|
|
1801
1804
|
for (const node of block2.nodes) {
|
|
1802
1805
|
destroy(node);
|
|
1803
1806
|
node.remove();
|
|
@@ -1867,7 +1870,7 @@ var BOOLEAN_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
|
1867
1870
|
"novalidate",
|
|
1868
1871
|
"inert"
|
|
1869
1872
|
]);
|
|
1870
|
-
var
|
|
1873
|
+
var URL_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
1871
1874
|
"href",
|
|
1872
1875
|
"src",
|
|
1873
1876
|
"action",
|
|
@@ -1876,15 +1879,15 @@ var ATRIBUTOS_DE_URL = /* @__PURE__ */ new Set([
|
|
|
1876
1879
|
"ping",
|
|
1877
1880
|
"poster"
|
|
1878
1881
|
]);
|
|
1879
|
-
var
|
|
1880
|
-
function
|
|
1881
|
-
const
|
|
1882
|
-
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");
|
|
1883
1886
|
}
|
|
1884
|
-
function applyBinding(el, name, value, asProp = false,
|
|
1887
|
+
function applyBinding(el, name, value, asProp = false, allowDangerous = false) {
|
|
1885
1888
|
if (name === "class") return applyClass(el, value);
|
|
1886
1889
|
if (name === "style") return applyStyle(el, value);
|
|
1887
|
-
if (config.sanitizeUrls && !
|
|
1890
|
+
if (config.sanitizeUrls && !allowDangerous && name === "srcdoc") {
|
|
1888
1891
|
warn$1(
|
|
1889
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.`
|
|
1890
1893
|
);
|
|
@@ -1892,7 +1895,7 @@ function applyBinding(el, name, value, asProp = false, perigoLiberado = false) {
|
|
|
1892
1895
|
return;
|
|
1893
1896
|
}
|
|
1894
1897
|
if (config.sanitizeUrls && !asProp) {
|
|
1895
|
-
if (
|
|
1898
|
+
if (URL_ATTRIBUTES.has(name) && typeof value === "string" && isDangerousUrl(value)) {
|
|
1896
1899
|
warn$1(
|
|
1897
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.`
|
|
1898
1901
|
);
|
|
@@ -1989,9 +1992,9 @@ defineDirective(
|
|
|
1989
1992
|
}
|
|
1990
1993
|
if (arg === "key") return;
|
|
1991
1994
|
const asProp = !!modifiers.prop;
|
|
1992
|
-
const
|
|
1995
|
+
const allowDangerous = !!modifiers.dangerous;
|
|
1993
1996
|
effect2(() => {
|
|
1994
|
-
applyBinding(el, arg, ev(), asProp,
|
|
1997
|
+
applyBinding(el, arg, ev(), asProp, allowDangerous);
|
|
1995
1998
|
});
|
|
1996
1999
|
},
|
|
1997
2000
|
{ priority: PRIORITY.BIND }
|
|
@@ -2946,11 +2949,11 @@ function data(values) {
|
|
|
2946
2949
|
Object.defineProperties(rootScope.data, Object.getOwnPropertyDescriptors(values));
|
|
2947
2950
|
return rootScope.data;
|
|
2948
2951
|
}
|
|
2949
|
-
var
|
|
2952
|
+
var version2 = "0.4.6";
|
|
2950
2953
|
var core = {
|
|
2951
2954
|
// Utilities first: Voodoo's own names can override.
|
|
2952
2955
|
...utils_exports,
|
|
2953
|
-
version,
|
|
2956
|
+
version: version2,
|
|
2954
2957
|
config,
|
|
2955
2958
|
// Reactivity
|
|
2956
2959
|
reactive,
|
|
@@ -6552,37 +6555,37 @@ defineDirective("offline", ({ el, expression, scope, modifiers, cleanup }) => {
|
|
|
6552
6555
|
|
|
6553
6556
|
// src/forms/validate.ts
|
|
6554
6557
|
var messages = {
|
|
6555
|
-
required: "
|
|
6556
|
-
email: "
|
|
6557
|
-
url: "
|
|
6558
|
-
number: "
|
|
6559
|
-
integer: "
|
|
6560
|
-
decimal: "
|
|
6561
|
-
alpha: "Use
|
|
6562
|
-
alphanumeric: "Use
|
|
6563
|
-
minlength: "Use
|
|
6564
|
-
maxlength: "Use
|
|
6565
|
-
min: "
|
|
6566
|
-
max: "
|
|
6567
|
-
between: "
|
|
6568
|
-
match: "
|
|
6569
|
-
regex: "
|
|
6570
|
-
date: "
|
|
6571
|
-
after: "
|
|
6572
|
-
before: "
|
|
6573
|
-
accepted: "
|
|
6574
|
-
same: "
|
|
6575
|
-
different: "
|
|
6576
|
-
in: "
|
|
6577
|
-
notin: "
|
|
6578
|
-
phone: "
|
|
6579
|
-
cpf: "CPF
|
|
6580
|
-
cnpj: "CNPJ
|
|
6581
|
-
cep: "
|
|
6582
|
-
creditcard: "
|
|
6583
|
-
strongpassword: "Use {param}
|
|
6584
|
-
unique: "
|
|
6585
|
-
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."
|
|
6586
6589
|
};
|
|
6587
6590
|
function formatMessage(template, data2) {
|
|
6588
6591
|
const param = data2.param ?? "";
|
|
@@ -9523,7 +9526,7 @@ function openDialog(request2) {
|
|
|
9523
9526
|
source.remove();
|
|
9524
9527
|
}
|
|
9525
9528
|
sourceAnchors.delete(source);
|
|
9526
|
-
if (source
|
|
9529
|
+
if (hasDirective(source, "modal-content")) {
|
|
9527
9530
|
source.setAttribute("hidden", "");
|
|
9528
9531
|
}
|
|
9529
9532
|
}
|
|
@@ -10268,5 +10271,5 @@ defineDirective(
|
|
|
10268
10271
|
);
|
|
10269
10272
|
|
|
10270
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 };
|
|
10271
|
-
//# sourceMappingURL=chunk-
|
|
10272
|
-
//# 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()],
|
|
@@ -4662,10 +4662,11 @@ var cache2 = {
|
|
|
4662
4662
|
}
|
|
4663
4663
|
};
|
|
4664
4664
|
var THEME_KEY = "voodoo:theme";
|
|
4665
|
+
var picked = null;
|
|
4665
4666
|
var theme = {
|
|
4666
4667
|
/** Theme chosen by the user, or `system` when never set. */
|
|
4667
4668
|
get current() {
|
|
4668
|
-
return storage.get(THEME_KEY) ?? "system";
|
|
4669
|
+
return storage.get(THEME_KEY) ?? picked ?? "system";
|
|
4669
4670
|
},
|
|
4670
4671
|
/** Theme effectively applied, resolving `system`. */
|
|
4671
4672
|
get resolved() {
|
|
@@ -4675,6 +4676,7 @@ var theme = {
|
|
|
4675
4676
|
return matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
4676
4677
|
},
|
|
4677
4678
|
set(value) {
|
|
4679
|
+
picked = value;
|
|
4678
4680
|
storage.set(THEME_KEY, value);
|
|
4679
4681
|
this.apply();
|
|
4680
4682
|
},
|
|
@@ -4685,7 +4687,7 @@ var theme = {
|
|
|
4685
4687
|
},
|
|
4686
4688
|
/** `true` once the visitor has actually picked a theme. */
|
|
4687
4689
|
get chosen() {
|
|
4688
|
-
return storage.get(THEME_KEY) != null;
|
|
4690
|
+
return picked !== null || storage.get(THEME_KEY) != null;
|
|
4689
4691
|
},
|
|
4690
4692
|
/** Writes `data-theme` on the root element and notifies the page. */
|
|
4691
4693
|
apply() {
|
|
@@ -4709,7 +4711,8 @@ var theme = {
|
|
|
4709
4711
|
init() {
|
|
4710
4712
|
if (typeof document === "undefined") return;
|
|
4711
4713
|
this.apply();
|
|
4712
|
-
|
|
4714
|
+
if (typeof matchMedia === "undefined") return;
|
|
4715
|
+
matchMedia("(prefers-color-scheme: dark)").addEventListener("change", () => {
|
|
4713
4716
|
if (this.current === "system") this.apply();
|
|
4714
4717
|
});
|
|
4715
4718
|
}
|
|
@@ -5144,8 +5147,8 @@ function transitionOptions(el) {
|
|
|
5144
5147
|
defineDirective("text", ({ el, effect: effect2, evaluate: ev }) => {
|
|
5145
5148
|
effect2(() => {
|
|
5146
5149
|
el.textContent = stringify(ev());
|
|
5147
|
-
const
|
|
5148
|
-
if (
|
|
5150
|
+
const first = el.firstChild;
|
|
5151
|
+
if (first && first.nodeType === 3) markInitialized(first);
|
|
5149
5152
|
});
|
|
5150
5153
|
});
|
|
5151
5154
|
defineDirective("html", (ctx) => {
|
|
@@ -5348,10 +5351,10 @@ defineDirective(
|
|
|
5348
5351
|
next.push({ key, scope: childScope, nodes, data: childScope.data });
|
|
5349
5352
|
});
|
|
5350
5353
|
if (batch.fragment.firstChild) anchor.parentNode?.insertBefore(batch.fragment, anchor);
|
|
5351
|
-
for (const [node,
|
|
5352
|
-
const
|
|
5354
|
+
for (const [node, rowScope] of batch.pending) walk(node, rowScope);
|
|
5355
|
+
const reused = new Set(next);
|
|
5353
5356
|
for (const block2 of blocks) {
|
|
5354
|
-
if (used.has(block2.key) &&
|
|
5357
|
+
if (used.has(block2.key) && reused.has(block2)) continue;
|
|
5355
5358
|
for (const node of block2.nodes) {
|
|
5356
5359
|
destroy(node);
|
|
5357
5360
|
node.remove();
|
|
@@ -5421,7 +5424,7 @@ var BOOLEAN_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
|
5421
5424
|
"novalidate",
|
|
5422
5425
|
"inert"
|
|
5423
5426
|
]);
|
|
5424
|
-
var
|
|
5427
|
+
var URL_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
5425
5428
|
"href",
|
|
5426
5429
|
"src",
|
|
5427
5430
|
"action",
|
|
@@ -5430,15 +5433,15 @@ var ATRIBUTOS_DE_URL = /* @__PURE__ */ new Set([
|
|
|
5430
5433
|
"ping",
|
|
5431
5434
|
"poster"
|
|
5432
5435
|
]);
|
|
5433
|
-
var
|
|
5434
|
-
function
|
|
5435
|
-
const
|
|
5436
|
-
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");
|
|
5437
5440
|
}
|
|
5438
|
-
function applyBinding(el, name, value, asProp = false,
|
|
5441
|
+
function applyBinding(el, name, value, asProp = false, allowDangerous = false) {
|
|
5439
5442
|
if (name === "class") return applyClass(el, value);
|
|
5440
5443
|
if (name === "style") return applyStyle(el, value);
|
|
5441
|
-
if (config.sanitizeUrls && !
|
|
5444
|
+
if (config.sanitizeUrls && !allowDangerous && name === "srcdoc") {
|
|
5442
5445
|
warn2(
|
|
5443
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.`
|
|
5444
5447
|
);
|
|
@@ -5446,7 +5449,7 @@ function applyBinding(el, name, value, asProp = false, perigoLiberado = false) {
|
|
|
5446
5449
|
return;
|
|
5447
5450
|
}
|
|
5448
5451
|
if (config.sanitizeUrls && !asProp) {
|
|
5449
|
-
if (
|
|
5452
|
+
if (URL_ATTRIBUTES.has(name) && typeof value === "string" && isDangerousUrl(value)) {
|
|
5450
5453
|
warn2(
|
|
5451
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.`
|
|
5452
5455
|
);
|
|
@@ -5543,9 +5546,9 @@ defineDirective(
|
|
|
5543
5546
|
}
|
|
5544
5547
|
if (arg === "key") return;
|
|
5545
5548
|
const asProp = !!modifiers.prop;
|
|
5546
|
-
const
|
|
5549
|
+
const allowDangerous = !!modifiers.dangerous;
|
|
5547
5550
|
effect2(() => {
|
|
5548
|
-
applyBinding(el, arg, ev(), asProp,
|
|
5551
|
+
applyBinding(el, arg, ev(), asProp, allowDangerous);
|
|
5549
5552
|
});
|
|
5550
5553
|
},
|
|
5551
5554
|
{ priority: PRIORITY.BIND }
|
|
@@ -6502,11 +6505,11 @@ function data(values) {
|
|
|
6502
6505
|
Object.defineProperties(rootScope.data, Object.getOwnPropertyDescriptors(values));
|
|
6503
6506
|
return rootScope.data;
|
|
6504
6507
|
}
|
|
6505
|
-
var
|
|
6508
|
+
var version2 = "0.4.6";
|
|
6506
6509
|
var core = {
|
|
6507
6510
|
// Utilities first: Voodoo's own names can override.
|
|
6508
6511
|
...utils_exports,
|
|
6509
|
-
version,
|
|
6512
|
+
version: version2,
|
|
6510
6513
|
config,
|
|
6511
6514
|
// Reactivity
|
|
6512
6515
|
reactive,
|
|
@@ -10126,37 +10129,37 @@ init_reactivity();
|
|
|
10126
10129
|
init_registry();
|
|
10127
10130
|
init_style();
|
|
10128
10131
|
var messages = {
|
|
10129
|
-
required: "
|
|
10130
|
-
email: "
|
|
10131
|
-
url: "
|
|
10132
|
-
number: "
|
|
10133
|
-
integer: "
|
|
10134
|
-
decimal: "
|
|
10135
|
-
alpha: "Use
|
|
10136
|
-
alphanumeric: "Use
|
|
10137
|
-
minlength: "Use
|
|
10138
|
-
maxlength: "Use
|
|
10139
|
-
min: "
|
|
10140
|
-
max: "
|
|
10141
|
-
between: "
|
|
10142
|
-
match: "
|
|
10143
|
-
regex: "
|
|
10144
|
-
date: "
|
|
10145
|
-
after: "
|
|
10146
|
-
before: "
|
|
10147
|
-
accepted: "
|
|
10148
|
-
same: "
|
|
10149
|
-
different: "
|
|
10150
|
-
in: "
|
|
10151
|
-
notin: "
|
|
10152
|
-
phone: "
|
|
10153
|
-
cpf: "CPF
|
|
10154
|
-
cnpj: "CNPJ
|
|
10155
|
-
cep: "
|
|
10156
|
-
creditcard: "
|
|
10157
|
-
strongpassword: "Use {param}
|
|
10158
|
-
unique: "
|
|
10159
|
-
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."
|
|
10160
10163
|
};
|
|
10161
10164
|
function formatMessage(template, data2) {
|
|
10162
10165
|
const param = data2.param ?? "";
|
|
@@ -13106,7 +13109,7 @@ function openDialog(request2) {
|
|
|
13106
13109
|
source.remove();
|
|
13107
13110
|
}
|
|
13108
13111
|
sourceAnchors.delete(source);
|
|
13109
|
-
if (source
|
|
13112
|
+
if (hasDirective(source, "modal-content")) {
|
|
13110
13113
|
source.setAttribute("hidden", "");
|
|
13111
13114
|
}
|
|
13112
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';
|