@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,622 @@
1
+ // behaviors/domain/game-2d-puzzle.ts
2
+ var PUZZLE_THEME = {
3
+ name: "game-puzzle-yellow",
4
+ tokens: {
5
+ colors: {
6
+ primary: "#ca8a04",
7
+ "primary-hover": "#a16207",
8
+ "primary-foreground": "#ffffff",
9
+ accent: "#eab308",
10
+ "accent-foreground": "#000000",
11
+ success: "#22c55e",
12
+ warning: "#f59e0b",
13
+ error: "#ef4444"
14
+ }
15
+ }
16
+ };
17
+ var gridPuzzleMainEffect = ["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
18
+ // Header: puzzle icon + title
19
+ { type: "stack", direction: "horizontal", justify: "space-between", children: [
20
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
21
+ { type: "icon", name: "puzzle", size: "lg" },
22
+ { type: "typography", variant: "h2", content: "Grid Puzzle" }
23
+ ] },
24
+ { type: "badge", label: "Playing", variant: "success", icon: "zap" }
25
+ ] },
26
+ { type: "divider" },
27
+ // Stats row: grid size, moves, matches
28
+ { type: "stack", direction: "horizontal", gap: "md", children: [
29
+ { type: "stats", label: "Grid Size", icon: "grid-3x3", value: "@entity.gridSize" },
30
+ { type: "stats", label: "Moves", icon: "target", value: "@entity.moves" },
31
+ { type: "stats", label: "Matches", icon: "star", value: "@entity.matchCount" }
32
+ ] },
33
+ { type: "divider" },
34
+ // Puzzle grid area
35
+ {
36
+ type: "data-grid",
37
+ entity: "GridPuzzleData",
38
+ columns: 3,
39
+ fields: [
40
+ { name: "gridSize", label: "Grid", icon: "grid-3x3", variant: "h4" },
41
+ { name: "moves", label: "Moves", icon: "target", variant: "body" },
42
+ { name: "matchCount", label: "Matches", icon: "star", variant: "badge" }
43
+ ]
44
+ }
45
+ ] }];
46
+ var gridPuzzleMatchedMainEffect = ["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
47
+ // Header with match indicator
48
+ { type: "stack", direction: "horizontal", justify: "space-between", children: [
49
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
50
+ { type: "icon", name: "star", size: "lg" },
51
+ { type: "typography", variant: "h2", content: "Match Found!" }
52
+ ] },
53
+ { type: "badge", label: "Matched", variant: "warning", icon: "zap" }
54
+ ] },
55
+ { type: "divider" },
56
+ // Stats row
57
+ { type: "stack", direction: "horizontal", gap: "md", children: [
58
+ { type: "stats", label: "Moves", icon: "target", value: "@entity.moves" },
59
+ { type: "stats", label: "Matches", icon: "star", value: "@entity.matchCount" }
60
+ ] },
61
+ { type: "divider" },
62
+ {
63
+ type: "data-grid",
64
+ entity: "GridPuzzleData",
65
+ columns: 3,
66
+ fields: [
67
+ { name: "gridSize", label: "Grid", icon: "grid-3x3", variant: "h4" },
68
+ { name: "moves", label: "Moves", icon: "target", variant: "body" },
69
+ { name: "matchCount", label: "Matches", icon: "star", variant: "badge" }
70
+ ]
71
+ }
72
+ ] }];
73
+ var gridPuzzleCompletedMainEffect = ["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
74
+ // Victory header
75
+ { type: "stack", direction: "horizontal", justify: "center", gap: "sm", children: [
76
+ { type: "icon", name: "trophy", size: "xl" },
77
+ { type: "typography", variant: "h1", content: "Puzzle Complete!" }
78
+ ] },
79
+ { type: "divider" },
80
+ // Final stats
81
+ { type: "stack", direction: "horizontal", gap: "md", children: [
82
+ { type: "stats", label: "Total Moves", icon: "target", value: "@entity.moves" },
83
+ { type: "stats", label: "Total Matches", icon: "star", value: "@entity.matchCount" }
84
+ ] },
85
+ { type: "divider" },
86
+ // Restart button
87
+ { type: "stack", direction: "horizontal", justify: "center", children: [
88
+ { type: "button", label: "Play Again", icon: "refresh-cw", variant: "primary", action: "RESTART" }
89
+ ] }
90
+ ] }];
91
+ var GRID_PUZZLE_BEHAVIOR = {
92
+ name: "std-grid-puzzle",
93
+ version: "1.0.0",
94
+ description: "Grid-based puzzle with match detection",
95
+ theme: PUZZLE_THEME,
96
+ orbitals: [
97
+ {
98
+ name: "GridPuzzleOrbital",
99
+ entity: {
100
+ name: "GridPuzzleData",
101
+ persistence: "runtime",
102
+ fields: [
103
+ { name: "id", type: "string", required: true },
104
+ { name: "gridSize", type: "number", default: 8 },
105
+ { name: "moves", type: "number", default: 0 },
106
+ { name: "matchCount", type: "number", default: 0 },
107
+ { name: "isComplete", type: "boolean", default: false }
108
+ ]
109
+ },
110
+ traits: [
111
+ {
112
+ name: "GridPuzzle",
113
+ linkedEntity: "GridPuzzleData",
114
+ category: "interaction",
115
+ stateMachine: {
116
+ states: [
117
+ { name: "Playing", isInitial: true },
118
+ { name: "Matched" },
119
+ { name: "Completed" }
120
+ ],
121
+ events: [
122
+ { key: "INIT", name: "Initialize" },
123
+ { key: "SWAP", name: "Swap Tiles", payloadSchema: [
124
+ { name: "tileA", type: "number", required: true },
125
+ { name: "tileB", type: "number", required: true }
126
+ ] },
127
+ { key: "MATCH_FOUND", name: "Match Found" },
128
+ { key: "SETTLE", name: "Settle Board" },
129
+ { key: "WIN", name: "Win" },
130
+ { key: "RESTART", name: "Restart" }
131
+ ],
132
+ transitions: [
133
+ {
134
+ from: "Playing",
135
+ to: "Playing",
136
+ event: "INIT",
137
+ effects: [
138
+ ["fetch", "GridPuzzleData"],
139
+ ["set", "@entity.moves", 0],
140
+ ["set", "@entity.matchCount", 0],
141
+ ["set", "@entity.isComplete", false],
142
+ gridPuzzleMainEffect
143
+ ]
144
+ },
145
+ {
146
+ from: "Playing",
147
+ to: "Playing",
148
+ event: "SWAP",
149
+ effects: [
150
+ ["fetch", "GridPuzzleData"],
151
+ ["set", "@entity.moves", ["+", "@entity.moves", 1]],
152
+ gridPuzzleMainEffect
153
+ ]
154
+ },
155
+ {
156
+ from: "Playing",
157
+ to: "Matched",
158
+ event: "MATCH_FOUND",
159
+ effects: [
160
+ ["fetch", "GridPuzzleData"],
161
+ ["set", "@entity.matchCount", ["+", "@entity.matchCount", 1]],
162
+ gridPuzzleMatchedMainEffect
163
+ ]
164
+ },
165
+ {
166
+ from: "Matched",
167
+ to: "Playing",
168
+ event: "SETTLE",
169
+ effects: [
170
+ ["fetch", "GridPuzzleData"],
171
+ gridPuzzleMainEffect
172
+ ]
173
+ },
174
+ {
175
+ from: "Playing",
176
+ to: "Completed",
177
+ event: "WIN",
178
+ effects: [
179
+ ["set", "@entity.isComplete", true],
180
+ gridPuzzleCompletedMainEffect
181
+ ]
182
+ },
183
+ {
184
+ from: "Matched",
185
+ to: "Completed",
186
+ event: "WIN",
187
+ effects: [
188
+ ["set", "@entity.isComplete", true],
189
+ gridPuzzleCompletedMainEffect
190
+ ]
191
+ },
192
+ {
193
+ from: "Completed",
194
+ to: "Playing",
195
+ event: "RESTART",
196
+ effects: [
197
+ ["fetch", "GridPuzzleData"],
198
+ ["set", "@entity.moves", 0],
199
+ ["set", "@entity.matchCount", 0],
200
+ ["set", "@entity.isComplete", false],
201
+ gridPuzzleMainEffect
202
+ ]
203
+ }
204
+ ]
205
+ }
206
+ }
207
+ ],
208
+ pages: [
209
+ {
210
+ name: "GridPuzzlePage",
211
+ path: "/grid-puzzle",
212
+ isInitial: true,
213
+ traits: [{ ref: "GridPuzzle" }]
214
+ }
215
+ ]
216
+ }
217
+ ]
218
+ };
219
+ var timerIdleMainEffect = ["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
220
+ // Header: timer icon + title
221
+ { type: "stack", direction: "horizontal", justify: "space-between", children: [
222
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
223
+ { type: "icon", name: "timer", size: "lg" },
224
+ { type: "typography", variant: "h2", content: "Timer" }
225
+ ] },
226
+ { type: "badge", label: "Idle", variant: "default", icon: "timer" }
227
+ ] },
228
+ { type: "divider" },
229
+ // Time display
230
+ { type: "stack", direction: "horizontal", gap: "md", justify: "center", children: [
231
+ { type: "stats", label: "Remaining", icon: "timer", value: "@entity.remaining" },
232
+ { type: "stats", label: "Total", icon: "target", value: "@entity.total" }
233
+ ] },
234
+ // Progress bar
235
+ { type: "progress-bar", value: 0, max: 100, label: "Time", icon: "timer" }
236
+ ] }];
237
+ var timerRunningMainEffect = ["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
238
+ // Header: running state
239
+ { type: "stack", direction: "horizontal", justify: "space-between", children: [
240
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
241
+ { type: "icon", name: "timer", size: "lg" },
242
+ { type: "typography", variant: "h2", content: "Timer" }
243
+ ] },
244
+ { type: "badge", label: "Running", variant: "success", icon: "zap" }
245
+ ] },
246
+ { type: "divider" },
247
+ // Time display
248
+ { type: "stack", direction: "horizontal", gap: "md", justify: "center", children: [
249
+ { type: "stats", label: "Remaining", icon: "timer", value: "@entity.remaining" },
250
+ { type: "stats", label: "Total", icon: "target", value: "@entity.total" }
251
+ ] },
252
+ // Progress bar
253
+ { type: "progress-bar", value: "@entity.remaining", max: "@entity.total", label: "Time Left", icon: "timer" },
254
+ { type: "divider" },
255
+ // Pause button
256
+ { type: "stack", direction: "horizontal", justify: "center", children: [
257
+ { type: "button", label: "Pause", icon: "pause-circle", variant: "secondary", action: "PAUSE" }
258
+ ] }
259
+ ] }];
260
+ var timerPausedMainEffect = ["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
261
+ // Header: paused state
262
+ { type: "stack", direction: "horizontal", justify: "space-between", children: [
263
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
264
+ { type: "icon", name: "timer", size: "lg" },
265
+ { type: "typography", variant: "h2", content: "Timer" }
266
+ ] },
267
+ { type: "badge", label: "Paused", variant: "warning", icon: "pause-circle" }
268
+ ] },
269
+ { type: "divider" },
270
+ // Time display
271
+ { type: "stack", direction: "horizontal", gap: "md", justify: "center", children: [
272
+ { type: "stats", label: "Remaining", icon: "timer", value: "@entity.remaining" },
273
+ { type: "stats", label: "Total", icon: "target", value: "@entity.total" }
274
+ ] },
275
+ // Progress bar
276
+ { type: "progress-bar", value: "@entity.remaining", max: "@entity.total", label: "Paused", icon: "pause-circle" },
277
+ { type: "divider" },
278
+ // Resume button
279
+ { type: "stack", direction: "horizontal", justify: "center", children: [
280
+ { type: "button", label: "Resume", icon: "play-circle", variant: "primary", action: "RESUME" }
281
+ ] }
282
+ ] }];
283
+ var timerExpiredMainEffect = ["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
284
+ // Header: expired state
285
+ { type: "stack", direction: "horizontal", justify: "center", gap: "sm", children: [
286
+ { type: "icon", name: "timer", size: "xl" },
287
+ { type: "typography", variant: "h1", content: "Time Expired" }
288
+ ] },
289
+ { type: "divider" },
290
+ // Final stats
291
+ { type: "stack", direction: "horizontal", gap: "md", justify: "center", children: [
292
+ { type: "stats", label: "Duration", icon: "target", value: "@entity.total" }
293
+ ] },
294
+ // Progress bar at zero
295
+ { type: "progress-bar", value: 0, max: "@entity.total", label: "Expired", icon: "timer" },
296
+ { type: "divider" },
297
+ // Reset button
298
+ { type: "stack", direction: "horizontal", justify: "center", children: [
299
+ { type: "button", label: "Reset", icon: "refresh-cw", variant: "primary", action: "RESET" }
300
+ ] }
301
+ ] }];
302
+ var TIMER_BEHAVIOR = {
303
+ name: "std-timer",
304
+ version: "1.0.0",
305
+ description: "Countdown timer with pause and expiry",
306
+ theme: PUZZLE_THEME,
307
+ orbitals: [
308
+ {
309
+ name: "TimerOrbital",
310
+ entity: {
311
+ name: "TimerData",
312
+ persistence: "runtime",
313
+ fields: [
314
+ { name: "id", type: "string", required: true },
315
+ { name: "remaining", type: "number", default: 0 },
316
+ { name: "total", type: "number", default: 0 },
317
+ { name: "isRunning", type: "boolean", default: false },
318
+ { name: "isPaused", type: "boolean", default: false }
319
+ ]
320
+ },
321
+ traits: [
322
+ {
323
+ name: "Timer",
324
+ linkedEntity: "TimerData",
325
+ category: "interaction",
326
+ stateMachine: {
327
+ states: [
328
+ { name: "Idle", isInitial: true },
329
+ { name: "Running" },
330
+ { name: "Paused" },
331
+ { name: "Expired" }
332
+ ],
333
+ events: [
334
+ { key: "INIT", name: "Initialize" },
335
+ { key: "START", name: "Start Timer", payloadSchema: [
336
+ { name: "duration", type: "number", required: true }
337
+ ] },
338
+ { key: "PAUSE", name: "Pause Timer" },
339
+ { key: "RESUME", name: "Resume Timer" },
340
+ { key: "EXPIRE", name: "Timer Expired" },
341
+ { key: "RESET", name: "Reset Timer" }
342
+ ],
343
+ transitions: [
344
+ {
345
+ from: "Idle",
346
+ to: "Idle",
347
+ event: "INIT",
348
+ effects: [
349
+ ["set", "@entity.remaining", 0],
350
+ ["set", "@entity.total", 0],
351
+ ["set", "@entity.isRunning", false],
352
+ ["set", "@entity.isPaused", false],
353
+ timerIdleMainEffect
354
+ ]
355
+ },
356
+ {
357
+ from: "Idle",
358
+ to: "Running",
359
+ event: "START",
360
+ effects: [
361
+ ["set", "@entity.total", "@payload.duration"],
362
+ ["set", "@entity.remaining", "@payload.duration"],
363
+ ["set", "@entity.isRunning", true],
364
+ ["set", "@entity.isPaused", false],
365
+ timerRunningMainEffect
366
+ ]
367
+ },
368
+ {
369
+ from: "Running",
370
+ to: "Paused",
371
+ event: "PAUSE",
372
+ effects: [
373
+ ["set", "@entity.isRunning", false],
374
+ ["set", "@entity.isPaused", true],
375
+ timerPausedMainEffect
376
+ ]
377
+ },
378
+ {
379
+ from: "Paused",
380
+ to: "Running",
381
+ event: "RESUME",
382
+ effects: [
383
+ ["set", "@entity.isRunning", true],
384
+ ["set", "@entity.isPaused", false],
385
+ timerRunningMainEffect
386
+ ]
387
+ },
388
+ {
389
+ from: "Running",
390
+ to: "Expired",
391
+ event: "EXPIRE",
392
+ effects: [
393
+ ["set", "@entity.remaining", 0],
394
+ ["set", "@entity.isRunning", false],
395
+ timerExpiredMainEffect
396
+ ]
397
+ },
398
+ {
399
+ from: "Expired",
400
+ to: "Idle",
401
+ event: "RESET",
402
+ effects: [
403
+ ["set", "@entity.remaining", 0],
404
+ ["set", "@entity.total", 0],
405
+ ["set", "@entity.isRunning", false],
406
+ ["set", "@entity.isPaused", false],
407
+ timerIdleMainEffect
408
+ ]
409
+ }
410
+ ]
411
+ },
412
+ ticks: [
413
+ {
414
+ name: "Countdown",
415
+ interval: "frame",
416
+ guard: ["and", ["=", "@state", "Running"], [">", "@entity.remaining", 0]],
417
+ effects: [
418
+ ["set", "@entity.remaining", ["-", "@entity.remaining", 1]]
419
+ ]
420
+ }
421
+ ]
422
+ }
423
+ ],
424
+ pages: [
425
+ {
426
+ name: "TimerPage",
427
+ path: "/timer",
428
+ isInitial: true,
429
+ traits: [{ ref: "Timer" }]
430
+ }
431
+ ]
432
+ }
433
+ ]
434
+ };
435
+ var scoringIdleMainEffect = ["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
436
+ // Header: scoring icon + title
437
+ { type: "stack", direction: "horizontal", justify: "space-between", children: [
438
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
439
+ { type: "icon", name: "trophy", size: "lg" },
440
+ { type: "typography", variant: "h2", content: "Combo Scoring" }
441
+ ] },
442
+ { type: "badge", label: "Ready", variant: "default", icon: "target" }
443
+ ] },
444
+ { type: "divider" },
445
+ // Score stats
446
+ { type: "stack", direction: "horizontal", gap: "md", children: [
447
+ { type: "stats", label: "Score", icon: "trophy", value: "@entity.totalScore" },
448
+ { type: "stats", label: "Chain", icon: "zap", value: "@entity.chainLength" },
449
+ { type: "stats", label: "Multiplier", icon: "star", value: "@entity.multiplier" }
450
+ ] },
451
+ // Multiplier meter
452
+ { type: "meter", value: "@entity.multiplier", max: 10, label: "Combo Multiplier", icon: "zap" }
453
+ ] }];
454
+ var scoringChainingMainEffect = ["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
455
+ // Header: chaining state
456
+ { type: "stack", direction: "horizontal", justify: "space-between", children: [
457
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
458
+ { type: "icon", name: "zap", size: "lg" },
459
+ { type: "typography", variant: "h2", content: "Combo Active!" }
460
+ ] },
461
+ { type: "badge", label: "Chaining", variant: "success", icon: "zap" }
462
+ ] },
463
+ { type: "divider" },
464
+ // Score stats
465
+ { type: "stack", direction: "horizontal", gap: "md", children: [
466
+ { type: "stats", label: "Score", icon: "trophy", value: "@entity.totalScore" },
467
+ { type: "stats", label: "Chain", icon: "zap", value: "@entity.chainLength" },
468
+ { type: "stats", label: "Multiplier", icon: "star", value: "@entity.multiplier" }
469
+ ] },
470
+ // Multiplier meter (growing)
471
+ { type: "meter", value: "@entity.multiplier", max: 10, label: "Combo Multiplier", icon: "zap" },
472
+ { type: "divider" },
473
+ // Chain progress
474
+ { type: "progress-bar", value: "@entity.chainLength", max: 20, label: "Chain Length", icon: "zap" }
475
+ ] }];
476
+ var scoringBreakingMainEffect = ["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
477
+ // Header: chain broken
478
+ { type: "stack", direction: "horizontal", justify: "space-between", children: [
479
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
480
+ { type: "icon", name: "target", size: "lg" },
481
+ { type: "typography", variant: "h2", content: "Chain Broken" }
482
+ ] },
483
+ { type: "badge", label: "Broken", variant: "error", icon: "target" }
484
+ ] },
485
+ { type: "divider" },
486
+ // Final score
487
+ { type: "stack", direction: "horizontal", gap: "md", justify: "center", children: [
488
+ { type: "stats", label: "Total Score", icon: "trophy", value: "@entity.totalScore" }
489
+ ] },
490
+ // Meter reset
491
+ { type: "meter", value: 1, max: 10, label: "Multiplier Reset", icon: "target" },
492
+ { type: "divider" },
493
+ // Resume button
494
+ { type: "stack", direction: "horizontal", justify: "center", children: [
495
+ { type: "button", label: "Continue", icon: "refresh-cw", variant: "primary", action: "RESUME" }
496
+ ] }
497
+ ] }];
498
+ var SCORING_CHAIN_BEHAVIOR = {
499
+ name: "std-scoring-chain",
500
+ version: "1.0.0",
501
+ description: "Combo scoring with chain multiplier",
502
+ theme: PUZZLE_THEME,
503
+ orbitals: [
504
+ {
505
+ name: "ScoringChainOrbital",
506
+ entity: {
507
+ name: "ScoringChainData",
508
+ persistence: "runtime",
509
+ fields: [
510
+ { name: "id", type: "string", required: true },
511
+ { name: "chainLength", type: "number", default: 0 },
512
+ { name: "multiplier", type: "number", default: 1 },
513
+ { name: "totalScore", type: "number", default: 0 }
514
+ ]
515
+ },
516
+ traits: [
517
+ {
518
+ name: "ScoringChain",
519
+ linkedEntity: "ScoringChainData",
520
+ category: "interaction",
521
+ stateMachine: {
522
+ states: [
523
+ { name: "Idle", isInitial: true },
524
+ { name: "Chaining" },
525
+ { name: "Breaking" }
526
+ ],
527
+ events: [
528
+ { key: "INIT", name: "Initialize" },
529
+ { key: "HIT", name: "Chain Hit", payloadSchema: [
530
+ { name: "points", type: "number", required: true }
531
+ ] },
532
+ { key: "BREAK", name: "Break Chain" },
533
+ { key: "RESET_SCORE", name: "Reset Score" },
534
+ { key: "RESUME", name: "Resume" }
535
+ ],
536
+ transitions: [
537
+ {
538
+ from: "Idle",
539
+ to: "Idle",
540
+ event: "INIT",
541
+ effects: [
542
+ ["set", "@entity.chainLength", 0],
543
+ ["set", "@entity.multiplier", 1],
544
+ ["set", "@entity.totalScore", 0],
545
+ scoringIdleMainEffect
546
+ ]
547
+ },
548
+ {
549
+ from: "Idle",
550
+ to: "Chaining",
551
+ event: "HIT",
552
+ effects: [
553
+ ["set", "@entity.chainLength", 1],
554
+ ["set", "@entity.multiplier", 1],
555
+ ["set", "@entity.totalScore", ["+", "@entity.totalScore", "@payload.points"]],
556
+ scoringChainingMainEffect
557
+ ]
558
+ },
559
+ {
560
+ from: "Chaining",
561
+ to: "Chaining",
562
+ event: "HIT",
563
+ effects: [
564
+ ["set", "@entity.chainLength", ["+", "@entity.chainLength", 1]],
565
+ ["set", "@entity.multiplier", ["+", "@entity.multiplier", 1]],
566
+ ["set", "@entity.totalScore", ["+", "@entity.totalScore", ["*", "@payload.points", "@entity.multiplier"]]],
567
+ scoringChainingMainEffect
568
+ ]
569
+ },
570
+ {
571
+ from: "Chaining",
572
+ to: "Breaking",
573
+ event: "BREAK",
574
+ effects: [
575
+ ["set", "@entity.chainLength", 0],
576
+ ["set", "@entity.multiplier", 1],
577
+ scoringBreakingMainEffect
578
+ ]
579
+ },
580
+ {
581
+ from: "Breaking",
582
+ to: "Idle",
583
+ event: "RESUME",
584
+ effects: [
585
+ scoringIdleMainEffect
586
+ ]
587
+ },
588
+ {
589
+ from: "Idle",
590
+ to: "Idle",
591
+ event: "RESET_SCORE",
592
+ effects: [
593
+ ["set", "@entity.chainLength", 0],
594
+ ["set", "@entity.multiplier", 1],
595
+ ["set", "@entity.totalScore", 0],
596
+ scoringIdleMainEffect
597
+ ]
598
+ }
599
+ ]
600
+ }
601
+ }
602
+ ],
603
+ pages: [
604
+ {
605
+ name: "ScoringChainPage",
606
+ path: "/scoring-chain",
607
+ isInitial: true,
608
+ traits: [{ ref: "ScoringChain" }]
609
+ }
610
+ ]
611
+ }
612
+ ]
613
+ };
614
+ var GAME_2D_PUZZLE_BEHAVIORS = [
615
+ GRID_PUZZLE_BEHAVIOR,
616
+ TIMER_BEHAVIOR,
617
+ SCORING_CHAIN_BEHAVIOR
618
+ ];
619
+
620
+ export { GAME_2D_PUZZLE_BEHAVIORS, GRID_PUZZLE_BEHAVIOR, SCORING_CHAIN_BEHAVIOR, TIMER_BEHAVIOR };
621
+ //# sourceMappingURL=game-2d-puzzle.js.map
622
+ //# sourceMappingURL=game-2d-puzzle.js.map