@planet/maps 11.2.0-dev.1760368995285 → 11.2.0-dev.1760376342277
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/internal/render.d.ts.map +1 -1
- package/internal/render.js +29 -41
- package/internal/update.d.ts +0 -19
- package/internal/update.d.ts.map +1 -1
- package/internal/update.js +0 -96
- package/package.json +2 -2
package/internal/render.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["render.js"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["render.js"],"names":[],"mappings":";;;;;AAqcA;;;GAGG;AACH,gCAHW,KAAK,CAAC,SAAS,aACf,GAAG,QAsBb;;;;;SA1Va,KAAI,OAAO,EAAE,GAAG,KAAK,GAAG;;;;cACxB,GAAG"}
|
package/internal/render.js
CHANGED
|
@@ -17,16 +17,7 @@ import {
|
|
|
17
17
|
NoEventPriority,
|
|
18
18
|
} from 'react-reconciler/constants.js';
|
|
19
19
|
import {CONTROL, INTERACTION, LAYER, OVERLAY, SOURCE, VIEW} from './config.js';
|
|
20
|
-
import {
|
|
21
|
-
arrayEquals,
|
|
22
|
-
prepareControlUpdate,
|
|
23
|
-
prepareInteractionUpdate,
|
|
24
|
-
prepareLayerUpdate,
|
|
25
|
-
prepareOverlayUpdate,
|
|
26
|
-
prepareSourceUpdate,
|
|
27
|
-
prepareViewUpdate,
|
|
28
|
-
reservedProps,
|
|
29
|
-
} from './update.js';
|
|
20
|
+
import {arrayEquals, reservedProps} from './update.js';
|
|
30
21
|
|
|
31
22
|
const listenerRegex = /^on([A-Z].*)/;
|
|
32
23
|
const listenerColonRegex = /^onChange-/;
|
|
@@ -217,32 +208,6 @@ function appendChild(parent, child) {
|
|
|
217
208
|
throw new Error(`Cannot add ${child} to ${parent}`);
|
|
218
209
|
}
|
|
219
210
|
|
|
220
|
-
/**
|
|
221
|
-
* @type {Object<string, import('./update.js').Updater>}
|
|
222
|
-
*/
|
|
223
|
-
const updaters = {
|
|
224
|
-
[VIEW]: prepareViewUpdate,
|
|
225
|
-
[OVERLAY]: prepareOverlayUpdate,
|
|
226
|
-
[CONTROL]: prepareControlUpdate,
|
|
227
|
-
[INTERACTION]: prepareInteractionUpdate,
|
|
228
|
-
[LAYER]: prepareLayerUpdate,
|
|
229
|
-
[SOURCE]: prepareSourceUpdate,
|
|
230
|
-
};
|
|
231
|
-
|
|
232
|
-
/**
|
|
233
|
-
* @param {any} instance The instance to update.
|
|
234
|
-
* @param {string} type The string type.
|
|
235
|
-
* @param {Object<string, any>} oldProps The old props.
|
|
236
|
-
* @param {Object<string, any>} newProps The new props.
|
|
237
|
-
*/
|
|
238
|
-
function prepareUpdate(instance, type, oldProps, newProps) {
|
|
239
|
-
const updater = updaters[type];
|
|
240
|
-
if (!updater) {
|
|
241
|
-
throw new Error(`Unsupported element type: ${type}`);
|
|
242
|
-
}
|
|
243
|
-
return updater(instance, type, oldProps, newProps);
|
|
244
|
-
}
|
|
245
|
-
|
|
246
211
|
/**
|
|
247
212
|
* @type {import('./update.js').Updater}
|
|
248
213
|
*/
|
|
@@ -365,13 +330,40 @@ let currentUpdatePriority = NoEventPriority;
|
|
|
365
330
|
|
|
366
331
|
const reconciler = ReactReconciler({
|
|
367
332
|
supportsMutation: true,
|
|
333
|
+
supportsPersistence: false,
|
|
334
|
+
preparePortalMount() {},
|
|
335
|
+
beforeActiveInstanceBlur() {},
|
|
336
|
+
afterActiveInstanceBlur() {},
|
|
337
|
+
prepareScopeUpdate() {},
|
|
338
|
+
getInstanceFromScope() {
|
|
339
|
+
throw new Error('getInstanceFromScope not implemented');
|
|
340
|
+
},
|
|
341
|
+
supportsHydration: false,
|
|
342
|
+
resetFormInstance() {},
|
|
343
|
+
trackSchedulerEvent() {},
|
|
344
|
+
resolveEventType() {
|
|
345
|
+
return null;
|
|
346
|
+
},
|
|
347
|
+
resolveEventTimeStamp() {
|
|
348
|
+
return -1.1;
|
|
349
|
+
},
|
|
350
|
+
NotPendingTransition: null,
|
|
351
|
+
HostTransitionContext: {
|
|
352
|
+
$$typeof: Symbol.for('react.context'),
|
|
353
|
+
Provider: /** @type {any} */ (null),
|
|
354
|
+
Consumer: /** @type {any} */ (null),
|
|
355
|
+
_currentValue: null,
|
|
356
|
+
_currentValue2: null,
|
|
357
|
+
_threadCount: 0,
|
|
358
|
+
},
|
|
359
|
+
scheduleTimeout: setTimeout,
|
|
360
|
+
cancelTimeout: clearTimeout,
|
|
368
361
|
isPrimaryRenderer: false,
|
|
369
362
|
createInstance,
|
|
370
363
|
createTextInstance,
|
|
371
364
|
appendChildToContainer,
|
|
372
365
|
appendChild,
|
|
373
366
|
appendInitialChild: appendChild,
|
|
374
|
-
prepareUpdate,
|
|
375
367
|
commitUpdate,
|
|
376
368
|
clearContainer,
|
|
377
369
|
removeChildFromContainer,
|
|
@@ -441,10 +433,6 @@ const reconciler = ReactReconciler({
|
|
|
441
433
|
return noContext;
|
|
442
434
|
},
|
|
443
435
|
|
|
444
|
-
getCurrentEventPriority() {
|
|
445
|
-
return DefaultEventPriority;
|
|
446
|
-
},
|
|
447
|
-
|
|
448
436
|
prepareForCommit() {
|
|
449
437
|
return null;
|
|
450
438
|
},
|
package/internal/update.d.ts
CHANGED
|
@@ -7,19 +7,6 @@
|
|
|
7
7
|
* @return {boolean} All elements in the array are the same;
|
|
8
8
|
*/
|
|
9
9
|
export function arrayEquals(a1?: Array<any>, a2?: Array<any>): boolean;
|
|
10
|
-
/**
|
|
11
|
-
* @param {import("ol/View.js").default} view The view.
|
|
12
|
-
* @param {string} type The string type.
|
|
13
|
-
* @param {Object<string, any>} oldProps The old props.
|
|
14
|
-
* @param {Object<string, any>} newProps The new props.
|
|
15
|
-
*/
|
|
16
|
-
export function prepareViewUpdate(view: import("ol/View.js").default, type: string, oldProps: {
|
|
17
|
-
[x: string]: any;
|
|
18
|
-
}, newProps: {
|
|
19
|
-
[x: string]: any;
|
|
20
|
-
}): {
|
|
21
|
-
[x: string]: any;
|
|
22
|
-
} | null;
|
|
23
10
|
/**
|
|
24
11
|
* @type {Object<string, boolean>}
|
|
25
12
|
*/
|
|
@@ -31,10 +18,4 @@ export type Updater = (arg0: any, arg1: string, arg2: {
|
|
|
31
18
|
}, arg3: {
|
|
32
19
|
[x: string]: any;
|
|
33
20
|
}) => any;
|
|
34
|
-
declare function prepareGenericUpdate(arg0: any, arg1: string, arg2: {
|
|
35
|
-
[x: string]: any;
|
|
36
|
-
}, arg3: {
|
|
37
|
-
[x: string]: any;
|
|
38
|
-
}): any;
|
|
39
|
-
export { prepareGenericUpdate as prepareControlUpdate, prepareGenericUpdate as prepareInteractionUpdate, prepareGenericUpdate as prepareLayerUpdate, prepareGenericUpdate as prepareOverlayUpdate, prepareGenericUpdate as prepareSourceUpdate };
|
|
40
21
|
//# sourceMappingURL=update.d.ts.map
|
package/internal/update.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["update.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;GAIG;AACH,iCAJW,KAAK,CAAC,GAAG,CAAC,OACV,KAAK,CAAC,GAAG,CAAC,GACT,OAAO,CAkBlB;
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["update.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;GAIG;AACH,iCAJW,KAAK,CAAC,GAAG,CAAC,OACV,KAAK,CAAC,GAAG,CAAC,GACT,OAAO,CAkBlB;AAED;;GAEG;AACH;;EAKE;sBAlCW,CAAS,IAAG,EAAH,GAAG,EAAE,IAAM,EAAN,MAAM,EAAE,IAAmB,EAAnB;QAAO,MAAM,GAAE,GAAG;CAAC,EAAE,IAAmB,EAAnB;QAAO,MAAM,GAAE,GAAG;CAAC,KAAG,GAAG"}
|
package/internal/update.js
CHANGED
|
@@ -34,99 +34,3 @@ export const reservedProps = {
|
|
|
34
34
|
options: true,
|
|
35
35
|
ref: true, // TODO: deal with changing ref
|
|
36
36
|
};
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* @param {import("ol/View.js").default} view The view.
|
|
40
|
-
* @param {string} type The string type.
|
|
41
|
-
* @param {Object<string, any>} oldProps The old props.
|
|
42
|
-
* @param {Object<string, any>} newProps The new props.
|
|
43
|
-
*/
|
|
44
|
-
export function prepareViewUpdate(view, type, oldProps, newProps) {
|
|
45
|
-
if (view.getAnimating()) {
|
|
46
|
-
return null;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* @type {Object<string, any>}
|
|
50
|
-
*/
|
|
51
|
-
const payload = {};
|
|
52
|
-
let needsUpdate = false;
|
|
53
|
-
for (const key in newProps) {
|
|
54
|
-
if (reservedProps[key]) {
|
|
55
|
-
continue;
|
|
56
|
-
}
|
|
57
|
-
if (key === 'center') {
|
|
58
|
-
if (
|
|
59
|
-
!(
|
|
60
|
-
arrayEquals(oldProps.center, newProps.center) ||
|
|
61
|
-
arrayEquals(view.getCenter(), newProps.center)
|
|
62
|
-
)
|
|
63
|
-
) {
|
|
64
|
-
payload.center = newProps.center;
|
|
65
|
-
needsUpdate = true;
|
|
66
|
-
}
|
|
67
|
-
continue;
|
|
68
|
-
}
|
|
69
|
-
if (key === 'zoom') {
|
|
70
|
-
if (
|
|
71
|
-
!(oldProps.zoom === newProps.zoom || view.getZoom() === newProps.zoom)
|
|
72
|
-
) {
|
|
73
|
-
payload.zoom = newProps.zoom;
|
|
74
|
-
needsUpdate = true;
|
|
75
|
-
}
|
|
76
|
-
continue;
|
|
77
|
-
}
|
|
78
|
-
if (key === 'rotation') {
|
|
79
|
-
if (
|
|
80
|
-
!(
|
|
81
|
-
oldProps.rotation === newProps.rotation ||
|
|
82
|
-
view.getRotation() === newProps.rotation
|
|
83
|
-
)
|
|
84
|
-
) {
|
|
85
|
-
payload.rotation = newProps.rotation;
|
|
86
|
-
needsUpdate = true;
|
|
87
|
-
}
|
|
88
|
-
continue;
|
|
89
|
-
}
|
|
90
|
-
if (newProps[key] !== oldProps[key]) {
|
|
91
|
-
payload[key] = newProps[key];
|
|
92
|
-
needsUpdate = true;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
if (!needsUpdate) {
|
|
96
|
-
return null;
|
|
97
|
-
}
|
|
98
|
-
return payload;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* @type {Updater}
|
|
103
|
-
*/
|
|
104
|
-
function prepareGenericUpdate(instance, type, oldProps, newProps) {
|
|
105
|
-
/**
|
|
106
|
-
* @type {Object<string, any>}
|
|
107
|
-
*/
|
|
108
|
-
const payload = {};
|
|
109
|
-
let needsUpdate = false;
|
|
110
|
-
for (const key in newProps) {
|
|
111
|
-
if (reservedProps[key]) {
|
|
112
|
-
continue;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
if (newProps[key] !== oldProps[key]) {
|
|
116
|
-
payload[key] = newProps[key];
|
|
117
|
-
needsUpdate = true;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
if (!needsUpdate) {
|
|
121
|
-
return null;
|
|
122
|
-
}
|
|
123
|
-
return payload;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
export {
|
|
127
|
-
prepareGenericUpdate as prepareControlUpdate,
|
|
128
|
-
prepareGenericUpdate as prepareInteractionUpdate,
|
|
129
|
-
prepareGenericUpdate as prepareLayerUpdate,
|
|
130
|
-
prepareGenericUpdate as prepareOverlayUpdate,
|
|
131
|
-
prepareGenericUpdate as prepareSourceUpdate,
|
|
132
|
-
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@planet/maps",
|
|
3
|
-
"version": "11.2.0-dev.
|
|
3
|
+
"version": "11.2.0-dev.1760376342277",
|
|
4
4
|
"description": "Declarative mapping components for React",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@testing-library/react": "^16.0.0",
|
|
41
41
|
"@types/react": "^19.1.9",
|
|
42
42
|
"@types/react-dom": "^19.1.7",
|
|
43
|
-
"@types/react-reconciler": "^0.
|
|
43
|
+
"@types/react-reconciler": "^0.32.1",
|
|
44
44
|
"@vitest/browser": "^3.0.7",
|
|
45
45
|
"astro": "^5.1.1",
|
|
46
46
|
"es-main": "^1.2.0",
|