@workbench-kit/adapters 0.0.2-prototype.0.2.5 → 0.0.2-prototype.0.2.6

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.
@@ -1,328 +1,328 @@
1
- import type { WorkspaceFile } from '@workbench-kit/workspace';
2
-
3
- import {
4
- flattenWidgetStudioAssetPackages,
5
- WIDGET_STUDIO_ASSETS_DIR,
6
- WIDGET_STUDIO_CUSTOM_ASSETS_DIR,
7
- type WidgetStudioAssetPackageDefinition,
8
- } from './widget-studio-asset-package.js';
9
-
10
- export { WIDGET_STUDIO_ASSETS_DIR, WIDGET_STUDIO_CUSTOM_ASSETS_DIR };
11
-
12
- export type WidgetStudioWorkspaceAssetFile = WorkspaceFile;
13
-
14
- const TEXT_INPUTS_SCHEMA = {
15
- $schema: 'http://json-schema.org/draft-07/schema#',
16
- title: 'TextAssetInputs',
17
- type: 'object',
18
- properties: {
19
- text: { type: 'string' },
20
- fontSize: { type: 'number', minimum: 1 },
21
- color: { type: 'string' },
22
- },
23
- };
24
-
25
- const LAYOUT_INPUTS_SCHEMA = {
26
- $schema: 'http://json-schema.org/draft-07/schema#',
27
- title: 'LayoutAssetInputs',
28
- type: 'object',
29
- properties: {
30
- gap: { type: 'number', minimum: 0, default: 8 },
31
- padding: { type: 'number', minimum: 0, default: 0 },
32
- },
33
- };
34
-
35
- const builtinAssetPackages: WidgetStudioAssetPackageDefinition[] = [
36
- {
37
- slug: 'heading',
38
- updatedAt: '2026-06-02T09:24:00.000Z',
39
- manifest: {
40
- name: 'content.heading',
41
- version: '1.0.0',
42
- label: 'Heading',
43
- description: 'Large title text',
44
- category: 'content',
45
- kind: 'leaf',
46
- icon: 'codicon-symbol-text',
47
- },
48
- schema: TEXT_INPUTS_SCHEMA,
49
- content: {
50
- type: 'text',
51
- args: { text: 'Heading', fontSize: 24 },
52
- },
53
- },
54
- {
55
- slug: 'body',
56
- updatedAt: '2026-06-02T09:24:10.000Z',
57
- manifest: {
58
- name: 'content.body',
59
- version: '1.0.0',
60
- label: 'Body',
61
- description: 'Default paragraph text',
62
- category: 'content',
63
- kind: 'leaf',
64
- icon: 'codicon-whole-word',
65
- },
66
- schema: TEXT_INPUTS_SCHEMA,
67
- content: {
68
- type: 'text',
69
- args: { text: 'Body text' },
70
- },
71
- },
72
- {
73
- slug: 'label',
74
- updatedAt: '2026-06-02T09:24:12.000Z',
75
- manifest: {
76
- name: 'content.label',
77
- version: '1.0.0',
78
- label: 'Label',
79
- description: 'Small muted label',
80
- category: 'content',
81
- kind: 'leaf',
82
- icon: 'codicon-tag',
83
- },
84
- schema: TEXT_INPUTS_SCHEMA,
85
- content: {
86
- type: 'text',
87
- args: { text: 'Label', fontSize: 12, color: '#9aa0a6' },
88
- },
89
- },
90
- {
91
- slug: 'caption',
92
- updatedAt: '2026-06-02T09:24:14.000Z',
93
- manifest: {
94
- name: 'content.caption',
95
- version: '1.0.0',
96
- label: 'Caption',
97
- description: 'Secondary supporting text',
98
- category: 'content',
99
- kind: 'leaf',
100
- icon: 'codicon-info',
101
- },
102
- schema: TEXT_INPUTS_SCHEMA,
103
- content: {
104
- type: 'text',
105
- args: { text: 'Caption', fontSize: 11, color: '#7a7f87' },
106
- },
107
- },
108
- {
109
- slug: 'row',
110
- updatedAt: '2026-06-02T09:24:20.000Z',
111
- manifest: {
112
- name: 'layout.row',
113
- version: '1.0.0',
114
- label: 'Row',
115
- description: 'Horizontal flex container',
116
- category: 'layout',
117
- kind: 'container',
118
- icon: 'codicon-arrow-right',
119
- },
120
- schema: LAYOUT_INPUTS_SCHEMA,
121
- content: {
122
- type: 'row',
123
- args: { gap: 8, padding: 0, children: [] },
124
- },
125
- },
126
- {
127
- slug: 'column',
128
- updatedAt: '2026-06-02T09:24:22.000Z',
129
- manifest: {
130
- name: 'layout.column',
131
- version: '1.0.0',
132
- label: 'Column',
133
- description: 'Vertical flex container',
134
- category: 'layout',
135
- kind: 'container',
136
- icon: 'codicon-arrow-down',
137
- },
138
- schema: LAYOUT_INPUTS_SCHEMA,
139
- content: {
140
- type: 'column',
141
- args: { gap: 8, padding: 0, children: [] },
142
- },
143
- },
144
- {
145
- slug: 'grid-2',
146
- updatedAt: '2026-06-02T09:24:30.000Z',
147
- manifest: {
148
- name: 'layout.grid-2',
149
- version: '1.0.0',
150
- label: '2-col Grid',
151
- description: 'Two column grid',
152
- category: 'layout',
153
- kind: 'container',
154
- icon: 'codicon-layout',
155
- },
156
- schema: {
157
- ...LAYOUT_INPUTS_SCHEMA,
158
- properties: {
159
- ...LAYOUT_INPUTS_SCHEMA.properties,
160
- columns: { type: 'number', minimum: 1, default: 2 },
161
- },
162
- },
163
- content: {
164
- type: 'grid',
165
- args: { columns: 2, gap: 8, padding: 0, children: [] },
166
- },
167
- },
168
- {
169
- slug: 'grid-3',
170
- updatedAt: '2026-06-02T09:24:32.000Z',
171
- manifest: {
172
- name: 'layout.grid-3',
173
- version: '1.0.0',
174
- label: '3-col Grid',
175
- description: 'Three column grid',
176
- category: 'layout',
177
- kind: 'container',
178
- icon: 'codicon-layout',
179
- },
180
- schema: {
181
- ...LAYOUT_INPUTS_SCHEMA,
182
- properties: {
183
- ...LAYOUT_INPUTS_SCHEMA.properties,
184
- columns: { type: 'number', minimum: 1, default: 3 },
185
- },
186
- },
187
- content: {
188
- type: 'grid',
189
- args: { columns: 3, gap: 8, padding: 0, children: [] },
190
- },
191
- },
192
- {
193
- slug: 'media-card',
194
- updatedAt: '2026-06-02T09:24:36.000Z',
195
- manifest: {
196
- name: 'template.media-card',
197
- version: '1.0.0',
198
- label: 'Media Card',
199
- description: 'Image placeholder with title and caption',
200
- category: 'template',
201
- kind: 'template',
202
- icon: 'codicon-file-media',
203
- },
204
- schema: {
205
- $schema: 'http://json-schema.org/draft-07/schema#',
206
- title: 'MediaCardInputs',
207
- type: 'object',
208
- properties: {
209
- title: { type: 'string', default: 'Card title' },
210
- description: { type: 'string', default: 'Short description for the card.' },
211
- },
212
- },
213
- content: {
214
- type: 'column',
215
- args: {
216
- gap: 8,
217
- children: [
218
- {
219
- type: 'row',
220
- args: {
221
- gap: 0,
222
- children: [
223
- {
224
- type: 'expanded',
225
- args: {
226
- flex: 1,
227
- child: {
228
- type: 'text',
229
- args: { text: ' ', background: '#2b2f36' },
230
- },
231
- },
232
- },
233
- ],
234
- },
235
- },
236
- {
237
- type: 'text',
238
- args: { text: 'Card title', fontSize: 16 },
239
- },
240
- {
241
- type: 'text',
242
- args: {
243
- text: 'Short description for the card.',
244
- fontSize: 12,
245
- color: '#9aa0a6',
246
- },
247
- },
248
- ],
249
- },
250
- },
251
- },
252
- {
253
- slug: 'section-stack',
254
- updatedAt: '2026-06-02T09:24:40.000Z',
255
- manifest: {
256
- name: 'template.section-stack',
257
- version: '1.0.0',
258
- label: 'Section Stack',
259
- description: 'Title with supporting body copy',
260
- category: 'template',
261
- kind: 'template',
262
- icon: 'codicon-layers',
263
- },
264
- schema: {
265
- $schema: 'http://json-schema.org/draft-07/schema#',
266
- title: 'SectionStackInputs',
267
- type: 'object',
268
- properties: {
269
- title: { type: 'string', default: 'Section title' },
270
- body: { type: 'string', default: 'Supporting body copy.' },
271
- },
272
- },
273
- content: {
274
- type: 'column',
275
- args: {
276
- gap: 4,
277
- children: [
278
- { type: 'text', args: { text: 'Section title', fontSize: 18 } },
279
- { type: 'text', args: { text: 'Supporting body copy.' } },
280
- ],
281
- },
282
- },
283
- },
284
- ];
285
-
286
- const customAssetPackages: WidgetStudioAssetPackageDefinition[] = [
287
- {
288
- slug: 'feature-badge',
289
- baseDir: WIDGET_STUDIO_CUSTOM_ASSETS_DIR,
290
- updatedAt: '2026-06-02T09:25:00.000Z',
291
- manifest: {
292
- name: 'custom.feature-badge',
293
- version: '1.0.0',
294
- label: 'Feature Badge',
295
- description: 'Custom workspace asset example',
296
- category: 'content',
297
- kind: 'template',
298
- icon: 'codicon-verified',
299
- },
300
- schema: {
301
- $schema: 'http://json-schema.org/draft-07/schema#',
302
- title: 'FeatureBadgeInputs',
303
- type: 'object',
304
- properties: {
305
- label: { type: 'string', default: 'Feature enabled' },
306
- },
307
- },
308
- content: {
309
- type: 'row',
310
- args: {
311
- gap: 6,
312
- children: [
313
- { type: 'text', args: { text: '✓', fontSize: 12, color: '#34a853' } },
314
- { type: 'text', args: { text: 'Feature enabled', fontSize: 12 } },
315
- ],
316
- },
317
- },
318
- },
319
- ];
320
-
321
- export const widgetStudioBuiltinAssetFiles = flattenWidgetStudioAssetPackages(builtinAssetPackages);
322
- export const widgetStudioCustomAssetExampleFiles =
323
- flattenWidgetStudioAssetPackages(customAssetPackages);
324
-
325
- export const widgetStudioAssetPackageSlugs = [
326
- ...builtinAssetPackages.map((pkg) => pkg.slug),
327
- ...customAssetPackages.map((pkg) => `${pkg.baseDir?.split('/').pop()}/${pkg.slug}`),
328
- ];
1
+ import type { WorkspaceFile } from '@workbench-kit/workspace';
2
+
3
+ import {
4
+ flattenWidgetStudioAssetPackages,
5
+ WIDGET_STUDIO_ASSETS_DIR,
6
+ WIDGET_STUDIO_CUSTOM_ASSETS_DIR,
7
+ type WidgetStudioAssetPackageDefinition,
8
+ } from './widget-studio-asset-package.js';
9
+
10
+ export { WIDGET_STUDIO_ASSETS_DIR, WIDGET_STUDIO_CUSTOM_ASSETS_DIR };
11
+
12
+ export type WidgetStudioWorkspaceAssetFile = WorkspaceFile;
13
+
14
+ const TEXT_INPUTS_SCHEMA = {
15
+ $schema: 'http://json-schema.org/draft-07/schema#',
16
+ title: 'TextAssetInputs',
17
+ type: 'object',
18
+ properties: {
19
+ text: { type: 'string' },
20
+ fontSize: { type: 'number', minimum: 1 },
21
+ color: { type: 'string' },
22
+ },
23
+ };
24
+
25
+ const LAYOUT_INPUTS_SCHEMA = {
26
+ $schema: 'http://json-schema.org/draft-07/schema#',
27
+ title: 'LayoutAssetInputs',
28
+ type: 'object',
29
+ properties: {
30
+ gap: { type: 'number', minimum: 0, default: 8 },
31
+ padding: { type: 'number', minimum: 0, default: 0 },
32
+ },
33
+ };
34
+
35
+ const builtinAssetPackages: WidgetStudioAssetPackageDefinition[] = [
36
+ {
37
+ slug: 'heading',
38
+ updatedAt: '2026-06-02T09:24:00.000Z',
39
+ manifest: {
40
+ name: 'content.heading',
41
+ version: '1.0.0',
42
+ label: 'Heading',
43
+ description: 'Large title text',
44
+ category: 'content',
45
+ kind: 'leaf',
46
+ icon: 'codicon-symbol-text',
47
+ },
48
+ schema: TEXT_INPUTS_SCHEMA,
49
+ content: {
50
+ type: 'text',
51
+ args: { text: 'Heading', fontSize: 24 },
52
+ },
53
+ },
54
+ {
55
+ slug: 'body',
56
+ updatedAt: '2026-06-02T09:24:10.000Z',
57
+ manifest: {
58
+ name: 'content.body',
59
+ version: '1.0.0',
60
+ label: 'Body',
61
+ description: 'Default paragraph text',
62
+ category: 'content',
63
+ kind: 'leaf',
64
+ icon: 'codicon-whole-word',
65
+ },
66
+ schema: TEXT_INPUTS_SCHEMA,
67
+ content: {
68
+ type: 'text',
69
+ args: { text: 'Body text' },
70
+ },
71
+ },
72
+ {
73
+ slug: 'label',
74
+ updatedAt: '2026-06-02T09:24:12.000Z',
75
+ manifest: {
76
+ name: 'content.label',
77
+ version: '1.0.0',
78
+ label: 'Label',
79
+ description: 'Small muted label',
80
+ category: 'content',
81
+ kind: 'leaf',
82
+ icon: 'codicon-tag',
83
+ },
84
+ schema: TEXT_INPUTS_SCHEMA,
85
+ content: {
86
+ type: 'text',
87
+ args: { text: 'Label', fontSize: 12, color: '#9aa0a6' },
88
+ },
89
+ },
90
+ {
91
+ slug: 'caption',
92
+ updatedAt: '2026-06-02T09:24:14.000Z',
93
+ manifest: {
94
+ name: 'content.caption',
95
+ version: '1.0.0',
96
+ label: 'Caption',
97
+ description: 'Secondary supporting text',
98
+ category: 'content',
99
+ kind: 'leaf',
100
+ icon: 'codicon-info',
101
+ },
102
+ schema: TEXT_INPUTS_SCHEMA,
103
+ content: {
104
+ type: 'text',
105
+ args: { text: 'Caption', fontSize: 11, color: '#7a7f87' },
106
+ },
107
+ },
108
+ {
109
+ slug: 'row',
110
+ updatedAt: '2026-06-02T09:24:20.000Z',
111
+ manifest: {
112
+ name: 'layout.row',
113
+ version: '1.0.0',
114
+ label: 'Row',
115
+ description: 'Horizontal flex container',
116
+ category: 'layout',
117
+ kind: 'container',
118
+ icon: 'codicon-arrow-right',
119
+ },
120
+ schema: LAYOUT_INPUTS_SCHEMA,
121
+ content: {
122
+ type: 'row',
123
+ args: { gap: 8, padding: 0, children: [] },
124
+ },
125
+ },
126
+ {
127
+ slug: 'column',
128
+ updatedAt: '2026-06-02T09:24:22.000Z',
129
+ manifest: {
130
+ name: 'layout.column',
131
+ version: '1.0.0',
132
+ label: 'Column',
133
+ description: 'Vertical flex container',
134
+ category: 'layout',
135
+ kind: 'container',
136
+ icon: 'codicon-arrow-down',
137
+ },
138
+ schema: LAYOUT_INPUTS_SCHEMA,
139
+ content: {
140
+ type: 'column',
141
+ args: { gap: 8, padding: 0, children: [] },
142
+ },
143
+ },
144
+ {
145
+ slug: 'grid-2',
146
+ updatedAt: '2026-06-02T09:24:30.000Z',
147
+ manifest: {
148
+ name: 'layout.grid-2',
149
+ version: '1.0.0',
150
+ label: '2-col Grid',
151
+ description: 'Two column grid',
152
+ category: 'layout',
153
+ kind: 'container',
154
+ icon: 'codicon-layout',
155
+ },
156
+ schema: {
157
+ ...LAYOUT_INPUTS_SCHEMA,
158
+ properties: {
159
+ ...LAYOUT_INPUTS_SCHEMA.properties,
160
+ columns: { type: 'number', minimum: 1, default: 2 },
161
+ },
162
+ },
163
+ content: {
164
+ type: 'grid',
165
+ args: { columns: 2, gap: 8, padding: 0, children: [] },
166
+ },
167
+ },
168
+ {
169
+ slug: 'grid-3',
170
+ updatedAt: '2026-06-02T09:24:32.000Z',
171
+ manifest: {
172
+ name: 'layout.grid-3',
173
+ version: '1.0.0',
174
+ label: '3-col Grid',
175
+ description: 'Three column grid',
176
+ category: 'layout',
177
+ kind: 'container',
178
+ icon: 'codicon-layout',
179
+ },
180
+ schema: {
181
+ ...LAYOUT_INPUTS_SCHEMA,
182
+ properties: {
183
+ ...LAYOUT_INPUTS_SCHEMA.properties,
184
+ columns: { type: 'number', minimum: 1, default: 3 },
185
+ },
186
+ },
187
+ content: {
188
+ type: 'grid',
189
+ args: { columns: 3, gap: 8, padding: 0, children: [] },
190
+ },
191
+ },
192
+ {
193
+ slug: 'media-card',
194
+ updatedAt: '2026-06-02T09:24:36.000Z',
195
+ manifest: {
196
+ name: 'template.media-card',
197
+ version: '1.0.0',
198
+ label: 'Media Card',
199
+ description: 'Image placeholder with title and caption',
200
+ category: 'template',
201
+ kind: 'template',
202
+ icon: 'codicon-file-media',
203
+ },
204
+ schema: {
205
+ $schema: 'http://json-schema.org/draft-07/schema#',
206
+ title: 'MediaCardInputs',
207
+ type: 'object',
208
+ properties: {
209
+ title: { type: 'string', default: 'Card title' },
210
+ description: { type: 'string', default: 'Short description for the card.' },
211
+ },
212
+ },
213
+ content: {
214
+ type: 'column',
215
+ args: {
216
+ gap: 8,
217
+ children: [
218
+ {
219
+ type: 'row',
220
+ args: {
221
+ gap: 0,
222
+ children: [
223
+ {
224
+ type: 'expanded',
225
+ args: {
226
+ flex: 1,
227
+ child: {
228
+ type: 'text',
229
+ args: { text: ' ', background: '#2b2f36' },
230
+ },
231
+ },
232
+ },
233
+ ],
234
+ },
235
+ },
236
+ {
237
+ type: 'text',
238
+ args: { text: 'Card title', fontSize: 16 },
239
+ },
240
+ {
241
+ type: 'text',
242
+ args: {
243
+ text: 'Short description for the card.',
244
+ fontSize: 12,
245
+ color: '#9aa0a6',
246
+ },
247
+ },
248
+ ],
249
+ },
250
+ },
251
+ },
252
+ {
253
+ slug: 'section-stack',
254
+ updatedAt: '2026-06-02T09:24:40.000Z',
255
+ manifest: {
256
+ name: 'template.section-stack',
257
+ version: '1.0.0',
258
+ label: 'Section Stack',
259
+ description: 'Title with supporting body copy',
260
+ category: 'template',
261
+ kind: 'template',
262
+ icon: 'codicon-layers',
263
+ },
264
+ schema: {
265
+ $schema: 'http://json-schema.org/draft-07/schema#',
266
+ title: 'SectionStackInputs',
267
+ type: 'object',
268
+ properties: {
269
+ title: { type: 'string', default: 'Section title' },
270
+ body: { type: 'string', default: 'Supporting body copy.' },
271
+ },
272
+ },
273
+ content: {
274
+ type: 'column',
275
+ args: {
276
+ gap: 4,
277
+ children: [
278
+ { type: 'text', args: { text: 'Section title', fontSize: 18 } },
279
+ { type: 'text', args: { text: 'Supporting body copy.' } },
280
+ ],
281
+ },
282
+ },
283
+ },
284
+ ];
285
+
286
+ const customAssetPackages: WidgetStudioAssetPackageDefinition[] = [
287
+ {
288
+ slug: 'feature-badge',
289
+ baseDir: WIDGET_STUDIO_CUSTOM_ASSETS_DIR,
290
+ updatedAt: '2026-06-02T09:25:00.000Z',
291
+ manifest: {
292
+ name: 'custom.feature-badge',
293
+ version: '1.0.0',
294
+ label: 'Feature Badge',
295
+ description: 'Custom workspace asset example',
296
+ category: 'content',
297
+ kind: 'template',
298
+ icon: 'codicon-verified',
299
+ },
300
+ schema: {
301
+ $schema: 'http://json-schema.org/draft-07/schema#',
302
+ title: 'FeatureBadgeInputs',
303
+ type: 'object',
304
+ properties: {
305
+ label: { type: 'string', default: 'Feature enabled' },
306
+ },
307
+ },
308
+ content: {
309
+ type: 'row',
310
+ args: {
311
+ gap: 6,
312
+ children: [
313
+ { type: 'text', args: { text: '✓', fontSize: 12, color: '#34a853' } },
314
+ { type: 'text', args: { text: 'Feature enabled', fontSize: 12 } },
315
+ ],
316
+ },
317
+ },
318
+ },
319
+ ];
320
+
321
+ export const widgetStudioBuiltinAssetFiles = flattenWidgetStudioAssetPackages(builtinAssetPackages);
322
+ export const widgetStudioCustomAssetExampleFiles =
323
+ flattenWidgetStudioAssetPackages(customAssetPackages);
324
+
325
+ export const widgetStudioAssetPackageSlugs = [
326
+ ...builtinAssetPackages.map((pkg) => pkg.slug),
327
+ ...customAssetPackages.map((pkg) => `${pkg.baseDir?.split('/').pop()}/${pkg.slug}`),
328
+ ];