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
|
@@ -1342,8 +1342,8 @@ declare const core: {
|
|
|
1342
1342
|
*
|
|
1343
1343
|
* ```js
|
|
1344
1344
|
* V.query('.card')
|
|
1345
|
-
* .addClass('
|
|
1346
|
-
* .on('click', '.
|
|
1345
|
+
* .addClass('active')
|
|
1346
|
+
* .on('click', '.button', function () { V.query(this).closest('.card').remove() })
|
|
1347
1347
|
* ```
|
|
1348
1348
|
*/
|
|
1349
1349
|
/** Function executed when the document becomes ready. */
|
|
@@ -1566,10 +1566,10 @@ declare class VoodooCollection implements Iterable<HTMLElement> {
|
|
|
1566
1566
|
* HTML string, or function.
|
|
1567
1567
|
*
|
|
1568
1568
|
* ```js
|
|
1569
|
-
* V.query('#
|
|
1569
|
+
* V.query('#list li') // selector
|
|
1570
1570
|
* V.query(document.body) // element
|
|
1571
|
-
* V.query('<li>
|
|
1572
|
-
* V.query(() =>
|
|
1571
|
+
* V.query('<li>new</li>') // creates elements
|
|
1572
|
+
* V.query(() => start()) // equivalent to V.ready
|
|
1573
1573
|
* ```
|
|
1574
1574
|
*
|
|
1575
1575
|
* @param input selector, node, list, HTML or initialization function
|
|
@@ -1342,8 +1342,8 @@ declare const core: {
|
|
|
1342
1342
|
*
|
|
1343
1343
|
* ```js
|
|
1344
1344
|
* V.query('.card')
|
|
1345
|
-
* .addClass('
|
|
1346
|
-
* .on('click', '.
|
|
1345
|
+
* .addClass('active')
|
|
1346
|
+
* .on('click', '.button', function () { V.query(this).closest('.card').remove() })
|
|
1347
1347
|
* ```
|
|
1348
1348
|
*/
|
|
1349
1349
|
/** Function executed when the document becomes ready. */
|
|
@@ -1566,10 +1566,10 @@ declare class VoodooCollection implements Iterable<HTMLElement> {
|
|
|
1566
1566
|
* HTML string, or function.
|
|
1567
1567
|
*
|
|
1568
1568
|
* ```js
|
|
1569
|
-
* V.query('#
|
|
1569
|
+
* V.query('#list li') // selector
|
|
1570
1570
|
* V.query(document.body) // element
|
|
1571
|
-
* V.query('<li>
|
|
1572
|
-
* V.query(() =>
|
|
1571
|
+
* V.query('<li>new</li>') // creates elements
|
|
1572
|
+
* V.query(() => start()) // equivalent to V.ready
|
|
1573
1573
|
* ```
|
|
1574
1574
|
*
|
|
1575
1575
|
* @param input selector, node, list, HTML or initialization function
|
package/dist/socket.d.cts
CHANGED
|
@@ -18,8 +18,8 @@ export { R as RoomOptions, a as RoomState, h as Socket, i as SocketDefaults, j a
|
|
|
18
18
|
* 2 server ping
|
|
19
19
|
* 3 client pong
|
|
20
20
|
* 40 enter namespace
|
|
21
|
-
* 42["
|
|
22
|
-
* 421["
|
|
21
|
+
* 42["message",{"text":"hi"}] event
|
|
22
|
+
* 421["save",{...}] event requesting ack 1
|
|
23
23
|
* 431[{"ok":true}] ack 1 response
|
|
24
24
|
* ```
|
|
25
25
|
*
|
|
@@ -31,7 +31,7 @@ export { R as RoomOptions, a as RoomState, h as Socket, i as SocketDefaults, j a
|
|
|
31
31
|
* short list is: binary attachments (`45`/`46`), polling transport and upgrade,
|
|
32
32
|
* and namespaces other than `/`.
|
|
33
33
|
*/
|
|
34
|
-
/**
|
|
34
|
+
/** Engine.IO v4 packet codes. */
|
|
35
35
|
declare const ENGINE: {
|
|
36
36
|
readonly OPEN: "0";
|
|
37
37
|
readonly CLOSE: "1";
|
|
@@ -41,7 +41,7 @@ declare const ENGINE: {
|
|
|
41
41
|
readonly UPGRADE: "5";
|
|
42
42
|
readonly NOOP: "6";
|
|
43
43
|
};
|
|
44
|
-
/**
|
|
44
|
+
/** Socket.IO v5 packet types (v4 server protocol). */
|
|
45
45
|
declare const SIO: {
|
|
46
46
|
readonly CONNECT: 0;
|
|
47
47
|
readonly DISCONNECT: 1;
|
package/dist/socket.d.ts
CHANGED
|
@@ -18,8 +18,8 @@ export { R as RoomOptions, a as RoomState, h as Socket, i as SocketDefaults, j a
|
|
|
18
18
|
* 2 server ping
|
|
19
19
|
* 3 client pong
|
|
20
20
|
* 40 enter namespace
|
|
21
|
-
* 42["
|
|
22
|
-
* 421["
|
|
21
|
+
* 42["message",{"text":"hi"}] event
|
|
22
|
+
* 421["save",{...}] event requesting ack 1
|
|
23
23
|
* 431[{"ok":true}] ack 1 response
|
|
24
24
|
* ```
|
|
25
25
|
*
|
|
@@ -31,7 +31,7 @@ export { R as RoomOptions, a as RoomState, h as Socket, i as SocketDefaults, j a
|
|
|
31
31
|
* short list is: binary attachments (`45`/`46`), polling transport and upgrade,
|
|
32
32
|
* and namespaces other than `/`.
|
|
33
33
|
*/
|
|
34
|
-
/**
|
|
34
|
+
/** Engine.IO v4 packet codes. */
|
|
35
35
|
declare const ENGINE: {
|
|
36
36
|
readonly OPEN: "0";
|
|
37
37
|
readonly CLOSE: "1";
|
|
@@ -41,7 +41,7 @@ declare const ENGINE: {
|
|
|
41
41
|
readonly UPGRADE: "5";
|
|
42
42
|
readonly NOOP: "6";
|
|
43
43
|
};
|
|
44
|
-
/**
|
|
44
|
+
/** Socket.IO v5 packet types (v4 server protocol). */
|
|
45
45
|
declare const SIO: {
|
|
46
46
|
readonly CONNECT: 0;
|
|
47
47
|
readonly DISCONNECT: 1;
|
package/dist/socket.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { socketSupported, createSocket, socket } from './chunk-
|
|
2
|
-
export { ENGINE, SIO, createSocket, decodeEngine, decodeSocketIo, encodeSocketIo, engineURL, resolveSocketURL, socket, socketSupported } from './chunk-
|
|
3
|
-
import { evaluateIn, readAttr } from './chunk-
|
|
1
|
+
import { socketSupported, createSocket, socket } from './chunk-4LR3IFPX.js';
|
|
2
|
+
export { ENGINE, SIO, createSocket, decodeEngine, decodeSocketIo, encodeSocketIo, engineURL, resolveSocketURL, socket, socketSupported } from './chunk-4LR3IFPX.js';
|
|
3
|
+
import { evaluateIn, readAttr } from './chunk-PHMBDPWH.js';
|
|
4
4
|
import { reactive } from './chunk-NNU6WOOU.js';
|
|
5
5
|
import { warnAlias } from './chunk-A2UOVQBP.js';
|
|
6
6
|
import { parseDuration } from './chunk-234ZLC6W.js';
|
package/dist/voodoo.core.js
CHANGED
|
@@ -3332,7 +3332,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
3332
3332
|
// src/store/index.ts
|
|
3333
3333
|
init_reactivity();
|
|
3334
3334
|
var stores = /* @__PURE__ */ new Map();
|
|
3335
|
-
var
|
|
3335
|
+
var version = ref(0);
|
|
3336
3336
|
var persistHandles = /* @__PURE__ */ new Map();
|
|
3337
3337
|
function store(name, definition, options = {}) {
|
|
3338
3338
|
const existing = stores.get(name);
|
|
@@ -3349,30 +3349,30 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
3349
3349
|
return existing;
|
|
3350
3350
|
}
|
|
3351
3351
|
const key = typeof options.persist === "string" ? options.persist : `voodoo:store:${name}`;
|
|
3352
|
-
const
|
|
3353
|
-
const initial = Object.defineProperties({},
|
|
3352
|
+
const descriptors = Object.getOwnPropertyDescriptors(definition);
|
|
3353
|
+
const initial = Object.defineProperties({}, descriptors);
|
|
3354
3354
|
if (options.persist && typeof localStorage !== "undefined") {
|
|
3355
3355
|
try {
|
|
3356
3356
|
const saved = localStorage.getItem(key);
|
|
3357
3357
|
if (saved) {
|
|
3358
|
-
const
|
|
3359
|
-
for (const [
|
|
3360
|
-
if (
|
|
3361
|
-
initial[
|
|
3358
|
+
const parsed = JSON.parse(saved);
|
|
3359
|
+
for (const [field, value] of Object.entries(parsed)) {
|
|
3360
|
+
if (descriptors[field] && !("value" in descriptors[field])) continue;
|
|
3361
|
+
initial[field] = value;
|
|
3362
3362
|
}
|
|
3363
3363
|
}
|
|
3364
3364
|
} catch (e) {
|
|
3365
3365
|
}
|
|
3366
3366
|
}
|
|
3367
3367
|
const created = reactive(initial);
|
|
3368
|
-
for (const [prop,
|
|
3369
|
-
const value =
|
|
3368
|
+
for (const [prop, descriptor] of Object.entries(descriptors)) {
|
|
3369
|
+
const value = descriptor.value;
|
|
3370
3370
|
if (typeof value === "function") {
|
|
3371
3371
|
created[prop] = (...args) => value.apply(created, args);
|
|
3372
3372
|
}
|
|
3373
3373
|
}
|
|
3374
3374
|
stores.set(name, created);
|
|
3375
|
-
|
|
3375
|
+
version.value++;
|
|
3376
3376
|
if (options.persist && typeof localStorage !== "undefined") {
|
|
3377
3377
|
const stop2 = watch(
|
|
3378
3378
|
created,
|
|
@@ -3390,10 +3390,10 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
3390
3390
|
}
|
|
3391
3391
|
function stripFunctions(source) {
|
|
3392
3392
|
const out = {};
|
|
3393
|
-
const
|
|
3393
|
+
const descriptors = Object.getOwnPropertyDescriptors(toRaw(source));
|
|
3394
3394
|
for (const [key, value] of Object.entries(source)) {
|
|
3395
3395
|
if (typeof value === "function") continue;
|
|
3396
|
-
if (
|
|
3396
|
+
if (descriptors[key] && !("value" in descriptors[key])) continue;
|
|
3397
3397
|
out[key] = value;
|
|
3398
3398
|
}
|
|
3399
3399
|
return out;
|
|
@@ -3402,11 +3402,11 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
3402
3402
|
{},
|
|
3403
3403
|
{
|
|
3404
3404
|
get: (_t, key) => {
|
|
3405
|
-
void
|
|
3405
|
+
void version.value;
|
|
3406
3406
|
return stores.get(key);
|
|
3407
3407
|
},
|
|
3408
3408
|
has: (_t, key) => {
|
|
3409
|
-
void
|
|
3409
|
+
void version.value;
|
|
3410
3410
|
return stores.has(key);
|
|
3411
3411
|
},
|
|
3412
3412
|
ownKeys: () => [...stores.keys()],
|
|
@@ -4681,11 +4681,12 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
4681
4681
|
}
|
|
4682
4682
|
};
|
|
4683
4683
|
var THEME_KEY = "voodoo:theme";
|
|
4684
|
+
var picked = null;
|
|
4684
4685
|
var theme = {
|
|
4685
4686
|
/** Theme chosen by the user, or `system` when never set. */
|
|
4686
4687
|
get current() {
|
|
4687
|
-
var _a2;
|
|
4688
|
-
return (_a2 = storage.get(THEME_KEY)) != null ? _a2 : "system";
|
|
4688
|
+
var _a2, _b;
|
|
4689
|
+
return (_b = (_a2 = storage.get(THEME_KEY)) != null ? _a2 : picked) != null ? _b : "system";
|
|
4689
4690
|
},
|
|
4690
4691
|
/** Theme effectively applied, resolving `system`. */
|
|
4691
4692
|
get resolved() {
|
|
@@ -4695,6 +4696,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
4695
4696
|
return matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
4696
4697
|
},
|
|
4697
4698
|
set(value) {
|
|
4699
|
+
picked = value;
|
|
4698
4700
|
storage.set(THEME_KEY, value);
|
|
4699
4701
|
this.apply();
|
|
4700
4702
|
},
|
|
@@ -4705,7 +4707,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
4705
4707
|
},
|
|
4706
4708
|
/** `true` once the visitor has actually picked a theme. */
|
|
4707
4709
|
get chosen() {
|
|
4708
|
-
return storage.get(THEME_KEY) != null;
|
|
4710
|
+
return picked !== null || storage.get(THEME_KEY) != null;
|
|
4709
4711
|
},
|
|
4710
4712
|
/** Writes `data-theme` on the root element and notifies the page. */
|
|
4711
4713
|
apply() {
|
|
@@ -4729,7 +4731,8 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
4729
4731
|
init() {
|
|
4730
4732
|
if (typeof document === "undefined") return;
|
|
4731
4733
|
this.apply();
|
|
4732
|
-
|
|
4734
|
+
if (typeof matchMedia === "undefined") return;
|
|
4735
|
+
matchMedia("(prefers-color-scheme: dark)").addEventListener("change", () => {
|
|
4733
4736
|
if (this.current === "system") this.apply();
|
|
4734
4737
|
});
|
|
4735
4738
|
}
|
|
@@ -5179,8 +5182,8 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
5179
5182
|
defineDirective("text", ({ el, effect: effect2, evaluate: ev }) => {
|
|
5180
5183
|
effect2(() => {
|
|
5181
5184
|
el.textContent = stringify(ev());
|
|
5182
|
-
const
|
|
5183
|
-
if (
|
|
5185
|
+
const first = el.firstChild;
|
|
5186
|
+
if (first && first.nodeType === 3) markInitialized(first);
|
|
5184
5187
|
});
|
|
5185
5188
|
});
|
|
5186
5189
|
defineDirective("html", (ctx) => {
|
|
@@ -5386,10 +5389,10 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
5386
5389
|
next.push({ key, scope: childScope, nodes, data: childScope.data });
|
|
5387
5390
|
});
|
|
5388
5391
|
if (batch.fragment.firstChild) (_a3 = anchor.parentNode) == null ? void 0 : _a3.insertBefore(batch.fragment, anchor);
|
|
5389
|
-
for (const [node,
|
|
5390
|
-
const
|
|
5392
|
+
for (const [node, rowScope] of batch.pending) walk(node, rowScope);
|
|
5393
|
+
const reused = new Set(next);
|
|
5391
5394
|
for (const block2 of blocks) {
|
|
5392
|
-
if (used.has(block2.key) &&
|
|
5395
|
+
if (used.has(block2.key) && reused.has(block2)) continue;
|
|
5393
5396
|
for (const node of block2.nodes) {
|
|
5394
5397
|
destroy(node);
|
|
5395
5398
|
node.remove();
|
|
@@ -5459,7 +5462,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
5459
5462
|
"novalidate",
|
|
5460
5463
|
"inert"
|
|
5461
5464
|
]);
|
|
5462
|
-
var
|
|
5465
|
+
var URL_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
5463
5466
|
"href",
|
|
5464
5467
|
"src",
|
|
5465
5468
|
"action",
|
|
@@ -5468,15 +5471,15 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
5468
5471
|
"ping",
|
|
5469
5472
|
"poster"
|
|
5470
5473
|
]);
|
|
5471
|
-
var
|
|
5472
|
-
function
|
|
5473
|
-
const
|
|
5474
|
-
return
|
|
5474
|
+
var SCHEME_NOISE = /[\s\x00-\x1f]/g;
|
|
5475
|
+
function isDangerousUrl(value) {
|
|
5476
|
+
const clean = value.replace(SCHEME_NOISE, "").toLowerCase();
|
|
5477
|
+
return clean.startsWith("javascript:") || clean.startsWith("vbscript:") || clean.startsWith("data:text/html") || clean.startsWith("data:application/xhtml");
|
|
5475
5478
|
}
|
|
5476
|
-
function applyBinding(el, name, value, asProp = false,
|
|
5479
|
+
function applyBinding(el, name, value, asProp = false, allowDangerous = false) {
|
|
5477
5480
|
if (name === "class") return applyClass(el, value);
|
|
5478
5481
|
if (name === "style") return applyStyle(el, value);
|
|
5479
|
-
if (config.sanitizeUrls && !
|
|
5482
|
+
if (config.sanitizeUrls && !allowDangerous && name === "srcdoc") {
|
|
5480
5483
|
warn2(
|
|
5481
5484
|
`: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.`
|
|
5482
5485
|
);
|
|
@@ -5484,7 +5487,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
5484
5487
|
return;
|
|
5485
5488
|
}
|
|
5486
5489
|
if (config.sanitizeUrls && !asProp) {
|
|
5487
|
-
if (
|
|
5490
|
+
if (URL_ATTRIBUTES.has(name) && typeof value === "string" && isDangerousUrl(value)) {
|
|
5488
5491
|
warn2(
|
|
5489
5492
|
`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.`
|
|
5490
5493
|
);
|
|
@@ -5581,9 +5584,9 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
5581
5584
|
}
|
|
5582
5585
|
if (arg === "key") return;
|
|
5583
5586
|
const asProp = !!modifiers.prop;
|
|
5584
|
-
const
|
|
5587
|
+
const allowDangerous = !!modifiers.dangerous;
|
|
5585
5588
|
effect2(() => {
|
|
5586
|
-
applyBinding(el, arg, ev(), asProp,
|
|
5589
|
+
applyBinding(el, arg, ev(), asProp, allowDangerous);
|
|
5587
5590
|
});
|
|
5588
5591
|
void expression;
|
|
5589
5592
|
},
|
|
@@ -6563,11 +6566,11 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
|
|
|
6563
6566
|
Object.defineProperties(rootScope.data, Object.getOwnPropertyDescriptors(values));
|
|
6564
6567
|
return rootScope.data;
|
|
6565
6568
|
}
|
|
6566
|
-
var
|
|
6569
|
+
var version2 = "0.4.6";
|
|
6567
6570
|
var core = {
|
|
6568
6571
|
// Utilities first: Voodoo's own names can override.
|
|
6569
6572
|
...utils_exports,
|
|
6570
|
-
version,
|
|
6573
|
+
version: version2,
|
|
6571
6574
|
config,
|
|
6572
6575
|
// Reactivity
|
|
6573
6576
|
reactive,
|