rask-ui 0.3.4 → 0.4.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/README.md +251 -79
- package/dist/batch.d.ts +4 -0
- package/dist/batch.d.ts.map +1 -0
- package/dist/batch.js +86 -0
- package/dist/component.d.ts +9 -1
- package/dist/component.d.ts.map +1 -1
- package/dist/component.js +15 -7
- package/dist/createComputed.d.ts +4 -0
- package/dist/createComputed.d.ts.map +1 -0
- package/dist/createComputed.js +34 -0
- package/dist/createEffect.d.ts +2 -0
- package/dist/createEffect.d.ts.map +1 -0
- package/dist/createEffect.js +19 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -1
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +4 -3
- package/dist/plugin.d.ts +8 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +195 -0
- package/dist/scheduler.d.ts +4 -0
- package/dist/scheduler.d.ts.map +1 -0
- package/dist/scheduler.js +107 -0
- package/package.json +1 -1
- package/dist/createRef.d.ts +0 -5
- package/dist/createRef.d.ts.map +0 -1
- package/dist/createRef.js +0 -7
- package/dist/test-setup.d.ts +0 -16
- package/dist/test-setup.d.ts.map +0 -1
- package/dist/test-setup.js +0 -40
- package/dist/vdom/AbstractVNode.d.ts +0 -44
- package/dist/vdom/AbstractVNode.d.ts.map +0 -1
- package/dist/vdom/AbstractVNode.js +0 -256
- package/dist/vdom/ComponentVNode.d.ts +0 -48
- package/dist/vdom/ComponentVNode.d.ts.map +0 -1
- package/dist/vdom/ComponentVNode.js +0 -221
- package/dist/vdom/ElementVNode.d.ts +0 -27
- package/dist/vdom/ElementVNode.d.ts.map +0 -1
- package/dist/vdom/ElementVNode.js +0 -220
- package/dist/vdom/FragmentVNode.d.ts +0 -13
- package/dist/vdom/FragmentVNode.d.ts.map +0 -1
- package/dist/vdom/FragmentVNode.js +0 -49
- package/dist/vdom/RootVNode.d.ts +0 -25
- package/dist/vdom/RootVNode.d.ts.map +0 -1
- package/dist/vdom/RootVNode.js +0 -79
- package/dist/vdom/TextVNode.d.ts +0 -11
- package/dist/vdom/TextVNode.d.ts.map +0 -1
- package/dist/vdom/TextVNode.js +0 -35
- package/dist/vdom/dom-utils.d.ts +0 -14
- package/dist/vdom/dom-utils.d.ts.map +0 -1
- package/dist/vdom/dom-utils.js +0 -103
- package/dist/vdom/index.d.ts +0 -10
- package/dist/vdom/index.d.ts.map +0 -1
- package/dist/vdom/index.js +0 -26
- package/dist/vdom/types.d.ts +0 -20
- package/dist/vdom/types.d.ts.map +0 -1
- package/dist/vdom/types.js +0 -1
- package/dist/vdom/utils.d.ts +0 -6
- package/dist/vdom/utils.d.ts.map +0 -1
- package/dist/vdom/utils.js +0 -63
package/dist/vdom/utils.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { ComponentVNode } from "./ComponentVNode";
|
|
2
|
-
import { TextVNode } from "./TextVNode";
|
|
3
|
-
export function diffObjectKeys(oldObj, newObj, onChange) {
|
|
4
|
-
// Added or changed
|
|
5
|
-
for (const key in newObj) {
|
|
6
|
-
const oldVal = oldObj[key];
|
|
7
|
-
const newVal = newObj[key];
|
|
8
|
-
if (oldVal !== newVal) {
|
|
9
|
-
onChange(key, newVal, oldVal);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
// Removed
|
|
13
|
-
for (const key in oldObj) {
|
|
14
|
-
if (!(key in newObj)) {
|
|
15
|
-
onChange(key, null, oldObj[key]);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
export function normalizeChildren(input) {
|
|
20
|
-
const out = [];
|
|
21
|
-
if (input == null || typeof input === "boolean")
|
|
22
|
-
return out;
|
|
23
|
-
// Fast path for single primitive or vnode
|
|
24
|
-
if (typeof input === "string" || typeof input === "number") {
|
|
25
|
-
out.push(new TextVNode(String(input)));
|
|
26
|
-
return out;
|
|
27
|
-
}
|
|
28
|
-
if (Array.isArray(input)) {
|
|
29
|
-
for (let i = 0; i < input.length; i++) {
|
|
30
|
-
const c = input[i];
|
|
31
|
-
if (c == null || typeof c === "boolean")
|
|
32
|
-
continue;
|
|
33
|
-
if (Array.isArray(c)) {
|
|
34
|
-
// Flatten nested arrays directly
|
|
35
|
-
const nested = normalizeChildren(c);
|
|
36
|
-
for (let j = 0; j < nested.length; j++)
|
|
37
|
-
out.push(nested[j]);
|
|
38
|
-
}
|
|
39
|
-
else if (typeof c === "string" || typeof c === "number") {
|
|
40
|
-
out.push(new TextVNode(String(c)));
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
out.push(c);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return out;
|
|
47
|
-
}
|
|
48
|
-
// Otherwise assume already a VNode
|
|
49
|
-
out.push(input);
|
|
50
|
-
return out;
|
|
51
|
-
}
|
|
52
|
-
export function findComponentVNode(vnode) {
|
|
53
|
-
if (!vnode) {
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
while (vnode && !(vnode instanceof ComponentVNode)) {
|
|
57
|
-
if (!vnode.parent) {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
vnode = vnode.parent;
|
|
61
|
-
}
|
|
62
|
-
return vnode;
|
|
63
|
-
}
|