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.
Files changed (61) hide show
  1. package/README.md +251 -79
  2. package/dist/batch.d.ts +4 -0
  3. package/dist/batch.d.ts.map +1 -0
  4. package/dist/batch.js +86 -0
  5. package/dist/component.d.ts +9 -1
  6. package/dist/component.d.ts.map +1 -1
  7. package/dist/component.js +15 -7
  8. package/dist/createComputed.d.ts +4 -0
  9. package/dist/createComputed.d.ts.map +1 -0
  10. package/dist/createComputed.js +34 -0
  11. package/dist/createEffect.d.ts +2 -0
  12. package/dist/createEffect.d.ts.map +1 -0
  13. package/dist/createEffect.js +19 -0
  14. package/dist/index.d.ts +4 -1
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +11 -1
  17. package/dist/observation.d.ts.map +1 -1
  18. package/dist/observation.js +4 -3
  19. package/dist/plugin.d.ts +8 -0
  20. package/dist/plugin.d.ts.map +1 -0
  21. package/dist/plugin.js +195 -0
  22. package/dist/scheduler.d.ts +4 -0
  23. package/dist/scheduler.d.ts.map +1 -0
  24. package/dist/scheduler.js +107 -0
  25. package/package.json +1 -1
  26. package/dist/createRef.d.ts +0 -5
  27. package/dist/createRef.d.ts.map +0 -1
  28. package/dist/createRef.js +0 -7
  29. package/dist/test-setup.d.ts +0 -16
  30. package/dist/test-setup.d.ts.map +0 -1
  31. package/dist/test-setup.js +0 -40
  32. package/dist/vdom/AbstractVNode.d.ts +0 -44
  33. package/dist/vdom/AbstractVNode.d.ts.map +0 -1
  34. package/dist/vdom/AbstractVNode.js +0 -256
  35. package/dist/vdom/ComponentVNode.d.ts +0 -48
  36. package/dist/vdom/ComponentVNode.d.ts.map +0 -1
  37. package/dist/vdom/ComponentVNode.js +0 -221
  38. package/dist/vdom/ElementVNode.d.ts +0 -27
  39. package/dist/vdom/ElementVNode.d.ts.map +0 -1
  40. package/dist/vdom/ElementVNode.js +0 -220
  41. package/dist/vdom/FragmentVNode.d.ts +0 -13
  42. package/dist/vdom/FragmentVNode.d.ts.map +0 -1
  43. package/dist/vdom/FragmentVNode.js +0 -49
  44. package/dist/vdom/RootVNode.d.ts +0 -25
  45. package/dist/vdom/RootVNode.d.ts.map +0 -1
  46. package/dist/vdom/RootVNode.js +0 -79
  47. package/dist/vdom/TextVNode.d.ts +0 -11
  48. package/dist/vdom/TextVNode.d.ts.map +0 -1
  49. package/dist/vdom/TextVNode.js +0 -35
  50. package/dist/vdom/dom-utils.d.ts +0 -14
  51. package/dist/vdom/dom-utils.d.ts.map +0 -1
  52. package/dist/vdom/dom-utils.js +0 -103
  53. package/dist/vdom/index.d.ts +0 -10
  54. package/dist/vdom/index.d.ts.map +0 -1
  55. package/dist/vdom/index.js +0 -26
  56. package/dist/vdom/types.d.ts +0 -20
  57. package/dist/vdom/types.d.ts.map +0 -1
  58. package/dist/vdom/types.js +0 -1
  59. package/dist/vdom/utils.d.ts +0 -6
  60. package/dist/vdom/utils.d.ts.map +0 -1
  61. package/dist/vdom/utils.js +0 -63
@@ -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
- }