@camstack/addon-training 0.1.109 → 0.1.111

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.
Files changed (22) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/{MotionZonesSettings-BFubqBUi.mjs → MotionZonesSettings-D4s4e-dn.mjs} +2 -2
  3. package/dist/{PrivacyMaskSettings-sNWgI2Ak.mjs → PrivacyMaskSettings-BtdwrmHQ.mjs} +2 -2
  4. package/dist/{SceneMonitorEditor-CyQQi49c.mjs → SceneMonitorEditor-DOX6WQaZ.mjs} +2 -2
  5. package/dist/_stub.js +10 -10
  6. package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_training_page-CoE4OqSm.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_training_page-wgqnvZam.mjs} +3 -3
  7. package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-CmVZHQ-k.mjs +26 -0
  8. package/dist/{dist-DW0wmCpB.mjs → dist-BY4SxNbQ.mjs} +322 -3
  9. package/dist/{dist-BkNG49yZ.js → dist-BsIozugK.js} +322 -3
  10. package/dist/{hostInit-C5xfMSma.mjs → hostInit-COVVezu5.mjs} +2 -2
  11. package/dist/index.js +1 -1
  12. package/dist/orchestrator/training.addon.js +1 -1
  13. package/dist/orchestrator/training.addon.mjs +1 -1
  14. package/dist/{player-overlays-DPQZJVmM.mjs → player-overlays-C_B-yc3g.mjs} +1 -1
  15. package/dist/providers/modal/training-modal.addon.js +1 -1
  16. package/dist/providers/modal/training-modal.addon.mjs +1 -1
  17. package/dist/remoteEntry.js +1 -1
  18. package/dist/{responsive-Dq7_CDVT.mjs → responsive-YANRyril.mjs} +1 -1
  19. package/dist/{scene-monitor-copy-B6AKXb0r.mjs → scene-monitor-copy-B0w92y1z.mjs} +1 -1
  20. package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_training_page__remoteEntry_js-CLjAuQ-T.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_training_page__remoteEntry_js-Xpg6ATFx.mjs} +1 -1
  21. package/package.json +1 -1
  22. package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-L5NIyvFm.mjs +0 -26
@@ -5588,7 +5588,7 @@ var ZodIssueCode = {
5588
5588
  var ZodFirstPartyTypeKind;
5589
5589
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5590
5590
  //#endregion
5591
- //#region ../types/dist/sleep-6eG9C8Xl.mjs
5591
+ //#region ../types/dist/sleep-63gM_1JR.mjs
5592
5592
  /**
5593
5593
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5594
5594
  * window to float samples (D455).
@@ -9116,6 +9116,7 @@ var CAP_NAMES = Object.freeze([
9116
9116
  "recording-signal",
9117
9117
  "records",
9118
9118
  "remote",
9119
+ "remote-layout-components",
9119
9120
  "running-state",
9120
9121
  "scene-monitor",
9121
9122
  "script-runner",
@@ -58566,6 +58567,30 @@ object({
58566
58567
  at: number()
58567
58568
  }).nullable()
58568
58569
  });
58570
+ var RemoteButtonShapeSchema = _enum([
58571
+ "rect",
58572
+ "rounded",
58573
+ "round",
58574
+ "pill"
58575
+ ]);
58576
+ var RemoteButtonToneSchema = _enum([
58577
+ "neutral",
58578
+ "accent",
58579
+ "danger",
58580
+ "red",
58581
+ "green",
58582
+ "yellow",
58583
+ "blue"
58584
+ ]);
58585
+ var RemoteGroupFrameSchema = _enum([
58586
+ "none",
58587
+ "panel",
58588
+ "divider",
58589
+ "dpad",
58590
+ "rocker-v",
58591
+ "rocker-h",
58592
+ "keypad"
58593
+ ]);
58569
58594
  var RemoteLayoutButtonSchema = object({
58570
58595
  id: string().min(1).max(40),
58571
58596
  /** 0-based grid position. */
@@ -58575,12 +58600,94 @@ var RemoteLayoutButtonSchema = object({
58575
58600
  colSpan: number().int().min(1).max(24),
58576
58601
  icon: string().min(1).max(60).optional(),
58577
58602
  label: string().min(1).max(40).optional(),
58578
- role: RemoteRoleSchema
58603
+ role: RemoteRoleSchema,
58604
+ /** Absent = the plain rendering every layout had before shapes existed. */
58605
+ shape: RemoteButtonShapeSchema.optional(),
58606
+ tone: RemoteButtonToneSchema.optional(),
58607
+ /** The group this button belongs to; it must lie inside that group's rectangle. */
58608
+ groupId: string().min(1).max(40).optional()
58579
58609
  });
58610
+ /**
58611
+ * A rectangle of the grid that moves as ONE thing and is drawn with a frame: a
58612
+ * titled panel, a section divider, a D-pad ring. `componentId` names the palette
58613
+ * entry it came from (informational: the layout is self-contained).
58614
+ */
58615
+ var RemoteLayoutGroupSchema = object({
58616
+ id: string().min(1).max(40),
58617
+ componentId: string().min(1).max(80),
58618
+ frame: RemoteGroupFrameSchema,
58619
+ row: number().int().min(0).max(24),
58620
+ col: number().int().min(0).max(24),
58621
+ rowSpan: number().int().min(1).max(24),
58622
+ colSpan: number().int().min(1).max(24),
58623
+ title: string().min(1).max(40).optional()
58624
+ });
58625
+ function rectsOverlap(a, b) {
58626
+ return a.row < b.row + b.rowSpan && b.row < a.row + a.rowSpan && a.col < b.col + b.colSpan && b.col < a.col + a.colSpan;
58627
+ }
58628
+ function rectContains(outer, inner) {
58629
+ return inner.row >= outer.row && inner.col >= outer.col && inner.row + inner.rowSpan <= outer.row + outer.rowSpan && inner.col + inner.colSpan <= outer.col + outer.colSpan;
58630
+ }
58631
+ /**
58632
+ * The group rules of a layout: inside the grid, no two groups overlap, a
58633
+ * member lies inside its group, a divider holds nothing, and a button that is
58634
+ * not a member never sits inside someone else's rectangle (a group moves as
58635
+ * one thing, so a stray key under it would be left behind).
58636
+ */
58637
+ function refineGroups(grid, ctx) {
58638
+ const groups = grid.groups ?? [];
58639
+ const byId = /* @__PURE__ */ new Map();
58640
+ const fail = (message, path) => {
58641
+ ctx.addIssue({
58642
+ code: "custom",
58643
+ message,
58644
+ path
58645
+ });
58646
+ };
58647
+ groups.forEach((group, index) => {
58648
+ if (byId.has(group.id)) fail(`group id "${group.id}" is used twice`, [
58649
+ "groups",
58650
+ index,
58651
+ "id"
58652
+ ]);
58653
+ byId.set(group.id, group);
58654
+ if (group.row + group.rowSpan > grid.rows || group.col + group.colSpan > grid.columns) fail(`group "${group.id}" leaves the grid`, ["groups", index]);
58655
+ for (let other = 0; other < index; other += 1) {
58656
+ const earlier = groups[other];
58657
+ if (earlier !== void 0 && rectsOverlap(earlier, group)) {
58658
+ fail(`groups "${earlier.id}" and "${group.id}" overlap`, ["groups", index]);
58659
+ return;
58660
+ }
58661
+ }
58662
+ });
58663
+ grid.buttons.forEach((button, index) => {
58664
+ if (button.groupId !== void 0) {
58665
+ const group = byId.get(button.groupId);
58666
+ if (group === void 0) {
58667
+ fail(`button "${button.id}" names the unknown group "${button.groupId}"`, [
58668
+ "buttons",
58669
+ index,
58670
+ "groupId"
58671
+ ]);
58672
+ return;
58673
+ }
58674
+ if (group.frame === "divider") fail(`a divider group ("${group.id}") holds no buttons`, [
58675
+ "buttons",
58676
+ index,
58677
+ "groupId"
58678
+ ]);
58679
+ if (!rectContains(group, button)) fail(`button "${button.id}" lies outside its group "${group.id}"`, ["buttons", index]);
58680
+ return;
58681
+ }
58682
+ const foreign = groups.find((group) => rectsOverlap(group, button));
58683
+ if (foreign !== void 0) fail(`button "${button.id}" lies inside group "${foreign.id}" but is not a member`, ["buttons", index]);
58684
+ });
58685
+ }
58580
58686
  object({
58581
58687
  columns: number().int().min(1).max(24),
58582
58688
  rows: number().int().min(1).max(24),
58583
- buttons: array(RemoteLayoutButtonSchema).max(200)
58689
+ buttons: array(RemoteLayoutButtonSchema).max(200),
58690
+ groups: array(RemoteLayoutGroupSchema).max(50).optional()
58584
58691
  }).superRefine((grid, ctx) => {
58585
58692
  const ids = /* @__PURE__ */ new Set();
58586
58693
  const taken = /* @__PURE__ */ new Map();
@@ -58617,6 +58724,7 @@ object({
58617
58724
  taken.set(cell, button.id);
58618
58725
  }
58619
58726
  });
58727
+ refineGroups(grid, ctx);
58620
58728
  });
58621
58729
  var RemoteBoundCommandSchema = object({
58622
58730
  role: RemoteRoleSchema,
@@ -58748,6 +58856,91 @@ method(object({ kind: TemplateKindSchema.optional() }), array(TemplateRecordSche
58748
58856
  kind: "mutation",
58749
58857
  auth: "admin"
58750
58858
  });
58859
+ var RemoteComponentCategorySchema = _enum([
58860
+ "power",
58861
+ "navigation",
58862
+ "volume",
58863
+ "numbers",
58864
+ "media",
58865
+ "colour",
58866
+ "apps",
58867
+ "layout"
58868
+ ]);
58869
+ /** `<namespace>:<name>`, both lowercase slugs — `core:dpad`, `<addonId>:<name>`. */
58870
+ var COMPONENT_ID_RE = /^[a-z0-9][a-z0-9_.-]*:[a-z0-9][a-z0-9_-]*$/;
58871
+ var RemoteComponentButtonSchema = object({
58872
+ /** Joined to the instance id when the component is inserted. */
58873
+ idSuffix: string().regex(/^[a-z0-9][a-z0-9_-]{0,19}$/, { message: "a short lowercase slug" }),
58874
+ row: number().int().min(0).max(24),
58875
+ col: number().int().min(0).max(24),
58876
+ rowSpan: number().int().min(1).max(24),
58877
+ colSpan: number().int().min(1).max(24),
58878
+ role: RemoteRoleSchema,
58879
+ icon: string().min(1).max(60).optional(),
58880
+ label: string().min(1).max(40).optional(),
58881
+ shape: RemoteButtonShapeSchema.optional(),
58882
+ tone: RemoteButtonToneSchema.optional()
58883
+ });
58884
+ var RemoteLayoutComponentSchema = object({
58885
+ id: string().max(80).regex(COMPONENT_ID_RE, { message: "<namespace>:<name>, lowercase" }),
58886
+ name: string().min(1).max(60),
58887
+ nameI18n: object({
58888
+ en: string().min(1).max(60),
58889
+ it: string().min(1).max(60)
58890
+ }).optional(),
58891
+ /** A display icon key, resolved by the UI like a button icon. */
58892
+ icon: string().min(1).max(60),
58893
+ category: RemoteComponentCategorySchema,
58894
+ size: object({
58895
+ rows: number().int().min(1).max(24),
58896
+ cols: number().int().min(1).max(24)
58897
+ }),
58898
+ /** The frame drawn around the whole component, or null for loose buttons. */
58899
+ group: object({
58900
+ frame: RemoteGroupFrameSchema,
58901
+ title: string().min(1).max(40).optional()
58902
+ }).nullable(),
58903
+ buttons: array(RemoteComponentButtonSchema).max(40)
58904
+ }).superRefine((component, ctx) => {
58905
+ const suffixes = /* @__PURE__ */ new Set();
58906
+ component.buttons.forEach((button, index) => {
58907
+ if (suffixes.has(button.idSuffix)) ctx.addIssue({
58908
+ code: "custom",
58909
+ message: `button "${button.idSuffix}" is listed twice`,
58910
+ path: [
58911
+ "buttons",
58912
+ index,
58913
+ "idSuffix"
58914
+ ]
58915
+ });
58916
+ suffixes.add(button.idSuffix);
58917
+ if (button.row + button.rowSpan > component.size.rows || button.col + button.colSpan > component.size.cols) {
58918
+ ctx.addIssue({
58919
+ code: "custom",
58920
+ message: `button "${button.idSuffix}" leaves the component`,
58921
+ path: ["buttons", index]
58922
+ });
58923
+ return;
58924
+ }
58925
+ for (let other = 0; other < index; other += 1) {
58926
+ const earlier = component.buttons[other];
58927
+ if (earlier !== void 0 && rectsOverlap(earlier, button)) {
58928
+ ctx.addIssue({
58929
+ code: "custom",
58930
+ message: `buttons "${earlier.idSuffix}" and "${button.idSuffix}" overlap`,
58931
+ path: ["buttons", index]
58932
+ });
58933
+ return;
58934
+ }
58935
+ }
58936
+ });
58937
+ if (component.group?.frame === "divider" && component.buttons.length > 0) ctx.addIssue({
58938
+ code: "custom",
58939
+ message: "a divider component holds no buttons",
58940
+ path: ["buttons"]
58941
+ });
58942
+ });
58943
+ method(object({}), array(RemoteLayoutComponentSchema), { auth: "protected" });
58751
58944
  DeviceType.Button, method(object({ deviceId: number().int().nonnegative() }), _void(), {
58752
58945
  kind: "mutation",
58753
58946
  auth: "protected"
@@ -67785,6 +67978,124 @@ var trainingCapability = {
67785
67978
  })
67786
67979
  }
67787
67980
  };
67981
+ var btn = (idSuffix, row, col, init) => ({
67982
+ idSuffix,
67983
+ row,
67984
+ col,
67985
+ rowSpan: 1,
67986
+ colSpan: 1,
67987
+ ...init
67988
+ });
67989
+ function rocker(id, name, it, frame, title, buttons, size) {
67990
+ return {
67991
+ id,
67992
+ name,
67993
+ nameI18n: {
67994
+ en: name,
67995
+ it
67996
+ },
67997
+ icon: frame === "rocker-v" ? "chevrons-up-down" : "chevrons-left-right",
67998
+ category: id.includes("channel") || id.includes("volume") ? "volume" : "navigation",
67999
+ size,
68000
+ group: title === null ? { frame } : {
68001
+ frame,
68002
+ title
68003
+ },
68004
+ buttons
68005
+ };
68006
+ }
68007
+ btn("power", 0, 0, {
68008
+ role: "power",
68009
+ shape: "round",
68010
+ tone: "danger"
68011
+ }), btn("up", 0, 1, {
68012
+ role: "up",
68013
+ icon: "chevron-up"
68014
+ }), btn("left", 1, 0, {
68015
+ role: "left",
68016
+ icon: "chevron-left"
68017
+ }), btn("ok", 1, 1, {
68018
+ role: "ok",
68019
+ shape: "round",
68020
+ tone: "accent"
68021
+ }), btn("right", 1, 2, {
68022
+ role: "right",
68023
+ icon: "chevron-right"
68024
+ }), btn("down", 2, 1, {
68025
+ role: "down",
68026
+ icon: "chevron-down"
68027
+ }), rocker("core:rocker-volume-v", "Volume rocker", "Bilanciere volume", "rocker-v", "VOL", [btn("up", 0, 0, {
68028
+ role: "volume_up",
68029
+ icon: "plus",
68030
+ shape: "pill"
68031
+ }), btn("down", 1, 0, {
68032
+ role: "volume_down",
68033
+ icon: "minus",
68034
+ shape: "pill"
68035
+ })], {
68036
+ rows: 2,
68037
+ cols: 1
68038
+ }), rocker("core:rocker-channel-v", "Channel rocker", "Bilanciere canali", "rocker-v", "CH", [btn("up", 0, 0, {
68039
+ role: "channel_up",
68040
+ icon: "chevron-up",
68041
+ shape: "pill"
68042
+ }), btn("down", 1, 0, {
68043
+ role: "channel_down",
68044
+ icon: "chevron-down",
68045
+ shape: "pill"
68046
+ })], {
68047
+ rows: 2,
68048
+ cols: 1
68049
+ }), rocker("core:rocker-h", "Minus / plus rocker", "Bilanciere meno / più", "rocker-h", null, [btn("minus", 0, 0, {
68050
+ role: "custom:minus",
68051
+ label: "Minus",
68052
+ icon: "minus",
68053
+ shape: "pill"
68054
+ }), btn("plus", 0, 1, {
68055
+ role: "custom:plus",
68056
+ label: "Plus",
68057
+ icon: "plus",
68058
+ shape: "pill"
68059
+ })], {
68060
+ rows: 1,
68061
+ cols: 2
68062
+ }), [...Array.from({ length: 9 }, (_, i) => btn(`d${i + 1}`, Math.floor(i / 3), i % 3, { role: `digit_${i + 1}` })), btn("d0", 3, 1, { role: "digit_0" })], btn("red", 0, 0, {
68063
+ role: "custom:color_red",
68064
+ label: "Red",
68065
+ tone: "red"
68066
+ }), btn("green", 0, 1, {
68067
+ role: "custom:color_green",
68068
+ label: "Green",
68069
+ tone: "green"
68070
+ }), btn("yellow", 0, 2, {
68071
+ role: "custom:color_yellow",
68072
+ label: "Yellow",
68073
+ tone: "yellow"
68074
+ }), btn("blue", 0, 3, {
68075
+ role: "custom:color_blue",
68076
+ label: "Blue",
68077
+ tone: "blue"
68078
+ }), btn("rewind", 0, 0, {
68079
+ role: "rewind",
68080
+ icon: "rewind"
68081
+ }), btn("play", 0, 1, {
68082
+ role: "play",
68083
+ icon: "play"
68084
+ }), btn("pause", 0, 2, {
68085
+ role: "pause",
68086
+ icon: "pause"
68087
+ }), btn("forward", 0, 3, {
68088
+ role: "fast_forward",
68089
+ icon: "fast-forward"
68090
+ }), btn("stop", 0, 4, {
68091
+ role: "stop",
68092
+ icon: "square"
68093
+ }), [
68094
+ 1,
68095
+ 2,
68096
+ 3,
68097
+ 4
68098
+ ].map((n) => btn(`app${n}`, 0, n - 1, { role: `custom:app_slot_${n}` })), btn("back", 0, 0, { role: "back" }), btn("home", 0, 1, { role: "home" }), btn("menu", 0, 2, { role: "menu" });
67788
68099
  discriminatedUnion("kind", [object({
67789
68100
  kind: literal("raw"),
67790
68101
  timings: array(number().int()),
@@ -75649,6 +75960,13 @@ Object.freeze({
75649
75960
  access: "create",
75650
75961
  role: "admin"
75651
75962
  },
75963
+ "remoteLayoutComponents.listComponents": {
75964
+ capName: "remote-layout-components",
75965
+ capScope: "system",
75966
+ addonId: null,
75967
+ access: "view",
75968
+ role: "admin"
75969
+ },
75652
75970
  "runningState.getStatus": {
75653
75971
  capName: "running-state",
75654
75972
  capScope: "device",
@@ -81825,6 +82143,7 @@ var SYSTEM_CAP_VOCABULARY = {
81825
82143
  "recording-export": system("recording exports — requested from the timeline, not an automation step"),
81826
82144
  records: system(INTERNAL),
81827
82145
  remote: system("the per-device remote setup — authored in the Customize remote editor, sent through the remote UI"),
82146
+ "remote-layout-components": system("the palette of the remote template editor — read-only data, never actuated"),
81828
82147
  "server-management": system(CLUSTER),
81829
82148
  "settings-store": system(INTERNAL),
81830
82149
  "smtp-provider": system(INTERNAL),