@kahwee/sf-map-svg 5.1.1 → 5.1.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/CHANGELOG.md +8 -0
- package/dist/src/configuration-controller.d.ts +21 -0
- package/dist/src/configuration-controller.js +43 -0
- package/dist/src/explorer-core.d.ts +2 -1
- package/dist/src/explorer-core.js +227 -347
- package/dist/src/label-coordinator.d.ts +54 -0
- package/dist/src/label-coordinator.js +157 -0
- package/dist/src/map.js +12 -35
- package/dist/src/marker-controller.d.ts +55 -0
- package/dist/src/marker-controller.js +125 -0
- package/llms-full.txt +19 -11
- package/llms.txt +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,14 @@ User-visible changes are recorded here. Unreleased entries describe changes on `
|
|
|
4
4
|
|
|
5
5
|
## Unreleased
|
|
6
6
|
|
|
7
|
+
## 5.1.3 — 2026-11-05
|
|
8
|
+
|
|
9
|
+
- Give configuration snapshots and revisions a dedicated internal owner. Split presentation preparation from a guarded, single-use commit, rejecting stale or disposed updates before mutating presentation. Preserve public configuration and reset behavior.
|
|
10
|
+
|
|
11
|
+
## 5.1.2 — 2026-11-05
|
|
12
|
+
|
|
13
|
+
- Separate marker selection, activation and focus recovery into an internal controller; separate label candidate caching, screen-space collision layout and metrics invalidation into a label coordinator. Preserve the public API and shared animation frame scheduling.
|
|
14
|
+
|
|
7
15
|
## 5.1.1 — 2026-11-05
|
|
8
16
|
|
|
9
17
|
- Reserve precinct report controls and status space during loading to prevent phone layout shifts when multiple reports are available.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { prepareConfiguration } from './configuration.js';
|
|
2
|
+
import type { MapConfiguration } from './controller-types.js';
|
|
3
|
+
import type { NeighborhoodExplorerElement } from './types.js';
|
|
4
|
+
/** A prepared engine update may commit once, only while all revisions remain current. */
|
|
5
|
+
export interface PreparedPresentation {
|
|
6
|
+
commit(onCommit: () => void, isCurrent: () => boolean): boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface ConfigurationTarget extends Pick<NeighborhoodExplorerElement, 'setFeatures' | 'setLayers' | 'setControls'> {
|
|
9
|
+
preparePresentation(patch: MapConfiguration): PreparedPresentation | undefined;
|
|
10
|
+
}
|
|
11
|
+
/** Own the public configuration snapshot and invalidate stale updates before DOM mutation. */
|
|
12
|
+
export declare function createConfigurationController(initial: ReturnType<typeof prepareConfiguration>, element: ConfigurationTarget, isDestroyed: () => boolean): {
|
|
13
|
+
configure: (patch: MapConfiguration) => boolean;
|
|
14
|
+
readonly current: {
|
|
15
|
+
features: import("./types.js").MapFeatures;
|
|
16
|
+
layers: import("./types.js").InteractiveLayers;
|
|
17
|
+
controls: import("./controller-types.js").MapControls;
|
|
18
|
+
appearance: import("./controller-types.js").MapAppearance;
|
|
19
|
+
};
|
|
20
|
+
invalidate(): void;
|
|
21
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { prepareConfiguration } from './configuration.js';
|
|
2
|
+
import { controlKeys, layerKeys } from './features.js';
|
|
3
|
+
/** Own the public configuration snapshot and invalidate stale updates before DOM mutation. */
|
|
4
|
+
export function createConfigurationController(initial, element, isDestroyed) {
|
|
5
|
+
let config = initial;
|
|
6
|
+
let configurationRevision = 0;
|
|
7
|
+
function configure(patch) {
|
|
8
|
+
const revision = ++configurationRevision;
|
|
9
|
+
const next = prepareConfiguration(config, patch);
|
|
10
|
+
const hasFeatures = 'features' in patch, hasLayers = 'layers' in patch, hasControls = 'controls' in patch;
|
|
11
|
+
const layers = Object.fromEntries(layerKeys.map((key) => [key, next.layers[key]]));
|
|
12
|
+
const controls = Object.fromEntries(controlKeys.map((key) => [key, next.controls[key]]));
|
|
13
|
+
const features = patch.features === undefined
|
|
14
|
+
? next.features
|
|
15
|
+
: Object.fromEntries(Object.keys(patch.features).map((key) => [
|
|
16
|
+
key,
|
|
17
|
+
next.features[key],
|
|
18
|
+
]));
|
|
19
|
+
const presentation = element.preparePresentation({
|
|
20
|
+
...patch,
|
|
21
|
+
...('appearance' in patch ? { appearance: next.appearance } : {}),
|
|
22
|
+
});
|
|
23
|
+
const committed = presentation?.commit(() => {
|
|
24
|
+
config = next;
|
|
25
|
+
if (hasFeatures)
|
|
26
|
+
element.setFeatures(features);
|
|
27
|
+
if (hasLayers)
|
|
28
|
+
element.setLayers(layers);
|
|
29
|
+
if (hasControls)
|
|
30
|
+
element.setControls(controls);
|
|
31
|
+
}, () => !isDestroyed() && revision === configurationRevision);
|
|
32
|
+
return committed === true && !isDestroyed() && revision === configurationRevision;
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
configure,
|
|
36
|
+
get current() {
|
|
37
|
+
return config;
|
|
38
|
+
},
|
|
39
|
+
invalidate() {
|
|
40
|
+
configurationRevision++;
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { NeighborhoodSource } from '../data/types.js';
|
|
2
|
+
import type { PreparedPresentation } from './configuration-controller.js';
|
|
2
3
|
import type { MapConfiguration } from './controller-types.js';
|
|
3
4
|
import type { InteractiveSFMapData } from './explorer-data.js';
|
|
4
5
|
import type { createMapShell } from './explorer-shell.js';
|
|
@@ -7,7 +8,7 @@ import type { DistrictYear, ExplorerMode, NeighborhoodExplorerElement, Neighborh
|
|
|
7
8
|
export type { ExplorerMode, NeighborhoodExplorerElement, NeighborhoodExplorerOptions, } from './types.js';
|
|
8
9
|
/** Private bridge between the renderer and its public lifecycle controller. */
|
|
9
10
|
type MapEngineElement = NeighborhoodExplorerElement & {
|
|
10
|
-
|
|
11
|
+
preparePresentation(patch: MapConfiguration): PreparedPresentation | undefined;
|
|
11
12
|
getMapState(): {
|
|
12
13
|
mode: ExplorerMode;
|
|
13
14
|
source: NeighborhoodSource;
|