@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,29 +1,34 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
Attrs,
|
|
3
3
|
NodeSpec,
|
|
4
4
|
NodeType,
|
|
5
5
|
PNode,
|
|
6
|
+
rdfaAttrSpec,
|
|
6
7
|
Schema,
|
|
7
8
|
Selection,
|
|
8
9
|
} from '@lblod/ember-rdfa-editor';
|
|
10
|
+
import {
|
|
11
|
+
getRdfaAttrs,
|
|
12
|
+
getRdfaContentElement,
|
|
13
|
+
hasRdfaContentChild,
|
|
14
|
+
renderRdfaAware,
|
|
15
|
+
} from '@lblod/ember-rdfa-editor/core/schema';
|
|
9
16
|
import { findParentNodeOfType } from '@curvenote/prosemirror-utils';
|
|
10
17
|
import {
|
|
11
|
-
|
|
18
|
+
EXT,
|
|
12
19
|
RDF,
|
|
13
20
|
SAY,
|
|
14
|
-
XSD,
|
|
15
21
|
} from '@lblod/ember-rdfa-editor-lblod-plugins/utils/constants';
|
|
16
22
|
import {
|
|
17
|
-
|
|
23
|
+
hasBacklink,
|
|
24
|
+
hasOutgoingNamedNodeTriple,
|
|
18
25
|
Resource,
|
|
19
26
|
} from '@lblod/ember-rdfa-editor-lblod-plugins/utils/namespace';
|
|
20
|
-
import { unwrap } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/option';
|
|
21
27
|
import { StructureSpec } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/article-structure-plugin';
|
|
22
|
-
import {
|
|
23
|
-
|
|
24
|
-
romanToInt,
|
|
25
|
-
} from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/article-structure-plugin/utils/romanize';
|
|
28
|
+
import { unwrap } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/option';
|
|
29
|
+
import { romanize } from './romanize';
|
|
26
30
|
|
|
31
|
+
const rdfaAware = true;
|
|
27
32
|
export function constructStructureNodeSpec(config: {
|
|
28
33
|
type: Resource;
|
|
29
34
|
content: string;
|
|
@@ -35,37 +40,54 @@ export function constructStructureNodeSpec(config: {
|
|
|
35
40
|
group,
|
|
36
41
|
content,
|
|
37
42
|
inline: false,
|
|
43
|
+
editable: true,
|
|
44
|
+
isolating: true,
|
|
38
45
|
attrs: {
|
|
39
|
-
|
|
40
|
-
|
|
46
|
+
...rdfaAttrSpec({ rdfaAware }),
|
|
47
|
+
rdfaNodeType: {
|
|
48
|
+
default: 'resource',
|
|
41
49
|
},
|
|
42
50
|
typeof: {
|
|
43
51
|
default: type.prefixed,
|
|
44
52
|
},
|
|
45
|
-
|
|
53
|
+
subject: {},
|
|
46
54
|
},
|
|
47
55
|
allowSplitByTable: config.allowSplitByTable,
|
|
48
56
|
toDOM(node) {
|
|
49
|
-
return
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
57
|
+
return renderRdfaAware({
|
|
58
|
+
renderable: node,
|
|
59
|
+
tag: 'div',
|
|
60
|
+
attrs: {
|
|
61
|
+
...node.attrs,
|
|
62
|
+
class: 'say-editable',
|
|
55
63
|
},
|
|
56
|
-
0,
|
|
57
|
-
|
|
64
|
+
content: 0,
|
|
65
|
+
});
|
|
58
66
|
},
|
|
59
67
|
parseDOM: [
|
|
60
68
|
{
|
|
61
69
|
tag: 'div',
|
|
70
|
+
preserveWhitespace: false,
|
|
62
71
|
getAttrs(element: HTMLElement) {
|
|
72
|
+
const rdfaAttrs = getRdfaAttrs(element, { rdfaAware });
|
|
63
73
|
if (
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
element.getAttribute('resource')
|
|
74
|
+
hasOutgoingNamedNodeTriple(rdfaAttrs, RDF('type'), type) &&
|
|
75
|
+
hasRdfaContentChild(element)
|
|
67
76
|
) {
|
|
68
|
-
return
|
|
77
|
+
return rdfaAttrs;
|
|
78
|
+
}
|
|
79
|
+
return false;
|
|
80
|
+
},
|
|
81
|
+
contentElement: getRdfaContentElement,
|
|
82
|
+
},
|
|
83
|
+
// Backwards compatibility
|
|
84
|
+
{
|
|
85
|
+
tag: 'div',
|
|
86
|
+
preserveWhitespace: false,
|
|
87
|
+
getAttrs(element: HTMLElement) {
|
|
88
|
+
const rdfaAttrs = getRdfaAttrs(element, { rdfaAware });
|
|
89
|
+
if (hasOutgoingNamedNodeTriple(rdfaAttrs, RDF('type'), type)) {
|
|
90
|
+
return rdfaAttrs;
|
|
69
91
|
}
|
|
70
92
|
return false;
|
|
71
93
|
},
|
|
@@ -76,37 +98,158 @@ export function constructStructureNodeSpec(config: {
|
|
|
76
98
|
|
|
77
99
|
export function constructStructureBodyNodeSpec(config: {
|
|
78
100
|
content: string;
|
|
101
|
+
context: string;
|
|
79
102
|
allowSplitByTable?: boolean;
|
|
103
|
+
tag?: string;
|
|
80
104
|
}): NodeSpec {
|
|
81
|
-
const { content } = config;
|
|
105
|
+
const { content, context, tag = 'div' } = config;
|
|
82
106
|
return {
|
|
83
107
|
content,
|
|
84
108
|
inline: false,
|
|
85
109
|
defining: true,
|
|
110
|
+
editable: true,
|
|
86
111
|
isolating: true,
|
|
87
112
|
allowSplitByTable: config.allowSplitByTable,
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
113
|
+
attrs: rdfaAttrSpec({ rdfaAware }),
|
|
114
|
+
toDOM(node) {
|
|
115
|
+
return renderRdfaAware({
|
|
116
|
+
renderable: node,
|
|
117
|
+
tag,
|
|
118
|
+
attrs: {
|
|
119
|
+
...node.attrs,
|
|
120
|
+
class: 'say-editable',
|
|
92
121
|
property: SAY('body').prefixed,
|
|
93
122
|
datatype: RDF('XMLLiteral').prefixed,
|
|
94
123
|
},
|
|
95
|
-
0,
|
|
96
|
-
|
|
124
|
+
content: 0,
|
|
125
|
+
});
|
|
97
126
|
},
|
|
98
127
|
parseDOM: [
|
|
99
128
|
{
|
|
100
|
-
tag
|
|
129
|
+
tag,
|
|
130
|
+
context,
|
|
101
131
|
getAttrs(element: HTMLElement) {
|
|
132
|
+
const rdfaAttrs = getRdfaAttrs(element, { rdfaAware });
|
|
102
133
|
if (
|
|
103
|
-
|
|
104
|
-
|
|
134
|
+
hasBacklink(rdfaAttrs, SAY('body')) &&
|
|
135
|
+
hasRdfaContentChild(element)
|
|
105
136
|
) {
|
|
106
|
-
return
|
|
137
|
+
return rdfaAttrs;
|
|
138
|
+
}
|
|
139
|
+
return false;
|
|
140
|
+
},
|
|
141
|
+
contentElement: getRdfaContentElement,
|
|
142
|
+
},
|
|
143
|
+
// Backwards compatibility with old versions, without explicit content nodes
|
|
144
|
+
{
|
|
145
|
+
tag,
|
|
146
|
+
context,
|
|
147
|
+
getAttrs(element: HTMLElement) {
|
|
148
|
+
const rdfaAttrs = getRdfaAttrs(element, { rdfaAware });
|
|
149
|
+
if (hasBacklink(rdfaAttrs, SAY('body'))) {
|
|
150
|
+
return rdfaAttrs;
|
|
151
|
+
}
|
|
152
|
+
return false;
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
],
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
const TAG_TO_LEVEL = new Map([
|
|
160
|
+
['h1', 1],
|
|
161
|
+
['h2', 2],
|
|
162
|
+
['h3', 3],
|
|
163
|
+
['h4', 4],
|
|
164
|
+
['h5', 5],
|
|
165
|
+
['h6', 6],
|
|
166
|
+
]);
|
|
167
|
+
|
|
168
|
+
export type StructureHeaderType = 'structure_header' | 'article_header';
|
|
169
|
+
|
|
170
|
+
type StructureHeaderArgs = {
|
|
171
|
+
type: StructureHeaderType;
|
|
172
|
+
outlineText: (node: PNode) => string;
|
|
173
|
+
includeLevel: boolean;
|
|
174
|
+
numberDisplayStyle?: 'decimal' | 'roman';
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
export function constructStructureHeaderNodeSpec({
|
|
178
|
+
type,
|
|
179
|
+
outlineText,
|
|
180
|
+
includeLevel,
|
|
181
|
+
numberDisplayStyle = 'decimal',
|
|
182
|
+
}: StructureHeaderArgs): NodeSpec {
|
|
183
|
+
return {
|
|
184
|
+
content: 'text* structure_header_number text* structure_header_title',
|
|
185
|
+
inline: false,
|
|
186
|
+
defining: true,
|
|
187
|
+
isolating: true,
|
|
188
|
+
editable: true,
|
|
189
|
+
selectable: false,
|
|
190
|
+
allowSplitByTable: false,
|
|
191
|
+
attrs: {
|
|
192
|
+
...rdfaAttrSpec({ rdfaAware }),
|
|
193
|
+
property: {
|
|
194
|
+
default: SAY('heading').prefixed,
|
|
195
|
+
},
|
|
196
|
+
number: {
|
|
197
|
+
default: 1,
|
|
198
|
+
},
|
|
199
|
+
numberDisplayStyle: {
|
|
200
|
+
default: numberDisplayStyle,
|
|
201
|
+
},
|
|
202
|
+
startNumber: {
|
|
203
|
+
default: null,
|
|
204
|
+
},
|
|
205
|
+
...(includeLevel
|
|
206
|
+
? {
|
|
207
|
+
level: {
|
|
208
|
+
default: 1,
|
|
209
|
+
},
|
|
210
|
+
}
|
|
211
|
+
: {}),
|
|
212
|
+
},
|
|
213
|
+
outlineText,
|
|
214
|
+
toDOM(node) {
|
|
215
|
+
const { level, ...attrs } = node.attrs;
|
|
216
|
+
return renderRdfaAware({
|
|
217
|
+
renderable: node,
|
|
218
|
+
tag: includeLevel ? `h${level as number}` : 'span',
|
|
219
|
+
rdfaContainerTag: 'span',
|
|
220
|
+
contentContainerTag: 'span',
|
|
221
|
+
attrs: {
|
|
222
|
+
...enhanceAttributesWithNumberAttributes(attrs),
|
|
223
|
+
...(includeLevel ? { level: level as number } : {}),
|
|
224
|
+
},
|
|
225
|
+
content: 0,
|
|
226
|
+
});
|
|
227
|
+
},
|
|
228
|
+
parseDOM: [
|
|
229
|
+
{
|
|
230
|
+
tag: `h1,h2,h3,h4,h5,h6,span${type === 'article_header' ? ',div' : ''}`,
|
|
231
|
+
context: type === 'article_header' ? 'article/' : undefined,
|
|
232
|
+
// Need to have higher priority than default (50) as otherwise seems to get parsed as a
|
|
233
|
+
// generic header
|
|
234
|
+
priority: 60,
|
|
235
|
+
getAttrs(element: HTMLElement) {
|
|
236
|
+
const level = TAG_TO_LEVEL.get(element.tagName.toLowerCase()) ?? 6;
|
|
237
|
+
const rdfaAttrs = getRdfaAttrs(element, { rdfaAware });
|
|
238
|
+
if (hasBacklink(rdfaAttrs, SAY('heading'))) {
|
|
239
|
+
const titleChild = element.querySelector(`
|
|
240
|
+
span[property~='${EXT('title').prefixed}'],
|
|
241
|
+
span[property~='${EXT('title').full}']`);
|
|
242
|
+
|
|
243
|
+
const numberAttributes = getNodeNumberAttrsFromElement(element);
|
|
244
|
+
|
|
245
|
+
if (titleChild) {
|
|
246
|
+
return { level, ...rdfaAttrs, ...numberAttributes };
|
|
247
|
+
}
|
|
107
248
|
}
|
|
249
|
+
|
|
108
250
|
return false;
|
|
109
251
|
},
|
|
252
|
+
contentElement: getRdfaContentElement,
|
|
110
253
|
},
|
|
111
254
|
],
|
|
112
255
|
};
|
|
@@ -128,61 +271,6 @@ export function findAncestorOfType(selection: Selection, ...types: NodeType[]) {
|
|
|
128
271
|
return;
|
|
129
272
|
}
|
|
130
273
|
|
|
131
|
-
export function getNumberAttributeFromElement(
|
|
132
|
-
containerElement: Element,
|
|
133
|
-
numberElement: Element,
|
|
134
|
-
): {
|
|
135
|
-
number: number;
|
|
136
|
-
numberDisplayStyle: string;
|
|
137
|
-
startNumber: number | null;
|
|
138
|
-
} {
|
|
139
|
-
// Storing the number in the content attribute was not introduced straight away,
|
|
140
|
-
// so we need to check for both the content attribute and the textContent.
|
|
141
|
-
const contentAttribute = numberElement.getAttribute('content');
|
|
142
|
-
|
|
143
|
-
// If the content attribute is present, we can assume it is the correct number.
|
|
144
|
-
if (contentAttribute) {
|
|
145
|
-
return {
|
|
146
|
-
number: parseInt(contentAttribute, 10),
|
|
147
|
-
...getNodeNumberAttrsFromElement(containerElement),
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
const textContentNumber = numberElement.textContent;
|
|
152
|
-
|
|
153
|
-
if (!textContentNumber) {
|
|
154
|
-
return { number: 1, ...getNodeNumberAttrsFromElement(containerElement) };
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
// If the textContent is a number, we can assume it is the correct number.
|
|
158
|
-
if (/^[0-9]+$/.exec(textContentNumber)) {
|
|
159
|
-
return {
|
|
160
|
-
number: parseInt(textContentNumber, 10),
|
|
161
|
-
...getNodeNumberAttrsFromElement(containerElement),
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
// Otherwise, we assume it is a roman number.
|
|
166
|
-
return {
|
|
167
|
-
number: romanToInt(textContentNumber),
|
|
168
|
-
...getNodeNumberAttrsFromElement(containerElement),
|
|
169
|
-
numberDisplayStyle: 'roman',
|
|
170
|
-
};
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
export function getStructureHeaderAttrs(element: HTMLElement) {
|
|
174
|
-
const numberElement = element.querySelector(
|
|
175
|
-
`[property~="${ELI('number').prefixed}"],
|
|
176
|
-
[property~="${ELI('number').full}"]`,
|
|
177
|
-
);
|
|
178
|
-
|
|
179
|
-
if (hasRDFaAttribute(element, 'property', SAY('heading')) && numberElement) {
|
|
180
|
-
return getNumberAttributeFromElement(element, numberElement);
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
return false;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
274
|
export function containsOnlyPlaceholder(schema: Schema, node: PNode) {
|
|
187
275
|
return (
|
|
188
276
|
node.childCount === 1 &&
|
|
@@ -191,57 +279,72 @@ export function containsOnlyPlaceholder(schema: Schema, node: PNode) {
|
|
|
191
279
|
);
|
|
192
280
|
}
|
|
193
281
|
|
|
194
|
-
export const
|
|
195
|
-
|
|
196
|
-
? `${node.attrs.startNumber}`
|
|
197
|
-
: null,
|
|
198
|
-
['data-number-display-style']: node.attrs.numberDisplayStyle as string,
|
|
199
|
-
});
|
|
282
|
+
export const enhanceAttributesWithNumberAttributes = (attrs: Attrs) => {
|
|
283
|
+
const { startNumber, numberDisplayStyle, number, ...remainingAttrs } = attrs;
|
|
200
284
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
node.attrs.numberDisplayStyle === 'roman'
|
|
210
|
-
? romanize(node.attrs.number ?? '1')
|
|
211
|
-
: `${node.attrs.number ?? '1'}`,
|
|
212
|
-
];
|
|
285
|
+
return {
|
|
286
|
+
['data-number']: number ? `${number}` : null,
|
|
287
|
+
['data-start-number']: startNumber ? `${startNumber}` : null,
|
|
288
|
+
['data-number-display-style']: numberDisplayStyle as string,
|
|
289
|
+
number: number as string,
|
|
290
|
+
...remainingAttrs,
|
|
291
|
+
};
|
|
292
|
+
};
|
|
213
293
|
|
|
214
294
|
const getNodeNumberAttrsFromElement = (element: Element) => {
|
|
295
|
+
const number = element.getAttribute('data-number');
|
|
215
296
|
const startNumber = element.getAttribute('data-start-number');
|
|
216
297
|
const numberDisplayStyle = element.getAttribute('data-number-display-style');
|
|
217
298
|
|
|
218
299
|
return {
|
|
219
300
|
numberDisplayStyle: numberDisplayStyle ?? 'decimal',
|
|
220
301
|
startNumber: startNumber ? parseInt(startNumber, 10) : null,
|
|
302
|
+
number: number ? parseInt(number, 10) : 1,
|
|
221
303
|
};
|
|
222
304
|
};
|
|
223
305
|
|
|
224
|
-
|
|
306
|
+
const maybeNumber = (number: string | number | null | undefined) => {
|
|
307
|
+
if (typeof number === 'string' && number.length > 0) {
|
|
308
|
+
return parseInt(number, 10);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
if (typeof number === 'number') {
|
|
312
|
+
return number;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
return null;
|
|
316
|
+
};
|
|
317
|
+
|
|
318
|
+
type NumberUtilsProps = {
|
|
225
319
|
// Offset for the position of the node where the starting number is stored.
|
|
226
320
|
// For structures with `structure_header` it will usually be +1,
|
|
227
321
|
// for `articleParagraph` it is 0.
|
|
322
|
+
offset?: number;
|
|
323
|
+
convertNumber?: (number: number) => string;
|
|
324
|
+
};
|
|
325
|
+
|
|
326
|
+
export const getNumberUtils = ({
|
|
228
327
|
offset = 0,
|
|
229
|
-
|
|
328
|
+
convertNumber = romanize,
|
|
329
|
+
}: NumberUtilsProps): Pick<
|
|
230
330
|
StructureSpec,
|
|
231
|
-
|
|
331
|
+
| 'setStartNumber'
|
|
332
|
+
| 'getStartNumber'
|
|
333
|
+
| 'getNumber'
|
|
334
|
+
| 'setNumber'
|
|
335
|
+
| 'numberConfig'
|
|
232
336
|
> => ({
|
|
233
|
-
|
|
234
|
-
|
|
337
|
+
numberConfig: {
|
|
338
|
+
convertNumber,
|
|
235
339
|
},
|
|
340
|
+
setNumber: ({ number, pos, transaction }) =>
|
|
341
|
+
transaction.setNodeAttribute(pos + offset, 'number', number),
|
|
236
342
|
getNumber: ({ pos, transaction }) => {
|
|
237
343
|
const node = unwrap(transaction.doc.nodeAt(pos + offset));
|
|
238
|
-
const number = node.attrs.number as string | number | undefined | null;
|
|
239
344
|
|
|
240
|
-
|
|
241
|
-
return parseInt(number, 10);
|
|
242
|
-
}
|
|
345
|
+
const number = maybeNumber(node.attrs.number);
|
|
243
346
|
|
|
244
|
-
if (
|
|
347
|
+
if (number !== null) {
|
|
245
348
|
return number;
|
|
246
349
|
}
|
|
247
350
|
|
|
@@ -249,17 +352,10 @@ export const getNumberUtils = (
|
|
|
249
352
|
},
|
|
250
353
|
getStartNumber: ({ pos, transaction }) => {
|
|
251
354
|
const node = unwrap(transaction.doc.nodeAt(pos + offset));
|
|
252
|
-
const startNumber = node.attrs.startNumber as
|
|
253
|
-
| string
|
|
254
|
-
| number
|
|
255
|
-
| undefined
|
|
256
|
-
| null;
|
|
257
355
|
|
|
258
|
-
|
|
259
|
-
return parseInt(startNumber, 10);
|
|
260
|
-
}
|
|
356
|
+
const startNumber = maybeNumber(node.attrs.startNumber);
|
|
261
357
|
|
|
262
|
-
if (
|
|
358
|
+
if (startNumber !== null) {
|
|
263
359
|
return startNumber;
|
|
264
360
|
}
|
|
265
361
|
|
|
@@ -1,18 +1,48 @@
|
|
|
1
1
|
import { PNode } from '@lblod/ember-rdfa-editor';
|
|
2
2
|
import { CitationSchema } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/citation-plugin';
|
|
3
|
+
import {
|
|
4
|
+
ELI,
|
|
5
|
+
RDF,
|
|
6
|
+
} from '@lblod/ember-rdfa-editor-lblod-plugins/utils/constants';
|
|
3
7
|
import { unwrap } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/option';
|
|
8
|
+
import { sayDataFactory } from '@lblod/ember-rdfa-editor/core/say-data-factory';
|
|
4
9
|
|
|
5
10
|
export function citedText(
|
|
6
11
|
schema: CitationSchema,
|
|
7
12
|
title: string,
|
|
8
13
|
uri: string,
|
|
9
14
|
): PNode {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
const linkType = unwrap(schema.nodes.link);
|
|
16
|
+
const linkSpec = linkType.spec;
|
|
17
|
+
if (linkSpec.attrs && linkSpec.attrs['properties']) {
|
|
18
|
+
// Link node-spec is RDFa-aware
|
|
19
|
+
return linkType.create(
|
|
20
|
+
{
|
|
21
|
+
href: uri,
|
|
22
|
+
subject: uri,
|
|
23
|
+
rdfaNodeType: 'resource',
|
|
24
|
+
properties: [
|
|
25
|
+
{
|
|
26
|
+
predicate: RDF('type').full,
|
|
27
|
+
object: sayDataFactory.namedNode(ELI('LegalExpression').full),
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
predicate: ELI('cites').full,
|
|
31
|
+
object: sayDataFactory.contentLiteral(),
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
schema.text(title),
|
|
36
|
+
);
|
|
37
|
+
} else {
|
|
38
|
+
// Link node-spec uses classic RDFa
|
|
39
|
+
return linkType.create(
|
|
40
|
+
{
|
|
41
|
+
href: uri,
|
|
42
|
+
property: 'eli:cites',
|
|
43
|
+
typeof: 'eli:LegalExpression',
|
|
44
|
+
},
|
|
45
|
+
[schema.text(title)],
|
|
46
|
+
);
|
|
47
|
+
}
|
|
18
48
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MarkSpec } from '
|
|
1
|
+
import { MarkSpec } from '@lblod/ember-rdfa-editor';
|
|
2
2
|
import { EXT } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/constants';
|
|
3
3
|
import { hasRDFaAttribute } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/namespace';
|
|
4
4
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { NodeSpec, getRdfaAttrs,
|
|
1
|
+
import { NodeSpec, getRdfaAttrs, rdfaAttrSpec } from '@lblod/ember-rdfa-editor';
|
|
2
2
|
|
|
3
3
|
import { ELI } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/constants';
|
|
4
4
|
|
|
5
5
|
import { hasRDFaAttribute } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/namespace';
|
|
6
6
|
|
|
7
|
+
const rdfaAware = true;
|
|
7
8
|
export const document_title: NodeSpec = {
|
|
8
9
|
content: 'paragraph{1}',
|
|
9
10
|
inline: false,
|
|
@@ -12,7 +13,7 @@ export const document_title: NodeSpec = {
|
|
|
12
13
|
group: '',
|
|
13
14
|
allowSplitByTable: false,
|
|
14
15
|
attrs: {
|
|
15
|
-
...
|
|
16
|
+
...rdfaAttrSpec({ rdfaAware }),
|
|
16
17
|
property: {
|
|
17
18
|
default: 'eli:title',
|
|
18
19
|
},
|
|
@@ -28,7 +29,7 @@ export const document_title: NodeSpec = {
|
|
|
28
29
|
tag: 'h1,h2,h3,h4,h5',
|
|
29
30
|
getAttrs(element: HTMLElement) {
|
|
30
31
|
if (hasRDFaAttribute(element, 'property', ELI('title'))) {
|
|
31
|
-
return getRdfaAttrs(element);
|
|
32
|
+
return getRdfaAttrs(element, { rdfaAware });
|
|
32
33
|
}
|
|
33
34
|
return false;
|
|
34
35
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getRdfaAttrs, NodeSpec,
|
|
1
|
+
import { getRdfaAttrs, NodeSpec, rdfaAttrSpec } from '@lblod/ember-rdfa-editor';
|
|
2
2
|
import {
|
|
3
3
|
DCT,
|
|
4
4
|
EXT,
|
|
@@ -10,11 +10,12 @@ import { hasRDFaAttribute } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/n
|
|
|
10
10
|
const CONTENT_SELECTOR = `div[property~='${
|
|
11
11
|
DCT('description').full
|
|
12
12
|
}'],div[property~='${DCT('description').prefixed}']`;
|
|
13
|
+
const rdfaAware = false;
|
|
13
14
|
export const roadsign_regulation: NodeSpec = {
|
|
14
15
|
content: 'block+',
|
|
15
16
|
group: 'block',
|
|
16
17
|
attrs: {
|
|
17
|
-
...
|
|
18
|
+
...rdfaAttrSpec({ rdfaAware }),
|
|
18
19
|
resourceUri: {},
|
|
19
20
|
measureUri: {},
|
|
20
21
|
zonality: {},
|
|
@@ -96,7 +97,7 @@ export const roadsign_regulation: NodeSpec = {
|
|
|
96
97
|
measureUri,
|
|
97
98
|
zonality,
|
|
98
99
|
temporal,
|
|
99
|
-
...getRdfaAttrs(node),
|
|
100
|
+
...getRdfaAttrs(node, { rdfaAware }),
|
|
100
101
|
};
|
|
101
102
|
}
|
|
102
103
|
return false;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as updateSnippetIds } from './update-snippet-ids';
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Command } from '@lblod/ember-rdfa-editor';
|
|
2
|
+
import { addProperty, removeProperty } from '@lblod/ember-rdfa-editor/commands';
|
|
3
|
+
import { sayDataFactory } from '@lblod/ember-rdfa-editor/core/say-data-factory';
|
|
4
|
+
import { SNIPPET_LIST_RDFA_PREDICATE } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/snippet-plugin/utils/rdfa-predicate';
|
|
5
|
+
import { getSnippetUriFromId } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/snippet-plugin';
|
|
6
|
+
import { OutgoingTriple } from '@lblod/ember-rdfa-editor/core/rdfa-processor';
|
|
7
|
+
|
|
8
|
+
const updateSnippetIds = ({
|
|
9
|
+
resource,
|
|
10
|
+
oldSnippetProperties,
|
|
11
|
+
newSnippetIds,
|
|
12
|
+
}: {
|
|
13
|
+
resource: string;
|
|
14
|
+
oldSnippetProperties: OutgoingTriple[];
|
|
15
|
+
newSnippetIds: string[];
|
|
16
|
+
}): Command => {
|
|
17
|
+
return (state, dispatch) => {
|
|
18
|
+
if (dispatch) {
|
|
19
|
+
let transaction = state.tr;
|
|
20
|
+
let newState = state;
|
|
21
|
+
|
|
22
|
+
oldSnippetProperties.forEach((property) => {
|
|
23
|
+
newState = state.apply(transaction);
|
|
24
|
+
|
|
25
|
+
removeProperty({
|
|
26
|
+
resource,
|
|
27
|
+
property,
|
|
28
|
+
transaction,
|
|
29
|
+
})(newState, (newTransaction) => {
|
|
30
|
+
transaction = newTransaction;
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
newSnippetIds.forEach((snippetId) => {
|
|
35
|
+
newState = state.apply(transaction);
|
|
36
|
+
|
|
37
|
+
addProperty({
|
|
38
|
+
resource,
|
|
39
|
+
property: {
|
|
40
|
+
predicate: SNIPPET_LIST_RDFA_PREDICATE.prefixed,
|
|
41
|
+
object: sayDataFactory.namedNode(getSnippetUriFromId(snippetId)),
|
|
42
|
+
},
|
|
43
|
+
transaction,
|
|
44
|
+
})(newState, (newTransaction) => {
|
|
45
|
+
transaction = newTransaction;
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
dispatch(transaction);
|
|
50
|
+
}
|
|
51
|
+
return true;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export default updateSnippetIds;
|
|
@@ -34,13 +34,18 @@ interface SnippetListArgs {
|
|
|
34
34
|
|
|
35
35
|
const snippetListBase = 'http://lblod.data.gift/snippet-lists/';
|
|
36
36
|
|
|
37
|
+
export const getSnippetUriFromId = (id: string) => `${snippetListBase}${id}`;
|
|
38
|
+
|
|
39
|
+
export const getSnippetIdFromUri = (uri: string) =>
|
|
40
|
+
uri.replace(snippetListBase, '');
|
|
41
|
+
|
|
37
42
|
export class SnippetList {
|
|
38
43
|
id: string | null;
|
|
39
44
|
label: string | null;
|
|
40
45
|
createdOn: string | null;
|
|
41
46
|
|
|
42
47
|
constructor({ id, label, createdOn }: SnippetListArgs) {
|
|
43
|
-
this.id = id
|
|
48
|
+
this.id = id ? getSnippetIdFromUri(id) : null;
|
|
44
49
|
this.label = label;
|
|
45
50
|
this.createdOn = dateValue(createdOn ?? undefined);
|
|
46
51
|
}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
executeCountQuery,
|
|
3
3
|
executeQuery,
|
|
4
|
+
sparqlEscapeString,
|
|
4
5
|
} from '@lblod/ember-rdfa-editor-lblod-plugins/utils/sparql-helpers';
|
|
5
6
|
import { Snippet, SnippetList } from '../index';
|
|
6
7
|
|
|
7
8
|
type Filter = { name?: string; assignedSnippetListIds?: string[] };
|
|
8
9
|
type Pagination = { pageNumber: number; pageSize: number };
|
|
9
10
|
|
|
10
|
-
const sparqlEscapeString = (value: string) =>
|
|
11
|
-
'"""' + value.replace(/[\\"]/g, (match) => '\\' + match) + '"""';
|
|
12
|
-
|
|
13
11
|
const buildSnippetCountQuery = ({ name, assignedSnippetListIds }: Filter) => {
|
|
14
12
|
return `
|
|
15
13
|
PREFIX schema: <http://schema.org/>
|