@arcanejs/toolkit-frontend 0.9.0 → 0.11.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-7P6ASYW6.mjs +9 -0
- package/dist/{chunk-UHFE2X4V.js → chunk-BBUHASWZ.js} +23 -21
- package/dist/{chunk-GMPDVDSW.mjs → chunk-DK4BAXVE.mjs} +24 -22
- package/dist/chunk-MLKGABMK.js +9 -0
- package/dist/{chunk-TMN35K5Y.js → chunk-R7E6SIN6.js} +45 -10
- package/dist/{chunk-PTANIWKR.mjs → chunk-SNIL7DDI.mjs} +45 -10
- package/dist/components/core/index.js +4 -3
- package/dist/components/core/index.mjs +3 -2
- package/dist/components/index.d.mts +18 -12
- package/dist/components/index.d.ts +18 -12
- 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 +21 -4
- package/dist/util/index.d.ts +21 -4
- package/dist/util/index.js +7 -2
- package/dist/util/index.mjs +6 -1
- package/package.json +29 -9
- package/dist/chunk-6XOE7F7U.mjs +0 -216
- package/dist/chunk-ZHJBPEPY.js +0 -216
package/README.md
CHANGED
|
@@ -1,43 +1,144 @@
|
|
|
1
|
-
# `@arcanejs/
|
|
1
|
+
# `@arcanejs/toolkit-frontend`
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/@arcanejs/toolkit-frontend)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Browser-side renderer components and stage utilities for ArcaneJS.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- Update objects by applying diffs
|
|
7
|
+
This package is used by `@arcanejs/toolkit`'s default frontend bundle, and can also be used directly when building custom frontend entrypoints for custom component namespaces.
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
and produces diffs that are type-safe,
|
|
12
|
-
and can only be applied to objects that match the type
|
|
13
|
-
of the objects being compared.
|
|
9
|
+
## Install
|
|
14
10
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
```bash
|
|
12
|
+
npm install @arcanejs/toolkit-frontend
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Peer ecosystem typically used with this package:
|
|
16
|
+
|
|
17
|
+
- `react@^19.2.0`
|
|
18
|
+
- `react-dom@^19.2.0`
|
|
19
|
+
- `@arcanejs/protocol`
|
|
20
|
+
|
|
21
|
+
## What It Provides
|
|
22
|
+
|
|
23
|
+
- Core frontend renderer: `CORE_FRONTEND_COMPONENT_RENDERER`
|
|
24
|
+
- Core UI components (`Button`, `Group`, `Switch`, `Tabs`, etc.)
|
|
25
|
+
- Stage context and connection state (`StageContext`)
|
|
26
|
+
- Theme root wrapper (`ThemeRoot`)
|
|
27
|
+
- Touch/mouse interaction helpers (`usePressable`, `trackTouch`, `initialiseListeners`)
|
|
28
|
+
- Precompiled core component stylesheet (`@arcanejs/toolkit-frontend/styles/core.css`)
|
|
29
|
+
- Default theme variables stylesheet (`@arcanejs/toolkit-frontend/styles/theme.css`)
|
|
30
|
+
- Tailwind base stylesheet for custom utility generation (`@arcanejs/toolkit-frontend/styles/base.css`)
|
|
31
|
+
|
|
32
|
+
## Public Exports
|
|
33
|
+
|
|
34
|
+
### `@arcanejs/toolkit-frontend`
|
|
35
|
+
|
|
36
|
+
- `CORE_FRONTEND_COMPONENT_RENDERER`
|
|
37
|
+
- Component exports: `Button`, `Group`, `GroupStateWrapper`, `Label`, `NestedContent`, `Rect`, `SliderButton`, `Switch`, `Tabs`, `TextInput`, `Timeline`
|
|
38
|
+
- `StageContext`
|
|
39
|
+
- Types: `StageContextData`, `StageConnectionState`
|
|
40
|
+
- `code` namespace re-export (`core` helpers such as `Icon`, transparency SVG constants)
|
|
41
|
+
|
|
42
|
+
### `@arcanejs/toolkit-frontend/components/core`
|
|
43
|
+
|
|
44
|
+
- `Icon`
|
|
45
|
+
- `TRANSPARENCY_SVG`
|
|
46
|
+
- `TRANSPARENCY_SVG_URI`
|
|
47
|
+
|
|
48
|
+
### `@arcanejs/toolkit-frontend/styling`
|
|
49
|
+
|
|
50
|
+
- `ThemeRoot`
|
|
51
|
+
|
|
52
|
+
### `@arcanejs/toolkit-frontend/styles`
|
|
53
|
+
|
|
54
|
+
- `CORE_STYLE_PATH`
|
|
55
|
+
- `THEME_STYLE_PATH`
|
|
56
|
+
- `BASE_STYLE_PATH`
|
|
57
|
+
|
|
58
|
+
### `@arcanejs/toolkit-frontend/styles/core.css`
|
|
59
|
+
|
|
60
|
+
- Tailwind-generated core Arcane component classes and shared global rules
|
|
61
|
+
- Excludes default theme variable values
|
|
62
|
+
|
|
63
|
+
### `@arcanejs/toolkit-frontend/styles/theme.css`
|
|
64
|
+
|
|
65
|
+
- Default Arcane theme variable values (`.arcane-theme-root`, dark mode, and `prefers-color-scheme` behavior)
|
|
66
|
+
|
|
67
|
+
### `@arcanejs/toolkit-frontend/styles/base.css`
|
|
19
68
|
|
|
20
|
-
|
|
69
|
+
- Tailwind source stylesheet for custom builds
|
|
70
|
+
- Provides Arcane `@theme` token mappings and Tailwind utility generation entrypoint for custom component classes
|
|
21
71
|
|
|
22
|
-
|
|
23
|
-
import { diffJson, Diff } from '@arcanejs/diff/diff';
|
|
24
|
-
import { patchJson } from '@arcanejs/diff/patch';
|
|
72
|
+
### `@arcanejs/toolkit-frontend/types`
|
|
25
73
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
bar?: number[];
|
|
29
|
-
};
|
|
74
|
+
- `FrontendComponentRenderer`
|
|
75
|
+
- `FrontendComponentRenderers`
|
|
30
76
|
|
|
31
|
-
|
|
32
|
-
const b: E = { foo: 'baz', bar: [1] };
|
|
77
|
+
### `@arcanejs/toolkit-frontend/util`
|
|
33
78
|
|
|
34
|
-
|
|
79
|
+
- `calculateClass`
|
|
80
|
+
- touch helpers: `initialiseListeners`, `usePressable`, `trackTouch`, etc.
|
|
81
|
+
- theme preference hooks: `useColorSchemePreferences`, `usePreferredColorScheme`
|
|
82
|
+
- `VALID_COLOR_SCHEME_PREFS`
|
|
35
83
|
|
|
36
|
-
|
|
84
|
+
## Typical Usage
|
|
37
85
|
|
|
38
|
-
|
|
86
|
+
In most apps you will not call this package directly; `@arcanejs/toolkit` serves a prebuilt frontend entrypoint.
|
|
39
87
|
|
|
40
|
-
|
|
88
|
+
Use this package directly when you provide your own frontend bundle for custom namespaces:
|
|
41
89
|
|
|
42
|
-
|
|
90
|
+
```tsx
|
|
91
|
+
import '@arcanejs/toolkit-frontend/styles/core.css';
|
|
92
|
+
import '@arcanejs/toolkit-frontend/styles/theme.css';
|
|
93
|
+
import { startArcaneFrontend } from '@arcanejs/toolkit/frontend';
|
|
94
|
+
import { CORE_FRONTEND_COMPONENT_RENDERER } from '@arcanejs/toolkit-frontend';
|
|
95
|
+
|
|
96
|
+
startArcaneFrontend({
|
|
97
|
+
renderers: [CORE_FRONTEND_COMPONENT_RENDERER, customRenderer],
|
|
98
|
+
});
|
|
43
99
|
```
|
|
100
|
+
|
|
101
|
+
For default core frontend styling, import both:
|
|
102
|
+
|
|
103
|
+
- `@arcanejs/toolkit-frontend/styles/core.css`
|
|
104
|
+
- `@arcanejs/toolkit-frontend/styles/theme.css`
|
|
105
|
+
|
|
106
|
+
If you compile your own stylesheet with Tailwind (for example to generate utilities used by custom component `className`s), import `@arcanejs/toolkit-frontend/styles/base.css` in your Tailwind input file.
|
|
107
|
+
|
|
108
|
+
Common CSS import combinations:
|
|
109
|
+
|
|
110
|
+
- Core components + default theme: `core.css` + `theme.css`
|
|
111
|
+
- Core components + custom theme: `core.css` (plus your own theme variable overrides)
|
|
112
|
+
- Custom components (Tailwind) + default theme: `base.css` + `theme.css`
|
|
113
|
+
- Core components + custom components (Tailwind) + default theme: `core.css` + `base.css` + `theme.css`
|
|
114
|
+
|
|
115
|
+
`startArcaneFrontend` supports:
|
|
116
|
+
|
|
117
|
+
- `themeRootProps?: React.HTMLAttributes<HTMLDivElement>`: props for the root theme container.
|
|
118
|
+
|
|
119
|
+
Theme switching is class-based (`theme-auto`, `theme-dark`, `theme-light`) and managed internally from `useColorSchemePreferences`; theme customization should be done in CSS by overriding Arcane variables on `.arcane-theme-root` for those classes.
|
|
120
|
+
|
|
121
|
+
## Stage Context
|
|
122
|
+
|
|
123
|
+
`StageContext` provides browser-side runtime hooks for custom renderers:
|
|
124
|
+
|
|
125
|
+
- `sendMessage(...)`: fire-and-forget component messages
|
|
126
|
+
- `call(...)`: request/response component calls
|
|
127
|
+
- `renderComponent(...)`: render nested protocol components
|
|
128
|
+
- `connection`, `connectionUuid`, `reconnect()`
|
|
129
|
+
- `timeDifferenceMs`: estimated `browserTime - serverTime` in milliseconds (only when toolkit clock sync is enabled)
|
|
130
|
+
- `lastPingMs`: latest ping round-trip time in milliseconds
|
|
131
|
+
|
|
132
|
+
## When To Use This Package
|
|
133
|
+
|
|
134
|
+
Use `@arcanejs/toolkit-frontend` if you are:
|
|
135
|
+
|
|
136
|
+
- creating custom frontend renderers for non-core namespaces
|
|
137
|
+
- customizing ArcaneJS theme/styling behavior
|
|
138
|
+
- implementing browser-side interaction behavior integrated with Arcane stage context
|
|
139
|
+
|
|
140
|
+
If you only need server-side panel composition, use `@arcanejs/react-toolkit` and the default toolkit frontend.
|
|
141
|
+
|
|
142
|
+
## Example
|
|
143
|
+
|
|
144
|
+
- Custom frontend entrypoint example: <https://github.com/ArcaneWizards/arcanejs/blob/main/examples/custom-components/src/frontend.tsx>
|
|
@@ -1,37 +1,39 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
+
var _chunkR7E6SIN6js = require('./chunk-R7E6SIN6.js');
|
|
3
4
|
|
|
4
|
-
|
|
5
|
+
|
|
6
|
+
var _chunkMLKGABMKjs = require('./chunk-MLKGABMK.js');
|
|
5
7
|
|
|
6
8
|
// src/components/core/index.ts
|
|
7
9
|
var core_exports = {};
|
|
8
|
-
|
|
10
|
+
_chunkMLKGABMKjs.__export.call(void 0, core_exports, {
|
|
9
11
|
Icon: () => Icon,
|
|
10
12
|
TRANSPARENCY_SVG: () => TRANSPARENCY_SVG,
|
|
11
13
|
TRANSPARENCY_SVG_URI: () => TRANSPARENCY_SVG_URI
|
|
12
14
|
});
|
|
13
15
|
|
|
14
16
|
// src/components/core/icon.tsx
|
|
15
|
-
var _styledcomponents = require('styled-components');
|
|
16
17
|
var _jsxruntime = require('react/jsx-runtime');
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
18
|
+
var Icon = ({
|
|
19
|
+
icon,
|
|
20
|
+
className,
|
|
21
|
+
...props
|
|
22
|
+
}) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
23
|
+
"span",
|
|
24
|
+
{
|
|
25
|
+
className: _chunkR7E6SIN6js.cn.call(void 0,
|
|
26
|
+
`
|
|
27
|
+
inline-block text-arcane-icon leading-none font-normal tracking-normal
|
|
28
|
+
whitespace-nowrap
|
|
29
|
+
`,
|
|
30
|
+
"font-arcane-icon",
|
|
31
|
+
className
|
|
32
|
+
),
|
|
33
|
+
...props,
|
|
34
|
+
children: icon
|
|
35
|
+
}
|
|
36
|
+
);
|
|
35
37
|
|
|
36
38
|
// src/components/core/index.ts
|
|
37
39
|
var TRANSPARENCY_SVG = `
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
cn
|
|
3
|
+
} from "./chunk-SNIL7DDI.mjs";
|
|
4
|
+
import {
|
|
5
|
+
__export
|
|
6
|
+
} from "./chunk-7P6ASYW6.mjs";
|
|
5
7
|
|
|
6
8
|
// src/components/core/index.ts
|
|
7
9
|
var core_exports = {};
|
|
@@ -12,26 +14,26 @@ __export(core_exports, {
|
|
|
12
14
|
});
|
|
13
15
|
|
|
14
16
|
// src/components/core/icon.tsx
|
|
15
|
-
import { styled } from "styled-components";
|
|
16
17
|
import { jsx } from "react/jsx-runtime";
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
18
|
+
var Icon = ({
|
|
19
|
+
icon,
|
|
20
|
+
className,
|
|
21
|
+
...props
|
|
22
|
+
}) => /* @__PURE__ */ jsx(
|
|
23
|
+
"span",
|
|
24
|
+
{
|
|
25
|
+
className: cn(
|
|
26
|
+
`
|
|
27
|
+
inline-block text-arcane-icon leading-none font-normal tracking-normal
|
|
28
|
+
whitespace-nowrap
|
|
29
|
+
`,
|
|
30
|
+
"font-arcane-icon",
|
|
31
|
+
className
|
|
32
|
+
),
|
|
33
|
+
...props,
|
|
34
|
+
children: icon
|
|
35
|
+
}
|
|
36
|
+
);
|
|
35
37
|
|
|
36
38
|
// src/components/core/index.ts
|
|
37
39
|
var TRANSPARENCY_SVG = `
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var __defProp = Object.defineProperty;
|
|
2
|
+
var __export = (target, all) => {
|
|
3
|
+
for (var name in all)
|
|
4
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports.__export = __export;
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true})
|
|
2
|
-
var __export = (target, all) => {
|
|
3
|
-
for (var name in all)
|
|
4
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
// src/util/index.ts
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/util/index.ts
|
|
8
2
|
var _react = require('react');
|
|
3
|
+
var _clsx = require('clsx');
|
|
4
|
+
var _tailwindmerge = require('tailwind-merge');
|
|
9
5
|
|
|
10
6
|
// src/util/touch.ts
|
|
11
7
|
|
|
@@ -41,12 +37,49 @@ var usePressable = (click) => {
|
|
|
41
37
|
if (touching) {
|
|
42
38
|
event.preventDefault();
|
|
43
39
|
setTouching(false);
|
|
44
|
-
click();
|
|
40
|
+
click(event);
|
|
45
41
|
}
|
|
46
42
|
}
|
|
47
43
|
}
|
|
48
44
|
};
|
|
49
45
|
};
|
|
46
|
+
var useLongPressable = ({
|
|
47
|
+
onPress,
|
|
48
|
+
onRelease
|
|
49
|
+
}) => {
|
|
50
|
+
const [touching, setTouching] = _react.useState.call(void 0, false);
|
|
51
|
+
return _react.useMemo.call(void 0,
|
|
52
|
+
() => ({
|
|
53
|
+
touching,
|
|
54
|
+
handlers: {
|
|
55
|
+
onTouchStart: (e) => {
|
|
56
|
+
setTouching(true);
|
|
57
|
+
onPress(e);
|
|
58
|
+
},
|
|
59
|
+
onMouseDown: (e) => {
|
|
60
|
+
setTouching(true);
|
|
61
|
+
onPress(e);
|
|
62
|
+
},
|
|
63
|
+
onMouseUp: (e) => {
|
|
64
|
+
setTouching(false);
|
|
65
|
+
onRelease(e);
|
|
66
|
+
},
|
|
67
|
+
onTouchMove: (e) => {
|
|
68
|
+
setTouching(false);
|
|
69
|
+
onRelease(e);
|
|
70
|
+
},
|
|
71
|
+
onTouchEnd: (event) => {
|
|
72
|
+
if (touching) {
|
|
73
|
+
event.preventDefault();
|
|
74
|
+
setTouching(false);
|
|
75
|
+
onRelease(event);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}),
|
|
80
|
+
[touching, onRelease, onPress]
|
|
81
|
+
);
|
|
82
|
+
};
|
|
50
83
|
function trackTouch(touch, move, end) {
|
|
51
84
|
const touchMove = (ev) => {
|
|
52
85
|
ev.preventDefault();
|
|
@@ -72,7 +105,8 @@ function trackTouch(touch, move, end) {
|
|
|
72
105
|
}
|
|
73
106
|
|
|
74
107
|
// src/util/index.ts
|
|
75
|
-
var
|
|
108
|
+
var cn = (...args) => _tailwindmerge.twMerge.call(void 0, _clsx.clsx.call(void 0, args));
|
|
109
|
+
var calculateClass = cn;
|
|
76
110
|
var COLOR_SCHEME_SETTINGS = "arcane-color-scheme-preference";
|
|
77
111
|
var VALID_COLOR_SCHEME_PREFS = ["auto", "dark", "light"];
|
|
78
112
|
var isValidColorSchemePreference = (value) => {
|
|
@@ -152,4 +186,5 @@ var usePreferredColorScheme = () => {
|
|
|
152
186
|
|
|
153
187
|
|
|
154
188
|
|
|
155
|
-
|
|
189
|
+
|
|
190
|
+
exports.switchToMouseMode = switchToMouseMode; exports.switchToTouchMode = switchToTouchMode; exports.initialiseListeners = initialiseListeners; exports.usePressable = usePressable; exports.useLongPressable = useLongPressable; exports.trackTouch = trackTouch; exports.cn = cn; exports.calculateClass = calculateClass; exports.VALID_COLOR_SCHEME_PREFS = VALID_COLOR_SCHEME_PREFS; exports.useColorSchemePreferences = useColorSchemePreferences; exports.usePreferredColorScheme = usePreferredColorScheme;
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __export = (target, all) => {
|
|
3
|
-
for (var name in all)
|
|
4
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
5
|
-
};
|
|
6
|
-
|
|
7
1
|
// src/util/index.ts
|
|
8
2
|
import { useEffect, useState as useState2 } from "react";
|
|
3
|
+
import { clsx } from "clsx";
|
|
4
|
+
import { twMerge } from "tailwind-merge";
|
|
9
5
|
|
|
10
6
|
// src/util/touch.ts
|
|
11
|
-
import { useState } from "react";
|
|
7
|
+
import { useMemo, useState } from "react";
|
|
12
8
|
function switchToMouseMode(ev) {
|
|
13
9
|
if (ev.movementX === 0 && ev.movementY === 0) return;
|
|
14
10
|
document.body.classList.remove("touch-mode");
|
|
@@ -41,12 +37,49 @@ var usePressable = (click) => {
|
|
|
41
37
|
if (touching) {
|
|
42
38
|
event.preventDefault();
|
|
43
39
|
setTouching(false);
|
|
44
|
-
click();
|
|
40
|
+
click(event);
|
|
45
41
|
}
|
|
46
42
|
}
|
|
47
43
|
}
|
|
48
44
|
};
|
|
49
45
|
};
|
|
46
|
+
var useLongPressable = ({
|
|
47
|
+
onPress,
|
|
48
|
+
onRelease
|
|
49
|
+
}) => {
|
|
50
|
+
const [touching, setTouching] = useState(false);
|
|
51
|
+
return useMemo(
|
|
52
|
+
() => ({
|
|
53
|
+
touching,
|
|
54
|
+
handlers: {
|
|
55
|
+
onTouchStart: (e) => {
|
|
56
|
+
setTouching(true);
|
|
57
|
+
onPress(e);
|
|
58
|
+
},
|
|
59
|
+
onMouseDown: (e) => {
|
|
60
|
+
setTouching(true);
|
|
61
|
+
onPress(e);
|
|
62
|
+
},
|
|
63
|
+
onMouseUp: (e) => {
|
|
64
|
+
setTouching(false);
|
|
65
|
+
onRelease(e);
|
|
66
|
+
},
|
|
67
|
+
onTouchMove: (e) => {
|
|
68
|
+
setTouching(false);
|
|
69
|
+
onRelease(e);
|
|
70
|
+
},
|
|
71
|
+
onTouchEnd: (event) => {
|
|
72
|
+
if (touching) {
|
|
73
|
+
event.preventDefault();
|
|
74
|
+
setTouching(false);
|
|
75
|
+
onRelease(event);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}),
|
|
80
|
+
[touching, onRelease, onPress]
|
|
81
|
+
);
|
|
82
|
+
};
|
|
50
83
|
function trackTouch(touch, move, end) {
|
|
51
84
|
const touchMove = (ev) => {
|
|
52
85
|
ev.preventDefault();
|
|
@@ -72,7 +105,8 @@ function trackTouch(touch, move, end) {
|
|
|
72
105
|
}
|
|
73
106
|
|
|
74
107
|
// src/util/index.ts
|
|
75
|
-
var
|
|
108
|
+
var cn = (...args) => twMerge(clsx(args));
|
|
109
|
+
var calculateClass = cn;
|
|
76
110
|
var COLOR_SCHEME_SETTINGS = "arcane-color-scheme-preference";
|
|
77
111
|
var VALID_COLOR_SCHEME_PREFS = ["auto", "dark", "light"];
|
|
78
112
|
var isValidColorSchemePreference = (value) => {
|
|
@@ -142,12 +176,13 @@ var usePreferredColorScheme = () => {
|
|
|
142
176
|
};
|
|
143
177
|
|
|
144
178
|
export {
|
|
145
|
-
__export,
|
|
146
179
|
switchToMouseMode,
|
|
147
180
|
switchToTouchMode,
|
|
148
181
|
initialiseListeners,
|
|
149
182
|
usePressable,
|
|
183
|
+
useLongPressable,
|
|
150
184
|
trackTouch,
|
|
185
|
+
cn,
|
|
151
186
|
calculateClass,
|
|
152
187
|
VALID_COLOR_SCHEME_PREFS,
|
|
153
188
|
useColorSchemePreferences,
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
require('../../chunk-
|
|
5
|
+
var _chunkBBUHASWZjs = require('../../chunk-BBUHASWZ.js');
|
|
6
|
+
require('../../chunk-R7E6SIN6.js');
|
|
7
|
+
require('../../chunk-MLKGABMK.js');
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
|
|
11
|
-
exports.Icon =
|
|
12
|
+
exports.Icon = _chunkBBUHASWZjs.Icon; exports.TRANSPARENCY_SVG = _chunkBBUHASWZjs.TRANSPARENCY_SVG; exports.TRANSPARENCY_SVG_URI = _chunkBBUHASWZjs.TRANSPARENCY_SVG_URI;
|
|
@@ -2,8 +2,9 @@ import {
|
|
|
2
2
|
Icon,
|
|
3
3
|
TRANSPARENCY_SVG,
|
|
4
4
|
TRANSPARENCY_SVG_URI
|
|
5
|
-
} from "../../chunk-
|
|
6
|
-
import "../../chunk-
|
|
5
|
+
} from "../../chunk-DK4BAXVE.mjs";
|
|
6
|
+
import "../../chunk-SNIL7DDI.mjs";
|
|
7
|
+
import "../../chunk-7P6ASYW6.mjs";
|
|
7
8
|
export {
|
|
8
9
|
Icon,
|
|
9
10
|
TRANSPARENCY_SVG,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { i as code } from '../index-Db4cPoyC.mjs';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import React__default, { FC } from 'react';
|
|
3
|
+
import React__default, { FC, ReactElement, ReactNode } from 'react';
|
|
4
4
|
import * as proto from '@arcanejs/protocol/core';
|
|
5
5
|
import * as proto$1 from '@arcanejs/protocol';
|
|
6
6
|
import { FrontendComponentRenderer } from '../types.mjs';
|
|
@@ -9,7 +9,7 @@ interface Props$8 {
|
|
|
9
9
|
className?: string;
|
|
10
10
|
info: proto.ButtonComponent;
|
|
11
11
|
}
|
|
12
|
-
declare const
|
|
12
|
+
declare const Button: FC<Props$8>;
|
|
13
13
|
|
|
14
14
|
type StageConnectionState = {
|
|
15
15
|
state: 'connecting' | 'closed';
|
|
@@ -23,9 +23,15 @@ type StageConnectionState = {
|
|
|
23
23
|
type StageContextData = {
|
|
24
24
|
sendMessage: (<M extends proto$1.AnyClientComponentMessage>(msg: M) => void) | null;
|
|
25
25
|
call: (<Namespace extends string, P, Action extends string & keyof P>(msg: proto$1.CallForPair<Namespace, P, Action>) => Promise<proto$1.ReturnForPair<P, Action>>) | null;
|
|
26
|
-
renderComponent: (info: proto$1.AnyComponentProto) =>
|
|
26
|
+
renderComponent: (info: proto$1.AnyComponentProto) => ReactElement;
|
|
27
27
|
connectionUuid: string | null;
|
|
28
28
|
connection: StageConnectionState;
|
|
29
|
+
/**
|
|
30
|
+
* Estimated offset in milliseconds for how far ahead of the server clock
|
|
31
|
+
* the client clock is.
|
|
32
|
+
*/
|
|
33
|
+
timeDifferenceMs: number | null;
|
|
34
|
+
lastPingMs: number | null;
|
|
29
35
|
reconnect: () => void;
|
|
30
36
|
};
|
|
31
37
|
declare const StageContext: React.Context<StageContextData>;
|
|
@@ -39,21 +45,21 @@ declare const GroupStateWrapper: React__default.FunctionComponent<{
|
|
|
39
45
|
* Whether new groups using `auto` should be open by default.
|
|
40
46
|
*/
|
|
41
47
|
openByDefault: boolean;
|
|
42
|
-
children:
|
|
48
|
+
children: ReactNode;
|
|
43
49
|
}>;
|
|
44
|
-
declare const
|
|
50
|
+
declare const Group: FC<Props$7>;
|
|
45
51
|
|
|
46
52
|
interface Props$6 {
|
|
47
53
|
className?: string;
|
|
48
54
|
info: proto.LabelComponent;
|
|
49
55
|
}
|
|
50
|
-
declare const
|
|
56
|
+
declare const Label: FC<Props$6>;
|
|
51
57
|
|
|
52
58
|
type NestContentProps = {
|
|
53
59
|
className?: string;
|
|
54
|
-
children?:
|
|
60
|
+
children?: ReactNode;
|
|
55
61
|
};
|
|
56
|
-
declare const
|
|
62
|
+
declare const NestedContent: FC<NestContentProps>;
|
|
57
63
|
|
|
58
64
|
interface Props$5 {
|
|
59
65
|
className?: string;
|
|
@@ -65,13 +71,13 @@ interface Props$4 {
|
|
|
65
71
|
className?: string;
|
|
66
72
|
info: proto.SliderButtonComponent;
|
|
67
73
|
}
|
|
68
|
-
declare const
|
|
74
|
+
declare const SliderButton: FC<Props$4>;
|
|
69
75
|
|
|
70
76
|
interface Props$3 {
|
|
71
77
|
className?: string;
|
|
72
78
|
info: proto.SwitchComponent;
|
|
73
79
|
}
|
|
74
|
-
declare const
|
|
80
|
+
declare const Switch: FC<Props$3>;
|
|
75
81
|
|
|
76
82
|
interface Props$2 {
|
|
77
83
|
info: proto.TabsComponent;
|
|
@@ -82,7 +88,7 @@ interface Props$1 {
|
|
|
82
88
|
className?: string;
|
|
83
89
|
info: proto.TextInputComponent;
|
|
84
90
|
}
|
|
85
|
-
declare const
|
|
91
|
+
declare const TextInput: FC<Props$1>;
|
|
86
92
|
|
|
87
93
|
interface Props {
|
|
88
94
|
className?: string;
|
|
@@ -92,4 +98,4 @@ declare const Timeline: FC<Props>;
|
|
|
92
98
|
|
|
93
99
|
declare const CORE_FRONTEND_COMPONENT_RENDERER: FrontendComponentRenderer;
|
|
94
100
|
|
|
95
|
-
export {
|
|
101
|
+
export { Button, CORE_FRONTEND_COMPONENT_RENDERER, Group, GroupStateWrapper, Label, NestedContent, Rect, SliderButton, type StageConnectionState, StageContext, type StageContextData, Switch, Tabs, TextInput, Timeline };
|