@webx-ui/module-blocks 0.11.6 → 0.12.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.
@@ -43,6 +43,7 @@ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {},
43
43
  selected?: string | null;
44
44
  reload?: number;
45
45
  compact?: boolean;
46
+ hidden?: string[];
46
47
  }> & Readonly<{
47
48
  onSelect?: ((key: string | null) => any) | undefined;
48
49
  onEdit?: (() => any) | undefined;
@@ -54,6 +55,7 @@ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {},
54
55
  select: (key: string | null) => any;
55
56
  edit: () => any;
56
57
  }, import('vue').PublicProps, {
58
+ hidden: string[];
57
59
  compact: boolean;
58
60
  selected: string | null;
59
61
  reload: number;
@@ -73,6 +75,7 @@ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {},
73
75
  selected?: string | null;
74
76
  reload?: number;
75
77
  compact?: boolean;
78
+ hidden?: string[];
76
79
  }> & Readonly<{
77
80
  onSelect?: ((key: string | null) => any) | undefined;
78
81
  onEdit?: (() => any) | undefined;
@@ -81,6 +84,7 @@ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {},
81
84
  refresh: () => void;
82
85
  open: () => boolean;
83
86
  }, {}, {}, {}, {
87
+ hidden: string[];
84
88
  compact: boolean;
85
89
  selected: string | null;
86
90
  reload: number;
@@ -17,6 +17,8 @@ type __VLS_Props = {
17
17
  * there is no tree standing next to it to click.
18
18
  */
19
19
  compact?: boolean;
20
+ /** Keys of the blocks switched off: marked in the page until it reloads without them. */
21
+ hidden?: string[];
20
22
  };
21
23
  /** Swap one block's markup in place; false when the page has to be reloaded instead. */
22
24
  declare function replace(key: string, html: string): boolean;
@@ -32,6 +34,7 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {
32
34
  onSelect?: ((key: string | null) => any) | undefined;
33
35
  onEdit?: (() => any) | undefined;
34
36
  }>, {
37
+ hidden: string[];
35
38
  compact: boolean;
36
39
  selected: string | null;
37
40
  reload: number;
@@ -18,6 +18,8 @@ type __VLS_Props = {
18
18
  selected?: string | null;
19
19
  disabled?: boolean;
20
20
  depth?: number;
21
+ /** What the last save was refused for, by block key. */
22
+ errors?: Record<string, string[]>;
21
23
  };
22
24
  declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
23
25
  add: (parentKey: string | null, field: string | null, node: ScreenNode | null, index?: number | undefined) => any;
@@ -39,6 +41,7 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
39
41
  field: string | null;
40
42
  disabled: boolean;
41
43
  depth: number;
44
+ errors: Record<string, string[]>;
42
45
  max: number | null;
43
46
  selected: string | null;
44
47
  parentKey: string | null;
package/dist/api.d.ts CHANGED
@@ -13,7 +13,10 @@ export interface BlocksApi {
13
13
  remove(id: number): Promise<void>;
14
14
  /** A declared place made into the site's own type: an unpublished draft of the module's view. */
15
15
  customise(slug: string): Promise<BlockType>;
16
- publish(id: number): Promise<BlockType>;
16
+ /** `dropTranslations` agrees to keep one language where a field stops being localized. */
17
+ publish(id: number, options?: {
18
+ dropTranslations?: boolean;
19
+ }): Promise<BlockType>;
17
20
  render(id: number, input?: RenderInput): Promise<RenderResult>;
18
21
  usage(id: number): Promise<BlockUsage[]>;
19
22
  versions(id: number): Promise<BlockVersionMeta[]>;
package/dist/frame.d.ts CHANGED
@@ -25,6 +25,13 @@ export declare function replaceBlock(doc: Document, key: string, html: string):
25
25
  export declare function blockElement(root: Node, key: string): Element | null;
26
26
  /** Mark one block as the selected one, and nothing else. Null clears the selection. */
27
27
  export declare function highlightBlock(doc: Document, key: string | null): Element | null;
28
+ export declare const HIDDEN_CLASS = "wx-preview-hidden";
29
+ /**
30
+ * Mark the blocks switched off. The page drawn under the preview token leaves a hidden block out,
31
+ * but one hidden after the page was drawn is still in the frame until it reloads — and it looked
32
+ * exactly like the blocks that will be on the site.
33
+ */
34
+ export declare function markHidden(doc: Document, keys: string[]): void;
28
35
  /** Mark one block as the one under the pointer. Null clears it. */
29
36
  export declare function hoverBlock(doc: Document, key: string | null): void;
30
37
  /**