@kubex/zinc 1.1.67 → 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.
- package/dist/custom-elements.json +1288 -20
- package/dist/vscode.html-custom-data.json +167 -11
- package/dist/web-types.json +360 -17
- package/dist/zn.d.ts +368 -20
- package/dist/zn.min.js +764 -645
- package/docs/pages/components/collapsible.md +6 -2
- package/docs/pages/components/preview-frame-demo.njk +33 -4
- package/docs/pages/components/preview-frame.md +20 -0
- package/docs/pages/components/theme-editor.md +269 -0
- package/docs/superpowers/plans/2026-08-03-theme-editor.md +1536 -0
- package/docs/superpowers/specs/2026-08-03-theme-editor-design.md +327 -0
- package/package.json +1 -1
- package/src/components/collapsible/collapsible.component.ts +21 -23
- package/src/components/collapsible/collapsible.scss +10 -0
- package/src/components/data-table/data-table.component.ts +49 -44
- package/src/components/data-table/data-table.scss +4 -0
- package/src/components/data-table/data-table.test.ts +42 -0
- package/src/components/defined-label/defined-label.component.ts +118 -95
- package/src/components/defined-label/defined-label.scss +40 -28
- package/src/components/dropdown/dropdown.component.ts +9 -0
- package/src/components/editor/editor.component.ts +20 -21
- package/src/components/file/file.component.ts +70 -0
- package/src/components/page-builder/page-builder.scss +1 -1
- package/src/components/preview-frame/preview-frame.component.ts +126 -16
- package/src/components/preview-frame/preview-frame.scss +27 -0
- package/src/components/preview-frame/preview-frame.test.ts +253 -0
- package/src/components/theme-editor/index.ts +12 -0
- package/src/components/theme-editor/theme-editor.component.ts +761 -0
- package/src/components/theme-editor/theme-editor.scss +309 -0
- package/src/components/theme-editor/theme-editor.test.ts +1584 -0
- package/src/events/events.ts +2 -0
- package/src/events/zn-theme-change.ts +13 -0
- package/src/events/zn-theme-submit.ts +9 -0
- package/src/types/web-test-runner-commands.d.ts +6 -0
- package/src/zinc.ts +1 -0
- package/tsconfig.json +7 -1
- package/web-test-runner.config.js +3 -1
|
@@ -762,7 +762,7 @@
|
|
|
762
762
|
},
|
|
763
763
|
{
|
|
764
764
|
"name": "zn-collapsible",
|
|
765
|
-
"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.",
|
|
765
|
+
"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.",
|
|
766
766
|
"attributes": [
|
|
767
767
|
{ "name": "caption", "values": [] },
|
|
768
768
|
{ "name": "description", "values": [] },
|
|
@@ -1318,10 +1318,19 @@
|
|
|
1318
1318
|
"name": "zn-defined-label",
|
|
1319
1319
|
"description": "This component provides a labeled input with support for predefined and custom labels,\nallowing users to select or enter label-value pairs within a dropdown interface.\n---\n\n\n### **CSS Parts:**\n - **input** - The component's main input.\n- **input-value** - The label's value inputs.",
|
|
1320
1320
|
"attributes": [
|
|
1321
|
-
{
|
|
1322
|
-
|
|
1321
|
+
{
|
|
1322
|
+
"name": "value",
|
|
1323
|
+
"description": "The selected label key. Also acts as the filter while typing.",
|
|
1324
|
+
"values": []
|
|
1325
|
+
},
|
|
1326
|
+
{
|
|
1327
|
+
"name": "inputValue",
|
|
1328
|
+
"description": "The value entered for the selected label. Submitted as `label:value` when present.",
|
|
1329
|
+
"values": []
|
|
1330
|
+
},
|
|
1323
1331
|
{
|
|
1324
1332
|
"name": "input-size",
|
|
1333
|
+
"description": "The size of the main input.",
|
|
1325
1334
|
"values": [
|
|
1326
1335
|
{ "name": "x-small" },
|
|
1327
1336
|
{ "name": "small" },
|
|
@@ -1329,11 +1338,31 @@
|
|
|
1329
1338
|
{ "name": "large" }
|
|
1330
1339
|
]
|
|
1331
1340
|
},
|
|
1332
|
-
{
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1341
|
+
{
|
|
1342
|
+
"name": "name",
|
|
1343
|
+
"description": "The name of the control. Used for form submission.",
|
|
1344
|
+
"values": []
|
|
1345
|
+
},
|
|
1346
|
+
{
|
|
1347
|
+
"name": "title",
|
|
1348
|
+
"description": "The title of the main input.",
|
|
1349
|
+
"values": []
|
|
1350
|
+
},
|
|
1351
|
+
{
|
|
1352
|
+
"name": "disabled",
|
|
1353
|
+
"description": "Disables the control.",
|
|
1354
|
+
"values": []
|
|
1355
|
+
},
|
|
1356
|
+
{
|
|
1357
|
+
"name": "allow-custom",
|
|
1358
|
+
"description": "Allows labels that aren't in the predefined list.",
|
|
1359
|
+
"values": []
|
|
1360
|
+
},
|
|
1361
|
+
{
|
|
1362
|
+
"name": "predefined-labels",
|
|
1363
|
+
"description": "The predefined labels. Entries are either a string or `{name, options}`.",
|
|
1364
|
+
"values": [{ "name": "(PredefinedLabel" }, { "name": "string)[]" }]
|
|
1365
|
+
}
|
|
1337
1366
|
],
|
|
1338
1367
|
"references": [
|
|
1339
1368
|
{
|
|
@@ -1665,6 +1694,11 @@
|
|
|
1665
1694
|
"name": "show-link",
|
|
1666
1695
|
"description": "When enabled, render the current link (`previewSrc`) as a clickable URL below the control.\nUseful for showing the existing CDN link alongside the preview.",
|
|
1667
1696
|
"values": []
|
|
1697
|
+
},
|
|
1698
|
+
{
|
|
1699
|
+
"name": "upload-url",
|
|
1700
|
+
"description": "When set, a chosen file is immediately POSTed (multipart, field `file`) to this URL.\nThe endpoint must respond with JSON `{\"url\": \"...\"}`; that URL becomes the control's\nvalue (and `src` preview) in place of the file bytes, so the control works inside\nJSON-serialising hosts such as `zn-page-builder`. Emits `zn-error` when the upload fails.",
|
|
1701
|
+
"values": []
|
|
1668
1702
|
}
|
|
1669
1703
|
],
|
|
1670
1704
|
"references": [
|
|
@@ -2921,7 +2955,7 @@
|
|
|
2921
2955
|
},
|
|
2922
2956
|
{
|
|
2923
2957
|
"name": "zn-preview-frame",
|
|
2924
|
-
"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,
|
|
2958
|
+
"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.",
|
|
2925
2959
|
"attributes": [
|
|
2926
2960
|
{
|
|
2927
2961
|
"name": "src",
|
|
@@ -2943,6 +2977,11 @@
|
|
|
2943
2977
|
"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.",
|
|
2944
2978
|
"values": []
|
|
2945
2979
|
},
|
|
2980
|
+
{
|
|
2981
|
+
"name": "refresh-on",
|
|
2982
|
+
"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.",
|
|
2983
|
+
"values": []
|
|
2984
|
+
},
|
|
2946
2985
|
{
|
|
2947
2986
|
"name": "debounce",
|
|
2948
2987
|
"description": "Debounce in ms between a form change and its auto-save.",
|
|
@@ -2950,13 +2989,28 @@
|
|
|
2950
2989
|
},
|
|
2951
2990
|
{
|
|
2952
2991
|
"name": "zoom",
|
|
2953
|
-
"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.",
|
|
2992
|
+
"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.",
|
|
2954
2993
|
"values": []
|
|
2955
2994
|
},
|
|
2956
2995
|
{
|
|
2957
2996
|
"name": "min-height",
|
|
2958
|
-
"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.",
|
|
2997
|
+
"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.",
|
|
2998
|
+
"values": []
|
|
2999
|
+
},
|
|
3000
|
+
{
|
|
3001
|
+
"name": "fill",
|
|
3002
|
+
"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.",
|
|
2959
3003
|
"values": []
|
|
3004
|
+
},
|
|
3005
|
+
{
|
|
3006
|
+
"name": "device",
|
|
3007
|
+
"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.",
|
|
3008
|
+
"values": [{ "name": "PreviewFrameDevice" }]
|
|
3009
|
+
},
|
|
3010
|
+
{
|
|
3011
|
+
"name": "backdrop",
|
|
3012
|
+
"description": "Backdrop behind the stage: `dots` (default) is the canvas dot grid; `panel` is a plain `rgb(var(--zn-panel))` fill.",
|
|
3013
|
+
"values": [{ "name": "dots" }, { "name": "panel" }]
|
|
2960
3014
|
}
|
|
2961
3015
|
],
|
|
2962
3016
|
"references": [
|
|
@@ -4085,6 +4139,108 @@
|
|
|
4085
4139
|
}
|
|
4086
4140
|
]
|
|
4087
4141
|
},
|
|
4142
|
+
{
|
|
4143
|
+
"name": "zn-theme-editor",
|
|
4144
|
+
"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).",
|
|
4145
|
+
"attributes": [
|
|
4146
|
+
{
|
|
4147
|
+
"name": "src",
|
|
4148
|
+
"description": "URL of the preview shell page; forwarded to the frame.",
|
|
4149
|
+
"values": []
|
|
4150
|
+
},
|
|
4151
|
+
{
|
|
4152
|
+
"name": "frame-origin",
|
|
4153
|
+
"description": "Expected origin of the iframe; forwarded to the frame.",
|
|
4154
|
+
"values": []
|
|
4155
|
+
},
|
|
4156
|
+
{
|
|
4157
|
+
"name": "data-uri",
|
|
4158
|
+
"description": "Optional endpoint returning the base hp-preview:config payload.",
|
|
4159
|
+
"values": []
|
|
4160
|
+
},
|
|
4161
|
+
{
|
|
4162
|
+
"name": "mode",
|
|
4163
|
+
"description": "Which mode the preview renders in. Travels in the theme payload.",
|
|
4164
|
+
"values": [{ "name": "ThemeEditorMode" }]
|
|
4165
|
+
},
|
|
4166
|
+
{
|
|
4167
|
+
"name": "device",
|
|
4168
|
+
"description": "Preview viewport width. Resizes the frame only; not part of the payload.",
|
|
4169
|
+
"values": [{ "name": "ThemeEditorDevice" }]
|
|
4170
|
+
},
|
|
4171
|
+
{
|
|
4172
|
+
"name": "min-height",
|
|
4173
|
+
"description": "Minimum height of the preview row, in pixels; forwarded to the frame as its own floor.",
|
|
4174
|
+
"values": []
|
|
4175
|
+
},
|
|
4176
|
+
{
|
|
4177
|
+
"name": "debounce",
|
|
4178
|
+
"description": "Debounce in ms between a control change and the push to the preview.",
|
|
4179
|
+
"values": []
|
|
4180
|
+
},
|
|
4181
|
+
{
|
|
4182
|
+
"name": "action",
|
|
4183
|
+
"description": "Optional endpoint the values are POSTed to. Empty = no persistence.",
|
|
4184
|
+
"values": []
|
|
4185
|
+
},
|
|
4186
|
+
{
|
|
4187
|
+
"name": "save-debounce",
|
|
4188
|
+
"description": "Debounce in ms between a control change and the save POST.",
|
|
4189
|
+
"values": []
|
|
4190
|
+
},
|
|
4191
|
+
{
|
|
4192
|
+
"name": "sections",
|
|
4193
|
+
"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`.",
|
|
4194
|
+
"values": [{ "name": "ThemeEditorSection[]" }]
|
|
4195
|
+
},
|
|
4196
|
+
{
|
|
4197
|
+
"name": "section-layout",
|
|
4198
|
+
"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.",
|
|
4199
|
+
"values": [{ "name": "collapsible" }, { "name": "tabs" }]
|
|
4200
|
+
},
|
|
4201
|
+
{
|
|
4202
|
+
"name": "sources",
|
|
4203
|
+
"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.",
|
|
4204
|
+
"values": [{ "name": "ThemeEditorSource[]" }]
|
|
4205
|
+
},
|
|
4206
|
+
{
|
|
4207
|
+
"name": "controls-collapsed",
|
|
4208
|
+
"description": "Collapses the controls column.",
|
|
4209
|
+
"values": []
|
|
4210
|
+
},
|
|
4211
|
+
{
|
|
4212
|
+
"name": "standalone",
|
|
4213
|
+
"description": "Presents the editor as its own bordered, rounded panel with a plain preview backdrop, rather than embedded in a dotted canvas.",
|
|
4214
|
+
"values": []
|
|
4215
|
+
},
|
|
4216
|
+
{
|
|
4217
|
+
"name": "controls-caption",
|
|
4218
|
+
"description": "Caption in the controls column's header row. Empty (default) renders no text; the row itself always renders.",
|
|
4219
|
+
"values": []
|
|
4220
|
+
},
|
|
4221
|
+
{
|
|
4222
|
+
"name": "preview-caption",
|
|
4223
|
+
"description": "Caption at the left of the toolbar, opposite the device and mode controls. Empty (default) renders no text.",
|
|
4224
|
+
"values": []
|
|
4225
|
+
},
|
|
4226
|
+
{
|
|
4227
|
+
"name": "submit-label",
|
|
4228
|
+
"description": "Label for the built-in submit button. Empty (default) renders no button.",
|
|
4229
|
+
"values": []
|
|
4230
|
+
},
|
|
4231
|
+
{
|
|
4232
|
+
"name": "manual",
|
|
4233
|
+
"description": "Disables the debounced auto-save; saving then happens only via submit. Preview pushes are unaffected.",
|
|
4234
|
+
"values": []
|
|
4235
|
+
}
|
|
4236
|
+
],
|
|
4237
|
+
"references": [
|
|
4238
|
+
{
|
|
4239
|
+
"name": "Documentation",
|
|
4240
|
+
"url": "https://zinc.style/components/theme-editor"
|
|
4241
|
+
}
|
|
4242
|
+
]
|
|
4243
|
+
},
|
|
4088
4244
|
{
|
|
4089
4245
|
"name": "zn-tile",
|
|
4090
4246
|
"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.",
|