@lblod/ember-rdfa-editor-lblod-plugins 26.0.2 → 26.1.0-dev.f41e5a314cd7d496c91ceafc5ae27ccfd07257ef

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,5 +1,23 @@
1
1
  # @lblod/ember-rdfa-editor-lblod-plugins
2
2
 
3
+ ## 26.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#514](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/514) [`21dcb88`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/21dcb88270ef5c4b43492db987811603aa996af5) Thanks [@piemonkey](https://github.com/piemonkey)! - Change predicate used for decision theme to match application profile
8
+
9
+ - [#515](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/515) [`e1f4791`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/e1f47919b3f6af6300bbf4b6ea2e418240220666) Thanks [@lagartoverde](https://github.com/lagartoverde)! - Allow the user to select how they want the article titles
10
+
11
+ - [#510](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/510) [`ffe23cb`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/ffe23cb7501a94ee7a10839eac363ddae0b5d2b6) Thanks [@abeforgit](https://github.com/abeforgit)! - Make the decision-topic plugin useable outside decisions
12
+
13
+ ### Patch Changes
14
+
15
+ - [#487](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/487) [`1c95c0f`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/1c95c0fbf3e9433ab5e1b0610e9c592f5fddb80b) Thanks [@andreo141](https://github.com/andreo141)! - Change the IRGN plugin to prefix the sign code with the traffic sign type in the outputted HTML of a measure.
16
+
17
+ - [#513](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/513) [`90615a4`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/90615a4c6d0daa6509a7d08cc6126c74a4a6ee26) Thanks [@elpoelma](https://github.com/elpoelma)! - bugfix: ensure that an http://data.europa.eu/eli/ontology#has_part relationship is created between the article and decision when inserting an article container/block
18
+
19
+ - [#516](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/516) [`a51ff27`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/a51ff279e4a2b808081fb2eb192f4071eccbc14a) Thanks [@elpoelma](https://github.com/elpoelma)! - Execute `recalculateNumbers` transaction-monad when inserting article container
20
+
3
21
  ## 26.0.2
4
22
 
5
23
  ### Patch Changes
@@ -2,8 +2,8 @@ import { tracked } from '@glimmer/tracking';
2
2
  import Component from '@glimmer/component';
3
3
  import { action } from '@ember/object';
4
4
  import { SayController } from '@lblod/ember-rdfa-editor';
5
+ import { transformExternalTriples } from '@lblod/ember-rdfa-editor/utils/external-triple-utils';
5
6
  import { trackedFunction } from 'reactiveweb/function';
6
- import { ELI } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/constants';
7
7
  import { AlertTriangleIcon } from '@appuniversum/ember-appuniversum/components/icons/alert-triangle';
8
8
  import { CrossIcon } from '@appuniversum/ember-appuniversum/components/icons/cross';
9
9
  import { MailIcon } from '@appuniversum/ember-appuniversum/components/icons/mail';
@@ -18,9 +18,15 @@ import {
18
18
  } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/besluit-topic-plugin/utils/helpers';
19
19
  import {
20
20
  updateBesluitTopicResource,
21
- ELI_SUBJECT,
21
+ TOPIC_PREDICATE,
22
+ TOPIC_PREDICATE_DEPRECATED,
22
23
  } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/besluit-topic-plugin/commands/update-besluit-topic-resource';
23
24
  import { getOutgoingTripleList } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/namespace';
25
+ import {
26
+ FullTriple,
27
+ OutgoingTriple,
28
+ } from '@lblod/ember-rdfa-editor/core/rdfa-processor';
29
+ import { SayDataFactory } from '@lblod/ember-rdfa-editor/core/say-data-factory';
24
30
 
25
31
  type Args = {
26
32
  controller: SayController;
@@ -52,9 +58,43 @@ export default class BesluitTopicToolbarDropdownComponent extends Component<Args
52
58
  }
53
59
 
54
60
  get showCard() {
55
- return !!this.decisionRange;
61
+ return this.decisionUri || this.decisionRange;
62
+ }
63
+ get options() {
64
+ return this.args.options;
65
+ }
66
+ get decisionUri() {
67
+ return this.options.decisionUri;
56
68
  }
57
69
 
70
+ get currentTopicUris() {
71
+ if (this.decisionRange) {
72
+ const triples: OutgoingTriple[] = this.findTopicTriples(
73
+ this.decisionRange.node.attrs,
74
+ );
75
+ const topicTriples = triples.filter(
76
+ (topic) =>
77
+ topic.object.termType === 'NamedNode' &&
78
+ topic.object.value.includes(
79
+ 'https://data.vlaanderen.be/id/concept/BesluitThema/',
80
+ ),
81
+ );
82
+ return topicTriples.map((topic) => topic.object.value);
83
+ } else if (this.decisionUri) {
84
+ const triples: FullTriple[] = this.doc.attrs['externalTriples'];
85
+ const topicTriples = triples.filter(
86
+ (topic) =>
87
+ topic.subject.value === this.decisionUri &&
88
+ topic.object.termType === 'NamedNode' &&
89
+ topic.object.value.includes(
90
+ 'https://data.vlaanderen.be/id/concept/BesluitThema/',
91
+ ),
92
+ );
93
+ return topicTriples.map((topic) => topic.object.value);
94
+ } else {
95
+ return [];
96
+ }
97
+ }
58
98
  topics = trackedFunction(this, async () => {
59
99
  const result = await fetchBesluitTopics({
60
100
  config: { endpoint: this.args.options.endpoint },
@@ -71,10 +111,27 @@ export default class BesluitTopicToolbarDropdownComponent extends Component<Args
71
111
 
72
112
  return topics.filter((besluitTopic) => uris.includes(besluitTopic.uri));
73
113
  }
114
+ findTopicTriples(attrs?: Record<string, unknown>): OutgoingTriple[] {
115
+ if (!attrs) {
116
+ return [];
117
+ }
118
+ const result = getOutgoingTripleList(attrs, TOPIC_PREDICATE);
119
+ if (result) {
120
+ return result;
121
+ }
122
+ return getOutgoingTripleList(attrs, TOPIC_PREDICATE_DEPRECATED);
123
+ }
124
+ matchTopicPredicate = (predicate: string): boolean => {
125
+ const newMatch = TOPIC_PREDICATE.matches(predicate);
126
+ if (newMatch) {
127
+ return newMatch;
128
+ }
129
+ return TOPIC_PREDICATE_DEPRECATED.matches(predicate);
130
+ };
74
131
 
75
132
  @action
76
133
  updateBesluitTopic() {
77
- if (!this.topics.isFinished || !this.decisionRange) {
134
+ if (!this.topics.isFinished || !this.showCard) {
78
135
  return;
79
136
  }
80
137
  if (!this.topics.value) {
@@ -82,27 +139,10 @@ export default class BesluitTopicToolbarDropdownComponent extends Component<Args
82
139
  return;
83
140
  }
84
141
 
85
- const outgoingBesluitTopics = getOutgoingTripleList(
86
- this.decisionRange.node.attrs,
87
- ELI(ELI_SUBJECT),
88
- );
142
+ const besluitTopics = this.findBesluitTopicsByUris(this.currentTopicUris);
89
143
 
90
- const besluitTopicsRelevant = outgoingBesluitTopics.filter(
91
- (topic) =>
92
- topic.object.termType === 'NamedNode' &&
93
- topic.object.value.includes(
94
- 'https://data.vlaanderen.be/id/concept/BesluitThema/',
95
- ),
96
- );
97
-
98
- const outgoingUris = besluitTopicsRelevant.map(
99
- (topic) => topic.object.value,
100
- );
101
-
102
- const besluitTopics = this.findBesluitTopicsByUris(outgoingUris);
103
-
104
- if (besluitTopicsRelevant && besluitTopics) {
105
- this.previousBesluitTopics = outgoingUris;
144
+ if (this.currentTopicUris && besluitTopics) {
145
+ this.previousBesluitTopics = this.currentTopicUris;
106
146
 
107
147
  this.besluitTopicsSelected = besluitTopics;
108
148
  } else {
@@ -114,19 +154,40 @@ export default class BesluitTopicToolbarDropdownComponent extends Component<Args
114
154
  upsertBesluitTopic(selected: BesluitTopic[]) {
115
155
  this.besluitTopicsSelected = selected;
116
156
 
117
- const resource = getCurrentBesluitURI(this.controller);
118
-
119
- if (this.besluitTopicsSelected && resource) {
120
- this.controller.doCommand(
121
- updateBesluitTopicResource({
122
- resource,
123
- previousTopics: this.previousBesluitTopics,
124
- newTopics: this.besluitTopicsSelected,
125
- }),
126
- {
127
- view: this.args.controller.mainEditorView,
128
- },
129
- );
157
+ if (this.besluitTopicsSelected) {
158
+ const resource = getCurrentBesluitURI(this.controller);
159
+ if (resource) {
160
+ this.controller.doCommand(
161
+ updateBesluitTopicResource({
162
+ resource,
163
+ previousTopics: this.previousBesluitTopics,
164
+ newTopics: this.besluitTopicsSelected,
165
+ }),
166
+ {
167
+ view: this.args.controller.mainEditorView,
168
+ },
169
+ );
170
+ } else if (this.decisionUri) {
171
+ const factory = new SayDataFactory();
172
+ // locking it in for the closure
173
+ const decisionUri = this.decisionUri;
174
+ const newTriples = this.besluitTopicsSelected.map((topic) => ({
175
+ subject: factory.namedNode(decisionUri),
176
+ predicate: TOPIC_PREDICATE.full,
177
+ object: factory.namedNode(topic.uri),
178
+ }));
179
+ const res = transformExternalTriples((oldTriples) => {
180
+ const notOurTriples = oldTriples.filter(
181
+ (trip) =>
182
+ trip.subject.value !== decisionUri ||
183
+ !this.matchTopicPredicate(trip.predicate),
184
+ );
185
+ return notOurTriples.concat(newTriples);
186
+ })(this.controller.mainEditorState);
187
+ if (res.result) {
188
+ this.controller.mainEditorView.dispatch(res.transaction);
189
+ }
190
+ }
130
191
  }
131
192
  }
132
193
 
@@ -21,6 +21,7 @@ import { RoadsignRegulationPluginOptions } from '@lblod/ember-rdfa-editor-lblod-
21
21
  import insertArticle from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/decision-plugin/commands/insert-article-command';
22
22
  import { getCurrentBesluitRange } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/besluit-topic-plugin/utils/helpers';
23
23
  import { buildArticleStructure } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/decision-plugin/utils/build-article-structure';
24
+ import Sign from '@lblod/ember-rdfa-editor-lblod-plugins/models/sign';
24
25
 
25
26
  const PAGE_SIZE = 10;
26
27
  const SIGN_TYPE_URI =
@@ -274,15 +275,17 @@ export default class RoadsignsModal extends Component<Args> {
274
275
  instructions,
275
276
  true,
276
277
  );
278
+
277
279
  const signsHTML = measure.signs
278
280
  .map((sign) => {
279
281
  const roadSignUri = 'http://data.lblod.info/verkeerstekens/' + uuid();
282
+ const trafficSignPrefix = this.addTrafficSignPrefix(sign);
280
283
  return `<li style="margin-bottom:1rem;">
281
284
  <span property="mobiliteit:wordtAangeduidDoor" resource=${roadSignUri} typeof="mobiliteit:Verkeersbord-Verkeersteken">
282
285
  <span property="mobiliteit:heeftVerkeersbordconcept" resource="${
283
286
  sign.uri
284
287
  }" typeof="mobiliteit:Verkeersbordconcept" style="display:flex;align-items:center;">
285
- <span property="skos:prefLabel" style="padding-bottom:0;margin-left:0;margin-right:.4rem;">${
288
+ <span property="skos:prefLabel" style="padding-bottom:0;margin-left:0;margin-right:.4rem;"> ${trafficSignPrefix} ${
286
289
  sign.code
287
290
  }</span>
288
291
  <span style="margin-left:0;margin-top:0;">${
@@ -340,6 +343,23 @@ export default class RoadsignsModal extends Component<Args> {
340
343
  this.args.closeModal();
341
344
  }
342
345
 
346
+ @action
347
+ addTrafficSignPrefix(sign: Sign) {
348
+ let trafficSignPrefix;
349
+ switch (sign.type) {
350
+ case 'https://data.vlaanderen.be/ns/mobiliteit#Verkeersbordconcept':
351
+ trafficSignPrefix = 'Verkeersbord';
352
+ break;
353
+ case 'https://data.vlaanderen.be/ns/mobiliteit#Wegmarkeringconcept':
354
+ trafficSignPrefix = 'Wegmarkering van artikel';
355
+ break;
356
+ case 'https://data.vlaanderen.be/ns/mobiliteit#Verkeerslichtconcept':
357
+ trafficSignPrefix = 'Verkeerslicht van artikel';
358
+ break;
359
+ }
360
+ return trafficSignPrefix;
361
+ }
362
+
343
363
  @action
344
364
  goToPage(pageStart: number) {
345
365
  this.pageStart = pageStart;
@@ -95,12 +95,17 @@ export default class Structure extends Component<Sig> {
95
95
  return this.node.attrs.structureType as StructureType;
96
96
  }
97
97
 
98
+ get fullLengthArticles() {
99
+ return this.node.attrs.fullLengthArticles as boolean;
100
+ }
101
+
98
102
  get structureName() {
99
103
  const docLang = this.controller.mainEditorState.doc.attrs.lang;
100
104
  if (this.displayStructureName) {
101
105
  return getNameForStructureType(
102
106
  this.structureType,
103
107
  this.number,
108
+ this.fullLengthArticles,
104
109
  this.intl,
105
110
  docLang,
106
111
  );
@@ -113,7 +118,10 @@ export default class Structure extends Component<Sig> {
113
118
  }
114
119
 
115
120
  get title() {
116
- if (this.node.attrs.isOnlyArticle) {
121
+ if (
122
+ this.node.attrs.isOnlyArticle &&
123
+ this.node.attrs.onlyArticleSpecialName
124
+ ) {
117
125
  const docLang = this.controller.mainEditorState.doc.attrs.lang;
118
126
  return this.intl.t('structure-plugin.only-article-title', {
119
127
  locale: docLang,
@@ -4,6 +4,7 @@ import { unwrap } from '../utils/option';
4
4
  export default class Sign {
5
5
  constructor(
6
6
  readonly code: string,
7
+ readonly type: string,
7
8
  readonly image: string,
8
9
  readonly classifications: string[] = [],
9
10
  readonly uri: string,
@@ -19,10 +20,10 @@ export default class Sign {
19
20
 
20
21
  const uri = unwrap(binding['uri']?.value);
21
22
  const order = unwrap(binding['order']?.value);
22
-
23
+ const type = unwrap(binding['type']?.value);
23
24
  const classifications = binding['classifications']?.value.split('|') ?? [];
24
25
  const zonality = binding['zonality']?.value;
25
- return new Sign(code, image, classifications, uri, order, zonality);
26
+ return new Sign(code, type, image, classifications, uri, order, zonality);
26
27
  }
27
28
 
28
29
  static processImage(url: string, imageBaseUrl: string) {
@@ -2,9 +2,13 @@ import { BesluitTopic } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/bes
2
2
  import { Command } from '@lblod/ember-rdfa-editor';
3
3
  import { addProperty, removeProperty } from '@lblod/ember-rdfa-editor/commands';
4
4
  import { sayDataFactory } from '@lblod/ember-rdfa-editor/core/say-data-factory';
5
- import { ELI } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/constants';
5
+ import {
6
+ DCT,
7
+ ELI,
8
+ } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/constants';
6
9
 
7
- export const ELI_SUBJECT = 'is_about';
10
+ export const TOPIC_PREDICATE = DCT('subject');
11
+ export const TOPIC_PREDICATE_DEPRECATED = ELI('is_about');
8
12
 
9
13
  export const updateBesluitTopicResource = ({
10
14
  resource,
@@ -24,16 +28,18 @@ export const updateBesluitTopicResource = ({
24
28
  previousTopics.forEach((uri) => {
25
29
  newState = state.apply(transaction);
26
30
 
27
- removeProperty({
28
- resource,
29
- property: {
30
- predicate: ELI(ELI_SUBJECT).full,
31
- object: sayDataFactory.namedNode(uri),
32
- },
33
- transaction,
34
- })(newState, (newTransaction) => {
35
- transaction = newTransaction;
36
- });
31
+ [TOPIC_PREDICATE, TOPIC_PREDICATE_DEPRECATED].forEach((PREDICATE) =>
32
+ removeProperty({
33
+ resource,
34
+ property: {
35
+ predicate: PREDICATE.full,
36
+ object: sayDataFactory.namedNode(uri),
37
+ },
38
+ transaction,
39
+ })(newState, (newTransaction) => {
40
+ transaction = newTransaction;
41
+ }),
42
+ );
37
43
  });
38
44
  }
39
45
 
@@ -43,7 +49,7 @@ export const updateBesluitTopicResource = ({
43
49
  addProperty({
44
50
  resource,
45
51
  property: {
46
- predicate: ELI(ELI_SUBJECT).full,
52
+ predicate: TOPIC_PREDICATE.full,
47
53
  object: sayDataFactory.namedNode(besluitTopic.uri),
48
54
  },
49
55
  transaction,
@@ -1,3 +1,5 @@
1
1
  export type BesluitTopicPluginOptions = {
2
2
  endpoint: string;
3
+ /** Pass an explicit decision uri instead of finding it in the doc */
4
+ decisionUri?: string;
3
5
  };
@@ -7,6 +7,7 @@ import { PROV } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/constants';
7
7
  import { SayDataFactory } from '@lblod/ember-rdfa-editor/core/say-data-factory';
8
8
  import { buildArticleStructure } from '../utils/build-article-structure';
9
9
  import { transactionCombinator } from '@lblod/ember-rdfa-editor/utils/transaction-utils';
10
+ import { recalculateNumbers } from '../../structure-plugin/recalculate-structure-numbers';
10
11
 
11
12
  interface InsertArticleContainerArgs {
12
13
  intl: IntlService;
@@ -24,7 +25,11 @@ export default function insertArticleContainer({
24
25
  const nodeToInsert = schema.node(
25
26
  'block_rdfa',
26
27
  { rdfaNodeType: 'literal', __rdfaId: articleContainerId },
27
- buildArticleStructure(schema, articleUriGenerator),
28
+ buildArticleStructure(
29
+ schema,
30
+ articleUriGenerator,
31
+ decisionLocation.node.attrs.subject,
32
+ ),
28
33
  );
29
34
 
30
35
  const tr = state.tr;
@@ -42,6 +47,7 @@ export default function insertArticleContainer({
42
47
  object: factory.literalNode(articleContainerId),
43
48
  },
44
49
  }),
50
+ recalculateNumbers,
45
51
  ]);
46
52
  if (dispatch && result.every((ok) => ok)) {
47
53
  dispatch(newTr.scrollIntoView());
@@ -30,11 +30,12 @@ const rdfaAware = true;
30
30
  export function getNameForStructureType(
31
31
  structureType: StructureType,
32
32
  number: number,
33
+ fullLengthArticles?: boolean,
33
34
  intl?: IntlService,
34
35
  locale?: string,
35
36
  ) {
36
37
  if (intl?.exists(`structure-plugin.types.${structureType}`, locale)) {
37
- if (structureType === 'article' && number !== 1) {
38
+ if (structureType === 'article' && number !== 1 && !fullLengthArticles) {
38
39
  return intl?.t(`structure-plugin.shortened-article`, { locale });
39
40
  } else {
40
41
  return intl?.t(`structure-plugin.types.${structureType}`, { locale });
@@ -51,7 +52,14 @@ export type StructureType =
51
52
  | 'subsection'
52
53
  | 'paragraph';
53
54
 
54
- export const emberNodeConfig: () => EmberNodeConfig = () => {
55
+ type StructureConfig = {
56
+ fullLengthArticles?: boolean;
57
+ onlyArticleSpecialName?: boolean;
58
+ };
59
+
60
+ export const emberNodeConfig: (config?: StructureConfig) => EmberNodeConfig = (
61
+ config,
62
+ ) => {
55
63
  return {
56
64
  name: 'structure',
57
65
  component: Structure as unknown as ComponentLike,
@@ -88,6 +96,13 @@ export const emberNodeConfig: () => EmberNodeConfig = () => {
88
96
  },
89
97
 
90
98
  sayRenderAs: { default: 'structure' },
99
+ fullLengthArticles: { default: config?.fullLengthArticles },
100
+ onlyArticleSpecialName: {
101
+ default:
102
+ config?.onlyArticleSpecialName === undefined
103
+ ? true
104
+ : config?.onlyArticleSpecialName,
105
+ },
91
106
  },
92
107
  serialize(node: PNode, state: EditorState) {
93
108
  const parser = new DOMParser();
@@ -106,6 +121,7 @@ export const emberNodeConfig: () => EmberNodeConfig = () => {
106
121
  ? getNameForStructureType(
107
122
  structureType,
108
123
  number,
124
+ node.attrs.fullLengthArticles,
109
125
  intlService,
110
126
  state.doc.attrs.lang,
111
127
  )
@@ -117,6 +133,8 @@ export const emberNodeConfig: () => EmberNodeConfig = () => {
117
133
  locale: state.doc.attrs.lang,
118
134
  })
119
135
  : structureName;
136
+ const displayOnlyArticle =
137
+ isOnlyArticle && node.attrs.onlyArticleSpecialName;
120
138
  if (titleHTML) {
121
139
  headerSpec = [
122
140
  tag,
@@ -149,20 +167,20 @@ export const emberNodeConfig: () => EmberNodeConfig = () => {
149
167
  [
150
168
  'span',
151
169
  { 'data-say-structure-header-name': true },
152
- `${isOnlyArticle ? onlyArticleTitle : structureName} `,
170
+ `${displayOnlyArticle ? onlyArticleTitle : structureName} `,
153
171
  ],
154
172
  ]
155
173
  : []),
156
174
  [
157
175
  'span',
158
176
  {
159
- style: isOnlyArticle ? 'display: none;' : '',
177
+ style: displayOnlyArticle ? 'display: none;' : '',
160
178
  'data-say-structure-header-number': true,
161
179
  property: ELI('number').full,
162
180
  },
163
181
  number.toString(),
164
182
  ],
165
- isOnlyArticle ? '' : '.',
183
+ displayOnlyArticle ? '' : '.',
166
184
  ];
167
185
  }
168
186
  return renderRdfaAware({
@@ -297,3 +315,7 @@ export const emberNodeConfig: () => EmberNodeConfig = () => {
297
315
  };
298
316
  export const structure = createEmberNodeSpec(emberNodeConfig());
299
317
  export const structureView = createEmberNodeView(emberNodeConfig());
318
+ export const structureWithConfig = (config?: StructureConfig) =>
319
+ createEmberNodeSpec(emberNodeConfig(config));
320
+ export const structureViewWithConfig = (config?: StructureConfig) =>
321
+ createEmberNodeView(emberNodeConfig(config));
@@ -240,7 +240,7 @@ export default class RoadsignRegistryService extends Service {
240
240
  fetchSignsForMeasure = task(
241
241
  async (uri: string, endpoint: string, imageBaseUrl: string) => {
242
242
  const query = `
243
- SELECT ?uri ?code ?image ?zonality ?order (GROUP_CONCAT(?classification; SEPARATOR="|") AS ?classifications)
243
+ SELECT ?uri ?code ?image ?zonality ?order ?type (GROUP_CONCAT(?classification; SEPARATOR="|") AS ?classifications)
244
244
  WHERE {
245
245
  <${uri}> ext:relation ?relation.
246
246
  ?relation a ext:MustUseRelation;
@@ -2,6 +2,7 @@ import Component from '@glimmer/component';
2
2
  import { SayController } from '@lblod/ember-rdfa-editor';
3
3
  import { BesluitTopicPluginOptions } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/besluit-topic-plugin';
4
4
  import { BesluitTopic } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/besluit-topic-plugin/utils/fetchBesluitTopics';
5
+ import { OutgoingTriple } from '@lblod/ember-rdfa-editor/core/rdfa-processor';
5
6
  type Args = {
6
7
  controller: SayController;
7
8
  options: BesluitTopicPluginOptions;
@@ -19,9 +20,14 @@ export default class BesluitTopicToolbarDropdownComponent extends Component<Args
19
20
  get controller(): SayController;
20
21
  get doc(): import("prosemirror-model").Node;
21
22
  get decisionRange(): import("@lblod/ember-rdfa-editor/plugins/datastore").ElementPNode | undefined;
22
- get showCard(): boolean;
23
+ get showCard(): string | import("@lblod/ember-rdfa-editor/plugins/datastore").ElementPNode | undefined;
24
+ get options(): BesluitTopicPluginOptions;
25
+ get decisionUri(): string | undefined;
26
+ get currentTopicUris(): string[];
23
27
  topics: import("reactiveweb/function").State<Promise<BesluitTopic[]>>;
24
28
  findBesluitTopicsByUris(uris: string[], topics?: BesluitTopic[] | null): BesluitTopic[] | undefined;
29
+ findTopicTriples(attrs?: Record<string, unknown>): OutgoingTriple[];
30
+ matchTopicPredicate: (predicate: string) => boolean;
25
31
  updateBesluitTopic(): void;
26
32
  upsertBesluitTopic(selected: BesluitTopic[]): void;
27
33
  toggleCard(): void;
@@ -4,6 +4,7 @@ import Measure from '@lblod/ember-rdfa-editor-lblod-plugins/models/measure';
4
4
  import { SayController } from '@lblod/ember-rdfa-editor';
5
5
  import IntlService from 'ember-intl/services/intl';
6
6
  import { RoadsignRegulationPluginOptions } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/roadsign-regulation-plugin';
7
+ import Sign from '@lblod/ember-rdfa-editor-lblod-plugins/models/sign';
7
8
  type Option = {
8
9
  label: string;
9
10
  value: string;
@@ -62,6 +63,7 @@ export default class RoadsignsModal extends Component<Args> {
62
63
  restartable: boolean;
63
64
  }, () => Promise<void>>;
64
65
  insertHtml(measure: Measure, zonalityValue: string, temporalValue: string): Promise<void>;
66
+ addTrafficSignPrefix(sign: Sign): string | undefined;
65
67
  goToPage(pageStart: number): void;
66
68
  search(): void;
67
69
  }
@@ -25,6 +25,7 @@ export default class Structure extends Component<Sig> {
25
25
  get number(): any;
26
26
  get displayStructureName(): boolean;
27
27
  get structureType(): StructureType;
28
+ get fullLengthArticles(): boolean;
28
29
  get structureName(): string;
29
30
  get hasTitle(): any;
30
31
  get title(): string;
@@ -1,12 +1,13 @@
1
1
  import { IBindings } from 'fetch-sparql-endpoint';
2
2
  export default class Sign {
3
3
  readonly code: string;
4
+ readonly type: string;
4
5
  readonly image: string;
5
6
  readonly classifications: string[];
6
7
  readonly uri: string;
7
8
  readonly order: string;
8
9
  readonly zonality?: string | undefined;
9
- constructor(code: string, image: string, classifications: string[], uri: string, order: string, zonality?: string | undefined);
10
+ constructor(code: string, type: string, image: string, classifications: string[], uri: string, order: string, zonality?: string | undefined);
10
11
  static fromBinding(binding: IBindings): Sign;
11
12
  static processImage(url: string, imageBaseUrl: string): string;
12
13
  }
@@ -1,6 +1,7 @@
1
1
  import { BesluitTopic } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/besluit-topic-plugin/utils/fetchBesluitTopics';
2
2
  import { Command } from '@lblod/ember-rdfa-editor';
3
- export declare const ELI_SUBJECT = "is_about";
3
+ export declare const TOPIC_PREDICATE: import("../../../utils/namespace").Resource;
4
+ export declare const TOPIC_PREDICATE_DEPRECATED: import("../../../utils/namespace").Resource;
4
5
  export declare const updateBesluitTopicResource: ({ resource, previousTopics, newTopics, }: {
5
6
  resource: string;
6
7
  previousTopics: string[] | undefined;
@@ -1,3 +1,5 @@
1
1
  export type BesluitTopicPluginOptions = {
2
2
  endpoint: string;
3
+ /** Pass an explicit decision uri instead of finding it in the doc */
4
+ decisionUri?: string;
3
5
  };
@@ -1,7 +1,14 @@
1
1
  import { EmberNodeConfig } from '@lblod/ember-rdfa-editor/utils/ember-node';
2
2
  import IntlService from 'ember-intl/services/intl';
3
- export declare function getNameForStructureType(structureType: StructureType, number: number, intl?: IntlService, locale?: string): string;
3
+ export declare function getNameForStructureType(structureType: StructureType, number: number, fullLengthArticles?: boolean, intl?: IntlService, locale?: string): string;
4
4
  export type StructureType = 'article' | 'chapter' | 'section' | 'subsection' | 'paragraph';
5
- export declare const emberNodeConfig: () => EmberNodeConfig;
5
+ type StructureConfig = {
6
+ fullLengthArticles?: boolean;
7
+ onlyArticleSpecialName?: boolean;
8
+ };
9
+ export declare const emberNodeConfig: (config?: StructureConfig) => EmberNodeConfig;
6
10
  export declare const structure: import("@lblod/ember-rdfa-editor/core/say-node-spec").default;
7
11
  export declare const structureView: (controller: import("@lblod/ember-rdfa-editor").SayController) => import("@lblod/ember-rdfa-editor/utils/ember-node").SayNodeViewConstructor;
12
+ export declare const structureWithConfig: (config?: StructureConfig) => import("@lblod/ember-rdfa-editor/core/say-node-spec").default;
13
+ export declare const structureViewWithConfig: (config?: StructureConfig) => (controller: import("@lblod/ember-rdfa-editor").SayController) => import("@lblod/ember-rdfa-editor/utils/ember-node").SayNodeViewConstructor;
14
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lblod/ember-rdfa-editor-lblod-plugins",
3
- "version": "26.0.2",
3
+ "version": "26.1.0-dev.f41e5a314cd7d496c91ceafc5ae27ccfd07257ef",
4
4
  "description": "Ember addon providing lblod specific plugins for the ember-rdfa-editor",
5
5
  "keywords": [
6
6
  "ember-addon",
@@ -105,7 +105,7 @@
105
105
  "@glint/template": "^1.4.0",
106
106
  "@graphy/content.ttl.write": "^4.3.7",
107
107
  "@graphy/memory.dataset.fast": "4.3.3",
108
- "@lblod/ember-rdfa-editor": "10.8.0",
108
+ "@lblod/ember-rdfa-editor": "10.9.0",
109
109
  "@rdfjs/types": "^1.1.0",
110
110
  "@release-it/keep-a-changelog": "^4.0.0",
111
111
  "@tsconfig/ember": "^3.0.8",
package/pnpm-lock.yaml CHANGED
@@ -169,8 +169,8 @@ importers:
169
169
  specifier: 4.3.3
170
170
  version: 4.3.3
171
171
  '@lblod/ember-rdfa-editor':
172
- specifier: 10.8.0
173
- version: 10.8.0(2ef3gpurqxbttnmniw6grhzpuy)
172
+ specifier: 10.9.0
173
+ version: 10.9.0(2ef3gpurqxbttnmniw6grhzpuy)
174
174
  '@rdfjs/types':
175
175
  specifier: ^1.1.0
176
176
  version: 1.1.0
@@ -1595,8 +1595,8 @@ packages:
1595
1595
  '@jridgewell/trace-mapping@0.3.25':
1596
1596
  resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==}
1597
1597
 
1598
- '@lblod/ember-rdfa-editor@10.8.0':
1599
- resolution: {integrity: sha512-Xmcs8+e5sC9aDKz6hB5PslIePKizvh294O9A1JpKx00TzZhIFVBZeyW2baKiBpKpMjR/SyXj4WyryUKLYDldWw==}
1598
+ '@lblod/ember-rdfa-editor@10.9.0':
1599
+ resolution: {integrity: sha512-FHCV9/yYosA9c/dU1zQkHhscsysv5MuUQEZCZ3mayrVFN7EQyerJutC/apej0pqHx+dBL6HHtV+nTv3O3q8FSQ==}
1600
1600
  engines: {node: 16.* || 18.* || >= 20}
1601
1601
  peerDependencies:
1602
1602
  '@appuniversum/ember-appuniversum': ^3.4.2
@@ -10738,7 +10738,7 @@ snapshots:
10738
10738
  '@jridgewell/resolve-uri': 3.1.2
10739
10739
  '@jridgewell/sourcemap-codec': 1.4.15
10740
10740
 
10741
- '@lblod/ember-rdfa-editor@10.8.0(2ef3gpurqxbttnmniw6grhzpuy)':
10741
+ '@lblod/ember-rdfa-editor@10.9.0(2ef3gpurqxbttnmniw6grhzpuy)':
10742
10742
  dependencies:
10743
10743
  '@appuniversum/ember-appuniversum': 3.4.2(yenc6o4wruytt4u2jbwlbsqcl4)
10744
10744
  '@babel/core': 7.24.7