@octostar/map-component 0.2.0 → 0.2.2
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/dist/index.cjs +30 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +31 -13
- package/dist/index.mjs.map +1 -1
- package/dist/types/components/map-editor-canvas.d.ts.map +1 -1
- package/dist/types/components/timebar.d.ts.map +1 -1
- package/dist/types/lib/timeline-store.d.ts +34 -1
- package/dist/types/lib/timeline-store.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-editor-canvas.d.ts","sourceRoot":"","sources":["../../../client/src/components/map-editor-canvas.tsx"],"names":[],"mappings":"AAiMA,OAAO,kCAAkC,CAAC;AAC1C,OAAO,gDAAgD,CAAC;
|
|
1
|
+
{"version":3,"file":"map-editor-canvas.d.ts","sourceRoot":"","sources":["../../../client/src/components/map-editor-canvas.tsx"],"names":[],"mappings":"AAiMA,OAAO,kCAAkC,CAAC;AAC1C,OAAO,gDAAgD,CAAC;AAkOxD,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAuG5E,eAAO,MAAM,eAAe,4GAy3R1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timebar.d.ts","sourceRoot":"","sources":["../../../client/src/components/timebar.tsx"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc,MAAM,CAAC;AAClC,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAExC,UAAU,YAAY;IACpB,cAAc,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC1F,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,qBAAqB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iFAAiF;IACjF,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAChC;AAiQD,wBAAgB,aAAa,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,MAAM,IAAI,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,sCAa5F;AAID,wBAAgB,OAAO,CAAC,EAAE,cAAc,EAAE,kBAAuB,EAAE,qBAAqB,EAAE,SAAS,EAAE,YAAY,EAAE,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"timebar.d.ts","sourceRoot":"","sources":["../../../client/src/components/timebar.tsx"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc,MAAM,CAAC;AAClC,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAExC,UAAU,YAAY;IACpB,cAAc,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC1F,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,qBAAqB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iFAAiF;IACjF,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAChC;AAiQD,wBAAgB,aAAa,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,MAAM,IAAI,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,sCAa5F;AAID,wBAAgB,OAAO,CAAC,EAAE,cAAc,EAAE,kBAAuB,EAAE,qBAAqB,EAAE,SAAS,EAAE,YAAY,EAAE,EAAE,YAAY,sCAkRhI"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type StoreApi } from 'zustand';
|
|
1
2
|
export interface TemporalFeature {
|
|
2
3
|
id: string;
|
|
3
4
|
startDate: Date | null;
|
|
@@ -38,5 +39,37 @@ export declare function normalizeTemporalProperties(properties: Record<string, u
|
|
|
38
39
|
endDate: Date | null;
|
|
39
40
|
};
|
|
40
41
|
export declare function isFeatureInRange(feature: TemporalFeature, rangeStart: Date | null, rangeEnd: Date | null): boolean;
|
|
41
|
-
export
|
|
42
|
+
export type TimelineStoreApi = StoreApi<TimelineState>;
|
|
43
|
+
/**
|
|
44
|
+
* Create a fresh, isolated timeline store for a SINGLE map instance.
|
|
45
|
+
*
|
|
46
|
+
* Timeline state — enabled/range/playback, the temporal-feature set, and the
|
|
47
|
+
* per-feature visibility filter derived from the range — is per-map. It used to
|
|
48
|
+
* live in a module-scope singleton shared by every `MapEditorCanvas`; with two
|
|
49
|
+
* maps open at once (e.g. two Map NT tabs) that state leaked between them:
|
|
50
|
+
* scrubbing or toggling the timebar in one map moved the other's, and the
|
|
51
|
+
* range-based visibility filter hid the other map's features (which looked like
|
|
52
|
+
* entities being deleted from the second map). Each map now owns its own store,
|
|
53
|
+
* provided to its subtree through {@link TimelineStoreContext}.
|
|
54
|
+
*/
|
|
55
|
+
export declare function createTimelineStore(): TimelineStoreApi;
|
|
56
|
+
/**
|
|
57
|
+
* React context carrying the per-`MapEditorCanvas` timeline store. The canvas
|
|
58
|
+
* creates one store per mount and provides it here; descendants (e.g. the
|
|
59
|
+
* `Timebar`) read this instance via {@link useTimelineStore} /
|
|
60
|
+
* {@link useTimelineStoreApi}.
|
|
61
|
+
*/
|
|
62
|
+
export declare const TimelineStoreContext: import("react").Context<TimelineStoreApi | null>;
|
|
63
|
+
/**
|
|
64
|
+
* Get the raw store api for the nearest map — use this for imperative
|
|
65
|
+
* `getState()` / `subscribe()` calls (outside React's render subscription).
|
|
66
|
+
*/
|
|
67
|
+
export declare function useTimelineStoreApi(): TimelineStoreApi;
|
|
68
|
+
/**
|
|
69
|
+
* Subscribe to the nearest map's timeline store. Preserves the old
|
|
70
|
+
* `useTimelineStore()` (whole state) and `useTimelineStore(selector)` call
|
|
71
|
+
* shapes, but reads from context so each map instance stays isolated.
|
|
72
|
+
*/
|
|
73
|
+
export declare function useTimelineStore(): TimelineState;
|
|
74
|
+
export declare function useTimelineStore<U>(selector: (state: TimelineState) => U): U;
|
|
42
75
|
//# sourceMappingURL=timeline-store.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeline-store.d.ts","sourceRoot":"","sources":["../../../client/src/lib/timeline-store.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"timeline-store.d.ts","sourceRoot":"","sources":["../../../client/src/lib/timeline-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,QAAQ,EAAqB,MAAM,SAAS,CAAC;AAGlF,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IACvB,OAAO,EAAE,IAAI,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,OAAO,CAAC;IACnB,eAAe,EAAE,OAAO,CAAC;IACzB,gBAAgB,EAAE,eAAe,EAAE,CAAC;IACpC,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAE5B,aAAa,EAAE,IAAI,GAAG,IAAI,CAAC;IAC3B,aAAa,EAAE,IAAI,GAAG,IAAI,CAAC;IAE3B,UAAU,EAAE,IAAI,GAAG,IAAI,CAAC;IACxB,QAAQ,EAAE,IAAI,GAAG,IAAI,CAAC;IAEtB,SAAS,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IAEtB,aAAa,EAAE;QAAE,KAAK,EAAE,IAAI,CAAC;QAAC,GAAG,EAAE,IAAI,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAE3D,UAAU,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAA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