@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/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,11 +1,7 @@
|
|
|
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
7
|
import { useState } from "react";
|
|
@@ -72,7 +68,8 @@ function trackTouch(touch, move, end) {
|
|
|
72
68
|
}
|
|
73
69
|
|
|
74
70
|
// src/util/index.ts
|
|
75
|
-
var
|
|
71
|
+
var cn = (...args) => twMerge(clsx(args));
|
|
72
|
+
var calculateClass = cn;
|
|
76
73
|
var COLOR_SCHEME_SETTINGS = "arcane-color-scheme-preference";
|
|
77
74
|
var VALID_COLOR_SCHEME_PREFS = ["auto", "dark", "light"];
|
|
78
75
|
var isValidColorSchemePreference = (value) => {
|
|
@@ -142,12 +139,12 @@ var usePreferredColorScheme = () => {
|
|
|
142
139
|
};
|
|
143
140
|
|
|
144
141
|
export {
|
|
145
|
-
__export,
|
|
146
142
|
switchToMouseMode,
|
|
147
143
|
switchToTouchMode,
|
|
148
144
|
initialiseListeners,
|
|
149
145
|
usePressable,
|
|
150
146
|
trackTouch,
|
|
147
|
+
cn,
|
|
151
148
|
calculateClass,
|
|
152
149
|
VALID_COLOR_SCHEME_PREFS,
|
|
153
150
|
useColorSchemePreferences,
|
|
@@ -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
|
|
|
@@ -72,7 +68,8 @@ function trackTouch(touch, move, end) {
|
|
|
72
68
|
}
|
|
73
69
|
|
|
74
70
|
// src/util/index.ts
|
|
75
|
-
var
|
|
71
|
+
var cn = (...args) => _tailwindmerge.twMerge.call(void 0, _clsx.clsx.call(void 0, args));
|
|
72
|
+
var calculateClass = cn;
|
|
76
73
|
var COLOR_SCHEME_SETTINGS = "arcane-color-scheme-preference";
|
|
77
74
|
var VALID_COLOR_SCHEME_PREFS = ["auto", "dark", "light"];
|
|
78
75
|
var isValidColorSchemePreference = (value) => {
|
|
@@ -152,4 +149,4 @@ var usePreferredColorScheme = () => {
|
|
|
152
149
|
|
|
153
150
|
|
|
154
151
|
|
|
155
|
-
exports.
|
|
152
|
+
exports.switchToMouseMode = switchToMouseMode; exports.switchToTouchMode = switchToTouchMode; exports.initialiseListeners = initialiseListeners; exports.usePressable = usePressable; 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,37 +1,39 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
+
var _chunkGBYIEWGNjs = require('./chunk-GBYIEWGN.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: _chunkGBYIEWGNjs.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 = `
|
|
@@ -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,7 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
cn
|
|
3
|
+
} from "./chunk-2HBLGAG3.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 = `
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
require('../../chunk-
|
|
5
|
+
var _chunkLXNJPBVTjs = require('../../chunk-LXNJPBVT.js');
|
|
6
|
+
require('../../chunk-GBYIEWGN.js');
|
|
7
|
+
require('../../chunk-MLKGABMK.js');
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
|
|
11
|
-
exports.Icon =
|
|
12
|
+
exports.Icon = _chunkLXNJPBVTjs.Icon; exports.TRANSPARENCY_SVG = _chunkLXNJPBVTjs.TRANSPARENCY_SVG; exports.TRANSPARENCY_SVG_URI = _chunkLXNJPBVTjs.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-TOVGDMHN.mjs";
|
|
6
|
+
import "../../chunk-2HBLGAG3.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,13 +9,30 @@ 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
|
+
type StageConnectionState = {
|
|
15
|
+
state: 'connecting' | 'closed';
|
|
16
|
+
} | {
|
|
17
|
+
state: 'error';
|
|
18
|
+
error: Error;
|
|
19
|
+
} | {
|
|
20
|
+
state: 'connected';
|
|
21
|
+
uuid: string | null;
|
|
22
|
+
};
|
|
14
23
|
type StageContextData = {
|
|
15
24
|
sendMessage: (<M extends proto$1.AnyClientComponentMessage>(msg: M) => void) | null;
|
|
16
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;
|
|
17
|
-
renderComponent: (info: proto$1.AnyComponentProto) =>
|
|
18
|
-
connectionUuid: string;
|
|
26
|
+
renderComponent: (info: proto$1.AnyComponentProto) => ReactElement;
|
|
27
|
+
connectionUuid: string | null;
|
|
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;
|
|
35
|
+
reconnect: () => void;
|
|
19
36
|
};
|
|
20
37
|
declare const StageContext: React.Context<StageContextData>;
|
|
21
38
|
|
|
@@ -28,21 +45,21 @@ declare const GroupStateWrapper: React__default.FunctionComponent<{
|
|
|
28
45
|
* Whether new groups using `auto` should be open by default.
|
|
29
46
|
*/
|
|
30
47
|
openByDefault: boolean;
|
|
31
|
-
children:
|
|
48
|
+
children: ReactNode;
|
|
32
49
|
}>;
|
|
33
|
-
declare const
|
|
50
|
+
declare const Group: FC<Props$7>;
|
|
34
51
|
|
|
35
52
|
interface Props$6 {
|
|
36
53
|
className?: string;
|
|
37
54
|
info: proto.LabelComponent;
|
|
38
55
|
}
|
|
39
|
-
declare const
|
|
56
|
+
declare const Label: FC<Props$6>;
|
|
40
57
|
|
|
41
58
|
type NestContentProps = {
|
|
42
59
|
className?: string;
|
|
43
|
-
children?:
|
|
60
|
+
children?: ReactNode;
|
|
44
61
|
};
|
|
45
|
-
declare const
|
|
62
|
+
declare const NestedContent: FC<NestContentProps>;
|
|
46
63
|
|
|
47
64
|
interface Props$5 {
|
|
48
65
|
className?: string;
|
|
@@ -54,13 +71,13 @@ interface Props$4 {
|
|
|
54
71
|
className?: string;
|
|
55
72
|
info: proto.SliderButtonComponent;
|
|
56
73
|
}
|
|
57
|
-
declare const
|
|
74
|
+
declare const SliderButton: FC<Props$4>;
|
|
58
75
|
|
|
59
76
|
interface Props$3 {
|
|
60
77
|
className?: string;
|
|
61
78
|
info: proto.SwitchComponent;
|
|
62
79
|
}
|
|
63
|
-
declare const
|
|
80
|
+
declare const Switch: FC<Props$3>;
|
|
64
81
|
|
|
65
82
|
interface Props$2 {
|
|
66
83
|
info: proto.TabsComponent;
|
|
@@ -71,7 +88,7 @@ interface Props$1 {
|
|
|
71
88
|
className?: string;
|
|
72
89
|
info: proto.TextInputComponent;
|
|
73
90
|
}
|
|
74
|
-
declare const
|
|
91
|
+
declare const TextInput: FC<Props$1>;
|
|
75
92
|
|
|
76
93
|
interface Props {
|
|
77
94
|
className?: string;
|
|
@@ -81,4 +98,4 @@ declare const Timeline: FC<Props>;
|
|
|
81
98
|
|
|
82
99
|
declare const CORE_FRONTEND_COMPONENT_RENDERER: FrontendComponentRenderer;
|
|
83
100
|
|
|
84
|
-
export {
|
|
101
|
+
export { Button, CORE_FRONTEND_COMPONENT_RENDERER, Group, GroupStateWrapper, Label, NestedContent, Rect, SliderButton, type StageConnectionState, StageContext, type StageContextData, Switch, Tabs, TextInput, Timeline };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { i as code } from '../index-Db4cPoyC.js';
|
|
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.js';
|
|
@@ -9,13 +9,30 @@ 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
|
+
type StageConnectionState = {
|
|
15
|
+
state: 'connecting' | 'closed';
|
|
16
|
+
} | {
|
|
17
|
+
state: 'error';
|
|
18
|
+
error: Error;
|
|
19
|
+
} | {
|
|
20
|
+
state: 'connected';
|
|
21
|
+
uuid: string | null;
|
|
22
|
+
};
|
|
14
23
|
type StageContextData = {
|
|
15
24
|
sendMessage: (<M extends proto$1.AnyClientComponentMessage>(msg: M) => void) | null;
|
|
16
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;
|
|
17
|
-
renderComponent: (info: proto$1.AnyComponentProto) =>
|
|
18
|
-
connectionUuid: string;
|
|
26
|
+
renderComponent: (info: proto$1.AnyComponentProto) => ReactElement;
|
|
27
|
+
connectionUuid: string | null;
|
|
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;
|
|
35
|
+
reconnect: () => void;
|
|
19
36
|
};
|
|
20
37
|
declare const StageContext: React.Context<StageContextData>;
|
|
21
38
|
|
|
@@ -28,21 +45,21 @@ declare const GroupStateWrapper: React__default.FunctionComponent<{
|
|
|
28
45
|
* Whether new groups using `auto` should be open by default.
|
|
29
46
|
*/
|
|
30
47
|
openByDefault: boolean;
|
|
31
|
-
children:
|
|
48
|
+
children: ReactNode;
|
|
32
49
|
}>;
|
|
33
|
-
declare const
|
|
50
|
+
declare const Group: FC<Props$7>;
|
|
34
51
|
|
|
35
52
|
interface Props$6 {
|
|
36
53
|
className?: string;
|
|
37
54
|
info: proto.LabelComponent;
|
|
38
55
|
}
|
|
39
|
-
declare const
|
|
56
|
+
declare const Label: FC<Props$6>;
|
|
40
57
|
|
|
41
58
|
type NestContentProps = {
|
|
42
59
|
className?: string;
|
|
43
|
-
children?:
|
|
60
|
+
children?: ReactNode;
|
|
44
61
|
};
|
|
45
|
-
declare const
|
|
62
|
+
declare const NestedContent: FC<NestContentProps>;
|
|
46
63
|
|
|
47
64
|
interface Props$5 {
|
|
48
65
|
className?: string;
|
|
@@ -54,13 +71,13 @@ interface Props$4 {
|
|
|
54
71
|
className?: string;
|
|
55
72
|
info: proto.SliderButtonComponent;
|
|
56
73
|
}
|
|
57
|
-
declare const
|
|
74
|
+
declare const SliderButton: FC<Props$4>;
|
|
58
75
|
|
|
59
76
|
interface Props$3 {
|
|
60
77
|
className?: string;
|
|
61
78
|
info: proto.SwitchComponent;
|
|
62
79
|
}
|
|
63
|
-
declare const
|
|
80
|
+
declare const Switch: FC<Props$3>;
|
|
64
81
|
|
|
65
82
|
interface Props$2 {
|
|
66
83
|
info: proto.TabsComponent;
|
|
@@ -71,7 +88,7 @@ interface Props$1 {
|
|
|
71
88
|
className?: string;
|
|
72
89
|
info: proto.TextInputComponent;
|
|
73
90
|
}
|
|
74
|
-
declare const
|
|
91
|
+
declare const TextInput: FC<Props$1>;
|
|
75
92
|
|
|
76
93
|
interface Props {
|
|
77
94
|
className?: string;
|
|
@@ -81,4 +98,4 @@ declare const Timeline: FC<Props>;
|
|
|
81
98
|
|
|
82
99
|
declare const CORE_FRONTEND_COMPONENT_RENDERER: FrontendComponentRenderer;
|
|
83
100
|
|
|
84
|
-
export {
|
|
101
|
+
export { Button, CORE_FRONTEND_COMPONENT_RENDERER, Group, GroupStateWrapper, Label, NestedContent, Rect, SliderButton, type StageConnectionState, StageContext, type StageContextData, Switch, Tabs, TextInput, Timeline };
|