@ankhorage/zora 25.8.3 → 25.8.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 25.8.5
4
+
5
+ ### Patch Changes
6
+
7
+ - 4f367f6: Update Game binding resolution for Runtime 5 and Contracts 26, and align the Surface peer contract.
8
+
9
+ ## 25.8.4
10
+
11
+ ### Patch Changes
12
+
13
+ - 427eb62: Update dependencies: `@ankhorage/ankh`, `@ankhorage/devtools`.
14
+
3
15
  ## 25.8.3
4
16
 
5
17
  ### Patch Changes
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  # @ankhorage/zora
5
5
 
6
- ![license: MIT](././paradox/badges/license.svg) ![npm: v25.8.3](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![paradox: warnings](././paradox/badges/docs.svg)
6
+ ![license: MIT](././paradox/badges/license.svg) ![npm: v25.8.5](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![paradox: warnings](././paradox/badges/docs.svg)
7
7
 
8
8
  Opinionated React Native and React Native Web UI kit built on @ankhorage/surface.
9
9
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ankhorage/zora",
3
3
  "type": "module",
4
- "version": "25.8.3",
4
+ "version": "25.8.5",
5
5
  "description": "Opinionated React Native and React Native Web UI kit built on @ankhorage/surface.",
6
6
  "homepage": "https://github.com/ankhorage/zora#readme",
7
7
  "bugs": {
@@ -41,15 +41,15 @@
41
41
  "react-native-worklets": "0.10.1"
42
42
  },
43
43
  "dependencies": {
44
- "@ankhorage/ankh": "^0.13.0",
44
+ "@ankhorage/ankh": "^0.13.1",
45
45
  "@ankhorage/capability": "^0.2.1",
46
46
  "@ankhorage/color-theory": "^0.3.1",
47
- "@ankhorage/contracts": "^25.2.0",
47
+ "@ankhorage/contracts": "^26.0.0",
48
48
  "@ankhorage/game": "^0.1.2",
49
49
  "@ankhorage/grid-view": "^0.5.0",
50
50
  "@ankhorage/reader": "^0.1.0",
51
- "@ankhorage/runtime": "^4.1.1",
52
- "@ankhorage/surface": "^9.4.5",
51
+ "@ankhorage/runtime": "^5.0.1",
52
+ "@ankhorage/surface": "^9.4.6",
53
53
  "@ankhorage/utility": "^1.9.85",
54
54
  "chess.js": "^1.4.0",
55
55
  "expo-document-picker": "~57.0.3",
@@ -134,21 +134,21 @@
134
134
  "version-packages": "ankhorage-changeset version"
135
135
  },
136
136
  "devDependencies": {
137
- "@ankhorage/devtools": "^2.3.13",
137
+ "@ankhorage/devtools": "^2.3.18",
138
138
  "@ankhorage/paradox": "^0.3.3",
139
- "@react-native-vector-icons/fontawesome": "^13.1.4",
140
- "@react-native-vector-icons/fontawesome5": "^13.1.4",
141
- "@react-native-vector-icons/fontawesome6": "^13.1.4",
142
- "@react-native-vector-icons/ionicons": "^13.1.4",
143
- "@react-native-vector-icons/material-design-icons": "^13.1.4",
139
+ "@react-native-vector-icons/fontawesome": "^13.1.5",
140
+ "@react-native-vector-icons/fontawesome5": "^13.1.5",
141
+ "@react-native-vector-icons/fontawesome6": "^13.1.5",
142
+ "@react-native-vector-icons/ionicons": "^13.1.5",
143
+ "@react-native-vector-icons/material-design-icons": "^13.1.5",
144
144
  "@types/bun": "^1.4.2",
145
145
  "@types/node": "^26.6.5",
146
146
  "@types/react": "^19.3.0",
147
147
  "@types/react-dom": "^19.3.0",
148
148
  "@types/react-native-web": "^0.19.3",
149
- "cytoscape": "^3.34.3",
149
+ "cytoscape": "^3.34.4",
150
150
  "cytoscape-elk": "^2.3.0",
151
- "happy-dom": "^20.14.6",
151
+ "happy-dom": "^21.0.3",
152
152
  "react": "19.2.3",
153
153
  "react-dom": "19.2.3",
154
154
  "react-native": "0.86.3",
@@ -1,5 +1,6 @@
1
+ import type { BindingExpression } from '@ankhorage/contracts';
1
2
  import type { GameSession } from '@ankhorage/game';
2
- import { resolveRuntimeBindingValueSync } from '@ankhorage/runtime/bindings';
3
+ import { resolveRuntimeBindingExpressionSync } from '@ankhorage/runtime/bindings';
3
4
  import { describe, expect, test } from 'bun:test';
4
5
 
5
6
  import { createGameBindingContext } from './createGameBindingContext';
@@ -26,30 +27,29 @@ const session: GameSession = {
26
27
  sequence: 4,
27
28
  };
28
29
 
30
+ const playerXExpression = {
31
+ capability: 'context.game.session.entities.player.state.x',
32
+ } satisfies BindingExpression;
33
+
34
+ const healthExpression = {
35
+ capability: 'context.game.session.state.health',
36
+ } satisfies BindingExpression;
37
+
38
+ const entitiesExpression = {
39
+ capability: 'context.game.entities',
40
+ } satisfies BindingExpression;
41
+
29
42
  describe('createGameBindingContext', () => {
30
43
  test('resolves ordinary Runtime context bindings from the local Game session', () => {
31
44
  const context = createGameBindingContext(session);
32
45
 
33
- expect(
34
- resolveRuntimeBindingValueSync(
35
- { source: { kind: 'context', path: 'game.session.entities.player.state.x' } },
36
- { context },
37
- ),
38
- ).toBe(42);
39
- expect(
40
- resolveRuntimeBindingValueSync(
41
- { source: { kind: 'context', path: 'game.session.state.health' } },
42
- { context },
43
- ),
44
- ).toBe(80);
46
+ expect(resolveRuntimeBindingExpressionSync(playerXExpression, { context })).toBe(42);
47
+ expect(resolveRuntimeBindingExpressionSync(healthExpression, { context })).toBe(80);
45
48
  });
46
49
 
47
50
  test('exposes current entities as a repeatable array with stable ids', () => {
48
51
  const context = createGameBindingContext(session);
49
- const entities = resolveRuntimeBindingValueSync(
50
- { source: { kind: 'context', path: 'game.entities' } },
51
- { context },
52
- );
52
+ const entities = resolveRuntimeBindingExpressionSync(entitiesExpression, { context });
53
53
 
54
54
  expect(Array.isArray(entities)).toBe(true);
55
55
  expect(entities).toEqual(Object.values(session.entities));
@@ -48,7 +48,8 @@ test('declares a jointly satisfiable Expo 57 native peer contract with Surface',
48
48
  throw new Error('Expected package.json dependency sections to contain objects.');
49
49
  }
50
50
 
51
- expect(dependencies['@ankhorage/surface']).toBe('^9.4.5');
51
+ const surfaceRange = dependencies['@ankhorage/surface'];
52
+ expect(typeof surfaceRange).toBe('string');
52
53
 
53
54
  const surfacePackageJson = JSON.parse(
54
55
  await readFile(
@@ -56,10 +57,16 @@ test('declares a jointly satisfiable Expo 57 native peer contract with Surface',
56
57
  'utf8',
57
58
  ),
58
59
  ) as unknown;
59
- if (!isRecord(surfacePackageJson) || !isRecord(surfacePackageJson.peerDependencies)) {
60
+ if (
61
+ !isRecord(surfacePackageJson) ||
62
+ !isRecord(surfacePackageJson.peerDependencies) ||
63
+ typeof surfacePackageJson.version !== 'string'
64
+ ) {
60
65
  throw new Error('Expected Surface to expose peer dependencies.');
61
66
  }
62
67
 
68
+ expect(Bun.semver.satisfies(surfacePackageJson.version, surfaceRange as string)).toBe(true);
69
+
63
70
  const zoraPeers = new Map(Object.entries(peerDependencies));
64
71
  const surfacePeers = new Map(Object.entries(surfacePackageJson.peerDependencies));
65
72
 
@@ -88,9 +88,8 @@ function mergeRuntimeRendererConfig(localConfig, inheritedConfig) {
88
88
  if (!localConfig && !inheritedConfig) {
89
89
  return EMPTY_RUNTIME_RENDERER_CONFIG;
90
90
  }
91
- const actionHandlers = mergeRecordConfig(inheritedConfig?.actionHandlers, localConfig?.actionHandlers);
92
91
  const bindingContext = mergeRecordConfig(inheritedConfig?.bindingContext, localConfig?.bindingContext);
93
- const operationResults = mergeRecordConfig(inheritedConfig?.operationResults, localConfig?.operationResults);
92
+ const resultSlots = mergeRecordConfig(inheritedConfig?.resultSlots, localConfig?.resultSlots);
94
93
  return {
95
94
  disableActions: localConfig?.disableActions === true || inheritedConfig?.disableActions === true,
96
95
  registry: localConfig?.registry ?? inheritedConfig?.registry,
@@ -98,17 +97,15 @@ function mergeRuntimeRendererConfig(localConfig, inheritedConfig) {
98
97
  resolveNodeProps: composeRuntimeNodePropsResolver(localConfig?.resolveNodeProps, inheritedConfig?.resolveNodeProps),
99
98
  resolveMediaAsset: localConfig?.resolveMediaAsset ?? inheritedConfig?.resolveMediaAsset,
100
99
  mediaAssets: localConfig?.mediaAssets ?? inheritedConfig?.mediaAssets,
101
- actionHandlers,
102
100
  dbAdapter: localConfig?.dbAdapter ?? inheritedConfig?.dbAdapter,
103
101
  dbRealtimeAdapter: localConfig?.dbRealtimeAdapter ?? inheritedConfig?.dbRealtimeAdapter,
104
102
  stateAdapter: localConfig?.stateAdapter ?? inheritedConfig?.stateAdapter,
105
103
  bindingContext,
106
- apis: localConfig?.apis ?? inheritedConfig?.apis,
107
104
  dataBindings: localConfig?.dataBindings ?? inheritedConfig?.dataBindings,
108
- operationResults,
109
- writeOperationResult: localConfig?.writeOperationResult ?? inheritedConfig?.writeOperationResult,
110
- executeAction: localConfig?.executeAction ?? inheritedConfig?.executeAction,
111
- executeOperation: localConfig?.executeOperation ?? inheritedConfig?.executeOperation,
105
+ resultSlots,
106
+ writeResultSlot: localConfig?.writeResultSlot ?? inheritedConfig?.writeResultSlot,
107
+ executeCapability: localConfig?.executeCapability ?? inheritedConfig?.executeCapability,
108
+ resolveEventCapability: localConfig?.resolveEventCapability ?? inheritedConfig?.resolveEventCapability,
112
109
  onDiagnostics: localConfig?.onDiagnostics ?? inheritedConfig?.onDiagnostics,
113
110
  eventOperationLifecycle: localConfig?.eventOperationLifecycle ?? inheritedConfig?.eventOperationLifecycle,
114
111
  eventOperationState: localConfig?.eventOperationState ?? inheritedConfig?.eventOperationState
@@ -6,7 +6,7 @@ import {
6
6
  GameInputZone2,
7
7
  GameMeasurementProbe2,
8
8
  GameOverlay2
9
- } from "../../chunks/Accordion-38ts3gnn.js";
9
+ } from "../../chunks/Accordion-r87xx7mg.js";
10
10
  import"../../chunks/Accordion-6wrr910w.js";
11
11
  import"../../chunks/Accordion-vj1m2wck.js";
12
12
  import"../../chunks/Accordion-09qs8gt1.js";
@@ -6,7 +6,7 @@ import {
6
6
  GameInputZone2,
7
7
  GameMeasurementProbe2,
8
8
  GameOverlay2
9
- } from "../../chunks/Accordion-38ts3gnn.js";
9
+ } from "../../chunks/Accordion-r87xx7mg.js";
10
10
  import"../../chunks/Accordion-6wrr910w.js";
11
11
  import"../../chunks/Accordion-vj1m2wck.js";
12
12
  import"../../chunks/Accordion-09qs8gt1.js";
@@ -6,7 +6,7 @@ import {
6
6
  GameInputZone2,
7
7
  GameMeasurementProbe2,
8
8
  GameOverlay2
9
- } from "../../chunks/Accordion-38ts3gnn.js";
9
+ } from "../../chunks/Accordion-r87xx7mg.js";
10
10
  import"../../chunks/Accordion-6wrr910w.js";
11
11
  import"../../chunks/Accordion-vj1m2wck.js";
12
12
  import"../../chunks/Accordion-09qs8gt1.js";
@@ -6,7 +6,7 @@ import {
6
6
  GameInputZone2,
7
7
  GameMeasurementProbe2,
8
8
  GameOverlay2
9
- } from "../../chunks/Accordion-38ts3gnn.js";
9
+ } from "../../chunks/Accordion-r87xx7mg.js";
10
10
  import"../../chunks/Accordion-6wrr910w.js";
11
11
  import"../../chunks/Accordion-vj1m2wck.js";
12
12
  import"../../chunks/Accordion-09qs8gt1.js";
@@ -6,7 +6,7 @@ import {
6
6
  GameInputZone2,
7
7
  GameMeasurementProbe2,
8
8
  GameOverlay2
9
- } from "../../chunks/Accordion-38ts3gnn.js";
9
+ } from "../../chunks/Accordion-r87xx7mg.js";
10
10
  import"../../chunks/Accordion-6wrr910w.js";
11
11
  import"../../chunks/Accordion-vj1m2wck.js";
12
12
  import"../../chunks/Accordion-09qs8gt1.js";
@@ -6,7 +6,7 @@ import {
6
6
  GameInputZone2,
7
7
  GameMeasurementProbe2,
8
8
  GameOverlay2
9
- } from "../../chunks/Accordion-38ts3gnn.js";
9
+ } from "../../chunks/Accordion-r87xx7mg.js";
10
10
  import"../../chunks/Accordion-6wrr910w.js";
11
11
  import"../../chunks/Accordion-vj1m2wck.js";
12
12
  import"../../chunks/Accordion-09qs8gt1.js";
@@ -97033,12 +97033,17 @@ var elesfn$k = {
97033
97033
  startVertex = string(root) ? this.filter(root)[0].id() : root[0].id();
97034
97034
  var nodes = {};
97035
97035
  var edges = {};
97036
+ var subgraphEdges = eles.edges().filter(function(e) {
97037
+ return eles.has(e.source()) && eles.has(e.target());
97038
+ });
97036
97039
  if (directed) {
97037
97040
  eles.forEach(function(ele) {
97038
97041
  var id = ele.id();
97039
97042
  if (ele.isNode()) {
97040
- var ind = ele.indegree(true);
97041
- var outd = ele.outdegree(true);
97043
+ var incoming = ele.incomers().edges().intersection(subgraphEdges);
97044
+ var outgoing = ele.outgoers().edges().intersection(subgraphEdges);
97045
+ var ind = incoming.length;
97046
+ var outd = outgoing.length;
97042
97047
  var d1 = ind - outd;
97043
97048
  var d2 = outd - ind;
97044
97049
  if (d1 == 1) {
@@ -97055,9 +97060,8 @@ var elesfn$k = {
97055
97060
  dflag = true;
97056
97061
  }
97057
97062
  nodes[id] = [];
97058
- ele.outgoers().forEach(function(e) {
97059
- if (e.isEdge())
97060
- nodes[id].push(e.id());
97063
+ outgoing.forEach(function(e) {
97064
+ return nodes[id].push(e.id());
97061
97065
  });
97062
97066
  } else {
97063
97067
  edges[id] = [undefined, ele.target().id()];
@@ -97067,7 +97071,10 @@ var elesfn$k = {
97067
97071
  eles.forEach(function(ele) {
97068
97072
  var id = ele.id();
97069
97073
  if (ele.isNode()) {
97070
- var d = ele.degree(true);
97074
+ var connected = ele.connectedEdges().intersection(subgraphEdges);
97075
+ var d = connected.length + connected.filter(function(e) {
97076
+ return e.isLoop();
97077
+ }).length;
97071
97078
  if (d % 2) {
97072
97079
  if (!oddIn)
97073
97080
  oddIn = id;
@@ -97077,7 +97084,7 @@ var elesfn$k = {
97077
97084
  dflag = true;
97078
97085
  }
97079
97086
  nodes[id] = [];
97080
- ele.connectedEdges().forEach(function(e) {
97087
+ connected.forEach(function(e) {
97081
97088
  return nodes[id].push(e.id());
97082
97089
  });
97083
97090
  } else {
@@ -121583,8 +121590,6 @@ CRp$2.bufferCanvasImage = function(options) {
121583
121590
  buffCxt.translate(-bb.x1 * scale, -bb.y1 * scale);
121584
121591
  buffCxt.scale(scale, scale);
121585
121592
  this.drawElements(buffCxt, zsortedEles);
121586
- buffCxt.scale(1 / scale, 1 / scale);
121587
- buffCxt.translate(bb.x1 * scale, bb.y1 * scale);
121588
121593
  } else {
121589
121594
  var pan = cy.pan();
121590
121595
  var translation = {
@@ -121595,14 +121600,12 @@ CRp$2.bufferCanvasImage = function(options) {
121595
121600
  buffCxt.translate(translation.x, translation.y);
121596
121601
  buffCxt.scale(scale, scale);
121597
121602
  this.drawElements(buffCxt, zsortedEles);
121598
- buffCxt.scale(1 / scale, 1 / scale);
121599
- buffCxt.translate(-translation.x, -translation.y);
121600
121603
  }
121604
+ buffCxt.setTransform(1, 0, 0, 1, 0, 0);
121601
121605
  if (options.bg) {
121602
121606
  buffCxt.globalCompositeOperation = "destination-over";
121603
121607
  buffCxt.fillStyle = options.bg;
121604
- buffCxt.rect(0, 0, width, height);
121605
- buffCxt.fill();
121608
+ buffCxt.fillRect(0, 0, width, height);
121606
121609
  }
121607
121610
  }
121608
121611
  return buffCanvas;
@@ -122300,7 +122303,7 @@ sheetfn.appendToStyle = function(style) {
122300
122303
  }
122301
122304
  return style;
122302
122305
  };
122303
- var version = "3.34.3";
122306
+ var version = "3.34.4";
122304
122307
  var cytoscape = function cytoscape(options) {
122305
122308
  if (options === undefined) {
122306
122309
  options = {};
@@ -1512,11 +1512,11 @@
1512
1512
  "components/game/index.d.ts",
1513
1513
  "chunks/Accordion-09qs8gt1.js",
1514
1514
  "chunks/Accordion-184r2r82.js",
1515
- "chunks/Accordion-38ts3gnn.js",
1516
1515
  "chunks/Accordion-6wrr910w.js",
1517
1516
  "chunks/Accordion-fcczvwgg.js",
1518
1517
  "chunks/Accordion-fre84yaq.js",
1519
1518
  "chunks/Accordion-nh0cs9hq.js",
1519
+ "chunks/Accordion-r87xx7mg.js",
1520
1520
  "chunks/Accordion-vbzjq3z8.js",
1521
1521
  "chunks/Accordion-vj1m2wck.js",
1522
1522
  "chunks/Accordion-xgpzh4wq.js",
@@ -1535,11 +1535,11 @@
1535
1535
  "components/game-entity/index.d.ts",
1536
1536
  "chunks/Accordion-09qs8gt1.js",
1537
1537
  "chunks/Accordion-184r2r82.js",
1538
- "chunks/Accordion-38ts3gnn.js",
1539
1538
  "chunks/Accordion-6wrr910w.js",
1540
1539
  "chunks/Accordion-fcczvwgg.js",
1541
1540
  "chunks/Accordion-fre84yaq.js",
1542
1541
  "chunks/Accordion-nh0cs9hq.js",
1542
+ "chunks/Accordion-r87xx7mg.js",
1543
1543
  "chunks/Accordion-vbzjq3z8.js",
1544
1544
  "chunks/Accordion-vj1m2wck.js",
1545
1545
  "chunks/Accordion-xgpzh4wq.js",
@@ -1558,11 +1558,11 @@
1558
1558
  "components/game-field/index.d.ts",
1559
1559
  "chunks/Accordion-09qs8gt1.js",
1560
1560
  "chunks/Accordion-184r2r82.js",
1561
- "chunks/Accordion-38ts3gnn.js",
1562
1561
  "chunks/Accordion-6wrr910w.js",
1563
1562
  "chunks/Accordion-fcczvwgg.js",
1564
1563
  "chunks/Accordion-fre84yaq.js",
1565
1564
  "chunks/Accordion-nh0cs9hq.js",
1565
+ "chunks/Accordion-r87xx7mg.js",
1566
1566
  "chunks/Accordion-vbzjq3z8.js",
1567
1567
  "chunks/Accordion-vj1m2wck.js",
1568
1568
  "chunks/Accordion-xgpzh4wq.js",
@@ -1581,11 +1581,11 @@
1581
1581
  "components/game-input-zone/index.d.ts",
1582
1582
  "chunks/Accordion-09qs8gt1.js",
1583
1583
  "chunks/Accordion-184r2r82.js",
1584
- "chunks/Accordion-38ts3gnn.js",
1585
1584
  "chunks/Accordion-6wrr910w.js",
1586
1585
  "chunks/Accordion-fcczvwgg.js",
1587
1586
  "chunks/Accordion-fre84yaq.js",
1588
1587
  "chunks/Accordion-nh0cs9hq.js",
1588
+ "chunks/Accordion-r87xx7mg.js",
1589
1589
  "chunks/Accordion-vbzjq3z8.js",
1590
1590
  "chunks/Accordion-vj1m2wck.js",
1591
1591
  "chunks/Accordion-xgpzh4wq.js",
@@ -1604,11 +1604,11 @@
1604
1604
  "components/game-measurement-probe/index.d.ts",
1605
1605
  "chunks/Accordion-09qs8gt1.js",
1606
1606
  "chunks/Accordion-184r2r82.js",
1607
- "chunks/Accordion-38ts3gnn.js",
1608
1607
  "chunks/Accordion-6wrr910w.js",
1609
1608
  "chunks/Accordion-fcczvwgg.js",
1610
1609
  "chunks/Accordion-fre84yaq.js",
1611
1610
  "chunks/Accordion-nh0cs9hq.js",
1611
+ "chunks/Accordion-r87xx7mg.js",
1612
1612
  "chunks/Accordion-vbzjq3z8.js",
1613
1613
  "chunks/Accordion-vj1m2wck.js",
1614
1614
  "chunks/Accordion-xgpzh4wq.js",
@@ -1627,11 +1627,11 @@
1627
1627
  "components/game-overlay/index.d.ts",
1628
1628
  "chunks/Accordion-09qs8gt1.js",
1629
1629
  "chunks/Accordion-184r2r82.js",
1630
- "chunks/Accordion-38ts3gnn.js",
1631
1630
  "chunks/Accordion-6wrr910w.js",
1632
1631
  "chunks/Accordion-fcczvwgg.js",
1633
1632
  "chunks/Accordion-fre84yaq.js",
1634
1633
  "chunks/Accordion-nh0cs9hq.js",
1634
+ "chunks/Accordion-r87xx7mg.js",
1635
1635
  "chunks/Accordion-vbzjq3z8.js",
1636
1636
  "chunks/Accordion-vj1m2wck.js",
1637
1637
  "chunks/Accordion-xgpzh4wq.js",