@lblod/ember-rdfa-editor-lblod-plugins 34.0.2 → 34.1.1-dev.29920bcd6d316470556433a018a2c90739cfecff
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/green-bulldogs-ring.md +5 -0
- package/CHANGELOG.md +12 -0
- package/addon/components/document-validation-plugin/card.gts +8 -6
- package/addon/plugins/roadsign-regulation-plugin/actions/insert-measure.ts +4 -0
- package/addon/plugins/roadsign-regulation-plugin/schemas/mobility-measure-design.ts +5 -1
- package/addon/plugins/roadsign-regulation-plugin/schemas/variable-instance.ts +1 -0
- package/addon/plugins/variable-plugin/actions/create-codelist-variable.ts +12 -0
- package/declarations/addon/plugins/roadsign-regulation-plugin/schemas/mobility-measure-design.d.ts +80 -4
- package/declarations/addon/plugins/roadsign-regulation-plugin/schemas/variable-instance.d.ts +3 -0
- package/declarations/addon/plugins/variable-plugin/actions/create-codelist-variable.d.ts +3 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @lblod/ember-rdfa-editor-lblod-plugins
|
|
2
2
|
|
|
3
|
+
## 34.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`ea58ba1`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/ea58ba1cebf5d69c4f1d784c524a13c1dfe6034e) Thanks [@abeforgit](https://github.com/abeforgit)! - Allow insertMeasure to take in ar-designs with concepts instead of signs
|
|
8
|
+
|
|
9
|
+
## 34.1.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#617](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/617) [`b77f866`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/b77f866cde0afa81671fcd8378d735eb747afa90) Thanks [@abeforgit](https://github.com/abeforgit)! - Automatically instantiate codelist options when possible
|
|
14
|
+
|
|
3
15
|
## 34.0.2
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -176,12 +176,14 @@ export default class DocumentValidationPluginCard extends Component<Sig> {
|
|
|
176
176
|
as |error|
|
|
177
177
|
}}
|
|
178
178
|
<div class='say-document-validation__error-container'>
|
|
179
|
-
<
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
179
|
+
<div class='au-u-margin-right-small'>
|
|
180
|
+
<AuIcon
|
|
181
|
+
@icon={{CloseFilledIcon}}
|
|
182
|
+
@size='large'
|
|
183
|
+
@ariaHidden={{true}}
|
|
184
|
+
class='say-document-validation__icon-error'
|
|
185
|
+
/>
|
|
186
|
+
</div>
|
|
185
187
|
<div>
|
|
186
188
|
{{error.message}}
|
|
187
189
|
<AuButton
|
|
@@ -341,6 +341,10 @@ function constructVariableNode(
|
|
|
341
341
|
variable: variable.uri,
|
|
342
342
|
variableInstance: variableInstance.uri,
|
|
343
343
|
value: valueStr,
|
|
344
|
+
valueLabel:
|
|
345
|
+
'valueLabel' in variableInstance
|
|
346
|
+
? variableInstance.valueLabel
|
|
347
|
+
: undefined,
|
|
344
348
|
label: variable.label,
|
|
345
349
|
};
|
|
346
350
|
switch (variable.type) {
|
|
@@ -4,10 +4,14 @@ import {
|
|
|
4
4
|
type MobilityMeasureConcept,
|
|
5
5
|
MobilityMeasureConceptSchema,
|
|
6
6
|
} from './mobility-measure-concept';
|
|
7
|
+
import { TrafficSignalConceptSchema } from './traffic-signal-concept';
|
|
7
8
|
|
|
8
9
|
export const MobilityMeasureDesignSchema = z.object({
|
|
9
10
|
uri: z.string(),
|
|
10
|
-
trafficSignals: z.
|
|
11
|
+
trafficSignals: z.union([
|
|
12
|
+
z.array(TrafficSignalSchema),
|
|
13
|
+
z.array(TrafficSignalConceptSchema),
|
|
14
|
+
]),
|
|
11
15
|
measureConcept: MobilityMeasureConceptSchema,
|
|
12
16
|
});
|
|
13
17
|
|
|
@@ -34,6 +34,7 @@ const LocationVariableInstanceSchema = BaseVariableInstanceSchema.extend({
|
|
|
34
34
|
|
|
35
35
|
const CodelistVariableInstanceSchema = BaseVariableInstanceSchema.extend({
|
|
36
36
|
value: z.string().optional(),
|
|
37
|
+
valueLabel: z.string().optional(),
|
|
37
38
|
variable: CodelistVariableSchema,
|
|
38
39
|
});
|
|
39
40
|
|
|
@@ -15,11 +15,22 @@ import { sayDataFactory } from '@lblod/ember-rdfa-editor/core/say-data-factory';
|
|
|
15
15
|
|
|
16
16
|
type CreateCodelistVariableArgs = {
|
|
17
17
|
schema: Schema;
|
|
18
|
+
value?: string;
|
|
19
|
+
valueLabel?: string;
|
|
18
20
|
} & CreateCodelistVariableAttrsArgs;
|
|
19
21
|
|
|
20
22
|
export function createCodelistVariable(args: CreateCodelistVariableArgs) {
|
|
21
23
|
const { schema } = args;
|
|
22
24
|
const attrs = createCodelistVariableAttrs(args);
|
|
25
|
+
if (args.value && args.valueLabel) {
|
|
26
|
+
const codelistOption = createCodelistOptionNode({
|
|
27
|
+
schema,
|
|
28
|
+
subject: args.value,
|
|
29
|
+
variableInstance: args.variableInstance,
|
|
30
|
+
text: args.valueLabel,
|
|
31
|
+
});
|
|
32
|
+
return schema.nodes.codelist.create(attrs, [codelistOption]);
|
|
33
|
+
}
|
|
23
34
|
return schema.nodes.codelist.create(attrs);
|
|
24
35
|
}
|
|
25
36
|
|
|
@@ -85,6 +96,7 @@ export function createCodelistOptionNode(args: CreateCodelistOptionNodeArgs) {
|
|
|
85
96
|
type CreateCodelistOptionNodeAttrsArgs = {
|
|
86
97
|
subject: string;
|
|
87
98
|
text: string;
|
|
99
|
+
value?: string;
|
|
88
100
|
variableInstance?: string;
|
|
89
101
|
};
|
|
90
102
|
|
package/declarations/addon/plugins/roadsign-regulation-plugin/schemas/mobility-measure-design.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { type MobilityMeasureConcept } from './mobility-measure-concept';
|
|
3
3
|
export declare const MobilityMeasureDesignSchema: z.ZodObject<{
|
|
4
4
|
uri: z.ZodString;
|
|
5
|
-
trafficSignals: z.ZodArray<z.ZodObject<{
|
|
5
|
+
trafficSignals: z.ZodUnion<[z.ZodArray<z.ZodObject<{
|
|
6
6
|
uri: z.ZodString;
|
|
7
7
|
trafficSignalConcept: z.ZodIntersection<z.ZodObject<{
|
|
8
8
|
uri: z.ZodString;
|
|
@@ -87,7 +87,55 @@ export declare const MobilityMeasureDesignSchema: z.ZodObject<{
|
|
|
87
87
|
} | {
|
|
88
88
|
type: "https://data.vlaanderen.be/ns/mobiliteit#Verkeerslichtconcept" | "https://data.vlaanderen.be/ns/mobiliteit#Wegmarkeringconcept";
|
|
89
89
|
});
|
|
90
|
-
}>, "many"
|
|
90
|
+
}>, "many">, z.ZodArray<z.ZodIntersection<z.ZodObject<{
|
|
91
|
+
uri: z.ZodString;
|
|
92
|
+
code: z.ZodString;
|
|
93
|
+
regulatoryNotation: z.ZodOptional<z.ZodString>;
|
|
94
|
+
image: z.ZodString;
|
|
95
|
+
position: z.ZodDefault<z.ZodNumber>;
|
|
96
|
+
}, "strip", z.ZodTypeAny, {
|
|
97
|
+
code: string;
|
|
98
|
+
image: string;
|
|
99
|
+
uri: string;
|
|
100
|
+
position: number;
|
|
101
|
+
regulatoryNotation?: string | undefined;
|
|
102
|
+
}, {
|
|
103
|
+
code: string;
|
|
104
|
+
image: string;
|
|
105
|
+
uri: string;
|
|
106
|
+
position?: number | undefined;
|
|
107
|
+
regulatoryNotation?: string | undefined;
|
|
108
|
+
}>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
109
|
+
type: z.ZodLiteral<"https://data.vlaanderen.be/ns/mobiliteit#Verkeersbordconcept">;
|
|
110
|
+
categories: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
111
|
+
uri: z.ZodString;
|
|
112
|
+
label: z.ZodString;
|
|
113
|
+
}, "strip", z.ZodTypeAny, {
|
|
114
|
+
label: string;
|
|
115
|
+
uri: string;
|
|
116
|
+
}, {
|
|
117
|
+
label: string;
|
|
118
|
+
uri: string;
|
|
119
|
+
}>, "many">>;
|
|
120
|
+
}, "strip", z.ZodTypeAny, {
|
|
121
|
+
type: "https://data.vlaanderen.be/ns/mobiliteit#Verkeersbordconcept";
|
|
122
|
+
categories: {
|
|
123
|
+
label: string;
|
|
124
|
+
uri: string;
|
|
125
|
+
}[];
|
|
126
|
+
}, {
|
|
127
|
+
type: "https://data.vlaanderen.be/ns/mobiliteit#Verkeersbordconcept";
|
|
128
|
+
categories?: {
|
|
129
|
+
label: string;
|
|
130
|
+
uri: string;
|
|
131
|
+
}[] | undefined;
|
|
132
|
+
}>, z.ZodObject<{
|
|
133
|
+
type: z.ZodEnum<["https://data.vlaanderen.be/ns/mobiliteit#Wegmarkeringconcept", "https://data.vlaanderen.be/ns/mobiliteit#Verkeerslichtconcept"]>;
|
|
134
|
+
}, "strip", z.ZodTypeAny, {
|
|
135
|
+
type: "https://data.vlaanderen.be/ns/mobiliteit#Verkeerslichtconcept" | "https://data.vlaanderen.be/ns/mobiliteit#Wegmarkeringconcept";
|
|
136
|
+
}, {
|
|
137
|
+
type: "https://data.vlaanderen.be/ns/mobiliteit#Verkeerslichtconcept" | "https://data.vlaanderen.be/ns/mobiliteit#Wegmarkeringconcept";
|
|
138
|
+
}>]>>, "many">]>;
|
|
91
139
|
measureConcept: z.ZodObject<{
|
|
92
140
|
uri: z.ZodString;
|
|
93
141
|
label: z.ZodString;
|
|
@@ -214,7 +262,21 @@ export declare const MobilityMeasureDesignSchema: z.ZodObject<{
|
|
|
214
262
|
type: "https://data.vlaanderen.be/ns/mobiliteit#Verkeerslichtconcept" | "https://data.vlaanderen.be/ns/mobiliteit#Wegmarkeringconcept";
|
|
215
263
|
}))[];
|
|
216
264
|
};
|
|
217
|
-
trafficSignals: {
|
|
265
|
+
trafficSignals: ({
|
|
266
|
+
code: string;
|
|
267
|
+
image: string;
|
|
268
|
+
uri: string;
|
|
269
|
+
position: number;
|
|
270
|
+
regulatoryNotation?: string | undefined;
|
|
271
|
+
} & ({
|
|
272
|
+
type: "https://data.vlaanderen.be/ns/mobiliteit#Verkeersbordconcept";
|
|
273
|
+
categories: {
|
|
274
|
+
label: string;
|
|
275
|
+
uri: string;
|
|
276
|
+
}[];
|
|
277
|
+
} | {
|
|
278
|
+
type: "https://data.vlaanderen.be/ns/mobiliteit#Verkeerslichtconcept" | "https://data.vlaanderen.be/ns/mobiliteit#Wegmarkeringconcept";
|
|
279
|
+
}))[] | {
|
|
218
280
|
uri: string;
|
|
219
281
|
trafficSignalConcept: {
|
|
220
282
|
code: string;
|
|
@@ -256,7 +318,21 @@ export declare const MobilityMeasureDesignSchema: z.ZodObject<{
|
|
|
256
318
|
type: "https://data.vlaanderen.be/ns/mobiliteit#Verkeerslichtconcept" | "https://data.vlaanderen.be/ns/mobiliteit#Wegmarkeringconcept";
|
|
257
319
|
}))[] | undefined;
|
|
258
320
|
};
|
|
259
|
-
trafficSignals: {
|
|
321
|
+
trafficSignals: ({
|
|
322
|
+
code: string;
|
|
323
|
+
image: string;
|
|
324
|
+
uri: string;
|
|
325
|
+
position?: number | undefined;
|
|
326
|
+
regulatoryNotation?: string | undefined;
|
|
327
|
+
} & ({
|
|
328
|
+
type: "https://data.vlaanderen.be/ns/mobiliteit#Verkeersbordconcept";
|
|
329
|
+
categories?: {
|
|
330
|
+
label: string;
|
|
331
|
+
uri: string;
|
|
332
|
+
}[] | undefined;
|
|
333
|
+
} | {
|
|
334
|
+
type: "https://data.vlaanderen.be/ns/mobiliteit#Verkeerslichtconcept" | "https://data.vlaanderen.be/ns/mobiliteit#Wegmarkeringconcept";
|
|
335
|
+
}))[] | {
|
|
260
336
|
uri: string;
|
|
261
337
|
trafficSignalConcept: {
|
|
262
338
|
code: string;
|
package/declarations/addon/plugins/roadsign-regulation-plugin/schemas/variable-instance.d.ts
CHANGED
|
@@ -180,6 +180,7 @@ export declare const VariableInstanceSchema: z.ZodUnion<[z.ZodObject<z.objectUti
|
|
|
180
180
|
uri: z.ZodString;
|
|
181
181
|
}, {
|
|
182
182
|
value: z.ZodOptional<z.ZodString>;
|
|
183
|
+
valueLabel: z.ZodOptional<z.ZodString>;
|
|
183
184
|
variable: z.ZodObject<z.objectUtil.extendShape<{
|
|
184
185
|
uri: z.ZodString;
|
|
185
186
|
label: z.ZodString;
|
|
@@ -214,6 +215,7 @@ export declare const VariableInstanceSchema: z.ZodUnion<[z.ZodObject<z.objectUti
|
|
|
214
215
|
defaultValue?: string | undefined;
|
|
215
216
|
};
|
|
216
217
|
value?: string | undefined;
|
|
218
|
+
valueLabel?: string | undefined;
|
|
217
219
|
}, {
|
|
218
220
|
uri: string;
|
|
219
221
|
variable: {
|
|
@@ -225,6 +227,7 @@ export declare const VariableInstanceSchema: z.ZodUnion<[z.ZodObject<z.objectUti
|
|
|
225
227
|
defaultValue?: string | undefined;
|
|
226
228
|
};
|
|
227
229
|
value?: string | undefined;
|
|
230
|
+
valueLabel?: string | undefined;
|
|
228
231
|
}>]>;
|
|
229
232
|
export type VariableInstance = z.infer<typeof VariableInstanceSchema>;
|
|
230
233
|
export declare function isVariableInstance(variableOrVariableInstance: Variable | VariableInstance): variableOrVariableInstance is VariableInstance;
|
|
@@ -3,6 +3,8 @@ import { AllOrNone } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/types';
|
|
|
3
3
|
import { FullTriple } from '@lblod/ember-rdfa-editor/core/rdfa-processor';
|
|
4
4
|
type CreateCodelistVariableArgs = {
|
|
5
5
|
schema: Schema;
|
|
6
|
+
value?: string;
|
|
7
|
+
valueLabel?: string;
|
|
6
8
|
} & CreateCodelistVariableAttrsArgs;
|
|
7
9
|
export declare function createCodelistVariable(args: CreateCodelistVariableArgs): import("prosemirror-model").Node;
|
|
8
10
|
type CreateCodelistVariableAttrsArgs = {
|
|
@@ -32,6 +34,7 @@ export declare function createCodelistOptionNode(args: CreateCodelistOptionNodeA
|
|
|
32
34
|
type CreateCodelistOptionNodeAttrsArgs = {
|
|
33
35
|
subject: string;
|
|
34
36
|
text: string;
|
|
37
|
+
value?: string;
|
|
35
38
|
variableInstance?: string;
|
|
36
39
|
};
|
|
37
40
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lblod/ember-rdfa-editor-lblod-plugins",
|
|
3
|
-
"version": "34.
|
|
3
|
+
"version": "34.1.1-dev.29920bcd6d316470556433a018a2c90739cfecff",
|
|
4
4
|
"description": "Ember addon providing lblod specific plugins for the ember-rdfa-editor",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon",
|