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
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()],
|
|
@@ -4727,11 +4727,12 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
4727
4727
|
}
|
|
4728
4728
|
};
|
|
4729
4729
|
var THEME_KEY = "voodoo:theme";
|
|
4730
|
+
var picked = null;
|
|
4730
4731
|
var theme = {
|
|
4731
4732
|
/** Theme chosen by the user, or `system` when never set. */
|
|
4732
4733
|
get current() {
|
|
4733
|
-
var _a2;
|
|
4734
|
-
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";
|
|
4735
4736
|
},
|
|
4736
4737
|
/** Theme effectively applied, resolving `system`. */
|
|
4737
4738
|
get resolved() {
|
|
@@ -4741,6 +4742,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
4741
4742
|
return matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
4742
4743
|
},
|
|
4743
4744
|
set(value) {
|
|
4745
|
+
picked = value;
|
|
4744
4746
|
storage.set(THEME_KEY, value);
|
|
4745
4747
|
this.apply();
|
|
4746
4748
|
},
|
|
@@ -4751,7 +4753,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
4751
4753
|
},
|
|
4752
4754
|
/** `true` once the visitor has actually picked a theme. */
|
|
4753
4755
|
get chosen() {
|
|
4754
|
-
return storage.get(THEME_KEY) != null;
|
|
4756
|
+
return picked !== null || storage.get(THEME_KEY) != null;
|
|
4755
4757
|
},
|
|
4756
4758
|
/** Writes `data-theme` on the root element and notifies the page. */
|
|
4757
4759
|
apply() {
|
|
@@ -4775,7 +4777,8 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
4775
4777
|
init() {
|
|
4776
4778
|
if (typeof document === "undefined") return;
|
|
4777
4779
|
this.apply();
|
|
4778
|
-
|
|
4780
|
+
if (typeof matchMedia === "undefined") return;
|
|
4781
|
+
matchMedia("(prefers-color-scheme: dark)").addEventListener("change", () => {
|
|
4779
4782
|
if (this.current === "system") this.apply();
|
|
4780
4783
|
});
|
|
4781
4784
|
}
|
|
@@ -5225,8 +5228,8 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
5225
5228
|
defineDirective("text", ({ el, effect: effect2, evaluate: ev }) => {
|
|
5226
5229
|
effect2(() => {
|
|
5227
5230
|
el.textContent = stringify(ev());
|
|
5228
|
-
const
|
|
5229
|
-
if (
|
|
5231
|
+
const first = el.firstChild;
|
|
5232
|
+
if (first && first.nodeType === 3) markInitialized(first);
|
|
5230
5233
|
});
|
|
5231
5234
|
});
|
|
5232
5235
|
defineDirective("html", (ctx) => {
|
|
@@ -5432,10 +5435,10 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
5432
5435
|
next.push({ key, scope: childScope, nodes, data: childScope.data });
|
|
5433
5436
|
});
|
|
5434
5437
|
if (batch.fragment.firstChild) (_a3 = anchor.parentNode) == null ? void 0 : _a3.insertBefore(batch.fragment, anchor);
|
|
5435
|
-
for (const [node,
|
|
5436
|
-
const
|
|
5438
|
+
for (const [node, rowScope] of batch.pending) walk(node, rowScope);
|
|
5439
|
+
const reused = new Set(next);
|
|
5437
5440
|
for (const block2 of blocks) {
|
|
5438
|
-
if (used.has(block2.key) &&
|
|
5441
|
+
if (used.has(block2.key) && reused.has(block2)) continue;
|
|
5439
5442
|
for (const node of block2.nodes) {
|
|
5440
5443
|
destroy(node);
|
|
5441
5444
|
node.remove();
|
|
@@ -5505,7 +5508,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
5505
5508
|
"novalidate",
|
|
5506
5509
|
"inert"
|
|
5507
5510
|
]);
|
|
5508
|
-
var
|
|
5511
|
+
var URL_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
5509
5512
|
"href",
|
|
5510
5513
|
"src",
|
|
5511
5514
|
"action",
|
|
@@ -5514,15 +5517,15 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
5514
5517
|
"ping",
|
|
5515
5518
|
"poster"
|
|
5516
5519
|
]);
|
|
5517
|
-
var
|
|
5518
|
-
function
|
|
5519
|
-
const
|
|
5520
|
-
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");
|
|
5521
5524
|
}
|
|
5522
|
-
function applyBinding(el, name, value, asProp = false,
|
|
5525
|
+
function applyBinding(el, name, value, asProp = false, allowDangerous = false) {
|
|
5523
5526
|
if (name === "class") return applyClass(el, value);
|
|
5524
5527
|
if (name === "style") return applyStyle(el, value);
|
|
5525
|
-
if (config.sanitizeUrls && !
|
|
5528
|
+
if (config.sanitizeUrls && !allowDangerous && name === "srcdoc") {
|
|
5526
5529
|
warn2(
|
|
5527
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.`
|
|
5528
5531
|
);
|
|
@@ -5530,7 +5533,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
5530
5533
|
return;
|
|
5531
5534
|
}
|
|
5532
5535
|
if (config.sanitizeUrls && !asProp) {
|
|
5533
|
-
if (
|
|
5536
|
+
if (URL_ATTRIBUTES.has(name) && typeof value === "string" && isDangerousUrl(value)) {
|
|
5534
5537
|
warn2(
|
|
5535
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.`
|
|
5536
5539
|
);
|
|
@@ -5627,9 +5630,9 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
5627
5630
|
}
|
|
5628
5631
|
if (arg === "key") return;
|
|
5629
5632
|
const asProp = !!modifiers.prop;
|
|
5630
|
-
const
|
|
5633
|
+
const allowDangerous = !!modifiers.dangerous;
|
|
5631
5634
|
effect2(() => {
|
|
5632
|
-
applyBinding(el, arg, ev(), asProp,
|
|
5635
|
+
applyBinding(el, arg, ev(), asProp, allowDangerous);
|
|
5633
5636
|
});
|
|
5634
5637
|
void expression;
|
|
5635
5638
|
},
|
|
@@ -6609,11 +6612,11 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
6609
6612
|
Object.defineProperties(rootScope.data, Object.getOwnPropertyDescriptors(values));
|
|
6610
6613
|
return rootScope.data;
|
|
6611
6614
|
}
|
|
6612
|
-
var
|
|
6615
|
+
var version2 = "0.4.6";
|
|
6613
6616
|
var core = {
|
|
6614
6617
|
// Utilities first: Voodoo's own names can override.
|
|
6615
6618
|
...utils_exports,
|
|
6616
|
-
version,
|
|
6619
|
+
version: version2,
|
|
6617
6620
|
config,
|
|
6618
6621
|
// Reactivity
|
|
6619
6622
|
reactive,
|
|
@@ -10286,37 +10289,37 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
10286
10289
|
init_registry();
|
|
10287
10290
|
init_style();
|
|
10288
10291
|
var messages = {
|
|
10289
|
-
required: "
|
|
10290
|
-
email: "
|
|
10291
|
-
url: "
|
|
10292
|
-
number: "
|
|
10293
|
-
integer: "
|
|
10294
|
-
decimal: "
|
|
10295
|
-
alpha: "Use
|
|
10296
|
-
alphanumeric: "Use
|
|
10297
|
-
minlength: "Use
|
|
10298
|
-
maxlength: "Use
|
|
10299
|
-
min: "
|
|
10300
|
-
max: "
|
|
10301
|
-
between: "
|
|
10302
|
-
match: "
|
|
10303
|
-
regex: "
|
|
10304
|
-
date: "
|
|
10305
|
-
after: "
|
|
10306
|
-
before: "
|
|
10307
|
-
accepted: "
|
|
10308
|
-
same: "
|
|
10309
|
-
different: "
|
|
10310
|
-
in: "
|
|
10311
|
-
notin: "
|
|
10312
|
-
phone: "
|
|
10313
|
-
cpf: "CPF
|
|
10314
|
-
cnpj: "CNPJ
|
|
10315
|
-
cep: "
|
|
10316
|
-
creditcard: "
|
|
10317
|
-
strongpassword: "Use {param}
|
|
10318
|
-
unique: "
|
|
10319
|
-
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."
|
|
10320
10323
|
};
|
|
10321
10324
|
function formatMessage(template, data2) {
|
|
10322
10325
|
var _a2, _b, _c, _d, _e, _f;
|
|
@@ -13316,7 +13319,7 @@ textarea.v-dialog-input{min-height:96px;resize:vertical}
|
|
|
13316
13319
|
source.remove();
|
|
13317
13320
|
}
|
|
13318
13321
|
sourceAnchors.delete(source);
|
|
13319
|
-
if (source
|
|
13322
|
+
if (hasDirective(source, "modal-content")) {
|
|
13320
13323
|
source.setAttribute("hidden", "");
|
|
13321
13324
|
}
|
|
13322
13325
|
}
|