@almadar/std 2.1.0 → 2.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/dist/behaviors/async.d.ts +12 -7
  2. package/dist/behaviors/async.js +1085 -312
  3. package/dist/behaviors/async.js.map +1 -1
  4. package/dist/behaviors/data-management.d.ts +27 -13
  5. package/dist/behaviors/data-management.js +600 -244
  6. package/dist/behaviors/data-management.js.map +1 -1
  7. package/dist/behaviors/domain/commerce.d.ts +51 -0
  8. package/dist/behaviors/domain/commerce.js +1093 -0
  9. package/dist/behaviors/domain/commerce.js.map +1 -0
  10. package/dist/behaviors/domain/content.d.ts +51 -0
  11. package/dist/behaviors/domain/content.js +1294 -0
  12. package/dist/behaviors/domain/content.js.map +1 -0
  13. package/dist/behaviors/domain/dashboard.d.ts +45 -0
  14. package/dist/behaviors/domain/dashboard.js +783 -0
  15. package/dist/behaviors/domain/dashboard.js.map +1 -0
  16. package/dist/behaviors/domain/education.d.ts +41 -0
  17. package/dist/behaviors/domain/education.js +738 -0
  18. package/dist/behaviors/domain/education.js.map +1 -0
  19. package/dist/behaviors/domain/finance.d.ts +49 -0
  20. package/dist/behaviors/domain/finance.js +660 -0
  21. package/dist/behaviors/domain/finance.js.map +1 -0
  22. package/dist/behaviors/domain/game-2d-platformer.d.ts +50 -0
  23. package/dist/behaviors/domain/game-2d-platformer.js +810 -0
  24. package/dist/behaviors/domain/game-2d-platformer.js.map +1 -0
  25. package/dist/behaviors/domain/game-2d-puzzle.d.ts +42 -0
  26. package/dist/behaviors/domain/game-2d-puzzle.js +622 -0
  27. package/dist/behaviors/domain/game-2d-puzzle.js.map +1 -0
  28. package/dist/behaviors/domain/game-2d-rpg.d.ts +48 -0
  29. package/dist/behaviors/domain/game-2d-rpg.js +860 -0
  30. package/dist/behaviors/domain/game-2d-rpg.js.map +1 -0
  31. package/dist/behaviors/domain/game-2d-strategy.d.ts +48 -0
  32. package/dist/behaviors/domain/game-2d-strategy.js +692 -0
  33. package/dist/behaviors/domain/game-2d-strategy.js.map +1 -0
  34. package/dist/behaviors/domain/geospatial.d.ts +35 -0
  35. package/dist/behaviors/domain/geospatial.js +634 -0
  36. package/dist/behaviors/domain/geospatial.js.map +1 -0
  37. package/dist/behaviors/domain/healthcare.d.ts +36 -0
  38. package/dist/behaviors/domain/healthcare.js +1068 -0
  39. package/dist/behaviors/domain/healthcare.js.map +1 -0
  40. package/dist/behaviors/domain/iot.d.ts +45 -0
  41. package/dist/behaviors/domain/iot.js +589 -0
  42. package/dist/behaviors/domain/iot.js.map +1 -0
  43. package/dist/behaviors/domain/media.d.ts +41 -0
  44. package/dist/behaviors/domain/media.js +771 -0
  45. package/dist/behaviors/domain/media.js.map +1 -0
  46. package/dist/behaviors/domain/scheduling.d.ts +41 -0
  47. package/dist/behaviors/domain/scheduling.js +930 -0
  48. package/dist/behaviors/domain/scheduling.js.map +1 -0
  49. package/dist/behaviors/domain/simulation.d.ts +36 -0
  50. package/dist/behaviors/domain/simulation.js +706 -0
  51. package/dist/behaviors/domain/simulation.js.map +1 -0
  52. package/dist/behaviors/domain/social.d.ts +41 -0
  53. package/dist/behaviors/domain/social.js +840 -0
  54. package/dist/behaviors/domain/social.js.map +1 -0
  55. package/dist/behaviors/domain/workflow.d.ts +41 -0
  56. package/dist/behaviors/domain/workflow.js +879 -0
  57. package/dist/behaviors/domain/workflow.js.map +1 -0
  58. package/dist/behaviors/feedback.d.ts +10 -5
  59. package/dist/behaviors/feedback.js +279 -194
  60. package/dist/behaviors/feedback.js.map +1 -1
  61. package/dist/behaviors/game-core.d.ts +15 -8
  62. package/dist/behaviors/game-core.js +412 -80
  63. package/dist/behaviors/game-core.js.map +1 -1
  64. package/dist/behaviors/game-entity.d.ts +17 -10
  65. package/dist/behaviors/game-entity.js +544 -237
  66. package/dist/behaviors/game-entity.js.map +1 -1
  67. package/dist/behaviors/game-ui.d.ts +16 -8
  68. package/dist/behaviors/game-ui.js +451 -316
  69. package/dist/behaviors/game-ui.js.map +1 -1
  70. package/dist/behaviors/index.d.ts +18 -1
  71. package/dist/behaviors/index.js +18905 -2140
  72. package/dist/behaviors/index.js.map +1 -1
  73. package/dist/behaviors/infrastructure.d.ts +9 -8
  74. package/dist/behaviors/infrastructure.js +597 -169
  75. package/dist/behaviors/infrastructure.js.map +1 -1
  76. package/dist/behaviors/registry.d.ts +11 -11
  77. package/dist/behaviors/registry.js +18904 -2139
  78. package/dist/behaviors/registry.js.map +1 -1
  79. package/dist/behaviors/types.d.ts +19 -2
  80. package/dist/behaviors/types.js.map +1 -1
  81. package/dist/behaviors/ui-interaction.d.ts +20 -14
  82. package/dist/behaviors/ui-interaction.js +928 -518
  83. package/dist/behaviors/ui-interaction.js.map +1 -1
  84. package/dist/index.js +18906 -2141
  85. package/dist/index.js.map +1 -1
  86. package/package.json +4 -1
@@ -0,0 +1,1294 @@
1
+ // behaviors/domain/content.ts
2
+ var contentAmberTheme = {
3
+ name: "content-amber",
4
+ tokens: {
5
+ colors: {
6
+ primary: "#d97706",
7
+ "primary-hover": "#b45309",
8
+ "primary-foreground": "#ffffff",
9
+ accent: "#f59e0b",
10
+ "accent-foreground": "#000000",
11
+ success: "#22c55e",
12
+ warning: "#f59e0b",
13
+ error: "#ef4444"
14
+ }
15
+ }
16
+ };
17
+ var articleBrowsingMainEffects = [
18
+ ["render-ui", "main", {
19
+ type: "stack",
20
+ direction: "vertical",
21
+ gap: "lg",
22
+ children: [
23
+ {
24
+ type: "stack",
25
+ direction: "horizontal",
26
+ justify: "space-between",
27
+ align: "center",
28
+ children: [
29
+ {
30
+ type: "stack",
31
+ direction: "horizontal",
32
+ gap: "sm",
33
+ align: "center",
34
+ children: [
35
+ { type: "icon", name: "file-text", size: "lg" },
36
+ { type: "typography", variant: "h2", text: "Articles" }
37
+ ]
38
+ },
39
+ { type: "badge", label: "Content Hub", color: "primary" }
40
+ ]
41
+ },
42
+ { type: "divider" },
43
+ {
44
+ type: "stats",
45
+ entity: "Article"
46
+ },
47
+ {
48
+ type: "search-input",
49
+ placeholder: "Search articles by title or author...",
50
+ event: "EDIT_ARTICLE"
51
+ },
52
+ {
53
+ type: "data-grid",
54
+ entity: "Article",
55
+ columns: [
56
+ { field: "title", label: "Title" },
57
+ { field: "author", label: "Author" },
58
+ { field: "status", label: "Status" },
59
+ { field: "publishedAt", label: "Published" }
60
+ ],
61
+ itemActions: [
62
+ { label: "Edit", event: "EDIT_ARTICLE", icon: "pencil" }
63
+ ]
64
+ }
65
+ ]
66
+ }]
67
+ ];
68
+ var articleEditMainEffects = [
69
+ ["render-ui", "main", {
70
+ type: "stack",
71
+ direction: "vertical",
72
+ gap: "md",
73
+ children: [
74
+ {
75
+ type: "stack",
76
+ direction: "horizontal",
77
+ gap: "sm",
78
+ align: "center",
79
+ children: [
80
+ { type: "icon", name: "pen-tool", size: "lg" },
81
+ { type: "typography", variant: "h2", text: "Edit Article" }
82
+ ]
83
+ },
84
+ { type: "divider" },
85
+ {
86
+ type: "form-section",
87
+ entity: "Article"
88
+ }
89
+ ]
90
+ }]
91
+ ];
92
+ var ARTICLE_BEHAVIOR = {
93
+ name: "std-article",
94
+ version: "1.0.0",
95
+ description: "Article management with editing, preview, and publish workflow",
96
+ theme: contentAmberTheme,
97
+ orbitals: [
98
+ {
99
+ name: "ArticleOrbital",
100
+ entity: {
101
+ name: "Article",
102
+ persistence: "persistent",
103
+ collection: "articles",
104
+ fields: [
105
+ { name: "id", type: "string", required: true },
106
+ { name: "title", type: "string", default: "" },
107
+ { name: "body", type: "string", default: "" },
108
+ { name: "status", type: "string", default: "draft" },
109
+ { name: "author", type: "string", default: "" },
110
+ { name: "publishedAt", type: "string", default: "" }
111
+ ]
112
+ },
113
+ traits: [
114
+ {
115
+ name: "ArticleWorkflow",
116
+ linkedEntity: "Article",
117
+ category: "interaction",
118
+ stateMachine: {
119
+ states: [
120
+ { name: "browsing", isInitial: true },
121
+ { name: "editing" },
122
+ { name: "previewing" },
123
+ { name: "published" }
124
+ ],
125
+ events: [
126
+ { key: "INIT", name: "Initialize" },
127
+ { key: "EDIT_ARTICLE", name: "Edit Article", payloadSchema: [
128
+ { name: "id", type: "string", required: true }
129
+ ] },
130
+ { key: "SAVE_DRAFT", name: "Save Draft", payloadSchema: [
131
+ { name: "title", type: "string", required: true },
132
+ { name: "body", type: "string", required: true }
133
+ ] },
134
+ { key: "PREVIEW", name: "Preview" },
135
+ { key: "PUBLISH", name: "Publish" },
136
+ { key: "BACK_TO_EDIT", name: "Back to Edit" },
137
+ { key: "BACK_TO_LIST", name: "Back to List" }
138
+ ],
139
+ transitions: [
140
+ {
141
+ from: "browsing",
142
+ to: "browsing",
143
+ event: "INIT",
144
+ effects: [
145
+ ["fetch", "Article"],
146
+ ...articleBrowsingMainEffects
147
+ ]
148
+ },
149
+ {
150
+ from: "browsing",
151
+ to: "editing",
152
+ event: "EDIT_ARTICLE",
153
+ effects: [
154
+ ["fetch", "Article"],
155
+ ...articleEditMainEffects
156
+ ]
157
+ },
158
+ {
159
+ from: "editing",
160
+ to: "editing",
161
+ event: "SAVE_DRAFT",
162
+ effects: [
163
+ ["fetch", "Article"],
164
+ ["set", "@entity.title", "@payload.title"],
165
+ ["set", "@entity.body", "@payload.body"],
166
+ ["set", "@entity.status", "draft"],
167
+ ["render-ui", "main", {
168
+ type: "stack",
169
+ direction: "vertical",
170
+ gap: "md",
171
+ children: [
172
+ {
173
+ type: "stack",
174
+ direction: "horizontal",
175
+ gap: "sm",
176
+ align: "center",
177
+ children: [
178
+ { type: "icon", name: "pen-tool", size: "lg" },
179
+ { type: "typography", variant: "h2", text: "Edit Article" },
180
+ { type: "badge", label: "Draft Saved", color: "success" }
181
+ ]
182
+ },
183
+ { type: "divider" },
184
+ { type: "form-section", entity: "Article" }
185
+ ]
186
+ }]
187
+ ]
188
+ },
189
+ {
190
+ from: "editing",
191
+ to: "previewing",
192
+ event: "PREVIEW",
193
+ effects: [
194
+ ["fetch", "Article"],
195
+ ["render-ui", "main", {
196
+ type: "stack",
197
+ direction: "vertical",
198
+ gap: "md",
199
+ children: [
200
+ {
201
+ type: "stack",
202
+ direction: "horizontal",
203
+ justify: "space-between",
204
+ align: "center",
205
+ children: [
206
+ {
207
+ type: "stack",
208
+ direction: "horizontal",
209
+ gap: "sm",
210
+ align: "center",
211
+ children: [
212
+ { type: "icon", name: "eye", size: "lg" },
213
+ { type: "typography", variant: "h2", text: "Preview Article" }
214
+ ]
215
+ },
216
+ {
217
+ type: "stack",
218
+ direction: "horizontal",
219
+ gap: "sm",
220
+ children: [
221
+ { type: "button", label: "Back to Edit", event: "BACK_TO_EDIT", variant: "secondary" },
222
+ { type: "button", label: "Publish", event: "PUBLISH", variant: "primary" }
223
+ ]
224
+ }
225
+ ]
226
+ },
227
+ { type: "divider" },
228
+ { type: "typography", variant: "h3", text: "@entity.title" },
229
+ { type: "typography", variant: "body", text: "@entity.body" },
230
+ {
231
+ type: "stack",
232
+ direction: "horizontal",
233
+ gap: "md",
234
+ children: [
235
+ { type: "badge", label: "@entity.status", color: "warning" },
236
+ {
237
+ type: "stack",
238
+ direction: "horizontal",
239
+ gap: "xs",
240
+ align: "center",
241
+ children: [
242
+ { type: "icon", name: "type", size: "sm" },
243
+ { type: "typography", variant: "caption", text: "@entity.author" }
244
+ ]
245
+ }
246
+ ]
247
+ }
248
+ ]
249
+ }]
250
+ ]
251
+ },
252
+ {
253
+ from: "previewing",
254
+ to: "editing",
255
+ event: "BACK_TO_EDIT",
256
+ effects: [
257
+ ["fetch", "Article"],
258
+ ...articleEditMainEffects
259
+ ]
260
+ },
261
+ {
262
+ from: "previewing",
263
+ to: "published",
264
+ event: "PUBLISH",
265
+ effects: [
266
+ ["fetch", "Article"],
267
+ ["set", "@entity.status", "published"],
268
+ ["render-ui", "main", {
269
+ type: "stack",
270
+ direction: "vertical",
271
+ gap: "md",
272
+ children: [
273
+ {
274
+ type: "stack",
275
+ direction: "horizontal",
276
+ gap: "sm",
277
+ align: "center",
278
+ children: [
279
+ { type: "icon", name: "book-open", size: "lg" },
280
+ { type: "typography", variant: "h2", text: "Published" },
281
+ { type: "badge", label: "Live", color: "success" }
282
+ ]
283
+ },
284
+ { type: "divider" },
285
+ { type: "typography", variant: "h3", text: "@entity.title" },
286
+ { type: "typography", variant: "body", text: "@entity.body" },
287
+ {
288
+ type: "stack",
289
+ direction: "horizontal",
290
+ gap: "md",
291
+ children: [
292
+ {
293
+ type: "stack",
294
+ direction: "horizontal",
295
+ gap: "xs",
296
+ align: "center",
297
+ children: [
298
+ { type: "icon", name: "type", size: "sm" },
299
+ { type: "typography", variant: "caption", text: "@entity.author" }
300
+ ]
301
+ },
302
+ {
303
+ type: "stack",
304
+ direction: "horizontal",
305
+ gap: "xs",
306
+ align: "center",
307
+ children: [
308
+ { type: "icon", name: "calendar", size: "sm" },
309
+ { type: "typography", variant: "caption", text: "@entity.publishedAt" }
310
+ ]
311
+ }
312
+ ]
313
+ },
314
+ { type: "button", label: "Back to Articles", event: "BACK_TO_LIST", variant: "secondary" }
315
+ ]
316
+ }]
317
+ ]
318
+ },
319
+ {
320
+ from: "editing",
321
+ to: "browsing",
322
+ event: "BACK_TO_LIST",
323
+ effects: [
324
+ ["fetch", "Article"],
325
+ ...articleBrowsingMainEffects
326
+ ]
327
+ },
328
+ {
329
+ from: "published",
330
+ to: "browsing",
331
+ event: "BACK_TO_LIST",
332
+ effects: [
333
+ ["fetch", "Article"],
334
+ ...articleBrowsingMainEffects
335
+ ]
336
+ }
337
+ ]
338
+ }
339
+ }
340
+ ],
341
+ pages: [
342
+ {
343
+ name: "ArticlesPage",
344
+ path: "/articles",
345
+ isInitial: true,
346
+ traits: [{ ref: "ArticleWorkflow" }]
347
+ }
348
+ ]
349
+ }
350
+ ]
351
+ };
352
+ var readerBrowsingMainEffects = [
353
+ ["render-ui", "main", {
354
+ type: "stack",
355
+ direction: "vertical",
356
+ gap: "lg",
357
+ children: [
358
+ {
359
+ type: "stack",
360
+ direction: "horizontal",
361
+ justify: "space-between",
362
+ align: "center",
363
+ children: [
364
+ {
365
+ type: "stack",
366
+ direction: "horizontal",
367
+ gap: "sm",
368
+ align: "center",
369
+ children: [
370
+ { type: "icon", name: "book-open", size: "lg" },
371
+ { type: "typography", variant: "h2", text: "Library" }
372
+ ]
373
+ },
374
+ { type: "badge", label: "Reading Hub", color: "accent" }
375
+ ]
376
+ },
377
+ { type: "divider" },
378
+ {
379
+ type: "data-list",
380
+ entity: "ReadingState",
381
+ fields: ["articleId", "fontSize", "theme"],
382
+ itemActions: [
383
+ { label: "Read", event: "OPEN_ARTICLE", icon: "book-open" }
384
+ ]
385
+ }
386
+ ]
387
+ }]
388
+ ];
389
+ var READER_BEHAVIOR = {
390
+ name: "std-reader",
391
+ version: "1.0.0",
392
+ description: "Reading experience with customizable display settings",
393
+ theme: contentAmberTheme,
394
+ orbitals: [
395
+ {
396
+ name: "ReaderOrbital",
397
+ entity: {
398
+ name: "ReadingState",
399
+ persistence: "persistent",
400
+ collection: "reading_states",
401
+ fields: [
402
+ { name: "id", type: "string", required: true },
403
+ { name: "articleId", type: "string", default: "" },
404
+ { name: "scrollPosition", type: "number", default: 0 },
405
+ { name: "fontSize", type: "number", default: 16 },
406
+ { name: "theme", type: "string", default: "light" }
407
+ ]
408
+ },
409
+ traits: [
410
+ {
411
+ name: "ReaderControl",
412
+ linkedEntity: "ReadingState",
413
+ category: "interaction",
414
+ stateMachine: {
415
+ states: [
416
+ { name: "browsing", isInitial: true },
417
+ { name: "reading" }
418
+ ],
419
+ events: [
420
+ { key: "INIT", name: "Initialize" },
421
+ { key: "OPEN_ARTICLE", name: "Open Article", payloadSchema: [
422
+ { name: "articleId", type: "string", required: true }
423
+ ] },
424
+ { key: "UPDATE_SETTINGS", name: "Update Settings", payloadSchema: [
425
+ { name: "fontSize", type: "number", required: true }
426
+ ] },
427
+ { key: "BACK_TO_LIST", name: "Back to List" }
428
+ ],
429
+ transitions: [
430
+ {
431
+ from: "browsing",
432
+ to: "browsing",
433
+ event: "INIT",
434
+ effects: [
435
+ ["fetch", "ReadingState"],
436
+ ...readerBrowsingMainEffects
437
+ ]
438
+ },
439
+ {
440
+ from: "browsing",
441
+ to: "reading",
442
+ event: "OPEN_ARTICLE",
443
+ effects: [
444
+ ["fetch", "ReadingState"],
445
+ ["set", "@entity.articleId", "@payload.articleId"],
446
+ ["render-ui", "main", {
447
+ type: "stack",
448
+ direction: "vertical",
449
+ gap: "md",
450
+ children: [
451
+ {
452
+ type: "stack",
453
+ direction: "horizontal",
454
+ justify: "space-between",
455
+ align: "center",
456
+ children: [
457
+ {
458
+ type: "stack",
459
+ direction: "horizontal",
460
+ gap: "sm",
461
+ align: "center",
462
+ children: [
463
+ { type: "icon", name: "eye", size: "lg" },
464
+ { type: "typography", variant: "h2", text: "Reading" }
465
+ ]
466
+ },
467
+ { type: "button", label: "Back to Library", event: "BACK_TO_LIST", variant: "secondary" }
468
+ ]
469
+ },
470
+ { type: "divider" },
471
+ { type: "meter", value: "@entity.scrollPosition", max: 100, label: "Reading Progress" },
472
+ {
473
+ type: "stack",
474
+ direction: "horizontal",
475
+ gap: "lg",
476
+ children: [
477
+ {
478
+ type: "stack",
479
+ direction: "horizontal",
480
+ gap: "xs",
481
+ align: "center",
482
+ children: [
483
+ { type: "icon", name: "type", size: "sm" },
484
+ { type: "typography", variant: "caption", text: "Font Size" },
485
+ { type: "badge", label: "@entity.fontSize", color: "primary" }
486
+ ]
487
+ },
488
+ {
489
+ type: "stack",
490
+ direction: "horizontal",
491
+ gap: "xs",
492
+ align: "center",
493
+ children: [
494
+ { type: "icon", name: "image", size: "sm" },
495
+ { type: "typography", variant: "caption", text: "Theme" },
496
+ { type: "badge", label: "@entity.theme", color: "accent" }
497
+ ]
498
+ }
499
+ ]
500
+ },
501
+ { type: "typography", variant: "body", text: "@entity.articleId" }
502
+ ]
503
+ }]
504
+ ]
505
+ },
506
+ {
507
+ from: "reading",
508
+ to: "reading",
509
+ event: "UPDATE_SETTINGS",
510
+ effects: [
511
+ ["fetch", "ReadingState"],
512
+ ["set", "@entity.fontSize", "@payload.fontSize"],
513
+ ["render-ui", "main", {
514
+ type: "stack",
515
+ direction: "vertical",
516
+ gap: "md",
517
+ children: [
518
+ {
519
+ type: "stack",
520
+ direction: "horizontal",
521
+ justify: "space-between",
522
+ align: "center",
523
+ children: [
524
+ {
525
+ type: "stack",
526
+ direction: "horizontal",
527
+ gap: "sm",
528
+ align: "center",
529
+ children: [
530
+ { type: "icon", name: "eye", size: "lg" },
531
+ { type: "typography", variant: "h2", text: "Reading" },
532
+ { type: "badge", label: "Settings Updated", color: "success" }
533
+ ]
534
+ },
535
+ { type: "button", label: "Back to Library", event: "BACK_TO_LIST", variant: "secondary" }
536
+ ]
537
+ },
538
+ { type: "divider" },
539
+ { type: "meter", value: "@entity.scrollPosition", max: 100, label: "Reading Progress" },
540
+ {
541
+ type: "stack",
542
+ direction: "horizontal",
543
+ gap: "lg",
544
+ children: [
545
+ {
546
+ type: "stack",
547
+ direction: "horizontal",
548
+ gap: "xs",
549
+ align: "center",
550
+ children: [
551
+ { type: "icon", name: "type", size: "sm" },
552
+ { type: "typography", variant: "caption", text: "Font Size" },
553
+ { type: "badge", label: "@entity.fontSize", color: "primary" }
554
+ ]
555
+ },
556
+ {
557
+ type: "stack",
558
+ direction: "horizontal",
559
+ gap: "xs",
560
+ align: "center",
561
+ children: [
562
+ { type: "icon", name: "image", size: "sm" },
563
+ { type: "typography", variant: "caption", text: "Theme" },
564
+ { type: "badge", label: "@entity.theme", color: "accent" }
565
+ ]
566
+ }
567
+ ]
568
+ },
569
+ { type: "typography", variant: "body", text: "@entity.articleId" }
570
+ ]
571
+ }]
572
+ ]
573
+ },
574
+ {
575
+ from: "reading",
576
+ to: "browsing",
577
+ event: "BACK_TO_LIST",
578
+ effects: [
579
+ ["fetch", "ReadingState"],
580
+ ...readerBrowsingMainEffects
581
+ ]
582
+ }
583
+ ]
584
+ }
585
+ }
586
+ ],
587
+ pages: [
588
+ {
589
+ name: "ReaderPage",
590
+ path: "/reader",
591
+ isInitial: true,
592
+ traits: [{ ref: "ReaderControl" }]
593
+ }
594
+ ]
595
+ }
596
+ ]
597
+ };
598
+ var bookmarkBrowsingMainEffects = [
599
+ ["render-ui", "main", {
600
+ type: "stack",
601
+ direction: "vertical",
602
+ gap: "lg",
603
+ children: [
604
+ {
605
+ type: "stack",
606
+ direction: "horizontal",
607
+ justify: "space-between",
608
+ align: "center",
609
+ children: [
610
+ {
611
+ type: "stack",
612
+ direction: "horizontal",
613
+ gap: "sm",
614
+ align: "center",
615
+ children: [
616
+ { type: "icon", name: "tag", size: "lg" },
617
+ { type: "typography", variant: "h2", text: "Bookmarks" }
618
+ ]
619
+ },
620
+ { type: "button", label: "Create Bookmark", event: "CREATE", variant: "primary", icon: "tag" }
621
+ ]
622
+ },
623
+ { type: "divider" },
624
+ { type: "stats", entity: "Bookmark" },
625
+ { type: "search-input", placeholder: "Filter by title, URL, or category...", event: "VIEW" },
626
+ {
627
+ type: "data-list",
628
+ entity: "Bookmark",
629
+ fields: ["title", "url", "category", "createdAt"],
630
+ itemActions: [
631
+ { label: "View", event: "VIEW", icon: "eye" }
632
+ ]
633
+ }
634
+ ]
635
+ }]
636
+ ];
637
+ var BOOKMARK_BEHAVIOR = {
638
+ name: "std-bookmark",
639
+ version: "1.0.0",
640
+ description: "Bookmark management with create, browse, and view",
641
+ theme: contentAmberTheme,
642
+ orbitals: [
643
+ {
644
+ name: "BookmarkOrbital",
645
+ entity: {
646
+ name: "Bookmark",
647
+ persistence: "persistent",
648
+ collection: "bookmarks",
649
+ fields: [
650
+ { name: "id", type: "string", required: true },
651
+ { name: "title", type: "string", default: "" },
652
+ { name: "url", type: "string", default: "" },
653
+ { name: "category", type: "string", default: "" },
654
+ { name: "createdAt", type: "string", default: "" }
655
+ ]
656
+ },
657
+ traits: [
658
+ {
659
+ name: "BookmarkControl",
660
+ linkedEntity: "Bookmark",
661
+ category: "interaction",
662
+ stateMachine: {
663
+ states: [
664
+ { name: "browsing", isInitial: true },
665
+ { name: "creating" },
666
+ { name: "viewing" }
667
+ ],
668
+ events: [
669
+ { key: "INIT", name: "Initialize" },
670
+ { key: "CREATE", name: "Create Bookmark" },
671
+ { key: "SAVE", name: "Save Bookmark", payloadSchema: [
672
+ { name: "title", type: "string", required: true },
673
+ { name: "url", type: "string", required: true },
674
+ { name: "category", type: "string", required: true }
675
+ ] },
676
+ { key: "VIEW", name: "View Bookmark", payloadSchema: [
677
+ { name: "id", type: "string", required: true }
678
+ ] },
679
+ { key: "CLOSE", name: "Close" },
680
+ { key: "CANCEL", name: "Cancel" }
681
+ ],
682
+ transitions: [
683
+ {
684
+ from: "browsing",
685
+ to: "browsing",
686
+ event: "INIT",
687
+ effects: [
688
+ ["fetch", "Bookmark"],
689
+ ...bookmarkBrowsingMainEffects
690
+ ]
691
+ },
692
+ {
693
+ from: "browsing",
694
+ to: "creating",
695
+ event: "CREATE",
696
+ effects: [
697
+ ["fetch", "Bookmark"],
698
+ ["render-ui", "modal", {
699
+ type: "stack",
700
+ direction: "vertical",
701
+ gap: "md",
702
+ children: [
703
+ {
704
+ type: "stack",
705
+ direction: "horizontal",
706
+ gap: "sm",
707
+ align: "center",
708
+ children: [
709
+ { type: "icon", name: "tag", size: "md" },
710
+ { type: "typography", variant: "h3", text: "New Bookmark" }
711
+ ]
712
+ },
713
+ { type: "divider" },
714
+ {
715
+ type: "form-section",
716
+ entity: "Bookmark",
717
+ submitEvent: "SAVE",
718
+ cancelEvent: "CANCEL"
719
+ }
720
+ ]
721
+ }]
722
+ ]
723
+ },
724
+ {
725
+ from: "creating",
726
+ to: "browsing",
727
+ event: "SAVE",
728
+ effects: [
729
+ ["fetch", "Bookmark"],
730
+ ["set", "@entity.title", "@payload.title"],
731
+ ["set", "@entity.url", "@payload.url"],
732
+ ["set", "@entity.category", "@payload.category"],
733
+ ["render-ui", "modal", null],
734
+ ...bookmarkBrowsingMainEffects
735
+ ]
736
+ },
737
+ { from: "creating", to: "browsing", event: "CLOSE", effects: [["render-ui", "modal", null]] },
738
+ { from: "creating", to: "browsing", event: "CANCEL", effects: [["render-ui", "modal", null]] },
739
+ {
740
+ from: "browsing",
741
+ to: "viewing",
742
+ event: "VIEW",
743
+ effects: [
744
+ ["fetch", "Bookmark"],
745
+ ["render-ui", "modal", {
746
+ type: "stack",
747
+ direction: "vertical",
748
+ gap: "md",
749
+ children: [
750
+ {
751
+ type: "stack",
752
+ direction: "horizontal",
753
+ justify: "space-between",
754
+ align: "center",
755
+ children: [
756
+ { type: "typography", variant: "h3", text: "@entity.title" },
757
+ { type: "button", label: "Close", event: "CLOSE", variant: "ghost" }
758
+ ]
759
+ },
760
+ { type: "divider" },
761
+ {
762
+ type: "stack",
763
+ direction: "vertical",
764
+ gap: "sm",
765
+ children: [
766
+ {
767
+ type: "stack",
768
+ direction: "horizontal",
769
+ gap: "xs",
770
+ align: "center",
771
+ children: [
772
+ { type: "icon", name: "tag", size: "sm" },
773
+ { type: "typography", variant: "caption", text: "URL" }
774
+ ]
775
+ },
776
+ { type: "typography", variant: "body", text: "@entity.url" },
777
+ {
778
+ type: "stack",
779
+ direction: "horizontal",
780
+ gap: "md",
781
+ children: [
782
+ { type: "badge", label: "@entity.category", color: "primary" },
783
+ {
784
+ type: "stack",
785
+ direction: "horizontal",
786
+ gap: "xs",
787
+ align: "center",
788
+ children: [
789
+ { type: "icon", name: "calendar", size: "sm" },
790
+ { type: "typography", variant: "caption", text: "@entity.createdAt" }
791
+ ]
792
+ }
793
+ ]
794
+ }
795
+ ]
796
+ }
797
+ ]
798
+ }]
799
+ ]
800
+ },
801
+ { from: "viewing", to: "browsing", event: "CLOSE", effects: [["render-ui", "modal", null]] },
802
+ { from: "viewing", to: "browsing", event: "CANCEL", effects: [["render-ui", "modal", null]] }
803
+ ]
804
+ }
805
+ }
806
+ ],
807
+ pages: [
808
+ {
809
+ name: "BookmarksPage",
810
+ path: "/bookmarks",
811
+ isInitial: true,
812
+ traits: [{ ref: "BookmarkControl" }]
813
+ }
814
+ ]
815
+ }
816
+ ]
817
+ };
818
+ var annotationBrowsingMainEffects = [
819
+ ["render-ui", "main", {
820
+ type: "stack",
821
+ direction: "vertical",
822
+ gap: "lg",
823
+ children: [
824
+ {
825
+ type: "stack",
826
+ direction: "horizontal",
827
+ justify: "space-between",
828
+ align: "center",
829
+ children: [
830
+ {
831
+ type: "stack",
832
+ direction: "horizontal",
833
+ gap: "sm",
834
+ align: "center",
835
+ children: [
836
+ { type: "icon", name: "pencil", size: "lg" },
837
+ { type: "typography", variant: "h2", text: "Annotations" }
838
+ ]
839
+ },
840
+ { type: "button", label: "Add Annotation", event: "ADD_ANNOTATION", variant: "primary", icon: "pencil" }
841
+ ]
842
+ },
843
+ { type: "divider" },
844
+ { type: "stats", entity: "Annotation" },
845
+ { type: "search-input", placeholder: "Search highlights and notes...", event: "VIEW_ANNOTATION" },
846
+ {
847
+ type: "data-grid",
848
+ entity: "Annotation",
849
+ columns: [
850
+ { field: "text", label: "Highlighted Text" },
851
+ { field: "note", label: "Note" },
852
+ { field: "color", label: "Color" },
853
+ { field: "pageNumber", label: "Page" }
854
+ ],
855
+ itemActions: [
856
+ { label: "View", event: "VIEW_ANNOTATION", icon: "eye" }
857
+ ]
858
+ }
859
+ ]
860
+ }]
861
+ ];
862
+ var ANNOTATION_BEHAVIOR = {
863
+ name: "std-annotation",
864
+ version: "1.0.0",
865
+ description: "Text annotation with highlight, note, and color coding",
866
+ theme: contentAmberTheme,
867
+ orbitals: [
868
+ {
869
+ name: "AnnotationOrbital",
870
+ entity: {
871
+ name: "Annotation",
872
+ persistence: "persistent",
873
+ collection: "annotations",
874
+ fields: [
875
+ { name: "id", type: "string", required: true },
876
+ { name: "text", type: "string", default: "" },
877
+ { name: "note", type: "string", default: "" },
878
+ { name: "color", type: "string", default: "yellow" },
879
+ { name: "pageNumber", type: "number", default: 1 }
880
+ ]
881
+ },
882
+ traits: [
883
+ {
884
+ name: "AnnotationControl",
885
+ linkedEntity: "Annotation",
886
+ category: "interaction",
887
+ stateMachine: {
888
+ states: [
889
+ { name: "browsing", isInitial: true },
890
+ { name: "annotating" },
891
+ { name: "viewing" }
892
+ ],
893
+ events: [
894
+ { key: "INIT", name: "Initialize" },
895
+ { key: "ADD_ANNOTATION", name: "Add Annotation" },
896
+ { key: "SAVE_ANNOTATION", name: "Save Annotation", payloadSchema: [
897
+ { name: "text", type: "string", required: true },
898
+ { name: "note", type: "string", required: true },
899
+ { name: "color", type: "string", required: true }
900
+ ] },
901
+ { key: "VIEW_ANNOTATION", name: "View Annotation", payloadSchema: [
902
+ { name: "id", type: "string", required: true }
903
+ ] },
904
+ { key: "CLOSE", name: "Close" },
905
+ { key: "CANCEL", name: "Cancel" }
906
+ ],
907
+ transitions: [
908
+ {
909
+ from: "browsing",
910
+ to: "browsing",
911
+ event: "INIT",
912
+ effects: [
913
+ ["fetch", "Annotation"],
914
+ ...annotationBrowsingMainEffects
915
+ ]
916
+ },
917
+ {
918
+ from: "browsing",
919
+ to: "annotating",
920
+ event: "ADD_ANNOTATION",
921
+ effects: [
922
+ ["fetch", "Annotation"],
923
+ ["render-ui", "modal", {
924
+ type: "stack",
925
+ direction: "vertical",
926
+ gap: "md",
927
+ children: [
928
+ {
929
+ type: "stack",
930
+ direction: "horizontal",
931
+ gap: "sm",
932
+ align: "center",
933
+ children: [
934
+ { type: "icon", name: "pencil", size: "md" },
935
+ { type: "typography", variant: "h3", text: "New Annotation" }
936
+ ]
937
+ },
938
+ { type: "divider" },
939
+ {
940
+ type: "form-section",
941
+ entity: "Annotation",
942
+ submitEvent: "SAVE_ANNOTATION",
943
+ cancelEvent: "CANCEL"
944
+ }
945
+ ]
946
+ }]
947
+ ]
948
+ },
949
+ {
950
+ from: "annotating",
951
+ to: "browsing",
952
+ event: "SAVE_ANNOTATION",
953
+ effects: [
954
+ ["fetch", "Annotation"],
955
+ ["set", "@entity.text", "@payload.text"],
956
+ ["set", "@entity.note", "@payload.note"],
957
+ ["set", "@entity.color", "@payload.color"],
958
+ ["render-ui", "modal", null],
959
+ ...annotationBrowsingMainEffects
960
+ ]
961
+ },
962
+ { from: "annotating", to: "browsing", event: "CLOSE", effects: [["render-ui", "modal", null]] },
963
+ { from: "annotating", to: "browsing", event: "CANCEL", effects: [["render-ui", "modal", null]] },
964
+ {
965
+ from: "browsing",
966
+ to: "viewing",
967
+ event: "VIEW_ANNOTATION",
968
+ effects: [
969
+ ["fetch", "Annotation"],
970
+ ["render-ui", "modal", {
971
+ type: "stack",
972
+ direction: "vertical",
973
+ gap: "md",
974
+ children: [
975
+ {
976
+ type: "stack",
977
+ direction: "horizontal",
978
+ justify: "space-between",
979
+ align: "center",
980
+ children: [
981
+ {
982
+ type: "stack",
983
+ direction: "horizontal",
984
+ gap: "sm",
985
+ align: "center",
986
+ children: [
987
+ { type: "icon", name: "pencil", size: "md" },
988
+ { type: "typography", variant: "h3", text: "Annotation Detail" }
989
+ ]
990
+ },
991
+ { type: "button", label: "Close", event: "CLOSE", variant: "ghost" }
992
+ ]
993
+ },
994
+ { type: "divider" },
995
+ {
996
+ type: "stack",
997
+ direction: "vertical",
998
+ gap: "sm",
999
+ children: [
1000
+ { type: "typography", variant: "label", text: "Highlighted Text" },
1001
+ { type: "typography", variant: "body", text: "@entity.text" },
1002
+ { type: "divider" },
1003
+ { type: "typography", variant: "label", text: "Note" },
1004
+ { type: "typography", variant: "body", text: "@entity.note" },
1005
+ {
1006
+ type: "stack",
1007
+ direction: "horizontal",
1008
+ gap: "md",
1009
+ children: [
1010
+ { type: "badge", label: "@entity.color", color: "accent" },
1011
+ {
1012
+ type: "stack",
1013
+ direction: "horizontal",
1014
+ gap: "xs",
1015
+ align: "center",
1016
+ children: [
1017
+ { type: "icon", name: "file-text", size: "sm" },
1018
+ { type: "typography", variant: "caption", text: "Page" },
1019
+ { type: "badge", label: "@entity.pageNumber", color: "primary" }
1020
+ ]
1021
+ }
1022
+ ]
1023
+ }
1024
+ ]
1025
+ }
1026
+ ]
1027
+ }]
1028
+ ]
1029
+ },
1030
+ { from: "viewing", to: "browsing", event: "CLOSE", effects: [["render-ui", "modal", null]] },
1031
+ { from: "viewing", to: "browsing", event: "CANCEL", effects: [["render-ui", "modal", null]] }
1032
+ ]
1033
+ }
1034
+ }
1035
+ ],
1036
+ pages: [
1037
+ {
1038
+ name: "AnnotationsPage",
1039
+ path: "/annotations",
1040
+ isInitial: true,
1041
+ traits: [{ ref: "AnnotationControl" }]
1042
+ }
1043
+ ]
1044
+ }
1045
+ ]
1046
+ };
1047
+ var feedBrowsingMainEffects = [
1048
+ ["render-ui", "main", {
1049
+ type: "stack",
1050
+ direction: "vertical",
1051
+ gap: "lg",
1052
+ children: [
1053
+ {
1054
+ type: "stack",
1055
+ direction: "horizontal",
1056
+ justify: "space-between",
1057
+ align: "center",
1058
+ children: [
1059
+ {
1060
+ type: "stack",
1061
+ direction: "horizontal",
1062
+ gap: "sm",
1063
+ align: "center",
1064
+ children: [
1065
+ { type: "icon", name: "file-text", size: "lg" },
1066
+ { type: "typography", variant: "h2", text: "Content Feed" }
1067
+ ]
1068
+ },
1069
+ { type: "badge", label: "Live", color: "success" }
1070
+ ]
1071
+ },
1072
+ { type: "divider" },
1073
+ { type: "stats", entity: "FeedItem" },
1074
+ { type: "search-input", placeholder: "Search feed by title or source...", event: "READ_ITEM" },
1075
+ {
1076
+ type: "data-list",
1077
+ entity: "FeedItem",
1078
+ fields: ["title", "summary", "source", "publishedAt", "isRead"],
1079
+ itemActions: [
1080
+ { label: "Read", event: "READ_ITEM", icon: "book-open" }
1081
+ ]
1082
+ }
1083
+ ]
1084
+ }]
1085
+ ];
1086
+ var CONTENT_FEED_BEHAVIOR = {
1087
+ name: "std-content-feed",
1088
+ version: "1.0.0",
1089
+ description: "Content feed with read tracking and archiving",
1090
+ theme: contentAmberTheme,
1091
+ orbitals: [
1092
+ {
1093
+ name: "ContentFeedOrbital",
1094
+ entity: {
1095
+ name: "FeedItem",
1096
+ persistence: "persistent",
1097
+ collection: "feed_items",
1098
+ fields: [
1099
+ { name: "id", type: "string", required: true },
1100
+ { name: "title", type: "string", default: "" },
1101
+ { name: "summary", type: "string", default: "" },
1102
+ { name: "source", type: "string", default: "" },
1103
+ { name: "publishedAt", type: "string", default: "" },
1104
+ { name: "isRead", type: "boolean", default: false }
1105
+ ]
1106
+ },
1107
+ traits: [
1108
+ {
1109
+ name: "FeedControl",
1110
+ linkedEntity: "FeedItem",
1111
+ category: "interaction",
1112
+ stateMachine: {
1113
+ states: [
1114
+ { name: "browsing", isInitial: true },
1115
+ { name: "reading" },
1116
+ { name: "archiving" }
1117
+ ],
1118
+ events: [
1119
+ { key: "INIT", name: "Initialize" },
1120
+ { key: "READ_ITEM", name: "Read Item", payloadSchema: [
1121
+ { name: "id", type: "string", required: true }
1122
+ ] },
1123
+ { key: "ARCHIVE_ITEM", name: "Archive Item" },
1124
+ { key: "CONFIRM_ARCHIVE", name: "Confirm Archive" },
1125
+ { key: "BACK_TO_FEED", name: "Back to Feed" },
1126
+ { key: "CLOSE", name: "Close" },
1127
+ { key: "CANCEL", name: "Cancel" }
1128
+ ],
1129
+ transitions: [
1130
+ {
1131
+ from: "browsing",
1132
+ to: "browsing",
1133
+ event: "INIT",
1134
+ effects: [
1135
+ ["fetch", "FeedItem"],
1136
+ ...feedBrowsingMainEffects
1137
+ ]
1138
+ },
1139
+ {
1140
+ from: "browsing",
1141
+ to: "reading",
1142
+ event: "READ_ITEM",
1143
+ effects: [
1144
+ ["fetch", "FeedItem"],
1145
+ ["set", "@entity.isRead", true],
1146
+ ["render-ui", "main", {
1147
+ type: "stack",
1148
+ direction: "vertical",
1149
+ gap: "md",
1150
+ children: [
1151
+ {
1152
+ type: "stack",
1153
+ direction: "horizontal",
1154
+ justify: "space-between",
1155
+ align: "center",
1156
+ children: [
1157
+ {
1158
+ type: "stack",
1159
+ direction: "horizontal",
1160
+ gap: "sm",
1161
+ align: "center",
1162
+ children: [
1163
+ { type: "icon", name: "book-open", size: "lg" },
1164
+ { type: "typography", variant: "h2", text: "@entity.title" }
1165
+ ]
1166
+ },
1167
+ {
1168
+ type: "stack",
1169
+ direction: "horizontal",
1170
+ gap: "sm",
1171
+ children: [
1172
+ { type: "button", label: "Archive", event: "ARCHIVE_ITEM", variant: "secondary" },
1173
+ { type: "button", label: "Back to Feed", event: "BACK_TO_FEED", variant: "ghost" }
1174
+ ]
1175
+ }
1176
+ ]
1177
+ },
1178
+ { type: "divider" },
1179
+ { type: "typography", variant: "body", text: "@entity.summary" },
1180
+ {
1181
+ type: "stack",
1182
+ direction: "horizontal",
1183
+ gap: "md",
1184
+ children: [
1185
+ {
1186
+ type: "stack",
1187
+ direction: "horizontal",
1188
+ gap: "xs",
1189
+ align: "center",
1190
+ children: [
1191
+ { type: "icon", name: "file-text", size: "sm" },
1192
+ { type: "typography", variant: "caption", text: "@entity.source" }
1193
+ ]
1194
+ },
1195
+ {
1196
+ type: "stack",
1197
+ direction: "horizontal",
1198
+ gap: "xs",
1199
+ align: "center",
1200
+ children: [
1201
+ { type: "icon", name: "calendar", size: "sm" },
1202
+ { type: "typography", variant: "caption", text: "@entity.publishedAt" }
1203
+ ]
1204
+ },
1205
+ { type: "badge", label: "Read", color: "success" }
1206
+ ]
1207
+ }
1208
+ ]
1209
+ }]
1210
+ ]
1211
+ },
1212
+ {
1213
+ from: "reading",
1214
+ to: "archiving",
1215
+ event: "ARCHIVE_ITEM",
1216
+ effects: [
1217
+ ["render-ui", "modal", {
1218
+ type: "stack",
1219
+ direction: "vertical",
1220
+ gap: "md",
1221
+ children: [
1222
+ {
1223
+ type: "stack",
1224
+ direction: "horizontal",
1225
+ gap: "sm",
1226
+ align: "center",
1227
+ children: [
1228
+ { type: "icon", name: "tag", size: "md" },
1229
+ { type: "typography", variant: "h3", text: "Archive Item" }
1230
+ ]
1231
+ },
1232
+ { type: "divider" },
1233
+ { type: "typography", variant: "body", text: "Are you sure you want to archive this item?" },
1234
+ {
1235
+ type: "stack",
1236
+ direction: "horizontal",
1237
+ gap: "sm",
1238
+ justify: "flex-end",
1239
+ children: [
1240
+ { type: "button", label: "Cancel", event: "CANCEL", variant: "secondary" },
1241
+ { type: "button", label: "Confirm", event: "CONFIRM_ARCHIVE", variant: "primary" }
1242
+ ]
1243
+ }
1244
+ ]
1245
+ }]
1246
+ ]
1247
+ },
1248
+ {
1249
+ from: "archiving",
1250
+ to: "browsing",
1251
+ event: "CONFIRM_ARCHIVE",
1252
+ effects: [
1253
+ ["fetch", "FeedItem"],
1254
+ ["render-ui", "modal", null],
1255
+ ...feedBrowsingMainEffects
1256
+ ]
1257
+ },
1258
+ { from: "archiving", to: "reading", event: "CLOSE", effects: [["render-ui", "modal", null]] },
1259
+ { from: "archiving", to: "reading", event: "CANCEL", effects: [["render-ui", "modal", null]] },
1260
+ {
1261
+ from: "reading",
1262
+ to: "browsing",
1263
+ event: "BACK_TO_FEED",
1264
+ effects: [
1265
+ ["fetch", "FeedItem"],
1266
+ ...feedBrowsingMainEffects
1267
+ ]
1268
+ }
1269
+ ]
1270
+ }
1271
+ }
1272
+ ],
1273
+ pages: [
1274
+ {
1275
+ name: "FeedPage",
1276
+ path: "/feed",
1277
+ isInitial: true,
1278
+ traits: [{ ref: "FeedControl" }]
1279
+ }
1280
+ ]
1281
+ }
1282
+ ]
1283
+ };
1284
+ var CONTENT_BEHAVIORS = [
1285
+ ARTICLE_BEHAVIOR,
1286
+ READER_BEHAVIOR,
1287
+ BOOKMARK_BEHAVIOR,
1288
+ ANNOTATION_BEHAVIOR,
1289
+ CONTENT_FEED_BEHAVIOR
1290
+ ];
1291
+
1292
+ export { ANNOTATION_BEHAVIOR, ARTICLE_BEHAVIOR, BOOKMARK_BEHAVIOR, CONTENT_BEHAVIORS, CONTENT_FEED_BEHAVIOR, READER_BEHAVIOR };
1293
+ //# sourceMappingURL=content.js.map
1294
+ //# sourceMappingURL=content.js.map