xote 4.16.1 → 6.0.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 (34) hide show
  1. package/README.md +19 -11
  2. package/dist/xote.cjs +9 -9
  3. package/dist/xote.mjs +1282 -1199
  4. package/dist/xote.umd.js +10 -10
  5. package/package.json +3 -3
  6. package/rescript.json +18 -3
  7. package/src/Computed.res +1 -0
  8. package/src/Computed.res.mjs +13 -0
  9. package/src/Effect.res +1 -0
  10. package/src/Effect.res.mjs +13 -0
  11. package/src/Html.res +28 -0
  12. package/src/Html.res.mjs +62 -0
  13. package/src/{Xote__Hydration.res → Hydration.res} +52 -50
  14. package/src/{Xote__Hydration.res.mjs → Hydration.res.mjs} +66 -68
  15. package/src/{Xote__Component.res → Node.res} +8 -31
  16. package/src/{Xote__Component.res.mjs → Node.res.mjs} +26 -88
  17. package/src/{Xote__ReactiveProp.res → ReactiveProp.res} +0 -1
  18. package/src/{Xote__ReactiveProp.res.mjs → ReactiveProp.res.mjs} +2 -2
  19. package/src/{Xote__Router.res → Router.res} +38 -32
  20. package/src/{Xote__Router.res.mjs → Router.res.mjs} +28 -28
  21. package/src/{Xote__SSR.res → SSR.res} +16 -18
  22. package/src/{Xote__SSR.res.mjs → SSR.res.mjs} +5 -8
  23. package/src/{Xote__SSRState.res → SSRState.res} +7 -6
  24. package/src/{Xote__SSRState.res.mjs → SSRState.res.mjs} +12 -12
  25. package/src/Signal.res +1 -0
  26. package/src/Signal.res.mjs +31 -0
  27. package/src/{Xote__JSX.res → XoteJSX.res} +22 -23
  28. package/src/{Xote__JSX.res.mjs → XoteJSX.res.mjs} +22 -24
  29. package/src/Xote.res +0 -43
  30. package/src/Xote.res.mjs +0 -114
  31. /package/src/{Xote__Route.res → Route.res} +0 -0
  32. /package/src/{Xote__Route.res.mjs → Route.res.mjs} +0 -0
  33. /package/src/{Xote__SSRContext.res → SSRContext.res} +0 -0
  34. /package/src/{Xote__SSRContext.res.mjs → SSRContext.res.mjs} +0 -0
@@ -1,7 +1,8 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
- import * as Signals from "rescript-signals/src/Signals.res.mjs";
4
- import * as Xote__Component from "./Xote__Component.res.mjs";
3
+ import * as Node$Xote from "./Node.res.mjs";
4
+ import * as Signal$Xote from "./Signal.res.mjs";
5
+ import * as Computed$Xote from "./Computed.res.mjs";
5
6
  import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.js";
6
7
 
7
8
  function jsx(component, props) {
@@ -23,14 +24,14 @@ function jsxFragment(props) {
23
24
  if (child !== undefined) {
24
25
  return child;
25
26
  } else {
26
- return Xote__Component.fragment([]);
27
+ return Node$Xote.fragment([]);
27
28
  }
28
29
  }
29
30
 
30
- let array = Xote__Component.fragment;
31
+ let array = Node$Xote.fragment;
31
32
 
32
33
  function $$null() {
33
- return Xote__Component.text("");
34
+ return Node$Xote.text("");
34
35
  }
35
36
 
36
37
  function isReactiveProp(value) {
@@ -40,36 +41,36 @@ function isReactiveProp(value) {
40
41
  function convertAttrValue(key, value) {
41
42
  if (isReactiveProp(value)) {
42
43
  if (value.TAG === "Reactive") {
43
- return Xote__Component.signalAttr(key, value._0);
44
+ return Node$Xote.signalAttr(key, value._0);
44
45
  } else {
45
- return Xote__Component.attr(key, value._0);
46
+ return Node$Xote.attr(key, value._0);
46
47
  }
47
48
  } else if (typeof value === "function") {
48
- return Xote__Component.computedAttr(key, value);
49
+ return Node$Xote.computedAttr(key, value);
49
50
  } else if (typeof value === "object") {
50
- return Xote__Component.signalAttr(key, value);
51
+ return Node$Xote.signalAttr(key, value);
51
52
  } else {
52
- return Xote__Component.attr(key, value);
53
+ return Node$Xote.attr(key, value);
53
54
  }
54
55
  }
55
56
 
56
57
  function convertBoolAttrValue(key, value) {
57
58
  if (isReactiveProp(value)) {
58
59
  if (value.TAG !== "Reactive") {
59
- return Xote__Component.attr(key, value._0 ? "true" : "false");
60
+ return Node$Xote.attr(key, value._0 ? "true" : "false");
60
61
  }
61
62
  let signal = value._0;
62
- let strSignal = Signals.Computed.make(() => {
63
- if (Signals.Signal.get(signal)) {
63
+ let strSignal = Computed$Xote.make(() => {
64
+ if (Signal$Xote.get(signal)) {
64
65
  return "true";
65
66
  } else {
66
67
  return "false";
67
68
  }
68
69
  }, undefined);
69
- return Xote__Component.signalAttr(key, strSignal);
70
+ return Node$Xote.signalAttr(key, strSignal);
70
71
  }
71
72
  if (typeof value === "function") {
72
- return Xote__Component.computedAttr(key, () => {
73
+ return Node$Xote.computedAttr(key, () => {
73
74
  if (value()) {
74
75
  return "true";
75
76
  } else {
@@ -78,16 +79,16 @@ function convertBoolAttrValue(key, value) {
78
79
  });
79
80
  }
80
81
  if (typeof value !== "object") {
81
- return Xote__Component.attr(key, value ? "true" : "false");
82
+ return Node$Xote.attr(key, value ? "true" : "false");
82
83
  }
83
- let strSignal$1 = Signals.Computed.make(() => {
84
- if (Signals.Signal.get(value)) {
84
+ let strSignal$1 = Computed$Xote.make(() => {
85
+ if (Signal$Xote.get(value)) {
85
86
  return "true";
86
87
  } else {
87
88
  return "false";
88
89
  }
89
90
  }, undefined);
90
- return Xote__Component.signalAttr(key, strSignal$1);
91
+ return Node$Xote.signalAttr(key, strSignal$1);
91
92
  }
92
93
 
93
94
  function addAttr(attrs, opt, key, converter) {
@@ -99,7 +100,7 @@ function addAttr(attrs, opt, key, converter) {
99
100
 
100
101
  function addIntAttr(attrs, opt, key) {
101
102
  if (opt !== undefined) {
102
- attrs.push(Xote__Component.attr(key, opt.toString()));
103
+ attrs.push(Node$Xote.attr(key, opt.toString()));
103
104
  return;
104
105
  }
105
106
  }
@@ -225,8 +226,6 @@ let Elements = {
225
226
  jsxsKeyed: jsxKeyed$1
226
227
  };
227
228
 
228
- let Component;
229
-
230
229
  let ReactiveProp;
231
230
 
232
231
  let jsxs = jsx;
@@ -234,7 +233,6 @@ let jsxs = jsx;
234
233
  let jsxsKeyed = jsxKeyed;
235
234
 
236
235
  export {
237
- Component,
238
236
  ReactiveProp,
239
237
  jsx,
240
238
  jsxs,
@@ -245,4 +243,4 @@ export {
245
243
  $$null,
246
244
  Elements,
247
245
  }
248
- /* Xote__Component Not a pure module */
246
+ /* Node-Xote Not a pure module */
package/src/Xote.res DELETED
@@ -1,43 +0,0 @@
1
- module Signal = {
2
- include Signals.Signal
3
- }
4
-
5
- module Computed = {
6
- include Signals.Computed
7
- }
8
-
9
- module Effect = {
10
- include Signals.Effect
11
- }
12
-
13
- module Component = {
14
- include Xote__Component
15
- }
16
-
17
- module Route = {
18
- include Xote__Route
19
- }
20
-
21
- module Router = {
22
- include Xote__Router
23
- }
24
-
25
- module ReactiveProp = {
26
- include Xote__ReactiveProp
27
- }
28
-
29
- module SSR = {
30
- include Xote__SSR
31
- }
32
-
33
- module SSRContext = {
34
- include Xote__SSRContext
35
- }
36
-
37
- module SSRState = {
38
- include Xote__SSRState
39
- }
40
-
41
- module Hydration = {
42
- include Xote__Hydration
43
- }
package/src/Xote.res.mjs DELETED
@@ -1,114 +0,0 @@
1
- // Generated by ReScript, PLEASE EDIT WITH CARE
2
-
3
- import * as Signals from "rescript-signals/src/Signals.res.mjs";
4
- import * as Xote__SSR from "./Xote__SSR.res.mjs";
5
- import * as Xote__Route from "./Xote__Route.res.mjs";
6
- import * as Xote__Router from "./Xote__Router.res.mjs";
7
- import * as Xote__SSRState from "./Xote__SSRState.res.mjs";
8
- import * as Xote__Component from "./Xote__Component.res.mjs";
9
- import * as Xote__Hydration from "./Xote__Hydration.res.mjs";
10
- import * as Xote__SSRContext from "./Xote__SSRContext.res.mjs";
11
- import * as Xote__ReactiveProp from "./Xote__ReactiveProp.res.mjs";
12
-
13
- let Signal_Id = Signals.Signal.Id;
14
-
15
- let Signal_Scheduler = Signals.Signal.Scheduler;
16
-
17
- let Signal_Core = Signals.Signal.Core;
18
-
19
- let Signal_make = Signals.Signal.make;
20
-
21
- let Signal_makeForComputed = Signals.Signal.makeForComputed;
22
-
23
- let Signal_get = Signals.Signal.get;
24
-
25
- let Signal_peek = Signals.Signal.peek;
26
-
27
- let Signal_set = Signals.Signal.set;
28
-
29
- let Signal_update = Signals.Signal.update;
30
-
31
- let Signal_batch = Signals.Signal.batch;
32
-
33
- let Signal_untrack = Signals.Signal.untrack;
34
-
35
- let Signal = {
36
- Id: Signal_Id,
37
- Scheduler: Signal_Scheduler,
38
- Core: Signal_Core,
39
- make: Signal_make,
40
- makeForComputed: Signal_makeForComputed,
41
- get: Signal_get,
42
- peek: Signal_peek,
43
- set: Signal_set,
44
- update: Signal_update,
45
- batch: Signal_batch,
46
- untrack: Signal_untrack
47
- };
48
-
49
- let Computed_Id = Signals.Computed.Id;
50
-
51
- let Computed_Signal = Signals.Computed.Signal;
52
-
53
- let Computed_Core = Signals.Computed.Core;
54
-
55
- let Computed_Scheduler = Signals.Computed.Scheduler;
56
-
57
- let Computed_make = Signals.Computed.make;
58
-
59
- let Computed_dispose = Signals.Computed.dispose;
60
-
61
- let Computed = {
62
- Id: Computed_Id,
63
- Signal: Computed_Signal,
64
- Core: Computed_Core,
65
- Scheduler: Computed_Scheduler,
66
- make: Computed_make,
67
- dispose: Computed_dispose
68
- };
69
-
70
- let Effect_Id = Signals.Effect.Id;
71
-
72
- let Effect_Core = Signals.Effect.Core;
73
-
74
- let Effect_Scheduler = Signals.Effect.Scheduler;
75
-
76
- let Effect_run = Signals.Effect.run;
77
-
78
- let Effect = {
79
- Id: Effect_Id,
80
- Core: Effect_Core,
81
- Scheduler: Effect_Scheduler,
82
- run: Effect_run
83
- };
84
-
85
- let Component = Xote__Component;
86
-
87
- let Route = Xote__Route;
88
-
89
- let Router = Xote__Router;
90
-
91
- let ReactiveProp = Xote__ReactiveProp;
92
-
93
- let SSR = Xote__SSR;
94
-
95
- let SSRContext = Xote__SSRContext;
96
-
97
- let SSRState = Xote__SSRState;
98
-
99
- let Hydration = Xote__Hydration;
100
-
101
- export {
102
- Signal,
103
- Computed,
104
- Effect,
105
- Component,
106
- Route,
107
- Router,
108
- ReactiveProp,
109
- SSR,
110
- SSRContext,
111
- SSRState,
112
- Hydration,
113
- }
114
- /* Xote__Router Not a pure module */
File without changes
File without changes
File without changes