@webx-ui/module-blocks 0.2.0 → 0.3.0
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/BlocksTree.d.ts +2 -0
- package/dist/content.d.ts +10 -0
- package/dist/index.js +1306 -1185
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types.d.ts +6 -0
- package/package.json +4 -4
package/dist/BlocksTree.d.ts
CHANGED
|
@@ -20,12 +20,14 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
20
20
|
add: (parentKey: string | null, field: string | null, node: ScreenNode | null) => any;
|
|
21
21
|
remove: (key: string) => any;
|
|
22
22
|
duplicate: (key: string) => any;
|
|
23
|
+
visibility: (key: string, hidden: boolean) => any;
|
|
23
24
|
reorder: (parentKey: string | null, field: string | null, list: BlockNode[]) => any;
|
|
24
25
|
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
25
26
|
onSelect?: ((key: string) => any) | undefined;
|
|
26
27
|
onAdd?: ((parentKey: string | null, field: string | null, node: ScreenNode | null) => any) | undefined;
|
|
27
28
|
onRemove?: ((key: string) => any) | undefined;
|
|
28
29
|
onDuplicate?: ((key: string) => any) | undefined;
|
|
30
|
+
onVisibility?: ((key: string, hidden: boolean) => any) | undefined;
|
|
29
31
|
onReorder?: ((parentKey: string | null, field: string | null, list: BlockNode[]) => any) | undefined;
|
|
30
32
|
}>, {
|
|
31
33
|
disabled: boolean;
|
package/dist/content.d.ts
CHANGED
|
@@ -28,12 +28,22 @@ export declare function locate(tree: BlockNode[], key: string): Located | null;
|
|
|
28
28
|
export declare function walk(tree: BlockNode[], visit: (node: BlockNode, depth: number, parent: BlockNode | null) => void, depth?: number, parent?: BlockNode | null): void;
|
|
29
29
|
/** How many instances of a type the tree holds, nested ones included. */
|
|
30
30
|
export declare function countType(tree: BlockNode[], slug: string): number;
|
|
31
|
+
/** How many blocks sit inside a node, at any depth — what removing it takes with it. */
|
|
32
|
+
export declare function countInside(node: BlockNode): number;
|
|
31
33
|
/** The distinct types a tree uses, in first-seen order. */
|
|
32
34
|
export declare function typesIn(tree: BlockNode[]): string[];
|
|
33
35
|
/** The `wx-blocks` nodes of a schema, through cards and tabs. */
|
|
34
36
|
export declare function nestedFields(schema: ScreenNode[]): ScreenNode[];
|
|
35
37
|
/** A copy with fresh keys all the way down — what a duplicate is. */
|
|
36
38
|
export declare function cloneNode(node: BlockNode): BlockNode;
|
|
39
|
+
/**
|
|
40
|
+
* Switch a block off, or back on.
|
|
41
|
+
*
|
|
42
|
+
* Showing it removes the key rather than writing `false`, so a block that was never hidden and
|
|
43
|
+
* one that was hidden and shown again are the same content — and the revision that guards a
|
|
44
|
+
* save says so.
|
|
45
|
+
*/
|
|
46
|
+
export declare function setHidden(tree: BlockNode[], key: string, hidden: boolean): BlockNode[];
|
|
37
47
|
export declare function insertNode(tree: BlockNode[], parentKey: string | null, field: string | null, index: number, node: BlockNode): BlockNode[];
|
|
38
48
|
export declare function removeNode(tree: BlockNode[], key: string): BlockNode[];
|
|
39
49
|
export declare function updateValues(tree: BlockNode[], key: string, values: Record<string, unknown>): BlockNode[];
|