@tileflow/vue 0.1.0-alpha.20 → 0.1.0-alpha.21
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 +6 -5
- package/dist/index.d.ts +3 -11
- package/dist/index.js +9 -32
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -143,10 +143,8 @@ const interactionState = ref<TileflowInteractionState>({popup: null});
|
|
|
143
143
|
```
|
|
144
144
|
|
|
145
145
|
Omit `interactionState` and use `default-interaction-state` for uncontrolled state. Do not provide
|
|
146
|
-
both or switch ownership modes during a component instance's lifetime.
|
|
147
|
-
|
|
148
|
-
are normalized into annotations and retain their exact `title = label ?? id` behavior while the
|
|
149
|
-
new API uses singular `coordinate` and required `ariaLabel`.
|
|
146
|
+
both or switch ownership modes during a component instance's lifetime. `annotations` is the only
|
|
147
|
+
application-owned marker input and uses singular `coordinate` plus required `ariaLabel`.
|
|
150
148
|
|
|
151
149
|
The `marker` slot is annotation-only and preserves the annotation's generic `data` type.
|
|
152
150
|
`tooltip` and `popup` receive the general `TileflowInteractionViewContext`; narrow
|
|
@@ -169,8 +167,11 @@ lazily, and the component and its interaction imports remain SSR-safe.
|
|
|
169
167
|
Hosted maps automatically preflight a short-lived commercial session grant before eligible
|
|
170
168
|
resources. Setting `analytics` with `enabled: false` disables the optional beacon only; it does not
|
|
171
169
|
remove hosted authorization or override a user `mapOptions.transformRequest` callback.
|
|
170
|
+
Use `:analytics="{surfaceId: 'store-locator'}"` when the same Map is embedded in several stable
|
|
171
|
+
product locations. Missing or invalid Surface IDs become `default`; do not use URLs, branches,
|
|
172
|
+
random instance IDs, or user IDs.
|
|
172
173
|
Direct Tileflow World maps keep early `GRACE` silent, show a compact accessible owner-action pill
|
|
173
|
-
when late `GRACE` is activated, and show a stronger banner in `
|
|
174
|
+
when late `GRACE` is activated, and show a stronger banner in `MANAGED_REQUIRED`. Missing tiles and
|
|
174
175
|
MapLibre failures do not remove that recovery path.
|
|
175
176
|
|
|
176
177
|
## Headless capture readiness
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MapOptions, Map } from 'maplibre-gl';
|
|
2
2
|
import { DefineComponent, VNodeChild } from 'vue';
|
|
3
3
|
import { TileflowThemeTransition } from '@tileflow/core/browser';
|
|
4
|
-
import { TileflowRuntimeSource, TileflowThemeSelection, TileflowAnalytics
|
|
4
|
+
import { TileflowRuntimeSource, TileflowThemeSelection, TileflowAnalytics } from '@tileflow/core/runtime';
|
|
5
5
|
import { TileflowAnnotation, TileflowInteractionJsonValue, TileflowInteractionState, TileflowInteractionBinding, TileflowInteractionDiagnostic, TileflowInteractionEvent, TileflowAnnotationViewContext, TileflowInteractionViewContext } from '@tileflow/interactions';
|
|
6
6
|
|
|
7
7
|
type TileflowMapStyleSourceProps = {
|
|
@@ -31,13 +31,6 @@ type TileflowMapSharedProps = {
|
|
|
31
31
|
mapOptions?: TileflowMapOptions;
|
|
32
32
|
zoom?: number;
|
|
33
33
|
};
|
|
34
|
-
type TileflowMapAnnotationInput<TAnnotation extends TileflowAnnotation> = {
|
|
35
|
-
annotations?: readonly TAnnotation[];
|
|
36
|
-
markers?: never;
|
|
37
|
-
} | {
|
|
38
|
-
annotations?: never;
|
|
39
|
-
markers?: readonly TileflowMapMarker[];
|
|
40
|
-
};
|
|
41
34
|
type TileflowMapStateInput = {
|
|
42
35
|
defaultInteractionState?: never;
|
|
43
36
|
interactionState?: TileflowInteractionState;
|
|
@@ -45,7 +38,8 @@ type TileflowMapStateInput = {
|
|
|
45
38
|
defaultInteractionState?: TileflowInteractionState;
|
|
46
39
|
interactionState?: never;
|
|
47
40
|
};
|
|
48
|
-
type TileflowMapInteractiveProps<TAnnotation extends TileflowAnnotation> = TileflowMapSharedProps &
|
|
41
|
+
type TileflowMapInteractiveProps<TAnnotation extends TileflowAnnotation> = TileflowMapSharedProps & TileflowMapStateInput & {
|
|
42
|
+
annotations?: readonly TAnnotation[];
|
|
49
43
|
interactions?: readonly TileflowInteractionBinding[];
|
|
50
44
|
interactive?: boolean;
|
|
51
45
|
mode?: 'interactive';
|
|
@@ -56,7 +50,6 @@ type TileflowMapImageProps = TileflowMapSharedProps & {
|
|
|
56
50
|
interactionState?: never;
|
|
57
51
|
interactions?: never;
|
|
58
52
|
interactive?: never;
|
|
59
|
-
markers?: never;
|
|
60
53
|
mode: 'image';
|
|
61
54
|
};
|
|
62
55
|
type TileflowMapProps<TAnnotation extends TileflowAnnotation = TileflowAnnotation> = (TileflowMapInteractiveProps<TAnnotation> | TileflowMapImageProps) & TileflowMapStyleSourceProps;
|
|
@@ -67,7 +60,6 @@ type RuntimeTileflowMapProps = TileflowMapSharedProps & TileflowMapStyleSourcePr
|
|
|
67
60
|
interactionState?: TileflowInteractionState;
|
|
68
61
|
interactions?: readonly TileflowInteractionBinding[];
|
|
69
62
|
interactive?: boolean;
|
|
70
|
-
markers?: readonly TileflowMapMarker[];
|
|
71
63
|
mode?: TileflowMapMode;
|
|
72
64
|
};
|
|
73
65
|
type PublicTileflowMapStatics = Pick<DefineComponent<RuntimeTileflowMapProps>, keyof DefineComponent<RuntimeTileflowMapProps>>;
|
package/dist/index.js
CHANGED
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
getTileflowSystemColorScheme,
|
|
23
23
|
loadTileflowStyleFonts,
|
|
24
24
|
registerTileflowContourProtocol,
|
|
25
|
+
registerTileflowPmtilesProtocol,
|
|
25
26
|
registerTileflowWorldRequestBridge,
|
|
26
27
|
subscribeTileflowSystemColorScheme
|
|
27
28
|
} from "@tileflow/core/browser";
|
|
@@ -57,33 +58,13 @@ import {
|
|
|
57
58
|
validateTileflowAnnotations,
|
|
58
59
|
validateTileflowInteractionBindings
|
|
59
60
|
} from "@tileflow/interactions";
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
annotations,
|
|
63
|
-
markers
|
|
64
|
-
}) {
|
|
65
|
-
if (annotations !== void 0 && markers !== void 0) {
|
|
66
|
-
return {
|
|
67
|
-
annotations: [],
|
|
68
|
-
diagnostics: [
|
|
69
|
-
createTileflowVueInteractionDiagnostic(
|
|
70
|
-
"INVALID_DOCUMENT",
|
|
71
|
-
"The annotations and legacy markers props are mutually exclusive."
|
|
72
|
-
)
|
|
73
|
-
],
|
|
74
|
-
legacyTitles: /* @__PURE__ */ new Map(),
|
|
75
|
-
ok: false
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
const normalizedLegacyMarkers = normalizeTileflowLegacyMarkers(markers ?? []);
|
|
79
|
-
const legacyTitles = markers === void 0 ? /* @__PURE__ */ new Map() : normalizedLegacyMarkers.titles;
|
|
80
|
-
const candidates = annotations ?? normalizedLegacyMarkers.annotations;
|
|
61
|
+
function resolveTileflowVueAnnotations({ annotations }) {
|
|
62
|
+
const candidates = annotations ?? [];
|
|
81
63
|
const validation = validateTileflowAnnotations(candidates);
|
|
82
64
|
if (!validation.ok) {
|
|
83
65
|
return {
|
|
84
66
|
annotations: [],
|
|
85
67
|
diagnostics: validation.diagnostics,
|
|
86
|
-
legacyTitles,
|
|
87
68
|
ok: false
|
|
88
69
|
};
|
|
89
70
|
}
|
|
@@ -92,7 +73,6 @@ function resolveTileflowVueAnnotations({
|
|
|
92
73
|
// contexts keep the caller's typed annotation and data identities.
|
|
93
74
|
annotations: candidates,
|
|
94
75
|
diagnostics: [],
|
|
95
|
-
legacyTitles,
|
|
96
76
|
ok: true
|
|
97
77
|
};
|
|
98
78
|
}
|
|
@@ -213,7 +193,6 @@ var TileflowMap = defineComponent({
|
|
|
213
193
|
interactions: Array,
|
|
214
194
|
interactionState: Object,
|
|
215
195
|
mapOptions: Object,
|
|
216
|
-
markers: Array,
|
|
217
196
|
mode: {
|
|
218
197
|
default: "interactive",
|
|
219
198
|
type: String
|
|
@@ -265,7 +244,6 @@ var TileflowMap = defineComponent({
|
|
|
265
244
|
let activeSemanticDiagnosticKeys = /* @__PURE__ */ new Set();
|
|
266
245
|
let annotationRuntimeDiagnostics = [];
|
|
267
246
|
let semanticRuntimeDiagnostics = [];
|
|
268
|
-
let legacyTitles = /* @__PURE__ */ new Map();
|
|
269
247
|
let imageResizeObserver = null;
|
|
270
248
|
let mapFairUseNotice = null;
|
|
271
249
|
let mapLifecycle = null;
|
|
@@ -284,8 +262,7 @@ var TileflowMap = defineComponent({
|
|
|
284
262
|
const isImageMode = computed(() => resolvedMode.value === "image");
|
|
285
263
|
const annotationResolution = computed(
|
|
286
264
|
() => resolveTileflowVueAnnotations({
|
|
287
|
-
annotations: props.annotations
|
|
288
|
-
markers: props.markers
|
|
265
|
+
annotations: props.annotations
|
|
289
266
|
})
|
|
290
267
|
);
|
|
291
268
|
const interactionBindingResolution = computed(
|
|
@@ -309,7 +286,7 @@ var TileflowMap = defineComponent({
|
|
|
309
286
|
return diagnostics;
|
|
310
287
|
});
|
|
311
288
|
const hasInteractionConfiguration = computed(
|
|
312
|
-
() => props.annotations !== void 0 || props.
|
|
289
|
+
() => props.annotations !== void 0 || props.interactions !== void 0 || props.interactionState !== void 0 || props.defaultInteractionState !== void 0 || slots.marker !== void 0 || slots.popup !== void 0 || slots.tooltip !== void 0
|
|
313
290
|
);
|
|
314
291
|
const interactionInputDiagnostics = computed(() => {
|
|
315
292
|
const diagnostics = [
|
|
@@ -661,7 +638,6 @@ var TileflowMap = defineComponent({
|
|
|
661
638
|
};
|
|
662
639
|
const syncAnnotationRuntime = () => {
|
|
663
640
|
const resolution = annotationResolution.value;
|
|
664
|
-
legacyTitles = new Map(resolution.legacyTitles);
|
|
665
641
|
if (!annotationRuntime) return;
|
|
666
642
|
try {
|
|
667
643
|
annotationRuntime.reconcile(
|
|
@@ -740,6 +716,7 @@ var TileflowMap = defineComponent({
|
|
|
740
716
|
});
|
|
741
717
|
mapFairUseNotice = attachTileflowFairUseNotice(container);
|
|
742
718
|
registerTileflowContourProtocol({ addProtocol: maplibregl.addProtocol });
|
|
719
|
+
registerTileflowPmtilesProtocol({ addProtocol: maplibregl.addProtocol });
|
|
743
720
|
mapWorldRequestBridge = registerTileflowWorldRequestBridge({
|
|
744
721
|
addProtocol: maplibregl.addProtocol,
|
|
745
722
|
onNotice: mapFairUseNotice.update
|
|
@@ -782,7 +759,7 @@ var TileflowMap = defineComponent({
|
|
|
782
759
|
try {
|
|
783
760
|
const mapInteractions = createTileflowMapLibreDomRuntime({
|
|
784
761
|
createMarker({ annotation, element }) {
|
|
785
|
-
element.title =
|
|
762
|
+
element.title = annotation.ariaLabel;
|
|
786
763
|
return new maplibregl.Marker({ element });
|
|
787
764
|
},
|
|
788
765
|
customMarker: slots.marker !== void 0,
|
|
@@ -802,7 +779,7 @@ var TileflowMap = defineComponent({
|
|
|
802
779
|
map,
|
|
803
780
|
onInteractionStateChange: interactionCoordinator.requestInteractionState,
|
|
804
781
|
updateMarker(_marker, { annotation, element }) {
|
|
805
|
-
element.title =
|
|
782
|
+
element.title = annotation.ariaLabel;
|
|
806
783
|
}
|
|
807
784
|
});
|
|
808
785
|
annotationRuntime = mapInteractions;
|
|
@@ -1044,7 +1021,7 @@ var TileflowMap = defineComponent({
|
|
|
1044
1021
|
{ flush: "post" }
|
|
1045
1022
|
);
|
|
1046
1023
|
watch(
|
|
1047
|
-
() =>
|
|
1024
|
+
() => props.annotations,
|
|
1048
1025
|
() => syncAnnotationRuntime(),
|
|
1049
1026
|
{ deep: true, flush: "post" }
|
|
1050
1027
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tileflow/vue",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.21",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Vue component for rendering Tileflow maps with MapLibre.",
|
|
6
6
|
"type": "module",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"access": "public"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@tileflow/core": ">=0.1.0-alpha.
|
|
45
|
-
"@tileflow/interactions": ">=0.1.0-alpha.
|
|
44
|
+
"@tileflow/core": ">=0.1.0-alpha.22 <0.1.0-beta.0",
|
|
45
|
+
"@tileflow/interactions": ">=0.1.0-alpha.1 <0.1.0-beta.0"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"maplibre-gl": ">=5 <7",
|