@lblod/ember-rdfa-editor-lblod-plugins 35.1.0 → 35.1.2-dev.d2ac61769c71978bc9bc5e3ff10385057ae807bb
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/.changeset/polite-ears-grow.md +5 -0
- package/CHANGELOG.md +14 -0
- package/addon/components/citation-plugin/citation-card.hbs +1 -0
- package/addon/components/decision-plugin/insert-article.gts +1 -1
- package/addon/components/location-plugin/edit.gts +2 -1
- package/addon/components/location-plugin/insert.gts +2 -1
- package/addon/components/location-plugin/map.gts +72 -8
- package/addon/components/placeholder-utils-plugin/edit.gts +19 -5
- package/addon/components/template-comments-plugin/edit-card.hbs +1 -0
- package/addon/components/variable-plugin/address/edit.hbs +1 -0
- package/addon/components/variable-plugin/location/edit.hbs +39 -36
- package/addon/components/variable-plugin/location/edit.ts +1 -1
- package/addon/components/variable-plugin/number/nodeview.hbs +1 -0
- package/addon/components/variable-plugin/person/edit.hbs +1 -0
- package/addon/helpers/set.ts +15 -0
- package/addon/plugins/roadsign-regulation-plugin/nodes.ts +46 -12
- package/app/styles/location-plugin.scss +9 -0
- package/declarations/addon/components/decision-plugin/insert-article.d.ts +1 -1
- package/declarations/addon/components/location-plugin/edit.d.ts +2 -1
- package/declarations/addon/components/location-plugin/insert.d.ts +2 -1
- package/declarations/addon/components/location-plugin/map.d.ts +6 -0
- package/declarations/addon/components/placeholder-utils-plugin/edit.d.ts +10 -2
- package/declarations/addon/helpers/set.d.ts +2 -0
- package/declarations/addon/plugins/roadsign-regulation-plugin/nodes.d.ts +4 -0
- package/package.json +1 -1
- package/translations/en-US.yaml +1 -0
- package/translations/nl-BE.yaml +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @lblod/ember-rdfa-editor-lblod-plugins
|
|
2
2
|
|
|
3
|
+
## 35.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#634](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/634) [`7f89a0f`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/7f89a0f010d4f843407390621cdab4f0966deb02) Thanks [@kobemertens](https://github.com/kobemertens)! - Change the default tile server of location plugin to GBR and add OSM as an option
|
|
8
|
+
|
|
9
|
+
## 35.1.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#633](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/633) [`2bdb16b`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/2bdb16b0811350bfd01c8a76b316cc0bc9173af9) Thanks [@piemonkey](https://github.com/piemonkey)! - Fix parsing of (deprecated) roadsign_regulation nodes to ignore incorrect `resource="false"` values
|
|
14
|
+
|
|
15
|
+
- [#632](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/632) [`1b9933c`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/1b9933ca93badb06e3c7cc42797f2cc98bf732e3) Thanks [@piemonkey](https://github.com/piemonkey)! - Update location-plugin types to accept null as well as undefined
|
|
16
|
+
|
|
3
17
|
## 35.1.0
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
|
@@ -37,6 +37,7 @@ import { type Point } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/locat
|
|
|
37
37
|
import { type NodeContentsUtils } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/location-plugin/node-contents';
|
|
38
38
|
import { SUPPORTED_LOCATION_TYPES, type LocationType } from './map';
|
|
39
39
|
import { type SafeString } from '@ember/template';
|
|
40
|
+
import type { Option } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/option';
|
|
40
41
|
|
|
41
42
|
interface Message {
|
|
42
43
|
skin: AuAlertSignature['Args']['skin'];
|
|
@@ -50,7 +51,7 @@ type Signature = {
|
|
|
50
51
|
locationTypes?: readonly LocationType[];
|
|
51
52
|
locationType: LocationType;
|
|
52
53
|
setLocationType: (type: LocationType) => void;
|
|
53
|
-
defaultMunicipality
|
|
54
|
+
defaultMunicipality: Option<string>;
|
|
54
55
|
currentAddress?: Address;
|
|
55
56
|
selectedLocationNode: ResolvedPNode | null;
|
|
56
57
|
setAddressToInsert: (address: Address | undefined) => void;
|
|
@@ -34,6 +34,7 @@ import LocationMap, {
|
|
|
34
34
|
import { transactionCombinator } from '@lblod/ember-rdfa-editor/utils/transaction-utils';
|
|
35
35
|
import { updateSubject } from '@lblod/ember-rdfa-editor/plugins/rdfa-info/utils';
|
|
36
36
|
import { replaceSelectionWithLocation } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/location-plugin/_private/utils/node-utils';
|
|
37
|
+
import type { Option } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/option';
|
|
37
38
|
|
|
38
39
|
export type CurrentLocation = Address | GlobalCoordinates | undefined;
|
|
39
40
|
|
|
@@ -58,7 +59,7 @@ interface Signature {
|
|
|
58
59
|
Args: {
|
|
59
60
|
controller: SayController;
|
|
60
61
|
config: LocationPluginConfig;
|
|
61
|
-
defaultMunicipality?: string
|
|
62
|
+
defaultMunicipality?: Option<string>;
|
|
62
63
|
templateMode?: boolean;
|
|
63
64
|
locationTypes?: LocationType[];
|
|
64
65
|
};
|
|
@@ -20,6 +20,10 @@ import {
|
|
|
20
20
|
GeoPos,
|
|
21
21
|
type GlobalCoordinates,
|
|
22
22
|
} from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/location-plugin/utils/geo-helpers';
|
|
23
|
+
import AuToggleSwitch from '@appuniversum/ember-appuniversum/components/au-toggle-switch';
|
|
24
|
+
import AuCard from '@appuniversum/ember-appuniversum/components/au-card';
|
|
25
|
+
import { on } from '@ember/modifier';
|
|
26
|
+
import set from '@lblod/ember-rdfa-editor-lblod-plugins/helpers/set';
|
|
23
27
|
|
|
24
28
|
// Taken from Leaflet's default icon, with the viewbox tweaked (from 0 0 500 820), so that the icon
|
|
25
29
|
// is a whole number of pixels in size, to make positioning the point easy.
|
|
@@ -56,16 +60,26 @@ const MARKER_ICON = Leaflet.divIcon({
|
|
|
56
60
|
export const SUPPORTED_LOCATION_TYPES = ['address', 'place', 'area'] as const;
|
|
57
61
|
export type LocationType = (typeof SUPPORTED_LOCATION_TYPES)[number];
|
|
58
62
|
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
63
|
+
const TILE_PROVIDER_CONSTANTS = {
|
|
64
|
+
OPEN_STREET_MAP: {
|
|
65
|
+
ATTRIBUTION:
|
|
66
|
+
'© <a target="_blank" href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
|
|
67
|
+
URL: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
|
68
|
+
},
|
|
69
|
+
GRB: {
|
|
70
|
+
ATTRIBUTION:
|
|
71
|
+
'Bron: Grootschalig Referentie Bestand Vlaanderen, Digitaal Vlaanderen',
|
|
72
|
+
URL: 'https://geo.api.vlaanderen.be/GRB/wmts?layer=grb_bsk&style=GRB-Basiskaart&tilematrixset=GoogleMapsVL&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image/png&TileMatrix={z}&TileCol={x}&TileRow={y}',
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
|
|
62
76
|
const COORD_SYSTEM_CENTER: GlobalCoordinates = {
|
|
63
77
|
lng: 4.450822554431,
|
|
64
78
|
lat: 50.50526730529,
|
|
65
79
|
};
|
|
66
80
|
const COORD_SYSTEM_START = {
|
|
67
81
|
center: COORD_SYSTEM_CENTER,
|
|
68
|
-
zoom:
|
|
82
|
+
zoom: 8,
|
|
69
83
|
};
|
|
70
84
|
|
|
71
85
|
function isLast(array: unknown[], index: number) {
|
|
@@ -216,6 +230,7 @@ class MapWrapper extends Component<MapWrapperSig> {
|
|
|
216
230
|
|
|
217
231
|
export default class LocationPluginMapComponent extends Component<Signature> {
|
|
218
232
|
@tracked vertices: GlobalCoordinates[] = [];
|
|
233
|
+
@tracked useOpenStreetMaps = false;
|
|
219
234
|
|
|
220
235
|
// Use untracked properties as otherwise the map jumps to any area or location we pick
|
|
221
236
|
existingAreaBounds = generateBoundsFromShape(this.args.existingArea);
|
|
@@ -259,6 +274,14 @@ export default class LocationPluginMapComponent extends Component<Signature> {
|
|
|
259
274
|
return 'center' in this.mapLocation ? this.mapLocation.center : false;
|
|
260
275
|
}
|
|
261
276
|
|
|
277
|
+
get tileProvider() {
|
|
278
|
+
if (this.useOpenStreetMaps) {
|
|
279
|
+
return TILE_PROVIDER_CONSTANTS.OPEN_STREET_MAP;
|
|
280
|
+
} else {
|
|
281
|
+
return TILE_PROVIDER_CONSTANTS.GRB;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
262
285
|
@action
|
|
263
286
|
onMapClick(event: LeafletMouseEvent) {
|
|
264
287
|
if (this.args.locationType === 'place') {
|
|
@@ -280,6 +303,11 @@ export default class LocationPluginMapComponent extends Component<Signature> {
|
|
|
280
303
|
}
|
|
281
304
|
}
|
|
282
305
|
|
|
306
|
+
@action
|
|
307
|
+
stopEventPropagation(event: MouseEvent) {
|
|
308
|
+
event.stopPropagation();
|
|
309
|
+
}
|
|
310
|
+
|
|
283
311
|
<template>
|
|
284
312
|
<div
|
|
285
313
|
class='map-wrapper
|
|
@@ -291,10 +319,46 @@ export default class LocationPluginMapComponent extends Component<Signature> {
|
|
|
291
319
|
@onClick={{this.onMapClick}}
|
|
292
320
|
as |layers|
|
|
293
321
|
>
|
|
294
|
-
<
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
322
|
+
<div
|
|
323
|
+
{{! template-lint-disable no-invalid-interactive }}
|
|
324
|
+
{{on 'click' this.stopEventPropagation}}
|
|
325
|
+
class='tile-provider-selector'
|
|
326
|
+
>
|
|
327
|
+
<AuCard
|
|
328
|
+
class='au-u-padding-tiny'
|
|
329
|
+
@size='flush'
|
|
330
|
+
@textCenter={{true}}
|
|
331
|
+
as |c|
|
|
332
|
+
>
|
|
333
|
+
<c.content>
|
|
334
|
+
<AuToggleSwitch @onChange={{set this 'useOpenStreetMaps'}}>
|
|
335
|
+
<p class='au-u-para-tiny'>{{t
|
|
336
|
+
'location-plugin.use-open-street-map'
|
|
337
|
+
}}</p>
|
|
338
|
+
</AuToggleSwitch>
|
|
339
|
+
</c.content>
|
|
340
|
+
</AuCard>
|
|
341
|
+
</div>
|
|
342
|
+
{{! Don't change: I know the last component from each leg can be lifted out of the condition but cycling the OSM button does not work anymore then}}
|
|
343
|
+
{{#if (eq this.tileProvider.URL TILE_PROVIDER_CONSTANTS.GRB.URL)}}
|
|
344
|
+
<layers.tile
|
|
345
|
+
@url={{TILE_PROVIDER_CONSTANTS.OPEN_STREET_MAP.URL}}
|
|
346
|
+
@minZoom={{8}}
|
|
347
|
+
@maxNativeZoom={{12}}
|
|
348
|
+
/>
|
|
349
|
+
<layers.tile
|
|
350
|
+
@url={{this.tileProvider.URL}}
|
|
351
|
+
@attribution={{this.tileProvider.ATTRIBUTION}}
|
|
352
|
+
@minZoom={{8}}
|
|
353
|
+
/>
|
|
354
|
+
{{else}}
|
|
355
|
+
<layers.tile
|
|
356
|
+
@url={{this.tileProvider.URL}}
|
|
357
|
+
@attribution={{this.tileProvider.ATTRIBUTION}}
|
|
358
|
+
@minZoom={{8}}
|
|
359
|
+
/>
|
|
360
|
+
{{/if}}
|
|
361
|
+
|
|
298
362
|
{{#if (and @address (eq @locationType 'address') this.foundAddress)}}
|
|
299
363
|
<layers.marker
|
|
300
364
|
@location={{this.foundAddress}}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
2
|
import { tracked } from '@glimmer/tracking';
|
|
3
3
|
import { type ComponentLike } from '@glint/template';
|
|
4
|
-
import { NodeSelection, SayController } from '@lblod/ember-rdfa-editor';
|
|
4
|
+
import { NodeSelection, Node, SayController } from '@lblod/ember-rdfa-editor';
|
|
5
5
|
import { service } from '@ember/service';
|
|
6
6
|
import IntlService from 'ember-intl/services/intl';
|
|
7
7
|
import AuCard from '@appuniversum/ember-appuniversum/components/au-card';
|
|
@@ -14,6 +14,8 @@ import AuNativeInput from '../au-native-input';
|
|
|
14
14
|
import AuFormRow from '@appuniversum/ember-appuniversum/components/au-form-row';
|
|
15
15
|
import checkEnterAndSubmit from '@lblod/ember-rdfa-editor-lblod-plugins/utils/check-enter-and-submit';
|
|
16
16
|
import { fn } from '@ember/helper';
|
|
17
|
+
import { modifier } from 'ember-modifier';
|
|
18
|
+
import { not } from 'ember-truth-helpers';
|
|
17
19
|
|
|
18
20
|
type VariableComponentArgs = {
|
|
19
21
|
Args: {
|
|
@@ -35,6 +37,7 @@ type Args = {
|
|
|
35
37
|
|
|
36
38
|
export default class PlaceholderUtilsEditCardComponent extends Component<Args> {
|
|
37
39
|
@tracked editedPlaceholderLabel?: string;
|
|
40
|
+
lastSelectedPlaceholder?: Node;
|
|
38
41
|
|
|
39
42
|
@service declare intl: IntlService;
|
|
40
43
|
|
|
@@ -57,10 +60,10 @@ export default class PlaceholderUtilsEditCardComponent extends Component<Args> {
|
|
|
57
60
|
return !!this.selectedPlaceholderNode;
|
|
58
61
|
}
|
|
59
62
|
get placeholderLabel() {
|
|
60
|
-
|
|
61
|
-
this.editedPlaceholderLabel
|
|
62
|
-
|
|
63
|
-
|
|
63
|
+
if (this.editedPlaceholderLabel !== undefined) {
|
|
64
|
+
return this.editedPlaceholderLabel;
|
|
65
|
+
}
|
|
66
|
+
return this.selectedPlaceholderNode?.attrs.placeholderText;
|
|
64
67
|
}
|
|
65
68
|
updateLabelPlaceholder = (event: InputEvent) => {
|
|
66
69
|
this.editedPlaceholderLabel = (event.target as HTMLInputElement).value;
|
|
@@ -74,8 +77,17 @@ export default class PlaceholderUtilsEditCardComponent extends Component<Args> {
|
|
|
74
77
|
this.editedPlaceholderLabel,
|
|
75
78
|
);
|
|
76
79
|
});
|
|
80
|
+
this.editedPlaceholderLabel = undefined;
|
|
77
81
|
};
|
|
78
82
|
|
|
83
|
+
trackNode = modifier(() => {
|
|
84
|
+
const selectedPlaceholderNode = this.selectedPlaceholderNode;
|
|
85
|
+
if (this.lastSelectedPlaceholder !== selectedPlaceholderNode) {
|
|
86
|
+
this.editedPlaceholderLabel = undefined;
|
|
87
|
+
this.lastSelectedPlaceholder = selectedPlaceholderNode;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
|
|
79
91
|
<template>
|
|
80
92
|
{{#if this.showCard}}
|
|
81
93
|
<AuCard
|
|
@@ -86,6 +98,7 @@ export default class PlaceholderUtilsEditCardComponent extends Component<Args> {
|
|
|
86
98
|
@shadow={{true}}
|
|
87
99
|
@size='small'
|
|
88
100
|
@disableAuContent={{true}}
|
|
101
|
+
{{this.trackNode}}
|
|
89
102
|
as |c|
|
|
90
103
|
>
|
|
91
104
|
<c.header>
|
|
@@ -110,6 +123,7 @@ export default class PlaceholderUtilsEditCardComponent extends Component<Args> {
|
|
|
110
123
|
<AuButton
|
|
111
124
|
{{on 'click' this.updatePlaceholder}}
|
|
112
125
|
class='au-u-margin-top'
|
|
126
|
+
@disabled={{not this.editedPlaceholderLabel}}
|
|
113
127
|
>
|
|
114
128
|
{{t 'editor-plugins.utils.insert'}}
|
|
115
129
|
</AuButton>
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
@expandable={{true}}
|
|
8
8
|
@shadow={{true}}
|
|
9
9
|
@size='small'
|
|
10
|
+
@disableAuContent={{true}}
|
|
10
11
|
as |c|
|
|
11
12
|
>
|
|
12
13
|
<c.header>
|
|
@@ -15,43 +16,45 @@
|
|
|
15
16
|
</AuHeading>
|
|
16
17
|
</c.header>
|
|
17
18
|
<c.content>
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
19
|
+
<AuContent>
|
|
20
|
+
<AuLabel for='location-select'>
|
|
21
|
+
{{this.label}}
|
|
22
|
+
</AuLabel>
|
|
23
|
+
{{#if this.multiSelect}}
|
|
24
|
+
<PowerSelectMultiple
|
|
25
|
+
id='location-select'
|
|
26
|
+
@allowClear={{false}}
|
|
27
|
+
@searchEnabled={{true}}
|
|
28
|
+
@searchField='label'
|
|
29
|
+
@options={{this.locationOptions.value.options}}
|
|
30
|
+
@selected={{this.selectedLocationOption}}
|
|
31
|
+
@onChange={{this.updateLocationOption}}
|
|
32
|
+
as |option|
|
|
33
|
+
>
|
|
34
|
+
{{option.label}}
|
|
35
|
+
</PowerSelectMultiple>
|
|
36
|
+
{{else}}
|
|
37
|
+
<PowerSelect
|
|
38
|
+
id='location-select'
|
|
39
|
+
@dropdownClass='location-select-dropdown'
|
|
40
|
+
@allowClear={{false}}
|
|
41
|
+
@searchEnabled={{true}}
|
|
42
|
+
@searchField='label'
|
|
43
|
+
@options={{this.locationOptions.value.options}}
|
|
44
|
+
@selected={{this.selectedLocationOption}}
|
|
45
|
+
@onChange={{this.updateLocationOption}}
|
|
46
|
+
as |option|
|
|
47
|
+
>
|
|
48
|
+
{{option.label}}
|
|
49
|
+
</PowerSelect>
|
|
50
|
+
{{/if}}
|
|
51
|
+
<AuButton
|
|
52
|
+
{{on 'click' this.insert}}
|
|
53
|
+
@disabled={{not this.selectedLocationOption}}
|
|
31
54
|
>
|
|
32
|
-
{{
|
|
33
|
-
</
|
|
34
|
-
|
|
35
|
-
<PowerSelect
|
|
36
|
-
id='location-select'
|
|
37
|
-
@dropdownClass='location-select-dropdown'
|
|
38
|
-
@allowClear={{false}}
|
|
39
|
-
@searchEnabled={{true}}
|
|
40
|
-
@searchField='label'
|
|
41
|
-
@options={{this.locationOptions.value.options}}
|
|
42
|
-
@selected={{this.selectedLocationOption}}
|
|
43
|
-
@onChange={{this.updateLocationOption}}
|
|
44
|
-
as |option|
|
|
45
|
-
>
|
|
46
|
-
{{option.label}}
|
|
47
|
-
</PowerSelect>
|
|
48
|
-
{{/if}}
|
|
49
|
-
<AuButton
|
|
50
|
-
{{on 'click' this.insert}}
|
|
51
|
-
@disabled={{not this.selectedLocationOption}}
|
|
52
|
-
>
|
|
53
|
-
{{t 'editor-plugins.utils.insert'}}
|
|
54
|
-
</AuButton>
|
|
55
|
+
{{t 'editor-plugins.utils.insert'}}
|
|
56
|
+
</AuButton>
|
|
57
|
+
</AuContent>
|
|
55
58
|
</c.content>
|
|
56
59
|
</AuCard>
|
|
57
60
|
{{/if}}
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
MOBILITEIT,
|
|
25
25
|
RDF,
|
|
26
26
|
} from '@lblod/ember-rdfa-editor-lblod-plugins/utils/constants';
|
|
27
|
-
import { Option } from '@lblod/ember-rdfa-editor/utils/
|
|
27
|
+
import { Option } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/option';
|
|
28
28
|
|
|
29
29
|
export type LocationEditOptions = {
|
|
30
30
|
endpoint: string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export default <T extends string, U>(
|
|
2
|
+
obj: Record<T, U>,
|
|
3
|
+
propName: T,
|
|
4
|
+
value?: U,
|
|
5
|
+
) => {
|
|
6
|
+
if (value === undefined) {
|
|
7
|
+
return (innerValue: U) => {
|
|
8
|
+
obj[propName] = innerValue;
|
|
9
|
+
};
|
|
10
|
+
} else {
|
|
11
|
+
return () => {
|
|
12
|
+
obj[propName] = value;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
};
|
|
@@ -27,6 +27,7 @@ import {
|
|
|
27
27
|
ModelMigrationGenerator,
|
|
28
28
|
} from '@lblod/ember-rdfa-editor/core/rdfa-types';
|
|
29
29
|
import { getRdfaContentElement } from '@lblod/ember-rdfa-editor/core/schema';
|
|
30
|
+
import type { OutgoingTriple } from '@lblod/ember-rdfa-editor/core/rdfa-processor';
|
|
30
31
|
import {
|
|
31
32
|
getNewZonalityUri,
|
|
32
33
|
isLegacyZonalityUri,
|
|
@@ -121,13 +122,28 @@ export const roadsign_regulation: NodeSpec = {
|
|
|
121
122
|
}
|
|
122
123
|
const { rdfaNodeType, properties, backlinks, __rdfaId } = attrs;
|
|
123
124
|
// We need to ensure that a content-literal for the description is added
|
|
124
|
-
|
|
125
|
+
let propertiesFiltered = properties.filter(
|
|
125
126
|
(prop) => !DCT('description').matches(prop.predicate),
|
|
126
127
|
);
|
|
127
128
|
propertiesFiltered.push({
|
|
128
129
|
predicate: DCT('description').full,
|
|
129
130
|
object: sayDataFactory.contentLiteral(),
|
|
130
131
|
});
|
|
132
|
+
|
|
133
|
+
// Previously having no 'temporal' value could lead to a relationship being added, but
|
|
134
|
+
// to `resource="false". Strip this.
|
|
135
|
+
const temporal = node
|
|
136
|
+
.querySelector(
|
|
137
|
+
`span[property~='${EXT('temporal').prefixed}'],
|
|
138
|
+
span[property~='${EXT('temporal').full}']`,
|
|
139
|
+
)
|
|
140
|
+
?.getAttribute('resource');
|
|
141
|
+
if (temporal === 'false') {
|
|
142
|
+
propertiesFiltered = propertiesFiltered.filter(
|
|
143
|
+
(prop) => !EXT('temporal').matches(prop.predicate),
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
|
|
131
147
|
return {
|
|
132
148
|
rdfaNodeType,
|
|
133
149
|
__rdfaId,
|
|
@@ -203,7 +219,7 @@ export const trafficSignalMigration: ModelMigrationGenerator = (attrs) => {
|
|
|
203
219
|
return false;
|
|
204
220
|
};
|
|
205
221
|
|
|
206
|
-
export const
|
|
222
|
+
export const trafficMeasureModelMigration: ModelMigrationGenerator = (
|
|
207
223
|
attrs,
|
|
208
224
|
) => {
|
|
209
225
|
const factory = new SayDataFactory();
|
|
@@ -218,20 +234,34 @@ export const trafficMeasureZonalityMigration: ModelMigrationGenerator = (
|
|
|
218
234
|
) {
|
|
219
235
|
return false;
|
|
220
236
|
}
|
|
237
|
+
|
|
238
|
+
// Migrate zonality to new model
|
|
239
|
+
let newProps: OutgoingTriple[] | undefined;
|
|
221
240
|
const zonalityTriple = getOutgoingTriple(attrs, EXT('zonality'));
|
|
222
|
-
if (
|
|
223
|
-
|
|
241
|
+
if (zonalityTriple && isLegacyZonalityUri(zonalityTriple.object.value)) {
|
|
242
|
+
const newZonalityProp = {
|
|
243
|
+
predicate: EXT('zonality').full,
|
|
244
|
+
object: factory.namedNode(getNewZonalityUri(zonalityTriple.object.value)),
|
|
245
|
+
};
|
|
246
|
+
newProps = attrs.properties
|
|
247
|
+
.filter((prop) => !EXT('zonality').matches(prop.predicate))
|
|
248
|
+
.concat([newZonalityProp]);
|
|
224
249
|
}
|
|
225
|
-
|
|
250
|
+
|
|
251
|
+
// Remove invalid temporal values
|
|
252
|
+
const temporalTriple = getOutgoingTriple(attrs, EXT('temporal'));
|
|
253
|
+
if (
|
|
254
|
+
temporalTriple &&
|
|
255
|
+
temporalTriple.object.value === 'http://example.org/false'
|
|
256
|
+
) {
|
|
257
|
+
newProps = (newProps ?? attrs.properties).filter(
|
|
258
|
+
(prop) => !EXT('temporal').matches(prop.predicate),
|
|
259
|
+
);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
if (!newProps) {
|
|
226
263
|
return false;
|
|
227
264
|
}
|
|
228
|
-
const newZonalityProp = {
|
|
229
|
-
predicate: EXT('zonality').full,
|
|
230
|
-
object: factory.namedNode(getNewZonalityUri(zonalityTriple.object.value)),
|
|
231
|
-
};
|
|
232
|
-
const newProps = attrs.properties
|
|
233
|
-
.filter((prop) => !EXT('zonality').matches(prop.predicate))
|
|
234
|
-
.concat([newZonalityProp]);
|
|
235
265
|
return {
|
|
236
266
|
getAttrs: () => {
|
|
237
267
|
return {
|
|
@@ -241,3 +271,7 @@ export const trafficMeasureZonalityMigration: ModelMigrationGenerator = (
|
|
|
241
271
|
},
|
|
242
272
|
} satisfies ModelMigration;
|
|
243
273
|
};
|
|
274
|
+
/**
|
|
275
|
+
* @deprecated moved to trafficMeasureModelMigration
|
|
276
|
+
*/
|
|
277
|
+
export const trafficMeasureZonalityMigration = trafficMeasureModelMigration;
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
|
|
20
20
|
.map-wrapper {
|
|
21
21
|
height: 100%;
|
|
22
|
+
position: relative;
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
// Override the 'grab' cursor to 'pointer' so we can accurately pick points
|
|
@@ -28,5 +29,13 @@
|
|
|
28
29
|
|
|
29
30
|
.leaflet-container {
|
|
30
31
|
height: 100%;
|
|
32
|
+
font-family: var(--au-font);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.leaflet-container .tile-provider-selector {
|
|
36
|
+
position: absolute;
|
|
37
|
+
bottom: 0.6em;
|
|
38
|
+
left: 0.6em;
|
|
39
|
+
z-index: 1000;
|
|
31
40
|
}
|
|
32
41
|
}
|
|
@@ -6,6 +6,7 @@ import { Address } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/location
|
|
|
6
6
|
import { type NodeContentsUtils } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/location-plugin/node-contents';
|
|
7
7
|
import { type LocationType } from './map';
|
|
8
8
|
import { type SafeString } from '@ember/template';
|
|
9
|
+
import type { Option } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/option';
|
|
9
10
|
interface Message {
|
|
10
11
|
skin: AuAlertSignature['Args']['skin'];
|
|
11
12
|
icon: AuAlertSignature['Args']['icon'];
|
|
@@ -17,7 +18,7 @@ type Signature = {
|
|
|
17
18
|
locationTypes?: readonly LocationType[];
|
|
18
19
|
locationType: LocationType;
|
|
19
20
|
setLocationType: (type: LocationType) => void;
|
|
20
|
-
defaultMunicipality
|
|
21
|
+
defaultMunicipality: Option<string>;
|
|
21
22
|
currentAddress?: Address;
|
|
22
23
|
selectedLocationNode: ResolvedPNode | null;
|
|
23
24
|
setAddressToInsert: (address: Address | undefined) => void;
|
|
@@ -7,12 +7,13 @@ import { GeoPos, type GlobalCoordinates } from '@lblod/ember-rdfa-editor-lblod-p
|
|
|
7
7
|
import { type LocationPluginConfig } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/location-plugin/node';
|
|
8
8
|
import { NodeContentsUtils } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/location-plugin/node-contents';
|
|
9
9
|
import { type LocationType } from './map';
|
|
10
|
+
import type { Option } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/option';
|
|
10
11
|
export type CurrentLocation = Address | GlobalCoordinates | undefined;
|
|
11
12
|
interface Signature {
|
|
12
13
|
Args: {
|
|
13
14
|
controller: SayController;
|
|
14
15
|
config: LocationPluginConfig;
|
|
15
|
-
defaultMunicipality?: string
|
|
16
|
+
defaultMunicipality?: Option<string>;
|
|
16
17
|
templateMode?: boolean;
|
|
17
18
|
locationTypes?: LocationType[];
|
|
18
19
|
};
|
|
@@ -20,11 +20,17 @@ interface Signature {
|
|
|
20
20
|
}
|
|
21
21
|
export default class LocationPluginMapComponent extends Component<Signature> {
|
|
22
22
|
vertices: GlobalCoordinates[];
|
|
23
|
+
useOpenStreetMaps: boolean;
|
|
23
24
|
existingAreaBounds: LatLngBoundsExpression | undefined;
|
|
24
25
|
existingLocationCoords: GlobalCoordinates | undefined;
|
|
25
26
|
mapLocation: LeafletMapStart;
|
|
26
27
|
get foundAddress(): false | import("leaflet").LatLngTuple | import("leaflet").LatLngLiteral;
|
|
28
|
+
get tileProvider(): {
|
|
29
|
+
ATTRIBUTION: string;
|
|
30
|
+
URL: string;
|
|
31
|
+
};
|
|
27
32
|
onMapClick(event: LeafletMouseEvent): void;
|
|
28
33
|
onVertexClick(index: number): void;
|
|
34
|
+
stopEventPropagation(event: MouseEvent): void;
|
|
29
35
|
}
|
|
30
36
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
2
|
import { type ComponentLike } from '@glint/template';
|
|
3
|
-
import { SayController } from '@lblod/ember-rdfa-editor';
|
|
3
|
+
import { Node, SayController } from '@lblod/ember-rdfa-editor';
|
|
4
4
|
import IntlService from 'ember-intl/services/intl';
|
|
5
5
|
type VariableComponentArgs = {
|
|
6
6
|
Args: {
|
|
@@ -20,12 +20,20 @@ type Args = {
|
|
|
20
20
|
};
|
|
21
21
|
export default class PlaceholderUtilsEditCardComponent extends Component<Args> {
|
|
22
22
|
editedPlaceholderLabel?: string;
|
|
23
|
+
lastSelectedPlaceholder?: Node;
|
|
23
24
|
intl: IntlService;
|
|
24
25
|
get controller(): SayController;
|
|
25
|
-
get selectedPlaceholderNode():
|
|
26
|
+
get selectedPlaceholderNode(): Node | undefined;
|
|
26
27
|
get showCard(): boolean;
|
|
27
28
|
get placeholderLabel(): any;
|
|
28
29
|
updateLabelPlaceholder: (event: InputEvent) => void;
|
|
29
30
|
updatePlaceholder: () => void;
|
|
31
|
+
trackNode: import("ember-modifier").FunctionBasedModifier<{
|
|
32
|
+
Args: {
|
|
33
|
+
Positional: unknown[];
|
|
34
|
+
Named: import("ember-modifier/-private/signature.js").EmptyObject;
|
|
35
|
+
};
|
|
36
|
+
Element: Element;
|
|
37
|
+
}>;
|
|
30
38
|
}
|
|
31
39
|
export {};
|
|
@@ -6,4 +6,8 @@ export declare const roadsign_regulation: NodeSpec;
|
|
|
6
6
|
* namedNodes to encode everything in one inline_rdfa
|
|
7
7
|
**/
|
|
8
8
|
export declare const trafficSignalMigration: ModelMigrationGenerator;
|
|
9
|
+
export declare const trafficMeasureModelMigration: ModelMigrationGenerator;
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated moved to trafficMeasureModelMigration
|
|
12
|
+
*/
|
|
9
13
|
export declare const trafficMeasureZonalityMigration: ModelMigrationGenerator;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lblod/ember-rdfa-editor-lblod-plugins",
|
|
3
|
-
"version": "35.1.
|
|
3
|
+
"version": "35.1.2-dev.d2ac61769c71978bc9bc5e3ff10385057ae807bb",
|
|
4
4
|
"description": "Ember addon providing lblod specific plugins for the ember-rdfa-editor",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon",
|
package/translations/en-US.yaml
CHANGED