@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
|
@@ -1,21 +1,42 @@
|
|
|
1
|
-
import { LEGISLATION_TYPE_CONCEPTS } from '
|
|
2
|
-
const SPARQL_ENDPOINT = '/codex/sparql/';
|
|
1
|
+
import { LEGISLATION_TYPE_CONCEPTS } from '../../../utils/legislation-types';
|
|
3
2
|
import { warn } from '@ember/debug';
|
|
4
3
|
import { htmlSafe } from '@ember/template';
|
|
4
|
+
import {
|
|
5
|
+
Option,
|
|
6
|
+
optionMapOr,
|
|
7
|
+
} from '@lblod/ember-rdfa-editor-lblod-plugins/utils/option';
|
|
8
|
+
import Ember from 'ember';
|
|
9
|
+
import SafeString = Ember.Handlebars.SafeString;
|
|
10
|
+
|
|
11
|
+
const SPARQL_ENDPOINT = '/codex/sparql/';
|
|
5
12
|
|
|
6
13
|
//const SPARQL_ENDPOINT = 'https://codex.opendata.api.vlaanderen.be:8888/sparql';
|
|
7
14
|
|
|
8
|
-
|
|
15
|
+
interface DecisionArgs {
|
|
16
|
+
uri: string;
|
|
17
|
+
legislationTypeUri: Option<string>;
|
|
18
|
+
title: string | null;
|
|
19
|
+
publicationDate: string | null;
|
|
20
|
+
documentDate: string | null;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export class Decision {
|
|
24
|
+
uri: string;
|
|
25
|
+
legislationType: { label: string; value: string } | undefined;
|
|
26
|
+
title: string | null;
|
|
27
|
+
publicationDate: string | null;
|
|
28
|
+
documentDate: string | null;
|
|
29
|
+
|
|
9
30
|
constructor({
|
|
10
31
|
uri,
|
|
11
32
|
legislationTypeUri,
|
|
12
33
|
title,
|
|
13
34
|
publicationDate,
|
|
14
35
|
documentDate,
|
|
15
|
-
}) {
|
|
36
|
+
}: DecisionArgs) {
|
|
16
37
|
this.uri = uri;
|
|
17
38
|
this.legislationType = LEGISLATION_TYPE_CONCEPTS.find(
|
|
18
|
-
(t) => t.value
|
|
39
|
+
(t) => t.value === legislationTypeUri
|
|
19
40
|
);
|
|
20
41
|
this.title = title;
|
|
21
42
|
this.publicationDate = publicationDate;
|
|
@@ -23,15 +44,35 @@ class Decision {
|
|
|
23
44
|
}
|
|
24
45
|
|
|
25
46
|
get fullTitle() {
|
|
26
|
-
return `${this.legislationType
|
|
47
|
+
return `${this.legislationType?.label ?? ''} ${this.title ?? ''}`;
|
|
27
48
|
}
|
|
28
49
|
}
|
|
29
50
|
|
|
30
|
-
|
|
31
|
-
|
|
51
|
+
interface ArticleArgs {
|
|
52
|
+
uri: string;
|
|
53
|
+
number?: number;
|
|
54
|
+
content: string | null;
|
|
55
|
+
dateInForce: string | null;
|
|
56
|
+
dateNoLongerInForce: string | null;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export class Article {
|
|
60
|
+
uri: string;
|
|
61
|
+
number?: number;
|
|
62
|
+
content: SafeString | null;
|
|
63
|
+
dateInForce: string | null;
|
|
64
|
+
dateNoLongerInForce: string | null;
|
|
65
|
+
|
|
66
|
+
constructor({
|
|
67
|
+
uri,
|
|
68
|
+
number,
|
|
69
|
+
content,
|
|
70
|
+
dateInForce,
|
|
71
|
+
dateNoLongerInForce,
|
|
72
|
+
}: ArticleArgs) {
|
|
32
73
|
this.uri = uri;
|
|
33
74
|
this.number = number;
|
|
34
|
-
this.content = htmlSafe
|
|
75
|
+
this.content = optionMapOr(null, htmlSafe, content);
|
|
35
76
|
this.dateInForce = dateInForce;
|
|
36
77
|
this.dateNoLongerInForce = dateNoLongerInForce;
|
|
37
78
|
}
|
|
@@ -41,12 +82,12 @@ class Article {
|
|
|
41
82
|
* flemish codex encodes certain characters as a html character, which breaks our search
|
|
42
83
|
* this is an ugly work around
|
|
43
84
|
*/
|
|
44
|
-
function replaceDiacriticsInWord(word) {
|
|
85
|
+
function replaceDiacriticsInWord(word: string): string {
|
|
45
86
|
const characters =
|
|
46
87
|
'Ë À Ì Â Í Ã Î Ä Ï Ç Ò È Ó É Ô Ê Õ Ö ê Ù ë Ú î Û ï Ü ô Ý õ â û ã ÿ ç'.split(
|
|
47
88
|
' '
|
|
48
89
|
);
|
|
49
|
-
for (
|
|
90
|
+
for (const char of characters) {
|
|
50
91
|
word = word.replace(new RegExp(`${char}`, 'g'), `&#${char.charCodeAt(0)};`);
|
|
51
92
|
}
|
|
52
93
|
return word;
|
|
@@ -55,11 +96,19 @@ function replaceDiacriticsInWord(word) {
|
|
|
55
96
|
//Attempt to memoise on the fetching by stringifying the arguments. This could spare a few fetches.
|
|
56
97
|
//If memoising fails, at least a normal fetch is performed.
|
|
57
98
|
|
|
58
|
-
const fetchDecisionsMemory = new Map();
|
|
99
|
+
const fetchDecisionsMemory = new Map<string, DecisionCollection>();
|
|
100
|
+
|
|
101
|
+
export interface QueryFilter {
|
|
102
|
+
type: string;
|
|
103
|
+
documentDateFrom?: Option<string>;
|
|
104
|
+
documentDateTo?: Option<string>;
|
|
105
|
+
publicationDateFrom?: Option<string>;
|
|
106
|
+
publicationDateTo?: Option<string>;
|
|
107
|
+
}
|
|
59
108
|
|
|
60
109
|
async function fetchDecisions(
|
|
61
|
-
words,
|
|
62
|
-
filter,
|
|
110
|
+
words: string[],
|
|
111
|
+
filter: QueryFilter,
|
|
63
112
|
pageNumber = 0,
|
|
64
113
|
pageSize = 5
|
|
65
114
|
/*abortSignal*/
|
|
@@ -83,19 +132,29 @@ async function fetchDecisions(
|
|
|
83
132
|
if (results) {
|
|
84
133
|
return results;
|
|
85
134
|
} else {
|
|
86
|
-
const newResults = await
|
|
135
|
+
const newResults = await fetchDecisionsMemo(
|
|
136
|
+
words,
|
|
137
|
+
filter,
|
|
138
|
+
pageNumber,
|
|
139
|
+
pageSize
|
|
140
|
+
);
|
|
87
141
|
fetchDecisionsMemory.set(stringArguments, newResults);
|
|
88
142
|
return newResults;
|
|
89
143
|
}
|
|
90
144
|
}
|
|
91
145
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
146
|
+
interface DecisionCollection {
|
|
147
|
+
totalCount: number;
|
|
148
|
+
decisions: Decision[];
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
async function fetchDecisionsMemo(
|
|
152
|
+
words: string[],
|
|
153
|
+
filter: QueryFilter,
|
|
95
154
|
pageNumber = 0,
|
|
96
155
|
pageSize = 5,
|
|
97
|
-
abortSignal
|
|
98
|
-
) {
|
|
156
|
+
abortSignal?: AbortSignal
|
|
157
|
+
): Promise<DecisionCollection> {
|
|
99
158
|
// TBD/NOTE: in the context of a <http://data.europa.eu/eli/ontology#LegalResource>
|
|
100
159
|
// the eli:cites can have either a <http://xmlns.com/foaf/0.1/Document> or <http://data.europa.eu/eli/ontology#LegalResource>
|
|
101
160
|
// as range (see AP https://data.vlaanderen.be/doc/applicatieprofiel/besluit-publicatie/#Rechtsgrond),
|
|
@@ -165,7 +224,7 @@ async function fetchDecisionsMemd(
|
|
|
165
224
|
);
|
|
166
225
|
|
|
167
226
|
if (totalCount > 0) {
|
|
168
|
-
const response = await executeQuery(
|
|
227
|
+
const response = await executeQuery<DecisionBinding>(
|
|
169
228
|
`PREFIX eli: <http://data.europa.eu/eli/ontology#>
|
|
170
229
|
|
|
171
230
|
SELECT DISTINCT ?expressionUri as ?uri ?title ?publicationDate ?documentDate
|
|
@@ -219,15 +278,26 @@ async function fetchDecisionsMemd(
|
|
|
219
278
|
}
|
|
220
279
|
}
|
|
221
280
|
|
|
222
|
-
|
|
281
|
+
interface Binding<A> {
|
|
282
|
+
value: A;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
interface DecisionBinding {
|
|
286
|
+
uri: Binding<string>;
|
|
287
|
+
title: Binding<string>;
|
|
288
|
+
publicationDate: Binding<string>;
|
|
289
|
+
documentDate: Binding<string>;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
const fetchArticlesMemory = new Map<string, ArticleCollection>();
|
|
223
293
|
|
|
224
294
|
async function fetchArticles(
|
|
225
|
-
legalExpression,
|
|
226
|
-
pageNumber,
|
|
227
|
-
pageSize,
|
|
228
|
-
articleFilter
|
|
295
|
+
legalExpression: string,
|
|
296
|
+
pageNumber: number,
|
|
297
|
+
pageSize: number,
|
|
298
|
+
articleFilter: string
|
|
229
299
|
/*abortSignal*/
|
|
230
|
-
) {
|
|
300
|
+
): Promise<ArticleCollection> {
|
|
231
301
|
//Simpler here, only one way arguments are set up
|
|
232
302
|
const stringArguments = JSON.stringify({
|
|
233
303
|
legalExpression,
|
|
@@ -239,19 +309,56 @@ async function fetchArticles(
|
|
|
239
309
|
if (results) {
|
|
240
310
|
return results;
|
|
241
311
|
} else {
|
|
242
|
-
const newResults = await
|
|
312
|
+
const newResults = await fetchArticlesMemo(
|
|
313
|
+
legalExpression,
|
|
314
|
+
pageNumber,
|
|
315
|
+
pageSize,
|
|
316
|
+
articleFilter
|
|
317
|
+
);
|
|
243
318
|
fetchArticlesMemory.set(stringArguments, newResults);
|
|
244
319
|
return newResults;
|
|
245
320
|
}
|
|
246
321
|
}
|
|
247
322
|
|
|
248
|
-
|
|
249
|
-
|
|
323
|
+
interface ArticleBinding {
|
|
324
|
+
count: {
|
|
325
|
+
value: string;
|
|
326
|
+
};
|
|
327
|
+
content?: {
|
|
328
|
+
value: string;
|
|
329
|
+
};
|
|
330
|
+
dateInForce?: {
|
|
331
|
+
value: string;
|
|
332
|
+
};
|
|
333
|
+
dateNoLongerInForce?: {
|
|
334
|
+
value: string;
|
|
335
|
+
};
|
|
336
|
+
article: {
|
|
337
|
+
value: string;
|
|
338
|
+
};
|
|
339
|
+
number?: {
|
|
340
|
+
value: number;
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
interface QueryResponse<B> {
|
|
345
|
+
results: {
|
|
346
|
+
bindings: B[];
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
interface ArticleCollection {
|
|
351
|
+
totalCount: number;
|
|
352
|
+
articles: Article[];
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
async function fetchArticlesMemo(
|
|
356
|
+
legalExpression: string,
|
|
250
357
|
pageNumber = 0,
|
|
251
358
|
pageSize = 10,
|
|
252
|
-
articleFilter,
|
|
253
|
-
abortSignal
|
|
254
|
-
) {
|
|
359
|
+
articleFilter: string,
|
|
360
|
+
abortSignal?: AbortSignal
|
|
361
|
+
): Promise<ArticleCollection> {
|
|
255
362
|
const numberFilter = articleFilter
|
|
256
363
|
? `FILTER( !BOUND(?number) || CONTAINS(?number, "${articleFilter}"))`
|
|
257
364
|
: '';
|
|
@@ -280,7 +387,7 @@ async function fetchArticlesMemd(
|
|
|
280
387
|
if (totalCount > 0) {
|
|
281
388
|
// ?number has format like "Artikel 12." We parse the number from the string for ordering
|
|
282
389
|
// Second degree ordering on ?numberStr to make sure "Artikel 3/1." comes after "Artikel 3."
|
|
283
|
-
const response = await executeQuery(
|
|
390
|
+
const response = await executeQuery<ArticleBinding>(
|
|
284
391
|
`PREFIX eli: <http://data.europa.eu/eli/ontology#>
|
|
285
392
|
PREFIX prov: <http://www.w3.org/ns/prov#>
|
|
286
393
|
PREFIX dct: <http://purl.org/dc/terms/>
|
|
@@ -343,7 +450,7 @@ function cleanCaches() {
|
|
|
343
450
|
fetchArticlesMemory.clear();
|
|
344
451
|
}
|
|
345
452
|
|
|
346
|
-
function escapeValue(value) {
|
|
453
|
+
function escapeValue(value?: string) {
|
|
347
454
|
if (value) {
|
|
348
455
|
const shadowDomElement = document.createElement('textarea');
|
|
349
456
|
shadowDomElement.innerHTML = value;
|
|
@@ -353,14 +460,20 @@ function escapeValue(value) {
|
|
|
353
460
|
}
|
|
354
461
|
}
|
|
355
462
|
|
|
356
|
-
function dateValue(value) {
|
|
463
|
+
function dateValue(value?: string): string | null {
|
|
357
464
|
if (value) {
|
|
358
465
|
try {
|
|
359
466
|
return new Intl.DateTimeFormat('nl-BE').format(
|
|
360
467
|
new Date(Date.parse(value))
|
|
361
468
|
);
|
|
362
469
|
} catch (e) {
|
|
363
|
-
|
|
470
|
+
let message: string;
|
|
471
|
+
if (e instanceof Error) {
|
|
472
|
+
message = e.message;
|
|
473
|
+
} else {
|
|
474
|
+
message = e as string;
|
|
475
|
+
}
|
|
476
|
+
warn(`Error parsing date ${value}: ${message}`, {
|
|
364
477
|
id: 'date-parsing-error',
|
|
365
478
|
});
|
|
366
479
|
return null;
|
|
@@ -370,12 +483,18 @@ function dateValue(value) {
|
|
|
370
483
|
}
|
|
371
484
|
}
|
|
372
485
|
|
|
373
|
-
async function executeCountQuery(query, abortSignal) {
|
|
374
|
-
const response = await executeQuery(
|
|
375
|
-
|
|
486
|
+
async function executeCountQuery(query: string, abortSignal?: AbortSignal) {
|
|
487
|
+
const response = await executeQuery<{ count: { value: string } }>(
|
|
488
|
+
query,
|
|
489
|
+
abortSignal
|
|
490
|
+
);
|
|
491
|
+
return optionMapOr(0, parseInt, response.results.bindings[0]?.count.value);
|
|
376
492
|
}
|
|
377
493
|
|
|
378
|
-
async function executeQuery(
|
|
494
|
+
async function executeQuery<A>(
|
|
495
|
+
query: string,
|
|
496
|
+
abortSignal?: AbortSignal
|
|
497
|
+
): Promise<QueryResponse<A>> {
|
|
379
498
|
const encodedQuery = encodeURIComponent(query.trim());
|
|
380
499
|
const endpoint = `${SPARQL_ENDPOINT}`;
|
|
381
500
|
const response = await fetch(endpoint, {
|
|
@@ -389,7 +508,7 @@ async function executeQuery(query, abortSignal) {
|
|
|
389
508
|
});
|
|
390
509
|
|
|
391
510
|
if (response.ok) {
|
|
392
|
-
return response.json()
|
|
511
|
+
return response.json() as Promise<QueryResponse<A>>;
|
|
393
512
|
} else {
|
|
394
513
|
throw new Error(
|
|
395
514
|
`Request to Vlaamse Codex was unsuccessful: [${response.status}] ${response.statusText}`
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { WidgetSpec } from '@lblod/ember-rdfa-editor';
|
|
2
|
+
|
|
3
|
+
export function insertVariableWidget(options?: unknown): WidgetSpec {
|
|
4
|
+
return {
|
|
5
|
+
componentName: 'insert-variable-plugin/insert-variable-card',
|
|
6
|
+
desiredLocation: 'sidebar',
|
|
7
|
+
widgetArgs: {
|
|
8
|
+
options,
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { WidgetSpec } from '@lblod/ember-rdfa-editor';
|
|
2
|
+
|
|
3
|
+
export const rdfaDateCardWidget: WidgetSpec = {
|
|
4
|
+
componentName: 'rdfa-date-plugin/card',
|
|
5
|
+
desiredLocation: 'sidebar',
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const rdfaDateInsertWidget: WidgetSpec = {
|
|
9
|
+
componentName: 'rdfa-date-plugin/insert',
|
|
10
|
+
desiredLocation: 'insertSidebar',
|
|
11
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { WidgetSpec } from '@lblod/ember-rdfa-editor';
|
|
2
|
+
import { TableOfContentsConfig } from '../constants';
|
|
3
|
+
|
|
4
|
+
export function tableOfContentsWidget(
|
|
5
|
+
config?: TableOfContentsConfig
|
|
6
|
+
): WidgetSpec {
|
|
7
|
+
return {
|
|
8
|
+
componentName: 'table-of-contents-plugin/card',
|
|
9
|
+
desiredLocation: 'sidebar',
|
|
10
|
+
widgetArgs: {
|
|
11
|
+
config,
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -1,25 +1,32 @@
|
|
|
1
1
|
import Service from '@ember/service';
|
|
2
|
-
import { A } from '@ember/array';
|
|
3
2
|
import ContextScanner from '@lblod/marawa/rdfa-context-scanner';
|
|
3
|
+
import RdfaBlock from '@lblod/marawa/rdfa-block';
|
|
4
|
+
import { tracked } from 'tracked-built-ins';
|
|
4
5
|
|
|
6
|
+
type RequestParams = {
|
|
7
|
+
source: string;
|
|
8
|
+
uri?: string;
|
|
9
|
+
omitCredentials: boolean | string;
|
|
10
|
+
mock: boolean | string;
|
|
11
|
+
};
|
|
5
12
|
/*
|
|
6
13
|
* @module editor-import-snippet-plugin
|
|
7
14
|
* @class ImportRdfaSnippet
|
|
8
15
|
* @constructor
|
|
9
16
|
*/
|
|
10
|
-
class RdfaSnippet {
|
|
11
|
-
constructor(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
get resourceTypeString() {
|
|
19
|
-
return (this.resourceTypes || []).join(', ');
|
|
20
|
-
}
|
|
17
|
+
export class RdfaSnippet {
|
|
18
|
+
constructor(
|
|
19
|
+
readonly source: string,
|
|
20
|
+
readonly type: string,
|
|
21
|
+
readonly content: string,
|
|
22
|
+
readonly blocks: RdfaBlock[]
|
|
23
|
+
) {}
|
|
21
24
|
}
|
|
22
25
|
|
|
26
|
+
type Error = {
|
|
27
|
+
source: string;
|
|
28
|
+
details: string;
|
|
29
|
+
};
|
|
23
30
|
/**
|
|
24
31
|
* Service responsible for fetching and storing a snippet
|
|
25
32
|
*
|
|
@@ -33,14 +40,17 @@ class RdfaSnippet {
|
|
|
33
40
|
* @extends EmberService
|
|
34
41
|
*/
|
|
35
42
|
export default class ImportRdfaSnippet extends Service {
|
|
36
|
-
errors;
|
|
43
|
+
@tracked errors: Error[];
|
|
37
44
|
|
|
38
|
-
snippets;
|
|
45
|
+
@tracked snippets: RdfaSnippet[];
|
|
46
|
+
|
|
47
|
+
contextScanner: ContextScanner;
|
|
39
48
|
|
|
40
49
|
constructor() {
|
|
50
|
+
// eslint-disable-next-line prefer-rest-params
|
|
41
51
|
super(...arguments);
|
|
42
|
-
this.snippets =
|
|
43
|
-
this.errors =
|
|
52
|
+
this.snippets = tracked([]);
|
|
53
|
+
this.errors = tracked([]);
|
|
44
54
|
this.contextScanner = new ContextScanner();
|
|
45
55
|
}
|
|
46
56
|
|
|
@@ -51,7 +61,7 @@ export default class ImportRdfaSnippet extends Service {
|
|
|
51
61
|
* @return {String}
|
|
52
62
|
* @public
|
|
53
63
|
*/
|
|
54
|
-
async downloadSnippet(params) {
|
|
64
|
+
async downloadSnippet(params: RequestParams) {
|
|
55
65
|
const data = await this.getSnippet(params);
|
|
56
66
|
if (data) await this.processSnippet(params, data);
|
|
57
67
|
}
|
|
@@ -59,11 +69,10 @@ export default class ImportRdfaSnippet extends Service {
|
|
|
59
69
|
/**
|
|
60
70
|
* Remove a snippet from the store, typically after using it
|
|
61
71
|
* @method removeSnippet
|
|
62
|
-
* @param {RdfaSnippet} snippet
|
|
63
72
|
* @return void
|
|
64
73
|
* @public
|
|
65
74
|
*/
|
|
66
|
-
removeSnippet(snippet) {
|
|
75
|
+
removeSnippet(snippet: RdfaSnippet) {
|
|
67
76
|
const index = this.snippets.indexOf(snippet);
|
|
68
77
|
if (index >= 0) {
|
|
69
78
|
this.snippets.splice(index, 1);
|
|
@@ -76,7 +85,7 @@ export default class ImportRdfaSnippet extends Service {
|
|
|
76
85
|
* @params {String} type
|
|
77
86
|
* @return {Array} array of RdfaSnippets
|
|
78
87
|
*/
|
|
79
|
-
snippetsForType(type) {
|
|
88
|
+
snippetsForType(type: string) {
|
|
80
89
|
return this.snippets.filter((snippet) => snippet.type === type);
|
|
81
90
|
}
|
|
82
91
|
|
|
@@ -88,7 +97,7 @@ export default class ImportRdfaSnippet extends Service {
|
|
|
88
97
|
* @result {Response} result from ember fetch call
|
|
89
98
|
* @private
|
|
90
99
|
*/
|
|
91
|
-
async getSnippet(params) {
|
|
100
|
+
async getSnippet(params: RequestParams): Promise<Response | null> {
|
|
92
101
|
let data = null;
|
|
93
102
|
try {
|
|
94
103
|
const credentials = params.omitCredentials ? 'omit' : 'include';
|
|
@@ -98,15 +107,15 @@ export default class ImportRdfaSnippet extends Service {
|
|
|
98
107
|
});
|
|
99
108
|
|
|
100
109
|
if (!data) {
|
|
101
|
-
this.errors.
|
|
110
|
+
this.errors.push({
|
|
102
111
|
source: params.source,
|
|
103
|
-
details: `No data found for ${params.uri}`,
|
|
112
|
+
details: `No data found for ${params.uri ?? ''}`,
|
|
104
113
|
});
|
|
105
114
|
}
|
|
106
115
|
} catch (err) {
|
|
107
|
-
this.errors.
|
|
116
|
+
this.errors.push({
|
|
108
117
|
source: params.source,
|
|
109
|
-
details: `Error fetching data ${params.uri}: ${err}`,
|
|
118
|
+
details: `Error fetching data ${params.uri ?? ''}: ${err as string}`,
|
|
110
119
|
});
|
|
111
120
|
}
|
|
112
121
|
return data;
|
|
@@ -117,7 +126,7 @@ export default class ImportRdfaSnippet extends Service {
|
|
|
117
126
|
* currently just a very basic check if a type exists in the snippet.
|
|
118
127
|
* @method determineType
|
|
119
128
|
*/
|
|
120
|
-
determineType(
|
|
129
|
+
determineType(rdfaBlocks: RdfaBlock[]): string {
|
|
121
130
|
const triples = rdfaBlocks
|
|
122
131
|
.map((block) => block.context)
|
|
123
132
|
.reduce((prevValue, next) => [...prevValue, ...next])
|
|
@@ -140,23 +149,21 @@ export default class ImportRdfaSnippet extends Service {
|
|
|
140
149
|
/**
|
|
141
150
|
* Processes and stores snippet
|
|
142
151
|
* @method processSnippet
|
|
143
|
-
* @param {Object} { source }
|
|
144
|
-
* @param {Object} { text } (result from ember fetch call)
|
|
145
152
|
* @private
|
|
146
153
|
*/
|
|
147
|
-
async processSnippet(params, data) {
|
|
154
|
+
async processSnippet(params: RequestParams, data: Response) {
|
|
148
155
|
try {
|
|
149
156
|
const snippet = await data.text();
|
|
150
157
|
const snippetElements = this.htmlToElements(snippet);
|
|
151
158
|
const rdfaBlocks = snippetElements
|
|
152
159
|
.map((e) => this.contextScanner.analyse(e))
|
|
153
160
|
.reduce((acc, blocks) => [...acc, ...blocks], []);
|
|
154
|
-
const type = this.determineType(
|
|
161
|
+
const type = this.determineType(rdfaBlocks);
|
|
155
162
|
this.storeSnippet(params.source, type, snippet, rdfaBlocks);
|
|
156
|
-
} catch (err) {
|
|
157
|
-
this.errors.
|
|
163
|
+
} catch (err: unknown) {
|
|
164
|
+
this.errors.push({
|
|
158
165
|
source: params.source,
|
|
159
|
-
details: `Error fetching data ${params.uri}: ${err}`,
|
|
166
|
+
details: `Error fetching data ${params.uri ?? ''}: ${err as string}`,
|
|
160
167
|
});
|
|
161
168
|
}
|
|
162
169
|
}
|
|
@@ -168,7 +175,7 @@ export default class ImportRdfaSnippet extends Service {
|
|
|
168
175
|
* @return {Object}
|
|
169
176
|
* @private
|
|
170
177
|
*/
|
|
171
|
-
htmlToElements(html) {
|
|
178
|
+
htmlToElements(html: string): Element[] {
|
|
172
179
|
const template = document.createElement('template');
|
|
173
180
|
template.innerHTML = html;
|
|
174
181
|
return [...template.content.children];
|
|
@@ -182,7 +189,12 @@ export default class ImportRdfaSnippet extends Service {
|
|
|
182
189
|
* @param {Array} block array of richnodes representing the content of the snippet
|
|
183
190
|
* @private
|
|
184
191
|
*/
|
|
185
|
-
storeSnippet(
|
|
186
|
-
|
|
192
|
+
storeSnippet(
|
|
193
|
+
source: string,
|
|
194
|
+
type: string,
|
|
195
|
+
content: string,
|
|
196
|
+
blocks: RdfaBlock[]
|
|
197
|
+
): void {
|
|
198
|
+
this.snippets.push(new RdfaSnippet(source, type, content, blocks));
|
|
187
199
|
}
|
|
188
200
|
}
|