@lblod/ember-rdfa-editor-lblod-plugins 16.3.0 → 17.0.0-dev.f473cdfb5868261b49cdae52ea2558970c082d01
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/.changeset/afraid-tips-visit.md +5 -0
- package/.changeset/chilly-ravens-think.md +6 -0
- package/.changeset/hot-owls-laugh.md +5 -0
- package/.changeset/olive-pets-cheer.md +5 -0
- package/.changeset/smooth-fireants-doubt.md +5 -0
- package/.changeset/tall-carrots-ring.md +5 -0
- package/.changeset/wet-baboons-serve.md +5 -0
- package/.changeset/witty-suns-speak.md +5 -0
- package/.woodpecker/.release-commit.yml +18 -0
- package/.woodpecker/.release.yml +21 -0
- package/.woodpecker/.verify-pr.yml +30 -0
- package/CHANGELOG.md +20 -0
- package/Dockerfile +6 -4
- package/addon/commands/index.ts +1 -0
- package/addon/commands/replace-selection-and-select-node.ts +24 -0
- package/addon/components/article-structure-plugin/article-structure-card.hbs +2 -1
- package/addon/components/article-structure-plugin/article-structure-card.ts +2 -0
- package/addon/components/article-structure-plugin/structure-card.hbs +7 -6
- package/addon/components/article-structure-plugin/structure-card.ts +49 -35
- package/addon/components/au-native-input.hbs +1 -0
- package/addon/components/au-native-input.ts +2 -1
- package/addon/components/besluit-type-plugin/besluit-type-select.hbs +3 -2
- package/addon/components/besluit-type-plugin/besluit-type-select.ts +4 -0
- package/addon/components/besluit-type-plugin/toolbar-dropdown.hbs +5 -4
- package/addon/components/besluit-type-plugin/toolbar-dropdown.ts +48 -20
- package/addon/components/citation-plugin/citation-card.hbs +4 -3
- package/addon/components/citation-plugin/citation-card.ts +9 -2
- package/addon/components/citation-plugin/citation-insert.hbs +2 -1
- package/addon/components/citation-plugin/citation-insert.ts +3 -0
- package/addon/components/citation-plugin/citations/article-list.hbs +2 -2
- package/addon/components/citation-plugin/citations/article-preview.hbs +3 -2
- package/addon/components/citation-plugin/citations/article-preview.ts +2 -0
- package/addon/components/citation-plugin/citations/legal-document-detail.hbs +19 -11
- package/addon/components/citation-plugin/citations/legal-document-detail.ts +18 -1
- package/addon/components/citation-plugin/citations/legal-document-list.hbs +2 -2
- package/addon/components/citation-plugin/citations/legal-document-preview.hbs +10 -9
- package/addon/components/citation-plugin/citations/legal-document-preview.ts +9 -0
- package/addon/components/citation-plugin/citations/search-modal.hbs +7 -8
- package/addon/components/citation-plugin/citations/search-modal.ts +3 -0
- package/addon/components/common/search/alert-load-error.gts +34 -0
- package/addon/components/common/search/alert-no-items.gts +18 -0
- package/addon/components/common/search/loading.hbs +4 -0
- package/addon/components/confidentiality-plugin/redact.gts +13 -0
- package/addon/components/decision-plugin/decision-plugin-card.hbs +4 -3
- package/addon/components/decision-plugin/decision-plugin-card.ts +3 -0
- package/addon/components/document-title-plugin/insert-title-card.hbs +8 -1
- package/addon/components/document-title-plugin/insert-title-card.ts +3 -0
- package/addon/components/generic-rdfa-variable/insert-menu.hbs +2 -1
- package/addon/components/generic-rdfa-variable/insert-menu.ts +3 -1
- package/addon/components/hover-tooltip.hbs +1 -0
- package/addon/components/import-snippet-plugin/card.hbs +1 -0
- package/addon/components/import-snippet-plugin/card.ts +7 -2
- package/addon/components/loading-alert.hbs +2 -1
- package/addon/components/loading-alert.ts +5 -2
- package/addon/components/pagination/pagination-view.gts +55 -0
- package/addon/components/roadsign-regulation-plugin/expanded-measure.hbs +28 -37
- package/addon/components/roadsign-regulation-plugin/expanded-measure.ts +4 -13
- package/addon/components/roadsign-regulation-plugin/measure-template.hbs +1 -0
- package/addon/components/roadsign-regulation-plugin/roadsign-regulation-card.hbs +2 -1
- package/addon/components/roadsign-regulation-plugin/roadsign-regulation-card.ts +3 -0
- package/addon/components/roadsign-regulation-plugin/roadsigns-modal.hbs +1 -0
- package/addon/components/roadsign-regulation-plugin/roadsigns-pagination.hbs +9 -4
- package/addon/components/roadsign-regulation-plugin/roadsigns-pagination.ts +5 -0
- package/addon/components/roadsign-regulation-plugin/roadsigns-table.hbs +7 -6
- package/addon/components/roadsign-regulation-plugin/roadsigns-table.ts +5 -0
- package/addon/components/snippet-plugin/search-modal.hbs +5 -6
- package/addon/components/snippet-plugin/snippet-insert-rdfa.hbs +7 -0
- package/addon/components/snippet-plugin/snippet-insert-rdfa.ts +78 -0
- package/addon/components/snippet-plugin/snippet-insert.hbs +3 -1
- package/addon/components/snippet-plugin/snippet-insert.ts +25 -4
- package/addon/components/snippet-plugin/snippet-list/snippet-list-modal.hbs +4 -6
- package/addon/components/snippet-plugin/snippet-list/snippet-list-modal.ts +3 -3
- package/addon/components/snippet-plugin/snippet-list/snippet-list-view.hbs +3 -2
- package/addon/components/snippet-plugin/snippet-list-select-rdfa.hbs +8 -0
- package/addon/components/snippet-plugin/snippet-list-select-rdfa.ts +69 -0
- package/addon/components/snippet-plugin/snippet-list-select.hbs +2 -1
- package/addon/components/snippet-plugin/snippet-list-select.ts +2 -1
- package/addon/components/snippet-plugin/snippets/snippet-preview.hbs +1 -0
- package/addon/components/standard-template-plugin/card.hbs +2 -1
- package/addon/components/standard-template-plugin/card.ts +2 -0
- package/addon/components/standard-template-plugin/template-provider.hbs +1 -0
- package/addon/components/standard-template-plugin/template-provider.ts +10 -4
- package/addon/components/table-of-contents-plugin/ember-nodes/table-of-contents.hbs +1 -0
- package/addon/components/table-of-contents-plugin/toolbar-button.hbs +1 -0
- package/addon/components/template-comments-plugin/edit-card.hbs +4 -3
- package/addon/components/template-comments-plugin/edit-card.ts +7 -0
- package/addon/components/template-comments-plugin/insert.hbs +2 -1
- package/addon/components/template-comments-plugin/insert.ts +3 -0
- package/addon/components/template-comments-plugin/template-comment.hbs +2 -1
- package/addon/components/template-comments-plugin/template-comment.ts +3 -0
- package/addon/components/validation-plugin/validation-card.hbs +1 -0
- package/addon/components/validation-plugin/validation-item.hbs +1 -0
- package/addon/components/validation-plugin/validation-item.ts +7 -4
- package/addon/components/variable-plugin/address/edit.hbs +1 -0
- package/addon/components/variable-plugin/address/edit.ts +5 -3
- package/addon/components/variable-plugin/address/insert-variable.hbs +1 -0
- package/addon/components/variable-plugin/address/insert.hbs +3 -2
- package/addon/components/variable-plugin/address/insert.ts +3 -0
- package/addon/components/variable-plugin/address/nodeview.hbs +4 -3
- package/addon/components/variable-plugin/address/nodeview.ts +9 -0
- package/addon/components/variable-plugin/address/utils.ts +28 -3
- package/addon/components/variable-plugin/codelist/edit.hbs +1 -0
- package/addon/components/variable-plugin/codelist/edit.ts +24 -7
- package/addon/components/variable-plugin/codelist/insert.hbs +1 -0
- package/addon/components/variable-plugin/codelist/insert.ts +52 -17
- package/addon/components/variable-plugin/date/date-time-picker.hbs +1 -0
- package/addon/components/variable-plugin/date/edit.hbs +27 -31
- package/addon/components/variable-plugin/date/edit.ts +47 -8
- package/addon/components/variable-plugin/date/help-modal.hbs +1 -0
- package/addon/components/variable-plugin/date/insert-variable.hbs +1 -0
- package/addon/components/variable-plugin/date/insert-variable.ts +36 -10
- package/addon/components/variable-plugin/date/insert.hbs +2 -1
- package/addon/components/variable-plugin/date/insert.ts +38 -10
- package/addon/components/variable-plugin/date/nodeview.hbs +4 -3
- package/addon/components/variable-plugin/date/nodeview.ts +11 -1
- package/addon/components/variable-plugin/insert-variable-card.hbs +1 -0
- package/addon/components/variable-plugin/insert-variable-card.ts +9 -1
- package/addon/components/variable-plugin/location/edit.hbs +1 -0
- package/addon/components/variable-plugin/location/edit.ts +1 -9
- package/addon/components/variable-plugin/location/insert.hbs +1 -0
- package/addon/components/variable-plugin/location/insert.ts +4 -7
- package/addon/components/variable-plugin/location/nodeview.hbs +19 -8
- package/addon/components/variable-plugin/location/nodeview.ts +37 -9
- package/addon/components/variable-plugin/number/insert.hbs +1 -0
- package/addon/components/variable-plugin/number/insert.ts +34 -10
- package/addon/components/variable-plugin/number/nodeview.hbs +7 -5
- package/addon/components/variable-plugin/number/nodeview.ts +32 -5
- package/addon/components/variable-plugin/text/insert.hbs +1 -0
- package/addon/components/variable-plugin/text/insert.ts +40 -12
- package/addon/components/variable-plugin/variable/nodeview.hbs +12 -8
- package/addon/components/variable-plugin/variable/nodeview.ts +16 -9
- package/addon/components/worship-plugin/administrative-unit-picker.hbs +16 -0
- package/addon/components/worship-plugin/administrative-unit-picker.ts +38 -0
- package/addon/components/worship-plugin/insert.hbs +18 -0
- package/addon/components/worship-plugin/insert.ts +41 -0
- package/addon/components/worship-plugin/list.hbs +46 -0
- package/addon/components/worship-plugin/search-modal.hbs +79 -0
- package/addon/components/worship-plugin/search-modal.ts +131 -0
- package/addon/components/worship-plugin/sortable-table-header.hbs +36 -0
- package/addon/components/worship-plugin/sortable-table-header.ts +45 -0
- package/addon/plugins/article-structure-plugin/commands/insert-structure.ts +82 -15
- package/addon/plugins/article-structure-plugin/commands/move-selected-structure.ts +2 -1
- package/addon/plugins/article-structure-plugin/commands/recalculate-structure-numbers.ts +70 -2
- package/addon/plugins/article-structure-plugin/commands/remove-structure.ts +1 -1
- package/addon/plugins/article-structure-plugin/commands/set-structure-start-number.ts +5 -14
- package/addon/plugins/article-structure-plugin/commands/unwrap-structure.ts +1 -1
- package/addon/plugins/article-structure-plugin/commands/wrap-structure-content.ts +197 -105
- package/addon/plugins/article-structure-plugin/index.ts +16 -7
- package/addon/plugins/article-structure-plugin/structures/article-paragraph.ts +181 -71
- package/addon/plugins/article-structure-plugin/structures/article.ts +91 -98
- package/addon/plugins/article-structure-plugin/structures/chapter.ts +89 -39
- package/addon/plugins/article-structure-plugin/structures/index.ts +12 -1
- package/addon/plugins/article-structure-plugin/structures/section.ts +88 -39
- package/addon/plugins/article-structure-plugin/structures/structure-header-number.ts +56 -0
- package/addon/plugins/article-structure-plugin/structures/structure-header-title.ts +38 -0
- package/addon/plugins/article-structure-plugin/structures/structure-header.ts +87 -73
- package/addon/plugins/article-structure-plugin/structures/subsection.ts +81 -39
- package/addon/plugins/article-structure-plugin/structures/title.ts +91 -39
- package/addon/plugins/article-structure-plugin/utils/structure.ts +223 -127
- package/addon/plugins/citation-plugin/utils/cited-text.ts +38 -8
- package/addon/plugins/confidentiality-plugin/marks/redacted.ts +1 -1
- package/addon/plugins/document-title-plugin/nodes/document-title.ts +4 -3
- package/addon/plugins/roadsign-regulation-plugin/nodes.ts +4 -3
- package/addon/plugins/snippet-plugin/commands/index.ts +1 -0
- package/addon/plugins/snippet-plugin/commands/update-snippet-ids.ts +55 -0
- package/addon/plugins/snippet-plugin/index.ts +6 -1
- package/addon/plugins/snippet-plugin/utils/fetch-data.ts +1 -3
- package/addon/plugins/snippet-plugin/utils/rdfa-predicate.ts +33 -0
- package/addon/plugins/standard-template-plugin/utils/nodes.ts +293 -81
- package/addon/plugins/table-of-contents-plugin/nodes/table-of-contents.ts +3 -2
- package/addon/plugins/variable-plugin/utils/attribute-parsers.ts +19 -1
- package/addon/plugins/variable-plugin/utils/dom-constructors.ts +3 -3
- package/addon/plugins/variable-plugin/variables/address.ts +93 -26
- package/addon/plugins/variable-plugin/variables/codelist.ts +99 -50
- package/addon/plugins/variable-plugin/variables/date.ts +143 -53
- package/addon/plugins/variable-plugin/variables/location.ts +1 -0
- package/addon/plugins/variable-plugin/variables/number.ts +99 -52
- package/addon/plugins/variable-plugin/variables/text.ts +80 -28
- package/addon/plugins/worship-plugin/index.ts +9 -0
- package/addon/plugins/worship-plugin/utils/fetchAdministrativeUnits.ts +52 -0
- package/addon/plugins/worship-plugin/utils/fetchWorshipServices.ts +109 -0
- package/addon/plugins/worship-plugin/utils/insertWorshipService.ts +16 -0
- package/addon/utils/_private/find-insertion-range.ts +18 -5
- package/addon/utils/dom-utils.ts +4 -0
- package/addon/utils/namespace.ts +63 -13
- package/addon/utils/sparql-helpers.ts +8 -0
- package/app/components/{citation-plugin/helpers/alert-no-items.js → common/search/alert-load-error.js} +1 -1
- package/app/components/{snippet-plugin/helpers → common/search}/alert-no-items.js +1 -1
- package/app/components/{snippet-plugin/helpers/alert-load-error.js → common/search/loading.js} +1 -1
- package/app/components/{citation-plugin/helpers/alert-load-error.js → snippet-plugin/snippet-list-insert-rdfa.js} +1 -1
- package/app/components/snippet-plugin/snippet-list-select-rdfa.js +1 -0
- package/app/components/worship-plugin/administrative-unit-picker.js +1 -0
- package/app/components/worship-plugin/insert.js +1 -0
- package/app/components/worship-plugin/list.js +1 -0
- package/app/components/worship-plugin/search-modal.js +1 -0
- package/app/components/worship-plugin/sortable-table-header.js +1 -0
- package/app/styles/article-structure-plugin.scss +106 -3
- package/app/styles/citaten-plugin.scss +1 -1
- package/app/styles/snippet-plugin.scss +1 -1
- package/app/styles/worship-plugin.scss +19 -0
- package/declarations/addon/commands/index.d.ts +1 -0
- package/declarations/addon/commands/replace-selection-and-select-node.d.ts +3 -0
- package/{components → declarations/addon/components}/article-structure-plugin/article-structure-card.d.ts +1 -0
- package/{components → declarations/addon/components}/article-structure-plugin/structure-card.d.ts +5 -2
- package/{components → declarations/addon/components}/au-native-input.d.ts +2 -1
- package/{components → declarations/addon/components}/besluit-type-plugin/besluit-type-select.d.ts +1 -0
- package/{components → declarations/addon/components}/besluit-type-plugin/toolbar-dropdown.d.ts +4 -5
- package/{components → declarations/addon/components}/citation-plugin/citation-card.d.ts +3 -2
- package/{components → declarations/addon/components}/citation-plugin/citation-insert.d.ts +1 -0
- package/declarations/addon/components/citation-plugin/citations/article-list.d.ts +1 -0
- package/{components → declarations/addon/components}/citation-plugin/citations/article-preview.d.ts +2 -1
- package/{components → declarations/addon/components}/citation-plugin/citations/legal-document-detail.d.ts +8 -1
- package/declarations/addon/components/citation-plugin/citations/legal-document-list.d.ts +1 -0
- package/declarations/addon/components/citation-plugin/citations/legal-document-preview.d.ts +14 -0
- package/{components → declarations/addon/components}/citation-plugin/citations/search-modal.d.ts +1 -0
- package/declarations/addon/components/common/search/alert-load-error.d.ts +4 -0
- package/declarations/addon/components/common/search/alert-no-items.d.ts +4 -0
- package/declarations/addon/components/common/search/loading.d.ts +1 -0
- package/declarations/addon/components/confidentiality-plugin/redact.d.ts +4 -0
- package/declarations/addon/components/confidentiality-plugin/toolbar.d.ts +1 -0
- package/{components → declarations/addon/components}/decision-plugin/decision-plugin-card.d.ts +1 -0
- package/{components → declarations/addon/components}/document-title-plugin/insert-title-card.d.ts +1 -0
- package/{components → declarations/addon/components}/generic-rdfa-variable/insert-menu.d.ts +1 -0
- package/{components → declarations/addon/components}/import-snippet-plugin/card.d.ts +6 -5
- package/{components → declarations/addon/components}/loading-alert.d.ts +1 -0
- package/declarations/addon/components/pagination/pagination-view.d.ts +4 -0
- package/{components → declarations/addon/components}/roadsign-regulation-plugin/expanded-measure.d.ts +2 -2
- package/{components → declarations/addon/components}/roadsign-regulation-plugin/roadsign-regulation-card.d.ts +1 -0
- package/{components → declarations/addon/components}/roadsign-regulation-plugin/roadsigns-pagination.d.ts +2 -0
- package/{components → declarations/addon/components}/roadsign-regulation-plugin/roadsigns-table.d.ts +2 -0
- package/declarations/addon/components/snippet-plugin/snippet-insert-rdfa.d.ts +19 -0
- package/{components → declarations/addon/components}/snippet-plugin/snippet-insert.d.ts +3 -0
- package/declarations/addon/components/snippet-plugin/snippet-list-select-rdfa.d.ts +21 -0
- package/{components → declarations/addon/components}/snippet-plugin/snippet-list-select.d.ts +1 -0
- package/declarations/addon/components/snippet-plugin/snippets/snippet-list.d.ts +1 -0
- package/{components → declarations/addon/components}/standard-template-plugin/card.d.ts +1 -0
- package/declarations/addon/components/table-of-contents-plugin/ember-nodes/outline.d.ts +1 -0
- package/{components → declarations/addon/components}/template-comments-plugin/edit-card.d.ts +3 -0
- package/{components → declarations/addon/components}/template-comments-plugin/insert.d.ts +1 -0
- package/{components → declarations/addon/components}/template-comments-plugin/template-comment.d.ts +1 -0
- package/{components → declarations/addon/components}/validation-plugin/validation-item.d.ts +2 -2
- package/{components → declarations/addon/components}/variable-plugin/address/edit.d.ts +2 -2
- package/{components → declarations/addon/components}/variable-plugin/address/insert.d.ts +1 -0
- package/{components → declarations/addon/components}/variable-plugin/address/nodeview.d.ts +2 -0
- package/{components → declarations/addon/components}/variable-plugin/date/edit.d.ts +4 -2
- package/{components → declarations/addon/components}/variable-plugin/date/insert.d.ts +1 -0
- package/{components → declarations/addon/components}/variable-plugin/date/nodeview.d.ts +2 -0
- package/{components → declarations/addon/components}/variable-plugin/insert-variable-card.d.ts +9 -1
- package/{components → declarations/addon/components}/variable-plugin/location/edit.d.ts +0 -1
- package/declarations/addon/components/variable-plugin/location/nodeview.d.ts +11 -0
- package/{components → declarations/addon/components}/variable-plugin/number/nodeview.d.ts +4 -1
- package/{components → declarations/addon/components}/variable-plugin/text/insert.d.ts +1 -1
- package/declarations/addon/components/variable-plugin/utils/label-input.d.ts +1 -0
- package/declarations/addon/components/variable-plugin/variable/nodeview.d.ts +11 -0
- package/declarations/addon/components/worship-plugin/administrative-unit-picker.d.ts +12 -0
- package/declarations/addon/components/worship-plugin/insert.d.ts +17 -0
- package/declarations/addon/components/worship-plugin/list.d.ts +1 -0
- package/declarations/addon/components/worship-plugin/search-modal.d.ts +30 -0
- package/declarations/addon/components/worship-plugin/sortable-table-header.d.ts +16 -0
- package/declarations/addon/plugins/article-structure-plugin/commands/recalculate-structure-numbers.d.ts +3 -0
- package/declarations/addon/plugins/article-structure-plugin/commands/set-structure-start-number.d.ts +7 -0
- package/{plugins → declarations/addon/plugins}/article-structure-plugin/index.d.ts +15 -7
- package/{plugins → declarations/addon/plugins}/article-structure-plugin/structures/article-paragraph.d.ts +2 -0
- package/declarations/addon/plugins/article-structure-plugin/structures/article.d.ts +5 -0
- package/{plugins → declarations/addon/plugins}/article-structure-plugin/structures/index.d.ts +4 -0
- package/declarations/addon/plugins/article-structure-plugin/structures/structure-header-number.d.ts +2 -0
- package/declarations/addon/plugins/article-structure-plugin/structures/structure-header-title.d.ts +2 -0
- package/declarations/addon/plugins/article-structure-plugin/structures/structure-header.d.ts +17 -0
- package/declarations/addon/plugins/article-structure-plugin/utils/structure.d.ts +42 -0
- package/declarations/addon/plugins/confidentiality-plugin/marks/redacted.d.ts +2 -0
- package/declarations/addon/plugins/snippet-plugin/commands/index.d.ts +1 -0
- package/declarations/addon/plugins/snippet-plugin/commands/update-snippet-ids.d.ts +8 -0
- package/{plugins → declarations/addon/plugins}/snippet-plugin/index.d.ts +2 -0
- package/declarations/addon/plugins/snippet-plugin/utils/rdfa-predicate.d.ts +5 -0
- package/{plugins → declarations/addon/plugins}/table-of-contents-plugin/nodes/table-of-contents.d.ts +1 -1
- package/{plugins → declarations/addon/plugins}/template-comments-plugin/node.d.ts +1 -1
- package/{plugins → declarations/addon/plugins}/variable-plugin/utils/attribute-parsers.d.ts +3 -0
- package/{plugins → declarations/addon/plugins}/variable-plugin/variables/address.d.ts +1 -1
- package/{plugins → declarations/addon/plugins}/variable-plugin/variables/codelist.d.ts +1 -1
- package/{plugins → declarations/addon/plugins}/variable-plugin/variables/date.d.ts +1 -1
- package/{plugins → declarations/addon/plugins}/variable-plugin/variables/location.d.ts +1 -1
- package/{plugins → declarations/addon/plugins}/variable-plugin/variables/number.d.ts +1 -1
- package/{plugins → declarations/addon/plugins}/variable-plugin/variables/text.d.ts +1 -1
- package/declarations/addon/plugins/worship-plugin/index.d.ts +8 -0
- package/declarations/addon/plugins/worship-plugin/utils/fetchAdministrativeUnits.d.ts +7 -0
- package/declarations/addon/plugins/worship-plugin/utils/fetchWorshipServices.d.ts +23 -0
- package/declarations/addon/plugins/worship-plugin/utils/insertWorshipService.d.ts +3 -0
- package/declarations/addon/serializers/application.d.ts +3 -0
- package/{services → declarations/addon/services}/import-rdfa-snippet.d.ts +2 -0
- package/{utils → declarations/addon/utils}/_private/find-insertion-range.d.ts +7 -4
- package/declarations/addon/utils/dom-utils.d.ts +2 -0
- package/declarations/addon/utils/namespace.d.ts +21 -0
- package/{utils → declarations/addon/utils}/sparql-helpers.d.ts +4 -0
- package/package.json +54 -19
- package/pnpm-lock.yaml +17788 -0
- package/scripts/generate-type-declarations.sh +16 -0
- package/translations/en-US.yaml +27 -12
- package/translations/nl-BE.yaml +27 -12
- package/tsconfig.declarations.json +15 -0
- package/tsconfig.json +7 -57
- package/tsconfig.main.json +62 -0
- package/types/ember-intl.d.ts +15 -0
- package/types/graphy/memory.dataset.fast.d.ts +74 -0
- package/.woodpecker/.test.yml +0 -49
- package/addon/components/citation-plugin/helpers/alert-load-error.hbs +0 -21
- package/addon/components/citation-plugin/helpers/alert-no-items.hbs +0 -10
- package/addon/components/confidentiality-plugin/redact.hbs +0 -6
- package/addon/components/pagination/pagination-view.hbs +0 -39
- package/addon/components/snippet-plugin/helpers/alert-load-error.hbs +0 -22
- package/addon/components/snippet-plugin/helpers/alert-no-items.hbs +0 -8
- package/components/citation-plugin/citations/legal-document-preview.d.ts +0 -10
- package/components/variable-plugin/location/nodeview.d.ts +0 -12
- package/components/variable-plugin/variable/nodeview.d.ts +0 -11
- package/plugins/article-structure-plugin/commands/recalculate-structure-numbers.d.ts +0 -3
- package/plugins/article-structure-plugin/commands/set-structure-start-number.d.ts +0 -4
- package/plugins/article-structure-plugin/structures/article.d.ts +0 -6
- package/plugins/article-structure-plugin/structures/structure-header.d.ts +0 -2
- package/plugins/article-structure-plugin/utils/structure.d.ts +0 -36
- package/plugins/confidentiality-plugin/marks/redacted.d.ts +0 -2
- package/utils/namespace.d.ts +0 -12
- package/{components → declarations/addon/components}/hover-tooltip.d.ts +0 -0
- package/{components → declarations/addon/components}/roadsign-regulation-plugin/measure-template.d.ts +0 -0
- package/{components → declarations/addon/components}/roadsign-regulation-plugin/roadsigns-modal.d.ts +0 -0
- package/{components → declarations/addon/components}/snippet-plugin/search-modal.d.ts +0 -0
- package/{components → declarations/addon/components}/snippet-plugin/snippet-list/snippet-list-modal.d.ts +0 -0
- package/{components → declarations/addon/components}/snippet-plugin/snippet-list/snippet-list-view.d.ts +0 -0
- package/{components → declarations/addon/components}/snippet-plugin/snippets/snippet-preview.d.ts +0 -0
- package/{components → declarations/addon/components}/standard-template-plugin/template-provider.d.ts +0 -0
- package/{components → declarations/addon/components}/table-of-contents-plugin/ember-nodes/table-of-contents.d.ts +0 -0
- package/{components → declarations/addon/components}/table-of-contents-plugin/toolbar-button.d.ts +0 -0
- package/{components → declarations/addon/components}/validation-plugin/validation-card.d.ts +0 -0
- package/{components → declarations/addon/components}/variable-plugin/address/insert-variable.d.ts +0 -0
- package/{components → declarations/addon/components}/variable-plugin/address/utils.d.ts +0 -0
- package/{components → declarations/addon/components}/variable-plugin/codelist/edit.d.ts +0 -0
- package/{components → declarations/addon/components}/variable-plugin/codelist/insert.d.ts +0 -0
- package/{components → declarations/addon/components}/variable-plugin/date/date-time-picker.d.ts +0 -0
- package/{components → declarations/addon/components}/variable-plugin/date/help-modal.d.ts +0 -0
- package/{components → declarations/addon/components}/variable-plugin/date/insert-variable.d.ts +0 -0
- package/{components → declarations/addon/components}/variable-plugin/location/insert.d.ts +0 -0
- package/{components → declarations/addon/components}/variable-plugin/number/insert.d.ts +0 -0
- package/{helpers → declarations/addon/helpers}/capitalize.d.ts +0 -0
- package/{helpers → declarations/addon/helpers}/in-array.d.ts +0 -0
- package/{helpers → declarations/addon/helpers}/limit-text.d.ts +0 -0
- package/{helpers → declarations/addon/helpers}/pagination.d.ts +0 -0
- package/{models → declarations/addon/models}/instruction.d.ts +0 -0
- package/{models → declarations/addon/models}/measure.d.ts +0 -0
- package/{models → declarations/addon/models}/sign.d.ts +0 -0
- package/{models → declarations/addon/models}/template.d.ts +0 -0
- package/{plugins → declarations/addon/plugins}/article-structure-plugin/commands/index.d.ts +0 -0
- package/{plugins → declarations/addon/plugins}/article-structure-plugin/commands/insert-structure.d.ts +0 -0
- package/{plugins → declarations/addon/plugins}/article-structure-plugin/commands/move-selected-structure.d.ts +0 -0
- package/{plugins → declarations/addon/plugins}/article-structure-plugin/commands/remove-structure.d.ts +0 -0
- package/{plugins → declarations/addon/plugins}/article-structure-plugin/commands/unwrap-structure.d.ts +0 -0
- package/{plugins → declarations/addon/plugins}/article-structure-plugin/commands/wrap-structure-content.d.ts +1 -1
- /package/{plugins → declarations/addon/plugins}/article-structure-plugin/structures/chapter.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/article-structure-plugin/structures/section.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/article-structure-plugin/structures/subsection.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/article-structure-plugin/structures/title.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/article-structure-plugin/utils/romanize.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/besluit-type-plugin/index.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/besluit-type-plugin/utils/fetchBesluitTypes.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/citation-plugin/index.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/citation-plugin/utils/article.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/citation-plugin/utils/cache.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/citation-plugin/utils/cited-text.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/citation-plugin/utils/legal-documents.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/citation-plugin/utils/process-match.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/citation-plugin/utils/public-decisions.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/citation-plugin/utils/types.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/citation-plugin/utils/utils.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/citation-plugin/utils/vlaamse-codex.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/confidentiality-plugin/index.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/decision-plugin/commands/index.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/decision-plugin/commands/insert-article-container.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/decision-plugin/commands/insert-description.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/decision-plugin/commands/insert-motivation.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/decision-plugin/commands/insert-title.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/decision-plugin/utils/get-title-for-decision.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/decision-plugin/utils/validation-rules.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/document-title-plugin/commands/insert-document-title.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/document-title-plugin/nodes/document-title.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/document-title-plugin/nodes/index.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/generic-rdfa-variable/commands/index.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/generic-rdfa-variable/commands/insert-generic-rdfa.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/roadsign-regulation-plugin/index.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/roadsign-regulation-plugin/nodes.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/roadsign-regulation-plugin/utils/constants.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/roadsign-regulation-plugin/utils/fetchData.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/roadsign-regulation-plugin/utils/includeInstructions.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/snippet-plugin/utils/fetch-data.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/standard-template-plugin/index.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/standard-template-plugin/utils/instantiate-uuids.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/standard-template-plugin/utils/nodes.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/table-of-contents-plugin/index.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/table-of-contents-plugin/nodes/index.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/table-of-contents-plugin/utils/index.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/template-comments-plugin/index.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/validation/index.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/validation/utils/transaction-complies-with-shapes.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/variable-plugin/utils/address-helpers.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/variable-plugin/utils/codelist-utils.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/variable-plugin/utils/constants.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/variable-plugin/utils/date-helpers.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/variable-plugin/utils/dom-constructors.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/variable-plugin/utils/fetch-data.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/variable-plugin/utils/number-to-words.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/variable-plugin/variables/index.d.ts +0 -0
- /package/{services → declarations/addon/services}/roadsign-registry.d.ts +0 -0
- /package/{utils → declarations/addon/utils}/changed-descendants.d.ts +0 -0
- /package/{utils → declarations/addon/utils}/constants.d.ts +0 -0
- /package/{utils → declarations/addon/utils}/dom-output-spec-helpers.d.ts +0 -0
- /package/{utils → declarations/addon/utils}/find-insertion-contentmatch.d.ts +0 -0
- /package/{utils → declarations/addon/utils}/find-insertion-pos-in-ancestor-of-type.d.ts +0 -0
- /package/{utils → declarations/addon/utils}/memoize.d.ts +0 -0
- /package/{utils → declarations/addon/utils}/option.d.ts +0 -0
- /package/{utils → declarations/addon/utils}/strings.d.ts +0 -0
- /package/{utils → declarations/addon/utils}/translation.d.ts +0 -0
- /package/{utils → declarations/addon/utils}/types.d.ts +0 -0
|
@@ -1,15 +1,43 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
|
-
import {
|
|
2
|
+
import { NodeSelection, ProsePlugin, SayView } from '@lblod/ember-rdfa-editor';
|
|
3
|
+
import { editableNodePlugin } from '@lblod/ember-rdfa-editor/plugins/editable-node';
|
|
3
4
|
import { tracked } from '@glimmer/tracking';
|
|
4
|
-
import {
|
|
5
|
+
import { action } from '@ember/object';
|
|
6
|
+
import { PencilIcon } from '@appuniversum/ember-appuniversum/components/icons/pencil';
|
|
7
|
+
import { EmberNodeArgs } from '@lblod/ember-rdfa-editor/utils/ember-node';
|
|
5
8
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
+
export default class LocationNodeViewComponent extends Component<EmberNodeArgs> {
|
|
10
|
+
PencilIcon = PencilIcon;
|
|
9
11
|
|
|
10
|
-
export default class LocationNodeViewComponent extends Component<Args> {
|
|
11
|
-
@tracked nodeViews = {
|
|
12
|
-
address: addressView(this.args.controller),
|
|
13
|
-
};
|
|
14
12
|
@tracked innerView?: SayView;
|
|
13
|
+
|
|
14
|
+
get plugins(): ProsePlugin[] {
|
|
15
|
+
return [editableNodePlugin(this.args.getPos)];
|
|
16
|
+
}
|
|
17
|
+
@action
|
|
18
|
+
onClick() {
|
|
19
|
+
if (this.innerView) {
|
|
20
|
+
if (this.innerView.state.doc.firstChild?.type.name === 'placeholder') {
|
|
21
|
+
this.innerView.focus();
|
|
22
|
+
// Use request animation frame to only change the selection when the focus has been established
|
|
23
|
+
window.requestAnimationFrame(() => {
|
|
24
|
+
if (this.innerView) {
|
|
25
|
+
const tr = this.innerView.state.tr;
|
|
26
|
+
tr.setSelection(NodeSelection.create(this.innerView?.state.doc, 0));
|
|
27
|
+
this.innerView?.dispatch(tr);
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
} else {
|
|
31
|
+
this.innerView.focus();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
@action
|
|
36
|
+
initEditor(view: SayView) {
|
|
37
|
+
this.innerView = view;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
get label() {
|
|
41
|
+
return this.args.node.attrs.label as string;
|
|
42
|
+
}
|
|
15
43
|
}
|
|
@@ -7,6 +7,13 @@ import { isNumber } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/strings';
|
|
|
7
7
|
import { service } from '@ember/service';
|
|
8
8
|
import IntlService from 'ember-intl/services/intl';
|
|
9
9
|
import { modifier } from 'ember-modifier';
|
|
10
|
+
import { sayDataFactory } from '@lblod/ember-rdfa-editor/core/say-data-factory';
|
|
11
|
+
import {
|
|
12
|
+
DCT,
|
|
13
|
+
EXT,
|
|
14
|
+
RDF,
|
|
15
|
+
} from '@lblod/ember-rdfa-editor-lblod-plugins/utils/constants';
|
|
16
|
+
import { replaceSelectionWithAndSelectNode } from '@lblod/ember-rdfa-editor-lblod-plugins/commands';
|
|
10
17
|
|
|
11
18
|
type Args = {
|
|
12
19
|
controller: SayController;
|
|
@@ -85,17 +92,37 @@ export default class NumberInsertComponent extends Component<Args> {
|
|
|
85
92
|
if (this.numberVariableError !== '') return;
|
|
86
93
|
|
|
87
94
|
const mappingResource = `http://data.lblod.info/mappings/${uuidv4()}`;
|
|
95
|
+
const subject = mappingResource;
|
|
88
96
|
const variableInstance = `http://data.lblod.info/variables/${uuidv4()}`;
|
|
89
97
|
|
|
90
98
|
const defaultLabel = this.intl.t('variable.number.label', {
|
|
91
99
|
locale: this.documentLanguage,
|
|
92
100
|
});
|
|
101
|
+
const label = this.label ?? defaultLabel;
|
|
102
|
+
const variableId = uuidv4();
|
|
93
103
|
|
|
94
104
|
const node = this.schema.nodes.number.create({
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
105
|
+
subject,
|
|
106
|
+
rdfaNodeType: 'resource',
|
|
107
|
+
__rdfaId: variableId,
|
|
108
|
+
properties: [
|
|
109
|
+
{
|
|
110
|
+
predicate: RDF('type').full,
|
|
111
|
+
object: sayDataFactory.namedNode(EXT('Mapping').full),
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
predicate: EXT('instance').full,
|
|
115
|
+
object: sayDataFactory.namedNode(variableInstance),
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
predicate: EXT('label').full,
|
|
119
|
+
object: sayDataFactory.literal(label),
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
predicate: DCT('type').full,
|
|
123
|
+
object: sayDataFactory.literal('number'),
|
|
124
|
+
},
|
|
125
|
+
],
|
|
99
126
|
...(isNumber(this.minimumValue) && {
|
|
100
127
|
minimumValue: Number(this.minimumValue),
|
|
101
128
|
}),
|
|
@@ -108,11 +135,8 @@ export default class NumberInsertComponent extends Component<Args> {
|
|
|
108
135
|
this.minimumValue = '';
|
|
109
136
|
this.maximumValue = '';
|
|
110
137
|
|
|
111
|
-
this.controller.
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
},
|
|
115
|
-
{ view: this.controller.mainEditorView },
|
|
116
|
-
);
|
|
138
|
+
this.controller.doCommand(replaceSelectionWithAndSelectNode(node), {
|
|
139
|
+
view: this.controller.mainEditorView,
|
|
140
|
+
});
|
|
117
141
|
}
|
|
118
142
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
{{! @glint-nocheck: not typesafe yet }}
|
|
1
2
|
<this.Velcro
|
|
2
3
|
@placement='bottom-start'
|
|
3
4
|
@offsetOptions={{hash mainAxis=3}} as |velcro|
|
|
4
5
|
>
|
|
5
6
|
<AuPill
|
|
6
|
-
@icon=
|
|
7
|
+
@icon={{this.PencilIcon}}
|
|
7
8
|
@iconAlignment='right'
|
|
8
9
|
class='variable atomic'
|
|
9
10
|
{{velcro.hook}}
|
|
@@ -16,9 +17,9 @@
|
|
|
16
17
|
{{this.translations.placeholder}}
|
|
17
18
|
</span>
|
|
18
19
|
{{/if}}
|
|
19
|
-
{{#if
|
|
20
|
+
{{#if this.label}}
|
|
20
21
|
<span class='label'>
|
|
21
|
-
({{
|
|
22
|
+
({{this.label}})
|
|
22
23
|
</span>
|
|
23
24
|
{{/if}}
|
|
24
25
|
</AuPill>
|
|
@@ -45,8 +46,9 @@
|
|
|
45
46
|
@name='writtenNumber'
|
|
46
47
|
@checked={{this.writtenNumber}}
|
|
47
48
|
@onChange={{this.changeWrittenNumber}}
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
>
|
|
50
|
+
{{t 'variable.number.written-number-label'}}
|
|
51
|
+
</AuToggleSwitch>
|
|
50
52
|
{{#if this.errorMessage}}
|
|
51
53
|
<AuHelpText @small={{true}} @error={{true}}>
|
|
52
54
|
{{this.errorMessage}}
|
|
@@ -10,9 +10,14 @@ import { service } from '@ember/service';
|
|
|
10
10
|
import intlService from 'ember-intl/services/intl';
|
|
11
11
|
import { localCopy } from 'tracked-toolbox';
|
|
12
12
|
import { isBlank } from '@ember/utils';
|
|
13
|
+
import { Velcro } from 'ember-velcro';
|
|
14
|
+
import { isRdfaAttrs } from '@lblod/ember-rdfa-editor/core/schema';
|
|
15
|
+
import { sayDataFactory } from '@lblod/ember-rdfa-editor/core/say-data-factory';
|
|
13
16
|
import { isNumber } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/strings';
|
|
14
17
|
import { numberToWords } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/variable-plugin/utils/number-to-words';
|
|
15
|
-
import {
|
|
18
|
+
import { EXT } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/constants';
|
|
19
|
+
import { getOutgoingTriple } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/namespace';
|
|
20
|
+
import { PencilIcon } from '@appuniversum/ember-appuniversum/components/icons/pencil';
|
|
16
21
|
|
|
17
22
|
type Args = {
|
|
18
23
|
getPos: () => number | undefined;
|
|
@@ -25,9 +30,10 @@ type Args = {
|
|
|
25
30
|
};
|
|
26
31
|
|
|
27
32
|
export default class NumberNodeviewComponent extends Component<Args> {
|
|
33
|
+
PencilIcon = PencilIcon;
|
|
28
34
|
Velcro = Velcro;
|
|
29
35
|
|
|
30
|
-
@localCopy('
|
|
36
|
+
@localCopy('number', '') declare inputNumber: string;
|
|
31
37
|
@localCopy('args.node.attrs.writtenNumber', false)
|
|
32
38
|
declare writtenNumber: boolean;
|
|
33
39
|
@service declare intl: intlService;
|
|
@@ -57,9 +63,12 @@ export default class NumberNodeviewComponent extends Component<Args> {
|
|
|
57
63
|
return this.args.node;
|
|
58
64
|
}
|
|
59
65
|
|
|
60
|
-
get
|
|
61
|
-
|
|
66
|
+
get number(): string | null | undefined {
|
|
67
|
+
return getOutgoingTriple(this.node.attrs, EXT('content'))?.object.value;
|
|
68
|
+
}
|
|
62
69
|
|
|
70
|
+
get formattedNumber() {
|
|
71
|
+
const value = this.number;
|
|
63
72
|
if (!isNumber(value)) {
|
|
64
73
|
return value;
|
|
65
74
|
}
|
|
@@ -82,6 +91,10 @@ export default class NumberNodeviewComponent extends Component<Args> {
|
|
|
82
91
|
return this.node.attrs.maximumValue as number;
|
|
83
92
|
}
|
|
84
93
|
|
|
94
|
+
get label(): string | undefined {
|
|
95
|
+
return getOutgoingTriple(this.args.node.attrs, EXT('label'))?.object.value;
|
|
96
|
+
}
|
|
97
|
+
|
|
85
98
|
@action onInputNumberChange(event: InputEvent) {
|
|
86
99
|
this.inputNumber = (event.target as HTMLInputElement).value;
|
|
87
100
|
this.validateAndSave();
|
|
@@ -125,7 +138,21 @@ export default class NumberNodeviewComponent extends Component<Args> {
|
|
|
125
138
|
@action
|
|
126
139
|
validateAndSave() {
|
|
127
140
|
if (!this.errorMessage) {
|
|
128
|
-
this.
|
|
141
|
+
const attrs = this.node.attrs;
|
|
142
|
+
const properties =
|
|
143
|
+
isRdfaAttrs(attrs) && attrs.rdfaNodeType === 'resource'
|
|
144
|
+
? attrs.properties
|
|
145
|
+
: [];
|
|
146
|
+
const newProperties = properties.filter((prop) => {
|
|
147
|
+
return !EXT('content').matches(prop.predicate);
|
|
148
|
+
});
|
|
149
|
+
if (this.inputNumber) {
|
|
150
|
+
newProperties.push({
|
|
151
|
+
predicate: EXT('content').full,
|
|
152
|
+
object: sayDataFactory.literal(this.inputNumber),
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
this.args.updateAttribute('properties', newProperties);
|
|
129
156
|
}
|
|
130
157
|
}
|
|
131
158
|
}
|
|
@@ -2,9 +2,16 @@ import Component from '@glimmer/component';
|
|
|
2
2
|
import { tracked } from '@glimmer/tracking';
|
|
3
3
|
import { action } from '@ember/object';
|
|
4
4
|
import { service } from '@ember/service';
|
|
5
|
-
import { SayController } from '@lblod/ember-rdfa-editor';
|
|
5
|
+
import { type SayController } from '@lblod/ember-rdfa-editor';
|
|
6
|
+
import { sayDataFactory } from '@lblod/ember-rdfa-editor/core/say-data-factory';
|
|
6
7
|
import { v4 as uuidv4 } from 'uuid';
|
|
7
8
|
import IntlService from 'ember-intl/services/intl';
|
|
9
|
+
import {
|
|
10
|
+
DCT,
|
|
11
|
+
EXT,
|
|
12
|
+
RDF,
|
|
13
|
+
} from '@lblod/ember-rdfa-editor-lblod-plugins/utils/constants';
|
|
14
|
+
import { replaceSelectionWithAndSelectNode } from '@lblod/ember-rdfa-editor-lblod-plugins/commands';
|
|
8
15
|
|
|
9
16
|
type Args = {
|
|
10
17
|
controller: SayController;
|
|
@@ -33,29 +40,50 @@ export default class TextVariableInsertComponent extends Component<Args> {
|
|
|
33
40
|
|
|
34
41
|
@action
|
|
35
42
|
insert() {
|
|
36
|
-
const
|
|
43
|
+
const mappingSubject = `http://data.lblod.info/mappings/${uuidv4()}`;
|
|
37
44
|
const variableInstance = `http://data.lblod.info/variables/${uuidv4()}`;
|
|
45
|
+
const variableId = uuidv4();
|
|
38
46
|
|
|
39
47
|
const placeholder = this.intl.t('variable.text.label', {
|
|
40
48
|
locale: this.documentLanguage,
|
|
41
49
|
});
|
|
42
50
|
|
|
51
|
+
const label = this.label ?? placeholder;
|
|
43
52
|
const node = this.schema.nodes.text_variable.create(
|
|
44
53
|
{
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
54
|
+
subject: mappingSubject,
|
|
55
|
+
rdfaNodeType: 'resource',
|
|
56
|
+
__rdfaId: variableId,
|
|
57
|
+
properties: [
|
|
58
|
+
{
|
|
59
|
+
predicate: RDF('type').full,
|
|
60
|
+
object: sayDataFactory.namedNode(EXT('Mapping').full),
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
predicate: EXT('instance').full,
|
|
64
|
+
object: sayDataFactory.namedNode(variableInstance),
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
predicate: EXT('label').full,
|
|
68
|
+
object: sayDataFactory.literal(label),
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
predicate: DCT('type').full,
|
|
72
|
+
object: sayDataFactory.literal('text'),
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
predicate: EXT('content').full,
|
|
76
|
+
object: sayDataFactory.contentLiteral(),
|
|
77
|
+
},
|
|
78
|
+
],
|
|
48
79
|
},
|
|
49
|
-
this.schema.
|
|
80
|
+
this.schema.text('text'),
|
|
50
81
|
);
|
|
51
82
|
|
|
52
83
|
this.label = undefined;
|
|
53
84
|
|
|
54
|
-
this.controller.
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
},
|
|
58
|
-
{ view: this.controller.mainEditorView },
|
|
59
|
-
);
|
|
85
|
+
this.controller.doCommand(replaceSelectionWithAndSelectNode(node), {
|
|
86
|
+
view: this.controller.mainEditorView,
|
|
87
|
+
});
|
|
60
88
|
}
|
|
61
89
|
}
|
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
@
|
|
5
|
-
@
|
|
6
|
-
@
|
|
1
|
+
{{! @glint-nocheck: not typesafe yet }}
|
|
2
|
+
<AuPill @icon={{this.PencilIcon}} @iconAlignment="right" class="variable" {{on 'click' this.onClick}}>
|
|
3
|
+
<EmberNode::EmbeddedEditor
|
|
4
|
+
@controller={{@controller}}
|
|
5
|
+
@node={{@node}}
|
|
6
|
+
@view={{@view}}
|
|
7
|
+
@getPos={{@getPos}}
|
|
7
8
|
@selected={{@selected}}
|
|
8
9
|
@initEditor={{this.initEditor}}
|
|
9
10
|
@nodeViews={{@nodeViews}}
|
|
11
|
+
@plugins={{this.plugins}}
|
|
12
|
+
@decorations={{@decorations}}
|
|
13
|
+
@contentDecorations={{@contentDecorations}}
|
|
10
14
|
/>
|
|
11
|
-
{{#if
|
|
15
|
+
{{#if this.label}}
|
|
12
16
|
<span class="label">
|
|
13
|
-
({{
|
|
17
|
+
({{this.label}})
|
|
14
18
|
</span>
|
|
15
19
|
{{/if}}
|
|
16
20
|
</AuPill>
|
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
SayController,
|
|
5
|
-
SayView,
|
|
6
|
-
} from '@lblod/ember-rdfa-editor';
|
|
2
|
+
import { NodeSelection, ProsePlugin, SayView } from '@lblod/ember-rdfa-editor';
|
|
3
|
+
import { editableNodePlugin } from '@lblod/ember-rdfa-editor/plugins/editable-node';
|
|
7
4
|
import { tracked } from '@glimmer/tracking';
|
|
8
5
|
import { action } from '@ember/object';
|
|
6
|
+
import { PencilIcon } from '@appuniversum/ember-appuniversum/components/icons/pencil';
|
|
9
7
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
};
|
|
8
|
+
import { EmberNodeArgs } from '@lblod/ember-rdfa-editor/utils/ember-node';
|
|
9
|
+
import { getOutgoingTriple } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/namespace';
|
|
10
|
+
import { EXT } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/constants';
|
|
11
|
+
|
|
12
|
+
export default class VariableNodeViewComponent extends Component<EmberNodeArgs> {
|
|
13
|
+
PencilIcon = PencilIcon;
|
|
13
14
|
|
|
14
|
-
export default class VariableNodeViewComponent extends Component<Args> {
|
|
15
15
|
@tracked innerView?: SayView;
|
|
16
16
|
|
|
17
|
+
get plugins(): ProsePlugin[] {
|
|
18
|
+
return [editableNodePlugin(this.args.getPos)];
|
|
19
|
+
}
|
|
17
20
|
@action
|
|
18
21
|
onClick() {
|
|
19
22
|
if (this.innerView) {
|
|
@@ -36,4 +39,8 @@ export default class VariableNodeViewComponent extends Component<Args> {
|
|
|
36
39
|
initEditor(view: SayView) {
|
|
37
40
|
this.innerView = view;
|
|
38
41
|
}
|
|
42
|
+
|
|
43
|
+
get label() {
|
|
44
|
+
return getOutgoingTriple(this.args.node.attrs, EXT('label'))?.object.value;
|
|
45
|
+
}
|
|
39
46
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{{! @glint-nocheck: not typesafe yet }}
|
|
2
|
+
<PowerSelect
|
|
3
|
+
@loadingMessage={{t 'common.search.loading'}}
|
|
4
|
+
@searchMessage={{t 'worship-plugin.modal.search.search'}}
|
|
5
|
+
@noMatchesMessage={{t 'worship-plugin.modal.search.no-results'}}
|
|
6
|
+
@placeholderMessage={{t 'worship-plugin.modal.fields.admin-unit'}}
|
|
7
|
+
@allowClear={{true}}
|
|
8
|
+
@renderInPlace={{true}}
|
|
9
|
+
@searchEnabled={{true}}
|
|
10
|
+
@search={{perform this.searchUnits}}
|
|
11
|
+
@selected={{@selectedUnit}}
|
|
12
|
+
@onChange={{@onSelectUnit}}
|
|
13
|
+
...attributes
|
|
14
|
+
as |unit|>
|
|
15
|
+
{{unit.label}}
|
|
16
|
+
</PowerSelect>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { restartableTask, timeout } from 'ember-concurrency';
|
|
3
|
+
import { AdministrativeUnit } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/worship-plugin';
|
|
4
|
+
import { fetchAdministrativeUnits } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/worship-plugin/utils/fetchAdministrativeUnits';
|
|
5
|
+
import { WorshipPluginConfig } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/worship-plugin';
|
|
6
|
+
|
|
7
|
+
interface Args {
|
|
8
|
+
config: WorshipPluginConfig;
|
|
9
|
+
selectedUnit?: AdministrativeUnit;
|
|
10
|
+
onSelectUnit: (unit: AdministrativeUnit) => void;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default class AdministrativeUnitPickerComponent extends Component<Args> {
|
|
14
|
+
searchUnits = restartableTask(async (search: string) => {
|
|
15
|
+
await timeout(200);
|
|
16
|
+
|
|
17
|
+
const abortController = new AbortController();
|
|
18
|
+
try {
|
|
19
|
+
const units = await fetchAdministrativeUnits({
|
|
20
|
+
search,
|
|
21
|
+
config: this.args.config,
|
|
22
|
+
abortSignal: abortController.signal,
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
return units;
|
|
26
|
+
} catch (err) {
|
|
27
|
+
// ember-power-select doesn't seem to have a way to display errors.
|
|
28
|
+
console.error(
|
|
29
|
+
'Error occured when searching for administrative units',
|
|
30
|
+
err,
|
|
31
|
+
);
|
|
32
|
+
// We just re-throw to keep TS happy, ember-concurrency just swallows it.
|
|
33
|
+
throw err;
|
|
34
|
+
} finally {
|
|
35
|
+
abortController.abort();
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{{! @glint-nocheck: not typesafe yet }}
|
|
2
|
+
<li class='au-c-list__item'>
|
|
3
|
+
<AuButton
|
|
4
|
+
@icon={{this.AddIcon}}
|
|
5
|
+
@iconAlignment='left'
|
|
6
|
+
@skin='link'
|
|
7
|
+
{{on 'click' this.openModal}}
|
|
8
|
+
>
|
|
9
|
+
{{t 'worship-plugin.insert.title'}}
|
|
10
|
+
</AuButton>
|
|
11
|
+
</li>
|
|
12
|
+
|
|
13
|
+
<WorshipPlugin::SearchModal
|
|
14
|
+
@open={{this.showModal}}
|
|
15
|
+
@closeModal={{this.closeModal}}
|
|
16
|
+
@config={{@config}}
|
|
17
|
+
@onInsert={{this.onInsert}}
|
|
18
|
+
/>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { action } from '@ember/object';
|
|
2
|
+
import Component from '@glimmer/component';
|
|
3
|
+
import { tracked } from '@glimmer/tracking';
|
|
4
|
+
import { AddIcon } from '@appuniversum/ember-appuniversum/components/icons/add';
|
|
5
|
+
|
|
6
|
+
import { SayController } from '@lblod/ember-rdfa-editor';
|
|
7
|
+
import { WorshipPluginConfig } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/worship-plugin';
|
|
8
|
+
import { WorshipService } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/worship-plugin/utils/fetchWorshipServices';
|
|
9
|
+
import { insertWorshipService } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/worship-plugin/utils/insertWorshipService';
|
|
10
|
+
|
|
11
|
+
interface Args {
|
|
12
|
+
controller: SayController;
|
|
13
|
+
config: WorshipPluginConfig;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default class WorshipPluginInsertComponent extends Component<Args> {
|
|
17
|
+
AddIcon = AddIcon;
|
|
18
|
+
|
|
19
|
+
@tracked showModal = false;
|
|
20
|
+
|
|
21
|
+
get controller() {
|
|
22
|
+
return this.args.controller;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@action
|
|
26
|
+
openModal() {
|
|
27
|
+
this.controller.focus();
|
|
28
|
+
this.showModal = true;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@action
|
|
32
|
+
closeModal() {
|
|
33
|
+
this.showModal = false;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@action
|
|
37
|
+
onInsert(service: WorshipService) {
|
|
38
|
+
insertWorshipService(this.controller, service);
|
|
39
|
+
this.closeModal();
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<AuTable>
|
|
2
|
+
<:header>
|
|
3
|
+
<tr class='au-c-data-table__header-title'>
|
|
4
|
+
<th>
|
|
5
|
+
<WorshipPlugin::SortableTableHeader
|
|
6
|
+
@field='label'
|
|
7
|
+
@label={{t 'worship-plugin.modal.fields.name'}}
|
|
8
|
+
@sort={{@sort}}
|
|
9
|
+
@setSort={{@setSort}}
|
|
10
|
+
/>
|
|
11
|
+
</th>
|
|
12
|
+
<th />
|
|
13
|
+
</tr>
|
|
14
|
+
</:header>
|
|
15
|
+
<:body>
|
|
16
|
+
{{#unless (or @services.isRunning @error)}}
|
|
17
|
+
{{#if @services.value.totalCount}}
|
|
18
|
+
{{#each @services.value.results as |row|}}
|
|
19
|
+
<tr>
|
|
20
|
+
<td>{{row.label}}</td>
|
|
21
|
+
<td class='au-u-text-center'>
|
|
22
|
+
<AuButton
|
|
23
|
+
{{on 'click' (fn @insert row)}}
|
|
24
|
+
>
|
|
25
|
+
{{t 'worship-plugin.modal.insert'}}
|
|
26
|
+
</AuButton>
|
|
27
|
+
</td>
|
|
28
|
+
</tr>
|
|
29
|
+
{{/each}}
|
|
30
|
+
{{/if}}
|
|
31
|
+
{{/unless}}
|
|
32
|
+
</:body>
|
|
33
|
+
</AuTable>
|
|
34
|
+
{{#if @services.isRunning}}
|
|
35
|
+
<div class='au-u-margin'>
|
|
36
|
+
<Common::Search::Loading />
|
|
37
|
+
</div>
|
|
38
|
+
{{else}}
|
|
39
|
+
{{#if @error}}
|
|
40
|
+
<Common::Search::AlertLoadError @error={{@error}} />
|
|
41
|
+
{{else}}
|
|
42
|
+
{{#unless @services.value.totalCount}}
|
|
43
|
+
<Common::Search::AlertNoItems />
|
|
44
|
+
{{/unless}}
|
|
45
|
+
{{/if}}
|
|
46
|
+
{{/if}}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
{{! @glint-nocheck: not typesafe yet }}
|
|
2
|
+
<AuModal
|
|
3
|
+
class='worship-modal'
|
|
4
|
+
@modalOpen={{@open}}
|
|
5
|
+
@closeModal={{this.closeModal}}
|
|
6
|
+
@title={{t 'worship-plugin.modal.title'}}
|
|
7
|
+
@size='large'
|
|
8
|
+
@padding='none'
|
|
9
|
+
as |modal|
|
|
10
|
+
>
|
|
11
|
+
<modal.Body>
|
|
12
|
+
<AuMainContainer @scroll={{true}} class='worship-modal--main-container' as |mc|>
|
|
13
|
+
<mc.sidebar>
|
|
14
|
+
<div class='au-c-sidebar'>
|
|
15
|
+
<div class='au-c-sidebar__content au-u-padding'>
|
|
16
|
+
<AuHeading @level='3' @skin='4' class='au-u-padding-bottom-small'>
|
|
17
|
+
{{t 'worship-plugin.modal.search.title'}}
|
|
18
|
+
</AuHeading>
|
|
19
|
+
<AuLabel
|
|
20
|
+
class='au-margin-bottom-small'
|
|
21
|
+
for='searchTerm'
|
|
22
|
+
>
|
|
23
|
+
{{t 'worship-plugin.modal.fields.name'}}
|
|
24
|
+
</AuLabel>
|
|
25
|
+
<AuNativeInput
|
|
26
|
+
@type='text'
|
|
27
|
+
@width='block'
|
|
28
|
+
id='searchTerm'
|
|
29
|
+
value={{this.searchText}}
|
|
30
|
+
placeholder={{t 'worship-plugin.modal.search.placeholder'}}
|
|
31
|
+
{{on 'input' this.setInputSearchText}}
|
|
32
|
+
/>
|
|
33
|
+
<AuLabel
|
|
34
|
+
class='au-margin-bottom-small'
|
|
35
|
+
for='admin-unit-select'
|
|
36
|
+
>
|
|
37
|
+
{{t 'worship-plugin.modal.fields.admin-unit'}}
|
|
38
|
+
</AuLabel>
|
|
39
|
+
<WorshipPlugin::AdministrativeUnitPicker
|
|
40
|
+
id='admin-unit-select'
|
|
41
|
+
@config={{@config}}
|
|
42
|
+
@selectedUnit={{this.administrativeUnit}}
|
|
43
|
+
@onSelectUnit={{this.setAdministrativeUnit}}
|
|
44
|
+
/>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
</mc.sidebar>
|
|
48
|
+
<mc.content @scroll={{true}}>
|
|
49
|
+
<div class='worship-modal--list-container'>
|
|
50
|
+
<WorshipPlugin::List
|
|
51
|
+
@error={{this.error}}
|
|
52
|
+
@services={{this.servicesResource}}
|
|
53
|
+
@sort={{this.sort}}
|
|
54
|
+
@setSort={{this.setSort}}
|
|
55
|
+
@insert={{@onInsert}}
|
|
56
|
+
/>
|
|
57
|
+
</div>
|
|
58
|
+
{{#if this.servicesResource.value.totalCount}}
|
|
59
|
+
{{#let
|
|
60
|
+
(pagination
|
|
61
|
+
page=this.pageNumber pageSize=this.pageSize count=this.servicesResource.value.totalCount
|
|
62
|
+
)
|
|
63
|
+
as |pg|
|
|
64
|
+
}}
|
|
65
|
+
<Pagination::PaginationView
|
|
66
|
+
@totalCount={{pg.count}}
|
|
67
|
+
@rangeStart={{pg.pageStart}}
|
|
68
|
+
@rangeEnd={{pg.pageEnd}}
|
|
69
|
+
@onNextPage={{this.nextPage}}
|
|
70
|
+
@onPreviousPage={{this.previousPage}}
|
|
71
|
+
@isFirstPage={{not pg.hasPreviousPage}}
|
|
72
|
+
@isLastPage={{not pg.hasNextPage}}
|
|
73
|
+
/>
|
|
74
|
+
{{/let}}
|
|
75
|
+
{{/if}}
|
|
76
|
+
</mc.content>
|
|
77
|
+
</AuMainContainer>
|
|
78
|
+
</modal.Body>
|
|
79
|
+
</AuModal>
|