@kubex/zinc 1.1.95 → 1.1.96
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 +193 -428
- package/dist/vscode.html-custom-data.json +1 -1
- package/dist/web-types.json +3 -3
- package/dist/zn.d.ts +113 -224
- package/dist/zn.min.js +331 -377
- package/docs/pages/components/flow-builder.md +17 -1
- package/docs/pages/components/page-builder.md +21 -92
- package/package.json +1 -1
- package/src/components/flow-builder/flow-builder.component.ts +16 -1
- package/src/components/flow-builder/flow-builder.test.ts +206 -1
- package/src/components/flow-builder/flow-geometry.test.ts +102 -0
- package/src/components/flow-builder/flow.types.ts +82 -15
- package/src/components/flow-builder/modules/flow-canvas/flow-canvas.component.ts +163 -108
- package/src/components/flow-builder/modules/flow-step/flow-step.component.ts +2 -0
- package/src/components/page-builder/page-builder.component.ts +229 -429
- package/src/components/page-builder/page-builder.scss +10 -64
- package/src/components/page-builder/page-builder.test.ts +162 -614
- package/src/components/page-builder/page.types.ts +7 -75
- package/src/components/remarkd-editor/remarkd-editor.component.ts +37 -11
- package/src/components/remarkd-editor/remarkd-editor.test.ts +79 -0
- package/src/components/page-builder/page-tree.test.ts +0 -483
- package/src/components/page-builder/page-tree.ts +0 -329
|
@@ -2759,7 +2759,7 @@
|
|
|
2759
2759
|
},
|
|
2760
2760
|
{
|
|
2761
2761
|
"name": "zn-page-builder",
|
|
2762
|
-
"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- **
|
|
2762
|
+
"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 with that many child slots; `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.",
|
|
2763
2763
|
"attributes": [
|
|
2764
2764
|
{
|
|
2765
2765
|
"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.96",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -6507,7 +6507,7 @@
|
|
|
6507
6507
|
},
|
|
6508
6508
|
{
|
|
6509
6509
|
"name": "zn-page-builder",
|
|
6510
|
-
"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- **
|
|
6510
|
+
"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 with that many child slots; `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.",
|
|
6511
6511
|
"doc-url": "",
|
|
6512
6512
|
"attributes": [
|
|
6513
6513
|
{
|
|
@@ -6557,7 +6557,7 @@
|
|
|
6557
6557
|
"slots": [
|
|
6558
6558
|
{
|
|
6559
6559
|
"name": "config",
|
|
6560
|
-
"description": "`<template type=\"…\">` declarations; never displayed. Each template's attributes (type, label, icon, icon-library, color, category, description,
|
|
6560
|
+
"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 with that many child slots; `accepts` is a comma-separated list of the type keys its slots allow."
|
|
6561
6561
|
},
|
|
6562
6562
|
{
|
|
6563
6563
|
"name": "header-left",
|
package/dist/zn.d.ts
CHANGED
|
@@ -9366,6 +9366,7 @@ declare module "components/remarkd-editor/remarkd-editor.component" {
|
|
|
9366
9366
|
private editShell;
|
|
9367
9367
|
private rawMode;
|
|
9368
9368
|
private includeOptions;
|
|
9369
|
+
private includeLoadFailed;
|
|
9369
9370
|
private includePickerIndex;
|
|
9370
9371
|
private includeQuery;
|
|
9371
9372
|
private pendingDragHandle;
|
|
@@ -9480,6 +9481,14 @@ declare module "components/remarkd-editor/remarkd-editor.component" {
|
|
|
9480
9481
|
private handleImagePicked;
|
|
9481
9482
|
private insertImage;
|
|
9482
9483
|
private uploadImage;
|
|
9484
|
+
/**
|
|
9485
|
+
* Resolves an app-relative path the way the console's pagelet handler does:
|
|
9486
|
+
* an app fragment's URLs sit under the app base, and the console puts the app's
|
|
9487
|
+
* `gaid` on the host element. Links rendered here live in the shadow root,
|
|
9488
|
+
* where a click retargets to the host, so that handler never sees them — the
|
|
9489
|
+
* href has to carry the base itself.
|
|
9490
|
+
*/
|
|
9491
|
+
private appPath;
|
|
9483
9492
|
private hasIncludeBlock;
|
|
9484
9493
|
/** Fetches the include list once; every later caller shares the same promise. */
|
|
9485
9494
|
private loadIncludeOptions;
|
|
@@ -9608,6 +9617,14 @@ declare module "components/flow-builder/flow.types" {
|
|
|
9608
9617
|
inputs?: FlowPort[];
|
|
9609
9618
|
/** Output ports. Defaults to a single unlabelled output. e.g. TRUE/FALSE for a split. */
|
|
9610
9619
|
outputs?: FlowPort[];
|
|
9620
|
+
/**
|
|
9621
|
+
* The type's branches are the only ones it has: the canvas offers no delete
|
|
9622
|
+
* on their pills, and clicking a fully-wired node's output adds nothing.
|
|
9623
|
+
* For steps whose branches mirror fixed fields in the consumer's own model
|
|
9624
|
+
* (a success / failure / skip triple, say), where an extra or missing branch
|
|
9625
|
+
* has nowhere to be stored.
|
|
9626
|
+
*/
|
|
9627
|
+
fixedOutputs?: boolean;
|
|
9611
9628
|
/** Initial `data` for a freshly placed node. */
|
|
9612
9629
|
defaultData?: Record<string, unknown>;
|
|
9613
9630
|
/**
|
|
@@ -9694,12 +9711,17 @@ declare module "components/flow-builder/flow.types" {
|
|
|
9694
9711
|
/** Extra pill height per wrapped line (matches the pill's CSS line-height). */
|
|
9695
9712
|
export const PILL_LINE_HEIGHT = 20;
|
|
9696
9713
|
/**
|
|
9697
|
-
* Canvas y of a branch pill's top edge. A pill on a wire to a child
|
|
9698
|
-
* centred along the run from its node's bottom to the child's top —
|
|
9699
|
-
* above and below
|
|
9700
|
-
*
|
|
9701
|
-
*
|
|
9702
|
-
*
|
|
9714
|
+
* Canvas y of a branch pill's top edge. A pill on a wire to a child in the next
|
|
9715
|
+
* row down is centred along the run from its node's bottom to the child's top —
|
|
9716
|
+
* equal wire above and below. A sole output's wire is a straight stem with no
|
|
9717
|
+
* bus to respect, so its pill may rise above the bus line to stay centred; fan
|
|
9718
|
+
* branches stop at the bus.
|
|
9719
|
+
*
|
|
9720
|
+
* A branch reaching past the next row sits right under the bus instead: it
|
|
9721
|
+
* reads as belonging to the node it hangs from rather than to whatever it flies
|
|
9722
|
+
* over, and it leaves the whole gap below free for the wire to route around
|
|
9723
|
+
* what is in the way. Open branches and loop/side wires keep the fixed drop
|
|
9724
|
+
* below the bus, where their "+" has room.
|
|
9703
9725
|
*/
|
|
9704
9726
|
export function branchPillTop(node: Pick<FlowNodeInstance, 'y'>, pillH: number, child?: Pick<FlowNodeInstance, 'y'>, soleOutput?: boolean): number;
|
|
9705
9727
|
/**
|
|
@@ -9726,13 +9748,19 @@ declare module "components/flow-builder/flow.types" {
|
|
|
9726
9748
|
/** A function resolving a node type key to its registered type. */
|
|
9727
9749
|
export type FlowTypeOf = (type: string) => FlowNodeType | undefined;
|
|
9728
9750
|
/**
|
|
9729
|
-
* Canvas x for each of a node's branch drops
|
|
9730
|
-
*
|
|
9731
|
-
*
|
|
9732
|
-
*
|
|
9733
|
-
* straight
|
|
9751
|
+
* Canvas x for each of a node's branch drops. Neighbours are spaced by what
|
|
9752
|
+
* they actually occupy — two child lanes keep the full spread, while a branch
|
|
9753
|
+
* with nothing wired to it needs only its pill — and the run is then shifted so
|
|
9754
|
+
* the *wired* branches stay centred on the node. A step that declares branches
|
|
9755
|
+
* it is not using therefore still runs straight down, instead of fanning empty
|
|
9756
|
+
* lanes across the canvas; and a fully wired fan is spaced exactly as before.
|
|
9757
|
+
*
|
|
9758
|
+
* Pills never shift sideways to chase their child — the wire into a pill is
|
|
9759
|
+
* always a straight vertical, and any lateral offset to the child is taken up
|
|
9760
|
+
* by the elbow below the pill (which still enters the child from straight
|
|
9761
|
+
* above).
|
|
9734
9762
|
*/
|
|
9735
|
-
export function branchDropXs(node: FlowNodeInstance, typeOf: FlowTypeOf): number[];
|
|
9763
|
+
export function branchDropXs(node: FlowNodeInstance, typeOf: FlowTypeOf, connections?: FlowConnection[]): number[];
|
|
9736
9764
|
/**
|
|
9737
9765
|
* The rects a node occupies on the canvas: its card plus each branch-name pill,
|
|
9738
9766
|
* at the exact positions the canvas draws them.
|
|
@@ -10102,20 +10130,40 @@ declare module "components/flow-builder/modules/flow-canvas/flow-canvas.componen
|
|
|
10102
10130
|
*/
|
|
10103
10131
|
private _elbowMidOffsets;
|
|
10104
10132
|
/**
|
|
10105
|
-
* Whether an orthogonal segment passes through any node card (with margin)
|
|
10106
|
-
*
|
|
10107
|
-
*
|
|
10108
|
-
*
|
|
10133
|
+
* Whether an orthogonal segment passes through any node card (with margin).
|
|
10134
|
+
* With `keepApproachClear`, the strip above each card - where incoming arrows
|
|
10135
|
+
* land - counts as occupied too: a foreign wire running just over a card's
|
|
10136
|
+
* input port reads as connecting to it.
|
|
10109
10137
|
*/
|
|
10110
10138
|
private _segmentBlocked;
|
|
10111
10139
|
private _routeClear;
|
|
10112
10140
|
/**
|
|
10113
10141
|
* Orthogonal waypoints from a branch exit to a child's input. The wire always
|
|
10114
10142
|
* enters the input from above (arrow pointing down), and never passes through
|
|
10115
|
-
* a node card
|
|
10116
|
-
*
|
|
10143
|
+
* a node card.
|
|
10144
|
+
*
|
|
10145
|
+
* The search runs twice: first keeping clear of the strip above every card as
|
|
10146
|
+
* well as the cards themselves, then - if the corridor is genuinely too tight
|
|
10147
|
+
* for that - clear of the cards alone. Only when nothing at all fits does the
|
|
10148
|
+
* wire fall back to the direct line, so a wire drawn over a card now means
|
|
10149
|
+
* there was no way around it rather than that the search gave up.
|
|
10117
10150
|
*/
|
|
10118
10151
|
private _routePoints;
|
|
10152
|
+
/**
|
|
10153
|
+
* Candidate routes to a child below, tidiest first: the straight drop or the
|
|
10154
|
+
* single elbow, then the same elbow on neighbouring lines, then out around
|
|
10155
|
+
* whatever sits between the two (the shape a loop-back uses - far more
|
|
10156
|
+
* readable than threading a corridor when a wire skips a row it has nothing
|
|
10157
|
+
* to do with), and finally a side-step that jogs out and back.
|
|
10158
|
+
*/
|
|
10159
|
+
private _forwardRoutes;
|
|
10160
|
+
/**
|
|
10161
|
+
* Routes that leave the exit, run down the outside of everything they span
|
|
10162
|
+
* vertically, and come back in above the input. Loop-backs always travel this
|
|
10163
|
+
* way rather than squeezing through corridors inside the flow; a forward wire
|
|
10164
|
+
* uses it when the corridor between it and its child is occupied.
|
|
10165
|
+
*/
|
|
10166
|
+
private _aroundRoutes;
|
|
10119
10167
|
private static _pathFrom;
|
|
10120
10168
|
/**
|
|
10121
10169
|
* Open output slots ("+" add-points) across all nodes — only rendered while
|
|
@@ -10426,6 +10474,13 @@ declare module "components/flow-builder/flow-builder.component" {
|
|
|
10426
10474
|
private _duplicateNode;
|
|
10427
10475
|
/** Canvas position for a node newly placed off a source node's output. */
|
|
10428
10476
|
private _positionBelowOutput;
|
|
10477
|
+
/**
|
|
10478
|
+
* Whether a node refuses the branch being asked of it: a fixed-output type
|
|
10479
|
+
* has only the branches it declares, so the "new branch" sentinel has nowhere
|
|
10480
|
+
* to go. Checked before the history push, so a refused gesture is a no-op
|
|
10481
|
+
* rather than an empty undo step.
|
|
10482
|
+
*/
|
|
10483
|
+
private _refusesBranch;
|
|
10429
10484
|
/**
|
|
10430
10485
|
* Resolve an output port id on a node: the "new branch" sentinel materialises a
|
|
10431
10486
|
* fresh, labelled output port (per-instance), so it exists before connecting.
|
|
@@ -10587,6 +10642,8 @@ declare module "components/flow-builder/modules/flow-step/flow-step.component" {
|
|
|
10587
10642
|
inputs: string;
|
|
10588
10643
|
/** JSON array of outputs (`"a"` or `{"id","label"}`), e.g. `'[{"id":"true","label":"TRUE"}]'`. Omit for one default output. */
|
|
10589
10644
|
outputs: string;
|
|
10645
|
+
/** The declared outputs are the only branches this step has — none can be deleted or added on the canvas. */
|
|
10646
|
+
fixedOutputs: boolean;
|
|
10590
10647
|
connectedCallback(): void;
|
|
10591
10648
|
disconnectedCallback(): void;
|
|
10592
10649
|
protected updated(changed: PropertyValues): void;
|
|
@@ -10615,23 +10672,9 @@ declare module "components/page-builder/page.types" {
|
|
|
10615
10672
|
label?: string;
|
|
10616
10673
|
/** Section content, keyed by field name (the inspector's `name` attributes). */
|
|
10617
10674
|
data: Record<string, unknown>;
|
|
10618
|
-
/**
|
|
10619
|
-
layout?: PageContainerLayout;
|
|
10620
|
-
/** Container instances only: one ordered stack per cell, row-major. */
|
|
10621
|
-
cells?: PageSection[][];
|
|
10622
|
-
/**
|
|
10623
|
-
* @deprecated The pre-cells fixed-slot shape. Read on load and migrated to
|
|
10624
|
-
* `cells`; never written back.
|
|
10625
|
-
*/
|
|
10675
|
+
/** Slot contents for container sections, sized to the type's `slots`. Empty slots are null. */
|
|
10626
10676
|
children?: (PageSection | null)[];
|
|
10627
10677
|
}
|
|
10628
|
-
/** A container instance's editor-chosen layout. */
|
|
10629
|
-
export interface PageContainerLayout {
|
|
10630
|
-
/** One weight per column; the array length IS the column count. */
|
|
10631
|
-
widths: number[];
|
|
10632
|
-
/** When true the builder offers a trailing empty row instead of a pinned cell count. */
|
|
10633
|
-
grow: boolean;
|
|
10634
|
-
}
|
|
10635
10678
|
/** The complete serialisable state of a page. Order = render order. */
|
|
10636
10679
|
export interface PageState {
|
|
10637
10680
|
sections: PageSection[];
|
|
@@ -10657,48 +10700,16 @@ declare module "components/page-builder/page.types" {
|
|
|
10657
10700
|
configTemplate?: HTMLTemplateElement;
|
|
10658
10701
|
/** Programmatic inspector body — takes precedence over `configTemplate`. */
|
|
10659
10702
|
renderConfig?: (section: PageSection, update: (data: Record<string, unknown>) => void) => TemplateResult;
|
|
10660
|
-
/** Marks this type a container: its card renders a grid of cells on the canvas. */
|
|
10661
|
-
container?: boolean;
|
|
10662
10703
|
/**
|
|
10663
|
-
*
|
|
10664
|
-
*
|
|
10665
|
-
*/
|
|
10666
|
-
defaultWidths?: number[];
|
|
10667
|
-
/** Whether a new instance of this container starts growable. */
|
|
10668
|
-
defaultGrow?: boolean;
|
|
10669
|
-
/**
|
|
10670
|
-
* @deprecated Use `container` with `columns`/`widths`. Read as a container of
|
|
10671
|
-
* `DEFAULT_WIDTHS` columns with the cell count pinned to this number.
|
|
10704
|
+
* Number of child slots this section offers on the canvas (a container tile);
|
|
10705
|
+
* rendered as a 3-column grid. Containers cannot be placed inside other containers.
|
|
10672
10706
|
*/
|
|
10673
10707
|
slots?: number;
|
|
10674
|
-
/**
|
|
10675
|
-
* Section type keys allowed in this container's cells. On a `container` type,
|
|
10676
|
-
* omitting it allows any type, subject to the nesting cap — that is how nesting
|
|
10677
|
-
* is reachable without enumerating types. The deprecated `slots=` alias keeps the
|
|
10678
|
-
* old rule instead: omitting it there allows any non-container type.
|
|
10679
|
-
*/
|
|
10708
|
+
/** Section type keys allowed in this container's slots. Omit to allow any non-container type. */
|
|
10680
10709
|
accepts?: string[];
|
|
10681
10710
|
}
|
|
10682
|
-
/**
|
|
10683
|
-
export
|
|
10684
|
-
/** A single weight beyond 12 makes the other columns unusably thin. */
|
|
10685
|
-
export const MAX_WIDTH = 12;
|
|
10686
|
-
/** Container nesting levels: a top-level container is 1, one inside a cell is 2. */
|
|
10687
|
-
export const MAX_CONTAINER_LEVELS = 2;
|
|
10688
|
-
/** Global section budget; also the sanity clamp on an incoming `cells` length. */
|
|
10689
|
-
export const MAX_SECTIONS = 500;
|
|
10690
|
-
/** What a bare `container` declaration seeds. */
|
|
10691
|
-
export const DEFAULT_WIDTHS: readonly number[];
|
|
10692
|
-
/** Container-ness is a property of the registered type, never of the instance. */
|
|
10693
|
-
export function isContainer(type: PageSectionType | undefined): boolean;
|
|
10694
|
-
/**
|
|
10695
|
-
* Coerces a weights list into a usable one: each entry a whole number from 1 to
|
|
10696
|
-
* MAX_WIDTH (anything unusable becomes 1), at most MAX_COLUMNS entries, falling
|
|
10697
|
-
* back to DEFAULT_WIDTHS only when nothing usable remains.
|
|
10698
|
-
*/
|
|
10699
|
-
export function sanitiseWidths(raw: unknown): number[];
|
|
10700
|
-
/** The layout a newly placed instance of a container type starts with. */
|
|
10701
|
-
export function defaultLayout(type: PageSectionType | undefined): PageContainerLayout;
|
|
10711
|
+
/** A container section's slot contents, padded/truncated to the type's slot count. */
|
|
10712
|
+
export function sectionChildren(section: PageSection, type: PageSectionType): (PageSection | null)[];
|
|
10702
10713
|
/** Drag-and-drop MIME carrying a section type id from the palette to the canvas. */
|
|
10703
10714
|
export const PAGE_TYPE_MIME = "application/x-zn-page-type";
|
|
10704
10715
|
/** Drag-and-drop MIME carrying a placed section's id when reordering. */
|
|
@@ -10713,82 +10724,6 @@ declare module "components/page-builder/page.types" {
|
|
|
10713
10724
|
*/
|
|
10714
10725
|
export function sectionSummary(section: PageSection, type?: PageSectionType): string;
|
|
10715
10726
|
}
|
|
10716
|
-
declare module "components/page-builder/page-tree" {
|
|
10717
|
-
import { type PageSection, type PageSectionType } from "components/page-builder/page.types";
|
|
10718
|
-
/** Drops trailing cells that hold nothing. Interior empties are meaningful and kept. */
|
|
10719
|
-
export function trimTrailingEmptyCells(cells: PageSection[][]): PageSection[][];
|
|
10720
|
-
/** Pads to a whole number of rows, always leaving at least one row to drop into. */
|
|
10721
|
-
export function padCells(cells: PageSection[][], columns: number): PageSection[][];
|
|
10722
|
-
/**
|
|
10723
|
-
* The canonical cell list for a container. A growable container never keeps a
|
|
10724
|
-
* trailing all-empty row (the renderer supplies the `+` row itself, so keeping
|
|
10725
|
-
* one would show two); a fixed container's trailing empty row is its layout and
|
|
10726
|
-
* survives untouched.
|
|
10727
|
-
*/
|
|
10728
|
-
export function normaliseCells(cells: PageSection[][], columns: number, grow: boolean): PageSection[][];
|
|
10729
|
-
/**
|
|
10730
|
-
* Re-chunks the same ordered list of stacks into a different column count. Only
|
|
10731
|
-
* trailing empties are dropped, so no section can be lost by a column change.
|
|
10732
|
-
*/
|
|
10733
|
-
export function recolumnCells(cells: PageSection[][], columns: number): PageSection[][];
|
|
10734
|
-
/** Row-major view of the flat cell list, for rendering. */
|
|
10735
|
-
export function cellRows(cells: PageSection[][], columns: number): PageSection[][][];
|
|
10736
|
-
export function containerWidths(section: PageSection, type?: PageSectionType): number[];
|
|
10737
|
-
export function containerColumns(section: PageSection, type?: PageSectionType): number;
|
|
10738
|
-
export function containerGrow(section: PageSection, type?: PageSectionType): boolean;
|
|
10739
|
-
/** A container's cells, normalised. Empty for a non-container. */
|
|
10740
|
-
export function containerCells(section: PageSection, type?: PageSectionType): PageSection[][];
|
|
10741
|
-
/** Depth-first search across top-level sections and every cell stack. */
|
|
10742
|
-
export function findSection(sections: PageSection[], id: string | null): PageSection | undefined;
|
|
10743
|
-
/** New section array with `id` replaced by `patch(section)`, wherever it lives. */
|
|
10744
|
-
export function patchSection(sections: PageSection[], id: string, patch: (section: PageSection) => PageSection): PageSection[];
|
|
10745
|
-
/** Detaches a section from wherever it lives, returning it and the remaining tree. */
|
|
10746
|
-
export function extractSection(sections: PageSection[], id: string): [PageSection | undefined, PageSection[]];
|
|
10747
|
-
/** Inserts a section into a container's cell at a stack position. */
|
|
10748
|
-
export function insertIntoCell(sections: PageSection[], containerId: string, cellIndex: number, insertIndex: number, section: PageSection, columns: number): PageSection[];
|
|
10749
|
-
/**
|
|
10750
|
-
* Nesting level of the container with this id: 1 at the top level, 2 inside a
|
|
10751
|
-
* cell, 0 when not found. Only containers have cells, so every cell level is a
|
|
10752
|
-
* container level.
|
|
10753
|
-
*/
|
|
10754
|
-
export function containerDepth(sections: PageSection[], containerId: string, depth?: number): number;
|
|
10755
|
-
/** Deep copy with a fresh id for the section and every descendant. */
|
|
10756
|
-
export function cloneWithNewIds(section: PageSection): PageSection;
|
|
10757
|
-
/** Resolves a type key to its registered type — the registry's `get`. */
|
|
10758
|
-
export type TypeLookup = (type: string) => PageSectionType | undefined;
|
|
10759
|
-
/**
|
|
10760
|
-
* Height of a container's subtree: 1 for a container with no nested containers,
|
|
10761
|
-
* otherwise 1 + the tallest nested container's height. 0 for a non-container, so
|
|
10762
|
-
* it composes with containerDepth to bound how deep a moved subtree would reach:
|
|
10763
|
-
* dropping a section into a container at depth d puts the section's own deepest
|
|
10764
|
-
* descendant at d + containerHeight(section).
|
|
10765
|
-
*/
|
|
10766
|
-
export function containerHeight(section: PageSection): number;
|
|
10767
|
-
/**
|
|
10768
|
-
* Re-applies each container's own grow/columns normalisation throughout the
|
|
10769
|
-
* tree, so a growable container never carries a trailing all-empty row once
|
|
10770
|
-
* committed — not only when read out via containerCells. A section whose
|
|
10771
|
-
* current type isn't a registered container is left untouched, preserving its
|
|
10772
|
-
* cells verbatim per the unknown-type contract.
|
|
10773
|
-
*/
|
|
10774
|
-
export function normaliseGrowth(sections: PageSection[], lookup: TypeLookup): PageSection[];
|
|
10775
|
-
/**
|
|
10776
|
-
* Rewrites the pre-cells `children` shape as `cells`. The old grid was always
|
|
10777
|
-
* DEFAULT_WIDTHS wide, and the slot count was the layout, so cells are padded
|
|
10778
|
-
* out to the declared slot count, then rounded up to a whole number of
|
|
10779
|
-
* DEFAULT_WIDTHS-wide rows; never trimmed.
|
|
10780
|
-
*/
|
|
10781
|
-
export function migrateSection(section: PageSection, type?: PageSectionType): PageSection;
|
|
10782
|
-
/**
|
|
10783
|
-
* Normalises externally supplied sections: migrates the old shape, gives every
|
|
10784
|
-
* section a unique id, drops malformed entries, sanitises layouts, caps nesting
|
|
10785
|
-
* and clamps sizes. Pure — warnings are returned for the caller to log.
|
|
10786
|
-
*/
|
|
10787
|
-
export function normaliseSections(sections: unknown, lookup: TypeLookup): {
|
|
10788
|
-
sections: PageSection[];
|
|
10789
|
-
warnings: string[];
|
|
10790
|
-
};
|
|
10791
|
-
}
|
|
10792
10727
|
declare module "components/page-builder/page-registry" {
|
|
10793
10728
|
import type { PageSectionType } from "components/page-builder/page.types";
|
|
10794
10729
|
/**
|
|
@@ -10907,7 +10842,7 @@ declare module "components/page-builder/modules/page-section-card/index" {
|
|
|
10907
10842
|
}
|
|
10908
10843
|
}
|
|
10909
10844
|
declare module "components/page-builder/page-builder.component" {
|
|
10910
|
-
import { type CSSResultGroup, type PropertyValues
|
|
10845
|
+
import { type CSSResultGroup, type PropertyValues } from 'lit';
|
|
10911
10846
|
import { type PageSection, type PageSectionType, type PageState } from "components/page-builder/page.types";
|
|
10912
10847
|
import ZincElement from "internal/zinc-element";
|
|
10913
10848
|
import ZnCollapsible from "components/collapsible/index";
|
|
@@ -10915,7 +10850,6 @@ declare module "components/page-builder/page-builder.component" {
|
|
|
10915
10850
|
import ZnInput from "components/input/index";
|
|
10916
10851
|
import ZnPagePaletteItem from "components/page-builder/modules/page-palette-item/index";
|
|
10917
10852
|
import ZnPageSectionCard from "components/page-builder/modules/page-section-card/index";
|
|
10918
|
-
import ZnToggle from "components/toggle/index";
|
|
10919
10853
|
/**
|
|
10920
10854
|
* @summary A config-driven page composer: a palette of predefined section types, a linear
|
|
10921
10855
|
* canvas of section cards, and an inspector for editing each section's content.
|
|
@@ -10933,14 +10867,10 @@ declare module "components/page-builder/page-builder.component" {
|
|
|
10933
10867
|
* @event zn-page-selection-change - Emitted when the selected section changes. `event.detail.sectionId`.
|
|
10934
10868
|
*
|
|
10935
10869
|
* @slot config - `<template type="…">` declarations; never displayed. Each template's attributes
|
|
10936
|
-
* (type, label, icon, icon-library, color, category, description,
|
|
10937
|
-
*
|
|
10938
|
-
*
|
|
10939
|
-
*
|
|
10940
|
-
* a growable instance. `accepts` is a comma-separated list of the type keys its cells allow —
|
|
10941
|
-
* omitted on a `container` type, any type is allowed subject to the nesting cap. `slots` is
|
|
10942
|
-
* @deprecated: it declares a fixed-slot container of `DEFAULT_WIDTHS` columns pinned to that many
|
|
10943
|
-
* cells, and keeps the old any-non-container-type rule when `accepts` is omitted.
|
|
10870
|
+
* (type, label, icon, icon-library, color, category, description, slots, accepts) declare a
|
|
10871
|
+
* palette entry and its content declares the inspector form for that type. `slots` makes the
|
|
10872
|
+
* section a container with that many child slots; `accepts` is a comma-separated list of the
|
|
10873
|
+
* type keys its slots allow.
|
|
10944
10874
|
* @slot header-left - Actions shown on the left of the header bar.
|
|
10945
10875
|
* @slot header-right - Actions shown on the right of the header bar.
|
|
10946
10876
|
*
|
|
@@ -10960,7 +10890,6 @@ declare module "components/page-builder/page-builder.component" {
|
|
|
10960
10890
|
'zn-input': typeof ZnInput;
|
|
10961
10891
|
'zn-page-palette-item': typeof ZnPagePaletteItem;
|
|
10962
10892
|
'zn-page-section-card': typeof ZnPageSectionCard;
|
|
10963
|
-
'zn-toggle': typeof ZnToggle;
|
|
10964
10893
|
};
|
|
10965
10894
|
private readonly formControlController;
|
|
10966
10895
|
/** The name of the control, submitted as a name/value pair with form data. */
|
|
@@ -10997,10 +10926,10 @@ declare module "components/page-builder/page-builder.component" {
|
|
|
10997
10926
|
/** Index of the drop zone whose "+" type picker is open, if any. */
|
|
10998
10927
|
private _pickerIndex;
|
|
10999
10928
|
private _dragOverIndex;
|
|
11000
|
-
/** The
|
|
11001
|
-
private
|
|
11002
|
-
/** The
|
|
11003
|
-
private
|
|
10929
|
+
/** The container slot a drag is currently over, if any. */
|
|
10930
|
+
private _slotDragOver;
|
|
10931
|
+
/** The container slot whose "+" type picker is open, if any. */
|
|
10932
|
+
private _slotPicker;
|
|
11004
10933
|
/** The stamped config form for the selected section; rebuilt on selection change. */
|
|
11005
10934
|
private _form;
|
|
11006
10935
|
private readonly _hasSlot;
|
|
@@ -11090,67 +11019,42 @@ declare module "components/page-builder/page-builder.component" {
|
|
|
11090
11019
|
* argument unchanged when there is nothing to do, so callers can compare by identity.
|
|
11091
11020
|
*/
|
|
11092
11021
|
private _requireFirst;
|
|
11093
|
-
/**
|
|
11094
|
-
|
|
11095
|
-
|
|
11096
|
-
|
|
11097
|
-
|
|
11098
|
-
|
|
11099
|
-
|
|
11022
|
+
/** Finds a section by id, searching top-level sections and slotted children. */
|
|
11023
|
+
private _findSection;
|
|
11024
|
+
/** New sections array with the section patched wherever it lives (top level or slot). */
|
|
11025
|
+
private _patchSection;
|
|
11026
|
+
/** Detaches a section wherever it lives: removed from the top level, or its slot nulled. */
|
|
11027
|
+
private _extract;
|
|
11028
|
+
/** Installs a new state from a user edit and notifies listeners. */
|
|
11100
11029
|
private _commit;
|
|
11101
11030
|
private _selectedSection;
|
|
11102
11031
|
private _select;
|
|
11103
11032
|
private _pushHistory;
|
|
11104
11033
|
undo: () => void;
|
|
11105
11034
|
redo: () => void;
|
|
11106
|
-
/** A fresh section of a registered type, seeded with layout/cells when it's a container. */
|
|
11107
|
-
private _newSection;
|
|
11108
11035
|
/** Adds a section of a registered type at `index` (default: end). Returns null for unknown types. */
|
|
11109
11036
|
addSection(type: string, index?: number): PageSection | null;
|
|
11037
|
+
/** Adds a new section of a registered type into a container's slot. Returns null if not allowed. */
|
|
11038
|
+
addSectionToSlot(type: string, containerId: string, slotIndex: number): PageSection | null;
|
|
11110
11039
|
private _removeSection;
|
|
11111
11040
|
private _duplicateSection;
|
|
11112
|
-
/**
|
|
11113
|
-
private _findCellOwner;
|
|
11114
|
-
/** Moves a section (top-level or inside a cell) to a top-level position. */
|
|
11041
|
+
/** Moves a section (top-level or slotted) to a top-level position. */
|
|
11115
11042
|
private _moveSection;
|
|
11116
|
-
/**
|
|
11117
|
-
|
|
11043
|
+
/**
|
|
11044
|
+
* Moves a section into a container's slot. Dropping onto an occupied slot swaps
|
|
11045
|
+
* the two children (slot-to-slot reordering); top-level sections and containers
|
|
11046
|
+
* only enter empty slots / never enter slots respectively.
|
|
11047
|
+
*/
|
|
11048
|
+
private _moveToSlot;
|
|
11118
11049
|
private _onCardDragStart;
|
|
11119
11050
|
/** Whether a drag carries one of the builder's own payloads. */
|
|
11120
11051
|
private _isPageDrag;
|
|
11052
|
+
private _onSlotDragOver;
|
|
11053
|
+
private _onSlotDrop;
|
|
11121
11054
|
private _onZoneDragOver;
|
|
11122
11055
|
private _onZoneDrop;
|
|
11123
11056
|
private _onCanvasDragOver;
|
|
11124
11057
|
private _onCanvasDrop;
|
|
11125
|
-
/**
|
|
11126
|
-
* Whether `typeKey`'s registered type is allowed into this container by its
|
|
11127
|
-
* `accepts`/`slots=` rule — the nesting depth cap is a separate concern,
|
|
11128
|
-
* checked by each caller against its own notion of how tall the dropped
|
|
11129
|
-
* subtree is.
|
|
11130
|
-
*/
|
|
11131
|
-
private _acceptsType;
|
|
11132
|
-
/**
|
|
11133
|
-
* Whether `typeKey` may be dropped into this container's cells from the
|
|
11134
|
-
* palette. A newly created section always has height 1, so the depth cap
|
|
11135
|
-
* only needs the target's own depth.
|
|
11136
|
-
*/
|
|
11137
|
-
private _acceptsInCell;
|
|
11138
|
-
/**
|
|
11139
|
-
* Whether a dragged, already-placed section may land in this container's
|
|
11140
|
-
* cells. Unlike a palette drop, the moved subtree can already be several
|
|
11141
|
-
* containers tall (it may itself hold a nested container), so the cap has to
|
|
11142
|
-
* account for that height, not just the target's depth: dropping `moved` at
|
|
11143
|
-
* a new depth of `containerDepth(container) + 1` puts its own deepest
|
|
11144
|
-
* descendant at `containerDepth(container) + containerHeight(moved)`.
|
|
11145
|
-
*/
|
|
11146
|
-
private _canMoveIntoCell;
|
|
11147
|
-
private _onCellDragOver;
|
|
11148
|
-
private _onCellDrop;
|
|
11149
|
-
/** Adds a new section of a registered type into a container cell. */
|
|
11150
|
-
addSectionToCell(type: string, containerId: string, cellIndex: number, insertIndex?: number): PageSection | null;
|
|
11151
|
-
private _moveToCell;
|
|
11152
|
-
/** Types offerable in a container's cells. */
|
|
11153
|
-
private _cellTypes;
|
|
11154
11058
|
private _onCardKeydown;
|
|
11155
11059
|
private _renderPalette;
|
|
11156
11060
|
private _renderPaletteItem;
|
|
@@ -11160,17 +11064,10 @@ declare module "components/page-builder/page-builder.component" {
|
|
|
11160
11064
|
/** The one card template both the page list and slot cells render. */
|
|
11161
11065
|
private _renderSectionCard;
|
|
11162
11066
|
private _renderCard;
|
|
11163
|
-
|
|
11164
|
-
|
|
11165
|
-
|
|
11166
|
-
|
|
11167
|
-
private _renderNode;
|
|
11168
|
-
/** A container's cell grid: one track per width, one stack per cell. */
|
|
11169
|
-
private _renderCells;
|
|
11170
|
-
private _renderCell;
|
|
11171
|
-
/** Thin insertion target between two cards in a stack. */
|
|
11172
|
-
private _renderCellStrip;
|
|
11173
|
-
/** The one type-picker template both drop zones and container cells render. */
|
|
11067
|
+
private _renderSlot;
|
|
11068
|
+
/** Types allowed in a container's slots: non-containers, filtered by its accepts list. */
|
|
11069
|
+
private _slotTypes;
|
|
11070
|
+
/** The one type-picker template both drop zones and slot cells render. */
|
|
11174
11071
|
private _renderTypePicker;
|
|
11175
11072
|
private _renderDropZone;
|
|
11176
11073
|
/**
|
|
@@ -11184,16 +11081,8 @@ declare module "components/page-builder/page-builder.component" {
|
|
|
11184
11081
|
private _onInspectorInput;
|
|
11185
11082
|
private _updateSectionData;
|
|
11186
11083
|
private _renameSection;
|
|
11187
|
-
/** Replaces a container's layout, keeping cells consistent with it. */
|
|
11188
|
-
private _setLayout;
|
|
11189
|
-
private _setColumns;
|
|
11190
|
-
private _setWidth;
|
|
11191
|
-
private _setGrow;
|
|
11192
|
-
/** Pads with empty rows, or trims trailing empty rows down to the last occupied one. */
|
|
11193
|
-
private _setRows;
|
|
11194
|
-
private _renderLayoutGroup;
|
|
11195
11084
|
private _renderInspector;
|
|
11196
|
-
render(): TemplateResult<1>;
|
|
11085
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
11197
11086
|
}
|
|
11198
11087
|
}
|
|
11199
11088
|
declare module "components/page-builder/index" {
|