@kubex/zinc 1.1.62 → 1.1.63
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 +337 -6
- package/dist/vscode.html-custom-data.json +55 -3
- package/dist/web-types.json +116 -6
- package/dist/zn.d.ts +83 -0
- package/dist/zn.min.js +529 -518
- package/docs/data/preview-frame-payload-error.json +4 -0
- package/docs/data/preview-frame-payload.json +6 -0
- package/docs/pages/components/form-group.md +12 -0
- package/docs/pages/components/preview-frame-demo.njk +138 -0
- package/docs/pages/components/preview-frame.md +105 -0
- package/docs/pages/components/toggle.md +2 -2
- package/package.json +1 -1
- package/src/components/form-group/form-group.component.ts +24 -12
- package/src/components/form-group/form-group.scss +10 -0
- package/src/components/form-group/form-group.test.ts +19 -0
- package/src/components/preview-frame/index.ts +12 -0
- package/src/components/preview-frame/preview-frame.component.ts +246 -0
- package/src/components/preview-frame/preview-frame.scss +27 -0
- package/src/components/preview-frame/preview-frame.test.ts +268 -0
- package/src/components/select/select.component.ts +4 -0
- package/src/components/select/select.test.ts +29 -0
- package/src/components/sp/sp.scss +5 -1
- package/src/components/tile/tile.scss +5 -1
- package/src/components/toggle/toggle.component.ts +3 -12
- package/src/components/toggle/toggle.test.ts +29 -0
- package/src/events/zn-error.ts +1 -1
- package/src/zinc.ts +1 -0
package/dist/web-types.json
CHANGED
|
@@ -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.
|
|
4
|
+
"version": "1.1.63",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -4084,7 +4084,7 @@
|
|
|
4084
4084
|
},
|
|
4085
4085
|
{
|
|
4086
4086
|
"name": "zn-form-group",
|
|
4087
|
-
"description": "Short summary of the component's intended use.\n---\n\n\n### **Slots:**\n - _default_ - The default slot.",
|
|
4087
|
+
"description": "Short summary of the component's intended use.\n---\n\n\n### **Slots:**\n - _default_ - The default slot.\n- **chip** - A chip displayed under the form group's help text.",
|
|
4088
4088
|
"doc-url": "",
|
|
4089
4089
|
"attributes": [
|
|
4090
4090
|
{
|
|
@@ -4109,9 +4109,19 @@
|
|
|
4109
4109
|
{
|
|
4110
4110
|
"name": "layout",
|
|
4111
4111
|
"value": { "type": "string", "default": "\"1,2\"" }
|
|
4112
|
+
},
|
|
4113
|
+
{
|
|
4114
|
+
"name": "pad",
|
|
4115
|
+
"value": { "type": "boolean", "default": "false" }
|
|
4116
|
+
}
|
|
4117
|
+
],
|
|
4118
|
+
"slots": [
|
|
4119
|
+
{ "name": "", "description": "The default slot." },
|
|
4120
|
+
{
|
|
4121
|
+
"name": "chip",
|
|
4122
|
+
"description": "A chip displayed under the form group's help text."
|
|
4112
4123
|
}
|
|
4113
4124
|
],
|
|
4114
|
-
"slots": [{ "name": "", "description": "The default slot." }],
|
|
4115
4125
|
"events": [],
|
|
4116
4126
|
"js": {
|
|
4117
4127
|
"properties": [
|
|
@@ -4131,7 +4141,8 @@
|
|
|
4131
4141
|
"type": "string"
|
|
4132
4142
|
},
|
|
4133
4143
|
{ "name": "forceCols", "type": "boolean" },
|
|
4134
|
-
{ "name": "layout", "type": "string" }
|
|
4144
|
+
{ "name": "layout", "type": "string" },
|
|
4145
|
+
{ "name": "pad", "type": "boolean" }
|
|
4135
4146
|
],
|
|
4136
4147
|
"events": []
|
|
4137
4148
|
}
|
|
@@ -6789,6 +6800,100 @@
|
|
|
6789
6800
|
]
|
|
6790
6801
|
}
|
|
6791
6802
|
},
|
|
6803
|
+
{
|
|
6804
|
+
"name": "zn-preview-frame",
|
|
6805
|
+
"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.",
|
|
6806
|
+
"doc-url": "",
|
|
6807
|
+
"attributes": [
|
|
6808
|
+
{
|
|
6809
|
+
"name": "src",
|
|
6810
|
+
"description": "URL of the preview shell page (tokened embed URL).",
|
|
6811
|
+
"value": { "type": "string", "default": "''" }
|
|
6812
|
+
},
|
|
6813
|
+
{
|
|
6814
|
+
"name": "frame-origin",
|
|
6815
|
+
"description": "Expected origin of the iframe; all postMessage traffic is checked against it.",
|
|
6816
|
+
"value": { "type": "string", "default": "''" }
|
|
6817
|
+
},
|
|
6818
|
+
{
|
|
6819
|
+
"name": "data-uri",
|
|
6820
|
+
"description": "Endpoint returning the hp-preview:config payload JSON. The console proxy rewrites this attribute to an app-prefixed path for proper fetch resolution.",
|
|
6821
|
+
"value": { "type": "string", "default": "''" }
|
|
6822
|
+
},
|
|
6823
|
+
{
|
|
6824
|
+
"name": "watch",
|
|
6825
|
+
"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.",
|
|
6826
|
+
"value": { "type": "string", "default": "'form[data-auto-save]'" }
|
|
6827
|
+
},
|
|
6828
|
+
{
|
|
6829
|
+
"name": "debounce",
|
|
6830
|
+
"description": "Debounce in ms between a form change and its auto-save.",
|
|
6831
|
+
"value": { "type": "number", "default": "400" }
|
|
6832
|
+
},
|
|
6833
|
+
{
|
|
6834
|
+
"name": "zoom",
|
|
6835
|
+
"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.",
|
|
6836
|
+
"value": { "type": "number", "default": "1" }
|
|
6837
|
+
},
|
|
6838
|
+
{
|
|
6839
|
+
"name": "min-height",
|
|
6840
|
+
"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.",
|
|
6841
|
+
"value": { "type": "number", "default": "480" }
|
|
6842
|
+
}
|
|
6843
|
+
],
|
|
6844
|
+
"events": [
|
|
6845
|
+
{
|
|
6846
|
+
"name": "zn-error",
|
|
6847
|
+
"description": "Emitted when the preview reports a render error or a save fails."
|
|
6848
|
+
}
|
|
6849
|
+
],
|
|
6850
|
+
"js": {
|
|
6851
|
+
"properties": [
|
|
6852
|
+
{
|
|
6853
|
+
"name": "src",
|
|
6854
|
+
"description": "URL of the preview shell page (tokened embed URL).",
|
|
6855
|
+
"type": "string"
|
|
6856
|
+
},
|
|
6857
|
+
{
|
|
6858
|
+
"name": "frameOrigin",
|
|
6859
|
+
"description": "Expected origin of the iframe; all postMessage traffic is checked against it.",
|
|
6860
|
+
"type": "string"
|
|
6861
|
+
},
|
|
6862
|
+
{
|
|
6863
|
+
"name": "dataUri",
|
|
6864
|
+
"description": "Endpoint returning the hp-preview:config payload JSON. The console proxy rewrites this attribute to an app-prefixed path for proper fetch resolution.",
|
|
6865
|
+
"type": "string"
|
|
6866
|
+
},
|
|
6867
|
+
{
|
|
6868
|
+
"name": "watch",
|
|
6869
|
+
"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.",
|
|
6870
|
+
"type": "string"
|
|
6871
|
+
},
|
|
6872
|
+
{
|
|
6873
|
+
"name": "debounce",
|
|
6874
|
+
"description": "Debounce in ms between a form change and its auto-save.",
|
|
6875
|
+
"type": "number"
|
|
6876
|
+
},
|
|
6877
|
+
{
|
|
6878
|
+
"name": "zoom",
|
|
6879
|
+
"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.",
|
|
6880
|
+
"type": "number"
|
|
6881
|
+
},
|
|
6882
|
+
{
|
|
6883
|
+
"name": "minHeight",
|
|
6884
|
+
"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.",
|
|
6885
|
+
"type": "number"
|
|
6886
|
+
},
|
|
6887
|
+
{ "name": "frame", "type": "HTMLIFrameElement" }
|
|
6888
|
+
],
|
|
6889
|
+
"events": [
|
|
6890
|
+
{
|
|
6891
|
+
"name": "zn-error",
|
|
6892
|
+
"description": "Emitted when the preview reports a render error or a save fails."
|
|
6893
|
+
}
|
|
6894
|
+
]
|
|
6895
|
+
}
|
|
6896
|
+
},
|
|
6792
6897
|
{
|
|
6793
6898
|
"name": "zn-priority-list",
|
|
6794
6899
|
"description": "A reorderable list where each item receives a numerical priority based on its position. Supports drag-and-drop\nand keyboard reordering. Priority values are submitted as form data via hidden inputs.\n---\n\n\n### **Events:**\n - **zn-change** - Emitted when the order of items changes.\n- **zn-reorder** - Emitted when items are reordered. Call `getPriorityMap()` on the component to get the updated `{ key: string, priority: number }[]` array.\n\n### **Methods:**\n - **getPriorityMap(): _PriorityItem[]_** - Returns the priority map: an array of { key, priority } objects.\n- **checkValidity(): _boolean_** - Checks for validity but does not show a validation message.\n- **getForm(): _HTMLFormElement | null_** - Gets the associated form, if one exists.\n- **reportValidity(): _boolean_** - Checks for validity and shows the browser's validation message if the control is invalid.\n- **setCustomValidity(_message)** - Sets a custom validation message. Pass an empty string to restore validity.\n\n### **Slots:**\n - _default_ - The default slot where list items are placed. Each slotted element must have a `value` attribute that uniquely identifies the item. The component automatically assigns slot names to project each item into the correct position. The item's position in the list determines its priority (top = `priority-start`, incrementing).\n- **label** - The component's label. Required for proper accessibility. Alternatively, use the `label` attribute.\n- **label-tooltip** - Used to add text displayed in a tooltip next to the label.\n- **help-text** - Text that describes how to use the component. Alternatively, use the `help-text` attribute.\n\n### **CSS Properties:**\n - **--zn-priority-list-item-gap** - The gap between list items. Defaults to `var(--zn-spacing-2x-small)`. _(default: undefined)_\n- **--zn-priority-list-item-padding** - The padding inside each item. Defaults to `var(--zn-spacing-small) var(--zn-spacing-medium)`. _(default: undefined)_\n- **--zn-priority-list-handle-color** - The color of the drag handle. Defaults to `var(--zn-color-neutral-500)`. _(default: undefined)_\n- **--zn-priority-list-priority-color** - The color of the priority number. Defaults to `var(--zn-color-neutral-600)`. _(default: undefined)_\n\n### **CSS Parts:**\n - **form-control** - The form control wrapper.\n- **form-control-label** - The label wrapper.\n- **form-control-input** - The input area wrapper.\n- **form-control-help-text** - The help text wrapper.\n- **list** - The list container.\n- **item** - An individual list item row.\n- **drag-handle** - The drag handle icon.\n- **priority** - The priority number badge.\n- **content** - The content area of an item.",
|
|
@@ -9574,7 +9679,8 @@
|
|
|
9574
9679
|
{ "name": "value", "value": { "type": "string" } },
|
|
9575
9680
|
{
|
|
9576
9681
|
"name": "fallback",
|
|
9577
|
-
"
|
|
9682
|
+
"description": "The value submitted when the toggle is unchecked, so the toggle always submits a value.",
|
|
9683
|
+
"value": { "type": "string", "default": "'off'" }
|
|
9578
9684
|
},
|
|
9579
9685
|
{
|
|
9580
9686
|
"name": "size",
|
|
@@ -9654,7 +9760,11 @@
|
|
|
9654
9760
|
{ "name": "title", "type": "string" },
|
|
9655
9761
|
{ "name": "name", "type": "string" },
|
|
9656
9762
|
{ "name": "value", "type": "string" },
|
|
9657
|
-
{
|
|
9763
|
+
{
|
|
9764
|
+
"name": "fallbackValue",
|
|
9765
|
+
"description": "The value submitted when the toggle is unchecked, so the toggle always submits a value.",
|
|
9766
|
+
"type": "string"
|
|
9767
|
+
},
|
|
9658
9768
|
{ "name": "size", "type": "'small' | 'medium' | 'large'" },
|
|
9659
9769
|
{ "name": "disabled", "type": "boolean" },
|
|
9660
9770
|
{ "name": "checked", "type": "boolean" },
|
package/dist/zn.d.ts
CHANGED
|
@@ -1327,6 +1327,7 @@ declare module "components/toggle/toggle.component" {
|
|
|
1327
1327
|
title: string;
|
|
1328
1328
|
name: string;
|
|
1329
1329
|
value: string;
|
|
1330
|
+
/** The value submitted when the toggle is unchecked, so the toggle always submits a value. */
|
|
1330
1331
|
fallbackValue: string;
|
|
1331
1332
|
size: 'small' | 'medium' | 'large';
|
|
1332
1333
|
disabled: boolean;
|
|
@@ -6572,6 +6573,7 @@ declare module "components/form-group/form-group.component" {
|
|
|
6572
6573
|
* @since 1.0
|
|
6573
6574
|
*
|
|
6574
6575
|
* @slot - The default slot.
|
|
6576
|
+
* @slot chip - A chip displayed under the form group's help text.
|
|
6575
6577
|
*
|
|
6576
6578
|
*/
|
|
6577
6579
|
export default class ZnFormGroup extends ZincElement {
|
|
@@ -6591,6 +6593,7 @@ declare module "components/form-group/form-group.component" {
|
|
|
6591
6593
|
helpText: string;
|
|
6592
6594
|
forceCols: boolean;
|
|
6593
6595
|
layout: string;
|
|
6596
|
+
pad: boolean;
|
|
6594
6597
|
render(): import("lit-html").TemplateResult<1>;
|
|
6595
6598
|
}
|
|
6596
6599
|
}
|
|
@@ -10157,6 +10160,84 @@ declare module "components/page-builder/index" {
|
|
|
10157
10160
|
}
|
|
10158
10161
|
}
|
|
10159
10162
|
}
|
|
10163
|
+
declare module "components/preview-frame/preview-frame.component" {
|
|
10164
|
+
import { type CSSResultGroup } from 'lit';
|
|
10165
|
+
import ZincElement from "internal/zinc-element";
|
|
10166
|
+
/**
|
|
10167
|
+
* @summary Embeds a live preview iframe and drives the hp-preview postMessage
|
|
10168
|
+
* protocol: answers the frame's ready handshake with a config payload fetched
|
|
10169
|
+
* from data-uri, auto-saves watched forms on change, and refreshes the
|
|
10170
|
+
* preview after each save.
|
|
10171
|
+
* @documentation https://zinc.style/components/preview-frame
|
|
10172
|
+
* @status experimental
|
|
10173
|
+
* @since 1.0
|
|
10174
|
+
*
|
|
10175
|
+
* @event zn-error - Emitted when the preview reports a render error or a save fails.
|
|
10176
|
+
*
|
|
10177
|
+
* @csspart base - The component's base wrapper.
|
|
10178
|
+
* @csspart iframe - The preview iframe.
|
|
10179
|
+
* @csspart error - The error overlay.
|
|
10180
|
+
*/
|
|
10181
|
+
export default class ZnPreviewFrame extends ZincElement {
|
|
10182
|
+
static styles: CSSResultGroup;
|
|
10183
|
+
/** URL of the preview shell page (tokened embed URL). */
|
|
10184
|
+
src: string;
|
|
10185
|
+
/** Expected origin of the iframe; all postMessage traffic is checked against it. */
|
|
10186
|
+
frameOrigin: string;
|
|
10187
|
+
/** Endpoint returning the hp-preview:config payload JSON. The console proxy rewrites this attribute to an app-prefixed path for proper fetch resolution. */
|
|
10188
|
+
dataUri: string;
|
|
10189
|
+
/**
|
|
10190
|
+
* Selector (resolved against the component's root node) for the forms to watch.
|
|
10191
|
+
* Defaults to only forms explicitly opted in via a `data-auto-save` attribute —
|
|
10192
|
+
* unmarked forms keep normal submit behavior and are never intercepted,
|
|
10193
|
+
* auto-saved, or used to trigger a preview refresh. Override to widen the scope.
|
|
10194
|
+
*/
|
|
10195
|
+
watch: string;
|
|
10196
|
+
/** Debounce in ms between a form change and its auto-save. */
|
|
10197
|
+
debounce: number;
|
|
10198
|
+
/**
|
|
10199
|
+
* Zooms the previewed page out (0–1]. The frame always fills the panel;
|
|
10200
|
+
* zoom shrinks the content browser-style, so 0.4 shows the page at 40%
|
|
10201
|
+
* size with correspondingly more of it visible. 1 = natural size.
|
|
10202
|
+
*/
|
|
10203
|
+
zoom: number;
|
|
10204
|
+
/**
|
|
10205
|
+
* The visible height (in CSS pixels) of the preview panel. Fixed rather
|
|
10206
|
+
* than measured, because a measured height would feed back into the
|
|
10207
|
+
* scaled iframe's layout box and grow unbounded.
|
|
10208
|
+
*/
|
|
10209
|
+
minHeight: number;
|
|
10210
|
+
frame: HTMLIFrameElement;
|
|
10211
|
+
private error;
|
|
10212
|
+
private _generation;
|
|
10213
|
+
private readonly _watchedForms;
|
|
10214
|
+
private readonly _debounceTimers;
|
|
10215
|
+
private readonly _formObserver;
|
|
10216
|
+
connectedCallback(): void;
|
|
10217
|
+
disconnectedCallback(): void;
|
|
10218
|
+
private readonly _onMessage;
|
|
10219
|
+
/** Re-fetches the payload and pushes a fresh config to the preview. */
|
|
10220
|
+
refresh(): Promise<void>;
|
|
10221
|
+
private _sendConfig;
|
|
10222
|
+
private _attachForms;
|
|
10223
|
+
private _detachForm;
|
|
10224
|
+
private readonly _onChange;
|
|
10225
|
+
private readonly _onSubmit;
|
|
10226
|
+
private _save;
|
|
10227
|
+
private _fail;
|
|
10228
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
10229
|
+
}
|
|
10230
|
+
}
|
|
10231
|
+
declare module "components/preview-frame/index" {
|
|
10232
|
+
import ZnPreviewFrame from "components/preview-frame/preview-frame.component";
|
|
10233
|
+
export * from "components/preview-frame/preview-frame.component";
|
|
10234
|
+
export default ZnPreviewFrame;
|
|
10235
|
+
global {
|
|
10236
|
+
interface HTMLElementTagNameMap {
|
|
10237
|
+
'zn-preview-frame': ZnPreviewFrame;
|
|
10238
|
+
}
|
|
10239
|
+
}
|
|
10240
|
+
}
|
|
10160
10241
|
declare module "utilities/form" {
|
|
10161
10242
|
export { clearFormStoreValues } from "internal/form";
|
|
10162
10243
|
}
|
|
@@ -10455,6 +10536,7 @@ declare module "zinc" {
|
|
|
10455
10536
|
export { default as PageBuilder } from "components/page-builder/index";
|
|
10456
10537
|
export { default as PagePaletteItem } from "components/page-builder/modules/page-palette-item/index";
|
|
10457
10538
|
export { default as PageSectionCard } from "components/page-builder/modules/page-section-card/index";
|
|
10539
|
+
export { default as PreviewFrame } from "components/preview-frame/index";
|
|
10458
10540
|
export { default as ZincElement } from "internal/zinc-element";
|
|
10459
10541
|
export * from "utilities/on";
|
|
10460
10542
|
export * from "utilities/query";
|
|
@@ -10570,6 +10652,7 @@ declare module "events/zn-element-added" {
|
|
|
10570
10652
|
declare module "events/zn-error" {
|
|
10571
10653
|
export type ZnErrorEvent = CustomEvent<{
|
|
10572
10654
|
status?: number;
|
|
10655
|
+
message?: string;
|
|
10573
10656
|
}>;
|
|
10574
10657
|
global {
|
|
10575
10658
|
interface GlobalEventHandlersEventMap {
|