@rainbow-robotics/plugin-ui 0.1.2-dev.5 → 0.1.2-dev.50
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 +236 -75
- package/build-dist.mjs +55 -17
- package/dist/host-ui.d.ts +49 -0
- package/dist/host-ui.d.ts.map +1 -0
- package/dist/host-ui.js +33 -0
- package/dist/host-ui.js.map +7 -0
- package/dist/manifest.d.ts +20 -4
- package/dist/manifest.d.ts.map +1 -1
- package/dist/manifest.js +1 -1
- package/dist/manifest.js.map +2 -2
- package/dist/pluginData.d.ts +62 -0
- package/dist/pluginData.d.ts.map +1 -0
- package/dist/react.d.ts +3430 -36
- package/dist/react.js +5 -54
- package/dist/react.js.map +2 -2
- package/dist/sdk.d.ts +54 -4
- package/dist/sdk.d.ts.map +1 -1
- package/dist/sdk.js +44 -10
- package/dist/sdk.js.map +2 -2
- package/dist/viteHost.d.ts +46 -0
- package/dist/viteHost.d.ts.map +1 -0
- package/dist/viteHost.js +262 -0
- package/dist/viteHost.js.map +7 -0
- package/dist/ws.d.ts +73 -0
- package/dist/ws.d.ts.map +1 -0
- package/dist/ws.js +129 -0
- package/dist/ws.js.map +7 -0
- package/package.json +41 -22
- package/src/host-ui.ts +80 -0
- package/src/host.tsx +225 -295
- package/src/index.d.ts +1 -0
- package/src/manifest.ts +25 -4
- package/src/pluginData.tsx +232 -0
- package/src/react.tsx +9 -127
- package/src/sdk.ts +119 -18
- package/src/viteHost.ts +309 -0
- package/src/ws.ts +204 -0
- package/build-browser.mjs +0 -84
- package/dist/connect.d.ts +0 -12
- package/dist/connect.d.ts.map +0 -1
- package/dist/connect.js +0 -29
- package/dist/connect.js.map +0 -7
- package/dist/elements.d.ts +0 -195
- package/dist/elements.d.ts.map +0 -1
- package/dist/elements.js +0 -115
- package/dist/elements.js.map +0 -7
- package/dist/react.d.ts.map +0 -1
- package/dist-browser/@rainbow-robotics/plugin-ui/chunks/chunk-AMCIKVG7.js +0 -1
- package/dist-browser/@rainbow-robotics/plugin-ui/chunks/chunk-GJWPOWHG.js +0 -1
- package/dist-browser/@rainbow-robotics/plugin-ui/chunks/chunk-JRCDA3EG.js +0 -1
- package/dist-browser/@rainbow-robotics/plugin-ui/connect.js +0 -1
- package/dist-browser/@rainbow-robotics/plugin-ui/elements.js +0 -1
- package/dist-browser/@rainbow-robotics/plugin-ui/react.js +0 -1
- package/dist-browser/@rainbow-robotics/plugin-ui/sdk.js +0 -1
- package/dist-browser/vendor/react-dom-client.js +0 -1
- package/dist-browser/vendor/react-jsx-dev-runtime.js +0 -1
- package/dist-browser/vendor/react-jsx-runtime.js +0 -1
- package/dist-browser/vendor/react-runtime.js +0 -65
- package/dist-browser/vendor/react.js +0 -1
- package/src/connect.ts +0 -68
- package/src/elements.ts +0 -257
package/dist/elements.d.ts
DELETED
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* rb-* remote element contract — shared by the sandbox (plugin author) and the
|
|
3
|
-
* nexus host. This is the *stable* surface: it must only ever grow additively
|
|
4
|
-
* (new elements / new optional properties), never break existing shapes.
|
|
5
|
-
*
|
|
6
|
-
* Verified against @remote-dom/core@1.11.x:
|
|
7
|
-
* - `RemoteElement` lives in `@remote-dom/core/elements`
|
|
8
|
-
* - static `remoteProperties` (data) + static `remoteEvents` (callbacks)
|
|
9
|
-
*/
|
|
10
|
-
import { RemoteElement } from "@remote-dom/core/elements";
|
|
11
|
-
type RbNoMethods = Record<never, never>;
|
|
12
|
-
type RbNoSlots = Record<never, never>;
|
|
13
|
-
type RbNoEvents = Record<never, never>;
|
|
14
|
-
export interface RbSliderProps {
|
|
15
|
-
value?: number;
|
|
16
|
-
min?: number;
|
|
17
|
-
max?: number;
|
|
18
|
-
step?: number;
|
|
19
|
-
disabled?: boolean;
|
|
20
|
-
}
|
|
21
|
-
export interface RbButtonProps {
|
|
22
|
-
label?: string;
|
|
23
|
-
variant?: string;
|
|
24
|
-
size?: string;
|
|
25
|
-
disabled?: boolean;
|
|
26
|
-
}
|
|
27
|
-
export interface RbIconButtonProps {
|
|
28
|
-
icon?: string;
|
|
29
|
-
variant?: string;
|
|
30
|
-
size?: string;
|
|
31
|
-
disabled?: boolean;
|
|
32
|
-
}
|
|
33
|
-
export type RbTextProps = Record<never, never>;
|
|
34
|
-
export interface RbTextInputProps {
|
|
35
|
-
value?: string;
|
|
36
|
-
placeholder?: string;
|
|
37
|
-
disabled?: boolean;
|
|
38
|
-
}
|
|
39
|
-
export interface RbSwitchProps {
|
|
40
|
-
checked?: boolean;
|
|
41
|
-
disabled?: boolean;
|
|
42
|
-
}
|
|
43
|
-
/** Option shape carried by `rb-select`'s `options` property. */
|
|
44
|
-
export interface RbSelectOption {
|
|
45
|
-
value: string;
|
|
46
|
-
label: string;
|
|
47
|
-
}
|
|
48
|
-
export interface RbSelectProps {
|
|
49
|
-
value?: string;
|
|
50
|
-
options?: RbSelectOption[];
|
|
51
|
-
placeholder?: string;
|
|
52
|
-
disabled?: boolean;
|
|
53
|
-
}
|
|
54
|
-
export interface RbSliderEvents {
|
|
55
|
-
change(detail: number): void;
|
|
56
|
-
}
|
|
57
|
-
export interface RbPressEvents {
|
|
58
|
-
press(): void;
|
|
59
|
-
}
|
|
60
|
-
export interface RbTextInputEvents {
|
|
61
|
-
input(detail: string): void;
|
|
62
|
-
}
|
|
63
|
-
export interface RbSwitchEvents {
|
|
64
|
-
change(detail: boolean): void;
|
|
65
|
-
}
|
|
66
|
-
export interface RbSelectEvents {
|
|
67
|
-
change(detail: string): void;
|
|
68
|
-
}
|
|
69
|
-
/** Slider → host renders RBSlider (Radix array value, single-thumb contract). */
|
|
70
|
-
export declare class RbSliderElement extends RemoteElement<RbSliderProps, RbNoMethods, RbNoSlots, RbSliderEvents> {
|
|
71
|
-
static get remoteProperties(): {
|
|
72
|
-
value: {
|
|
73
|
-
type: NumberConstructor;
|
|
74
|
-
};
|
|
75
|
-
min: {
|
|
76
|
-
type: NumberConstructor;
|
|
77
|
-
};
|
|
78
|
-
max: {
|
|
79
|
-
type: NumberConstructor;
|
|
80
|
-
};
|
|
81
|
-
step: {
|
|
82
|
-
type: NumberConstructor;
|
|
83
|
-
};
|
|
84
|
-
disabled: {
|
|
85
|
-
type: BooleanConstructor;
|
|
86
|
-
};
|
|
87
|
-
};
|
|
88
|
-
static get remoteEvents(): readonly ["change"];
|
|
89
|
-
}
|
|
90
|
-
/** Button → host renders RBLabelButton. */
|
|
91
|
-
export declare class RbButtonElement extends RemoteElement<RbButtonProps, RbNoMethods, RbNoSlots, RbPressEvents> {
|
|
92
|
-
static get remoteProperties(): {
|
|
93
|
-
label: {
|
|
94
|
-
type: StringConstructor;
|
|
95
|
-
};
|
|
96
|
-
variant: {
|
|
97
|
-
type: StringConstructor;
|
|
98
|
-
};
|
|
99
|
-
size: {
|
|
100
|
-
type: StringConstructor;
|
|
101
|
-
};
|
|
102
|
-
disabled: {
|
|
103
|
-
type: BooleanConstructor;
|
|
104
|
-
};
|
|
105
|
-
};
|
|
106
|
-
static get remoteEvents(): readonly ["press"];
|
|
107
|
-
}
|
|
108
|
-
/** Icon button → host renders RBIconButton with an icon resolved from RBIcons. */
|
|
109
|
-
export declare class RbIconButtonElement extends RemoteElement<RbIconButtonProps, RbNoMethods, RbNoSlots, RbPressEvents> {
|
|
110
|
-
static get remoteProperties(): {
|
|
111
|
-
icon: {
|
|
112
|
-
type: StringConstructor;
|
|
113
|
-
};
|
|
114
|
-
variant: {
|
|
115
|
-
type: StringConstructor;
|
|
116
|
-
};
|
|
117
|
-
size: {
|
|
118
|
-
type: StringConstructor;
|
|
119
|
-
};
|
|
120
|
-
disabled: {
|
|
121
|
-
type: BooleanConstructor;
|
|
122
|
-
};
|
|
123
|
-
};
|
|
124
|
-
static get remoteEvents(): readonly ["press"];
|
|
125
|
-
}
|
|
126
|
-
/** Plain text — renders its children as text on the host. */
|
|
127
|
-
export declare class RbTextElement extends RemoteElement<RbTextProps, RbNoMethods, RbNoSlots, RbNoEvents> {
|
|
128
|
-
static get remoteProperties(): {};
|
|
129
|
-
}
|
|
130
|
-
/** Text input → host renders RBTextInput. */
|
|
131
|
-
export declare class RbTextInputElement extends RemoteElement<RbTextInputProps, RbNoMethods, RbNoSlots, RbTextInputEvents> {
|
|
132
|
-
static get remoteProperties(): {
|
|
133
|
-
value: {
|
|
134
|
-
type: StringConstructor;
|
|
135
|
-
};
|
|
136
|
-
placeholder: {
|
|
137
|
-
type: StringConstructor;
|
|
138
|
-
};
|
|
139
|
-
disabled: {
|
|
140
|
-
type: BooleanConstructor;
|
|
141
|
-
};
|
|
142
|
-
};
|
|
143
|
-
static get remoteEvents(): readonly ["input"];
|
|
144
|
-
}
|
|
145
|
-
/** Switch → host renders RBSwitch. */
|
|
146
|
-
export declare class RbSwitchElement extends RemoteElement<RbSwitchProps, RbNoMethods, RbNoSlots, RbSwitchEvents> {
|
|
147
|
-
static get remoteProperties(): {
|
|
148
|
-
checked: {
|
|
149
|
-
type: BooleanConstructor;
|
|
150
|
-
};
|
|
151
|
-
disabled: {
|
|
152
|
-
type: BooleanConstructor;
|
|
153
|
-
};
|
|
154
|
-
};
|
|
155
|
-
static get remoteEvents(): readonly ["change"];
|
|
156
|
-
}
|
|
157
|
-
/** Select → host renders RBSelectBox. `options` is `[{value,label}]`. */
|
|
158
|
-
export declare class RbSelectElement extends RemoteElement<RbSelectProps, RbNoMethods, RbNoSlots, RbSelectEvents> {
|
|
159
|
-
static get remoteProperties(): {
|
|
160
|
-
value: {
|
|
161
|
-
type: StringConstructor;
|
|
162
|
-
};
|
|
163
|
-
options: {
|
|
164
|
-
type: ArrayConstructor;
|
|
165
|
-
};
|
|
166
|
-
placeholder: {
|
|
167
|
-
type: StringConstructor;
|
|
168
|
-
};
|
|
169
|
-
disabled: {
|
|
170
|
-
type: BooleanConstructor;
|
|
171
|
-
};
|
|
172
|
-
};
|
|
173
|
-
static get remoteEvents(): readonly ["change"];
|
|
174
|
-
}
|
|
175
|
-
/** Custom element tag names in the contract. */
|
|
176
|
-
export declare const RB_ELEMENT_NAMES: readonly ["rb-slider", "rb-button", "rb-icon-button", "rb-text", "rb-text-input", "rb-switch", "rb-select"];
|
|
177
|
-
export type RbElementName = (typeof RB_ELEMENT_NAMES)[number];
|
|
178
|
-
declare global {
|
|
179
|
-
interface HTMLElementTagNameMap {
|
|
180
|
-
"rb-slider": RbSliderElement;
|
|
181
|
-
"rb-button": RbButtonElement;
|
|
182
|
-
"rb-icon-button": RbIconButtonElement;
|
|
183
|
-
"rb-text": RbTextElement;
|
|
184
|
-
"rb-text-input": RbTextInputElement;
|
|
185
|
-
"rb-switch": RbSwitchElement;
|
|
186
|
-
"rb-select": RbSelectElement;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
/**
|
|
190
|
-
* Registers the rb-* custom elements. Safe to call multiple times; only the
|
|
191
|
-
* first call defines anything (subsequent calls are a no-op).
|
|
192
|
-
*/
|
|
193
|
-
export declare function defineElements(): void;
|
|
194
|
-
export {};
|
|
195
|
-
//# sourceMappingURL=elements.d.ts.map
|
package/dist/elements.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../src/elements.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D,KAAK,WAAW,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AACxC,KAAK,SAAS,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AACtC,KAAK,UAAU,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAEvC,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,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ACb,WAAW,EACX,SAAS,EACT,cAAc,CACf;IACC,MAAM,KAAK,gBAAgB;;;;;;;;;;;;;MAO1B;IACD,MAAM,KAAK,YAAY,wBAEtB;CACF;AAED,gDAAgD;AAChD,eAAO,MAAM,gBAAgB,6GAQnB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9D,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,eAAe,CAAC;QAC7B,WAAW,EAAE,eAAe,CAAC;QAC7B,gBAAgB,EAAE,mBAAmB,CAAC;QACtC,SAAS,EAAE,aAAa,CAAC;QACzB,eAAe,EAAE,kBAAkB,CAAC;QACpC,WAAW,EAAE,eAAe,CAAC;QAC7B,WAAW,EAAE,eAAe,CAAC;KAC9B;CACF;AAID;;;GAGG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAYrC"}
|
package/dist/elements.js
DELETED
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { RemoteElement } from "@remote-dom/core/elements";
|
|
2
|
-
class RbSliderElement extends RemoteElement {
|
|
3
|
-
static get remoteProperties() {
|
|
4
|
-
return {
|
|
5
|
-
value: { type: Number },
|
|
6
|
-
min: { type: Number },
|
|
7
|
-
max: { type: Number },
|
|
8
|
-
step: { type: Number },
|
|
9
|
-
disabled: { type: Boolean }
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
static get remoteEvents() {
|
|
13
|
-
return ["change"];
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
class RbButtonElement extends RemoteElement {
|
|
17
|
-
static get remoteProperties() {
|
|
18
|
-
return {
|
|
19
|
-
label: { type: String },
|
|
20
|
-
variant: { type: String },
|
|
21
|
-
size: { type: String },
|
|
22
|
-
disabled: { type: Boolean }
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
static get remoteEvents() {
|
|
26
|
-
return ["press"];
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
class RbIconButtonElement extends RemoteElement {
|
|
30
|
-
static get remoteProperties() {
|
|
31
|
-
return {
|
|
32
|
-
icon: { type: String },
|
|
33
|
-
variant: { type: String },
|
|
34
|
-
size: { type: String },
|
|
35
|
-
disabled: { type: Boolean }
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
static get remoteEvents() {
|
|
39
|
-
return ["press"];
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
class RbTextElement extends RemoteElement {
|
|
43
|
-
static get remoteProperties() {
|
|
44
|
-
return {};
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
class RbTextInputElement extends RemoteElement {
|
|
48
|
-
static get remoteProperties() {
|
|
49
|
-
return {
|
|
50
|
-
value: { type: String },
|
|
51
|
-
placeholder: { type: String },
|
|
52
|
-
disabled: { type: Boolean }
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
static get remoteEvents() {
|
|
56
|
-
return ["input"];
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
class RbSwitchElement extends RemoteElement {
|
|
60
|
-
static get remoteProperties() {
|
|
61
|
-
return {
|
|
62
|
-
checked: { type: Boolean },
|
|
63
|
-
disabled: { type: Boolean }
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
static get remoteEvents() {
|
|
67
|
-
return ["change"];
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
class RbSelectElement extends RemoteElement {
|
|
71
|
-
static get remoteProperties() {
|
|
72
|
-
return {
|
|
73
|
-
value: { type: String },
|
|
74
|
-
options: { type: Array },
|
|
75
|
-
placeholder: { type: String },
|
|
76
|
-
disabled: { type: Boolean }
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
static get remoteEvents() {
|
|
80
|
-
return ["change"];
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
const RB_ELEMENT_NAMES = [
|
|
84
|
-
"rb-slider",
|
|
85
|
-
"rb-button",
|
|
86
|
-
"rb-icon-button",
|
|
87
|
-
"rb-text",
|
|
88
|
-
"rb-text-input",
|
|
89
|
-
"rb-switch",
|
|
90
|
-
"rb-select"
|
|
91
|
-
];
|
|
92
|
-
let defined = false;
|
|
93
|
-
function defineElements() {
|
|
94
|
-
if (defined || typeof customElements === "undefined") return;
|
|
95
|
-
defined = true;
|
|
96
|
-
customElements.define("rb-slider", RbSliderElement);
|
|
97
|
-
customElements.define("rb-button", RbButtonElement);
|
|
98
|
-
customElements.define("rb-icon-button", RbIconButtonElement);
|
|
99
|
-
customElements.define("rb-text", RbTextElement);
|
|
100
|
-
customElements.define("rb-text-input", RbTextInputElement);
|
|
101
|
-
customElements.define("rb-switch", RbSwitchElement);
|
|
102
|
-
customElements.define("rb-select", RbSelectElement);
|
|
103
|
-
}
|
|
104
|
-
export {
|
|
105
|
-
RB_ELEMENT_NAMES,
|
|
106
|
-
RbButtonElement,
|
|
107
|
-
RbIconButtonElement,
|
|
108
|
-
RbSelectElement,
|
|
109
|
-
RbSliderElement,
|
|
110
|
-
RbSwitchElement,
|
|
111
|
-
RbTextElement,
|
|
112
|
-
RbTextInputElement,
|
|
113
|
-
defineElements
|
|
114
|
-
};
|
|
115
|
-
//# sourceMappingURL=elements.js.map
|
package/dist/elements.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/elements.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * rb-* remote element contract \u2014 shared by the sandbox (plugin author) and the\n * nexus host. This is the *stable* surface: it must only ever grow additively\n * (new elements / new optional properties), never break existing shapes.\n *\n * Verified against @remote-dom/core@1.11.x:\n * - `RemoteElement` lives in `@remote-dom/core/elements`\n * - static `remoteProperties` (data) + static `remoteEvents` (callbacks)\n */\nimport { RemoteElement } from \"@remote-dom/core/elements\";\n\ntype RbNoMethods = Record<never, never>;\ntype RbNoSlots = Record<never, never>;\ntype RbNoEvents = Record<never, never>;\n\nexport interface RbSliderProps {\n value?: number;\n min?: number;\n max?: number;\n step?: number;\n disabled?: boolean;\n}\n\nexport interface RbButtonProps {\n label?: string;\n variant?: string;\n size?: string;\n disabled?: boolean;\n}\n\nexport interface RbIconButtonProps {\n icon?: string;\n variant?: string;\n size?: string;\n disabled?: boolean;\n}\n\nexport type RbTextProps = Record<never, never>;\n\nexport interface RbTextInputProps {\n value?: string;\n placeholder?: string;\n disabled?: boolean;\n}\n\nexport interface RbSwitchProps {\n checked?: boolean;\n disabled?: boolean;\n}\n\n/** Option shape carried by `rb-select`'s `options` property. */\nexport interface RbSelectOption {\n value: string;\n label: string;\n}\n\nexport interface RbSelectProps {\n value?: string;\n options?: RbSelectOption[];\n placeholder?: string;\n disabled?: boolean;\n}\n\nexport interface RbSliderEvents {\n change(detail: number): void;\n}\n\nexport interface RbPressEvents {\n press(): void;\n}\n\nexport interface RbTextInputEvents {\n input(detail: string): void;\n}\n\nexport interface RbSwitchEvents {\n change(detail: boolean): void;\n}\n\nexport interface RbSelectEvents {\n change(detail: string): void;\n}\n\n/** Slider \u2192 host renders RBSlider (Radix array value, single-thumb contract). */\nexport class RbSliderElement extends RemoteElement<\n RbSliderProps,\n RbNoMethods,\n RbNoSlots,\n RbSliderEvents\n> {\n static get remoteProperties() {\n return {\n value: { type: Number },\n min: { type: Number },\n max: { type: Number },\n step: { type: Number },\n disabled: { type: Boolean },\n };\n }\n static get remoteEvents() {\n return [\"change\"] as const;\n }\n}\n\n/** Button \u2192 host renders RBLabelButton. */\nexport class RbButtonElement extends RemoteElement<\n RbButtonProps,\n RbNoMethods,\n RbNoSlots,\n RbPressEvents\n> {\n static get remoteProperties() {\n return {\n label: { type: String },\n variant: { type: String },\n size: { type: String },\n disabled: { type: Boolean },\n };\n }\n static get remoteEvents() {\n return [\"press\"] as const;\n }\n}\n\n/** Icon button \u2192 host renders RBIconButton with an icon resolved from RBIcons. */\nexport class RbIconButtonElement extends RemoteElement<\n RbIconButtonProps,\n RbNoMethods,\n RbNoSlots,\n RbPressEvents\n> {\n static get remoteProperties() {\n return {\n icon: { type: String },\n variant: { type: String },\n size: { type: String },\n disabled: { type: Boolean },\n };\n }\n static get remoteEvents() {\n return [\"press\"] as const;\n }\n}\n\n/** Plain text \u2014 renders its children as text on the host. */\nexport class RbTextElement extends RemoteElement<\n RbTextProps,\n RbNoMethods,\n RbNoSlots,\n RbNoEvents\n> {\n static get remoteProperties() {\n return {};\n }\n}\n\n/** Text input \u2192 host renders RBTextInput. */\nexport class RbTextInputElement extends RemoteElement<\n RbTextInputProps,\n RbNoMethods,\n RbNoSlots,\n RbTextInputEvents\n> {\n static get remoteProperties() {\n return {\n value: { type: String },\n placeholder: { type: String },\n disabled: { type: Boolean },\n };\n }\n static get remoteEvents() {\n return [\"input\"] as const;\n }\n}\n\n/** Switch \u2192 host renders RBSwitch. */\nexport class RbSwitchElement extends RemoteElement<\n RbSwitchProps,\n RbNoMethods,\n RbNoSlots,\n RbSwitchEvents\n> {\n static get remoteProperties() {\n return {\n checked: { type: Boolean },\n disabled: { type: Boolean },\n };\n }\n static get remoteEvents() {\n return [\"change\"] as const;\n }\n}\n\n/** Select \u2192 host renders RBSelectBox. `options` is `[{value,label}]`. */\nexport class RbSelectElement extends RemoteElement<\n RbSelectProps,\n RbNoMethods,\n RbNoSlots,\n RbSelectEvents\n> {\n static get remoteProperties() {\n return {\n value: { type: String },\n options: { type: Array },\n placeholder: { type: String },\n disabled: { type: Boolean },\n };\n }\n static get remoteEvents() {\n return [\"change\"] as const;\n }\n}\n\n/** Custom element tag names in the contract. */\nexport const RB_ELEMENT_NAMES = [\n \"rb-slider\",\n \"rb-button\",\n \"rb-icon-button\",\n \"rb-text\",\n \"rb-text-input\",\n \"rb-switch\",\n \"rb-select\",\n] as const;\n\nexport type RbElementName = (typeof RB_ELEMENT_NAMES)[number];\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"rb-slider\": RbSliderElement;\n \"rb-button\": RbButtonElement;\n \"rb-icon-button\": RbIconButtonElement;\n \"rb-text\": RbTextElement;\n \"rb-text-input\": RbTextInputElement;\n \"rb-switch\": RbSwitchElement;\n \"rb-select\": RbSelectElement;\n }\n}\n\nlet defined = false;\n\n/**\n * Registers the rb-* custom elements. Safe to call multiple times; only the\n * first call defines anything (subsequent calls are a no-op).\n */\nexport function defineElements(): void {\n if (defined || typeof customElements === \"undefined\") return;\n\n defined = true;\n\n customElements.define(\"rb-slider\", RbSliderElement);\n customElements.define(\"rb-button\", RbButtonElement);\n customElements.define(\"rb-icon-button\", RbIconButtonElement);\n customElements.define(\"rb-text\", RbTextElement);\n customElements.define(\"rb-text-input\", RbTextInputElement);\n customElements.define(\"rb-switch\", RbSwitchElement);\n customElements.define(\"rb-select\", RbSelectElement);\n}\n"],
|
|
5
|
-
"mappings": "AASA,SAAS,qBAAqB;AA2EvB,MAAM,wBAAwB,cAKnC;AAAA,EACA,WAAW,mBAAmB;AAC5B,WAAO;AAAA,MACL,OAAO,EAAE,MAAM,OAAO;AAAA,MACtB,KAAK,EAAE,MAAM,OAAO;AAAA,MACpB,KAAK,EAAE,MAAM,OAAO;AAAA,MACpB,MAAM,EAAE,MAAM,OAAO;AAAA,MACrB,UAAU,EAAE,MAAM,QAAQ;AAAA,IAC5B;AAAA,EACF;AAAA,EACA,WAAW,eAAe;AACxB,WAAO,CAAC,QAAQ;AAAA,EAClB;AACF;AAGO,MAAM,wBAAwB,cAKnC;AAAA,EACA,WAAW,mBAAmB;AAC5B,WAAO;AAAA,MACL,OAAO,EAAE,MAAM,OAAO;AAAA,MACtB,SAAS,EAAE,MAAM,OAAO;AAAA,MACxB,MAAM,EAAE,MAAM,OAAO;AAAA,MACrB,UAAU,EAAE,MAAM,QAAQ;AAAA,IAC5B;AAAA,EACF;AAAA,EACA,WAAW,eAAe;AACxB,WAAO,CAAC,OAAO;AAAA,EACjB;AACF;AAGO,MAAM,4BAA4B,cAKvC;AAAA,EACA,WAAW,mBAAmB;AAC5B,WAAO;AAAA,MACL,MAAM,E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AAuB;AACrC,MAAI,WAAW,OAAO,mBAAmB,YAAa;AAEtD,YAAU;AAEV,iBAAe,OAAO,aAAa,eAAe;AAClD,iBAAe,OAAO,aAAa,eAAe;AAClD,iBAAe,OAAO,kBAAkB,mBAAmB;AAC3D,iBAAe,OAAO,WAAW,aAAa;AAC9C,iBAAe,OAAO,iBAAiB,kBAAkB;AACzD,iBAAe,OAAO,aAAa,eAAe;AAClD,iBAAe,OAAO,aAAa,eAAe;AACpD;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/dist/react.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EACL,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EACjB,MAAM,YAAY,CAAC;AAcpB,KAAK,YAAY,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAEzC,KAAK,2BAA2B,CAC9B,OAAO,EACP,KAAK,EACL,UAAU,GAAG,YAAY,IACvB,KAAK,GACP,UAAU,GAAG;IACX,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,GAAG,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEJ,KAAK,sBAAsB,CACzB,OAAO,EACP,KAAK,EACL,UAAU,GAAG,YAAY,IACvB,aAAa,CAAC,2BAA2B,CAAC,OAAO,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC;AAE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MAAM,EAId,sBAAsB,CAAC,eAAe,EAAE,aAAa,EAAE,kBAAkB,CAAC,CAAC;AAChF,eAAO,MAAM,MAAM,EAId,sBAAsB,CAAC,eAAe,EAAE,aAAa,EAAE,kBAAkB,CAAC,CAAC;AAEhF,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACjD,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var g=Object.defineProperty;var f=a=>{throw TypeError(a)};var h=(a,b,c)=>b in a?g(a,b,{enumerable:!0,configurable:!0,writable:!0,value:c}):a[b]=c;var i=(a,b,c)=>h(a,typeof b!="symbol"?b+"":b,c),d=(a,b,c)=>b.has(a)||f("Cannot "+c);var j=(a,b,c)=>(d(a,b,"read from private field"),c?c.call(a):b.get(a)),k=(a,b,c)=>b.has(a)?f("Cannot add the same private member more than once"):b instanceof WeakSet?b.add(a):b.set(a,c),l=(a,b,c,e)=>(d(a,b,"write to private field"),e?e.call(a,c):b.set(a,c),c),m=(a,b,c)=>(d(a,b,"access private method"),c);export{i as a,j as b,k as c,l as d,m as e};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createContext as o,useContext as e}from"react";var t={action:async()=>{typeof console<"u"&&console.warn("[plugin-ui] rb.action called outside of a host context")},notify:n=>{typeof console<"u"&&console.warn("[plugin-ui] rb.notify (no host):",n)}},i=o(t);function s(){return e(i)}export{i as a,s as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as v,b as P,c as Q,d as ee}from"./chunk-AMCIKVG7.js";var M=class extends CustomEvent{respondWith(t){this.response=t}};var g=new WeakMap;var B=new WeakMap,ce=0;function y(e){let t=B.get(e);return t==null&&(t=String(ce++),k(e,t)),t}function k(e,t){B.set(e,t)}var L=new WeakMap;function S(e){return L.get(e)}var I=new WeakMap;function ae(e){let t=I.get(e);if(t!=null)return t;if(!(!(e instanceof Element)||e.tagName.includes("-"))){t={};for(let{name:r,value:n}of e.attributes)t[r]=n;return t}}var z=new WeakMap;function Y(e){return z.get(e)}function _(e,t,r){let n=L.get(e);if(n==null&&(n={},L.set(e,n)),n[t]===r)return;n[t]=r;let o=g.get(e);o?.mutate([[3,y(e),t,r,1]])}function A(e,t,r){let n=I.get(e);if(n==null&&(n={},I.set(e,n)),n[t]===r)return;r==null?delete n[t]:n[t]=String(r);let o=g.get(e);o?.mutate([[3,y(e),t,r,2]])}function j(e,t,r){let n=z.get(e);if(n==null&&(n={},z.set(e,n)),n[t]===r)return;r==null?delete n[t]:n[t]=r;let o=g.get(e);o?.mutate([[3,y(e),t,r,3]])}function D(e,t){if(g.get(e)!==t&&(g.set(e,t),e.childNodes))for(let n=0;n<e.childNodes.length;n++)D(e.childNodes[n],t)}function O(e){if(g.get(e)!=null&&(g.delete(e),e.childNodes))for(let r=0;r<e.childNodes.length;r++)O(e.childNodes[r])}function T(e){let{nodeType:t}=e;switch(t){case 1:return{id:y(e),type:t,element:e.localName,properties:w(S(e)),attributes:w(ae(e)),eventListeners:w(Y(e)),children:Array.from(e.childNodes).map(T)};case 3:case 8:return{id:y(e),type:t,data:e.data};default:throw new Error(`Cannot serialize node of type ${e.nodeType} (${typeof e.nodeType})`)}}function w(e){return e?{...e}:void 0}function te(e,t,...r){let n=B.get(e),o=g.get(e);if(n==null||o==null)throw new Error(`Cannot call method ${t} on an unconnected node`);return o.call(n,t,...r)}var U=Object.freeze({});var p=class extends HTMLElement{static get observedAttributes(){return this.finalize().__observedAttributes}static get remotePropertyDefinitions(){return this.finalize().__remotePropertyDefinitions}static get remoteAttributeDefinitions(){return this.finalize().__remoteAttributeDefinitions}static get remoteEventDefinitions(){return this.finalize().__remoteEventDefinitions}static get remoteSlotDefinitions(){return this.finalize().__remoteSlotDefinitions}static createProperty(t,r){F(t,r,this.observedAttributes,this.remotePropertyDefinitions,this.__attributeToPropertyMap,this.__eventToPropertyMap)}static finalize(){if(this.hasOwnProperty("__finalized"))return this;this.__finalized=!0;let{slottable:t,remoteSlots:r,remoteProperties:n,remoteAttributes:o,remoteEvents:i,remoteMethods:s}=this,c=Object.getPrototypeOf(this),a=new Set;t&&a.add("slot");let u=new Map,d=new Map,f=new Map,h=new Map,b=new Map,E=new Map;if(typeof c.finalize=="function"&&(c.finalize(),c.observedAttributes.forEach(l=>{a.add(l)}),c.remotePropertyDefinitions.forEach((l,m)=>{h.set(m,l)}),c.remoteAttributeDefinitions.forEach((l,m)=>{b.set(m,l)}),c.remoteEventDefinitions.forEach((l,m)=>{E.set(m,l)}),c.remoteSlotDefinitions.forEach((l,m)=>{f.set(m,l)})),r!=null&&(Array.isArray(r)?r:Object.keys(r)).forEach(m=>{f.set(m,U)}),n!=null&&(Array.isArray(n)?n.forEach(l=>{F(l,void 0,a,h,u,d)}):Object.keys(n).forEach(l=>{F(l,n[l],a,h,u,d)})),o?.forEach(l=>{b.set(l,U),a.add(l)}),i!=null&&(Array.isArray(i)?i.forEach(l=>{E.set(l,U)}):Object.keys(i).forEach(l=>{E.set(l,i[l])})),s!=null)if(Array.isArray(s))for(let l of s)this.prototype[l]=function(...m){return this.callRemoteMethod(l,...m)};else Object.assign(this,s);return Object.defineProperties(this,{__observedAttributes:{value:[...a],enumerable:!1},__remoteSlotDefinitions:{value:f,enumerable:!1},__remotePropertyDefinitions:{value:h,enumerable:!1},__remoteAttributeDefinitions:{value:b,enumerable:!1},__remoteEventDefinitions:{value:E,enumerable:!1},__attributeToPropertyMap:{value:u,enumerable:!1},__eventToPropertyMap:{value:d,enumerable:!1}}),this}constructor(){super(),this.constructor.finalize();let t={},r={},n=Object.getPrototypeOf(this),o=this.constructor;for(let[i,s]of o.remotePropertyDefinitions.entries()){let c=s.name;if(n.hasOwnProperty(i))continue;i===c&&(r[i]=s.default);let a={configurable:!0,enumerable:i===c,get:()=>S(this)?.[c],set:u=>{_(this,c,u)}};t[i]=a}for(let[i,s]of o.remoteEventDefinitions.entries()){let c=s.property??!0;if(!c)continue;let a=c===!0?`on${i}`:c;t[a]={configurable:!0,enumerable:!0,get:()=>N(this).properties.get(a)??null,set:u=>{let d=N(this),f=d.properties.get(a);if(typeof u=="function"){let h=function(...b){return u.call(this,...b)};d.properties.set(a,h),this.addEventListener(i,h)}else d.properties.delete(a);f&&this.removeEventListener(i,f)}}}Object.defineProperties(this,t),Object.assign(this,r)}attributeChangedCallback(t,r,n){if(t==="slot"&&this.constructor.slottable){A(this,t,n?String(n):void 0);return}let{remotePropertyDefinitions:o,remoteAttributeDefinitions:i,__attributeToPropertyMap:s}=this.constructor;if(i.has(t)){A(this,t,n);return}let c=s.get(t),a=c==null?c:o.get(c);a!=null&&(this[c]=ue(n,a.type))}connectedCallback(){for(let[t,r]of this.constructor.remoteEventDefinitions.entries())r.bubbles&&this.addEventListener(t,ne)}disconnectedCallback(){for(let[t,r]of this.constructor.remoteEventDefinitions.entries())r.bubbles&&this.removeEventListener(t,ne)}addEventListener(t,r,n){let{remoteEventDefinitions:o,__eventToPropertyMap:i}=this.constructor,s=o.get(t),c=i.get(t);if(s==null&&c==null)return super.addEventListener(t,r,n);let a=N(this),u=le.call(this,t,{property:c,definition:s}),d=typeof n=="object"&&n?.once?(...h)=>{let b=typeof r=="object"?r.handleEvent(...h):r.call(this,...h);return W.call(this,t,r,f),b}:r,f=[d,u];u.listeners.add(r),a.listeners.set(r,f),super.addEventListener(t,d,n),typeof n=="object"&&n.signal&&n.signal.addEventListener("abort",()=>{W.call(this,t,r,f)},{once:!0}),s?j(this,t,u.dispatch):_(this,c,u.dispatch)}removeEventListener(t,r,n){let o=$.get(this)?.listeners.get(r),i=o?o[0]:r;super.removeEventListener(t,i,n),o!=null&&W.call(this,t,r,o)}updateRemoteProperty(t,r){_(this,t,r)}updateRemoteAttribute(t,r){A(this,t,r)}callRemoteMethod(t,...r){return te(this,t,...r)}};v(p,"slottable",!0),v(p,"__finalized",!0),v(p,"__observedAttributes",[]),v(p,"__attributeToPropertyMap",new Map),v(p,"__eventToPropertyMap",new Map),v(p,"__remotePropertyDefinitions",new Map),v(p,"__remoteAttributeDefinitions",new Map),v(p,"__remoteEventDefinitions",new Map),v(p,"__remoteSlotDefinitions",new Map);var $=new WeakMap;function N(e){let t=$.get(e);return t||(t={events:new Map,properties:new Map,listeners:new WeakMap},$.set(e,t),t)}function le(e,{property:t,definition:r}){let n=N(this),o=n.events.get(e);return o==null&&(o={name:e,property:t,definition:r,listeners:new Set,dispatch:(...i)=>{let s=r?.dispatchEvent?.apply(this,i)??new M(e,{detail:i[0],bubbles:r?.bubbles});return this.dispatchEvent(s),s.response}},n.events.set(e,o)),o}function W(e,t,r){let n=N(this),o=r[1];o.listeners.delete(t),n.listeners.delete(t),!(o.listeners.size>0)&&(n.events.delete(e),o.property?S(this)?.[o.property]===o.dispatch&&_(this,o.property,void 0):Y(this)?.[e]===o.dispatch&&j(this,e,void 0))}function F(e,t,r,n,o,i){if(n.has(e))return n.get(e);let s=e[0]==="o"&&e[1]==="n",c=t??{},{alias:a}=c,{type:u=s?Function:String,attribute:d=u!==Function,event:f=s,default:h=u===Boolean?!1:void 0}=c;if(a==null){let m=e.toLowerCase();m!==e&&(a=[m]),s&&(a??(a=[]),a.unshift(`_${e}`))}let b;d===!0?b=re(e):typeof d=="string"&&(b=d),b&&(Array.isArray(r)?r.push(b):r.add(b),o.set(b,e));let E;f===!0?E=re(s?e.slice(2):e):typeof f=="string"&&(E=f),E&&i.set(E,e);let l={name:e,type:u,alias:a,event:E,attribute:b,default:h};if(n.set(e,l),a)for(let m of a)n.set(m,l);return l}function ue(e,t){if(e!=null)switch(t){case Boolean:return e!=null&&e!=="false";case Object:case Array:try{return JSON.parse(e)}catch{return}case String:return String(e);case Number:return Number.parseFloat(e);case Function:return;default:return t.parse?.(e)}}function re(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function ne(){}var R,H=class extends MutationObserver{constructor(r){super(n=>{let o=[],i=[];for(let s of n){let c=y(s.target);if(s.type==="childList"){let a=s.previousSibling?pe(s.previousSibling,s.target.childNodes)+1:0;s.removedNodes.forEach(u=>{O(u),i.push([1,c,a])}),s.addedNodes.forEach((u,d)=>{o.some(f=>f===u||f.contains(u))||(o.push(u),D(u,r),i.push([0,c,T(u),a+d]))})}else s.type==="characterData"?i.push([2,c,s.target.textContent??""]):s.type==="attributes"&&s.attributeName!=null&&s.target instanceof Element&&!s.target.tagName.includes("-")&&i.push([3,c,s.attributeName,s.target.getAttribute(s.attributeName)])}r.mutate(i)});Q(this,R);this.connection=r,ee(this,R,new Set)}observe(r,n){let o=n?.id??"~";if(k(r,o),P(this,R).add(r),n?.initial!==!1&&r.childNodes.length>0){if(o!=="~")this.connection.mutate([[0,"~",T(r),P(this,R).size-1]]);else if(r.childNodes.length>0){let i=[];for(let s=0;s<r.childNodes.length;s++){let c=r.childNodes[s];D(c,this.connection),i.push([0,"~",T(c),s])}this.connection.mutate(i)}}super.observe(r,{subtree:!0,childList:!0,attributes:!0,characterData:!0,...n})}disconnect({empty:r=!1}={}){if(r&&P(this,R).size>0){let n=[];for(let o of P(this,R)){O(o);let i=y(o);if(i==="~")for(let s=0;s<o.childNodes.length;s++)n.push([1,i,0]);else n.push([1,"~",0])}this.connection.mutate(n)}P(this,R).clear(),super.disconnect()}};R=new WeakMap;function pe(e,t){for(let r=0;r<t.length;r++)if(t[r]===e)return r;return-1}var V=class extends p{static get remoteProperties(){return{value:{type:Number},min:{type:Number},max:{type:Number},step:{type:Number},disabled:{type:Boolean}}}static get remoteEvents(){return["change"]}},J=class extends p{static get remoteProperties(){return{label:{type:String},variant:{type:String},size:{type:String},disabled:{type:Boolean}}}static get remoteEvents(){return["press"]}},K=class extends p{static get remoteProperties(){return{icon:{type:String},variant:{type:String},size:{type:String},disabled:{type:Boolean}}}static get remoteEvents(){return["press"]}},X=class extends p{static get remoteProperties(){return{}}},Z=class extends p{static get remoteProperties(){return{value:{type:String},placeholder:{type:String},disabled:{type:Boolean}}}static get remoteEvents(){return["input"]}},q=class extends p{static get remoteProperties(){return{checked:{type:Boolean},disabled:{type:Boolean}}}static get remoteEvents(){return["change"]}},G=class extends p{static get remoteProperties(){return{value:{type:String},options:{type:Array},placeholder:{type:String},disabled:{type:Boolean}}}static get remoteEvents(){return["change"]}},De=["rb-slider","rb-button","rb-icon-button","rb-text","rb-text-input","rb-switch","rb-select"],ie=!1;function Oe(){ie||typeof customElements>"u"||(ie=!0,customElements.define("rb-slider",V),customElements.define("rb-button",J),customElements.define("rb-icon-button",K),customElements.define("rb-text",X),customElements.define("rb-text-input",Z),customElements.define("rb-switch",q),customElements.define("rb-select",G))}export{H as a,V as b,J as c,K as d,X as e,Z as f,q as g,G as h,De as i,Oe as j};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as v}from"./chunks/chunk-GJWPOWHG.js";import{a as Q,j as X}from"./chunks/chunk-JRCDA3EG.js";import{a as I,b as c,c as p,d as L,e as m}from"./chunks/chunk-AMCIKVG7.js";var W=Symbol.for("quilt.threads.serialize"),tt=Symbol.for("quilt.threads.transferable");var z=class extends AbortController{constructor(...t){super();let e=t.find(r=>r.aborted);if(e)this.abort(e.reason);else{let r=n=>this.abort(n.target.reason),o={signal:this.signal};for(let n of t)n.addEventListener("abort",r,o)}}};var C=class extends Error{constructor(){super("You attempted to call a function on a closed thread.")}};var at="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";function N(a=21){let t="",e=crypto.getRandomValues(new Uint8Array(a));for(let r=0;r<a;r++)t+=at[63&e[r]];return t}var A,y,x,O,_,et,F=class{constructor(){p(this,_);p(this,A,new Map);p(this,y,new Map);p(this,x,new Map);p(this,O,new WeakMap)}get(t){return c(this,y).get(t)}release(t){let e=c(this,y).get(t);return e&&(c(this,y).delete(t),c(this,A).delete(e)),!!e}serialize(t){let e=c(this,A).get(t);return e==null&&(e=N(),c(this,A).set(t,e),c(this,y).set(e,t)),e}deserialize(t,e){let r=c(this,x).get(t)?.deref();return r||(r=(...o)=>{if(!c(this,x).has(t))throw new Error("You attempted to call a function that was already revoked.");return e.call((n,s,l)=>{e.messages.send([3,n,t,s],l)},o)},m(this,_,et).call(this,e)?.register(r,t),c(this,x).set(t,new WeakRef(r)),r)}};A=new WeakMap,y=new WeakMap,x=new WeakMap,O=new WeakMap,_=new WeakSet,et=function(t){let e=c(this,O).get(t);if(!(typeof FinalizationRegistry>"u"))return e||(e=new FinalizationRegistry(r=>{t.messages.send([5,r])}),c(this,O).set(t,e)),e};function rt(a){return a!=null&&(Symbol.asyncIterator in a||Symbol.iterator in a)&&typeof a.next=="function"}function Y(a){if(a==null||typeof a!="object")return!1;let t=Object.getPrototypeOf(a);return t==null||t===Object.prototype}var V="_@f",ot="_@i",T,M,h,k,w,U=class{constructor(t){p(this,h);p(this,T);p(this,M);L(this,T,t?.serialize),L(this,M,t?.deserialize)}serialize(t,e,r){return m(this,h,k).call(this,t,e,r)}deserialize(t,e){return m(this,h,w).call(this,t,e)}};T=new WeakMap,M=new WeakMap,h=new WeakSet,k=function(t,e,r,o=new Map,n=!1){if(t==null)return t;if(o.has(t))return o.get(t);if(o.set(t,void 0),typeof t=="object"){if(c(this,T)&&!n){let i=c(this,T).call(this,t,f=>m(this,h,k).call(this,f,e,r,o,!0),e,r);if(i!==void 0)return o.set(t,i),i}if(t[tt])return r?.push(t),o.set(t,t),t;let s=i=>m(this,h,k).call(this,i,e,r,o);if(typeof t[W]=="function"){let i=t[W]({serialize:s});return o.set(t,i),i}if(Array.isArray(t)){let i=t.map(f=>s(f));return o.set(t,i),i}if(t instanceof Map){let i=[...t.entries()].map(([E,g])=>[s(E),s(g)]),f=new Map(i);return o.set(t,f),f}if(t instanceof Set){let i=[...t].map(E=>s(E)),f=new Set(i);return o.set(t,f),f}let l=rt(t);if(Y(t)||l){let i={};for(let f of Object.keys(t))i[f]=s(t[f]);return l&&(i.next??(i.next=s(t.next.bind(t))),i.return??(i.return=s(t.return.bind(t))),i.throw??(i.throw=s(t.throw.bind(t))),i[ot]=!0),o.set(t,i),i}}if(typeof t=="function"){let s=e.functions.serialize(t,e,r),l={[V]:s};return o.set(t,l),l}return o.set(t,t),t},w=function(t,e,r=!1){if(t==null)return t;if(typeof t=="object"){if(c(this,M)&&!r){let n=c(this,M).call(this,t,s=>m(this,h,w).call(this,s,e,!0),e);if(n!==void 0)return n}if(t==null)return t;if(Array.isArray(t))return t.map(n=>m(this,h,w).call(this,n,e));if(t instanceof Map)return new Map([...t].map(([n,s])=>[m(this,h,w).call(this,n,e),m(this,h,w).call(this,s,e)]));if(t instanceof Set)return new Set([...t].map(n=>m(this,h,w).call(this,n,e)));if(V in t)return e.functions.deserialize(t[V],e);if(!Y(t))return t;let o={};for(let n of Object.keys(t))n===ot?o[Symbol.asyncIterator]=()=>o:o[n]=m(this,h,w).call(this,t[n],e);return o}return t};var b,S,u,Z,nt,q,it,j=class{constructor(t,{imports:e,exports:r,functions:o=new F,serialization:n=new U,signal:s}={}){p(this,u);p(this,b);p(this,S,new Map);this.messages=t,L(this,b,s?new z(s):new AbortController),this.exports=r??{},this.imports=pt(m(this,u,nt).bind(this),e),this.functions=o,this.serialization=n,this.functions.start?.(this),this.serialization.start?.(this),this.signal.addEventListener("abort",()=>{for(let l of c(this,S).keys())m(this,u,q).call(this,l,void 0,new C);c(this,S).clear()},{once:!0}),t.listen(async l=>{if(!(Array.isArray(l)&&typeof l[0]=="number"))return;let f=l;switch(f[0]){case 1:{let[,E,g,P]=f,G=this.exports[g]??(()=>{throw new Error(`No '${g}' method is exported from this thread`)});await m(this,u,Z).call(this,G,P,(D,B,H)=>{this.messages.send([2,E,D,B],H)});break}case 3:{let[,E,g,P]=f,G=this.functions.get(g,this)??ht;await m(this,u,Z).call(this,G,P,(D,B,H)=>{this.messages.send([4,E,D,B],H)});break}case 2:case 4:{m(this,u,q).call(this,...f.slice(1));break}case 5:{let E=f[1];this.functions.release(E,this);break}}},{signal:this.signal})}get signal(){return c(this,b).signal}get closed(){return c(this,b).signal.aborted}close(){c(this,b).abort()}call(t,e){if(this.closed)return Promise.reject(new C);let r=[],o=this.serialization.serialize(e,this,r),n=N(),s=m(this,u,it).call(this,n);return t(n,o,r),s}};b=new WeakMap,S=new WeakMap,u=new WeakSet,Z=async function(t,e,r){try{let o=this.functions.call?await this.functions.call(t,e,this):await t(...this.serialization.deserialize(e,this)),n=[],s=this.serialization.serialize(o,this,n);r(s,void 0,n)}catch(o){r(void 0,this.serialization.serialize(o,this))}},nt=function(t){return(...e)=>{try{if(typeof t!="string"&&typeof t!="number")throw new Error(`Can\u2019t call a symbol method on a thread: ${t.toString()}`);return this.call((r,o,n)=>{this.messages.send([1,r,t,o],n)},e)}catch(r){return Promise.reject(r)}}},q=function(...t){let e=t[0],r=c(this,S).get(e);r&&(r(...t),c(this,S).delete(e))},it=function(t){let e=new Promise((r,o)=>{c(this,S).set(t,(n,s,l)=>{l==null?r(this.serialization.deserialize(s,this)):o(this.serialization.deserialize(l,this))})});return Object.defineProperty(e,Symbol.asyncIterator,{async*value(){let r=await e;Object.defineProperty(r,Symbol.asyncIterator,{value:()=>r}),yield*r}}),e};function pt(a,t){let e;if(t==null){if(typeof Proxy!="function")throw new Error("You must pass an array of callable methods in environments without Proxies.");let r=new Map;e=new Proxy({},{get(o,n){if(r.has(n))return r.get(n);let s=a(n);return r.set(n,s),s}})}else{e={};for(let r of t)Object.defineProperty(e,r,{value:a(r),writable:!1,configurable:!0,enumerable:!0})}return e}function ht(){throw new Error("You attempted to call a function that is not stored. It may have already been released.")}var d=class d extends j{static from(t,e){return new d(t,e)}static import(t,e){return new d(t,e).imports}static export(t,e,r){new d(t,{...r,exports:e})}constructor(t,{targetOrigin:e="*",...r}={}){super(ut(t,{targetOrigin:e}),r),this.window=t}};I(d,"iframe",Object.assign((t,e)=>d.from(K(t),e),{import:(t,e)=>d.import(K(t),e),export:(t,e,r)=>d.export(K(t),e,r)})),I(d,"parent",Object.assign(t=>d.from($(),t),{import:t=>d.import($(),t),export:(t,e)=>d.export($(),t,e)})),I(d,"opener",Object.assign(t=>d.from(J(),t),{import:t=>d.import(J(),t),export:(t,e)=>d.export(J(),t,e)}));var R=d;function J(){if(typeof window>"u"||window.opener==null)throw new Error("No opener window found");return window.opener}function $(){if(typeof window>"u"||window.parent==null||window.parent===window)throw new Error("No parent window found");return window.parent}function K(a){if(a.contentWindow==null)throw new Error("No content window found");return a.contentWindow}function ut(a,{targetOrigin:t="*"}={}){let e=function(o,n){a.postMessage(o,t,n)};return{send(r,o){return e(r,o)},listen(r,{signal:o}){self.addEventListener("message",n=>{n.source===a&&r(n.data)},{signal:o})}}}import{createElement as st}from"react";import{createRoot as Et}from"react-dom/client";function $t(a){X(),R.parent.import({targetOrigin:"*"}).connect().then(({connection:e,action:r,notify:o})=>{let n={action:(i,f)=>Promise.resolve(r(i,f)),notify:(i,f)=>o(i,f)},s=document.createElement("remote-root");document.body.append(s),new Q(e).observe(s),Et(s).render(st(v.Provider,{value:n},st(a)))})}export{$t as connect};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i}from"./chunks/chunk-JRCDA3EG.js";import"./chunks/chunk-AMCIKVG7.js";export{h as RB_ELEMENT_NAMES,b as RbButtonElement,c as RbIconButtonElement,g as RbSelectElement,a as RbSliderElement,f as RbSwitchElement,d as RbTextElement,e as RbTextInputElement,i as defineElements};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as A}from"./chunks/chunk-GJWPOWHG.js";import{b as d,c as x,d as h,e as S,f as C,g as y,h as g}from"./chunks/chunk-JRCDA3EG.js";import"./chunks/chunk-AMCIKVG7.js";import{forwardRef as L,useRef as T,isValidElement as k,cloneElement as M,createElement as I,useLayoutEffect as O}from"react";function o(n,w=customElements.get(n),{slotProps:m=!0,eventProps:B={}}={}){let N=!!m,c=(typeof m=="object"?m.wrapper:void 0)??!0,E=typeof c=="string"?c:c?"remote-fragment":!1,u=L(function(l,i){let a=T(),v=T(),r={},R=V(l.children);for(let e in l){let t=l[e];if(e==="slot"){r.slot=t;continue}if(N&&w.remoteSlotDefinitions.has(e)&&k(t)){E?R.push(I(E,{slot:e},t)):R.push(M(t,{slot:e}));continue}r[e]=t}return O(()=>{let e=a.current;if(e!=null){for(let t in r){if(t==="children")continue;let b=v.current?.[t],s=r[t];if(b===s)continue;let P=B[t];if(P){let f=P.event;b&&e.removeEventListener(f,b),s&&e.addEventListener(f,s);continue}if(t in e){e[t]=r[t];continue}s==null?e.removeAttribute(t):e.setAttribute(t,String(s))}v.current=r}}),I(n,{ref:e=>{a.current=e,typeof i=="function"?i(e):i!=null&&(i.current=e)}},...R)});return u.displayName=`RemoteComponent(${n})`,u}function V(n){return n==null?[]:Array.isArray(n)?[...n]:[n]}var p=n=>({eventProps:n}),G=o("rb-slider",d,p({onChange:{event:"change"}})),H=o("rb-button",x,p({onPress:{event:"press"}})),J=o("rb-icon-button",h,p({onPress:{event:"press"}})),K=o("rb-text",S),Q=o("rb-text-input",C,p({onInput:{event:"input"}})),U=o("rb-switch",y,p({onChange:{event:"change"}})),X=o("rb-select",g,p({onChange:{event:"change"}}));export{H as Button,J as IconButton,X as Select,G as Slider,U as Switch,K as Text,Q as TextInput,A as useRb};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b}from"./chunks/chunk-GJWPOWHG.js";import"./chunks/chunk-AMCIKVG7.js";export{a as RbContext,b as useRb};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./react-runtime.js"; export { default } from "./react-runtime.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./react-runtime.js"; export { default } from "./react-runtime.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./react-runtime.js"; export { default } from "./react-runtime.js";
|