@tileflow/react-native 0.1.0-alpha.5 → 0.1.0-alpha.6
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/README.md +2 -7
- package/dist/{contract-Bp-Im7tj.d.ts → contract-By3URNxS.d.ts} +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -2
- package/dist/internal/camera.d.ts +1 -1
- package/dist/internal/initial-view.d.ts +1 -1
- package/dist/internal/native-appearance.d.ts +1 -1
- package/dist/internal/source-state.d.ts +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -93,15 +93,10 @@ Maps without this capability ignore the option; omitting it keeps the selected t
|
|
|
93
93
|
Changing it uses the existing theme transition. `themeBlend` takes precedence. See the
|
|
94
94
|
[authoring contract](https://github.com/tileflow/tileflow-sdk/blob/main/packages/core/README.md#style-with-themes-and-semantic-modules).
|
|
95
95
|
|
|
96
|
-
|
|
96
|
+
Theme and `timeOfDay` changes cross-fade over 450 ms by default: a snapshot of the drawn map covers it, follows the camera and fades out once the new theme is drawn. Use `themeTransition={{duration: 700}}` to customize the duration, or `duration: 0` for an immediate change. `themeBlend={{themes: ['night', 'dusk', 'day'], position}}` shows a continuous blend of the map's themes instead of `theme`; position 0 is the first theme and 1.5 is halfway from the second to the third:
|
|
97
97
|
|
|
98
98
|
```tsx
|
|
99
|
-
<Map
|
|
100
|
-
source={source}
|
|
101
|
-
themeTransition={{duration: 450}}
|
|
102
|
-
themeBlend={{themes: ['night', 'dusk', 'day'], position}}
|
|
103
|
-
style={{flex: 1}}
|
|
104
|
-
/>
|
|
99
|
+
<Map source={source} themeBlend={{themes: ['night', 'dusk', 'day'], position}} style={{flex: 1}} />
|
|
105
100
|
```
|
|
106
101
|
|
|
107
102
|
The first blend of a set of themes prepares every theme's style and replaces the native style once; moving `position` later changes the map without loading. Removing `themeBlend` returns to `theme`. Both keep the same native Map, context and session, and `ready` events wait for the fade. The device's reduce-motion setting changes at once. See [theme transitions and blends](https://github.com/tileflow/tileflow-sdk/blob/main/packages/core/docs/theme-transitions-and-blends.md#react-native) for what follows the position on native maps.
|
|
@@ -28,12 +28,12 @@ type MapView = TileflowNativeInitialView;
|
|
|
28
28
|
/** Portable composition inputs, independent from source acquisition. */
|
|
29
29
|
type MapInitialViewInputs = TileflowNativeInitialViewOptions;
|
|
30
30
|
/**
|
|
31
|
-
* How a theme change appears.
|
|
31
|
+
* How a theme change appears. By default, a snapshot of the current frame covers the map,
|
|
32
32
|
* follows the camera, and fades out once the new theme is drawn. The device's reduce-motion
|
|
33
33
|
* setting changes at once.
|
|
34
34
|
*/
|
|
35
35
|
type MapThemeTransition = Readonly<{
|
|
36
|
-
/** Cross-fade length in milliseconds, from 0 (
|
|
36
|
+
/** Cross-fade length in milliseconds, from 0 (immediate) to 5000. Defaults to 450. */
|
|
37
37
|
duration?: number;
|
|
38
38
|
}>;
|
|
39
39
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { TileflowAnnotation } from '@tileflow/interactions';
|
|
3
3
|
export { TileflowAnnotation, TileflowInteractionBinding, TileflowInteractionCoordinate, TileflowInteractionDiagnostic, TileflowPoiCategory, TileflowResolvedAnnotationTarget, TileflowResolvedPoiFeatureTarget } from '@tileflow/interactions';
|
|
4
|
-
import { d as MapProps } from './contract-
|
|
5
|
-
export { e as MapBaseProps, c as MapCameraProps, f as MapColorScheme, g as MapErrorEvent, h as MapEventHandlers, b as MapInitialViewInputs, i as MapInteractionEvent, j as MapInteractionProps, k as MapLoadEvent, l as MapMarkerRenderContext, m as MapMarkerRenderer, n as MapOptions, o as MapPresentationProps, p as MapReadinessChangeEvent, q as MapRef, r as MapSelection, s as MapSource, t as MapSourceError, u as MapSourceProps, v as MapSourceState, w as MapTheme, x as MapThemeBlend, y as MapThemeChangeEvent, z as MapThemeSelection, A as MapThemeTransition, M as MapView, a as MapViewChangeEvent } from './contract-
|
|
4
|
+
import { d as MapProps } from './contract-By3URNxS.js';
|
|
5
|
+
export { e as MapBaseProps, c as MapCameraProps, f as MapColorScheme, g as MapErrorEvent, h as MapEventHandlers, b as MapInitialViewInputs, i as MapInteractionEvent, j as MapInteractionProps, k as MapLoadEvent, l as MapMarkerRenderContext, m as MapMarkerRenderer, n as MapOptions, o as MapPresentationProps, p as MapReadinessChangeEvent, q as MapRef, r as MapSelection, s as MapSource, t as MapSourceError, u as MapSourceProps, v as MapSourceState, w as MapTheme, x as MapThemeBlend, y as MapThemeChangeEvent, z as MapThemeSelection, A as MapThemeTransition, M as MapView, a as MapViewChangeEvent } from './contract-By3URNxS.js';
|
|
6
6
|
import '@maplibre/maplibre-react-native';
|
|
7
7
|
import 'react-native';
|
|
8
8
|
import '@tileflow/core/native';
|
package/dist/index.js
CHANGED
|
@@ -5466,6 +5466,7 @@ function projectMapSourceState(state) {
|
|
|
5466
5466
|
// src/theme-motion-input.ts
|
|
5467
5467
|
import { validateTileflowThemeBlendSelection } from "@tileflow/core/native";
|
|
5468
5468
|
var maximumTransitionMs = 5e3;
|
|
5469
|
+
var defaultTransitionMs = 450;
|
|
5469
5470
|
function own(value, keys) {
|
|
5470
5471
|
const prototype = Object.getPrototypeOf(value);
|
|
5471
5472
|
if (Array.isArray(value) || prototype !== Object.prototype && prototype !== null)
|
|
@@ -5480,9 +5481,9 @@ function own(value, keys) {
|
|
|
5480
5481
|
return result;
|
|
5481
5482
|
}
|
|
5482
5483
|
function snapshotThemeTransition(value) {
|
|
5483
|
-
if (value === void 0) return
|
|
5484
|
+
if (value === void 0) return defaultTransitionMs;
|
|
5484
5485
|
if (!value || typeof value !== "object") throw new NativePreparationError();
|
|
5485
|
-
const { duration =
|
|
5486
|
+
const { duration = defaultTransitionMs } = own(value, ["duration"]);
|
|
5486
5487
|
if (typeof duration !== "number" || !Number.isFinite(duration) || duration < 0 || duration > maximumTransitionMs)
|
|
5487
5488
|
throw new NativePreparationError();
|
|
5488
5489
|
return Math.round(duration);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as MapView, a as MapViewChangeEvent, b as MapInitialViewInputs, c as MapCameraProps } from '../contract-
|
|
1
|
+
import { M as MapView, a as MapViewChangeEvent, b as MapInitialViewInputs, c as MapCameraProps } from '../contract-By3URNxS.js';
|
|
2
2
|
import '@maplibre/maplibre-react-native';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'react-native';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TileflowNativeSourceState } from '@tileflow/core/native';
|
|
2
|
-
import { v as MapSourceState } from '../contract-
|
|
2
|
+
import { v as MapSourceState } from '../contract-By3URNxS.js';
|
|
3
3
|
import '@maplibre/maplibre-react-native';
|
|
4
4
|
import 'react';
|
|
5
5
|
import 'react-native';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tileflow/react-native",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.6",
|
|
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.
|
|
39
|
+
"@tileflow/core": ">=0.1.0-alpha.40 <0.1.0-beta.0",
|
|
40
40
|
"@tileflow/interactions": ">=0.1.0-alpha.6 <0.1.0-beta.0"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|