@webx-ui/module-blocks 0.1.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/LICENSE +21 -0
- package/README.md +62 -0
- package/dist/BlockCard.d.ts +11 -0
- package/dist/BlockChecks.d.ts +19 -0
- package/dist/BlockCreateDialog.d.ts +2 -0
- package/dist/BlockEditorPage.d.ts +86 -0
- package/dist/BlockHistory.d.ts +15 -0
- package/dist/BlockPicker.d.ts +27 -0
- package/dist/BlockStage.d.ts +21 -0
- package/dist/BlockThumb.d.ts +22 -0
- package/dist/BlocksField.d.ts +78 -0
- package/dist/BlocksPage.d.ts +12 -0
- package/dist/BlocksPreview.d.ts +34 -0
- package/dist/BlocksTree.d.ts +37 -0
- package/dist/api.d.ts +20 -0
- package/dist/content.d.ts +43 -0
- package/dist/frame.d.ts +43 -0
- package/dist/i18n.d.ts +2 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +2461 -0
- package/dist/index.js.map +1 -0
- package/dist/lint.d.ts +23 -0
- package/dist/messages.d.ts +7 -0
- package/dist/module.d.ts +13 -0
- package/dist/preview.d.ts +25 -0
- package/dist/schema.d.ts +13 -0
- package/dist/style.css +1 -0
- package/dist/types.d.ts +126 -0
- package/package.json +65 -0
package/dist/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.wx-block-checks[data-v-a96ffa19]{display:flex;flex-direction:column;gap:var(--wx-space-4);padding:var(--wx-space-8) var(--wx-space-12);font-size:var(--wx-font-size-sm);border-block-start:1px solid var(--wx-color-border-muted, var(--wx-border-default))}.wx-block-checks__line[data-v-a96ffa19]{display:flex;gap:var(--wx-space-8);align-items:flex-start}.wx-block-checks__line .wx-icon[data-v-a96ffa19]{flex:none;margin-block-start:2px}.is-ok[data-v-a96ffa19]{color:var(--wx-text-muted)}.is-ok .wx-icon[data-v-a96ffa19]{color:var(--wx-color-success)}.is-warning[data-v-a96ffa19]{color:var(--wx-color-warning-text, var(--wx-color-warning))}.is-error[data-v-a96ffa19]{color:var(--wx-color-danger-text, var(--wx-color-danger))}.wx-block-history[data-v-e88160ce]{display:flex;flex-direction:column}.wx-block-history__row[data-v-e88160ce]{display:flex;align-items:center;gap:var(--wx-space-12);padding:var(--wx-space-10) var(--wx-space-12);border-block-end:1px solid var(--wx-color-border-muted, var(--wx-border-default));flex-wrap:wrap}.wx-block-history__row[data-v-e88160ce]:last-child{border-block-end:0}.wx-block-history__number[data-v-e88160ce]{width:40px;font-family:var(--wx-font-family-mono);font-size:var(--wx-font-size-sm);color:var(--wx-text-muted)}.wx-block-history__who[data-v-e88160ce]{display:flex;flex-direction:column;flex:1;min-width:160px}.wx-block-stage[data-v-976b03f0]{display:flex;flex-direction:column;border:1px solid var(--wx-border-default);border-radius:var(--wx-radius-md);background:var(--wx-bg-surface);overflow:hidden}.wx-block-stage__bar[data-v-976b03f0]{display:flex;justify-content:space-between;gap:var(--wx-space-8);padding:var(--wx-space-8) var(--wx-space-12);border-block-end:1px solid var(--wx-color-border-muted, var(--wx-border-default))}.wx-block-stage__ground[data-v-976b03f0]{padding:var(--wx-space-12);background:var(--wx-bg-subtle);overflow:auto;max-height:62vh}.wx-block-stage__clip[data-v-976b03f0]{overflow:hidden;margin-inline:auto;box-shadow:var(--wx-shadow-sm)}.wx-block-stage__frame[data-v-976b03f0]{display:block;border:0;background:#fff;transform-origin:top left}.wx-block-editor[data-v-2c17889f]{display:flex;flex-direction:column;gap:var(--wx-space-16);container-type:inline-size}.wx-block-editor__head[data-v-2c17889f]{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--wx-space-16);flex-wrap:wrap}.wx-block-editor__id[data-v-2c17889f]{display:flex;flex-direction:column;gap:var(--wx-space-4);flex:1 1 280px;min-width:0}.wx-block-editor__back[data-v-2c17889f]{font-size:var(--wx-font-size-sm);color:var(--wx-text-muted);text-decoration:none}.wx-block-editor__title[data-v-2c17889f]{width:100%;padding:0;border:0;background:transparent;color:inherit;font:inherit;font-size:var(--wx-font-size-xl);font-weight:var(--wx-font-weight-bold)}.wx-block-editor__title[data-v-2c17889f]:focus-visible{outline:2px solid var(--wx-color-primary);outline-offset:2px;border-radius:var(--wx-radius-xs)}.wx-block-editor__actions[data-v-2c17889f]{display:flex;align-items:center;gap:var(--wx-space-8);flex-wrap:wrap}.wx-block-editor__columns[data-v-2c17889f]{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:var(--wx-space-16);align-items:start}@container (max-width: 1080px){.wx-block-editor__columns[data-v-2c17889f]{grid-template-columns:minmax(0,1fr)}}.wx-block-editor__files[data-v-2c17889f]{min-width:0}.wx-block-editor__pane[data-v-2c17889f]{display:flex;flex-direction:column;border:1px solid var(--wx-border-default);border-radius:var(--wx-radius-md);overflow:hidden}.wx-block-editor__pane[data-v-2c17889f] .wx-code-editor{border:0;border-radius:0}.wx-block-editor__pills[data-v-2c17889f]{display:flex;flex-wrap:wrap;align-items:center;gap:var(--wx-space-6);padding:var(--wx-space-8) var(--wx-space-12);border-block-start:1px solid var(--wx-color-border-muted, var(--wx-border-default))}.wx-block-editor__pill[data-v-2c17889f]{padding:2px var(--wx-space-8);border:1px solid var(--wx-border-default);border-radius:var(--wx-radius-full);background:var(--wx-bg-surface);color:var(--wx-color-primary);font-family:var(--wx-font-family-mono);font-size:var(--wx-font-size-xs);cursor:pointer}.wx-block-editor__pill[data-v-2c17889f]:hover:not(:disabled){border-color:var(--wx-color-primary)}.wx-block-editor__note[data-v-2c17889f]{display:flex;flex-direction:column;gap:var(--wx-space-4);padding:var(--wx-space-8) var(--wx-space-12);border-block-start:1px solid var(--wx-color-border-muted, var(--wx-border-default))}.wx-block-editor__settings[data-v-2c17889f]{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:var(--wx-space-12) var(--wx-space-16);padding-block-start:var(--wx-space-12)}.wx-block-editor__settings .is-wide[data-v-2c17889f]{grid-column:1 / -1}.wx-block-editor__danger[data-v-2c17889f]{display:flex;align-items:center;gap:var(--wx-space-12);flex-wrap:wrap}.wx-block-editor__side[data-v-2c17889f]{display:flex;flex-direction:column;gap:var(--wx-space-16);min-width:0;position:sticky;top:var(--wx-space-12)}.wx-block-editor__usage[data-v-2c17889f]{display:flex;flex-direction:column;gap:var(--wx-space-6)}.wx-block-editor__use[data-v-2c17889f]{display:flex;align-items:center;gap:var(--wx-space-8)}code[data-v-2c17889f]{font-family:var(--wx-font-family-mono);font-size:var(--wx-font-size-xs)}.wx-block-thumb[data-v-615b818a]{position:relative;overflow:hidden;background:var(--wx-bg-subtle)}.wx-block-thumb__frame[data-v-615b818a]{position:absolute;inset-block-start:0;inset-inline-start:0;border:0;transform-origin:top left;pointer-events:none;background:#fff}.wx-block-thumb__empty[data-v-615b818a]{display:grid;place-items:center;height:100%;color:var(--wx-text-muted)}.wx-block-picker[data-v-a60d5d48]{display:flex;flex-direction:column;gap:var(--wx-space-16)}.wx-block-picker__group[data-v-a60d5d48]{display:flex;flex-direction:column;gap:var(--wx-space-8)}.wx-block-picker__group-title[data-v-a60d5d48]{font-size:var(--wx-font-size-xs);font-weight:var(--wx-font-weight-semibold);letter-spacing:.06em;text-transform:uppercase;color:var(--wx-text-muted)}.wx-block-picker__cards[data-v-a60d5d48]{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:var(--wx-space-12)}.wx-block-picker__card[data-v-a60d5d48]{display:flex;flex-direction:column;padding:0;overflow:hidden;text-align:start;font:inherit;color:inherit;background:var(--wx-bg-surface);border:1px solid var(--wx-border-default);border-radius:var(--wx-radius-md);cursor:pointer}.wx-block-picker__card[data-v-a60d5d48]:hover:not(:disabled),.wx-block-picker__card[data-v-a60d5d48]:focus-visible{border-color:var(--wx-color-primary);outline:none}.wx-block-picker__card.is-disabled[data-v-a60d5d48]{opacity:.6;cursor:not-allowed}.wx-block-picker__body[data-v-a60d5d48]{display:flex;flex-direction:column;gap:var(--wx-space-4);padding:var(--wx-space-10) var(--wx-space-12)}.wx-block-picker__title[data-v-a60d5d48]{font-weight:var(--wx-font-weight-semibold)}.wx-blocks-preview[data-v-1436a310]{display:flex;flex-direction:column;border:1px solid var(--wx-border-default);border-radius:var(--wx-radius-md);background:var(--wx-bg-surface);overflow:hidden;min-width:0}.wx-blocks-preview.is-fullscreen[data-v-1436a310]{position:fixed;inset:0;z-index:40;border:0;border-radius:0}.wx-blocks-preview__bar[data-v-1436a310]{display:flex;align-items:center;justify-content:space-between;gap:var(--wx-space-8);padding:var(--wx-space-8) var(--wx-space-12);border-block-end:1px solid var(--wx-color-border-muted, var(--wx-border-default))}.wx-blocks-preview__label[data-v-1436a310]{min-width:0;font-family:var(--wx-font-family-mono)}.wx-blocks-preview__tools[data-v-1436a310]{display:flex;gap:var(--wx-space-8);align-items:center;flex-wrap:wrap}.wx-blocks-preview__ground[data-v-1436a310]{flex:1;padding:var(--wx-space-12);background:var(--wx-bg-subtle);overflow:auto;max-height:calc(100vh - 200px)}.is-fullscreen .wx-blocks-preview__ground[data-v-1436a310]{max-height:none}.wx-blocks-preview__clip[data-v-1436a310]{margin-inline:auto;overflow:hidden;box-shadow:var(--wx-shadow-sm)}.wx-blocks-preview__frame[data-v-1436a310]{display:block;border:0;background:#fff;height:min(72vh,720px);transform-origin:top left}.is-fullscreen .wx-blocks-preview__frame[data-v-1436a310]{height:calc(100vh - 100px)}.wx-blocks-tree[data-v-5d559d85] .wx-sortable-list__content{min-width:0}.wx-blocks-tree__node[data-v-5d559d85]{display:flex;flex-direction:column;gap:var(--wx-space-2);min-width:0}.wx-blocks-tree__row[data-v-5d559d85]{display:flex;align-items:center;gap:var(--wx-space-8);padding:var(--wx-space-6) var(--wx-space-8);border:1px solid transparent;border-radius:var(--wx-radius-control);cursor:pointer}.wx-blocks-tree__row[data-v-5d559d85]:hover{background:var(--wx-bg-subtle)}.wx-blocks-tree__row.is-selected[data-v-5d559d85]{background:var(--wx-color-primary-soft);border-color:var(--wx-color-primary)}.wx-blocks-tree__icon[data-v-5d559d85]{display:grid;place-items:center;flex:none;width:24px;height:24px;border-radius:var(--wx-radius-sm);background:var(--wx-bg-subtle);color:var(--wx-text-muted)}.is-selected .wx-blocks-tree__icon[data-v-5d559d85]{background:var(--wx-bg-surface);color:var(--wx-color-primary)}.wx-blocks-tree__name[data-v-5d559d85]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--wx-font-size-sm);font-weight:var(--wx-font-weight-medium)}.wx-blocks-tree__flag[data-v-5d559d85]{display:flex;color:var(--wx-text-muted)}.wx-blocks-tree__flag.is-warning[data-v-5d559d85]{color:var(--wx-color-warning)}.wx-blocks-tree__flag.is-danger[data-v-5d559d85]{color:var(--wx-color-danger)}.wx-blocks-tree__actions[data-v-5d559d85]{display:flex;gap:var(--wx-space-2);opacity:0}.wx-blocks-tree__row:hover .wx-blocks-tree__actions[data-v-5d559d85],.wx-blocks-tree__row:focus-within .wx-blocks-tree__actions[data-v-5d559d85],.wx-blocks-tree__row.is-selected .wx-blocks-tree__actions[data-v-5d559d85]{opacity:1}.wx-blocks-tree__kids[data-v-5d559d85]{display:flex;flex-direction:column;gap:var(--wx-space-2);margin-inline-start:var(--wx-space-14);padding-inline-start:var(--wx-space-8);border-inline-start:1px dashed var(--wx-border-default)}.wx-blocks-tree__add[data-v-5d559d85]{width:100%;padding:var(--wx-space-6);border:1px dashed var(--wx-color-border-strong, var(--wx-border-default));border-radius:var(--wx-radius-control);background:transparent;color:var(--wx-text-muted);font:inherit;font-size:var(--wx-font-size-xs);cursor:pointer}.wx-blocks-tree__add[data-v-5d559d85]:hover{color:var(--wx-color-primary);border-color:var(--wx-color-primary);background:var(--wx-color-primary-soft)}.wx-blocks-host[data-v-f1ec0da8]{container-type:inline-size}.wx-blocks[data-v-f1ec0da8]{display:grid;grid-template-columns:minmax(220px,260px) minmax(0,1fr);gap:var(--wx-space-16);align-items:start}.wx-blocks.is-editing[data-v-f1ec0da8]{grid-template-columns:minmax(220px,260px) minmax(0,1fr)}.wx-blocks.is-editing.has-preview[data-v-f1ec0da8]{grid-template-columns:minmax(220px,260px) minmax(360px,1fr) 420px}.wx-blocks__tree[data-v-f1ec0da8],.wx-blocks__fields[data-v-f1ec0da8]{display:flex;flex-direction:column;gap:var(--wx-space-8);padding:var(--wx-space-8);border:1px solid var(--wx-border-default);border-radius:var(--wx-radius-md);background:var(--wx-bg-surface);min-width:0}.wx-blocks__panel-head[data-v-f1ec0da8]{display:flex;align-items:center;justify-content:space-between;gap:var(--wx-space-8);padding:var(--wx-space-4) var(--wx-space-6)}.wx-blocks__panel-title[data-v-f1ec0da8]{font-weight:var(--wx-font-weight-semibold)}.wx-blocks__panel-extra[data-v-f1ec0da8]{display:flex;align-items:center;gap:var(--wx-space-8)}.wx-blocks__form[data-v-f1ec0da8]{padding:var(--wx-space-6)}.wx-blocks__preview[data-v-f1ec0da8]{min-width:0;position:sticky;top:var(--wx-space-12)}.wx-blocks__preview-button[data-v-f1ec0da8]{display:none}@container (max-width: 1080px){.wx-blocks.is-editing.has-preview[data-v-f1ec0da8]{grid-template-columns:minmax(220px,260px) minmax(0,1fr)}.wx-blocks.is-editing .wx-blocks__preview[data-v-f1ec0da8]{display:none}.wx-blocks.is-editing.has-preview .wx-blocks__preview-button[data-v-f1ec0da8]{display:inline-flex}.wx-blocks.is-editing .wx-blocks__preview[data-v-f1ec0da8]:has(.is-fullscreen){display:block;position:static}}@container (max-width: 720px){.wx-blocks[data-v-f1ec0da8],.wx-blocks.is-editing[data-v-f1ec0da8],.wx-blocks.has-preview[data-v-f1ec0da8],.wx-blocks.is-editing.has-preview[data-v-f1ec0da8]{grid-template-columns:minmax(0,1fr)}.wx-blocks__preview[data-v-f1ec0da8]{display:none}.wx-blocks.has-preview .wx-blocks__preview-button[data-v-f1ec0da8]{display:inline-flex}.wx-blocks__preview[data-v-f1ec0da8]:has(.is-fullscreen){display:block;position:static}}code[data-v-f1ec0da8]{font-family:var(--wx-font-family-mono);font-size:var(--wx-font-size-xs);color:var(--wx-text-muted)}.wx-block-card[data-v-daa12de4]{display:flex;flex-direction:column;width:100%;padding:0;overflow:hidden;text-align:start;font:inherit;color:inherit;background:var(--wx-bg-surface);border:1px solid var(--wx-border-default);border-radius:var(--wx-radius-md);cursor:pointer}.wx-block-card[data-v-daa12de4]:hover,.wx-block-card[data-v-daa12de4]:focus-visible{border-color:var(--wx-color-primary);outline:none}.wx-block-card__body[data-v-daa12de4]{display:flex;flex-direction:column;gap:var(--wx-space-6);padding:var(--wx-space-12) var(--wx-space-14)}.wx-block-card__title[data-v-daa12de4]{font-weight:var(--wx-font-weight-semibold)}.wx-block-card__chips[data-v-daa12de4]{display:flex;flex-wrap:wrap;gap:var(--wx-space-6)}code[data-v-daa12de4]{font-family:var(--wx-font-family-mono);font-size:var(--wx-font-size-xs)}.wx-block-create[data-v-274bc88a]{display:flex;flex-direction:column;gap:var(--wx-space-12)}.wx-blocks-page[data-v-2dffcfb4]{display:flex;flex-direction:column;gap:var(--wx-space-16);container-type:inline-size}.wx-blocks-page__head[data-v-2dffcfb4]{display:flex;align-items:center;justify-content:space-between;gap:var(--wx-space-12);flex-wrap:wrap}.wx-blocks-page__tools[data-v-2dffcfb4]{display:flex;gap:var(--wx-space-8);align-items:center;flex-wrap:wrap}.wx-blocks-page__group[data-v-2dffcfb4]{display:flex;flex-direction:column;gap:var(--wx-space-12)}.wx-blocks-page__group-title[data-v-2dffcfb4]{font-size:var(--wx-font-size-xs);font-weight:var(--wx-font-weight-semibold);letter-spacing:.06em;text-transform:uppercase;color:var(--wx-text-muted)}.wx-blocks-page__cards[data-v-2dffcfb4]{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:var(--wx-space-16)}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { ScreenNode } from '@webx-ui/schema';
|
|
2
|
+
export type BlockSource = 'panel' | 'mcp' | 'import';
|
|
3
|
+
/** One version, as the history lists it. */
|
|
4
|
+
export interface BlockVersionMeta {
|
|
5
|
+
number: number;
|
|
6
|
+
source: BlockSource;
|
|
7
|
+
comment: string | null;
|
|
8
|
+
author_id: number | null;
|
|
9
|
+
author: string | null;
|
|
10
|
+
created_at: string | null;
|
|
11
|
+
}
|
|
12
|
+
/** The content of a version: what the editor works on. */
|
|
13
|
+
export interface BlockContent {
|
|
14
|
+
/** Screen nodes of `@webx-ui/schema`; a node's `id` is the field's key in the values. */
|
|
15
|
+
schema: ScreenNode[];
|
|
16
|
+
template: string;
|
|
17
|
+
styles: string;
|
|
18
|
+
script: string | null;
|
|
19
|
+
sample: Record<string, unknown>;
|
|
20
|
+
}
|
|
21
|
+
export interface BlockVersion extends BlockVersionMeta {
|
|
22
|
+
content?: BlockContent;
|
|
23
|
+
}
|
|
24
|
+
/** The block drawn on its sample, ready for an iframe. */
|
|
25
|
+
export interface BlockThumbnail {
|
|
26
|
+
html: string;
|
|
27
|
+
styles: string;
|
|
28
|
+
}
|
|
29
|
+
/** What was noticed on saving; never a refusal. */
|
|
30
|
+
export interface Lint {
|
|
31
|
+
file: 'template' | 'styles' | 'schema';
|
|
32
|
+
code: string;
|
|
33
|
+
line: number | null;
|
|
34
|
+
message: string;
|
|
35
|
+
}
|
|
36
|
+
/** A block type as the section shows it. */
|
|
37
|
+
export interface BlockType {
|
|
38
|
+
id: number;
|
|
39
|
+
slug: string;
|
|
40
|
+
title: string;
|
|
41
|
+
description: string | null;
|
|
42
|
+
icon: string | null;
|
|
43
|
+
group: string;
|
|
44
|
+
sort: number;
|
|
45
|
+
/** Types allowed inside; `null` means the block is not a container. */
|
|
46
|
+
allow: string[] | null;
|
|
47
|
+
/** Types that may hold this one, `root` standing for the page itself; `null` means anywhere. */
|
|
48
|
+
allowed_in: string[] | null;
|
|
49
|
+
max_per_entity: number | null;
|
|
50
|
+
is_enabled: boolean;
|
|
51
|
+
draft: BlockVersionMeta | null;
|
|
52
|
+
published: BlockVersionMeta | null;
|
|
53
|
+
usage_count: number;
|
|
54
|
+
thumbnail: BlockThumbnail | null;
|
|
55
|
+
created_at: string | null;
|
|
56
|
+
updated_at: string | null;
|
|
57
|
+
/** The draft's content, or the published version's without a draft. Absent in the list. */
|
|
58
|
+
content?: BlockContent;
|
|
59
|
+
warnings?: Lint[];
|
|
60
|
+
}
|
|
61
|
+
/** What a save sends: only what changed. */
|
|
62
|
+
export interface BlockInput {
|
|
63
|
+
slug?: string;
|
|
64
|
+
title?: string;
|
|
65
|
+
description?: string | null;
|
|
66
|
+
icon?: string | null;
|
|
67
|
+
group?: string;
|
|
68
|
+
sort?: number;
|
|
69
|
+
allow?: string[] | null;
|
|
70
|
+
allowed_in?: string[] | null;
|
|
71
|
+
max_per_entity?: number | null;
|
|
72
|
+
is_enabled?: boolean;
|
|
73
|
+
content?: Partial<BlockContent>;
|
|
74
|
+
comment?: string | null;
|
|
75
|
+
}
|
|
76
|
+
/** An entity a type stands on. */
|
|
77
|
+
export interface BlockUsage {
|
|
78
|
+
model: string;
|
|
79
|
+
id: number | string;
|
|
80
|
+
title: string | null;
|
|
81
|
+
published: boolean;
|
|
82
|
+
}
|
|
83
|
+
/** One block drawn by the server. */
|
|
84
|
+
export interface RenderResult {
|
|
85
|
+
/** The HTML between the marker pair `<!--wx:key-->…<!--/wx:key-->`. */
|
|
86
|
+
html: string;
|
|
87
|
+
styles: string;
|
|
88
|
+
/** The script wrapped for the runtime, or null when the block has none. */
|
|
89
|
+
script: string | null;
|
|
90
|
+
/** Where the runtime is served. */
|
|
91
|
+
runtime: string;
|
|
92
|
+
version: number;
|
|
93
|
+
}
|
|
94
|
+
export interface RenderInput {
|
|
95
|
+
values?: Record<string, unknown>;
|
|
96
|
+
key?: string;
|
|
97
|
+
/** Unsaved content to draw instead of the stored version. Needs the right to save. */
|
|
98
|
+
content?: Partial<BlockContent>;
|
|
99
|
+
}
|
|
100
|
+
/** A 422 from publishing: the reason, the line, and the page when a page broke. */
|
|
101
|
+
export interface PublishRefusal {
|
|
102
|
+
message: string;
|
|
103
|
+
errors: Record<string, string[]>;
|
|
104
|
+
line: number | null;
|
|
105
|
+
entity: {
|
|
106
|
+
model: string;
|
|
107
|
+
id: number | string;
|
|
108
|
+
title: string | null;
|
|
109
|
+
} | null;
|
|
110
|
+
}
|
|
111
|
+
/** What the server-side module says about itself in the manifest. */
|
|
112
|
+
export interface BlocksMeta {
|
|
113
|
+
groups: string[];
|
|
114
|
+
editing: boolean;
|
|
115
|
+
provides: string[];
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* One block on a page: the instance's key, the type's slug, and the values keyed by the
|
|
119
|
+
* type's field ids. A container holds its children in one of the values, as a list of the
|
|
120
|
+
* same shape.
|
|
121
|
+
*/
|
|
122
|
+
export interface BlockNode {
|
|
123
|
+
key: string;
|
|
124
|
+
type: string;
|
|
125
|
+
values: Record<string, unknown>;
|
|
126
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@webx-ui/module-blocks",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "The block constructor for the WebX UI admin panel: the section where a block type is made — fields, Blade, CSS, script — and the wx-blocks field that builds a page out of them.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"sideEffects": [
|
|
8
|
+
"*.css"
|
|
9
|
+
],
|
|
10
|
+
"keywords": [
|
|
11
|
+
"webx-ui",
|
|
12
|
+
"vue",
|
|
13
|
+
"admin",
|
|
14
|
+
"blocks",
|
|
15
|
+
"page-builder"
|
|
16
|
+
],
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/webx-ui/webx-ui.git",
|
|
20
|
+
"directory": "packages/module-blocks"
|
|
21
|
+
},
|
|
22
|
+
"homepage": "https://webx-ui.github.io/webx-ui/guide/blocks.html",
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"dist"
|
|
28
|
+
],
|
|
29
|
+
"main": "./dist/index.js",
|
|
30
|
+
"module": "./dist/index.js",
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
32
|
+
"exports": {
|
|
33
|
+
".": {
|
|
34
|
+
"types": "./dist/index.d.ts",
|
|
35
|
+
"import": "./dist/index.js"
|
|
36
|
+
},
|
|
37
|
+
"./style.css": "./dist/style.css",
|
|
38
|
+
"./dist/style.css": "./dist/style.css",
|
|
39
|
+
"./package.json": "./package.json"
|
|
40
|
+
},
|
|
41
|
+
"peerDependencies": {
|
|
42
|
+
"vue": "^3.5.0",
|
|
43
|
+
"vue-router": "^4.5.0"
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@webx-ui/core": "^0.19.0",
|
|
47
|
+
"@webx-ui/module-admin": "^0.4.1",
|
|
48
|
+
"@webx-ui/schema": "^0.2.0"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@types/node": "^24.10.1",
|
|
52
|
+
"@vitejs/plugin-vue": "^6.0.1",
|
|
53
|
+
"typescript": "^5.9.3",
|
|
54
|
+
"vite": "^7.1.14",
|
|
55
|
+
"vite-plugin-dts": "^4.5.4",
|
|
56
|
+
"vue": "^3.5.24",
|
|
57
|
+
"vue-router": "^4.5.1",
|
|
58
|
+
"vue-tsc": "^3.1.3"
|
|
59
|
+
},
|
|
60
|
+
"scripts": {
|
|
61
|
+
"build": "vite build",
|
|
62
|
+
"dev": "vite build --watch",
|
|
63
|
+
"typecheck": "vue-tsc -p tsconfig.json --noEmit"
|
|
64
|
+
}
|
|
65
|
+
}
|