@kubex/zinc 1.1.68 → 1.1.69

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 (30) hide show
  1. package/dist/custom-elements.json +1417 -275
  2. package/dist/vscode.html-custom-data.json +149 -27
  3. package/dist/web-types.json +351 -64
  4. package/dist/zn.d.ts +325 -14
  5. package/dist/zn.min.js +495 -374
  6. package/docs/pages/components/collapsible.md +6 -2
  7. package/docs/pages/components/preview-frame-demo.njk +33 -4
  8. package/docs/pages/components/preview-frame.md +20 -0
  9. package/docs/pages/components/theme-editor.md +269 -0
  10. package/docs/superpowers/plans/2026-08-03-theme-editor.md +1536 -0
  11. package/docs/superpowers/specs/2026-08-03-theme-editor-design.md +327 -0
  12. package/package.json +1 -1
  13. package/src/components/collapsible/collapsible.component.ts +21 -23
  14. package/src/components/collapsible/collapsible.scss +10 -0
  15. package/src/components/dropdown/dropdown.component.ts +9 -0
  16. package/src/components/editor/editor.component.ts +20 -21
  17. package/src/components/preview-frame/preview-frame.component.ts +126 -16
  18. package/src/components/preview-frame/preview-frame.scss +27 -0
  19. package/src/components/preview-frame/preview-frame.test.ts +253 -0
  20. package/src/components/theme-editor/index.ts +12 -0
  21. package/src/components/theme-editor/theme-editor.component.ts +761 -0
  22. package/src/components/theme-editor/theme-editor.scss +309 -0
  23. package/src/components/theme-editor/theme-editor.test.ts +1584 -0
  24. package/src/events/events.ts +2 -0
  25. package/src/events/zn-theme-change.ts +13 -0
  26. package/src/events/zn-theme-submit.ts +9 -0
  27. package/src/types/web-test-runner-commands.d.ts +6 -0
  28. package/src/zinc.ts +1 -0
  29. package/tsconfig.json +7 -1
  30. package/web-test-runner.config.js +3 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "name": "@kubex/zinc",
4
- "version": "1.1.68",
4
+ "version": "1.1.69",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -1663,7 +1663,7 @@
1663
1663
  },
1664
1664
  {
1665
1665
  "name": "zn-collapsible",
1666
- "description": "Toggles between showing and hiding content when clicked\n---\n\n\n### **Slots:**\n - **header** - Clicking will toggle the show state of the data\n\n### **CSS Parts:**\n - **header** - The header row (toggle).\n- **caption** - The caption text.",
1666
+ "description": "Toggles between showing and hiding content when clicked\n---\n\n\n### **Slots:**\n - **header** - Clicking will toggle the show state of the data\n\n### **CSS Parts:**\n - **header** - The header row (toggle).\n- **caption** - The caption text.\n- **content** - The expandable content wrapper.",
1667
1667
  "doc-url": "",
1668
1668
  "attributes": [
1669
1669
  {
@@ -4207,6 +4207,63 @@
4207
4207
  "events": []
4208
4208
  }
4209
4209
  },
4210
+ {
4211
+ "name": "zn-header",
4212
+ "description": "Short summary of the component's intended use.\n---\n\n\n### **Events:**\n - **zn-event-name** - Emitted as an example.\n\n### **Slots:**\n - _default_ - The default slot.\n- **example** - An example slot.\n\n### **CSS Properties:**\n - **--example** - An example CSS custom property. _(default: undefined)_\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.",
4213
+ "doc-url": "",
4214
+ "attributes": [
4215
+ { "name": "full-location", "value": { "type": "string" } },
4216
+ { "name": "entity-id", "value": { "type": "string" } },
4217
+ { "name": "entity-id-show", "value": { "type": "boolean" } },
4218
+ {
4219
+ "name": "transparent",
4220
+ "value": { "type": "boolean", "default": "false" }
4221
+ },
4222
+ { "name": "caption", "value": { "type": "string" } },
4223
+ { "name": "icon", "value": { "type": "string" } },
4224
+ {
4225
+ "name": "navigation",
4226
+ "value": { "type": "array", "default": "[]" }
4227
+ },
4228
+ { "name": "full-width", "value": { "type": "boolean" } },
4229
+ { "name": "previous-path", "value": { "type": "string" } },
4230
+ { "name": "previous-target", "value": { "type": "string" } },
4231
+ {
4232
+ "name": "hide-breadcrumb",
4233
+ "value": { "type": "boolean", "default": "false" }
4234
+ }
4235
+ ],
4236
+ "slots": [
4237
+ { "name": "", "description": "The default slot." },
4238
+ { "name": "example", "description": "An example slot." }
4239
+ ],
4240
+ "events": [
4241
+ { "name": "zn-event-name", "description": "Emitted as an example." }
4242
+ ],
4243
+ "js": {
4244
+ "properties": [
4245
+ { "name": "fullLocation", "type": "string" },
4246
+ { "name": "entityId", "type": "string" },
4247
+ { "name": "entityIdShow", "type": "boolean" },
4248
+ { "name": "transparent", "type": "boolean" },
4249
+ { "name": "caption", "type": "string" },
4250
+ { "name": "icon", "type": "string" },
4251
+ { "name": "navigation", "type": "array" },
4252
+ { "name": "fullWidth", "type": "boolean" },
4253
+ { "name": "previousPath", "type": "string" },
4254
+ { "name": "previousTarget", "type": "string" },
4255
+ { "name": "hideBreadcrumb", "type": "boolean" },
4256
+ { "name": "handleAltPress" },
4257
+ { "name": "handleAltUp" }
4258
+ ],
4259
+ "events": [
4260
+ {
4261
+ "name": "zn-event-name",
4262
+ "description": "Emitted as an example."
4263
+ }
4264
+ ]
4265
+ }
4266
+ },
4210
4267
  {
4211
4268
  "name": "zn-hover-container",
4212
4269
  "description": "The HoverContainer component is used to display additional information when a user hovers over or clicks\non an element.\n---\n\n\n### **Events:**\n - **zn-show** - Emitted when the hover-container is shown.\n- **zn-after-show** - Emitted after the hover-container is shown.\n- **zn-hide** - Emitted when the hover-container is hidden.\n- **zn-after-hide** - Emitted after the hover-container is hidden.\n\n### **Slots:**\n - _default_ - The content of the hover-container\n- **anchor** - The anchor the hover-container is attached to.",
@@ -4310,63 +4367,6 @@
4310
4367
  ]
4311
4368
  }
4312
4369
  },
4313
- {
4314
- "name": "zn-header",
4315
- "description": "Short summary of the component's intended use.\n---\n\n\n### **Events:**\n - **zn-event-name** - Emitted as an example.\n\n### **Slots:**\n - _default_ - The default slot.\n- **example** - An example slot.\n\n### **CSS Properties:**\n - **--example** - An example CSS custom property. _(default: undefined)_\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.",
4316
- "doc-url": "",
4317
- "attributes": [
4318
- { "name": "full-location", "value": { "type": "string" } },
4319
- { "name": "entity-id", "value": { "type": "string" } },
4320
- { "name": "entity-id-show", "value": { "type": "boolean" } },
4321
- {
4322
- "name": "transparent",
4323
- "value": { "type": "boolean", "default": "false" }
4324
- },
4325
- { "name": "caption", "value": { "type": "string" } },
4326
- { "name": "icon", "value": { "type": "string" } },
4327
- {
4328
- "name": "navigation",
4329
- "value": { "type": "array", "default": "[]" }
4330
- },
4331
- { "name": "full-width", "value": { "type": "boolean" } },
4332
- { "name": "previous-path", "value": { "type": "string" } },
4333
- { "name": "previous-target", "value": { "type": "string" } },
4334
- {
4335
- "name": "hide-breadcrumb",
4336
- "value": { "type": "boolean", "default": "false" }
4337
- }
4338
- ],
4339
- "slots": [
4340
- { "name": "", "description": "The default slot." },
4341
- { "name": "example", "description": "An example slot." }
4342
- ],
4343
- "events": [
4344
- { "name": "zn-event-name", "description": "Emitted as an example." }
4345
- ],
4346
- "js": {
4347
- "properties": [
4348
- { "name": "fullLocation", "type": "string" },
4349
- { "name": "entityId", "type": "string" },
4350
- { "name": "entityIdShow", "type": "boolean" },
4351
- { "name": "transparent", "type": "boolean" },
4352
- { "name": "caption", "type": "string" },
4353
- { "name": "icon", "type": "string" },
4354
- { "name": "navigation", "type": "array" },
4355
- { "name": "fullWidth", "type": "boolean" },
4356
- { "name": "previousPath", "type": "string" },
4357
- { "name": "previousTarget", "type": "string" },
4358
- { "name": "hideBreadcrumb", "type": "boolean" },
4359
- { "name": "handleAltPress" },
4360
- { "name": "handleAltUp" }
4361
- ],
4362
- "events": [
4363
- {
4364
- "name": "zn-event-name",
4365
- "description": "Emitted as an example."
4366
- }
4367
- ]
4368
- }
4369
- },
4370
4370
  {
4371
4371
  "name": "zn-icon",
4372
4372
  "description": "Short summary of the component's intended use.\n---\n\n\n### **Events:**\n - **zn-event-name** - Emitted as an example.\n\n### **Slots:**\n - _default_ - The default slot.\n- **example** - An example slot.\n\n### **CSS Properties:**\n - **--example** - An example CSS custom property. _(default: undefined)_\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.",
@@ -6901,7 +6901,7 @@
6901
6901
  },
6902
6902
  {
6903
6903
  "name": "zn-preview-frame",
6904
- "description": "Embeds a live preview iframe and drives the hp-preview postMessage\nprotocol: answers the frame's ready handshake with a config payload fetched\nfrom data-uri, auto-saves watched forms on change, and refreshes the\npreview after each save.\n---\n\n\n### **Events:**\n - **zn-error** - Emitted when the preview reports a render error or a save fails.\n\n### **Methods:**\n - **refresh()** - Re-fetches the payload and pushes a fresh config to the preview.\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.\n- **iframe** - The preview iframe.\n- **error** - The error overlay.",
6904
+ "description": "Embeds a live preview iframe and drives the hp-preview postMessage\nprotocol: answers the frame's ready handshake with a config payload fetched\nfrom data-uri, auto-saves watched forms on change, refreshes the preview\nafter each save (its own, or a shell-driven save of a `refresh-on` form),\nand accepts a theme payload via setTheme() that is retained and replayed\nafter every ready handshake.\n---\n\n\n### **Events:**\n - **zn-error** - Emitted when the preview reports a render error or a save fails.\n\n### **Methods:**\n - **refresh()** - Re-fetches the payload and pushes a fresh config to the preview.\n- **setTheme(theme: _Record<string, unknown>_)** - Pushes a theme payload into the preview. The payload is retained and\nre-posted after every ready handshake, so a frame reload doesn't drop an\nin-progress theme.\n\n### **CSS Properties:**\n - **--zn-preview-frame-dot-spacing** - Spacing of the backdrop dot grid (`backdrop=\"dots\"`). Defaults to 20px. _(default: undefined)_\n- **--zn-preview-frame-dot-opacity** - Opacity of the backdrop dots (`backdrop=\"dots\"`). Defaults to 0.08. _(default: undefined)_\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.\n- **stage** - The device-width wrapper around the iframe.\n- **iframe** - The preview iframe.\n- **error** - The error overlay.",
6905
6905
  "doc-url": "",
6906
6906
  "attributes": [
6907
6907
  {
@@ -6924,6 +6924,11 @@
6924
6924
  "description": "Selector (resolved against the component's root node) for the forms to watch.\nDefaults to only forms explicitly opted in via a `data-auto-save` attribute —\nunmarked forms keep normal submit behavior and are never intercepted,\nauto-saved, or used to trigger a preview refresh. Override to widen the scope.",
6925
6925
  "value": { "type": "string", "default": "'form[data-auto-save]'" }
6926
6926
  },
6927
+ {
6928
+ "name": "refresh-on",
6929
+ "description": "Selector for forms whose saves are left to the shell but should still\nrefresh the preview. These are never intercepted: the shell submits them\n(so its own response handling — alerts, refreshes — runs as normal) and the\npreview re-fetches its config once the shell reports the save complete.\nSet empty to disable.",
6930
+ "value": { "type": "string", "default": "'form'" }
6931
+ },
6927
6932
  {
6928
6933
  "name": "debounce",
6929
6934
  "description": "Debounce in ms between a form change and its auto-save.",
@@ -6931,13 +6936,28 @@
6931
6936
  },
6932
6937
  {
6933
6938
  "name": "zoom",
6934
- "description": "Zooms the previewed page out (0–1]. The frame always fills the panel;\nzoom shrinks the content browser-style, so 0.4 shows the page at 40%\nsize with correspondingly more of it visible. 1 = natural size.",
6939
+ "description": "Zooms the previewed page out (0–1]. The frame always fills the panel;\nzoom shrinks the content browser-style, so 0.4 shows the page at 40%\nsize with correspondingly more of it visible. 1 = natural size.\nIgnored when `fill` is set.",
6935
6940
  "value": { "type": "number", "default": "1" }
6936
6941
  },
6937
6942
  {
6938
6943
  "name": "min-height",
6939
- "description": "The visible height (in CSS pixels) of the preview panel. Fixed rather\nthan measured, because a measured height would feed back into the\nscaled iframe's layout box and grow unbounded.",
6944
+ "description": "The visible height (in CSS pixels) of the preview panel. Fixed rather\nthan measured, because a measured height would feed back into the\nscaled iframe's layout box and grow unbounded. With `fill` set, this\nbecomes a `min-height` floor instead of the height.",
6940
6945
  "value": { "type": "number", "default": "480" }
6946
+ },
6947
+ {
6948
+ "name": "fill",
6949
+ "description": "Fills the panel's own column height instead of using a fixed\n`min-height` pixel height — for hosts (like zn-theme-editor) whose\nlayout already stretches the column to match a taller sibling.\n`zoom` is ignored when set: its oversize maths depends on a known\npixel height, which `fill` deliberately doesn't have.",
6950
+ "value": { "type": "boolean", "default": "false" }
6951
+ },
6952
+ {
6953
+ "name": "device",
6954
+ "description": "Constrains and centres the preview to a device width: `desktop` (100%),\n`tablet` (768px) or `mobile` (390px). The iframe element itself is\nnarrowed, so the embedded page's own media queries fire.",
6955
+ "value": { "type": "PreviewFrameDevice", "default": "'desktop'" }
6956
+ },
6957
+ {
6958
+ "name": "backdrop",
6959
+ "description": "Backdrop behind the stage: `dots` (default) is the canvas dot grid; `panel` is a plain `rgb(var(--zn-panel))` fill.",
6960
+ "value": { "type": "'dots' | 'panel'", "default": "'dots'" }
6941
6961
  }
6942
6962
  ],
6943
6963
  "events": [
@@ -6968,6 +6988,11 @@
6968
6988
  "description": "Selector (resolved against the component's root node) for the forms to watch.\nDefaults to only forms explicitly opted in via a `data-auto-save` attribute —\nunmarked forms keep normal submit behavior and are never intercepted,\nauto-saved, or used to trigger a preview refresh. Override to widen the scope.",
6969
6989
  "type": "string"
6970
6990
  },
6991
+ {
6992
+ "name": "refreshOn",
6993
+ "description": "Selector for forms whose saves are left to the shell but should still\nrefresh the preview. These are never intercepted: the shell submits them\n(so its own response handling — alerts, refreshes — runs as normal) and the\npreview re-fetches its config once the shell reports the save complete.\nSet empty to disable.",
6994
+ "type": "string"
6995
+ },
6971
6996
  {
6972
6997
  "name": "debounce",
6973
6998
  "description": "Debounce in ms between a form change and its auto-save.",
@@ -6975,14 +7000,29 @@
6975
7000
  },
6976
7001
  {
6977
7002
  "name": "zoom",
6978
- "description": "Zooms the previewed page out (0–1]. The frame always fills the panel;\nzoom shrinks the content browser-style, so 0.4 shows the page at 40%\nsize with correspondingly more of it visible. 1 = natural size.",
7003
+ "description": "Zooms the previewed page out (0–1]. The frame always fills the panel;\nzoom shrinks the content browser-style, so 0.4 shows the page at 40%\nsize with correspondingly more of it visible. 1 = natural size.\nIgnored when `fill` is set.",
6979
7004
  "type": "number"
6980
7005
  },
6981
7006
  {
6982
7007
  "name": "minHeight",
6983
- "description": "The visible height (in CSS pixels) of the preview panel. Fixed rather\nthan measured, because a measured height would feed back into the\nscaled iframe's layout box and grow unbounded.",
7008
+ "description": "The visible height (in CSS pixels) of the preview panel. Fixed rather\nthan measured, because a measured height would feed back into the\nscaled iframe's layout box and grow unbounded. With `fill` set, this\nbecomes a `min-height` floor instead of the height.",
6984
7009
  "type": "number"
6985
7010
  },
7011
+ {
7012
+ "name": "fill",
7013
+ "description": "Fills the panel's own column height instead of using a fixed\n`min-height` pixel height — for hosts (like zn-theme-editor) whose\nlayout already stretches the column to match a taller sibling.\n`zoom` is ignored when set: its oversize maths depends on a known\npixel height, which `fill` deliberately doesn't have.",
7014
+ "type": "boolean"
7015
+ },
7016
+ {
7017
+ "name": "device",
7018
+ "description": "Constrains and centres the preview to a device width: `desktop` (100%),\n`tablet` (768px) or `mobile` (390px). The iframe element itself is\nnarrowed, so the embedded page's own media queries fire.",
7019
+ "type": "PreviewFrameDevice"
7020
+ },
7021
+ {
7022
+ "name": "backdrop",
7023
+ "description": "Backdrop behind the stage: `dots` (default) is the canvas dot grid; `panel` is a plain `rgb(var(--zn-panel))` fill.",
7024
+ "type": "'dots' | 'panel'"
7025
+ },
6986
7026
  { "name": "frame", "type": "HTMLIFrameElement" }
6987
7027
  ],
6988
7028
  "events": [
@@ -9723,6 +9763,253 @@
9723
9763
  ]
9724
9764
  }
9725
9765
  },
9766
+ {
9767
+ "name": "zn-theme-editor",
9768
+ "description": "A theme editor: slotted form controls drive a live preview frame,\nwith a toolbar for the preview's light/dark mode and device width.\n---\n\n\n### **Events:**\n - **zn-theme-change** - Emitted when the values, mode or device change.\n- **zn-theme-submit** - Emitted on submit (button click), carrying the current values. With `action` set, only fires after a successful save.\n- **zn-error** - Emitted when a save fails. Also seen for preview render failures: the frame's zn-error is composed and not stopped, so it bubbles out through the editor too.\n\n### **Slots:**\n - _default_ - Ungrouped theme controls, rendered above any sections. Controls assigned `slot=\"<name>\"` matching a `sections` entry (or, when nested, a `groups` entry) render inside that section/group instead. Harvesting and change detection walk every slot's full assigned subtree, not just direct children.\n- **toolbar** - Actions in the toolbar, right-aligned beside the device controls. Where a save button belongs.\n- **footer** - Actions pinned beneath the controls. The built-in submit button lives in the toolbar, not here.\n\n### **CSS Properties:**\n - **--zn-theme-editor-controls-width** - Width of the controls column. _(default: undefined)_\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.\n- **controls** - The left-hand controls column, full height.\n- **controls-header** - The controls column's header row: `controls-caption` on the left, the light/dark mode toggle on the right.\n- **toolbar** - The preview column's header row: `preview-caption` on the left, the device switcher (and sources/submit) on the right. Spans the preview column only.\n- **section** - A rendered section's or group's collapsible (`section-layout=\"collapsible\"`, or any nested group).\n- **footer** - The footer wrapper beneath the controls.\n- **preview** - The preview column.\n- **error** - The inline error strip.\n- **preview__base** - The frame's base wrapper (forwarded from zn-preview-frame).\n- **preview__stage** - The frame's device-width wrapper (forwarded from zn-preview-frame).\n- **preview__iframe** - The frame's iframe (forwarded from zn-preview-frame).\n- **preview__error** - The frame's own error overlay (forwarded from zn-preview-frame).",
9769
+ "doc-url": "",
9770
+ "attributes": [
9771
+ {
9772
+ "name": "src",
9773
+ "description": "URL of the preview shell page; forwarded to the frame.",
9774
+ "value": { "type": "string", "default": "''" }
9775
+ },
9776
+ {
9777
+ "name": "frame-origin",
9778
+ "description": "Expected origin of the iframe; forwarded to the frame.",
9779
+ "value": { "type": "string", "default": "''" }
9780
+ },
9781
+ {
9782
+ "name": "data-uri",
9783
+ "description": "Optional endpoint returning the base hp-preview:config payload.",
9784
+ "value": { "type": "string", "default": "''" }
9785
+ },
9786
+ {
9787
+ "name": "mode",
9788
+ "description": "Which mode the preview renders in. Travels in the theme payload.",
9789
+ "value": { "type": "ThemeEditorMode", "default": "'light'" }
9790
+ },
9791
+ {
9792
+ "name": "device",
9793
+ "description": "Preview viewport width. Resizes the frame only; not part of the payload.",
9794
+ "value": { "type": "ThemeEditorDevice", "default": "'desktop'" }
9795
+ },
9796
+ {
9797
+ "name": "min-height",
9798
+ "description": "Minimum height of the preview row, in pixels; forwarded to the frame as its own floor.",
9799
+ "value": { "type": "number", "default": "480" }
9800
+ },
9801
+ {
9802
+ "name": "debounce",
9803
+ "description": "Debounce in ms between a control change and the push to the preview.",
9804
+ "value": { "type": "number", "default": "150" }
9805
+ },
9806
+ {
9807
+ "name": "action",
9808
+ "description": "Optional endpoint the values are POSTed to. Empty = no persistence.",
9809
+ "value": { "type": "string", "default": "''" }
9810
+ },
9811
+ {
9812
+ "name": "save-debounce",
9813
+ "description": "Debounce in ms between a control change and the save POST.",
9814
+ "value": { "type": "number", "default": "1000" }
9815
+ },
9816
+ {
9817
+ "name": "sections",
9818
+ "description": "Groups controls into named sections. Empty/unset renders one ungrouped\ncolumn. A section with a non-empty `groups` nests a collapsible per\ngroup inside a `zn-tabs` tab for that section - see `groups` on\n`ThemeEditorSection`.",
9819
+ "value": { "type": "ThemeEditorSection[]", "default": "[]" }
9820
+ },
9821
+ {
9822
+ "name": "section-layout",
9823
+ "description": "Presentation for flat, group-less `sections`: stacked `zn-collapsible`s\n(default) or a `zn-tabs` strip. Ignored once any section has `groups` -\nnested sections always render as tabs.",
9824
+ "value": {
9825
+ "type": "'collapsible' | 'tabs'",
9826
+ "default": "'collapsible'"
9827
+ }
9828
+ },
9829
+ {
9830
+ "name": "sources",
9831
+ "description": "Dropdown of preview sources, `{label, src}`, rendered in the toolbar. Empty/unset renders no dropdown; the first entry wins over an explicit `src` when non-empty.",
9832
+ "value": { "type": "ThemeEditorSource[]", "default": "[]" }
9833
+ },
9834
+ {
9835
+ "name": "controls-collapsed",
9836
+ "description": "Collapses the controls column.",
9837
+ "value": { "type": "boolean", "default": "false" }
9838
+ },
9839
+ {
9840
+ "name": "standalone",
9841
+ "description": "Presents the editor as its own bordered, rounded panel with a plain preview backdrop, rather than embedded in a dotted canvas.",
9842
+ "value": { "type": "boolean", "default": "false" }
9843
+ },
9844
+ {
9845
+ "name": "controls-caption",
9846
+ "description": "Caption in the controls column's header row. Empty (default) renders no text; the row itself always renders.",
9847
+ "value": { "type": "string", "default": "''" }
9848
+ },
9849
+ {
9850
+ "name": "preview-caption",
9851
+ "description": "Caption at the left of the toolbar, opposite the device and mode controls. Empty (default) renders no text.",
9852
+ "value": { "type": "string", "default": "''" }
9853
+ },
9854
+ {
9855
+ "name": "submit-label",
9856
+ "description": "Label for the built-in submit button. Empty (default) renders no button.",
9857
+ "value": { "type": "string", "default": "''" }
9858
+ },
9859
+ {
9860
+ "name": "manual",
9861
+ "description": "Disables the debounced auto-save; saving then happens only via submit. Preview pushes are unaffected.",
9862
+ "value": { "type": "boolean", "default": "false" }
9863
+ }
9864
+ ],
9865
+ "slots": [
9866
+ {
9867
+ "name": "",
9868
+ "description": "Ungrouped theme controls, rendered above any sections. Controls assigned `slot=\"<name>\"` matching a `sections` entry (or, when nested, a `groups` entry) render inside that section/group instead. Harvesting and change detection walk every slot's full assigned subtree, not just direct children."
9869
+ },
9870
+ {
9871
+ "name": "toolbar",
9872
+ "description": "Actions in the toolbar, right-aligned beside the device controls. Where a save button belongs."
9873
+ },
9874
+ {
9875
+ "name": "footer",
9876
+ "description": "Actions pinned beneath the controls. The built-in submit button lives in the toolbar, not here."
9877
+ }
9878
+ ],
9879
+ "events": [
9880
+ {
9881
+ "name": "zn-theme-change",
9882
+ "description": "Emitted when the values, mode or device change."
9883
+ },
9884
+ {
9885
+ "name": "zn-theme-submit",
9886
+ "description": "Emitted on submit (button click), carrying the current values. With `action` set, only fires after a successful save."
9887
+ },
9888
+ {
9889
+ "name": "zn-error",
9890
+ "description": "Emitted when a save fails. Also seen for preview render failures: the frame's zn-error is composed and not stopped, so it bubbles out through the editor too."
9891
+ }
9892
+ ],
9893
+ "js": {
9894
+ "properties": [
9895
+ {
9896
+ "name": "src",
9897
+ "description": "URL of the preview shell page; forwarded to the frame.",
9898
+ "type": "string"
9899
+ },
9900
+ {
9901
+ "name": "frameOrigin",
9902
+ "description": "Expected origin of the iframe; forwarded to the frame.",
9903
+ "type": "string"
9904
+ },
9905
+ {
9906
+ "name": "dataUri",
9907
+ "description": "Optional endpoint returning the base hp-preview:config payload.",
9908
+ "type": "string"
9909
+ },
9910
+ {
9911
+ "name": "mode",
9912
+ "description": "Which mode the preview renders in. Travels in the theme payload.",
9913
+ "type": "ThemeEditorMode"
9914
+ },
9915
+ {
9916
+ "name": "device",
9917
+ "description": "Preview viewport width. Resizes the frame only; not part of the payload.",
9918
+ "type": "ThemeEditorDevice"
9919
+ },
9920
+ {
9921
+ "name": "minHeight",
9922
+ "description": "Minimum height of the preview row, in pixels; forwarded to the frame as its own floor.",
9923
+ "type": "number"
9924
+ },
9925
+ {
9926
+ "name": "debounce",
9927
+ "description": "Debounce in ms between a control change and the push to the preview.",
9928
+ "type": "number"
9929
+ },
9930
+ {
9931
+ "name": "action",
9932
+ "description": "Optional endpoint the values are POSTed to. Empty = no persistence.",
9933
+ "type": "string"
9934
+ },
9935
+ {
9936
+ "name": "saveDebounce",
9937
+ "description": "Debounce in ms between a control change and the save POST.",
9938
+ "type": "number"
9939
+ },
9940
+ {
9941
+ "name": "sections",
9942
+ "description": "Groups controls into named sections. Empty/unset renders one ungrouped\ncolumn. A section with a non-empty `groups` nests a collapsible per\ngroup inside a `zn-tabs` tab for that section - see `groups` on\n`ThemeEditorSection`.",
9943
+ "type": "ThemeEditorSection[]"
9944
+ },
9945
+ {
9946
+ "name": "sectionLayout",
9947
+ "description": "Presentation for flat, group-less `sections`: stacked `zn-collapsible`s\n(default) or a `zn-tabs` strip. Ignored once any section has `groups` -\nnested sections always render as tabs.",
9948
+ "type": "'collapsible' | 'tabs'"
9949
+ },
9950
+ {
9951
+ "name": "sources",
9952
+ "description": "Dropdown of preview sources, `{label, src}`, rendered in the toolbar. Empty/unset renders no dropdown; the first entry wins over an explicit `src` when non-empty.",
9953
+ "type": "ThemeEditorSource[]"
9954
+ },
9955
+ {
9956
+ "name": "controlsCollapsed",
9957
+ "description": "Collapses the controls column.",
9958
+ "type": "boolean"
9959
+ },
9960
+ {
9961
+ "name": "standalone",
9962
+ "description": "Presents the editor as its own bordered, rounded panel with a plain preview backdrop, rather than embedded in a dotted canvas.",
9963
+ "type": "boolean"
9964
+ },
9965
+ {
9966
+ "name": "controlsCaption",
9967
+ "description": "Caption in the controls column's header row. Empty (default) renders no text; the row itself always renders.",
9968
+ "type": "string"
9969
+ },
9970
+ {
9971
+ "name": "previewCaption",
9972
+ "description": "Caption at the left of the toolbar, opposite the device and mode controls. Empty (default) renders no text.",
9973
+ "type": "string"
9974
+ },
9975
+ {
9976
+ "name": "submitLabel",
9977
+ "description": "Label for the built-in submit button. Empty (default) renders no button.",
9978
+ "type": "string"
9979
+ },
9980
+ {
9981
+ "name": "manual",
9982
+ "description": "Disables the debounced auto-save; saving then happens only via submit. Preview pushes are unaffected.",
9983
+ "type": "boolean"
9984
+ },
9985
+ { "name": "frame", "type": "ZnPreviewFrame" },
9986
+ {
9987
+ "name": "values",
9988
+ "description": "The current per-mode value sets. Returns copies.",
9989
+ "type": "{ light: Record<string, unknown>; dark: Record<string, unknown> }"
9990
+ },
9991
+ {
9992
+ "name": "activeValues",
9993
+ "description": "The active mode's values - what gets pushed to the preview frame.",
9994
+ "type": "Record<string, unknown>"
9995
+ }
9996
+ ],
9997
+ "events": [
9998
+ {
9999
+ "name": "zn-theme-change",
10000
+ "description": "Emitted when the values, mode or device change."
10001
+ },
10002
+ {
10003
+ "name": "zn-theme-submit",
10004
+ "description": "Emitted on submit (button click), carrying the current values. With `action` set, only fires after a successful save."
10005
+ },
10006
+ {
10007
+ "name": "zn-error",
10008
+ "description": "Emitted when a save fails. Also seen for preview render failures: the frame's zn-error is composed and not stopped, so it bubbles out through the editor too."
10009
+ }
10010
+ ]
10011
+ }
10012
+ },
9726
10013
  {
9727
10014
  "name": "zn-tile",
9728
10015
  "description": "Short summary of the component's intended use.\n---\n\n\n### **Events:**\n - **zn-event-name** - Emitted as an example.\n\n### **Slots:**\n - _default_ - The default slot.\n- **example** - An example slot.\n\n### **CSS Properties:**\n - **--example** - An example CSS custom property. _(default: undefined)_\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.",