@rozenite/controls-plugin 1.11.0 → 1.12.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.
@@ -1,73 +1,73 @@
1
- import { useRozeniteDevToolsClient as S } from "@rozenite/plugin-bridge";
2
- import { useMemo as E, useRef as P, useEffect as h } from "react";
3
- import { useRozenitePluginAgentTool as f } from "@rozenite/agent-bridge";
4
- import { defineAgentToolContract as g } from "@rozenite/agent-shared";
5
- const U = (o, e) => o ? o(e) : { valid: !0 }, z = (o) => o.type === "text" ? o : o.type === "toggle" ? {
6
- id: o.id,
7
- type: o.type,
8
- title: o.title,
9
- value: o.value,
10
- description: o.description,
11
- disabled: o.disabled
12
- } : o.type === "button" ? {
13
- id: o.id,
14
- type: o.type,
15
- title: o.title,
16
- actionLabel: o.actionLabel,
17
- description: o.description,
18
- disabled: o.disabled
19
- } : o.type === "select" ? {
20
- id: o.id,
21
- type: o.type,
22
- title: o.title,
23
- value: o.value,
24
- options: o.options,
25
- description: o.description,
26
- disabled: o.disabled
1
+ import { useRozeniteDevToolsClient as x } from "@rozenite/plugin-bridge";
2
+ import { useRef as z, useSyncExternalStore as A, useEffect as h, useMemo as C } from "react";
3
+ import { useRozenitePluginAgentTool as v } from "@rozenite/agent-bridge";
4
+ import { defineAgentToolContract as w } from "@rozenite/agent-shared";
5
+ const U = (t, n) => t ? t(n) : { valid: !0 }, D = (t) => t.type === "text" ? t : t.type === "toggle" ? {
6
+ id: t.id,
7
+ type: t.type,
8
+ title: t.title,
9
+ value: t.value,
10
+ description: t.description,
11
+ disabled: t.disabled
12
+ } : t.type === "button" ? {
13
+ id: t.id,
14
+ type: t.type,
15
+ title: t.title,
16
+ actionLabel: t.actionLabel,
17
+ description: t.description,
18
+ disabled: t.disabled
19
+ } : t.type === "select" ? {
20
+ id: t.id,
21
+ type: t.type,
22
+ title: t.title,
23
+ value: t.value,
24
+ options: t.options,
25
+ description: t.description,
26
+ disabled: t.disabled
27
27
  } : {
28
- id: o.id,
29
- type: o.type,
30
- title: o.title,
31
- value: o.value,
32
- placeholder: o.placeholder,
33
- applyLabel: o.applyLabel,
34
- description: o.description,
35
- disabled: o.disabled
36
- }, A = (o) => o.map((e) => ({
37
- id: e.id,
38
- title: e.title,
39
- description: e.description,
40
- items: e.items.map(z)
41
- })), D = (o) => {
42
- const e = /* @__PURE__ */ new Map();
43
- return o.forEach((n) => {
44
- n.items.forEach((t) => {
45
- const i = `${n.id}:${t.id}`;
46
- t.type === "toggle" && e.set(i, {
28
+ id: t.id,
29
+ type: t.type,
30
+ title: t.title,
31
+ value: t.value,
32
+ placeholder: t.placeholder,
33
+ applyLabel: t.applyLabel,
34
+ description: t.description,
35
+ disabled: t.disabled
36
+ }, m = (t) => t.map((n) => ({
37
+ id: n.id,
38
+ title: n.title,
39
+ description: n.description,
40
+ items: n.items.map(D)
41
+ })), O = (t) => {
42
+ const n = /* @__PURE__ */ new Map();
43
+ return t.forEach((r) => {
44
+ r.items.forEach((s) => {
45
+ const e = `${r.id}:${s.id}`;
46
+ s.type === "toggle" && n.set(e, {
47
47
  type: "toggle",
48
- validate: t.validate,
49
- onUpdate: t.onUpdate
50
- }), t.type === "button" && e.set(i, {
48
+ validate: s.validate,
49
+ onUpdate: s.onUpdate
50
+ }), s.type === "button" && n.set(e, {
51
51
  type: "button",
52
- onPress: t.onPress
53
- }), t.type === "select" && e.set(i, {
52
+ onPress: s.onPress
53
+ }), s.type === "select" && n.set(e, {
54
54
  type: "select",
55
- validate: t.validate,
56
- onUpdate: t.onUpdate
57
- }), t.type === "input" && e.set(i, {
55
+ validate: s.validate,
56
+ onUpdate: s.onUpdate
57
+ }), s.type === "input" && n.set(e, {
58
58
  type: "input",
59
- validate: t.validate,
60
- onUpdate: t.onUpdate
59
+ validate: s.validate,
60
+ onUpdate: s.onUpdate
61
61
  });
62
62
  });
63
- }), e;
64
- }, R = (o, e) => `${o}:${e}`, b = "@rozenite/controls-plugin", v = {
65
- listSections: g({
63
+ }), n;
64
+ }, P = (t, n) => `${t}:${n}`, $ = "@rozenite/controls-plugin", E = {
65
+ listSections: w({
66
66
  name: "list-sections",
67
67
  description: "List all controls sections with their item IDs, types, and titles. Does not include values — call get-item for that.",
68
68
  inputSchema: { type: "object", properties: {} }
69
69
  }),
70
- getItem: g({
70
+ getItem: w({
71
71
  name: "get-item",
72
72
  description: "Get full details of a single controls item including its current value. For select items this includes available options.",
73
73
  inputSchema: {
@@ -79,7 +79,7 @@ const U = (o, e) => o ? o(e) : { valid: !0 }, z = (o) => o.type === "text" ? o :
79
79
  required: ["sectionId", "itemId"]
80
80
  }
81
81
  }),
82
- setValue: g({
82
+ setValue: w({
83
83
  name: "set-value",
84
84
  description: "Update the value of a toggle, select, or input item. Runs the validate callback when present. Fails for text (read-only) and button items.",
85
85
  inputSchema: {
@@ -94,7 +94,7 @@ const U = (o, e) => o ? o(e) : { valid: !0 }, z = (o) => o.type === "text" ? o :
94
94
  required: ["sectionId", "itemId", "value"]
95
95
  }
96
96
  }),
97
- pressButton: g({
97
+ pressButton: w({
98
98
  name: "press-button",
99
99
  description: "Trigger a button item's action. Fails if the item is not a button or is disabled.",
100
100
  inputSchema: {
@@ -106,321 +106,385 @@ const U = (o, e) => o ? o(e) : { valid: !0 }, z = (o) => o.type === "text" ? o :
106
106
  required: ["sectionId", "itemId"]
107
107
  }
108
108
  })
109
- }, w = (o, e, n) => {
110
- const t = o.find((s) => s.id === e);
111
- if (!t) {
112
- const s = o.map((u) => u.id).join(", ");
109
+ }, R = (t, n, r) => {
110
+ const s = t.find((i) => i.id === n);
111
+ if (!s) {
112
+ const i = t.map((o) => o.id).join(", ");
113
113
  throw new Error(
114
- `Section "${e}" not found. Available: ${s || "(none)"}`
114
+ `Section "${n}" not found. Available: ${i || "(none)"}`
115
115
  );
116
116
  }
117
- const i = t.items.find((s) => s.id === n);
118
- if (!i) {
119
- const s = t.items.map((u) => u.id).join(", ");
117
+ const e = s.items.find((i) => i.id === r);
118
+ if (!e) {
119
+ const i = s.items.map((o) => o.id).join(", ");
120
120
  throw new Error(
121
- `Item "${n}" not found in section "${e}". Available: ${s || "(none)"}`
121
+ `Item "${r}" not found in section "${n}". Available: ${i || "(none)"}`
122
122
  );
123
123
  }
124
- return { section: t, item: i };
125
- }, L = (o) => {
126
- f({
127
- pluginId: b,
128
- tool: v.listSections,
124
+ return { section: s, item: e };
125
+ }, L = (t, n = !0) => {
126
+ v({
127
+ pluginId: $,
128
+ tool: E.listSections,
129
+ enabled: n,
129
130
  handler: () => ({
130
- sections: o.map((e) => ({
131
- id: e.id,
132
- title: e.title,
133
- description: e.description,
134
- items: e.items.map((n) => ({
135
- id: n.id,
136
- type: n.type,
137
- title: n.title,
138
- disabled: "disabled" in n ? n.disabled : void 0
131
+ sections: t().map((r) => ({
132
+ id: r.id,
133
+ title: r.title,
134
+ description: r.description,
135
+ items: r.items.map((s) => ({
136
+ id: s.id,
137
+ type: s.type,
138
+ title: s.title,
139
+ disabled: "disabled" in s ? s.disabled : void 0
139
140
  }))
140
141
  }))
141
142
  })
142
- }), f({
143
- pluginId: b,
144
- tool: v.getItem,
145
- handler: ({ sectionId: e, itemId: n }) => {
146
- const { item: t } = w(o, e, n);
147
- return t.type === "text" ? {
148
- sectionId: e,
143
+ }), v({
144
+ pluginId: $,
145
+ tool: E.getItem,
146
+ enabled: n,
147
+ handler: ({ sectionId: r, itemId: s }) => {
148
+ const { item: e } = R(t(), r, s);
149
+ return e.type === "text" ? {
150
+ sectionId: r,
149
151
  item: {
150
- id: t.id,
151
- type: t.type,
152
- title: t.title,
153
- value: t.value,
154
- description: t.description
152
+ id: e.id,
153
+ type: e.type,
154
+ title: e.title,
155
+ value: e.value,
156
+ description: e.description
155
157
  }
156
- } : t.type === "toggle" ? {
157
- sectionId: e,
158
+ } : e.type === "toggle" ? {
159
+ sectionId: r,
158
160
  item: {
159
- id: t.id,
160
- type: t.type,
161
- title: t.title,
162
- value: t.value,
163
- description: t.description,
164
- disabled: t.disabled
161
+ id: e.id,
162
+ type: e.type,
163
+ title: e.title,
164
+ value: e.value,
165
+ description: e.description,
166
+ disabled: e.disabled
165
167
  }
166
- } : t.type === "button" ? {
167
- sectionId: e,
168
+ } : e.type === "button" ? {
169
+ sectionId: r,
168
170
  item: {
169
- id: t.id,
170
- type: t.type,
171
- title: t.title,
172
- actionLabel: t.actionLabel,
173
- description: t.description,
174
- disabled: t.disabled
171
+ id: e.id,
172
+ type: e.type,
173
+ title: e.title,
174
+ actionLabel: e.actionLabel,
175
+ description: e.description,
176
+ disabled: e.disabled
175
177
  }
176
- } : t.type === "select" ? {
177
- sectionId: e,
178
+ } : e.type === "select" ? {
179
+ sectionId: r,
178
180
  item: {
179
- id: t.id,
180
- type: t.type,
181
- title: t.title,
182
- value: t.value,
183
- options: t.options,
184
- description: t.description,
185
- disabled: t.disabled
181
+ id: e.id,
182
+ type: e.type,
183
+ title: e.title,
184
+ value: e.value,
185
+ options: e.options,
186
+ description: e.description,
187
+ disabled: e.disabled
186
188
  }
187
189
  } : {
188
- sectionId: e,
190
+ sectionId: r,
189
191
  item: {
190
- id: t.id,
191
- type: t.type,
192
- title: t.title,
193
- value: t.value,
194
- placeholder: t.placeholder,
195
- applyLabel: t.applyLabel,
196
- description: t.description,
197
- disabled: t.disabled
192
+ id: e.id,
193
+ type: e.type,
194
+ title: e.title,
195
+ value: e.value,
196
+ placeholder: e.placeholder,
197
+ applyLabel: e.applyLabel,
198
+ description: e.description,
199
+ disabled: e.disabled
198
200
  }
199
201
  };
200
202
  }
201
- }), f({
202
- pluginId: b,
203
- tool: v.setValue,
204
- handler: async ({ sectionId: e, itemId: n, value: t }) => {
205
- const { item: i } = w(o, e, n);
203
+ }), v({
204
+ pluginId: $,
205
+ tool: E.setValue,
206
+ enabled: n,
207
+ handler: async ({ sectionId: r, itemId: s, value: e }) => {
208
+ const { item: i } = R(t(), r, s);
206
209
  if (i.type === "text")
207
210
  throw new Error(
208
- `Item "${n}" is a read-only text item and cannot be updated.`
211
+ `Item "${s}" is a read-only text item and cannot be updated.`
209
212
  );
210
213
  if (i.type === "button")
211
214
  throw new Error(
212
- `Item "${n}" is a button. Use press-button to trigger its action.`
215
+ `Item "${s}" is a button. Use press-button to trigger its action.`
213
216
  );
214
217
  if (i.disabled)
215
- throw new Error(`Item "${n}" is disabled.`);
218
+ throw new Error(`Item "${s}" is disabled.`);
216
219
  if (i.type === "toggle") {
217
- if (typeof t != "boolean")
220
+ if (typeof e != "boolean")
218
221
  throw new Error(
219
- `Expected boolean value for toggle item "${n}".`
222
+ `Expected boolean value for toggle item "${s}".`
220
223
  );
221
224
  if (i.validate) {
222
- const s = i.validate(t);
223
- if (!s.valid)
224
- throw new Error(s.message);
225
+ const o = i.validate(e);
226
+ if (!o.valid)
227
+ throw new Error(o.message);
225
228
  }
226
- return await i.onUpdate(t), { applied: !0, sectionId: e, itemId: n };
229
+ return await i.onUpdate(e), { applied: !0, sectionId: r, itemId: s };
227
230
  }
228
- if (typeof t != "string")
231
+ if (typeof e != "string")
229
232
  throw new Error(
230
- `Expected string value for ${i.type} item "${n}".`
233
+ `Expected string value for ${i.type} item "${s}".`
231
234
  );
232
235
  if (i.type === "select") {
233
- const s = i.options.map((u) => u.value);
234
- if (!s.includes(t))
236
+ const o = i.options.map((p) => p.value);
237
+ if (!o.includes(e))
235
238
  throw new Error(
236
- `Invalid option "${t}" for item "${n}". Valid options: ${s.join(", ")}`
239
+ `Invalid option "${e}" for item "${s}". Valid options: ${o.join(", ")}`
237
240
  );
238
241
  }
239
242
  if (i.validate) {
240
- const s = i.validate(t);
241
- if (!s.valid)
242
- throw new Error(s.message);
243
+ const o = i.validate(e);
244
+ if (!o.valid)
245
+ throw new Error(o.message);
243
246
  }
244
- return await i.onUpdate(t), { applied: !0, sectionId: e, itemId: n };
247
+ return await i.onUpdate(e), { applied: !0, sectionId: r, itemId: s };
245
248
  }
246
- }), f({
247
- pluginId: b,
248
- tool: v.pressButton,
249
- handler: async ({ sectionId: e, itemId: n }) => {
250
- const { item: t } = w(o, e, n);
251
- if (t.type !== "button")
249
+ }), v({
250
+ pluginId: $,
251
+ tool: E.pressButton,
252
+ enabled: n,
253
+ handler: async ({ sectionId: r, itemId: s }) => {
254
+ const { item: e } = R(t(), r, s);
255
+ if (e.type !== "button")
252
256
  throw new Error(
253
- `Item "${n}" is not a button (type: ${t.type}). Use set-value to update its value.`
257
+ `Item "${s}" is not a button (type: ${e.type}). Use set-value to update its value.`
254
258
  );
255
- if (t.disabled)
256
- throw new Error(`Button "${n}" is disabled.`);
257
- return await t.onPress(), { pressed: !0, sectionId: e, itemId: n };
259
+ if (e.disabled)
260
+ throw new Error(`Button "${s}" is disabled.`);
261
+ return await e.onPress(), { pressed: !0, sectionId: r, itemId: s };
258
262
  }
259
263
  });
260
- }, j = ({
261
- sections: o
262
- }) => {
263
- const e = S({
264
+ }, T = {
265
+ sections: []
266
+ }, k = (t, n) => typeof n == "function" ? n(t) : {
267
+ ...t,
268
+ ...n,
269
+ sections: [...t.sections, ...n.sections]
270
+ }, j = () => {
271
+ const t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set();
272
+ let r = 0;
273
+ const s = () => t.keys().next().value, e = () => {
274
+ r += 1, n.forEach((o) => o());
275
+ }, i = (o) => {
276
+ const p = Array.from(t.entries());
277
+ return o ? p.findIndex(([a]) => a === o.id) === -1 ? [...p, [o.id, o.input]] : p.map(
278
+ ([a, l]) => a === o.id ? [a, o.input] : [a, l]
279
+ ) : p;
280
+ };
281
+ return {
282
+ set(o, p) {
283
+ const g = s();
284
+ t.set(o, p), g !== s() && e();
285
+ },
286
+ delete(o) {
287
+ t.delete(o), e();
288
+ },
289
+ getOptions(o) {
290
+ return i(o).map(([, p]) => p).reduce(k, T);
291
+ },
292
+ isOwner(o, p) {
293
+ return i(p)[0]?.[0] === o;
294
+ },
295
+ getSnapshot() {
296
+ return r;
297
+ },
298
+ subscribe(o) {
299
+ return n.add(o), () => {
300
+ n.delete(o);
301
+ };
302
+ }
303
+ };
304
+ }, u = j(), _ = (t) => {
305
+ const n = x({
264
306
  pluginId: "@rozenite/controls-plugin"
265
- });
266
- L(o);
267
- const n = E(() => A(o), [o]), t = E(() => D(o), [o]), i = P(t);
268
- return h(() => {
269
- i.current = t;
270
- }, [t]), h(() => {
271
- e && e.send("snapshot", {
307
+ }), s = z(/* @__PURE__ */ Symbol("rozenite-controls")).current, e = A(
308
+ u.subscribe,
309
+ u.getSnapshot,
310
+ u.getSnapshot
311
+ );
312
+ h(() => () => {
313
+ u.delete(s);
314
+ }, [s]), h(() => {
315
+ u.set(s, t);
316
+ }, [t, s]);
317
+ const i = C(
318
+ () => u.isOwner(s, {
319
+ id: s,
320
+ input: t
321
+ }),
322
+ [t, e, s]
323
+ );
324
+ return L(
325
+ () => u.getOptions().sections,
326
+ i
327
+ ), h(() => {
328
+ n && n.send("snapshot", {
272
329
  type: "snapshot",
273
- sections: n
330
+ sections: m(u.getOptions().sections)
274
331
  });
275
- }, [e, n]), h(() => {
276
- if (!e)
332
+ }, [n, t, e]), h(() => {
333
+ if (!n || !i)
277
334
  return;
278
- const s = async ({
279
- requestId: r,
280
- sectionId: a,
281
- itemId: l,
282
- value: d
335
+ const o = async ({
336
+ requestId: a,
337
+ sectionId: l,
338
+ itemId: d,
339
+ value: y
283
340
  }) => {
284
- const c = R(a, l), p = i.current.get(c);
285
- if (!p || p.type === "button") {
286
- e.send("update-result", {
341
+ const f = P(l, d), c = O(
342
+ u.getOptions().sections
343
+ ).get(f);
344
+ if (!c || c.type === "button") {
345
+ n.send("update-result", {
287
346
  type: "update-result",
288
- requestId: r,
289
- sectionId: a,
290
- itemId: l,
347
+ requestId: a,
348
+ sectionId: l,
349
+ itemId: d,
291
350
  status: "error",
292
351
  message: "Update target not found."
293
352
  });
294
353
  return;
295
354
  }
296
355
  try {
297
- if (p.type === "toggle") {
298
- if (typeof d != "boolean") {
299
- e.send("update-result", {
356
+ if (c.type === "toggle") {
357
+ if (typeof y != "boolean") {
358
+ n.send("update-result", {
300
359
  type: "update-result",
301
- requestId: r,
302
- sectionId: a,
303
- itemId: l,
360
+ requestId: a,
361
+ sectionId: l,
362
+ itemId: d,
304
363
  status: "error",
305
364
  message: "Invalid toggle value."
306
365
  });
307
366
  return;
308
367
  }
309
- const $ = U(p.validate, d);
310
- if (!$.valid) {
311
- e.send("update-result", {
368
+ const S = U(c.validate, y);
369
+ if (!S.valid) {
370
+ n.send("update-result", {
312
371
  type: "update-result",
313
- requestId: r,
314
- sectionId: a,
315
- itemId: l,
372
+ requestId: a,
373
+ sectionId: l,
374
+ itemId: d,
316
375
  status: "error",
317
- message: $.message
376
+ message: S.message
318
377
  });
319
378
  return;
320
379
  }
321
- await p.onUpdate(d), e.send("update-result", {
380
+ await c.onUpdate(y), n.send("update-result", {
322
381
  type: "update-result",
323
- requestId: r,
324
- sectionId: a,
325
- itemId: l,
382
+ requestId: a,
383
+ sectionId: l,
384
+ itemId: d,
326
385
  status: "ok"
327
386
  });
328
387
  return;
329
388
  }
330
- if (typeof d != "string") {
331
- e.send("update-result", {
389
+ if (typeof y != "string") {
390
+ n.send("update-result", {
332
391
  type: "update-result",
333
- requestId: r,
334
- sectionId: a,
335
- itemId: l,
392
+ requestId: a,
393
+ sectionId: l,
394
+ itemId: d,
336
395
  status: "error",
337
- message: `Invalid ${p.type} value.`
396
+ message: `Invalid ${c.type} value.`
338
397
  });
339
398
  return;
340
399
  }
341
- const y = U(p.validate, d);
342
- if (!y.valid) {
343
- e.send("update-result", {
400
+ const b = U(c.validate, y);
401
+ if (!b.valid) {
402
+ n.send("update-result", {
344
403
  type: "update-result",
345
- requestId: r,
346
- sectionId: a,
347
- itemId: l,
404
+ requestId: a,
405
+ sectionId: l,
406
+ itemId: d,
348
407
  status: "error",
349
- message: y.message
408
+ message: b.message
350
409
  });
351
410
  return;
352
411
  }
353
- await p.onUpdate(d), e.send("update-result", {
412
+ await c.onUpdate(y), n.send("update-result", {
354
413
  type: "update-result",
355
- requestId: r,
356
- sectionId: a,
357
- itemId: l,
414
+ requestId: a,
415
+ sectionId: l,
416
+ itemId: d,
358
417
  status: "ok"
359
418
  });
360
- } catch (y) {
419
+ } catch (b) {
361
420
  console.warn(
362
- `[Rozenite] Controls Plugin: Update failed for ${a}/${l}.`,
363
- y
364
- ), e.send("update-result", {
421
+ `[Rozenite] Controls Plugin: Update failed for ${l}/${d}.`,
422
+ b
423
+ ), n.send("update-result", {
365
424
  type: "update-result",
366
- requestId: r,
367
- sectionId: a,
368
- itemId: l,
425
+ requestId: a,
426
+ sectionId: l,
427
+ itemId: d,
369
428
  status: "error",
370
429
  message: "Update failed on the device."
371
430
  });
372
431
  }
373
- }, u = async ({
374
- sectionId: r,
375
- itemId: a,
376
- action: l
432
+ }, p = async ({
433
+ sectionId: a,
434
+ itemId: l,
435
+ action: d
377
436
  }) => {
378
- if (l !== "press") {
437
+ if (d !== "press") {
379
438
  console.warn(
380
- `[Rozenite] Controls Plugin: Unsupported action "${l}" for ${r}/${a}.`
439
+ `[Rozenite] Controls Plugin: Unsupported action "${d}" for ${a}/${l}.`
381
440
  );
382
441
  return;
383
442
  }
384
- const d = R(r, a), c = i.current.get(d);
385
- if (!c) {
443
+ const y = P(a, l), f = O(
444
+ u.getOptions().sections
445
+ ).get(y);
446
+ if (!f) {
386
447
  console.warn(
387
- `[Rozenite] Controls Plugin: Action target not found for ${r}/${a}.`
448
+ `[Rozenite] Controls Plugin: Action target not found for ${a}/${l}.`
388
449
  );
389
450
  return;
390
451
  }
391
452
  try {
392
- if (c.type !== "button") {
453
+ if (f.type !== "button") {
393
454
  console.warn(
394
- `[Rozenite] Controls Plugin: Invalid press action payload for ${r}/${a}.`
455
+ `[Rozenite] Controls Plugin: Invalid press action payload for ${a}/${l}.`
395
456
  );
396
457
  return;
397
458
  }
398
- await c.onPress();
399
- } catch (p) {
459
+ await f.onPress();
460
+ } catch (c) {
400
461
  console.warn(
401
- `[Rozenite] Controls Plugin: Action failed for ${r}/${a}.`,
402
- p
462
+ `[Rozenite] Controls Plugin: Action failed for ${a}/${l}.`,
463
+ c
403
464
  );
404
465
  }
405
- }, m = [
406
- e.onMessage("get-snapshot", () => {
407
- e.send("snapshot", {
466
+ }, g = [
467
+ n.onMessage("get-snapshot", () => {
468
+ n.send("snapshot", {
408
469
  type: "snapshot",
409
- sections: n
470
+ sections: m(u.getOptions().sections)
410
471
  });
411
472
  }),
412
- e.onMessage("update-request", (r) => {
413
- s(r);
414
- }),
415
- e.onMessage("invoke-action", (r) => {
416
- u(r);
473
+ n.onMessage(
474
+ "update-request",
475
+ (a) => {
476
+ o(a);
477
+ }
478
+ ),
479
+ n.onMessage("invoke-action", (a) => {
480
+ p(a);
417
481
  })
418
482
  ];
419
483
  return () => {
420
- m.forEach((r) => r.remove());
484
+ g.forEach((a) => a.remove());
421
485
  };
422
- }, [e, n]), e;
486
+ }, [n, i]), n;
423
487
  };
424
488
  export {
425
- j as useRozeniteControlsPlugin
489
+ _ as useRozeniteControlsPlugin
426
490
  };