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
package/dist/voodoo.js
CHANGED
|
@@ -3378,7 +3378,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
3378
3378
|
// src/store/index.ts
|
|
3379
3379
|
init_reactivity();
|
|
3380
3380
|
var stores = /* @__PURE__ */ new Map();
|
|
3381
|
-
var
|
|
3381
|
+
var version = ref(0);
|
|
3382
3382
|
var persistHandles = /* @__PURE__ */ new Map();
|
|
3383
3383
|
function store(name, definition, options = {}) {
|
|
3384
3384
|
const existing = stores.get(name);
|
|
@@ -3395,30 +3395,30 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
3395
3395
|
return existing;
|
|
3396
3396
|
}
|
|
3397
3397
|
const key = typeof options.persist === "string" ? options.persist : `voodoo:store:${name}`;
|
|
3398
|
-
const
|
|
3399
|
-
const initial = Object.defineProperties({},
|
|
3398
|
+
const descriptors = Object.getOwnPropertyDescriptors(definition);
|
|
3399
|
+
const initial = Object.defineProperties({}, descriptors);
|
|
3400
3400
|
if (options.persist && typeof localStorage !== "undefined") {
|
|
3401
3401
|
try {
|
|
3402
3402
|
const saved = localStorage.getItem(key);
|
|
3403
3403
|
if (saved) {
|
|
3404
|
-
const
|
|
3405
|
-
for (const [
|
|
3406
|
-
if (
|
|
3407
|
-
initial[
|
|
3404
|
+
const parsed = JSON.parse(saved);
|
|
3405
|
+
for (const [field, value] of Object.entries(parsed)) {
|
|
3406
|
+
if (descriptors[field] && !("value" in descriptors[field])) continue;
|
|
3407
|
+
initial[field] = value;
|
|
3408
3408
|
}
|
|
3409
3409
|
}
|
|
3410
3410
|
} catch (e) {
|
|
3411
3411
|
}
|
|
3412
3412
|
}
|
|
3413
3413
|
const created = reactive(initial);
|
|
3414
|
-
for (const [prop,
|
|
3415
|
-
const value =
|
|
3414
|
+
for (const [prop, descriptor] of Object.entries(descriptors)) {
|
|
3415
|
+
const value = descriptor.value;
|
|
3416
3416
|
if (typeof value === "function") {
|
|
3417
3417
|
created[prop] = (...args) => value.apply(created, args);
|
|
3418
3418
|
}
|
|
3419
3419
|
}
|
|
3420
3420
|
stores.set(name, created);
|
|
3421
|
-
|
|
3421
|
+
version.value++;
|
|
3422
3422
|
if (options.persist && typeof localStorage !== "undefined") {
|
|
3423
3423
|
const stop2 = watch(
|
|
3424
3424
|
created,
|
|
@@ -3436,10 +3436,10 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
3436
3436
|
}
|
|
3437
3437
|
function stripFunctions(source) {
|
|
3438
3438
|
const out = {};
|
|
3439
|
-
const
|
|
3439
|
+
const descriptors = Object.getOwnPropertyDescriptors(toRaw(source));
|
|
3440
3440
|
for (const [key, value] of Object.entries(source)) {
|
|
3441
3441
|
if (typeof value === "function") continue;
|
|
3442
|
-
if (
|
|
3442
|
+
if (descriptors[key] && !("value" in descriptors[key])) continue;
|
|
3443
3443
|
out[key] = value;
|
|
3444
3444
|
}
|
|
3445
3445
|
return out;
|
|
@@ -3448,11 +3448,11 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
3448
3448
|
{},
|
|
3449
3449
|
{
|
|
3450
3450
|
get: (_t, key) => {
|
|
3451
|
-
void
|
|
3451
|
+
void version.value;
|
|
3452
3452
|
return stores.get(key);
|
|
3453
3453
|
},
|
|
3454
3454
|
has: (_t, key) => {
|
|
3455
|
-
void
|
|
3455
|
+
void version.value;
|
|
3456
3456
|
return stores.has(key);
|
|
3457
3457
|
},
|
|
3458
3458
|
ownKeys: () => [...stores.keys()],
|
|
@@ -4395,6 +4395,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
4395
4395
|
element.setAttribute("data-type", type);
|
|
4396
4396
|
element.setAttribute("role", type === "error" ? "alert" : "status");
|
|
4397
4397
|
element.setAttribute("aria-live", type === "error" ? "assertive" : "polite");
|
|
4398
|
+
element.setAttribute("aria-atomic", "true");
|
|
4398
4399
|
let closed = false;
|
|
4399
4400
|
let timer = null;
|
|
4400
4401
|
const close = () => {
|
|
@@ -4726,11 +4727,12 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
4726
4727
|
}
|
|
4727
4728
|
};
|
|
4728
4729
|
var THEME_KEY = "voodoo:theme";
|
|
4730
|
+
var picked = null;
|
|
4729
4731
|
var theme = {
|
|
4730
4732
|
/** Theme chosen by the user, or `system` when never set. */
|
|
4731
4733
|
get current() {
|
|
4732
|
-
var _a2;
|
|
4733
|
-
return (_a2 = storage.get(THEME_KEY)) != null ? _a2 : "system";
|
|
4734
|
+
var _a2, _b;
|
|
4735
|
+
return (_b = (_a2 = storage.get(THEME_KEY)) != null ? _a2 : picked) != null ? _b : "system";
|
|
4734
4736
|
},
|
|
4735
4737
|
/** Theme effectively applied, resolving `system`. */
|
|
4736
4738
|
get resolved() {
|
|
@@ -4740,6 +4742,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
4740
4742
|
return matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
4741
4743
|
},
|
|
4742
4744
|
set(value) {
|
|
4745
|
+
picked = value;
|
|
4743
4746
|
storage.set(THEME_KEY, value);
|
|
4744
4747
|
this.apply();
|
|
4745
4748
|
},
|
|
@@ -4750,7 +4753,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
4750
4753
|
},
|
|
4751
4754
|
/** `true` once the visitor has actually picked a theme. */
|
|
4752
4755
|
get chosen() {
|
|
4753
|
-
return storage.get(THEME_KEY) != null;
|
|
4756
|
+
return picked !== null || storage.get(THEME_KEY) != null;
|
|
4754
4757
|
},
|
|
4755
4758
|
/** Writes `data-theme` on the root element and notifies the page. */
|
|
4756
4759
|
apply() {
|
|
@@ -4774,7 +4777,8 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
4774
4777
|
init() {
|
|
4775
4778
|
if (typeof document === "undefined") return;
|
|
4776
4779
|
this.apply();
|
|
4777
|
-
|
|
4780
|
+
if (typeof matchMedia === "undefined") return;
|
|
4781
|
+
matchMedia("(prefers-color-scheme: dark)").addEventListener("change", () => {
|
|
4778
4782
|
if (this.current === "system") this.apply();
|
|
4779
4783
|
});
|
|
4780
4784
|
}
|
|
@@ -5224,8 +5228,8 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
5224
5228
|
defineDirective("text", ({ el, effect: effect2, evaluate: ev }) => {
|
|
5225
5229
|
effect2(() => {
|
|
5226
5230
|
el.textContent = stringify(ev());
|
|
5227
|
-
const
|
|
5228
|
-
if (
|
|
5231
|
+
const first = el.firstChild;
|
|
5232
|
+
if (first && first.nodeType === 3) markInitialized(first);
|
|
5229
5233
|
});
|
|
5230
5234
|
});
|
|
5231
5235
|
defineDirective("html", (ctx) => {
|
|
@@ -5431,10 +5435,10 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
5431
5435
|
next.push({ key, scope: childScope, nodes, data: childScope.data });
|
|
5432
5436
|
});
|
|
5433
5437
|
if (batch.fragment.firstChild) (_a3 = anchor.parentNode) == null ? void 0 : _a3.insertBefore(batch.fragment, anchor);
|
|
5434
|
-
for (const [node,
|
|
5435
|
-
const
|
|
5438
|
+
for (const [node, rowScope] of batch.pending) walk(node, rowScope);
|
|
5439
|
+
const reused = new Set(next);
|
|
5436
5440
|
for (const block2 of blocks) {
|
|
5437
|
-
if (used.has(block2.key) &&
|
|
5441
|
+
if (used.has(block2.key) && reused.has(block2)) continue;
|
|
5438
5442
|
for (const node of block2.nodes) {
|
|
5439
5443
|
destroy(node);
|
|
5440
5444
|
node.remove();
|
|
@@ -5504,7 +5508,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
5504
5508
|
"novalidate",
|
|
5505
5509
|
"inert"
|
|
5506
5510
|
]);
|
|
5507
|
-
var
|
|
5511
|
+
var URL_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
5508
5512
|
"href",
|
|
5509
5513
|
"src",
|
|
5510
5514
|
"action",
|
|
@@ -5513,15 +5517,15 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
5513
5517
|
"ping",
|
|
5514
5518
|
"poster"
|
|
5515
5519
|
]);
|
|
5516
|
-
var
|
|
5517
|
-
function
|
|
5518
|
-
const
|
|
5519
|
-
return
|
|
5520
|
+
var SCHEME_NOISE = /[\s\x00-\x1f]/g;
|
|
5521
|
+
function isDangerousUrl(value) {
|
|
5522
|
+
const clean = value.replace(SCHEME_NOISE, "").toLowerCase();
|
|
5523
|
+
return clean.startsWith("javascript:") || clean.startsWith("vbscript:") || clean.startsWith("data:text/html") || clean.startsWith("data:application/xhtml");
|
|
5520
5524
|
}
|
|
5521
|
-
function applyBinding(el, name, value, asProp = false,
|
|
5525
|
+
function applyBinding(el, name, value, asProp = false, allowDangerous = false) {
|
|
5522
5526
|
if (name === "class") return applyClass(el, value);
|
|
5523
5527
|
if (name === "style") return applyStyle(el, value);
|
|
5524
|
-
if (config.sanitizeUrls && !
|
|
5528
|
+
if (config.sanitizeUrls && !allowDangerous && name === "srcdoc") {
|
|
5525
5529
|
warn2(
|
|
5526
5530
|
`: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.`
|
|
5527
5531
|
);
|
|
@@ -5529,7 +5533,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
5529
5533
|
return;
|
|
5530
5534
|
}
|
|
5531
5535
|
if (config.sanitizeUrls && !asProp) {
|
|
5532
|
-
if (
|
|
5536
|
+
if (URL_ATTRIBUTES.has(name) && typeof value === "string" && isDangerousUrl(value)) {
|
|
5533
5537
|
warn2(
|
|
5534
5538
|
`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.`
|
|
5535
5539
|
);
|
|
@@ -5626,9 +5630,9 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
5626
5630
|
}
|
|
5627
5631
|
if (arg === "key") return;
|
|
5628
5632
|
const asProp = !!modifiers.prop;
|
|
5629
|
-
const
|
|
5633
|
+
const allowDangerous = !!modifiers.dangerous;
|
|
5630
5634
|
effect2(() => {
|
|
5631
|
-
applyBinding(el, arg, ev(), asProp,
|
|
5635
|
+
applyBinding(el, arg, ev(), asProp, allowDangerous);
|
|
5632
5636
|
});
|
|
5633
5637
|
void expression;
|
|
5634
5638
|
},
|
|
@@ -6608,11 +6612,11 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
6608
6612
|
Object.defineProperties(rootScope.data, Object.getOwnPropertyDescriptors(values));
|
|
6609
6613
|
return rootScope.data;
|
|
6610
6614
|
}
|
|
6611
|
-
var
|
|
6615
|
+
var version2 = "0.4.6";
|
|
6612
6616
|
var core = {
|
|
6613
6617
|
// Utilities first: Voodoo's own names can override.
|
|
6614
6618
|
...utils_exports,
|
|
6615
|
-
version,
|
|
6619
|
+
version: version2,
|
|
6616
6620
|
config,
|
|
6617
6621
|
// Reactivity
|
|
6618
6622
|
reactive,
|
|
@@ -10285,37 +10289,37 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
10285
10289
|
init_registry();
|
|
10286
10290
|
init_style();
|
|
10287
10291
|
var messages = {
|
|
10288
|
-
required: "
|
|
10289
|
-
email: "
|
|
10290
|
-
url: "
|
|
10291
|
-
number: "
|
|
10292
|
-
integer: "
|
|
10293
|
-
decimal: "
|
|
10294
|
-
alpha: "Use
|
|
10295
|
-
alphanumeric: "Use
|
|
10296
|
-
minlength: "Use
|
|
10297
|
-
maxlength: "Use
|
|
10298
|
-
min: "
|
|
10299
|
-
max: "
|
|
10300
|
-
between: "
|
|
10301
|
-
match: "
|
|
10302
|
-
regex: "
|
|
10303
|
-
date: "
|
|
10304
|
-
after: "
|
|
10305
|
-
before: "
|
|
10306
|
-
accepted: "
|
|
10307
|
-
same: "
|
|
10308
|
-
different: "
|
|
10309
|
-
in: "
|
|
10310
|
-
notin: "
|
|
10311
|
-
phone: "
|
|
10312
|
-
cpf: "CPF
|
|
10313
|
-
cnpj: "CNPJ
|
|
10314
|
-
cep: "
|
|
10315
|
-
creditcard: "
|
|
10316
|
-
strongpassword: "Use {param}
|
|
10317
|
-
unique: "
|
|
10318
|
-
invalid: "
|
|
10292
|
+
required: "Please fill in this field.",
|
|
10293
|
+
email: "Enter a valid email address.",
|
|
10294
|
+
url: "Enter a valid URL.",
|
|
10295
|
+
number: "Enter a valid number.",
|
|
10296
|
+
integer: "Enter a whole number.",
|
|
10297
|
+
decimal: "Enter a valid decimal number.",
|
|
10298
|
+
alpha: "Use letters only.",
|
|
10299
|
+
alphanumeric: "Use letters and numbers only.",
|
|
10300
|
+
minlength: "Use at least {param} characters.",
|
|
10301
|
+
maxlength: "Use at most {param} characters.",
|
|
10302
|
+
min: "The smallest allowed value is {param}.",
|
|
10303
|
+
max: "The largest allowed value is {param}.",
|
|
10304
|
+
between: "Enter a value between {min} and {max}.",
|
|
10305
|
+
match: "The fields do not match.",
|
|
10306
|
+
regex: "That format is not valid.",
|
|
10307
|
+
date: "Enter a valid date.",
|
|
10308
|
+
after: "The date has to be later than {param}.",
|
|
10309
|
+
before: "The date has to be earlier than {param}.",
|
|
10310
|
+
accepted: "You have to tick this to continue.",
|
|
10311
|
+
same: "The values have to be the same.",
|
|
10312
|
+
different: "The values have to be different.",
|
|
10313
|
+
in: "Choose one of the allowed options.",
|
|
10314
|
+
notin: "That value is not allowed.",
|
|
10315
|
+
phone: "Enter a valid phone number, including the area code.",
|
|
10316
|
+
cpf: "Invalid CPF.",
|
|
10317
|
+
cnpj: "Invalid CNPJ.",
|
|
10318
|
+
cep: "Invalid postcode.",
|
|
10319
|
+
creditcard: "Invalid card number.",
|
|
10320
|
+
strongpassword: "Use {param} characters or more, with an upper case letter, a lower case letter, a number and a symbol.",
|
|
10321
|
+
unique: "That value is already taken.",
|
|
10322
|
+
invalid: "Invalid value."
|
|
10319
10323
|
};
|
|
10320
10324
|
function formatMessage(template, data2) {
|
|
10321
10325
|
var _a2, _b, _c, _d, _e, _f;
|
|
@@ -13315,7 +13319,7 @@ textarea.v-dialog-input{min-height:96px;resize:vertical}
|
|
|
13315
13319
|
source.remove();
|
|
13316
13320
|
}
|
|
13317
13321
|
sourceAnchors.delete(source);
|
|
13318
|
-
if (source
|
|
13322
|
+
if (hasDirective(source, "modal-content")) {
|
|
13319
13323
|
source.setAttribute("hidden", "");
|
|
13320
13324
|
}
|
|
13321
13325
|
}
|