@lblod/ember-rdfa-editor-lblod-plugins 0.4.1 → 1.0.0-alpha.2
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 +46 -0
- package/addon/components/article-structure-plugin/article-structure-card.hbs +10 -0
- package/addon/components/article-structure-plugin/article-structure-card.ts +33 -0
- package/addon/components/article-structure-plugin/structure-card.hbs +46 -0
- package/addon/components/article-structure-plugin/structure-card.ts +124 -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 +138 -0
- package/addon/components/besluit-plugin/besluit-plugin-card.hbs +20 -0
- package/addon/components/besluit-plugin/besluit-plugin-card.ts +40 -0
- package/addon/components/besluit-type-plugin/{besluit-type-select.js → besluit-type-select.ts} +8 -4
- package/addon/components/besluit-type-plugin/toolbar-dropdown.hbs +2 -0
- package/addon/components/besluit-type-plugin/toolbar-dropdown.ts +218 -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} +117 -90
- 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 +45 -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} +103 -66
- 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/helpers/{limit-text.js → limit-text.ts} +2 -2
- 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/commands/index.ts +6 -0
- package/addon/plugins/article-structure-plugin/commands/insert-structure.ts +80 -0
- package/addon/plugins/article-structure-plugin/commands/move-selected-structure.ts +130 -0
- package/addon/plugins/article-structure-plugin/commands/recalculate-structure-numbers.ts +26 -0
- package/addon/plugins/article-structure-plugin/commands/remove-structure.ts +21 -0
- package/addon/plugins/article-structure-plugin/commands/unwrap-structure.ts +40 -0
- package/addon/plugins/article-structure-plugin/commands/wrap-structure-content.ts +66 -0
- package/addon/plugins/article-structure-plugin/constants.ts +11 -0
- package/addon/plugins/article-structure-plugin/index.ts +70 -0
- package/addon/plugins/article-structure-plugin/structures/article-paragraph.ts +94 -0
- package/addon/plugins/article-structure-plugin/structures/article.ts +129 -0
- package/addon/plugins/article-structure-plugin/structures/chapter.ts +83 -0
- package/addon/plugins/article-structure-plugin/structures/index.ts +33 -0
- package/addon/plugins/article-structure-plugin/structures/section.ts +82 -0
- package/addon/plugins/article-structure-plugin/structures/structure-header.ts +65 -0
- package/addon/plugins/article-structure-plugin/structures/subsection.ts +83 -0
- package/addon/plugins/article-structure-plugin/structures/title.ts +83 -0
- package/addon/plugins/article-structure-plugin/utils/namespace.ts +25 -0
- package/addon/plugins/article-structure-plugin/utils/structure.ts +162 -0
- package/addon/plugins/besluit-plugin/commands/get-article-nodes-for-besluit.ts +30 -0
- package/addon/plugins/besluit-plugin/commands/index.ts +4 -0
- package/addon/plugins/besluit-plugin/commands/insert-article.ts +70 -0
- package/addon/plugins/besluit-plugin/commands/insert-title.ts +67 -0
- package/addon/plugins/besluit-plugin/commands/move-article.ts +69 -0
- package/addon/plugins/besluit-plugin/commands/recalculate-article-numbers.ts +44 -0
- package/addon/plugins/besluit-plugin/index.ts +11 -0
- package/addon/plugins/besluit-plugin/utils/get-title-for-decision.ts +35 -0
- package/addon/plugins/besluit-type-plugin/index.ts +6 -0
- package/addon/{utils/fetchBesluitTypes.js → plugins/besluit-type-plugin/utils/fetchBesluitTypes.ts} +35 -16
- 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/{utils/legislation-types.js → plugins/citation-plugin/utils/legislation-types.ts} +17 -3
- package/addon/plugins/citation-plugin/utils/process-match.ts +132 -0
- package/addon/{utils/vlaamse-codex.js → plugins/citation-plugin/utils/vlaamse-codex.ts} +160 -41
- package/addon/plugins/import-snippet-plugin.ts +6 -0
- package/addon/plugins/insert-variable-plugin/index.ts +11 -0
- package/addon/{utils/variable-plugins/default-variable-types.js → plugins/insert-variable-plugin/utils/constants.ts} +18 -7
- package/addon/plugins/insert-variable-plugin/utils/fetch-data.ts +41 -0
- package/addon/plugins/rdfa-date-plugin/commands/index.ts +1 -0
- package/addon/plugins/rdfa-date-plugin/commands/modify-date.ts +48 -0
- package/addon/plugins/rdfa-date-plugin/index.ts +11 -0
- package/addon/plugins/roadsign-regulation-plugin/index.ts +6 -0
- package/addon/plugins/roadsign-regulation-plugin/utils/constants.ts +8 -0
- package/addon/{utils/roadsign-regulation-plugin/fetchData.js → plugins/roadsign-regulation-plugin/utils/fetchData.ts} +20 -3
- package/addon/plugins/roadsign-regulation-plugin/utils/includeInstructions.ts +16 -0
- package/addon/plugins/standard-template-plugin/index.ts +6 -0
- package/addon/plugins/standard-template-plugin/utils/instantiate-uuids.ts +48 -0
- package/addon/plugins/table-of-contents-plugin/index.ts +14 -0
- package/addon/plugins/table-of-contents-plugin/nodes/index.ts +1 -0
- package/addon/plugins/table-of-contents-plugin/nodes/table-of-contents.ts +53 -0
- package/addon/plugins/table-of-contents-plugin/utils/constants.ts +17 -0
- package/addon/plugins/template-variable-plugin/index.ts +6 -0
- package/addon/plugins/template-variable-plugin/utils/constants.ts +2 -0
- package/addon/plugins/template-variable-plugin/utils/fetch-data.ts +62 -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/memoize.ts +8 -0
- package/addon/utils/option.ts +58 -0
- package/addon/utils/sparql-helpers.ts +27 -0
- 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/components/article-structure-plugin/article-structure-card.d.ts +17 -0
- package/components/article-structure-plugin/structure-card.d.ts +32 -0
- package/components/au-native-input.d.ts +20 -0
- package/components/besluit-plugin/besluit-context-card.d.ts +24 -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/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 +29 -8
- package/plugins/article-structure-plugin/commands/index.d.ts +6 -0
- package/plugins/article-structure-plugin/commands/insert-structure.d.ts +5 -0
- package/plugins/article-structure-plugin/commands/move-selected-structure.d.ts +10 -0
- package/plugins/article-structure-plugin/commands/recalculate-structure-numbers.d.ts +3 -0
- package/plugins/article-structure-plugin/commands/remove-structure.d.ts +7 -0
- package/plugins/article-structure-plugin/commands/unwrap-structure.d.ts +8 -0
- package/plugins/article-structure-plugin/commands/wrap-structure-content.d.ts +8 -0
- package/plugins/article-structure-plugin/constants.d.ts +5 -0
- package/plugins/article-structure-plugin/index.d.ts +41 -0
- package/plugins/article-structure-plugin/structures/article-paragraph.d.ts +4 -0
- package/plugins/article-structure-plugin/structures/article.d.ts +6 -0
- package/plugins/article-structure-plugin/structures/chapter.d.ts +4 -0
- package/plugins/article-structure-plugin/structures/index.d.ts +17 -0
- package/plugins/article-structure-plugin/structures/section.d.ts +4 -0
- package/plugins/article-structure-plugin/structures/structure-header.d.ts +2 -0
- package/plugins/article-structure-plugin/structures/subsection.d.ts +4 -0
- package/plugins/article-structure-plugin/structures/title.d.ts +4 -0
- package/plugins/article-structure-plugin/utils/namespace.d.ts +6 -0
- package/plugins/article-structure-plugin/utils/structure.d.ts +20 -0
- package/plugins/besluit-plugin/commands/get-article-nodes-for-besluit.d.ts +5 -0
- package/plugins/besluit-plugin/commands/index.d.ts +4 -0
- package/plugins/besluit-plugin/commands/insert-article.d.ts +3 -0
- package/plugins/besluit-plugin/commands/insert-title.d.ts +2 -0
- package/plugins/besluit-plugin/commands/move-article.d.ts +2 -0
- package/plugins/besluit-plugin/commands/recalculate-article-numbers.d.ts +2 -0
- package/plugins/besluit-plugin/index.d.ts +3 -0
- package/plugins/besluit-plugin/utils/get-title-for-decision.d.ts +10 -0
- package/plugins/besluit-type-plugin/index.d.ts +2 -0
- package/plugins/besluit-type-plugin/utils/fetchBesluitTypes.d.ts +12 -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/legislation-types.d.ts +24 -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/index.d.ts +2 -0
- package/plugins/insert-variable-plugin/utils/constants.d.ts +7 -0
- package/plugins/insert-variable-plugin/utils/fetch-data.d.ts +5 -0
- package/plugins/rdfa-date-plugin/commands/index.d.ts +1 -0
- package/plugins/rdfa-date-plugin/commands/modify-date.d.ts +2 -0
- package/plugins/rdfa-date-plugin/index.d.ts +3 -0
- package/plugins/roadsign-regulation-plugin/index.d.ts +2 -0
- package/plugins/roadsign-regulation-plugin/utils/constants.d.ts +3 -0
- package/plugins/roadsign-regulation-plugin/utils/fetchData.d.ts +8 -0
- package/plugins/roadsign-regulation-plugin/utils/includeInstructions.d.ts +2 -0
- package/plugins/standard-template-plugin/index.d.ts +2 -0
- package/plugins/standard-template-plugin/utils/instantiate-uuids.d.ts +15 -0
- package/plugins/table-of-contents-plugin/index.d.ts +3 -0
- package/plugins/table-of-contents-plugin/nodes/index.d.ts +1 -0
- package/plugins/table-of-contents-plugin/nodes/table-of-contents.d.ts +4 -0
- package/plugins/table-of-contents-plugin/utils/constants.d.ts +7 -0
- package/plugins/template-variable-plugin/index.d.ts +2 -0
- package/plugins/template-variable-plugin/utils/constants.d.ts +1 -0
- package/plugins/template-variable-plugin/utils/fetch-data.d.ts +9 -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 +64 -1
- package/translations/nl-BE.yaml +66 -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/memoize.d.ts +1 -0
- package/utils/option.d.ts +14 -0
- package/utils/sparql-helpers.d.ts +7 -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/constants.js +0 -24
- package/addon/initializers/plugin-initializer.js +0 -75
- package/addon/inline-components/table-of-contents.js +0 -43
- package/addon/marks/citaten-mark.js +0 -32
- 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/generate-template-plugin.js +0 -16
- 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/generate-template-plugin/default-resources.js +0 -9
- package/addon/utils/instantiate-uuids.js +0 -34
- package/addon/utils/memoize.js +0 -8
- package/addon/utils/processMatch.js +0 -80
- package/addon/utils/roadsign-regulation-plugin/includeInstructions.js +0 -10
- package/addon/utils/variable-plugins/fetch-data.js +0 -98
- 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,75 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { action } from '@ember/object';
|
|
3
|
+
import { inject as service } from '@ember/service';
|
|
4
|
+
import StandardTemplatePluginService from '@lblod/ember-rdfa-editor-lblod-plugins/services/standard-template-plugin';
|
|
5
|
+
import { ProseController } from '@lblod/ember-rdfa-editor/core/prosemirror';
|
|
6
|
+
import TemplateModel from '@lblod/ember-rdfa-editor-lblod-plugins/models/template';
|
|
7
|
+
import { insertHtml } from '@lblod/ember-rdfa-editor/commands/insert-html-command';
|
|
8
|
+
import instantiateUuids from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/standard-template-plugin/utils/instantiate-uuids';
|
|
9
|
+
|
|
10
|
+
type Args = {
|
|
11
|
+
controller: ProseController;
|
|
12
|
+
};
|
|
13
|
+
export default class TemplateProviderComponent extends Component<Args> {
|
|
14
|
+
@service declare standardTemplatePlugin: StandardTemplatePluginService;
|
|
15
|
+
|
|
16
|
+
get busy() {
|
|
17
|
+
return this.standardTemplatePlugin.fetchTemplates.isRunning;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
get controller() {
|
|
21
|
+
return this.args.controller;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
get hasApplicableTemplates() {
|
|
25
|
+
return this.applicableTemplates.length > 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
get applicableTemplates() {
|
|
29
|
+
return (
|
|
30
|
+
this.standardTemplatePlugin.fetchTemplates.last?.value?.filter(
|
|
31
|
+
(template) => this.templateIsApplicable(template)
|
|
32
|
+
) || []
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
templateIsApplicable(template: TemplateModel) {
|
|
37
|
+
const containsTypes = this.controller.datastore
|
|
38
|
+
.match(null, 'a')
|
|
39
|
+
.dataset.some((quad) => {
|
|
40
|
+
return template.contexts.includes(quad.object.value);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
const containsDisabledTypes = this.controller.datastore
|
|
44
|
+
.match(null, 'a')
|
|
45
|
+
.dataset.some((quad) =>
|
|
46
|
+
template.disabledInContexts.includes(quad.object.value)
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
return containsTypes && !containsDisabledTypes;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@action
|
|
53
|
+
async insert(template: TemplateModel) {
|
|
54
|
+
await template.reload();
|
|
55
|
+
const selection = this.controller.state.selection;
|
|
56
|
+
let insertRange: { from: number; to: number } = selection;
|
|
57
|
+
const { $from, $to } = selection;
|
|
58
|
+
if (
|
|
59
|
+
$from.parent.type === this.controller.schema.nodes['placeholder'] &&
|
|
60
|
+
$from.sameParent($to)
|
|
61
|
+
) {
|
|
62
|
+
insertRange = {
|
|
63
|
+
from: $from.start($from.depth - 1),
|
|
64
|
+
to: $from.end($from.depth - 1),
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
this.controller.doCommand(
|
|
68
|
+
insertHtml(
|
|
69
|
+
instantiateUuids(template.body),
|
|
70
|
+
insertRange.from,
|
|
71
|
+
insertRange.to
|
|
72
|
+
)
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
<AuCard @flex={{true}} @divided={{true}} @expandable={{false}} @shadow={{true}} @size="flush" as |c|>
|
|
2
2
|
<c.content class="au-c-content--small">
|
|
3
|
-
<
|
|
3
|
+
<label
|
|
4
|
+
class="au-c-toggle-switch"
|
|
5
|
+
>
|
|
6
|
+
<input
|
|
7
|
+
type="checkbox"
|
|
8
|
+
checked={{this.toggled}}
|
|
9
|
+
class="au-c-toggle-switch__input au-u-hidden-visually"
|
|
10
|
+
{{on "input" this.toggle}}
|
|
11
|
+
/>
|
|
12
|
+
<span class="au-c-toggle-switch__toggle"></span>
|
|
13
|
+
<span class="au-c-toggle-switch__label">{{t "table-of-contents-plugin.toggle" }}</span>
|
|
14
|
+
</label>
|
|
4
15
|
</c.content>
|
|
5
16
|
</AuCard>
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { action } from '@ember/object';
|
|
2
|
+
import Component from '@glimmer/component';
|
|
3
|
+
import {
|
|
4
|
+
TableOfContentsConfig,
|
|
5
|
+
TABLE_OF_CONTENTS_DEFAULT_CONFIG,
|
|
6
|
+
} from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/table-of-contents-plugin/utils/constants';
|
|
7
|
+
import { ProseController } from '@lblod/ember-rdfa-editor/core/prosemirror';
|
|
8
|
+
|
|
9
|
+
type Args = {
|
|
10
|
+
controller: ProseController;
|
|
11
|
+
widgetArgs: {
|
|
12
|
+
config: TableOfContentsConfig;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default class TableOfContentsCardComponent extends Component<Args> {
|
|
17
|
+
get toggled() {
|
|
18
|
+
return !!this.tableOfContentsRange;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
get controller() {
|
|
22
|
+
return this.args.controller;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
get tableOfContentsRange() {
|
|
26
|
+
let result: { from: number; to: number } | undefined;
|
|
27
|
+
this.controller.state.doc.descendants((node, pos) => {
|
|
28
|
+
if (node.type === this.controller.schema.nodes['table_of_contents']) {
|
|
29
|
+
result = { from: pos, to: pos + node.nodeSize };
|
|
30
|
+
}
|
|
31
|
+
return !result;
|
|
32
|
+
});
|
|
33
|
+
return result;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
get config() {
|
|
37
|
+
return this.args.widgetArgs.config ?? TABLE_OF_CONTENTS_DEFAULT_CONFIG;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@action
|
|
41
|
+
toggle() {
|
|
42
|
+
if (this.tableOfContentsRange) {
|
|
43
|
+
const { from, to } = this.tableOfContentsRange;
|
|
44
|
+
this.controller.withTransaction((tr) => {
|
|
45
|
+
return tr.deleteRange(from, to);
|
|
46
|
+
});
|
|
47
|
+
} else {
|
|
48
|
+
const { schema } = this.controller;
|
|
49
|
+
this.controller.withTransaction((tr) => {
|
|
50
|
+
return tr.replaceRangeWith(
|
|
51
|
+
0,
|
|
52
|
+
0,
|
|
53
|
+
schema.node('table_of_contents', {
|
|
54
|
+
config: this.config,
|
|
55
|
+
})
|
|
56
|
+
);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
package/addon/components/table-of-contents-plugin/{inline-components → ember-nodes}/outline.hbs
RENAMED
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
{{! template-lint-disable no-capital-arguments }}
|
|
7
7
|
@block={{true}}
|
|
8
8
|
@skin='link-secondary'
|
|
9
|
-
onclick={{fn @onEntryClick outlineEntry.
|
|
9
|
+
onclick={{(fn @onEntryClick outlineEntry.pos)}}
|
|
10
10
|
>
|
|
11
11
|
{{outlineEntry.content}}
|
|
12
12
|
</AuButton>
|
|
13
13
|
{{#if outlineEntry.children}}
|
|
14
|
-
<TableOfContentsPlugin::
|
|
14
|
+
<TableOfContentsPlugin::EmberNodes::Outline
|
|
15
15
|
@entries={{outlineEntry.children}}
|
|
16
16
|
@onEntryClick={{@onEntryClick}}
|
|
17
17
|
/>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<div class='au-u-background-gray-100 au-u-padding-tiny table-of-contents'>
|
|
2
|
+
<h3>{{t "table-of-contents-plugin.title"}}</h3>
|
|
3
|
+
{{#if this.outline}}
|
|
4
|
+
<TableOfContentsPlugin::EmberNodes::Outline
|
|
5
|
+
@entries={{this.outline.entries}}
|
|
6
|
+
@onEntryClick={{this.moveToPosition}}
|
|
7
|
+
/>
|
|
8
|
+
{{/if}}
|
|
9
|
+
</div>
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { action } from '@ember/object';
|
|
2
|
+
import Component from '@glimmer/component';
|
|
3
|
+
import { PNode } from '@lblod/ember-rdfa-editor';
|
|
4
|
+
import { EmberNodeArgs } from '@lblod/ember-rdfa-editor/utils/ember-node';
|
|
5
|
+
import { Selection } from '@lblod/ember-rdfa-editor';
|
|
6
|
+
import { getRdfaAttribute } from '@lblod/ember-rdfa-editor/utils/rdfa-utils';
|
|
7
|
+
import { unwrap } from '@lblod/ember-rdfa-editor/utils/option';
|
|
8
|
+
import { TableOfContentsConfig } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/table-of-contents-plugin/utils/constants';
|
|
9
|
+
type OutlineEntry = {
|
|
10
|
+
content: string;
|
|
11
|
+
pos: number;
|
|
12
|
+
children?: OutlineEntry[];
|
|
13
|
+
};
|
|
14
|
+
export default class TableOfContentsComponent extends Component<EmberNodeArgs> {
|
|
15
|
+
get config() {
|
|
16
|
+
return this.args.node.attrs['config'] as TableOfContentsConfig;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
get controller() {
|
|
20
|
+
return this.args.controller;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
get outline() {
|
|
24
|
+
const entries = this.extractOutline({
|
|
25
|
+
node: this.controller.state.doc,
|
|
26
|
+
pos: -1,
|
|
27
|
+
});
|
|
28
|
+
return {
|
|
29
|
+
entries,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
extractOutline({ node, pos }: { node: PNode; pos: number }): OutlineEntry[] {
|
|
34
|
+
let result: OutlineEntry[] = [];
|
|
35
|
+
let parent: OutlineEntry | undefined;
|
|
36
|
+
const properties = getRdfaAttribute(node, 'property').pop();
|
|
37
|
+
const resource = getRdfaAttribute(node, 'resource').pop();
|
|
38
|
+
if (properties && resource) {
|
|
39
|
+
for (const tocConfigEntry of this.config) {
|
|
40
|
+
if (
|
|
41
|
+
tocConfigEntry.sectionPredicate.some((pred) =>
|
|
42
|
+
properties.includes(pred)
|
|
43
|
+
)
|
|
44
|
+
) {
|
|
45
|
+
if (typeof tocConfigEntry.value === 'string') {
|
|
46
|
+
parent = { content: tocConfigEntry.value, pos };
|
|
47
|
+
break;
|
|
48
|
+
} else {
|
|
49
|
+
const range = [
|
|
50
|
+
...this.args.controller.datastore
|
|
51
|
+
.match(`>${resource}`, `>${tocConfigEntry.value.predicate}`)
|
|
52
|
+
.asPredicateNodeMapping()
|
|
53
|
+
.nodes(),
|
|
54
|
+
][0];
|
|
55
|
+
if (range) {
|
|
56
|
+
const node = unwrap(this.controller.state.doc.nodeAt(range.from));
|
|
57
|
+
parent = {
|
|
58
|
+
content: node.textContent,
|
|
59
|
+
pos: range.from,
|
|
60
|
+
};
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
const subResults: OutlineEntry[] = [];
|
|
68
|
+
node.forEach((child, offset) => {
|
|
69
|
+
subResults.push(
|
|
70
|
+
...this.extractOutline({ node: child, pos: pos + 1 + offset })
|
|
71
|
+
);
|
|
72
|
+
});
|
|
73
|
+
if (parent) {
|
|
74
|
+
parent.children = subResults;
|
|
75
|
+
result = [parent];
|
|
76
|
+
} else {
|
|
77
|
+
result = subResults;
|
|
78
|
+
}
|
|
79
|
+
return result;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
@action
|
|
83
|
+
moveToPosition(pos: number) {
|
|
84
|
+
this.controller.withTransaction((tr) => {
|
|
85
|
+
const resolvedPos = tr.doc.resolve(pos);
|
|
86
|
+
const selection = Selection.near(resolvedPos, 1);
|
|
87
|
+
if (selection) {
|
|
88
|
+
tr.setSelection(selection);
|
|
89
|
+
tr.scrollIntoView();
|
|
90
|
+
}
|
|
91
|
+
return tr;
|
|
92
|
+
});
|
|
93
|
+
this.controller.focus();
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<div {{did-update this.selectionChanged @controller.state}}>
|
|
1
2
|
{{#if this.showCard}}
|
|
2
3
|
<AuCard @flex={{true}} @divided={{true}} @isOpenInitially={{true}} @expandable={{true}} @shadow={{true}} @size="small" as |c|>
|
|
3
4
|
<c.header>
|
|
@@ -31,4 +32,4 @@
|
|
|
31
32
|
</c.content>
|
|
32
33
|
</AuCard>
|
|
33
34
|
{{/if}}
|
|
34
|
-
|
|
35
|
+
</div>
|
|
@@ -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
|
+
import { ProseController } from '@lblod/ember-rdfa-editor/core/prosemirror';
|
|
7
|
+
import { ProseStore } from '@lblod/ember-rdfa-editor/utils/datastore/prose-store';
|
|
8
|
+
import { insertHtml } from '@lblod/ember-rdfa-editor/commands/insert-html-command';
|
|
9
|
+
import { unwrap } from '@lblod/ember-rdfa-editor/utils/option';
|
|
10
|
+
import { getAppliedMarks } from '@lblod/ember-rdfa-editor/plugins/datastore';
|
|
11
|
+
import {
|
|
12
|
+
CodeListOption,
|
|
13
|
+
fetchCodeListOptions,
|
|
14
|
+
} from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/template-variable-plugin/utils/fetch-data';
|
|
15
|
+
import { ZONAL_URI } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/roadsign-regulation-plugin/utils/constants';
|
|
16
|
+
import { MULTI_SELECT_CODELIST_TYPE } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/template-variable-plugin/utils/constants';
|
|
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,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;
|
|
@@ -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,6 @@
|
|
|
1
|
+
export { default as insertStructure } from './insert-structure';
|
|
2
|
+
export { default as moveSelectedStructure } from './move-selected-structure';
|
|
3
|
+
export { default as recalculateStructureNumbers } from './recalculate-structure-numbers';
|
|
4
|
+
export { default as removeStructure } from './remove-structure';
|
|
5
|
+
export { default as unwrapStructure } from './unwrap-structure';
|
|
6
|
+
export { default as wrapStructureContent } from './wrap-structure-content';
|