@lblod/ember-rdfa-editor-lblod-plugins 5.0.1 → 6.0.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 +13 -1
- package/README.md +126 -70
- package/addon/components/address-plugin/insert.hbs +47 -0
- package/addon/components/address-plugin/insert.ts +100 -0
- package/addon/components/address-plugin/types.ts +26 -0
- package/addon/components/address-plugin/utils.ts +59 -0
- package/addon/components/besluit-type-plugin/toolbar-dropdown.ts +6 -5
- package/addon/components/{besluit-plugin/besluit-plugin-card.ts → decision-plugin/decision-plugin-card.ts} +22 -8
- package/addon/components/roadsign-regulation-plugin/measure-template.ts +5 -1
- package/addon/components/roadsign-regulation-plugin/roadsign-regulation-card.hbs +1 -1
- package/addon/components/roadsign-regulation-plugin/roadsigns-modal.hbs +1 -0
- package/addon/components/roadsign-regulation-plugin/roadsigns-modal.ts +24 -21
- package/addon/components/roadsign-regulation-plugin/roadsigns-table.ts +8 -11
- package/addon/components/validation-plugin/validation-card.hbs +12 -0
- package/addon/components/validation-plugin/validation-card.ts +19 -0
- package/addon/components/validation-plugin/validation-item.hbs +2 -0
- package/addon/components/validation-plugin/validation-item.ts +55 -0
- package/addon/components/variable-plugin/template-variable-card.ts +8 -25
- package/addon/plugins/besluit-type-plugin/index.ts +3 -0
- package/addon/plugins/besluit-type-plugin/utils/fetchBesluitTypes.ts +1 -6
- package/addon/plugins/decision-plugin/commands/index.ts +4 -0
- package/addon/plugins/decision-plugin/commands/insert-article-container.ts +56 -0
- package/addon/plugins/decision-plugin/commands/insert-description.ts +53 -0
- package/addon/plugins/decision-plugin/commands/insert-motivation.ts +62 -0
- package/addon/plugins/decision-plugin/commands/insert-title.ts +54 -0
- package/addon/plugins/roadsign-regulation-plugin/index.ts +4 -0
- package/addon/plugins/standard-template-plugin/utils/nodes.ts +0 -1
- package/addon/plugins/validation/README.md +84 -0
- package/addon/plugins/validation/index.ts +427 -0
- package/addon/plugins/validation/utils/transaction-complies-with-shapes.ts +28 -0
- package/addon/plugins/variable-plugin/index.ts +5 -0
- package/addon/services/roadsign-registry.ts +54 -50
- package/addon/utils/find-insertion-pos-in-ancestor-of-type.ts +35 -0
- package/app/components/{besluit-plugin/besluit-plugin-card.js → address-plugin/insert.js} +1 -1
- package/app/components/decision-plugin/decision-plugin-card.js +1 -0
- package/app/components/{besluit-plugin/besluit-context-card.js → validation-plugin/validation-card.js} +1 -1
- package/app/components/validation-plugin/validation-item.js +1 -0
- package/app/styles/address-plugin.scss +7 -0
- package/components/address-plugin/insert.d.ts +21 -0
- package/components/address-plugin/types.d.ts +25 -0
- package/components/address-plugin/utils.d.ts +9 -0
- package/components/besluit-type-plugin/toolbar-dropdown.d.ts +2 -0
- package/components/{besluit-plugin/besluit-plugin-card.d.ts → decision-plugin/decision-plugin-card.d.ts} +4 -1
- package/components/roadsign-regulation-plugin/measure-template.d.ts +2 -0
- package/components/roadsign-regulation-plugin/roadsigns-modal.d.ts +3 -0
- package/components/roadsign-regulation-plugin/roadsigns-table.d.ts +6 -1
- package/components/validation-plugin/validation-card.d.ts +13 -0
- package/components/validation-plugin/validation-item.d.ts +18 -0
- package/components/variable-plugin/template-variable-card.d.ts +2 -4
- package/package.json +1 -1
- package/plugins/besluit-type-plugin/index.d.ts +3 -0
- package/plugins/besluit-type-plugin/utils/fetchBesluitTypes.d.ts +1 -5
- package/plugins/decision-plugin/commands/index.d.ts +4 -0
- package/plugins/decision-plugin/commands/insert-article-container.d.ts +8 -0
- package/plugins/decision-plugin/commands/insert-description.d.ts +7 -0
- package/plugins/decision-plugin/commands/insert-motivation.d.ts +7 -0
- package/plugins/decision-plugin/commands/insert-title.d.ts +7 -0
- package/plugins/roadsign-regulation-plugin/index.d.ts +4 -0
- package/plugins/validation/index.d.ts +62 -0
- package/plugins/validation/utils/transaction-complies-with-shapes.d.ts +10 -0
- package/plugins/variable-plugin/index.d.ts +5 -0
- package/services/roadsign-registry.d.ts +7 -9
- package/translations/en-US.yaml +58 -47
- package/translations/nl-BE.yaml +15 -0
- package/utils/find-insertion-pos-in-ancestor-of-type.d.ts +11 -0
- package/addon/plugins/besluit-plugin/commands/index.ts +0 -1
- package/addon/plugins/besluit-plugin/commands/insert-title.ts +0 -43
- package/config/environment.js +0 -20
- package/plugins/besluit-plugin/commands/index.d.ts +0 -1
- package/plugins/besluit-plugin/commands/insert-title.d.ts +0 -3
- /package/addon/components/{besluit-plugin/besluit-plugin-card.hbs → decision-plugin/decision-plugin-card.hbs} +0 -0
- /package/addon/plugins/{besluit-plugin → decision-plugin}/utils/get-title-for-decision.ts +0 -0
- /package/plugins/{besluit-plugin → decision-plugin}/utils/get-title-for-decision.d.ts +0 -0
|
@@ -9,26 +9,24 @@ export default class RoadsignRegistryService extends Service {
|
|
|
9
9
|
label: string;
|
|
10
10
|
}[];
|
|
11
11
|
instructions: Map<string, Instruction[]>;
|
|
12
|
-
endpoint: string;
|
|
13
|
-
imageBaseUrl: string;
|
|
14
12
|
constructor();
|
|
15
|
-
loadClassifications: import("ember-concurrency").TaskForAsyncTaskFunction<unknown, () => Promise<void>>;
|
|
16
|
-
getInstructionsForMeasure: import("ember-concurrency").TaskForAsyncTaskFunction<unknown, (uri: string) => Promise<Instruction[]>>;
|
|
13
|
+
loadClassifications: import("ember-concurrency").TaskForAsyncTaskFunction<unknown, (endpoint: string) => Promise<void>>;
|
|
14
|
+
getInstructionsForMeasure: import("ember-concurrency").TaskForAsyncTaskFunction<unknown, (uri: string, endpoint: string) => Promise<Instruction[]>>;
|
|
17
15
|
searchCode: import("ember-concurrency").TaskForAsyncTaskFunction<{
|
|
18
16
|
restartable: boolean;
|
|
19
|
-
}, (codeString?: string, category?: string, type?: string, combinedSigns?: string[]) => Promise<{
|
|
17
|
+
}, (endpoint: string, codeString?: string, category?: string, type?: string, combinedSigns?: string[]) => Promise<{
|
|
20
18
|
value: string;
|
|
21
19
|
label: string;
|
|
22
20
|
}[]>>;
|
|
23
|
-
executeQuery: import("ember-concurrency").TaskForAsyncTaskFunction<unknown, (query: string) => Promise<{
|
|
21
|
+
executeQuery: import("ember-concurrency").TaskForAsyncTaskFunction<unknown, (query: string, endpoint: string) => Promise<{
|
|
24
22
|
results: {
|
|
25
23
|
bindings: IBindings[];
|
|
26
24
|
};
|
|
27
25
|
}>>;
|
|
28
|
-
fetchInstructionsForMeasure: import("ember-concurrency").TaskForAsyncTaskFunction<unknown, (uri: string) => Promise<Instruction[]>>;
|
|
26
|
+
fetchInstructionsForMeasure: import("ember-concurrency").TaskForAsyncTaskFunction<unknown, (uri: string, endpoint: string) => Promise<Instruction[]>>;
|
|
29
27
|
fetchMeasures: import("ember-concurrency").TaskForAsyncTaskFunction<{
|
|
30
28
|
restartable: boolean;
|
|
31
|
-
}, ({ zonality, type, codes, category, pageStart, }?: {
|
|
29
|
+
}, (endpoint: string, imageBaseUrl: string, { zonality, type, codes, category, pageStart, }?: {
|
|
32
30
|
zonality?: string | undefined;
|
|
33
31
|
type?: string | undefined;
|
|
34
32
|
codes?: string[] | undefined;
|
|
@@ -38,5 +36,5 @@ export default class RoadsignRegistryService extends Service {
|
|
|
38
36
|
measures: Measure[];
|
|
39
37
|
count: number;
|
|
40
38
|
}>>;
|
|
41
|
-
fetchSignsForMeasure: import("ember-concurrency").TaskForAsyncTaskFunction<unknown, (uri: string) => Promise<Sign[]>>;
|
|
39
|
+
fetchSignsForMeasure: import("ember-concurrency").TaskForAsyncTaskFunction<unknown, (uri: string, endpoint: string, imageBaseUrl: string) => Promise<Sign[]>>;
|
|
42
40
|
}
|
package/translations/en-US.yaml
CHANGED
|
@@ -61,7 +61,6 @@ article-structure-plugin:
|
|
|
61
61
|
paragraph:
|
|
62
62
|
body: Insert paragraph content
|
|
63
63
|
|
|
64
|
-
|
|
65
64
|
citaten-plugin:
|
|
66
65
|
card:
|
|
67
66
|
title: Add reference
|
|
@@ -74,11 +73,11 @@ citaten-plugin:
|
|
|
74
73
|
type: Type of document
|
|
75
74
|
placeholder: Type to search
|
|
76
75
|
date-document: Filter on date document
|
|
77
|
-
date-document-from:
|
|
78
|
-
date-document-to:
|
|
76
|
+
date-document-from: 'Filter document on date from:'
|
|
77
|
+
date-document-to: 'Filter document on date until:'
|
|
79
78
|
date-publication: Filter on date government gazette
|
|
80
|
-
date-publication-from:
|
|
81
|
-
date-publication-to:
|
|
79
|
+
date-publication-from: 'Filter publication on date from:'
|
|
80
|
+
date-publication-to: 'Filter publication on date until:'
|
|
82
81
|
from: from
|
|
83
82
|
to: to
|
|
84
83
|
article: Search for article
|
|
@@ -99,22 +98,20 @@ citaten-plugin:
|
|
|
99
98
|
loading: Loading…
|
|
100
99
|
no-results: No results found
|
|
101
100
|
error-title: Error while loading results
|
|
102
|
-
error-intro:
|
|
101
|
+
error-intro: 'An error occured while loading results from the Flemish Codex:'
|
|
103
102
|
error-outro: In case this problem keeps occuring, please contact
|
|
104
103
|
|
|
105
|
-
|
|
106
104
|
besluit-type-plugin:
|
|
107
|
-
dt:
|
|
108
|
-
insert-dt:
|
|
109
|
-
search-message:
|
|
110
|
-
no-matches-message:
|
|
111
|
-
alert-title:
|
|
112
|
-
alert-body:
|
|
113
|
-
error-short:
|
|
114
|
-
error-title:
|
|
115
|
-
error-first-body:
|
|
116
|
-
error-rest-body:
|
|
117
|
-
|
|
105
|
+
dt: 'Decision type'
|
|
106
|
+
insert-dt: 'Select a decision type'
|
|
107
|
+
search-message: 'Typ to search'
|
|
108
|
+
no-matches-message: 'No results'
|
|
109
|
+
alert-title: 'Attention'
|
|
110
|
+
alert-body: 'You must select a subtype in order to save the decision type'
|
|
111
|
+
error-short: 'Error fetching decision types'
|
|
112
|
+
error-title: 'Error'
|
|
113
|
+
error-first-body: 'An error occured while fetching the decision types. Try again later. If this problem persists, please contact'
|
|
114
|
+
error-rest-body: '. For more specific details about this problem, inspect the browser console.'
|
|
118
115
|
|
|
119
116
|
besluit-plugin:
|
|
120
117
|
missing-title-warning: This decision is missing a title
|
|
@@ -123,15 +120,14 @@ besluit-plugin:
|
|
|
123
120
|
placeholder:
|
|
124
121
|
decision-title: Insert decision title
|
|
125
122
|
|
|
126
|
-
|
|
127
123
|
date-plugin:
|
|
128
124
|
help:
|
|
129
|
-
title:
|
|
125
|
+
title: 'Custom format help'
|
|
130
126
|
first-line: "For custom formats, all the text between single quotes is escaped and written into the document as it's written, all the other characters are interpreted and represent different parts of the date:"
|
|
131
|
-
examples:
|
|
132
|
-
name:
|
|
133
|
-
symbol:
|
|
134
|
-
result:
|
|
127
|
+
examples: 'Examples:'
|
|
128
|
+
name: 'Name'
|
|
129
|
+
symbol: 'Symbol'
|
|
130
|
+
result: 'Result'
|
|
135
131
|
detailed-info: For more detailed symbols visit
|
|
136
132
|
docs-link: the library documentation
|
|
137
133
|
date-examples: With this you can create any date format, here are some examples and their corresponding dates
|
|
@@ -146,36 +142,51 @@ date-plugin:
|
|
|
146
142
|
long-month-content: January, February, ..., December
|
|
147
143
|
long-year: Long year
|
|
148
144
|
insert:
|
|
149
|
-
date:
|
|
150
|
-
datetime:
|
|
145
|
+
date: 'Insert date'
|
|
146
|
+
datetime: 'Insert date and time'
|
|
151
147
|
card:
|
|
152
|
-
title:
|
|
153
|
-
insert-date:
|
|
154
|
-
insert-datetime:
|
|
155
|
-
include-time:
|
|
156
|
-
info-custom-time:
|
|
157
|
-
custom-date:
|
|
158
|
-
label:
|
|
159
|
-
hours:
|
|
160
|
-
minutes:
|
|
161
|
-
seconds:
|
|
162
|
-
now:
|
|
148
|
+
title: 'Date'
|
|
149
|
+
insert-date: 'Insert date'
|
|
150
|
+
insert-datetime: 'Insert date and time'
|
|
151
|
+
include-time: 'Include time'
|
|
152
|
+
info-custom-time: 'With a custom format, time controls are shown automatically when the format includes time information'
|
|
153
|
+
custom-date: 'Custom format'
|
|
154
|
+
label: 'Select date'
|
|
155
|
+
hours: 'Hours'
|
|
156
|
+
minutes: 'Minutes'
|
|
157
|
+
seconds: 'Seconds'
|
|
158
|
+
now: 'Now'
|
|
163
159
|
validation:
|
|
164
|
-
character:
|
|
165
|
-
character-suggestion:
|
|
166
|
-
use-yyyy:
|
|
167
|
-
use-yy:
|
|
168
|
-
use-d:
|
|
169
|
-
use-dd:
|
|
170
|
-
required:
|
|
171
|
-
fractions:
|
|
172
|
-
unknown:
|
|
160
|
+
character: 'Invalid character'
|
|
161
|
+
character-suggestion: 'To insert literal characters, surround them with single quotes, like so'
|
|
162
|
+
use-yyyy: 'Use yyyy instead of YYYY'
|
|
163
|
+
use-yy: 'Use yy instead of YY'
|
|
164
|
+
use-d: 'Use d instead of D'
|
|
165
|
+
use-dd: 'Use dd instead of D'
|
|
166
|
+
required: 'This field cannot be empty'
|
|
167
|
+
fractions: 'Fractions of a second, such as S or T, are not supported.'
|
|
168
|
+
unknown: 'Invalid format'
|
|
173
169
|
variable-plugin:
|
|
174
170
|
insert-variable: Insert variable
|
|
175
171
|
button: Insert
|
|
176
172
|
enter-variable-value: Select value
|
|
177
|
-
|
|
173
|
+
validation-plugin:
|
|
174
|
+
default-fix-message: Resolve
|
|
178
175
|
|
|
179
176
|
table-of-contents-plugin:
|
|
180
177
|
title: Table of Contents
|
|
181
178
|
toggle: Show Table of Contents
|
|
179
|
+
|
|
180
|
+
address-plugin:
|
|
181
|
+
insert:
|
|
182
|
+
address: Insert address
|
|
183
|
+
button:
|
|
184
|
+
insert: Insert address
|
|
185
|
+
back: Back
|
|
186
|
+
search:
|
|
187
|
+
cta: 'Type to search'
|
|
188
|
+
no-match: 'No results'
|
|
189
|
+
|
|
190
|
+
dummy:
|
|
191
|
+
validation-card:
|
|
192
|
+
title: Document Validation
|
package/translations/nl-BE.yaml
CHANGED
|
@@ -171,6 +171,8 @@ date-plugin:
|
|
|
171
171
|
fractions: "Fracties van seconden, zoals S en T, zijn niet ondersteund."
|
|
172
172
|
unknown: "Ongeldig formaat"
|
|
173
173
|
|
|
174
|
+
validation-plugin:
|
|
175
|
+
default-fix-message: Oplossen
|
|
174
176
|
|
|
175
177
|
table-of-contents-plugin:
|
|
176
178
|
title: Inhoudstafel
|
|
@@ -181,3 +183,16 @@ variable-plugin:
|
|
|
181
183
|
insert-variable: Voeg variabele in
|
|
182
184
|
button: Voeg in
|
|
183
185
|
enter-variable-value: Selecteer waarde
|
|
186
|
+
|
|
187
|
+
address-plugin:
|
|
188
|
+
insert:
|
|
189
|
+
address: Adres invoegen
|
|
190
|
+
button:
|
|
191
|
+
insert: Adres invoegen
|
|
192
|
+
back: Terug
|
|
193
|
+
search:
|
|
194
|
+
cta: Zoekterm
|
|
195
|
+
no-match: Geen resultaten
|
|
196
|
+
dummy:
|
|
197
|
+
validation-card:
|
|
198
|
+
title: Documentvalidatie
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { NodeType, PNode, Selection } from '@lblod/ember-rdfa-editor';
|
|
2
|
+
import { Option } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/option';
|
|
3
|
+
/**
|
|
4
|
+
* Starting from the given selection, find a suitable position within an ancestor node
|
|
5
|
+
* of a given type to insert a given node into. Returns null when this fails, aka when
|
|
6
|
+
* suitable ancestor is found, or when within the found ancestor no suitable position can be found
|
|
7
|
+
* @param selection
|
|
8
|
+
* @param ancestorType
|
|
9
|
+
* @param nodeToInsert
|
|
10
|
+
*/
|
|
11
|
+
export declare function findInsertionPosInAncestorOfType(selection: Selection, ancestorType: NodeType, nodeToInsert: PNode): Option<number>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as insertTitle } from './insert-title';
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { findParentNodeOfType } from '@curvenote/prosemirror-utils';
|
|
2
|
-
import { Command, NodeSelection } from '@lblod/ember-rdfa-editor';
|
|
3
|
-
import IntlService from 'ember-intl/services/intl';
|
|
4
|
-
import { v4 as uuid } from 'uuid';
|
|
5
|
-
|
|
6
|
-
export default function insertTitle(intl: IntlService): Command {
|
|
7
|
-
return function (state, dispatch) {
|
|
8
|
-
const { selection, schema } = state;
|
|
9
|
-
const besluit = findParentNodeOfType(schema.nodes.besluit)(selection);
|
|
10
|
-
if (!besluit) {
|
|
11
|
-
return false;
|
|
12
|
-
}
|
|
13
|
-
if (!besluit.node.canReplaceWith(0, 0, schema.nodes.besluit_title)) {
|
|
14
|
-
return false;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
if (dispatch) {
|
|
18
|
-
const tr = state.tr;
|
|
19
|
-
tr.insert(
|
|
20
|
-
besluit.pos + 1,
|
|
21
|
-
schema.node(
|
|
22
|
-
'besluit_title',
|
|
23
|
-
{ __rdfaId: uuid() },
|
|
24
|
-
schema.node(
|
|
25
|
-
'paragraph',
|
|
26
|
-
null,
|
|
27
|
-
schema.node('placeholder', {
|
|
28
|
-
placeholderText: intl.t(
|
|
29
|
-
'besluit-plugin.placeholder.decision-title'
|
|
30
|
-
),
|
|
31
|
-
})
|
|
32
|
-
)
|
|
33
|
-
)
|
|
34
|
-
);
|
|
35
|
-
// Select placeholder in title
|
|
36
|
-
const selection = new NodeSelection(tr.doc.resolve(besluit.pos + 3));
|
|
37
|
-
tr.setSelection(selection);
|
|
38
|
-
dispatch(tr);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return true;
|
|
42
|
-
};
|
|
43
|
-
}
|
package/config/environment.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
module.exports = function (/* environment, appConfig */) {
|
|
4
|
-
return {
|
|
5
|
-
roadsignRegulationPlugin: {
|
|
6
|
-
endpoint: 'https://dev.roadsigns.lblod.info/sparql',
|
|
7
|
-
imageBaseUrl: 'https://register.mobiliteit.vlaanderen.be/',
|
|
8
|
-
},
|
|
9
|
-
besluitTypePlugin: {
|
|
10
|
-
endpoint: 'https://centrale-vindplaats.lblod.info/sparql',
|
|
11
|
-
},
|
|
12
|
-
templateVariablePlugin: {
|
|
13
|
-
endpoint: 'https://dev.roadsigns.lblod.info/sparql',
|
|
14
|
-
zonalLocationCodelistUri:
|
|
15
|
-
'http://lblod.data.gift/concept-schemes/62331E6900730AE7B99DF7EF',
|
|
16
|
-
nonZonalLocationCodelistUri:
|
|
17
|
-
'http://lblod.data.gift/concept-schemes/62331FDD00730AE7B99DF7F2',
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as insertTitle } from './insert-title';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|