@lblod/ember-rdfa-editor-lblod-plugins 0.4.1 → 1.0.0-alpha.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.
- package/CHANGELOG.md +25 -0
- package/addon/commands/article-structure-plugin/delete-structure.ts +85 -0
- package/addon/commands/article-structure-plugin/index.ts +4 -0
- package/addon/commands/article-structure-plugin/insert-article-structure.ts +137 -0
- package/addon/commands/article-structure-plugin/move-structure.ts +227 -0
- package/addon/commands/article-structure-plugin/recalculate-structure-numbers.ts +88 -0
- package/addon/commands/besluit-plugin/get-article-nodes-for-besluit.ts +30 -0
- package/addon/commands/besluit-plugin/index.ts +4 -0
- package/addon/commands/besluit-plugin/insert-article.ts +94 -0
- package/addon/commands/besluit-plugin/insert-title.ts +67 -0
- package/addon/commands/besluit-plugin/move-article.ts +69 -0
- package/addon/commands/besluit-plugin/recalculate-article-numbers.ts +44 -0
- package/addon/commands/modify-date-command.ts +48 -0
- package/addon/components/article-structure-plugin/article-structure-card.hbs +14 -0
- package/addon/components/article-structure-plugin/article-structure-card.ts +83 -0
- package/addon/components/article-structure-plugin/structure-card.hbs +42 -0
- package/addon/components/article-structure-plugin/structure-card.ts +140 -0
- package/addon/components/au-native-input.hbs +30 -0
- package/addon/components/au-native-input.ts +47 -0
- package/addon/components/besluit-plugin/besluit-context-card.hbs +44 -0
- package/addon/components/besluit-plugin/besluit-context-card.ts +144 -0
- package/addon/components/besluit-plugin/besluit-plugin-card.hbs +20 -0
- package/addon/components/besluit-plugin/besluit-plugin-card.ts +42 -0
- package/addon/components/besluit-type-plugin/{besluit-type-select.js → besluit-type-select.ts} +9 -4
- package/addon/components/besluit-type-plugin/toolbar-dropdown.hbs +2 -0
- package/addon/components/besluit-type-plugin/toolbar-dropdown.ts +216 -0
- package/addon/components/citation-plugin/citation-card.hbs +118 -0
- package/addon/components/citation-plugin/citation-card.ts +230 -0
- package/addon/components/citation-plugin/citation-insert.hbs +20 -0
- package/addon/components/citation-plugin/citation-insert.ts +102 -0
- package/addon/components/{citaten-plugin → citation-plugin}/citations/article-list.hbs +2 -2
- package/addon/components/{citaten-plugin → citation-plugin}/citations/article-preview.hbs +0 -0
- package/addon/components/{citaten-plugin → citation-plugin}/citations/decision-detail.hbs +9 -6
- package/addon/components/{citaten-plugin/citations/decision-detail.js → citation-plugin/citations/decision-detail.ts} +30 -31
- package/addon/components/{citaten-plugin → citation-plugin}/citations/decision-list.hbs +2 -2
- package/addon/components/{citaten-plugin → citation-plugin}/citations/decision-preview.hbs +0 -0
- package/addon/components/citation-plugin/citations/search-modal.hbs +254 -0
- package/addon/components/{citaten-plugin/citations/search-modal.js → citation-plugin/citations/search-modal.ts} +116 -89
- package/addon/components/{citaten-plugin → citation-plugin}/helpers/alert-load-error.hbs +0 -0
- package/addon/components/{citaten-plugin → citation-plugin}/helpers/alert-no-items.hbs +0 -0
- package/addon/components/import-snippet-plugin/card.ts +119 -0
- package/addon/components/insert-variable-plugin/insert-variable-card.hbs +2 -1
- package/addon/components/insert-variable-plugin/insert-variable-card.ts +134 -0
- package/addon/components/rdfa-date-plugin/{rdfa-date-plugin-card.hbs → card.hbs} +3 -1
- package/addon/components/rdfa-date-plugin/card.ts +72 -0
- package/addon/components/rdfa-date-plugin/{rdfa-date-time-picker.hbs → date-time-picker.hbs} +0 -0
- package/addon/components/rdfa-date-plugin/{rdfa-date-time-picker.js → date-time-picker.ts} +26 -12
- package/addon/components/rdfa-date-plugin/{rdfa-date-plugin-insert.hbs → insert.hbs} +0 -0
- package/addon/components/rdfa-date-plugin/insert.ts +44 -0
- package/addon/components/roadsign-regulation-plugin/expanded-measure.ts +58 -0
- package/addon/components/roadsign-regulation-plugin/measure-template.ts +35 -0
- package/addon/components/roadsign-regulation-plugin/roadsign-regulation-card.hbs +2 -2
- package/addon/components/roadsign-regulation-plugin/roadsign-regulation-card.ts +60 -0
- package/addon/components/roadsign-regulation-plugin/{roadsigns-modal.js → roadsigns-modal.ts} +101 -64
- package/addon/components/roadsign-regulation-plugin/{roadsigns-pagination.js → roadsigns-pagination.ts} +7 -3
- package/addon/components/roadsign-regulation-plugin/roadsigns-table.ts +32 -0
- package/addon/components/standard-template-plugin/{template-card.hbs → card.hbs} +0 -0
- package/addon/components/standard-template-plugin/card.ts +11 -0
- package/addon/components/standard-template-plugin/template-provider.hbs +3 -1
- package/addon/components/standard-template-plugin/template-provider.ts +75 -0
- package/addon/components/table-of-contents-plugin/card.hbs +12 -1
- package/addon/components/table-of-contents-plugin/card.ts +60 -0
- package/addon/components/table-of-contents-plugin/{inline-components → ember-nodes}/outline.hbs +2 -2
- package/addon/components/table-of-contents-plugin/ember-nodes/table-of-contents.hbs +9 -0
- package/addon/components/table-of-contents-plugin/ember-nodes/table-of-contents.ts +95 -0
- package/addon/components/template-variable-plugin/template-variable-card.hbs +2 -1
- package/addon/components/template-variable-plugin/template-variable-card.ts +227 -0
- package/addon/{constants.js → constants.ts} +15 -3
- package/addon/ember-nodes/table-of-contents.ts +53 -0
- package/addon/helpers/{limit-text.js → limit-text.ts} +2 -2
- package/addon/initializers/plugin-initializer.js +0 -75
- package/addon/models/instruction.ts +18 -0
- package/addon/models/measure.ts +38 -0
- package/addon/models/sign.ts +36 -0
- package/addon/models/template.ts +14 -0
- package/addon/plugins/article-structure-plugin.ts +55 -0
- package/addon/plugins/besluit-plugin.ts +27 -0
- package/addon/plugins/besluit-type-plugin.ts +6 -0
- package/addon/plugins/citation-plugin/index.ts +216 -0
- package/addon/plugins/citation-plugin/marks/citation.ts +27 -0
- package/addon/plugins/citation-plugin/utils/cited-text.ts +17 -0
- package/addon/plugins/citation-plugin/utils/process-match.ts +135 -0
- package/addon/{utils/vlaamse-codex.js → plugins/citation-plugin/utils/vlaamse-codex.ts} +161 -42
- package/addon/plugins/import-snippet-plugin.ts +6 -0
- package/addon/plugins/insert-variable-plugin.ts +11 -0
- package/addon/plugins/rdfa-date-plugin.ts +11 -0
- package/addon/plugins/roadsign-regulation-plugin.ts +6 -0
- package/addon/plugins/standard-template-plugin.ts +6 -0
- package/addon/plugins/table-of-contents-plugin.ts +14 -0
- package/addon/plugins/template-variable-plugin.ts +6 -0
- package/addon/services/{import-rdfa-snippet.js → import-rdfa-snippet.ts} +48 -36
- package/addon/services/roadsign-registry.ts +288 -0
- package/addon/services/{standard-template-plugin.js → standard-template-plugin.ts} +17 -11
- package/addon/utils/article-structure-plugin/constants.ts +260 -0
- package/addon/utils/article-structure-plugin/defaults.ts +3 -0
- package/addon/utils/article-structure-plugin/options-with-defaults.ts +31 -0
- package/addon/utils/article-structure-plugin/validate-datastore.ts +23 -0
- package/addon/utils/besluit-plugin/get-title-for-decision.ts +35 -0
- package/addon/utils/{fetchBesluitTypes.js → fetchBesluitTypes.ts} +36 -16
- package/addon/utils/generate-template-plugin/{default-resources.js → default-resources.ts} +0 -0
- package/addon/utils/{instantiate-uuids.js → instantiate-uuids.ts} +9 -6
- package/addon/utils/{legislation-types.js → legislation-types.ts} +17 -3
- package/addon/utils/{memoize.js → memoize.ts} +4 -2
- package/addon/utils/option.ts +58 -0
- package/addon/utils/roadsign-regulation-plugin/{fetchData.js → fetchData.ts} +19 -2
- package/addon/utils/roadsign-regulation-plugin/includeInstructions.ts +16 -0
- package/addon/utils/romanize.ts +47 -0
- package/addon/utils/variable-plugins/{default-variable-types.js → default-variable-types.ts} +18 -7
- package/addon/utils/variable-plugins/{fetch-data.js → fetch-data.ts} +43 -15
- package/app/components/article-structure-plugin/article-structure-card.js +1 -0
- package/app/components/article-structure-plugin/structure-card.js +1 -0
- package/app/components/{citaten-plugin/citaat-card.js → au-native-input.js} +1 -1
- package/app/components/{citaten-plugin/citations/article-list.js → besluit-plugin/besluit-context-card.js} +1 -1
- package/app/components/besluit-plugin/besluit-plugin-card.js +1 -0
- package/app/components/{citaten-plugin/citations/modal.js → citation-plugin/citation-card.js} +1 -1
- package/app/components/citation-plugin/citation-insert.js +1 -0
- package/app/components/{citaten-plugin/citations/decision-list.js → citation-plugin/citations/article-list.js} +1 -1
- package/app/components/{citaten-plugin → citation-plugin}/citations/article-preview.js +1 -1
- package/app/components/{citaten-plugin → citation-plugin}/citations/decision-detail.js +1 -1
- package/app/components/citation-plugin/citations/decision-list.js +1 -0
- package/app/components/{citaten-plugin → citation-plugin}/citations/decision-preview.js +1 -1
- package/app/components/citation-plugin/citations/modal.js +1 -0
- package/app/components/{citaten-plugin → citation-plugin}/citations/search-modal.js +1 -1
- package/app/components/{citaten-plugin → citation-plugin}/helpers/alert-load-error.js +1 -1
- package/app/components/{citaten-plugin → citation-plugin}/helpers/alert-no-items.js +1 -1
- package/app/components/{citaten-plugin/citaat-insert.js → rdfa-date-plugin/card.js} +1 -1
- package/app/components/rdfa-date-plugin/date-time-picker.js +1 -0
- package/app/components/rdfa-date-plugin/insert.js +1 -0
- package/app/components/standard-template-plugin/card.js +1 -0
- package/app/components/table-of-contents-plugin/ember-nodes/outline.js +1 -0
- package/app/components/table-of-contents-plugin/ember-nodes/table-of-contents.js +1 -0
- package/app/styles/citaten-plugin.scss +1 -1
- package/commands/article-structure-plugin/delete-structure.d.ts +4 -0
- package/commands/article-structure-plugin/index.d.ts +4 -0
- package/commands/article-structure-plugin/insert-article-structure.d.ts +6 -0
- package/commands/article-structure-plugin/move-structure.d.ts +5 -0
- package/commands/article-structure-plugin/recalculate-structure-numbers.d.ts +7 -0
- package/commands/besluit-plugin/get-article-nodes-for-besluit.d.ts +5 -0
- package/commands/besluit-plugin/index.d.ts +4 -0
- package/commands/besluit-plugin/insert-article.d.ts +3 -0
- package/commands/besluit-plugin/insert-title.d.ts +2 -0
- package/commands/besluit-plugin/move-article.d.ts +2 -0
- package/commands/besluit-plugin/recalculate-article-numbers.d.ts +2 -0
- package/commands/modify-date-command.d.ts +2 -0
- package/components/article-structure-plugin/article-structure-card.d.ts +36 -0
- package/components/article-structure-plugin/structure-card.d.ts +23 -0
- package/components/au-native-input.d.ts +20 -0
- package/components/besluit-plugin/besluit-context-card.d.ts +29 -0
- package/components/besluit-plugin/besluit-plugin-card.d.ts +14 -0
- package/components/besluit-type-plugin/besluit-type-select.d.ts +11 -0
- package/components/besluit-type-plugin/toolbar-dropdown.d.ts +46 -0
- package/components/citation-plugin/citation-card.d.ts +51 -0
- package/components/citation-plugin/citation-insert.d.ts +24 -0
- package/components/citation-plugin/citations/decision-detail.d.ts +26 -0
- package/components/citation-plugin/citations/search-modal.d.ts +67 -0
- package/components/import-snippet-plugin/card.d.ts +19 -0
- package/components/insert-variable-plugin/insert-variable-card.d.ts +31 -0
- package/components/rdfa-date-plugin/card.d.ts +20 -0
- package/components/rdfa-date-plugin/date-time-picker.d.ts +32 -0
- package/components/rdfa-date-plugin/insert.d.ts +12 -0
- package/components/roadsign-regulation-plugin/expanded-measure.d.ts +20 -0
- package/components/roadsign-regulation-plugin/measure-template.d.ts +14 -0
- package/components/roadsign-regulation-plugin/roadsign-regulation-card.d.ts +12 -0
- package/components/roadsign-regulation-plugin/roadsigns-modal.d.ts +57 -0
- package/components/roadsign-regulation-plugin/roadsigns-pagination.d.ts +19 -0
- package/components/roadsign-regulation-plugin/roadsigns-table.d.ts +9 -0
- package/components/standard-template-plugin/card.d.ts +9 -0
- package/components/standard-template-plugin/template-provider.d.ts +17 -0
- package/components/table-of-contents-plugin/card.d.ts +20 -0
- package/components/table-of-contents-plugin/ember-nodes/table-of-contents.d.ts +22 -0
- package/components/template-variable-plugin/template-variable-card.d.ts +27 -0
- package/constants.d.ts +11 -0
- package/ember-nodes/table-of-contents.d.ts +4 -0
- package/helpers/limit-text.d.ts +8 -0
- package/index.js +5 -0
- package/models/instruction.d.ts +8 -0
- package/models/measure.d.ts +14 -0
- package/models/sign.d.ts +12 -0
- package/models/template.d.ts +13 -0
- package/package.json +27 -8
- package/plugins/article-structure-plugin.d.ts +29 -0
- package/plugins/besluit-plugin.d.ts +9 -0
- package/plugins/besluit-type-plugin.d.ts +2 -0
- package/plugins/citation-plugin/index.d.ts +31 -0
- package/plugins/citation-plugin/marks/citation.d.ts +2 -0
- package/plugins/citation-plugin/utils/cited-text.d.ts +3 -0
- package/plugins/citation-plugin/utils/process-match.d.ts +23 -0
- package/plugins/citation-plugin/utils/vlaamse-codex.d.ts +56 -0
- package/plugins/import-snippet-plugin.d.ts +2 -0
- package/plugins/insert-variable-plugin.d.ts +2 -0
- package/plugins/rdfa-date-plugin.d.ts +3 -0
- package/plugins/roadsign-regulation-plugin.d.ts +2 -0
- package/plugins/standard-template-plugin.d.ts +2 -0
- package/plugins/table-of-contents-plugin.d.ts +3 -0
- package/plugins/template-variable-plugin.d.ts +2 -0
- package/services/import-rdfa-snippet.d.ts +99 -0
- package/services/roadsign-registry.d.ts +42 -0
- package/services/standard-template-plugin.d.ts +21 -0
- package/translations/en-US.yaml +47 -1
- package/translations/nl-BE.yaml +49 -3
- package/tsconfig.json +34 -9
- package/types/config/environment.d.ts +22 -0
- package/types/ember-mu-transform-helpers/transforms/string-set.d.ts +14 -0
- package/types/lblod/frontend-gelinkt-notuleren/models/account.d.ts +10 -0
- package/types/lblod/frontend-gelinkt-notuleren/models/bestuurseenheid-classificatie-code.d.ts +10 -0
- package/types/lblod/frontend-gelinkt-notuleren/models/bestuurseenheid.d.ts +12 -0
- package/types/lblod/frontend-gelinkt-notuleren/models/gebruiker-model.d.ts +18 -0
- package/types/lblod/frontend-gelinkt-notuleren/services/current-session.d.ts +30 -0
- package/types/lblod/marawa/dom-helpers.d.ts +4 -0
- package/types/lblod/marawa/ember-object-mock.d.ts +3 -0
- package/types/lblod/marawa/node-walker.d.ts +18 -0
- package/types/lblod/marawa/range-helpers.d.ts +10 -0
- package/types/lblod/marawa/rdfa-attributes.d.ts +25 -0
- package/types/lblod/marawa/rdfa-block.d.ts +22 -0
- package/types/lblod/marawa/rdfa-context-scanner.d.ts +13 -0
- package/types/lblod/marawa/rdfa-helpers.d.ts +22 -0
- package/types/lblod/marawa/rich-node.d.ts +50 -0
- package/types/lblod/marawa/triple.d.ts +16 -0
- package/utils/article-structure-plugin/constants.d.ts +2 -0
- package/utils/article-structure-plugin/defaults.d.ts +4 -0
- package/utils/article-structure-plugin/options-with-defaults.d.ts +2 -0
- package/utils/article-structure-plugin/validate-datastore.d.ts +3 -0
- package/utils/besluit-plugin/get-title-for-decision.d.ts +10 -0
- package/utils/fetchBesluitTypes.d.ts +12 -0
- package/utils/generate-template-plugin/default-resources.d.ts +2 -0
- package/utils/instantiate-uuids.d.ts +1 -0
- package/utils/legislation-types.d.ts +24 -0
- package/utils/memoize.d.ts +1 -0
- package/utils/option.d.ts +14 -0
- package/utils/roadsign-regulation-plugin/fetchData.d.ts +8 -0
- package/utils/roadsign-regulation-plugin/includeInstructions.d.ts +2 -0
- package/utils/romanize.d.ts +2 -0
- package/utils/variable-plugins/default-variable-types.d.ts +7 -0
- package/utils/variable-plugins/fetch-data.d.ts +14 -0
- package/addon/commands/generate-template-command.js +0 -35
- package/addon/commands/insert-and-collapse.js +0 -32
- package/addon/commands/modify-date-command.js +0 -42
- package/addon/components/besluit-type-plugin/toolbar-dropdown.js +0 -188
- package/addon/components/citaten-plugin/citaat-card.hbs +0 -76
- package/addon/components/citaten-plugin/citaat-card.js +0 -286
- package/addon/components/citaten-plugin/citaat-insert.hbs +0 -20
- package/addon/components/citaten-plugin/citaat-insert.js +0 -68
- package/addon/components/citaten-plugin/citations/search-modal.hbs +0 -175
- package/addon/components/import-snippet-plugin/card.js +0 -95
- package/addon/components/insert-variable-plugin/insert-variable-card.js +0 -125
- package/addon/components/rdfa-date-plugin/rdfa-date-plugin-card.js +0 -71
- package/addon/components/rdfa-date-plugin/rdfa-date-plugin-insert.js +0 -24
- package/addon/components/roadsign-regulation-plugin/expanded-measure.js +0 -38
- package/addon/components/roadsign-regulation-plugin/measure-template.js +0 -30
- package/addon/components/roadsign-regulation-plugin/roadsign-regulation-card.js +0 -101
- package/addon/components/roadsign-regulation-plugin/roadsigns-table.js +0 -24
- package/addon/components/standard-template-plugin/template-card.js +0 -7
- package/addon/components/standard-template-plugin/template-provider.js +0 -75
- package/addon/components/table-of-contents-plugin/card.js +0 -53
- package/addon/components/table-of-contents-plugin/inline-components/table-of-contents.hbs +0 -9
- package/addon/components/table-of-contents-plugin/inline-components/table-of-contents.js +0 -100
- package/addon/components/template-variable-plugin/template-variable-card.js +0 -230
- package/addon/inline-components/table-of-contents.js +0 -43
- package/addon/models/instruction.js +0 -19
- package/addon/models/measure.js +0 -46
- package/addon/models/sign.js +0 -37
- package/addon/models/template.js +0 -9
- package/addon/plugins/besluit-type-plugin.js +0 -16
- package/addon/plugins/citaten-plugin.js +0 -22
- package/addon/plugins/import-snippet-plugin.js +0 -16
- package/addon/plugins/insert-variable-plugin.js +0 -19
- package/addon/plugins/rdfa-date-plugin.js +0 -26
- package/addon/plugins/roadsign-regulation-plugin.js +0 -24
- package/addon/plugins/standard-template-plugin.js +0 -33
- package/addon/plugins/table-of-contents-plugin.js +0 -27
- package/addon/plugins/template-variable-plugin.js +0 -21
- package/addon/services/roadsign-registry.js +0 -240
- package/addon/utils/processMatch.js +0 -80
- package/addon/utils/roadsign-regulation-plugin/includeInstructions.js +0 -10
- package/app/components/rdfa-date-plugin/rdfa-date-plugin-card.js +0 -1
- package/app/components/rdfa-date-plugin/rdfa-date-plugin-insert.js +0 -1
- package/app/components/rdfa-date-plugin/rdfa-date-time-picker.js +0 -1
- package/app/components/standard-template-plugin/template-card.js +0 -1
- package/app/components/table-of-contents-plugin/inline-components/outline.js +0 -1
- package/app/components/table-of-contents-plugin/inline-components/table-of-contents.js +0 -1
- package/app/initializers/plugin-initializer.js +0 -4
- package/types/dummy/index.d.ts +0 -1
- package/types/ember-data/types/registries/model.d.ts +0 -6
package/addon/models/measure.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { tracked } from '@glimmer/tracking';
|
|
2
|
-
|
|
3
|
-
export default class Measure {
|
|
4
|
-
label;
|
|
5
|
-
@tracked signs = [];
|
|
6
|
-
template;
|
|
7
|
-
classifications = new Set();
|
|
8
|
-
annotatedTemplate;
|
|
9
|
-
zonality;
|
|
10
|
-
temporal;
|
|
11
|
-
|
|
12
|
-
static fromBinding(binding) {
|
|
13
|
-
const uri = binding.uri.value;
|
|
14
|
-
const label = binding.label.value;
|
|
15
|
-
const template = binding.basicTemplate.value;
|
|
16
|
-
const temporal = binding.temporal ? binding.temporal.value : false;
|
|
17
|
-
const annotatedTemplate = binding.annotatedTemplate.value;
|
|
18
|
-
const zonality = binding.zonality.value;
|
|
19
|
-
return new Measure(
|
|
20
|
-
uri,
|
|
21
|
-
label,
|
|
22
|
-
template,
|
|
23
|
-
annotatedTemplate,
|
|
24
|
-
zonality,
|
|
25
|
-
temporal
|
|
26
|
-
);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
constructor(
|
|
30
|
-
uri,
|
|
31
|
-
label,
|
|
32
|
-
template,
|
|
33
|
-
annotatedTemplate,
|
|
34
|
-
zonality,
|
|
35
|
-
temporal,
|
|
36
|
-
signs = null
|
|
37
|
-
) {
|
|
38
|
-
this.label = label;
|
|
39
|
-
this.uri = uri;
|
|
40
|
-
this.template = template;
|
|
41
|
-
this.zonality = zonality;
|
|
42
|
-
this.annotatedTemplate = annotatedTemplate;
|
|
43
|
-
this.signs = signs;
|
|
44
|
-
this.temporal = temporal;
|
|
45
|
-
}
|
|
46
|
-
}
|
package/addon/models/sign.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
export default class Sign {
|
|
2
|
-
code;
|
|
3
|
-
image;
|
|
4
|
-
classifications = [];
|
|
5
|
-
uri;
|
|
6
|
-
order;
|
|
7
|
-
zonality;
|
|
8
|
-
static fromBinding(binding) {
|
|
9
|
-
const code = binding.code.value;
|
|
10
|
-
const image = Sign.processImage(binding.image.value, binding.imageBaseUrl);
|
|
11
|
-
|
|
12
|
-
const uri = binding.uri.value;
|
|
13
|
-
const order = binding.order.value;
|
|
14
|
-
const classifications = binding.classifications
|
|
15
|
-
? binding.classifications.value.split('|')
|
|
16
|
-
: [];
|
|
17
|
-
const zonality = binding.zonality.value;
|
|
18
|
-
return new Sign(code, image, classifications, uri, order, zonality);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
constructor(code, image, classifications, uri, order, zonality) {
|
|
22
|
-
this.code = code;
|
|
23
|
-
this.image = image;
|
|
24
|
-
this.classifications = classifications;
|
|
25
|
-
this.uri = uri;
|
|
26
|
-
this.order = order;
|
|
27
|
-
this.zonality = zonality;
|
|
28
|
-
}
|
|
29
|
-
static processImage(url, imageBaseUrl) {
|
|
30
|
-
const isAbsoluteRegex = new RegExp('^(?:[a-z]+:)?//', 'i');
|
|
31
|
-
if (isAbsoluteRegex.test(url)) {
|
|
32
|
-
return url;
|
|
33
|
-
} else {
|
|
34
|
-
return `${imageBaseUrl}${url}`;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
package/addon/models/template.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import Model, { attr } from '@ember-data/model';
|
|
2
|
-
|
|
3
|
-
export default class TemplateModel extends Model {
|
|
4
|
-
@attr title;
|
|
5
|
-
@attr('string-set', { defaultValue: () => [] }) matches;
|
|
6
|
-
@attr body;
|
|
7
|
-
@attr('string-set', { defaultValue: () => [] }) contexts;
|
|
8
|
-
@attr('string-set', { defaultValue: () => [] }) disabledInContexts;
|
|
9
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export default class BesluitTypePlugin {
|
|
2
|
-
controller;
|
|
3
|
-
|
|
4
|
-
get name() {
|
|
5
|
-
return 'besluit-type-plugin';
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
initialize(controller) {
|
|
9
|
-
this.controller = controller;
|
|
10
|
-
controller.registerWidget({
|
|
11
|
-
componentName: 'besluit-type-plugin/toolbar-dropdown',
|
|
12
|
-
identifier: 'besluit-type-plugin/dropdown',
|
|
13
|
-
desiredLocation: 'toolbar',
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import CitatenMark from '../marks/citaten-mark';
|
|
2
|
-
export default class CitatenPlugin {
|
|
3
|
-
controller;
|
|
4
|
-
|
|
5
|
-
get name() {
|
|
6
|
-
return 'citaten-plugin';
|
|
7
|
-
}
|
|
8
|
-
async initialize(controller) {
|
|
9
|
-
this.controller = controller;
|
|
10
|
-
controller.registerWidget({
|
|
11
|
-
desiredLocation: 'sidebar',
|
|
12
|
-
componentName: 'citaten-plugin/citaat-card',
|
|
13
|
-
identifier: 'citaten-plugin/citaat-card',
|
|
14
|
-
});
|
|
15
|
-
controller.registerWidget({
|
|
16
|
-
desiredLocation: 'insertSidebar',
|
|
17
|
-
componentName: 'citaten-plugin/citaat-insert',
|
|
18
|
-
identifier: 'citaten-plugin/citaat-insert',
|
|
19
|
-
});
|
|
20
|
-
controller.registerMark(CitatenMark);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export default class ImportSnippetPlugin {
|
|
2
|
-
controller;
|
|
3
|
-
|
|
4
|
-
get name() {
|
|
5
|
-
return 'import-snippet-plugin';
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
initialize(controller) {
|
|
9
|
-
this.controller = controller;
|
|
10
|
-
controller.registerWidget({
|
|
11
|
-
componentName: 'import-snippet-plugin/card',
|
|
12
|
-
identifier: 'import-snippet-plugin/card',
|
|
13
|
-
desiredLocation: 'sidebar',
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export default class InsertVariablePlugin {
|
|
2
|
-
controller;
|
|
3
|
-
|
|
4
|
-
get name() {
|
|
5
|
-
return 'insert-variable-plugin';
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
initialize(controller, options) {
|
|
9
|
-
this.controller = controller;
|
|
10
|
-
controller.registerWidget({
|
|
11
|
-
componentName: 'insert-variable-plugin/insert-variable-card',
|
|
12
|
-
identifier: 'insert-variable-plugin/card',
|
|
13
|
-
desiredLocation: 'sidebar',
|
|
14
|
-
widgetArgs: {
|
|
15
|
-
options: options,
|
|
16
|
-
},
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import ModifyDateCommand from '../commands/modify-date-command';
|
|
2
|
-
|
|
3
|
-
export default class RdfaDatePlugin {
|
|
4
|
-
controller;
|
|
5
|
-
|
|
6
|
-
get name() {
|
|
7
|
-
return 'rdfa-date-plugin';
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
initialize(controller) {
|
|
11
|
-
this.controller = controller;
|
|
12
|
-
controller.registerWidget({
|
|
13
|
-
componentName: 'rdfa-date-plugin/rdfa-date-plugin-card',
|
|
14
|
-
identifier: 'rdfa-date-plugin/card',
|
|
15
|
-
desiredLocation: 'sidebar',
|
|
16
|
-
});
|
|
17
|
-
controller.registerWidget({
|
|
18
|
-
componentName: 'rdfa-date-plugin/rdfa-date-plugin-insert',
|
|
19
|
-
identifier: 'rdfa-date-plugin/insert',
|
|
20
|
-
desiredLocation: 'insertSidebar',
|
|
21
|
-
});
|
|
22
|
-
controller.registerCommand(
|
|
23
|
-
new ModifyDateCommand(controller._rawEditor._model)
|
|
24
|
-
);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Entrypoint for the roadsign regulation plugin.
|
|
3
|
-
*/
|
|
4
|
-
export default class RoadSignRegulationPlugin {
|
|
5
|
-
controller;
|
|
6
|
-
|
|
7
|
-
get name() {
|
|
8
|
-
return 'roadsign-regulation-plugin';
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Gets called when the editor loads.
|
|
13
|
-
* Can optionally be async if needed.
|
|
14
|
-
* @param controller
|
|
15
|
-
*/
|
|
16
|
-
initialize(controller) {
|
|
17
|
-
this.controller = controller;
|
|
18
|
-
controller.registerWidget({
|
|
19
|
-
componentName: 'roadsign-regulation-plugin/roadsign-regulation-card',
|
|
20
|
-
identifier: 'roadsign-regulation-plugin/roadsign-regulation-card',
|
|
21
|
-
desiredLocation: 'insertSidebar',
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { inject as service } from '@ember/service';
|
|
2
|
-
|
|
3
|
-
export default class StandardTemplatePlugin {
|
|
4
|
-
@service standardTemplatePlugin;
|
|
5
|
-
matches = new Set();
|
|
6
|
-
controller;
|
|
7
|
-
|
|
8
|
-
get name() {
|
|
9
|
-
return 'standard-template-plugin';
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
async initialize(controller) {
|
|
13
|
-
let templates;
|
|
14
|
-
try {
|
|
15
|
-
templates = await this.standardTemplatePlugin.fetchTemplates.perform();
|
|
16
|
-
} catch (e) {
|
|
17
|
-
console.warn(
|
|
18
|
-
`Plugin ${this.name} had trouble initializing: Templates failed to load`
|
|
19
|
-
);
|
|
20
|
-
}
|
|
21
|
-
if (templates) {
|
|
22
|
-
templates.forEach((template) => {
|
|
23
|
-
template.matches.forEach((match) => this.matches.add(match));
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
this.controller = controller;
|
|
27
|
-
controller.registerWidget({
|
|
28
|
-
desiredLocation: 'insertSidebar',
|
|
29
|
-
componentName: 'standard-template-plugin/template-card',
|
|
30
|
-
identifier: 'standard-template-plugin/template-card',
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import TableOfContentsSpec from '../inline-components/table-of-contents';
|
|
2
|
-
|
|
3
|
-
export default class TableOfContentsPlugin {
|
|
4
|
-
controller;
|
|
5
|
-
|
|
6
|
-
get name() {
|
|
7
|
-
return 'table-of-contents-plugin';
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
initialize(controller, options) {
|
|
11
|
-
this.controller = controller;
|
|
12
|
-
controller.registerInlineComponent(
|
|
13
|
-
new TableOfContentsSpec(this.controller)
|
|
14
|
-
);
|
|
15
|
-
const widgetArgs = options?.config
|
|
16
|
-
? {
|
|
17
|
-
config: options.config,
|
|
18
|
-
}
|
|
19
|
-
: {};
|
|
20
|
-
controller.registerWidget({
|
|
21
|
-
componentName: 'table-of-contents-plugin/card',
|
|
22
|
-
identifier: 'table-of-contents-plugin/card',
|
|
23
|
-
desiredLocation: 'sidebar',
|
|
24
|
-
widgetArgs,
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import InsertAndCollapseCommand from '../commands/insert-and-collapse';
|
|
2
|
-
|
|
3
|
-
export default class TemplateVariablePlugin {
|
|
4
|
-
controller;
|
|
5
|
-
|
|
6
|
-
get name() {
|
|
7
|
-
return 'template-variable-plugin';
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
initialize(controller) {
|
|
11
|
-
this.controller = controller;
|
|
12
|
-
controller.registerWidget({
|
|
13
|
-
componentName: 'template-variable-plugin/template-variable-card',
|
|
14
|
-
identifier: 'template-variable-plugin/card',
|
|
15
|
-
desiredLocation: 'sidebar',
|
|
16
|
-
});
|
|
17
|
-
controller.registerCommand(
|
|
18
|
-
new InsertAndCollapseCommand(controller._rawEditor._model)
|
|
19
|
-
);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
@@ -1,240 +0,0 @@
|
|
|
1
|
-
import Service from '@ember/service';
|
|
2
|
-
import { task, restartableTask, timeout } from 'ember-concurrency';
|
|
3
|
-
import { tracked } from '@glimmer/tracking';
|
|
4
|
-
import { getOwner } from '@ember/application';
|
|
5
|
-
import { generateMeasuresQuery } from '../utils/roadsign-regulation-plugin/fetchData';
|
|
6
|
-
import Instruction from '../models/instruction';
|
|
7
|
-
import Measure from '../models/measure';
|
|
8
|
-
import Sign from '../models/sign';
|
|
9
|
-
|
|
10
|
-
const PREFIXES = `
|
|
11
|
-
PREFIX ex: <http://example.org#>
|
|
12
|
-
PREFIX lblodMobiliteit: <http://data.lblod.info/vocabularies/mobiliteit/>
|
|
13
|
-
PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>
|
|
14
|
-
PREFIX sh: <http://www.w3.org/ns/shacl#>
|
|
15
|
-
PREFIX oslo: <http://data.vlaanderen.be/ns#>
|
|
16
|
-
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
|
|
17
|
-
PREFIX org: <http://www.w3.org/ns/org#>
|
|
18
|
-
PREFIX mobiliteit: <https://data.vlaanderen.be/ns/mobiliteit#>
|
|
19
|
-
`;
|
|
20
|
-
|
|
21
|
-
const DEBOUNCE_MS = 100;
|
|
22
|
-
|
|
23
|
-
export default class RoadsignRegistryService extends Service {
|
|
24
|
-
@tracked classifications = [];
|
|
25
|
-
instructions = new Map();
|
|
26
|
-
|
|
27
|
-
constructor() {
|
|
28
|
-
super(...arguments);
|
|
29
|
-
const config = getOwner(this).resolveRegistration('config:environment');
|
|
30
|
-
this.imageBaseUrl = config.roadsignRegulationPlugin.imageBaseUrl;
|
|
31
|
-
this.endpoint = config.roadsignRegulationPlugin.endpoint;
|
|
32
|
-
this.loadClassifications.perform();
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
@task
|
|
36
|
-
*loadClassifications() {
|
|
37
|
-
const result = yield this.executeQuery.perform(`
|
|
38
|
-
SELECT DISTINCT ?classificationUri ?classificationLabel WHERE {
|
|
39
|
-
?measure ext:relation/ext:concept ?signUri.
|
|
40
|
-
?signUri org:classification ?classificationUri.
|
|
41
|
-
?classificationUri a mobiliteit:Verkeersbordcategorie;
|
|
42
|
-
skos:prefLabel ?classificationLabel.
|
|
43
|
-
}
|
|
44
|
-
`);
|
|
45
|
-
const bindings = result.results.bindings;
|
|
46
|
-
this.classifications = bindings.map((binding) => ({
|
|
47
|
-
value: binding.classificationUri.value,
|
|
48
|
-
label: binding.classificationLabel.value,
|
|
49
|
-
}));
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
@task
|
|
53
|
-
*getInstructionsForMeasure(uri) {
|
|
54
|
-
if (this.instructions.has(uri)) {
|
|
55
|
-
return this.instructions.get(uri);
|
|
56
|
-
} else {
|
|
57
|
-
const instructions = yield this.fetchInstructionsForMeasure.perform(uri);
|
|
58
|
-
this.instructions.set(uri, instructions);
|
|
59
|
-
return instructions;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
@restartableTask
|
|
64
|
-
*searchCode(codeString, category, type, combinedSigns) {
|
|
65
|
-
yield timeout(DEBOUNCE_MS);
|
|
66
|
-
if (!Array.isArray(combinedSigns)) {
|
|
67
|
-
if (combinedSigns) combinedSigns = [combinedSigns];
|
|
68
|
-
else combinedSigns = [];
|
|
69
|
-
}
|
|
70
|
-
let signFilter = '';
|
|
71
|
-
if (combinedSigns.length > 0) {
|
|
72
|
-
signFilter = combinedSigns
|
|
73
|
-
.map((sign) => `?measure ext:relation/ext:concept <${sign}>.`)
|
|
74
|
-
.join('\n');
|
|
75
|
-
signFilter += '\n';
|
|
76
|
-
const commaSeperatedSigns = combinedSigns
|
|
77
|
-
.map((sign) => `<${sign}>`)
|
|
78
|
-
.join(',');
|
|
79
|
-
signFilter += `FILTER (?signUri NOT IN (${commaSeperatedSigns}))`;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
const query = `
|
|
83
|
-
SELECT DISTINCT ?signUri ?signCode WHERE {
|
|
84
|
-
?measure ext:relation/ext:concept ?signUri.
|
|
85
|
-
?signUri a ${type ? `<${type}>` : '?signType'};
|
|
86
|
-
skos:prefLabel ?signCode;
|
|
87
|
-
ext:valid "true"^^<http://mu.semte.ch/vocabularies/typed-literals/boolean>.
|
|
88
|
-
${category ? `?signUri org:classification <${category}>` : ''}
|
|
89
|
-
${
|
|
90
|
-
type
|
|
91
|
-
? ''
|
|
92
|
-
: `
|
|
93
|
-
VALUES ?signType {
|
|
94
|
-
<https://data.vlaanderen.be/ns/mobiliteit#Verkeersbordconcept>
|
|
95
|
-
<https://data.vlaanderen.be/ns/mobiliteit#Wegmarkeringconcept>
|
|
96
|
-
<https://data.vlaanderen.be/ns/mobiliteit#Verkeerslichtconcept>
|
|
97
|
-
}
|
|
98
|
-
`
|
|
99
|
-
}
|
|
100
|
-
${signFilter}
|
|
101
|
-
${
|
|
102
|
-
codeString
|
|
103
|
-
? `FILTER(CONTAINS(LCASE(?signCode), "${codeString.toLowerCase()}"))`
|
|
104
|
-
: ''
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
ORDER BY ASC(?signCode)
|
|
108
|
-
`;
|
|
109
|
-
const result = yield this.executeQuery.perform(query);
|
|
110
|
-
const codes = result.results.bindings.map((binding) => ({
|
|
111
|
-
value: binding.signUri.value,
|
|
112
|
-
label: binding.signCode.value,
|
|
113
|
-
}));
|
|
114
|
-
return codes;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
@task
|
|
118
|
-
*executeQuery(query) {
|
|
119
|
-
const encodedQuery = encodeURIComponent(`${PREFIXES}\n${query.trim()}`);
|
|
120
|
-
const response = yield fetch(this.endpoint, {
|
|
121
|
-
method: 'POST',
|
|
122
|
-
mode: 'cors',
|
|
123
|
-
headers: {
|
|
124
|
-
Accept: 'application/sparql-results+json',
|
|
125
|
-
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
|
|
126
|
-
},
|
|
127
|
-
body: `query=${encodedQuery}`,
|
|
128
|
-
});
|
|
129
|
-
if (response.ok) {
|
|
130
|
-
return response.json();
|
|
131
|
-
} else {
|
|
132
|
-
throw new Error(
|
|
133
|
-
`Request to MOW backend was unsuccessful: [${response.status}] ${response.statusText}`
|
|
134
|
-
);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
@task
|
|
139
|
-
*fetchInstructionsForMeasure(uri) {
|
|
140
|
-
const query = `SELECT ?name ?template ?annotatedTemplate
|
|
141
|
-
WHERE {
|
|
142
|
-
<${uri}> ext:template/ext:mapping ?mapping.
|
|
143
|
-
?mapping ext:variableType 'instruction';
|
|
144
|
-
ext:variable ?name;
|
|
145
|
-
ext:instructionVariable ?instructionVariable.
|
|
146
|
-
?instructionVariable ext:annotated ?annotatedTemplate;
|
|
147
|
-
ext:value ?template.
|
|
148
|
-
}
|
|
149
|
-
`;
|
|
150
|
-
const result = yield this.executeQuery.perform(query);
|
|
151
|
-
const instructions = result.results.bindings.map((binding) =>
|
|
152
|
-
Instruction.fromBinding(binding)
|
|
153
|
-
);
|
|
154
|
-
return instructions;
|
|
155
|
-
}
|
|
156
|
-
@restartableTask
|
|
157
|
-
*fetchMeasures({ zonality, type, codes, category, pageStart } = {}) {
|
|
158
|
-
const selectQuery = generateMeasuresQuery({
|
|
159
|
-
zonality,
|
|
160
|
-
type,
|
|
161
|
-
codes,
|
|
162
|
-
category,
|
|
163
|
-
pageStart,
|
|
164
|
-
});
|
|
165
|
-
const countQuery = generateMeasuresQuery({
|
|
166
|
-
zonality,
|
|
167
|
-
type,
|
|
168
|
-
codes,
|
|
169
|
-
category,
|
|
170
|
-
count: true,
|
|
171
|
-
});
|
|
172
|
-
const countResult = yield this.executeQuery.perform(countQuery);
|
|
173
|
-
const count =
|
|
174
|
-
countResult.results.bindings.length == 1
|
|
175
|
-
? Number(countResult.results.bindings[0].count.value)
|
|
176
|
-
: 0;
|
|
177
|
-
const measures = [];
|
|
178
|
-
const result = yield this.executeQuery.perform(selectQuery);
|
|
179
|
-
for (const binding of result.results.bindings) {
|
|
180
|
-
const measure = Measure.fromBinding(binding);
|
|
181
|
-
measure.signs = yield this.fetchSignsForMeasure.perform(measure.uri);
|
|
182
|
-
measure.classifications = makeClassificationSet(measure.signs);
|
|
183
|
-
measures.push(measure);
|
|
184
|
-
}
|
|
185
|
-
return { measures, count };
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
@task
|
|
189
|
-
*fetchSignsForMeasure(uri) {
|
|
190
|
-
const query = `
|
|
191
|
-
SELECT ?uri ?code ?image ?zonality ?order (GROUP_CONCAT(?classification; SEPARATOR="|") AS ?classifications)
|
|
192
|
-
WHERE {
|
|
193
|
-
<${uri}> ext:relation ?relation.
|
|
194
|
-
?relation a ext:MustUseRelation;
|
|
195
|
-
<http://purl.org/linked-data/cube#order> ?order;
|
|
196
|
-
ext:concept ?uri.
|
|
197
|
-
?uri a ?type;
|
|
198
|
-
skos:prefLabel ?code;
|
|
199
|
-
ext:zonality ?zonality;
|
|
200
|
-
mobiliteit:grafischeWeergave ?image.
|
|
201
|
-
OPTIONAL {
|
|
202
|
-
?uri org:classification/skos:prefLabel ?classification.
|
|
203
|
-
}
|
|
204
|
-
} ORDER BY ASC(?order)
|
|
205
|
-
`;
|
|
206
|
-
const result = yield this.executeQuery.perform(query);
|
|
207
|
-
const signs = [];
|
|
208
|
-
for (const binding of result.results.bindings) {
|
|
209
|
-
const sign = Sign.fromBinding({
|
|
210
|
-
...binding,
|
|
211
|
-
imageBaseUrl: this.imageBaseUrl,
|
|
212
|
-
});
|
|
213
|
-
signs.push(sign);
|
|
214
|
-
}
|
|
215
|
-
return signs;
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
function makeClassificationSet(signs) {
|
|
220
|
-
const classifications = new Set();
|
|
221
|
-
for (const sign of signs) {
|
|
222
|
-
for (const c of sign.classifications) {
|
|
223
|
-
classifications.add(c);
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
sortSet(classifications);
|
|
227
|
-
return classifications;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
function sortSet(set) {
|
|
231
|
-
const entries = [];
|
|
232
|
-
for (const member of set) {
|
|
233
|
-
entries.push(member);
|
|
234
|
-
}
|
|
235
|
-
set.clear();
|
|
236
|
-
for (const entry of entries.sort()) {
|
|
237
|
-
set.add(entry);
|
|
238
|
-
}
|
|
239
|
-
return set;
|
|
240
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { LEGISLATION_TYPES } from './legislation-types';
|
|
2
|
-
import { isBlank } from '@ember/utils';
|
|
3
|
-
|
|
4
|
-
const STOP_WORDS = ['het', 'de', 'van', 'tot', 'dat'];
|
|
5
|
-
const DATE_REGEX = new RegExp('(\\d{1,2})\\s(\\w+)\\s(\\d{2,4})', 'g');
|
|
6
|
-
const INVISIBLE_SPACE = '\u200B';
|
|
7
|
-
const SPACES_REGEX = new RegExp('[\\s${UNBREAKABLE_SPACE}]+');
|
|
8
|
-
|
|
9
|
-
export default function processMatch(match) {
|
|
10
|
-
const matchgroups = match.groups;
|
|
11
|
-
const type = matchgroups[2];
|
|
12
|
-
const searchTerms = matchgroups[3];
|
|
13
|
-
let cleanedSearchTerms = cleanupText(searchTerms)
|
|
14
|
-
.split(SPACES_REGEX)
|
|
15
|
-
.filter(
|
|
16
|
-
(word) => !isBlank(word) && word.length > 3 && !STOP_WORDS.includes(word)
|
|
17
|
-
)
|
|
18
|
-
.join(' ');
|
|
19
|
-
|
|
20
|
-
let typeLabel;
|
|
21
|
-
if (/\w+decreet/i.test(type)) {
|
|
22
|
-
typeLabel = 'decreet';
|
|
23
|
-
cleanedSearchTerms = `${type} ${cleanedSearchTerms}`;
|
|
24
|
-
} else if (/decreet/i.test(type)) {
|
|
25
|
-
typeLabel = 'decreet';
|
|
26
|
-
} else if (/\w+wetboek/i.test(type)) {
|
|
27
|
-
typeLabel = 'wetboek';
|
|
28
|
-
cleanedSearchTerms = `${type} ${cleanedSearchTerms}`;
|
|
29
|
-
} else if (/wetboek/i.test(type)) {
|
|
30
|
-
typeLabel = 'wetboek';
|
|
31
|
-
} else if (/geco[oö]rdineerde[^\S\n]wetten/i.test(type)) {
|
|
32
|
-
typeLabel = 'gecoördineerde wetten';
|
|
33
|
-
} else if (/grondwetswijziging/i.test(type)) {
|
|
34
|
-
typeLabel = 'grondwetswijziging';
|
|
35
|
-
} else if (/grondwet/i.test(type)) {
|
|
36
|
-
typeLabel = 'grondwet';
|
|
37
|
-
} else if (/\w+wet/i.test(type)) {
|
|
38
|
-
typeLabel = 'wet';
|
|
39
|
-
cleanedSearchTerms = `${type} ${cleanedSearchTerms}`;
|
|
40
|
-
} else if (/wet/i.test(type)) {
|
|
41
|
-
typeLabel = 'wet';
|
|
42
|
-
} else {
|
|
43
|
-
typeLabel = type.toLowerCase().trim();
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const typeUri = LEGISLATION_TYPES[typeLabel] || LEGISLATION_TYPES['decreet'];
|
|
47
|
-
return {
|
|
48
|
-
text: cleanedSearchTerms,
|
|
49
|
-
legislationTypeUri: typeUri,
|
|
50
|
-
range: match.groupRanges[1],
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function cleanupText(text) {
|
|
55
|
-
if (!text) return '';
|
|
56
|
-
const { textWithoutDates } = extractDates(text);
|
|
57
|
-
const textWithoutOddChars = textWithoutDates.replace(
|
|
58
|
-
new RegExp(`[,.:"()&${INVISIBLE_SPACE}]`, 'g'),
|
|
59
|
-
''
|
|
60
|
-
);
|
|
61
|
-
const articleIndex = textWithoutOddChars.indexOf('artikel');
|
|
62
|
-
return articleIndex >= 0
|
|
63
|
-
? textWithoutOddChars.slice(0, articleIndex)
|
|
64
|
-
: textWithoutOddChars;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
function extractDates(text) {
|
|
68
|
-
let date;
|
|
69
|
-
const matches = [];
|
|
70
|
-
while ((date = DATE_REGEX.exec(text)) !== null) {
|
|
71
|
-
matches.push(date);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
let textWithoutDates = text;
|
|
75
|
-
for (let match of matches) {
|
|
76
|
-
textWithoutDates = textWithoutDates.replace(match[0], '');
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
return { dates: matches, textWithoutDates };
|
|
80
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export default function includeInstructions(html, instructions, annotated) {
|
|
2
|
-
let finalHtml = html;
|
|
3
|
-
for (let instruction of instructions) {
|
|
4
|
-
finalHtml = finalHtml.replaceAll(
|
|
5
|
-
`\${${instruction.name}}`,
|
|
6
|
-
annotated ? instruction.annotatedTemplate : instruction.template
|
|
7
|
-
);
|
|
8
|
-
}
|
|
9
|
-
return finalHtml;
|
|
10
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from '@lblod/ember-rdfa-editor-lblod-plugins/components/rdfa-date-plugin/rdfa-date-plugin-card';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from '@lblod/ember-rdfa-editor-lblod-plugins/components/rdfa-date-plugin/rdfa-date-plugin-insert';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from '@lblod/ember-rdfa-editor-lblod-plugins/components/rdfa-date-plugin/rdfa-date-time-picker';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from '@lblod/ember-rdfa-editor-lblod-plugins/components/standard-template-plugin/template-card';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from '@lblod/ember-rdfa-editor-lblod-plugins/components/table-of-contents-plugin/inline-components/outline';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from '@lblod/ember-rdfa-editor-lblod-plugins/components/table-of-contents-plugin/inline-components/table-of-contents';
|
package/types/dummy/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|