@lblod/ember-rdfa-editor-lblod-plugins 16.4.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 +14 -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 +3 -2
- 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-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 +17 -9
- package/addon/components/citation-plugin/citations/legal-document-detail.ts +18 -1
- 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 +3 -2
- 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/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 +1 -0
- 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 +1 -0
- 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 +1 -0
- package/addon/components/worship-plugin/insert.hbs +2 -1
- package/addon/components/worship-plugin/insert.ts +3 -0
- package/addon/components/worship-plugin/search-modal.hbs +1 -0
- package/addon/components/worship-plugin/search-modal.ts +2 -0
- package/addon/components/worship-plugin/sortable-table-header.hbs +4 -3
- package/addon/components/worship-plugin/sortable-table-header.ts +7 -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/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/utils/_private/find-insertion-range.ts +18 -5
- package/addon/utils/dom-utils.ts +4 -0
- package/addon/utils/namespace.ts +63 -13
- package/app/components/snippet-plugin/snippet-list-insert-rdfa.js +1 -0
- package/app/components/snippet-plugin/snippet-list-select-rdfa.js +1 -0
- package/app/styles/article-structure-plugin.scss +106 -3
- 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/{components → declarations/addon/components}/worship-plugin/insert.d.ts +1 -0
- package/declarations/addon/components/worship-plugin/list.d.ts +1 -0
- package/{components → declarations/addon/components}/worship-plugin/sortable-table-header.d.ts +3 -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/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/package.json +54 -19
- package/pnpm-lock.yaml +17788 -0
- package/scripts/generate-type-declarations.sh +16 -0
- 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/common/search/alert-load-error.hbs +0 -23
- package/addon/components/common/search/alert-no-items.hbs +0 -9
- package/addon/components/confidentiality-plugin/redact.hbs +0 -6
- package/addon/components/pagination/pagination-view.hbs +0 -39
- 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/{components → declarations/addon/components}/worship-plugin/administrative-unit-picker.d.ts +0 -0
- package/{components → declarations/addon/components}/worship-plugin/search-modal.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/{plugins → declarations/addon/plugins}/worship-plugin/index.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/worship-plugin/utils/fetchAdministrativeUnits.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/worship-plugin/utils/fetchWorshipServices.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/worship-plugin/utils/insertWorshipService.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}/sparql-helpers.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,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
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { action } from '@ember/object';
|
|
2
2
|
import Component from '@glimmer/component';
|
|
3
3
|
import { tracked } from '@glimmer/tracking';
|
|
4
|
+
import { AddIcon } from '@appuniversum/ember-appuniversum/components/icons/add';
|
|
4
5
|
|
|
5
6
|
import { SayController } from '@lblod/ember-rdfa-editor';
|
|
6
7
|
import { WorshipPluginConfig } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/worship-plugin';
|
|
@@ -13,6 +14,8 @@ interface Args {
|
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
export default class WorshipPluginInsertComponent extends Component<Args> {
|
|
17
|
+
AddIcon = AddIcon;
|
|
18
|
+
|
|
16
19
|
@tracked showModal = false;
|
|
17
20
|
|
|
18
21
|
get controller() {
|
|
@@ -23,6 +23,8 @@ export default class WorshipPluginSearchModalComponent extends Component<Args> {
|
|
|
23
23
|
// Filtering
|
|
24
24
|
@tracked sort: SearchSort = false;
|
|
25
25
|
@tracked inputSearchText: string | null = null;
|
|
26
|
+
// We're deliberately using the arg to set the initial value
|
|
27
|
+
// eslint-disable-next-line ember/no-tracked-properties-from-args
|
|
26
28
|
@tracked administrativeUnit: AdministrativeUnit | undefined =
|
|
27
29
|
this.args.config.defaultAdministrativeUnit;
|
|
28
30
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
{{! @glint-nocheck: not typesafe yet }}
|
|
1
2
|
{{!-- Based on au-data-table-th-sortable from ember-appuniversum and using the same classes --}}
|
|
2
3
|
<span
|
|
3
4
|
class='au-c-data-table__header-title au-c-data-table__header-title--sortable
|
|
@@ -11,7 +12,7 @@
|
|
|
11
12
|
class='au-c-data-table__sort'
|
|
12
13
|
>
|
|
13
14
|
<span class='au-u-hidden-visually'>{{t 'worship-plugin.modal.sort.asc'}}</span>
|
|
14
|
-
<AuIcon @icon=
|
|
15
|
+
<AuIcon @icon={{this.NavUpIcon}} />
|
|
15
16
|
</button>
|
|
16
17
|
{{else if (eq this.order 'ASC')}}
|
|
17
18
|
<button
|
|
@@ -20,7 +21,7 @@
|
|
|
20
21
|
class='au-c-data-table__sort'
|
|
21
22
|
>
|
|
22
23
|
<span class='au-u-hidden-visually'>{{t 'worship-plugin.modal.sort.desc'}}</span>
|
|
23
|
-
<AuIcon @icon=
|
|
24
|
+
<AuIcon @icon={{this.NavDownIcon}} />
|
|
24
25
|
</button>
|
|
25
26
|
{{else}}
|
|
26
27
|
<button
|
|
@@ -29,7 +30,7 @@
|
|
|
29
30
|
class='au-c-data-table__sort'
|
|
30
31
|
>
|
|
31
32
|
<span class='au-u-hidden-visually'>{{t 'worship-plugin.modal.sort.sort'}}</span>
|
|
32
|
-
<AuIcon @icon=
|
|
33
|
+
<AuIcon @icon={{this.NavUpDownIcon}} />
|
|
33
34
|
</button>
|
|
34
35
|
{{/if}}
|
|
35
36
|
</span>
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { action } from '@ember/object';
|
|
2
2
|
import Component from '@glimmer/component';
|
|
3
|
+
import { NavUpIcon } from '@appuniversum/ember-appuniversum/components/icons/nav-up';
|
|
4
|
+
import { NavDownIcon } from '@appuniversum/ember-appuniversum/components/icons/nav-down';
|
|
5
|
+
import { NavUpDownIcon } from '@appuniversum/ember-appuniversum/components/icons/nav-up-down';
|
|
3
6
|
import {
|
|
4
7
|
SearchSort,
|
|
5
8
|
WorshipService,
|
|
@@ -13,6 +16,10 @@ interface Args {
|
|
|
13
16
|
}
|
|
14
17
|
|
|
15
18
|
export default class SnippetInsertComponent extends Component<Args> {
|
|
19
|
+
NavUpIcon = NavUpIcon;
|
|
20
|
+
NavDownIcon = NavDownIcon;
|
|
21
|
+
NavUpDownIcon = NavUpDownIcon;
|
|
22
|
+
|
|
16
23
|
get order() {
|
|
17
24
|
if (this.args.sort) {
|
|
18
25
|
const [sortedField, order] = this.args.sort;
|
|
@@ -1,14 +1,69 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Command,
|
|
3
|
+
EditorState,
|
|
3
4
|
Fragment,
|
|
4
5
|
NodeSelection,
|
|
5
6
|
TextSelection,
|
|
7
|
+
Transaction,
|
|
6
8
|
} from '@lblod/ember-rdfa-editor';
|
|
9
|
+
import { getNodeByRdfaId } from '@lblod/ember-rdfa-editor/plugins/rdfa-info';
|
|
10
|
+
import { addProperty } from '@lblod/ember-rdfa-editor/commands';
|
|
11
|
+
import { isRdfaAttrs } from '@lblod/ember-rdfa-editor/core/schema';
|
|
12
|
+
import { sayDataFactory } from '@lblod/ember-rdfa-editor/core/say-data-factory';
|
|
7
13
|
import recalculateStructureNumbers from './recalculate-structure-numbers';
|
|
8
14
|
import { StructureSpec } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/article-structure-plugin';
|
|
9
15
|
import wrapStructureContent from './wrap-structure-content';
|
|
10
16
|
import IntlService from 'ember-intl/services/intl';
|
|
11
17
|
import { findInsertionRange } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/_private/find-insertion-range';
|
|
18
|
+
import { SAY } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/constants';
|
|
19
|
+
|
|
20
|
+
const addPropertyToContainer = ({
|
|
21
|
+
state,
|
|
22
|
+
transaction,
|
|
23
|
+
structureSpec,
|
|
24
|
+
insertionRange,
|
|
25
|
+
newResource,
|
|
26
|
+
}: {
|
|
27
|
+
state: EditorState;
|
|
28
|
+
transaction: Transaction;
|
|
29
|
+
structureSpec: StructureSpec;
|
|
30
|
+
insertionRange: Exclude<ReturnType<typeof findInsertionRange>, null>;
|
|
31
|
+
newResource: string;
|
|
32
|
+
}) => {
|
|
33
|
+
if (!insertionRange) {
|
|
34
|
+
return transaction;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const containerAttrs = insertionRange.containerNode.attrs;
|
|
38
|
+
|
|
39
|
+
if (!isRdfaAttrs(containerAttrs)) {
|
|
40
|
+
return transaction;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const incoming = containerAttrs.backlinks;
|
|
44
|
+
const subject = incoming?.find((backlink) =>
|
|
45
|
+
SAY('body').matches(backlink.predicate),
|
|
46
|
+
)?.subject;
|
|
47
|
+
|
|
48
|
+
if (!subject) {
|
|
49
|
+
return transaction;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const newState = state.apply(transaction);
|
|
53
|
+
addProperty({
|
|
54
|
+
resource: subject.value,
|
|
55
|
+
property: {
|
|
56
|
+
predicate: (structureSpec.relationshipPredicate ?? SAY('hasPart'))
|
|
57
|
+
.prefixed,
|
|
58
|
+
object: sayDataFactory.resourceNode(newResource),
|
|
59
|
+
},
|
|
60
|
+
transaction,
|
|
61
|
+
})(newState, (newTransaction) => {
|
|
62
|
+
transaction = newTransaction;
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
return transaction;
|
|
66
|
+
};
|
|
12
67
|
|
|
13
68
|
const insertStructure = (
|
|
14
69
|
structureSpec: StructureSpec,
|
|
@@ -31,28 +86,40 @@ const insertStructure = (
|
|
|
31
86
|
return false;
|
|
32
87
|
}
|
|
33
88
|
if (dispatch) {
|
|
34
|
-
const {
|
|
35
|
-
|
|
36
|
-
|
|
89
|
+
const {
|
|
90
|
+
node: newStructureNode,
|
|
91
|
+
selectionConfig,
|
|
92
|
+
newResource,
|
|
93
|
+
} = structureSpec.constructor({ schema, intl, content, state });
|
|
94
|
+
let transaction = state.tr;
|
|
37
95
|
|
|
38
96
|
transaction.replaceWith(
|
|
39
97
|
insertionRange.from,
|
|
40
98
|
insertionRange.to,
|
|
41
99
|
newStructureNode,
|
|
42
100
|
);
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
101
|
+
const target = getNodeByRdfaId(
|
|
102
|
+
state.apply(transaction),
|
|
103
|
+
selectionConfig.rdfaId,
|
|
104
|
+
);
|
|
105
|
+
if (target) {
|
|
106
|
+
const newSelection =
|
|
107
|
+
selectionConfig.type === 'node'
|
|
108
|
+
? NodeSelection.create(transaction.doc, target.pos)
|
|
109
|
+
: TextSelection.create(transaction.doc, target.pos + 1);
|
|
110
|
+
transaction.setSelection(newSelection);
|
|
111
|
+
}
|
|
112
|
+
|
|
54
113
|
transaction.scrollIntoView();
|
|
55
|
-
recalculateStructureNumbers(transaction, structureSpec);
|
|
114
|
+
recalculateStructureNumbers(transaction, schema, structureSpec);
|
|
115
|
+
transaction = addPropertyToContainer({
|
|
116
|
+
state,
|
|
117
|
+
transaction,
|
|
118
|
+
structureSpec,
|
|
119
|
+
insertionRange,
|
|
120
|
+
newResource,
|
|
121
|
+
});
|
|
122
|
+
|
|
56
123
|
dispatch(transaction);
|
|
57
124
|
}
|
|
58
125
|
return true;
|
|
@@ -15,6 +15,7 @@ import IntlService from 'ember-intl/services/intl';
|
|
|
15
15
|
import { findParentNodeOfType } from '@curvenote/prosemirror-utils';
|
|
16
16
|
import { unwrap } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/option';
|
|
17
17
|
import { getTranslationFunction } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/translation';
|
|
18
|
+
|
|
18
19
|
const moveSelectedStructure = (
|
|
19
20
|
options: ArticleStructurePluginOptions,
|
|
20
21
|
direction: 'up' | 'down',
|
|
@@ -77,7 +78,7 @@ const moveSelectedStructure = (
|
|
|
77
78
|
: TextSelection.create(transaction.doc, newSelectionPos);
|
|
78
79
|
transaction.setSelection(newSelection);
|
|
79
80
|
transaction.scrollIntoView();
|
|
80
|
-
recalculateStructureNumbers(transaction, currentStructureSpec);
|
|
81
|
+
recalculateStructureNumbers(transaction, schema, currentStructureSpec);
|
|
81
82
|
dispatch(transaction);
|
|
82
83
|
}
|
|
83
84
|
return true;
|
|
@@ -1,15 +1,69 @@
|
|
|
1
|
-
import { PNode, Transaction } from '@lblod/ember-rdfa-editor';
|
|
1
|
+
import { PNode, Schema, Transaction } from '@lblod/ember-rdfa-editor';
|
|
2
|
+
import { findNodeByRdfaId } from '@lblod/ember-rdfa-editor/utils/rdfa-utils';
|
|
3
|
+
import { isRdfaAttrs } from '@lblod/ember-rdfa-editor/core/schema';
|
|
4
|
+
import type { Resource } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/namespace';
|
|
5
|
+
import { ELI } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/constants';
|
|
2
6
|
import { StructureSpec } from '..';
|
|
3
7
|
|
|
8
|
+
type UpdateNumberProps = {
|
|
9
|
+
transaction: Transaction;
|
|
10
|
+
schema: Schema;
|
|
11
|
+
node: PNode;
|
|
12
|
+
number: string;
|
|
13
|
+
numberPredicate?: Resource;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
function updateNumber({
|
|
17
|
+
transaction,
|
|
18
|
+
schema,
|
|
19
|
+
node,
|
|
20
|
+
number,
|
|
21
|
+
numberPredicate,
|
|
22
|
+
}: UpdateNumberProps) {
|
|
23
|
+
const { attrs } = node;
|
|
24
|
+
|
|
25
|
+
if (isRdfaAttrs(attrs) && attrs.rdfaNodeType === 'resource') {
|
|
26
|
+
const properties = attrs.properties;
|
|
27
|
+
const numberProp = properties.find((prop) =>
|
|
28
|
+
(numberPredicate ?? ELI('number')).matches(prop.predicate),
|
|
29
|
+
);
|
|
30
|
+
const numberRdfaId =
|
|
31
|
+
numberProp?.object.termType === 'LiteralNode' && numberProp.object.value;
|
|
32
|
+
const numberNode =
|
|
33
|
+
numberRdfaId && findNodeByRdfaId(transaction.doc, numberRdfaId);
|
|
34
|
+
|
|
35
|
+
if (numberNode) {
|
|
36
|
+
transaction.replaceWith(
|
|
37
|
+
numberNode.pos + 1,
|
|
38
|
+
numberNode.pos + numberNode.value.nodeSize - 1,
|
|
39
|
+
schema.text(number),
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
4
45
|
export default function recalculateStructureNumbers(
|
|
5
46
|
transaction: Transaction,
|
|
47
|
+
schema: Schema,
|
|
6
48
|
...structureSpecs: StructureSpec[]
|
|
7
49
|
) {
|
|
8
50
|
const doc = transaction.doc;
|
|
9
51
|
const indices = new Array<number>(structureSpecs.length).fill(1);
|
|
52
|
+
|
|
10
53
|
const contexts: (PNode | null)[] = new Array<PNode | null>(
|
|
11
54
|
structureSpecs.length,
|
|
12
55
|
).fill(null);
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Recording all calls to `updateNumber` in an array to run them all
|
|
59
|
+
* _after_ we've run all the `setNumber` calls.
|
|
60
|
+
*
|
|
61
|
+
* This is necessary because `updateNumber` calls can change positions of the nodes
|
|
62
|
+
* in the document, and the calls to `setNumber` are dependent on the correct position
|
|
63
|
+
* before the change.
|
|
64
|
+
*/
|
|
65
|
+
const updateNumberCalls: UpdateNumberProps[] = [];
|
|
66
|
+
|
|
13
67
|
doc.descendants((node, pos, parent) => {
|
|
14
68
|
structureSpecs.forEach((spec, i) => {
|
|
15
69
|
if (node.type.name === spec.name) {
|
|
@@ -24,10 +78,24 @@ export default function recalculateStructureNumbers(
|
|
|
24
78
|
indices[i] = startNumber;
|
|
25
79
|
}
|
|
26
80
|
|
|
27
|
-
spec.
|
|
81
|
+
spec.setNumber({ transaction, pos, number: indices[i] });
|
|
82
|
+
|
|
83
|
+
if ('convertNumber' in spec.numberConfig) {
|
|
84
|
+
updateNumberCalls.push({
|
|
85
|
+
transaction,
|
|
86
|
+
schema,
|
|
87
|
+
node,
|
|
88
|
+
number: spec.numberConfig.convertNumber(indices[i]),
|
|
89
|
+
numberPredicate: spec.numberConfig.numberPredicate,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
|
|
28
93
|
indices[i] += 1;
|
|
29
94
|
}
|
|
30
95
|
});
|
|
31
96
|
});
|
|
97
|
+
|
|
98
|
+
updateNumberCalls.forEach(updateNumber);
|
|
99
|
+
|
|
32
100
|
return transaction;
|
|
33
101
|
}
|
|
@@ -11,7 +11,7 @@ const removeStructure = (
|
|
|
11
11
|
const { pos, node } = structure;
|
|
12
12
|
const transaction = state.tr;
|
|
13
13
|
transaction.replace(pos, pos + node.nodeSize);
|
|
14
|
-
recalculateStructureNumbers(transaction, ...options);
|
|
14
|
+
recalculateStructureNumbers(transaction, state.schema, ...options);
|
|
15
15
|
dispatch(transaction);
|
|
16
16
|
}
|
|
17
17
|
return true;
|
|
@@ -1,26 +1,17 @@
|
|
|
1
|
-
import { Command } from '@lblod/ember-rdfa-editor';
|
|
1
|
+
import { Command, PNode } from '@lblod/ember-rdfa-editor';
|
|
2
2
|
|
|
3
|
-
import { findAncestorOfType } from '../utils/structure';
|
|
4
3
|
import type { ArticleStructurePluginOptions } from '..';
|
|
5
4
|
import recalculateStructureNumbers from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/article-structure-plugin/commands/recalculate-structure-numbers';
|
|
6
5
|
import { unwrap } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/option';
|
|
7
6
|
|
|
8
7
|
const setStructureStartNumber = (
|
|
8
|
+
structure: { pos: number; node: PNode },
|
|
9
9
|
options: ArticleStructurePluginOptions,
|
|
10
10
|
startNumber: number | null,
|
|
11
11
|
): Command => {
|
|
12
12
|
return (state, dispatch) => {
|
|
13
|
-
const { selection, schema } = state;
|
|
14
|
-
|
|
15
|
-
const structureSpecs = options.map((type) => schema.nodes[type.name]);
|
|
16
|
-
const currentStructure = findAncestorOfType(selection, ...structureSpecs);
|
|
17
|
-
|
|
18
|
-
if (!currentStructure || currentStructure.pos === -1) {
|
|
19
|
-
return false;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
13
|
const currentStructureSpec = unwrap(
|
|
23
|
-
options.find((spec) => spec.name ===
|
|
14
|
+
options.find((spec) => spec.name === structure.node.type.name),
|
|
24
15
|
);
|
|
25
16
|
|
|
26
17
|
if (dispatch) {
|
|
@@ -28,11 +19,11 @@ const setStructureStartNumber = (
|
|
|
28
19
|
|
|
29
20
|
currentStructureSpec.setStartNumber({
|
|
30
21
|
number: startNumber,
|
|
31
|
-
pos:
|
|
22
|
+
pos: structure.pos,
|
|
32
23
|
transaction,
|
|
33
24
|
});
|
|
34
25
|
|
|
35
|
-
recalculateStructureNumbers(transaction, ...options);
|
|
26
|
+
recalculateStructureNumbers(transaction, state.schema, ...options);
|
|
36
27
|
|
|
37
28
|
dispatch(transaction);
|
|
38
29
|
}
|