@kubex/zinc 1.1.125 → 1.1.126
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 +41 -3
- package/dist/vscode.html-custom-data.json +1 -1
- package/dist/web-types.json +3 -3
- package/dist/zn.d.ts +40 -6
- package/dist/zn.min.js +256 -246
- package/package.json +1 -1
- package/src/components/collapsible/collapsible.scss +3 -0
- package/src/components/expanding-action/expanding-action.component.ts +4 -2
- package/src/components/page-builder/modules/page-palette-item/page-palette-item.scss +4 -1
- package/src/components/page-builder/page-builder.component.ts +62 -13
- package/src/components/page-builder/page-builder.scss +1 -1
- package/src/components/page-builder/page-builder.test.ts +90 -0
- package/src/components/page-builder/page.types.ts +40 -5
|
@@ -27991,7 +27991,7 @@
|
|
|
27991
27991
|
],
|
|
27992
27992
|
"slots": [
|
|
27993
27993
|
{
|
|
27994
|
-
"description": "`<template type=\"…\">` declarations; never displayed. Each template's attributes (type, label, icon, icon-library, color, category, description, slots, accepts) declare a palette entry and its content declares the inspector form for that type. `slots` makes the section a container
|
|
27994
|
+
"description": "`<template type=\"…\">` declarations; never displayed. Each template's attributes (type, label, icon, icon-library, color, category, description, slots, accepts) declare a palette entry and its content declares the inspector form for that type. `slots` makes the section a container that many slots wide — rows are added as they fill — and `slots-min`/ `slots-max` let each placed section choose its own width; `accepts` is a comma-separated list of the type keys its slots allow.",
|
|
27995
27995
|
"name": "config"
|
|
27996
27996
|
},
|
|
27997
27997
|
{
|
|
@@ -28510,6 +28510,25 @@
|
|
|
28510
28510
|
}
|
|
28511
28511
|
]
|
|
28512
28512
|
},
|
|
28513
|
+
{
|
|
28514
|
+
"kind": "method",
|
|
28515
|
+
"name": "_slotsFromAttributes",
|
|
28516
|
+
"privacy": "private",
|
|
28517
|
+
"return": {
|
|
28518
|
+
"type": {
|
|
28519
|
+
"text": "Pick<PageSectionType, 'slots' | 'slotsMin' | 'slotsMax'>"
|
|
28520
|
+
}
|
|
28521
|
+
},
|
|
28522
|
+
"parameters": [
|
|
28523
|
+
{
|
|
28524
|
+
"name": "el",
|
|
28525
|
+
"type": {
|
|
28526
|
+
"text": "HTMLTemplateElement"
|
|
28527
|
+
}
|
|
28528
|
+
}
|
|
28529
|
+
],
|
|
28530
|
+
"description": "`slots=\"N\"` is a container N slots wide; adding `slots-max` lets each placed\nsection choose its own width between `slots-min` (1 by default) and that. A\nwidth past the slot cap would leave a container with no usable row, so an\nout-of-bounds bound is ignored rather than honoured."
|
|
28531
|
+
},
|
|
28513
28532
|
{
|
|
28514
28533
|
"kind": "field",
|
|
28515
28534
|
"name": "_registerSlottedTemplates",
|
|
@@ -28754,6 +28773,25 @@
|
|
|
28754
28773
|
],
|
|
28755
28774
|
"description": "Adds a new section of a registered type into a container's slot. Returns null if not allowed."
|
|
28756
28775
|
},
|
|
28776
|
+
{
|
|
28777
|
+
"kind": "method",
|
|
28778
|
+
"name": "setSectionColumns",
|
|
28779
|
+
"parameters": [
|
|
28780
|
+
{
|
|
28781
|
+
"name": "id",
|
|
28782
|
+
"type": {
|
|
28783
|
+
"text": "string"
|
|
28784
|
+
}
|
|
28785
|
+
},
|
|
28786
|
+
{
|
|
28787
|
+
"name": "columns",
|
|
28788
|
+
"type": {
|
|
28789
|
+
"text": "number"
|
|
28790
|
+
}
|
|
28791
|
+
}
|
|
28792
|
+
],
|
|
28793
|
+
"description": "Sets how many slots per row a container whose type allows a choice lays out,\nclamped to the declared bounds. Children keep their order and reflow into the\nnew width, so nothing is lost by narrowing one."
|
|
28794
|
+
},
|
|
28757
28795
|
{
|
|
28758
28796
|
"kind": "method",
|
|
28759
28797
|
"name": "_removeSection",
|
|
@@ -29313,7 +29351,7 @@
|
|
|
29313
29351
|
"tagNameWithoutPrefix": "page-builder",
|
|
29314
29352
|
"tagName": "zn-page-builder",
|
|
29315
29353
|
"customElement": true,
|
|
29316
|
-
"jsDoc": "/**\n * @summary A config-driven page composer: a palette of predefined section types, a linear\n * canvas of section cards, and an inspector for editing each section's content.\n * @documentation https://zinc.style/components/page-builder\n * @status experimental\n * @since 1.0\n *\n * @dependency zn-collapsible\n * @dependency zn-icon\n * @dependency zn-input\n * @dependency zn-page-palette-item\n * @dependency zn-page-section-card\n *\n * @event zn-page-change - Emitted whenever the page state changes. `event.detail.state` is the new PageState.\n * @event zn-page-selection-change - Emitted when the selected section changes. `event.detail.sectionId`.\n *\n * @slot config - `<template type=\"…\">` declarations; never displayed. Each template's attributes\n * (type, label, icon, icon-library, color, category, description, slots, accepts) declare a\n * palette entry and its content declares the inspector form for that type. `slots` makes the\n * section a container
|
|
29354
|
+
"jsDoc": "/**\n * @summary A config-driven page composer: a palette of predefined section types, a linear\n * canvas of section cards, and an inspector for editing each section's content.\n * @documentation https://zinc.style/components/page-builder\n * @status experimental\n * @since 1.0\n *\n * @dependency zn-collapsible\n * @dependency zn-icon\n * @dependency zn-input\n * @dependency zn-page-palette-item\n * @dependency zn-page-section-card\n *\n * @event zn-page-change - Emitted whenever the page state changes. `event.detail.state` is the new PageState.\n * @event zn-page-selection-change - Emitted when the selected section changes. `event.detail.sectionId`.\n *\n * @slot config - `<template type=\"…\">` declarations; never displayed. Each template's attributes\n * (type, label, icon, icon-library, color, category, description, slots, accepts) declare a\n * palette entry and its content declares the inspector form for that type. `slots` makes the\n * section a container that many slots wide — rows are added as they fill — and `slots-min`/\n * `slots-max` let each placed section choose its own width; `accepts` is a comma-separated\n * list of the type keys its slots allow.\n * @slot header-left - Actions shown on the left of the header bar.\n * @slot header-right - Actions shown on the right of the header bar.\n *\n * @csspart base - The grid wrapper.\n * @csspart header - The full-width header action bar (only rendered when header slots are filled).\n * @csspart palette - The left palette panel.\n * @csspart canvas - The centre section-card canvas.\n * @csspart inspector - The right panel while a section is selected.\n * @csspart inspector-header - The inspector's fixed header (icon, section name, type, close).\n * @csspart inspector-body - The inspector's scrolling form area.\n */",
|
|
29317
29355
|
"documentation": "https://zinc.style/components/page-builder",
|
|
29318
29356
|
"status": "experimental",
|
|
29319
29357
|
"since": "1.0",
|
|
@@ -52643,7 +52681,7 @@
|
|
|
52643
52681
|
"package": {
|
|
52644
52682
|
"name": "@kubex/zinc",
|
|
52645
52683
|
"description": "A collection of web components for building web applications based off of @shoelace-style/Shoelace",
|
|
52646
|
-
"version": "1.1.
|
|
52684
|
+
"version": "1.1.126",
|
|
52647
52685
|
"author": "",
|
|
52648
52686
|
"license": "MIT"
|
|
52649
52687
|
}
|
|
@@ -2942,7 +2942,7 @@
|
|
|
2942
2942
|
},
|
|
2943
2943
|
{
|
|
2944
2944
|
"name": "zn-page-builder",
|
|
2945
|
-
"description": "A config-driven page composer: a palette of predefined section types, a linear\ncanvas of section cards, and an inspector for editing each section's content.\n---\n\n\n### **Events:**\n - **zn-page-change** - Emitted whenever the page state changes. `event.detail.state` is the new PageState.\n- **zn-page-selection-change** - Emitted when the selected section changes. `event.detail.sectionId`.\n\n### **Methods:**\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- **addSection(type: _string_, index: _number_): _PageSection | null_** - Adds a section of a registered type at `index` (default: end). Returns null for unknown types.\n- **addSectionToSlot(type: _string_, containerId: _string_, slotIndex: _number_): _PageSection | null_** - Adds a new section of a registered type into a container's slot. Returns null if not allowed.\n\n### **Slots:**\n - **config** - `<template type=\"…\">` declarations; never displayed. Each template's attributes (type, label, icon, icon-library, color, category, description, slots, accepts) declare a palette entry and its content declares the inspector form for that type. `slots` makes the section a container
|
|
2945
|
+
"description": "A config-driven page composer: a palette of predefined section types, a linear\ncanvas of section cards, and an inspector for editing each section's content.\n---\n\n\n### **Events:**\n - **zn-page-change** - Emitted whenever the page state changes. `event.detail.state` is the new PageState.\n- **zn-page-selection-change** - Emitted when the selected section changes. `event.detail.sectionId`.\n\n### **Methods:**\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- **addSection(type: _string_, index: _number_): _PageSection | null_** - Adds a section of a registered type at `index` (default: end). Returns null for unknown types.\n- **addSectionToSlot(type: _string_, containerId: _string_, slotIndex: _number_): _PageSection | null_** - Adds a new section of a registered type into a container's slot. Returns null if not allowed.\n- **setSectionColumns(id: _string_, columns: _number_)** - Sets how many slots per row a container whose type allows a choice lays out,\nclamped to the declared bounds. Children keep their order and reflow into the\nnew width, so nothing is lost by narrowing one.\n\n### **Slots:**\n - **config** - `<template type=\"…\">` declarations; never displayed. Each template's attributes (type, label, icon, icon-library, color, category, description, slots, accepts) declare a palette entry and its content declares the inspector form for that type. `slots` makes the section a container that many slots wide — rows are added as they fill — and `slots-min`/ `slots-max` let each placed section choose its own width; `accepts` is a comma-separated list of the type keys its slots allow.\n- **header-left** - Actions shown on the left of the header bar.\n- **header-right** - Actions shown on the right of the header bar.\n\n### **CSS Parts:**\n - **base** - The grid wrapper.\n- **header** - The full-width header action bar (only rendered when header slots are filled).\n- **palette** - The left palette panel.\n- **canvas** - The centre section-card canvas.\n- **inspector** - The right panel while a section is selected.\n- **inspector-header** - The inspector's fixed header (icon, section name, type, close).\n- **inspector-body** - The inspector's scrolling form area.",
|
|
2946
2946
|
"attributes": [
|
|
2947
2947
|
{
|
|
2948
2948
|
"name": "name",
|
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.126",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -6933,7 +6933,7 @@
|
|
|
6933
6933
|
},
|
|
6934
6934
|
{
|
|
6935
6935
|
"name": "zn-page-builder",
|
|
6936
|
-
"description": "A config-driven page composer: a palette of predefined section types, a linear\ncanvas of section cards, and an inspector for editing each section's content.\n---\n\n\n### **Events:**\n - **zn-page-change** - Emitted whenever the page state changes. `event.detail.state` is the new PageState.\n- **zn-page-selection-change** - Emitted when the selected section changes. `event.detail.sectionId`.\n\n### **Methods:**\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- **addSection(type: _string_, index: _number_): _PageSection | null_** - Adds a section of a registered type at `index` (default: end). Returns null for unknown types.\n- **addSectionToSlot(type: _string_, containerId: _string_, slotIndex: _number_): _PageSection | null_** - Adds a new section of a registered type into a container's slot. Returns null if not allowed.\n\n### **Slots:**\n - **config** - `<template type=\"…\">` declarations; never displayed. Each template's attributes (type, label, icon, icon-library, color, category, description, slots, accepts) declare a palette entry and its content declares the inspector form for that type. `slots` makes the section a container
|
|
6936
|
+
"description": "A config-driven page composer: a palette of predefined section types, a linear\ncanvas of section cards, and an inspector for editing each section's content.\n---\n\n\n### **Events:**\n - **zn-page-change** - Emitted whenever the page state changes. `event.detail.state` is the new PageState.\n- **zn-page-selection-change** - Emitted when the selected section changes. `event.detail.sectionId`.\n\n### **Methods:**\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- **addSection(type: _string_, index: _number_): _PageSection | null_** - Adds a section of a registered type at `index` (default: end). Returns null for unknown types.\n- **addSectionToSlot(type: _string_, containerId: _string_, slotIndex: _number_): _PageSection | null_** - Adds a new section of a registered type into a container's slot. Returns null if not allowed.\n- **setSectionColumns(id: _string_, columns: _number_)** - Sets how many slots per row a container whose type allows a choice lays out,\nclamped to the declared bounds. Children keep their order and reflow into the\nnew width, so nothing is lost by narrowing one.\n\n### **Slots:**\n - **config** - `<template type=\"…\">` declarations; never displayed. Each template's attributes (type, label, icon, icon-library, color, category, description, slots, accepts) declare a palette entry and its content declares the inspector form for that type. `slots` makes the section a container that many slots wide — rows are added as they fill — and `slots-min`/ `slots-max` let each placed section choose its own width; `accepts` is a comma-separated list of the type keys its slots allow.\n- **header-left** - Actions shown on the left of the header bar.\n- **header-right** - Actions shown on the right of the header bar.\n\n### **CSS Parts:**\n - **base** - The grid wrapper.\n- **header** - The full-width header action bar (only rendered when header slots are filled).\n- **palette** - The left palette panel.\n- **canvas** - The centre section-card canvas.\n- **inspector** - The right panel while a section is selected.\n- **inspector-header** - The inspector's fixed header (icon, section name, type, close).\n- **inspector-body** - The inspector's scrolling form area.",
|
|
6937
6937
|
"doc-url": "",
|
|
6938
6938
|
"attributes": [
|
|
6939
6939
|
{
|
|
@@ -6983,7 +6983,7 @@
|
|
|
6983
6983
|
"slots": [
|
|
6984
6984
|
{
|
|
6985
6985
|
"name": "config",
|
|
6986
|
-
"description": "`<template type=\"…\">` declarations; never displayed. Each template's attributes (type, label, icon, icon-library, color, category, description, slots, accepts) declare a palette entry and its content declares the inspector form for that type. `slots` makes the section a container
|
|
6986
|
+
"description": "`<template type=\"…\">` declarations; never displayed. Each template's attributes (type, label, icon, icon-library, color, category, description, slots, accepts) declare a palette entry and its content declares the inspector form for that type. `slots` makes the section a container that many slots wide — rows are added as they fill — and `slots-min`/ `slots-max` let each placed section choose its own width; `accepts` is a comma-separated list of the type keys its slots allow."
|
|
6987
6987
|
},
|
|
6988
6988
|
{
|
|
6989
6989
|
"name": "header-left",
|
package/dist/zn.d.ts
CHANGED
|
@@ -11372,7 +11372,9 @@ declare module "components/page-builder/page.types" {
|
|
|
11372
11372
|
label?: string;
|
|
11373
11373
|
/** Section content, keyed by field name (the inspector's `name` attributes). */
|
|
11374
11374
|
data: Record<string, unknown>;
|
|
11375
|
-
/**
|
|
11375
|
+
/** Slots per row for a container whose type allows a choice; the type's default applies otherwise. */
|
|
11376
|
+
columns?: number;
|
|
11377
|
+
/** Slot contents for container sections, sized to {@link slotCount}. Empty slots are null. */
|
|
11376
11378
|
children?: (PageSection | null)[];
|
|
11377
11379
|
}
|
|
11378
11380
|
/** The complete serialisable state of a page. Order = render order. */
|
|
@@ -11401,14 +11403,32 @@ declare module "components/page-builder/page.types" {
|
|
|
11401
11403
|
/** Programmatic inspector body — takes precedence over `configTemplate`. */
|
|
11402
11404
|
renderConfig?: (section: PageSection, update: (data: Record<string, unknown>) => void) => TemplateResult;
|
|
11403
11405
|
/**
|
|
11404
|
-
*
|
|
11405
|
-
*
|
|
11406
|
+
* Slots per row on the canvas, and what makes a section a container. Rows are
|
|
11407
|
+
* added as they fill, so this is a width and not a capacity. Containers cannot
|
|
11408
|
+
* be placed inside other containers.
|
|
11406
11409
|
*/
|
|
11407
11410
|
slots?: number;
|
|
11411
|
+
/** Lower bound of a per-section column count. Defaults to 1 when `slotsMax` is set. */
|
|
11412
|
+
slotsMin?: number;
|
|
11413
|
+
/** Upper bound of a per-section column count. Its presence is what makes the width editable. */
|
|
11414
|
+
slotsMax?: number;
|
|
11408
11415
|
/** Section type keys allowed in this container's slots. Omit to allow any non-container type. */
|
|
11409
11416
|
accepts?: string[];
|
|
11410
11417
|
}
|
|
11411
|
-
/**
|
|
11418
|
+
/** Per-container children beyond this are dropped when external state is applied. */
|
|
11419
|
+
export const MAX_SLOTS = 24;
|
|
11420
|
+
/**
|
|
11421
|
+
* Slots per row for a placed container: its own choice when the type allows one,
|
|
11422
|
+
* clamped to the declared bounds, else the type's fixed width.
|
|
11423
|
+
*/
|
|
11424
|
+
export function slotColumns(section: PageSection, type: PageSectionType): number;
|
|
11425
|
+
/**
|
|
11426
|
+
* How many slots a placed container shows: enough rows to hold every child it
|
|
11427
|
+
* already has, plus a fresh row once the last one fills. Empty rows are never
|
|
11428
|
+
* offered ahead of being needed, and the total stays within {@link MAX_SLOTS}.
|
|
11429
|
+
*/
|
|
11430
|
+
export function slotCount(section: PageSection, type: PageSectionType): number;
|
|
11431
|
+
/** A container section's slot contents, padded/truncated to its slot count. */
|
|
11412
11432
|
export function sectionChildren(section: PageSection, type: PageSectionType): (PageSection | null)[];
|
|
11413
11433
|
/** Drag-and-drop MIME carrying a section type id from the palette to the canvas. */
|
|
11414
11434
|
export const PAGE_TYPE_MIME = "application/x-zn-page-type";
|
|
@@ -11569,8 +11589,9 @@ declare module "components/page-builder/page-builder.component" {
|
|
|
11569
11589
|
* @slot config - `<template type="…">` declarations; never displayed. Each template's attributes
|
|
11570
11590
|
* (type, label, icon, icon-library, color, category, description, slots, accepts) declare a
|
|
11571
11591
|
* palette entry and its content declares the inspector form for that type. `slots` makes the
|
|
11572
|
-
* section a container
|
|
11573
|
-
*
|
|
11592
|
+
* section a container that many slots wide — rows are added as they fill — and `slots-min`/
|
|
11593
|
+
* `slots-max` let each placed section choose its own width; `accepts` is a comma-separated
|
|
11594
|
+
* list of the type keys its slots allow.
|
|
11574
11595
|
* @slot header-left - Actions shown on the left of the header bar.
|
|
11575
11596
|
* @slot header-right - Actions shown on the right of the header bar.
|
|
11576
11597
|
*
|
|
@@ -11701,6 +11722,13 @@ declare module "components/page-builder/page-builder.component" {
|
|
|
11701
11722
|
protected willUpdate(changed: PropertyValues): void;
|
|
11702
11723
|
protected firstUpdated(changed: PropertyValues): void;
|
|
11703
11724
|
private _typeFromTemplate;
|
|
11725
|
+
/**
|
|
11726
|
+
* `slots="N"` is a container N slots wide; adding `slots-max` lets each placed
|
|
11727
|
+
* section choose its own width between `slots-min` (1 by default) and that. A
|
|
11728
|
+
* width past the slot cap would leave a container with no usable row, so an
|
|
11729
|
+
* out-of-bounds bound is ignored rather than honoured.
|
|
11730
|
+
*/
|
|
11731
|
+
private _slotsFromAttributes;
|
|
11704
11732
|
private _registerSlottedTemplates;
|
|
11705
11733
|
/** Normalises and installs an externally provided state; resets selection. */
|
|
11706
11734
|
private _applyExternalState;
|
|
@@ -11736,6 +11764,12 @@ declare module "components/page-builder/page-builder.component" {
|
|
|
11736
11764
|
addSection(type: string, index?: number): PageSection | null;
|
|
11737
11765
|
/** Adds a new section of a registered type into a container's slot. Returns null if not allowed. */
|
|
11738
11766
|
addSectionToSlot(type: string, containerId: string, slotIndex: number): PageSection | null;
|
|
11767
|
+
/**
|
|
11768
|
+
* Sets how many slots per row a container whose type allows a choice lays out,
|
|
11769
|
+
* clamped to the declared bounds. Children keep their order and reflow into the
|
|
11770
|
+
* new width, so nothing is lost by narrowing one.
|
|
11771
|
+
*/
|
|
11772
|
+
setSectionColumns(id: string, columns: number): void;
|
|
11739
11773
|
private _removeSection;
|
|
11740
11774
|
private _duplicateSection;
|
|
11741
11775
|
/** Moves a section (top-level or slotted) to a top-level position. */
|