@loomweaver/devkit 0.7.2

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.
Files changed (100) hide show
  1. package/README.md +127 -0
  2. package/generators.json +41 -0
  3. package/package.json +38 -0
  4. package/src/generators/auth-source/generator.d.ts +4 -0
  5. package/src/generators/auth-source/generator.js +17 -0
  6. package/src/generators/auth-source/generator.js.map +1 -0
  7. package/src/generators/auth-source/schema.json +18 -0
  8. package/src/generators/distribution/generator.d.ts +4 -0
  9. package/src/generators/distribution/generator.js +61 -0
  10. package/src/generators/distribution/generator.js.map +1 -0
  11. package/src/generators/distribution/nx-files.d.ts +22 -0
  12. package/src/generators/distribution/nx-files.js +133 -0
  13. package/src/generators/distribution/nx-files.js.map +1 -0
  14. package/src/generators/distribution/schema.json +48 -0
  15. package/src/generators/frame-plugin/generator.d.ts +4 -0
  16. package/src/generators/frame-plugin/generator.js +20 -0
  17. package/src/generators/frame-plugin/generator.js.map +1 -0
  18. package/src/generators/frame-plugin/schema.json +22 -0
  19. package/src/generators/layout/generator.d.ts +4 -0
  20. package/src/generators/layout/generator.js +17 -0
  21. package/src/generators/layout/generator.js.map +1 -0
  22. package/src/generators/layout/schema.json +17 -0
  23. package/src/generators/nx-scaffold-shared.d.ts +32 -0
  24. package/src/generators/nx-scaffold-shared.js +87 -0
  25. package/src/generators/nx-scaffold-shared.js.map +1 -0
  26. package/src/generators/settings-store/generator.d.ts +4 -0
  27. package/src/generators/settings-store/generator.js +17 -0
  28. package/src/generators/settings-store/generator.js.map +1 -0
  29. package/src/generators/settings-store/schema.json +18 -0
  30. package/src/generators/shared.d.ts +47 -0
  31. package/src/generators/shared.js +152 -0
  32. package/src/generators/shared.js.map +1 -0
  33. package/src/generators/theme/generator.d.ts +4 -0
  34. package/src/generators/theme/generator.js +17 -0
  35. package/src/generators/theme/generator.js.map +1 -0
  36. package/src/generators/theme/schema.json +24 -0
  37. package/src/generators/weaver/generator.d.ts +4 -0
  38. package/src/generators/weaver/generator.js +75 -0
  39. package/src/generators/weaver/generator.js.map +1 -0
  40. package/src/generators/weaver/nx-files.d.ts +26 -0
  41. package/src/generators/weaver/nx-files.js +73 -0
  42. package/src/generators/weaver/nx-files.js.map +1 -0
  43. package/src/generators/weaver/schema.json +97 -0
  44. package/src/index.d.ts +15 -0
  45. package/src/index.js +47 -0
  46. package/src/index.js.map +1 -0
  47. package/src/lib/generate/casing.d.ts +4 -0
  48. package/src/lib/generate/casing.js +27 -0
  49. package/src/lib/generate/casing.js.map +1 -0
  50. package/src/lib/generate/generate.d.ts +2 -0
  51. package/src/lib/generate/generate.js +18 -0
  52. package/src/lib/generate/generate.js.map +1 -0
  53. package/src/lib/generate/types.d.ts +5 -0
  54. package/src/lib/generate/types.js +3 -0
  55. package/src/lib/generate/types.js.map +1 -0
  56. package/src/lib/scaffolds/scaffolds.d.ts +37 -0
  57. package/src/lib/scaffolds/scaffolds.js +357 -0
  58. package/src/lib/scaffolds/scaffolds.js.map +1 -0
  59. package/src/lib/validate/catalog.d.ts +15 -0
  60. package/src/lib/validate/catalog.js +247 -0
  61. package/src/lib/validate/catalog.js.map +1 -0
  62. package/src/lib/validate/i18n.d.ts +3 -0
  63. package/src/lib/validate/i18n.js +41 -0
  64. package/src/lib/validate/i18n.js.map +1 -0
  65. package/src/lib/validate/manifest.d.ts +8 -0
  66. package/src/lib/validate/manifest.js +74 -0
  67. package/src/lib/validate/manifest.js.map +1 -0
  68. package/src/lib/validate/types.d.ts +7 -0
  69. package/src/lib/validate/types.js +3 -0
  70. package/src/lib/validate/types.js.map +1 -0
  71. package/src/recipes/angular-distribution/logo.d.ts +1 -0
  72. package/src/recipes/angular-distribution/logo.js +9 -0
  73. package/src/recipes/angular-distribution/logo.js.map +1 -0
  74. package/src/recipes/angular-distribution/recipe.d.ts +25 -0
  75. package/src/recipes/angular-distribution/recipe.js +407 -0
  76. package/src/recipes/angular-distribution/recipe.js.map +1 -0
  77. package/src/recipes/angular-weaver/recipe.d.ts +48 -0
  78. package/src/recipes/angular-weaver/recipe.js +568 -0
  79. package/src/recipes/angular-weaver/recipe.js.map +1 -0
  80. package/src/recipes/angular-weaver/weaver-i18n.d.ts +3 -0
  81. package/src/recipes/angular-weaver/weaver-i18n.js +24 -0
  82. package/src/recipes/angular-weaver/weaver-i18n.js.map +1 -0
  83. package/src/recipes/auth-source/recipe.d.ts +11 -0
  84. package/src/recipes/auth-source/recipe.js +61 -0
  85. package/src/recipes/auth-source/recipe.js.map +1 -0
  86. package/src/recipes/frame-plugin/recipe.d.ts +11 -0
  87. package/src/recipes/frame-plugin/recipe.js +143 -0
  88. package/src/recipes/frame-plugin/recipe.js.map +1 -0
  89. package/src/recipes/layout/recipe.d.ts +10 -0
  90. package/src/recipes/layout/recipe.js +35 -0
  91. package/src/recipes/layout/recipe.js.map +1 -0
  92. package/src/recipes/settings-store/recipe.d.ts +10 -0
  93. package/src/recipes/settings-store/recipe.js +51 -0
  94. package/src/recipes/settings-store/recipe.js.map +1 -0
  95. package/src/recipes/shell-regions.d.ts +9 -0
  96. package/src/recipes/shell-regions.js +23 -0
  97. package/src/recipes/shell-regions.js.map +1 -0
  98. package/src/recipes/theme/recipe.d.ts +13 -0
  99. package/src/recipes/theme/recipe.js +142 -0
  100. package/src/recipes/theme/recipe.js.map +1 -0
@@ -0,0 +1,568 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.angularWeaver = void 0;
4
+ exports.resolveWeaverInput = resolveWeaverInput;
5
+ const casing_1 = require("../../lib/generate/casing");
6
+ const manifest_1 = require("../../lib/validate/manifest");
7
+ const weaver_i18n_1 = require("./weaver-i18n");
8
+ const DEFAULT_MENU_SLOT = 'content/tab/context';
9
+ const SURFACE_ICON = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true"><rect x="4" y="4" width="16" height="16" rx="3"/><path d="M8 9h8M8 13h8M8 17h5"/></svg>';
10
+ function accessLiteral(spec) {
11
+ if (spec === 'authenticated')
12
+ return '{ authenticated: true }';
13
+ if (spec === 'anonymous')
14
+ return '{ authenticated: false }';
15
+ if (spec.startsWith('role:')) {
16
+ const role = spec.slice('role:'.length);
17
+ if (!role)
18
+ throw new Error('Access "role:" needs a role name, e.g. "role:admin".');
19
+ if (/['\\]/.test(role))
20
+ throw new Error(`Access role "${role}" must not contain quotes or backslashes.`);
21
+ return `{ anyRole: ['${role}'] }`;
22
+ }
23
+ throw new Error(`Unknown access "${spec}". Use "authenticated", "anonymous" or "role:<name>".`);
24
+ }
25
+ function resolveMenuSlot(menu) {
26
+ if (menu === true) {
27
+ return DEFAULT_MENU_SLOT;
28
+ }
29
+ return typeof menu === 'string' && menu.length ? menu : undefined;
30
+ }
31
+ const PLATFORM_BOUND_CHORD_TOKENS = [
32
+ 'cmd',
33
+ 'command',
34
+ 'ctrl',
35
+ 'control',
36
+ 'meta',
37
+ ];
38
+ function assertPlatformNeutralChord(shortcut) {
39
+ const tokens = shortcut
40
+ .toLowerCase()
41
+ .split('+')
42
+ .map((token) => token.trim());
43
+ const bound = tokens.find((token) => PLATFORM_BOUND_CHORD_TOKENS.includes(token));
44
+ if (bound) {
45
+ throw new Error(`Shortcut "${shortcut}" binds the platform-specific "${bound}" key. Use the neutral 'mod' token (e.g. 'mod+shift+k') — the host renders it as ⌘ on macOS and Ctrl elsewhere.`);
46
+ }
47
+ }
48
+ function resolveFeatures(id, input) {
49
+ var _a, _b, _c, _d;
50
+ const menuSlot = resolveMenuSlot(input === null || input === void 0 ? void 0 : input.menu);
51
+ const barItem = Boolean(input === null || input === void 0 ? void 0 : input.barItem);
52
+ const hasShortcut = Boolean((_a = input === null || input === void 0 ? void 0 : input.shortcut) === null || _a === void 0 ? void 0 : _a.trim());
53
+ if (hasShortcut) {
54
+ assertPlatformNeutralChord((_c = (_b = input === null || input === void 0 ? void 0 : input.shortcut) === null || _b === void 0 ? void 0 : _b.trim()) !== null && _c !== void 0 ? _c : '');
55
+ }
56
+ const instanceable = Boolean(input === null || input === void 0 ? void 0 : input.instanceable);
57
+ const container = Boolean(input === null || input === void 0 ? void 0 : input.container);
58
+ if (instanceable && container) {
59
+ throw new Error('A surface cannot be both a container and instanceable: a container tab holds its own ":id" and is therefore routable, while named instances exist only for a docked, non-routable surface. Pick one.');
60
+ }
61
+ return {
62
+ command: Boolean(input === null || input === void 0 ? void 0 : input.command) ||
63
+ menuSlot !== undefined ||
64
+ barItem ||
65
+ hasShortcut,
66
+ menuSlot,
67
+ settings: Boolean(input === null || input === void 0 ? void 0 : input.settings),
68
+ access: (input === null || input === void 0 ? void 0 : input.access) ? accessLiteral(input.access) : undefined,
69
+ shortcut: ((_d = input === null || input === void 0 ? void 0 : input.shortcut) === null || _d === void 0 ? void 0 : _d.trim()) || `mod+shift+${id.charAt(0)}`,
70
+ barItem,
71
+ about: Boolean(input === null || input === void 0 ? void 0 : input.about),
72
+ instanceable,
73
+ container,
74
+ spec: (input === null || input === void 0 ? void 0 : input.spec) !== false,
75
+ };
76
+ }
77
+ function deriveCapabilities(features) {
78
+ const set = new Set(['contributions', 'navigation']);
79
+ if (features.command)
80
+ set.add('ui');
81
+ if (features.about) {
82
+ set.add('ui');
83
+ set.add('host');
84
+ }
85
+ return manifest_1.KNOWN_CAPABILITIES.filter((capability) => set.has(capability));
86
+ }
87
+ function resolveWeaverInput(input) {
88
+ var _a, _b, _c, _d;
89
+ if (!(0, casing_1.isKebabId)(input.id)) {
90
+ throw new Error(`Weaver id must be kebab-case (e.g. "notes"); got "${input.id}".`);
91
+ }
92
+ const features = resolveFeatures(input.id, input.features);
93
+ const capabilities = ((_a = input.capabilities) === null || _a === void 0 ? void 0 : _a.length)
94
+ ? [...input.capabilities]
95
+ : deriveCapabilities(features);
96
+ return {
97
+ id: input.id,
98
+ name: ((_b = input.name) === null || _b === void 0 ? void 0 : _b.trim()) || (0, casing_1.toTitleCase)(input.id),
99
+ className: (0, casing_1.toPascalCase)(input.id),
100
+ propertyName: (0, casing_1.toCamelCase)(input.id),
101
+ capabilities,
102
+ features,
103
+ prefix: ((_c = input.prefix) === null || _c === void 0 ? void 0 : _c.trim()) || 'lw',
104
+ importPath: ((_d = input.importPath) === null || _d === void 0 ? void 0 : _d.trim()) || `@loomweaver/${input.id}-weaver`,
105
+ };
106
+ }
107
+ function capabilityItems(capabilities) {
108
+ return capabilities.map((capability) => `'${capability}'`).join(', ');
109
+ }
110
+ const CONTAINER_EXAMPLE_ID = 'example';
111
+ function containerChildIds(w) {
112
+ return [`${w.id}.canvas`, `${w.id}.details`];
113
+ }
114
+ function containerSurfaceBlock(w) {
115
+ const children = containerChildIds(w)
116
+ .map((id) => `'${id}'`)
117
+ .join(', ');
118
+ const lines = [
119
+ ' ctx.registerSurface({',
120
+ ` id: '${w.id}',`,
121
+ ` title: '${w.id}.title',`,
122
+ ` icon: '${w.id}',`,
123
+ ` routable: { path: '${w.id}/:id' },`,
124
+ ' container: {',
125
+ ` children: [${children}],`,
126
+ ` initial: [${children}],`,
127
+ ' },',
128
+ ];
129
+ if (w.features.access)
130
+ lines.push(` access: ${w.features.access},`);
131
+ lines.push(' });');
132
+ for (const [suffix, className] of [
133
+ ['canvas', `${w.className}CanvasView`],
134
+ ['details', `${w.className}DetailsView`],
135
+ ]) {
136
+ lines.push(' ctx.registerSurface({', ` id: '${w.id}.${suffix}',`, ` title: '${w.id}.${suffix}',`, ' docks: [],', ` component: ${className},`, ' });');
137
+ }
138
+ return lines.join('\n');
139
+ }
140
+ function surfaceBlock(w) {
141
+ if (w.features.container) {
142
+ return containerSurfaceBlock(w);
143
+ }
144
+ const lines = [
145
+ ' ctx.registerSurface({',
146
+ ` id: '${w.id}',`,
147
+ ` title: '${w.id}.title',`,
148
+ ` icon: '${w.id}',`,
149
+ ` component: ${w.className}View,`,
150
+ ];
151
+ if (w.features.instanceable) {
152
+ lines.push(" docks: ['primary'],", ' instanceable: true,');
153
+ }
154
+ else {
155
+ lines.push(` routable: { path: '${w.id}' },`);
156
+ }
157
+ if (w.features.access)
158
+ lines.push(` access: ${w.features.access},`);
159
+ lines.push(' });');
160
+ return lines.join('\n');
161
+ }
162
+ function railTarget(w) {
163
+ if (w.features.container) {
164
+ return `ctx.navigateContent('${w.id}/${CONTAINER_EXAMPLE_ID}')`;
165
+ }
166
+ if (w.features.instanceable) {
167
+ return `ctx.revealSurface('${w.id}')`;
168
+ }
169
+ return `ctx.navigateContent('${w.id}')`;
170
+ }
171
+ function railBlock(w) {
172
+ const lines = [
173
+ ' ctx.registerRailItem({',
174
+ ` id: '${w.id}.rail',`,
175
+ " rail: 'primary',",
176
+ ` icon: '${w.id}',`,
177
+ ` title: '${w.id}.title',`,
178
+ ` run: () => ${railTarget(w)},`,
179
+ ];
180
+ if (w.features.access)
181
+ lines.push(` access: ${w.features.access},`);
182
+ lines.push(' });');
183
+ return lines.join('\n');
184
+ }
185
+ function commandBlock(w) {
186
+ return [
187
+ ' ctx.registerCommand({',
188
+ ` id: '${w.id}.hello',`,
189
+ ` title: '${w.id}.action',`,
190
+ ` description: '${w.id}.actionDescription',`,
191
+ ` shortcut: '${w.features.shortcut}',`,
192
+ ' callable: true,',
193
+ ` run: () => ctx.ui.toast({ message: '${w.id}.action', kind: 'info' }),`,
194
+ ' });',
195
+ ].join('\n');
196
+ }
197
+ function barItemBlock(w) {
198
+ return [
199
+ ' ctx.registerBarItem({',
200
+ ` id: '${w.id}.bar',`,
201
+ " bar: 'status-bar',",
202
+ " slot: 'end',",
203
+ ` icon: '${w.id}',`,
204
+ ` tooltip: '${w.id}.action',`,
205
+ ` command: '${w.id}.hello',`,
206
+ ' });',
207
+ ].join('\n');
208
+ }
209
+ function aboutCommandBlock(w) {
210
+ return [
211
+ ' ctx.registerCommand({',
212
+ ` id: '${w.id}.about',`,
213
+ ` title: '${w.id}.about',`,
214
+ ` run: () => ctx.ui.open(${w.className}AboutDialog, { data: ctx.host, title: '${w.id}.title' }),`,
215
+ ' });',
216
+ ].join('\n');
217
+ }
218
+ function aboutRailBlock(w) {
219
+ return [
220
+ ' ctx.registerRailItem({',
221
+ ` id: '${w.id}.rail.about',`,
222
+ " rail: 'primary',",
223
+ " anchor: 'bottom',",
224
+ ` icon: '${w.id}',`,
225
+ ` title: '${w.id}.about',`,
226
+ ` command: '${w.id}.about',`,
227
+ ' });',
228
+ ].join('\n');
229
+ }
230
+ function menuBlock(w) {
231
+ return [
232
+ ' ctx.registerMenuItem({',
233
+ ` menu: '${w.features.menuSlot}',`,
234
+ ` command: '${w.id}.hello',`,
235
+ ' });',
236
+ ].join('\n');
237
+ }
238
+ function settingsBlock(w) {
239
+ return [
240
+ ' ctx.registerSettingsSection({',
241
+ ` id: '${w.id}',`,
242
+ ` title: '${w.id}.settings.title',`,
243
+ ' rows: [',
244
+ ' {',
245
+ " id: 'enabled',",
246
+ ` label: '${w.id}.settings.enabled',`,
247
+ ` control: { kind: 'toggle', value: () => ${w.propertyName}Enabled(), set: (v) => ${w.propertyName}Enabled.set(v) },`,
248
+ ' },',
249
+ ' {',
250
+ " id: 'note',",
251
+ ` label: '${w.id}.settings.note',`,
252
+ ` control: { kind: 'text', value: () => ${w.propertyName}Note(), set: (v) => ${w.propertyName}Note.set(v) },`,
253
+ ' },',
254
+ ' ],',
255
+ ' });',
256
+ ].join('\n');
257
+ }
258
+ function pluginFile(w) {
259
+ const imports = ["import { Plugin } from '@loomweaver/plugin-sdk';"];
260
+ if (w.features.container) {
261
+ imports.push(`import { ${w.className}CanvasView } from '../views/${w.id}-canvas-view';`, `import { ${w.className}DetailsView } from '../views/${w.id}-details-view';`);
262
+ }
263
+ else {
264
+ imports.push(`import { ${w.className}View } from '../views/${w.id}-view';`);
265
+ }
266
+ if (w.features.about) {
267
+ imports.push(`import { ${w.className}AboutDialog } from '../dialogs/${w.id}-about-dialog';`);
268
+ }
269
+ if (w.features.settings) {
270
+ imports.unshift("import { signal } from '@angular/core';");
271
+ }
272
+ const consts = [`const icon =\n '${SURFACE_ICON}';`];
273
+ if (w.features.settings) {
274
+ consts.push(`const ${w.propertyName}Enabled = signal(true);`, `const ${w.propertyName}Note = signal('');`);
275
+ }
276
+ const body = [` ctx.contributeIcons({ '${w.id}': icon });`];
277
+ if (w.features.command)
278
+ body.push(commandBlock(w));
279
+ if (w.features.about)
280
+ body.push(aboutCommandBlock(w));
281
+ body.push(surfaceBlock(w), railBlock(w));
282
+ if (w.features.about)
283
+ body.push(aboutRailBlock(w));
284
+ if (w.features.barItem)
285
+ body.push(barItemBlock(w));
286
+ if (w.features.menuSlot)
287
+ body.push(menuBlock(w));
288
+ if (w.features.settings)
289
+ body.push(settingsBlock(w));
290
+ return `${imports.join('\n')}
291
+
292
+ ${consts.join('\n')}
293
+
294
+ export const ${w.propertyName}Plugin: Plugin = {
295
+ manifest: {
296
+ id: '${w.id}',
297
+ name: '${w.name}',
298
+ capabilities: [${capabilityItems(w.capabilities)}],
299
+ },
300
+ activate(ctx) {
301
+ ${body.join('\n')}
302
+ },
303
+ };
304
+ `;
305
+ }
306
+ function aboutDialogFile(w) {
307
+ return `import { Component, inject } from '@angular/core';
308
+ import { DialogRef, PluginHost } from '@loomweaver/plugin-sdk';
309
+
310
+ @Component({
311
+ selector: '${w.prefix}-${w.id}-about-dialog',
312
+ templateUrl: './${w.id}-about-dialog.html',
313
+ })
314
+ export class ${w.className}AboutDialog {
315
+ protected readonly host = inject(DialogRef).data as PluginHost;
316
+ }
317
+ `;
318
+ }
319
+ function aboutDialogTemplateFile(w) {
320
+ return `<div class="flex flex-col items-center gap-2 text-center">
321
+ <h2 class="text-lg font-semibold text-content">${w.name}</h2>
322
+ <span class="text-xs text-content-faint tabular-nums">v{{ host.version() }}</span>
323
+ </div>
324
+ `;
325
+ }
326
+ function indexFile(w) {
327
+ return `export { ${w.propertyName}Plugin } from './lib/plugin/${w.id}.plugin';\n`;
328
+ }
329
+ function viewFile(w) {
330
+ if (!w.features.instanceable) {
331
+ return `import { Component } from '@angular/core';
332
+
333
+ @Component({
334
+ selector: '${w.prefix}-${w.id}-view',
335
+ templateUrl: './${w.id}-view.html',
336
+ })
337
+ export class ${w.className}View {}
338
+ `;
339
+ }
340
+ return `import { Component, computed, inject } from '@angular/core';
341
+ import { VIEW_STATE, type ViewState } from '@loomweaver/plugin-sdk';
342
+
343
+ interface ${w.className}State {
344
+ readonly sort: 'natural' | 'alpha';
345
+ }
346
+
347
+ const FRESH: ${w.className}State = { sort: 'natural' };
348
+
349
+ @Component({
350
+ selector: '${w.prefix}-${w.id}-view',
351
+ templateUrl: './${w.id}-view.html',
352
+ })
353
+ export class ${w.className}View {
354
+ private readonly viewState = inject(VIEW_STATE) as ViewState<${w.className}State>;
355
+
356
+ // undefined = a fresh instance, so apply your own default.
357
+ private readonly state = computed(() => this.viewState.value() ?? FRESH);
358
+
359
+ protected readonly sort = computed(() => this.state().sort);
360
+
361
+ protected toggleSort(): void {
362
+ // set() replaces the whole blob, so spread what is already there.
363
+ this.viewState.set({
364
+ ...this.state(),
365
+ sort: this.sort() === 'alpha' ? 'natural' : 'alpha',
366
+ });
367
+ }
368
+ }
369
+ `;
370
+ }
371
+ function viewTemplateFile(w) {
372
+ const stateNote = w.features.instanceable
373
+ ? ` <button type="button" class="lw-btn lw-btn--default self-start" (click)="toggleSort()">
374
+ Sort: {{ sort() }}
375
+ </button>
376
+ <p class="text-sm text-content-faint">
377
+ That choice lives in this instance's <code class="text-content">VIEW_STATE</code>, so it survives a
378
+ tab switch, a collapsed sidebar and a reload. Anything that must not be lost belongs there.
379
+ </p>
380
+ `
381
+ : '';
382
+ return `<div class="mx-auto flex max-w-2xl flex-col gap-4 p-6">
383
+ <h2 class="text-lg font-semibold text-content">${w.name}</h2>
384
+ <p class="text-sm text-content-faint">
385
+ Your new weaver surface. Register more surfaces, commands, rail items and menus on
386
+ <code class="text-content">ctx</code> inside the plugin's
387
+ <code class="text-content">activate</code>.
388
+ </p>
389
+ ${stateNote}</div>
390
+ `;
391
+ }
392
+ function childViewFile(w, suffix, className) {
393
+ return `import { Component, inject } from '@angular/core';
394
+ import { ActivatedRoute } from '@angular/router';
395
+
396
+ @Component({
397
+ selector: '${w.prefix}-${w.id}-${suffix}-view',
398
+ templateUrl: './${w.id}-${suffix}-view.html',
399
+ })
400
+ export class ${className} {
401
+ private readonly route = inject(ActivatedRoute, { optional: true });
402
+
403
+ protected readonly instanceId =
404
+ this.route?.snapshot.paramMap.get('id') ?? '—';
405
+ }
406
+ `;
407
+ }
408
+ function childViewTemplateFile(w, heading) {
409
+ return `<div class="flex h-full flex-col gap-3 p-4">
410
+ <h3 class="text-sm font-semibold text-content">${heading}</h3>
411
+ <p class="text-sm text-content-faint">
412
+ Scoped to <code class="text-content">{{ instanceId }}</code> — the id of the container tab this
413
+ pane lives in. Every open container tab has its own inner tree, so two of them show two
414
+ different ids side by side.
415
+ </p>
416
+ </div>
417
+ `;
418
+ }
419
+ function specFile(w) {
420
+ return `import { ${w.propertyName}Plugin } from './${w.id}.plugin';
421
+
422
+ describe('${w.propertyName}Plugin', () => {
423
+ it('declares its manifest', () => {
424
+ expect(${w.propertyName}Plugin.manifest.id).toBe('${w.id}');
425
+ expect(${w.propertyName}Plugin.manifest.capabilities).toContain('contributions');
426
+ });
427
+ });
428
+ `;
429
+ }
430
+ function surfaceNotes(w) {
431
+ const railNote = 'Rail and bar items reference region ids (`primary`, `status`) that must exist in your layout.';
432
+ if (w.features.container) {
433
+ return [
434
+ `The surface is a **container**: it is routable at \`/${w.id}/:id\`, and its tab holds a`,
435
+ 'nested pane tree of child surfaces. The host draws the inner tabs, splits and drag targets; this',
436
+ 'weaver only declares which children it offers.',
437
+ '',
438
+ `- \`children\` is what the inner "new tab" picker lists — the host access-gates it for you.`,
439
+ '- `initial` is what a freshly opened container tab starts with.',
440
+ `- The children declare \`docks: []\`. That is the container-only convention: they are never seeded`,
441
+ ' into a sidebar, they exist solely inside this container.',
442
+ `- Each child reads the container's \`:id\` from an injected \`ActivatedRoute\` — the host supplies a`,
443
+ ' synthetic one, so a child needs no knowledge of where it is mounted. Two open container tabs are',
444
+ ' two independent trees, each scoped to its own id.',
445
+ `- The inner tree is **sealed**: a child cannot be dragged out, and nothing can be dragged in. It`,
446
+ ' travels with the tab, including into a sidebar or a pop-out window.',
447
+ '',
448
+ `The rail item opens the fixed id \`${CONTAINER_EXAMPLE_ID}\`. Replace that with whatever the user`,
449
+ 'actually picked — a document, a run, a project.',
450
+ '',
451
+ railNote,
452
+ ];
453
+ }
454
+ if (w.features.instanceable) {
455
+ return [
456
+ `The surface is **docked** into the \`primary\` region and marked \`instanceable\`, so the host shows a`,
457
+ 'switcher for saving, naming, renaming and deleting several configurations of it, each with its own',
458
+ '`VIEW_STATE` blob.',
459
+ '',
460
+ 'It is deliberately **not** routable. Named instances exist only for a docked surface — a routable',
461
+ 'one holds the URL pane instead, and the host drops `instanceable` on that path. The rail item',
462
+ 'therefore reveals the surface (`ctx.revealSurface`) rather than navigating to a URL, which focuses',
463
+ 'it wherever the user has since moved it.',
464
+ '',
465
+ 'The generated view already uses that blob for its sort order, because a hidden surface is destroyed',
466
+ 'as soon as it is clean: state kept in a component field survives neither a tab switch nor',
467
+ 'a collapsed sidebar, and never survived a reload. The rule is *evictable = reload-safe* — anything',
468
+ 'that must not be lost goes through `VIEW_STATE`, and `set()` replaces the whole blob, so spread it.',
469
+ '',
470
+ railNote,
471
+ ];
472
+ }
473
+ return [
474
+ `The surface is routable at \`/${w.id}\`; ${railNote.charAt(0).toLowerCase()}${railNote.slice(1)}`,
475
+ '',
476
+ 'A routable surface has **no `VIEW_STATE` handle** — injecting the token there throws. It owns a URL,',
477
+ 'so anything shareable (a filter, the active sub-tab) belongs in route params or `subRoutes`, where it',
478
+ 'survives a deep link too; unsaved edits are `DirtySurface`, and an instance that is expensive to',
479
+ 'rebuild declares `retain: \'always\'`. Generate with `--instanceable` for the docked, `VIEW_STATE`',
480
+ 'flavour instead.',
481
+ ];
482
+ }
483
+ function readmeFile(w) {
484
+ return [
485
+ `# ${w.name} weaver`,
486
+ '',
487
+ `A LoomWeaver weaver (a domain plugin bundle). It consumes only the public \`@loomweaver/plugin-sdk\` contract.`,
488
+ '',
489
+ '## Wire it into a distribution',
490
+ '',
491
+ `1. Add the plugin to \`providePlugins\` in \`src/app/app.config.ts\`. It is **variadic** and`,
492
+ ` returns an array, so spread it:`,
493
+ '',
494
+ ' ```ts',
495
+ ` import { ${w.propertyName}Plugin } from '${w.importPath}'; // Nx: the workspace alias; without one, a relative path to this library's src/index.ts`,
496
+ ` ...providePlugins(${w.propertyName}Plugin),`,
497
+ ' ```',
498
+ '',
499
+ `2. Grant its capabilities (default-deny) via \`provideCapabilityGrants\`:`,
500
+ '',
501
+ ' ```ts',
502
+ ` provideCapabilityGrants({ '${w.id}': [${capabilityItems(w.capabilities)}] });`,
503
+ ' ```',
504
+ '',
505
+ `3. Compose its translations with \`provideTranslationNamespaces('${w.id}')\` — and serve the`,
506
+ ` bundle by adding an assets glob to your application's build target, so the loader can fetch`,
507
+ ` \`/i18n/${w.id}/<lang>.json\` (the Nx generator adds this glob for you):`,
508
+ '',
509
+ ' ```json',
510
+ ` { "glob": "**/*.json", "input": "<path to this library>/src/lib/i18n", "output": "i18n/${w.id}" }`,
511
+ ' ```',
512
+ '',
513
+ `4. If your application compiles the shell's theme with Tailwind, name this library as a source`,
514
+ ` for it, so the utility classes in these templates are emitted. Tailwind also detects sources`,
515
+ ` by itself, but that depends on where it resolves the project root and on \`.gitignore\`, and`,
516
+ ` what the scaffold names covers the application alone (the Nx generator adds this line for`,
517
+ ` you). Applications scaffolded with \`--styles precompiled\` run no Tailwind and need nothing:`,
518
+ '',
519
+ ' ```css',
520
+ ` @source '<path from that stylesheet to this library>/src';`,
521
+ ' ```',
522
+ '',
523
+ ...surfaceNotes(w),
524
+ '',
525
+ '## After scaffolding',
526
+ '',
527
+ '- `src/lib/i18n/de.json` starts as a copy of the English strings — translate it.',
528
+ `- A scaffolded command defaults its shortcut to \`mod+shift+<first letter of the id>\` — two weavers whose ids share a first letter collide; pass \`--shortcut\` or edit the command.`,
529
+ '- The project is generated **untagged**: Nx tags belong to your `depConstraints`, and inventing',
530
+ ' one would fail a lint policy you never opted this project into. If your workspace enforces',
531
+ ' module boundaries, give it tags your constraints allow — `--tags` at generation time, or',
532
+ ' `tags` in `project.json` afterwards.',
533
+ '',
534
+ ].join('\n');
535
+ }
536
+ exports.angularWeaver = {
537
+ id: 'angular-weaver',
538
+ build(input) {
539
+ const w = resolveWeaverInput(input);
540
+ const files = {
541
+ 'src/index.ts': indexFile(w),
542
+ [`src/lib/plugin/${w.id}.plugin.ts`]: pluginFile(w),
543
+ 'src/lib/i18n/en.json': (0, weaver_i18n_1.i18nFile)(w),
544
+ 'src/lib/i18n/de.json': (0, weaver_i18n_1.i18nFile)(w),
545
+ 'README.md': readmeFile(w),
546
+ };
547
+ if (w.features.container) {
548
+ files[`src/lib/views/${w.id}-canvas-view.ts`] = childViewFile(w, 'canvas', `${w.className}CanvasView`);
549
+ files[`src/lib/views/${w.id}-canvas-view.html`] = childViewTemplateFile(w, 'Canvas');
550
+ files[`src/lib/views/${w.id}-details-view.ts`] = childViewFile(w, 'details', `${w.className}DetailsView`);
551
+ files[`src/lib/views/${w.id}-details-view.html`] = childViewTemplateFile(w, 'Details');
552
+ }
553
+ else {
554
+ files[`src/lib/views/${w.id}-view.ts`] = viewFile(w);
555
+ files[`src/lib/views/${w.id}-view.html`] = viewTemplateFile(w);
556
+ }
557
+ if (w.features.about) {
558
+ files[`src/lib/dialogs/${w.id}-about-dialog.ts`] = aboutDialogFile(w);
559
+ files[`src/lib/dialogs/${w.id}-about-dialog.html`] =
560
+ aboutDialogTemplateFile(w);
561
+ }
562
+ if (w.features.spec) {
563
+ files[`src/lib/plugin/${w.id}.plugin.spec.ts`] = specFile(w);
564
+ }
565
+ return files;
566
+ },
567
+ };
568
+ //# sourceMappingURL=recipe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recipe.js","sourceRoot":"","sources":["../../../../../../../libs/tooling/devkit/src/recipes/angular-weaver/recipe.ts"],"names":[],"mappings":";;;AA4JA,gDAoB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ACrE,CAAC,EACD,QAAQ,CACT,CAAC;YACF,KAAK,CAAC,iBAAiB,CAAC,CAAC,EAAE,kBAAkB,CAAC,GAAG,aAAa,CAC5D,CAAC,EACD,SAAS,EACT,GAAG,CAAC,CAAC,SAAS,aAAa,CAC5B,CAAC;YACF,KAAK,CAAC,iBAAiB,CAAC,CAAC,EAAE,oBAAoB,CAAC,GAAG,qBAAqB,CACtE,CAAC,EACD,SAAS,CACV,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,iBAAiB,CAAC,CAAC,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;YACrD,KAAK,CAAC,iBAAiB,CAAC,CAAC,EAAE,YAAY,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;QACjE,CAAC;QACD,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;YACrB,KAAK,CAAC,mBAAmB,CAAC,CAAC,EAAE,kBAAkB,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC;YACtE,KAAK,CAAC,mBAAmB,CAAC,CAAC,EAAE,oBAAoB,CAAC;gBAChD,uBAAuB,CAAC,CAAC,CAAC,CAAC;QAC/B,CAAC;QACD,IAAI,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;YACpB,KAAK,CAAC,kBAAkB,CAAC,CAAC,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;QAC/D,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { ResolvedWeaver } from './recipe';
2
+ export declare function i18nBundle(w: ResolvedWeaver): Record<string, unknown>;
3
+ export declare function i18nFile(w: ResolvedWeaver): string;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.i18nBundle = i18nBundle;
4
+ exports.i18nFile = i18nFile;
5
+ function i18nBundle(w) {
6
+ const bundle = { title: w.name };
7
+ if (w.features.container) {
8
+ bundle['canvas'] = 'Canvas';
9
+ bundle['details'] = 'Details';
10
+ }
11
+ if (w.features.command) {
12
+ bundle['action'] = `${w.name} action`;
13
+ bundle['actionDescription'] = `Shows a short ${w.name} message.`;
14
+ }
15
+ if (w.features.about)
16
+ bundle['about'] = `About ${w.name}`;
17
+ if (w.features.settings)
18
+ bundle['settings'] = { title: w.name, enabled: 'Enabled', note: 'Note' };
19
+ return bundle;
20
+ }
21
+ function i18nFile(w) {
22
+ return JSON.stringify(i18nBundle(w), null, 2) + '\n';
23
+ }
24
+ //# sourceMappingURL=weaver-i18n.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"weaver-i18n.js","sourceRoot":"","sources":["../../../../../../../libs/tooling/devkit/src/recipes/angular-weaver/weaver-i18n.ts"],"names":[],"mappings":";;AAEA,gCAcC;AAED,4BAEC;AAlBD,SAAgB,UAAU,CAAC,CAAiB;IAC1C,MAAM,MAAM,GAA4B,EAAE,KAAK,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAC1D,IAAI,CAAC,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;QACzB,MAAM,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC;QAC5B,MAAM,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC;IAChC,CAAC;IACD,IAAI,CAAC,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;QACvB,MAAM,CAAC,QAAQ,CAAC,GAAG,GAAG,CAAC,CAAC,IAAI,SAAS,CAAC;QACtC,MAAM,CAAC,mBAAmB,CAAC,GAAG,iBAAiB,CAAC,CAAC,IAAI,WAAW,CAAC;IACnE,CAAC;IACD,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK;QAAE,MAAM,CAAC,OAAO,CAAC,GAAG,SAAS,CAAC,CAAC,IAAI,EAAE,CAAC;IAC1D,IAAI,CAAC,CAAC,QAAQ,CAAC,QAAQ;QACrB,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAC3E,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAgB,QAAQ,CAAC,CAAiB;IACxC,OAAO,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC;AACvD,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { Recipe } from '../../lib/generate/types';
2
+ export interface AuthSourceInput {
3
+ readonly name: string;
4
+ }
5
+ export interface ResolvedAuthSource {
6
+ readonly name: string;
7
+ readonly className: string;
8
+ readonly propertyName: string;
9
+ }
10
+ export declare function resolveAuthSourceInput(input: AuthSourceInput): ResolvedAuthSource;
11
+ export declare const authSource: Recipe<AuthSourceInput>;