@lblod/ember-rdfa-editor-lblod-plugins 36.0.0 → 37.0.1

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 (55) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/addon/components/citation-plugin/citation-card.hbs +1 -0
  3. package/addon/components/decision-plugin/decision-plugin-card.gts +4 -0
  4. package/addon/components/document-validation-plugin/card.gts +2 -0
  5. package/addon/components/location-plugin/insert.gts +27 -19
  6. package/addon/components/locked-placeholder-plugin/insert.gts +161 -0
  7. package/addon/components/locked-placeholder-plugin/nodeviews/block.gts +23 -0
  8. package/addon/components/locked-placeholder-plugin/nodeviews/inline.gts +23 -0
  9. package/addon/components/mandatee-table-plugin/configure.gts +1 -0
  10. package/addon/components/placeholder-utils-plugin/edit.gts +1 -0
  11. package/addon/components/roadsign-regulation-plugin/roadsigns-table.gts +1 -1
  12. package/addon/components/structure-plugin/control-card.gts +1 -0
  13. package/addon/components/template-comments-plugin/edit-card.hbs +1 -0
  14. package/addon/components/variable-plugin/address/edit.hbs +1 -0
  15. package/addon/components/variable-plugin/autofilled/edit.gts +1 -0
  16. package/addon/components/variable-plugin/codelist/edit.gts +1 -0
  17. package/addon/components/variable-plugin/date/edit.hbs +1 -0
  18. package/addon/components/variable-plugin/insert-variable-card.hbs +1 -0
  19. package/addon/components/variable-plugin/location/edit.hbs +1 -0
  20. package/addon/components/variable-plugin/number/nodeview.hbs +1 -0
  21. package/addon/components/variable-plugin/person/edit.hbs +1 -0
  22. package/addon/plugins/decision-plugin/commands/insert-article-container.ts +3 -0
  23. package/addon/plugins/decision-plugin/commands/insert-description.ts +4 -1
  24. package/addon/plugins/decision-plugin/commands/insert-motivation.ts +3 -1
  25. package/addon/plugins/decision-plugin/commands/insert-title.ts +3 -1
  26. package/addon/plugins/document-validation-plugin/common-fixes.ts +4 -0
  27. package/addon/plugins/location-plugin/contextual-actions/index.ts +84 -0
  28. package/addon/plugins/location-plugin/index.ts +90 -0
  29. package/addon/plugins/locked-placeholder-plugin/nodes/block-locked-placeholder.ts +68 -0
  30. package/addon/plugins/locked-placeholder-plugin/nodes/inline-locked-placeholder.ts +68 -0
  31. package/addon/plugins/locked-placeholder-plugin/utils/replace-content-function.ts +89 -0
  32. package/addon/plugins/structure-plugin/monads/regenerate-rdfa-links.ts +113 -40
  33. package/addon/plugins/variable-plugin/contextual-actions/index.ts +1 -1
  34. package/addon/utils/set-utils.ts +18 -0
  35. package/app/components/locked-placeholder-plugin/insert.js +1 -0
  36. package/app/styles/locked-placeholder-plugin.scss +12 -0
  37. package/declarations/addon/components/location-plugin/insert.d.ts +2 -2
  38. package/declarations/addon/components/locked-placeholder-plugin/insert.d.ts +24 -0
  39. package/declarations/addon/components/locked-placeholder-plugin/nodeviews/block.d.ts +14 -0
  40. package/declarations/addon/components/locked-placeholder-plugin/nodeviews/inline.d.ts +14 -0
  41. package/declarations/addon/plugins/decision-plugin/commands/insert-article-container.d.ts +2 -1
  42. package/declarations/addon/plugins/decision-plugin/commands/insert-description.d.ts +2 -1
  43. package/declarations/addon/plugins/decision-plugin/commands/insert-motivation.d.ts +2 -1
  44. package/declarations/addon/plugins/decision-plugin/commands/insert-title.d.ts +2 -1
  45. package/declarations/addon/plugins/location-plugin/contextual-actions/index.d.ts +14 -0
  46. package/declarations/addon/plugins/location-plugin/index.d.ts +13 -0
  47. package/declarations/addon/plugins/locked-placeholder-plugin/nodes/block-locked-placeholder.d.ts +2 -0
  48. package/declarations/addon/plugins/locked-placeholder-plugin/nodes/inline-locked-placeholder.d.ts +2 -0
  49. package/declarations/addon/plugins/locked-placeholder-plugin/utils/replace-content-function.d.ts +7 -0
  50. package/declarations/addon/plugins/structure-plugin/monads/regenerate-rdfa-links.d.ts +6 -0
  51. package/declarations/addon/plugins/variable-plugin/contextual-actions/index.d.ts +1 -1
  52. package/declarations/addon/utils/set-utils.d.ts +8 -0
  53. package/package.json +4 -4
  54. package/translations/en-US.yaml +16 -0
  55. package/translations/nl-BE.yaml +16 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # @lblod/ember-rdfa-editor-lblod-plugins
2
2
 
3
+ ## 37.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`d088a86`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/d088a868fdacb5d6b5f7c6d16eb0a2e9a5abdf24) Thanks [@abeforgit](https://github.com/abeforgit)! - correctly type command signature of location actions
8
+
9
+ ## 37.0.0
10
+
11
+ ### Major Changes
12
+
13
+ - [#657](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/657) [`3280b11`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/3280b118f0f69210fcbb67e3a71c85a0abf6b10c) Thanks [@kobemertens](https://github.com/kobemertens)! - Update appuniversum to v4
14
+
15
+ ### Minor Changes
16
+
17
+ - [#656](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/656) [`0335b04`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/0335b04e6ee22c0c18791e8f82b026c4fd7a0522) Thanks [@lagartoverde](https://github.com/lagartoverde)! - Add locked placeholders feature
18
+
19
+ - [#654](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/654) [`07e9655`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/07e9655428d07c099ef5ae3117482715a719e5d1) Thanks [@kobemertens](https://github.com/kobemertens)! - Add "Insert address", "Insert point on the map" and "Insert area" contextual actions for the location nodes
20
+
21
+ - [#654](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/654) [`d2301c5`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/d2301c55e8e15a5dfdb83dbe88062eb83ebf7e90) Thanks [@kobemertens](https://github.com/kobemertens)! - Add context actions for location nodes: Insert address, insert place on map, insert area
22
+
23
+ ### Patch Changes
24
+
25
+ - [`02609da`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/02609da40961713aa695fe14dec3fdd7dc469fa5) Thanks [@kobemertens](https://github.com/kobemertens)! - fix function signature for place description context actions
26
+
27
+ - [#655](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/655) [`615a7ff`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/615a7fff08bd9647619bf97b766f343f22fbb7a1) Thanks [@abeforgit](https://github.com/abeforgit)! - Improve performance of automatic structure-linking
28
+
29
+ - [#653](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/653) [`1c1ae88`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/1c1ae88b82537c3a769497f70dba869299566e65) Thanks [@lagartoverde](https://github.com/lagartoverde)! - Translate functions that insert besluit blocks
30
+
3
31
  ## 36.0.0
4
32
 
5
33
  ### Major Changes
@@ -7,6 +7,7 @@
7
7
  @expandable={{true}}
8
8
  @shadow={{true}}
9
9
  @size='small'
10
+ {{! @glint-ignore: backwards compat with AU v3, remove if not supported anymore}}
10
11
  @disableAuContent={{true}}
11
12
  {{did-update
12
13
  this.resetToDocumentState
@@ -78,6 +78,7 @@ export default class DecisionPluginCard extends Component<Sig> {
78
78
  'besluit-plugin.placeholder.decision-title',
79
79
  ),
80
80
  decisionLocation: this.decisionNodeLocation,
81
+ label: 'Titel',
81
82
  }),
82
83
  { view: this.controller.mainEditorView },
83
84
  );
@@ -102,6 +103,7 @@ export default class DecisionPluginCard extends Component<Sig> {
102
103
  'besluit-plugin.placeholder.decision-description',
103
104
  ),
104
105
  decisionLocation: this.decisionNodeLocation,
106
+ label: 'Beschrijving',
105
107
  }),
106
108
  {
107
109
  view: this.controller.mainEditorView,
@@ -128,6 +130,7 @@ export default class DecisionPluginCard extends Component<Sig> {
128
130
  insertMotivation({
129
131
  intl: this.intl,
130
132
  decisionLocation: this.decisionNodeLocation,
133
+ label: 'Motivering',
131
134
  }),
132
135
  {
133
136
  view: this.controller.mainEditorView,
@@ -152,6 +155,7 @@ export default class DecisionPluginCard extends Component<Sig> {
152
155
  decisionUri: this.decisionUri,
153
156
  articleUriGenerator: this.args.options?.articleUriGenerator,
154
157
  decisionLocation: this.decisionNodeLocation,
158
+ label: 'Artikels',
155
159
  }),
156
160
  {
157
161
  view: this.controller.mainEditorView,
@@ -175,6 +175,7 @@ export default class DocumentValidationPluginCard extends Component<Sig> {
175
175
  @expandable={{true}}
176
176
  @shadow={{true}}
177
177
  @size='small'
178
+ {{! @glint-ignore: backwards compat with AU v3, remove if not supported anymore}}
178
179
  @disableAuContent={{true}}
179
180
  class={{if
180
181
  this.isSuccesslike
@@ -281,6 +282,7 @@ export default class DocumentValidationPluginCard extends Component<Sig> {
281
282
  {{#each this.formattedValidationResult as |result|}}
282
283
  <AuCard
283
284
  class='au-u-margin say-document-validation__developer-card'
285
+ {{! @glint-ignore: backwards compat with AU v3, remove if not supported anymore}}
284
286
  @disableAuContent={{true}}
285
287
  as |c|
286
288
  >
@@ -38,11 +38,16 @@ import type { Option } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/option
38
38
  import type { FullTriple } from '@lblod/ember-rdfa-editor/core/rdfa-processor';
39
39
  import { PROV } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/constants';
40
40
  import { SayDataFactory } from '@lblod/ember-rdfa-editor/core/say-data-factory';
41
+ import {
42
+ closeLocationModal,
43
+ getLocationModalsPluginState,
44
+ openLocationModal,
45
+ } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/location-plugin';
41
46
 
42
47
  export type CurrentLocation = Address | GlobalCoordinates | undefined;
43
48
 
44
49
  function updateFromNode<T extends Address | Place | Area, R>(
45
- Class: new (...args: unknown[]) => T,
50
+ Class: new (...args: never[]) => T,
46
51
  extractFunc: (current: T) => R,
47
52
  defaultValue?: R,
48
53
  ) {
@@ -71,7 +76,6 @@ interface Signature {
71
76
 
72
77
  export default class LocationPluginInsertComponent extends Component<Signature> {
73
78
  @service declare intl: IntlService;
74
- @tracked modalOpen = false;
75
79
  @tracked chosenPoint: GeoPos | undefined;
76
80
  @tracked isLoading = false;
77
81
 
@@ -122,19 +126,6 @@ export default class LocationPluginInsertComponent extends Component<Signature>
122
126
  })
123
127
  savedArea: GeoPos[] | undefined;
124
128
 
125
- @trackedReset({
126
- memo: 'modalOpen',
127
- update(component: LocationPluginInsertComponent) {
128
- return (
129
- updateFromNode(Place, () => 'place')(component) ??
130
- updateFromNode(Area, () => 'area')(component) ??
131
- updateFromNode(Address, () => 'address')(component) ??
132
- component.locationTypes[0]
133
- );
134
- },
135
- })
136
- declare locationType: LocationType;
137
-
138
129
  @trackedReset({
139
130
  memo: 'controller.activeEditorState',
140
131
  update(component: LocationPluginInsertComponent) {
@@ -191,9 +182,26 @@ export default class LocationPluginInsertComponent extends Component<Signature>
191
182
  }
192
183
  }
193
184
 
185
+ get modalOpen() {
186
+ return getLocationModalsPluginState(this.controller.activeEditorState)
187
+ ?.modalOpen;
188
+ }
189
+
194
190
  @action
195
191
  setLocationType(type: LocationType) {
196
- this.locationType = type;
192
+ openLocationModal(this.controller.activeEditorView, type);
193
+ }
194
+
195
+ get locationType(): LocationType {
196
+ return (
197
+ // If the modal was not opened trough the context actions, this will be null
198
+ getLocationModalsPluginState(this.controller.activeEditorState)
199
+ ?.locationType ??
200
+ updateFromNode<Place, 'place'>(Place, () => 'place')(this) ??
201
+ updateFromNode<Area, 'area'>(Area, () => 'area')(this) ??
202
+ updateFromNode<Address, 'address'>(Address, () => 'address')(this) ??
203
+ this.locationTypes[0]
204
+ );
197
205
  }
198
206
 
199
207
  @action
@@ -212,12 +220,12 @@ export default class LocationPluginInsertComponent extends Component<Signature>
212
220
  @action
213
221
  closeModal() {
214
222
  this.chosenPoint = undefined;
215
- this.modalOpen = false;
223
+ closeLocationModal(this.controller.activeEditorView);
216
224
  }
217
225
 
218
226
  @action
219
227
  insertOrEditAddress() {
220
- this.modalOpen = true;
228
+ openLocationModal(this.controller.activeEditorView, 'address');
221
229
  }
222
230
 
223
231
  @action
@@ -275,7 +283,7 @@ export default class LocationPluginInsertComponent extends Component<Signature>
275
283
  });
276
284
  }
277
285
  if (toInsert) {
278
- this.modalOpen = false;
286
+ closeLocationModal(this.controller.activeEditorView);
279
287
  if (this.selectedLocationNode) {
280
288
  const df = new SayDataFactory();
281
289
  const { pos, value: locNode } = this.selectedLocationNode;
@@ -0,0 +1,161 @@
1
+ import Component from '@glimmer/component';
2
+ import { on } from '@ember/modifier';
3
+ import AuButton from '@appuniversum/ember-appuniversum/components/au-button';
4
+ import AuCard from '@appuniversum/ember-appuniversum/components/au-card';
5
+ import AuHeading from '@appuniversum/ember-appuniversum/components/au-heading';
6
+ import AuContent from '@appuniversum/ember-appuniversum/components/au-content';
7
+ import AuFormRow from '@appuniversum/ember-appuniversum/components/au-form-row';
8
+ import AuLabel from '@appuniversum/ember-appuniversum/components/au-label';
9
+ import AuNativeInput from '@lblod/ember-rdfa-editor-lblod-plugins/components/au-native-input';
10
+ import AuRadioGroup from '@appuniversum/ember-appuniversum/components/au-radio-group';
11
+ import { NodeSelection, SayController } from '@lblod/ember-rdfa-editor';
12
+ import { type LocationPluginConfig } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/location-plugin/node';
13
+ import { action } from '@ember/object';
14
+ import t from 'ember-intl/helpers/t';
15
+ import { tracked } from '@glimmer/tracking';
16
+
17
+ interface Signature {
18
+ Args: {
19
+ controller: SayController;
20
+ config: LocationPluginConfig;
21
+ templateMode?: boolean;
22
+ };
23
+ Element: HTMLLIElement;
24
+ }
25
+
26
+ export default class LockedPlaceholderPluginInsert extends Component<Signature> {
27
+ @tracked key: string | null = null;
28
+ @tracked label: string | null = null;
29
+ @tracked type = 'inline';
30
+ get selectedPlaceholderNode() {
31
+ const { selection, schema } = this.controller.activeEditorState;
32
+ if (
33
+ selection instanceof NodeSelection &&
34
+ selection.node.type === schema.nodes.placeholder
35
+ ) {
36
+ return selection.node;
37
+ } else {
38
+ return;
39
+ }
40
+ }
41
+
42
+ get controller() {
43
+ return this.args.controller;
44
+ }
45
+
46
+ get canInsert() {
47
+ return !this.selectedPlaceholderNode;
48
+ }
49
+
50
+ @action
51
+ insertPlaceholder() {
52
+ let node = 'inline_locked_placeholder';
53
+ if (this.type === 'block') {
54
+ node = 'block_locked_placeholder';
55
+ }
56
+ this.controller.withTransaction((tr) => {
57
+ tr.replaceSelectionWith(
58
+ this.controller.schema.node(node, {
59
+ key: this.key,
60
+ label: this.label,
61
+ }),
62
+ );
63
+ if (tr.selection.$anchor.nodeBefore) {
64
+ const resolvedPos = tr.doc.resolve(
65
+ tr.selection.anchor - tr.selection.$anchor.nodeBefore?.nodeSize,
66
+ );
67
+ tr.setSelection(new NodeSelection(resolvedPos));
68
+ }
69
+ return tr;
70
+ });
71
+ this.type = 'inline';
72
+ this.key = null;
73
+ this.label = null;
74
+ }
75
+
76
+ @action
77
+ updateKey(event: InputEvent) {
78
+ this.key = (event.target as HTMLInputElement).value;
79
+ }
80
+
81
+ @action
82
+ updateLabel(event: InputEvent) {
83
+ this.label = (event.target as HTMLInputElement).value;
84
+ }
85
+
86
+ @action
87
+ updateType(type: string) {
88
+ this.type = type;
89
+ }
90
+
91
+ <template>
92
+ <AuCard
93
+ @flex={{true}}
94
+ @divided={{true}}
95
+ @isOpenInitially={{true}}
96
+ @expandable={{true}}
97
+ @shadow={{true}}
98
+ @size='small'
99
+ {{! @glint-ignore: backwards compat for au v3}}
100
+ @disableAuContent={{true}}
101
+ as |c|
102
+ >
103
+ <c.header>
104
+ <AuHeading @level='3' @skin='6'>
105
+ {{t 'locked-placeholder-plugin.insert-title'}}
106
+ </AuHeading>
107
+ </c.header>
108
+ <c.content>
109
+ <AuContent>
110
+ <AuFormRow>
111
+ <AuLabel for='key'>
112
+ {{t 'locked-placeholder-plugin.key'}}
113
+ </AuLabel>
114
+ <AuNativeInput
115
+ id='key'
116
+ placeholder={{t 'locked-placeholder-plugin.keyPlaceholder'}}
117
+ @type='text'
118
+ @width='block'
119
+ value={{this.key}}
120
+ {{on 'input' this.updateKey}}
121
+ />
122
+ </AuFormRow>
123
+ <AuFormRow>
124
+ <AuLabel for='label'>
125
+ {{t 'locked-placeholder-plugin.label'}}
126
+ </AuLabel>
127
+ <AuNativeInput
128
+ id='label'
129
+ placeholder={{t 'locked-placeholder-plugin.labelPlaceholder'}}
130
+ @type='text'
131
+ @width='block'
132
+ value={{this.label}}
133
+ {{on 'input' this.updateLabel}}
134
+ />
135
+ </AuFormRow>
136
+ <AuFormRow>
137
+ <AuLabel for='type'>
138
+ {{t 'locked-placeholder-plugin.type'}}
139
+ </AuLabel>
140
+ <AuRadioGroup
141
+ @name='zonal'
142
+ @selected={{this.type}}
143
+ @onChange={{this.updateType}}
144
+ as |Group|
145
+ >
146
+ <Group.Radio @value='inline'>{{t
147
+ 'locked-placeholder-plugin.inline'
148
+ }}</Group.Radio>
149
+ <Group.Radio @value='block'>
150
+ {{t 'locked-placeholder-plugin.block'}}
151
+ </Group.Radio>
152
+ </AuRadioGroup>
153
+ </AuFormRow>
154
+ <AuButton {{on 'click' this.insertPlaceholder}}>
155
+ {{t 'locked-placeholder-plugin.button'}}
156
+ </AuButton>
157
+ </AuContent>
158
+ </c.content>
159
+ </AuCard>
160
+ </template>
161
+ }
@@ -0,0 +1,23 @@
1
+ import Component from '@glimmer/component';
2
+ import AuAlert from '@appuniversum/ember-appuniversum/components/au-alert';
3
+ import { PNode } from '@lblod/ember-rdfa-editor';
4
+
5
+ interface Sig {
6
+ Args: {
7
+ node: PNode;
8
+ };
9
+ Blocks: {
10
+ default: [];
11
+ };
12
+ }
13
+
14
+ export default class BlockLockedPlaceholder extends Component<Sig> {
15
+ get label() {
16
+ return this.args.node.attrs.label;
17
+ }
18
+ <template>
19
+ <AuAlert class='say-block-locked-placeholder'>
20
+ {{this.label}}
21
+ </AuAlert>
22
+ </template>
23
+ }
@@ -0,0 +1,23 @@
1
+ import Component from '@glimmer/component';
2
+ import AuPill from '@appuniversum/ember-appuniversum/components/au-pill';
3
+ import { PNode } from '@lblod/ember-rdfa-editor';
4
+
5
+ interface Sig {
6
+ Args: {
7
+ node: PNode;
8
+ };
9
+ Blocks: {
10
+ default: [];
11
+ };
12
+ }
13
+
14
+ export default class InlineLockedPlaceholder extends Component<Sig> {
15
+ get label() {
16
+ return this.args.node.attrs.label;
17
+ }
18
+ <template>
19
+ <AuPill class='say-pill say-inline-locked-placeholder'>
20
+ {{this.label}}
21
+ </AuPill>
22
+ </template>
23
+ }
@@ -75,6 +75,7 @@ export default class ConfigureMandateeTableComponent extends Component<Sig> {
75
75
  @expandable={{true}}
76
76
  @shadow={{true}}
77
77
  @size='small'
78
+ {{! @glint-ignore: backwards compat with AU v3, remove if not supported anymore}}
78
79
  @disableAuContent={{true}}
79
80
  as |c|
80
81
  >
@@ -87,6 +87,7 @@ export default class PlaceholderUtilsEditCardComponent extends Component<Args> {
87
87
  @expandable={{true}}
88
88
  @shadow={{true}}
89
89
  @size='small'
90
+ {{! @glint-ignore: backwards compat with AU v3, remove if not supported anymore}}
90
91
  @disableAuContent={{true}}
91
92
  as |c|
92
93
  >
@@ -7,7 +7,6 @@ import { addAll } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/_private/se
7
7
  import ExpandedMeasure, { InsertMobilityMeasureTask } from './expanded-measure';
8
8
  import MeasurePreview from './measure-preview';
9
9
 
10
- // @ts-expect-error AuDataTable is not yet converted to typescript
11
10
  import AuDataTable from '@appuniversum/ember-appuniversum/components/au-data-table';
12
11
  import AuLoader from '@appuniversum/ember-appuniversum/components/au-loader';
13
12
  import AuHelpText from '@appuniversum/ember-appuniversum/components/au-help-text';
@@ -57,6 +56,7 @@ export default class RoadSignsTable extends Component<Signature> {
57
56
  };
58
57
 
59
58
  <template>
59
+ {{! @glint-expect-error expect this error }}
60
60
  <AuDataTable @isLoading={{@isLoading}} @noDataMessage='No data' as |table|>
61
61
  <table.content as |c|>
62
62
  <c.header>
@@ -156,6 +156,7 @@ export default class StructureControlCardComponent extends Component<Sig> {
156
156
  @shadow={{true}}
157
157
  @isOpenInitially={{true}}
158
158
  @size='small'
159
+ {{! @glint-ignore: backwards compat with AU v3, remove if not supported anymore}}
159
160
  @disableAuContent={{true}}
160
161
  as |Card|
161
162
  >
@@ -6,6 +6,7 @@
6
6
  @expandable={{false}}
7
7
  @shadow={{true}}
8
8
  @size='flush'
9
+ {{! @glint-ignore: backwards compat with AU v3, remove if not supported anymore}}
9
10
  @disableAuContent={{true}}
10
11
  as |c|
11
12
  >
@@ -5,6 +5,7 @@
5
5
  @divided={{true}}
6
6
  @shadow={{true}}
7
7
  @size='small'
8
+ {{! @glint-ignore: backwards compat with AU v3, remove if not supported anymore}}
8
9
  @disableAuContent={{true}}
9
10
  as |c|
10
11
  >
@@ -146,6 +146,7 @@ export default class AutoFilledVariableInsertComponent extends Component<Args> {
146
146
  @expandable={{true}}
147
147
  @shadow={{true}}
148
148
  @size='small'
149
+ {{! @glint-ignore: backwards compat with AU v3, remove if not supported anymore}}
149
150
  @disableAuContent={{true}}
150
151
  as |c|
151
152
  >
@@ -192,6 +192,7 @@ export default class CodelistEditComponent extends Component<Sig> {
192
192
  @expandable={{true}}
193
193
  @shadow={{true}}
194
194
  @size='small'
195
+ {{! @glint-ignore: backwards compat with AU v3, remove if not supported anymore}}
195
196
  @disableAuContent={{true}}
196
197
  as |c|
197
198
  >
@@ -4,6 +4,7 @@
4
4
  <this.AuCard
5
5
  @shadow={{true}}
6
6
  @size='flush'
7
+ {{! @glint-ignore: backwards compat with AU v3, remove if not supported anymore}}
7
8
  @disableAuContent={{true}}
8
9
  as |c|
9
10
  >
@@ -7,6 +7,7 @@
7
7
  @expandable={{true}}
8
8
  @shadow={{true}}
9
9
  @size='small'
10
+ {{! @glint-ignore: backwards compat with AU v3, remove if not supported anymore}}
10
11
  @disableAuContent={{true}}
11
12
  as |c|
12
13
  >
@@ -7,6 +7,7 @@
7
7
  @expandable={{true}}
8
8
  @shadow={{true}}
9
9
  @size='small'
10
+ {{! @glint-ignore: backwards compat with AU v3, remove if not supported anymore}}
10
11
  @disableAuContent={{true}}
11
12
  as |c|
12
13
  >
@@ -22,6 +22,7 @@
22
22
  @size='small'
23
23
  id='number-input-tooltip'
24
24
  @standOut={{true}}
25
+ {{! @glint-ignore: backwards compat with AU v3, remove if not supported anymore}}
25
26
  @disableAuContent={{true}}
26
27
  as |card|
27
28
  >
@@ -5,6 +5,7 @@
5
5
  @divided={{true}}
6
6
  @shadow={{true}}
7
7
  @size='small'
8
+ {{! @glint-ignore: backwards compat with AU v3, remove if not supported anymore}}
8
9
  @disableAuContent={{true}}
9
10
  as |c|
10
11
  >
@@ -15,12 +15,14 @@ interface InsertArticleContainerArgs {
15
15
  decisionUri: string;
16
16
  articleUriGenerator?: () => string;
17
17
  decisionLocation: NodeWithPos;
18
+ label?: string;
18
19
  }
19
20
 
20
21
  export default function insertArticleContainer({
21
22
  decisionUri,
22
23
  articleUriGenerator,
23
24
  decisionLocation,
25
+ label,
24
26
  }: InsertArticleContainerArgs): Command {
25
27
  return function (state: EditorState, dispatch?: (tr: Transaction) => void) {
26
28
  const { schema } = state;
@@ -29,6 +31,7 @@ export default function insertArticleContainer({
29
31
  {
30
32
  rdfaNodeType: 'literal',
31
33
  __rdfaId: articleContainerId,
34
+ label,
32
35
  },
33
36
  schema.nodes.paragraph.create(),
34
37
  );
@@ -9,18 +9,20 @@ import { transactionCombinator } from '@lblod/ember-rdfa-editor/utils/transactio
9
9
  interface InsertDescriptionArgs {
10
10
  placeholderText: string;
11
11
  decisionLocation: NodeWithPos;
12
+ label?: string;
12
13
  }
13
14
 
14
15
  export default function insertDescription({
15
16
  placeholderText,
16
17
  decisionLocation,
18
+ label,
17
19
  }: InsertDescriptionArgs) {
18
20
  return function (state: EditorState, dispatch?: (tr: Transaction) => void) {
19
21
  const { schema } = state;
20
22
  const descriptionId = uuid();
21
23
  const nodeToInsert = schema.node(
22
24
  'block_rdfa',
23
- { rdfaNodeType: 'literal', __rdfaId: descriptionId },
25
+ { rdfaNodeType: 'literal', __rdfaId: descriptionId, label },
24
26
  schema.node(
25
27
  'paragraph',
26
28
  null,
@@ -30,6 +32,7 @@ export default function insertDescription({
30
32
  ),
31
33
  );
32
34
  const tr = state.tr;
35
+ console.log(nodeToInsert);
33
36
 
34
37
  if (state.selection.$from.pos === decisionLocation.pos) {
35
38
  tr.replaceRangeWith(
@@ -11,11 +11,13 @@ import { transactionCombinator } from '@lblod/ember-rdfa-editor/utils/transactio
11
11
  interface InsertMotivationArgs {
12
12
  intl: IntlService;
13
13
  decisionLocation: NodeWithPos;
14
+ label?: string;
14
15
  }
15
16
 
16
17
  export default function insertMotivation({
17
18
  intl,
18
19
  decisionLocation,
20
+ label,
19
21
  }: InsertMotivationArgs): Command {
20
22
  return function (state: EditorState, dispatch?: (tr: Transaction) => void) {
21
23
  const translationWithDocLang = getTranslationFunction(state);
@@ -24,7 +26,7 @@ export default function insertMotivation({
24
26
  const motivationId = uuid();
25
27
  const nodeToInsert = schema.node(
26
28
  'block_rdfa',
27
- { rdfaNodeType: 'literal', __rdfaId: motivationId },
29
+ { rdfaNodeType: 'literal', __rdfaId: motivationId, label },
28
30
  [
29
31
  schema.node(
30
32
  'paragraph',
@@ -9,18 +9,20 @@ import { transactionCombinator } from '@lblod/ember-rdfa-editor/utils/transactio
9
9
  interface InsertTitleArgs {
10
10
  placeholderText: string;
11
11
  decisionLocation: NodeWithPos;
12
+ label?: string;
12
13
  }
13
14
 
14
15
  export default function insertTitle({
15
16
  placeholderText,
16
17
  decisionLocation,
18
+ label,
17
19
  }: InsertTitleArgs) {
18
20
  return function (state: EditorState, dispatch?: (tr: Transaction) => void) {
19
21
  const { schema } = state;
20
22
  const titleId = uuid();
21
23
  const nodeToInsert = schema.node(
22
24
  'block_rdfa',
23
- { rdfaNodeType: 'literal', __rdfaId: titleId },
25
+ { rdfaNodeType: 'literal', __rdfaId: titleId, label },
24
26
  schema.node(
25
27
  'paragraph',
26
28
  null,
@@ -28,6 +28,7 @@ export function insertTitleAtCursor(
28
28
  insertTitle({
29
29
  placeholderText: intl.t('besluit-plugin.placeholder.decision-title'),
30
30
  decisionLocation: decisionNodeLocation,
31
+ label: 'Titel',
31
32
  }),
32
33
  { view: controller.mainEditorView },
33
34
  );
@@ -51,6 +52,7 @@ export function insertDescriptionAtCursor(
51
52
  'besluit-plugin.placeholder.decision-description',
52
53
  ),
53
54
  decisionLocation: decisionNodeLocation,
55
+ label: 'Beschrijving',
54
56
  }),
55
57
  {
56
58
  view: controller.mainEditorView,
@@ -74,6 +76,7 @@ export function insertMotivationAtCursor(
74
76
  insertMotivation({
75
77
  intl: intl,
76
78
  decisionLocation: decisionNodeLocation,
79
+ label: 'Motivering',
77
80
  }),
78
81
  {
79
82
  view: controller.mainEditorView,
@@ -100,6 +103,7 @@ export function insertArticleContainerAtCursor(
100
103
  decisionUri: decisionNodeLocation?.node.attrs.subject,
101
104
  articleUriGenerator: articleUriGenerator,
102
105
  decisionLocation: decisionNodeLocation,
106
+ label: 'Artikels',
103
107
  }),
104
108
  {
105
109
  view: controller.mainEditorView,