@open-pioneer/selection 1.3.0-dev.20260519140411 → 1.3.0

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 CHANGED
@@ -1,16 +1,16 @@
1
1
  # @open-pioneer/selection
2
2
 
3
- ## 1.3.0-dev.20260519140411
3
+ ## 1.3.0
4
4
 
5
5
  ### Minor Changes
6
6
 
7
7
  - 9b5d5f3: Support for new common container props (role, aria-\*, data-\* and css)
8
- - d54ccfd: Update to Chakra UI 3.34.0
9
- - 206b397: Update to trails core packages 4.5.0
8
+ - d54ccfd: Update to Chakra UI 3.35.0
9
+ - 4dd92e6: Remove deprecated intl object in selection service
10
+ - 206b397: Update to trails core packages 4.6.0
10
11
 
11
12
  ### Patch Changes
12
13
 
13
- - e464791: Update to Chakra UI @ 3.35.0
14
14
  - 0f1277f: minor changes to support dark color mode
15
15
  - 0704cd6: Use `classnames` from `@open-pioneer/react-utils` instead of `classnames` package.
16
16
 
@@ -1,7 +1,9 @@
1
1
  import { SelectionResult, SelectionOptions, SelectionKind, VectorLayerSelectionSource, SelectionSourceStatusObject } from "./api";
2
2
  import VectorLayer from "ol/layer/Vector";
3
3
  import Feature from "ol/Feature";
4
+ import { ReadonlyReactive } from "@conterra/reactivity-core";
4
5
  import VectorSource from "ol/source/Vector";
6
+ import { PackageIntl } from "@open-pioneer/runtime";
5
7
  /**
6
8
  * A SelectionSource to use an OpenLayers VectorLayer with an OpenLayers VectorSource (e.g. layer of the map).
7
9
  * Features are:
@@ -13,7 +15,7 @@ import VectorSource from "ol/source/Vector";
13
15
  export declare class VectorLayerSelectionSourceImpl implements VectorLayerSelectionSource {
14
16
  #private;
15
17
  readonly label: string;
16
- constructor(vectorLayer: VectorLayer<VectorSource, Feature>, label: string, layerNotVisibleReason: string);
18
+ constructor(vectorLayer: VectorLayer<VectorSource, Feature>, label: string, currentIntl: ReadonlyReactive<PackageIntl>);
17
19
  destroy(): void;
18
20
  get status(): SelectionSourceStatusObject;
19
21
  select(selectionKind: SelectionKind, options: SelectionOptions): Promise<SelectionResult[]>;
@@ -1,20 +1,27 @@
1
1
  import { unByKey } from 'ol/Observable.js';
2
2
  import { v4 } from 'uuid';
3
- import { reactive } from '@conterra/reactivity-core';
3
+ import { reactive, computed } from '@conterra/reactivity-core';
4
4
 
5
5
  class VectorLayerSelectionSourceImpl {
6
6
  label;
7
- #status = reactive({ kind: "available" });
8
7
  #vectorLayer;
9
8
  #eventHandler;
10
- #layerNotVisibleReason;
11
- constructor(vectorLayer, label, layerNotVisibleReason) {
9
+ #currentIntl;
10
+ #layerVisible = reactive(true);
11
+ #status;
12
+ constructor(vectorLayer, label, currentIntl) {
12
13
  this.label = label;
13
14
  this.#vectorLayer = vectorLayer;
14
- this.#layerNotVisibleReason = layerNotVisibleReason;
15
- this.#updateStatus();
15
+ this.#currentIntl = currentIntl;
16
+ this.#layerVisible.value = vectorLayer.getVisible();
17
+ this.#status = computed(
18
+ () => this.#layerVisible.value ? { kind: "available" } : {
19
+ kind: "unavailable",
20
+ reason: this.#currentIntl.value.formatMessage({ id: "layerNotVisibleReason" })
21
+ }
22
+ );
16
23
  this.#eventHandler = this.#vectorLayer.on("change:visible", () => {
17
- this.#updateStatus();
24
+ this.#layerVisible.value = this.#vectorLayer.getVisible();
18
25
  });
19
26
  }
20
27
  destroy() {
@@ -46,13 +53,6 @@ class VectorLayerSelectionSourceImpl {
46
53
  const limitedFeatures = selectedFeatures.length > options.maxResults ? selectedFeatures.slice(0, options.maxResults) : selectedFeatures;
47
54
  return limitedFeatures;
48
55
  }
49
- #updateStatus() {
50
- const layerIsVisible = this.#vectorLayer.getVisible();
51
- const newStatus = layerIsVisible ? { kind: "available" } : { kind: "unavailable", reason: this.#layerNotVisibleReason };
52
- if (newStatus.kind !== this.#status.value.kind) {
53
- this.#status.value = newStatus;
54
- }
55
- }
56
56
  }
57
57
 
58
58
  export { VectorLayerSelectionSourceImpl };
@@ -1 +1 @@
1
- {"version":3,"file":"VectorSelectionSource.js","sources":["VectorSelectionSource.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2023-2025 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport {\n SelectionResult,\n SelectionOptions,\n SelectionSourceStatus,\n SelectionKind,\n VectorLayerSelectionSource,\n SelectionSourceStatusObject\n} from \"./api\";\nimport VectorLayer from \"ol/layer/Vector\";\nimport { EventsKey } from \"ol/events\";\nimport { unByKey } from \"ol/Observable\";\nimport { v4 as uuid4v } from \"uuid\";\nimport Feature from \"ol/Feature\";\nimport { reactive } from \"@conterra/reactivity-core\";\nimport VectorSource from \"ol/source/Vector\";\n\n/**\n * A SelectionSource to use an OpenLayers VectorLayer with an OpenLayers VectorSource (e.g. layer of the map).\n * Features are:\n * - using only the extent as selection kind\n * - listening to layer visibility changes and updating the status of the source\n * - limiting the number of returned selection results to the corresponding selection option\n * - throwing an event `changed:status` when the status updates\n */\nexport class VectorLayerSelectionSourceImpl implements VectorLayerSelectionSource {\n readonly label: string;\n #status = reactive<SelectionSourceStatusObject>({ kind: \"available\" });\n #vectorLayer: VectorLayer<VectorSource, Feature>;\n #eventHandler: EventsKey;\n #layerNotVisibleReason: string;\n\n constructor(\n vectorLayer: VectorLayer<VectorSource, Feature>,\n label: string,\n layerNotVisibleReason: string\n ) {\n this.label = label;\n this.#vectorLayer = vectorLayer;\n this.#layerNotVisibleReason = layerNotVisibleReason;\n this.#updateStatus();\n this.#eventHandler = this.#vectorLayer.on(\"change:visible\", () => {\n this.#updateStatus();\n });\n }\n\n destroy() {\n unByKey(this.#eventHandler);\n }\n\n get status() {\n return this.#status.value;\n }\n\n async select(\n selectionKind: SelectionKind,\n options: SelectionOptions\n ): Promise<SelectionResult[]> {\n if (selectionKind.type !== \"extent\") {\n throw new Error(`Unsupported selection kind: ${selectionKind.type}`);\n }\n\n if (this.#status.value.kind !== \"available\" || this.#vectorLayer.getSource() === null)\n return [];\n\n const allResults: SelectionResult[] = [];\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.#vectorLayer\n .getSource()!\n .forEachFeatureIntersectingExtent(selectionKind.extent, (feature) => {\n if (!feature.getGeometry()) return;\n\n // TODO: Think about where to implement Date-Formatting, if the dates are already\n // encoded as Strings...\n\n const filteredProperties = { ...feature.getProperties() };\n delete filteredProperties.geometries;\n\n const result: SelectionResult = {\n id: feature.getId()?.toString() || uuid4v(),\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n geometry: feature.getGeometry()!,\n properties: filteredProperties\n };\n\n allResults.push(result);\n });\n const selectedFeatures = allResults.filter((s): s is SelectionResult => s != null);\n const limitedFeatures =\n selectedFeatures.length > options.maxResults\n ? selectedFeatures.slice(0, options.maxResults)\n : selectedFeatures;\n return limitedFeatures;\n }\n\n #updateStatus() {\n const layerIsVisible = this.#vectorLayer.getVisible();\n const newStatus: SelectionSourceStatus = layerIsVisible\n ? { kind: \"available\" }\n : { kind: \"unavailable\", reason: this.#layerNotVisibleReason };\n if (newStatus.kind !== this.#status.value.kind) {\n this.#status.value = newStatus;\n }\n }\n}\n"],"names":["uuid4v"],"mappings":";;;;AA0BO,MAAM,8BAAA,CAAqE;AAAA,EACrE,KAAA;AAAA,EACT,OAAA,GAAU,QAAA,CAAsC,EAAE,IAAA,EAAM,aAAa,CAAA;AAAA,EACrE,YAAA;AAAA,EACA,aAAA;AAAA,EACA,sBAAA;AAAA,EAEA,WAAA,CACI,WAAA,EACA,KAAA,EACA,qBAAA,EACF;AACE,IAAA,IAAA,CAAK,KAAA,GAAQ,KAAA;AACb,IAAA,IAAA,CAAK,YAAA,GAAe,WAAA;AACpB,IAAA,IAAA,CAAK,sBAAA,GAAyB,qBAAA;AAC9B,IAAA,IAAA,CAAK,aAAA,EAAc;AACnB,IAAA,IAAA,CAAK,aAAA,GAAgB,IAAA,CAAK,YAAA,CAAa,EAAA,CAAG,kBAAkB,MAAM;AAC9D,MAAA,IAAA,CAAK,aAAA,EAAc;AAAA,IAC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,OAAA,CAAQ,UAAA,GAC5B,iBAAiB,KAAA,CAAM,CAAA,EAAG,OAAA,CAAQ,UAAU,CAAA,GAC5C,gBAAA;AACV,IAAA,OAAO,eAAA;AAAA,EACX;AAAA,EAEA,aAAA,GAAgB;AACZ,IAAA,MAAM,cAAA,GAAiB,IAAA,CAAK,YAAA,CAAa,UAAA,EAAW;AACpD,IAAA,MAAM,SAAA,GAAmC,cAAA,GACnC,EAAE,IAAA,EAAM,WAAA,EAAY,GACpB,EAAE,IAAA,EAAM,aAAA,EAAe,MAAA,EAAQ,IAAA,CAAK,sBAAA,EAAuB;AACjE,IAAA,IAAI,SAAA,CAAU,IAAA,KAAS,IAAA,CAAK,OAAA,CAAQ,MAAM,IAAA,EAAM;AAC5C,MAAA,IAAA,CAAK,QAAQ,KAAA,GAAQ,SAAA;AAAA,IACzB;AAAA,EACJ;AACJ;;;;"}
1
+ {"version":3,"file":"VectorSelectionSource.js","sources":["VectorSelectionSource.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2023-2025 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport {\n SelectionResult,\n SelectionOptions,\n SelectionKind,\n VectorLayerSelectionSource,\n SelectionSourceStatusObject\n} from \"./api\";\nimport VectorLayer from \"ol/layer/Vector\";\nimport { EventsKey } from \"ol/events\";\nimport { unByKey } from \"ol/Observable\";\nimport { v4 as uuid4v } from \"uuid\";\nimport Feature from \"ol/Feature\";\nimport { computed, reactive, ReadonlyReactive } from \"@conterra/reactivity-core\";\nimport VectorSource from \"ol/source/Vector\";\nimport { PackageIntl } from \"@open-pioneer/runtime\";\n\n/**\n * A SelectionSource to use an OpenLayers VectorLayer with an OpenLayers VectorSource (e.g. layer of the map).\n * Features are:\n * - using only the extent as selection kind\n * - listening to layer visibility changes and updating the status of the source\n * - limiting the number of returned selection results to the corresponding selection option\n * - throwing an event `changed:status` when the status updates\n */\nexport class VectorLayerSelectionSourceImpl implements VectorLayerSelectionSource {\n readonly label: string;\n #vectorLayer: VectorLayer<VectorSource, Feature>;\n #eventHandler: EventsKey;\n #currentIntl: ReadonlyReactive<PackageIntl>;\n #layerVisible = reactive<boolean>(true);\n #status: ReadonlyReactive<SelectionSourceStatusObject>;\n\n constructor(\n vectorLayer: VectorLayer<VectorSource, Feature>,\n label: string,\n currentIntl: ReadonlyReactive<PackageIntl>\n ) {\n this.label = label;\n this.#vectorLayer = vectorLayer;\n this.#currentIntl = currentIntl;\n this.#layerVisible.value = vectorLayer.getVisible();\n this.#status = computed<SelectionSourceStatusObject>(() =>\n this.#layerVisible.value\n ? { kind: \"available\" }\n : {\n kind: \"unavailable\",\n reason: this.#currentIntl.value.formatMessage({ id: \"layerNotVisibleReason\" })\n }\n );\n this.#eventHandler = this.#vectorLayer.on(\"change:visible\", () => {\n this.#layerVisible.value = this.#vectorLayer.getVisible();\n });\n }\n\n destroy() {\n unByKey(this.#eventHandler);\n }\n\n get status() {\n return this.#status.value;\n }\n\n async select(\n selectionKind: SelectionKind,\n options: SelectionOptions\n ): Promise<SelectionResult[]> {\n if (selectionKind.type !== \"extent\") {\n throw new Error(`Unsupported selection kind: ${selectionKind.type}`);\n }\n\n if (this.#status.value.kind !== \"available\" || this.#vectorLayer.getSource() === null)\n return [];\n\n const allResults: SelectionResult[] = [];\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.#vectorLayer\n .getSource()!\n .forEachFeatureIntersectingExtent(selectionKind.extent, (feature) => {\n if (!feature.getGeometry()) return;\n\n // TODO: Think about where to implement Date-Formatting, if the dates are already\n // encoded as Strings...\n\n const filteredProperties = { ...feature.getProperties() };\n delete filteredProperties.geometries;\n\n const result: SelectionResult = {\n id: feature.getId()?.toString() || uuid4v(),\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n geometry: feature.getGeometry()!,\n properties: filteredProperties\n };\n\n allResults.push(result);\n });\n const selectedFeatures = allResults.filter((s): s is SelectionResult => s != null);\n const limitedFeatures =\n selectedFeatures.length > options.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AU;AACjC,MAAA,MAAM,IAAI,KAAA,CAAM,CAAA,4BAAA,EAA+B,aAAA,CAAc,IAAI,CAAA,CAAE,CAAA;AAAA,IACvE;AAEA,IAAA,IAAI,IAAA,CAAK,QAAQ,KAAA,CAAM,IAAA,KAAS,eAAe,IAAA,CAAK,YAAA,CAAa,WAAU,KAAM,IAAA;AAC7E,MAAA,OAAO,EAAC;AAEZ,IAAA,MAAM,aAAgC,EAAC;AAEvC,IAAA,IAAA,CAAK,aACA,SAAA,EAAU,CACV,iCAAiC,aAAA,CAAc,MAAA,EAAQ,CAAC,OAAA,KAAY;AACjE,MAAA,IAAI,CAAC,OAAA,CAAQ,WAAA,EAAY,EAAG;AAK5B,MAAA,MAAM,kBAAA,GAAqB,EAAE,GAAG,OAAA,CAAQ,eAAc,EAAE;AACxD,MAAA,OAAO,kBAAA,CAAmB,UAAA;AAE1B,MAAA,MAAM,MAAA,GAA0B;AAAA,QAC5B,IAAI,OAAA,CAAQ,KAAA,EAAM,EAAG,QAAA,MAAcA,EAAA,EAAO;AAAA;AAAA,QAE1C,QAAA,EAAU,QAAQ,WAAA,EAAY;AAAA,QAC9B,UAAA,EAAY;AAAA,OAChB;AAEA,MAAA,UAAA,CAAW,KAAK,MAAM,CAAA;AAAA,IAC1B,CAAC,CAAA;AACL,IAAA,MAAM,mBAAmB,UAAA,CAAW,MAAA,CAAO,CAAC,CAAA,KAA4B,KAAK,IAAI,CAAA;AACjF,IAAA,MAAM,eAAA,GACF,gBAAA,CAAiB,MAAA,GAAS,OAAA,CAAQ,UAAA,GAC5B,iBAAiB,KAAA,CAAM,CAAA,EAAG,OAAA,CAAQ,UAAU,CAAA,GAC5C,gBAAA;AACV,IAAA,OAAO,eAAA;AAAA,EACX;AACJ;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@open-pioneer/selection",
4
- "version": "1.3.0-dev.20260519140411",
4
+ "version": "1.3.0",
5
5
  "description": "This package provides a UI component to perform a selection on given selection sources from the map.",
6
6
  "keywords": [
7
7
  "open-pioneer-trails"
@@ -15,18 +15,18 @@
15
15
  },
16
16
  "dependencies": {
17
17
  "@chakra-ui/react": "^3.35.0",
18
- "@open-pioneer/core": "4.6.0-dev.20260519125519",
19
- "@open-pioneer/notifier": "4.6.0-dev.20260519125519",
20
- "@open-pioneer/react-utils": "4.6.0-dev.20260519125519",
21
- "@open-pioneer/runtime": "4.6.0-dev.20260519125519",
18
+ "@open-pioneer/core": "^4.6.0",
19
+ "@open-pioneer/notifier": "^4.6.0",
20
+ "@open-pioneer/react-utils": "^4.6.0",
21
+ "@open-pioneer/runtime": "^4.6.0",
22
22
  "ol": "^10.9.0",
23
23
  "react": "^19.2.6",
24
24
  "react-icons": "^5.6.0",
25
25
  "uuid": "^14.0.0",
26
26
  "@conterra/reactivity-core": "^0.8.5",
27
- "@open-pioneer/reactivity": "4.6.0-dev.20260519125519",
28
- "@open-pioneer/chakra-snippets": "4.6.0-dev.20260519125519",
29
- "@open-pioneer/map": "1.3.0-dev.20260519140411"
27
+ "@open-pioneer/reactivity": "^4.6.0",
28
+ "@open-pioneer/chakra-snippets": "^4.6.0",
29
+ "@open-pioneer/map": "1.3.0"
30
30
  },
31
31
  "exports": {
32
32
  "./package.json": "./package.json",
package/services.d.ts CHANGED
@@ -2,6 +2,6 @@ import { type PackageIntl, ServiceOptions } from "@open-pioneer/runtime";
2
2
  import { VectorLayerSelectionSource, VectorLayerSelectionSourceFactory, VectorLayerSelectionSourceOptions } from "./api";
3
3
  export declare class VectorSelectionSourceFactory implements VectorLayerSelectionSourceFactory {
4
4
  #private;
5
- constructor({ intl }: ServiceOptions<PackageIntl>);
5
+ constructor({ currentIntl }: ServiceOptions<PackageIntl>);
6
6
  createSelectionSource(options: VectorLayerSelectionSourceOptions): VectorLayerSelectionSource;
7
7
  }
package/services.js CHANGED
@@ -1,15 +1,15 @@
1
1
  import { VectorLayerSelectionSourceImpl } from './VectorSelectionSource.js';
2
2
 
3
3
  class VectorSelectionSourceFactory {
4
- #intl;
5
- constructor({ intl }) {
6
- this.#intl = intl;
4
+ #currentIntl;
5
+ constructor({ currentIntl }) {
6
+ this.#currentIntl = currentIntl;
7
7
  }
8
8
  createSelectionSource(options) {
9
9
  return new VectorLayerSelectionSourceImpl(
10
10
  options.vectorLayer,
11
11
  options.label,
12
- this.#intl.formatMessage({ id: "layerNotVisibleReason" })
12
+ this.#currentIntl
13
13
  );
14
14
  }
15
15
  }
package/services.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"services.js","sources":["services.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2023-2025 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport { type PackageIntl, ServiceOptions } from \"@open-pioneer/runtime\";\nimport { VectorLayerSelectionSourceImpl } from \"./VectorSelectionSource\";\nimport {\n VectorLayerSelectionSource,\n VectorLayerSelectionSourceFactory,\n VectorLayerSelectionSourceOptions\n} from \"./api\";\n\nexport class VectorSelectionSourceFactory implements VectorLayerSelectionSourceFactory {\n #intl: PackageIntl;\n\n constructor({ intl }: ServiceOptions<PackageIntl>) {\n this.#intl = intl;\n }\n createSelectionSource(options: VectorLayerSelectionSourceOptions): VectorLayerSelectionSource {\n return new VectorLayerSelectionSourceImpl(\n options.vectorLayer,\n options.label,\n this.#intl.formatMessage({ id: \"layerNotVisibleReason\" })\n );\n }\n}\n"],"names":[],"mappings":";;AAUO,MAAM,4BAAA,CAA0E;AAAA,EACnF,KAAA;AAAA,EAEA,WAAA,CAAY,EAAE,IAAA,EAAK,EAAgC;AAC/C,IAAA,IAAA,CAAK,KAAA,GAAQ,IAAA;AAAA,EACjB;AAAA,EACA,sBAAsB,OAAA,EAAwE;AAC1F,IAAA,OAAO,IAAI,8BAAA;AAAA,MACP,OAAA,CAAQ,WAAA;AAAA,MACR,OAAA,CAAQ,KAAA;AAAA,MACR,KAAK,KAAA,CAAM,aAAA,CAAc,EAAE,EAAA,EAAI,yBAAyB;AAAA,KAC5D;AAAA,EACJ;AACJ;;;;"}
1
+ {"version":3,"file":"services.js","sources":["services.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2023-2025 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport { type PackageIntl, ServiceOptions } from \"@open-pioneer/runtime\";\nimport { VectorLayerSelectionSourceImpl } from \"./VectorSelectionSource\";\nimport {\n VectorLayerSelectionSource,\n VectorLayerSelectionSourceFactory,\n VectorLayerSelectionSourceOptions\n} from \"./api\";\nimport { ReadonlyReactive } from \"@conterra/reactivity-core\";\n\nexport class VectorSelectionSourceFactory implements VectorLayerSelectionSourceFactory {\n #currentIntl: ReadonlyReactive<PackageIntl>;\n\n constructor({ currentIntl }: ServiceOptions<PackageIntl>) {\n this.#currentIntl = currentIntl;\n }\n createSelectionSource(options: VectorLayerSelectionSourceOptions): VectorLayerSelectionSource {\n return new VectorLayerSelectionSourceImpl(\n options.vectorLayer,\n options.label,\n this.#currentIntl\n );\n }\n}\n"],"names":[],"mappings":";;AAWO,MAAM,4BAAA,CAA0E;AAAA,EACnF,YAAA;AAAA,EAEA,WAAA,CAAY,EAAE,WAAA,EAAY,EAAgC;AACtD,IAAA,IAAA,CAAK,YAAA,GAAe,WAAA;AAAA,EACxB;AAAA,EACA,sBAAsB,OAAA,EAAwE;AAC1F,IAAA,OAAO,IAAI,8BAAA;AAAA,MACP,OAAA,CAAQ,WAAA;AAAA,MACR,OAAA,CAAQ,KAAA;AAAA,MACR,IAAA,CAAK;AAAA,KACT;AAAA,EACJ;AACJ;;;;"}