@lblod/ember-rdfa-editor-lblod-plugins 37.2.1 → 37.3.0-dev.271d0772b577d88af09ca5bd92434fe4d987a16a
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/few-dryers-peel.md +5 -0
- package/.changeset/nasty-pots-bathe.md +5 -0
- package/.changeset/tough-months-change.md +5 -0
- package/.changeset/twenty-poets-vanish.md +5 -0
- package/CHANGELOG.md +6 -0
- package/addon/plugins/document-validation-plugin/index.ts +3 -14
- package/addon/plugins/location-plugin/contextual-actions/index.ts +80 -74
- package/addon/plugins/location-plugin/utils/replace-location.ts +14 -10
- package/addon/plugins/roadsign-regulation-plugin/constants.ts +1 -2
- package/addon/plugins/structure-plugin/monads/insert-structure.ts +5 -2
- package/addon/plugins/variable-plugin/actions/create-classic-location-variable.ts +1 -0
- package/addon/plugins/variable-plugin/contextual-actions/index.ts +48 -19
- package/addon/utils/dom-output-spec-helpers.ts +2 -2
- package/addon/utils/option.ts +1 -1
- package/declarations/addon/components/document-validation-plugin/card.d.ts +6 -6
- package/declarations/addon/plugins/document-validation-plugin/index.d.ts +0 -2
- package/declarations/addon/plugins/location-plugin/contextual-actions/index.d.ts +4 -11
- package/declarations/addon/plugins/location-plugin/utils/replace-location.d.ts +2 -2
- package/declarations/addon/plugins/roadsign-regulation-plugin/constants.d.ts +1 -2
- package/declarations/addon/plugins/structure-plugin/structure-types.d.ts +1 -1
- package/declarations/addon/plugins/variable-plugin/actions/create-classic-location-variable.d.ts +1 -0
- package/declarations/addon/plugins/variable-plugin/contextual-actions/index.d.ts +3 -5
- package/declarations/addon/utils/dom-output-spec-helpers.d.ts +2 -2
- package/declarations/addon/utils/option.d.ts +1 -1
- package/package.json +6 -14
- package/pnpm-workspace.yaml +2 -0
- package/app/models/template.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @lblod/ember-rdfa-editor-lblod-plugins
|
|
2
2
|
|
|
3
|
+
## 37.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#664](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/664) [`5762f00`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/5762f007f928081a911ae9c50fb5a7b94bf3fec1) Thanks [@piemonkey](https://github.com/piemonkey)! - Update @rdfjs/types to v2
|
|
8
|
+
|
|
3
9
|
## 37.2.1
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -9,12 +9,7 @@ import {
|
|
|
9
9
|
SayController,
|
|
10
10
|
} from '@lblod/ember-rdfa-editor';
|
|
11
11
|
import removeQuotes from '@lblod/ember-rdfa-editor-lblod-plugins/utils/remove-quotes';
|
|
12
|
-
import {
|
|
13
|
-
DataFactory,
|
|
14
|
-
DatasetCore,
|
|
15
|
-
DatasetCoreFactory,
|
|
16
|
-
Quad,
|
|
17
|
-
} from '@rdfjs/types';
|
|
12
|
+
import { DatasetCore, Quad } from '@rdfjs/types';
|
|
18
13
|
import ValidationReport from 'rdf-validate-shacl/src/validation-report';
|
|
19
14
|
import { SayDataFactory } from '@lblod/ember-rdfa-editor/core/say-data-factory';
|
|
20
15
|
import {
|
|
@@ -55,11 +50,6 @@ export interface DocumentValidationPluginArgs {
|
|
|
55
50
|
rules: Rule[];
|
|
56
51
|
}
|
|
57
52
|
|
|
58
|
-
export type ShaclValidationReport = ValidationReport.ValidationReport<
|
|
59
|
-
DataFactory<Quad, Quad> &
|
|
60
|
-
DatasetCoreFactory<Quad, Quad, DatasetCore<Quad, Quad>>
|
|
61
|
-
>;
|
|
62
|
-
|
|
63
53
|
type PropertyWithError = {
|
|
64
54
|
message: string;
|
|
65
55
|
subject: string | undefined;
|
|
@@ -133,10 +123,9 @@ async function validationCallback(view: EditorView, documentHtml: string) {
|
|
|
133
123
|
const shacl = await parse(documentShape);
|
|
134
124
|
|
|
135
125
|
const validator = new SHACLValidator(shacl, {
|
|
136
|
-
// @ts-expect-error ts doesn't recognize the configuration parameter not sure why
|
|
137
126
|
allowNamedNodeInList: true,
|
|
138
127
|
});
|
|
139
|
-
const report = validator.validate(rdf);
|
|
128
|
+
const report = await validator.validate(rdf);
|
|
140
129
|
const sayFactory = new SayDataFactory();
|
|
141
130
|
const propertyPred = sayFactory.namedNode(
|
|
142
131
|
'http://www.w3.org/ns/shacl#property',
|
|
@@ -159,7 +148,7 @@ async function validationCallback(view: EditorView, documentHtml: string) {
|
|
|
159
148
|
message: removeQuotes(message),
|
|
160
149
|
subject: r.focusNode?.value,
|
|
161
150
|
shape: sourceShape.value,
|
|
162
|
-
constraint: r.sourceConstraintComponent?.value
|
|
151
|
+
constraint: r.sourceConstraintComponent?.value,
|
|
163
152
|
});
|
|
164
153
|
}
|
|
165
154
|
}
|
|
@@ -8,6 +8,7 @@ import { replaceLocationCommand } from '../utils/replace-location';
|
|
|
8
8
|
import { Area, Place } from '../utils/geo-helpers';
|
|
9
9
|
import { Address } from '../utils/address-helpers';
|
|
10
10
|
import { getLocationUri } from '../_private/utils/location-helpers';
|
|
11
|
+
import { ContextualActionGroup } from '@lblod/ember-rdfa-editor/plugins/contextual-actions';
|
|
11
12
|
|
|
12
13
|
const otherElementsGroupId =
|
|
13
14
|
'other-elements-e01f46a0-b323-4add-8035-d81dc2e8578d';
|
|
@@ -16,78 +17,85 @@ const recentLocationsGroupId =
|
|
|
16
17
|
|
|
17
18
|
const SUGGESTION_AMOUNT = 15;
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const selectedNode = selection.node;
|
|
25
|
-
if (selectedNode.type.name !== 'oslo_location') return [];
|
|
20
|
+
function getLocationSuggestionOptions(state: EditorState) {
|
|
21
|
+
const { selection } = state;
|
|
22
|
+
if (!(selection instanceof NodeSelection)) return [];
|
|
23
|
+
const selectedNode = selection.node;
|
|
24
|
+
if (selectedNode.type.name !== 'oslo_location') return [];
|
|
26
25
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
const selectedLocation = selectedNode.attrs.value as
|
|
27
|
+
| Address
|
|
28
|
+
| Place
|
|
29
|
+
| Area
|
|
30
|
+
| undefined;
|
|
32
31
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
32
|
+
return getDocumentLocations(state)
|
|
33
|
+
.filter(
|
|
34
|
+
(location) =>
|
|
35
|
+
!selectedLocation ||
|
|
36
|
+
getLocationUri(selectedLocation) !== getLocationUri(location),
|
|
37
|
+
)
|
|
38
|
+
.slice(0, SUGGESTION_AMOUNT)
|
|
39
|
+
.map((location) => ({
|
|
40
|
+
label: location.formatted,
|
|
41
|
+
id: uuidv4(),
|
|
42
|
+
group: recentLocationsGroupId,
|
|
43
|
+
command: replaceLocationCommand(
|
|
44
|
+
{ value: selection.node, pos: selection.from },
|
|
45
|
+
location,
|
|
46
|
+
),
|
|
47
|
+
}));
|
|
48
|
+
}
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
label: t(
|
|
53
|
-
'location-plugin.context-actions.insert-address',
|
|
54
|
-
'Adres invoegen',
|
|
55
|
-
),
|
|
56
|
-
locationType: 'address' as LocationType,
|
|
57
|
-
icon: 'location',
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
label: t(
|
|
61
|
-
'location-plugin.context-actions.insert-point-on-map',
|
|
62
|
-
'Punt op de kaart invoegen',
|
|
63
|
-
),
|
|
64
|
-
locationType: 'place' as LocationType,
|
|
65
|
-
icon: 'location-gps',
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
label: t(
|
|
69
|
-
'location-plugin.context-actions.insert-area',
|
|
70
|
-
'Gebied invoegen',
|
|
71
|
-
),
|
|
72
|
-
locationType: 'area' as LocationType,
|
|
73
|
-
icon: 'area',
|
|
74
|
-
},
|
|
75
|
-
].map((option) => {
|
|
76
|
-
return {
|
|
77
|
-
...option,
|
|
78
|
-
id: uuidv4(),
|
|
79
|
-
group: otherElementsGroupId,
|
|
80
|
-
command: openLocationModalCommand(option.locationType),
|
|
81
|
-
};
|
|
82
|
-
});
|
|
50
|
+
function getOtherElementsOptions(state: EditorState) {
|
|
51
|
+
const t = getTranslationFunction(state);
|
|
83
52
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
53
|
+
return [
|
|
54
|
+
{
|
|
55
|
+
label: t(
|
|
56
|
+
'location-plugin.context-actions.insert-address',
|
|
57
|
+
'Adres invoegen',
|
|
58
|
+
),
|
|
59
|
+
locationType: 'address' as LocationType,
|
|
60
|
+
icon: 'location',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
label: t(
|
|
64
|
+
'location-plugin.context-actions.insert-point-on-map',
|
|
65
|
+
'Punt op de kaart invoegen',
|
|
66
|
+
),
|
|
67
|
+
locationType: 'place' as LocationType,
|
|
68
|
+
icon: 'location-gps',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
label: t(
|
|
72
|
+
'location-plugin.context-actions.insert-area',
|
|
73
|
+
'Gebied invoegen',
|
|
74
|
+
),
|
|
75
|
+
locationType: 'area' as LocationType,
|
|
76
|
+
icon: 'area',
|
|
77
|
+
},
|
|
78
|
+
].map((option) => {
|
|
79
|
+
return {
|
|
80
|
+
...option,
|
|
81
|
+
id: uuidv4(),
|
|
82
|
+
group: otherElementsGroupId,
|
|
83
|
+
command: openLocationModalCommand(option.locationType),
|
|
84
|
+
};
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export function getContextualActions(type: 'suggestions' | 'other_elements') {
|
|
89
|
+
return function (state: EditorState, searchQuery?: string) {
|
|
90
|
+
const options =
|
|
91
|
+
type === 'suggestions'
|
|
92
|
+
? getLocationSuggestionOptions(state)
|
|
93
|
+
: getOtherElementsOptions(state);
|
|
94
|
+
return options.filter(
|
|
95
|
+
(option) =>
|
|
96
|
+
!searchQuery ||
|
|
97
|
+
option.label.toLocaleLowerCase().includes(searchQuery.toLowerCase()),
|
|
98
|
+
);
|
|
91
99
|
};
|
|
92
100
|
}
|
|
93
101
|
|
|
@@ -100,7 +108,7 @@ function contextualGroupIsVisible(state: EditorState) {
|
|
|
100
108
|
}
|
|
101
109
|
|
|
102
110
|
export function getContextualActionGroups() {
|
|
103
|
-
return function (state: EditorState) {
|
|
111
|
+
return function (state: EditorState): ContextualActionGroup[] {
|
|
104
112
|
if (!contextualGroupIsVisible(state)) return [];
|
|
105
113
|
return [
|
|
106
114
|
{
|
|
@@ -109,15 +117,13 @@ export function getContextualActionGroups() {
|
|
|
109
117
|
'location-plugin.context-actions.location-suggestions',
|
|
110
118
|
'Locatiesuggesties',
|
|
111
119
|
),
|
|
120
|
+
getActions: getContextualActions('suggestions'),
|
|
112
121
|
},
|
|
113
122
|
{
|
|
114
123
|
id: otherElementsGroupId,
|
|
115
|
-
label: getTranslationFunction(state)(
|
|
116
|
-
'location-plugin.context-actions.other-elements',
|
|
117
|
-
'Andere elementen',
|
|
118
|
-
),
|
|
119
124
|
sticky: 'bottom',
|
|
125
|
+
getActions: getContextualActions('other_elements'),
|
|
120
126
|
},
|
|
121
|
-
];
|
|
127
|
+
] satisfies ContextualActionGroup[];
|
|
122
128
|
};
|
|
123
129
|
}
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
TextSelection,
|
|
9
9
|
PNode,
|
|
10
10
|
Selection,
|
|
11
|
+
Command,
|
|
11
12
|
} from '@lblod/ember-rdfa-editor';
|
|
12
13
|
import type { FullTriple } from '@lblod/ember-rdfa-editor/core/rdfa-processor';
|
|
13
14
|
import { PROV } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/constants';
|
|
@@ -39,8 +40,8 @@ function moveNodeSelectionForward(selection: Selection, doc: PNode) {
|
|
|
39
40
|
export function replaceLocationCommand(
|
|
40
41
|
node: ResolvedPNode,
|
|
41
42
|
location: Address | Place | Area,
|
|
42
|
-
) {
|
|
43
|
-
return function (state: EditorState, dispatch
|
|
43
|
+
): Command {
|
|
44
|
+
return function (state: EditorState, dispatch?: (tr: Transaction) => void) {
|
|
44
45
|
const df = new SayDataFactory();
|
|
45
46
|
const { pos, value: locNode } = node;
|
|
46
47
|
// The location's subject has likely changed, so we should update the external links too
|
|
@@ -57,7 +58,7 @@ export function replaceLocationCommand(
|
|
|
57
58
|
}
|
|
58
59
|
}); // update the location value and the external triples
|
|
59
60
|
const tr = state.tr;
|
|
60
|
-
const setLocationTr = transactionCombinator(
|
|
61
|
+
const { transaction: setLocationTr, result } = transactionCombinator(
|
|
61
62
|
state,
|
|
62
63
|
tr
|
|
63
64
|
.setNodeAttribute(pos, 'value', location)
|
|
@@ -71,13 +72,16 @@ export function replaceLocationCommand(
|
|
|
71
72
|
keepProperties: false,
|
|
72
73
|
keepExternalTriples: true,
|
|
73
74
|
}),
|
|
74
|
-
])
|
|
75
|
+
]);
|
|
75
76
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
77
|
+
if (dispatch) {
|
|
78
|
+
const newSelection = moveNodeSelectionForward(
|
|
79
|
+
state.selection.map(setLocationTr.doc, setLocationTr.mapping),
|
|
80
|
+
setLocationTr.doc,
|
|
81
|
+
);
|
|
82
|
+
setLocationTr.setSelection(newSelection);
|
|
83
|
+
dispatch(setLocationTr);
|
|
84
|
+
}
|
|
85
|
+
return result.every((res) => res);
|
|
82
86
|
};
|
|
83
87
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { MOBILITEIT } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/constants';
|
|
2
2
|
import { ValueOf } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/types';
|
|
3
|
-
import { ValuesOf } from '@lblod/ember-rdfa-editor/utils/_private/types';
|
|
4
3
|
|
|
5
4
|
export const ZONALITY_OPTIONS = {
|
|
6
5
|
POTENTIALLY_ZONAL:
|
|
@@ -54,7 +53,7 @@ export function isLegacyZonalityUri(uri: string): uri is LegacyZonalityUri {
|
|
|
54
53
|
return Object.values(ZONALITY_OPTIONS_LEGACY).includes(uri);
|
|
55
54
|
}
|
|
56
55
|
|
|
57
|
-
export type ZonalityOption =
|
|
56
|
+
export type ZonalityOption = ValueOf<typeof ZONALITY_OPTIONS>;
|
|
58
57
|
export type ZonalOrNot = Exclude<
|
|
59
58
|
ZonalityOption,
|
|
60
59
|
typeof ZONALITY_OPTIONS.POTENTIALLY_ZONAL
|
|
@@ -83,7 +83,10 @@ export function findHowToInsertStructure(
|
|
|
83
83
|
|
|
84
84
|
const closestAncestorRank = parentStructures[0]?.rank;
|
|
85
85
|
// ### Either there is no parent structure or the nearest parent is higher in the hierarchy
|
|
86
|
-
if (
|
|
86
|
+
if (
|
|
87
|
+
parentStructures.length === 0 ||
|
|
88
|
+
(closestAncestorRank && closestAncestorRank < hierarchyRank)
|
|
89
|
+
) {
|
|
87
90
|
if (
|
|
88
91
|
selection instanceof NodeSelection &&
|
|
89
92
|
isHierarchyNode(selection.node)
|
|
@@ -112,7 +115,7 @@ export function findHowToInsertStructure(
|
|
|
112
115
|
// ### We have parent structures that are lower in the hierarchy, so find one where we can insert
|
|
113
116
|
for (let i = 0; i < parentStructures.length; i++) {
|
|
114
117
|
const parentStructure = parentStructures[i];
|
|
115
|
-
const parentRank = parentStructure.rank;
|
|
118
|
+
const parentRank = parentStructure.rank ?? -1;
|
|
116
119
|
if (hierarchyRank === parentRank) {
|
|
117
120
|
// ### If parent we are looking at is same structure type, put an empty structure after that one
|
|
118
121
|
const insertLocation =
|
|
@@ -24,10 +24,18 @@ import { getActiveEditableNode } from '@lblod/ember-rdfa-editor/plugins/editable
|
|
|
24
24
|
import { isRdfaAttrs } from '@lblod/ember-rdfa-editor/core/rdfa-types';
|
|
25
25
|
import { v4 as uuidv4 } from 'uuid';
|
|
26
26
|
import { getTranslationFunction } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/translation';
|
|
27
|
+
import { type CodeListOptions } from '../utils/fetch-data';
|
|
28
|
+
import { ContextualActionGroup } from '@lblod/ember-rdfa-editor/plugins/contextual-actions';
|
|
27
29
|
|
|
28
30
|
const plaatsbepalingGroupId =
|
|
29
31
|
'plaatsbepaling-1d8563d6-bfd8-487f-a2a0-6d7a6ab01cb5';
|
|
30
32
|
|
|
33
|
+
const placeDescriptionCodelistCache: {
|
|
34
|
+
placeDescriptions: CodeListOptions | null;
|
|
35
|
+
} = {
|
|
36
|
+
placeDescriptions: null,
|
|
37
|
+
};
|
|
38
|
+
|
|
31
39
|
function getSelectedLocation(state: EditorState) {
|
|
32
40
|
const { selection } = state;
|
|
33
41
|
if (
|
|
@@ -131,27 +139,47 @@ function createInsertPlaceDescriptionCommand(label: string) {
|
|
|
131
139
|
};
|
|
132
140
|
}
|
|
133
141
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
142
|
+
async function getPlaceDescriptionsCached(
|
|
143
|
+
state: EditorState,
|
|
144
|
+
{
|
|
145
|
+
zonalLocationCodelistUri,
|
|
146
|
+
nonZonalLocationCodelistUri,
|
|
147
|
+
endpoint,
|
|
148
|
+
}: GetContextualActionsAttrs,
|
|
149
|
+
) {
|
|
150
|
+
const source = getSource(state, endpoint);
|
|
151
|
+
const isZonal = getIsZonal(state);
|
|
152
|
+
let options;
|
|
153
|
+
if (!placeDescriptionCodelistCache.placeDescriptions) {
|
|
154
|
+
options = await fetchCodeListOptions(
|
|
143
155
|
source,
|
|
144
156
|
isZonal ? zonalLocationCodelistUri : nonZonalLocationCodelistUri,
|
|
145
157
|
);
|
|
158
|
+
placeDescriptionCodelistCache.placeDescriptions = options;
|
|
159
|
+
} else {
|
|
160
|
+
options = placeDescriptionCodelistCache.placeDescriptions;
|
|
161
|
+
}
|
|
146
162
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
163
|
+
return options;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export function getContextualActions(attrs: GetContextualActionsAttrs) {
|
|
167
|
+
return async function (state: EditorState, searchQuery?: string) {
|
|
168
|
+
const result = await getPlaceDescriptionsCached(state, attrs);
|
|
169
|
+
return result.options
|
|
170
|
+
.filter(
|
|
171
|
+
(option) =>
|
|
172
|
+
!searchQuery ||
|
|
173
|
+
option.label.toLowerCase().includes(searchQuery.toLowerCase()),
|
|
174
|
+
)
|
|
175
|
+
.map((option) => {
|
|
176
|
+
return {
|
|
177
|
+
id: uuidv4(),
|
|
178
|
+
label: humanReadableLabel(option.label),
|
|
179
|
+
group: plaatsbepalingGroupId,
|
|
180
|
+
command: createInsertPlaceDescriptionCommand(option.label),
|
|
181
|
+
};
|
|
182
|
+
});
|
|
155
183
|
};
|
|
156
184
|
}
|
|
157
185
|
|
|
@@ -171,8 +199,8 @@ function contextualGroupIsVisible(state: EditorState) {
|
|
|
171
199
|
);
|
|
172
200
|
}
|
|
173
201
|
|
|
174
|
-
export function getContextualActionGroups() {
|
|
175
|
-
return function (state: EditorState) {
|
|
202
|
+
export function getContextualActionGroups(attrs: GetContextualActionsAttrs) {
|
|
203
|
+
return function (state: EditorState): ContextualActionGroup[] {
|
|
176
204
|
return contextualGroupIsVisible(state)
|
|
177
205
|
? [
|
|
178
206
|
{
|
|
@@ -181,6 +209,7 @@ export function getContextualActionGroups() {
|
|
|
181
209
|
'variable.location.label',
|
|
182
210
|
'Plaatsbeschrijving',
|
|
183
211
|
),
|
|
212
|
+
getActions: getContextualActions(attrs),
|
|
184
213
|
},
|
|
185
214
|
]
|
|
186
215
|
: [];
|
|
@@ -3,7 +3,7 @@ import { EXT } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/constants';
|
|
|
3
3
|
|
|
4
4
|
export const span = (
|
|
5
5
|
attributes: Attrs = {},
|
|
6
|
-
...children: (DOMOutputSpec | 0)[]
|
|
6
|
+
...children: (DOMOutputSpec | string | 0)[]
|
|
7
7
|
): DOMOutputSpec => {
|
|
8
8
|
return ['span', attributes, ...children];
|
|
9
9
|
};
|
|
@@ -13,7 +13,7 @@ export const span = (
|
|
|
13
13
|
*/
|
|
14
14
|
export const contentSpan = (
|
|
15
15
|
attributes: Attrs,
|
|
16
|
-
...children: (DOMOutputSpec | 0)[]
|
|
16
|
+
...children: (DOMOutputSpec | string | 0)[]
|
|
17
17
|
) => {
|
|
18
18
|
return span(
|
|
19
19
|
{
|
package/addon/utils/option.ts
CHANGED
|
@@ -73,12 +73,12 @@ export default class DocumentValidationPluginCard extends Component<Sig> {
|
|
|
73
73
|
openDeveloperModal: (event: Event) => void;
|
|
74
74
|
closeDeveloperModal: () => void;
|
|
75
75
|
get formattedValidationResult(): {
|
|
76
|
-
focusNode: string
|
|
77
|
-
path: string
|
|
78
|
-
severity: string
|
|
79
|
-
sourceConstraintComponent: string
|
|
80
|
-
sourceShape: string
|
|
81
|
-
value: string
|
|
76
|
+
focusNode: string;
|
|
77
|
+
path: string;
|
|
78
|
+
severity: string;
|
|
79
|
+
sourceConstraintComponent: string;
|
|
80
|
+
sourceShape: string;
|
|
81
|
+
value: string;
|
|
82
82
|
}[] | undefined;
|
|
83
83
|
}
|
|
84
84
|
export {};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ProsePlugin, PluginKey, EditorView, SayController } from '@lblod/ember-rdfa-editor';
|
|
2
|
-
import { DataFactory, DatasetCore, DatasetCoreFactory, Quad } from '@rdfjs/types';
|
|
3
2
|
import ValidationReport from 'rdf-validate-shacl/src/validation-report';
|
|
4
3
|
export declare const documentValidationPluginKey: PluginKey<DocumentValidationPluginState>;
|
|
5
4
|
type Violation = {
|
|
@@ -25,7 +24,6 @@ export interface DocumentValidationPluginArgs {
|
|
|
25
24
|
documentShape: string;
|
|
26
25
|
rules: Rule[];
|
|
27
26
|
}
|
|
28
|
-
export type ShaclValidationReport = ValidationReport.ValidationReport<DataFactory<Quad, Quad> & DatasetCoreFactory<Quad, Quad, DatasetCore<Quad, Quad>>>;
|
|
29
27
|
type PropertyWithError = {
|
|
30
28
|
message: string;
|
|
31
29
|
subject: string | undefined;
|
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
import { EditorState } from '@lblod/ember-rdfa-editor';
|
|
2
|
-
|
|
2
|
+
import { ContextualActionGroup } from '@lblod/ember-rdfa-editor/plugins/contextual-actions';
|
|
3
|
+
export declare function getContextualActions(type: 'suggestions' | 'other_elements'): (state: EditorState, searchQuery?: string) => {
|
|
3
4
|
label: string;
|
|
4
5
|
id: string;
|
|
5
6
|
group: string;
|
|
6
|
-
command:
|
|
7
|
+
command: import("@lblod/ember-rdfa-editor").Command;
|
|
7
8
|
}[];
|
|
8
|
-
export declare function getContextualActionGroups(): (state: EditorState) =>
|
|
9
|
-
id: string;
|
|
10
|
-
label: string;
|
|
11
|
-
sticky?: undefined;
|
|
12
|
-
} | {
|
|
13
|
-
id: string;
|
|
14
|
-
label: string;
|
|
15
|
-
sticky: string;
|
|
16
|
-
})[];
|
|
9
|
+
export declare function getContextualActionGroups(): (state: EditorState) => ContextualActionGroup[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ResolvedPNode } from '@lblod/ember-rdfa-editor/utils/_private/types';
|
|
2
2
|
import { Address } from './address-helpers';
|
|
3
3
|
import { Area, Place } from './geo-helpers';
|
|
4
|
-
import {
|
|
5
|
-
export declare function replaceLocationCommand(node: ResolvedPNode, location: Address | Place | Area):
|
|
4
|
+
import { Command } from '@lblod/ember-rdfa-editor';
|
|
5
|
+
export declare function replaceLocationCommand(node: ResolvedPNode, location: Address | Place | Area): Command;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ValueOf } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/types';
|
|
2
|
-
import { ValuesOf } from '@lblod/ember-rdfa-editor/utils/_private/types';
|
|
3
2
|
export declare const ZONALITY_OPTIONS: {
|
|
4
3
|
readonly POTENTIALLY_ZONAL: "http://register.mobiliteit.vlaanderen.be/concepts/8f9367b2-c717-4be7-8833-4c75bbb4ae1f";
|
|
5
4
|
readonly ZONAL: "http://register.mobiliteit.vlaanderen.be/concepts/c81c6b96-736a-48cf-b003-6f5cc3dbc55d";
|
|
@@ -16,7 +15,7 @@ export declare function getLegacyZonalityUri(uri: ZonalityUri | LegacyZonalityUr
|
|
|
16
15
|
export declare function getNewZonalityUri(uri: ZonalityUri | LegacyZonalityUri): ZonalityUri;
|
|
17
16
|
export declare function isNewZonalityUri(uri: string): uri is ZonalityUri;
|
|
18
17
|
export declare function isLegacyZonalityUri(uri: string): uri is LegacyZonalityUri;
|
|
19
|
-
export type ZonalityOption =
|
|
18
|
+
export type ZonalityOption = ValueOf<typeof ZONALITY_OPTIONS>;
|
|
20
19
|
export type ZonalOrNot = Exclude<ZonalityOption, typeof ZONALITY_OPTIONS.POTENTIALLY_ZONAL>;
|
|
21
20
|
export declare const TRAFFIC_SIGNAL_CONCEPT_TYPES: {
|
|
22
21
|
readonly TRAFFIC_SIGNAL: "https://data.vlaanderen.be/ns/mobiliteit#Verkeerstekenconcept";
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import { EditorState, Transaction } from '@lblod/ember-rdfa-editor';
|
|
2
|
+
import { ContextualActionGroup } from '@lblod/ember-rdfa-editor/plugins/contextual-actions';
|
|
2
3
|
type GetContextualActionsAttrs = {
|
|
3
4
|
zonalLocationCodelistUri: string;
|
|
4
5
|
nonZonalLocationCodelistUri: string;
|
|
5
6
|
endpoint?: string;
|
|
6
7
|
};
|
|
7
|
-
export declare function getContextualActions(
|
|
8
|
+
export declare function getContextualActions(attrs: GetContextualActionsAttrs): (state: EditorState, searchQuery?: string) => Promise<{
|
|
8
9
|
id: string;
|
|
9
10
|
label: string;
|
|
10
11
|
group: string;
|
|
11
12
|
command: (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean;
|
|
12
13
|
}[]>;
|
|
13
|
-
export declare function getContextualActionGroups(): (state: EditorState) =>
|
|
14
|
-
id: string;
|
|
15
|
-
label: string;
|
|
16
|
-
}[];
|
|
14
|
+
export declare function getContextualActionGroups(attrs: GetContextualActionsAttrs): (state: EditorState) => ContextualActionGroup[];
|
|
17
15
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Attrs, DOMOutputSpec } from '@lblod/ember-rdfa-editor';
|
|
2
|
-
export declare const span: (attributes?: Attrs, ...children: (DOMOutputSpec | 0)[]) => DOMOutputSpec;
|
|
2
|
+
export declare const span: (attributes?: Attrs, ...children: (DOMOutputSpec | string | 0)[]) => DOMOutputSpec;
|
|
3
3
|
/**
|
|
4
4
|
* Constructs a variable content span. Accepts optional additional attributes and a series of children.
|
|
5
5
|
*/
|
|
6
|
-
export declare const contentSpan: (attributes: Attrs, ...children: (DOMOutputSpec | 0)[]) => DOMOutputSpec;
|
|
6
|
+
export declare const contentSpan: (attributes: Attrs, ...children: (DOMOutputSpec | string | 0)[]) => DOMOutputSpec;
|
|
@@ -8,7 +8,7 @@ export type Option<A> = A | None;
|
|
|
8
8
|
export declare function expect<A>(msg: string, thing: Option<A>): A;
|
|
9
9
|
export declare function unwrap<A>(thing: Option<A>): A;
|
|
10
10
|
export declare function unwrapOr<A>(defaultValue: A, thing: Option<A>): A;
|
|
11
|
-
export declare function optionMap<A, U>(func: (thing: A) => U
|
|
11
|
+
export declare function optionMap<A, U>(func: (thing: A) => U, thing: Option<A>): Option<U>;
|
|
12
12
|
export declare function optionMapOr<A, U>(defaultValue: U, func: (thing: A) => U, thing: Option<A>): U;
|
|
13
13
|
export declare function isSome<A>(thing: Option<A>): thing is A;
|
|
14
14
|
export declare function isNone<A>(thing: Option<A>): thing is None;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lblod/ember-rdfa-editor-lblod-plugins",
|
|
3
|
-
"version": "37.
|
|
3
|
+
"version": "37.3.0-dev.271d0772b577d88af09ca5bd92434fe4d987a16a",
|
|
4
4
|
"description": "Ember addon providing lblod specific plugins for the ember-rdfa-editor",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon",
|
|
@@ -64,7 +64,6 @@
|
|
|
64
64
|
"@rdfjs/data-model": "^2.0.2",
|
|
65
65
|
"@rdfjs/dataset": "^2.0.2",
|
|
66
66
|
"@rdfjs/parser-n3": "^2.0.2",
|
|
67
|
-
"@types/rdf-validate-shacl": "^0.4.7",
|
|
68
67
|
"@types/rdfjs__parser-n3": "^2.0.6",
|
|
69
68
|
"buffer": "^6.0.3",
|
|
70
69
|
"codemirror": "^6.0.1",
|
|
@@ -82,7 +81,7 @@
|
|
|
82
81
|
"process": "0.11.10",
|
|
83
82
|
"proj4": "^2.11.0",
|
|
84
83
|
"rdf-ext": "^2.5.2",
|
|
85
|
-
"rdf-validate-shacl": "^0.
|
|
84
|
+
"rdf-validate-shacl": "^0.6.5",
|
|
86
85
|
"rdfa-streaming-parser": "^3.0.2",
|
|
87
86
|
"reactiveweb": "^1.9.1",
|
|
88
87
|
"stream-browserify": "^3.0.0",
|
|
@@ -111,10 +110,10 @@
|
|
|
111
110
|
"@glint/ember-tsc": "^1.5.0",
|
|
112
111
|
"@glint/environment-ember-loose": "^1.5.0",
|
|
113
112
|
"@glint/environment-ember-template-imports": "^1.5.0",
|
|
114
|
-
"@lblod/ember-rdfa-editor": "13.
|
|
113
|
+
"@lblod/ember-rdfa-editor": "13.12.0",
|
|
115
114
|
"@glint/template": "^1.7.7",
|
|
116
115
|
"@rdfjs/to-ntriples": "^3.0.1",
|
|
117
|
-
"@rdfjs/types": "^
|
|
116
|
+
"@rdfjs/types": "^2.0.1",
|
|
118
117
|
"@release-it/keep-a-changelog": "^4.0.0",
|
|
119
118
|
"@tsconfig/ember": "^3.0.8",
|
|
120
119
|
"@types/debug": "^4.1.12",
|
|
@@ -184,7 +183,7 @@
|
|
|
184
183
|
"@appuniversum/ember-appuniversum": "^3.12.0",
|
|
185
184
|
"@ember/string": "3.x",
|
|
186
185
|
"@glint/template": "^1.4.0",
|
|
187
|
-
"@lblod/ember-rdfa-editor": "^13.
|
|
186
|
+
"@lblod/ember-rdfa-editor": "^13.12.0",
|
|
188
187
|
"ember-concurrency": "^4.0.2",
|
|
189
188
|
"ember-element-helper": "^0.8.6",
|
|
190
189
|
"ember-intl": "^7.0.0",
|
|
@@ -205,18 +204,11 @@
|
|
|
205
204
|
}
|
|
206
205
|
},
|
|
207
206
|
"overrides": {},
|
|
208
|
-
"pnpm": {
|
|
209
|
-
"overrides": {
|
|
210
|
-
"babel-plugin-ember-template-compilation": "^2.2.5",
|
|
211
|
-
"@codemirror/state": "6.5.2",
|
|
212
|
-
"prosemirror-view": "^1.41.5"
|
|
213
|
-
}
|
|
214
|
-
},
|
|
215
207
|
"engines": {
|
|
216
208
|
"node": ">= 18"
|
|
217
209
|
},
|
|
218
210
|
"volta": {
|
|
219
|
-
"node": "
|
|
211
|
+
"node": "22.22.0"
|
|
220
212
|
},
|
|
221
213
|
"ember": {
|
|
222
214
|
"edition": "octane"
|
package/app/models/template.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from '@lblod/ember-rdfa-editor-lblod-plugins/models/template';
|