@lblod/ember-rdfa-editor-lblod-plugins 10.0.0 → 11.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 (73) hide show
  1. package/CHANGELOG.md +25 -1
  2. package/README.md +62 -24
  3. package/addon/components/snippet-plugin/search-modal.ts +4 -0
  4. package/addon/components/snippet-plugin/snippet-insert.hbs +1 -0
  5. package/addon/components/snippet-plugin/snippet-insert.ts +1 -0
  6. package/addon/components/snippet-plugin/snippet-list/snippet-list-modal.hbs +80 -0
  7. package/addon/components/snippet-plugin/snippet-list/snippet-list-modal.ts +98 -0
  8. package/addon/components/snippet-plugin/snippet-list/snippet-list-view.hbs +29 -0
  9. package/addon/components/snippet-plugin/snippet-list/snippet-list-view.ts +28 -0
  10. package/addon/components/snippet-plugin/snippet-list-select.hbs +16 -0
  11. package/addon/components/snippet-plugin/snippet-list-select.ts +27 -0
  12. package/addon/components/table-of-contents-plugin/ember-nodes/table-of-contents.hbs +1 -1
  13. package/addon/components/table-of-contents-plugin/ember-nodes/table-of-contents.ts +16 -55
  14. package/addon/components/variable-plugin/address/edit.hbs +35 -0
  15. package/addon/components/variable-plugin/address/edit.ts +96 -0
  16. package/addon/components/variable-plugin/address/insert.hbs +9 -0
  17. package/addon/components/variable-plugin/address/insert.ts +37 -0
  18. package/addon/components/variable-plugin/address/nodeview.hbs +19 -0
  19. package/addon/components/variable-plugin/address/nodeview.ts +31 -0
  20. package/addon/components/variable-plugin/number/insert.hbs +8 -6
  21. package/addon/components/variable-plugin/number/insert.ts +10 -0
  22. package/addon/components/variable-plugin/number/nodeview.hbs +2 -2
  23. package/addon/components/variable-plugin/utils/label-input.hbs +3 -3
  24. package/addon/helpers/in-array.ts +13 -0
  25. package/addon/plugins/snippet-plugin/index.ts +20 -0
  26. package/addon/plugins/snippet-plugin/utils/fetch-data.ts +117 -9
  27. package/addon/plugins/table-of-contents-plugin/nodes/table-of-contents.ts +23 -17
  28. package/addon/plugins/table-of-contents-plugin/utils/index.ts +1 -1
  29. package/addon/plugins/variable-plugin/utils/address-helpers.ts +112 -0
  30. package/addon/plugins/variable-plugin/variables/address.ts +322 -0
  31. package/addon/plugins/variable-plugin/variables/index.ts +1 -0
  32. package/addon/plugins/variable-plugin/variables/text.ts +1 -1
  33. package/addon/utils/constants.ts +7 -0
  34. package/addon/utils/namespace.ts +11 -0
  35. package/app/components/snippet-plugin/snippet-list/snippet-list-modal.js +1 -0
  36. package/app/components/snippet-plugin/snippet-list/snippet-list-view.js +1 -0
  37. package/app/components/snippet-plugin/snippet-list-select.js +1 -0
  38. package/app/components/{address-plugin/insert.js → variable-plugin/address/edit.js} +1 -1
  39. package/app/components/variable-plugin/address/insert.js +1 -0
  40. package/app/components/variable-plugin/address/nodeview.js +1 -0
  41. package/app/helpers/in-array.js +4 -0
  42. package/app/styles/snippet-plugin.scss +11 -0
  43. package/components/snippet-plugin/search-modal.d.ts +1 -0
  44. package/components/snippet-plugin/snippet-insert.d.ts +1 -0
  45. package/components/snippet-plugin/snippet-list/snippet-list-modal.d.ts +23 -0
  46. package/components/snippet-plugin/snippet-list/snippet-list-view.d.ts +10 -0
  47. package/components/snippet-plugin/snippet-list-select.d.ts +14 -0
  48. package/components/table-of-contents-plugin/ember-nodes/table-of-contents.d.ts +5 -12
  49. package/components/variable-plugin/address/edit.d.ts +23 -0
  50. package/components/variable-plugin/address/insert.d.ts +11 -0
  51. package/components/variable-plugin/address/nodeview.d.ts +14 -0
  52. package/components/variable-plugin/number/insert.d.ts +2 -0
  53. package/helpers/in-array.d.ts +9 -0
  54. package/package.json +4 -4
  55. package/plugins/snippet-plugin/index.d.ts +11 -0
  56. package/plugins/snippet-plugin/utils/fetch-data.d.ts +10 -1
  57. package/plugins/table-of-contents-plugin/utils/index.d.ts +1 -1
  58. package/plugins/variable-plugin/utils/address-helpers.d.ts +4 -0
  59. package/plugins/variable-plugin/variables/address.d.ts +23 -0
  60. package/plugins/variable-plugin/variables/index.d.ts +1 -0
  61. package/plugins/variable-plugin/variables/text.d.ts +0 -2
  62. package/translations/en-US.yaml +29 -3
  63. package/translations/nl-BE.yaml +28 -2
  64. package/types/global.d.ts +7 -0
  65. package/utils/constants.d.ts +3 -0
  66. package/utils/namespace.d.ts +1 -0
  67. package/addon/components/address-plugin/insert.hbs +0 -47
  68. package/addon/components/address-plugin/insert.ts +0 -100
  69. package/addon/components/address-plugin/types.ts +0 -26
  70. package/addon/components/address-plugin/utils.ts +0 -59
  71. package/components/address-plugin/insert.d.ts +0 -21
  72. package/components/address-plugin/types.d.ts +0 -25
  73. package/components/address-plugin/utils.d.ts +0 -9
@@ -0,0 +1,112 @@
1
+ import { Address, ResolvedAddress } from '../variables/address';
2
+
3
+ type LocationRegisterResult = {
4
+ LocationResult: {
5
+ ID: number;
6
+ FormattedAddress: string;
7
+ Municipality: string;
8
+ Thoroughfarename: string; // street
9
+ Housenumber?: string | null;
10
+ Zipcode: string;
11
+ Location: {
12
+ Lat_WGS84: number;
13
+ Lon_WGS84: number;
14
+ X_Lambert72: number;
15
+ Y_Lambert72: number;
16
+ };
17
+ }[];
18
+ };
19
+
20
+ type AddressRegisterResult = {
21
+ adressen: {
22
+ identificator: {
23
+ id: string;
24
+ naamruimte: string;
25
+ objectId: string;
26
+ versieId: string;
27
+ };
28
+ detail: string;
29
+ huisnummer: string;
30
+ volledigAdres: {
31
+ geografischeNaam: {
32
+ spelling: string;
33
+ taal: string;
34
+ };
35
+ };
36
+ adresStatus: string;
37
+ }[];
38
+ };
39
+
40
+ const LOC_GEOPUNT_ENDPOINT = `https://geo.api.vlaanderen.be/geolocation/v4/Location`;
41
+ const BASISREGISTER_ADRESMATCH = `https://basisregisters.vlaanderen.be/api/v1/adressen`;
42
+
43
+ export const replaceAccents = (string: string) =>
44
+ string.normalize('NFD').replace(/([\u0300-\u036f])/g, '');
45
+
46
+ export async function fetchAddresses(
47
+ query: string,
48
+ includeHousenumber = true,
49
+ ): Promise<Address[]> {
50
+ const url = new URL(LOC_GEOPUNT_ENDPOINT);
51
+ url.searchParams.append('q', replaceAccents(query.replace(/^"(.*)"$/, '$1')));
52
+ url.searchParams.append('c', '10');
53
+ url.searchParams.append(
54
+ 'type',
55
+ includeHousenumber ? 'Housenumber' : 'Thoroughfarename',
56
+ );
57
+ const result = await fetch(url, {
58
+ method: 'GET',
59
+ });
60
+
61
+ if (result.ok) {
62
+ const jsonResult = (await result.json()) as LocationRegisterResult;
63
+ const addresses = jsonResult.LocationResult.map(
64
+ (entry) =>
65
+ new Address({
66
+ street: entry.Thoroughfarename,
67
+ housenumber: entry.Housenumber,
68
+ zipcode: entry.Zipcode,
69
+ municipality: entry.Municipality,
70
+ location: {
71
+ lat_WGS84: entry.Location.Lat_WGS84,
72
+ long_WGS84: entry.Location.Lon_WGS84,
73
+ },
74
+ }),
75
+ );
76
+ return addresses;
77
+ } else {
78
+ throw new Error(
79
+ 'An error occured when querying the location register, status code: ${response.status}',
80
+ );
81
+ }
82
+ }
83
+
84
+ export async function resolveAddress(
85
+ address: Address,
86
+ ): Promise<ResolvedAddress> {
87
+ const url = new URL(BASISREGISTER_ADRESMATCH);
88
+
89
+ url.searchParams.append('GemeenteNaam', replaceAccents(address.municipality));
90
+ url.searchParams.append('Straatnaam', replaceAccents(address.street));
91
+ if (address.housenumber) {
92
+ url.searchParams.append('Huisnummer', replaceAccents(address.housenumber));
93
+ }
94
+ url.searchParams.append('Postcode', replaceAccents(address.zipcode));
95
+
96
+ const response = await fetch(url.toString(), {
97
+ method: 'GET',
98
+ });
99
+ if (response.ok) {
100
+ const result = (await response.json()) as AddressRegisterResult;
101
+ if (result.adressen.length) {
102
+ const addressRegisterId = result.adressen[0].identificator.id;
103
+ return ResolvedAddress.resolve(address, addressRegisterId);
104
+ } else {
105
+ throw new Error('Could not find address in address register');
106
+ }
107
+ } else {
108
+ throw new Error(
109
+ `An error occured when querying the address register, status code: ${response.status}`,
110
+ );
111
+ }
112
+ }
@@ -0,0 +1,322 @@
1
+ import {
2
+ ADRES,
3
+ EXT,
4
+ GEO,
5
+ } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/constants';
6
+ import {
7
+ createEmberNodeSpec,
8
+ createEmberNodeView,
9
+ EmberNodeConfig,
10
+ } from '@lblod/ember-rdfa-editor/utils/ember-node';
11
+ import { v4 as uuidv4 } from 'uuid';
12
+ import { DOMOutputSpec, PNode } from '@lblod/ember-rdfa-editor';
13
+ import {
14
+ isVariable,
15
+ parseLabel,
16
+ parseVariableInstance,
17
+ parseVariableType,
18
+ } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/variable-plugin/utils/attribute-parsers';
19
+ import {
20
+ findChildWithRdfaAttribute,
21
+ hasRDFaAttribute,
22
+ } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/namespace';
23
+ import { span } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/dom-output-spec-helpers';
24
+ import {
25
+ contentSpan,
26
+ instanceSpan,
27
+ mappingSpan,
28
+ typeSpan,
29
+ } from '../utils/dom-constructors';
30
+
31
+ type Location = {
32
+ lat_WGS84: number;
33
+ long_WGS84: number;
34
+ };
35
+ export class Address {
36
+ declare street: string;
37
+ declare zipcode: string;
38
+ declare municipality: string;
39
+ declare location: Location;
40
+ housenumber?: string | null;
41
+ constructor(
42
+ args: Pick<
43
+ Address,
44
+ 'street' | 'housenumber' | 'zipcode' | 'municipality' | 'location'
45
+ >,
46
+ ) {
47
+ Object.assign(this, args);
48
+ }
49
+
50
+ get formatted() {
51
+ const firstPart = this.housenumber
52
+ ? `${this.street} ${this.housenumber}`
53
+ : this.street;
54
+ const secondPart = `${this.zipcode} ${this.municipality}`;
55
+ return `${firstPart}, ${secondPart}`;
56
+ }
57
+
58
+ sameAs(other?: Address | null) {
59
+ if (other) {
60
+ return (
61
+ this.street === other.street &&
62
+ this.housenumber === other.housenumber &&
63
+ this.zipcode === other.zipcode &&
64
+ this.municipality === other.municipality &&
65
+ this.location.lat_WGS84 === other.location.lat_WGS84 &&
66
+ this.location.long_WGS84 === other.location.long_WGS84
67
+ );
68
+ } else {
69
+ return false;
70
+ }
71
+ }
72
+
73
+ get hasHouseNumber() {
74
+ return !!this.housenumber;
75
+ }
76
+ }
77
+
78
+ export class ResolvedAddress extends Address {
79
+ addressRegisterId: string;
80
+
81
+ constructor(
82
+ args: Pick<
83
+ ResolvedAddress,
84
+ | 'street'
85
+ | 'housenumber'
86
+ | 'zipcode'
87
+ | 'municipality'
88
+ | 'addressRegisterId'
89
+ | 'location'
90
+ >,
91
+ ) {
92
+ super(args);
93
+ this.addressRegisterId = args.addressRegisterId;
94
+ }
95
+
96
+ static resolve(address: Address, addressRegisterId: string) {
97
+ return new ResolvedAddress({
98
+ addressRegisterId,
99
+ ...address,
100
+ });
101
+ }
102
+ }
103
+
104
+ const constructLocationNode = (location: Location) => {
105
+ return span(
106
+ {
107
+ property: ADRES('positie').full,
108
+ typeof: GEO('Point').full,
109
+ },
110
+ span({
111
+ property: GEO('lat').full,
112
+ content: location.lat_WGS84.toString(),
113
+ }),
114
+ span({
115
+ property: GEO('long').full,
116
+ content: location.long_WGS84.toString(),
117
+ }),
118
+ );
119
+ };
120
+
121
+ const constructAddressNode = (address?: Address | ResolvedAddress) => {
122
+ if (address) {
123
+ const resource =
124
+ 'addressRegisterId' in address ? address.addressRegisterId : undefined;
125
+ const houseNumberSpan = address.housenumber
126
+ ? span(
127
+ {
128
+ property: ADRES('huisnummer').full,
129
+ },
130
+ address.housenumber,
131
+ )
132
+ : '';
133
+ return contentSpan(
134
+ { resource, typeof: ADRES('Adres').full },
135
+ span(
136
+ {
137
+ property: ADRES('heeftStraatnaam').full,
138
+ },
139
+ address.street,
140
+ ),
141
+ address.housenumber ? ' ' : '', //if there is still a housenumber coming after the street, insert a space.
142
+ houseNumberSpan,
143
+ ', ',
144
+ span(
145
+ {
146
+ property: ADRES('heeftPostinfo').full,
147
+ typeof: ADRES('Postinfo').full,
148
+ },
149
+ span(
150
+ {
151
+ property: ADRES('postcode').full,
152
+ },
153
+ address.zipcode,
154
+ ),
155
+ ),
156
+ ' ',
157
+ span(
158
+ {
159
+ property: ADRES('gemeentenaam').full,
160
+ },
161
+ address.municipality,
162
+ ),
163
+ constructLocationNode(address.location),
164
+ );
165
+ } else {
166
+ return contentSpan({}, 'Voeg adres in');
167
+ }
168
+ };
169
+
170
+ const parseLocationNode = (locationNode: Element): Location | undefined => {
171
+ const lat_WGS84 = findChildWithRdfaAttribute(
172
+ locationNode,
173
+ 'property',
174
+ GEO('lat'),
175
+ )?.getAttribute('content');
176
+ const long_WGS84 = findChildWithRdfaAttribute(
177
+ locationNode,
178
+ 'property',
179
+ GEO('long'),
180
+ )?.getAttribute('content');
181
+ if (lat_WGS84 && long_WGS84) {
182
+ const lat_WGS84_number = parseFloat(lat_WGS84);
183
+ const long_WGS84_number = parseFloat(long_WGS84);
184
+ if (!isNaN(lat_WGS84_number) && !isNaN(long_WGS84_number)) {
185
+ return {
186
+ lat_WGS84: lat_WGS84_number,
187
+ long_WGS84: long_WGS84_number,
188
+ };
189
+ }
190
+ }
191
+ return;
192
+ };
193
+
194
+ const parseAddressNode = (addressNode: Element): Address | undefined => {
195
+ const addressRegisterId = addressNode.getAttribute('resource');
196
+ const street = findChildWithRdfaAttribute(
197
+ addressNode,
198
+ 'property',
199
+ ADRES('heeftStraatnaam'),
200
+ )?.textContent;
201
+ const housenumber = findChildWithRdfaAttribute(
202
+ addressNode,
203
+ 'property',
204
+ ADRES('huisnummer'),
205
+ )?.textContent;
206
+ const postInfoNode = findChildWithRdfaAttribute(
207
+ addressNode,
208
+ 'property',
209
+ ADRES('heeftPostinfo'),
210
+ );
211
+ const zipcode = postInfoNode
212
+ ? findChildWithRdfaAttribute(postInfoNode, 'property', ADRES('postcode'))
213
+ ?.textContent
214
+ : null;
215
+ const municipality = findChildWithRdfaAttribute(
216
+ addressNode,
217
+ 'property',
218
+ ADRES('gemeentenaam'),
219
+ )?.textContent;
220
+ const locationNode = findChildWithRdfaAttribute(
221
+ addressNode,
222
+ 'property',
223
+ ADRES('positie'),
224
+ );
225
+ const location = locationNode && parseLocationNode(locationNode);
226
+ if (street && zipcode && municipality && location) {
227
+ if (addressRegisterId) {
228
+ return new ResolvedAddress({
229
+ addressRegisterId,
230
+ street,
231
+ housenumber,
232
+ zipcode,
233
+ municipality,
234
+ location,
235
+ });
236
+ } else {
237
+ return new Address({
238
+ street,
239
+ housenumber,
240
+ zipcode,
241
+ municipality,
242
+ location,
243
+ });
244
+ }
245
+ } else {
246
+ return;
247
+ }
248
+ };
249
+
250
+ const parseDOM = [
251
+ {
252
+ tag: 'span',
253
+ getAttrs: (node: HTMLElement) => {
254
+ if (isVariable(node) && parseVariableType(node) === 'address') {
255
+ const mappingResource = node.getAttribute('resource');
256
+ if (!mappingResource) {
257
+ return false;
258
+ }
259
+ const variableInstance = parseVariableInstance(node);
260
+ const label = parseLabel(node);
261
+
262
+ const addressNode = [...node.children].find((el) =>
263
+ hasRDFaAttribute(el, 'property', EXT('content')),
264
+ );
265
+ if (!addressNode) {
266
+ return false;
267
+ }
268
+
269
+ return {
270
+ variableInstance:
271
+ variableInstance ?? `http://data.lblod.info/variables/${uuidv4()}`,
272
+ mappingResource,
273
+ label,
274
+ address: parseAddressNode(addressNode),
275
+ };
276
+ }
277
+
278
+ return false;
279
+ },
280
+ },
281
+ ];
282
+
283
+ const toDOM = (node: PNode): DOMOutputSpec => {
284
+ const { mappingResource, variableInstance, label, address } = node.attrs;
285
+ return mappingSpan(
286
+ mappingResource,
287
+ {
288
+ 'data-label': label as string,
289
+ },
290
+ instanceSpan(variableInstance),
291
+ typeSpan('address'),
292
+ constructAddressNode(address),
293
+ );
294
+ };
295
+
296
+ const emberNodeConfig: EmberNodeConfig = {
297
+ name: 'address',
298
+ componentPath: 'variable-plugin/address/nodeview',
299
+ inline: true,
300
+ group: 'inline variable',
301
+ content: 'inline*',
302
+ atom: true,
303
+ recreateUri: true,
304
+ uriAttributes: ['variableInstance'],
305
+ draggable: false,
306
+ needsFFKludge: true,
307
+ attrs: {
308
+ mappingResource: {},
309
+ variableInstance: {},
310
+ label: {
311
+ default: 'adres',
312
+ },
313
+ address: {
314
+ default: null,
315
+ },
316
+ },
317
+ toDOM,
318
+ parseDOM,
319
+ };
320
+
321
+ export const address = createEmberNodeSpec(emberNodeConfig);
322
+ export const addressView = createEmberNodeView(emberNodeConfig);
@@ -2,3 +2,4 @@ export * from './number';
2
2
  export * from './text';
3
3
  export * from './codelist';
4
4
  export * from './location';
5
+ export * from './address';
@@ -64,7 +64,7 @@ const toDOM = (node: PNode): DOMOutputSpec => {
64
64
  );
65
65
  };
66
66
 
67
- export const emberNodeConfig: EmberNodeConfig = {
67
+ const emberNodeConfig: EmberNodeConfig = {
68
68
  name: 'text-variable',
69
69
  componentPath: 'variable-plugin/variable/nodeview',
70
70
  inline: true,
@@ -20,3 +20,10 @@ export const MOBILITEIT = namespace(
20
20
  'https://data.vlaanderen.be/ns/mobiliteit#',
21
21
  'mobiliteit',
22
22
  );
23
+
24
+ export const ADRES = namespace('https://data.vlaanderen.be/ns/adres/', 'adres');
25
+ export const GENERIEK = namespace(
26
+ 'https://data.vlaanderen.be/ns/generiek/#',
27
+ 'generiek',
28
+ );
29
+ export const GEO = namespace('http://www.w3.org/2003/01/geo/wgs84_pos#', 'geo');
@@ -32,6 +32,17 @@ export function hasRDFaAttribute(
32
32
  return false;
33
33
  }
34
34
 
35
+ export function findChildWithRdfaAttribute(
36
+ element: Element,
37
+ attr: string,
38
+ value: Resource,
39
+ ) {
40
+ return [...element.children].find((child) => {
41
+ const result = child.getAttribute(attr)?.split(' ');
42
+ return result?.includes(value.full) || result?.includes(value.prefixed);
43
+ });
44
+ }
45
+
35
46
  export function pnodeHasRdfaAttribute(
36
47
  node: PNode,
37
48
  attr: string,
@@ -0,0 +1 @@
1
+ export { default } from '@lblod/ember-rdfa-editor-lblod-plugins/components/snippet-plugin/snippet-list/snippet-list-modal';
@@ -0,0 +1 @@
1
+ export { default } from '@lblod/ember-rdfa-editor-lblod-plugins/components/snippet-plugin/snippet-list/snippet-list-view';
@@ -0,0 +1 @@
1
+ export { default } from '@lblod/ember-rdfa-editor-lblod-plugins/components/snippet-plugin/snippet-list-select';
@@ -1 +1 @@
1
- export { default } from '@lblod/ember-rdfa-editor-lblod-plugins/components/address-plugin/insert';
1
+ export { default } from '@lblod/ember-rdfa-editor-lblod-plugins/components/variable-plugin/address/edit';
@@ -0,0 +1 @@
1
+ export { default } from '@lblod/ember-rdfa-editor-lblod-plugins/components/variable-plugin/address/insert';
@@ -0,0 +1 @@
1
+ export { default } from '@lblod/ember-rdfa-editor-lblod-plugins/components/variable-plugin/address/nodeview';
@@ -0,0 +1,4 @@
1
+ export {
2
+ default,
3
+ inArray,
4
+ } from '@lblod/ember-rdfa-editor-lblod-plugins/helpers/in-array';
@@ -70,3 +70,14 @@
70
70
  position: relative;
71
71
  }
72
72
  }
73
+
74
+ .snippet-lists-table {
75
+ .au-c-table-wrapper {
76
+ margin-top: 20px;
77
+ margin-right: 100px;
78
+
79
+ .selectColumn {
80
+ width: 200px;
81
+ }
82
+ }
83
+ }
@@ -2,6 +2,7 @@ import Component from '@glimmer/component';
2
2
  import { SnippetPluginConfig } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/snippet-plugin';
3
3
  interface Args {
4
4
  config: SnippetPluginConfig;
5
+ assignedSnippetListsIds: string[];
5
6
  closeModal: () => void;
6
7
  }
7
8
  export default class SnippetPluginSearchModalComponent extends Component<Args> {
@@ -4,6 +4,7 @@ import { SnippetPluginConfig } from '@lblod/ember-rdfa-editor-lblod-plugins/plug
4
4
  interface Args {
5
5
  controller: SayController;
6
6
  config: SnippetPluginConfig;
7
+ assignedSnippetListsIds: string[];
7
8
  }
8
9
  export default class SnippetInsertComponent extends Component<Args> {
9
10
  showModal: boolean;
@@ -0,0 +1,23 @@
1
+ import Component from '@glimmer/component';
2
+ import { Task } from 'ember-concurrency';
3
+ import { SnippetPluginConfig, SnippetList } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/snippet-plugin';
4
+ interface Args {
5
+ config: SnippetPluginConfig;
6
+ onSaveSnippetListIds: Task<Promise<void>, [snippetIds: string[]]>;
7
+ assignedSnippetListsIds: string[];
8
+ closeModal: () => void;
9
+ }
10
+ export default class SnippetListModalComponent extends Component<Args> {
11
+ inputSearchText: string | null;
12
+ error: unknown;
13
+ assignedSnippetListsIds: string[];
14
+ get config(): SnippetPluginConfig;
15
+ get searchText(): string | null;
16
+ setInputSearchText(event: InputEvent): void;
17
+ closeModal(): void;
18
+ saveAndClose(): Promise<void>;
19
+ snippetListSearch: import("ember-concurrency").TaskForAsyncTaskFunction<unknown, () => Promise<SnippetList[]>>;
20
+ snippetListResource: import("ember-resources/util/ember-concurrency").TaskInstance<SnippetList[]>;
21
+ onChange(assignedSnippetListsIds: string[]): void;
22
+ }
23
+ export {};
@@ -0,0 +1,10 @@
1
+ import Component from '@glimmer/component';
2
+ interface Args {
3
+ assignedSnippetListsIds: string[];
4
+ onChange: (assignedSnippetListsIds: string[]) => void;
5
+ closeModal: () => void;
6
+ }
7
+ export default class SnippetListViewComponent extends Component<Args> {
8
+ onChange(snippetId: string, isSelected: boolean): void;
9
+ }
10
+ export {};
@@ -0,0 +1,14 @@
1
+ import { Task } from 'ember-concurrency';
2
+ import Component from '@glimmer/component';
3
+ import { SnippetPluginConfig } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/snippet-plugin';
4
+ interface Args {
5
+ config: SnippetPluginConfig;
6
+ assignedSnippetListsIds: string[];
7
+ onSaveSnippetListIds: Task<Promise<void>, [snippetIds: string[]]>;
8
+ }
9
+ export default class SnippetListSelectComponent extends Component<Args> {
10
+ showModal: boolean;
11
+ openModal(): void;
12
+ closeModal(): void;
13
+ }
14
+ export {};
@@ -1,24 +1,17 @@
1
1
  import Component from '@glimmer/component';
2
- import { PNode } from '@lblod/ember-rdfa-editor';
3
2
  import { EmberNodeArgs } from '@lblod/ember-rdfa-editor/utils/ember-node';
4
3
  import { TableOfContentsConfig } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/table-of-contents-plugin';
5
- type OutlineEntry = {
6
- content: string;
7
- pos: number;
8
- children?: OutlineEntry[];
9
- };
4
+ import IntlService from 'ember-intl/services/intl';
10
5
  export default class TableOfContentsComponent extends Component<EmberNodeArgs> {
6
+ intl: IntlService;
11
7
  get config(): TableOfContentsConfig;
8
+ get documentLanguage(): string;
9
+ get title(): string;
12
10
  get controller(): import("@lblod/ember-rdfa-editor").SayController;
13
11
  get outline(): {
14
- entries: OutlineEntry[];
12
+ entries: import("@lblod/ember-rdfa-editor-lblod-plugins/plugins/table-of-contents-plugin/utils").OutlineEntry[];
15
13
  };
16
- extractOutline({ node, pos }: {
17
- node: PNode;
18
- pos: number;
19
- }): OutlineEntry[];
20
14
  moveToPosition(pos: number): void;
21
15
  getScrollContainer(): HTMLElement | undefined;
22
16
  isScrollable(element: HTMLElement): boolean;
23
17
  }
24
- export {};
@@ -0,0 +1,23 @@
1
+ import Component from '@glimmer/component';
2
+ import { SayController } from '@lblod/ember-rdfa-editor';
3
+ import { Address } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/variable-plugin/variables';
4
+ type Args = {
5
+ controller: SayController;
6
+ };
7
+ export default class AddressEditComponent extends Component<Args> {
8
+ selectedAddress?: Address;
9
+ includeHouseNumber: boolean;
10
+ toggleIncludeHouseNumber(): void;
11
+ get currentAddress(): Address | null | undefined;
12
+ get selectedAddressVariable(): {
13
+ node: import("prosemirror-model").Node;
14
+ pos: number;
15
+ } | undefined;
16
+ get showCard(): boolean;
17
+ get canUpdate(): boolean;
18
+ updateAddressVariable: import("ember-concurrency").TaskForAsyncTaskFunction<unknown, () => Promise<void>>;
19
+ selectAddress(address: Address): void;
20
+ get controller(): SayController;
21
+ searchAddress: import("ember-concurrency").TaskForAsyncTaskFunction<unknown, (term: string) => Promise<Address[]>>;
22
+ }
23
+ export {};
@@ -0,0 +1,11 @@
1
+ import Component from '@glimmer/component';
2
+ import { SayController } from '@lblod/ember-rdfa-editor';
3
+ type Args = {
4
+ controller: SayController;
5
+ };
6
+ export default class InsertAddressComponent extends Component<Args> {
7
+ get controller(): SayController;
8
+ get schema(): import("prosemirror-model").Schema<any, any>;
9
+ insertAddress(): void;
10
+ }
11
+ export {};
@@ -0,0 +1,14 @@
1
+ import Component from '@glimmer/component';
2
+ import { PNode, SayController } from '@lblod/ember-rdfa-editor';
3
+ import { Address } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/variable-plugin/variables/address';
4
+ type Args = {
5
+ getPos: () => number | undefined;
6
+ node: PNode;
7
+ controller: SayController;
8
+ };
9
+ export default class AddressNodeviewComponent extends Component<Args> {
10
+ get node(): PNode;
11
+ get address(): Address | null;
12
+ selectThisNode(): void;
13
+ }
14
+ export {};
@@ -13,6 +13,8 @@ export default class NumberInsertComponent extends Component<Args> {
13
13
  get schema(): import("prosemirror-model").Schema<any, any>;
14
14
  get numberVariableError(): string;
15
15
  updateLabel(event: InputEvent): void;
16
+ updateMinimumValue(event: InputEvent): void;
17
+ updateMaximumValue(event: InputEvent): void;
16
18
  insert(): void;
17
19
  }
18
20
  export {};