@webx-ui/module-blocks 0.10.5 → 0.11.1

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.
@@ -16,9 +16,12 @@ type __VLS_Props = {
16
16
  groups?: string[];
17
17
  /** Where a person with the right can go and make a type. */
18
18
  blocksPath?: string | null;
19
+ /** What the top level is called in `allowed_in`: a page, or a layout region. */
20
+ root?: string;
19
21
  };
20
22
  declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
21
23
  allow: string[] | null;
24
+ root: string;
22
25
  groups: string[];
23
26
  parent: BlockType | null;
24
27
  tree: BlockNode[];
@@ -0,0 +1,7 @@
1
+ type __VLS_Props = {
2
+ base?: string;
3
+ };
4
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
5
+ base: string;
6
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
7
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
2
+ export default _default;
@@ -0,0 +1,16 @@
1
+ import { LinkValue } from '@webx-ui/module-admin';
2
+ export interface RegionPlace {
3
+ /** The site path the preview draws, `/` for the home page. */
4
+ path: string;
5
+ /** What was chosen, so reopening the picker shows it chosen. `null` — the home page. */
6
+ link: LinkValue | null;
7
+ }
8
+ type __VLS_PublicProps = {
9
+ modelValue: RegionPlace;
10
+ };
11
+ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
12
+ "update:modelValue": (value: RegionPlace) => any;
13
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
14
+ "onUpdate:modelValue"?: ((value: RegionPlace) => any) | undefined;
15
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
16
+ export default _default;
@@ -0,0 +1,7 @@
1
+ type __VLS_Props = {
2
+ base?: string;
3
+ };
4
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
5
+ base: string;
6
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
7
+ export default _default;
package/dist/api.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { AdminContext } from '@webx-ui/module-admin';
2
- import { BlockInput, BlockList, BlockType, BlockUsage, BlockVersion, BlockVersionMeta, RenderInput, RenderResult } from './types';
2
+ import { BlockInput, BlockList, BlockType, BlockUsage, BlockVersion, BlockNode, BlockVersionMeta, RegionAdopted, RegionDetail, RegionRow, RegionVersion, RenderInput, RenderResult } from './types';
3
3
  export interface BlocksApi {
4
4
  /** Every type, without content: the section's list. */
5
5
  list(): Promise<BlockType[]>;
@@ -24,3 +24,27 @@ export interface BlocksApi {
24
24
  }
25
25
  /** Everything under `/blocks`, below the panel's API path. */
26
26
  export declare function createBlocksApi(admin: AdminContext): BlocksApi;
27
+ export interface RegionsApi {
28
+ /** Every region the site's config declares, saved or not. */
29
+ list(): Promise<RegionRow[]>;
30
+ get(name: string): Promise<RegionDetail>;
31
+ /**
32
+ * Save the draft. Refused with a 409 when the revision is not the current one — the error's
33
+ * body is a {@link RegionConflict} carrying the revision to write over.
34
+ */
35
+ save(name: string, input: {
36
+ blocks: BlockNode[];
37
+ revision?: string;
38
+ }): Promise<RegionDetail>;
39
+ publish(name: string): Promise<RegionDetail>;
40
+ /** Off the site: the code's view comes back, the blocks stay as the draft. */
41
+ unpublish(name: string): Promise<RegionDetail>;
42
+ discardDraft(name: string): Promise<RegionDetail>;
43
+ versions(name: string): Promise<RegionVersion[]>;
44
+ /** An old publication becomes the draft; putting it on the site is a separate step. */
45
+ restoreVersion(name: string, number: number): Promise<RegionDetail>;
46
+ /** The fallback view made into a block type, and one of it put into the draft. */
47
+ adopt(name: string): Promise<RegionAdopted>;
48
+ }
49
+ /** Everything under `/regions`, below the panel's API path. */
50
+ export declare function createRegionsApi(admin: AdminContext): RegionsApi;
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- export { blocks, type BlocksOptions } from './module';
2
- export { createBlocksApi, type BlocksApi } from './api';
1
+ export { blocks, regions, type BlocksOptions, type RegionsOptions } from './module';
2
+ export { createBlocksApi, createRegionsApi, type BlocksApi, type RegionsApi } from './api';
3
3
  export { blocksMessages } from './messages';
4
- export { blocksPreviewKey, provideBlocksPreview, useBlocksPreview, type BlocksPreview, } from './preview';
4
+ export { blocksPreviewKey, blocksTopKey, provideBlocksPreview, provideBlocksTop, useBlocksPreview, type BlocksPreview, type BlocksTop, } from './preview';
5
5
  export { cloneNode, countType, insertNode, isNode, isNodeList, locate, makeNode, newKey, removeNode, replaceList, typesIn, updateValues, walk, type Located, } from './content';
6
6
  export { lintBlock, undeclared } from './lint';
7
7
  export { findRange, highlightBlock, replaceBlock, stageDocument } from './frame';
@@ -12,4 +12,6 @@ export { default as WxBlockEditorPage } from './BlockEditorPage';
12
12
  export { default as WxBlockPicker } from './BlockPicker';
13
13
  export { default as WxBlockThumb } from './BlockThumb';
14
14
  export { default as WxBlockStage } from './BlockStage';
15
- export type { BlockContent, BlockInput, BlockKind, BlockList, BlockNode, BlockParent, BlockSource, BlocksMeta, BlockThumbnail, BlockType, BlockUsage, BlockVersion, BlockVersionMeta, DeclaredComponent, Lint, PublishRefusal, RenderInput, RenderResult, ShapeField, } from './types';
15
+ export { default as WxRegionsPage } from './RegionsPage';
16
+ export { default as WxRegionEditorPage } from './RegionEditorPage';
17
+ export type { BlockContent, BlockInput, BlockKind, BlockList, BlockNode, BlockParent, BlockSource, BlocksMeta, BlockThumbnail, BlockType, BlockUsage, BlockVersion, BlockVersionMeta, DeclaredComponent, Lint, PublishRefusal, RegionAdopted, RegionConflict, RegionDetail, RegionRow, RegionVersion, RenderInput, RenderResult, ShapeField, } from './types';