@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
|
@@ -3,27 +3,39 @@ import {
|
|
|
3
3
|
createEmberNodeView,
|
|
4
4
|
EmberNodeConfig,
|
|
5
5
|
} from '@lblod/ember-rdfa-editor/utils/ember-node';
|
|
6
|
+
import { sayDataFactory } from '@lblod/ember-rdfa-editor/core/say-data-factory';
|
|
6
7
|
import {
|
|
8
|
+
DCT,
|
|
7
9
|
EXT,
|
|
10
|
+
RDF,
|
|
8
11
|
XSD,
|
|
9
12
|
} from '@lblod/ember-rdfa-editor-lblod-plugins/utils/constants';
|
|
10
|
-
import { hasRDFaAttribute } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/namespace';
|
|
11
|
-
import { EditorState, PNode } from '@lblod/ember-rdfa-editor';
|
|
12
13
|
import {
|
|
14
|
+
getOutgoingTriple,
|
|
15
|
+
hasOutgoingNamedNodeTriple,
|
|
16
|
+
hasRDFaAttribute,
|
|
17
|
+
} from '@lblod/ember-rdfa-editor-lblod-plugins/utils/namespace';
|
|
18
|
+
import {
|
|
19
|
+
EditorState,
|
|
20
|
+
getRdfaAttrs,
|
|
21
|
+
PNode,
|
|
22
|
+
rdfaAttrSpec,
|
|
23
|
+
} from '@lblod/ember-rdfa-editor';
|
|
24
|
+
import {
|
|
25
|
+
hasRdfaVariableType,
|
|
13
26
|
isVariable,
|
|
14
27
|
parseLabel,
|
|
15
28
|
parseVariableType,
|
|
16
29
|
} from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/variable-plugin/utils/attribute-parsers';
|
|
17
|
-
import {
|
|
18
|
-
contentSpan,
|
|
19
|
-
mappingSpan,
|
|
20
|
-
typeSpan,
|
|
21
|
-
} from '../../variable-plugin/utils/dom-constructors';
|
|
22
30
|
import type { ComponentLike } from '@glint/template';
|
|
23
31
|
import { getTranslationFunction } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/translation';
|
|
24
32
|
import { formatDate, validateDateFormat } from '../utils/date-helpers';
|
|
25
33
|
import DateNodeviewComponent from '@lblod/ember-rdfa-editor-lblod-plugins/components/variable-plugin/date/nodeview';
|
|
26
34
|
import { v4 as uuidv4 } from 'uuid';
|
|
35
|
+
import {
|
|
36
|
+
RdfaAttrs,
|
|
37
|
+
renderRdfaAware,
|
|
38
|
+
} from '@lblod/ember-rdfa-editor/core/schema';
|
|
27
39
|
|
|
28
40
|
const TRANSLATION_FALLBACKS = {
|
|
29
41
|
insertDate: 'Datum invoegen',
|
|
@@ -42,8 +54,38 @@ export type DateOptions = {
|
|
|
42
54
|
formats: DateFormat[];
|
|
43
55
|
allowCustomFormat: boolean;
|
|
44
56
|
};
|
|
57
|
+
const rdfaAware = true;
|
|
45
58
|
|
|
46
59
|
const parseDOM = [
|
|
60
|
+
{
|
|
61
|
+
tag: 'span',
|
|
62
|
+
getAttrs(node: HTMLElement) {
|
|
63
|
+
const attrs = getRdfaAttrs(node, { rdfaAware });
|
|
64
|
+
if (!attrs) {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
if (
|
|
68
|
+
hasOutgoingNamedNodeTriple(attrs, RDF('type'), EXT('Mapping')) &&
|
|
69
|
+
node.querySelector('[data-content-container="true"]') &&
|
|
70
|
+
hasRdfaVariableType(attrs, 'date')
|
|
71
|
+
) {
|
|
72
|
+
if (attrs.rdfaNodeType !== 'resource') {
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const format = node.dataset.format;
|
|
77
|
+
|
|
78
|
+
return {
|
|
79
|
+
...attrs,
|
|
80
|
+
onlyDate: true,
|
|
81
|
+
format: format,
|
|
82
|
+
custom: node.dataset.custom === 'true',
|
|
83
|
+
customAllowed: node.dataset.customAllowed !== 'false',
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
return false;
|
|
87
|
+
},
|
|
88
|
+
},
|
|
47
89
|
{
|
|
48
90
|
/**
|
|
49
91
|
* Parses dates in the form of e.g.:
|
|
@@ -58,14 +100,41 @@ const parseDOM = [
|
|
|
58
100
|
hasRDFaAttribute(node, 'datatype', XSD('dateTime'))
|
|
59
101
|
) {
|
|
60
102
|
const onlyDate = hasRDFaAttribute(node, 'datatype', XSD('date'));
|
|
103
|
+
const datatype = onlyDate ? XSD('date') : XSD('dateTime');
|
|
61
104
|
const mappingResource = `http://data.lblod.info/mappings/${uuidv4()}`;
|
|
105
|
+
const content = node.getAttribute('content');
|
|
106
|
+
const properties = [
|
|
107
|
+
{
|
|
108
|
+
predicate: RDF('type').full,
|
|
109
|
+
object: sayDataFactory.namedNode(EXT('Mapping').full),
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
predicate: EXT('instance').full,
|
|
113
|
+
object: sayDataFactory.namedNode(
|
|
114
|
+
`http://data.lblod.info/variables/${uuidv4()}`,
|
|
115
|
+
),
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
predicate: DCT('type').full,
|
|
119
|
+
object: sayDataFactory.literal('date'),
|
|
120
|
+
},
|
|
121
|
+
];
|
|
122
|
+
if (content) {
|
|
123
|
+
properties.push({
|
|
124
|
+
predicate: EXT('content').full,
|
|
125
|
+
object: sayDataFactory.literal(content, datatype.namedNode),
|
|
126
|
+
});
|
|
127
|
+
}
|
|
62
128
|
return {
|
|
63
129
|
mappingResource,
|
|
64
|
-
value: node.getAttribute('content'),
|
|
65
130
|
onlyDate,
|
|
66
131
|
format: node.dataset.format,
|
|
67
132
|
custom: node.dataset.custom === 'true',
|
|
68
133
|
customAllowed: node.dataset.customAllowed !== 'false',
|
|
134
|
+
rdfaNodeType: 'resource',
|
|
135
|
+
subject: mappingResource,
|
|
136
|
+
__rdfaId: uuidv4(),
|
|
137
|
+
properties,
|
|
69
138
|
};
|
|
70
139
|
}
|
|
71
140
|
return false;
|
|
@@ -73,32 +142,72 @@ const parseDOM = [
|
|
|
73
142
|
},
|
|
74
143
|
{
|
|
75
144
|
/**
|
|
76
|
-
* Parses dates in the
|
|
145
|
+
* Parses dates in the 2nd (variable) format (pre-RDFa rework) e.g.
|
|
146
|
+
* <span resource="http://data.lblod.info/mappings/81190ceb-9ed0-4708-a344-99ba0bf039c5" typeof="ext:Mapping" class="date" data-label="datum">
|
|
147
|
+
* <span property="dct:type" content="date"></span>
|
|
148
|
+
* <span property="ext:content" datatype="xsd:date" data-format="dd/MM/yy" data-custom="false" data-custom-allowed="true" content="2024-02-12T23:00:00.000Z">
|
|
149
|
+
* 13/02/24
|
|
150
|
+
* </span>
|
|
151
|
+
* </span>
|
|
77
152
|
*/
|
|
78
153
|
tag: 'span',
|
|
79
154
|
getAttrs: (node: HTMLElement) => {
|
|
80
155
|
if (isVariable(node) && parseVariableType(node) === 'date') {
|
|
81
|
-
const
|
|
82
|
-
|
|
156
|
+
const mappingSubject =
|
|
157
|
+
node.getAttribute('subject') ??
|
|
158
|
+
node.getAttribute('resource') ??
|
|
159
|
+
node.getAttribute('about');
|
|
160
|
+
if (!mappingSubject) {
|
|
83
161
|
return false;
|
|
84
162
|
}
|
|
85
163
|
const onlyDate = !![...node.children].find((el) =>
|
|
86
164
|
hasRDFaAttribute(el, 'datatype', XSD('date')),
|
|
87
165
|
);
|
|
166
|
+
const datatype = onlyDate ? XSD('date') : XSD('dateTime');
|
|
88
167
|
const dateNode = [...node.children].find((el) =>
|
|
89
168
|
hasRDFaAttribute(el, 'property', EXT('content')),
|
|
90
169
|
) as HTMLElement | undefined;
|
|
91
170
|
const value = dateNode?.getAttribute('content');
|
|
92
171
|
const format = dateNode?.dataset.format;
|
|
93
172
|
const label = parseLabel(node);
|
|
173
|
+
const properties = [
|
|
174
|
+
{
|
|
175
|
+
predicate: RDF('type').full,
|
|
176
|
+
object: sayDataFactory.namedNode(EXT('Mapping').full),
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
predicate: EXT('instance').full,
|
|
180
|
+
object: sayDataFactory.namedNode(
|
|
181
|
+
`http://data.lblod.info/variables/${uuidv4()}`,
|
|
182
|
+
),
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
predicate: DCT('type').full,
|
|
186
|
+
object: sayDataFactory.literal('date'),
|
|
187
|
+
},
|
|
188
|
+
];
|
|
189
|
+
if (label) {
|
|
190
|
+
properties.push({
|
|
191
|
+
predicate: EXT('label').full,
|
|
192
|
+
object: sayDataFactory.literal(label),
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
if (value) {
|
|
196
|
+
properties.push({
|
|
197
|
+
predicate: EXT('content').full,
|
|
198
|
+
object: sayDataFactory.literal(value, datatype.namedNode),
|
|
199
|
+
});
|
|
200
|
+
}
|
|
94
201
|
return {
|
|
95
|
-
|
|
202
|
+
...getRdfaAttrs(node, { rdfaAware }),
|
|
96
203
|
onlyDate,
|
|
97
|
-
value: value,
|
|
98
204
|
format: format,
|
|
99
205
|
custom: dateNode?.dataset.custom === 'true',
|
|
100
206
|
customAllowed: dateNode?.dataset.customAllowed !== 'false',
|
|
101
|
-
|
|
207
|
+
rdfaNodeType: 'resource',
|
|
208
|
+
subject: mappingSubject,
|
|
209
|
+
__rdfaId: uuidv4(),
|
|
210
|
+
properties,
|
|
102
211
|
};
|
|
103
212
|
}
|
|
104
213
|
|
|
@@ -109,17 +218,10 @@ const parseDOM = [
|
|
|
109
218
|
|
|
110
219
|
const serialize = (node: PNode, state: EditorState) => {
|
|
111
220
|
const t = getTranslationFunction(state);
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
format,
|
|
117
|
-
mappingResource,
|
|
118
|
-
custom,
|
|
119
|
-
customAllowed,
|
|
120
|
-
label,
|
|
121
|
-
} = node.attrs;
|
|
122
|
-
const datatype = onlyDate ? XSD('date') : XSD('dateTime');
|
|
221
|
+
const value = getOutgoingTriple(node.attrs, EXT('content'))?.object.value;
|
|
222
|
+
// TODO Could remove the custom 'onlyDate' attr and instead use the datatype of the outgoing
|
|
223
|
+
// content triple.
|
|
224
|
+
const { onlyDate, format, custom, customAllowed } = node.attrs;
|
|
123
225
|
let humanReadableDate: string;
|
|
124
226
|
if (value) {
|
|
125
227
|
if (validateDateFormat(format).type === 'ok') {
|
|
@@ -136,24 +238,23 @@ const serialize = (node: PNode, state: EditorState) => {
|
|
|
136
238
|
: t('date-plugin.insert.datetime', TRANSLATION_FALLBACKS.insertDateTime);
|
|
137
239
|
}
|
|
138
240
|
const dateAttrs = {
|
|
139
|
-
datatype: datatype.prefixed,
|
|
140
241
|
'data-format': format as string,
|
|
141
242
|
'data-custom': custom ? 'true' : 'false',
|
|
142
243
|
'data-custom-allowed': customAllowed ? 'true' : 'false',
|
|
143
|
-
...(!!value && { content: value as string }),
|
|
144
244
|
};
|
|
145
|
-
return
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
);
|
|
245
|
+
return renderRdfaAware({
|
|
246
|
+
renderable: node,
|
|
247
|
+
tag: 'span',
|
|
248
|
+
attrs: dateAttrs,
|
|
249
|
+
content: humanReadableDate,
|
|
250
|
+
});
|
|
151
251
|
};
|
|
152
252
|
|
|
153
253
|
const emberNodeConfig = (options: DateOptions): EmberNodeConfig => ({
|
|
154
254
|
name: 'date',
|
|
155
255
|
group: 'inline variable',
|
|
156
256
|
component: DateNodeviewComponent as unknown as ComponentLike,
|
|
257
|
+
editable: true,
|
|
157
258
|
inline: true,
|
|
158
259
|
selectable: true,
|
|
159
260
|
draggable: false,
|
|
@@ -161,10 +262,6 @@ const emberNodeConfig = (options: DateOptions): EmberNodeConfig => ({
|
|
|
161
262
|
defining: false,
|
|
162
263
|
options,
|
|
163
264
|
attrs: {
|
|
164
|
-
mappingResource: {},
|
|
165
|
-
value: {
|
|
166
|
-
default: null,
|
|
167
|
-
},
|
|
168
265
|
format: {
|
|
169
266
|
default: options.formats[0].dateFormat,
|
|
170
267
|
},
|
|
@@ -177,29 +274,22 @@ const emberNodeConfig = (options: DateOptions): EmberNodeConfig => ({
|
|
|
177
274
|
customAllowed: {
|
|
178
275
|
default: options.allowCustomFormat,
|
|
179
276
|
},
|
|
180
|
-
|
|
181
|
-
},
|
|
182
|
-
// TODO: is this property still required?
|
|
183
|
-
leafText: (node: PNode) => {
|
|
184
|
-
const { value, onlyDate, format } = node.attrs;
|
|
185
|
-
|
|
186
|
-
const humanReadableDate = value
|
|
187
|
-
? formatDate(new Date(value), format)
|
|
188
|
-
: onlyDate
|
|
189
|
-
? TRANSLATION_FALLBACKS.insertDate
|
|
190
|
-
: TRANSLATION_FALLBACKS.insertDateTime;
|
|
191
|
-
|
|
192
|
-
return humanReadableDate;
|
|
277
|
+
...rdfaAttrSpec({ rdfaAware }),
|
|
193
278
|
},
|
|
194
279
|
outlineText: (node: PNode, state: EditorState) => {
|
|
195
280
|
const t = getTranslationFunction(state);
|
|
196
|
-
const
|
|
281
|
+
const value = getOutgoingTriple(node.attrs as RdfaAttrs, EXT('content'))
|
|
282
|
+
?.object.value;
|
|
283
|
+
const { onlyDate, format } = node.attrs;
|
|
197
284
|
|
|
198
285
|
const humanReadableDate = value
|
|
199
286
|
? formatDate(new Date(value), format)
|
|
200
287
|
: onlyDate
|
|
201
|
-
|
|
202
|
-
|
|
288
|
+
? t('date-plugin.insert.date', TRANSLATION_FALLBACKS.insertDate)
|
|
289
|
+
: t(
|
|
290
|
+
'date-plugin.insert.datetime',
|
|
291
|
+
TRANSLATION_FALLBACKS.insertDateTime,
|
|
292
|
+
);
|
|
203
293
|
|
|
204
294
|
return humanReadableDate;
|
|
205
295
|
},
|
|
@@ -3,45 +3,80 @@ import {
|
|
|
3
3
|
createEmberNodeView,
|
|
4
4
|
EmberNodeConfig,
|
|
5
5
|
} from '@lblod/ember-rdfa-editor/utils/ember-node';
|
|
6
|
-
import { DOMOutputSpec, EditorState, PNode } from '@lblod/ember-rdfa-editor';
|
|
7
|
-
import { hasRDFaAttribute } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/namespace';
|
|
8
6
|
import {
|
|
7
|
+
DOMOutputSpec,
|
|
8
|
+
EditorState,
|
|
9
|
+
getRdfaAttrs,
|
|
10
|
+
ParseRule,
|
|
11
|
+
PNode,
|
|
12
|
+
rdfaAttrSpec,
|
|
13
|
+
} from '@lblod/ember-rdfa-editor';
|
|
14
|
+
import {
|
|
15
|
+
getOutgoingTriple,
|
|
16
|
+
hasOutgoingNamedNodeTriple,
|
|
17
|
+
hasRDFaAttribute,
|
|
18
|
+
} from '@lblod/ember-rdfa-editor-lblod-plugins/utils/namespace';
|
|
19
|
+
import {
|
|
20
|
+
DCT,
|
|
9
21
|
EXT,
|
|
10
|
-
|
|
22
|
+
RDF,
|
|
11
23
|
} from '@lblod/ember-rdfa-editor-lblod-plugins/utils/constants';
|
|
12
24
|
import { isNumber } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/strings';
|
|
13
25
|
import { numberToWords } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/variable-plugin/utils/number-to-words';
|
|
14
26
|
import {
|
|
27
|
+
hasRdfaVariableType,
|
|
15
28
|
isVariable,
|
|
16
29
|
parseLabel,
|
|
17
30
|
parseVariableInstance,
|
|
18
31
|
parseVariableType,
|
|
19
32
|
} from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/variable-plugin/utils/attribute-parsers';
|
|
20
33
|
import { v4 as uuidv4 } from 'uuid';
|
|
21
|
-
import {
|
|
22
|
-
contentSpan,
|
|
23
|
-
instanceSpan,
|
|
24
|
-
mappingSpan,
|
|
25
|
-
typeSpan,
|
|
26
|
-
} from '../utils/dom-constructors';
|
|
27
34
|
import NumberNodeviewComponent from '@lblod/ember-rdfa-editor-lblod-plugins/components/variable-plugin/number/nodeview';
|
|
28
35
|
import type { ComponentLike } from '@glint/template';
|
|
29
36
|
import { getTranslationFunction } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/translation';
|
|
37
|
+
import { renderRdfaAware } from '@lblod/ember-rdfa-editor/core/schema';
|
|
38
|
+
import { sayDataFactory } from '@lblod/ember-rdfa-editor/core/say-data-factory';
|
|
30
39
|
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const parseDOM = [
|
|
40
|
+
const rdfaAware = true;
|
|
41
|
+
const parseDOM: ParseRule[] = [
|
|
35
42
|
{
|
|
36
43
|
tag: 'span',
|
|
37
|
-
getAttrs
|
|
44
|
+
getAttrs(node: HTMLElement) {
|
|
45
|
+
const attrs = getRdfaAttrs(node, { rdfaAware });
|
|
46
|
+
if (!attrs) {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
38
49
|
if (
|
|
39
|
-
|
|
40
|
-
node.querySelector(
|
|
41
|
-
|
|
50
|
+
hasOutgoingNamedNodeTriple(attrs, RDF('type'), EXT('Mapping')) &&
|
|
51
|
+
node.querySelector('[data-content-container="true"]') &&
|
|
52
|
+
hasRdfaVariableType(attrs, 'number')
|
|
42
53
|
) {
|
|
43
|
-
|
|
44
|
-
|
|
54
|
+
if (attrs.rdfaNodeType !== 'resource') {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
const writtenNumber =
|
|
58
|
+
node.getAttribute('data-written-number') === 'true' ? true : false;
|
|
59
|
+
const minimumValue = node.getAttribute('data-minimum-value');
|
|
60
|
+
const maximumValue = node.getAttribute('data-maximum-value');
|
|
61
|
+
return {
|
|
62
|
+
...attrs,
|
|
63
|
+
writtenNumber,
|
|
64
|
+
minimumValue,
|
|
65
|
+
maximumValue,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
return false;
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
tag: 'span',
|
|
73
|
+
getAttrs: (node: HTMLElement) => {
|
|
74
|
+
if (isVariable(node) && parseVariableType(node) === 'number') {
|
|
75
|
+
const mappingSubject =
|
|
76
|
+
node.getAttribute('subject') ||
|
|
77
|
+
node.getAttribute('resource') ||
|
|
78
|
+
node.getAttribute('about');
|
|
79
|
+
if (!mappingSubject) {
|
|
45
80
|
return false;
|
|
46
81
|
}
|
|
47
82
|
const variableInstance = parseVariableInstance(node);
|
|
@@ -53,36 +88,57 @@ const parseDOM = [
|
|
|
53
88
|
node.getAttribute('data-written-number') === 'true' ? true : false;
|
|
54
89
|
const minimumValue = node.getAttribute('data-minimum-value');
|
|
55
90
|
const maximumValue = node.getAttribute('data-maximum-value');
|
|
91
|
+
|
|
92
|
+
const properties = [
|
|
93
|
+
{
|
|
94
|
+
predicate: RDF('type').full,
|
|
95
|
+
object: sayDataFactory.namedNode(EXT('Mapping').full),
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
predicate: EXT('instance').full,
|
|
99
|
+
object: sayDataFactory.namedNode(
|
|
100
|
+
variableInstance ??
|
|
101
|
+
`http://data.lblod.info/variables/${uuidv4()}`,
|
|
102
|
+
),
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
predicate: DCT('type').full,
|
|
106
|
+
object: sayDataFactory.literal('number'),
|
|
107
|
+
},
|
|
108
|
+
];
|
|
109
|
+
if (label) {
|
|
110
|
+
properties.push({
|
|
111
|
+
predicate: EXT('label').full,
|
|
112
|
+
object: sayDataFactory.literal(label),
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
if (value) {
|
|
116
|
+
properties.push({
|
|
117
|
+
predicate: EXT('content').full,
|
|
118
|
+
object: sayDataFactory.literal(value),
|
|
119
|
+
});
|
|
120
|
+
}
|
|
56
121
|
return {
|
|
57
|
-
variableInstance:
|
|
58
|
-
variableInstance ?? `http://data.lblod.info/variables/${uuidv4()}`,
|
|
59
|
-
mappingResource,
|
|
60
|
-
label,
|
|
61
122
|
writtenNumber,
|
|
62
123
|
minimumValue,
|
|
63
124
|
maximumValue,
|
|
64
|
-
|
|
125
|
+
subject: mappingSubject,
|
|
126
|
+
rdfaNodeType: 'resource',
|
|
127
|
+
__rdfaId: uuidv4(),
|
|
128
|
+
properties,
|
|
65
129
|
};
|
|
66
130
|
} else {
|
|
67
131
|
return false;
|
|
68
132
|
}
|
|
69
133
|
},
|
|
70
|
-
contentElement: CONTENT_SELECTOR,
|
|
71
134
|
},
|
|
72
135
|
];
|
|
73
136
|
|
|
74
137
|
const serialize = (node: PNode, state: EditorState): DOMOutputSpec => {
|
|
75
138
|
const t = getTranslationFunction(state);
|
|
76
139
|
const docLang = state.doc.attrs.lang as string;
|
|
77
|
-
const {
|
|
78
|
-
|
|
79
|
-
variableInstance,
|
|
80
|
-
label,
|
|
81
|
-
writtenNumber,
|
|
82
|
-
minimumValue,
|
|
83
|
-
maximumValue,
|
|
84
|
-
value,
|
|
85
|
-
} = node.attrs;
|
|
140
|
+
const { writtenNumber, minimumValue, maximumValue } = node.attrs;
|
|
141
|
+
const value = getOutgoingTriple(node.attrs, EXT('content'))?.object.value;
|
|
86
142
|
|
|
87
143
|
let humanReadableContent: string;
|
|
88
144
|
|
|
@@ -96,24 +152,16 @@ const serialize = (node: PNode, state: EditorState): DOMOutputSpec => {
|
|
|
96
152
|
humanReadableContent = t('variable.number.placeholder', 'Voeg getal in');
|
|
97
153
|
}
|
|
98
154
|
|
|
99
|
-
return
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
155
|
+
return renderRdfaAware({
|
|
156
|
+
renderable: node,
|
|
157
|
+
tag: 'span',
|
|
158
|
+
attrs: {
|
|
103
159
|
'data-written-number': String(writtenNumber ?? false),
|
|
104
160
|
'data-minimum-value': (minimumValue as string) ?? null,
|
|
105
161
|
'data-maximum-value': (maximumValue as string) ?? null,
|
|
106
162
|
},
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
contentSpan(
|
|
110
|
-
{
|
|
111
|
-
content: (value as string | null) ?? '',
|
|
112
|
-
datatype: XSD('integer').prefixed,
|
|
113
|
-
},
|
|
114
|
-
humanReadableContent,
|
|
115
|
-
),
|
|
116
|
-
);
|
|
163
|
+
content: humanReadableContent.toString(),
|
|
164
|
+
});
|
|
117
165
|
};
|
|
118
166
|
|
|
119
167
|
const emberNodeConfig: EmberNodeConfig = {
|
|
@@ -125,13 +173,12 @@ const emberNodeConfig: EmberNodeConfig = {
|
|
|
125
173
|
atom: true,
|
|
126
174
|
recreateUri: true,
|
|
127
175
|
uriAttributes: ['variableInstance'],
|
|
176
|
+
editable: true,
|
|
128
177
|
draggable: false,
|
|
129
178
|
needsFFKludge: true,
|
|
179
|
+
selectable: true,
|
|
130
180
|
attrs: {
|
|
131
|
-
|
|
132
|
-
variableInstance: {},
|
|
133
|
-
label: { default: null },
|
|
134
|
-
value: { default: null },
|
|
181
|
+
...rdfaAttrSpec({ rdfaAware }),
|
|
135
182
|
writtenNumber: { default: false },
|
|
136
183
|
minimumValue: { default: null },
|
|
137
184
|
maximumValue: { default: null },
|
|
@@ -1,30 +1,59 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
DCT,
|
|
3
|
+
EXT,
|
|
4
|
+
RDF,
|
|
5
|
+
} from '@lblod/ember-rdfa-editor-lblod-plugins/utils/constants';
|
|
2
6
|
import {
|
|
3
7
|
createEmberNodeSpec,
|
|
4
8
|
createEmberNodeView,
|
|
5
9
|
EmberNodeConfig,
|
|
6
10
|
} from '@lblod/ember-rdfa-editor/utils/ember-node';
|
|
7
11
|
import { v4 as uuidv4 } from 'uuid';
|
|
8
|
-
import { DOMOutputSpec, PNode } from '@lblod/ember-rdfa-editor';
|
|
9
12
|
import {
|
|
13
|
+
DOMOutputSpec,
|
|
14
|
+
getRdfaAttrs,
|
|
15
|
+
PNode,
|
|
16
|
+
rdfaAttrSpec,
|
|
17
|
+
} from '@lblod/ember-rdfa-editor';
|
|
18
|
+
import {
|
|
19
|
+
hasRdfaVariableType,
|
|
10
20
|
isVariable,
|
|
11
21
|
parseLabel,
|
|
12
22
|
parseVariableInstance,
|
|
13
23
|
parseVariableType,
|
|
14
24
|
} from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/variable-plugin/utils/attribute-parsers';
|
|
15
|
-
import {
|
|
16
|
-
contentSpan,
|
|
17
|
-
instanceSpan,
|
|
18
|
-
typeSpan,
|
|
19
|
-
mappingSpan,
|
|
20
|
-
} from '../utils/dom-constructors';
|
|
21
25
|
import VariableNodeViewComponent from '@lblod/ember-rdfa-editor-lblod-plugins/components/variable-plugin/variable/nodeview';
|
|
22
26
|
import type { ComponentLike } from '@glint/template';
|
|
27
|
+
import { hasOutgoingNamedNodeTriple } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/namespace';
|
|
28
|
+
import { renderRdfaAware } from '@lblod/ember-rdfa-editor/core/schema';
|
|
29
|
+
import { sayDataFactory } from '@lblod/ember-rdfa-editor/core/say-data-factory';
|
|
23
30
|
|
|
24
31
|
const CONTENT_SELECTOR = `span[property~='${EXT('content').prefixed}'],
|
|
25
32
|
span[property~='${EXT('content').full}']`;
|
|
26
|
-
|
|
33
|
+
const rdfaAware = true;
|
|
27
34
|
const parseDOM = [
|
|
35
|
+
{
|
|
36
|
+
tag: 'span',
|
|
37
|
+
getAttrs: (node: HTMLElement) => {
|
|
38
|
+
const attrs = getRdfaAttrs(node, { rdfaAware });
|
|
39
|
+
if (!attrs) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
if (
|
|
43
|
+
hasOutgoingNamedNodeTriple(attrs, RDF('type'), EXT('Mapping')) &&
|
|
44
|
+
node.querySelector('[data-content-container="true"]') &&
|
|
45
|
+
hasRdfaVariableType(attrs, 'text')
|
|
46
|
+
) {
|
|
47
|
+
if (attrs.rdfaNodeType !== 'resource') {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
return attrs;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return false;
|
|
54
|
+
},
|
|
55
|
+
contentElement: '[data-content-container="true"]',
|
|
56
|
+
},
|
|
28
57
|
{
|
|
29
58
|
tag: 'span',
|
|
30
59
|
getAttrs: (node: HTMLElement) => {
|
|
@@ -33,17 +62,44 @@ const parseDOM = [
|
|
|
33
62
|
node.querySelector(CONTENT_SELECTOR) &&
|
|
34
63
|
parseVariableType(node) === 'text'
|
|
35
64
|
) {
|
|
36
|
-
const
|
|
37
|
-
|
|
65
|
+
const mappingSubject =
|
|
66
|
+
node.getAttribute('subject') ||
|
|
67
|
+
node.getAttribute('resource') ||
|
|
68
|
+
node.getAttribute('about');
|
|
69
|
+
if (!mappingSubject) {
|
|
38
70
|
return false;
|
|
39
71
|
}
|
|
40
72
|
const variableInstance = parseVariableInstance(node);
|
|
41
73
|
const label = parseLabel(node);
|
|
42
74
|
return {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
75
|
+
__rdfaId: uuidv4(),
|
|
76
|
+
subject: mappingSubject,
|
|
77
|
+
rdfaNodeType: 'resource',
|
|
78
|
+
properties: [
|
|
79
|
+
{
|
|
80
|
+
predicate: RDF('type').full,
|
|
81
|
+
object: sayDataFactory.namedNode(EXT('Mapping').full),
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
predicate: EXT('instance').full,
|
|
85
|
+
object: sayDataFactory.namedNode(
|
|
86
|
+
variableInstance ??
|
|
87
|
+
`http://data.lblod.info/variables/${uuidv4()}`,
|
|
88
|
+
),
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
predicate: EXT('label').full,
|
|
92
|
+
object: sayDataFactory.literal(label || ''),
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
predicate: DCT('type').full,
|
|
96
|
+
object: sayDataFactory.literal('text'),
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
predicate: EXT('content').full,
|
|
100
|
+
object: sayDataFactory.contentLiteral(),
|
|
101
|
+
},
|
|
102
|
+
],
|
|
47
103
|
};
|
|
48
104
|
}
|
|
49
105
|
|
|
@@ -54,16 +110,12 @@ const parseDOM = [
|
|
|
54
110
|
];
|
|
55
111
|
|
|
56
112
|
const toDOM = (node: PNode): DOMOutputSpec => {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
instanceSpan(variableInstance),
|
|
64
|
-
typeSpan('text'),
|
|
65
|
-
contentSpan({}, 0),
|
|
66
|
-
);
|
|
113
|
+
return renderRdfaAware({
|
|
114
|
+
renderable: node,
|
|
115
|
+
tag: 'span',
|
|
116
|
+
attrs: node.attrs,
|
|
117
|
+
content: 0,
|
|
118
|
+
});
|
|
67
119
|
};
|
|
68
120
|
|
|
69
121
|
const emberNodeConfig: EmberNodeConfig = {
|
|
@@ -77,10 +129,10 @@ const emberNodeConfig: EmberNodeConfig = {
|
|
|
77
129
|
uriAttributes: ['variableInstance'],
|
|
78
130
|
draggable: false,
|
|
79
131
|
needsFFKludge: true,
|
|
132
|
+
editable: true,
|
|
133
|
+
selectable: true,
|
|
80
134
|
attrs: {
|
|
81
|
-
|
|
82
|
-
variableInstance: {},
|
|
83
|
-
label: { default: null },
|
|
135
|
+
...rdfaAttrSpec({ rdfaAware }),
|
|
84
136
|
},
|
|
85
137
|
toDOM,
|
|
86
138
|
parseDOM,
|