@arcanejs/react-toolkit 0.7.0 → 0.8.1
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 +4 -5
- package/dist/chunk-CAHNLXTY.mjs +246 -0
- package/dist/chunk-Q54JXYCV.js +246 -0
- package/dist/colors.d.mts +64 -11
- package/dist/colors.d.ts +64 -11
- package/dist/colors.js +8 -7
- package/dist/colors.mjs +2 -1
- package/dist/index.d.mts +103 -26
- package/dist/index.d.ts +103 -26
- package/dist/index.js +33 -225
- package/dist/index.mjs +9 -201
- package/package.json +13 -13
- package/dist/chunk-HVMRFXJ2.mjs +0 -49
- package/dist/chunk-RKOUSLUW.js +0 -49
- package/dist/types-D0Wa4a4d.d.mts +0 -66
- package/dist/types-D0Wa4a4d.d.ts +0 -66
package/README.md
CHANGED
|
@@ -134,12 +134,11 @@ Please note:
|
|
|
134
134
|
that is loaded in the browser,
|
|
135
135
|
and then used to render the JSON representation of the `@arcanejs` tree.
|
|
136
136
|
|
|
137
|
-
-
|
|
138
|
-
|
|
139
|
-
Apps can only be composed of the below supported components,
|
|
140
|
-
or composite components directly built by these components.
|
|
137
|
+
- It's possible to define your own custom components,
|
|
138
|
+
however this functionality is not documented.
|
|
141
139
|
|
|
142
|
-
|
|
140
|
+
You can see code examples of this functionality here in the
|
|
141
|
+
[custom components example app](https://github.com/arcanejs/arcanejs/tree/main/examples/custom-components).
|
|
143
142
|
|
|
144
143
|
## Components
|
|
145
144
|
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
import {
|
|
2
|
+
LoggerContext
|
|
3
|
+
} from "./chunk-TOGR56FN.mjs";
|
|
4
|
+
|
|
5
|
+
// src/index.tsx
|
|
6
|
+
import Reconciler from "react-reconciler";
|
|
7
|
+
import { DefaultEventPriority } from "react-reconciler/constants";
|
|
8
|
+
import * as ld from "@arcanejs/toolkit";
|
|
9
|
+
import { Base, BaseParent } from "@arcanejs/toolkit/components/base";
|
|
10
|
+
|
|
11
|
+
// src/registry.ts
|
|
12
|
+
import React from "react";
|
|
13
|
+
var prepareComponents = (namespace, defn) => {
|
|
14
|
+
const entries = Object.entries(defn);
|
|
15
|
+
const _creators = entries.reduce((acc, [key, cls]) => {
|
|
16
|
+
acc[key] = (props) => new cls(props);
|
|
17
|
+
return acc;
|
|
18
|
+
}, {});
|
|
19
|
+
const components = entries.reduce(
|
|
20
|
+
(acc, [key, cls]) => {
|
|
21
|
+
acc[key] = React.forwardRef(
|
|
22
|
+
(props, ref) => React.createElement(
|
|
23
|
+
`${namespace}:${key}`,
|
|
24
|
+
{ ...props, ref },
|
|
25
|
+
props.children
|
|
26
|
+
)
|
|
27
|
+
);
|
|
28
|
+
return acc;
|
|
29
|
+
},
|
|
30
|
+
{}
|
|
31
|
+
);
|
|
32
|
+
return {
|
|
33
|
+
_namespace: namespace,
|
|
34
|
+
_creators,
|
|
35
|
+
...components
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// src/core.ts
|
|
40
|
+
import {
|
|
41
|
+
Button,
|
|
42
|
+
Group,
|
|
43
|
+
GroupHeader,
|
|
44
|
+
Label,
|
|
45
|
+
Rect,
|
|
46
|
+
SliderButton,
|
|
47
|
+
Switch,
|
|
48
|
+
Tab,
|
|
49
|
+
Tabs,
|
|
50
|
+
TextInput,
|
|
51
|
+
Timeline
|
|
52
|
+
} from "@arcanejs/toolkit";
|
|
53
|
+
var CoreComponents = prepareComponents("core", {
|
|
54
|
+
Button,
|
|
55
|
+
Group,
|
|
56
|
+
GroupHeader,
|
|
57
|
+
Label,
|
|
58
|
+
Rect,
|
|
59
|
+
SliderButton,
|
|
60
|
+
Switch,
|
|
61
|
+
Tab,
|
|
62
|
+
Tabs,
|
|
63
|
+
TextInput,
|
|
64
|
+
Timeline
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
// src/index.tsx
|
|
68
|
+
import { jsx } from "react/jsx-runtime";
|
|
69
|
+
var canSetProps = (instance) => instance instanceof Base;
|
|
70
|
+
var hostConfig = ({
|
|
71
|
+
componentNamespaces
|
|
72
|
+
}) => {
|
|
73
|
+
const processedNamespaces = {};
|
|
74
|
+
for (const namespace of componentNamespaces) {
|
|
75
|
+
if (processedNamespaces[namespace._namespace]) {
|
|
76
|
+
throw new Error(`Duplicate namespace: ${namespace._namespace}`);
|
|
77
|
+
}
|
|
78
|
+
processedNamespaces[namespace._namespace] = namespace;
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
supportsMutation: true,
|
|
82
|
+
supportsPersistence: false,
|
|
83
|
+
noTimeout: -1,
|
|
84
|
+
isPrimaryRenderer: true,
|
|
85
|
+
supportsHydration: false,
|
|
86
|
+
afterActiveInstanceBlur: () => null,
|
|
87
|
+
appendChild: (parentInstance, child) => {
|
|
88
|
+
if (parentInstance instanceof BaseParent) {
|
|
89
|
+
parentInstance.appendChild(child);
|
|
90
|
+
} else {
|
|
91
|
+
throw new Error(`Unexpected Parent: ${parentInstance}`);
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
appendInitialChild: (parentInstance, child) => {
|
|
95
|
+
if (parentInstance instanceof BaseParent) {
|
|
96
|
+
parentInstance.appendChild(child);
|
|
97
|
+
} else {
|
|
98
|
+
throw new Error(`Unexpected Parent: ${parentInstance}`);
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
appendChildToContainer(container, child) {
|
|
102
|
+
container.appendChild(child);
|
|
103
|
+
},
|
|
104
|
+
beforeActiveInstanceBlur: () => null,
|
|
105
|
+
cancelTimeout: (id) => clearTimeout(id),
|
|
106
|
+
clearContainer: (container) => container.removeAllChildren(),
|
|
107
|
+
commitMount: () => {
|
|
108
|
+
throw new Error(`Unexpected call to commitMount()`);
|
|
109
|
+
},
|
|
110
|
+
commitUpdate(instance, updatePayload, _type, _prevProps, _nextProps, _internalHandle) {
|
|
111
|
+
if (canSetProps(instance)) {
|
|
112
|
+
instance.setProps(updatePayload);
|
|
113
|
+
} else {
|
|
114
|
+
throw new Error(`Unexpected Instance: ${instance}`);
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
commitTextUpdate: (textInstance, _oldText, newText) => textInstance.setText(newText),
|
|
118
|
+
createInstance: (type, props) => {
|
|
119
|
+
const [namespace, typeName] = type.split(":", 2);
|
|
120
|
+
if (!namespace || !typeName) {
|
|
121
|
+
throw new Error(`Invalid type: ${type}`);
|
|
122
|
+
}
|
|
123
|
+
const components = processedNamespaces[namespace];
|
|
124
|
+
if (!components) {
|
|
125
|
+
throw new Error(`Unknown component namespace: ${namespace}`);
|
|
126
|
+
}
|
|
127
|
+
const creator = components._creators[typeName];
|
|
128
|
+
if (!creator) {
|
|
129
|
+
throw new Error(
|
|
130
|
+
`Unable to render <${typeName} />, not provided to renderer.`
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
const instance = creator(props);
|
|
134
|
+
return instance;
|
|
135
|
+
},
|
|
136
|
+
createTextInstance: (text) => new ld.Label({ text }),
|
|
137
|
+
detachDeletedInstance: () => null,
|
|
138
|
+
getChildHostContext: (parentHostContext) => parentHostContext,
|
|
139
|
+
getCurrentEventPriority: () => DefaultEventPriority,
|
|
140
|
+
getInstanceFromNode: () => {
|
|
141
|
+
throw new Error("Not yet implemented.");
|
|
142
|
+
},
|
|
143
|
+
getInstanceFromScope: () => {
|
|
144
|
+
throw new Error("Not yet implemented.");
|
|
145
|
+
},
|
|
146
|
+
getPublicInstance: (instance) => instance,
|
|
147
|
+
getRootHostContext: () => null,
|
|
148
|
+
insertBefore: (parentInstance, child, beforeChild) => {
|
|
149
|
+
if (parentInstance instanceof BaseParent) {
|
|
150
|
+
parentInstance.insertBefore(child, beforeChild);
|
|
151
|
+
} else {
|
|
152
|
+
throw new Error(`Unexpected Parent: ${parentInstance}`);
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
insertInContainerBefore: (container, child, beforeChild) => container.insertBefore(child, beforeChild),
|
|
156
|
+
finalizeInitialChildren: () => false,
|
|
157
|
+
prepareForCommit: () => null,
|
|
158
|
+
preparePortalMount: () => null,
|
|
159
|
+
prepareScopeUpdate: () => null,
|
|
160
|
+
prepareUpdate: (_instance, _type, _oldProps, newProps, _rootContainer, _hostContext) => {
|
|
161
|
+
const updates = {};
|
|
162
|
+
for (const [key, val] of Object.entries(newProps)) {
|
|
163
|
+
if (key !== "children") {
|
|
164
|
+
updates[key] = val;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
if (Object.keys(updates).length) {
|
|
168
|
+
return updates;
|
|
169
|
+
} else {
|
|
170
|
+
return null;
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
removeChild(parentInstance, child) {
|
|
174
|
+
if (parentInstance instanceof BaseParent) {
|
|
175
|
+
parentInstance.removeChild(child);
|
|
176
|
+
} else {
|
|
177
|
+
throw new Error(`Unexpected Parent: ${parentInstance}`);
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
removeChildFromContainer: (container, child) => container.removeChild(child),
|
|
181
|
+
resetAfterCommit: () => null,
|
|
182
|
+
resetTextContent: () => {
|
|
183
|
+
throw new Error(`Unexpected call to resetTextContent()`);
|
|
184
|
+
},
|
|
185
|
+
scheduleTimeout: (fn, delay) => setTimeout(fn, delay),
|
|
186
|
+
shouldSetTextContent: () => false,
|
|
187
|
+
// Not-implemented
|
|
188
|
+
hideInstance: () => {
|
|
189
|
+
console.log("Not-implemented: hideInstance");
|
|
190
|
+
},
|
|
191
|
+
hideTextInstance: () => {
|
|
192
|
+
console.log("Not-implemented: hideTextInstance");
|
|
193
|
+
},
|
|
194
|
+
unhideInstance: () => {
|
|
195
|
+
console.log("Not-implemented: unhideInstance");
|
|
196
|
+
},
|
|
197
|
+
unhideTextInstance: () => {
|
|
198
|
+
console.log("Not-implemented: unhideTextInstance");
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
};
|
|
202
|
+
var ToolkitRenderer = {
|
|
203
|
+
renderGroup: (component, container, config = {
|
|
204
|
+
componentNamespaces: [CoreComponents]
|
|
205
|
+
}) => {
|
|
206
|
+
const reconciler = Reconciler(hostConfig(config));
|
|
207
|
+
const root = reconciler.createContainer(container, 0, false, null);
|
|
208
|
+
const componentWithContexts = /* @__PURE__ */ jsx(LoggerContext.Provider, { value: container.log, children: component });
|
|
209
|
+
reconciler.updateContainer(componentWithContexts, root, null);
|
|
210
|
+
},
|
|
211
|
+
render: (component, container, rootGroupProps, config = {
|
|
212
|
+
componentNamespaces: [CoreComponents]
|
|
213
|
+
}) => {
|
|
214
|
+
const group = new ld.Group({ direction: "vertical", ...rootGroupProps });
|
|
215
|
+
container.setRoot(group);
|
|
216
|
+
ToolkitRenderer.renderGroup(component, group, config);
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
var Button2 = CoreComponents.Button;
|
|
220
|
+
var Group3 = CoreComponents.Group;
|
|
221
|
+
var GroupHeader2 = CoreComponents.GroupHeader;
|
|
222
|
+
var Label3 = CoreComponents.Label;
|
|
223
|
+
var Rect2 = CoreComponents.Rect;
|
|
224
|
+
var SliderButton2 = CoreComponents.SliderButton;
|
|
225
|
+
var Switch2 = CoreComponents.Switch;
|
|
226
|
+
var Tab2 = CoreComponents.Tab;
|
|
227
|
+
var Tabs2 = CoreComponents.Tabs;
|
|
228
|
+
var TextInput2 = CoreComponents.TextInput;
|
|
229
|
+
var Timeline2 = CoreComponents.Timeline;
|
|
230
|
+
|
|
231
|
+
export {
|
|
232
|
+
prepareComponents,
|
|
233
|
+
CoreComponents,
|
|
234
|
+
ToolkitRenderer,
|
|
235
|
+
Button2 as Button,
|
|
236
|
+
Group3 as Group,
|
|
237
|
+
GroupHeader2 as GroupHeader,
|
|
238
|
+
Label3 as Label,
|
|
239
|
+
Rect2 as Rect,
|
|
240
|
+
SliderButton2 as SliderButton,
|
|
241
|
+
Switch2 as Switch,
|
|
242
|
+
Tab2 as Tab,
|
|
243
|
+
Tabs2 as Tabs,
|
|
244
|
+
TextInput2 as TextInput,
|
|
245
|
+
Timeline2 as Timeline
|
|
246
|
+
};
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2
|
+
|
|
3
|
+
var _chunkRT2VSMJLjs = require('./chunk-RT2VSMJL.js');
|
|
4
|
+
|
|
5
|
+
// src/index.tsx
|
|
6
|
+
var _reactreconciler = require('react-reconciler'); var _reactreconciler2 = _interopRequireDefault(_reactreconciler);
|
|
7
|
+
var _constants = require('react-reconciler/constants');
|
|
8
|
+
var _toolkit = require('@arcanejs/toolkit'); var ld = _interopRequireWildcard(_toolkit);
|
|
9
|
+
var _base = require('@arcanejs/toolkit/components/base');
|
|
10
|
+
|
|
11
|
+
// src/registry.ts
|
|
12
|
+
var _react = require('react'); var _react2 = _interopRequireDefault(_react);
|
|
13
|
+
var prepareComponents = (namespace, defn) => {
|
|
14
|
+
const entries = Object.entries(defn);
|
|
15
|
+
const _creators = entries.reduce((acc, [key, cls]) => {
|
|
16
|
+
acc[key] = (props) => new cls(props);
|
|
17
|
+
return acc;
|
|
18
|
+
}, {});
|
|
19
|
+
const components = entries.reduce(
|
|
20
|
+
(acc, [key, cls]) => {
|
|
21
|
+
acc[key] = _react2.default.forwardRef(
|
|
22
|
+
(props, ref) => _react2.default.createElement(
|
|
23
|
+
`${namespace}:${key}`,
|
|
24
|
+
{ ...props, ref },
|
|
25
|
+
props.children
|
|
26
|
+
)
|
|
27
|
+
);
|
|
28
|
+
return acc;
|
|
29
|
+
},
|
|
30
|
+
{}
|
|
31
|
+
);
|
|
32
|
+
return {
|
|
33
|
+
_namespace: namespace,
|
|
34
|
+
_creators,
|
|
35
|
+
...components
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// src/core.ts
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
var CoreComponents = prepareComponents("core", {
|
|
54
|
+
Button: _toolkit.Button,
|
|
55
|
+
Group: _toolkit.Group,
|
|
56
|
+
GroupHeader: _toolkit.GroupHeader,
|
|
57
|
+
Label: _toolkit.Label,
|
|
58
|
+
Rect: _toolkit.Rect,
|
|
59
|
+
SliderButton: _toolkit.SliderButton,
|
|
60
|
+
Switch: _toolkit.Switch,
|
|
61
|
+
Tab: _toolkit.Tab,
|
|
62
|
+
Tabs: _toolkit.Tabs,
|
|
63
|
+
TextInput: _toolkit.TextInput,
|
|
64
|
+
Timeline: _toolkit.Timeline
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
// src/index.tsx
|
|
68
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
69
|
+
var canSetProps = (instance) => instance instanceof _base.Base;
|
|
70
|
+
var hostConfig = ({
|
|
71
|
+
componentNamespaces
|
|
72
|
+
}) => {
|
|
73
|
+
const processedNamespaces = {};
|
|
74
|
+
for (const namespace of componentNamespaces) {
|
|
75
|
+
if (processedNamespaces[namespace._namespace]) {
|
|
76
|
+
throw new Error(`Duplicate namespace: ${namespace._namespace}`);
|
|
77
|
+
}
|
|
78
|
+
processedNamespaces[namespace._namespace] = namespace;
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
supportsMutation: true,
|
|
82
|
+
supportsPersistence: false,
|
|
83
|
+
noTimeout: -1,
|
|
84
|
+
isPrimaryRenderer: true,
|
|
85
|
+
supportsHydration: false,
|
|
86
|
+
afterActiveInstanceBlur: () => null,
|
|
87
|
+
appendChild: (parentInstance, child) => {
|
|
88
|
+
if (parentInstance instanceof _base.BaseParent) {
|
|
89
|
+
parentInstance.appendChild(child);
|
|
90
|
+
} else {
|
|
91
|
+
throw new Error(`Unexpected Parent: ${parentInstance}`);
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
appendInitialChild: (parentInstance, child) => {
|
|
95
|
+
if (parentInstance instanceof _base.BaseParent) {
|
|
96
|
+
parentInstance.appendChild(child);
|
|
97
|
+
} else {
|
|
98
|
+
throw new Error(`Unexpected Parent: ${parentInstance}`);
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
appendChildToContainer(container, child) {
|
|
102
|
+
container.appendChild(child);
|
|
103
|
+
},
|
|
104
|
+
beforeActiveInstanceBlur: () => null,
|
|
105
|
+
cancelTimeout: (id) => clearTimeout(id),
|
|
106
|
+
clearContainer: (container) => container.removeAllChildren(),
|
|
107
|
+
commitMount: () => {
|
|
108
|
+
throw new Error(`Unexpected call to commitMount()`);
|
|
109
|
+
},
|
|
110
|
+
commitUpdate(instance, updatePayload, _type, _prevProps, _nextProps, _internalHandle) {
|
|
111
|
+
if (canSetProps(instance)) {
|
|
112
|
+
instance.setProps(updatePayload);
|
|
113
|
+
} else {
|
|
114
|
+
throw new Error(`Unexpected Instance: ${instance}`);
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
commitTextUpdate: (textInstance, _oldText, newText) => textInstance.setText(newText),
|
|
118
|
+
createInstance: (type, props) => {
|
|
119
|
+
const [namespace, typeName] = type.split(":", 2);
|
|
120
|
+
if (!namespace || !typeName) {
|
|
121
|
+
throw new Error(`Invalid type: ${type}`);
|
|
122
|
+
}
|
|
123
|
+
const components = processedNamespaces[namespace];
|
|
124
|
+
if (!components) {
|
|
125
|
+
throw new Error(`Unknown component namespace: ${namespace}`);
|
|
126
|
+
}
|
|
127
|
+
const creator = components._creators[typeName];
|
|
128
|
+
if (!creator) {
|
|
129
|
+
throw new Error(
|
|
130
|
+
`Unable to render <${typeName} />, not provided to renderer.`
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
const instance = creator(props);
|
|
134
|
+
return instance;
|
|
135
|
+
},
|
|
136
|
+
createTextInstance: (text) => new ld.Label({ text }),
|
|
137
|
+
detachDeletedInstance: () => null,
|
|
138
|
+
getChildHostContext: (parentHostContext) => parentHostContext,
|
|
139
|
+
getCurrentEventPriority: () => _constants.DefaultEventPriority,
|
|
140
|
+
getInstanceFromNode: () => {
|
|
141
|
+
throw new Error("Not yet implemented.");
|
|
142
|
+
},
|
|
143
|
+
getInstanceFromScope: () => {
|
|
144
|
+
throw new Error("Not yet implemented.");
|
|
145
|
+
},
|
|
146
|
+
getPublicInstance: (instance) => instance,
|
|
147
|
+
getRootHostContext: () => null,
|
|
148
|
+
insertBefore: (parentInstance, child, beforeChild) => {
|
|
149
|
+
if (parentInstance instanceof _base.BaseParent) {
|
|
150
|
+
parentInstance.insertBefore(child, beforeChild);
|
|
151
|
+
} else {
|
|
152
|
+
throw new Error(`Unexpected Parent: ${parentInstance}`);
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
insertInContainerBefore: (container, child, beforeChild) => container.insertBefore(child, beforeChild),
|
|
156
|
+
finalizeInitialChildren: () => false,
|
|
157
|
+
prepareForCommit: () => null,
|
|
158
|
+
preparePortalMount: () => null,
|
|
159
|
+
prepareScopeUpdate: () => null,
|
|
160
|
+
prepareUpdate: (_instance, _type, _oldProps, newProps, _rootContainer, _hostContext) => {
|
|
161
|
+
const updates = {};
|
|
162
|
+
for (const [key, val] of Object.entries(newProps)) {
|
|
163
|
+
if (key !== "children") {
|
|
164
|
+
updates[key] = val;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
if (Object.keys(updates).length) {
|
|
168
|
+
return updates;
|
|
169
|
+
} else {
|
|
170
|
+
return null;
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
removeChild(parentInstance, child) {
|
|
174
|
+
if (parentInstance instanceof _base.BaseParent) {
|
|
175
|
+
parentInstance.removeChild(child);
|
|
176
|
+
} else {
|
|
177
|
+
throw new Error(`Unexpected Parent: ${parentInstance}`);
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
removeChildFromContainer: (container, child) => container.removeChild(child),
|
|
181
|
+
resetAfterCommit: () => null,
|
|
182
|
+
resetTextContent: () => {
|
|
183
|
+
throw new Error(`Unexpected call to resetTextContent()`);
|
|
184
|
+
},
|
|
185
|
+
scheduleTimeout: (fn, delay) => setTimeout(fn, delay),
|
|
186
|
+
shouldSetTextContent: () => false,
|
|
187
|
+
// Not-implemented
|
|
188
|
+
hideInstance: () => {
|
|
189
|
+
console.log("Not-implemented: hideInstance");
|
|
190
|
+
},
|
|
191
|
+
hideTextInstance: () => {
|
|
192
|
+
console.log("Not-implemented: hideTextInstance");
|
|
193
|
+
},
|
|
194
|
+
unhideInstance: () => {
|
|
195
|
+
console.log("Not-implemented: unhideInstance");
|
|
196
|
+
},
|
|
197
|
+
unhideTextInstance: () => {
|
|
198
|
+
console.log("Not-implemented: unhideTextInstance");
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
};
|
|
202
|
+
var ToolkitRenderer = {
|
|
203
|
+
renderGroup: (component, container, config = {
|
|
204
|
+
componentNamespaces: [CoreComponents]
|
|
205
|
+
}) => {
|
|
206
|
+
const reconciler = _reactreconciler2.default.call(void 0, hostConfig(config));
|
|
207
|
+
const root = reconciler.createContainer(container, 0, false, null);
|
|
208
|
+
const componentWithContexts = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRT2VSMJLjs.LoggerContext.Provider, { value: container.log, children: component });
|
|
209
|
+
reconciler.updateContainer(componentWithContexts, root, null);
|
|
210
|
+
},
|
|
211
|
+
render: (component, container, rootGroupProps, config = {
|
|
212
|
+
componentNamespaces: [CoreComponents]
|
|
213
|
+
}) => {
|
|
214
|
+
const group = new ld.Group({ direction: "vertical", ...rootGroupProps });
|
|
215
|
+
container.setRoot(group);
|
|
216
|
+
ToolkitRenderer.renderGroup(component, group, config);
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
var Button2 = CoreComponents.Button;
|
|
220
|
+
var Group3 = CoreComponents.Group;
|
|
221
|
+
var GroupHeader2 = CoreComponents.GroupHeader;
|
|
222
|
+
var Label3 = CoreComponents.Label;
|
|
223
|
+
var Rect2 = CoreComponents.Rect;
|
|
224
|
+
var SliderButton2 = CoreComponents.SliderButton;
|
|
225
|
+
var Switch2 = CoreComponents.Switch;
|
|
226
|
+
var Tab2 = CoreComponents.Tab;
|
|
227
|
+
var Tabs2 = CoreComponents.Tabs;
|
|
228
|
+
var TextInput2 = CoreComponents.TextInput;
|
|
229
|
+
var Timeline2 = CoreComponents.Timeline;
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
exports.prepareComponents = prepareComponents; exports.CoreComponents = CoreComponents; exports.ToolkitRenderer = ToolkitRenderer; exports.Button = Button2; exports.Group = Group3; exports.GroupHeader = GroupHeader2; exports.Label = Label3; exports.Rect = Rect2; exports.SliderButton = SliderButton2; exports.Switch = Switch2; exports.Tab = Tab2; exports.Tabs = Tabs2; exports.TextInput = TextInput2; exports.Timeline = Timeline2;
|
package/dist/colors.d.mts
CHANGED
|
@@ -1,14 +1,67 @@
|
|
|
1
|
-
import React__default from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import '@arcanejs/toolkit/components/
|
|
4
|
-
import '@arcanejs/toolkit/components/
|
|
5
|
-
import '@arcanejs/toolkit/components/
|
|
6
|
-
import '@arcanejs/toolkit/components/
|
|
7
|
-
import '@arcanejs/toolkit/components/
|
|
8
|
-
import '@arcanejs/toolkit/components/
|
|
9
|
-
import '@arcanejs/toolkit/components/
|
|
10
|
-
import '@arcanejs/toolkit/components/
|
|
11
|
-
|
|
1
|
+
import React__default, { Ref } from 'react';
|
|
2
|
+
import { Props as Props$1, Events as Events$1, Group, GroupHeader } from '@arcanejs/toolkit/components/group';
|
|
3
|
+
import { Props, Events, Button } from '@arcanejs/toolkit/components/button';
|
|
4
|
+
import { Props as Props$2, Label } from '@arcanejs/toolkit/components/label';
|
|
5
|
+
import { Props as Props$3, Rect } from '@arcanejs/toolkit/components/rect';
|
|
6
|
+
import { Props as Props$4, Events as Events$2, SliderButton } from '@arcanejs/toolkit/components/slider-button';
|
|
7
|
+
import { Props as Props$5, Events as Events$3, Switch } from '@arcanejs/toolkit/components/switch';
|
|
8
|
+
import { TabProps, Tab, TabsProps, Tabs } from '@arcanejs/toolkit/components/tabs';
|
|
9
|
+
import { Props as Props$6, Events as Events$4, TextInput } from '@arcanejs/toolkit/components/text-input';
|
|
10
|
+
import { Props as Props$7, Timeline } from '@arcanejs/toolkit/components/timeline';
|
|
11
|
+
|
|
12
|
+
type Child = JSX.Element | string | null | undefined | boolean;
|
|
13
|
+
type Children = Child | Child[];
|
|
14
|
+
interface LightDeskIntrinsicElements {
|
|
15
|
+
button: Props & {
|
|
16
|
+
children?: never;
|
|
17
|
+
onClick?: Events['click'];
|
|
18
|
+
ref?: Ref<Button>;
|
|
19
|
+
};
|
|
20
|
+
group: Props$1 & {
|
|
21
|
+
children?: Children;
|
|
22
|
+
onTitleChanged?: Events$1['title-changed'];
|
|
23
|
+
ref?: Ref<Group>;
|
|
24
|
+
};
|
|
25
|
+
'group-header': {
|
|
26
|
+
children?: Children;
|
|
27
|
+
ref?: Ref<GroupHeader>;
|
|
28
|
+
};
|
|
29
|
+
label: Props$2 & {
|
|
30
|
+
children?: never;
|
|
31
|
+
ref?: Ref<Label>;
|
|
32
|
+
};
|
|
33
|
+
rect: Props$3 & {
|
|
34
|
+
children?: never;
|
|
35
|
+
ref?: Ref<Rect>;
|
|
36
|
+
};
|
|
37
|
+
'slider-button': Props$4 & {
|
|
38
|
+
children?: never;
|
|
39
|
+
onChange?: Events$2['change'];
|
|
40
|
+
ref?: Ref<SliderButton>;
|
|
41
|
+
};
|
|
42
|
+
switch: Props$5 & {
|
|
43
|
+
children?: never;
|
|
44
|
+
onChange?: Events$3['change'];
|
|
45
|
+
ref?: Ref<Switch>;
|
|
46
|
+
};
|
|
47
|
+
tab: TabProps & {
|
|
48
|
+
children?: JSX.Element | string;
|
|
49
|
+
ref?: Ref<Tab>;
|
|
50
|
+
};
|
|
51
|
+
tabs: TabsProps & {
|
|
52
|
+
children?: JSX.Element | JSX.Element[];
|
|
53
|
+
ref?: Ref<Tabs>;
|
|
54
|
+
};
|
|
55
|
+
'text-input': Props$6 & {
|
|
56
|
+
children?: JSX.Element | JSX.Element[];
|
|
57
|
+
onChange?: Events$4['change'];
|
|
58
|
+
ref?: Ref<TextInput>;
|
|
59
|
+
};
|
|
60
|
+
timeline: Props$7 & {
|
|
61
|
+
children?: never;
|
|
62
|
+
ref?: Ref<Timeline>;
|
|
63
|
+
};
|
|
64
|
+
}
|
|
12
65
|
|
|
13
66
|
type HslColor = {
|
|
14
67
|
/**
|
package/dist/colors.d.ts
CHANGED
|
@@ -1,14 +1,67 @@
|
|
|
1
|
-
import React__default from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import '@arcanejs/toolkit/components/
|
|
4
|
-
import '@arcanejs/toolkit/components/
|
|
5
|
-
import '@arcanejs/toolkit/components/
|
|
6
|
-
import '@arcanejs/toolkit/components/
|
|
7
|
-
import '@arcanejs/toolkit/components/
|
|
8
|
-
import '@arcanejs/toolkit/components/
|
|
9
|
-
import '@arcanejs/toolkit/components/
|
|
10
|
-
import '@arcanejs/toolkit/components/
|
|
11
|
-
|
|
1
|
+
import React__default, { Ref } from 'react';
|
|
2
|
+
import { Props as Props$1, Events as Events$1, Group, GroupHeader } from '@arcanejs/toolkit/components/group';
|
|
3
|
+
import { Props, Events, Button } from '@arcanejs/toolkit/components/button';
|
|
4
|
+
import { Props as Props$2, Label } from '@arcanejs/toolkit/components/label';
|
|
5
|
+
import { Props as Props$3, Rect } from '@arcanejs/toolkit/components/rect';
|
|
6
|
+
import { Props as Props$4, Events as Events$2, SliderButton } from '@arcanejs/toolkit/components/slider-button';
|
|
7
|
+
import { Props as Props$5, Events as Events$3, Switch } from '@arcanejs/toolkit/components/switch';
|
|
8
|
+
import { TabProps, Tab, TabsProps, Tabs } from '@arcanejs/toolkit/components/tabs';
|
|
9
|
+
import { Props as Props$6, Events as Events$4, TextInput } from '@arcanejs/toolkit/components/text-input';
|
|
10
|
+
import { Props as Props$7, Timeline } from '@arcanejs/toolkit/components/timeline';
|
|
11
|
+
|
|
12
|
+
type Child = JSX.Element | string | null | undefined | boolean;
|
|
13
|
+
type Children = Child | Child[];
|
|
14
|
+
interface LightDeskIntrinsicElements {
|
|
15
|
+
button: Props & {
|
|
16
|
+
children?: never;
|
|
17
|
+
onClick?: Events['click'];
|
|
18
|
+
ref?: Ref<Button>;
|
|
19
|
+
};
|
|
20
|
+
group: Props$1 & {
|
|
21
|
+
children?: Children;
|
|
22
|
+
onTitleChanged?: Events$1['title-changed'];
|
|
23
|
+
ref?: Ref<Group>;
|
|
24
|
+
};
|
|
25
|
+
'group-header': {
|
|
26
|
+
children?: Children;
|
|
27
|
+
ref?: Ref<GroupHeader>;
|
|
28
|
+
};
|
|
29
|
+
label: Props$2 & {
|
|
30
|
+
children?: never;
|
|
31
|
+
ref?: Ref<Label>;
|
|
32
|
+
};
|
|
33
|
+
rect: Props$3 & {
|
|
34
|
+
children?: never;
|
|
35
|
+
ref?: Ref<Rect>;
|
|
36
|
+
};
|
|
37
|
+
'slider-button': Props$4 & {
|
|
38
|
+
children?: never;
|
|
39
|
+
onChange?: Events$2['change'];
|
|
40
|
+
ref?: Ref<SliderButton>;
|
|
41
|
+
};
|
|
42
|
+
switch: Props$5 & {
|
|
43
|
+
children?: never;
|
|
44
|
+
onChange?: Events$3['change'];
|
|
45
|
+
ref?: Ref<Switch>;
|
|
46
|
+
};
|
|
47
|
+
tab: TabProps & {
|
|
48
|
+
children?: JSX.Element | string;
|
|
49
|
+
ref?: Ref<Tab>;
|
|
50
|
+
};
|
|
51
|
+
tabs: TabsProps & {
|
|
52
|
+
children?: JSX.Element | JSX.Element[];
|
|
53
|
+
ref?: Ref<Tabs>;
|
|
54
|
+
};
|
|
55
|
+
'text-input': Props$6 & {
|
|
56
|
+
children?: JSX.Element | JSX.Element[];
|
|
57
|
+
onChange?: Events$4['change'];
|
|
58
|
+
ref?: Ref<TextInput>;
|
|
59
|
+
};
|
|
60
|
+
timeline: Props$7 & {
|
|
61
|
+
children?: never;
|
|
62
|
+
ref?: Ref<Timeline>;
|
|
63
|
+
};
|
|
64
|
+
}
|
|
12
65
|
|
|
13
66
|
type HslColor = {
|
|
14
67
|
/**
|