@almadar/core 10.47.0 → 10.49.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -421,7 +421,7 @@ var ScenePosSchema = z.object({
421
421
  y: z.number(),
422
422
  z: z.number().optional()
423
423
  });
424
- var CAMERA_MODES = ["isometric", "perspective", "top-down", "follow", "chase"];
424
+ var CAMERA_MODES = ["isometric", "perspective", "top-down", "front", "follow", "chase"];
425
425
  var CameraModeSchema = z.enum(CAMERA_MODES);
426
426
  var CameraSchema = z.object({
427
427
  pos: ScenePosSchema.optional(),
@@ -2167,7 +2167,7 @@ function getInteractionModelForDomain(domain) {
2167
2167
  // src/patterns/patterns-registry.json
2168
2168
  var patterns_registry_default = {
2169
2169
  version: "1.0.0",
2170
- exportedAt: "2026-07-31T07:15:07.239Z",
2170
+ exportedAt: "2026-08-01T09:06:41.875Z",
2171
2171
  patterns: {
2172
2172
  "entity-table": {
2173
2173
  type: "entity-table",
@@ -43361,6 +43361,18 @@ var patterns_registry_default = {
43361
43361
  }
43362
43362
  }
43363
43363
  },
43364
+ lighting: {
43365
+ types: [
43366
+ "object"
43367
+ ],
43368
+ description: "3D scene light rig as data \u2014 ambient/directional/hemisphere/point lights + optional 'room' environment for PBR reflections. Omitted \u2192 the standard fixed rig."
43369
+ },
43370
+ post: {
43371
+ types: [
43372
+ "object"
43373
+ ],
43374
+ description: "3D post-processing stack \u2014 bloom (emissive glow / neon) and vignette. Omitted \u2192 no post pass."
43375
+ },
43364
43376
  tileClickEvent: {
43365
43377
  types: [
43366
43378
  "string"
@@ -43965,6 +43977,126 @@ var patterns_registry_default = {
43965
43977
  ],
43966
43978
  description: "Rotation in radians (painter units)."
43967
43979
  },
43980
+ rotation: {
43981
+ types: [
43982
+ "array"
43983
+ ],
43984
+ description: "Euler rotation `[x, y, z]` in radians (world axes) \u2014 per-axis joint rotation for the 3D backend; a group placed at a joint with children authored joint-local IS a bone. The 2D painter applies only the in-plane `z` component, after `rotate`.",
43985
+ items: {
43986
+ types: [
43987
+ "number"
43988
+ ]
43989
+ }
43990
+ },
43991
+ bone: {
43992
+ types: [
43993
+ "string"
43994
+ ],
43995
+ description: "Skeleton bone name. A named group is addressable by a `draw-mesh` `skin` block (smooth skinning): the skinned mesh deforms with this group's animated transform. Names resolve within the nearest enclosing `skeleton: true` group (falling back to the canvas), so multiple instances of one rig never collide. Distinct from `id` (the hit-test handle)."
43996
+ },
43997
+ skeleton: {
43998
+ types: [
43999
+ "boolean"
44000
+ ],
44001
+ description: "Marks this group as a skeleton SCOPE: `bone` names and `skin` bindings in its subtree resolve against each other only \u2014 one scope per rig instance."
44002
+ },
44003
+ animation: {
44004
+ types: [
44005
+ "object"
44006
+ ],
44007
+ description: "Keyframe animation over the group TRANSFORM tracks (`offsetX/Y/Z` in cells, `rotateX/Y/Z` in radians, `scale`; the 2D painter also honors `opacity`) \u2014 children inherit it, so nested animated groups form a joint chain. Material tracks belong on leaf meshes.",
44008
+ properties: {
44009
+ durationMs: {
44010
+ types: [
44011
+ "number"
44012
+ ]
44013
+ },
44014
+ loop: {
44015
+ types: [
44016
+ "boolean"
44017
+ ]
44018
+ },
44019
+ keyframes: {
44020
+ types: [
44021
+ "array"
44022
+ ],
44023
+ items: {
44024
+ types: [
44025
+ "object"
44026
+ ],
44027
+ properties: {
44028
+ at: {
44029
+ types: [
44030
+ "number"
44031
+ ]
44032
+ },
44033
+ offsetX: {
44034
+ types: [
44035
+ "number"
44036
+ ]
44037
+ },
44038
+ offsetY: {
44039
+ types: [
44040
+ "number"
44041
+ ]
44042
+ },
44043
+ offsetZ: {
44044
+ types: [
44045
+ "number"
44046
+ ]
44047
+ },
44048
+ rotateX: {
44049
+ types: [
44050
+ "number"
44051
+ ]
44052
+ },
44053
+ rotateY: {
44054
+ types: [
44055
+ "number"
44056
+ ]
44057
+ },
44058
+ rotateZ: {
44059
+ types: [
44060
+ "number"
44061
+ ]
44062
+ },
44063
+ scale: {
44064
+ types: [
44065
+ "number"
44066
+ ]
44067
+ },
44068
+ opacity: {
44069
+ types: [
44070
+ "number"
44071
+ ]
44072
+ },
44073
+ emissiveIntensity: {
44074
+ types: [
44075
+ "number"
44076
+ ]
44077
+ },
44078
+ color: {
44079
+ types: [
44080
+ "string"
44081
+ ]
44082
+ },
44083
+ emissive: {
44084
+ types: [
44085
+ "string"
44086
+ ]
44087
+ }
44088
+ },
44089
+ required: [
44090
+ "at"
44091
+ ]
44092
+ }
44093
+ }
44094
+ },
44095
+ propertyRequired: [
44096
+ "durationMs",
44097
+ "keyframes"
44098
+ ]
44099
+ },
43968
44100
  opacity: {
43969
44101
  types: [
43970
44102
  "number"
@@ -44047,6 +44179,459 @@ var patterns_registry_default = {
44047
44179
  description: "Additional CSS classes applied to the trigger button"
44048
44180
  }
44049
44181
  }
44182
+ },
44183
+ "draw-mesh": {
44184
+ type: "draw-mesh",
44185
+ category: "game",
44186
+ tier: "atoms",
44187
+ family: "game",
44188
+ description: "DrawMesh component",
44189
+ suggestedFor: [
44190
+ "draw",
44191
+ "mesh",
44192
+ "draw mesh"
44193
+ ],
44194
+ typicalSize: "small",
44195
+ propsSchema: {
44196
+ id: {
44197
+ types: [
44198
+ "string"
44199
+ ],
44200
+ description: "Optional source-tagged hit-test handle \u2014 the host indexes the drawable's ScenePos\u2192id so a pointer/raycast at that cell resolves to this id (unit/entity click). No id \u2192 the host emits only the coordinate (tile click)."
44201
+ },
44202
+ type: {
44203
+ types: [
44204
+ "unknown"
44205
+ ],
44206
+ description: "type prop",
44207
+ required: true
44208
+ },
44209
+ shape: {
44210
+ types: [
44211
+ "string"
44212
+ ],
44213
+ description: "shape prop",
44214
+ required: true,
44215
+ enumValues: [
44216
+ "box",
44217
+ "sphere",
44218
+ "capsule",
44219
+ "cylinder",
44220
+ "cone",
44221
+ "torus",
44222
+ "plane",
44223
+ "circle",
44224
+ "polyhedron"
44225
+ ]
44226
+ },
44227
+ position: {
44228
+ types: [
44229
+ "object"
44230
+ ],
44231
+ description: "Logical scene position; `z` is height in cells (projected to world Y).",
44232
+ required: true,
44233
+ properties: {
44234
+ x: {
44235
+ types: [
44236
+ "number"
44237
+ ]
44238
+ },
44239
+ y: {
44240
+ types: [
44241
+ "number"
44242
+ ]
44243
+ },
44244
+ z: {
44245
+ types: [
44246
+ "number"
44247
+ ]
44248
+ }
44249
+ },
44250
+ propertyRequired: [
44251
+ "x",
44252
+ "y"
44253
+ ],
44254
+ scenePos: true
44255
+ },
44256
+ width: {
44257
+ types: [
44258
+ "number"
44259
+ ],
44260
+ description: "Box/plane X extent in cells (default 1)."
44261
+ },
44262
+ height: {
44263
+ types: [
44264
+ "number"
44265
+ ],
44266
+ description: "Box Y (height) extent / capsule-cylinder-cone length in cells (default 1)."
44267
+ },
44268
+ depth: {
44269
+ types: [
44270
+ "number"
44271
+ ],
44272
+ description: "Box/plane Z extent in cells (default `width`)."
44273
+ },
44274
+ radius: {
44275
+ types: [
44276
+ "number"
44277
+ ],
44278
+ description: "Sphere/capsule/cone/torus/circle radius in cells (default 0.4)."
44279
+ },
44280
+ radiusTop: {
44281
+ types: [
44282
+ "number"
44283
+ ],
44284
+ description: "Cylinder top radius (default `radius`)."
44285
+ },
44286
+ radiusBottom: {
44287
+ types: [
44288
+ "number"
44289
+ ],
44290
+ description: "Cylinder bottom radius (default `radius`)."
44291
+ },
44292
+ tube: {
44293
+ types: [
44294
+ "number"
44295
+ ],
44296
+ description: "Torus tube radius in cells (default `radius` / 3)."
44297
+ },
44298
+ segments: {
44299
+ types: [
44300
+ "number"
44301
+ ],
44302
+ description: "Curved-surface tessellation, clamped 3..64 (default 24). 4\u20138 + `flatShading` = low-poly."
44303
+ },
44304
+ vertices: {
44305
+ types: [
44306
+ "array"
44307
+ ],
44308
+ description: "`polyhedron` only: raw vertices as scene-frame `[x, y, z]` triples in cells, `z` = up.",
44309
+ items: {
44310
+ types: [
44311
+ "array"
44312
+ ],
44313
+ items: {
44314
+ types: [
44315
+ "number"
44316
+ ]
44317
+ }
44318
+ }
44319
+ },
44320
+ faces: {
44321
+ types: [
44322
+ "array"
44323
+ ],
44324
+ description: "`polyhedron` only: triangle index triples into `vertices`, wound counter-clockwise seen from OUTSIDE in the scene frame.",
44325
+ items: {
44326
+ types: [
44327
+ "array"
44328
+ ],
44329
+ items: {
44330
+ types: [
44331
+ "number"
44332
+ ]
44333
+ }
44334
+ }
44335
+ },
44336
+ skin: {
44337
+ types: [
44338
+ "object"
44339
+ ],
44340
+ description: "`polyhedron` only: smooth-skinning weights binding the vertices to named bone groups. Vertices must then be authored in BIND POSE model space; the bones' animated transforms deform them.",
44341
+ properties: {
44342
+ bones: {
44343
+ types: [
44344
+ "array"
44345
+ ],
44346
+ items: {
44347
+ types: [
44348
+ "string"
44349
+ ]
44350
+ }
44351
+ },
44352
+ inverseBindMatrices: {
44353
+ types: [
44354
+ "array"
44355
+ ],
44356
+ items: {
44357
+ types: [
44358
+ "array"
44359
+ ],
44360
+ items: {
44361
+ types: [
44362
+ "number"
44363
+ ]
44364
+ }
44365
+ }
44366
+ },
44367
+ indices: {
44368
+ types: [
44369
+ "array"
44370
+ ],
44371
+ items: {
44372
+ types: [
44373
+ "array"
44374
+ ],
44375
+ items: {
44376
+ types: [
44377
+ "number"
44378
+ ]
44379
+ }
44380
+ }
44381
+ },
44382
+ weights: {
44383
+ types: [
44384
+ "array"
44385
+ ],
44386
+ items: {
44387
+ types: [
44388
+ "array"
44389
+ ],
44390
+ items: {
44391
+ types: [
44392
+ "number"
44393
+ ]
44394
+ }
44395
+ }
44396
+ }
44397
+ },
44398
+ propertyRequired: [
44399
+ "bones",
44400
+ "inverseBindMatrices",
44401
+ "indices",
44402
+ "weights"
44403
+ ]
44404
+ },
44405
+ rotation: {
44406
+ types: [
44407
+ "array"
44408
+ ],
44409
+ description: "Euler rotation `[x, y, z]` in radians.",
44410
+ items: {
44411
+ types: [
44412
+ "number"
44413
+ ]
44414
+ }
44415
+ },
44416
+ pivot: {
44417
+ types: [
44418
+ "string"
44419
+ ],
44420
+ description: "`bottom` (default) rests the mesh on its position's ground plane; `center` centers it there. For `polyhedron`, `bottom` lifts by \u2212min(z) and `center` applies no offset \u2014 the vertices are authoritative.",
44421
+ enumValues: [
44422
+ "bottom",
44423
+ "center"
44424
+ ]
44425
+ },
44426
+ material: {
44427
+ types: [
44428
+ "object"
44429
+ ],
44430
+ description: "material prop",
44431
+ properties: {
44432
+ kind: {
44433
+ types: [
44434
+ "string"
44435
+ ],
44436
+ enumValues: [
44437
+ "standard",
44438
+ "physical",
44439
+ "toon",
44440
+ "basic"
44441
+ ]
44442
+ },
44443
+ color: {
44444
+ types: [
44445
+ "string"
44446
+ ]
44447
+ },
44448
+ metalness: {
44449
+ types: [
44450
+ "number"
44451
+ ]
44452
+ },
44453
+ roughness: {
44454
+ types: [
44455
+ "number"
44456
+ ]
44457
+ },
44458
+ emissive: {
44459
+ types: [
44460
+ "string"
44461
+ ]
44462
+ },
44463
+ emissiveIntensity: {
44464
+ types: [
44465
+ "number"
44466
+ ]
44467
+ },
44468
+ opacity: {
44469
+ types: [
44470
+ "number"
44471
+ ]
44472
+ },
44473
+ transmission: {
44474
+ types: [
44475
+ "number"
44476
+ ]
44477
+ },
44478
+ ior: {
44479
+ types: [
44480
+ "number"
44481
+ ]
44482
+ },
44483
+ flatShading: {
44484
+ types: [
44485
+ "boolean"
44486
+ ]
44487
+ },
44488
+ side: {
44489
+ types: [
44490
+ "string"
44491
+ ],
44492
+ enumValues: [
44493
+ "front",
44494
+ "back",
44495
+ "double"
44496
+ ]
44497
+ }
44498
+ }
44499
+ },
44500
+ outline: {
44501
+ types: [
44502
+ "object"
44503
+ ],
44504
+ description: "outline prop",
44505
+ properties: {
44506
+ color: {
44507
+ types: [
44508
+ "string"
44509
+ ]
44510
+ },
44511
+ width: {
44512
+ types: [
44513
+ "number"
44514
+ ]
44515
+ }
44516
+ }
44517
+ },
44518
+ castShadow: {
44519
+ types: [
44520
+ "boolean"
44521
+ ],
44522
+ description: "castShadow prop"
44523
+ },
44524
+ receiveShadow: {
44525
+ types: [
44526
+ "boolean"
44527
+ ],
44528
+ description: "receiveShadow prop"
44529
+ },
44530
+ animation: {
44531
+ types: [
44532
+ "object"
44533
+ ],
44534
+ description: "Keyframe animation over transform/material tracks; the 3D host runs it per frame.",
44535
+ properties: {
44536
+ durationMs: {
44537
+ types: [
44538
+ "number"
44539
+ ]
44540
+ },
44541
+ loop: {
44542
+ types: [
44543
+ "boolean"
44544
+ ]
44545
+ },
44546
+ keyframes: {
44547
+ types: [
44548
+ "array"
44549
+ ],
44550
+ items: {
44551
+ types: [
44552
+ "object"
44553
+ ],
44554
+ properties: {
44555
+ at: {
44556
+ types: [
44557
+ "number"
44558
+ ]
44559
+ },
44560
+ offsetX: {
44561
+ types: [
44562
+ "number"
44563
+ ]
44564
+ },
44565
+ offsetY: {
44566
+ types: [
44567
+ "number"
44568
+ ]
44569
+ },
44570
+ offsetZ: {
44571
+ types: [
44572
+ "number"
44573
+ ]
44574
+ },
44575
+ rotateX: {
44576
+ types: [
44577
+ "number"
44578
+ ]
44579
+ },
44580
+ rotateY: {
44581
+ types: [
44582
+ "number"
44583
+ ]
44584
+ },
44585
+ rotateZ: {
44586
+ types: [
44587
+ "number"
44588
+ ]
44589
+ },
44590
+ scale: {
44591
+ types: [
44592
+ "number"
44593
+ ]
44594
+ },
44595
+ opacity: {
44596
+ types: [
44597
+ "number"
44598
+ ]
44599
+ },
44600
+ emissiveIntensity: {
44601
+ types: [
44602
+ "number"
44603
+ ]
44604
+ },
44605
+ color: {
44606
+ types: [
44607
+ "string"
44608
+ ]
44609
+ },
44610
+ emissive: {
44611
+ types: [
44612
+ "string"
44613
+ ]
44614
+ }
44615
+ },
44616
+ required: [
44617
+ "at"
44618
+ ]
44619
+ }
44620
+ }
44621
+ },
44622
+ propertyRequired: [
44623
+ "durationMs",
44624
+ "keyframes"
44625
+ ]
44626
+ },
44627
+ opacity: {
44628
+ types: [
44629
+ "number"
44630
+ ],
44631
+ description: "0..1 opacity; multiplies the material and enclosing group opacity."
44632
+ }
44633
+ },
44634
+ drawable: true
44050
44635
  }
44051
44636
  },
44052
44637
  categories: [
@@ -44968,7 +45553,7 @@ var integrators_registry_default = {
44968
45553
  // src/patterns/component-mapping.json
44969
45554
  var component_mapping_default = {
44970
45555
  version: "1.0.0",
44971
- exportedAt: "2026-07-31T07:15:07.239Z",
45556
+ exportedAt: "2026-08-01T09:06:41.875Z",
44972
45557
  mappings: {
44973
45558
  "page-header": {
44974
45559
  component: "PageHeader",
@@ -46351,6 +46936,11 @@ var component_mapping_default = {
46351
46936
  component: "EmojiPicker",
46352
46937
  importPath: "@/components/core/molecules/EmojiPicker",
46353
46938
  category: "component"
46939
+ },
46940
+ "draw-mesh": {
46941
+ component: "DrawMesh",
46942
+ importPath: "@/components/game/atoms/DrawMesh",
46943
+ category: "game"
46354
46944
  }
46355
46945
  }
46356
46946
  };
@@ -46358,7 +46948,7 @@ var component_mapping_default = {
46358
46948
  // src/patterns/event-contracts.json
46359
46949
  var event_contracts_default = {
46360
46950
  version: "1.0.0",
46361
- exportedAt: "2026-07-31T07:15:07.239Z",
46951
+ exportedAt: "2026-08-01T09:06:41.875Z",
46362
46952
  contracts: {
46363
46953
  form: {
46364
46954
  emits: [
@@ -47589,6 +48179,7 @@ var PATTERN_TYPES = [
47589
48179
  "doc-toc",
47590
48180
  "document-viewer",
47591
48181
  "draw-group",
48182
+ "draw-mesh",
47592
48183
  "draw-shape",
47593
48184
  "draw-shape-layer",
47594
48185
  "draw-sprite",
@@ -51382,8 +51973,12 @@ function inlineEntities(schema) {
51382
51973
  }
51383
51974
  return out;
51384
51975
  }
51976
+ function isDeclared(p) {
51977
+ return p.read !== void 0 || p.create !== void 0 || p.update !== void 0 || p.delete !== void 0;
51978
+ }
51385
51979
  function entityAccessTable(schema) {
51386
51980
  const table = /* @__PURE__ */ new Map();
51981
+ const collectionOf = /* @__PURE__ */ new Map();
51387
51982
  for (const def of inlineEntities(schema)) {
51388
51983
  table.set(def.name, {
51389
51984
  read: def.read_policy,
@@ -51391,6 +51986,20 @@ function entityAccessTable(schema) {
51391
51986
  update: def.update_policy,
51392
51987
  delete: def.delete_policy
51393
51988
  });
51989
+ if (def.collection) collectionOf.set(def.name, def.collection);
51990
+ }
51991
+ const byCollection = /* @__PURE__ */ new Map();
51992
+ for (const [name, policies] of table) {
51993
+ const collection = collectionOf.get(name);
51994
+ if (collection && isDeclared(policies) && !byCollection.has(collection)) {
51995
+ byCollection.set(collection, policies);
51996
+ }
51997
+ }
51998
+ for (const [name, policies] of table) {
51999
+ if (isDeclared(policies)) continue;
52000
+ const collection = collectionOf.get(name);
52001
+ const inherited = collection ? byCollection.get(collection) : void 0;
52002
+ if (inherited) table.set(name, { ...inherited });
51394
52003
  }
51395
52004
  return table;
51396
52005
  }