@tileflow/react-native 0.1.0-alpha.2 → 0.1.0-alpha.3

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
@@ -2933,10 +2933,11 @@ function createNativeAdmissionOwner(options) {
2933
2933
  if (options.sessionFetch) boundFetch = options.sessionFetch(registered.context);
2934
2934
  let retirement;
2935
2935
  let retirementNotified = false;
2936
- const catalog = createNativeAdmissionCatalog(resources, registered.context, (additions) => {
2937
- if (!bridge.extendContext) return Promise.reject(cancel("NATIVE_ADMISSION_UNAVAILABLE"));
2938
- return bridge.extendContext(ack.installation, registered.context, additions);
2939
- });
2936
+ const catalog = createNativeAdmissionCatalog(
2937
+ resources,
2938
+ registered.context,
2939
+ (additions) => bridge.extendContext(ack.installation, registered.context, additions)
2940
+ );
2940
2941
  const context = {
2941
2942
  id: registered.context,
2942
2943
  generation: registered.generation,
@@ -5133,9 +5134,7 @@ function owned(url, scope, policy) {
5133
5134
  let tilesetId;
5134
5135
  const base = /^\/base\/[0-9a-f]{64}\/(.+)$/u.exec(path)?.[1];
5135
5136
  if (scope === "style") {
5136
- const prefix = `/maps/${policy.mapId}/`;
5137
- const legacy = path.startsWith(prefix) && /^[a-z0-9][a-z0-9-]{0,63}\.json$/u.test(path.slice(prefix.length));
5138
- if (!legacy && !nativeVersionedStyleMatchesMap(url, policy.mapId)) throw invalid3();
5137
+ if (!nativeVersionedStyleMatchesMap(url, policy.mapId)) throw invalid3();
5139
5138
  } else if (scope === "tilejson" || scope === "tile") {
5140
5139
  const match = /^\/(?:v1\/)?tiles\/([A-Za-z0-9._:-]{1,255})\/(.+)$/u.exec(path);
5141
5140
  if (!match || !policy.tilesetIds.includes(match[1])) throw invalid3();
@@ -6221,10 +6220,7 @@ function createNativeAdmissionWire(native, listen) {
6221
6220
  return Object.freeze({ installation: ack.installation });
6222
6221
  },
6223
6222
  registerContext: (id, registration) => safe(() => native.registerContext(id, registration)),
6224
- extendContext: (id, context, resources) => safe(() => {
6225
- if (!native.extendContext) throw unavailable();
6226
- return native.extendContext(id, context, resources);
6227
- }),
6223
+ extendContext: (id, context, resources) => safe(() => native.extendContext(id, context, resources)),
6228
6224
  retireContext(id, context) {
6229
6225
  if (id === installation2?.id) retireContext(context);
6230
6226
  return safe(() => native.retireContext(id, context));
@@ -6371,6 +6367,7 @@ function createReactNativeAdmissionTransport() {
6371
6367
  for (const name3 of [
6372
6368
  "install",
6373
6369
  "registerContext",
6370
+ "extendContext",
6374
6371
  "retireContext",
6375
6372
  "completeBatch",
6376
6373
  "remove",
@@ -1,5 +1,5 @@
1
1
  import { HostedNativeSessionFetch } from './session.js';
2
- import { N as NativeAdmissionEvent, a as NativeAdmissionResource, b as NativeContextAck, c as NativeAdmissionResult, d as NativeRemovalAck } from '../native-admission-contract-k7LKE1vW.js';
2
+ import { N as NativeAdmissionEvent, a as NativeAdmissionResource, b as NativeContextAck, c as NativeAdmissionResult, d as NativeRemovalAck } from '../native-admission-contract-DFLfUP9X.js';
3
3
 
4
4
  declare function createReactNativeAdmissionTransport(): Readonly<{
5
5
  bridge: Readonly<{
@@ -11,7 +11,7 @@ declare function createReactNativeAdmissionTransport(): Readonly<{
11
11
  mapId: string | null;
12
12
  resources: readonly NativeAdmissionResource[];
13
13
  }>): Promise<NativeContextAck>;
14
- extendContext?(installation: string, context: string, resources: readonly NativeAdmissionResource[]): Promise<Readonly<{
14
+ extendContext(installation: string, context: string, resources: readonly NativeAdmissionResource[]): Promise<Readonly<{
15
15
  resources: number;
16
16
  }>>;
17
17
  retireContext(installation: string, context: string): Promise<Readonly<{
@@ -176,10 +176,7 @@ function createNativeAdmissionWire(native, listen) {
176
176
  return Object.freeze({ installation: ack.installation });
177
177
  },
178
178
  registerContext: (id, registration) => safe(() => native.registerContext(id, registration)),
179
- extendContext: (id, context, resources) => safe(() => {
180
- if (!native.extendContext) throw unavailable();
181
- return native.extendContext(id, context, resources);
182
- }),
179
+ extendContext: (id, context, resources) => safe(() => native.extendContext(id, context, resources)),
183
180
  retireContext(id, context) {
184
181
  if (id === installation?.id) retireContext(context);
185
182
  return safe(() => native.retireContext(id, context));
@@ -326,6 +323,7 @@ function createReactNativeAdmissionTransport() {
326
323
  for (const name of [
327
324
  "install",
328
325
  "registerContext",
326
+ "extendContext",
329
327
  "retireContext",
330
328
  "completeBatch",
331
329
  "remove",
@@ -1,4 +1,4 @@
1
- import { e as NativeAdmissionCode, a as NativeAdmissionResource, f as NativeAdmissionBridge, d as NativeRemovalAck } from '../native-admission-contract-k7LKE1vW.js';
1
+ import { e as NativeAdmissionCode, a as NativeAdmissionResource, f as NativeAdmissionBridge, d as NativeRemovalAck } from '../native-admission-contract-DFLfUP9X.js';
2
2
  import { HostedNativeResourcePolicy, createHostedNativeSessionController, HostedNativeSessionFetch, HostedNativeSessionController } from './session.js';
3
3
 
4
4
  type SessionInput = Parameters<typeof createHostedNativeSessionController>[0];
@@ -69,7 +69,7 @@ declare function createNativeAdmissionOwner(options: {
69
69
  }>>;
70
70
  dispose: () => Promise<NativeRemovalAck>;
71
71
  readonly state: Readonly<{
72
- status: "ready" | "error" | "disposed" | "idle" | "installing";
72
+ status: "disposed" | "error" | "idle" | "installing" | "ready";
73
73
  contexts: number;
74
74
  pendingRegistrations: number;
75
75
  }>;
@@ -1459,10 +1459,11 @@ function createNativeAdmissionOwner(options) {
1459
1459
  if (options.sessionFetch) boundFetch = options.sessionFetch(registered.context);
1460
1460
  let retirement;
1461
1461
  let retirementNotified = false;
1462
- const catalog = createNativeAdmissionCatalog(resources, registered.context, (additions) => {
1463
- if (!bridge.extendContext) return Promise.reject(cancel("NATIVE_ADMISSION_UNAVAILABLE"));
1464
- return bridge.extendContext(ack.installation, registered.context, additions);
1465
- });
1462
+ const catalog = createNativeAdmissionCatalog(
1463
+ resources,
1464
+ registered.context,
1465
+ (additions) => bridge.extendContext(ack.installation, registered.context, additions)
1466
+ );
1466
1467
  const context = {
1467
1468
  id: registered.context,
1468
1469
  generation: registered.generation,
@@ -74,7 +74,7 @@ type NativeAdmissionBridge = Readonly<{
74
74
  mapId: string | null;
75
75
  resources: readonly NativeAdmissionResource[];
76
76
  }>): Promise<NativeContextAck>;
77
- extendContext?(installation: string, context: string, resources: readonly NativeAdmissionResource[]): Promise<Readonly<{
77
+ extendContext(installation: string, context: string, resources: readonly NativeAdmissionResource[]): Promise<Readonly<{
78
78
  resources: number;
79
79
  }>>;
80
80
  retireContext(installation: string, context: string): Promise<Readonly<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tileflow/react-native",
3
- "version": "0.1.0-alpha.2",
3
+ "version": "0.1.0-alpha.3",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Tileflow maps, camera control and semantic interactions for React Native.",
6
6
  "type": "module",
@@ -36,7 +36,7 @@
36
36
  }
37
37
  },
38
38
  "dependencies": {
39
- "@tileflow/core": ">=0.1.0-alpha.31 <0.1.0-beta.0",
39
+ "@tileflow/core": ">=0.1.0-alpha.32 <0.1.0-beta.0",
40
40
  "@tileflow/interactions": ">=0.1.0-alpha.4 <0.1.0-beta.0"
41
41
  },
42
42
  "peerDependencies": {