@arcanejs/toolkit-frontend 0.9.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 CHANGED
@@ -1,43 +1,144 @@
1
- # `@arcanejs/diff`
1
+ # `@arcanejs/toolkit-frontend`
2
2
 
3
- [![NPM Version](https://img.shields.io/npm/v/%40arcanejs%2Fdiff)](https://www.npmjs.com/package/@arcanejs/diff)
3
+ [![NPM Version](https://img.shields.io/npm/v/%40arcanejs%2Ftoolkit-frontend)](https://www.npmjs.com/package/@arcanejs/toolkit-frontend)
4
4
 
5
- This package provides an easy way to:
5
+ Browser-side renderer components and stage utilities for ArcaneJS.
6
6
 
7
- - Create diffs by comparing objects
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
- This library is written in TypeScript,
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
- This package is part of the
16
- [`arcanejs` project](https://github.com/ArcaneWizards/arcanejs#arcanejs),
17
- and is used to maintain a copy of a JSON tree in downstream clients in real-time
18
- via websockets.
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
- ## Usage
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
- ```ts
23
- import { diffJson, Diff } from '@arcanejs/diff/diff';
24
- import { patchJson } from '@arcanejs/diff/patch';
72
+ ### `@arcanejs/toolkit-frontend/types`
25
73
 
26
- type E = {
27
- foo: string;
28
- bar?: number[];
29
- };
74
+ - `FrontendComponentRenderer`
75
+ - `FrontendComponentRenderers`
30
76
 
31
- const a: E = { foo: 'bar' };
32
- const b: E = { foo: 'baz', bar: [1] };
77
+ ### `@arcanejs/toolkit-frontend/util`
33
78
 
34
- const diffA: Diff<E> = diffJson(a, b);
79
+ - `calculateClass`
80
+ - touch helpers: `initialiseListeners`, `usePressable`, `trackTouch`, etc.
81
+ - theme preference hooks: `useColorSchemePreferences`, `usePreferredColorScheme`
82
+ - `VALID_COLOR_SCHEME_PREFS`
35
83
 
36
- const resultA = patchJson(a, diffA);
84
+ ## Typical Usage
37
85
 
38
- console.log(resultB); // { foo: 'baz', bar: [1] }
86
+ In most apps you will not call this package directly; `@arcanejs/toolkit` serves a prebuilt frontend entrypoint.
39
87
 
40
- const c = { baz: 'foo' };
88
+ Use this package directly when you provide your own frontend bundle for custom namespaces:
41
89
 
42
- const resultB = patchJson(c, diffA); // TypeScript Type Error: Property 'baz' is missing in type '{ foo: string; bar?: number[] | undefined; }' but required in type '{ baz: string; }'
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 calculateClass = (...args) => args.filter((a) => !!a).join(" ");
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,
@@ -0,0 +1,9 @@
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
+ export {
8
+ __export
9
+ };
@@ -1,11 +1,7 @@
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
- // 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 calculateClass = (...args) => args.filter((a) => !!a).join(" ");
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.__export = __export; exports.switchToMouseMode = switchToMouseMode; exports.switchToTouchMode = switchToTouchMode; exports.initialiseListeners = initialiseListeners; exports.usePressable = usePressable; exports.trackTouch = trackTouch; exports.calculateClass = calculateClass; exports.VALID_COLOR_SCHEME_PREFS = VALID_COLOR_SCHEME_PREFS; exports.useColorSchemePreferences = useColorSchemePreferences; exports.usePreferredColorScheme = usePreferredColorScheme;
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
- var _chunkTMN35K5Yjs = require('./chunk-TMN35K5Y.js');
5
+
6
+ var _chunkMLKGABMKjs = require('./chunk-MLKGABMK.js');
5
7
 
6
8
  // src/components/core/index.ts
7
9
  var core_exports = {};
8
- _chunkTMN35K5Yjs.__export.call(void 0, core_exports, {
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 ICON_CLASS = "icon";
18
- var Span = _styledcomponents.styled.span`
19
- font-family: 'Material Symbols Outlined';
20
- font-weight: normal;
21
- font-style: normal;
22
- font-size: 22px;
23
- display: inline-block;
24
- line-height: 1;
25
- text-transform: none;
26
- letter-spacing: normal;
27
- word-wrap: normal;
28
- white-space: nowrap;
29
- direction: ltr;
30
- font-variation-settings:
31
- 'wght' 300,
32
- 'GRAD' -25;
33
- `;
34
- var Icon = ({ icon, ...props }) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Span, { className: _chunkTMN35K5Yjs.calculateClass.call(void 0, props.className, ICON_CLASS), ...props, children: icon });
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
- __export,
3
- calculateClass
4
- } from "./chunk-PTANIWKR.mjs";
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 ICON_CLASS = "icon";
18
- var Span = styled.span`
19
- font-family: 'Material Symbols Outlined';
20
- font-weight: normal;
21
- font-style: normal;
22
- font-size: 22px;
23
- display: inline-block;
24
- line-height: 1;
25
- text-transform: none;
26
- letter-spacing: normal;
27
- word-wrap: normal;
28
- white-space: nowrap;
29
- direction: ltr;
30
- font-variation-settings:
31
- 'wght' 300,
32
- 'GRAD' -25;
33
- `;
34
- var Icon = ({ icon, ...props }) => /* @__PURE__ */ jsx(Span, { className: calculateClass(props.className, ICON_CLASS), ...props, children: icon });
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 _chunkUHFE2X4Vjs = require('../../chunk-UHFE2X4V.js');
6
- require('../../chunk-TMN35K5Y.js');
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 = _chunkUHFE2X4Vjs.Icon; exports.TRANSPARENCY_SVG = _chunkUHFE2X4Vjs.TRANSPARENCY_SVG; exports.TRANSPARENCY_SVG_URI = _chunkUHFE2X4Vjs.TRANSPARENCY_SVG_URI;
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-GMPDVDSW.mjs";
6
- import "../../chunk-PTANIWKR.mjs";
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,7 +9,7 @@ interface Props$8 {
9
9
  className?: string;
10
10
  info: proto.ButtonComponent;
11
11
  }
12
- declare const StyledButton: FC<Props$8>;
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) => JSX.Element;
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: JSX.Element | JSX.Element[];
48
+ children: ReactNode;
43
49
  }>;
44
- declare const StyledGroup: FC<Props$7>;
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 StyledLabel: FC<Props$6>;
56
+ declare const Label: FC<Props$6>;
51
57
 
52
58
  type NestContentProps = {
53
59
  className?: string;
54
- children?: JSX.Element | JSX.Element[];
60
+ children?: ReactNode;
55
61
  };
56
- declare const StyledNestedContent: FC<NestContentProps>;
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 StyledSliderButton: FC<Props$4>;
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 StyledSwitch: FC<Props$3>;
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 StyledTextInput: FC<Props$1>;
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 { StyledButton as Button, CORE_FRONTEND_COMPONENT_RENDERER, StyledGroup as Group, GroupStateWrapper, StyledLabel as Label, StyledNestedContent as NestedContent, Rect, StyledSliderButton as SliderButton, type StageConnectionState, StageContext, type StageContextData, StyledSwitch as Switch, Tabs, StyledTextInput as TextInput, Timeline };
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,7 +9,7 @@ interface Props$8 {
9
9
  className?: string;
10
10
  info: proto.ButtonComponent;
11
11
  }
12
- declare const StyledButton: FC<Props$8>;
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) => JSX.Element;
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: JSX.Element | JSX.Element[];
48
+ children: ReactNode;
43
49
  }>;
44
- declare const StyledGroup: FC<Props$7>;
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 StyledLabel: FC<Props$6>;
56
+ declare const Label: FC<Props$6>;
51
57
 
52
58
  type NestContentProps = {
53
59
  className?: string;
54
- children?: JSX.Element | JSX.Element[];
60
+ children?: ReactNode;
55
61
  };
56
- declare const StyledNestedContent: FC<NestContentProps>;
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 StyledSliderButton: FC<Props$4>;
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 StyledSwitch: FC<Props$3>;
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 StyledTextInput: FC<Props$1>;
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 { StyledButton as Button, CORE_FRONTEND_COMPONENT_RENDERER, StyledGroup as Group, GroupStateWrapper, StyledLabel as Label, StyledNestedContent as NestedContent, Rect, StyledSliderButton as SliderButton, type StageConnectionState, StageContext, type StageContextData, StyledSwitch as Switch, Tabs, StyledTextInput as TextInput, Timeline };
101
+ export { Button, CORE_FRONTEND_COMPONENT_RENDERER, Group, GroupStateWrapper, Label, NestedContent, Rect, SliderButton, type StageConnectionState, StageContext, type StageContextData, Switch, Tabs, TextInput, Timeline };