@lblod/ember-rdfa-editor-lblod-plugins 35.2.0 → 35.4.0-dev.02ee7f2c8203606ff87480922a1a9e6b9e67bf55

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.
Files changed (31) hide show
  1. package/.changeset/dry-masks-roll.md +5 -0
  2. package/.changeset/famous-zebras-dream.md +5 -0
  3. package/.changeset/loose-masks-warn.md +5 -0
  4. package/.changeset/quick-frogs-type.md +5 -0
  5. package/CHANGELOG.md +20 -0
  6. package/addon/components/_private/appuniversum-overrides/au-card.gts +0 -2
  7. package/addon/components/besluit-type-plugin/besluit-type-form.gts +12 -0
  8. package/addon/components/besluit-type-plugin/besluit-type-select.gts +4 -2
  9. package/addon/components/placeholder-utils-plugin/edit.gts +15 -12
  10. package/addon/components/roadsign-regulation-plugin/roadsigns-table.gts +1 -1
  11. package/addon/components/variable-plugin/marcode/insert.gts +1 -0
  12. package/addon/plugins/location-plugin/utils/get-document-locations.ts +63 -0
  13. package/addon/plugins/variable-plugin/actions/create-codelist-variable.ts +7 -0
  14. package/addon/plugins/variable-plugin/utils/codelist-utils.ts +4 -0
  15. package/addon/plugins/variable-plugin/variables/codelist.ts +37 -27
  16. package/app/styles/structure-plugin.scss +6 -2
  17. package/declarations/addon/components/besluit-type-plugin/besluit-type-form.d.ts +3 -0
  18. package/declarations/addon/components/besluit-type-plugin/besluit-type-select.d.ts +2 -0
  19. package/declarations/addon/components/placeholder-utils-plugin/edit.d.ts +4 -4
  20. package/declarations/addon/components/roadsign-regulation-plugin/roadsigns-modal.d.ts +2 -2
  21. package/declarations/addon/components/structure-plugin/_private/structure.d.ts +1 -1
  22. package/declarations/addon/plugins/decision-plugin/utils/build-article-structure.d.ts +1 -1
  23. package/declarations/addon/plugins/location-plugin/utils/get-document-locations.d.ts +4 -0
  24. package/declarations/addon/plugins/roadsign-regulation-plugin/queries/mobility-measure-concept.d.ts +1 -1
  25. package/declarations/addon/plugins/roadsign-regulation-plugin/queries/traffic-signal-concept.d.ts +2 -2
  26. package/declarations/addon/plugins/roadsign-regulation-plugin/schemas/mobility-measure-concept.d.ts +4 -4
  27. package/declarations/addon/plugins/roadsign-regulation-plugin/schemas/mobility-measure-design.d.ts +16 -16
  28. package/declarations/addon/plugins/roadsign-regulation-plugin/schemas/traffic-signal-concept.d.ts +2 -2
  29. package/declarations/addon/plugins/roadsign-regulation-plugin/schemas/traffic-signal.d.ts +4 -4
  30. package/declarations/addon/plugins/variable-plugin/actions/create-codelist-variable.d.ts +3 -1
  31. package/package.json +8 -6
@@ -0,0 +1,5 @@
1
+ ---
2
+ '@lblod/ember-rdfa-editor-lblod-plugins': patch
3
+ ---
4
+
5
+ Glint V2 hybrid setup
@@ -0,0 +1,5 @@
1
+ ---
2
+ '@lblod/ember-rdfa-editor-lblod-plugins': minor
3
+ ---
4
+
5
+ Allow modify renderInPlace for besluit type form component
@@ -0,0 +1,5 @@
1
+ ---
2
+ '@lblod/ember-rdfa-editor-lblod-plugins': patch
3
+ ---
4
+
5
+ fix structure move on select by using outline instead of changing the border size
@@ -0,0 +1,5 @@
1
+ ---
2
+ '@lblod/ember-rdfa-editor-lblod-plugins': minor
3
+ ---
4
+
5
+ Add function to search the document for oslo locations
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @lblod/ember-rdfa-editor-lblod-plugins
2
2
 
3
+ ## 35.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#636](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/636) [`867383d`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/867383d8ee85dcf30ad7338cd80dc2c0802326c7) Thanks [@piemonkey](https://github.com/piemonkey)! - Use pointer functionality to link to make linking to codelist URIs possible
8
+
9
+ ### Patch Changes
10
+
11
+ - [#636](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/636) [`aeb74b2`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/aeb74b22f159f0297749e430093d90a54f5f34f6) Thanks [@piemonkey](https://github.com/piemonkey)! - Update to [v13.6.0](https://github.com/lblod/ember-rdfa-editor/releases/tag/%40lblod%2Fember-rdfa-editor%4013.6.0) of the editor
12
+
13
+ ## 35.3.0
14
+
15
+ ### Minor Changes
16
+
17
+ - [#641](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/641) [`062b89a`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/062b89ad35edff9cb0963a17e606497697e7614a) Thanks [@lagartoverde](https://github.com/lagartoverde)! - Add a way to set the required attribute of the label of the besluit type select
18
+
19
+ ### Patch Changes
20
+
21
+ - [#635](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/635) [`d2ac617`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/d2ac61769c71978bc9bc5e3ff10385057ae807bb) Thanks [@lagartoverde](https://github.com/lagartoverde)! - Fix resetting the placeholder edit card
22
+
3
23
  ## 35.2.0
4
24
 
5
25
  ### Minor Changes
@@ -133,7 +133,6 @@ export default class AuCard extends Component<AuCardSignature> {
133
133
  @skin='link'
134
134
  class='au-c-card__toggle'
135
135
  aria-hidden='true'
136
- focusable='false'
137
136
  aria-expanded={{if this.sectionOpen 'true' 'false'}}
138
137
  >
139
138
  {{#if this.sectionOpen}}
@@ -169,7 +168,6 @@ export default class AuCard extends Component<AuCardSignature> {
169
168
  @skin='link'
170
169
  class='au-c-card__toggle'
171
170
  aria-hidden='true'
172
- focusable='false'
173
171
  aria-expanded={{if this.sectionOpen 'true' 'false'}}
174
172
  >
175
173
  {{#if this.sectionOpen}}
@@ -8,6 +8,8 @@ interface Sig {
8
8
  types: BesluitType[];
9
9
  selectedType?: BesluitTypeInstance;
10
10
  setType: (selected: BesluitTypeInstance) => void;
11
+ required?: boolean;
12
+ renderInPlace?: boolean;
11
13
  };
12
14
  Element: HTMLDivElement;
13
15
  }
@@ -35,6 +37,10 @@ export default class BesluitTypePluginBesluitTypeSelectComponent extends Compone
35
37
  });
36
38
  }
37
39
  };
40
+ get renderInPlace() {
41
+ if (this.args.renderInPlace === false) return false;
42
+ return true;
43
+ }
38
44
 
39
45
  <template>
40
46
  <div ...attributes>
@@ -44,6 +50,8 @@ export default class BesluitTypePluginBesluitTypeSelectComponent extends Compone
44
50
  @onchange={{this.updateParentType}}
45
51
  @selected={{@selectedType.parent}}
46
52
  @showWarningWhenEmpty={{false}}
53
+ @required={{@required}}
54
+ @renderInPlace={{this.renderInPlace}}
47
55
  />
48
56
  {{#if @selectedType.parent.subTypes.length}}
49
57
  <BesluitTypeSelect
@@ -52,6 +60,8 @@ export default class BesluitTypePluginBesluitTypeSelectComponent extends Compone
52
60
  @onchange={{this.updateSubType}}
53
61
  @selected={{@selectedType.subType}}
54
62
  @showWarningWhenEmpty={{true}}
63
+ @required={{@required}}
64
+ @renderInPlace={{this.renderInPlace}}
55
65
  />
56
66
  {{/if}}
57
67
  {{#if @selectedType.subType.subTypes.length}}
@@ -61,6 +71,8 @@ export default class BesluitTypePluginBesluitTypeSelectComponent extends Compone
61
71
  @onchange={{this.updateSubSubType}}
62
72
  @selected={{@selectedType.subSubType}}
63
73
  @showWarningWhenEmpty={{true}}
74
+ @required={{@required}}
75
+ @renderInPlace={{this.renderInPlace}}
64
76
  />
65
77
  {{/if}}
66
78
  </div>
@@ -15,6 +15,8 @@ interface Sig {
15
15
  selected?: BesluitType;
16
16
  showWarningWhenEmpty: boolean;
17
17
  onchange: (selected: BesluitType) => void;
18
+ required?: boolean;
19
+ renderInPlace?: boolean;
18
20
  };
19
21
  Element: HTMLDivElement;
20
22
  }
@@ -43,12 +45,12 @@ export default class BesluitTypePluginBesluitTypeSelectComponent extends Compone
43
45
  <template>
44
46
  <div ...attributes>
45
47
  {{#let (uuidv4) as |id|}}
46
- <AuLabel for={{id}}>
48
+ <AuLabel for={{id}} @required={{@required}}>
47
49
  {{t @fieldNameTranslation}}
48
50
  </AuLabel>
49
51
  <PowerSelect
50
52
  id={{id}}
51
- @renderInPlace={{true}}
53
+ @renderInPlace={{@renderInPlace}}
52
54
  @searchEnabled={{true}}
53
55
  @searchMessage={{t 'besluit-type-plugin.search-message'}}
54
56
  @noMatchesMessage={{t 'besluit-type-plugin.no-matches-message'}}
@@ -1,7 +1,6 @@
1
1
  import Component from '@glimmer/component';
2
- import { tracked } from '@glimmer/tracking';
3
2
  import { type ComponentLike } from '@glint/template';
4
- import { NodeSelection, SayController } from '@lblod/ember-rdfa-editor';
3
+ import { NodeSelection, Node, SayController } from '@lblod/ember-rdfa-editor';
5
4
  import { service } from '@ember/service';
6
5
  import IntlService from 'ember-intl/services/intl';
7
6
  import AuCard from '@appuniversum/ember-appuniversum/components/au-card';
@@ -14,6 +13,8 @@ import AuNativeInput from '../au-native-input';
14
13
  import AuFormRow from '@appuniversum/ember-appuniversum/components/au-form-row';
15
14
  import checkEnterAndSubmit from '@lblod/ember-rdfa-editor-lblod-plugins/utils/check-enter-and-submit';
16
15
  import { fn } from '@ember/helper';
16
+ import { not } from 'ember-truth-helpers';
17
+ import { trackedReset } from 'tracked-toolbox';
17
18
 
18
19
  type VariableComponentArgs = {
19
20
  Args: {
@@ -34,7 +35,14 @@ type Args = {
34
35
  };
35
36
 
36
37
  export default class PlaceholderUtilsEditCardComponent extends Component<Args> {
37
- @tracked editedPlaceholderLabel?: string;
38
+ @trackedReset({
39
+ memo: 'selectedPlaceholderNode',
40
+ update(component: PlaceholderUtilsEditCardComponent) {
41
+ return component.selectedPlaceholderNode?.attrs.placeholderText;
42
+ },
43
+ })
44
+ placeholderLabel: string | null = null;
45
+ lastSelectedPlaceholder: Node | null = null;
38
46
 
39
47
  @service declare intl: IntlService;
40
48
 
@@ -50,20 +58,14 @@ export default class PlaceholderUtilsEditCardComponent extends Component<Args> {
50
58
  ) {
51
59
  return selection.node;
52
60
  } else {
53
- return;
61
+ return null;
54
62
  }
55
63
  }
56
64
  get showCard() {
57
65
  return !!this.selectedPlaceholderNode;
58
66
  }
59
- get placeholderLabel() {
60
- return (
61
- this.editedPlaceholderLabel ||
62
- this.selectedPlaceholderNode?.attrs.placeholderText
63
- );
64
- }
65
67
  updateLabelPlaceholder = (event: InputEvent) => {
66
- this.editedPlaceholderLabel = (event.target as HTMLInputElement).value;
68
+ this.placeholderLabel = (event.target as HTMLInputElement).value;
67
69
  };
68
70
  updatePlaceholder = () => {
69
71
  const { selection } = this.controller.activeEditorState;
@@ -71,7 +73,7 @@ export default class PlaceholderUtilsEditCardComponent extends Component<Args> {
71
73
  return tr.setNodeAttribute(
72
74
  selection.$from.pos,
73
75
  'placeholderText',
74
- this.editedPlaceholderLabel,
76
+ this.placeholderLabel,
75
77
  );
76
78
  });
77
79
  };
@@ -110,6 +112,7 @@ export default class PlaceholderUtilsEditCardComponent extends Component<Args> {
110
112
  <AuButton
111
113
  {{on 'click' this.updatePlaceholder}}
112
114
  class='au-u-margin-top'
115
+ @disabled={{not this.placeholderLabel}}
113
116
  >
114
117
  {{t 'editor-plugins.utils.insert'}}
115
118
  </AuButton>
@@ -127,7 +127,7 @@ export default class RoadSignsTable extends Component<Signature> {
127
127
  <td>
128
128
  <AuHelpText
129
129
  @size='large'
130
- skin='secondary'
130
+ @skin='secondary'
131
131
  class='au-u-margin-none'
132
132
  >
133
133
  <MeasurePreview
@@ -50,6 +50,7 @@ export default class MarcodeInsertComponent extends Component<Sig> {
50
50
  // list in code instead of in the doc?
51
51
  hardcodedOptionList: hardcodedMarcodeList,
52
52
  label,
53
+ hasNonLiteralContents: true,
53
54
  });
54
55
  this.controller.doCommand(replaceSelectionWithAndSelectNode(node), {
55
56
  view: this.controller.mainEditorView,
@@ -0,0 +1,63 @@
1
+ import { EditorState } from '@lblod/ember-rdfa-editor';
2
+ import { Area, Place } from './geo-helpers';
3
+ import { Address } from './address-helpers';
4
+
5
+ type LocationsWithDistanceType = {
6
+ location: Place | Address | Area;
7
+ distance: number;
8
+ };
9
+
10
+ type LocationMetadataType = {
11
+ [locationUri: string]: { ocurrences: number; distance: number };
12
+ };
13
+
14
+ export default function getDocumentLocations(state: EditorState) {
15
+ const doc = state.doc;
16
+ const locationsWithDistance: LocationsWithDistanceType[] = [];
17
+ const selection = state.selection;
18
+ doc.descendants((node, pos) => {
19
+ if (node.type.name === 'oslo_location') {
20
+ const distance = Math.abs(pos - selection.from);
21
+ locationsWithDistance.push({
22
+ location: node.attrs.value,
23
+ distance: distance,
24
+ });
25
+ return false;
26
+ }
27
+ return true;
28
+ });
29
+ const locationMetadata: LocationMetadataType = {};
30
+ const locationsDedup: (Place | Address | Area)[] = [];
31
+ for (const locationWithDistance of locationsWithDistance) {
32
+ const uri =
33
+ (locationWithDistance.location as Address).belgianAddressUri ||
34
+ locationWithDistance.location.uri;
35
+ if (!locationMetadata[uri]) {
36
+ locationMetadata[uri] = {
37
+ ocurrences: 1,
38
+ distance: locationWithDistance.distance,
39
+ };
40
+ locationsDedup.push(locationWithDistance.location);
41
+ } else {
42
+ locationMetadata[uri].ocurrences++;
43
+ if (locationWithDistance.distance < locationMetadata[uri].distance) {
44
+ locationMetadata[uri].distance = locationWithDistance.distance;
45
+ }
46
+ }
47
+ }
48
+
49
+ const locations = locationsDedup.sort((a, b) => {
50
+ const uriA = (a as Address).belgianAddressUri || a.uri;
51
+ const uriB = (b as Address).belgianAddressUri || b.uri;
52
+ if (
53
+ locationMetadata[uriA].ocurrences === locationMetadata[uriB].ocurrences
54
+ ) {
55
+ return locationMetadata[uriA].distance - locationMetadata[uriB].distance;
56
+ } else {
57
+ return (
58
+ locationMetadata[uriB].ocurrences - locationMetadata[uriA].ocurrences
59
+ );
60
+ }
61
+ });
62
+ return locations;
63
+ }
@@ -30,6 +30,7 @@ export function createCodelistVariable(args: CreateCodelistVariableArgs) {
30
30
  subject: args.value,
31
31
  variableInstance: args.variableInstance,
32
32
  text: args.valueLabel,
33
+ pointsToNode: args.__rdfaId,
33
34
  });
34
35
  return schema.nodes.codelist.create(attrs, [codelistOption]);
35
36
  }
@@ -42,6 +43,7 @@ type CreateCodelistVariableAttrsArgs = {
42
43
  source: string;
43
44
  codelist: string;
44
45
  hardcodedOptionList?: CodeListOption[];
46
+ hasNonLiteralContents?: boolean;
45
47
  } & AllOrNone<{
46
48
  variable: string;
47
49
  variableInstance: string;
@@ -57,6 +59,7 @@ export function createCodelistVariableAttrs({
57
59
  variable,
58
60
  variableInstance,
59
61
  hardcodedOptionList,
62
+ hasNonLiteralContents,
60
63
  }: CreateCodelistVariableAttrsArgs) {
61
64
  const externalTriples: FullTriple[] = [];
62
65
  if (variable) {
@@ -90,6 +93,7 @@ export function createCodelistVariableAttrs({
90
93
  variable,
91
94
  variableInstance,
92
95
  hardcodedOptionList,
96
+ hasNonLiteralContents: !!hasNonLiteralContents,
93
97
  } as CodelistAttrs;
94
98
  }
95
99
 
@@ -109,12 +113,14 @@ type CreateCodelistOptionNodeAttrsArgs = {
109
113
  text: string;
110
114
  value?: string;
111
115
  variableInstance?: string;
116
+ pointsToNode?: string;
112
117
  };
113
118
 
114
119
  function createCodelistOptionNodeAttrs({
115
120
  subject,
116
121
  text,
117
122
  variableInstance,
123
+ pointsToNode,
118
124
  }: CreateCodelistOptionNodeAttrsArgs) {
119
125
  const backlinks: IncomingTriple[] = [];
120
126
  if (variableInstance) {
@@ -135,5 +141,6 @@ function createCodelistOptionNodeAttrs({
135
141
  subject,
136
142
  properties,
137
143
  backlinks,
144
+ pointsToNode,
138
145
  };
139
146
  }
@@ -35,12 +35,16 @@ export function updateCodelistVariable(
35
35
  const variableInstance = selectedCodelist.node.attrs['variableInstance'] as
36
36
  | string
37
37
  | undefined;
38
+ const pointerTarget = selectedCodelist.node.attrs['__rdfaId'] as
39
+ | string
40
+ | undefined;
38
41
  const codelistOptionNodes = selectedOptions.map((option) =>
39
42
  createCodelistOptionNode({
40
43
  schema: controller.schema,
41
44
  text: option.label,
42
45
  subject: option.uri,
43
46
  variableInstance,
47
+ pointsToNode: pointerTarget,
44
48
  }),
45
49
  );
46
50
  const range = {
@@ -5,6 +5,7 @@ import {
5
5
  } from '@lblod/ember-rdfa-editor/utils/ember-node';
6
6
  import {
7
7
  DOMOutputSpec,
8
+ EditorState,
8
9
  Fragment,
9
10
  PNode,
10
11
  Schema,
@@ -102,7 +103,7 @@ const parseDOM: TagParseRule[] = [
102
103
  },
103
104
  ];
104
105
 
105
- const toDOM = (node: PNode): DOMOutputSpec => {
106
+ const toDOM = (node: PNode, state?: EditorState): DOMOutputSpec => {
106
107
  const {
107
108
  label = 'codelist',
108
109
  codelist,
@@ -119,30 +120,36 @@ const toDOM = (node: PNode): DOMOutputSpec => {
119
120
  for (let i = 0; i < codelist_option_nodes.length; i++) {
120
121
  const codelist_option_node = codelist_option_nodes[i];
121
122
  contentArray.push(
122
- unwrap(codelist_option_node.type.spec.toDOM)(codelist_option_node),
123
+ unwrap((codelist_option_node.type.spec as SayNodeSpec).toDOM)(
124
+ codelist_option_node,
125
+ state,
126
+ ),
123
127
  );
124
128
  if (i !== codelist_option_nodes.length - 1) {
125
129
  contentArray.push(', ');
126
130
  }
127
131
  }
128
- return renderRdfaAware({
129
- renderable: node,
130
- tag: 'span',
131
- attrs: {
132
- class: `${getClassnamesFromNode(node)}${className}`,
133
- 'data-say-variable': 'true',
134
- 'data-say-variable-type': 'codelist',
135
- 'data-say-node-version': '2',
136
- 'data-label': label as string | null,
137
- 'data-codelist': codelist as string,
138
- 'data-source': source as string,
139
- 'data-selection-style': selectionStyle as string,
140
- 'data-variable': variable as string,
141
- 'data-variable-instance': variableInstance as string,
142
- 'data-option-list': JSON.stringify(hardcodedOptionList),
132
+ return renderRdfaAware(
133
+ {
134
+ renderable: node,
135
+ tag: 'span',
136
+ attrs: {
137
+ class: `${getClassnamesFromNode(node)}${className}`,
138
+ 'data-say-variable': 'true',
139
+ 'data-say-variable-type': 'codelist',
140
+ 'data-say-node-version': '2',
141
+ 'data-label': label as string | null,
142
+ 'data-codelist': codelist as string,
143
+ 'data-source': source as string,
144
+ 'data-selection-style': selectionStyle as string,
145
+ 'data-variable': variable as string,
146
+ 'data-variable-instance': variableInstance as string,
147
+ 'data-option-list': JSON.stringify(hardcodedOptionList),
148
+ },
149
+ contentArray: contentArray.length ? contentArray : [label],
143
150
  },
144
- contentArray: contentArray.length ? contentArray : [label],
145
- });
151
+ state,
152
+ );
146
153
  };
147
154
 
148
155
  const emberNodeConfig: EmberNodeConfig = {
@@ -195,14 +202,17 @@ export const codelist_option: SayNodeSpec = {
195
202
  attrs: {
196
203
  ...rdfaAttrSpec({ rdfaAware }),
197
204
  },
198
- toDOM: (node) => {
199
- return renderRdfaAware({
200
- renderable: node,
201
- attrs: {
202
- 'data-say-type': 'codelist_option',
205
+ toDOM: (node, state) => {
206
+ return renderRdfaAware(
207
+ {
208
+ renderable: node,
209
+ attrs: {
210
+ 'data-say-type': 'codelist_option',
211
+ },
212
+ tag: 'span',
213
+ content: node.textContent,
203
214
  },
204
- tag: 'span',
205
- content: node.textContent,
206
- });
215
+ state,
216
+ );
207
217
  },
208
218
  };
@@ -94,11 +94,15 @@
94
94
 
95
95
  .ember-node.say-active > .say-structure {
96
96
  border-color: var(--au-blue-700);
97
- border-width: 0.2rem;
97
+ outline-color: var(--au-blue-700);
98
+ outline-width: 0.18rem;
99
+ outline-style: solid;
98
100
 
99
101
  > .say-structure__header {
100
102
  border-bottom-color: var(--au-blue-700);
101
- border-bottom-width: 0.2rem;
103
+ outline-color: var(--au-blue-700);
104
+ outline-width: 0.18rem;
105
+ outline-style: solid;
102
106
  }
103
107
  }
104
108
 
@@ -6,6 +6,8 @@ interface Sig {
6
6
  types: BesluitType[];
7
7
  selectedType?: BesluitTypeInstance;
8
8
  setType: (selected: BesluitTypeInstance) => void;
9
+ required?: boolean;
10
+ renderInPlace?: boolean;
9
11
  };
10
12
  Element: HTMLDivElement;
11
13
  }
@@ -13,5 +15,6 @@ export default class BesluitTypePluginBesluitTypeSelectComponent extends Compone
13
15
  updateParentType: (selected: BesluitType) => void;
14
16
  updateSubType: (selected: BesluitType) => void;
15
17
  updateSubSubType: (selected: BesluitType) => void;
18
+ get renderInPlace(): boolean;
16
19
  }
17
20
  export {};
@@ -7,6 +7,8 @@ interface Sig {
7
7
  selected?: BesluitType;
8
8
  showWarningWhenEmpty: boolean;
9
9
  onchange: (selected: BesluitType) => void;
10
+ required?: boolean;
11
+ renderInPlace?: boolean;
10
12
  };
11
13
  Element: HTMLDivElement;
12
14
  }
@@ -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: {
@@ -19,12 +19,12 @@ type Args = {
19
19
  variableTypes: VariableConfig[];
20
20
  };
21
21
  export default class PlaceholderUtilsEditCardComponent extends Component<Args> {
22
- editedPlaceholderLabel?: string;
22
+ placeholderLabel: string | null;
23
+ lastSelectedPlaceholder: Node | null;
23
24
  intl: IntlService;
24
25
  get controller(): SayController;
25
- get selectedPlaceholderNode(): import("prosemirror-model").Node | undefined;
26
+ get selectedPlaceholderNode(): Node | null;
26
27
  get showCard(): boolean;
27
- get placeholderLabel(): any;
28
28
  updateLabelPlaceholder: (event: InputEvent) => void;
29
29
  updatePlaceholder: () => void;
30
30
  }
@@ -91,8 +91,8 @@ export default class RoadsignsModal extends Component<Signature> {
91
91
  variableSignage: boolean;
92
92
  trafficSignalConcepts: ({
93
93
  code: string;
94
- image: string;
95
94
  uri: string;
95
+ image: string;
96
96
  position: number;
97
97
  regulatoryNotation?: string | undefined;
98
98
  } & ({
@@ -119,8 +119,8 @@ export default class RoadsignsModal extends Component<Signature> {
119
119
  variableSignage: boolean;
120
120
  trafficSignalConcepts: ({
121
121
  code: string;
122
- image: string;
123
122
  uri: string;
123
+ image: string;
124
124
  position: number;
125
125
  regulatoryNotation?: string | undefined;
126
126
  } & ({
@@ -13,7 +13,7 @@ interface Sig {
13
13
  }
14
14
  export default class Structure extends Component<Sig> {
15
15
  intl: IntlService;
16
- titleSchema: Schema<"text" | "doc", "em" | "strong" | "redacted" | "underline" | "strikethrough" | "subscript" | "superscript" | "highlight" | "color">;
16
+ titleSchema: Schema<"text" | "doc", "em" | "strong" | "color" | "redacted" | "underline" | "strikethrough" | "subscript" | "superscript" | "highlight">;
17
17
  innerView?: SayView;
18
18
  /**
19
19
  * A time counter to store the last time an update to the title was added to
@@ -13,7 +13,7 @@ export declare function generateStructureAttrs({ config, subject, properties, ba
13
13
  hasTitle: boolean;
14
14
  structureType: "paragraph" | "article" | "section" | "title" | "chapter" | "subsection";
15
15
  headerTag: string | undefined;
16
- headerFormat: "plain-number" | "name" | "section-symbol" | undefined;
16
+ headerFormat: "name" | "plain-number" | "section-symbol" | undefined;
17
17
  romanize: boolean;
18
18
  subject: string;
19
19
  };
@@ -0,0 +1,4 @@
1
+ import { EditorState } from '@lblod/ember-rdfa-editor';
2
+ import { Area, Place } from './geo-helpers';
3
+ import { Address } from './address-helpers';
4
+ export default function getDocumentLocations(state: EditorState): (Address | Place | Area)[];
@@ -20,8 +20,8 @@ export declare function queryMobilityMeasures(endpoint: string, options?: Mobili
20
20
  variableSignage: boolean;
21
21
  trafficSignalConcepts: ({
22
22
  code: string;
23
- image: string;
24
23
  uri: string;
24
+ image: string;
25
25
  position: number;
26
26
  regulatoryNotation?: string | undefined;
27
27
  } & ({
@@ -5,8 +5,8 @@ type QueryOptions = {
5
5
  };
6
6
  export declare function queryTrafficSignalConcepts(endpoint: string, options: QueryOptions): Promise<(({
7
7
  code: string;
8
- image: string;
9
8
  uri: string;
9
+ image: string;
10
10
  position: number;
11
11
  regulatoryNotation?: string | undefined;
12
12
  } & {
@@ -17,8 +17,8 @@ export declare function queryTrafficSignalConcepts(endpoint: string, options: Qu
17
17
  uri: string;
18
18
  }[];
19
19
  code: string;
20
- image: string;
21
20
  uri: string;
21
+ image: string;
22
22
  position: number;
23
23
  regulatoryNotation?: string | undefined;
24
24
  type: "https://data.vlaanderen.be/ns/mobiliteit#Verkeersbordconcept";
@@ -17,14 +17,14 @@ export declare const MobilityMeasureConceptSchema: z.ZodObject<{
17
17
  position: z.ZodDefault<z.ZodNumber>;
18
18
  }, "strip", z.ZodTypeAny, {
19
19
  code: string;
20
- image: string;
21
20
  uri: string;
21
+ image: string;
22
22
  position: number;
23
23
  regulatoryNotation?: string | undefined;
24
24
  }, {
25
25
  code: string;
26
- image: string;
27
26
  uri: string;
27
+ image: string;
28
28
  position?: number | undefined;
29
29
  regulatoryNotation?: string | undefined;
30
30
  }>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
@@ -66,8 +66,8 @@ export declare const MobilityMeasureConceptSchema: z.ZodObject<{
66
66
  variableSignage: boolean;
67
67
  trafficSignalConcepts: ({
68
68
  code: string;
69
- image: string;
70
69
  uri: string;
70
+ image: string;
71
71
  position: number;
72
72
  regulatoryNotation?: string | undefined;
73
73
  } & ({
@@ -87,8 +87,8 @@ export declare const MobilityMeasureConceptSchema: z.ZodObject<{
87
87
  variableSignage?: boolean | undefined;
88
88
  trafficSignalConcepts?: ({
89
89
  code: string;
90
- image: string;
91
90
  uri: string;
91
+ image: string;
92
92
  position?: number | undefined;
93
93
  regulatoryNotation?: string | undefined;
94
94
  } & ({
@@ -12,14 +12,14 @@ export declare const MobilityMeasureDesignSchema: z.ZodObject<{
12
12
  position: z.ZodDefault<z.ZodNumber>;
13
13
  }, "strip", z.ZodTypeAny, {
14
14
  code: string;
15
- image: string;
16
15
  uri: string;
16
+ image: string;
17
17
  position: number;
18
18
  regulatoryNotation?: string | undefined;
19
19
  }, {
20
20
  code: string;
21
- image: string;
22
21
  uri: string;
22
+ image: string;
23
23
  position?: number | undefined;
24
24
  regulatoryNotation?: string | undefined;
25
25
  }>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
@@ -57,8 +57,8 @@ export declare const MobilityMeasureDesignSchema: z.ZodObject<{
57
57
  uri: string;
58
58
  trafficSignalConcept: {
59
59
  code: string;
60
- image: string;
61
60
  uri: string;
61
+ image: string;
62
62
  position: number;
63
63
  regulatoryNotation?: string | undefined;
64
64
  } & ({
@@ -74,8 +74,8 @@ export declare const MobilityMeasureDesignSchema: z.ZodObject<{
74
74
  uri: string;
75
75
  trafficSignalConcept: {
76
76
  code: string;
77
- image: string;
78
77
  uri: string;
78
+ image: string;
79
79
  position?: number | undefined;
80
80
  regulatoryNotation?: string | undefined;
81
81
  } & ({
@@ -95,14 +95,14 @@ export declare const MobilityMeasureDesignSchema: z.ZodObject<{
95
95
  position: z.ZodDefault<z.ZodNumber>;
96
96
  }, "strip", z.ZodTypeAny, {
97
97
  code: string;
98
- image: string;
99
98
  uri: string;
99
+ image: string;
100
100
  position: number;
101
101
  regulatoryNotation?: string | undefined;
102
102
  }, {
103
103
  code: string;
104
- image: string;
105
104
  uri: string;
105
+ image: string;
106
106
  position?: number | undefined;
107
107
  regulatoryNotation?: string | undefined;
108
108
  }>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
@@ -154,14 +154,14 @@ export declare const MobilityMeasureDesignSchema: z.ZodObject<{
154
154
  position: z.ZodDefault<z.ZodNumber>;
155
155
  }, "strip", z.ZodTypeAny, {
156
156
  code: string;
157
- image: string;
158
157
  uri: string;
158
+ image: string;
159
159
  position: number;
160
160
  regulatoryNotation?: string | undefined;
161
161
  }, {
162
162
  code: string;
163
- image: string;
164
163
  uri: string;
164
+ image: string;
165
165
  position?: number | undefined;
166
166
  regulatoryNotation?: string | undefined;
167
167
  }>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
@@ -203,8 +203,8 @@ export declare const MobilityMeasureDesignSchema: z.ZodObject<{
203
203
  variableSignage: boolean;
204
204
  trafficSignalConcepts: ({
205
205
  code: string;
206
- image: string;
207
206
  uri: string;
207
+ image: string;
208
208
  position: number;
209
209
  regulatoryNotation?: string | undefined;
210
210
  } & ({
@@ -224,8 +224,8 @@ export declare const MobilityMeasureDesignSchema: z.ZodObject<{
224
224
  variableSignage?: boolean | undefined;
225
225
  trafficSignalConcepts?: ({
226
226
  code: string;
227
- image: string;
228
227
  uri: string;
228
+ image: string;
229
229
  position?: number | undefined;
230
230
  regulatoryNotation?: string | undefined;
231
231
  } & ({
@@ -248,8 +248,8 @@ export declare const MobilityMeasureDesignSchema: z.ZodObject<{
248
248
  variableSignage: boolean;
249
249
  trafficSignalConcepts: ({
250
250
  code: string;
251
- image: string;
252
251
  uri: string;
252
+ image: string;
253
253
  position: number;
254
254
  regulatoryNotation?: string | undefined;
255
255
  } & ({
@@ -264,8 +264,8 @@ export declare const MobilityMeasureDesignSchema: z.ZodObject<{
264
264
  };
265
265
  trafficSignals: ({
266
266
  code: string;
267
- image: string;
268
267
  uri: string;
268
+ image: string;
269
269
  position: number;
270
270
  regulatoryNotation?: string | undefined;
271
271
  } & ({
@@ -280,8 +280,8 @@ export declare const MobilityMeasureDesignSchema: z.ZodObject<{
280
280
  uri: string;
281
281
  trafficSignalConcept: {
282
282
  code: string;
283
- image: string;
284
283
  uri: string;
284
+ image: string;
285
285
  position: number;
286
286
  regulatoryNotation?: string | undefined;
287
287
  } & ({
@@ -304,8 +304,8 @@ export declare const MobilityMeasureDesignSchema: z.ZodObject<{
304
304
  variableSignage?: boolean | undefined;
305
305
  trafficSignalConcepts?: ({
306
306
  code: string;
307
- image: string;
308
307
  uri: string;
308
+ image: string;
309
309
  position?: number | undefined;
310
310
  regulatoryNotation?: string | undefined;
311
311
  } & ({
@@ -320,8 +320,8 @@ export declare const MobilityMeasureDesignSchema: z.ZodObject<{
320
320
  };
321
321
  trafficSignals: ({
322
322
  code: string;
323
- image: string;
324
323
  uri: string;
324
+ image: string;
325
325
  position?: number | undefined;
326
326
  regulatoryNotation?: string | undefined;
327
327
  } & ({
@@ -336,8 +336,8 @@ export declare const MobilityMeasureDesignSchema: z.ZodObject<{
336
336
  uri: string;
337
337
  trafficSignalConcept: {
338
338
  code: string;
339
- image: string;
340
339
  uri: string;
340
+ image: string;
341
341
  position?: number | undefined;
342
342
  regulatoryNotation?: string | undefined;
343
343
  } & ({
@@ -7,14 +7,14 @@ export declare const TrafficSignalConceptSchema: z.ZodIntersection<z.ZodObject<{
7
7
  position: z.ZodDefault<z.ZodNumber>;
8
8
  }, "strip", z.ZodTypeAny, {
9
9
  code: string;
10
- image: string;
11
10
  uri: string;
11
+ image: string;
12
12
  position: number;
13
13
  regulatoryNotation?: string | undefined;
14
14
  }, {
15
15
  code: string;
16
- image: string;
17
16
  uri: string;
17
+ image: string;
18
18
  position?: number | undefined;
19
19
  regulatoryNotation?: string | undefined;
20
20
  }>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
@@ -10,14 +10,14 @@ export declare const TrafficSignalSchema: z.ZodObject<{
10
10
  position: z.ZodDefault<z.ZodNumber>;
11
11
  }, "strip", z.ZodTypeAny, {
12
12
  code: string;
13
- image: string;
14
13
  uri: string;
14
+ image: string;
15
15
  position: number;
16
16
  regulatoryNotation?: string | undefined;
17
17
  }, {
18
18
  code: string;
19
- image: string;
20
19
  uri: string;
20
+ image: string;
21
21
  position?: number | undefined;
22
22
  regulatoryNotation?: string | undefined;
23
23
  }>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
@@ -55,8 +55,8 @@ export declare const TrafficSignalSchema: z.ZodObject<{
55
55
  uri: string;
56
56
  trafficSignalConcept: {
57
57
  code: string;
58
- image: string;
59
58
  uri: string;
59
+ image: string;
60
60
  position: number;
61
61
  regulatoryNotation?: string | undefined;
62
62
  } & ({
@@ -72,8 +72,8 @@ export declare const TrafficSignalSchema: z.ZodObject<{
72
72
  uri: string;
73
73
  trafficSignalConcept: {
74
74
  code: string;
75
- image: string;
76
75
  uri: string;
76
+ image: string;
77
77
  position?: number | undefined;
78
78
  regulatoryNotation?: string | undefined;
79
79
  } & ({
@@ -14,12 +14,13 @@ type CreateCodelistVariableAttrsArgs = {
14
14
  source: string;
15
15
  codelist: string;
16
16
  hardcodedOptionList?: CodeListOption[];
17
+ hasNonLiteralContents?: boolean;
17
18
  } & AllOrNone<{
18
19
  variable: string;
19
20
  variableInstance: string;
20
21
  __rdfaId?: string;
21
22
  }>;
22
- export declare function createCodelistVariableAttrs({ selectionStyle, label, source, codelist, __rdfaId, variable, variableInstance, hardcodedOptionList, }: CreateCodelistVariableAttrsArgs): CodelistAttrs;
23
+ export declare function createCodelistVariableAttrs({ selectionStyle, label, source, codelist, __rdfaId, variable, variableInstance, hardcodedOptionList, hasNonLiteralContents, }: CreateCodelistVariableAttrsArgs): CodelistAttrs;
23
24
  type CreateCodelistOptionNodeArgs = {
24
25
  schema: Schema;
25
26
  text: string;
@@ -30,5 +31,6 @@ type CreateCodelistOptionNodeAttrsArgs = {
30
31
  text: string;
31
32
  value?: string;
32
33
  variableInstance?: string;
34
+ pointsToNode?: string;
33
35
  };
34
36
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lblod/ember-rdfa-editor-lblod-plugins",
3
- "version": "35.2.0",
3
+ "version": "35.4.0-dev.02ee7f2c8203606ff87480922a1a9e6b9e67bf55",
4
4
  "description": "Ember addon providing lblod specific plugins for the ember-rdfa-editor",
5
5
  "keywords": [
6
6
  "ember-addon",
@@ -38,8 +38,9 @@
38
38
  "lint:js": "eslint . --cache",
39
39
  "lint:js:fix": "eslint . --fix",
40
40
  "lint:prettier": "prettier --check .",
41
- "lint:prettier:fix": "prettier --write .",
41
+ "lint:prettier:fix": "pnpm format",
42
42
  "lint:types": "glint",
43
+ "format": "prettier --write .",
43
44
  "start": "concurrently -c \"auto\" -P \"pnpm:serve {@}\" \"pnpm:typecheck\" --",
44
45
  "typecheck": "glint --watch --preserveWatchOutput",
45
46
  "serve": "ember serve",
@@ -107,12 +108,12 @@
107
108
  "@glimmer/component": "^1.1.2",
108
109
  "@glimmer/tracking": "^1.1.2",
109
110
  "@glint/core": "^1.5.0",
111
+ "@glint/ember-tsc": "^1.5.0",
110
112
  "@glint/environment-ember-loose": "^1.5.0",
111
113
  "@glint/environment-ember-template-imports": "^1.5.0",
112
- "@glint/template": "^1.5.0",
113
- "@graphy/content.ttl.write": "^4.3.7",
114
- "@graphy/memory.dataset.fast": "4.3.3",
115
- "@lblod/ember-rdfa-editor": "13.1.1",
114
+ "@glint/template": "^1.7.7",
115
+ "@lblod/ember-rdfa-editor": "13.6.0",
116
+ "@rdfjs/to-ntriples": "^3.0.1",
116
117
  "@rdfjs/types": "^1.1.0",
117
118
  "@release-it/keep-a-changelog": "^4.0.0",
118
119
  "@tsconfig/ember": "^3.0.8",
@@ -207,6 +208,7 @@
207
208
  "pnpm": {
208
209
  "overrides": {
209
210
  "babel-plugin-ember-template-compilation": "^2.2.5",
211
+ "@codemirror/state": "6.5.2",
210
212
  "prosemirror-view": "^1.41.5"
211
213
  }
212
214
  },