@kubex/zinc 1.1.68 → 1.1.70
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 +1719 -282
- package/dist/vscode.html-custom-data.json +160 -29
- package/dist/web-types.json +395 -70
- package/dist/zn.d.ts +395 -16
- package/dist/zn.min.js +580 -408
- package/docs/pages/components/collapsible.md +6 -2
- package/docs/pages/components/icon-picker.md +14 -0
- package/docs/pages/components/input.md +19 -1
- 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 +303 -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/dropdown/dropdown.component.ts +9 -0
- package/src/components/editor/editor.component.ts +20 -21
- package/src/components/file/file.component.ts +15 -0
- package/src/components/icon-picker/icon-picker.component.ts +150 -16
- package/src/components/icon-picker/icon-picker.scss +32 -0
- package/src/components/input/input.component.ts +44 -21
- package/src/components/input/input.scss +134 -42
- package/src/components/input/input.test.ts +45 -0
- 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 +918 -0
- package/src/components/theme-editor/theme-editor.scss +309 -0
- package/src/components/theme-editor/theme-editor.test.ts +1752 -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": [] },
|
|
@@ -1594,7 +1594,7 @@
|
|
|
1594
1594
|
},
|
|
1595
1595
|
{
|
|
1596
1596
|
"name": "zn-file",
|
|
1597
|
-
"description": "File controls allow selecting an arbitrary number of files for uploading.\n---\n\n\n### **Events:**\n - **zn-blur** - Emitted when the control loses focus.\n- **zn-change** - Emitted when an alteration to the control's value is committed by the user.\n- **zn-clear** - Emitted when the user confirms clearing the selected file or `src`.\n- **zn-error** - Emitted when multiple files are selected via drag and drop, without the `multiple` property being set.\n- **zn-focus** - Emitted when the control gains focus.\n- **zn-input** - Emitted when the control receives input.\n\n### **Methods:**\n - **checkValidity()** - Checks for validity but does not show a validation message.\nReturns `true` when valid and `false` when invalid.\n- **getForm(): _HTMLFormElement | null_** - Gets the associated form, if one exists.\n- **reportValidity()** - Checks for validity and shows the browser's validation message if the control is invalid.\n- **setCustomValidity(message: _string_)** - Sets a custom validation message. Pass an empty string to restore validity.\n- **focus(options: _FocusOptions_)** - Sets focus on the button or droparea.\n- **blur()** - Removes focus from the button or droparea.\n\n### **Slots:**\n - **label** - The file control's label. Alternatively, you can use the `label` attribute.\n- **help-text** - Text that describes how to use the file control. Alternatively, you can use the `help-text` attribute.\n- **trigger** - Optional content to be used as trigger instead of the default content. Opening the file dialog on click and as well as drag and drop will work for this content. Following attributes will no longer work: *label*, *droparea*, *help-text*, *size*, *hide-value*. Also if using the disabled attribute, the disabled styling will not be applied and must be taken care of yourself.\n\n### **CSS Parts:**\n - **form-control** - The form control that wraps the label, input, and help text.\n- **form-control-label** - The label's wrapper.\n- **form-control-input** - The input's wrapper.\n- **form-control-help-text** - The help text's wrapper.\n- **button-wrapper** - The wrapper around the button and text value.\n- **button** - The zn-button acting as a file input.\n- **button__base** - The zn-button's exported `base` part.\n- **value** - The chosen files or placeholder text for the file input.\n- **droparea** - The element wrapping the drop zone.\n- **droparea-background** - The background of the drop zone.\n- **upload** - The upload button shown in the droparea when no file is selected.\n- **preview** - The image preview rendered in the droparea for previewable files.\n- **filename** - The filename label rendered in the droparea for non-previewable files.\n- **clear** - The clear button rendered in the droparea when a file is present.\n- **clear-confirm** - The confirmation dialog shown before clearing the file.\n- **link** - The current link anchor rendered when `show-link` is enabled.\n- **trigger** - The container that wraps the trigger.",
|
|
1597
|
+
"description": "File controls allow selecting an arbitrary number of files for uploading.\n---\n\n\n### **Events:**\n - **zn-blur** - Emitted when the control loses focus.\n- **zn-change** - Emitted when an alteration to the control's value is committed by the user.\n- **zn-clear** - Emitted when the user confirms clearing the selected file or `src`.\n- **zn-error** - Emitted when multiple files are selected via drag and drop, without the `multiple` property being set.\n- **zn-focus** - Emitted when the control gains focus.\n- **zn-input** - Emitted when the control receives input.\n\n### **Methods:**\n - **checkValidity()** - Checks for validity but does not show a validation message.\nReturns `true` when valid and `false` when invalid.\n- **getForm(): _HTMLFormElement | null_** - Gets the associated form, if one exists.\n- **reportValidity()** - Checks for validity and shows the browser's validation message if the control is invalid.\n- **setCustomValidity(message: _string_)** - Sets a custom validation message. Pass an empty string to restore validity.\n- **focus(options: _FocusOptions_)** - Sets focus on the button or droparea.\n- **blur()** - Removes focus from the button or droparea.\n- **clear()** - Programmatically clears the selected file and any external `src` without\nconfirmation. Unlike a user-initiated clear, this does not flag the control\nto submit an empty value.\n\n### **Slots:**\n - **label** - The file control's label. Alternatively, you can use the `label` attribute.\n- **help-text** - Text that describes how to use the file control. Alternatively, you can use the `help-text` attribute.\n- **trigger** - Optional content to be used as trigger instead of the default content. Opening the file dialog on click and as well as drag and drop will work for this content. Following attributes will no longer work: *label*, *droparea*, *help-text*, *size*, *hide-value*. Also if using the disabled attribute, the disabled styling will not be applied and must be taken care of yourself.\n\n### **CSS Parts:**\n - **form-control** - The form control that wraps the label, input, and help text.\n- **form-control-label** - The label's wrapper.\n- **form-control-input** - The input's wrapper.\n- **form-control-help-text** - The help text's wrapper.\n- **button-wrapper** - The wrapper around the button and text value.\n- **button** - The zn-button acting as a file input.\n- **button__base** - The zn-button's exported `base` part.\n- **value** - The chosen files or placeholder text for the file input.\n- **droparea** - The element wrapping the drop zone.\n- **droparea-background** - The background of the drop zone.\n- **upload** - The upload button shown in the droparea when no file is selected.\n- **preview** - The image preview rendered in the droparea for previewable files.\n- **filename** - The filename label rendered in the droparea for non-previewable files.\n- **clear** - The clear button rendered in the droparea when a file is present.\n- **clear-confirm** - The confirmation dialog shown before clearing the file.\n- **link** - The current link anchor rendered when `show-link` is enabled.\n- **trigger** - The container that wraps the trigger.",
|
|
1598
1598
|
"attributes": [
|
|
1599
1599
|
{
|
|
1600
1600
|
"name": "files",
|
|
@@ -1784,6 +1784,29 @@
|
|
|
1784
1784
|
}
|
|
1785
1785
|
]
|
|
1786
1786
|
},
|
|
1787
|
+
{
|
|
1788
|
+
"name": "zn-header",
|
|
1789
|
+
"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.",
|
|
1790
|
+
"attributes": [
|
|
1791
|
+
{ "name": "full-location", "values": [] },
|
|
1792
|
+
{ "name": "entity-id", "values": [] },
|
|
1793
|
+
{ "name": "entity-id-show", "values": [] },
|
|
1794
|
+
{ "name": "transparent", "values": [] },
|
|
1795
|
+
{ "name": "caption", "values": [] },
|
|
1796
|
+
{ "name": "icon", "values": [] },
|
|
1797
|
+
{ "name": "navigation", "values": [{ "name": "array" }] },
|
|
1798
|
+
{ "name": "full-width", "values": [] },
|
|
1799
|
+
{ "name": "previous-path", "values": [] },
|
|
1800
|
+
{ "name": "previous-target", "values": [] },
|
|
1801
|
+
{ "name": "hide-breadcrumb", "values": [] }
|
|
1802
|
+
],
|
|
1803
|
+
"references": [
|
|
1804
|
+
{
|
|
1805
|
+
"name": "Documentation",
|
|
1806
|
+
"url": "https://zinc.style/components/header"
|
|
1807
|
+
}
|
|
1808
|
+
]
|
|
1809
|
+
},
|
|
1787
1810
|
{
|
|
1788
1811
|
"name": "zn-hover-container",
|
|
1789
1812
|
"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.",
|
|
@@ -1821,29 +1844,6 @@
|
|
|
1821
1844
|
}
|
|
1822
1845
|
]
|
|
1823
1846
|
},
|
|
1824
|
-
{
|
|
1825
|
-
"name": "zn-header",
|
|
1826
|
-
"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.",
|
|
1827
|
-
"attributes": [
|
|
1828
|
-
{ "name": "full-location", "values": [] },
|
|
1829
|
-
{ "name": "entity-id", "values": [] },
|
|
1830
|
-
{ "name": "entity-id-show", "values": [] },
|
|
1831
|
-
{ "name": "transparent", "values": [] },
|
|
1832
|
-
{ "name": "caption", "values": [] },
|
|
1833
|
-
{ "name": "icon", "values": [] },
|
|
1834
|
-
{ "name": "navigation", "values": [{ "name": "array" }] },
|
|
1835
|
-
{ "name": "full-width", "values": [] },
|
|
1836
|
-
{ "name": "previous-path", "values": [] },
|
|
1837
|
-
{ "name": "previous-target", "values": [] },
|
|
1838
|
-
{ "name": "hide-breadcrumb", "values": [] }
|
|
1839
|
-
],
|
|
1840
|
-
"references": [
|
|
1841
|
-
{
|
|
1842
|
-
"name": "Documentation",
|
|
1843
|
-
"url": "https://zinc.style/components/header"
|
|
1844
|
-
}
|
|
1845
|
-
]
|
|
1846
|
-
},
|
|
1847
1847
|
{
|
|
1848
1848
|
"name": "zn-icon",
|
|
1849
1849
|
"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.",
|
|
@@ -1879,6 +1879,9 @@
|
|
|
1879
1879
|
{ "name": "help-text", "values": [] },
|
|
1880
1880
|
{ "name": "disabled", "values": [] },
|
|
1881
1881
|
{ "name": "required", "values": [] },
|
|
1882
|
+
{ "name": "trigger-submit", "values": [] },
|
|
1883
|
+
{ "name": "allow-upload", "values": [] },
|
|
1884
|
+
{ "name": "accept", "values": [] },
|
|
1882
1885
|
{ "name": "form", "values": [] }
|
|
1883
1886
|
],
|
|
1884
1887
|
"references": [
|
|
@@ -1990,7 +1993,7 @@
|
|
|
1990
1993
|
},
|
|
1991
1994
|
{
|
|
1992
1995
|
"name": "zn-input",
|
|
1993
|
-
"description": "Short summary of the component's intended use.\n---\n\n\n### **Events:**\n - **zn-blur** - Emitted when the control loses focus.\n- **zn-change** - Emitted when an alteration to the control's value is committed by the user.\n- **zn-clear** - Emitted when the clear button is activated.\n- **zn-focus** - Emitted when the control gains focus.\n- **zn-input** - Emitted when the control receives input.\n- **zn-invalid** - Emitted when the form control has been checked for validity and its constraints aren't satisfied.\n\n### **Methods:**\n - **focus(options: _FocusOptions_)** - Sets focus on the input.\n- **blur()** - Removes focus from the input.\n- **select()** - Selects all the text in the input.\n- **setSelectionRange(selectionStart: _number_, selectionEnd: _number_, selectionDirection: _'forward' | 'backward' | 'none'_)** - Sets the start and end positions of the text selection (0-based).\n- **setRangeText(replacement: _string_, start: _number_, end: _number_, selectMode: _'select' | 'start' | 'end' | 'preserve'_)** - Replaces a range of text with a new string.\n- **showPicker()** - Displays the browser picker for an input element (only works if the browser supports it for the input type).\n- **stepUp()** - Increments the value of a numeric input type by the value of the step attribute.\n- **stepDown()** - Decrements the value of a numeric input type by the value of the step attribute.\n- **checkValidity(): _boolean_** - Checks the validity but does not show a validation message. Returns `true` when valid and `false` when invalid.\n- **getForm(): _HTMLFormElement | null_** - Gets the associated form, if one exists.\n- **reportValidity()** - Checks for validity and shows the browser's validation message if the control is invalid.\n- **setCustomValidity(message: _string_)** - Sets a custom validation message. Pass an empty string to restore validity.\n\n### **Slots:**\n - **label** - The input's label. Alternatively, you can use the `label` attribute.\n- **label-tooltip** - Used to add text that is displayed in a tooltip next to the label. Alternatively, you can use the `label-tooltip` attribute.\n- **context-note** - Used to add contextual text that is displayed above the input, on the right. Alternatively, you can use the `context-note` attribute.\n- **prefix** - Used to prepend a presentational icon or similar element to the input.\n- **suffix** - Used to append a presentational icon or similar element to the input.\n- **clear-icon** - An icon to use in lieu of the default clear icon.\n- **show-password-icon** - An icon to use in lieu of the default show password icon.\n- **hide-password-icon** - An icon to use in lieu of the default hide password icon.\n- **help-text** - Text that describes how to use the input. Alternatively, you can use the `help-text` attribute.\n\n### **CSS Parts:**\n - **form-control** - The form control that wraps the label, input, and help text.\n- **form-control-label** - The label's wrapper.\n- **form-control-input** - The input's wrapper.\n- **form-control-help-text** - The help text's wrapper.\n- **base** - The component's base wrapper.\n- **input** - The internal `<input>` control.\n- **prefix** - The container that wraps the prefix.\n- **clear-button** - The clear button.\n- **password-toggle-button** - The password toggle button.\n- **suffix** - The container that wraps the suffix.",
|
|
1996
|
+
"description": "Short summary of the component's intended use.\n---\n\n\n### **Events:**\n - **zn-blur** - Emitted when the control loses focus.\n- **zn-change** - Emitted when an alteration to the control's value is committed by the user.\n- **zn-clear** - Emitted when the clear button is activated.\n- **zn-focus** - Emitted when the control gains focus.\n- **zn-input** - Emitted when the control receives input.\n- **zn-invalid** - Emitted when the form control has been checked for validity and its constraints aren't satisfied.\n\n### **Methods:**\n - **focus(options: _FocusOptions_)** - Sets focus on the input.\n- **blur()** - Removes focus from the input.\n- **select()** - Selects all the text in the input.\n- **setSelectionRange(selectionStart: _number_, selectionEnd: _number_, selectionDirection: _'forward' | 'backward' | 'none'_)** - Sets the start and end positions of the text selection (0-based).\n- **setRangeText(replacement: _string_, start: _number_, end: _number_, selectMode: _'select' | 'start' | 'end' | 'preserve'_)** - Replaces a range of text with a new string.\n- **showPicker()** - Displays the browser picker for an input element (only works if the browser supports it for the input type).\n- **stepUp()** - Increments the value of a numeric input type by the value of the step attribute.\n- **stepDown()** - Decrements the value of a numeric input type by the value of the step attribute.\n- **checkValidity(): _boolean_** - Checks the validity but does not show a validation message. Returns `true` when valid and `false` when invalid.\n- **getForm(): _HTMLFormElement | null_** - Gets the associated form, if one exists.\n- **reportValidity()** - Checks for validity and shows the browser's validation message if the control is invalid.\n- **setCustomValidity(message: _string_)** - Sets a custom validation message. Pass an empty string to restore validity.\n\n### **Slots:**\n - **label** - The input's label. Alternatively, you can use the `label` attribute.\n- **label-tooltip** - Used to add text that is displayed in a tooltip next to the label. Alternatively, you can use the `label-tooltip` attribute.\n- **context-note** - Used to add contextual text that is displayed above the input, on the right. Alternatively, you can use the `context-note` attribute. Range inputs display their live value here unless this is set.\n- **prefix** - Used to prepend a presentational icon or similar element to the input.\n- **suffix** - Used to append a presentational icon or similar element to the input.\n- **clear-icon** - An icon to use in lieu of the default clear icon.\n- **show-password-icon** - An icon to use in lieu of the default show password icon.\n- **hide-password-icon** - An icon to use in lieu of the default hide password icon.\n- **help-text** - Text that describes how to use the input. Alternatively, you can use the `help-text` attribute.\n\n### **CSS Properties:**\n - **--zn-range-track-height** - The height of a range input's track. _(default: undefined)_\n- **--zn-range-track-color** - The color of a range input's track. _(default: undefined)_\n- **--zn-range-thumb-size** - The diameter of a range input's thumb. _(default: undefined)_\n- **--zn-range-thumb-color** - The color of a range input's thumb. _(default: undefined)_\n- **--zn-range-thumb-ring-width** - The width of the ring drawn around a range input's thumb. _(default: undefined)_\n\n### **CSS Parts:**\n - **form-control** - The form control that wraps the label, input, and help text.\n- **form-control-label** - The label's wrapper.\n- **form-control-input** - The input's wrapper.\n- **form-control-help-text** - The help text's wrapper.\n- **base** - The component's base wrapper.\n- **input** - The internal `<input>` control.\n- **prefix** - The container that wraps the prefix.\n- **clear-button** - The clear button.\n- **password-toggle-button** - The password toggle button.\n- **suffix** - The container that wraps the suffix.",
|
|
1994
1997
|
"attributes": [
|
|
1995
1998
|
{ "name": "title", "values": [] },
|
|
1996
1999
|
{
|
|
@@ -2004,6 +2007,7 @@
|
|
|
2004
2007
|
{ "name": "email" },
|
|
2005
2008
|
{ "name": "number" },
|
|
2006
2009
|
{ "name": "password" },
|
|
2010
|
+
{ "name": "range" },
|
|
2007
2011
|
{ "name": "search" },
|
|
2008
2012
|
{ "name": "tel" },
|
|
2009
2013
|
{ "name": "text" },
|
|
@@ -2111,6 +2115,11 @@
|
|
|
2111
2115
|
{ "name": "oklch" }
|
|
2112
2116
|
]
|
|
2113
2117
|
},
|
|
2118
|
+
{
|
|
2119
|
+
"name": "value-suffix",
|
|
2120
|
+
"description": "Appended to the value that range inputs display above the track, on the right, e.g. `rem`. Only applies when type\nis 'range' and no `context-note` is set.",
|
|
2121
|
+
"values": []
|
|
2122
|
+
},
|
|
2114
2123
|
{
|
|
2115
2124
|
"name": "form",
|
|
2116
2125
|
"description": "By default, form-controls are associated with the nearest containing `<form>` element. This attribute allows you\nto place the form control outside a form and associate it with the form that has this `id`. The form must be\nin the same document or shadow root for this to work.",
|
|
@@ -2955,7 +2964,7 @@
|
|
|
2955
2964
|
},
|
|
2956
2965
|
{
|
|
2957
2966
|
"name": "zn-preview-frame",
|
|
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,
|
|
2967
|
+
"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.",
|
|
2959
2968
|
"attributes": [
|
|
2960
2969
|
{
|
|
2961
2970
|
"name": "src",
|
|
@@ -2977,6 +2986,11 @@
|
|
|
2977
2986
|
"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.",
|
|
2978
2987
|
"values": []
|
|
2979
2988
|
},
|
|
2989
|
+
{
|
|
2990
|
+
"name": "refresh-on",
|
|
2991
|
+
"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.",
|
|
2992
|
+
"values": []
|
|
2993
|
+
},
|
|
2980
2994
|
{
|
|
2981
2995
|
"name": "debounce",
|
|
2982
2996
|
"description": "Debounce in ms between a form change and its auto-save.",
|
|
@@ -2984,13 +2998,28 @@
|
|
|
2984
2998
|
},
|
|
2985
2999
|
{
|
|
2986
3000
|
"name": "zoom",
|
|
2987
|
-
"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.",
|
|
3001
|
+
"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.",
|
|
2988
3002
|
"values": []
|
|
2989
3003
|
},
|
|
2990
3004
|
{
|
|
2991
3005
|
"name": "min-height",
|
|
2992
|
-
"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.",
|
|
3006
|
+
"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.",
|
|
2993
3007
|
"values": []
|
|
3008
|
+
},
|
|
3009
|
+
{
|
|
3010
|
+
"name": "fill",
|
|
3011
|
+
"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.",
|
|
3012
|
+
"values": []
|
|
3013
|
+
},
|
|
3014
|
+
{
|
|
3015
|
+
"name": "device",
|
|
3016
|
+
"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.",
|
|
3017
|
+
"values": [{ "name": "PreviewFrameDevice" }]
|
|
3018
|
+
},
|
|
3019
|
+
{
|
|
3020
|
+
"name": "backdrop",
|
|
3021
|
+
"description": "Backdrop behind the stage: `dots` (default) is the canvas dot grid; `panel` is a plain `rgb(var(--zn-panel))` fill.",
|
|
3022
|
+
"values": [{ "name": "dots" }, { "name": "panel" }]
|
|
2994
3023
|
}
|
|
2995
3024
|
],
|
|
2996
3025
|
"references": [
|
|
@@ -4119,6 +4148,108 @@
|
|
|
4119
4148
|
}
|
|
4120
4149
|
]
|
|
4121
4150
|
},
|
|
4151
|
+
{
|
|
4152
|
+
"name": "zn-theme-editor",
|
|
4153
|
+
"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. With `sections` left unset, the structure is instead derived from the controls' own attributes: `group=\"<label>\"` becomes a tab and `category=\"<label>\"` a collapsible within it, and the control is slotted into that collapsible automatically. Either attribute works alone - a control with only `group` sits directly in its tab, and one with only `category` becomes its own top-level section. Setting `sections` explicitly disables the derivation entirely.\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).",
|
|
4154
|
+
"attributes": [
|
|
4155
|
+
{
|
|
4156
|
+
"name": "src",
|
|
4157
|
+
"description": "URL of the preview shell page; forwarded to the frame.",
|
|
4158
|
+
"values": []
|
|
4159
|
+
},
|
|
4160
|
+
{
|
|
4161
|
+
"name": "frame-origin",
|
|
4162
|
+
"description": "Expected origin of the iframe; forwarded to the frame.",
|
|
4163
|
+
"values": []
|
|
4164
|
+
},
|
|
4165
|
+
{
|
|
4166
|
+
"name": "data-uri",
|
|
4167
|
+
"description": "Optional endpoint returning the base hp-preview:config payload.",
|
|
4168
|
+
"values": []
|
|
4169
|
+
},
|
|
4170
|
+
{
|
|
4171
|
+
"name": "mode",
|
|
4172
|
+
"description": "Which mode the preview renders in. Travels in the theme payload.",
|
|
4173
|
+
"values": [{ "name": "ThemeEditorMode" }]
|
|
4174
|
+
},
|
|
4175
|
+
{
|
|
4176
|
+
"name": "device",
|
|
4177
|
+
"description": "Preview viewport width. Resizes the frame only; not part of the payload.",
|
|
4178
|
+
"values": [{ "name": "ThemeEditorDevice" }]
|
|
4179
|
+
},
|
|
4180
|
+
{
|
|
4181
|
+
"name": "min-height",
|
|
4182
|
+
"description": "Minimum height of the preview row, in pixels; forwarded to the frame as its own floor.",
|
|
4183
|
+
"values": []
|
|
4184
|
+
},
|
|
4185
|
+
{
|
|
4186
|
+
"name": "debounce",
|
|
4187
|
+
"description": "Debounce in ms between a control change and the push to the preview.",
|
|
4188
|
+
"values": []
|
|
4189
|
+
},
|
|
4190
|
+
{
|
|
4191
|
+
"name": "action",
|
|
4192
|
+
"description": "Optional endpoint the values are POSTed to. Empty = no persistence.",
|
|
4193
|
+
"values": []
|
|
4194
|
+
},
|
|
4195
|
+
{
|
|
4196
|
+
"name": "save-debounce",
|
|
4197
|
+
"description": "Debounce in ms between a control change and the save POST.",
|
|
4198
|
+
"values": []
|
|
4199
|
+
},
|
|
4200
|
+
{
|
|
4201
|
+
"name": "sections",
|
|
4202
|
+
"description": "Groups controls into named sections. Empty/unset falls back to deriving the\nstructure from the controls' own `group`/`category` attributes, and renders\none ungrouped column when they carry neither. A section with a non-empty\n`groups` nests a collapsible per group inside a `zn-tabs` tab for that\nsection - see `groups` on `ThemeEditorSection`.",
|
|
4203
|
+
"values": [{ "name": "ThemeEditorSection[]" }]
|
|
4204
|
+
},
|
|
4205
|
+
{
|
|
4206
|
+
"name": "section-layout",
|
|
4207
|
+
"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.",
|
|
4208
|
+
"values": [{ "name": "collapsible" }, { "name": "tabs" }]
|
|
4209
|
+
},
|
|
4210
|
+
{
|
|
4211
|
+
"name": "sources",
|
|
4212
|
+
"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.",
|
|
4213
|
+
"values": [{ "name": "ThemeEditorSource[]" }]
|
|
4214
|
+
},
|
|
4215
|
+
{
|
|
4216
|
+
"name": "controls-collapsed",
|
|
4217
|
+
"description": "Collapses the controls column.",
|
|
4218
|
+
"values": []
|
|
4219
|
+
},
|
|
4220
|
+
{
|
|
4221
|
+
"name": "standalone",
|
|
4222
|
+
"description": "Presents the editor as its own bordered, rounded panel with a plain preview backdrop, rather than embedded in a dotted canvas.",
|
|
4223
|
+
"values": []
|
|
4224
|
+
},
|
|
4225
|
+
{
|
|
4226
|
+
"name": "controls-caption",
|
|
4227
|
+
"description": "Caption in the controls column's header row. Empty (default) renders no text; the row itself always renders.",
|
|
4228
|
+
"values": []
|
|
4229
|
+
},
|
|
4230
|
+
{
|
|
4231
|
+
"name": "preview-caption",
|
|
4232
|
+
"description": "Caption at the left of the toolbar, opposite the device and mode controls. Empty (default) renders no text.",
|
|
4233
|
+
"values": []
|
|
4234
|
+
},
|
|
4235
|
+
{
|
|
4236
|
+
"name": "submit-label",
|
|
4237
|
+
"description": "Label for the built-in submit button. Empty (default) renders no button.",
|
|
4238
|
+
"values": []
|
|
4239
|
+
},
|
|
4240
|
+
{
|
|
4241
|
+
"name": "manual",
|
|
4242
|
+
"description": "Disables the debounced auto-save; saving then happens only via submit. Preview pushes are unaffected.",
|
|
4243
|
+
"values": []
|
|
4244
|
+
}
|
|
4245
|
+
],
|
|
4246
|
+
"references": [
|
|
4247
|
+
{
|
|
4248
|
+
"name": "Documentation",
|
|
4249
|
+
"url": "https://zinc.style/components/theme-editor"
|
|
4250
|
+
}
|
|
4251
|
+
]
|
|
4252
|
+
},
|
|
4122
4253
|
{
|
|
4123
4254
|
"name": "zn-tile",
|
|
4124
4255
|
"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.",
|