@lblod/ember-rdfa-editor-lblod-plugins 16.4.0 → 17.0.0-dev.f473cdfb5868261b49cdae52ea2558970c082d01
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.changeset/afraid-tips-visit.md +5 -0
- package/.changeset/chilly-ravens-think.md +6 -0
- package/.changeset/hot-owls-laugh.md +5 -0
- package/.changeset/olive-pets-cheer.md +5 -0
- package/.changeset/smooth-fireants-doubt.md +5 -0
- package/.changeset/tall-carrots-ring.md +5 -0
- package/.changeset/wet-baboons-serve.md +5 -0
- package/.changeset/witty-suns-speak.md +5 -0
- package/.woodpecker/.release-commit.yml +18 -0
- package/.woodpecker/.release.yml +21 -0
- package/.woodpecker/.verify-pr.yml +30 -0
- package/CHANGELOG.md +14 -0
- package/Dockerfile +6 -4
- package/addon/commands/index.ts +1 -0
- package/addon/commands/replace-selection-and-select-node.ts +24 -0
- package/addon/components/article-structure-plugin/article-structure-card.hbs +2 -1
- package/addon/components/article-structure-plugin/article-structure-card.ts +2 -0
- package/addon/components/article-structure-plugin/structure-card.hbs +7 -6
- package/addon/components/article-structure-plugin/structure-card.ts +49 -35
- package/addon/components/au-native-input.hbs +1 -0
- package/addon/components/au-native-input.ts +2 -1
- package/addon/components/besluit-type-plugin/besluit-type-select.hbs +3 -2
- package/addon/components/besluit-type-plugin/besluit-type-select.ts +4 -0
- package/addon/components/besluit-type-plugin/toolbar-dropdown.hbs +5 -4
- package/addon/components/besluit-type-plugin/toolbar-dropdown.ts +48 -20
- package/addon/components/citation-plugin/citation-card.hbs +3 -2
- package/addon/components/citation-plugin/citation-card.ts +9 -2
- package/addon/components/citation-plugin/citation-insert.hbs +2 -1
- package/addon/components/citation-plugin/citation-insert.ts +3 -0
- package/addon/components/citation-plugin/citations/article-preview.hbs +3 -2
- package/addon/components/citation-plugin/citations/article-preview.ts +2 -0
- package/addon/components/citation-plugin/citations/legal-document-detail.hbs +17 -9
- package/addon/components/citation-plugin/citations/legal-document-detail.ts +18 -1
- package/addon/components/citation-plugin/citations/legal-document-preview.hbs +10 -9
- package/addon/components/citation-plugin/citations/legal-document-preview.ts +9 -0
- package/addon/components/citation-plugin/citations/search-modal.hbs +3 -2
- package/addon/components/citation-plugin/citations/search-modal.ts +3 -0
- package/addon/components/common/search/alert-load-error.gts +34 -0
- package/addon/components/common/search/alert-no-items.gts +18 -0
- package/addon/components/confidentiality-plugin/redact.gts +13 -0
- package/addon/components/decision-plugin/decision-plugin-card.hbs +4 -3
- package/addon/components/decision-plugin/decision-plugin-card.ts +3 -0
- package/addon/components/document-title-plugin/insert-title-card.hbs +8 -1
- package/addon/components/document-title-plugin/insert-title-card.ts +3 -0
- package/addon/components/generic-rdfa-variable/insert-menu.hbs +2 -1
- package/addon/components/generic-rdfa-variable/insert-menu.ts +3 -1
- package/addon/components/hover-tooltip.hbs +1 -0
- package/addon/components/import-snippet-plugin/card.hbs +1 -0
- package/addon/components/import-snippet-plugin/card.ts +7 -2
- package/addon/components/loading-alert.hbs +2 -1
- package/addon/components/loading-alert.ts +5 -2
- package/addon/components/pagination/pagination-view.gts +55 -0
- package/addon/components/roadsign-regulation-plugin/expanded-measure.hbs +28 -37
- package/addon/components/roadsign-regulation-plugin/expanded-measure.ts +4 -13
- package/addon/components/roadsign-regulation-plugin/measure-template.hbs +1 -0
- package/addon/components/roadsign-regulation-plugin/roadsign-regulation-card.hbs +2 -1
- package/addon/components/roadsign-regulation-plugin/roadsign-regulation-card.ts +3 -0
- package/addon/components/roadsign-regulation-plugin/roadsigns-modal.hbs +1 -0
- package/addon/components/roadsign-regulation-plugin/roadsigns-pagination.hbs +9 -4
- package/addon/components/roadsign-regulation-plugin/roadsigns-pagination.ts +5 -0
- package/addon/components/roadsign-regulation-plugin/roadsigns-table.hbs +7 -6
- package/addon/components/roadsign-regulation-plugin/roadsigns-table.ts +5 -0
- package/addon/components/snippet-plugin/search-modal.hbs +1 -0
- package/addon/components/snippet-plugin/snippet-insert-rdfa.hbs +7 -0
- package/addon/components/snippet-plugin/snippet-insert-rdfa.ts +78 -0
- package/addon/components/snippet-plugin/snippet-insert.hbs +3 -1
- package/addon/components/snippet-plugin/snippet-insert.ts +25 -4
- package/addon/components/snippet-plugin/snippet-list/snippet-list-modal.hbs +1 -0
- package/addon/components/snippet-plugin/snippet-list/snippet-list-modal.ts +3 -3
- package/addon/components/snippet-plugin/snippet-list/snippet-list-view.hbs +3 -2
- package/addon/components/snippet-plugin/snippet-list-select-rdfa.hbs +8 -0
- package/addon/components/snippet-plugin/snippet-list-select-rdfa.ts +69 -0
- package/addon/components/snippet-plugin/snippet-list-select.hbs +2 -1
- package/addon/components/snippet-plugin/snippet-list-select.ts +2 -1
- package/addon/components/snippet-plugin/snippets/snippet-preview.hbs +1 -0
- package/addon/components/standard-template-plugin/card.hbs +2 -1
- package/addon/components/standard-template-plugin/card.ts +2 -0
- package/addon/components/standard-template-plugin/template-provider.hbs +1 -0
- package/addon/components/standard-template-plugin/template-provider.ts +10 -4
- package/addon/components/table-of-contents-plugin/ember-nodes/table-of-contents.hbs +1 -0
- package/addon/components/table-of-contents-plugin/toolbar-button.hbs +1 -0
- package/addon/components/template-comments-plugin/edit-card.hbs +4 -3
- package/addon/components/template-comments-plugin/edit-card.ts +7 -0
- package/addon/components/template-comments-plugin/insert.hbs +2 -1
- package/addon/components/template-comments-plugin/insert.ts +3 -0
- package/addon/components/template-comments-plugin/template-comment.hbs +2 -1
- package/addon/components/template-comments-plugin/template-comment.ts +3 -0
- package/addon/components/validation-plugin/validation-card.hbs +1 -0
- package/addon/components/validation-plugin/validation-item.hbs +1 -0
- package/addon/components/validation-plugin/validation-item.ts +7 -4
- package/addon/components/variable-plugin/address/edit.hbs +1 -0
- package/addon/components/variable-plugin/address/edit.ts +5 -3
- package/addon/components/variable-plugin/address/insert-variable.hbs +1 -0
- package/addon/components/variable-plugin/address/insert.hbs +3 -2
- package/addon/components/variable-plugin/address/insert.ts +3 -0
- package/addon/components/variable-plugin/address/nodeview.hbs +4 -3
- package/addon/components/variable-plugin/address/nodeview.ts +9 -0
- package/addon/components/variable-plugin/address/utils.ts +28 -3
- package/addon/components/variable-plugin/codelist/edit.hbs +1 -0
- package/addon/components/variable-plugin/codelist/edit.ts +24 -7
- package/addon/components/variable-plugin/codelist/insert.hbs +1 -0
- package/addon/components/variable-plugin/codelist/insert.ts +52 -17
- package/addon/components/variable-plugin/date/date-time-picker.hbs +1 -0
- package/addon/components/variable-plugin/date/edit.hbs +27 -31
- package/addon/components/variable-plugin/date/edit.ts +47 -8
- package/addon/components/variable-plugin/date/help-modal.hbs +1 -0
- package/addon/components/variable-plugin/date/insert-variable.hbs +1 -0
- package/addon/components/variable-plugin/date/insert-variable.ts +36 -10
- package/addon/components/variable-plugin/date/insert.hbs +2 -1
- package/addon/components/variable-plugin/date/insert.ts +38 -10
- package/addon/components/variable-plugin/date/nodeview.hbs +4 -3
- package/addon/components/variable-plugin/date/nodeview.ts +11 -1
- package/addon/components/variable-plugin/insert-variable-card.hbs +1 -0
- package/addon/components/variable-plugin/insert-variable-card.ts +9 -1
- package/addon/components/variable-plugin/location/edit.hbs +1 -0
- package/addon/components/variable-plugin/location/edit.ts +1 -9
- package/addon/components/variable-plugin/location/insert.hbs +1 -0
- package/addon/components/variable-plugin/location/insert.ts +4 -7
- package/addon/components/variable-plugin/location/nodeview.hbs +19 -8
- package/addon/components/variable-plugin/location/nodeview.ts +37 -9
- package/addon/components/variable-plugin/number/insert.hbs +1 -0
- package/addon/components/variable-plugin/number/insert.ts +34 -10
- package/addon/components/variable-plugin/number/nodeview.hbs +7 -5
- package/addon/components/variable-plugin/number/nodeview.ts +32 -5
- package/addon/components/variable-plugin/text/insert.hbs +1 -0
- package/addon/components/variable-plugin/text/insert.ts +40 -12
- package/addon/components/variable-plugin/variable/nodeview.hbs +12 -8
- package/addon/components/variable-plugin/variable/nodeview.ts +16 -9
- package/addon/components/worship-plugin/administrative-unit-picker.hbs +1 -0
- package/addon/components/worship-plugin/insert.hbs +2 -1
- package/addon/components/worship-plugin/insert.ts +3 -0
- package/addon/components/worship-plugin/search-modal.hbs +1 -0
- package/addon/components/worship-plugin/search-modal.ts +2 -0
- package/addon/components/worship-plugin/sortable-table-header.hbs +4 -3
- package/addon/components/worship-plugin/sortable-table-header.ts +7 -0
- package/addon/plugins/article-structure-plugin/commands/insert-structure.ts +82 -15
- package/addon/plugins/article-structure-plugin/commands/move-selected-structure.ts +2 -1
- package/addon/plugins/article-structure-plugin/commands/recalculate-structure-numbers.ts +70 -2
- package/addon/plugins/article-structure-plugin/commands/remove-structure.ts +1 -1
- package/addon/plugins/article-structure-plugin/commands/set-structure-start-number.ts +5 -14
- package/addon/plugins/article-structure-plugin/commands/unwrap-structure.ts +1 -1
- package/addon/plugins/article-structure-plugin/commands/wrap-structure-content.ts +197 -105
- package/addon/plugins/article-structure-plugin/index.ts +16 -7
- package/addon/plugins/article-structure-plugin/structures/article-paragraph.ts +181 -71
- package/addon/plugins/article-structure-plugin/structures/article.ts +91 -98
- package/addon/plugins/article-structure-plugin/structures/chapter.ts +89 -39
- package/addon/plugins/article-structure-plugin/structures/index.ts +12 -1
- package/addon/plugins/article-structure-plugin/structures/section.ts +88 -39
- package/addon/plugins/article-structure-plugin/structures/structure-header-number.ts +56 -0
- package/addon/plugins/article-structure-plugin/structures/structure-header-title.ts +38 -0
- package/addon/plugins/article-structure-plugin/structures/structure-header.ts +87 -73
- package/addon/plugins/article-structure-plugin/structures/subsection.ts +81 -39
- package/addon/plugins/article-structure-plugin/structures/title.ts +91 -39
- package/addon/plugins/article-structure-plugin/utils/structure.ts +223 -127
- package/addon/plugins/citation-plugin/utils/cited-text.ts +38 -8
- package/addon/plugins/confidentiality-plugin/marks/redacted.ts +1 -1
- package/addon/plugins/document-title-plugin/nodes/document-title.ts +4 -3
- package/addon/plugins/roadsign-regulation-plugin/nodes.ts +4 -3
- package/addon/plugins/snippet-plugin/commands/index.ts +1 -0
- package/addon/plugins/snippet-plugin/commands/update-snippet-ids.ts +55 -0
- package/addon/plugins/snippet-plugin/index.ts +6 -1
- package/addon/plugins/snippet-plugin/utils/rdfa-predicate.ts +33 -0
- package/addon/plugins/standard-template-plugin/utils/nodes.ts +293 -81
- package/addon/plugins/table-of-contents-plugin/nodes/table-of-contents.ts +3 -2
- package/addon/plugins/variable-plugin/utils/attribute-parsers.ts +19 -1
- package/addon/plugins/variable-plugin/utils/dom-constructors.ts +3 -3
- package/addon/plugins/variable-plugin/variables/address.ts +93 -26
- package/addon/plugins/variable-plugin/variables/codelist.ts +99 -50
- package/addon/plugins/variable-plugin/variables/date.ts +143 -53
- package/addon/plugins/variable-plugin/variables/location.ts +1 -0
- package/addon/plugins/variable-plugin/variables/number.ts +99 -52
- package/addon/plugins/variable-plugin/variables/text.ts +80 -28
- package/addon/utils/_private/find-insertion-range.ts +18 -5
- package/addon/utils/dom-utils.ts +4 -0
- package/addon/utils/namespace.ts +63 -13
- package/app/components/snippet-plugin/snippet-list-insert-rdfa.js +1 -0
- package/app/components/snippet-plugin/snippet-list-select-rdfa.js +1 -0
- package/app/styles/article-structure-plugin.scss +106 -3
- package/declarations/addon/commands/index.d.ts +1 -0
- package/declarations/addon/commands/replace-selection-and-select-node.d.ts +3 -0
- package/{components → declarations/addon/components}/article-structure-plugin/article-structure-card.d.ts +1 -0
- package/{components → declarations/addon/components}/article-structure-plugin/structure-card.d.ts +5 -2
- package/{components → declarations/addon/components}/au-native-input.d.ts +2 -1
- package/{components → declarations/addon/components}/besluit-type-plugin/besluit-type-select.d.ts +1 -0
- package/{components → declarations/addon/components}/besluit-type-plugin/toolbar-dropdown.d.ts +4 -5
- package/{components → declarations/addon/components}/citation-plugin/citation-card.d.ts +3 -2
- package/{components → declarations/addon/components}/citation-plugin/citation-insert.d.ts +1 -0
- package/declarations/addon/components/citation-plugin/citations/article-list.d.ts +1 -0
- package/{components → declarations/addon/components}/citation-plugin/citations/article-preview.d.ts +2 -1
- package/{components → declarations/addon/components}/citation-plugin/citations/legal-document-detail.d.ts +8 -1
- package/declarations/addon/components/citation-plugin/citations/legal-document-list.d.ts +1 -0
- package/declarations/addon/components/citation-plugin/citations/legal-document-preview.d.ts +14 -0
- package/{components → declarations/addon/components}/citation-plugin/citations/search-modal.d.ts +1 -0
- package/declarations/addon/components/common/search/alert-load-error.d.ts +4 -0
- package/declarations/addon/components/common/search/alert-no-items.d.ts +4 -0
- package/declarations/addon/components/common/search/loading.d.ts +1 -0
- package/declarations/addon/components/confidentiality-plugin/redact.d.ts +4 -0
- package/declarations/addon/components/confidentiality-plugin/toolbar.d.ts +1 -0
- package/{components → declarations/addon/components}/decision-plugin/decision-plugin-card.d.ts +1 -0
- package/{components → declarations/addon/components}/document-title-plugin/insert-title-card.d.ts +1 -0
- package/{components → declarations/addon/components}/generic-rdfa-variable/insert-menu.d.ts +1 -0
- package/{components → declarations/addon/components}/import-snippet-plugin/card.d.ts +6 -5
- package/{components → declarations/addon/components}/loading-alert.d.ts +1 -0
- package/declarations/addon/components/pagination/pagination-view.d.ts +4 -0
- package/{components → declarations/addon/components}/roadsign-regulation-plugin/expanded-measure.d.ts +2 -2
- package/{components → declarations/addon/components}/roadsign-regulation-plugin/roadsign-regulation-card.d.ts +1 -0
- package/{components → declarations/addon/components}/roadsign-regulation-plugin/roadsigns-pagination.d.ts +2 -0
- package/{components → declarations/addon/components}/roadsign-regulation-plugin/roadsigns-table.d.ts +2 -0
- package/declarations/addon/components/snippet-plugin/snippet-insert-rdfa.d.ts +19 -0
- package/{components → declarations/addon/components}/snippet-plugin/snippet-insert.d.ts +3 -0
- package/declarations/addon/components/snippet-plugin/snippet-list-select-rdfa.d.ts +21 -0
- package/{components → declarations/addon/components}/snippet-plugin/snippet-list-select.d.ts +1 -0
- package/declarations/addon/components/snippet-plugin/snippets/snippet-list.d.ts +1 -0
- package/{components → declarations/addon/components}/standard-template-plugin/card.d.ts +1 -0
- package/declarations/addon/components/table-of-contents-plugin/ember-nodes/outline.d.ts +1 -0
- package/{components → declarations/addon/components}/template-comments-plugin/edit-card.d.ts +3 -0
- package/{components → declarations/addon/components}/template-comments-plugin/insert.d.ts +1 -0
- package/{components → declarations/addon/components}/template-comments-plugin/template-comment.d.ts +1 -0
- package/{components → declarations/addon/components}/validation-plugin/validation-item.d.ts +2 -2
- package/{components → declarations/addon/components}/variable-plugin/address/edit.d.ts +2 -2
- package/{components → declarations/addon/components}/variable-plugin/address/insert.d.ts +1 -0
- package/{components → declarations/addon/components}/variable-plugin/address/nodeview.d.ts +2 -0
- package/{components → declarations/addon/components}/variable-plugin/date/edit.d.ts +4 -2
- package/{components → declarations/addon/components}/variable-plugin/date/insert.d.ts +1 -0
- package/{components → declarations/addon/components}/variable-plugin/date/nodeview.d.ts +2 -0
- package/{components → declarations/addon/components}/variable-plugin/insert-variable-card.d.ts +9 -1
- package/{components → declarations/addon/components}/variable-plugin/location/edit.d.ts +0 -1
- package/declarations/addon/components/variable-plugin/location/nodeview.d.ts +11 -0
- package/{components → declarations/addon/components}/variable-plugin/number/nodeview.d.ts +4 -1
- package/{components → declarations/addon/components}/variable-plugin/text/insert.d.ts +1 -1
- package/declarations/addon/components/variable-plugin/utils/label-input.d.ts +1 -0
- package/declarations/addon/components/variable-plugin/variable/nodeview.d.ts +11 -0
- package/{components → declarations/addon/components}/worship-plugin/insert.d.ts +1 -0
- package/declarations/addon/components/worship-plugin/list.d.ts +1 -0
- package/{components → declarations/addon/components}/worship-plugin/sortable-table-header.d.ts +3 -0
- package/declarations/addon/plugins/article-structure-plugin/commands/recalculate-structure-numbers.d.ts +3 -0
- package/declarations/addon/plugins/article-structure-plugin/commands/set-structure-start-number.d.ts +7 -0
- package/{plugins → declarations/addon/plugins}/article-structure-plugin/index.d.ts +15 -7
- package/{plugins → declarations/addon/plugins}/article-structure-plugin/structures/article-paragraph.d.ts +2 -0
- package/declarations/addon/plugins/article-structure-plugin/structures/article.d.ts +5 -0
- package/{plugins → declarations/addon/plugins}/article-structure-plugin/structures/index.d.ts +4 -0
- package/declarations/addon/plugins/article-structure-plugin/structures/structure-header-number.d.ts +2 -0
- package/declarations/addon/plugins/article-structure-plugin/structures/structure-header-title.d.ts +2 -0
- package/declarations/addon/plugins/article-structure-plugin/structures/structure-header.d.ts +17 -0
- package/declarations/addon/plugins/article-structure-plugin/utils/structure.d.ts +42 -0
- package/declarations/addon/plugins/confidentiality-plugin/marks/redacted.d.ts +2 -0
- package/declarations/addon/plugins/snippet-plugin/commands/index.d.ts +1 -0
- package/declarations/addon/plugins/snippet-plugin/commands/update-snippet-ids.d.ts +8 -0
- package/{plugins → declarations/addon/plugins}/snippet-plugin/index.d.ts +2 -0
- package/declarations/addon/plugins/snippet-plugin/utils/rdfa-predicate.d.ts +5 -0
- package/{plugins → declarations/addon/plugins}/table-of-contents-plugin/nodes/table-of-contents.d.ts +1 -1
- package/{plugins → declarations/addon/plugins}/template-comments-plugin/node.d.ts +1 -1
- package/{plugins → declarations/addon/plugins}/variable-plugin/utils/attribute-parsers.d.ts +3 -0
- package/{plugins → declarations/addon/plugins}/variable-plugin/variables/address.d.ts +1 -1
- package/{plugins → declarations/addon/plugins}/variable-plugin/variables/codelist.d.ts +1 -1
- package/{plugins → declarations/addon/plugins}/variable-plugin/variables/date.d.ts +1 -1
- package/{plugins → declarations/addon/plugins}/variable-plugin/variables/location.d.ts +1 -1
- package/{plugins → declarations/addon/plugins}/variable-plugin/variables/number.d.ts +1 -1
- package/{plugins → declarations/addon/plugins}/variable-plugin/variables/text.d.ts +1 -1
- package/declarations/addon/serializers/application.d.ts +3 -0
- package/{services → declarations/addon/services}/import-rdfa-snippet.d.ts +2 -0
- package/{utils → declarations/addon/utils}/_private/find-insertion-range.d.ts +7 -4
- package/declarations/addon/utils/dom-utils.d.ts +2 -0
- package/declarations/addon/utils/namespace.d.ts +21 -0
- package/package.json +54 -19
- package/pnpm-lock.yaml +17788 -0
- package/scripts/generate-type-declarations.sh +16 -0
- package/tsconfig.declarations.json +15 -0
- package/tsconfig.json +7 -57
- package/tsconfig.main.json +62 -0
- package/types/ember-intl.d.ts +15 -0
- package/types/graphy/memory.dataset.fast.d.ts +74 -0
- package/.woodpecker/.test.yml +0 -49
- package/addon/components/common/search/alert-load-error.hbs +0 -23
- package/addon/components/common/search/alert-no-items.hbs +0 -9
- package/addon/components/confidentiality-plugin/redact.hbs +0 -6
- package/addon/components/pagination/pagination-view.hbs +0 -39
- package/components/citation-plugin/citations/legal-document-preview.d.ts +0 -10
- package/components/variable-plugin/location/nodeview.d.ts +0 -12
- package/components/variable-plugin/variable/nodeview.d.ts +0 -11
- package/plugins/article-structure-plugin/commands/recalculate-structure-numbers.d.ts +0 -3
- package/plugins/article-structure-plugin/commands/set-structure-start-number.d.ts +0 -4
- package/plugins/article-structure-plugin/structures/article.d.ts +0 -6
- package/plugins/article-structure-plugin/structures/structure-header.d.ts +0 -2
- package/plugins/article-structure-plugin/utils/structure.d.ts +0 -36
- package/plugins/confidentiality-plugin/marks/redacted.d.ts +0 -2
- package/utils/namespace.d.ts +0 -12
- package/{components → declarations/addon/components}/hover-tooltip.d.ts +0 -0
- package/{components → declarations/addon/components}/roadsign-regulation-plugin/measure-template.d.ts +0 -0
- package/{components → declarations/addon/components}/roadsign-regulation-plugin/roadsigns-modal.d.ts +0 -0
- package/{components → declarations/addon/components}/snippet-plugin/search-modal.d.ts +0 -0
- package/{components → declarations/addon/components}/snippet-plugin/snippet-list/snippet-list-modal.d.ts +0 -0
- package/{components → declarations/addon/components}/snippet-plugin/snippet-list/snippet-list-view.d.ts +0 -0
- package/{components → declarations/addon/components}/snippet-plugin/snippets/snippet-preview.d.ts +0 -0
- package/{components → declarations/addon/components}/standard-template-plugin/template-provider.d.ts +0 -0
- package/{components → declarations/addon/components}/table-of-contents-plugin/ember-nodes/table-of-contents.d.ts +0 -0
- package/{components → declarations/addon/components}/table-of-contents-plugin/toolbar-button.d.ts +0 -0
- package/{components → declarations/addon/components}/validation-plugin/validation-card.d.ts +0 -0
- package/{components → declarations/addon/components}/variable-plugin/address/insert-variable.d.ts +0 -0
- package/{components → declarations/addon/components}/variable-plugin/address/utils.d.ts +0 -0
- package/{components → declarations/addon/components}/variable-plugin/codelist/edit.d.ts +0 -0
- package/{components → declarations/addon/components}/variable-plugin/codelist/insert.d.ts +0 -0
- package/{components → declarations/addon/components}/variable-plugin/date/date-time-picker.d.ts +0 -0
- package/{components → declarations/addon/components}/variable-plugin/date/help-modal.d.ts +0 -0
- package/{components → declarations/addon/components}/variable-plugin/date/insert-variable.d.ts +0 -0
- package/{components → declarations/addon/components}/variable-plugin/location/insert.d.ts +0 -0
- package/{components → declarations/addon/components}/variable-plugin/number/insert.d.ts +0 -0
- package/{components → declarations/addon/components}/worship-plugin/administrative-unit-picker.d.ts +0 -0
- package/{components → declarations/addon/components}/worship-plugin/search-modal.d.ts +0 -0
- package/{helpers → declarations/addon/helpers}/capitalize.d.ts +0 -0
- package/{helpers → declarations/addon/helpers}/in-array.d.ts +0 -0
- package/{helpers → declarations/addon/helpers}/limit-text.d.ts +0 -0
- package/{helpers → declarations/addon/helpers}/pagination.d.ts +0 -0
- package/{models → declarations/addon/models}/instruction.d.ts +0 -0
- package/{models → declarations/addon/models}/measure.d.ts +0 -0
- package/{models → declarations/addon/models}/sign.d.ts +0 -0
- package/{models → declarations/addon/models}/template.d.ts +0 -0
- package/{plugins → declarations/addon/plugins}/article-structure-plugin/commands/index.d.ts +0 -0
- package/{plugins → declarations/addon/plugins}/article-structure-plugin/commands/insert-structure.d.ts +0 -0
- package/{plugins → declarations/addon/plugins}/article-structure-plugin/commands/move-selected-structure.d.ts +0 -0
- package/{plugins → declarations/addon/plugins}/article-structure-plugin/commands/remove-structure.d.ts +0 -0
- package/{plugins → declarations/addon/plugins}/article-structure-plugin/commands/unwrap-structure.d.ts +0 -0
- package/{plugins → declarations/addon/plugins}/article-structure-plugin/commands/wrap-structure-content.d.ts +1 -1
- /package/{plugins → declarations/addon/plugins}/article-structure-plugin/structures/chapter.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/article-structure-plugin/structures/section.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/article-structure-plugin/structures/subsection.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/article-structure-plugin/structures/title.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/article-structure-plugin/utils/romanize.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/besluit-type-plugin/index.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/besluit-type-plugin/utils/fetchBesluitTypes.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/citation-plugin/index.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/citation-plugin/utils/article.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/citation-plugin/utils/cache.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/citation-plugin/utils/cited-text.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/citation-plugin/utils/legal-documents.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/citation-plugin/utils/process-match.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/citation-plugin/utils/public-decisions.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/citation-plugin/utils/types.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/citation-plugin/utils/utils.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/citation-plugin/utils/vlaamse-codex.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/confidentiality-plugin/index.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/decision-plugin/commands/index.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/decision-plugin/commands/insert-article-container.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/decision-plugin/commands/insert-description.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/decision-plugin/commands/insert-motivation.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/decision-plugin/commands/insert-title.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/decision-plugin/utils/get-title-for-decision.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/decision-plugin/utils/validation-rules.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/document-title-plugin/commands/insert-document-title.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/document-title-plugin/nodes/document-title.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/document-title-plugin/nodes/index.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/generic-rdfa-variable/commands/index.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/generic-rdfa-variable/commands/insert-generic-rdfa.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/roadsign-regulation-plugin/index.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/roadsign-regulation-plugin/nodes.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/roadsign-regulation-plugin/utils/constants.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/roadsign-regulation-plugin/utils/fetchData.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/roadsign-regulation-plugin/utils/includeInstructions.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/snippet-plugin/utils/fetch-data.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/standard-template-plugin/index.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/standard-template-plugin/utils/instantiate-uuids.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/standard-template-plugin/utils/nodes.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/table-of-contents-plugin/index.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/table-of-contents-plugin/nodes/index.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/table-of-contents-plugin/utils/index.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/template-comments-plugin/index.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/validation/index.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/validation/utils/transaction-complies-with-shapes.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/variable-plugin/utils/address-helpers.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/variable-plugin/utils/codelist-utils.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/variable-plugin/utils/constants.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/variable-plugin/utils/date-helpers.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/variable-plugin/utils/dom-constructors.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/variable-plugin/utils/fetch-data.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/variable-plugin/utils/number-to-words.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/variable-plugin/variables/index.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/worship-plugin/index.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/worship-plugin/utils/fetchAdministrativeUnits.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/worship-plugin/utils/fetchWorshipServices.d.ts +0 -0
- /package/{plugins → declarations/addon/plugins}/worship-plugin/utils/insertWorshipService.d.ts +0 -0
- /package/{services → declarations/addon/services}/roadsign-registry.d.ts +0 -0
- /package/{utils → declarations/addon/utils}/changed-descendants.d.ts +0 -0
- /package/{utils → declarations/addon/utils}/constants.d.ts +0 -0
- /package/{utils → declarations/addon/utils}/dom-output-spec-helpers.d.ts +0 -0
- /package/{utils → declarations/addon/utils}/find-insertion-contentmatch.d.ts +0 -0
- /package/{utils → declarations/addon/utils}/find-insertion-pos-in-ancestor-of-type.d.ts +0 -0
- /package/{utils → declarations/addon/utils}/memoize.d.ts +0 -0
- /package/{utils → declarations/addon/utils}/option.d.ts +0 -0
- /package/{utils → declarations/addon/utils}/sparql-helpers.d.ts +0 -0
- /package/{utils → declarations/addon/utils}/strings.d.ts +0 -0
- /package/{utils → declarations/addon/utils}/translation.d.ts +0 -0
- /package/{utils → declarations/addon/utils}/types.d.ts +0 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RdfaAttrs } from '@lblod/ember-rdfa-editor';
|
|
1
2
|
import { StructureSpec } from '..';
|
|
2
3
|
import {
|
|
3
4
|
constructStructureBodyNodeSpec,
|
|
@@ -5,9 +6,16 @@ import {
|
|
|
5
6
|
getNumberUtils,
|
|
6
7
|
} from '../utils/structure';
|
|
7
8
|
import { v4 as uuid } from 'uuid';
|
|
8
|
-
import {
|
|
9
|
+
import { sayDataFactory } from '@lblod/ember-rdfa-editor/core/say-data-factory';
|
|
10
|
+
import {
|
|
11
|
+
ELI,
|
|
12
|
+
EXT,
|
|
13
|
+
SAY,
|
|
14
|
+
} from '@lblod/ember-rdfa-editor-lblod-plugins/utils/constants';
|
|
9
15
|
import { unwrap } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/option';
|
|
10
16
|
import { getTranslationFunction } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/translation';
|
|
17
|
+
import { constructStructureHeader } from './structure-header';
|
|
18
|
+
import { romanize } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/article-structure-plugin/utils/romanize';
|
|
11
19
|
|
|
12
20
|
const PLACEHOLDERS = {
|
|
13
21
|
title: 'article-structure-plugin.placeholder.chapter.heading',
|
|
@@ -26,50 +34,91 @@ export const chapterSpec: StructureSpec = {
|
|
|
26
34
|
removeWithContent: 'article-structure-plugin.remove-with-content.chapter',
|
|
27
35
|
},
|
|
28
36
|
constructor: ({ schema, number, content, intl, state }) => {
|
|
37
|
+
const numberConverted = romanize(number ?? 1);
|
|
29
38
|
const translationWithDocLang = getTranslationFunction(state);
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
[
|
|
34
|
-
schema.node(
|
|
35
|
-
'structure_header',
|
|
36
|
-
{ level: 4, number: number ?? 1, numberDisplayStyle: 'roman' },
|
|
37
|
-
schema.node('placeholder', {
|
|
38
|
-
placeholderText: translationWithDocLang(
|
|
39
|
-
PLACEHOLDERS.title,
|
|
40
|
-
intl?.t(PLACEHOLDERS.title) || '',
|
|
41
|
-
),
|
|
42
|
-
}),
|
|
43
|
-
),
|
|
44
|
-
schema.node(
|
|
45
|
-
`chapter_body`,
|
|
46
|
-
{},
|
|
47
|
-
content ??
|
|
48
|
-
schema.node(
|
|
49
|
-
'paragraph',
|
|
50
|
-
{},
|
|
51
|
-
schema.node('placeholder', {
|
|
52
|
-
placeholderText: translationWithDocLang(
|
|
53
|
-
PLACEHOLDERS.body,
|
|
54
|
-
intl?.t(PLACEHOLDERS.body) || '',
|
|
55
|
-
),
|
|
56
|
-
}),
|
|
57
|
-
),
|
|
58
|
-
),
|
|
59
|
-
],
|
|
39
|
+
const titleText = translationWithDocLang(
|
|
40
|
+
PLACEHOLDERS.title,
|
|
41
|
+
intl?.t(PLACEHOLDERS.title) || '',
|
|
60
42
|
);
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
43
|
+
const chapterUuid = uuid();
|
|
44
|
+
const headingRdfaId = uuid();
|
|
45
|
+
const titleRdfaId = uuid();
|
|
46
|
+
const numberRdfaId = uuid();
|
|
47
|
+
const bodyRdfaId = uuid();
|
|
48
|
+
const chapterSubject = `http://data.lblod.info/chapters/${chapterUuid}`;
|
|
49
|
+
const chapterAttrs: RdfaAttrs = {
|
|
50
|
+
__rdfaId: chapterUuid,
|
|
51
|
+
rdfaNodeType: 'resource',
|
|
52
|
+
subject: chapterSubject,
|
|
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(chapterSubject),
|
|
79
|
+
predicate: SAY('body').prefixed,
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
const node = schema.node(`chapter`, chapterAttrs, [
|
|
85
|
+
constructStructureHeader({
|
|
86
|
+
schema,
|
|
87
|
+
titleRdfaId,
|
|
88
|
+
titleText,
|
|
89
|
+
headingRdfaId,
|
|
90
|
+
backlinkResource: chapterSubject,
|
|
91
|
+
numberRdfaId,
|
|
92
|
+
number: numberConverted,
|
|
93
|
+
level: 4,
|
|
94
|
+
}),
|
|
95
|
+
schema.node(
|
|
96
|
+
`chapter_body`,
|
|
97
|
+
bodyAttrs,
|
|
98
|
+
content ??
|
|
99
|
+
schema.node(
|
|
100
|
+
'paragraph',
|
|
101
|
+
{},
|
|
102
|
+
schema.node('placeholder', {
|
|
103
|
+
placeholderText: translationWithDocLang(
|
|
104
|
+
PLACEHOLDERS.body,
|
|
105
|
+
intl?.t(PLACEHOLDERS.body) || '',
|
|
106
|
+
),
|
|
107
|
+
}),
|
|
108
|
+
),
|
|
109
|
+
),
|
|
110
|
+
]);
|
|
111
|
+
|
|
67
112
|
return {
|
|
68
113
|
node,
|
|
69
|
-
selectionConfig
|
|
114
|
+
selectionConfig: {
|
|
115
|
+
type: content ? 'text' : 'node',
|
|
116
|
+
rdfaId: bodyRdfaId,
|
|
117
|
+
},
|
|
118
|
+
newResource: chapterSubject,
|
|
70
119
|
};
|
|
71
120
|
},
|
|
72
|
-
...getNumberUtils(1),
|
|
121
|
+
...getNumberUtils({ offset: 1, convertNumber: romanize }),
|
|
73
122
|
content: ({ pos, state }) => {
|
|
74
123
|
const node = unwrap(state.doc.nodeAt(pos));
|
|
75
124
|
return node.child(1).content;
|
|
@@ -83,4 +132,5 @@ export const chapter = constructStructureNodeSpec({
|
|
|
83
132
|
|
|
84
133
|
export const chapter_body = constructStructureBodyNodeSpec({
|
|
85
134
|
content: '(section|block)+|(article|block)+',
|
|
135
|
+
context: 'chapter/',
|
|
86
136
|
});
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import { ArticleStructurePluginOptions } from '..';
|
|
2
2
|
import { article, articleSpec, article_body, article_header } from './article';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
articleParagraphSpec,
|
|
5
|
+
article_paragraph,
|
|
6
|
+
article_paragraph_number,
|
|
7
|
+
article_paragraph_body,
|
|
8
|
+
} from './article-paragraph';
|
|
4
9
|
import { chapterSpec, chapter, chapter_body } from './chapter';
|
|
5
10
|
import { titleSpec, title, title_body } from './title';
|
|
6
11
|
import { sectionSpec, section, section_body } from './section';
|
|
7
12
|
import { structure_header } from './structure-header';
|
|
13
|
+
import { structure_header_title } from './structure-header-title';
|
|
14
|
+
import { structure_header_number } from './structure-header-number';
|
|
8
15
|
import { subsectionSpec, subsection, subsection_body } from './subsection';
|
|
9
16
|
|
|
10
17
|
export const STRUCTURE_SPECS: ArticleStructurePluginOptions = [
|
|
@@ -30,4 +37,8 @@ export const STRUCTURE_NODES = {
|
|
|
30
37
|
article_header,
|
|
31
38
|
article_body,
|
|
32
39
|
article_paragraph,
|
|
40
|
+
article_paragraph_number,
|
|
41
|
+
article_paragraph_body,
|
|
42
|
+
structure_header_title,
|
|
43
|
+
structure_header_number,
|
|
33
44
|
};
|
|
@@ -5,9 +5,17 @@ import {
|
|
|
5
5
|
} from '../utils/structure';
|
|
6
6
|
import { v4 as uuid } from 'uuid';
|
|
7
7
|
import { StructureSpec } from '..';
|
|
8
|
-
import {
|
|
8
|
+
import { RdfaAttrs } from '@lblod/ember-rdfa-editor';
|
|
9
|
+
import { sayDataFactory } from '@lblod/ember-rdfa-editor/core/say-data-factory';
|
|
10
|
+
import {
|
|
11
|
+
ELI,
|
|
12
|
+
EXT,
|
|
13
|
+
SAY,
|
|
14
|
+
} from '@lblod/ember-rdfa-editor-lblod-plugins/utils/constants';
|
|
9
15
|
import { unwrap } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/option';
|
|
10
16
|
import { getTranslationFunction } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/translation';
|
|
17
|
+
import { constructStructureHeader } from './structure-header';
|
|
18
|
+
import { romanize } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/article-structure-plugin/utils/romanize';
|
|
11
19
|
|
|
12
20
|
const PLACEHOLDERS = {
|
|
13
21
|
title: 'article-structure-plugin.placeholder.section.heading',
|
|
@@ -26,50 +34,90 @@ export const sectionSpec: StructureSpec = {
|
|
|
26
34
|
removeWithContent: 'article-structure-plugin.remove-with-content.section',
|
|
27
35
|
},
|
|
28
36
|
constructor: ({ schema, number, content, intl, state }) => {
|
|
37
|
+
const numberConverted = romanize(number || 1);
|
|
29
38
|
const translationWithDocLang = getTranslationFunction(state);
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
PLACEHOLDERS.title,
|
|
40
|
-
intl?.t(PLACEHOLDERS.title) || '',
|
|
41
|
-
),
|
|
42
|
-
}),
|
|
43
|
-
),
|
|
44
|
-
schema.node(
|
|
45
|
-
`section_body`,
|
|
46
|
-
{},
|
|
47
|
-
content ??
|
|
48
|
-
schema.node(
|
|
49
|
-
'paragraph',
|
|
50
|
-
{},
|
|
51
|
-
schema.node('placeholder', {
|
|
52
|
-
placeholderText: translationWithDocLang(
|
|
53
|
-
PLACEHOLDERS.body,
|
|
54
|
-
intl?.t(PLACEHOLDERS.body) || '',
|
|
55
|
-
),
|
|
56
|
-
}),
|
|
57
|
-
),
|
|
58
|
-
),
|
|
59
|
-
],
|
|
39
|
+
const resourceUuid = uuid();
|
|
40
|
+
const titleRdfaId = uuid();
|
|
41
|
+
const headingRdfaId = uuid();
|
|
42
|
+
const numberRdfaId = uuid();
|
|
43
|
+
const bodyRdfaId = uuid();
|
|
44
|
+
const subject = `http://data.lblod.info/sections/${resourceUuid}`;
|
|
45
|
+
const titleText = translationWithDocLang(
|
|
46
|
+
PLACEHOLDERS.title,
|
|
47
|
+
intl?.t(PLACEHOLDERS.title) || '',
|
|
60
48
|
);
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
49
|
+
const sectionAttrs: RdfaAttrs = {
|
|
50
|
+
__rdfaId: resourceUuid,
|
|
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(`section`, sectionAttrs, [
|
|
84
|
+
constructStructureHeader({
|
|
85
|
+
schema,
|
|
86
|
+
level: 5,
|
|
87
|
+
number: numberConverted,
|
|
88
|
+
titleRdfaId,
|
|
89
|
+
titleText,
|
|
90
|
+
headingRdfaId,
|
|
91
|
+
numberRdfaId,
|
|
92
|
+
backlinkResource: subject,
|
|
93
|
+
}),
|
|
94
|
+
schema.node(
|
|
95
|
+
`section_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
|
+
|
|
67
111
|
return {
|
|
68
112
|
node,
|
|
69
|
-
selectionConfig
|
|
113
|
+
selectionConfig: {
|
|
114
|
+
type: content ? 'text' : 'node',
|
|
115
|
+
rdfaId: bodyRdfaId,
|
|
116
|
+
},
|
|
117
|
+
newResource: subject,
|
|
70
118
|
};
|
|
71
119
|
},
|
|
72
|
-
...getNumberUtils(1),
|
|
120
|
+
...getNumberUtils({ offset: 1, convertNumber: romanize }),
|
|
73
121
|
content: ({ pos, state }) => {
|
|
74
122
|
const node = unwrap(state.doc.nodeAt(pos));
|
|
75
123
|
return node.child(1).content;
|
|
@@ -83,4 +131,5 @@ export const section = constructStructureNodeSpec({
|
|
|
83
131
|
|
|
84
132
|
export const section_body = constructStructureBodyNodeSpec({
|
|
85
133
|
content: '(subsection|block)+|(article|block)+',
|
|
134
|
+
context: 'section/',
|
|
86
135
|
});
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { NodeSpec, getRdfaAttrs, rdfaAttrSpec } from '@lblod/ember-rdfa-editor';
|
|
2
|
+
import {
|
|
3
|
+
getRdfaContentElement,
|
|
4
|
+
renderRdfaAware,
|
|
5
|
+
} from '@lblod/ember-rdfa-editor/core/schema';
|
|
6
|
+
import { ELI } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/constants';
|
|
7
|
+
import {
|
|
8
|
+
hasBacklink,
|
|
9
|
+
hasRDFaAttribute,
|
|
10
|
+
} from '@lblod/ember-rdfa-editor-lblod-plugins/utils/namespace';
|
|
11
|
+
|
|
12
|
+
const rdfaAware = true;
|
|
13
|
+
export const structure_header_number: NodeSpec = {
|
|
14
|
+
attrs: rdfaAttrSpec({ rdfaAware }),
|
|
15
|
+
content: 'text*',
|
|
16
|
+
inline: true,
|
|
17
|
+
editable: true,
|
|
18
|
+
hasRdfa: true,
|
|
19
|
+
toDOM(node) {
|
|
20
|
+
return renderRdfaAware({
|
|
21
|
+
renderable: node,
|
|
22
|
+
tag: 'span',
|
|
23
|
+
attrs: {
|
|
24
|
+
contenteditable: false,
|
|
25
|
+
...node.attrs,
|
|
26
|
+
},
|
|
27
|
+
content: 0,
|
|
28
|
+
});
|
|
29
|
+
},
|
|
30
|
+
parseDOM: [
|
|
31
|
+
{
|
|
32
|
+
tag: 'span',
|
|
33
|
+
getAttrs(node: HTMLElement) {
|
|
34
|
+
const attrs = getRdfaAttrs(node, { rdfaAware });
|
|
35
|
+
if (hasBacklink(attrs, ELI('number'))) {
|
|
36
|
+
return attrs;
|
|
37
|
+
}
|
|
38
|
+
return false;
|
|
39
|
+
},
|
|
40
|
+
contentElement: getRdfaContentElement,
|
|
41
|
+
},
|
|
42
|
+
// Backwards compatibility
|
|
43
|
+
{
|
|
44
|
+
tag: 'span',
|
|
45
|
+
getAttrs(node: HTMLElement) {
|
|
46
|
+
if (hasRDFaAttribute(node, 'property', ELI('number'))) {
|
|
47
|
+
return {
|
|
48
|
+
rdfaNodeType: 'literal',
|
|
49
|
+
property: ELI('number').prefixed,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
return false;
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { NodeSpec, getRdfaAttrs, rdfaAttrSpec } from '@lblod/ember-rdfa-editor';
|
|
2
|
+
import {
|
|
3
|
+
getRdfaContentElement,
|
|
4
|
+
renderRdfaAware,
|
|
5
|
+
} from '@lblod/ember-rdfa-editor/core/schema';
|
|
6
|
+
import { EXT } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/constants';
|
|
7
|
+
import { hasBacklink } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/namespace';
|
|
8
|
+
|
|
9
|
+
const rdfaAware = true;
|
|
10
|
+
export const structure_header_title: NodeSpec = {
|
|
11
|
+
attrs: rdfaAttrSpec({ rdfaAware }),
|
|
12
|
+
content: 'placeholder|text*',
|
|
13
|
+
inline: true,
|
|
14
|
+
editable: true,
|
|
15
|
+
hasRdfa: true,
|
|
16
|
+
toDOM(node) {
|
|
17
|
+
return renderRdfaAware({
|
|
18
|
+
renderable: node,
|
|
19
|
+
tag: 'span',
|
|
20
|
+
attrs: node.attrs,
|
|
21
|
+
content: 0,
|
|
22
|
+
});
|
|
23
|
+
},
|
|
24
|
+
parseDOM: [
|
|
25
|
+
{
|
|
26
|
+
tag: 'span',
|
|
27
|
+
context: 'structure_header/|article_header/',
|
|
28
|
+
getAttrs(node: HTMLElement) {
|
|
29
|
+
const attrs = getRdfaAttrs(node, { rdfaAware });
|
|
30
|
+
if (hasBacklink(attrs, EXT('title'))) {
|
|
31
|
+
return attrs;
|
|
32
|
+
}
|
|
33
|
+
return false;
|
|
34
|
+
},
|
|
35
|
+
contentElement: getRdfaContentElement,
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
};
|
|
@@ -1,87 +1,101 @@
|
|
|
1
|
-
import { NodeSpec, PNode } from '@lblod/ember-rdfa-editor';
|
|
1
|
+
import { NodeSpec, PNode, RdfaAttrs, Schema } from '@lblod/ember-rdfa-editor';
|
|
2
|
+
import { sayDataFactory } from '@lblod/ember-rdfa-editor/core/say-data-factory';
|
|
2
3
|
import {
|
|
4
|
+
ELI,
|
|
3
5
|
EXT,
|
|
4
6
|
SAY,
|
|
5
7
|
} from '@lblod/ember-rdfa-editor-lblod-plugins/utils/constants';
|
|
6
8
|
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
getStructureHeaderAttrs,
|
|
9
|
+
constructStructureHeaderNodeSpec,
|
|
10
|
+
StructureHeaderType,
|
|
10
11
|
} from '../utils/structure';
|
|
11
12
|
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
['h3', 3],
|
|
16
|
-
['h4', 4],
|
|
17
|
-
['h5', 5],
|
|
18
|
-
['h6', 6],
|
|
19
|
-
]);
|
|
20
|
-
|
|
21
|
-
export const structure_header: NodeSpec = {
|
|
22
|
-
content: 'text*|placeholder',
|
|
23
|
-
inline: false,
|
|
24
|
-
defining: true,
|
|
25
|
-
isolating: true,
|
|
26
|
-
selectable: false,
|
|
27
|
-
allowSplitByTable: false,
|
|
28
|
-
attrs: {
|
|
29
|
-
property: {
|
|
30
|
-
default: SAY('heading').prefixed,
|
|
31
|
-
},
|
|
32
|
-
number: {
|
|
33
|
-
default: 1,
|
|
34
|
-
},
|
|
35
|
-
numberDisplayStyle: {
|
|
36
|
-
default: 'decimal', // decimal, roman
|
|
37
|
-
},
|
|
38
|
-
startNumber: {
|
|
39
|
-
default: null,
|
|
40
|
-
},
|
|
41
|
-
level: {
|
|
42
|
-
default: 1,
|
|
43
|
-
},
|
|
44
|
-
},
|
|
13
|
+
export const structure_header: NodeSpec = constructStructureHeaderNodeSpec({
|
|
14
|
+
type: 'structure_header',
|
|
15
|
+
includeLevel: true,
|
|
45
16
|
outlineText: (node: PNode) => {
|
|
46
17
|
const { number } = node.attrs;
|
|
47
18
|
return `${number as string}. ${node.textContent}`;
|
|
48
19
|
},
|
|
49
|
-
|
|
50
|
-
return [
|
|
51
|
-
`h${node.attrs.level as number}`,
|
|
52
|
-
{
|
|
53
|
-
property: node.attrs.property as string,
|
|
54
|
-
...getNumberAttributesFromNode(node),
|
|
55
|
-
},
|
|
56
|
-
getNumberDocSpecFromNode(node),
|
|
57
|
-
['span', { contenteditable: false }, '. '],
|
|
58
|
-
[
|
|
59
|
-
'span',
|
|
60
|
-
{
|
|
61
|
-
property: EXT('title').prefixed,
|
|
62
|
-
},
|
|
63
|
-
0,
|
|
64
|
-
],
|
|
65
|
-
];
|
|
66
|
-
},
|
|
67
|
-
parseDOM: [
|
|
68
|
-
{
|
|
69
|
-
tag: 'h1,h2,h3,h4,h5,h6,span',
|
|
70
|
-
getAttrs(element: HTMLElement) {
|
|
71
|
-
const level = TAG_TO_LEVEL.get(element.tagName.toLowerCase()) ?? 6;
|
|
72
|
-
const headerAttrs = getStructureHeaderAttrs(element);
|
|
20
|
+
});
|
|
73
21
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
22
|
+
const headerNodes = (
|
|
23
|
+
schema: Schema,
|
|
24
|
+
): Record<
|
|
25
|
+
StructureHeaderType,
|
|
26
|
+
{ beforeNumberNodes?: PNode[]; afterNumberNodes: PNode[] }
|
|
27
|
+
> => ({
|
|
28
|
+
structure_header: { afterNumberNodes: [schema.text('. ')] },
|
|
29
|
+
article_header: {
|
|
30
|
+
beforeNumberNodes: [schema.text('Artikel ')],
|
|
31
|
+
afterNumberNodes: [schema.text(': ')],
|
|
32
|
+
},
|
|
33
|
+
});
|
|
80
34
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
35
|
+
type ConstructArgs = {
|
|
36
|
+
schema: Schema;
|
|
37
|
+
backlinkResource: string;
|
|
38
|
+
titleRdfaId: string;
|
|
39
|
+
titleText: string;
|
|
40
|
+
headingRdfaId: string;
|
|
41
|
+
headingProperty?: string;
|
|
42
|
+
numberRdfaId: string;
|
|
43
|
+
number: string;
|
|
44
|
+
level?: number;
|
|
45
|
+
headerType?: StructureHeaderType;
|
|
87
46
|
};
|
|
47
|
+
export function constructStructureHeader({
|
|
48
|
+
schema,
|
|
49
|
+
backlinkResource,
|
|
50
|
+
titleRdfaId,
|
|
51
|
+
titleText,
|
|
52
|
+
headingRdfaId,
|
|
53
|
+
headingProperty = SAY('heading').prefixed,
|
|
54
|
+
numberRdfaId,
|
|
55
|
+
number,
|
|
56
|
+
level,
|
|
57
|
+
headerType = 'structure_header',
|
|
58
|
+
}: ConstructArgs) {
|
|
59
|
+
const { beforeNumberNodes = [], afterNumberNodes } =
|
|
60
|
+
headerNodes(schema)[headerType];
|
|
61
|
+
const headingAttrs: RdfaAttrs = {
|
|
62
|
+
__rdfaId: headingRdfaId,
|
|
63
|
+
rdfaNodeType: 'literal',
|
|
64
|
+
backlinks: [
|
|
65
|
+
{
|
|
66
|
+
subject: sayDataFactory.literalNode(backlinkResource),
|
|
67
|
+
predicate: headingProperty,
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
};
|
|
71
|
+
const titleAttrs: RdfaAttrs = {
|
|
72
|
+
__rdfaId: titleRdfaId,
|
|
73
|
+
rdfaNodeType: 'literal',
|
|
74
|
+
backlinks: [
|
|
75
|
+
{
|
|
76
|
+
subject: sayDataFactory.literalNode(backlinkResource),
|
|
77
|
+
predicate: EXT('title').prefixed,
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
};
|
|
81
|
+
const numberAttrs: RdfaAttrs = {
|
|
82
|
+
__rdfaId: numberRdfaId,
|
|
83
|
+
rdfaNodeType: 'literal',
|
|
84
|
+
backlinks: [
|
|
85
|
+
{
|
|
86
|
+
subject: sayDataFactory.literalNode(backlinkResource),
|
|
87
|
+
predicate: ELI('number').prefixed,
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
};
|
|
91
|
+
return schema.node(headerType, { level, ...headingAttrs }, [
|
|
92
|
+
...beforeNumberNodes,
|
|
93
|
+
schema.node('structure_header_number', numberAttrs, schema.text(number)),
|
|
94
|
+
...afterNumberNodes,
|
|
95
|
+
schema.node(
|
|
96
|
+
'structure_header_title',
|
|
97
|
+
titleAttrs,
|
|
98
|
+
schema.node('placeholder', { placeholderText: titleText }),
|
|
99
|
+
),
|
|
100
|
+
]);
|
|
101
|
+
}
|