@tileflow/core 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.
@@ -0,0 +1,185 @@
1
+ # Third-party notices
2
+
3
+ `@tileflow/core/browser` embeds `maplibre-contour` 0.1.0 so contour rendering remains local and
4
+ does not require executable code from a public CDN. The complete upstream license follows.
5
+
6
+ ## maplibre-contour 0.1.0
7
+
8
+ BSD 3-Clause License
9
+
10
+ Copyright (c) 2023, Michael Barry and maplibre-contour contributors
11
+
12
+ Redistribution and use in source and binary forms, with or without modification, are permitted
13
+ provided that the following conditions are met:
14
+
15
+ 1. Redistributions of source code must retain the above copyright notice, this list of conditions
16
+ and the following disclaimer.
17
+
18
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list of
19
+ conditions and the following disclaimer in the documentation and/or other materials provided
20
+ with the distribution.
21
+
22
+ 3. Neither the name of the copyright holder nor the names of its contributors may be used to
23
+ endorse or promote products derived from this software without specific prior written
24
+ permission.
25
+
26
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
27
+ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
28
+ FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
29
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
31
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
32
+ IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
33
+ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34
+
35
+ ---
36
+
37
+ Contains code from d3-contour <https://github.com/d3/d3-contour>
38
+
39
+ Copyright 2012-2023 Mike Bostock
40
+
41
+ Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee
42
+ is hereby granted, provided that the above copyright notice and this permission notice appear in all
43
+ copies.
44
+
45
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
46
+ SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
47
+ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
48
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
49
+ NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
50
+ OF THIS SOFTWARE.
51
+
52
+ ---
53
+
54
+ Contains code from vt-pbf <https://github.com/mapbox/vt-pbf>
55
+
56
+ The MIT License (MIT)
57
+
58
+ Copyright (c) 2015 Anand Thakker
59
+
60
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
61
+ associated documentation files (the "Software"), to deal in the Software without restriction,
62
+ including without limitation the rights to use, copy, modify, merge, publish, distribute,
63
+ sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
64
+ furnished to do so, subject to the following conditions:
65
+
66
+ The above copyright notice and this permission notice shall be included in all copies or
67
+ substantial portions of the Software.
68
+
69
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
70
+ NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
71
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
72
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
73
+ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
74
+
75
+ ---
76
+
77
+ ## pbf 4.0.1
78
+
79
+ Copyright (c) 2024, Mapbox
80
+ All rights reserved.
81
+
82
+ Redistribution and use in source and binary forms, with or without modification, are permitted
83
+ provided that the following conditions are met:
84
+
85
+ 1. Redistributions of source code must retain the above copyright notice, this list of conditions
86
+ and the following disclaimer.
87
+
88
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list of
89
+ conditions and the following disclaimer in the documentation and/or other materials provided
90
+ with the distribution.
91
+
92
+ 3. Neither the name of pbf nor the names of its contributors may be used to endorse or promote
93
+ products derived from this software without specific prior written permission.
94
+
95
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
96
+ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
97
+ FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
98
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
99
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
100
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
101
+ IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
102
+ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
103
+
104
+ ---
105
+
106
+ Contains code based on node-buffer-more-ints <https://github.com/dpw/node-buffer-more-ints>
107
+
108
+ Copyright (c) 2012 David Wragg. All rights reserved.
109
+
110
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
111
+ associated documentation files (the "Software"), to deal in the Software without restriction,
112
+ including without limitation the rights to use, copy, modify, merge, publish, distribute,
113
+ sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
114
+ furnished to do so, subject to the following conditions:
115
+
116
+ The above copyright notice and this permission notice shall be included in all copies or
117
+ substantial portions of the Software.
118
+
119
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
120
+ NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
121
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
122
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
123
+ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
124
+
125
+ ---
126
+
127
+ Contains code from buffer <https://github.com/feross/buffer>
128
+
129
+ The MIT License (MIT)
130
+
131
+ Copyright (c) Feross Aboukhadijeh, and other contributors.
132
+
133
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
134
+ associated documentation files (the "Software"), to deal in the Software without restriction,
135
+ including without limitation the rights to use, copy, modify, merge, publish, distribute,
136
+ sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
137
+ furnished to do so, subject to the following conditions:
138
+
139
+ The above copyright notice and this permission notice shall be included in all copies or
140
+ substantial portions of the Software.
141
+
142
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
143
+ NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
144
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
145
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
146
+ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
147
+
148
+ Parts of this software are based on Node.js:
149
+
150
+ Copyright Node.js contributors. All rights reserved.
151
+
152
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
153
+ associated documentation files (the "Software"), to deal in the Software without restriction,
154
+ including without limitation the rights to use, copy, modify, merge, publish, distribute,
155
+ sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
156
+ furnished to do so, subject to the following conditions:
157
+
158
+ The above copyright notice and this permission notice shall be included in all copies or
159
+ substantial portions of the Software.
160
+
161
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
162
+ NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
163
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
164
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
165
+ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
166
+
167
+ See <https://github.com/nodejs/node/blob/main/LICENSE> for more information.
168
+
169
+ ---
170
+
171
+ ## TypeScript helper code
172
+
173
+ The bundled browser entry retains TypeScript helper code and its complete upstream notice:
174
+
175
+ Copyright (c) Microsoft Corporation.
176
+
177
+ Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee
178
+ is hereby granted.
179
+
180
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
181
+ SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
182
+ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
183
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
184
+ NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
185
+ OF THIS SOFTWARE.
package/TRADEMARKS.md ADDED
@@ -0,0 +1,10 @@
1
+ # Tileflow trademarks
2
+
3
+ The Apache License, Version 2.0, and the Tileflow generated-output grant do not grant permission to
4
+ use the Tileflow name, `tileflow.dev`, logos, service marks, product names, or other Tileflow brand
5
+ features except for reasonable and customary use that truthfully describes the origin of the SDK or
6
+ compatibility with Tileflow, and for reproducing required notices.
7
+
8
+ You may not use Tileflow brand features in a way that suggests sponsorship, endorsement, or an
9
+ official Tileflow product when none exists. Third-party names and marks remain the property of their
10
+ respective owners.
package/dist/browser.d.ts CHANGED
@@ -1,7 +1,101 @@
1
- import { T as TileflowAnalytics, a as TileflowSessionController } from './runtime-DroKDIuB.js';
1
+ import { T as TileflowAnalytics, a as TileflowStyleFontFace, b as TileflowRuntimeStyle, c as TileflowSessionController, d as TileflowRuntimeColorScheme } from './runtime-C4MtSzkB.js';
2
+ import { M as MapLibreStyle } from './types-DlUGI6LC.js';
2
3
  import 'zod';
3
4
 
5
+ type TileflowFairUseNoticeState = 'GRACE' | 'CLAIM_REQUIRED';
6
+ type TileflowFairUseNotice = Readonly<{
7
+ action: string;
8
+ helpUrl: string;
9
+ message: string;
10
+ state: TileflowFairUseNoticeState;
11
+ }>;
12
+ type TileflowWorldProtocolRequest = Readonly<{
13
+ type?: string;
14
+ url: string;
15
+ }>;
16
+ type TileflowWorldProtocolResponse = Readonly<{
17
+ cacheControl?: string;
18
+ data: ArrayBuffer;
19
+ etag?: string;
20
+ expires?: string;
21
+ }>;
22
+ type TileflowWorldProtocolHandler = (request: TileflowWorldProtocolRequest, abortController: AbortController) => Promise<TileflowWorldProtocolResponse>;
23
+ type TileflowWorldRequestBridge = Readonly<{
24
+ dispose: () => void;
25
+ rewriteUrl: (url: string) => string;
26
+ }>;
27
+ type TileflowFairUseNoticeController = Readonly<{
28
+ dispose: () => void;
29
+ update: (notice: TileflowFairUseNotice | null) => void;
30
+ }>;
31
+ declare function registerTileflowWorldRequestBridge(input: {
32
+ addProtocol: (name: string, handler: TileflowWorldProtocolHandler) => void;
33
+ fetch?: typeof fetch;
34
+ onNotice: (notice: TileflowFairUseNotice | null) => void;
35
+ }): TileflowWorldRequestBridge;
36
+ declare function tileflowFairUseNoticeMessage(state: TileflowFairUseNoticeState): string;
37
+ declare function attachTileflowFairUseNotice(container: HTMLElement): TileflowFairUseNoticeController;
38
+
39
+ declare const tileflowMaplibreContourVersion: "0.1.0";
40
+ type TileflowContourProtocolRequest = Readonly<{
41
+ url: string;
42
+ }>;
43
+ type TileflowContourProtocolResponse = Readonly<{
44
+ cacheControl?: string | null;
45
+ data: ArrayBuffer;
46
+ expires?: Date | string | null;
47
+ }>;
48
+ type TileflowContourProtocolHandler = (request: TileflowContourProtocolRequest, abortController: AbortController) => Promise<TileflowContourProtocolResponse>;
49
+ type TileflowContourProtocolRegistry = {
50
+ addProtocol: (name: string, handler: TileflowContourProtocolHandler) => void;
51
+ };
52
+ type TileflowContourProtocolRegistrationOptions = {
53
+ /** Test/integration override; the default lazily initializes the pinned, bundled module. */
54
+ loadMaplibreContour?: () => Promise<unknown>;
55
+ };
56
+ /** Registers the one self-contained protocol emitted by every compiled contour source. */
57
+ declare function registerTileflowContourProtocol(registry: TileflowContourProtocolRegistry, options?: TileflowContourProtocolRegistrationOptions): void;
58
+
4
59
  type TileflowMapReadinessState = 'error' | 'idle' | 'loading';
60
+ /** Read the browser preference without persisting or mutating user state. */
61
+ declare function getTileflowSystemColorScheme(): TileflowRuntimeColorScheme;
62
+ /**
63
+ * Subscribe through one process-wide `matchMedia` listener, regardless of adapter or map count.
64
+ */
65
+ declare function subscribeTileflowSystemColorScheme(listener: (scheme: TileflowRuntimeColorScheme) => void): () => void;
66
+ type TileflowThemeTransitionPhase = 'applying' | 'error' | 'preloading' | 'ready';
67
+ type TileflowThemeTransition = Readonly<{
68
+ currentTheme?: string;
69
+ error?: Error;
70
+ phase: TileflowThemeTransitionPhase;
71
+ targetTheme?: string;
72
+ }>;
73
+ type TileflowThemeTransitionResult = Readonly<{
74
+ error?: Error;
75
+ status: 'applied' | 'failed' | 'superseded';
76
+ theme?: string;
77
+ }>;
78
+ type TileflowStyleSwitchMap = {
79
+ off(event: 'error' | 'style.load', listener: (event?: unknown) => void): unknown;
80
+ on(event: 'error' | 'style.load', listener: (event?: unknown) => void): unknown;
81
+ setStyle: unknown;
82
+ };
83
+ type TileflowThemeController = {
84
+ dispose(): void;
85
+ getCurrent(): TileflowRuntimeStyle;
86
+ setTheme(style: TileflowRuntimeStyle): Promise<TileflowThemeTransitionResult>;
87
+ };
88
+ /**
89
+ * Transactionally changes a MapLibre style while preserving the map instance and camera.
90
+ * Independent font preloads start immediately; style application is serialized and last request wins.
91
+ */
92
+ declare function createTileflowThemeController(options: {
93
+ initial: TileflowRuntimeStyle;
94
+ loadFonts?: (style: TileflowRuntimeStyle) => Promise<void>;
95
+ map: TileflowStyleSwitchMap;
96
+ onTransition?: (transition: TileflowThemeTransition) => void;
97
+ timeoutMs?: number;
98
+ }): TileflowThemeController;
5
99
  type TileflowMapLifecycleEvent = 'dataloading' | 'error' | 'idle' | 'load' | 'styledataloading';
6
100
  type TileflowFrameScheduler<TFrame> = {
7
101
  cancelFrame: (frame: TFrame) => void;
@@ -22,6 +116,13 @@ type TileflowMapLifecycleAttachment = {
22
116
  dispose: () => void;
23
117
  invalidate: (state?: TileflowMapReadinessState) => void;
24
118
  };
119
+ type TileflowStyleFontLoadOptions = {
120
+ /** Already resolved manifest metadata. An explicit empty array avoids fetching the style. */
121
+ fontFaces?: readonly TileflowStyleFontFace[];
122
+ fetch?: typeof globalThis.fetch;
123
+ };
124
+ /** Loads content-addressed style font faces before MapLibre starts shaping labels. */
125
+ declare function loadTileflowStyleFonts(style: MapLibreStyle | string, options?: TileflowStyleFontLoadOptions): Promise<void>;
25
126
  type TileflowTransformRequestParameters = {
26
127
  url: string;
27
128
  };
@@ -59,6 +160,7 @@ declare function createTileflowTransformRequest<TRequest extends TileflowTransfo
59
160
  sessionController?: TileflowSessionController;
60
161
  sessionId: string;
61
162
  transformRequest?: TileflowUserTransformRequest<TRequest, TResourceType>;
163
+ worldRequestBridge?: TileflowWorldRequestBridge;
62
164
  }): TileflowTransformRequest<TRequest, TResourceType>;
63
165
  declare function createTileflowTransformRequest<TRequest extends TileflowTransformRequestParameters = TileflowTransformRequestParameters, TResourceType = unknown>(options: {
64
166
  always?: boolean;
@@ -67,6 +169,7 @@ declare function createTileflowTransformRequest<TRequest extends TileflowTransfo
67
169
  sessionController?: TileflowSessionController;
68
170
  sessionId: string;
69
171
  transformRequest?: TileflowUserTransformRequest<TRequest, TResourceType>;
172
+ worldRequestBridge?: TileflowWorldRequestBridge;
70
173
  }): TileflowTransformRequest<TRequest, TResourceType> | undefined;
71
174
  declare function createTileflowMarkerController<TMap, TDefinition, TMarker>(options: {
72
175
  attach: (marker: TMarker, map: TMap, definition: TDefinition) => void;
@@ -74,4 +177,4 @@ declare function createTileflowMarkerController<TMap, TDefinition, TMarker>(opti
74
177
  remove: (marker: TMarker) => void;
75
178
  }): TileflowMarkerController<TMap, TDefinition, TMarker>;
76
179
 
77
- export { type TileflowAsyncAnalyticsTiming, type TileflowComposedRequest, type TileflowFrameScheduler, type TileflowMapLifecycleAttachment, type TileflowMapLifecycleEvent, type TileflowMapLifecycleSubscriber, type TileflowMapReadinessState, type TileflowMarkerController, type TileflowSessionSender, type TileflowSessionStarter, type TileflowTransformRequest, type TileflowTransformRequestParameters, type TileflowUserTransformRequest, attachTileflowMapLifecycle, createTileflowMarkerController, createTileflowSessionStarter, createTileflowTransformRequest };
180
+ export { type TileflowAsyncAnalyticsTiming, type TileflowComposedRequest, type TileflowContourProtocolHandler, type TileflowContourProtocolRegistrationOptions, type TileflowContourProtocolRegistry, type TileflowContourProtocolRequest, type TileflowContourProtocolResponse, type TileflowFairUseNotice, type TileflowFairUseNoticeController, type TileflowFairUseNoticeState, type TileflowFrameScheduler, type TileflowMapLifecycleAttachment, type TileflowMapLifecycleEvent, type TileflowMapLifecycleSubscriber, type TileflowMapReadinessState, type TileflowMarkerController, type TileflowSessionSender, type TileflowSessionStarter, type TileflowStyleFontLoadOptions, type TileflowStyleSwitchMap, type TileflowThemeController, type TileflowThemeTransition, type TileflowThemeTransitionPhase, type TileflowThemeTransitionResult, type TileflowTransformRequest, type TileflowTransformRequestParameters, type TileflowUserTransformRequest, type TileflowWorldProtocolHandler, type TileflowWorldProtocolRequest, type TileflowWorldProtocolResponse, type TileflowWorldRequestBridge, attachTileflowFairUseNotice, attachTileflowMapLifecycle, createTileflowMarkerController, createTileflowSessionStarter, createTileflowThemeController, createTileflowTransformRequest, getTileflowSystemColorScheme, loadTileflowStyleFonts, registerTileflowContourProtocol, registerTileflowWorldRequestBridge, subscribeTileflowSystemColorScheme, tileflowFairUseNoticeMessage, tileflowMaplibreContourVersion };