@arcanejs/toolkit-frontend 0.8.0 → 0.10.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 +129 -28
- package/dist/{chunk-PTANIWKR.mjs → chunk-2HBLGAG3.mjs} +5 -8
- package/dist/chunk-7P6ASYW6.mjs +9 -0
- package/dist/{chunk-TMN35K5Y.js → chunk-GBYIEWGN.js} +6 -9
- package/dist/{chunk-UHFE2X4V.js → chunk-LXNJPBVT.js} +23 -21
- package/dist/chunk-MLKGABMK.js +9 -0
- package/dist/{chunk-GMPDVDSW.mjs → chunk-TOVGDMHN.mjs} +24 -22
- package/dist/components/core/index.js +4 -3
- package/dist/components/core/index.mjs +3 -2
- package/dist/components/index.d.mts +30 -13
- package/dist/components/index.d.ts +30 -13
- package/dist/components/index.js +437 -615
- package/dist/components/index.mjs +440 -618
- package/dist/styles/base.css +68 -0
- package/dist/styles/core.css +712 -0
- package/dist/styles/index.d.mts +5 -0
- package/dist/styles/index.d.ts +5 -0
- package/dist/styles/index.js +11 -0
- package/dist/styles/index.mjs +11 -0
- package/dist/styles/theme.css +115 -0
- package/dist/styling.d.mts +5 -53
- package/dist/styling.d.ts +5 -53
- package/dist/styling.js +26 -31
- package/dist/styling.mjs +23 -28
- package/dist/types.d.mts +2 -1
- package/dist/types.d.ts +2 -1
- package/dist/util/index.d.mts +6 -3
- package/dist/util/index.d.ts +6 -3
- package/dist/util/index.js +5 -2
- package/dist/util/index.mjs +4 -1
- package/package.json +29 -9
- package/dist/chunk-6XOE7F7U.mjs +0 -216
- package/dist/chunk-ZHJBPEPY.js +0 -216
package/dist/components/index.js
CHANGED
|
@@ -2,28 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkLXNJPBVTjs = require('../chunk-LXNJPBVT.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var _chunkZHJBPEPYjs = require('../chunk-ZHJBPEPY.js');
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
var _chunkTMN35K5Yjs = require('../chunk-TMN35K5Y.js');
|
|
10
|
+
var _chunkGBYIEWGNjs = require('../chunk-GBYIEWGN.js');
|
|
11
|
+
require('../chunk-MLKGABMK.js');
|
|
20
12
|
|
|
21
13
|
// src/components/index.tsx
|
|
22
14
|
var _core = require('@arcanejs/protocol/core');
|
|
23
15
|
|
|
24
16
|
// src/components/button.tsx
|
|
25
17
|
var _react = require('react'); var _react2 = _interopRequireDefault(_react);
|
|
26
|
-
var _styledcomponents = require('styled-components');
|
|
27
18
|
|
|
28
19
|
// src/components/context.ts
|
|
29
20
|
|
|
@@ -37,28 +28,11 @@ var StageContext = _react.createContext.call(void 0,
|
|
|
37
28
|
|
|
38
29
|
// src/components/button.tsx
|
|
39
30
|
var _jsxruntime = require('react/jsx-runtime');
|
|
40
|
-
var TOUCH_INDICATOR_CLASS = "touch-indicator";
|
|
41
|
-
var LOADING_CLASS = "loading";
|
|
42
|
-
var TOUCHING_CLASS = "touching";
|
|
43
|
-
var ERROR_CLASS = "error";
|
|
44
|
-
var ButtonContents = _styledcomponents.styled.div`
|
|
45
|
-
padding: 6px 4px;
|
|
46
|
-
display: flex;
|
|
47
|
-
justify-content: center;
|
|
48
|
-
align-items: center;
|
|
49
|
-
|
|
50
|
-
> * {
|
|
51
|
-
padding: 0;
|
|
52
|
-
}
|
|
53
|
-
`;
|
|
54
|
-
var ButtonLabel = _styledcomponents.styled.span`
|
|
55
|
-
padding: 0 4px;
|
|
56
|
-
`;
|
|
57
31
|
var Button = (props) => {
|
|
58
32
|
const { call } = _react2.default.useContext(StageContext);
|
|
59
33
|
const [localState, setLocalState] = _react2.default.useState(null);
|
|
60
34
|
const state = _nullishCoalesce(localState, () => ( props.info.state));
|
|
61
|
-
const { touching, handlers } =
|
|
35
|
+
const { touching, handlers } = _chunkGBYIEWGNjs.usePressable.call(void 0, async () => {
|
|
62
36
|
try {
|
|
63
37
|
if (!call) return;
|
|
64
38
|
setLocalState({ state: "loading" });
|
|
@@ -76,48 +50,47 @@ var Button = (props) => {
|
|
|
76
50
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
77
51
|
"div",
|
|
78
52
|
{
|
|
79
|
-
className:
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
53
|
+
className: _chunkGBYIEWGNjs.cn.call(void 0,
|
|
54
|
+
`
|
|
55
|
+
relative box-border flex h-arcane-btn cursor-pointer items-center
|
|
56
|
+
justify-center overflow-visible rounded-arcane-btn border
|
|
57
|
+
border-arcane-btn-border bg-arcane-grad-btn text-arcane-btn-text
|
|
58
|
+
shadow-arcane-btn transition-all duration-200 outline-none
|
|
59
|
+
text-shadow-arcane-btn
|
|
60
|
+
hover:bg-arcane-grad-btn-hover
|
|
61
|
+
active:bg-arcane-grad-btn-active active:shadow-arcane-btn-active
|
|
62
|
+
active:duration-50 active:text-shadow-arcane-btn-active
|
|
63
|
+
`,
|
|
64
|
+
(touching || state.state === "pressed" || state.state === "loading") && "bg-arcane-grad-btn-active",
|
|
65
|
+
(touching || state.state === "pressed" || state.state === "loading") && "text-shadow-arcane-btn-active",
|
|
66
|
+
(touching || state.state === "pressed" || state.state === "loading") && "shadow-arcane-btn-active",
|
|
67
|
+
(touching || state.state === "pressed" || state.state === "loading") && "duration-50",
|
|
68
|
+
state.state === "error" && "border-arcane-btn-err text-arcane-btn-err",
|
|
69
|
+
props.className
|
|
84
70
|
),
|
|
85
71
|
...handlers,
|
|
86
72
|
title: state.state === "error" ? state.error : void 0,
|
|
87
73
|
children: [
|
|
88
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
74
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
75
|
+
"div",
|
|
76
|
+
{
|
|
77
|
+
className: _chunkGBYIEWGNjs.cn.call(void 0,
|
|
78
|
+
`
|
|
79
|
+
pointer-events-none absolute -inset-1.5 rounded-md border-2
|
|
80
|
+
border-transparent bg-transparent transition-colors duration-300
|
|
81
|
+
`,
|
|
82
|
+
(touching || state.state === "loading") && "border-arcane-hint bg-arcane-hint-soft duration-0"
|
|
83
|
+
)
|
|
84
|
+
}
|
|
85
|
+
),
|
|
86
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _chunkGBYIEWGNjs.cn.call(void 0, "flex items-center justify-center px-0.5"), children: [
|
|
87
|
+
props.info.icon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLXNJPBVTjs.Icon, { icon: props.info.icon }),
|
|
88
|
+
props.info.text && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: _chunkGBYIEWGNjs.cn.call(void 0, "px-1"), children: props.info.text })
|
|
92
89
|
] })
|
|
93
90
|
]
|
|
94
91
|
}
|
|
95
92
|
);
|
|
96
93
|
};
|
|
97
|
-
var StyledButton = _styledcomponents.styled.call(void 0, Button)`
|
|
98
|
-
${_chunkZHJBPEPYjs.rectButton}
|
|
99
|
-
outline: none;
|
|
100
|
-
height: 30px;
|
|
101
|
-
position: relative;
|
|
102
|
-
overflow: visible;
|
|
103
|
-
|
|
104
|
-
.${TOUCH_INDICATOR_CLASS} {
|
|
105
|
-
${_chunkZHJBPEPYjs.touchIndicatorNormal}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
&.${ERROR_CLASS} {
|
|
109
|
-
color: ${(p) => p.theme.colorRed};
|
|
110
|
-
border-color: ${(p) => p.theme.colorRed};
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
&.${TOUCHING_CLASS}, &.${LOADING_CLASS} {
|
|
114
|
-
${_chunkZHJBPEPYjs.buttonStateNormalActive}
|
|
115
|
-
|
|
116
|
-
.${TOUCH_INDICATOR_CLASS} {
|
|
117
|
-
${_chunkZHJBPEPYjs.touchIndicatorTouching}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
`;
|
|
121
94
|
|
|
122
95
|
// src/components/group.tsx
|
|
123
96
|
|
|
@@ -125,11 +98,9 @@ var StyledButton = _styledcomponents.styled.call(void 0, Button)`
|
|
|
125
98
|
|
|
126
99
|
|
|
127
100
|
|
|
128
|
-
|
|
129
101
|
// src/components/nesting.tsx
|
|
130
102
|
|
|
131
103
|
|
|
132
|
-
|
|
133
104
|
function nextColor(currentColor) {
|
|
134
105
|
switch (currentColor) {
|
|
135
106
|
case "dark":
|
|
@@ -143,104 +114,24 @@ function nextColor(currentColor) {
|
|
|
143
114
|
var LastNestedColor = _react2.default.createContext("dark");
|
|
144
115
|
var NestedContent = ({ className, children }) => {
|
|
145
116
|
const color = _react2.default.useContext(LastNestedColor);
|
|
146
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
117
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
118
|
+
"div",
|
|
119
|
+
{
|
|
120
|
+
className: _chunkGBYIEWGNjs.cn.call(void 0,
|
|
121
|
+
"p-2 shadow-arcane-box-inset",
|
|
122
|
+
color === "dark" && "bg-arcane-bg-dark-1",
|
|
123
|
+
color === "lighter" && "bg-arcane-bg",
|
|
124
|
+
color === "lighterer" && "bg-arcane-bg-light-1",
|
|
125
|
+
className
|
|
126
|
+
),
|
|
127
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, LastNestedColor.Provider, { value: nextColor(color), children })
|
|
128
|
+
}
|
|
129
|
+
);
|
|
147
130
|
};
|
|
148
131
|
NestedContent.displayName = "NestedContent";
|
|
149
|
-
var StyledNestedContent = _styledcomponents.styled.call(void 0, NestedContent)`
|
|
150
|
-
padding: ${(p) => p.theme.sizingPx.spacing / 2}px;
|
|
151
|
-
box-shadow: ${(p) => p.theme.shadows.boxShadowInset};
|
|
152
|
-
|
|
153
|
-
&.color-dark {
|
|
154
|
-
background: ${(p) => p.theme.bgDark1};
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
&.color-lighter {
|
|
158
|
-
background: ${(p) => p.theme.bg};
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
&.color-lighterer {
|
|
162
|
-
background: ${(p) => p.theme.bgLight1};
|
|
163
|
-
}
|
|
164
|
-
`;
|
|
165
132
|
|
|
166
133
|
// src/components/group.tsx
|
|
167
134
|
|
|
168
|
-
var CollapseIcon = _styledcomponents.styled.call(void 0, (0, _chunkUHFE2X4Vjs.Icon))({
|
|
169
|
-
cursor: "pointer"
|
|
170
|
-
});
|
|
171
|
-
var Header = _styledcomponents.styled.div`
|
|
172
|
-
display: flex;
|
|
173
|
-
align-items: center;
|
|
174
|
-
padding: 5px 2px;
|
|
175
|
-
background: ${(p) => p.theme.borderDark};
|
|
176
|
-
border-bottom: 1px solid ${(p) => p.theme.borderDark};
|
|
177
|
-
|
|
178
|
-
&.touching {
|
|
179
|
-
background: ${(p) => p.theme.bgDark1};
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
&.collapsed {
|
|
183
|
-
border-bottom: none;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
> * {
|
|
187
|
-
margin: 0 3px;
|
|
188
|
-
}
|
|
189
|
-
`;
|
|
190
|
-
var Label = _styledcomponents.styled.span`
|
|
191
|
-
display: inline-block;
|
|
192
|
-
border-radius: 3px;
|
|
193
|
-
background: ${(p) => p.theme.bg};
|
|
194
|
-
border: 1px solid ${(p) => p.theme.bgLight1};
|
|
195
|
-
padding: 3px 4px;
|
|
196
|
-
`;
|
|
197
|
-
var Grow = _styledcomponents.styled.span({
|
|
198
|
-
flexGrow: "1"
|
|
199
|
-
});
|
|
200
|
-
var CollapseBar = _styledcomponents.styled.span({
|
|
201
|
-
flexGrow: "1",
|
|
202
|
-
cursor: "pointer",
|
|
203
|
-
height: "30px"
|
|
204
|
-
});
|
|
205
|
-
var GroupChildren = _styledcomponents.styled.div`
|
|
206
|
-
display: flex;
|
|
207
|
-
flex-direction: ${(p) => p.info.direction === "vertical" ? "column" : "row"};
|
|
208
|
-
flex-wrap: ${(p) => p.info.wrap ? "wrap" : "nowrap"};
|
|
209
|
-
${(p) => p.info.direction === "vertical" ? "" : "align-items: center;"}
|
|
210
|
-
|
|
211
|
-
> * {
|
|
212
|
-
margin: ${(p) => p.theme.sizingPx.spacing / 2}px;
|
|
213
|
-
}
|
|
214
|
-
`;
|
|
215
|
-
var EditableTitle = _styledcomponents.styled.span`
|
|
216
|
-
display: flex;
|
|
217
|
-
align-items: center;
|
|
218
|
-
border-radius: 3px;
|
|
219
|
-
cursor: pointer;
|
|
220
|
-
padding: 3px 2px;
|
|
221
|
-
|
|
222
|
-
> * {
|
|
223
|
-
margin: 0 2px;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
> .icon {
|
|
227
|
-
color: ${(p) => p.theme.textMuted};
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
&:hover {
|
|
231
|
-
background: ${(p) => p.theme.bg};
|
|
232
|
-
|
|
233
|
-
> .icon {
|
|
234
|
-
color: ${(p) => p.theme.hint};
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
`;
|
|
238
|
-
var TitleInput = _styledcomponents.styled.input`
|
|
239
|
-
background: none;
|
|
240
|
-
border: none;
|
|
241
|
-
outline: none;
|
|
242
|
-
color: ${(p) => p.theme.textNormal};
|
|
243
|
-
`;
|
|
244
135
|
var GroupStateContext = _react2.default.createContext({
|
|
245
136
|
isCollapsed: () => {
|
|
246
137
|
throw new Error("missing GroupStateContext");
|
|
@@ -274,10 +165,21 @@ var Group = ({ className, info }) => {
|
|
|
274
165
|
const groupState = _react.useContext.call(void 0, GroupStateContext);
|
|
275
166
|
const { renderComponent, sendMessage } = _react.useContext.call(void 0, StageContext);
|
|
276
167
|
const [editingTitle, setEditingTitle] = _react.useState.call(void 0, false);
|
|
277
|
-
const children = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
168
|
+
const children = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
169
|
+
"div",
|
|
170
|
+
{
|
|
171
|
+
className: _chunkGBYIEWGNjs.cn.call(void 0,
|
|
172
|
+
"flex gap-2",
|
|
173
|
+
info.direction === "vertical" && "flex-col",
|
|
174
|
+
info.direction === "horizontal" && "items-center",
|
|
175
|
+
info.wrap ? "flex-wrap" : "flex-nowrap"
|
|
176
|
+
),
|
|
177
|
+
children: info.children.map(renderComponent)
|
|
178
|
+
}
|
|
179
|
+
);
|
|
278
180
|
const collapsible = !!info.defaultCollapsibleState;
|
|
279
181
|
const collapsed = info.defaultCollapsibleState ? groupState.isCollapsed(info.key, info.defaultCollapsibleState) : false;
|
|
280
|
-
const collapsePressable =
|
|
182
|
+
const collapsePressable = _chunkGBYIEWGNjs.usePressable.call(void 0,
|
|
281
183
|
() => groupState.toggleCollapsed(info.key)
|
|
282
184
|
);
|
|
283
185
|
const showTitle = info.title || info.editableTitle;
|
|
@@ -303,101 +205,146 @@ var Group = ({ className, info }) => {
|
|
|
303
205
|
}
|
|
304
206
|
};
|
|
305
207
|
const hasBorder = info.border || displayHeader;
|
|
306
|
-
const childrenElements = hasBorder ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
307
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
208
|
+
const childrenElements = hasBorder ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NestedContent, { children }) : children;
|
|
209
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
210
|
+
"div",
|
|
211
|
+
{
|
|
212
|
+
className: _chunkGBYIEWGNjs.cn.call(void 0,
|
|
213
|
+
hasBorder ? "border border-arcane-btn-border" : "m-0 border-none",
|
|
214
|
+
className
|
|
215
|
+
),
|
|
216
|
+
children: [
|
|
217
|
+
displayHeader ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
218
|
+
"div",
|
|
219
|
+
{
|
|
220
|
+
className: _chunkGBYIEWGNjs.cn.call(void 0,
|
|
221
|
+
`
|
|
222
|
+
flex items-center gap-0.5 border-b border-arcane-btn-border
|
|
223
|
+
bg-arcane-btn-border p-1
|
|
224
|
+
`,
|
|
225
|
+
collapsePressable.touching && "bg-arcane-bg-dark-1",
|
|
226
|
+
collapsible && collapsed && "border-b-0"
|
|
227
|
+
),
|
|
228
|
+
children: [
|
|
229
|
+
collapsible && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
230
|
+
_chunkLXNJPBVTjs.Icon,
|
|
231
|
+
{
|
|
232
|
+
className: _chunkGBYIEWGNjs.cn.call(void 0, "mx-0.5 cursor-pointer"),
|
|
233
|
+
icon: collapsed ? "arrow_right" : "arrow_drop_down",
|
|
234
|
+
...collapsePressable.handlers
|
|
235
|
+
}
|
|
236
|
+
),
|
|
237
|
+
_optionalChain([info, 'access', _7 => _7.labels, 'optionalAccess', _8 => _8.map, 'call', _9 => _9((l, index) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
238
|
+
"span",
|
|
239
|
+
{
|
|
240
|
+
className: _chunkGBYIEWGNjs.cn.call(void 0,
|
|
241
|
+
`
|
|
242
|
+
mx-0.5 inline-block rounded-arcane-btn border
|
|
243
|
+
border-arcane-bg-light-1 bg-arcane-bg px-1 py-0.5
|
|
244
|
+
`
|
|
245
|
+
),
|
|
246
|
+
children: l.text
|
|
247
|
+
},
|
|
248
|
+
`${l.text}-${index}`
|
|
249
|
+
))]),
|
|
250
|
+
showTitle && (info.editableTitle ? editingTitle ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
251
|
+
"input",
|
|
252
|
+
{
|
|
253
|
+
className: _chunkGBYIEWGNjs.cn.call(void 0,
|
|
254
|
+
`
|
|
255
|
+
border-none bg-transparent px-0.5 text-arcane-normal
|
|
256
|
+
text-arcane-text outline-none
|
|
257
|
+
`
|
|
258
|
+
),
|
|
259
|
+
ref: (input) => _optionalChain([input, 'optionalAccess', _10 => _10.focus, 'call', _11 => _11()]),
|
|
260
|
+
onBlur: updateTitle,
|
|
261
|
+
onKeyDown: keyDown,
|
|
262
|
+
defaultValue: info.title
|
|
263
|
+
}
|
|
264
|
+
) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
265
|
+
"span",
|
|
266
|
+
{
|
|
267
|
+
className: _chunkGBYIEWGNjs.cn.call(void 0,
|
|
268
|
+
`
|
|
269
|
+
group flex cursor-pointer items-center gap-0.5
|
|
270
|
+
rounded-arcane-btn px-0.5 text-arcane-normal
|
|
271
|
+
hover:bg-arcane-bg
|
|
272
|
+
`
|
|
273
|
+
),
|
|
274
|
+
onClick: () => setEditingTitle(true),
|
|
275
|
+
children: [
|
|
276
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: info.title }),
|
|
277
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
278
|
+
_chunkLXNJPBVTjs.Icon,
|
|
279
|
+
{
|
|
280
|
+
className: _chunkGBYIEWGNjs.cn.call(void 0,
|
|
281
|
+
`
|
|
282
|
+
text-arcane-text-muted
|
|
283
|
+
group-hover:text-arcane-hint
|
|
284
|
+
`
|
|
285
|
+
),
|
|
286
|
+
icon: "edit"
|
|
287
|
+
}
|
|
288
|
+
)
|
|
289
|
+
]
|
|
290
|
+
}
|
|
291
|
+
) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: info.title })),
|
|
292
|
+
collapsible ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
293
|
+
"span",
|
|
294
|
+
{
|
|
295
|
+
className: _chunkGBYIEWGNjs.cn.call(void 0, "mx-0.5 h-arcane-btn grow cursor-pointer"),
|
|
296
|
+
...collapsePressable.handlers
|
|
297
|
+
}
|
|
298
|
+
) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: _chunkGBYIEWGNjs.cn.call(void 0, "grow") }),
|
|
299
|
+
_optionalChain([info, 'access', _12 => _12.headers, 'optionalAccess', _13 => _13.map, 'call', _14 => _14((h) => h.children.map((c) => renderComponent(c)))])
|
|
300
|
+
]
|
|
301
|
+
}
|
|
302
|
+
) : null,
|
|
303
|
+
collapsible && collapsed ? null : childrenElements
|
|
304
|
+
]
|
|
305
|
+
}
|
|
306
|
+
);
|
|
343
307
|
};
|
|
344
308
|
Group.displayName = "Group";
|
|
345
|
-
var StyledGroup = _styledcomponents.styled.call(void 0, Group)`
|
|
346
|
-
border: 1px solid ${(p) => p.theme.borderDark};
|
|
347
|
-
|
|
348
|
-
> .title {
|
|
349
|
-
padding: 5px;
|
|
350
|
-
background: ${(p) => p.theme.borderDark};
|
|
351
|
-
border-bottom: 1px solid ${(p) => p.theme.borderDark};
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
&.no-border {
|
|
355
|
-
border: none;
|
|
356
|
-
margin: 0 !important;
|
|
357
|
-
}
|
|
358
|
-
`;
|
|
359
309
|
|
|
360
310
|
// src/components/label.tsx
|
|
361
311
|
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
312
|
+
var Label = ({ className, info }) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
313
|
+
"div",
|
|
314
|
+
{
|
|
315
|
+
className: _chunkGBYIEWGNjs.cn.call(void 0,
|
|
316
|
+
"font-normal whitespace-nowrap",
|
|
317
|
+
info.bold && "font-bold",
|
|
318
|
+
className
|
|
319
|
+
),
|
|
320
|
+
children: info.text
|
|
321
|
+
}
|
|
322
|
+
);
|
|
368
323
|
|
|
369
324
|
// src/components/rect.tsx
|
|
370
325
|
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
326
|
+
var Rect = ({ className, info }) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
327
|
+
"div",
|
|
328
|
+
{
|
|
329
|
+
className: _chunkGBYIEWGNjs.cn.call(void 0,
|
|
330
|
+
`
|
|
331
|
+
h-arcane-rect min-w-arcane-rect overflow-hidden rounded-arcane-btn
|
|
332
|
+
border border-arcane-btn-border bg-repeat
|
|
333
|
+
`,
|
|
334
|
+
info.grow && "grow",
|
|
335
|
+
className
|
|
336
|
+
),
|
|
337
|
+
style: {
|
|
338
|
+
backgroundImage: `url('${_chunkLXNJPBVTjs.TRANSPARENCY_SVG_URI}')`,
|
|
339
|
+
backgroundSize: "10px"
|
|
340
|
+
},
|
|
341
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: _chunkGBYIEWGNjs.cn.call(void 0, "size-full"), style: { backgroundColor: info.color } })
|
|
385
342
|
}
|
|
386
|
-
|
|
387
|
-
var Inner = _styledcomponents.styled.div`
|
|
388
|
-
width: 100%;
|
|
389
|
-
height: 100%;
|
|
390
|
-
`;
|
|
391
|
-
var Rect = ({ className, info }) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Wrapper, { className: _chunkTMN35K5Yjs.calculateClass.call(void 0, className, info.grow && CLS_GROW), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Inner, { style: { backgroundColor: info.color } }) });
|
|
343
|
+
);
|
|
392
344
|
|
|
393
345
|
// src/components/slider-button.tsx
|
|
394
346
|
|
|
395
347
|
|
|
396
|
-
|
|
397
|
-
var CLASS_SLIDER_DISPLAY = "slider-display";
|
|
398
|
-
var CLASS_SLIDER_VALUE = "slider-value";
|
|
399
|
-
var CLASS_GRADIENT = "gradient";
|
|
400
|
-
var CLASS_GROW = "grow";
|
|
401
348
|
var OPEN_SLIDER_WIDTH = 400;
|
|
402
349
|
var SLIDER_PADDING = 15;
|
|
403
350
|
var SLIDER_VALUE_WIDTH = 60;
|
|
@@ -488,7 +435,7 @@ var SliderButton = ({ info, className }) => {
|
|
|
488
435
|
touch.pageX
|
|
489
436
|
);
|
|
490
437
|
const start = onDown(cursorPosition);
|
|
491
|
-
|
|
438
|
+
_chunkGBYIEWGNjs.trackTouch.call(void 0,
|
|
492
439
|
touch,
|
|
493
440
|
(p) => {
|
|
494
441
|
const amntDiff = (p.pageX - originalPageX) / OPEN_SLIDER_INNER_WIDTH;
|
|
@@ -525,20 +472,34 @@ var SliderButton = ({ info, className }) => {
|
|
|
525
472
|
const valueCSSPercent = value ? (value - info.min) / (info.max - info.min) * 100 + "%" : "0";
|
|
526
473
|
const gradientStops = info.gradient && info.gradient.map((g) => `${g.color} ${g.position * 100}%`);
|
|
527
474
|
const sliderGradient = gradientStops ? {
|
|
528
|
-
background: `linear-gradient(90deg, ${gradientStops.join(", ")}), url(${
|
|
475
|
+
background: `linear-gradient(90deg, ${gradientStops.join(", ")}), url(${_chunkLXNJPBVTjs.TRANSPARENCY_SVG_URI})`
|
|
529
476
|
} : void 0;
|
|
530
477
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
531
478
|
"div",
|
|
532
479
|
{
|
|
533
|
-
className:
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
480
|
+
className: _chunkGBYIEWGNjs.cn.call(void 0,
|
|
481
|
+
"relative min-h-arcane-btn min-w-arcane-slider-min",
|
|
482
|
+
info.grow && "grow",
|
|
483
|
+
state.state === "touching" && "z-arcane-slider-touching",
|
|
484
|
+
className
|
|
537
485
|
),
|
|
538
486
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
539
487
|
"div",
|
|
540
488
|
{
|
|
541
|
-
className:
|
|
489
|
+
className: _chunkGBYIEWGNjs.cn.call(void 0,
|
|
490
|
+
`
|
|
491
|
+
absolute inset-y-0 left-0 flex w-full cursor-pointer items-center
|
|
492
|
+
rounded-arcane-btn border border-arcane-btn-border
|
|
493
|
+
bg-arcane-grad-btn px-arcane-slider-pad text-arcane-text
|
|
494
|
+
shadow-arcane-btn transition-all duration-200 text-shadow-arcane-btn
|
|
495
|
+
hover:bg-arcane-grad-btn-hover
|
|
496
|
+
`,
|
|
497
|
+
state.state === "mouse-down" && `
|
|
498
|
+
!bg-arcane-grad-btn-active !text-shadow-arcane-btn-active
|
|
499
|
+
!shadow-arcane-btn-active !duration-50
|
|
500
|
+
`,
|
|
501
|
+
state.state === "touching" && "!w-arcane-slider-open !bg-arcane-bg-dark-1"
|
|
502
|
+
),
|
|
542
503
|
onMouseDown: () => setState({ state: "mouse-down" }),
|
|
543
504
|
onMouseUp: () => _optionalChain([input, 'access', _19 => _19.current, 'optionalAccess', _20 => _20.focus, 'call', _21 => _21()]),
|
|
544
505
|
onTouchStart,
|
|
@@ -547,6 +508,19 @@ var SliderButton = ({ info, className }) => {
|
|
|
547
508
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
548
509
|
"input",
|
|
549
510
|
{
|
|
511
|
+
className: _chunkGBYIEWGNjs.cn.call(void 0,
|
|
512
|
+
`
|
|
513
|
+
pointer-events-none -mx-arcane-slider-input-hidden my-0 w-0
|
|
514
|
+
overflow-hidden rounded-arcane-btn border border-arcane-btn-border
|
|
515
|
+
bg-arcane-bg-dark-1 px-arcane-slider-input-px py-0
|
|
516
|
+
text-arcane-text opacity-0 shadow-arcane-box-inset transition-all
|
|
517
|
+
duration-200
|
|
518
|
+
`,
|
|
519
|
+
state.state === "focused" && `
|
|
520
|
+
mx-0 w-3/5
|
|
521
|
+
opacity-100
|
|
522
|
+
`
|
|
523
|
+
),
|
|
550
524
|
type: "text",
|
|
551
525
|
ref: input,
|
|
552
526
|
onFocus,
|
|
@@ -554,158 +528,67 @@ var SliderButton = ({ info, className }) => {
|
|
|
554
528
|
onKeyDown
|
|
555
529
|
}
|
|
556
530
|
),
|
|
557
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: CLASS_SLIDER_VALUE, children: valueDisplay }),
|
|
558
531
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
559
532
|
"div",
|
|
560
533
|
{
|
|
561
|
-
className:
|
|
562
|
-
|
|
563
|
-
|
|
534
|
+
className: _chunkGBYIEWGNjs.cn.call(void 0,
|
|
535
|
+
`
|
|
536
|
+
-mx-arcane-slider-value-hidden w-arcane-slider-value text-center
|
|
537
|
+
leading-arcane-slider-value-hidden opacity-0
|
|
538
|
+
`,
|
|
539
|
+
state.state === "touching" && "mx-arcane-slider-pad opacity-100"
|
|
540
|
+
),
|
|
541
|
+
children: valueDisplay
|
|
542
|
+
}
|
|
543
|
+
),
|
|
544
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
545
|
+
"div",
|
|
546
|
+
{
|
|
547
|
+
className: _chunkGBYIEWGNjs.cn.call(void 0,
|
|
548
|
+
`
|
|
549
|
+
mx-arcane-slider-pad h-arcane-slider-display grow border
|
|
550
|
+
border-arcane-btn-border bg-arcane-bg-dark-1
|
|
551
|
+
`,
|
|
552
|
+
sliderGradient && "h-arcane-slider-gradient-display"
|
|
564
553
|
),
|
|
565
554
|
style: sliderGradient,
|
|
566
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
555
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
556
|
+
"div",
|
|
557
|
+
{
|
|
558
|
+
className: _chunkGBYIEWGNjs.cn.call(void 0,
|
|
559
|
+
`h-full bg-arcane-hint`,
|
|
560
|
+
sliderGradient && `border-arcane-btn-border relative border-r-[2px] bg-transparent`,
|
|
561
|
+
sliderGradient && `before:absolute before:w-[4px] before:-top-[5px] before:-bottom-[5px] before:-right-[3px] before:bg-arcane-btn-border`,
|
|
562
|
+
sliderGradient && `after:absolute after:w-[2px] after:-top-[4px] after:-bottom-[4px] after:-right-[2px] after:bg-arcane-btn-text`
|
|
563
|
+
),
|
|
564
|
+
style: { width: valueCSSPercent }
|
|
565
|
+
}
|
|
566
|
+
)
|
|
567
567
|
}
|
|
568
568
|
),
|
|
569
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
569
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
570
|
+
"div",
|
|
571
|
+
{
|
|
572
|
+
className: _chunkGBYIEWGNjs.cn.call(void 0,
|
|
573
|
+
`
|
|
574
|
+
-mx-arcane-slider-value-hidden w-arcane-slider-value text-center
|
|
575
|
+
leading-arcane-slider-value-hidden opacity-0
|
|
576
|
+
`,
|
|
577
|
+
state.state === "touching" && "mx-arcane-slider-pad opacity-100"
|
|
578
|
+
),
|
|
579
|
+
children: valueDisplay
|
|
580
|
+
}
|
|
581
|
+
)
|
|
570
582
|
]
|
|
571
583
|
}
|
|
572
584
|
)
|
|
573
585
|
}
|
|
574
586
|
);
|
|
575
587
|
};
|
|
576
|
-
var StyledSliderButton = _styledcomponents.styled.call(void 0, SliderButton)`
|
|
577
|
-
position: relative;
|
|
578
|
-
min-width: 100px;
|
|
579
|
-
min-height: 30px;
|
|
580
|
-
|
|
581
|
-
&.${CLASS_GROW} {
|
|
582
|
-
flex-grow: 1;
|
|
583
|
-
}
|
|
584
|
-
|
|
585
|
-
> .inner {
|
|
586
|
-
position: absolute;
|
|
587
|
-
display: flex;
|
|
588
|
-
align-items: center;
|
|
589
|
-
padding: 0 ${SLIDER_PADDING / 2}px;
|
|
590
|
-
left: 0;
|
|
591
|
-
top: 0;
|
|
592
|
-
bottom: 0;
|
|
593
|
-
width: 100%;
|
|
594
|
-
cursor: pointer;
|
|
595
|
-
transition: all 200ms;
|
|
596
|
-
border-radius: 3px;
|
|
597
|
-
border: 1px solid ${(p) => p.theme.borderDark};
|
|
598
|
-
${_chunkZHJBPEPYjs.buttonStateNormal}
|
|
599
|
-
|
|
600
|
-
> input {
|
|
601
|
-
color: ${(p) => p.theme.textNormal};
|
|
602
|
-
opacity: 0;
|
|
603
|
-
margin: 0 -9px;
|
|
604
|
-
padding: 6px 8px;
|
|
605
|
-
width: 0;
|
|
606
|
-
pointer-events: none;
|
|
607
|
-
transition: all 200ms;
|
|
608
|
-
border-radius: 3px;
|
|
609
|
-
background: ${(p) => p.theme.bgDark1};
|
|
610
|
-
border: 1px solid ${(p) => p.theme.borderDark};
|
|
611
|
-
overflow: hidden;
|
|
612
|
-
box-shadow: ${(p) => p.theme.shadows.boxShadowInset};
|
|
613
|
-
}
|
|
614
|
-
|
|
615
|
-
> .${CLASS_SLIDER_DISPLAY} {
|
|
616
|
-
flex-grow: 1;
|
|
617
|
-
margin: 0 ${SLIDER_PADDING / 2}px;
|
|
618
|
-
height: 4px;
|
|
619
|
-
background: ${(p) => p.theme.bgDark1};
|
|
620
|
-
border: 1px solid ${(p) => p.theme.borderDark};
|
|
621
|
-
|
|
622
|
-
> .inner {
|
|
623
|
-
height: 100%;
|
|
624
|
-
background: ${(p) => p.theme.hint};
|
|
625
|
-
}
|
|
626
|
-
|
|
627
|
-
&.${CLASS_GRADIENT} {
|
|
628
|
-
height: 10px;
|
|
629
|
-
|
|
630
|
-
> .inner {
|
|
631
|
-
position: relative;
|
|
632
|
-
background: none;
|
|
633
|
-
border-right: 2px solid ${(p) => p.theme.borderDark};
|
|
634
|
-
|
|
635
|
-
&::before {
|
|
636
|
-
content: '';
|
|
637
|
-
position: absolute;
|
|
638
|
-
width: 4px;
|
|
639
|
-
top: -5px;
|
|
640
|
-
bottom: -5px;
|
|
641
|
-
right: -3px;
|
|
642
|
-
background: ${(p) => p.theme.borderDark};
|
|
643
|
-
}
|
|
644
|
-
|
|
645
|
-
&::after {
|
|
646
|
-
content: '';
|
|
647
|
-
position: absolute;
|
|
648
|
-
width: 2px;
|
|
649
|
-
top: -4px;
|
|
650
|
-
bottom: -4px;
|
|
651
|
-
right: -2px;
|
|
652
|
-
background: ${(p) => p.theme.textNormal};
|
|
653
|
-
}
|
|
654
|
-
}
|
|
655
|
-
}
|
|
656
|
-
}
|
|
657
|
-
|
|
658
|
-
> .${CLASS_SLIDER_VALUE} {
|
|
659
|
-
width: ${SLIDER_VALUE_WIDTH}px;
|
|
660
|
-
margin: 0 -${SLIDER_VALUE_WIDTH / 2}px;
|
|
661
|
-
line-height: 30px;
|
|
662
|
-
text-align: center;
|
|
663
|
-
opacity: 0;
|
|
664
|
-
}
|
|
665
|
-
|
|
666
|
-
&:hover {
|
|
667
|
-
${_chunkZHJBPEPYjs.buttonStateNormalHover}
|
|
668
|
-
}
|
|
669
|
-
}
|
|
670
|
-
|
|
671
|
-
&.state-mouse-down {
|
|
672
|
-
> .inner {
|
|
673
|
-
${_chunkZHJBPEPYjs.buttonPressed}
|
|
674
|
-
}
|
|
675
|
-
}
|
|
676
|
-
|
|
677
|
-
&.state-focused {
|
|
678
|
-
> .inner {
|
|
679
|
-
> input {
|
|
680
|
-
opacity: 1;
|
|
681
|
-
width: 60%;
|
|
682
|
-
padding: 0 5px;
|
|
683
|
-
margin: 0;
|
|
684
|
-
}
|
|
685
|
-
}
|
|
686
|
-
}
|
|
687
|
-
|
|
688
|
-
&.state-touching {
|
|
689
|
-
z-index: 100;
|
|
690
|
-
|
|
691
|
-
.inner {
|
|
692
|
-
background: ${(p) => p.theme.bgDark1};
|
|
693
|
-
width: ${OPEN_SLIDER_WIDTH}px;
|
|
694
|
-
|
|
695
|
-
> .${CLASS_SLIDER_VALUE} {
|
|
696
|
-
opacity: 1;
|
|
697
|
-
margin: 0 ${SLIDER_PADDING / 2}px;
|
|
698
|
-
}
|
|
699
|
-
}
|
|
700
|
-
}
|
|
701
|
-
`;
|
|
702
588
|
|
|
703
589
|
// src/components/switch.tsx
|
|
704
590
|
|
|
705
591
|
|
|
706
|
-
|
|
707
|
-
var CLASS_TOUCHING = "touching";
|
|
708
|
-
var TOUCH_INDICATOR_CLASS2 = "touch-indicator";
|
|
709
592
|
var Switch = ({ className, info }) => {
|
|
710
593
|
const { sendMessage } = _react2.default.useContext(StageContext);
|
|
711
594
|
const [touching, setTouching] = _react.useState.call(void 0, false);
|
|
@@ -738,181 +621,153 @@ var Switch = ({ className, info }) => {
|
|
|
738
621
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
739
622
|
"div",
|
|
740
623
|
{
|
|
741
|
-
className:
|
|
624
|
+
className: _chunkGBYIEWGNjs.cn.call(void 0, "relative", className),
|
|
742
625
|
onClick,
|
|
743
626
|
onTouchStart,
|
|
744
627
|
onTouchEnd,
|
|
745
628
|
children: [
|
|
746
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
629
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
630
|
+
"div",
|
|
631
|
+
{
|
|
632
|
+
className: _chunkGBYIEWGNjs.cn.call(void 0,
|
|
633
|
+
`
|
|
634
|
+
pointer-events-none absolute -inset-arcane-touch-indicator
|
|
635
|
+
rounded-arcane-touch-indicator border-2 border-transparent
|
|
636
|
+
bg-transparent transition-colors duration-300
|
|
637
|
+
`,
|
|
638
|
+
touching && "border-arcane-hint bg-arcane-hint-soft duration-0"
|
|
639
|
+
)
|
|
640
|
+
}
|
|
641
|
+
),
|
|
642
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
643
|
+
"div",
|
|
644
|
+
{
|
|
645
|
+
className: _chunkGBYIEWGNjs.cn.call(void 0,
|
|
646
|
+
`
|
|
647
|
+
relative block h-arcane-switch-knob w-arcane-switch-track
|
|
648
|
+
min-w-arcane-switch-track overflow-hidden rounded-arcane-btn border
|
|
649
|
+
border-arcane-btn-border
|
|
650
|
+
`
|
|
651
|
+
),
|
|
652
|
+
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
653
|
+
"div",
|
|
654
|
+
{
|
|
655
|
+
className: _chunkGBYIEWGNjs.cn.call(void 0,
|
|
656
|
+
`absolute top-0 left-0 cursor-pointer transition-all duration-300`,
|
|
657
|
+
info.state === "on" && "left-arcane-switch-label"
|
|
658
|
+
),
|
|
659
|
+
children: [
|
|
660
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
661
|
+
"div",
|
|
662
|
+
{
|
|
663
|
+
className: _chunkGBYIEWGNjs.cn.call(void 0,
|
|
664
|
+
`
|
|
665
|
+
absolute top-0 -left-arcane-switch-label h-arcane-switch-knob
|
|
666
|
+
w-arcane-switch-label bg-arcane-grad-hint-pressed text-center
|
|
667
|
+
leading-arcane-switch-label shadow-arcane-btn-active
|
|
668
|
+
text-shadow-arcane-btn-active
|
|
669
|
+
`
|
|
670
|
+
),
|
|
671
|
+
children: "ON"
|
|
672
|
+
}
|
|
673
|
+
),
|
|
674
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
675
|
+
"div",
|
|
676
|
+
{
|
|
677
|
+
className: _chunkGBYIEWGNjs.cn.call(void 0,
|
|
678
|
+
`
|
|
679
|
+
absolute top-0 left-arcane-switch-off-left h-arcane-switch-knob
|
|
680
|
+
w-arcane-switch-label bg-arcane-grad-btn-active text-center
|
|
681
|
+
leading-arcane-switch-label shadow-arcane-btn-active
|
|
682
|
+
text-shadow-arcane-btn-active
|
|
683
|
+
`
|
|
684
|
+
),
|
|
685
|
+
children: "OFF"
|
|
686
|
+
}
|
|
687
|
+
),
|
|
688
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
689
|
+
"div",
|
|
690
|
+
{
|
|
691
|
+
className: _chunkGBYIEWGNjs.cn.call(void 0,
|
|
692
|
+
`
|
|
693
|
+
absolute -top-px -left-px size-arcane-btn rounded-arcane-btn
|
|
694
|
+
border border-arcane-btn-border bg-arcane-grad-btn
|
|
695
|
+
shadow-arcane-btn text-shadow-arcane-btn
|
|
696
|
+
hover:bg-arcane-grad-btn-hover
|
|
697
|
+
`
|
|
698
|
+
)
|
|
699
|
+
}
|
|
700
|
+
)
|
|
701
|
+
]
|
|
702
|
+
}
|
|
703
|
+
)
|
|
704
|
+
}
|
|
705
|
+
)
|
|
752
706
|
]
|
|
753
707
|
}
|
|
754
708
|
);
|
|
755
709
|
};
|
|
756
|
-
var SWITCH_HEIGHT = 30;
|
|
757
|
-
var BUTTON_WIDTH = 30;
|
|
758
|
-
var TEXT_WIDTH = 40;
|
|
759
|
-
var StyledSwitch = _styledcomponents.styled.call(void 0, Switch)`
|
|
760
|
-
position: relative;
|
|
761
|
-
|
|
762
|
-
.inner {
|
|
763
|
-
display: block;
|
|
764
|
-
position: relative;
|
|
765
|
-
overflow: hidden;
|
|
766
|
-
width: ${BUTTON_WIDTH + TEXT_WIDTH}px;
|
|
767
|
-
min-width: ${BUTTON_WIDTH + TEXT_WIDTH}px;
|
|
768
|
-
height: ${SWITCH_HEIGHT}px;
|
|
769
|
-
border-radius: 3px;
|
|
770
|
-
border: 1px solid ${(p) => p.theme.borderDark};
|
|
771
|
-
|
|
772
|
-
> .slider {
|
|
773
|
-
position: absolute;
|
|
774
|
-
top: 0;
|
|
775
|
-
left: 0;
|
|
776
|
-
cursor: pointer;
|
|
777
|
-
transition: left 300ms;
|
|
778
|
-
|
|
779
|
-
> .on-text,
|
|
780
|
-
.off-text,
|
|
781
|
-
.button {
|
|
782
|
-
position: absolute;
|
|
783
|
-
height: ${SWITCH_HEIGHT}px;
|
|
784
|
-
}
|
|
785
|
-
|
|
786
|
-
> .on-text,
|
|
787
|
-
.off-text {
|
|
788
|
-
width: ${TEXT_WIDTH}px;
|
|
789
|
-
text-align: center;
|
|
790
|
-
top: 0;
|
|
791
|
-
line-height: ${SWITCH_HEIGHT - 2}px;
|
|
792
|
-
text-shadow: ${(p) => p.theme.shadows.textShadowActive};
|
|
793
|
-
box-shadow:
|
|
794
|
-
inset 0 1px 2px rgba(0, 0, 0, 0.2),
|
|
795
|
-
0 1px 0 0 rgba(255, 255, 255, 0.15);
|
|
796
|
-
}
|
|
797
|
-
|
|
798
|
-
> .on-text {
|
|
799
|
-
left: -40px;
|
|
800
|
-
background: ${(p) => p.theme.gradients.hintPressed};
|
|
801
|
-
}
|
|
802
|
-
|
|
803
|
-
> .button {
|
|
804
|
-
top: -1px;
|
|
805
|
-
left: -1px;
|
|
806
|
-
width: ${BUTTON_WIDTH}px;
|
|
807
|
-
background: ${(p) => p.theme.gradients.button};
|
|
808
|
-
text-shadow: ${(p) => p.theme.shadows.textShadow};
|
|
809
|
-
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
|
|
810
|
-
border-radius: 3px;
|
|
811
|
-
border: 1px solid ${(p) => p.theme.borderDark};
|
|
812
|
-
}
|
|
813
|
-
|
|
814
|
-
> .off-text {
|
|
815
|
-
background: ${(p) => p.theme.gradients.buttonActive};
|
|
816
|
-
left: ${BUTTON_WIDTH - 2}px;
|
|
817
|
-
}
|
|
818
|
-
|
|
819
|
-
&.on {
|
|
820
|
-
left: 40px;
|
|
821
|
-
}
|
|
822
|
-
|
|
823
|
-
&:hover > .button {
|
|
824
|
-
background: ${(p) => p.theme.gradients.buttonHover};
|
|
825
|
-
}
|
|
826
|
-
}
|
|
827
|
-
}
|
|
828
|
-
|
|
829
|
-
.${TOUCH_INDICATOR_CLASS2} {
|
|
830
|
-
${_chunkZHJBPEPYjs.touchIndicatorNormal}
|
|
831
|
-
}
|
|
832
|
-
|
|
833
|
-
&.${CLASS_TOUCHING} {
|
|
834
|
-
.${TOUCH_INDICATOR_CLASS2} {
|
|
835
|
-
${_chunkZHJBPEPYjs.touchIndicatorTouching}
|
|
836
|
-
}
|
|
837
|
-
}
|
|
838
|
-
`;
|
|
839
710
|
|
|
840
711
|
// src/components/tabs.tsx
|
|
841
712
|
|
|
842
713
|
|
|
843
|
-
|
|
844
|
-
var Wrapper2 = _styledcomponents.styled.div`
|
|
845
|
-
display: flex;
|
|
846
|
-
flex-direction: column;
|
|
847
|
-
background: ${(p) => p.theme.borderDark};
|
|
848
|
-
border: 1px solid ${(p) => p.theme.borderDark};
|
|
849
|
-
`;
|
|
850
|
-
var TabList = _styledcomponents.styled.div`
|
|
851
|
-
display: flex;
|
|
852
|
-
flex-direction: row;
|
|
853
|
-
border-bottom: 1px solid ${(p) => p.theme.borderDark};
|
|
854
|
-
`;
|
|
855
|
-
var TabItem = _styledcomponents.styled.div`
|
|
856
|
-
height: ${(p) => p.theme.sizingPx.spacing * 3}px;
|
|
857
|
-
display: flex;
|
|
858
|
-
flex-direction: column;
|
|
859
|
-
justify-content: center;
|
|
860
|
-
padding: 0 ${(p) => p.theme.sizingPx.spacing}px;
|
|
861
|
-
cursor: pointer;
|
|
862
|
-
background: ${(p) => p.theme.bgDark1};
|
|
863
|
-
margin-right: 1px;
|
|
864
|
-
|
|
865
|
-
&:hover,
|
|
866
|
-
&.touching {
|
|
867
|
-
background: ${(p) => p.theme.bgLight1};
|
|
868
|
-
}
|
|
869
|
-
|
|
870
|
-
&.current {
|
|
871
|
-
color: ${(p) => p.theme.hint};
|
|
872
|
-
|
|
873
|
-
&::after {
|
|
874
|
-
content: '';
|
|
875
|
-
border-bottom: 2px solid ${(p) => p.theme.hint};
|
|
876
|
-
display: block;
|
|
877
|
-
margin-top: ${(p) => p.theme.sizingPx.spacing / 2}px;
|
|
878
|
-
}
|
|
879
|
-
}
|
|
880
|
-
`;
|
|
881
714
|
var Tabs = (props) => {
|
|
882
715
|
const { renderComponent } = _react2.default.useContext(StageContext);
|
|
883
716
|
const [touching, setTouching] = _react2.default.useState(null);
|
|
884
717
|
const [currentTab, setCurrentTab] = _react2.default.useState(0);
|
|
885
718
|
const tab = props.info.tabs[currentTab];
|
|
886
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
),
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
719
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
720
|
+
"div",
|
|
721
|
+
{
|
|
722
|
+
className: _chunkGBYIEWGNjs.cn.call(void 0,
|
|
723
|
+
"flex flex-col border border-arcane-btn-border bg-arcane-btn-border"
|
|
724
|
+
),
|
|
725
|
+
children: [
|
|
726
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: _chunkGBYIEWGNjs.cn.call(void 0, "flex flex-row border-b border-arcane-btn-border"), children: props.info.tabs.map((tab2, i) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
727
|
+
"div",
|
|
728
|
+
{
|
|
729
|
+
className: _chunkGBYIEWGNjs.cn.call(void 0,
|
|
730
|
+
`
|
|
731
|
+
relative mr-px flex h-arcane-tabs-item cursor-pointer
|
|
732
|
+
items-center bg-arcane-bg-dark-1 px-arcane
|
|
733
|
+
hover:bg-arcane-bg-light-1
|
|
734
|
+
`,
|
|
735
|
+
touching === i && "bg-arcane-bg-light-1",
|
|
736
|
+
currentTab === i && "text-arcane-hint"
|
|
737
|
+
),
|
|
738
|
+
onClick: () => setCurrentTab(i),
|
|
739
|
+
onTouchStart: (event) => {
|
|
740
|
+
event.preventDefault();
|
|
741
|
+
setTouching(i);
|
|
742
|
+
},
|
|
743
|
+
onTouchEnd: (event) => {
|
|
744
|
+
event.preventDefault();
|
|
745
|
+
setTouching(null);
|
|
746
|
+
setCurrentTab(i);
|
|
747
|
+
},
|
|
748
|
+
children: [
|
|
749
|
+
tab2.name,
|
|
750
|
+
currentTab === i ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
751
|
+
"span",
|
|
752
|
+
{
|
|
753
|
+
className: _chunkGBYIEWGNjs.cn.call(void 0,
|
|
754
|
+
"absolute inset-x-2 bottom-1 h-0.5 bg-arcane-hint"
|
|
755
|
+
)
|
|
756
|
+
}
|
|
757
|
+
) : null
|
|
758
|
+
]
|
|
759
|
+
},
|
|
760
|
+
i
|
|
761
|
+
)) }),
|
|
762
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, NestedContent, { children: _optionalChain([tab, 'optionalAccess', _23 => _23.child]) && renderComponent(tab.child) })
|
|
763
|
+
]
|
|
764
|
+
}
|
|
765
|
+
);
|
|
910
766
|
};
|
|
911
767
|
|
|
912
768
|
// src/components/text-input.tsx
|
|
913
769
|
|
|
914
770
|
|
|
915
|
-
|
|
916
771
|
var TextInput = ({ className, info }) => {
|
|
917
772
|
const { sendMessage } = _react2.default.useContext(StageContext);
|
|
918
773
|
const ref = _react2.default.useRef(null);
|
|
@@ -924,7 +779,14 @@ var TextInput = ({ className, info }) => {
|
|
|
924
779
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
925
780
|
"input",
|
|
926
781
|
{
|
|
927
|
-
className,
|
|
782
|
+
className: _chunkGBYIEWGNjs.cn.call(void 0,
|
|
783
|
+
`
|
|
784
|
+
relative box-border overflow-hidden rounded-arcane-btn border
|
|
785
|
+
border-arcane-btn-border bg-arcane-bg-dark-1 px-1 py-0.5
|
|
786
|
+
text-arcane-text shadow-arcane-box-inset text-shadow-arcane-btn
|
|
787
|
+
`,
|
|
788
|
+
className
|
|
789
|
+
),
|
|
928
790
|
defaultValue: info.value,
|
|
929
791
|
ref,
|
|
930
792
|
onChange: (ev) => _optionalChain([sendMessage, 'optionalCall', _24 => _24({
|
|
@@ -937,67 +799,13 @@ var TextInput = ({ className, info }) => {
|
|
|
937
799
|
}
|
|
938
800
|
);
|
|
939
801
|
};
|
|
940
|
-
var StyledTextInput = _styledcomponents.styled.call(void 0, TextInput)`
|
|
941
|
-
position: relative;
|
|
942
|
-
box-sizing: border-box;
|
|
943
|
-
padding: 6px 8px;
|
|
944
|
-
border-radius: 3px;
|
|
945
|
-
background: ${(p) => p.theme.bgDark1};
|
|
946
|
-
border: 1px solid ${(p) => p.theme.borderDark};
|
|
947
|
-
overflow: hidden;
|
|
948
|
-
box-shadow: ${(p) => p.theme.shadows.boxShadowInset};
|
|
949
|
-
color: ${(p) => p.theme.textNormal};
|
|
950
|
-
text-shadow: ${(p) => p.theme.shadows.textShadow};
|
|
951
|
-
|
|
952
|
-
@media (max-width: 500px) {
|
|
953
|
-
flex-basis: 100%;
|
|
954
|
-
}
|
|
955
|
-
`;
|
|
956
802
|
|
|
957
803
|
// src/components/timeline.tsx
|
|
958
804
|
|
|
959
805
|
|
|
960
|
-
|
|
961
|
-
var Wrapper3 = _styledcomponents.styled.div`
|
|
962
|
-
flex-grow: 1;
|
|
963
|
-
`;
|
|
964
|
-
var Data = _styledcomponents.styled.div`
|
|
965
|
-
display: flex;
|
|
966
|
-
`;
|
|
967
|
-
var Metadata = _styledcomponents.styled.div`
|
|
968
|
-
flex-grow: 1;
|
|
969
|
-
`;
|
|
970
|
-
var SourceData = _styledcomponents.styled.div`
|
|
971
|
-
display: flex;
|
|
972
|
-
flex-direction: column;
|
|
973
|
-
align-items: end;
|
|
974
|
-
justify-content: center;
|
|
975
|
-
`;
|
|
976
|
-
var IndicatorIcon = _styledcomponents.styled.call(void 0, _chunkUHFE2X4Vjs.Icon)`
|
|
977
|
-
font-size: 40px;
|
|
978
|
-
`;
|
|
979
|
-
var Bar = _styledcomponents.styled.div`
|
|
980
|
-
width: 100%;
|
|
981
|
-
height: 10px;
|
|
982
|
-
border: 1px solid ${(p) => p.theme.borderDark};
|
|
983
|
-
background: ${(p) => p.theme.borderDark};
|
|
984
|
-
`;
|
|
985
|
-
var Fill = _styledcomponents.styled.div`
|
|
986
|
-
height: 100%;
|
|
987
|
-
background: ${(p) => p.theme.hint};
|
|
988
|
-
`;
|
|
989
|
-
var Title = _styledcomponents.styled.div`
|
|
990
|
-
font-size: 1.5em;
|
|
991
|
-
font-weight: bold;
|
|
992
|
-
margin-bottom: 0.5em;
|
|
993
|
-
`;
|
|
994
|
-
var Subtitle = _styledcomponents.styled.div`
|
|
995
|
-
font-size: 1em;
|
|
996
|
-
font-weight: bold;
|
|
997
|
-
margin-bottom: 0.5em;
|
|
998
|
-
`;
|
|
999
806
|
var Timeline = (props) => {
|
|
1000
807
|
const { className, info } = props;
|
|
808
|
+
const { timeDifferenceMs } = _react.useContext.call(void 0, StageContext);
|
|
1001
809
|
const frameState = _react2.default.useRef({
|
|
1002
810
|
animationFrame: -1,
|
|
1003
811
|
state: null
|
|
@@ -1011,7 +819,7 @@ var Timeline = (props) => {
|
|
|
1011
819
|
}
|
|
1012
820
|
if (info.state.state === "playing") {
|
|
1013
821
|
setCurrentTimeMillis(
|
|
1014
|
-
(Date.now() - info.state.effectiveStartTime) * info.state.speed
|
|
822
|
+
(Date.now() - (_nullishCoalesce(timeDifferenceMs, () => ( 0))) - info.state.effectiveStartTime) * info.state.speed
|
|
1015
823
|
);
|
|
1016
824
|
frameState.current.animationFrame = window.requestAnimationFrame(
|
|
1017
825
|
recalculateCurrentTimeMillis
|
|
@@ -1024,31 +832,44 @@ var Timeline = (props) => {
|
|
|
1024
832
|
return () => {
|
|
1025
833
|
window.cancelAnimationFrame(frameState.current.animationFrame);
|
|
1026
834
|
};
|
|
1027
|
-
}, [frameState, info.state]);
|
|
1028
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1029
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1030
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1031
|
-
info.title && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1032
|
-
_optionalChain([info, 'access', _25 => _25.subtitles, 'optionalAccess', _26 => _26.map, 'call', _27 => _27((subtitle, k) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
835
|
+
}, [frameState, info.state, timeDifferenceMs]);
|
|
836
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _chunkGBYIEWGNjs.cn.call(void 0, "grow", className), children: [
|
|
837
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _chunkGBYIEWGNjs.cn.call(void 0, "flex"), children: [
|
|
838
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _chunkGBYIEWGNjs.cn.call(void 0, "grow"), children: [
|
|
839
|
+
info.title && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: _chunkGBYIEWGNjs.cn.call(void 0, "mb-2 text-arcane-title font-bold"), children: info.title }),
|
|
840
|
+
_optionalChain([info, 'access', _25 => _25.subtitles, 'optionalAccess', _26 => _26.map, 'call', _27 => _27((subtitle, k) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: _chunkGBYIEWGNjs.cn.call(void 0, "mb-2 text-arcane-subtitle font-bold"), children: subtitle }, k))])
|
|
1033
841
|
] }),
|
|
1034
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
842
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _chunkGBYIEWGNjs.cn.call(void 0, "flex flex-col items-end justify-center"), children: [
|
|
1035
843
|
_optionalChain([info, 'access', _28 => _28.source, 'optionalAccess', _29 => _29.name]),
|
|
1036
844
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1037
|
-
|
|
845
|
+
_chunkLXNJPBVTjs.Icon,
|
|
1038
846
|
{
|
|
847
|
+
className: _chunkGBYIEWGNjs.cn.call(void 0, "text-arcane-timeline-indicator"),
|
|
1039
848
|
icon: info.state.state === "playing" ? "play_arrow" : "pause"
|
|
1040
849
|
}
|
|
1041
850
|
)
|
|
1042
851
|
] })
|
|
1043
852
|
] }),
|
|
1044
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1045
|
-
|
|
853
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
854
|
+
"div",
|
|
1046
855
|
{
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
856
|
+
className: _chunkGBYIEWGNjs.cn.call(void 0,
|
|
857
|
+
`
|
|
858
|
+
h-arcane-timeline-bar w-full border border-arcane-btn-border
|
|
859
|
+
bg-arcane-btn-border
|
|
860
|
+
`
|
|
861
|
+
),
|
|
862
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
863
|
+
"div",
|
|
864
|
+
{
|
|
865
|
+
className: _chunkGBYIEWGNjs.cn.call(void 0, "h-full bg-arcane-hint"),
|
|
866
|
+
style: {
|
|
867
|
+
width: `${Math.min(100, 100 * currentTimeMillis / info.state.totalTimeMillis)}%`
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
)
|
|
1050
871
|
}
|
|
1051
|
-
)
|
|
872
|
+
)
|
|
1052
873
|
] });
|
|
1053
874
|
};
|
|
1054
875
|
|
|
@@ -1062,23 +883,24 @@ var CORE_FRONTEND_COMPONENT_RENDERER = {
|
|
|
1062
883
|
}
|
|
1063
884
|
switch (info.component) {
|
|
1064
885
|
case "button":
|
|
1065
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
886
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Button, { info }, info.key);
|
|
1066
887
|
case "group":
|
|
1067
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
888
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Group, { info }, info.key);
|
|
1068
889
|
case "label":
|
|
1069
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
890
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Label, { info }, info.key);
|
|
1070
891
|
case "rect":
|
|
1071
892
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Rect, { info }, info.key);
|
|
1072
893
|
case "slider_button":
|
|
1073
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
894
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, SliderButton, { info }, info.key);
|
|
1074
895
|
case "switch":
|
|
1075
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
896
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Switch, { info }, info.key);
|
|
1076
897
|
case "tabs":
|
|
1077
898
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Tabs, { info }, info.key);
|
|
1078
899
|
case "text-input":
|
|
1079
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
900
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TextInput, { info }, info.key);
|
|
1080
901
|
case "timeline":
|
|
1081
902
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Timeline, { info }, info.key);
|
|
903
|
+
// Parent-Specific Components
|
|
1082
904
|
case "group-header":
|
|
1083
905
|
case "tab":
|
|
1084
906
|
throw new Error(
|
|
@@ -1102,4 +924,4 @@ var CORE_FRONTEND_COMPONENT_RENDERER = {
|
|
|
1102
924
|
|
|
1103
925
|
|
|
1104
926
|
|
|
1105
|
-
exports.Button =
|
|
927
|
+
exports.Button = Button; exports.CORE_FRONTEND_COMPONENT_RENDERER = CORE_FRONTEND_COMPONENT_RENDERER; exports.Group = Group; exports.GroupStateWrapper = GroupStateWrapper; exports.Label = Label; exports.NestedContent = NestedContent; exports.Rect = Rect; exports.SliderButton = SliderButton; exports.StageContext = StageContext; exports.Switch = Switch; exports.Tabs = Tabs; exports.TextInput = TextInput; exports.Timeline = Timeline; exports.code = _chunkLXNJPBVTjs.core_exports;
|