@octostar/map-component 0.2.20 → 0.2.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/dist/index.cjs +291 -230
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +291 -230
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +2 -0
- package/dist/types/components/map-editor-canvas.d.ts.map +1 -1
- package/dist/types/lib/label-pinning.d.ts.map +1 -1
- package/dist/types/lib/paint-feature.d.ts +65 -0
- package/dist/types/lib/paint-feature.d.ts.map +1 -0
- package/dist/types/lib/tooltip-feature.d.ts +36 -0
- package/dist/types/lib/tooltip-feature.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/styles.css
CHANGED
|
@@ -319,6 +319,7 @@ body{--tw-bg-opacity:1;background-color:hsl(var(--background) / var(--tw-bg-opac
|
|
|
319
319
|
.h-8{height:2rem}
|
|
320
320
|
.h-9{height:2.25rem}
|
|
321
321
|
.h-\[18px\]{height:18px}
|
|
322
|
+
.h-\[360px\]{height:360px}
|
|
322
323
|
.h-\[400px\]{height:400px}
|
|
323
324
|
.h-\[600px\]{height:600px}
|
|
324
325
|
.h-\[calc\(100vh-60px\)\]{height:calc(100vh - 60px)}
|
|
@@ -375,6 +376,7 @@ body{--tw-bg-opacity:1;background-color:hsl(var(--background) / var(--tw-bg-opac
|
|
|
375
376
|
.max-w-48{max-width:12rem}
|
|
376
377
|
.max-w-4xl{max-width:56rem}
|
|
377
378
|
.max-w-5xl{max-width:64rem}
|
|
379
|
+
.max-w-7xl{max-width:80rem}
|
|
378
380
|
.max-w-md{max-width:28rem}
|
|
379
381
|
.flex-1{flex:1 1 0%}
|
|
380
382
|
.flex-shrink-0{flex-shrink:0}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-editor-canvas.d.ts","sourceRoot":"","sources":["../../../client/src/components/map-editor-canvas.tsx"],"names":[],"mappings":"AA2FA,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":"AA2FA,OAAO,kCAAkC,CAAC;AAC1C,OAAO,gDAAgD,CAAC;AAsRxD,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAkH5E,eAAO,MAAM,eAAe,4GAgmS1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"label-pinning.d.ts","sourceRoot":"","sources":["../../../client/src/lib/label-pinning.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAEjF;;;;;GAKG;AAEH,mHAAmH;AACnH,eAAO,MAAM,qBAAqB,oBAAoB,CAAC;AAEvD,mEAAmE;AACnE,eAAO,MAAM,mBAAmB,EAAE,mBAA+D,CAAC;AAElG;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,EAAE,mBAA+D,CAAC;AAEpG,gFAAgF;AAChF,wBAAgB,qBAAqB,CACnC,KAAK,EAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,GAC3D,CAAC,GAAG,CAAC,CAEP;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,IAAI,WAAW,CAAC,wBAAwB,CAAC,QAAQ,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"label-pinning.d.ts","sourceRoot":"","sources":["../../../client/src/lib/label-pinning.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAEjF;;;;;GAKG;AAEH,mHAAmH;AACnH,eAAO,MAAM,qBAAqB,oBAAoB,CAAC;AAEvD,mEAAmE;AACnE,eAAO,MAAM,mBAAmB,EAAE,mBAA+D,CAAC;AAElG;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,EAAE,mBAA+D,CAAC;AAEpG,gFAAgF;AAChF,wBAAgB,qBAAqB,CACnC,KAAK,EAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,GAC3D,CAAC,GAAG,CAAC,CAEP;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,IAAI,WAAW,CAAC,wBAAwB,CAAC,QAAQ,CAAC,CAAC,CAmCxF;AAED,2DAA2D;AAC3D,wBAAgB,qBAAqB,IAAI,WAAW,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC,CAgBtF"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { Layer } from '@/components/layers-panel';
|
|
2
|
+
import { type GradientRange } from './color-utils';
|
|
3
|
+
import { type TracePointPaint } from './trace-timeline';
|
|
4
|
+
/** Everything the full sync computes once per rebuild and the per-feature body reads. */
|
|
5
|
+
export interface PaintContext {
|
|
6
|
+
/** null = no timeline filter active. */
|
|
7
|
+
timelineVisibleIds: ReadonlySet<string> | null;
|
|
8
|
+
/** Ids selected in draw union the component selection, already String()-normalized. */
|
|
9
|
+
selectedIds: ReadonlySet<string>;
|
|
10
|
+
/** `enableSelection || enableDrawing`: selection styling is inert without one of them. */
|
|
11
|
+
selectionEnabled: boolean;
|
|
12
|
+
sizeFieldRanges: ReadonlyMap<string, {
|
|
13
|
+
min: number;
|
|
14
|
+
max: number;
|
|
15
|
+
}>;
|
|
16
|
+
colorFieldRanges: ReadonlyMap<string, GradientRange>;
|
|
17
|
+
tracePointIds: ReadonlySet<string>;
|
|
18
|
+
lastTracePointIds: ReadonlySet<string>;
|
|
19
|
+
lastTracePointLabels: ReadonlyMap<string, string>;
|
|
20
|
+
tracePointColors: ReadonlyMap<string, string>;
|
|
21
|
+
}
|
|
22
|
+
/** What the sync records into the paint caches after styling one feature. */
|
|
23
|
+
export interface PaintedFeatureRecord {
|
|
24
|
+
featureId: string;
|
|
25
|
+
/** `_labelPriority` as if the feature were unselected. */
|
|
26
|
+
basePriority: number;
|
|
27
|
+
selected: boolean;
|
|
28
|
+
/** As-if-timeline-visible opacity; 0 when the feature is 3D-only-hidden. */
|
|
29
|
+
visibleStrokeOpacity: number;
|
|
30
|
+
visibleFillOpacity: number;
|
|
31
|
+
timelineHidden: boolean;
|
|
32
|
+
}
|
|
33
|
+
export interface StyledFeature {
|
|
34
|
+
/** What goes into the `custom-features` source. */
|
|
35
|
+
feature: GeoJSON.Feature;
|
|
36
|
+
paint: PaintedFeatureRecord;
|
|
37
|
+
/** Non-null only for trace points, which the trace timeline fast path repaints. */
|
|
38
|
+
tracePaint: TracePointPaint | null;
|
|
39
|
+
}
|
|
40
|
+
/** Every key the render source needs on a read-only feature: read by a style
|
|
41
|
+
* expression (the canvas `custom-*` layers, `label-pinning.ts`), a fast-path
|
|
42
|
+
* diff (`selection-diff`, `timeline-diff`, `trace-timeline`) or an interaction
|
|
43
|
+
* handler (click-select, context menu, tooltip key). Adding a key here costs
|
|
44
|
+
* one serialize and one tile copy per feature; remove keys before adding. */
|
|
45
|
+
export declare const RENDER_PROPERTY_KEYS: readonly string[];
|
|
46
|
+
/** Host keys copied verbatim onto read-only features. `_dvl_h3`: Map NT's DVL
|
|
47
|
+
* hex bins, whose tooltip identity key reads it off the rendered feature. */
|
|
48
|
+
export declare const RENDER_PASSTHROUGH_KEYS: readonly string[];
|
|
49
|
+
/** Draw-annotation keys the label layout and the arrow overlay read, so
|
|
50
|
+
* annotations exported from one map and imported into another as a read-only
|
|
51
|
+
* layer keep rendering. These are the names MapboxDraw already persists into
|
|
52
|
+
* saved maps and exported GeoJSON -- `kind` (the annotation's shape: `text`,
|
|
53
|
+
* `arrow`, `circle`, `rectangle`) included -- so they are matched verbatim
|
|
54
|
+
* rather than renamed. The gate below reads `kind` for the same reason. */
|
|
55
|
+
export declare const ANNOTATION_PASSTHROUGH_KEYS: readonly string[];
|
|
56
|
+
/**
|
|
57
|
+
* Style one feature for the `custom-features` render source.
|
|
58
|
+
*
|
|
59
|
+
* `slim` picks the payload: read-only features emit only
|
|
60
|
+
* `RENDER_PROPERTY_KEYS` plus the passthroughs, draw features keep every record
|
|
61
|
+
* field. Inputs are never slimmed -- the branches below all still read the
|
|
62
|
+
* feature's own properties; only the emitted `properties` object is reduced.
|
|
63
|
+
*/
|
|
64
|
+
export declare function styleFeatureForPaint(f: GeoJSON.Feature, layer: Layer | undefined, ctx: PaintContext, slim: boolean): StyledFeature;
|
|
65
|
+
//# sourceMappingURL=paint-feature.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paint-feature.d.ts","sourceRoot":"","sources":["../../../client/src/lib/paint-feature.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAOxE,OAAO,EAIL,KAAK,eAAe,EACrB,MAAM,kBAAkB,CAAC;AAE1B,yFAAyF;AACzF,MAAM,WAAW,YAAY;IAC3B,wCAAwC;IACxC,kBAAkB,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IAC/C,uFAAuF;IACvF,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACjC,0FAA0F;IAC1F,gBAAgB,EAAE,OAAO,CAAC;IAC1B,eAAe,EAAE,WAAW,CAAC,MAAM,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACnE,gBAAgB,EAAE,WAAW,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IACrD,aAAa,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACnC,iBAAiB,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACvC,oBAAoB,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClD,gBAAgB,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/C;AAED,6EAA6E;AAC7E,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,0DAA0D;IAC1D,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,4EAA4E;IAC5E,oBAAoB,EAAE,MAAM,CAAC;IAC7B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,cAAc,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,aAAa;IAC5B,mDAAmD;IACnD,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC;IACzB,KAAK,EAAE,oBAAoB,CAAC;IAC5B,mFAAmF;IACnF,UAAU,EAAE,eAAe,GAAG,IAAI,CAAC;CACpC;AAED;;;;6EAI6E;AAC7E,eAAO,MAAM,oBAAoB,EAAE,SAAS,MAAM,EAmBjD,CAAC;AAEF;6EAC6E;AAC7E,eAAO,MAAM,uBAAuB,EAAE,SAAS,MAAM,EAAgB,CAAC;AAEtE;;;;;2EAK2E;AAC3E,eAAO,MAAM,2BAA2B,EAAE,SAAS,MAAM,EAQxD,CAAC;AAUF;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,CAAC,EAAE,OAAO,CAAC,OAAO,EAClB,KAAK,EAAE,KAAK,GAAG,SAAS,EACxB,GAAG,EAAE,YAAY,EACjB,IAAI,EAAE,OAAO,GACZ,aAAa,CAkNf"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The tooltip is the one consumer that used to read record fields straight off
|
|
3
|
+
* the rendered feature. Since TEAM-7584 a read-only feature's payload is the
|
|
4
|
+
* paint keep-list, so the tooltip resolves the record by id in the feature
|
|
5
|
+
* stores instead -- the same move click-select and the context menu already
|
|
6
|
+
* make.
|
|
7
|
+
*/
|
|
8
|
+
/** The part of `maplibregl.MapGeoJSONFeature` this module needs, kept
|
|
9
|
+
* structural so there is no maplibre value import and the tests run in node. */
|
|
10
|
+
export interface RenderedFeatureLike {
|
|
11
|
+
id?: string | number;
|
|
12
|
+
geometry: GeoJSON.Geometry;
|
|
13
|
+
properties: Record<string, unknown> | null;
|
|
14
|
+
}
|
|
15
|
+
export type FeatureLookup = (id: string) => GeoJSON.Feature | null;
|
|
16
|
+
/** `properties.id` is the sync's canonical string id; MapLibre's own `id` may
|
|
17
|
+
* be absent or numeric. Null when neither is usable. */
|
|
18
|
+
export declare function renderedFeatureId(f: RenderedFeatureLike): string | null;
|
|
19
|
+
/**
|
|
20
|
+
* The feature the tooltip should describe: the stored record when the rendered
|
|
21
|
+
* id resolves, otherwise a copy of the rendered feature -- overlays and DVL
|
|
22
|
+
* bins have no store record and must still tooltip.
|
|
23
|
+
*
|
|
24
|
+
* The resolved record is deep-cloned, so a host provider cannot reach the
|
|
25
|
+
* feature stores through a nested value or the geometry. A shallow copy would
|
|
26
|
+
* not be enough here: records carry arbitrary host fields, and before the
|
|
27
|
+
* render source was slimmed the tooltip saw only throwaway tile-clipped
|
|
28
|
+
* geometry and sanitized primitives. The resolved case uses the *stored*
|
|
29
|
+
* geometry -- the rendered one is tile-clipped, and a host reading geometry
|
|
30
|
+
* wants the whole shape.
|
|
31
|
+
*
|
|
32
|
+
* Only ever called for the handful of features under the cursor, so the clone
|
|
33
|
+
* is not on a hot path.
|
|
34
|
+
*/
|
|
35
|
+
export declare function resolveTooltipFeature(rendered: RenderedFeatureLike, lookup: FeatureLookup): GeoJSON.Feature;
|
|
36
|
+
//# sourceMappingURL=tooltip-feature.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltip-feature.d.ts","sourceRoot":"","sources":["../../../client/src/lib/tooltip-feature.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;gFACgF;AAChF,MAAM,WAAW,mBAAmB;IAClC,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;CAC5C;AAED,MAAM,MAAM,aAAa,GAAG,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;AAEnE;wDACwD;AACxD,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,mBAAmB,GAAG,MAAM,GAAG,IAAI,CAKvE;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,mBAAmB,EAC7B,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,OAAO,CAiBjB"}
|