@kubex/zinc 1.1.62 → 1.1.64
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 +3141 -1885
- package/dist/vscode.html-custom-data.json +102 -3
- package/dist/web-types.json +224 -6
- package/dist/zn.d.ts +235 -0
- package/dist/zn.min.js +795 -679
- 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/remarkd-editor.md +103 -0
- package/docs/pages/components/toggle.md +2 -2
- package/package.json +3 -2
- package/src/components/file/file.component.ts +16 -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/query-builder/query-builder.component.ts +14 -6
- package/src/components/remarkd-editor/index.ts +12 -0
- package/src/components/remarkd-editor/remarkd-editor.component.ts +752 -0
- package/src/components/remarkd-editor/remarkd-editor.scss +241 -0
- package/src/components/remarkd-editor/remarkd-editor.test.ts +147 -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/tabs/tabs.component.ts +9 -4
- package/src/components/tabs/tabs.test.ts +42 -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 +2 -0
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;
|
|
@@ -3119,6 +3120,7 @@ declare module "components/query-builder/query-builder.component" {
|
|
|
3119
3120
|
name: string;
|
|
3120
3121
|
value: PropertyKey;
|
|
3121
3122
|
showValues: string[];
|
|
3123
|
+
private get _usedFilterIds();
|
|
3122
3124
|
get validationMessage(): string;
|
|
3123
3125
|
get validity(): ValidityState;
|
|
3124
3126
|
protected firstUpdated(_changedProperties: PropertyValues): void;
|
|
@@ -6572,6 +6574,7 @@ declare module "components/form-group/form-group.component" {
|
|
|
6572
6574
|
* @since 1.0
|
|
6573
6575
|
*
|
|
6574
6576
|
* @slot - The default slot.
|
|
6577
|
+
* @slot chip - A chip displayed under the form group's help text.
|
|
6575
6578
|
*
|
|
6576
6579
|
*/
|
|
6577
6580
|
export default class ZnFormGroup extends ZincElement {
|
|
@@ -6591,6 +6594,7 @@ declare module "components/form-group/form-group.component" {
|
|
|
6591
6594
|
helpText: string;
|
|
6592
6595
|
forceCols: boolean;
|
|
6593
6596
|
layout: string;
|
|
6597
|
+
pad: boolean;
|
|
6594
6598
|
render(): import("lit-html").TemplateResult<1>;
|
|
6595
6599
|
}
|
|
6596
6600
|
}
|
|
@@ -7054,6 +7058,8 @@ declare module "components/file/file.component" {
|
|
|
7054
7058
|
'zn-dialog': typeof ZnDialog;
|
|
7055
7059
|
};
|
|
7056
7060
|
private readonly formControlController;
|
|
7061
|
+
/** Set when the user clears the control; reset when a file is chosen. */
|
|
7062
|
+
private clearedByUser;
|
|
7057
7063
|
private readonly hasSlotController;
|
|
7058
7064
|
private readonly localize;
|
|
7059
7065
|
private userIsDragging;
|
|
@@ -8692,6 +8698,154 @@ declare module "components/markdown-editor/index" {
|
|
|
8692
8698
|
}
|
|
8693
8699
|
}
|
|
8694
8700
|
}
|
|
8701
|
+
declare module "components/remarkd-editor/remarkd-editor.component" {
|
|
8702
|
+
import { type CSSResultGroup, type PropertyValues } from 'lit';
|
|
8703
|
+
import ZincElement from "internal/zinc-element";
|
|
8704
|
+
import type { ZincFormControl } from "internal/zinc-element";
|
|
8705
|
+
/**
|
|
8706
|
+
* @summary A Notion-style block editor for remarkd content. Blocks render inline; click one to edit its source.
|
|
8707
|
+
* @documentation https://zinc.style/components/remarkd-editor
|
|
8708
|
+
* @status experimental
|
|
8709
|
+
* @since 1.0
|
|
8710
|
+
*
|
|
8711
|
+
* @dependency zn-button
|
|
8712
|
+
* @dependency zn-button-group
|
|
8713
|
+
* @dependency zn-icon
|
|
8714
|
+
* @dependency zn-dialog
|
|
8715
|
+
* @dependency zn-file
|
|
8716
|
+
* @dependency zn-input
|
|
8717
|
+
*
|
|
8718
|
+
* @event zn-input - Emitted on each keystroke while editing a block.
|
|
8719
|
+
* @event zn-change - Emitted when a block edit is committed and the value changes.
|
|
8720
|
+
*
|
|
8721
|
+
* @csspart base - The component's base wrapper.
|
|
8722
|
+
* @csspart toolbar - The always-visible block-insert toolbar.
|
|
8723
|
+
* @csspart block - A rendered block wrapper.
|
|
8724
|
+
* @csspart rendered - The rendered remarkd output of a block.
|
|
8725
|
+
* @csspart input - The textarea shown while editing a block.
|
|
8726
|
+
* @csspart slash-menu - The context menu opened by typing "/" in a block.
|
|
8727
|
+
*/
|
|
8728
|
+
export default class ZnRemarkdEditor extends ZincElement implements ZincFormControl {
|
|
8729
|
+
static styles: CSSResultGroup;
|
|
8730
|
+
private readonly formControlController;
|
|
8731
|
+
private editingDraft;
|
|
8732
|
+
private suppressValueSync;
|
|
8733
|
+
private suppressBlurCommit;
|
|
8734
|
+
private validationInput;
|
|
8735
|
+
private blocks;
|
|
8736
|
+
private editingIndex;
|
|
8737
|
+
private slashMenuOpen;
|
|
8738
|
+
private slashQuery;
|
|
8739
|
+
private slashActiveIndex;
|
|
8740
|
+
private imageDialogOpen;
|
|
8741
|
+
private dropIndicator;
|
|
8742
|
+
private dragIndex;
|
|
8743
|
+
private editShell;
|
|
8744
|
+
private imageInsertIndex;
|
|
8745
|
+
private pendingDragHandle;
|
|
8746
|
+
private dragStartX;
|
|
8747
|
+
private dragStartY;
|
|
8748
|
+
private dragGhost;
|
|
8749
|
+
/** The name of the control, submitted as part of form data. */
|
|
8750
|
+
name: string;
|
|
8751
|
+
/** The current remarkd source. */
|
|
8752
|
+
value: string;
|
|
8753
|
+
/** The default value — used when resetting the form. */
|
|
8754
|
+
defaultValue: string;
|
|
8755
|
+
/** Placeholder shown when the document is empty. */
|
|
8756
|
+
placeholder: string;
|
|
8757
|
+
/**
|
|
8758
|
+
* Endpoint for image uploads. Posting the file metadata here must return
|
|
8759
|
+
* `{uploadPath, uploadUrl}`; the file is then PUT to `uploadUrl` and
|
|
8760
|
+
* `uploadPath` is inserted into the document. When unset, adding an image
|
|
8761
|
+
* prompts for a URL instead.
|
|
8762
|
+
*/
|
|
8763
|
+
attachmentUrl: string;
|
|
8764
|
+
/** Makes the editor required for form submission. */
|
|
8765
|
+
required: boolean;
|
|
8766
|
+
/** Makes the editor read-only. */
|
|
8767
|
+
readonly: boolean;
|
|
8768
|
+
/** Disables the editor. */
|
|
8769
|
+
disabled: boolean;
|
|
8770
|
+
get validity(): ValidityState;
|
|
8771
|
+
get validationMessage(): string;
|
|
8772
|
+
checkValidity(): boolean;
|
|
8773
|
+
getForm(): HTMLFormElement | null;
|
|
8774
|
+
reportValidity(): boolean;
|
|
8775
|
+
setCustomValidity(message: string): void;
|
|
8776
|
+
/** Starts editing the first block, or a new block if the document is empty. */
|
|
8777
|
+
focus(): void;
|
|
8778
|
+
/** Commits any in-progress block edit. */
|
|
8779
|
+
blur(): void;
|
|
8780
|
+
protected firstUpdated(_changedProperties: PropertyValues): void;
|
|
8781
|
+
disconnectedCallback(): void;
|
|
8782
|
+
handleValueChange(): void;
|
|
8783
|
+
/**
|
|
8784
|
+
* Splits remarkd source into blocks on blank lines, keeping fenced /
|
|
8785
|
+
* delimited containers (``` ==== !!!! .... ----) as single blocks.
|
|
8786
|
+
*/
|
|
8787
|
+
private splitBlocks;
|
|
8788
|
+
private fenceMarker;
|
|
8789
|
+
private closesFence;
|
|
8790
|
+
private updateBlocks;
|
|
8791
|
+
private handleRenderedClick;
|
|
8792
|
+
private toggleCheckbox;
|
|
8793
|
+
private startEdit;
|
|
8794
|
+
/**
|
|
8795
|
+
* The remarkd chrome the editing block should keep, derived from its first
|
|
8796
|
+
* line — so a NOTE still looks like a note while its source is edited.
|
|
8797
|
+
*/
|
|
8798
|
+
private computeEditShell;
|
|
8799
|
+
private focusInput;
|
|
8800
|
+
private addBlockAt;
|
|
8801
|
+
/** Inserts a draft block — committed (or dropped, if left empty) on blur. */
|
|
8802
|
+
private insertDraftBlock;
|
|
8803
|
+
/**
|
|
8804
|
+
* Blur handler for the editing textarea. Re-renders that replace the
|
|
8805
|
+
* focused textarea (e.g. Shift+Enter committing and opening the next
|
|
8806
|
+
* block) fire blur mid-transition — `suppressBlurCommit` masks those.
|
|
8807
|
+
*/
|
|
8808
|
+
private handleEditBlur;
|
|
8809
|
+
/** Commits the in-progress edit; returns the index after the committed parts. */
|
|
8810
|
+
private commitEdit;
|
|
8811
|
+
private get filteredSlashItems();
|
|
8812
|
+
private handleDraftInput;
|
|
8813
|
+
private handleEditKeydown;
|
|
8814
|
+
private applySlashItem;
|
|
8815
|
+
private handleEditPaste;
|
|
8816
|
+
private handleDragOver;
|
|
8817
|
+
private handleDrop;
|
|
8818
|
+
/** The insertion index a drop at `y` maps to, from the rendered block positions. */
|
|
8819
|
+
private insertionIndexFromY;
|
|
8820
|
+
private handleHandlePointerDown;
|
|
8821
|
+
private handleDragPointerMove;
|
|
8822
|
+
private handleDragPointerUp;
|
|
8823
|
+
private cancelDrag;
|
|
8824
|
+
private createDragGhost;
|
|
8825
|
+
private moveDragGhost;
|
|
8826
|
+
private pickImage;
|
|
8827
|
+
private handleImageDialogClose;
|
|
8828
|
+
private handleImageInsert;
|
|
8829
|
+
private insertImage;
|
|
8830
|
+
private uploadImage;
|
|
8831
|
+
private autosize;
|
|
8832
|
+
private handleToolbarInsert;
|
|
8833
|
+
private renderSlashMenu;
|
|
8834
|
+
private renderBlock;
|
|
8835
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
8836
|
+
private renderImageDialog;
|
|
8837
|
+
}
|
|
8838
|
+
}
|
|
8839
|
+
declare module "components/remarkd-editor/index" {
|
|
8840
|
+
import ZnRemarkdEditor from "components/remarkd-editor/remarkd-editor.component";
|
|
8841
|
+
export * from "components/remarkd-editor/remarkd-editor.component";
|
|
8842
|
+
export default ZnRemarkdEditor;
|
|
8843
|
+
global {
|
|
8844
|
+
interface HTMLElementTagNameMap {
|
|
8845
|
+
'zn-remarkd-editor': ZnRemarkdEditor;
|
|
8846
|
+
}
|
|
8847
|
+
}
|
|
8848
|
+
}
|
|
8695
8849
|
declare module "components/flow-builder/flow.types" {
|
|
8696
8850
|
import type { TemplateResult } from 'lit';
|
|
8697
8851
|
/** Which steps-panel tab a node type appears under. */
|
|
@@ -10157,6 +10311,84 @@ declare module "components/page-builder/index" {
|
|
|
10157
10311
|
}
|
|
10158
10312
|
}
|
|
10159
10313
|
}
|
|
10314
|
+
declare module "components/preview-frame/preview-frame.component" {
|
|
10315
|
+
import { type CSSResultGroup } from 'lit';
|
|
10316
|
+
import ZincElement from "internal/zinc-element";
|
|
10317
|
+
/**
|
|
10318
|
+
* @summary Embeds a live preview iframe and drives the hp-preview postMessage
|
|
10319
|
+
* protocol: answers the frame's ready handshake with a config payload fetched
|
|
10320
|
+
* from data-uri, auto-saves watched forms on change, and refreshes the
|
|
10321
|
+
* preview after each save.
|
|
10322
|
+
* @documentation https://zinc.style/components/preview-frame
|
|
10323
|
+
* @status experimental
|
|
10324
|
+
* @since 1.0
|
|
10325
|
+
*
|
|
10326
|
+
* @event zn-error - Emitted when the preview reports a render error or a save fails.
|
|
10327
|
+
*
|
|
10328
|
+
* @csspart base - The component's base wrapper.
|
|
10329
|
+
* @csspart iframe - The preview iframe.
|
|
10330
|
+
* @csspart error - The error overlay.
|
|
10331
|
+
*/
|
|
10332
|
+
export default class ZnPreviewFrame extends ZincElement {
|
|
10333
|
+
static styles: CSSResultGroup;
|
|
10334
|
+
/** URL of the preview shell page (tokened embed URL). */
|
|
10335
|
+
src: string;
|
|
10336
|
+
/** Expected origin of the iframe; all postMessage traffic is checked against it. */
|
|
10337
|
+
frameOrigin: string;
|
|
10338
|
+
/** Endpoint returning the hp-preview:config payload JSON. The console proxy rewrites this attribute to an app-prefixed path for proper fetch resolution. */
|
|
10339
|
+
dataUri: string;
|
|
10340
|
+
/**
|
|
10341
|
+
* Selector (resolved against the component's root node) for the forms to watch.
|
|
10342
|
+
* Defaults to only forms explicitly opted in via a `data-auto-save` attribute —
|
|
10343
|
+
* unmarked forms keep normal submit behavior and are never intercepted,
|
|
10344
|
+
* auto-saved, or used to trigger a preview refresh. Override to widen the scope.
|
|
10345
|
+
*/
|
|
10346
|
+
watch: string;
|
|
10347
|
+
/** Debounce in ms between a form change and its auto-save. */
|
|
10348
|
+
debounce: number;
|
|
10349
|
+
/**
|
|
10350
|
+
* Zooms the previewed page out (0–1]. The frame always fills the panel;
|
|
10351
|
+
* zoom shrinks the content browser-style, so 0.4 shows the page at 40%
|
|
10352
|
+
* size with correspondingly more of it visible. 1 = natural size.
|
|
10353
|
+
*/
|
|
10354
|
+
zoom: number;
|
|
10355
|
+
/**
|
|
10356
|
+
* The visible height (in CSS pixels) of the preview panel. Fixed rather
|
|
10357
|
+
* than measured, because a measured height would feed back into the
|
|
10358
|
+
* scaled iframe's layout box and grow unbounded.
|
|
10359
|
+
*/
|
|
10360
|
+
minHeight: number;
|
|
10361
|
+
frame: HTMLIFrameElement;
|
|
10362
|
+
private error;
|
|
10363
|
+
private _generation;
|
|
10364
|
+
private readonly _watchedForms;
|
|
10365
|
+
private readonly _debounceTimers;
|
|
10366
|
+
private readonly _formObserver;
|
|
10367
|
+
connectedCallback(): void;
|
|
10368
|
+
disconnectedCallback(): void;
|
|
10369
|
+
private readonly _onMessage;
|
|
10370
|
+
/** Re-fetches the payload and pushes a fresh config to the preview. */
|
|
10371
|
+
refresh(): Promise<void>;
|
|
10372
|
+
private _sendConfig;
|
|
10373
|
+
private _attachForms;
|
|
10374
|
+
private _detachForm;
|
|
10375
|
+
private readonly _onChange;
|
|
10376
|
+
private readonly _onSubmit;
|
|
10377
|
+
private _save;
|
|
10378
|
+
private _fail;
|
|
10379
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
10380
|
+
}
|
|
10381
|
+
}
|
|
10382
|
+
declare module "components/preview-frame/index" {
|
|
10383
|
+
import ZnPreviewFrame from "components/preview-frame/preview-frame.component";
|
|
10384
|
+
export * from "components/preview-frame/preview-frame.component";
|
|
10385
|
+
export default ZnPreviewFrame;
|
|
10386
|
+
global {
|
|
10387
|
+
interface HTMLElementTagNameMap {
|
|
10388
|
+
'zn-preview-frame': ZnPreviewFrame;
|
|
10389
|
+
}
|
|
10390
|
+
}
|
|
10391
|
+
}
|
|
10160
10392
|
declare module "utilities/form" {
|
|
10161
10393
|
export { clearFormStoreValues } from "internal/form";
|
|
10162
10394
|
}
|
|
@@ -10447,6 +10679,7 @@ declare module "zinc" {
|
|
|
10447
10679
|
export { default as OptGroup } from "components/opt-group/index";
|
|
10448
10680
|
export { default as PriorityList } from "components/priority-list/index";
|
|
10449
10681
|
export { default as MarkdownEditor } from "components/markdown-editor/index";
|
|
10682
|
+
export { default as RemarkdEditor } from "components/remarkd-editor/index";
|
|
10450
10683
|
export { default as FlowBuilder } from "components/flow-builder/index";
|
|
10451
10684
|
export { default as FlowSteps } from "components/flow-builder/modules/flow-steps/index";
|
|
10452
10685
|
export { default as FlowStepGroup } from "components/flow-builder/modules/flow-step-group/index";
|
|
@@ -10455,6 +10688,7 @@ declare module "zinc" {
|
|
|
10455
10688
|
export { default as PageBuilder } from "components/page-builder/index";
|
|
10456
10689
|
export { default as PagePaletteItem } from "components/page-builder/modules/page-palette-item/index";
|
|
10457
10690
|
export { default as PageSectionCard } from "components/page-builder/modules/page-section-card/index";
|
|
10691
|
+
export { default as PreviewFrame } from "components/preview-frame/index";
|
|
10458
10692
|
export { default as ZincElement } from "internal/zinc-element";
|
|
10459
10693
|
export * from "utilities/on";
|
|
10460
10694
|
export * from "utilities/query";
|
|
@@ -10570,6 +10804,7 @@ declare module "events/zn-element-added" {
|
|
|
10570
10804
|
declare module "events/zn-error" {
|
|
10571
10805
|
export type ZnErrorEvent = CustomEvent<{
|
|
10572
10806
|
status?: number;
|
|
10807
|
+
message?: string;
|
|
10573
10808
|
}>;
|
|
10574
10809
|
global {
|
|
10575
10810
|
interface GlobalEventHandlersEventMap {
|