@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,22 +1,28 @@
|
|
|
1
|
-
import { Fragment, NodeSpec } from '@lblod/ember-rdfa-editor';
|
|
1
|
+
import { Fragment, NodeSpec, RdfaAttrs } from '@lblod/ember-rdfa-editor';
|
|
2
|
+
import {
|
|
3
|
+
hasRdfaContentChild,
|
|
4
|
+
getRdfaAttrs,
|
|
5
|
+
rdfaAttrSpec,
|
|
6
|
+
renderRdfaAware,
|
|
7
|
+
getRdfaContentElement,
|
|
8
|
+
} from '@lblod/ember-rdfa-editor/core/schema';
|
|
2
9
|
import { StructureSpec } from '..';
|
|
3
10
|
import { v4 as uuid } from 'uuid';
|
|
11
|
+
import { sayDataFactory } from '@lblod/ember-rdfa-editor/core/say-data-factory';
|
|
4
12
|
import {
|
|
5
13
|
ELI,
|
|
14
|
+
RDF,
|
|
6
15
|
SAY,
|
|
7
16
|
} from '@lblod/ember-rdfa-editor-lblod-plugins/utils/constants';
|
|
8
|
-
import { hasRDFaAttribute } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/namespace';
|
|
9
|
-
import { getTranslationFunction } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/translation';
|
|
10
17
|
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
18
|
+
hasOutgoingNamedNodeTriple,
|
|
19
|
+
hasRDFaAttribute,
|
|
20
|
+
} from '@lblod/ember-rdfa-editor-lblod-plugins/utils/namespace';
|
|
21
|
+
const rdfaAware = true;
|
|
22
|
+
import {
|
|
23
|
+
constructStructureBodyNodeSpec,
|
|
14
24
|
getNumberUtils,
|
|
15
|
-
} from '
|
|
16
|
-
|
|
17
|
-
const PLACEHOLDERS = {
|
|
18
|
-
body: 'article-structure-plugin.placeholder.paragraph.body',
|
|
19
|
-
};
|
|
25
|
+
} from '../utils/structure';
|
|
20
26
|
|
|
21
27
|
export const articleParagraphSpec: StructureSpec = {
|
|
22
28
|
name: 'article_paragraph',
|
|
@@ -31,106 +37,210 @@ export const articleParagraphSpec: StructureSpec = {
|
|
|
31
37
|
},
|
|
32
38
|
continuous: false,
|
|
33
39
|
noUnwrap: true,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
relationshipPredicate: SAY('hasParagraph'),
|
|
41
|
+
constructor: ({ schema, number }) => {
|
|
42
|
+
const numberConverted = number?.toString() ?? '1';
|
|
43
|
+
const paragraphRdfaId = uuid();
|
|
44
|
+
const numberRdfaId = uuid();
|
|
45
|
+
const bodyRdfaId = uuid();
|
|
46
|
+
const subject = `http://data.lblod.info/paragraphs/${paragraphRdfaId}`;
|
|
47
|
+
const paragraphAttrs: RdfaAttrs = {
|
|
48
|
+
__rdfaId: paragraphRdfaId,
|
|
49
|
+
rdfaNodeType: 'resource',
|
|
50
|
+
subject,
|
|
51
|
+
properties: [
|
|
52
|
+
{
|
|
53
|
+
predicate: ELI('number').prefixed,
|
|
54
|
+
object: sayDataFactory.literalNode(numberRdfaId),
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
predicate: SAY('body').prefixed,
|
|
58
|
+
object: sayDataFactory.literalNode(bodyRdfaId),
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
backlinks: [],
|
|
62
|
+
};
|
|
63
|
+
const numberAttrs: RdfaAttrs = {
|
|
64
|
+
__rdfaId: numberRdfaId,
|
|
65
|
+
rdfaNodeType: 'literal',
|
|
66
|
+
backlinks: [
|
|
67
|
+
{
|
|
68
|
+
predicate: ELI('number').prefixed,
|
|
69
|
+
subject: sayDataFactory.literalNode(subject),
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
};
|
|
73
|
+
const bodyAttrs: RdfaAttrs = {
|
|
74
|
+
__rdfaId: bodyRdfaId,
|
|
75
|
+
rdfaNodeType: 'literal',
|
|
76
|
+
backlinks: [
|
|
77
|
+
{
|
|
78
|
+
predicate: SAY('body').prefixed,
|
|
79
|
+
subject: sayDataFactory.literalNode(subject),
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
};
|
|
83
|
+
const node = schema.node(`article_paragraph`, paragraphAttrs, [
|
|
84
|
+
schema.node('article_paragraph_number', {}, [
|
|
85
|
+
schema.text('§'),
|
|
86
|
+
schema.node(
|
|
87
|
+
'structure_header_number',
|
|
88
|
+
numberAttrs,
|
|
89
|
+
schema.text(numberConverted),
|
|
90
|
+
),
|
|
91
|
+
schema.text('. '),
|
|
92
|
+
]),
|
|
42
93
|
schema.node(
|
|
43
|
-
'
|
|
44
|
-
|
|
45
|
-
schema.node('
|
|
46
|
-
placeholderText: translationWithDocLang(
|
|
47
|
-
PLACEHOLDERS.body,
|
|
48
|
-
intl?.t(PLACEHOLDERS.body) || '',
|
|
49
|
-
),
|
|
50
|
-
}),
|
|
94
|
+
'article_paragraph_body',
|
|
95
|
+
bodyAttrs,
|
|
96
|
+
schema.node('paragraph', {}),
|
|
51
97
|
),
|
|
52
|
-
);
|
|
53
|
-
return {
|
|
98
|
+
]);
|
|
99
|
+
return {
|
|
100
|
+
node,
|
|
101
|
+
selectionConfig: { rdfaId: bodyRdfaId, type: 'text' },
|
|
102
|
+
newResource: subject,
|
|
103
|
+
};
|
|
54
104
|
},
|
|
55
|
-
...getNumberUtils(
|
|
105
|
+
...getNumberUtils({
|
|
106
|
+
offset: 0,
|
|
107
|
+
convertNumber: (number) => number.toString(),
|
|
108
|
+
}),
|
|
56
109
|
};
|
|
57
110
|
|
|
58
|
-
const
|
|
59
|
-
|
|
111
|
+
export const article_paragraph_body = constructStructureBodyNodeSpec({
|
|
112
|
+
tag: 'span',
|
|
113
|
+
content: 'block+',
|
|
114
|
+
context: 'article_paragraph/',
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
export const article_paragraph_number: NodeSpec = {
|
|
118
|
+
content: 'text* structure_header_number text*',
|
|
119
|
+
inline: false,
|
|
120
|
+
editable: false,
|
|
121
|
+
toDOM(node) {
|
|
122
|
+
return ['span', { class: 'article-paragraph-number', ...node.attrs }, 0];
|
|
123
|
+
},
|
|
124
|
+
parseDOM: [
|
|
125
|
+
{
|
|
126
|
+
tag: 'span',
|
|
127
|
+
context: 'article_paragraph/',
|
|
128
|
+
getAttrs(element: HTMLElement) {
|
|
129
|
+
if (element.querySelector(`[property~="${ELI('number').prefixed}"]`)) {
|
|
130
|
+
return {};
|
|
131
|
+
}
|
|
132
|
+
return false;
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
],
|
|
136
|
+
};
|
|
60
137
|
|
|
61
138
|
export const article_paragraph: NodeSpec = {
|
|
62
|
-
content: '
|
|
139
|
+
content: 'article_paragraph_number article_paragraph_body',
|
|
63
140
|
inline: false,
|
|
64
141
|
isolating: true,
|
|
142
|
+
editable: true,
|
|
65
143
|
defining: true,
|
|
66
144
|
attrs: {
|
|
145
|
+
...rdfaAttrSpec({ rdfaAware }),
|
|
67
146
|
typeof: {
|
|
68
147
|
default: SAY('Paragraph').prefixed,
|
|
69
148
|
},
|
|
70
|
-
property: {
|
|
71
|
-
default: SAY('hasParagraph').prefixed,
|
|
72
|
-
},
|
|
73
|
-
resource: {},
|
|
74
149
|
number: {
|
|
75
150
|
default: 1,
|
|
76
151
|
},
|
|
77
152
|
numberDisplayStyle: {
|
|
78
|
-
default: 'decimal',
|
|
153
|
+
default: 'decimal',
|
|
79
154
|
},
|
|
80
155
|
startNumber: {
|
|
81
156
|
default: null,
|
|
82
157
|
},
|
|
83
158
|
},
|
|
84
159
|
toDOM(node) {
|
|
85
|
-
return
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
...
|
|
160
|
+
return renderRdfaAware({
|
|
161
|
+
renderable: node,
|
|
162
|
+
tag: 'div',
|
|
163
|
+
contentContainerTag: 'span',
|
|
164
|
+
rdfaContainerTag: 'span',
|
|
165
|
+
attrs: {
|
|
166
|
+
...node.attrs,
|
|
167
|
+
class: 'say-editable',
|
|
92
168
|
},
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
['span', { contenteditable: false }, '. '],
|
|
96
|
-
['span', { property: SAY('body').prefixed }, 0],
|
|
97
|
-
];
|
|
169
|
+
content: 0,
|
|
170
|
+
});
|
|
98
171
|
},
|
|
99
172
|
parseDOM: [
|
|
100
173
|
{
|
|
101
174
|
tag: 'div',
|
|
175
|
+
context: 'article/article_body/',
|
|
102
176
|
getAttrs(element: HTMLElement) {
|
|
103
|
-
const
|
|
104
|
-
span[property~='${ELI('number').prefixed}'],
|
|
105
|
-
span[property~='${ELI('number').full}']`);
|
|
177
|
+
const rdfaAttrs = getRdfaAttrs(element, { rdfaAware });
|
|
106
178
|
if (
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
179
|
+
hasOutgoingNamedNodeTriple(
|
|
180
|
+
rdfaAttrs,
|
|
181
|
+
RDF('type'),
|
|
182
|
+
SAY('Paragraph'),
|
|
183
|
+
) &&
|
|
184
|
+
hasRdfaContentChild(element)
|
|
112
185
|
) {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
186
|
+
return rdfaAttrs;
|
|
187
|
+
}
|
|
188
|
+
return false;
|
|
189
|
+
},
|
|
190
|
+
contentElement: getRdfaContentElement,
|
|
191
|
+
},
|
|
192
|
+
// Older structures (without an explicit 'content' element) don't have a separate element
|
|
193
|
+
// around the paragraph number, so we manually create that to use as a content element
|
|
194
|
+
{
|
|
195
|
+
tag: 'div',
|
|
196
|
+
context: 'article/article_body/',
|
|
197
|
+
getAttrs(element: HTMLElement) {
|
|
198
|
+
const rdfaAttrs = getRdfaAttrs(element, { rdfaAware });
|
|
199
|
+
if (
|
|
200
|
+
hasOutgoingNamedNodeTriple(rdfaAttrs, RDF('type'), SAY('Paragraph'))
|
|
201
|
+
) {
|
|
202
|
+
return rdfaAttrs;
|
|
122
203
|
}
|
|
123
204
|
return false;
|
|
124
205
|
},
|
|
125
|
-
contentElement
|
|
206
|
+
contentElement(node) {
|
|
207
|
+
if (node.nodeType !== Node.ELEMENT_NODE) {
|
|
208
|
+
throw new Error('content element is not an element');
|
|
209
|
+
}
|
|
210
|
+
let contentElem = node as HTMLElement;
|
|
211
|
+
if (
|
|
212
|
+
contentElem.lastElementChild &&
|
|
213
|
+
hasRDFaAttribute(
|
|
214
|
+
contentElem.lastElementChild,
|
|
215
|
+
'property',
|
|
216
|
+
SAY('body'),
|
|
217
|
+
)
|
|
218
|
+
) {
|
|
219
|
+
const bodyElem = contentElem.lastElementChild;
|
|
220
|
+
const headingSpan = document.createElement('span');
|
|
221
|
+
const children = [...contentElem.childNodes];
|
|
222
|
+
// Just in case there's a non-element child after the body
|
|
223
|
+
let child: Node | undefined;
|
|
224
|
+
do {
|
|
225
|
+
child = children.pop();
|
|
226
|
+
} while (child && child.nodeType !== Node.ELEMENT_NODE);
|
|
227
|
+
headingSpan.replaceChildren(...children);
|
|
228
|
+
|
|
229
|
+
contentElem = document.createElement('div');
|
|
230
|
+
contentElem.replaceChildren(headingSpan, bodyElem);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
return contentElem;
|
|
234
|
+
},
|
|
126
235
|
},
|
|
127
236
|
// Parsing rule for backwards compatibility (when content was not inside seperate say:body div)
|
|
128
237
|
{
|
|
129
238
|
tag: 'div',
|
|
239
|
+
context: 'article/article_body/',
|
|
130
240
|
getAttrs(element: HTMLElement) {
|
|
131
241
|
const numberSpan = element.querySelector(`
|
|
132
|
-
|
|
133
|
-
|
|
242
|
+
span[property~='${ELI('number').prefixed}'],
|
|
243
|
+
span[property~='${ELI('number').full}']`);
|
|
134
244
|
if (
|
|
135
245
|
hasRDFaAttribute(element, 'property', SAY('hasParagraph')) &&
|
|
136
246
|
hasRDFaAttribute(element, 'typeof', SAY('Paragraph')) &&
|
|
@@ -138,7 +248,7 @@ export const article_paragraph: NodeSpec = {
|
|
|
138
248
|
numberSpan
|
|
139
249
|
) {
|
|
140
250
|
return {
|
|
141
|
-
|
|
251
|
+
subject: element.getAttribute('resource'),
|
|
142
252
|
number: numberSpan.textContent,
|
|
143
253
|
};
|
|
144
254
|
}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PNode, RdfaAttrs } from '@lblod/ember-rdfa-editor';
|
|
2
2
|
import { StructureSpec } from '..';
|
|
3
3
|
import {
|
|
4
4
|
constructStructureBodyNodeSpec,
|
|
5
5
|
constructStructureNodeSpec,
|
|
6
|
-
|
|
7
|
-
getNumberAttributesFromNode,
|
|
6
|
+
constructStructureHeaderNodeSpec,
|
|
8
7
|
getNumberUtils,
|
|
9
|
-
getStructureHeaderAttrs,
|
|
10
8
|
} from '../utils/structure';
|
|
9
|
+
import { constructStructureHeader } from './structure-header';
|
|
11
10
|
import { v4 as uuid } from 'uuid';
|
|
11
|
+
import { sayDataFactory } from '@lblod/ember-rdfa-editor/core/say-data-factory';
|
|
12
12
|
import {
|
|
13
|
+
ELI,
|
|
13
14
|
EXT,
|
|
14
15
|
SAY,
|
|
15
16
|
} from '@lblod/ember-rdfa-editor-lblod-plugins/utils/constants';
|
|
@@ -33,50 +34,93 @@ export const articleSpec: StructureSpec = {
|
|
|
33
34
|
},
|
|
34
35
|
continuous: true,
|
|
35
36
|
constructor: ({ schema, number, content, intl, state }) => {
|
|
37
|
+
const numberConverted = number?.toString() ?? '1';
|
|
36
38
|
const translationWithDocLang = getTranslationFunction(state);
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
PLACEHOLDERS.title,
|
|
47
|
-
intl?.t(PLACEHOLDERS.title) || '',
|
|
48
|
-
),
|
|
49
|
-
}),
|
|
50
|
-
),
|
|
51
|
-
schema.node(
|
|
52
|
-
`article_body`,
|
|
53
|
-
{},
|
|
54
|
-
content ??
|
|
55
|
-
schema.node(
|
|
56
|
-
'paragraph',
|
|
57
|
-
{},
|
|
58
|
-
schema.node('placeholder', {
|
|
59
|
-
placeholderText: translationWithDocLang(
|
|
60
|
-
PLACEHOLDERS.body,
|
|
61
|
-
intl?.t(PLACEHOLDERS.body) || '',
|
|
62
|
-
),
|
|
63
|
-
}),
|
|
64
|
-
),
|
|
65
|
-
),
|
|
66
|
-
],
|
|
39
|
+
const articleUuid = uuid();
|
|
40
|
+
const titleRdfaId = uuid();
|
|
41
|
+
const headingRdfaId = uuid();
|
|
42
|
+
const numberRdfaId = uuid();
|
|
43
|
+
const bodyRdfaId = uuid();
|
|
44
|
+
const subject = `http://data.lblod.info/articles/${articleUuid}`;
|
|
45
|
+
const titleText = translationWithDocLang(
|
|
46
|
+
PLACEHOLDERS.title,
|
|
47
|
+
intl?.t(PLACEHOLDERS.title) || '',
|
|
67
48
|
);
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
49
|
+
const articleAttrs: RdfaAttrs = {
|
|
50
|
+
__rdfaId: articleUuid,
|
|
51
|
+
rdfaNodeType: 'resource',
|
|
52
|
+
subject,
|
|
53
|
+
properties: [
|
|
54
|
+
{
|
|
55
|
+
predicate: ELI('number').prefixed,
|
|
56
|
+
object: sayDataFactory.literalNode(numberRdfaId),
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
predicate: SAY('heading').prefixed,
|
|
60
|
+
object: sayDataFactory.literalNode(headingRdfaId),
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
predicate: EXT('title').prefixed,
|
|
64
|
+
object: sayDataFactory.literalNode(titleRdfaId),
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
predicate: SAY('body').prefixed,
|
|
68
|
+
object: sayDataFactory.literalNode(bodyRdfaId),
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
backlinks: [],
|
|
72
|
+
};
|
|
73
|
+
const bodyAttrs: RdfaAttrs = {
|
|
74
|
+
__rdfaId: bodyRdfaId,
|
|
75
|
+
rdfaNodeType: 'literal',
|
|
76
|
+
backlinks: [
|
|
77
|
+
{
|
|
78
|
+
subject: sayDataFactory.literalNode(subject),
|
|
79
|
+
predicate: SAY('body').prefixed,
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
};
|
|
83
|
+
const node = schema.node(`article`, articleAttrs, [
|
|
84
|
+
constructStructureHeader({
|
|
85
|
+
schema,
|
|
86
|
+
backlinkResource: subject,
|
|
87
|
+
titleRdfaId,
|
|
88
|
+
titleText,
|
|
89
|
+
headingRdfaId,
|
|
90
|
+
numberRdfaId,
|
|
91
|
+
number: numberConverted,
|
|
92
|
+
headerType: 'article_header',
|
|
93
|
+
}),
|
|
94
|
+
schema.node(
|
|
95
|
+
`article_body`,
|
|
96
|
+
bodyAttrs,
|
|
97
|
+
content ??
|
|
98
|
+
schema.node(
|
|
99
|
+
'paragraph',
|
|
100
|
+
{},
|
|
101
|
+
schema.node('placeholder', {
|
|
102
|
+
placeholderText: translationWithDocLang(
|
|
103
|
+
PLACEHOLDERS.body,
|
|
104
|
+
intl?.t(PLACEHOLDERS.body) || '',
|
|
105
|
+
),
|
|
106
|
+
}),
|
|
107
|
+
),
|
|
108
|
+
),
|
|
109
|
+
]);
|
|
110
|
+
|
|
74
111
|
return {
|
|
75
112
|
node,
|
|
76
|
-
selectionConfig
|
|
113
|
+
selectionConfig: {
|
|
114
|
+
type: content ? 'text' : 'node',
|
|
115
|
+
rdfaId: bodyRdfaId,
|
|
116
|
+
},
|
|
117
|
+
newResource: subject,
|
|
77
118
|
};
|
|
78
119
|
},
|
|
79
|
-
...getNumberUtils(
|
|
120
|
+
...getNumberUtils({
|
|
121
|
+
offset: 1,
|
|
122
|
+
convertNumber: (number) => number.toString(),
|
|
123
|
+
}),
|
|
80
124
|
content: ({ pos, state }) => {
|
|
81
125
|
const node = unwrap(state.doc.nodeAt(pos));
|
|
82
126
|
return node.child(1).content;
|
|
@@ -88,67 +132,16 @@ export const article = constructStructureNodeSpec({
|
|
|
88
132
|
content: 'article_header article_body',
|
|
89
133
|
});
|
|
90
134
|
|
|
91
|
-
export const article_header
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
isolating: true,
|
|
95
|
-
defining: true,
|
|
96
|
-
attrs: {
|
|
97
|
-
number: {
|
|
98
|
-
default: 1,
|
|
99
|
-
},
|
|
100
|
-
numberDisplayStyle: {
|
|
101
|
-
default: 'decimal', // decimal, roman
|
|
102
|
-
},
|
|
103
|
-
startNumber: {
|
|
104
|
-
default: null,
|
|
105
|
-
},
|
|
106
|
-
property: {
|
|
107
|
-
default: SAY('heading').prefixed,
|
|
108
|
-
},
|
|
109
|
-
},
|
|
110
|
-
allowSplitByTable: false,
|
|
135
|
+
export const article_header = constructStructureHeaderNodeSpec({
|
|
136
|
+
type: 'article_header',
|
|
137
|
+
includeLevel: false,
|
|
111
138
|
outlineText: (node: PNode) => {
|
|
112
139
|
const { number } = node.attrs;
|
|
113
140
|
return `Artikel ${number as string}: ${node.textContent}`;
|
|
114
141
|
},
|
|
115
|
-
|
|
116
|
-
return [
|
|
117
|
-
'div',
|
|
118
|
-
{
|
|
119
|
-
property: node.attrs.property as string,
|
|
120
|
-
...getNumberAttributesFromNode(node),
|
|
121
|
-
},
|
|
122
|
-
'Artikel ',
|
|
123
|
-
getNumberDocSpecFromNode(node),
|
|
124
|
-
['span', { contenteditable: false }, ': '],
|
|
125
|
-
[
|
|
126
|
-
'span',
|
|
127
|
-
{
|
|
128
|
-
property: EXT('title').prefixed,
|
|
129
|
-
},
|
|
130
|
-
0,
|
|
131
|
-
],
|
|
132
|
-
];
|
|
133
|
-
},
|
|
134
|
-
parseDOM: [
|
|
135
|
-
{
|
|
136
|
-
tag: 'div',
|
|
137
|
-
getAttrs(element: HTMLElement) {
|
|
138
|
-
const headerAttrs = getStructureHeaderAttrs(element);
|
|
139
|
-
|
|
140
|
-
if (headerAttrs) {
|
|
141
|
-
return headerAttrs;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
return false;
|
|
145
|
-
},
|
|
146
|
-
contentElement: `span[property~='${EXT('title').prefixed}'],
|
|
147
|
-
span[property~='${EXT('title').full}']`,
|
|
148
|
-
},
|
|
149
|
-
],
|
|
150
|
-
};
|
|
142
|
+
});
|
|
151
143
|
|
|
152
144
|
export const article_body = constructStructureBodyNodeSpec({
|
|
153
145
|
content: '(block|article_paragraph)+',
|
|
146
|
+
context: 'article//',
|
|
154
147
|
});
|