@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
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { tracked } from '@glimmer/tracking';
|
|
3
|
+
import { action } from '@ember/object';
|
|
4
|
+
import { getOwner } from '@ember/application';
|
|
5
|
+
import { task } from 'ember-concurrency';
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
CodeListOption,
|
|
9
|
+
fetchCodeListOptions,
|
|
10
|
+
} from '../../utils/variable-plugins/fetch-data';
|
|
11
|
+
import { MULTI_SELECT_CODELIST_TYPE, ZONAL_URI } from '../../constants';
|
|
12
|
+
import { ProseController } from '@lblod/ember-rdfa-editor/core/prosemirror';
|
|
13
|
+
import { ProseStore } from '@lblod/ember-rdfa-editor/utils/datastore/prose-store';
|
|
14
|
+
import { insertHtml } from '@lblod/ember-rdfa-editor/commands/insert-html-command';
|
|
15
|
+
import { unwrap } from '@lblod/ember-rdfa-editor/utils/option';
|
|
16
|
+
import { getAppliedMarks } from '@lblod/ember-rdfa-editor/plugins/datastore';
|
|
17
|
+
|
|
18
|
+
type Args = {
|
|
19
|
+
controller: ProseController;
|
|
20
|
+
};
|
|
21
|
+
export default class EditorPluginsTemplateVariableCardComponent extends Component<Args> {
|
|
22
|
+
@tracked variableOptions: CodeListOption[] = [];
|
|
23
|
+
@tracked selectedVariable?: CodeListOption | CodeListOption[];
|
|
24
|
+
@tracked showCard = false;
|
|
25
|
+
@tracked multiSelect = false;
|
|
26
|
+
mappingUri?: string;
|
|
27
|
+
zonalLocationCodelistUri: string;
|
|
28
|
+
endpoint: string;
|
|
29
|
+
nonZonalLocationCodelistUri: string;
|
|
30
|
+
|
|
31
|
+
constructor(parent: unknown, args: Args) {
|
|
32
|
+
super(parent, args);
|
|
33
|
+
const config = getOwner(this)?.resolveRegistration(
|
|
34
|
+
'config:environment'
|
|
35
|
+
) as {
|
|
36
|
+
templateVariablePlugin: {
|
|
37
|
+
zonalLocationCodelistUri: string;
|
|
38
|
+
endpoint: string;
|
|
39
|
+
nonZonalLocationCodelistUri: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
const pluginConfig = config.templateVariablePlugin;
|
|
43
|
+
this.zonalLocationCodelistUri = pluginConfig.zonalLocationCodelistUri;
|
|
44
|
+
this.endpoint = pluginConfig.endpoint;
|
|
45
|
+
this.nonZonalLocationCodelistUri = pluginConfig.nonZonalLocationCodelistUri;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
get controller() {
|
|
49
|
+
return this.args.controller;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@action
|
|
53
|
+
insert() {
|
|
54
|
+
const { selection } = this.controller.state;
|
|
55
|
+
if (!this.mappingUri || !this.selectedVariable) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
this.controller.datastore;
|
|
59
|
+
const limitedDatastore = this.controller.datastore.limitToRange(
|
|
60
|
+
this.controller.state,
|
|
61
|
+
selection.from,
|
|
62
|
+
selection.to
|
|
63
|
+
);
|
|
64
|
+
const insertRange = [
|
|
65
|
+
...limitedDatastore
|
|
66
|
+
.match(`>${this.mappingUri}`, 'ext:content')
|
|
67
|
+
.asObjectNodeMapping()
|
|
68
|
+
.nodes(),
|
|
69
|
+
][0];
|
|
70
|
+
if (!insertRange) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const marks = getAppliedMarks(insertRange);
|
|
74
|
+
let htmlToInsert: string;
|
|
75
|
+
if (Array.isArray(this.selectedVariable)) {
|
|
76
|
+
htmlToInsert = this.selectedVariable
|
|
77
|
+
.map((variable) => variable.value)
|
|
78
|
+
.join(', ');
|
|
79
|
+
} else {
|
|
80
|
+
htmlToInsert = unwrap(this.selectedVariable.value);
|
|
81
|
+
}
|
|
82
|
+
htmlToInsert = this.wrapVariableInHighlight(htmlToInsert);
|
|
83
|
+
if (insertRange) {
|
|
84
|
+
this.controller.doCommand(
|
|
85
|
+
insertHtml(htmlToInsert, insertRange.from, insertRange.to, marks)
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
wrapVariableInHighlight(text: string) {
|
|
91
|
+
return text.replace(
|
|
92
|
+
/\$\{(.+?)\}/g,
|
|
93
|
+
'<span class="mark-highlight-manual">${$1}</span>'
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
@action
|
|
98
|
+
selectionChanged() {
|
|
99
|
+
this.showCard = false;
|
|
100
|
+
this.selectedVariable = undefined;
|
|
101
|
+
const { selection } = this.controller.state;
|
|
102
|
+
const { from, to } = selection;
|
|
103
|
+
const fullDatastore = this.controller.datastore;
|
|
104
|
+
const limitedDatastore = this.controller.datastore.limitToRange(
|
|
105
|
+
this.controller.state,
|
|
106
|
+
from,
|
|
107
|
+
to
|
|
108
|
+
);
|
|
109
|
+
const mapping = limitedDatastore
|
|
110
|
+
.match(null, 'a', 'ext:Mapping')
|
|
111
|
+
.asQuadResultSet()
|
|
112
|
+
.single();
|
|
113
|
+
if (mapping) {
|
|
114
|
+
const mappingUri = mapping.subject.value;
|
|
115
|
+
this.mappingUri = mappingUri;
|
|
116
|
+
const mappingTypeTriple = fullDatastore
|
|
117
|
+
.match(`>${mappingUri}`, 'dct:type')
|
|
118
|
+
.asQuadResultSet()
|
|
119
|
+
.single();
|
|
120
|
+
if (mappingTypeTriple) {
|
|
121
|
+
const mappingType = mappingTypeTriple.object.value;
|
|
122
|
+
if (mappingType === 'codelist') {
|
|
123
|
+
const codelistTriple = fullDatastore
|
|
124
|
+
.match(`>${mappingUri}`, 'ext:codelist')
|
|
125
|
+
.asQuadResultSet()
|
|
126
|
+
.single();
|
|
127
|
+
if (codelistTriple) {
|
|
128
|
+
const codelistSource = this.getCodelistSource(
|
|
129
|
+
fullDatastore,
|
|
130
|
+
mappingUri
|
|
131
|
+
);
|
|
132
|
+
this.showCard = true;
|
|
133
|
+
const codelistUri = codelistTriple.object.value;
|
|
134
|
+
void this.fetchCodeListOptions.perform(codelistSource, codelistUri);
|
|
135
|
+
}
|
|
136
|
+
} else if (mappingType === 'location') {
|
|
137
|
+
const codelistSource = this.getCodelistSource(
|
|
138
|
+
fullDatastore,
|
|
139
|
+
mappingUri
|
|
140
|
+
);
|
|
141
|
+
const measureTriple = limitedDatastore
|
|
142
|
+
.match(
|
|
143
|
+
null,
|
|
144
|
+
'a',
|
|
145
|
+
'>https://data.vlaanderen.be/ns/mobiliteit#Mobiliteitsmaatregel'
|
|
146
|
+
)
|
|
147
|
+
.asQuadResultSet()
|
|
148
|
+
.single();
|
|
149
|
+
if (!measureTriple) {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
const measureUri = measureTriple.subject.value;
|
|
153
|
+
const zonalityTriple = fullDatastore
|
|
154
|
+
.match(`>${measureUri}`, 'ext:zonality')
|
|
155
|
+
.asQuadResultSet()
|
|
156
|
+
.single();
|
|
157
|
+
if (!zonalityTriple) {
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
const zonalityUri = zonalityTriple.object.value;
|
|
161
|
+
if (zonalityUri === ZONAL_URI) {
|
|
162
|
+
void this.fetchCodeListOptions.perform(
|
|
163
|
+
codelistSource,
|
|
164
|
+
this.zonalLocationCodelistUri,
|
|
165
|
+
true
|
|
166
|
+
);
|
|
167
|
+
} else {
|
|
168
|
+
void this.fetchCodeListOptions.perform(
|
|
169
|
+
codelistSource,
|
|
170
|
+
this.nonZonalLocationCodelistUri,
|
|
171
|
+
true
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
this.showCard = true;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
getCodelistSource(fullDatastore: ProseStore, mappingUri: string): string {
|
|
181
|
+
const codelistSourceTriple = fullDatastore
|
|
182
|
+
.match(`>${mappingUri}`, 'dct:source')
|
|
183
|
+
.asQuadResultSet()
|
|
184
|
+
.single();
|
|
185
|
+
|
|
186
|
+
if (codelistSourceTriple) {
|
|
187
|
+
return codelistSourceTriple.object.value;
|
|
188
|
+
} else {
|
|
189
|
+
return this.endpoint;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
@action
|
|
194
|
+
updateVariable(variable: CodeListOption | CodeListOption[]) {
|
|
195
|
+
this.selectedVariable = variable;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
fetchCodeListOptions = task(
|
|
199
|
+
async (endpoint: string, codelistUri: string, isLocation?: boolean) => {
|
|
200
|
+
const { type, options } = await fetchCodeListOptions(
|
|
201
|
+
endpoint,
|
|
202
|
+
codelistUri
|
|
203
|
+
);
|
|
204
|
+
if (isLocation) {
|
|
205
|
+
this.variableOptions = options.map((option) => ({
|
|
206
|
+
label: option.label,
|
|
207
|
+
value: this.wrapInLocation(unwrap(option.value)),
|
|
208
|
+
}));
|
|
209
|
+
} else {
|
|
210
|
+
this.variableOptions = options;
|
|
211
|
+
}
|
|
212
|
+
if (type === MULTI_SELECT_CODELIST_TYPE) {
|
|
213
|
+
this.multiSelect = true;
|
|
214
|
+
} else {
|
|
215
|
+
this.multiSelect = false;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
);
|
|
219
|
+
|
|
220
|
+
wrapInLocation(value: string) {
|
|
221
|
+
return `
|
|
222
|
+
<span property="https://data.vlaanderen.be/ns/mobiliteit#plaatsbepaling">
|
|
223
|
+
${value}
|
|
224
|
+
</span>
|
|
225
|
+
`;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
@@ -1,12 +1,24 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type TableOfContentsConfig = {
|
|
2
|
+
sectionPredicate: string[];
|
|
3
|
+
value:
|
|
4
|
+
| string
|
|
5
|
+
| {
|
|
6
|
+
predicate: string;
|
|
7
|
+
};
|
|
8
|
+
}[];
|
|
9
|
+
|
|
10
|
+
export const TABLE_OF_CONTENTS_DEFAULT_CONFIG: TableOfContentsConfig = [
|
|
2
11
|
{
|
|
3
|
-
sectionPredicate: 'https://say.data.gift/ns/hasPart',
|
|
12
|
+
sectionPredicate: ['https://say.data.gift/ns/hasPart', 'say:hasPart'],
|
|
4
13
|
value: {
|
|
5
14
|
predicate: 'https://say.data.gift/ns/heading',
|
|
6
15
|
},
|
|
7
16
|
},
|
|
8
17
|
{
|
|
9
|
-
sectionPredicate:
|
|
18
|
+
sectionPredicate: [
|
|
19
|
+
'https://say.data.gift/ns/hasParagraph',
|
|
20
|
+
'say:hasParagraph',
|
|
21
|
+
],
|
|
10
22
|
value: '§',
|
|
11
23
|
},
|
|
12
24
|
];
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { optionMapOr } from '@lblod/ember-rdfa-editor/utils/option';
|
|
2
|
+
import {
|
|
3
|
+
createEmberNodeSpec,
|
|
4
|
+
createEmberNodeView,
|
|
5
|
+
EmberNodeConfig,
|
|
6
|
+
} from '@lblod/ember-rdfa-editor/utils/ember-node';
|
|
7
|
+
import {
|
|
8
|
+
TableOfContentsConfig,
|
|
9
|
+
TABLE_OF_CONTENTS_DEFAULT_CONFIG,
|
|
10
|
+
} from '../constants';
|
|
11
|
+
|
|
12
|
+
export const emberNodeConfig: EmberNodeConfig = {
|
|
13
|
+
name: 'table-of-contents',
|
|
14
|
+
componentPath: 'table-of-contents-plugin/ember-nodes/table-of-contents',
|
|
15
|
+
inline: false,
|
|
16
|
+
group: 'tableOfContents',
|
|
17
|
+
atom: true,
|
|
18
|
+
attrs: {
|
|
19
|
+
config: {
|
|
20
|
+
default: TABLE_OF_CONTENTS_DEFAULT_CONFIG,
|
|
21
|
+
serialize: (node) => {
|
|
22
|
+
return JSON.stringify(node.attrs['config']);
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
parseDOM: [
|
|
27
|
+
{
|
|
28
|
+
tag: 'div',
|
|
29
|
+
getAttrs(element: HTMLElement) {
|
|
30
|
+
if (
|
|
31
|
+
element.dataset['emberNode'] === 'table-of-contents' ||
|
|
32
|
+
// Ensure backwards compatibility
|
|
33
|
+
element.dataset['inlineComponent'] ===
|
|
34
|
+
'inline-components/table-of-contents' ||
|
|
35
|
+
(element.classList.contains('inline-component') &&
|
|
36
|
+
element.classList.contains('inline-components/table-of-contents'))
|
|
37
|
+
) {
|
|
38
|
+
return {
|
|
39
|
+
config: optionMapOr(
|
|
40
|
+
TABLE_OF_CONTENTS_DEFAULT_CONFIG,
|
|
41
|
+
JSON.parse,
|
|
42
|
+
element.getAttribute('config')
|
|
43
|
+
) as TableOfContentsConfig,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
return false;
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const tableOfContents = createEmberNodeSpec(emberNodeConfig);
|
|
53
|
+
export const tableOfContentsView = createEmberNodeView(emberNodeConfig);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { helper } from '@ember/component/helper';
|
|
2
2
|
|
|
3
|
-
export default helper(function limitText([string]) {
|
|
4
|
-
if (string.length > 140) {
|
|
3
|
+
export default helper(function limitText([string]: string[]) {
|
|
4
|
+
if (string && string.length > 140) {
|
|
5
5
|
return string.slice(0, 140) + '...';
|
|
6
6
|
} else {
|
|
7
7
|
return string;
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import BesluitTypePlugin from '../plugins/besluit-type-plugin';
|
|
2
|
-
import CitatenPlugin from '../plugins/citaten-plugin';
|
|
3
|
-
import StandardTemplatePlugin from '../plugins/standard-template-plugin';
|
|
4
|
-
import GenerateTemplatePlugin from '../plugins/generate-template-plugin';
|
|
5
|
-
import RoadSignRegulationPlugin from '../plugins/roadsign-regulation-plugin';
|
|
6
|
-
import TableOfContentsPlugin from '../plugins/table-of-contents-plugin';
|
|
7
|
-
import RdfaDatePlugin from '../plugins/rdfa-date-plugin';
|
|
8
|
-
import ImportSnippetPlugin from '../plugins/import-snippet-plugin';
|
|
9
|
-
import TemplateVariablePlugin from '../plugins/template-variable-plugin';
|
|
10
|
-
import InsertVariablePlugin from '../plugins/insert-variable-plugin';
|
|
11
|
-
|
|
12
|
-
function pluginFactory(plugin) {
|
|
13
|
-
return {
|
|
14
|
-
create: (initializers) => {
|
|
15
|
-
const pluginInstance = new plugin();
|
|
16
|
-
Object.assign(pluginInstance, initializers);
|
|
17
|
-
return pluginInstance;
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function initialize(application) {
|
|
23
|
-
application.register('plugin:citaten', pluginFactory(CitatenPlugin), {
|
|
24
|
-
singleton: false,
|
|
25
|
-
});
|
|
26
|
-
application.register(
|
|
27
|
-
'plugin:standard-template',
|
|
28
|
-
pluginFactory(StandardTemplatePlugin),
|
|
29
|
-
{ singleton: false }
|
|
30
|
-
);
|
|
31
|
-
application.register(
|
|
32
|
-
'plugin:besluit-type',
|
|
33
|
-
pluginFactory(BesluitTypePlugin),
|
|
34
|
-
{ singleton: false }
|
|
35
|
-
);
|
|
36
|
-
application.register(
|
|
37
|
-
'plugin:table-of-contents',
|
|
38
|
-
pluginFactory(TableOfContentsPlugin),
|
|
39
|
-
{ singleton: false }
|
|
40
|
-
);
|
|
41
|
-
application.register(
|
|
42
|
-
'plugin:generate-template',
|
|
43
|
-
pluginFactory(GenerateTemplatePlugin),
|
|
44
|
-
{ singleton: false }
|
|
45
|
-
);
|
|
46
|
-
application.register(
|
|
47
|
-
'plugin:roadsign-regulation',
|
|
48
|
-
pluginFactory(RoadSignRegulationPlugin),
|
|
49
|
-
{ singleton: false }
|
|
50
|
-
);
|
|
51
|
-
application.register('plugin:rdfa-date', pluginFactory(RdfaDatePlugin), {
|
|
52
|
-
singleton: false,
|
|
53
|
-
});
|
|
54
|
-
application.register(
|
|
55
|
-
'plugin:import-snippet',
|
|
56
|
-
pluginFactory(ImportSnippetPlugin),
|
|
57
|
-
{
|
|
58
|
-
singleton: false,
|
|
59
|
-
}
|
|
60
|
-
);
|
|
61
|
-
application.register(
|
|
62
|
-
'plugin:template-variable',
|
|
63
|
-
pluginFactory(TemplateVariablePlugin),
|
|
64
|
-
{ singleton: false }
|
|
65
|
-
);
|
|
66
|
-
application.register(
|
|
67
|
-
'plugin:insert-variable',
|
|
68
|
-
pluginFactory(InsertVariablePlugin),
|
|
69
|
-
{ singleton: false }
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export default {
|
|
74
|
-
initialize,
|
|
75
|
-
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { unwrap } from '@lblod/ember-rdfa-editor/utils/option';
|
|
2
|
+
import { IBindings } from 'fetch-sparql-endpoint';
|
|
3
|
+
|
|
4
|
+
export default class Instruction {
|
|
5
|
+
constructor(
|
|
6
|
+
readonly name: string,
|
|
7
|
+
readonly template: string,
|
|
8
|
+
readonly annotatedTemplate: string
|
|
9
|
+
) {}
|
|
10
|
+
|
|
11
|
+
static fromBinding(binding: IBindings) {
|
|
12
|
+
return new Instruction(
|
|
13
|
+
unwrap(binding['name']?.value),
|
|
14
|
+
unwrap(binding['template']?.value),
|
|
15
|
+
unwrap(binding['annotatedTemplate']?.value)
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { tracked } from '@glimmer/tracking';
|
|
2
|
+
import { unwrap } from '@lblod/ember-rdfa-editor/utils/option';
|
|
3
|
+
import { IBindings } from 'fetch-sparql-endpoint';
|
|
4
|
+
import Sign from './sign';
|
|
5
|
+
|
|
6
|
+
export default class Measure {
|
|
7
|
+
@tracked signs: Sign[] = [];
|
|
8
|
+
classifications = new Set();
|
|
9
|
+
|
|
10
|
+
constructor(
|
|
11
|
+
readonly uri: string,
|
|
12
|
+
readonly label: string,
|
|
13
|
+
readonly template: string,
|
|
14
|
+
readonly annotatedTemplate: string,
|
|
15
|
+
readonly zonality: string,
|
|
16
|
+
readonly temporal: string | false,
|
|
17
|
+
signs: Sign[] = []
|
|
18
|
+
) {
|
|
19
|
+
this.signs = signs;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
static fromBinding(binding: IBindings) {
|
|
23
|
+
const uri = unwrap(binding['uri']?.value);
|
|
24
|
+
const label = unwrap(binding['label']?.value);
|
|
25
|
+
const template = unwrap(binding['basicTemplate']?.value);
|
|
26
|
+
const temporal = binding['temporal']?.value ?? false;
|
|
27
|
+
const annotatedTemplate = unwrap(binding['annotatedTemplate']?.value);
|
|
28
|
+
const zonality = unwrap(binding['zonality']?.value);
|
|
29
|
+
return new Measure(
|
|
30
|
+
uri,
|
|
31
|
+
label,
|
|
32
|
+
template,
|
|
33
|
+
annotatedTemplate,
|
|
34
|
+
zonality,
|
|
35
|
+
temporal
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { unwrap } from '@lblod/ember-rdfa-editor/utils/option';
|
|
2
|
+
import { IBindings } from 'fetch-sparql-endpoint';
|
|
3
|
+
|
|
4
|
+
export default class Sign {
|
|
5
|
+
constructor(
|
|
6
|
+
readonly code: string,
|
|
7
|
+
readonly image: string,
|
|
8
|
+
readonly classifications: string[] = [],
|
|
9
|
+
readonly uri: string,
|
|
10
|
+
readonly order: string,
|
|
11
|
+
readonly zonality: string
|
|
12
|
+
) {}
|
|
13
|
+
static fromBinding(binding: IBindings) {
|
|
14
|
+
const code = unwrap(binding['code']?.value);
|
|
15
|
+
const image = Sign.processImage(
|
|
16
|
+
unwrap(binding['image']?.value),
|
|
17
|
+
unwrap(binding['imageBaseUrl']?.value)
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
const uri = unwrap(binding['uri']?.value);
|
|
21
|
+
const order = unwrap(binding['order']?.value);
|
|
22
|
+
|
|
23
|
+
const classifications = binding['classifications']?.value.split('|') ?? [];
|
|
24
|
+
const zonality = unwrap(binding['zonality']?.value);
|
|
25
|
+
return new Sign(code, image, classifications, uri, order, zonality);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
static processImage(url: string, imageBaseUrl: string) {
|
|
29
|
+
const isAbsoluteRegex = new RegExp('^(?:[a-z]+:)?//', 'i');
|
|
30
|
+
if (isAbsoluteRegex.test(url)) {
|
|
31
|
+
return url;
|
|
32
|
+
} else {
|
|
33
|
+
return `${imageBaseUrl}${url}`;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import Model, { attr } from '@ember-data/model';
|
|
2
|
+
declare module 'ember-data/types/registries/model' {
|
|
3
|
+
export default interface ModelRegistry {
|
|
4
|
+
template: TemplateModel;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
export default class TemplateModel extends Model {
|
|
8
|
+
@attr declare title: string;
|
|
9
|
+
@attr('string-set', { defaultValue: () => [] }) declare matches: string[];
|
|
10
|
+
@attr declare body: string;
|
|
11
|
+
@attr('string-set', { defaultValue: () => [] }) declare contexts: string[];
|
|
12
|
+
@attr('string-set', { defaultValue: () => [] })
|
|
13
|
+
declare disabledInContexts: string[];
|
|
14
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { WidgetSpec } from '@lblod/ember-rdfa-editor';
|
|
2
|
+
import IntlService from 'ember-intl/services/intl';
|
|
3
|
+
import optionsWithDefaults from '../utils/article-structure-plugin/options-with-defaults';
|
|
4
|
+
|
|
5
|
+
export type StructureSpec = {
|
|
6
|
+
uriBase: string;
|
|
7
|
+
title: string;
|
|
8
|
+
type: string;
|
|
9
|
+
numberPredicate: string;
|
|
10
|
+
numbering?: string;
|
|
11
|
+
numberingFunction?: (num: number) => string;
|
|
12
|
+
heading?: string;
|
|
13
|
+
translation: string;
|
|
14
|
+
moveUp: string;
|
|
15
|
+
moveDown: string;
|
|
16
|
+
insertPredicate?: {
|
|
17
|
+
long: string;
|
|
18
|
+
short: string;
|
|
19
|
+
};
|
|
20
|
+
shaclConstraint: string;
|
|
21
|
+
template: (uri: string, intlService: IntlService) => string;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type ArticleStructurePluginOptions = {
|
|
25
|
+
structures: StructureSpec[];
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export type ResolvedArticleStructurePluginOptions = {
|
|
29
|
+
structures: StructureSpec[];
|
|
30
|
+
structureTypes: string[];
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const articleStructureInsertWidget: (
|
|
34
|
+
options?: ArticleStructurePluginOptions
|
|
35
|
+
) => WidgetSpec = (options) => {
|
|
36
|
+
return {
|
|
37
|
+
componentName: 'article-structure-plugin/article-structure-card',
|
|
38
|
+
desiredLocation: 'insertSidebar',
|
|
39
|
+
widgetArgs: {
|
|
40
|
+
options: optionsWithDefaults(options),
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const articleStructureContextWidget: (
|
|
46
|
+
options?: ArticleStructurePluginOptions
|
|
47
|
+
) => WidgetSpec = (options) => {
|
|
48
|
+
return {
|
|
49
|
+
componentName: 'article-structure-plugin/structure-card',
|
|
50
|
+
desiredLocation: 'sidebar',
|
|
51
|
+
widgetArgs: {
|
|
52
|
+
options: optionsWithDefaults(options),
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { WidgetSpec } from '@lblod/ember-rdfa-editor';
|
|
2
|
+
import { VariableType } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/variable-plugins/default-variable-types';
|
|
3
|
+
|
|
4
|
+
export interface DecisionOptions {
|
|
5
|
+
publisher?: string;
|
|
6
|
+
variableTypes?: (VariableType | string)[];
|
|
7
|
+
defaultEndpoint?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function besluitPluginCardWidget(): WidgetSpec {
|
|
11
|
+
return {
|
|
12
|
+
componentName: 'besluit-plugin/besluit-plugin-card',
|
|
13
|
+
desiredLocation: 'insertSidebar',
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function besluitContextCardWidget(
|
|
18
|
+
options: DecisionOptions = {}
|
|
19
|
+
): WidgetSpec {
|
|
20
|
+
return {
|
|
21
|
+
componentName: 'besluit-plugin/besluit-context-card',
|
|
22
|
+
desiredLocation: 'sidebar',
|
|
23
|
+
widgetArgs: {
|
|
24
|
+
options,
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
}
|