@adia-ai/web-modules 0.0.4
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/CHANGELOG.md +292 -0
- package/README.md +119 -0
- package/chat/chat-shell/chat-shell.a2ui.json +149 -0
- package/chat/chat-shell/chat-shell.css +10 -0
- package/chat/chat-shell/chat-shell.js +297 -0
- package/chat/chat-shell/chat-shell.yaml +119 -0
- package/chat/chat-shell/css/chat-shell.empty.css +12 -0
- package/chat/chat-shell/css/chat-shell.layout.css +60 -0
- package/chat/chat-shell/css/chat-shell.markdown.css +74 -0
- package/chat/chat-shell/css/chat-shell.messages.css +87 -0
- package/chat/chat-shell/css/chat-shell.streaming.css +30 -0
- package/chat/chat-shell/css/chat-shell.tokens.css +95 -0
- package/chat/index.js +1 -0
- package/editor/editor-shell/css/editor-shell.layout.css +171 -0
- package/editor/editor-shell/css/editor-shell.tokens.css +28 -0
- package/editor/editor-shell/editor-shell.a2ui.json +73 -0
- package/editor/editor-shell/editor-shell.css +6 -0
- package/editor/editor-shell/editor-shell.js +56 -0
- package/editor/editor-shell/editor-shell.yaml +59 -0
- package/editor/index.js +1 -0
- package/index.js +14 -0
- package/package.json +48 -0
- package/runtime/a2ui-root/a2ui-root.a2ui.json +125 -0
- package/runtime/a2ui-root/a2ui-root.js +191 -0
- package/runtime/a2ui-root/a2ui-root.yaml +87 -0
- package/runtime/gen-root/gen-root.a2ui.json +72 -0
- package/runtime/gen-root/gen-root.css +83 -0
- package/runtime/gen-root/gen-root.js +136 -0
- package/runtime/gen-root/gen-root.yaml +43 -0
- package/runtime/index.js +2 -0
- package/shell/admin-shell/admin-shell.a2ui.json +129 -0
- package/shell/admin-shell/admin-shell.css +14 -0
- package/shell/admin-shell/admin-shell.js +261 -0
- package/shell/admin-shell/admin-shell.yaml +89 -0
- package/shell/admin-shell/css/admin-shell.collapsed.css +86 -0
- package/shell/admin-shell/css/admin-shell.helpers.css +42 -0
- package/shell/admin-shell/css/admin-shell.main.css +182 -0
- package/shell/admin-shell/css/admin-shell.shell.css +48 -0
- package/shell/admin-shell/css/admin-shell.sidebar.css +165 -0
- package/shell/admin-shell/css/admin-shell.templates.css +215 -0
- package/shell/admin-shell/css/admin-shell.tokens.css +119 -0
- package/shell/index.js +1 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/* ═══════════════════════════════════════════════════════════════
|
|
2
|
+
chat-shell — Design tokens
|
|
3
|
+
═══════════════════════════════════════════════════════════════ */
|
|
4
|
+
|
|
5
|
+
:where(chat-shell) {
|
|
6
|
+
/* Layout */
|
|
7
|
+
--chat-bg: var(--a-canvas-0);
|
|
8
|
+
--chat-border: unset;
|
|
9
|
+
--chat-radius: unset;
|
|
10
|
+
|
|
11
|
+
/* Header */
|
|
12
|
+
--chat-header-height: var(--a-chrome-app-header-height);
|
|
13
|
+
--chat-header-px: var(--a-space-4);
|
|
14
|
+
--chat-header-gap: var(--a-space-2);
|
|
15
|
+
--chat-header-border: 1px solid var(--a-border-subtle);
|
|
16
|
+
|
|
17
|
+
/* Messages area */
|
|
18
|
+
--chat-messages-px: var(--a-space-4);
|
|
19
|
+
--chat-messages-py: var(--a-space-4);
|
|
20
|
+
--chat-messages-gap: var(--a-space-3);
|
|
21
|
+
--chat-message-max-width: 85%;
|
|
22
|
+
|
|
23
|
+
/* User bubble */
|
|
24
|
+
--chat-user-bg: var(--a-primary);
|
|
25
|
+
--chat-user-fg: var(--a-primary-fg);
|
|
26
|
+
--chat-user-radius: var(--a-radius-md);
|
|
27
|
+
--chat-user-tail-radius: var(--a-radius-sm);
|
|
28
|
+
--chat-user-px: var(--a-space-3);
|
|
29
|
+
--chat-user-py: var(--a-space-1);
|
|
30
|
+
|
|
31
|
+
/* Assistant bubble */
|
|
32
|
+
--chat-assistant-bg: var(--a-canvas-2);
|
|
33
|
+
--chat-assistant-fg: var(--a-fg);
|
|
34
|
+
--chat-assistant-radius: var(--a-radius-lg);
|
|
35
|
+
--chat-assistant-tail-radius: var(--a-radius-sm);
|
|
36
|
+
--chat-assistant-px: var(--a-space-3);
|
|
37
|
+
--chat-assistant-py: var(--a-space-1);
|
|
38
|
+
|
|
39
|
+
/* Avatar */
|
|
40
|
+
--chat-avatar-size: 1.75rem;
|
|
41
|
+
--chat-avatar-bg: var(--chat-assistant-bg);
|
|
42
|
+
--chat-avatar-fg: var(--chat-assistant-fg);
|
|
43
|
+
--chat-avatar-font: var(--a-ui-sm);
|
|
44
|
+
--chat-avatar-weight: var(--a-weight-semibold);
|
|
45
|
+
|
|
46
|
+
/* Streaming cursor */
|
|
47
|
+
--chat-cursor-width: 2px;
|
|
48
|
+
--chat-cursor-color: currentColor;
|
|
49
|
+
--chat-cursor-speed: 0.8s;
|
|
50
|
+
|
|
51
|
+
/* Footer / input area */
|
|
52
|
+
--chat-footer-px: var(--a-space-3);
|
|
53
|
+
--chat-footer-py: var(--a-space-3);
|
|
54
|
+
|
|
55
|
+
/* Message actions */
|
|
56
|
+
--chat-actions-gap: var(--a-space-1);
|
|
57
|
+
|
|
58
|
+
/* Code blocks inside messages */
|
|
59
|
+
--chat-code-bg: var(--a-canvas-2);
|
|
60
|
+
--chat-code-radius: var(--a-radius-md);
|
|
61
|
+
|
|
62
|
+
/* Typography */
|
|
63
|
+
--chat-font-size: var(--a-ui-size);
|
|
64
|
+
--chat-line-height: var(--a-leading-normal);
|
|
65
|
+
--chat-weight-semibold: var(--a-weight-semibold);
|
|
66
|
+
|
|
67
|
+
/* Header typography */
|
|
68
|
+
--chat-header-name-font: var(--a-ui-lg);
|
|
69
|
+
--chat-header-status-font: var(--a-ui-md);
|
|
70
|
+
--chat-header-status-fg: var(--a-fg-muted);
|
|
71
|
+
|
|
72
|
+
/* Error */
|
|
73
|
+
--chat-error-gap: var(--a-space-2);
|
|
74
|
+
--chat-error-fg: var(--a-danger-strong);
|
|
75
|
+
--chat-error-font: var(--a-ui-sm);
|
|
76
|
+
|
|
77
|
+
/* Message actions */
|
|
78
|
+
--chat-actions-duration: var(--a-duration-fast);
|
|
79
|
+
--chat-actions-easing: var(--a-easing);
|
|
80
|
+
|
|
81
|
+
/* Avatar */
|
|
82
|
+
--chat-avatar-radius: var(--a-radius-full);
|
|
83
|
+
|
|
84
|
+
/* Streaming — thinking */
|
|
85
|
+
--chat-thinking-fg: var(--a-fg-muted);
|
|
86
|
+
|
|
87
|
+
/* Markdown — inline code */
|
|
88
|
+
--chat-code-inline-radius: var(--a-radius-sm);
|
|
89
|
+
--chat-code-inline-family: var(--a-font-family-code);
|
|
90
|
+
|
|
91
|
+
/* Markdown — pre blocks */
|
|
92
|
+
--chat-code-block-px: var(--a-space-3);
|
|
93
|
+
--chat-code-block-my: var(--a-space-2);
|
|
94
|
+
--chat-code-block-font: var(--a-ui-sm);
|
|
95
|
+
}
|
package/chat/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ChatShell } from './chat-shell/chat-shell.js';
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/* ═══════════════════════════════════════════════════════════════
|
|
2
|
+
editor-shell — Layout
|
|
3
|
+
|
|
4
|
+
Structure:
|
|
5
|
+
editor-shell
|
|
6
|
+
header — topbar
|
|
7
|
+
[data-editor-body] — flex row: pane | canvas | pane
|
|
8
|
+
pane-ui — left navigator
|
|
9
|
+
[data-canvas] — center canvas
|
|
10
|
+
pane-ui — right inspector
|
|
11
|
+
footer — bottombar
|
|
12
|
+
═══════════════════════════════════════════════════════════════ */
|
|
13
|
+
|
|
14
|
+
editor-shell {
|
|
15
|
+
box-sizing: border-box;
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
height: 100%;
|
|
19
|
+
overflow: hidden;
|
|
20
|
+
background: var(--editor-bg);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/* ── Top bar ──
|
|
24
|
+
Slot contract (shared with > footer below):
|
|
25
|
+
[slot="icon"] leading glyph (status dot, app icon, etc.)
|
|
26
|
+
[slot="heading"] primary label; strong-weight token
|
|
27
|
+
[slot="description"] secondary metadata; muted
|
|
28
|
+
[slot="action"] trailing control cluster; first pushes to end
|
|
29
|
+
Authors may also place raw inline content (spans, buttons) directly
|
|
30
|
+
— those flow in source order. `[data-title]` / `<span data-spacer>`
|
|
31
|
+
are kept working for one release as deprecated hooks; migrate to
|
|
32
|
+
slots. */
|
|
33
|
+
editor-shell > header {
|
|
34
|
+
display: flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
gap: var(--editor-bar-gap);
|
|
37
|
+
min-height: var(--editor-bar-height);
|
|
38
|
+
padding: 0 var(--editor-bar-px);
|
|
39
|
+
border-bottom: var(--editor-border);
|
|
40
|
+
font-size: var(--editor-bar-font);
|
|
41
|
+
color: var(--editor-bar-fg);
|
|
42
|
+
flex-shrink: 0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
editor-shell > header [data-title],
|
|
46
|
+
editor-shell > header > [slot="heading"] {
|
|
47
|
+
font-weight: var(--editor-title-weight);
|
|
48
|
+
color: var(--editor-bar-fg-strong);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
editor-shell > header > [slot="icon"] {
|
|
52
|
+
display: flex;
|
|
53
|
+
align-items: center;
|
|
54
|
+
flex-shrink: 0;
|
|
55
|
+
color: var(--editor-bar-fg);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
editor-shell > header > [slot="description"] {
|
|
59
|
+
color: var(--editor-bar-fg);
|
|
60
|
+
font-size: var(--a-ui-sm);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
editor-shell > header > [slot="action"] {
|
|
64
|
+
display: flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
gap: var(--editor-bar-gap);
|
|
67
|
+
flex-shrink: 0;
|
|
68
|
+
margin-inline-start: auto;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
editor-shell > header > [slot="action"] ~ [slot="action"] {
|
|
72
|
+
margin-inline-start: 0;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* Dual-cluster: leading group on inline-start, trailing cluster on inline-end. */
|
|
76
|
+
editor-shell > header > [slot="action-leading"] {
|
|
77
|
+
display: flex;
|
|
78
|
+
align-items: center;
|
|
79
|
+
gap: var(--editor-bar-gap);
|
|
80
|
+
flex-shrink: 0;
|
|
81
|
+
margin-inline-end: auto;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/* ── Body: pane | canvas | pane ── */
|
|
85
|
+
editor-shell > [data-editor-body] {
|
|
86
|
+
display: flex;
|
|
87
|
+
flex: 1;
|
|
88
|
+
min-width: 0;
|
|
89
|
+
min-height: 0;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/* ── Canvas ── */
|
|
93
|
+
editor-shell [data-canvas] {
|
|
94
|
+
flex: 1;
|
|
95
|
+
min-width: 0;
|
|
96
|
+
display: flex;
|
|
97
|
+
align-items: center;
|
|
98
|
+
justify-content: center;
|
|
99
|
+
background: var(--editor-canvas-bg);
|
|
100
|
+
color: var(--editor-canvas-fg);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/* ── Panes ── */
|
|
104
|
+
editor-shell pane-ui {
|
|
105
|
+
--pane-radius: 0;
|
|
106
|
+
height: 100%;
|
|
107
|
+
flex-shrink: 0;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
editor-shell pane-ui[data-left] {
|
|
111
|
+
width: var(--editor-pane-width-left);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
editor-shell pane-ui[data-right] {
|
|
115
|
+
width: var(--editor-pane-width-right);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/* ── Bottom bar ──
|
|
119
|
+
Same slot contract as > header above (icon / heading / description
|
|
120
|
+
/ action). Statusbar is structurally identical to the topbar —
|
|
121
|
+
both are 36px-min chrome bands with left-aligned label content and
|
|
122
|
+
a trailing action cluster. */
|
|
123
|
+
editor-shell > footer {
|
|
124
|
+
display: flex;
|
|
125
|
+
align-items: center;
|
|
126
|
+
gap: var(--editor-bar-gap);
|
|
127
|
+
min-height: var(--editor-bar-height);
|
|
128
|
+
padding: 0 var(--editor-bar-px);
|
|
129
|
+
border-top: var(--editor-border);
|
|
130
|
+
font-size: var(--editor-bar-font);
|
|
131
|
+
color: var(--editor-bar-fg);
|
|
132
|
+
flex-shrink: 0;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
editor-shell > footer > [slot="heading"] {
|
|
136
|
+
font-weight: var(--editor-title-weight);
|
|
137
|
+
color: var(--editor-bar-fg-strong);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
editor-shell > footer > [slot="icon"] {
|
|
141
|
+
display: flex;
|
|
142
|
+
align-items: center;
|
|
143
|
+
flex-shrink: 0;
|
|
144
|
+
color: var(--editor-bar-fg);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
editor-shell > footer > [slot="description"] {
|
|
148
|
+
color: var(--editor-bar-fg);
|
|
149
|
+
font-size: var(--a-ui-sm);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
editor-shell > footer > [slot="action"] {
|
|
153
|
+
display: flex;
|
|
154
|
+
align-items: center;
|
|
155
|
+
gap: var(--editor-bar-gap);
|
|
156
|
+
flex-shrink: 0;
|
|
157
|
+
margin-inline-start: auto;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
editor-shell > footer > [slot="action"] ~ [slot="action"] {
|
|
161
|
+
margin-inline-start: 0;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/* Dual-cluster: leading group on inline-start, trailing cluster on inline-end. */
|
|
165
|
+
editor-shell > footer > [slot="action-leading"] {
|
|
166
|
+
display: flex;
|
|
167
|
+
align-items: center;
|
|
168
|
+
gap: var(--editor-bar-gap);
|
|
169
|
+
flex-shrink: 0;
|
|
170
|
+
margin-inline-end: auto;
|
|
171
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/* ═══════════════════════════════════════════════════════════════
|
|
2
|
+
editor-shell — Design tokens
|
|
3
|
+
═══════════════════════════════════════════════════════════════ */
|
|
4
|
+
|
|
5
|
+
:where(editor-shell) {
|
|
6
|
+
/* Shell */
|
|
7
|
+
--editor-bg: var(--a-canvas-0);
|
|
8
|
+
--editor-border: 1px solid var(--a-border-subtle);
|
|
9
|
+
|
|
10
|
+
/* Top/bottom bars */
|
|
11
|
+
--editor-bar-height: var(--a-chrome-pane-header-height);
|
|
12
|
+
--editor-bar-px: var(--a-space-3);
|
|
13
|
+
--editor-bar-gap: var(--a-space-2);
|
|
14
|
+
--editor-bar-font: var(--a-ui-size);
|
|
15
|
+
--editor-bar-fg: var(--a-fg-subtle);
|
|
16
|
+
--editor-bar-fg-strong: var(--a-fg);
|
|
17
|
+
|
|
18
|
+
/* Canvas */
|
|
19
|
+
--editor-canvas-bg: var(--a-bg);
|
|
20
|
+
--editor-canvas-fg: var(--a-fg-muted);
|
|
21
|
+
|
|
22
|
+
/* Typography */
|
|
23
|
+
--editor-title-weight: var(--a-weight-medium);
|
|
24
|
+
|
|
25
|
+
/* Panes */
|
|
26
|
+
--editor-pane-width-left: 240px;
|
|
27
|
+
--editor-pane-width-right: 280px;
|
|
28
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://adiaui.dev/a2ui/v0_9/components/EditorShell.json",
|
|
4
|
+
"title": "EditorShell",
|
|
5
|
+
"description": "Behavior-only editor shell module for design-tool layouts. Author\nprovides the structural DOM — header (topbar), [data-editor-body] with\npane-ui children ([data-left], [data-right]), [data-canvas] for the\ncentral surface, and a footer (statusbar). editor-shell wires\nselect-ui[data-options] for JSON-parsed option lists.\n",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"allOf": [
|
|
8
|
+
{
|
|
9
|
+
"$ref": "common_types.json#/$defs/ComponentCommon"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"$ref": "common_types.json#/$defs/CatalogComponentCommon"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"properties": {
|
|
16
|
+
"component": {
|
|
17
|
+
"const": "EditorShell"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"required": [
|
|
21
|
+
"component"
|
|
22
|
+
],
|
|
23
|
+
"unevaluatedProperties": false,
|
|
24
|
+
"x-adiaui": {
|
|
25
|
+
"anti_patterns": [],
|
|
26
|
+
"category": "container",
|
|
27
|
+
"events": {},
|
|
28
|
+
"examples": [],
|
|
29
|
+
"keywords": [
|
|
30
|
+
"editor-shell",
|
|
31
|
+
"editor",
|
|
32
|
+
"design-tool",
|
|
33
|
+
"canvas-shell"
|
|
34
|
+
],
|
|
35
|
+
"name": "EditorShell",
|
|
36
|
+
"related": [
|
|
37
|
+
"Pane",
|
|
38
|
+
"Select",
|
|
39
|
+
"Toolbar"
|
|
40
|
+
],
|
|
41
|
+
"slots": {
|
|
42
|
+
"description": {
|
|
43
|
+
"description": "Secondary metadata inside <header> or <footer> — document name, artboard size, zoom level, etc. Muted color, --a-ui-sm size."
|
|
44
|
+
},
|
|
45
|
+
"default": {
|
|
46
|
+
"description": "Author provides header, [data-editor-body] wrapping pane-ui[data-left], [data-canvas], pane-ui[data-right], and an optional footer."
|
|
47
|
+
},
|
|
48
|
+
"action": {
|
|
49
|
+
"description": "Trailing control cluster inside <header> or <footer>. The first [slot=\"action\"] child pushes itself (and siblings) to the end of the bar; subsequent [slot=\"action\"] siblings flow with gap."
|
|
50
|
+
},
|
|
51
|
+
"action-leading": {
|
|
52
|
+
"description": "Leading (inline-start) control cluster inside <header> or <footer>. Pairs with [slot=\"action\"] to produce a dual-cluster bar with space-between alignment (e.g. Back ↔ Cancel/Next, Discard ↔ Publish). Replaces the legacy <span data-spacer> hack."
|
|
53
|
+
},
|
|
54
|
+
"heading": {
|
|
55
|
+
"description": "Primary label inside <header> or <footer>. Rendered with --editor-title-weight + the strong foreground token."
|
|
56
|
+
},
|
|
57
|
+
"icon": {
|
|
58
|
+
"description": "Leading glyph inside <header> or <footer> — status dot, app icon, zoom badge, etc. Muted color, size-aware."
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"states": [
|
|
62
|
+
{
|
|
63
|
+
"description": "Default.",
|
|
64
|
+
"name": "idle"
|
|
65
|
+
}
|
|
66
|
+
],
|
|
67
|
+
"synonyms": {},
|
|
68
|
+
"tag": "editor-shell",
|
|
69
|
+
"tokens": {},
|
|
70
|
+
"traits": [],
|
|
71
|
+
"version": 1
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/* ═══════════════════════════════════════════════════════════════
|
|
2
|
+
editor-shell — Module CSS (editor layout shell)
|
|
3
|
+
═══════════════════════════════════════════════════════════════ */
|
|
4
|
+
|
|
5
|
+
@import "./css/editor-shell.tokens.css";
|
|
6
|
+
@import "./css/editor-shell.layout.css";
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { UIElement } from '../../../web-components/core/element.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* <editor-shell> — Editor layout pattern.
|
|
5
|
+
*
|
|
6
|
+
* Behavior-only orchestrator for design tool UIs:
|
|
7
|
+
* topbar, navigator pane, center canvas, inspector pane, bottombar.
|
|
8
|
+
*
|
|
9
|
+
* Structure:
|
|
10
|
+
* <editor-shell>
|
|
11
|
+
* <header>
|
|
12
|
+
* <span data-title>Editor</span>
|
|
13
|
+
* <span data-spacer></span>
|
|
14
|
+
* <button-ui icon="gear" variant="ghost" size="sm"></button-ui>
|
|
15
|
+
* </header>
|
|
16
|
+
* <div data-editor-body>
|
|
17
|
+
* <pane-ui data-left resizable>
|
|
18
|
+
* <header>Navigator</header>
|
|
19
|
+
* <section>...tree, layers...</section>
|
|
20
|
+
* </pane-ui>
|
|
21
|
+
* <div data-canvas>
|
|
22
|
+
* ...canvas content...
|
|
23
|
+
* </div>
|
|
24
|
+
* <pane-ui data-right resizable>
|
|
25
|
+
* <header>Inspector</header>
|
|
26
|
+
* <section>...form fields...</section>
|
|
27
|
+
* <footer>...actions...</footer>
|
|
28
|
+
* </pane-ui>
|
|
29
|
+
* </div>
|
|
30
|
+
* <footer>
|
|
31
|
+
* <span>Ready</span>
|
|
32
|
+
* <span data-spacer></span>
|
|
33
|
+
* <span>100%</span>
|
|
34
|
+
* </footer>
|
|
35
|
+
* </editor-shell>
|
|
36
|
+
*/
|
|
37
|
+
class EditorShell extends UIElement {
|
|
38
|
+
static template = () => null;
|
|
39
|
+
|
|
40
|
+
connected() {
|
|
41
|
+
// Wire select options if present
|
|
42
|
+
this.#wireSelects();
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
#wireSelects() {
|
|
46
|
+
for (const sel of this.querySelectorAll('select-ui[data-options]')) {
|
|
47
|
+
try {
|
|
48
|
+
const opts = JSON.parse(sel.getAttribute('data-options'));
|
|
49
|
+
sel.options = opts;
|
|
50
|
+
} catch { /* skip invalid */ }
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
customElements.define('editor-shell', EditorShell);
|
|
56
|
+
export { EditorShell };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
$schema: ../../../../scripts/schemas/component.yaml.schema.json
|
|
2
|
+
name: EditorShell
|
|
3
|
+
tag: editor-shell
|
|
4
|
+
component: EditorShell
|
|
5
|
+
category: container
|
|
6
|
+
version: 1
|
|
7
|
+
description: |
|
|
8
|
+
Behavior-only editor shell module for design-tool layouts. Author
|
|
9
|
+
provides the structural DOM — header (topbar), [data-editor-body] with
|
|
10
|
+
pane-ui children ([data-left], [data-right]), [data-canvas] for the
|
|
11
|
+
central surface, and a footer (statusbar). editor-shell wires
|
|
12
|
+
select-ui[data-options] for JSON-parsed option lists.
|
|
13
|
+
|
|
14
|
+
props: {} # Pure wrapper — no own props.
|
|
15
|
+
|
|
16
|
+
events: {} # Child interactions bubble through.
|
|
17
|
+
|
|
18
|
+
slots:
|
|
19
|
+
default:
|
|
20
|
+
description: >-
|
|
21
|
+
Author provides header, [data-editor-body] wrapping pane-ui[data-left],
|
|
22
|
+
[data-canvas], pane-ui[data-right], and an optional footer.
|
|
23
|
+
icon:
|
|
24
|
+
description: >-
|
|
25
|
+
Leading glyph inside <header> or <footer> — status dot, app icon,
|
|
26
|
+
zoom badge, etc. Muted color, size-aware.
|
|
27
|
+
heading:
|
|
28
|
+
description: >-
|
|
29
|
+
Primary label inside <header> or <footer>. Rendered with
|
|
30
|
+
--editor-title-weight + the strong foreground token.
|
|
31
|
+
description:
|
|
32
|
+
description: >-
|
|
33
|
+
Secondary metadata inside <header> or <footer> — document name,
|
|
34
|
+
artboard size, zoom level, etc. Muted color, --a-ui-sm size.
|
|
35
|
+
action:
|
|
36
|
+
description: >-
|
|
37
|
+
Trailing control cluster inside <header> or <footer>. The first
|
|
38
|
+
[slot="action"] child pushes itself (and siblings) to the end of
|
|
39
|
+
the bar; subsequent [slot="action"] siblings flow with gap.
|
|
40
|
+
action-leading:
|
|
41
|
+
description: >-
|
|
42
|
+
Leading (inline-start) control cluster inside <header> or <footer>.
|
|
43
|
+
Pairs with [slot="action"] to produce a dual-cluster bar with
|
|
44
|
+
space-between alignment (e.g. Back ↔ Cancel/Next, Discard ↔
|
|
45
|
+
Publish). Replaces the legacy <span data-spacer> hack.
|
|
46
|
+
|
|
47
|
+
states:
|
|
48
|
+
- name: idle
|
|
49
|
+
description: Default.
|
|
50
|
+
|
|
51
|
+
traits: []
|
|
52
|
+
|
|
53
|
+
a2ui:
|
|
54
|
+
rules:
|
|
55
|
+
- editor-shell is a layout skeleton. Children must follow the documented
|
|
56
|
+
structural DOM; the element wires behavior, not content.
|
|
57
|
+
|
|
58
|
+
keywords: [editor-shell, editor, design-tool, canvas-shell]
|
|
59
|
+
related: [Pane, Select, Toolbar]
|
package/editor/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { EditorShell } from './editor-shell/editor-shell.js';
|
package/index.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Barrel re-export — `import '@adia-ai/web-modules'` registers every
|
|
2
|
+
// cluster's elements. Consumers wanting a single cluster should
|
|
3
|
+
// import the cluster subpath instead, e.g.:
|
|
4
|
+
//
|
|
5
|
+
// import '@adia-ai/web-modules/shell';
|
|
6
|
+
// import '@adia-ai/web-modules/chat';
|
|
7
|
+
//
|
|
8
|
+
// Cluster organization is captured in
|
|
9
|
+
// /.brain/adrs/0012-three-tier-architecture-modules.md.
|
|
10
|
+
|
|
11
|
+
export * from './shell/index.js';
|
|
12
|
+
export * from './chat/index.js';
|
|
13
|
+
export * from './editor/index.js';
|
|
14
|
+
export * from './runtime/index.js';
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@adia-ai/web-modules",
|
|
3
|
+
"version": "0.0.4",
|
|
4
|
+
"description": "AdiaUI composite custom elements — shell, chat, editor, runtime clusters built from @adia-ai/web-components primitives. Subpath exports per cluster.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": "./index.js",
|
|
8
|
+
"./shell": "./shell/index.js",
|
|
9
|
+
"./shell/*": "./shell/*/*.js",
|
|
10
|
+
"./chat": "./chat/index.js",
|
|
11
|
+
"./chat/*": "./chat/*/*.js",
|
|
12
|
+
"./editor": "./editor/index.js",
|
|
13
|
+
"./editor/*": "./editor/*/*.js",
|
|
14
|
+
"./runtime": "./runtime/index.js",
|
|
15
|
+
"./runtime/*": "./runtime/*/*.js",
|
|
16
|
+
"./package.json": "./package.json"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"shell/",
|
|
20
|
+
"chat/",
|
|
21
|
+
"editor/",
|
|
22
|
+
"runtime/",
|
|
23
|
+
"index.js",
|
|
24
|
+
"README.md",
|
|
25
|
+
"CHANGELOG.md"
|
|
26
|
+
],
|
|
27
|
+
"sideEffects": [
|
|
28
|
+
"*.css",
|
|
29
|
+
"./index.js",
|
|
30
|
+
"./shell/**/*.js",
|
|
31
|
+
"./chat/**/*.js",
|
|
32
|
+
"./editor/**/*.js",
|
|
33
|
+
"./runtime/**/*.js"
|
|
34
|
+
],
|
|
35
|
+
"peerDependencies": {
|
|
36
|
+
"@adia-ai/web-components": ">=0.0.33",
|
|
37
|
+
"@adia-ai/a2ui-utils": "^0.0.2"
|
|
38
|
+
},
|
|
39
|
+
"publishConfig": {
|
|
40
|
+
"access": "public",
|
|
41
|
+
"registry": "https://registry.npmjs.org"
|
|
42
|
+
},
|
|
43
|
+
"repository": {
|
|
44
|
+
"type": "git",
|
|
45
|
+
"url": "git+https://github.com/adiahealth/gen-ui-kit.git",
|
|
46
|
+
"directory": "packages/web-modules"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://adiaui.dev/a2ui/v0_9/components/A2UIRoot.json",
|
|
4
|
+
"title": "A2UIRoot",
|
|
5
|
+
"description": "A2UI protocol surface. Connects to a stream source (SSE, WebSocket, JSONL, MCP) and renders A2UI messages as AdiaUI components via the `@adia-ai/a2ui-utils` renderer.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"allOf": [
|
|
8
|
+
{
|
|
9
|
+
"$ref": "common_types.json#/$defs/ComponentCommon"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"$ref": "common_types.json#/$defs/CatalogComponentCommon"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"properties": {
|
|
16
|
+
"active": {
|
|
17
|
+
"description": "True while the stream is connected and receiving messages.",
|
|
18
|
+
"type": "boolean",
|
|
19
|
+
"default": false
|
|
20
|
+
},
|
|
21
|
+
"batch": {
|
|
22
|
+
"description": "Batch renderer updates via requestAnimationFrame for large fan-in.",
|
|
23
|
+
"type": "boolean",
|
|
24
|
+
"default": false
|
|
25
|
+
},
|
|
26
|
+
"component": {
|
|
27
|
+
"const": "A2UIRoot"
|
|
28
|
+
},
|
|
29
|
+
"doc": {
|
|
30
|
+
"description": "Author-driven mode — set to an array of A2UI messages and the renderer resets + replays them. No network/transport involvement. Setting to a new array triggers a full re-render. Use this for editors, previews, tests, and any static-doc authoring loop. When both `src` and `doc` are set, `doc` wins (the stream is not opened). Pass as a JS property; not reflected to an attribute.",
|
|
31
|
+
"type": "array"
|
|
32
|
+
},
|
|
33
|
+
"loading": {
|
|
34
|
+
"description": "True while the stream is connecting.",
|
|
35
|
+
"type": "boolean",
|
|
36
|
+
"default": false
|
|
37
|
+
},
|
|
38
|
+
"src": {
|
|
39
|
+
"description": "Stream source URL (endpoint for SSE/WebSocket, file path for JSONL, tool-call target for MCP).",
|
|
40
|
+
"type": "string",
|
|
41
|
+
"default": ""
|
|
42
|
+
},
|
|
43
|
+
"transport": {
|
|
44
|
+
"description": "Stream transport to use.",
|
|
45
|
+
"type": "string",
|
|
46
|
+
"enum": [
|
|
47
|
+
"sse",
|
|
48
|
+
"ws",
|
|
49
|
+
"websocket",
|
|
50
|
+
"jsonl",
|
|
51
|
+
"mcp"
|
|
52
|
+
],
|
|
53
|
+
"default": "sse"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"required": [
|
|
57
|
+
"component"
|
|
58
|
+
],
|
|
59
|
+
"unevaluatedProperties": false,
|
|
60
|
+
"x-adiaui": {
|
|
61
|
+
"anti_patterns": [],
|
|
62
|
+
"category": "container",
|
|
63
|
+
"events": {
|
|
64
|
+
"a2ui-action": {
|
|
65
|
+
"description": "Fired when a child element with [data-action] is clicked. detail: { name, sourceComponentId, context }"
|
|
66
|
+
},
|
|
67
|
+
"a2ui-closed": {
|
|
68
|
+
"description": "Fired when the stream ends."
|
|
69
|
+
},
|
|
70
|
+
"a2ui-connected": {
|
|
71
|
+
"description": "Fired when the stream is established."
|
|
72
|
+
},
|
|
73
|
+
"a2ui-error": {
|
|
74
|
+
"description": "Fired when the stream errors. detail: { error }"
|
|
75
|
+
},
|
|
76
|
+
"a2ui-message": {
|
|
77
|
+
"description": "Fired for each A2UI message received. detail: { message }"
|
|
78
|
+
},
|
|
79
|
+
"doc-replaced": {
|
|
80
|
+
"description": "Fired after a full doc reset + replay in author-driven mode. detail: { count }"
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"examples": [],
|
|
84
|
+
"keywords": [
|
|
85
|
+
"a2ui",
|
|
86
|
+
"protocol",
|
|
87
|
+
"renderer",
|
|
88
|
+
"stream",
|
|
89
|
+
"surface",
|
|
90
|
+
"sse",
|
|
91
|
+
"websocket",
|
|
92
|
+
"jsonl",
|
|
93
|
+
"mcp"
|
|
94
|
+
],
|
|
95
|
+
"name": "A2UIRoot",
|
|
96
|
+
"related": [
|
|
97
|
+
"canvas",
|
|
98
|
+
"inspector"
|
|
99
|
+
],
|
|
100
|
+
"slots": {
|
|
101
|
+
"default": {
|
|
102
|
+
"description": "The rendered surface. Children are stamped by the A2UI renderer."
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
"states": [
|
|
106
|
+
{
|
|
107
|
+
"description": "Default, ready to connect.",
|
|
108
|
+
"name": "idle"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"description": "Stream is connecting.",
|
|
112
|
+
"name": "loading"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"description": "Stream is connected and receiving messages.",
|
|
116
|
+
"name": "active"
|
|
117
|
+
}
|
|
118
|
+
],
|
|
119
|
+
"synonyms": {},
|
|
120
|
+
"tag": "a2ui-root",
|
|
121
|
+
"tokens": {},
|
|
122
|
+
"traits": [],
|
|
123
|
+
"version": 1
|
|
124
|
+
}
|
|
125
|
+
}
|