@arcanejs/react-toolkit 0.11.1 → 0.12.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 +7 -7
- package/dist/data.d.mts +4 -0
- package/dist/data.d.ts +4 -0
- package/dist/data.js +2 -0
- package/dist/data.mjs +2 -0
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ The UI has also been designed primarily with touch devices in mind,
|
|
|
15
15
|
but also works well with a cursor and keyboard.
|
|
16
16
|
|
|
17
17
|
<p align="center">
|
|
18
|
-
<img src="https://raw.githubusercontent.com/
|
|
18
|
+
<img src="https://raw.githubusercontent.com/ArcaneWizards/arcanejs/main/packages/react-toolkit/docs/architecture.svg" alt="Architecture Diagram">
|
|
19
19
|
</p>
|
|
20
20
|
|
|
21
21
|
## What
|
|
@@ -114,7 +114,7 @@ ToolkitRenderer.render(<ControlPanel />, toolkit);
|
|
|
114
114
|
You would then be able to access the following control panel
|
|
115
115
|
from [localhost:3000](http://localhost:3000):
|
|
116
116
|
|
|
117
|
-

|
|
118
118
|
|
|
119
119
|
Please note:
|
|
120
120
|
|
|
@@ -124,7 +124,7 @@ Please note:
|
|
|
124
124
|
- You are welcome to abstract / componentize your application as you like,
|
|
125
125
|
in the same manner that you would any `react-dom` or `react-native` project.
|
|
126
126
|
|
|
127
|
-
_See the [counter example](https://github.com/
|
|
127
|
+
_See the [counter example](https://github.com/ArcaneWizards/arcanejs/blob/main/examples/react/src/counter.tsx)._
|
|
128
128
|
|
|
129
129
|
- This react / component-tree / state is managed server-side,
|
|
130
130
|
and does not accurately represent the HTML used on the frontend.
|
|
@@ -138,13 +138,13 @@ Please note:
|
|
|
138
138
|
however this functionality is not documented.
|
|
139
139
|
|
|
140
140
|
You can see code examples of this functionality here in the
|
|
141
|
-
[custom components example app](https://github.com/
|
|
141
|
+
[custom components example app](https://github.com/ArcaneWizards/arcanejs/tree/main/examples/custom-components).
|
|
142
142
|
|
|
143
143
|
## Components
|
|
144
144
|
|
|
145
145
|
For full example usage all of our components in applications that are
|
|
146
146
|
ready-to-run, we recommend that you check-out the
|
|
147
|
-
[examples directory](https://github.com/
|
|
147
|
+
[examples directory](https://github.com/ArcaneWizards/arcanejs/tree/main/examples/react).
|
|
148
148
|
|
|
149
149
|
### `Button`
|
|
150
150
|
|
|
@@ -282,11 +282,11 @@ TODO
|
|
|
282
282
|
|
|
283
283
|
TODO
|
|
284
284
|
|
|
285
|
-
## [Examples](https://github.com/
|
|
285
|
+
## [Examples](https://github.com/ArcaneWizards/arcanejs/tree/main/examples/react)
|
|
286
286
|
|
|
287
287
|
For a comprehensive list of examples,
|
|
288
288
|
please see the example directory in the arcane monorepo:
|
|
289
|
-
<https://github.com/
|
|
289
|
+
<https://github.com/ArcaneWizards/arcanejs/tree/main/examples/react>
|
|
290
290
|
|
|
291
291
|
### [Example Philips Hue App](https://github.com/arcanejs/hue-example)
|
|
292
292
|
|
package/dist/data.d.mts
CHANGED
|
@@ -24,6 +24,10 @@ type ProviderProps = DataFileUsage & {
|
|
|
24
24
|
type DataFileUpdater<T> = (update: (current: T) => T) => void;
|
|
25
25
|
type DataFileContext<T> = {
|
|
26
26
|
data: T;
|
|
27
|
+
/**
|
|
28
|
+
* False until the initial load from disk has completed.
|
|
29
|
+
*/
|
|
30
|
+
status: 'loading' | 'error' | 'ready';
|
|
27
31
|
/**
|
|
28
32
|
* Last timestamp where {@link DataFileContext.data data} was updated
|
|
29
33
|
* in-memory.
|
package/dist/data.d.ts
CHANGED
|
@@ -24,6 +24,10 @@ type ProviderProps = DataFileUsage & {
|
|
|
24
24
|
type DataFileUpdater<T> = (update: (current: T) => T) => void;
|
|
25
25
|
type DataFileContext<T> = {
|
|
26
26
|
data: T;
|
|
27
|
+
/**
|
|
28
|
+
* False until the initial load from disk has completed.
|
|
29
|
+
*/
|
|
30
|
+
status: 'loading' | 'error' | 'ready';
|
|
27
31
|
/**
|
|
28
32
|
* Last timestamp where {@link DataFileContext.data data} was updated
|
|
29
33
|
* in-memory.
|
package/dist/data.js
CHANGED
|
@@ -190,6 +190,7 @@ function createDataFileDefinition({
|
|
|
190
190
|
}) {
|
|
191
191
|
const context = _react.createContext.call(void 0, {
|
|
192
192
|
data: defaultValue,
|
|
193
|
+
status: "loading",
|
|
193
194
|
lastUpdatedMillis: Date.now(),
|
|
194
195
|
updateData: () => {
|
|
195
196
|
throw new Error("Data file provider not used");
|
|
@@ -216,6 +217,7 @@ function createDataFileDefinition({
|
|
|
216
217
|
const providedContext = _react.useMemo.call(void 0,
|
|
217
218
|
() => ({
|
|
218
219
|
data: data.status !== "loading" && data.data !== void 0 ? data.data : defaultValue,
|
|
220
|
+
status: data.status,
|
|
219
221
|
lastUpdatedMillis: data.lastUpdatedMillis,
|
|
220
222
|
updateData,
|
|
221
223
|
saveData,
|
package/dist/data.mjs
CHANGED
|
@@ -190,6 +190,7 @@ function createDataFileDefinition({
|
|
|
190
190
|
}) {
|
|
191
191
|
const context = createContext({
|
|
192
192
|
data: defaultValue,
|
|
193
|
+
status: "loading",
|
|
193
194
|
lastUpdatedMillis: Date.now(),
|
|
194
195
|
updateData: () => {
|
|
195
196
|
throw new Error("Data file provider not used");
|
|
@@ -216,6 +217,7 @@ function createDataFileDefinition({
|
|
|
216
217
|
const providedContext = useMemo(
|
|
217
218
|
() => ({
|
|
218
219
|
data: data.status !== "loading" && data.data !== void 0 ? data.data : defaultValue,
|
|
220
|
+
status: data.status,
|
|
219
221
|
lastUpdatedMillis: data.lastUpdatedMillis,
|
|
220
222
|
updateData,
|
|
221
223
|
saveData,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcanejs/react-toolkit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Build web-accessible control interfaces for your long-running Node.js processes",
|
|
6
6
|
"keywords": [
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"repository": {
|
|
18
18
|
"type": "git",
|
|
19
|
-
"url": "https://github.com/
|
|
19
|
+
"url": "https://github.com/ArcaneWizards/arcanejs.git"
|
|
20
20
|
},
|
|
21
21
|
"exports": {
|
|
22
22
|
".": {
|
|
@@ -62,15 +62,15 @@
|
|
|
62
62
|
"tsup": "^8.1.0",
|
|
63
63
|
"typescript": "^5.3.3",
|
|
64
64
|
"zod": "^3.23.8",
|
|
65
|
-
"@arcanejs/
|
|
66
|
-
"@arcanejs/
|
|
65
|
+
"@arcanejs/eslint-config": "^0.0.0",
|
|
66
|
+
"@arcanejs/typescript-config": "^0.0.0"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
69
|
"lodash": "^4.17.21",
|
|
70
70
|
"react": "^18",
|
|
71
71
|
"react-reconciler": "0.28.0",
|
|
72
|
-
"@arcanejs/protocol": "^0.
|
|
73
|
-
"@arcanejs/toolkit": "^
|
|
72
|
+
"@arcanejs/protocol": "^0.7.0",
|
|
73
|
+
"@arcanejs/toolkit": "^4.0.0"
|
|
74
74
|
},
|
|
75
75
|
"peerDependencies": {
|
|
76
76
|
"zod": "^3.23.8"
|