@thestatic-tv/dcl-sdk 2.13.0 → 2.15.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 +31 -0
- package/dist/index.d.mts +39 -8
- package/dist/index.d.ts +39 -8
- package/dist/index.js +608 -441
- package/dist/index.mjs +559 -392
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -150,6 +150,37 @@ other, a `coversGuide` panel and those two close each other, and the chat stays
|
|
|
150
150
|
guide or the admin panel. A panel registered without the option is left to the scene there. The
|
|
151
151
|
names `guide`, `chat` and `admin` are the SDK's.
|
|
152
152
|
|
|
153
|
+
**Circles (2.15.0).** Every toolbar button is a round, see-through circle: a ring in the button's
|
|
154
|
+
own color (the face's `uiBackground` color), a white icon in the middle, its short tag under it,
|
|
155
|
+
and the chat's unread count as a badge. A phone: 72 across, in the column flush on the right
|
|
156
|
+
edge; desktop: 52 across, in the bottom-right row from right 20. A scene's button names its icon
|
|
157
|
+
(`chat`, `guide`, `sparkle`, `radio`, `admin`, or a full https URL) and its tag:
|
|
158
|
+
|
|
159
|
+
```typescript
|
|
160
|
+
staticTV.toolbarButton(3, {
|
|
161
|
+
uiBackground: { color: Color4.create(0.55, 0.4, 0.1, 0.95) }, // the ring
|
|
162
|
+
icon: 'sparkle', // from the SDK's site: <base URL's site>/sdk/icons/sparkle.png
|
|
163
|
+
tag: 'MY AI', // stays even if the icon cannot load
|
|
164
|
+
open: aiPanel.isOpen, // fills the circle while its panel is open
|
|
165
|
+
onMouseDown: () => aiPanel.toggle(),
|
|
166
|
+
})
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
A face with no icon still draws, its children inside the circle. On desktop a panel opening
|
|
170
|
+
under the circle row is raised to clear it (`toolbarPanel`).
|
|
171
|
+
|
|
172
|
+
**Fold (2.14.0; one circle since 2.15.0).** A circle with a chevron folds the toolbar: on top of
|
|
173
|
+
the phone's column (pointing right) or at the desktop row's left end (pointing down). Folded, the
|
|
174
|
+
whole toolbar is one circle, on the phone's edge at mid-height (pointing left) or in the
|
|
175
|
+
desktop's bottom-right corner (pointing up); a press brings the buttons back. Folding closes
|
|
176
|
+
every open panel, the scene's registered ones too. It lasts for the visit and starts open. A
|
|
177
|
+
scene's buttons drawn through `toolbarButton` fold with the rest; `staticTV.toolbarCollapsed`
|
|
178
|
+
says which it is.
|
|
179
|
+
|
|
180
|
+
**The version (2.14.0).** The guide shows `TheStatic SDK <version>` small and dim at the bottom
|
|
181
|
+
of its sidebar, so a visitor can name it when asking for help. The build writes it from
|
|
182
|
+
`package.json`.
|
|
183
|
+
|
|
153
184
|
## 18+ channels (2.8.0)
|
|
154
185
|
|
|
155
186
|
18+ channels are in the lineup with the rest: each 18+ channel and each of its VODs carries
|
package/dist/index.d.mts
CHANGED
|
@@ -1487,8 +1487,6 @@ declare class AdminPanelUIModule {
|
|
|
1487
1487
|
* Uses same layout as NotificationBanner but with scaled font size
|
|
1488
1488
|
*/
|
|
1489
1489
|
private renderScaledNotification;
|
|
1490
|
-
/** The ADMIN / CLOSE button itself; its place is the row's or, on a phone, the column's (2.12.0) */
|
|
1491
|
-
private renderToggleFace;
|
|
1492
1490
|
/**
|
|
1493
1491
|
* Get the React-ECS component for the admin panel
|
|
1494
1492
|
* Always renders notification (scaled), admin panel only for admins
|
|
@@ -1533,13 +1531,25 @@ interface PanelOptions {
|
|
|
1533
1531
|
coversGuide?: boolean;
|
|
1534
1532
|
}
|
|
1535
1533
|
|
|
1536
|
-
/** A toolbar button's face
|
|
1534
|
+
/** A toolbar button's face (2.12.0; the circle's own props since 2.15.0) */
|
|
1537
1535
|
interface ToolbarButtonProps {
|
|
1538
|
-
/** Extra layout for
|
|
1536
|
+
/** Extra layout for what shows inside the circle when no icon is given */
|
|
1539
1537
|
uiTransform?: Record<string, unknown>;
|
|
1538
|
+
/** Its color: the circle's ring (2.15.0); before, the brick's fill */
|
|
1540
1539
|
uiBackground?: unknown;
|
|
1541
1540
|
onMouseDown?: () => void;
|
|
1541
|
+
/** Shown inside the circle when no icon is given (a pre-2.15.0 face's label) */
|
|
1542
1542
|
children?: unknown[];
|
|
1543
|
+
/** 2.15.0: the icon, a name on the SDK's icon host (chat, guide, sparkle, radio, admin) or a full https URL */
|
|
1544
|
+
icon?: string;
|
|
1545
|
+
/** 2.15.0: the short name under the circle (CHAT, GUIDE, MY AI...) */
|
|
1546
|
+
tag?: string;
|
|
1547
|
+
/** 2.15.0: the tag's color (white unless given; RADIO's turns green while a station plays) */
|
|
1548
|
+
tagColor?: unknown;
|
|
1549
|
+
/** 2.15.0: a small count on the circle (CHAT's unread messages); nothing when empty or 0 */
|
|
1550
|
+
badge?: string | number;
|
|
1551
|
+
/** 2.15.0: its panel is open - the circle fills with its ring color */
|
|
1552
|
+
open?: boolean;
|
|
1543
1553
|
[prop: string]: unknown;
|
|
1544
1554
|
}
|
|
1545
1555
|
|
|
@@ -1616,6 +1626,8 @@ declare class StaticTVClient {
|
|
|
1616
1626
|
* scene's (registerPanel); elsewhere the guide and the admin panel close each other, as before.
|
|
1617
1627
|
*/
|
|
1618
1628
|
private readonly panelRules;
|
|
1629
|
+
/** The toolbar collapsed to strips or not, for the visit (2.14.0): collapsing closes every panel first */
|
|
1630
|
+
private readonly fold;
|
|
1619
1631
|
/** The SDK's own panels, which a scene cannot register over */
|
|
1620
1632
|
private static readonly OWN_PANELS;
|
|
1621
1633
|
/** Get the API base URL (for internal module use) */
|
|
@@ -2050,20 +2062,39 @@ declare class StaticTVClient {
|
|
|
2050
2062
|
* Draw one of the scene's own toolbar buttons in its slot: the row along the bottom right on desktop (where a scene
|
|
2051
2063
|
* placed its own by hand before), the column on a phone. Slots count from the right (the row) or the top (the
|
|
2052
2064
|
* column): 0 is CHAT's, 1 GUIDE's, 2 ADMIN's (for a non-admin the scene's first button may take it), then the
|
|
2053
|
-
* scene's. `props` is the button's face
|
|
2054
|
-
*
|
|
2065
|
+
* scene's. `props` is the button's face. Since 2.15.0 every button is a circle: its uiBackground color is the ring,
|
|
2066
|
+
* `icon` the white icon in the middle (a name on the SDK's icon host - chat, guide, sparkle, radio, admin - or a full
|
|
2067
|
+
* https URL), `tag` the short name under it, `tagColor`, `badge` (a small count) and `open` (its panel is open) are
|
|
2068
|
+
* optional; a face with no icon shows its children inside the circle. Folded (2.14.0), the buttons draw nothing:
|
|
2069
|
+
* the toolbar is one circle (toolbarHandle).
|
|
2055
2070
|
*
|
|
2056
2071
|
* @example
|
|
2057
2072
|
* ```typescript
|
|
2058
2073
|
* staticTV.toolbarButton(3, {
|
|
2059
|
-
* uiTransform: { justifyContent: 'center', alignItems: 'center' },
|
|
2060
2074
|
* uiBackground: { color: Color4.create(0.2, 0.4, 0.2, 0.9) },
|
|
2075
|
+
* icon: 'radio',
|
|
2076
|
+
* tag: 'MAP',
|
|
2077
|
+
* open: myPanel.isOpen,
|
|
2061
2078
|
* onMouseDown: () => myPanel.toggle(),
|
|
2062
|
-
* children: [ReactEcs.createElement(UiEntity, { uiText: { value: 'MAP', fontSize: 14 } })],
|
|
2063
2079
|
* })
|
|
2064
2080
|
* ```
|
|
2065
2081
|
*/
|
|
2066
2082
|
toolbarButton(slot: number, props: ToolbarButtonProps): any;
|
|
2083
|
+
/** The toolbar's last slot: ADMIN's (2) when it is drawn, else GUIDE's (1), or a scene button's past them */
|
|
2084
|
+
private toolbarLastSlot;
|
|
2085
|
+
/**
|
|
2086
|
+
* The toolbar folded (2.14.0, his ask: "small tabs out of users way"; one circle since 2.15.0): the fold circle
|
|
2087
|
+
* folds it and closes every open panel, the scene's registered ones too; the one folded circle opens it. For the
|
|
2088
|
+
* visit only; it starts open. A scene drawing its buttons through toolbarButton needs nothing more.
|
|
2089
|
+
*/
|
|
2090
|
+
get toolbarCollapsed(): boolean;
|
|
2091
|
+
/**
|
|
2092
|
+
* The fold circle, drawn by the SDK's chat (2.15.0): open, on top of a phone's column (chevron right) or past the
|
|
2093
|
+
* desktop row's last button (chevron down); folded, the toolbar's one circle, on a phone's edge at mid-height
|
|
2094
|
+
* (chevron left) or in the desktop's bottom-right corner (chevron up). A press folds or opens.
|
|
2095
|
+
* @internal
|
|
2096
|
+
*/
|
|
2097
|
+
toolbarHandle(): any;
|
|
2067
2098
|
/** Where a scene's own panel's right edge goes: on a phone one gap left of the column; elsewhere `desktopRight` */
|
|
2068
2099
|
panelRight(desktopRight: number): number;
|
|
2069
2100
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1487,8 +1487,6 @@ declare class AdminPanelUIModule {
|
|
|
1487
1487
|
* Uses same layout as NotificationBanner but with scaled font size
|
|
1488
1488
|
*/
|
|
1489
1489
|
private renderScaledNotification;
|
|
1490
|
-
/** The ADMIN / CLOSE button itself; its place is the row's or, on a phone, the column's (2.12.0) */
|
|
1491
|
-
private renderToggleFace;
|
|
1492
1490
|
/**
|
|
1493
1491
|
* Get the React-ECS component for the admin panel
|
|
1494
1492
|
* Always renders notification (scaled), admin panel only for admins
|
|
@@ -1533,13 +1531,25 @@ interface PanelOptions {
|
|
|
1533
1531
|
coversGuide?: boolean;
|
|
1534
1532
|
}
|
|
1535
1533
|
|
|
1536
|
-
/** A toolbar button's face
|
|
1534
|
+
/** A toolbar button's face (2.12.0; the circle's own props since 2.15.0) */
|
|
1537
1535
|
interface ToolbarButtonProps {
|
|
1538
|
-
/** Extra layout for
|
|
1536
|
+
/** Extra layout for what shows inside the circle when no icon is given */
|
|
1539
1537
|
uiTransform?: Record<string, unknown>;
|
|
1538
|
+
/** Its color: the circle's ring (2.15.0); before, the brick's fill */
|
|
1540
1539
|
uiBackground?: unknown;
|
|
1541
1540
|
onMouseDown?: () => void;
|
|
1541
|
+
/** Shown inside the circle when no icon is given (a pre-2.15.0 face's label) */
|
|
1542
1542
|
children?: unknown[];
|
|
1543
|
+
/** 2.15.0: the icon, a name on the SDK's icon host (chat, guide, sparkle, radio, admin) or a full https URL */
|
|
1544
|
+
icon?: string;
|
|
1545
|
+
/** 2.15.0: the short name under the circle (CHAT, GUIDE, MY AI...) */
|
|
1546
|
+
tag?: string;
|
|
1547
|
+
/** 2.15.0: the tag's color (white unless given; RADIO's turns green while a station plays) */
|
|
1548
|
+
tagColor?: unknown;
|
|
1549
|
+
/** 2.15.0: a small count on the circle (CHAT's unread messages); nothing when empty or 0 */
|
|
1550
|
+
badge?: string | number;
|
|
1551
|
+
/** 2.15.0: its panel is open - the circle fills with its ring color */
|
|
1552
|
+
open?: boolean;
|
|
1543
1553
|
[prop: string]: unknown;
|
|
1544
1554
|
}
|
|
1545
1555
|
|
|
@@ -1616,6 +1626,8 @@ declare class StaticTVClient {
|
|
|
1616
1626
|
* scene's (registerPanel); elsewhere the guide and the admin panel close each other, as before.
|
|
1617
1627
|
*/
|
|
1618
1628
|
private readonly panelRules;
|
|
1629
|
+
/** The toolbar collapsed to strips or not, for the visit (2.14.0): collapsing closes every panel first */
|
|
1630
|
+
private readonly fold;
|
|
1619
1631
|
/** The SDK's own panels, which a scene cannot register over */
|
|
1620
1632
|
private static readonly OWN_PANELS;
|
|
1621
1633
|
/** Get the API base URL (for internal module use) */
|
|
@@ -2050,20 +2062,39 @@ declare class StaticTVClient {
|
|
|
2050
2062
|
* Draw one of the scene's own toolbar buttons in its slot: the row along the bottom right on desktop (where a scene
|
|
2051
2063
|
* placed its own by hand before), the column on a phone. Slots count from the right (the row) or the top (the
|
|
2052
2064
|
* column): 0 is CHAT's, 1 GUIDE's, 2 ADMIN's (for a non-admin the scene's first button may take it), then the
|
|
2053
|
-
* scene's. `props` is the button's face
|
|
2054
|
-
*
|
|
2065
|
+
* scene's. `props` is the button's face. Since 2.15.0 every button is a circle: its uiBackground color is the ring,
|
|
2066
|
+
* `icon` the white icon in the middle (a name on the SDK's icon host - chat, guide, sparkle, radio, admin - or a full
|
|
2067
|
+
* https URL), `tag` the short name under it, `tagColor`, `badge` (a small count) and `open` (its panel is open) are
|
|
2068
|
+
* optional; a face with no icon shows its children inside the circle. Folded (2.14.0), the buttons draw nothing:
|
|
2069
|
+
* the toolbar is one circle (toolbarHandle).
|
|
2055
2070
|
*
|
|
2056
2071
|
* @example
|
|
2057
2072
|
* ```typescript
|
|
2058
2073
|
* staticTV.toolbarButton(3, {
|
|
2059
|
-
* uiTransform: { justifyContent: 'center', alignItems: 'center' },
|
|
2060
2074
|
* uiBackground: { color: Color4.create(0.2, 0.4, 0.2, 0.9) },
|
|
2075
|
+
* icon: 'radio',
|
|
2076
|
+
* tag: 'MAP',
|
|
2077
|
+
* open: myPanel.isOpen,
|
|
2061
2078
|
* onMouseDown: () => myPanel.toggle(),
|
|
2062
|
-
* children: [ReactEcs.createElement(UiEntity, { uiText: { value: 'MAP', fontSize: 14 } })],
|
|
2063
2079
|
* })
|
|
2064
2080
|
* ```
|
|
2065
2081
|
*/
|
|
2066
2082
|
toolbarButton(slot: number, props: ToolbarButtonProps): any;
|
|
2083
|
+
/** The toolbar's last slot: ADMIN's (2) when it is drawn, else GUIDE's (1), or a scene button's past them */
|
|
2084
|
+
private toolbarLastSlot;
|
|
2085
|
+
/**
|
|
2086
|
+
* The toolbar folded (2.14.0, his ask: "small tabs out of users way"; one circle since 2.15.0): the fold circle
|
|
2087
|
+
* folds it and closes every open panel, the scene's registered ones too; the one folded circle opens it. For the
|
|
2088
|
+
* visit only; it starts open. A scene drawing its buttons through toolbarButton needs nothing more.
|
|
2089
|
+
*/
|
|
2090
|
+
get toolbarCollapsed(): boolean;
|
|
2091
|
+
/**
|
|
2092
|
+
* The fold circle, drawn by the SDK's chat (2.15.0): open, on top of a phone's column (chevron right) or past the
|
|
2093
|
+
* desktop row's last button (chevron down); folded, the toolbar's one circle, on a phone's edge at mid-height
|
|
2094
|
+
* (chevron left) or in the desktop's bottom-right corner (chevron up). A press folds or opens.
|
|
2095
|
+
* @internal
|
|
2096
|
+
*/
|
|
2097
|
+
toolbarHandle(): any;
|
|
2067
2098
|
/** Where a scene's own panel's right edge goes: on a phone one gap left of the column; elsewhere `desktopRight` */
|
|
2068
2099
|
panelRight(desktopRight: number): number;
|
|
2069
2100
|
/**
|