@lblod/ember-rdfa-editor-lblod-plugins 8.4.1 → 9.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/CHANGELOG.md +31 -1
  2. package/README.md +132 -0
  3. package/addon/components/address-plugin/insert.ts +2 -2
  4. package/addon/components/address-plugin/utils.ts +2 -2
  5. package/addon/components/article-structure-plugin/structure-card.ts +11 -11
  6. package/addon/components/besluit-type-plugin/besluit-type-select.ts +2 -2
  7. package/addon/components/besluit-type-plugin/toolbar-dropdown.ts +8 -8
  8. package/addon/components/citation-plugin/citation-card.ts +6 -6
  9. package/addon/components/citation-plugin/citation-insert.ts +7 -7
  10. package/addon/components/citation-plugin/citations/search-modal.ts +4 -4
  11. package/addon/components/document-title-plugin/insert-title-card.ts +4 -4
  12. package/addon/components/generic-rdfa-variable/insert-menu.ts +2 -2
  13. package/addon/components/hover-tooltip.ts +1 -1
  14. package/addon/components/import-snippet-plugin/card.ts +9 -9
  15. package/addon/components/rdfa-date-plugin/card.ts +6 -6
  16. package/addon/components/rdfa-date-plugin/date-time-picker.ts +2 -2
  17. package/addon/components/rdfa-date-plugin/date.ts +2 -2
  18. package/addon/components/rdfa-date-plugin/insert.ts +2 -2
  19. package/addon/components/roadsign-regulation-plugin/expanded-measure.ts +3 -3
  20. package/addon/components/roadsign-regulation-plugin/measure-template.ts +2 -2
  21. package/addon/components/roadsign-regulation-plugin/roadsign-regulation-card.ts +1 -1
  22. package/addon/components/roadsign-regulation-plugin/roadsigns-modal.ts +9 -9
  23. package/addon/components/snippet-plugin/search-modal.ts +1 -1
  24. package/addon/components/snippet-plugin/snippet-insert.ts +2 -2
  25. package/addon/components/standard-template-plugin/template-provider.ts +7 -7
  26. package/addon/components/table-of-contents-plugin/ember-nodes/table-of-contents.ts +3 -3
  27. package/addon/components/table-of-contents-plugin/toolbar-button.ts +5 -5
  28. package/addon/components/variable-number/number.ts +24 -25
  29. package/addon/components/variable-plugin/insert-variable-card.hbs +2 -0
  30. package/addon/components/variable-plugin/insert-variable-card.ts +53 -11
  31. package/addon/components/variable-plugin/number-settings.hbs +5 -0
  32. package/addon/components/variable-plugin/template-variable-card.ts +8 -8
  33. package/addon/helpers/pagination.ts +1 -1
  34. package/addon/models/instruction.ts +2 -2
  35. package/addon/models/measure.ts +2 -2
  36. package/addon/models/sign.ts +2 -2
  37. package/addon/plugins/article-structure-plugin/commands/insert-structure.ts +4 -4
  38. package/addon/plugins/article-structure-plugin/commands/move-selected-structure.ts +5 -5
  39. package/addon/plugins/article-structure-plugin/commands/recalculate-structure-numbers.ts +1 -1
  40. package/addon/plugins/article-structure-plugin/commands/remove-structure.ts +1 -1
  41. package/addon/plugins/article-structure-plugin/commands/unwrap-structure.ts +1 -1
  42. package/addon/plugins/article-structure-plugin/commands/wrap-structure-content.ts +5 -5
  43. package/addon/plugins/article-structure-plugin/structures/article-paragraph.ts +2 -2
  44. package/addon/plugins/article-structure-plugin/structures/article.ts +4 -4
  45. package/addon/plugins/article-structure-plugin/structures/chapter.ts +4 -4
  46. package/addon/plugins/article-structure-plugin/structures/section.ts +4 -4
  47. package/addon/plugins/article-structure-plugin/structures/subsection.ts +4 -4
  48. package/addon/plugins/article-structure-plugin/structures/title.ts +4 -4
  49. package/addon/plugins/article-structure-plugin/utils/structure.ts +1 -1
  50. package/addon/plugins/besluit-type-plugin/utils/fetchBesluitTypes.ts +1 -1
  51. package/addon/plugins/citation-plugin/index.ts +17 -17
  52. package/addon/plugins/citation-plugin/utils/cited-text.ts +2 -2
  53. package/addon/plugins/citation-plugin/utils/legislation-types.ts +1 -1
  54. package/addon/plugins/citation-plugin/utils/process-match.ts +3 -3
  55. package/addon/plugins/citation-plugin/utils/vlaamse-codex.ts +14 -14
  56. package/addon/plugins/decision-plugin/commands/insert-article-container.ts +2 -2
  57. package/addon/plugins/decision-plugin/commands/insert-description.ts +3 -3
  58. package/addon/plugins/decision-plugin/commands/insert-motivation.ts +9 -9
  59. package/addon/plugins/decision-plugin/commands/insert-title.ts +3 -3
  60. package/addon/plugins/decision-plugin/utils/get-title-for-decision.ts +1 -1
  61. package/addon/plugins/document-title-plugin/commands/insert-document-title.ts +3 -3
  62. package/addon/plugins/rdfa-date-plugin/nodes/date.ts +2 -2
  63. package/addon/plugins/rdfa-date-plugin/utils.ts +1 -1
  64. package/addon/plugins/roadsign-regulation-plugin/nodes.ts +4 -4
  65. package/addon/plugins/roadsign-regulation-plugin/utils/fetchData.ts +2 -2
  66. package/addon/plugins/roadsign-regulation-plugin/utils/includeInstructions.ts +2 -2
  67. package/addon/plugins/snippet-plugin/utils/fetch-data.ts +22 -14
  68. package/addon/plugins/standard-template-plugin/utils/instantiate-uuids.ts +2 -2
  69. package/addon/plugins/standard-template-plugin/utils/nodes.ts +5 -5
  70. package/addon/plugins/table-of-contents-plugin/nodes/table-of-contents.ts +1 -1
  71. package/addon/plugins/table-of-contents-plugin/utils/index.ts +1 -1
  72. package/addon/plugins/validation/index.ts +13 -13
  73. package/addon/plugins/validation/utils/transaction-complies-with-shapes.ts +2 -2
  74. package/addon/plugins/variable-plugin/nodes.ts +7 -6
  75. package/addon/plugins/variable-plugin/utils/constants.ts +5 -5
  76. package/addon/plugins/variable-plugin/utils/fetch-data.ts +2 -2
  77. package/addon/plugins/variable-plugin/utils/number-to-words.ts +15 -0
  78. package/addon/services/import-rdfa-snippet.ts +3 -3
  79. package/addon/services/roadsign-registry.ts +15 -15
  80. package/addon/services/standard-template-plugin.ts +1 -1
  81. package/addon/utils/_private/find-insertion-range.ts +1 -1
  82. package/addon/utils/changed-descendants.ts +1 -1
  83. package/addon/utils/constants.ts +3 -3
  84. package/addon/utils/find-insertion-pos-in-ancestor-of-type.ts +2 -2
  85. package/addon/utils/namespace.ts +3 -3
  86. package/addon/utils/option.ts +2 -2
  87. package/addon/utils/sparql-helpers.ts +2 -2
  88. package/addon/utils/strings.ts +11 -1
  89. package/app/styles/variable-plugin.scss +14 -0
  90. package/components/variable-number/number.d.ts +1 -1
  91. package/components/variable-plugin/insert-variable-card.d.ts +14 -1
  92. package/package.json +8 -8
  93. package/plugins/variable-plugin/utils/number-to-words.d.ts +8 -0
  94. package/translations/en-US.yaml +3 -2
  95. package/translations/nl-BE.yaml +3 -2
  96. package/types/global.d.ts +2 -2
  97. package/types/lblod/marawa/rdfa-attributes.d.ts +1 -1
  98. package/types/lblod/marawa/rdfa-context-scanner.d.ts +1 -1
  99. package/types/lblod/marawa/rdfa-helpers.d.ts +3 -3
  100. package/utils/strings.d.ts +1 -0
package/CHANGELOG.md CHANGED
@@ -7,6 +7,35 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [9.0.0] - 2023-07-24
11
+
12
+ ### Added
13
+ - Addition of documentation on the article-structure plugin
14
+
15
+ ### Fixed
16
+ - When a number is too big to be converted to words, display it numerically.
17
+ - Can only insert a number variable with a minimum that is smaller than its maximum
18
+ - Fetch public snippets
19
+ ### Changed
20
+ - Make `errorMessage` of number input modal reactive to attribute changes
21
+ - Number variable input box has a cleaner UI by adjusting the top margins.
22
+ - Demo uses `initialize` and `docWithConfig` introduced in `ember-rdfa-editor@4.0.0`
23
+ ### Dependencies
24
+ - Bumps `@lblod/ember-rdfa-editor` from 3.10.0 to 4.0.0
25
+ - Bumps `@typescript-eslint/parser` from 5.60.0 to 5.61.0
26
+ - Bumps `@tsconfig/ember` from 1.0.1 to 3.0.0
27
+ - Bumps `fetch-sparql-endpoint` from 3.1.1 to 3.3.3
28
+ - Bumps `eslint` from 7.32.0 to 8.44.0
29
+ - Bumps `semver` from 5.7.1 to 5.7.2
30
+ - Bumps `prettier` from 2.8.8 to 3.0.0
31
+ - Bumps `eslint-plugin-prettier` to 5.0.0
32
+ - Bumps `@types/ember__utils` from 4.0.2 to 4.0.3
33
+ - Bumps `@types/ember__controller` from 4.0.3 to 4.0.5
34
+ - Bumps `tracked-built-ins` from 3.1.0 to 3.1.1
35
+ - Bumps `word-wrap` from 1.2.3 to 1.2.4
36
+ - Pin `ember-auto-import` to 2.5.x
37
+
38
+
10
39
  ## [8.4.1] - 2023-07-06
11
40
 
12
41
  ### Fixed
@@ -553,7 +582,7 @@ add onclick handler to pencil icon in variable plugin
553
582
 
554
583
  # Changelog
555
584
 
556
- [unreleased]: https://github.com/lblod/ember-rdfa-editor-lblod-plugins/compare/v8.4.1...HEAD
585
+ [unreleased]: https://github.com/lblod/ember-rdfa-editor-lblod-plugins/compare/v9.0.0...HEAD
557
586
  [8.0.0]: https://github.com/lblod/ember-rdfa-editor-lblod-plugins/compare/v8.0.0...v8.0.1
558
587
  [8.0.0]: https://github.com/lblod/ember-rdfa-editor-lblod-plugins/compare/v7.1.0...v8.0.0
559
588
  [7.1.0]: https://github.com/lblod/ember-rdfa-editor-lblod-plugins/compare/v7.0.0...v7.1.0
@@ -569,6 +598,7 @@ add onclick handler to pencil icon in variable plugin
569
598
  [3.0.0]: https://github.com/lblod/ember-rdfa-editor-lblod-plugins/compare/v2.1.2...v3.0.0
570
599
  [2.1.2]: https://github.com/lblod/ember-rdfa-editor-lblod-plugins/compare/v2.1.1...v2.1.2
571
600
  [2.1.1]: https://github.com/lblod/ember-rdfa-editor-lblod-plugins/compare/v2.1.0...v2.1.1
601
+ [9.0.0]: https://github.com/lblod/ember-rdfa-editor-lblod-plugins/compare/v8.4.1...v9.0.0
572
602
  [8.4.1]: https://github.com/lblod/ember-rdfa-editor-lblod-plugins/compare/v8.4.0...v8.4.1
573
603
  [8.4.0]: https://github.com/lblod/ember-rdfa-editor-lblod-plugins/compare/v8.3.0...v8.4.0
574
604
  [8.3.0]: https://github.com/lblod/ember-rdfa-editor-lblod-plugins/compare/v8.2.2...v8.3.0
package/README.md CHANGED
@@ -19,6 +19,7 @@ ember install ember-rdfa-editor-lblod-plugins
19
19
 
20
20
  This addon contains the following editor plugins:
21
21
 
22
+ * [article-structure-plugin](#article-structure-plugin)
22
23
  * [besluit-type-plugin](#besluit-type-plugin)
23
24
  * [citaten-plugin](#citaten-plugin)
24
25
  * [decision-plugin](#decision-plugin)
@@ -62,6 +63,137 @@ You can configure your editor like this:
62
63
 
63
64
  You will have 2 anchor points where to put your plugins: `top` for a toolbar, and `aside` for plugin cards.
64
65
 
66
+ ## article-structure plugin
67
+
68
+ Plugin which allows a user to insert different types of structures, like chapters, sections, articles etc.
69
+
70
+ This plugin provides two widgets which can be added to the sidebar.
71
+ ### The structure insertion widget
72
+
73
+ This widget displays a series of buttons which allows the user to insert the configured widgets.
74
+
75
+ You can add this widget to the sidebar using the following syntax:
76
+ ```hbs
77
+ <ArticleStructurePlugin::ArticleStructureCard
78
+ @controller={{this.controller}}
79
+ @options={{this.config.structures}}
80
+ />
81
+ ```
82
+ The widgets accepts two properties:
83
+ - `controller`: an instance of a `SayController` which the widgets uses two insert structures into a document
84
+ - `options`: a list of structure configurations which are supported.
85
+
86
+ ### The structure context widget
87
+
88
+ This widget displays a context card in the sidebar when a structure is selected by the user. The card displays controls which allow users to move a structure around or remove it alltogether.
89
+
90
+ You can add this widget to the sidebar using the following syntax:
91
+ ```hbs
92
+ <ArticleStructurePlugin::StructureCard
93
+ @controller={{this.controller}}
94
+ @options={{this.config.structures}}
95
+ />
96
+ ```
97
+
98
+ Just like the insertion widget, this widget also accepts the same two properties.
99
+
100
+ ### Configuring the plugin
101
+ Both widgets require an `options` property which allows you to configure which type of structures are supported, which is a list of `StructureSpec` objects.
102
+
103
+ E.g. a regulatory statement document will typically have the following configuration of structures:
104
+
105
+ ```js
106
+ export const STRUCTURE_SPECS: ArticleStructurePluginOptions = [
107
+ titleSpec,
108
+ chapterSpec,
109
+ sectionSpec,
110
+ subsectionSpec,
111
+ articleSpec,
112
+ articleParagraphSpec,
113
+ ];
114
+ ```
115
+
116
+ Each of these entries is a seperate `StructureSpec` object. The `StructureSpec` interface is defined as:
117
+ ```js
118
+ export type StructureSpec = {
119
+ name: SpecName; // the name of the corresponding structure node-spec
120
+ translations: { // the ember-intl translation keys which are to be used in the widgets
121
+ insert: string;
122
+ move?: {
123
+ up?: string;
124
+ down?: string;
125
+ };
126
+ remove?: string;
127
+ removeWithContent?: string;
128
+ };
129
+ constructor: (args: { // a `constructor` method which creates an instance of the structure node
130
+ schema: Schema;
131
+ number?: number;
132
+ intl?: IntlService;
133
+ content?: PNode | Fragment;
134
+ }) => {
135
+ node: PNode;
136
+ selectionConfig: {
137
+ relativePos: number;
138
+ type: 'node' | 'text';
139
+ };
140
+ };
141
+ updateNumber: (args: { // a method which produces a transaction which updates the number of a structure when it is moved around
142
+ number: number;
143
+ pos: number;
144
+ transaction: Transaction;
145
+ }) => Transaction;
146
+ content?: (args: { pos: number; state: EditorState }) => Fragment;
147
+ continuous: boolean; // boolean which indicates whether the numbering of this structure type is continuous or should restart with each different parent
148
+ limitTo?: string; // string which indicates a node-spec name to which the insertion of the structure should be limited to
149
+ noUnwrap?: boolean; // disable unwrapping of the structure when it is removed and just remove it with it content alltogether
150
+ };
151
+ ```
152
+
153
+ Note: for each structure you configure, the corresponding node-spec also needs to be added to the schema.
154
+
155
+ By default, this plugin already exports some structure-specs and their corresponding node-specs:
156
+
157
+ ```js
158
+ const STRUCTURE_SPECS: ArticleStructurePluginOptions = [
159
+ titleSpec,
160
+ chapterSpec,
161
+ sectionSpec,
162
+ subsectionSpec,
163
+ articleSpec,
164
+ articleParagraphSpec,
165
+ ];
166
+
167
+ const STRUCTURE_NODES = {
168
+ structure_header,
169
+ title,
170
+ title_body,
171
+ chapter,
172
+ chapter_body,
173
+ section,
174
+ section_body,
175
+ subsection,
176
+ subsection_body,
177
+ article,
178
+ article_header,
179
+ article_body,
180
+ article_paragraph,
181
+ };
182
+
183
+ ```
184
+
185
+ You can import these using:
186
+ ```js
187
+ import {
188
+ STRUCTURE_NODES,
189
+ STRUCTURE_SPECS,
190
+ } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/article-structure-plugin/structures';
191
+ ```
192
+
193
+
194
+ Additional examples can be found in the two controllers (besluit-sample and regulatory-statement-sample) of the dummy-app contained in this repository.
195
+
196
+
65
197
  ## besluit-type-plugin
66
198
 
67
199
  Plugin which allows a user to change the type of a [besluit](https://data.vlaanderen.be/ns/besluit#Besluit).
@@ -77,8 +77,8 @@ export default class AddressPluginInsertComponent extends Component<Args> {
77
77
  },
78
78
  this.schema.node('paragraph', null, [
79
79
  this.schema.text(address.volledigAdres.geografischeNaam.spelling),
80
- ])
81
- )
80
+ ]),
81
+ ),
82
82
  );
83
83
 
84
84
  return tr;
@@ -9,11 +9,11 @@ export const replaceAccents = (string: string) =>
9
9
  export async function getSuggestedLocations(query: string) {
10
10
  const result = await fetch(
11
11
  `${LOC_GEOPUNT_ENDPOINT}?q=${encodeURIComponent(
12
- query.replace(/^"(.*)"$/, '$1')
12
+ query.replace(/^"(.*)"$/, '$1'),
13
13
  )}&c=10&type=Housenumber`,
14
14
  {
15
15
  method: 'GET',
16
- }
16
+ },
17
17
  );
18
18
 
19
19
  const jsonResult = (await result.json()) as {
@@ -29,7 +29,7 @@ export default class EditorPluginsStructureCardComponent extends Component<Args>
29
29
  moveStructure(direction: 'up' | 'down') {
30
30
  this.controller.doCommand(
31
31
  moveSelectedStructure(this.structureTypes, direction, this.intl),
32
- { view: this.controller.mainEditorView }
32
+ { view: this.controller.mainEditorView },
33
33
  );
34
34
  this.controller.focus();
35
35
  }
@@ -40,7 +40,7 @@ export default class EditorPluginsStructureCardComponent extends Component<Args>
40
40
  if (withContent || this.currentStructureType.noUnwrap) {
41
41
  this.controller.doCommand(
42
42
  removeStructure(this.structure, this.structureTypes),
43
- { view: this.controller.mainEditorView }
43
+ { view: this.controller.mainEditorView },
44
44
  );
45
45
  } else {
46
46
  this.controller.doCommand(
@@ -49,9 +49,9 @@ export default class EditorPluginsStructureCardComponent extends Component<Args>
49
49
  ...this.structure,
50
50
  type: this.currentStructureType,
51
51
  },
52
- this.structureTypes
52
+ this.structureTypes,
53
53
  ),
54
- { view: this.controller.mainEditorView }
54
+ { view: this.controller.mainEditorView },
55
55
  );
56
56
  }
57
57
  }
@@ -69,7 +69,7 @@ export default class EditorPluginsStructureCardComponent extends Component<Args>
69
69
 
70
70
  get structureNodeSpecs() {
71
71
  return this.structureTypes.map(
72
- (type) => this.controller.schema.nodes[type.name]
72
+ (type) => this.controller.schema.nodes[type.name],
73
73
  );
74
74
  }
75
75
 
@@ -82,7 +82,7 @@ export default class EditorPluginsStructureCardComponent extends Component<Args>
82
82
  if (this.structure) {
83
83
  const { node: structureNode } = this.structure;
84
84
  return this.structureTypes.find(
85
- (spec) => spec.name === structureNode.type.name
85
+ (spec) => spec.name === structureNode.type.name,
86
86
  );
87
87
  }
88
88
  return;
@@ -104,7 +104,7 @@ export default class EditorPluginsStructureCardComponent extends Component<Args>
104
104
  return this.intl.t(translation);
105
105
  } else {
106
106
  return this.intl.t(
107
- 'article-structure-plugin.remove-with-content.default'
107
+ 'article-structure-plugin.remove-with-content.default',
108
108
  );
109
109
  }
110
110
  }
@@ -116,14 +116,14 @@ export default class EditorPluginsStructureCardComponent extends Component<Args>
116
116
  get canMoveDown() {
117
117
  return this.controller.checkCommand(
118
118
  moveSelectedStructure(this.structureTypes, 'down', this.intl),
119
- { view: this.controller.mainEditorView }
119
+ { view: this.controller.mainEditorView },
120
120
  );
121
121
  }
122
122
 
123
123
  get canMoveUp() {
124
124
  return this.controller.checkCommand(
125
125
  moveSelectedStructure(this.structureTypes, 'up', this.intl),
126
- { view: this.controller.mainEditorView }
126
+ { view: this.controller.mainEditorView },
127
127
  );
128
128
  }
129
129
 
@@ -138,9 +138,9 @@ export default class EditorPluginsStructureCardComponent extends Component<Args>
138
138
  ...this.structure,
139
139
  type: this.currentStructureType,
140
140
  },
141
- this.structureTypes
141
+ this.structureTypes,
142
142
  ),
143
- { view: this.controller.mainEditorView }
143
+ { view: this.controller.mainEditorView },
144
144
  );
145
145
  }
146
146
  }
@@ -11,7 +11,7 @@ export default class BesluitTypePluginBesluitTypeSelectComponent extends Compone
11
11
  constructor(parent: unknown, args: Args) {
12
12
  super(parent, args);
13
13
  this.besluitTypes = this.args.besluitTypes.sort((a, b) =>
14
- a.label > b.label ? 1 : -1
14
+ a.label > b.label ? 1 : -1,
15
15
  );
16
16
  }
17
17
 
@@ -19,7 +19,7 @@ export default class BesluitTypePluginBesluitTypeSelectComponent extends Compone
19
19
  search(term: string) {
20
20
  const lowerTerm = term.toLowerCase();
21
21
  return this.args.besluitTypes.filter((besluitType) =>
22
- besluitType.label.toLowerCase().includes(lowerTerm)
22
+ besluitType.label.toLowerCase().includes(lowerTerm),
23
23
  );
24
24
  }
25
25
  }
@@ -66,7 +66,7 @@ export default class EditorPluginsToolbarDropdownComponent extends Component<Arg
66
66
  const classificatie = await bestuurseenheid.get('classificatie');
67
67
  const types = await fetchBesluitTypes(
68
68
  classificatie.uri,
69
- this.args.options.endpoint
69
+ this.args.options.endpoint,
70
70
  );
71
71
  return types;
72
72
  });
@@ -75,7 +75,7 @@ export default class EditorPluginsToolbarDropdownComponent extends Component<Arg
75
75
  const selection = this.controller.mainEditorState.selection;
76
76
  const besluit = findAncestorOfType(
77
77
  selection,
78
- this.controller.schema.nodes['besluit']
78
+ this.controller.schema.nodes['besluit'],
79
79
  );
80
80
  if (!besluit) {
81
81
  return undefined;
@@ -106,12 +106,12 @@ export default class EditorPluginsToolbarDropdownComponent extends Component<Arg
106
106
  }
107
107
  const besluit = findAncestorOfType(
108
108
  this.controller.mainEditorState.selection,
109
- this.controller.schema.nodes['besluit']
109
+ this.controller.schema.nodes['besluit'],
110
110
  );
111
111
  const besluitTypeof = besluit?.node.attrs.typeof as string;
112
112
  const besluitTypesUris = besluitTypeof.split(' ');
113
113
  const besluitTypeRelevant = besluitTypesUris.find((type) =>
114
- type.includes('https://data.vlaanderen.be/id/concept/BesluitType/')
114
+ type.includes('https://data.vlaanderen.be/id/concept/BesluitType/'),
115
115
  );
116
116
  if (besluitTypeRelevant) {
117
117
  this.previousBesluitType = besluitTypeRelevant;
@@ -168,7 +168,7 @@ export default class EditorPluginsToolbarDropdownComponent extends Component<Arg
168
168
  findBesluitTypeParent(
169
169
  besluitType?: BesluitType,
170
170
  array: BesluitType[] | null = this.types.value,
171
- parent?: BesluitType
171
+ parent?: BesluitType,
172
172
  ): BesluitType | undefined {
173
173
  if (!besluitType || !array) {
174
174
  return;
@@ -186,7 +186,7 @@ export default class EditorPluginsToolbarDropdownComponent extends Component<Arg
186
186
 
187
187
  findBesluitTypeByURI(
188
188
  uri: string,
189
- types = this.types.value
189
+ types = this.types.value,
190
190
  ): BesluitType | undefined {
191
191
  if (uri && types) {
192
192
  for (const besluitType of types) {
@@ -209,12 +209,12 @@ export default class EditorPluginsToolbarDropdownComponent extends Component<Arg
209
209
  if (this.previousBesluitType) {
210
210
  this.controller.doCommand(
211
211
  removeType(this.currentBesluitRange.from, this.previousBesluitType),
212
- { view: this.controller.mainEditorView }
212
+ { view: this.controller.mainEditorView },
213
213
  );
214
214
  }
215
215
  this.controller.doCommand(
216
216
  addType(this.currentBesluitRange.from, this.besluitType.uri),
217
- { view: this.controller.mainEditorView }
217
+ { view: this.controller.mainEditorView },
218
218
  );
219
219
  }
220
220
  }
@@ -51,7 +51,7 @@ export default class CitationCardComponent extends Component<Args> {
51
51
  @action
52
52
  update() {
53
53
  if (this.activeDecoration) {
54
- const { legislationTypeUri, searchText } = this.activeDecoration?.spec;
54
+ const { legislationTypeUri, searchText } = this.activeDecoration.spec;
55
55
  if (legislationTypeUri !== this.documentLegislationType) {
56
56
  this.documentLegislationType = legislationTypeUri;
57
57
  }
@@ -159,7 +159,7 @@ export default class CitationCardComponent extends Component<Args> {
159
159
  selectLegislationType(type: string) {
160
160
  type = type.toLowerCase();
161
161
  const found = LEGISLATION_TYPE_CONCEPTS.find(
162
- (c) => c.label.toLowerCase() === type
162
+ (c) => c.label.toLowerCase() === type,
163
163
  );
164
164
  this.cardLegislationType = found
165
165
  ? found.value
@@ -205,10 +205,10 @@ export default class CitationCardComponent extends Component<Args> {
205
205
  .replaceRangeWith(
206
206
  from,
207
207
  to,
208
- citedText(this.controller.schema, title, uri)
208
+ citedText(this.controller.schema, title, uri),
209
209
  )
210
210
  .scrollIntoView(),
211
- { view: this.controller.mainEditorView }
211
+ { view: this.controller.mainEditorView },
212
212
  );
213
213
  this.controller.focus();
214
214
  }
@@ -227,10 +227,10 @@ export default class CitationCardComponent extends Component<Args> {
227
227
  .replaceRangeWith(
228
228
  from,
229
229
  to,
230
- citedText(this.controller.schema, title, uri)
230
+ citedText(this.controller.schema, title, uri),
231
231
  )
232
232
  .scrollIntoView(),
233
- { view: this.controller.mainEditorView }
233
+ { view: this.controller.mainEditorView },
234
234
  );
235
235
  }
236
236
 
@@ -49,7 +49,7 @@ export default class EditorPluginsCitationInsertComponent extends Component<Args
49
49
  selectLegislationType(type: string) {
50
50
  type = type.toLowerCase();
51
51
  const found = LEGISLATION_TYPE_CONCEPTS.find(
52
- (c) => c.label.toLowerCase() === type
52
+ (c) => c.label.toLowerCase() === type,
53
53
  );
54
54
  this.legislationType = found
55
55
  ? found.value
@@ -63,7 +63,7 @@ export default class EditorPluginsCitationInsertComponent extends Component<Args
63
63
  const { selection } = this.controller.mainEditorState;
64
64
  if (this.config.type === 'ranges') {
65
65
  const ranges = this.config.activeInRanges(
66
- this.controller.mainEditorState
66
+ this.controller.mainEditorState,
67
67
  );
68
68
  for (const range of ranges) {
69
69
  if (selection.from > range[0] && selection.from < range[1]) {
@@ -74,7 +74,7 @@ export default class EditorPluginsCitationInsertComponent extends Component<Args
74
74
  } else {
75
75
  const nodeTypes = this.config.activeInNodeTypes(
76
76
  this.controller.schema,
77
- this.controller.mainEditorState
77
+ this.controller.mainEditorState,
78
78
  );
79
79
  // if the doc node is included, the button should always be active
80
80
  // the findParentNodeOfType util we import does NOT consider the doc node
@@ -120,11 +120,11 @@ export default class EditorPluginsCitationInsertComponent extends Component<Args
120
120
  citedText(this.controller.schema, title, uri),
121
121
  ]),
122
122
  0,
123
- 0
124
- )
123
+ 0,
124
+ ),
125
125
  )
126
126
  .scrollIntoView(),
127
- { view: this.controller.mainEditorView }
127
+ { view: this.controller.mainEditorView },
128
128
  );
129
129
  }
130
130
 
@@ -143,7 +143,7 @@ export default class EditorPluginsCitationInsertComponent extends Component<Args
143
143
  this.controller.schema.text(`${type} `),
144
144
  citedText(this.controller.schema, title, uri),
145
145
  ]),
146
- { view: this.controller.mainEditorView }
146
+ { view: this.controller.mainEditorView },
147
147
  );
148
148
  }
149
149
  }
@@ -89,10 +89,10 @@ export default class EditorPluginsCitationsSearchModalComponent extends Componen
89
89
 
90
90
  get legislationSelected() {
91
91
  const found = LEGISLATION_TYPE_CONCEPTS.find(
92
- (c) => c.value === this.legislationTypeUri
92
+ (c) => c.value === this.legislationTypeUri,
93
93
  );
94
94
  return capitalize(
95
- found ? found.label : unwrap(LEGISLATION_TYPE_CONCEPTS[0]).label
95
+ found ? found.label : unwrap(LEGISLATION_TYPE_CONCEPTS[0]).label,
96
96
  );
97
97
  }
98
98
 
@@ -223,7 +223,7 @@ export default class EditorPluginsCitationsSearchModalComponent extends Componen
223
223
 
224
224
  function getLocalizedMonths(
225
225
  intl: IntlService,
226
- monthFormat: Intl.DateTimeFormatOptions['month'] = 'long'
226
+ monthFormat: Intl.DateTimeFormatOptions['month'] = 'long',
227
227
  ) {
228
228
  const someYear = 2021;
229
229
  return [...Array(12).keys()].map((monthIndex) => {
@@ -234,7 +234,7 @@ function getLocalizedMonths(
234
234
 
235
235
  function getLocalizedDays(
236
236
  intl: IntlService,
237
- weekdayFormat: Intl.DateTimeFormatOptions['weekday'] = 'long'
237
+ weekdayFormat: Intl.DateTimeFormatOptions['weekday'] = 'long',
238
238
  ) {
239
239
  const someSunday = new Date('2021-01-03');
240
240
  return [...Array(7).keys()].map((index) => {
@@ -16,12 +16,12 @@ export default class InsertTitleCardComponent extends Component<Args> {
16
16
  this.args.controller.doCommand(
17
17
  insertDocumentTitle({
18
18
  placeholder: this.intl.t(
19
- 'document-title-plugin.document-title-placeholder'
19
+ 'document-title-plugin.document-title-placeholder',
20
20
  ),
21
21
  }),
22
22
  {
23
23
  view: this.args.controller.mainEditorView,
24
- }
24
+ },
25
25
  );
26
26
  this.args.controller.focus();
27
27
  }
@@ -30,12 +30,12 @@ export default class InsertTitleCardComponent extends Component<Args> {
30
30
  return this.args.controller.checkCommand(
31
31
  insertDocumentTitle({
32
32
  placeholder: this.intl.t(
33
- 'document-title-plugin.document-title-placeholder'
33
+ 'document-title-plugin.document-title-placeholder',
34
34
  ),
35
35
  }),
36
36
  {
37
37
  view: this.args.controller.mainEditorView,
38
- }
38
+ },
39
39
  );
40
40
  }
41
41
  }
@@ -87,8 +87,8 @@ export default class GenericRdfaVariableInsertMenu extends Component<Args> {
87
87
  this.controller.withTransaction((tr) => {
88
88
  return tr.replaceSelectionWith(
89
89
  ProseParser.fromSchema(this.schema).parse(
90
- domParser.parseFromString(editorContent, 'text/html')
91
- )
90
+ domParser.parseFromString(editorContent, 'text/html'),
91
+ ),
92
92
  );
93
93
  });
94
94
 
@@ -20,7 +20,7 @@ export default class HoverTooltip extends Component<Args> {
20
20
  element.removeEventListener('blur', this.hideTooltip);
21
21
  };
22
22
  },
23
- { eager: false }
23
+ { eager: false },
24
24
  );
25
25
 
26
26
  @tracked tooltipOpen = false;
@@ -24,7 +24,7 @@ export default class ImportSnippetPluginCard extends Component<Args> {
24
24
  get insertRange() {
25
25
  const { selection } = this.controller.mainEditorState;
26
26
  const besluit = findParentNodeOfType(this.controller.schema.nodes.besluit)(
27
- selection
27
+ selection,
28
28
  );
29
29
  if (besluit) {
30
30
  return {
@@ -45,7 +45,7 @@ export default class ImportSnippetPluginCard extends Component<Args> {
45
45
  (tr) => {
46
46
  return tr.replaceRangeWith(insertRange.from, insertRange.to, node);
47
47
  },
48
- { view: this.controller.mainEditorView }
48
+ { view: this.controller.mainEditorView },
49
49
  );
50
50
  this.importRdfaSnippet.removeSnippet(snippet);
51
51
  } else {
@@ -57,7 +57,7 @@ export default class ImportSnippetPluginCard extends Component<Args> {
57
57
  generateSnippetHtml(snippet: RdfaSnippet, type: string) {
58
58
  const domParser = new DOMParser();
59
59
  const contentFragment = ProseParser.fromSchema(
60
- this.controller.schema
60
+ this.controller.schema,
61
61
  ).parse(domParser.parseFromString(snippet.content, 'text/html')).content;
62
62
  const { schema } = this.controller;
63
63
  if (type === 'attachment') {
@@ -83,11 +83,11 @@ export default class ImportSnippetPluginCard extends Component<Args> {
83
83
  schema.node(
84
84
  'block_rdfa',
85
85
  { property: 'http://www.w3.org/ns/prov#value' },
86
- contentFragment
86
+ contentFragment,
87
87
  ),
88
- ]
88
+ ],
89
89
  ),
90
- ]
90
+ ],
91
91
  );
92
92
  } else {
93
93
  return schema.node(
@@ -107,11 +107,11 @@ export default class ImportSnippetPluginCard extends Component<Args> {
107
107
  schema.node(
108
108
  'block_rdfa',
109
109
  { property: 'http://www.w3.org/ns/prov#value' },
110
- contentFragment
110
+ contentFragment,
111
111
  ),
112
- ]
112
+ ],
113
113
  ),
114
- ]
114
+ ],
115
115
  );
116
116
  }
117
117
  }
@@ -84,7 +84,7 @@ export default class RdfaDatePluginCardComponent extends Component<Args> {
84
84
  (node) => {
85
85
  return !formatContainsTime(node.attrs.format);
86
86
  },
87
- this.selectedDateNode
87
+ this.selectedDateNode,
88
88
  );
89
89
  }
90
90
 
@@ -95,14 +95,14 @@ export default class RdfaDatePluginCardComponent extends Component<Args> {
95
95
  const format = node.attrs.format as string;
96
96
  return SECONDS_REGEX.test(format.replace(/'[^']*'|"[^"]*"/g, ''));
97
97
  },
98
- this.selectedDateNode
98
+ this.selectedDateNode,
99
99
  );
100
100
  }
101
101
 
102
102
  get documentDateFormat(): Option<string> {
103
103
  return optionMap(
104
104
  (node) => node.attrs.format as string,
105
- this.selectedDateNode
105
+ this.selectedDateNode,
106
106
  );
107
107
  }
108
108
 
@@ -110,11 +110,11 @@ export default class RdfaDatePluginCardComponent extends Component<Args> {
110
110
  if (this.documentDateFormat) {
111
111
  if (this.onlyDate) {
112
112
  return this.formats.find(
113
- (format) => format.dateFormat === this.documentDateFormat
113
+ (format) => format.dateFormat === this.documentDateFormat,
114
114
  );
115
115
  } else {
116
116
  return this.formats.find(
117
- (format) => format.dateTimeFormat === this.documentDateFormat
117
+ (format) => format.dateTimeFormat === this.documentDateFormat,
118
118
  );
119
119
  }
120
120
  }
@@ -223,7 +223,7 @@ export default class RdfaDatePluginCardComponent extends Component<Args> {
223
223
  if (format) {
224
224
  this.setDateFormat(
225
225
  this.onlyDate ? format.dateFormat : format.dateTimeFormat,
226
- false
226
+ false,
227
227
  );
228
228
  }
229
229
  }