@atlaskit/adf-schema 51.5.0 → 51.5.2
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/CHANGELOG.md +763 -424
- package/README.md +5 -0
- package/codemods/23.0.0-move-bitbucket-schema-to-own-entry-points.ts +1 -3
- package/codemods/23.0.0-move-confluence-schema-to-own-entry-points.ts +1 -3
- package/codemods/migrates/update-bitbucket-schema-entry-points.ts +5 -5
- package/codemods/migrates/update-confluence-schema-entry-points.ts +10 -10
- package/codemods/migrates/update-default-schema-entry-points.ts +15 -15
- package/codemods/migrates/update-jira-schema-entry-points.ts +60 -60
- package/dist/cjs/next-schema/groups/nonNestableBlockContentGroup.js +1 -1
- package/dist/cjs/next-schema/marks/link.js +1 -1
- package/dist/cjs/next-schema/nodes/bodiedSyncBlock.js +1 -1
- package/dist/cjs/schema/bitbucket-schema.js +1 -0
- package/dist/cjs/schema/confluence-schema.js +2 -0
- package/dist/cjs/schema/create-schema.js +0 -2
- package/dist/cjs/schema/createPMSpecFactory.js +2 -0
- package/dist/cjs/schema/inline-nodes.js +3 -0
- package/dist/cjs/schema/jira-schema.js +2 -0
- package/dist/cjs/schema/marks/annotation.js +6 -5
- package/dist/cjs/schema/marks/background-color.js +2 -0
- package/dist/cjs/schema/marks/border.js +1 -0
- package/dist/cjs/schema/marks/breakout.js +2 -0
- package/dist/cjs/schema/marks/indentation.js +1 -0
- package/dist/cjs/schema/marks/link.js +4 -0
- package/dist/cjs/schema/marks/strong.js +5 -1
- package/dist/cjs/schema/marks/text-color.js +2 -0
- package/dist/cjs/schema/nodes/block-card.js +4 -1
- package/dist/cjs/schema/nodes/bodied-extension.js +1 -0
- package/dist/cjs/schema/nodes/bodied-sync-block.js +1 -0
- package/dist/cjs/schema/nodes/caption.js +4 -2
- package/dist/cjs/schema/nodes/code-block.js +33 -8
- package/dist/cjs/schema/nodes/confluence-jira-issue.js +1 -0
- package/dist/cjs/schema/nodes/confluence-unsupported-block.js +1 -0
- package/dist/cjs/schema/nodes/confluence-unsupported-inline.js +1 -0
- package/dist/cjs/schema/nodes/date.js +2 -0
- package/dist/cjs/schema/nodes/decision-item.js +1 -0
- package/dist/cjs/schema/nodes/embed-card.js +18 -4
- package/dist/cjs/schema/nodes/emoji.js +20 -0
- package/dist/cjs/schema/nodes/expand.js +1 -0
- package/dist/cjs/schema/nodes/extension.js +1 -0
- package/dist/cjs/schema/nodes/heading.js +3 -2
- package/dist/cjs/schema/nodes/image.js +1 -0
- package/dist/cjs/schema/nodes/inline-extension.js +1 -0
- package/dist/cjs/schema/nodes/layout-column.js +6 -2
- package/dist/cjs/schema/nodes/media-group.js +1 -1
- package/dist/cjs/schema/nodes/media-single.js +1 -0
- package/dist/cjs/schema/nodes/media.js +25 -16
- package/dist/cjs/schema/nodes/mention.js +5 -0
- package/dist/cjs/schema/nodes/nested-expand.js +2 -1
- package/dist/cjs/schema/nodes/ordered-list.js +3 -0
- package/dist/cjs/schema/nodes/panel.js +6 -0
- package/dist/cjs/schema/nodes/paragraph.js +1 -0
- package/dist/cjs/schema/nodes/placeholder.js +6 -2
- package/dist/cjs/schema/nodes/status.js +3 -0
- package/dist/cjs/schema/nodes/sync-block.js +1 -0
- package/dist/cjs/schema/nodes/tableNodes.js +32 -15
- package/dist/cjs/schema/nodes/task-item.js +2 -0
- package/dist/cjs/schema/nodes/unsupported-block.js +1 -0
- package/dist/cjs/schema/nodes/unsupported-inline.js +1 -0
- package/dist/cjs/schema/sanitizeNodes.js +11 -6
- package/dist/cjs/steps/analytics.js +1 -1
- package/dist/cjs/steps/batch-attrs-step.js +1 -1
- package/dist/cjs/utils/colors.js +21 -8
- package/dist/cjs/utils/editor-palette.js +7 -0
- package/dist/cjs/utils/lch-color-inversion.js +11 -5
- package/dist/cjs/utils/url.js +9 -6
- package/dist/cjs/utils/uuid.js +7 -7
- package/dist/cjs/validator-schema/generated/validatorSpec.js +1 -1
- package/dist/es2019/index.js +4 -1
- package/dist/es2019/json-schema/index.js +1 -0
- package/dist/es2019/next-schema/groups/nonNestableBlockContentGroup.js +1 -1
- package/dist/es2019/next-schema/index.js +1 -0
- package/dist/es2019/next-schema/marks/alignmentAndIndentation.js +1 -2
- package/dist/es2019/next-schema/marks/color.js +1 -2
- package/dist/es2019/next-schema/marks/link.js +1 -1
- package/dist/es2019/next-schema/nodes/bodiedSyncBlock.js +1 -1
- package/dist/es2019/schema/bitbucket-schema.js +1 -0
- package/dist/es2019/schema/confluence-schema.js +2 -0
- package/dist/es2019/schema/create-schema.js +0 -2
- package/dist/es2019/schema/createPMSpecFactory.js +2 -0
- package/dist/es2019/schema/index.js +4 -1
- package/dist/es2019/schema/inline-nodes.js +3 -0
- package/dist/es2019/schema/jira-schema.js +1 -0
- package/dist/es2019/schema/marks/annotation.js +7 -5
- package/dist/es2019/schema/marks/background-color.js +3 -1
- package/dist/es2019/schema/marks/border.js +1 -0
- package/dist/es2019/schema/marks/breakout.js +2 -0
- package/dist/es2019/schema/marks/indentation.js +1 -0
- package/dist/es2019/schema/marks/index.js +1 -0
- package/dist/es2019/schema/marks/link.js +4 -0
- package/dist/es2019/schema/marks/strong.js +5 -1
- package/dist/es2019/schema/marks/text-color.js +3 -1
- package/dist/es2019/schema/nodes/block-card.js +4 -1
- package/dist/es2019/schema/nodes/blockquote.js +1 -2
- package/dist/es2019/schema/nodes/bodied-extension.js +1 -0
- package/dist/es2019/schema/nodes/bodied-sync-block.js +1 -0
- package/dist/es2019/schema/nodes/caption.js +4 -2
- package/dist/es2019/schema/nodes/code-block.js +34 -9
- package/dist/es2019/schema/nodes/confluence-jira-issue.js +1 -0
- package/dist/es2019/schema/nodes/confluence-unsupported-block.js +1 -0
- package/dist/es2019/schema/nodes/confluence-unsupported-inline.js +1 -0
- package/dist/es2019/schema/nodes/date.js +2 -0
- package/dist/es2019/schema/nodes/decision-item.js +1 -0
- package/dist/es2019/schema/nodes/embed-card.js +18 -4
- package/dist/es2019/schema/nodes/emoji.js +20 -0
- package/dist/es2019/schema/nodes/expand.js +1 -0
- package/dist/es2019/schema/nodes/extension.js +1 -0
- package/dist/es2019/schema/nodes/heading.js +6 -7
- package/dist/es2019/schema/nodes/image.js +1 -0
- package/dist/es2019/schema/nodes/index.js +1 -0
- package/dist/es2019/schema/nodes/inline-extension.js +1 -0
- package/dist/es2019/schema/nodes/layout-column.js +6 -2
- package/dist/es2019/schema/nodes/layout-section.js +1 -2
- package/dist/es2019/schema/nodes/media-group.js +1 -1
- package/dist/es2019/schema/nodes/media-single.js +1 -0
- package/dist/es2019/schema/nodes/media.js +22 -15
- package/dist/es2019/schema/nodes/mention.js +5 -0
- package/dist/es2019/schema/nodes/multi-bodied-extension.js +1 -2
- package/dist/es2019/schema/nodes/nested-expand.js +2 -1
- package/dist/es2019/schema/nodes/ordered-list.js +3 -0
- package/dist/es2019/schema/nodes/panel.js +6 -0
- package/dist/es2019/schema/nodes/paragraph.js +1 -0
- package/dist/es2019/schema/nodes/placeholder.js +6 -2
- package/dist/es2019/schema/nodes/status.js +4 -1
- package/dist/es2019/schema/nodes/sync-block.js +1 -0
- package/dist/es2019/schema/nodes/tableNodes.js +22 -8
- package/dist/es2019/schema/nodes/task-item.js +2 -0
- package/dist/es2019/schema/nodes/unsupported-block.js +1 -0
- package/dist/es2019/schema/nodes/unsupported-inline.js +1 -0
- package/dist/es2019/schema/sanitizeNodes.js +11 -6
- package/dist/es2019/steps/analytics.js +1 -1
- package/dist/es2019/steps/batch-attrs-step.js +1 -1
- package/dist/es2019/steps/set-attrs.js +5 -5
- package/dist/es2019/steps.js +1 -0
- package/dist/es2019/utils/colors.js +23 -9
- package/dist/es2019/utils/editor-palette.js +6 -0
- package/dist/es2019/utils/index.js +1 -0
- package/dist/es2019/utils/lch-color-inversion.js +8 -3
- package/dist/es2019/utils/url.js +9 -6
- package/dist/es2019/utils/uuid.js +3 -4
- package/dist/es2019/validator-schema/generated/validatorSpec.js +1 -1
- package/dist/esm/index.js +4 -1
- package/dist/esm/json-schema/index.js +1 -0
- package/dist/esm/next-schema/groups/nonNestableBlockContentGroup.js +1 -1
- package/dist/esm/next-schema/index.js +1 -0
- package/dist/esm/next-schema/marks/alignmentAndIndentation.js +1 -2
- package/dist/esm/next-schema/marks/color.js +1 -2
- package/dist/esm/next-schema/marks/link.js +1 -1
- package/dist/esm/next-schema/nodes/bodiedSyncBlock.js +1 -1
- package/dist/esm/schema/bitbucket-schema.js +1 -0
- package/dist/esm/schema/confluence-schema.js +2 -0
- package/dist/esm/schema/create-schema.js +0 -2
- package/dist/esm/schema/createPMSpecFactory.js +2 -0
- package/dist/esm/schema/index.js +4 -1
- package/dist/esm/schema/inline-nodes.js +3 -0
- package/dist/esm/schema/jira-schema.js +1 -0
- package/dist/esm/schema/marks/annotation.js +6 -5
- package/dist/esm/schema/marks/background-color.js +2 -0
- package/dist/esm/schema/marks/border.js +1 -0
- package/dist/esm/schema/marks/breakout.js +2 -0
- package/dist/esm/schema/marks/indentation.js +1 -0
- package/dist/esm/schema/marks/index.js +1 -0
- package/dist/esm/schema/marks/link.js +4 -0
- package/dist/esm/schema/marks/strong.js +5 -1
- package/dist/esm/schema/marks/text-color.js +2 -0
- package/dist/esm/schema/nodes/block-card.js +4 -1
- package/dist/esm/schema/nodes/blockquote.js +1 -2
- package/dist/esm/schema/nodes/bodied-extension.js +1 -0
- package/dist/esm/schema/nodes/bodied-sync-block.js +1 -0
- package/dist/esm/schema/nodes/caption.js +4 -2
- package/dist/esm/schema/nodes/code-block.js +33 -8
- package/dist/esm/schema/nodes/confluence-jira-issue.js +1 -0
- package/dist/esm/schema/nodes/confluence-unsupported-block.js +1 -0
- package/dist/esm/schema/nodes/confluence-unsupported-inline.js +1 -0
- package/dist/esm/schema/nodes/date.js +2 -0
- package/dist/esm/schema/nodes/decision-item.js +1 -0
- package/dist/esm/schema/nodes/embed-card.js +18 -4
- package/dist/esm/schema/nodes/emoji.js +20 -0
- package/dist/esm/schema/nodes/expand.js +1 -0
- package/dist/esm/schema/nodes/extension.js +1 -0
- package/dist/esm/schema/nodes/heading.js +3 -2
- package/dist/esm/schema/nodes/image.js +1 -0
- package/dist/esm/schema/nodes/index.js +1 -0
- package/dist/esm/schema/nodes/inline-extension.js +1 -0
- package/dist/esm/schema/nodes/layout-column.js +6 -2
- package/dist/esm/schema/nodes/layout-section.js +1 -2
- package/dist/esm/schema/nodes/media-group.js +1 -1
- package/dist/esm/schema/nodes/media-single.js +1 -0
- package/dist/esm/schema/nodes/media.js +26 -18
- package/dist/esm/schema/nodes/mention.js +5 -0
- package/dist/esm/schema/nodes/multi-bodied-extension.js +1 -2
- package/dist/esm/schema/nodes/nested-expand.js +2 -1
- package/dist/esm/schema/nodes/ordered-list.js +3 -0
- package/dist/esm/schema/nodes/panel.js +6 -0
- package/dist/esm/schema/nodes/paragraph.js +1 -0
- package/dist/esm/schema/nodes/placeholder.js +6 -2
- package/dist/esm/schema/nodes/status.js +3 -0
- package/dist/esm/schema/nodes/sync-block.js +1 -0
- package/dist/esm/schema/nodes/tableNodes.js +32 -15
- package/dist/esm/schema/nodes/task-item.js +2 -0
- package/dist/esm/schema/nodes/unsupported-block.js +1 -0
- package/dist/esm/schema/nodes/unsupported-inline.js +1 -0
- package/dist/esm/schema/sanitizeNodes.js +11 -6
- package/dist/esm/steps/analytics.js +1 -1
- package/dist/esm/steps/batch-attrs-step.js +1 -1
- package/dist/esm/steps.js +1 -0
- package/dist/esm/utils/colors.js +20 -8
- package/dist/esm/utils/editor-palette.js +6 -0
- package/dist/esm/utils/index.js +1 -0
- package/dist/esm/utils/lch-color-inversion.js +11 -5
- package/dist/esm/utils/url.js +9 -6
- package/dist/esm/utils/uuid.js +7 -7
- package/dist/esm/validator-schema/generated/validatorSpec.js +1 -1
- package/dist/types/next-schema/full-schema.adf.d.ts +1 -1
- package/dist/types/next-schema/generated/markTypes.d.ts +1 -1
- package/dist/types/next-schema/generated/nodeTypes.d.ts +4 -4
- package/dist/types/next-schema/groups/blockContentGroup.d.ts +1 -1
- package/dist/types/next-schema/groups/blockGroup.d.ts +1 -1
- package/dist/types/next-schema/groups/blockRootOnlyGroup.d.ts +1 -1
- package/dist/types/next-schema/groups/fontStyleGroup.d.ts +1 -1
- package/dist/types/next-schema/groups/inlineContentGroup.d.ts +1 -1
- package/dist/types/next-schema/groups/inlineGroup.d.ts +1 -1
- package/dist/types/next-schema/groups/linkMarkGroup.d.ts +1 -1
- package/dist/types/next-schema/groups/nonNestableBlockContentGroup.d.ts +6 -6
- package/dist/types/next-schema/groups/searchQueryMarkGroup.d.ts +1 -1
- package/dist/types/next-schema/groups/tableCellContentPseudoGroup.d.ts +7 -67
- package/dist/types/next-schema/marks/alignmentAndIndentation.d.ts +2 -2
- package/dist/types/next-schema/marks/annotation.d.ts +2 -2
- package/dist/types/next-schema/marks/border.d.ts +1 -1
- package/dist/types/next-schema/marks/breakout.d.ts +1 -1
- package/dist/types/next-schema/marks/code.d.ts +1 -1
- package/dist/types/next-schema/marks/color.d.ts +3 -3
- package/dist/types/next-schema/marks/confluenceInlineComment.d.ts +1 -1
- package/dist/types/next-schema/marks/dataConsumer.d.ts +1 -1
- package/dist/types/next-schema/marks/em.d.ts +1 -1
- package/dist/types/next-schema/marks/fragment.d.ts +1 -1
- package/dist/types/next-schema/marks/link.d.ts +1 -1
- package/dist/types/next-schema/marks/strike.d.ts +1 -1
- package/dist/types/next-schema/marks/strong.d.ts +1 -1
- package/dist/types/next-schema/marks/subsup.d.ts +1 -1
- package/dist/types/next-schema/marks/typeAheadQuery.d.ts +1 -1
- package/dist/types/next-schema/marks/underline.d.ts +1 -1
- package/dist/types/next-schema/marks/unsupportedMark.d.ts +1 -1
- package/dist/types/next-schema/marks/unsupportedNodeAttribute.d.ts +1 -1
- package/dist/types/next-schema/nodes/blockCard.d.ts +1 -1
- package/dist/types/next-schema/nodes/blockquote.d.ts +3 -3
- package/dist/types/next-schema/nodes/bodiedExtension.d.ts +4 -4
- package/dist/types/next-schema/nodes/bodiedSyncBlock.d.ts +1 -1
- package/dist/types/next-schema/nodes/caption.d.ts +1 -1
- package/dist/types/next-schema/nodes/codeBlock.d.ts +2 -2
- package/dist/types/next-schema/nodes/confluenceJiraIssue.d.ts +1 -1
- package/dist/types/next-schema/nodes/confluenceUnsupportedBlock.d.ts +1 -1
- package/dist/types/next-schema/nodes/confluenceUnsupportedInline.d.ts +1 -1
- package/dist/types/next-schema/nodes/date.d.ts +1 -1
- package/dist/types/next-schema/nodes/decisionItem.d.ts +1 -1
- package/dist/types/next-schema/nodes/decisionList.d.ts +1 -1
- package/dist/types/next-schema/nodes/embedCard.d.ts +1 -1
- package/dist/types/next-schema/nodes/emoji.d.ts +1 -1
- package/dist/types/next-schema/nodes/expand.d.ts +2 -2
- package/dist/types/next-schema/nodes/extension.d.ts +3 -3
- package/dist/types/next-schema/nodes/extensionFrame.d.ts +1 -1
- package/dist/types/next-schema/nodes/hardBreak.d.ts +1 -1
- package/dist/types/next-schema/nodes/heading.d.ts +20 -20
- package/dist/types/next-schema/nodes/image.d.ts +1 -1
- package/dist/types/next-schema/nodes/inlineCard.d.ts +2 -2
- package/dist/types/next-schema/nodes/inlineExtension.d.ts +2 -2
- package/dist/types/next-schema/nodes/layoutColumn.d.ts +1 -1
- package/dist/types/next-schema/nodes/layoutSection.d.ts +7 -7
- package/dist/types/next-schema/nodes/list.d.ts +2 -2
- package/dist/types/next-schema/nodes/media.d.ts +1 -1
- package/dist/types/next-schema/nodes/mediaGroup.d.ts +1 -1
- package/dist/types/next-schema/nodes/mediaInline.d.ts +1 -1
- package/dist/types/next-schema/nodes/mediaSingle.d.ts +10 -10
- package/dist/types/next-schema/nodes/mention.d.ts +1 -1
- package/dist/types/next-schema/nodes/multiBodiedExtension.d.ts +1 -1
- package/dist/types/next-schema/nodes/nestedExpand.d.ts +3 -3
- package/dist/types/next-schema/nodes/panel.d.ts +1 -1
- package/dist/types/next-schema/nodes/paragraph.d.ts +13 -13
- package/dist/types/next-schema/nodes/placeholder.d.ts +1 -1
- package/dist/types/next-schema/nodes/rule.d.ts +1 -1
- package/dist/types/next-schema/nodes/status.d.ts +1 -1
- package/dist/types/next-schema/nodes/syncBlock.d.ts +1 -1
- package/dist/types/next-schema/nodes/tableCellContent.d.ts +1 -1
- package/dist/types/next-schema/nodes/tableNodes.d.ts +1 -1
- package/dist/types/next-schema/nodes/task.d.ts +3 -3
- package/dist/types/next-schema/nodes/text.d.ts +5 -5
- package/dist/types/next-schema/nodes/unsupportedBlock.d.ts +1 -1
- package/dist/types/next-schema/nodes/unsupportedInline.d.ts +1 -1
- package/dist/types/schema/bitbucket-schema.d.ts +1 -1
- package/dist/types/schema/confluence-schema.d.ts +1 -1
- package/dist/types/schema/create-schema.d.ts +4 -3
- package/dist/types/schema/createPMSpecFactory.d.ts +3 -3
- package/dist/types/schema/default-schema.d.ts +1 -1
- package/dist/types/schema/index.d.ts +1 -1
- package/dist/types/schema/jira-schema.d.ts +8 -8
- package/dist/types/schema/marks/alignment.d.ts +2 -2
- package/dist/types/schema/marks/annotation.d.ts +5 -5
- package/dist/types/schema/marks/background-color.d.ts +3 -3
- package/dist/types/schema/marks/border.d.ts +6 -6
- package/dist/types/schema/marks/breakout.d.ts +2 -2
- package/dist/types/schema/marks/code.d.ts +1 -1
- package/dist/types/schema/marks/confluence-inline-comment.d.ts +2 -2
- package/dist/types/schema/marks/data-consumer.d.ts +2 -2
- package/dist/types/schema/marks/em.d.ts +1 -1
- package/dist/types/schema/marks/fragment.d.ts +2 -2
- package/dist/types/schema/marks/indentation.d.ts +2 -2
- package/dist/types/schema/marks/index.d.ts +3 -3
- package/dist/types/schema/marks/link.d.ts +12 -12
- package/dist/types/schema/marks/strike.d.ts +1 -1
- package/dist/types/schema/marks/strong.d.ts +1 -1
- package/dist/types/schema/marks/subsup.d.ts +2 -2
- package/dist/types/schema/marks/text-color.d.ts +2 -2
- package/dist/types/schema/marks/type-ahead-query.d.ts +1 -1
- package/dist/types/schema/marks/underline.d.ts +1 -1
- package/dist/types/schema/marks/unsupported-mark.d.ts +1 -1
- package/dist/types/schema/marks/unsupported-node-attributes.d.ts +1 -1
- package/dist/types/schema/nodes/block-card.d.ts +6 -6
- package/dist/types/schema/nodes/blockquote.d.ts +10 -11
- package/dist/types/schema/nodes/bodied-extension.d.ts +7 -7
- package/dist/types/schema/nodes/bodied-sync-block.d.ts +23 -24
- package/dist/types/schema/nodes/caption.d.ts +12 -12
- package/dist/types/schema/nodes/code-block.d.ts +7 -7
- package/dist/types/schema/nodes/date.d.ts +3 -3
- package/dist/types/schema/nodes/decision-item.d.ts +6 -6
- package/dist/types/schema/nodes/decision-list.d.ts +5 -5
- package/dist/types/schema/nodes/doc.d.ts +10 -10
- package/dist/types/schema/nodes/embed-card.d.ts +4 -4
- package/dist/types/schema/nodes/emoji.d.ts +3 -3
- package/dist/types/schema/nodes/expand.d.ts +7 -7
- package/dist/types/schema/nodes/extension.d.ts +5 -5
- package/dist/types/schema/nodes/heading.d.ts +9 -9
- package/dist/types/schema/nodes/index.d.ts +6 -6
- package/dist/types/schema/nodes/inline-card.d.ts +3 -3
- package/dist/types/schema/nodes/inline-extension.d.ts +5 -5
- package/dist/types/schema/nodes/layout-column.d.ts +3 -3
- package/dist/types/schema/nodes/layout-section.d.ts +9 -9
- package/dist/types/schema/nodes/media-group.d.ts +2 -2
- package/dist/types/schema/nodes/media-inline.d.ts +6 -6
- package/dist/types/schema/nodes/media-single.d.ts +10 -10
- package/dist/types/schema/nodes/media.d.ts +27 -27
- package/dist/types/schema/nodes/mention.d.ts +5 -5
- package/dist/types/schema/nodes/multi-bodied-extension.d.ts +21 -22
- package/dist/types/schema/nodes/nested-expand.d.ts +14 -14
- package/dist/types/schema/nodes/panel.d.ts +14 -15
- package/dist/types/schema/nodes/paragraph.d.ts +5 -5
- package/dist/types/schema/nodes/rule.d.ts +1 -1
- package/dist/types/schema/nodes/status.d.ts +6 -6
- package/dist/types/schema/nodes/sync-block.d.ts +7 -7
- package/dist/types/schema/nodes/tableNodes.d.ts +36 -37
- package/dist/types/schema/nodes/task-item.d.ts +13 -13
- package/dist/types/schema/nodes/task-list.d.ts +5 -5
- package/dist/types/schema/nodes/types/block-content.d.ts +17 -18
- package/dist/types/schema/nodes/types/inline-content.d.ts +12 -12
- package/dist/types/schema/nodes/types/list.d.ts +18 -18
- package/dist/types/schema/nodes/types/non-nestable-block-content.d.ts +15 -16
- package/dist/types/schema/nodes/unknown-block.d.ts +1 -1
- package/dist/types/schema/sanitizeNodes.d.ts +1 -1
- package/dist/types/steps/analytics.d.ts +4 -3
- package/dist/types/steps/batch-attrs-step.d.ts +4 -4
- package/dist/types/steps/link-meta-step.d.ts +7 -6
- package/dist/types/steps/override-document-step.d.ts +4 -4
- package/dist/types/steps/set-attrs.d.ts +4 -3
- package/dist/types/steps/type-ahead.d.ts +2 -2
- package/dist/types/utils/colors.d.ts +1 -1
- package/dist/types/utils/confluence/emoji.d.ts +1 -1
- package/dist/types/utils/extensions.d.ts +1 -1
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types/utils/url.d.ts +3 -3
- package/dist/types/validator-schema/generated/validatorSpec.d.ts +12 -12
- package/dist/types-ts4.5/index.d.ts +8 -0
- package/dist/types-ts4.5/next-schema/full-schema.adf.d.ts +4 -0
- package/dist/types-ts4.5/next-schema/generated/markTypes.d.ts +206 -0
- package/dist/types-ts4.5/next-schema/generated/nodeGroupTypes.d.ts +10 -0
- package/dist/types-ts4.5/next-schema/generated/nodeTypes.d.ts +976 -0
- package/dist/types-ts4.5/next-schema/groups/blockContentGroup.d.ts +12 -0
- package/dist/types-ts4.5/next-schema/groups/blockGroup.d.ts +1 -0
- package/dist/types-ts4.5/next-schema/groups/blockRootOnlyGroup.d.ts +1 -0
- package/dist/types-ts4.5/next-schema/groups/fontStyleGroup.d.ts +1 -0
- package/dist/types-ts4.5/next-schema/groups/inlineContentGroup.d.ts +10 -0
- package/dist/types-ts4.5/next-schema/groups/inlineGroup.d.ts +1 -0
- package/dist/types-ts4.5/next-schema/groups/linkMarkGroup.d.ts +1 -0
- package/dist/types-ts4.5/next-schema/groups/nonNestableBlockContentGroup.d.ts +30 -0
- package/dist/types-ts4.5/next-schema/groups/searchQueryMarkGroup.d.ts +1 -0
- package/dist/types-ts4.5/next-schema/groups/tableCellContentPseudoGroup.d.ts +26 -0
- package/dist/types-ts4.5/next-schema/index.d.ts +3 -0
- package/dist/types-ts4.5/next-schema/marks/alignmentAndIndentation.d.ts +2 -0
- package/dist/types-ts4.5/next-schema/marks/annotation.d.ts +2 -0
- package/dist/types-ts4.5/next-schema/marks/border.d.ts +1 -0
- package/dist/types-ts4.5/next-schema/marks/breakout.d.ts +1 -0
- package/dist/types-ts4.5/next-schema/marks/code.d.ts +1 -0
- package/dist/types-ts4.5/next-schema/marks/color.d.ts +3 -0
- package/dist/types-ts4.5/next-schema/marks/confluenceInlineComment.d.ts +1 -0
- package/dist/types-ts4.5/next-schema/marks/dataConsumer.d.ts +1 -0
- package/dist/types-ts4.5/next-schema/marks/em.d.ts +1 -0
- package/dist/types-ts4.5/next-schema/marks/fragment.d.ts +1 -0
- package/dist/types-ts4.5/next-schema/marks/link.d.ts +1 -0
- package/dist/types-ts4.5/next-schema/marks/strike.d.ts +1 -0
- package/dist/types-ts4.5/next-schema/marks/strong.d.ts +1 -0
- package/dist/types-ts4.5/next-schema/marks/subsup.d.ts +1 -0
- package/dist/types-ts4.5/next-schema/marks/typeAheadQuery.d.ts +1 -0
- package/dist/types-ts4.5/next-schema/marks/underline.d.ts +1 -0
- package/dist/types-ts4.5/next-schema/marks/unsupportedMark.d.ts +1 -0
- package/dist/types-ts4.5/next-schema/marks/unsupportedNodeAttribute.d.ts +1 -0
- package/dist/types-ts4.5/next-schema/nodes/blockCard.d.ts +3 -0
- package/dist/types-ts4.5/next-schema/nodes/blockquote.d.ts +14 -0
- package/dist/types-ts4.5/next-schema/nodes/bodiedExtension.d.ts +8 -0
- package/dist/types-ts4.5/next-schema/nodes/bodiedSyncBlock.d.ts +3 -0
- package/dist/types-ts4.5/next-schema/nodes/caption.d.ts +3 -0
- package/dist/types-ts4.5/next-schema/nodes/codeBlock.d.ts +8 -0
- package/dist/types-ts4.5/next-schema/nodes/confluenceJiraIssue.d.ts +3 -0
- package/dist/types-ts4.5/next-schema/nodes/confluenceUnsupportedBlock.d.ts +3 -0
- package/dist/types-ts4.5/next-schema/nodes/confluenceUnsupportedInline.d.ts +3 -0
- package/dist/types-ts4.5/next-schema/nodes/date.d.ts +3 -0
- package/dist/types-ts4.5/next-schema/nodes/decisionItem.d.ts +3 -0
- package/dist/types-ts4.5/next-schema/nodes/decisionList.d.ts +3 -0
- package/dist/types-ts4.5/next-schema/nodes/embedCard.d.ts +3 -0
- package/dist/types-ts4.5/next-schema/nodes/emoji.d.ts +3 -0
- package/dist/types-ts4.5/next-schema/nodes/expand.d.ts +8 -0
- package/dist/types-ts4.5/next-schema/nodes/extension.d.ts +7 -0
- package/dist/types-ts4.5/next-schema/nodes/extensionFrame.d.ts +3 -0
- package/dist/types-ts4.5/next-schema/nodes/hardBreak.d.ts +3 -0
- package/dist/types-ts4.5/next-schema/nodes/heading.d.ts +38 -0
- package/dist/types-ts4.5/next-schema/nodes/image.d.ts +3 -0
- package/dist/types-ts4.5/next-schema/nodes/inlineCard.d.ts +6 -0
- package/dist/types-ts4.5/next-schema/nodes/inlineExtension.d.ts +6 -0
- package/dist/types-ts4.5/next-schema/nodes/layoutColumn.d.ts +3 -0
- package/dist/types-ts4.5/next-schema/nodes/layoutSection.d.ts +25 -0
- package/dist/types-ts4.5/next-schema/nodes/list.d.ts +6 -0
- package/dist/types-ts4.5/next-schema/nodes/media.d.ts +3 -0
- package/dist/types-ts4.5/next-schema/nodes/mediaGroup.d.ts +3 -0
- package/dist/types-ts4.5/next-schema/nodes/mediaInline.d.ts +3 -0
- package/dist/types-ts4.5/next-schema/nodes/mediaSingle.d.ts +57 -0
- package/dist/types-ts4.5/next-schema/nodes/mention.d.ts +3 -0
- package/dist/types-ts4.5/next-schema/nodes/multiBodiedExtension.d.ts +3 -0
- package/dist/types-ts4.5/next-schema/nodes/nestedExpand.d.ts +11 -0
- package/dist/types-ts4.5/next-schema/nodes/panel.d.ts +3 -0
- package/dist/types-ts4.5/next-schema/nodes/paragraph.d.ts +24 -0
- package/dist/types-ts4.5/next-schema/nodes/placeholder.d.ts +3 -0
- package/dist/types-ts4.5/next-schema/nodes/rule.d.ts +3 -0
- package/dist/types-ts4.5/next-schema/nodes/status.d.ts +3 -0
- package/dist/types-ts4.5/next-schema/nodes/syncBlock.d.ts +3 -0
- package/dist/types-ts4.5/next-schema/nodes/tableCellContent.d.ts +3 -0
- package/dist/types-ts4.5/next-schema/nodes/tableNodes.d.ts +4 -0
- package/dist/types-ts4.5/next-schema/nodes/task.d.ts +9 -0
- package/dist/types-ts4.5/next-schema/nodes/text.d.ts +25 -0
- package/dist/types-ts4.5/next-schema/nodes/unsupportedBlock.d.ts +3 -0
- package/dist/types-ts4.5/next-schema/nodes/unsupportedInline.d.ts +3 -0
- package/dist/types-ts4.5/schema/bitbucket-schema.d.ts +5 -0
- package/dist/types-ts4.5/schema/confluence-schema.d.ts +9 -0
- package/dist/types-ts4.5/schema/create-schema.d.ts +27 -0
- package/dist/types-ts4.5/schema/createPMSpecFactory.d.ts +33 -0
- package/dist/types-ts4.5/schema/default-schema.d.ts +7 -0
- package/dist/types-ts4.5/schema/groups.d.ts +6 -0
- package/dist/types-ts4.5/schema/index.d.ts +12 -0
- package/dist/types-ts4.5/schema/inline-nodes.d.ts +1 -0
- package/dist/types-ts4.5/schema/jira-schema.d.ts +65 -0
- package/dist/types-ts4.5/schema/marks/alignment.d.ts +16 -0
- package/dist/types-ts4.5/schema/marks/annotation.d.ts +32 -0
- package/dist/types-ts4.5/schema/marks/background-color.d.ts +20 -0
- package/dist/types-ts4.5/schema/marks/border.d.ts +23 -0
- package/dist/types-ts4.5/schema/marks/breakout.d.ts +12 -0
- package/dist/types-ts4.5/schema/marks/code.d.ts +8 -0
- package/dist/types-ts4.5/schema/marks/confluence-inline-comment.d.ts +12 -0
- package/dist/types-ts4.5/schema/marks/data-consumer.d.ts +46 -0
- package/dist/types-ts4.5/schema/marks/em.d.ts +8 -0
- package/dist/types-ts4.5/schema/marks/fragment.d.ts +29 -0
- package/dist/types-ts4.5/schema/marks/indentation.d.ts +16 -0
- package/dist/types-ts4.5/schema/marks/index.d.ts +36 -0
- package/dist/types-ts4.5/schema/marks/link.d.ts +39 -0
- package/dist/types-ts4.5/schema/marks/strike.d.ts +8 -0
- package/dist/types-ts4.5/schema/marks/strong.d.ts +8 -0
- package/dist/types-ts4.5/schema/marks/subsup.d.ts +15 -0
- package/dist/types-ts4.5/schema/marks/text-color.d.ts +26 -0
- package/dist/types-ts4.5/schema/marks/type-ahead-query.d.ts +2 -0
- package/dist/types-ts4.5/schema/marks/underline.d.ts +8 -0
- package/dist/types-ts4.5/schema/marks/unsupported-mark.d.ts +2 -0
- package/dist/types-ts4.5/schema/marks/unsupported-node-attributes.d.ts +2 -0
- package/dist/types-ts4.5/schema/nodes/block-card.d.ts +44 -0
- package/dist/types-ts4.5/schema/nodes/blockquote.d.ts +27 -0
- package/dist/types-ts4.5/schema/nodes/bodied-extension.d.ts +23 -0
- package/dist/types-ts4.5/schema/nodes/bodied-sync-block.d.ts +43 -0
- package/dist/types-ts4.5/schema/nodes/bullet-list.d.ts +3 -0
- package/dist/types-ts4.5/schema/nodes/caption.d.ts +24 -0
- package/dist/types-ts4.5/schema/nodes/code-block.d.ts +31 -0
- package/dist/types-ts4.5/schema/nodes/confluence-jira-issue.d.ts +1 -0
- package/dist/types-ts4.5/schema/nodes/confluence-unsupported-block.d.ts +1 -0
- package/dist/types-ts4.5/schema/nodes/confluence-unsupported-inline.d.ts +1 -0
- package/dist/types-ts4.5/schema/nodes/date.d.ts +20 -0
- package/dist/types-ts4.5/schema/nodes/decision-item.d.ts +16 -0
- package/dist/types-ts4.5/schema/nodes/decision-list.d.ts +17 -0
- package/dist/types-ts4.5/schema/nodes/doc.d.ts +20 -0
- package/dist/types-ts4.5/schema/nodes/embed-card.d.ts +19 -0
- package/dist/types-ts4.5/schema/nodes/emoji.d.ts +20 -0
- package/dist/types-ts4.5/schema/nodes/expand.d.ts +34 -0
- package/dist/types-ts4.5/schema/nodes/extension.d.ts +17 -0
- package/dist/types-ts4.5/schema/nodes/hard-break.d.ts +10 -0
- package/dist/types-ts4.5/schema/nodes/heading.d.ts +39 -0
- package/dist/types-ts4.5/schema/nodes/image.d.ts +1 -0
- package/dist/types-ts4.5/schema/nodes/index.d.ts +98 -0
- package/dist/types-ts4.5/schema/nodes/inline-card.d.ts +15 -0
- package/dist/types-ts4.5/schema/nodes/inline-extension.d.ts +17 -0
- package/dist/types-ts4.5/schema/nodes/layout-column.d.ts +22 -0
- package/dist/types-ts4.5/schema/nodes/layout-section.d.ts +49 -0
- package/dist/types-ts4.5/schema/nodes/list-item.d.ts +12 -0
- package/dist/types-ts4.5/schema/nodes/media-group.d.ts +13 -0
- package/dist/types-ts4.5/schema/nodes/media-inline.d.ts +20 -0
- package/dist/types-ts4.5/schema/nodes/media-single.d.ts +69 -0
- package/dist/types-ts4.5/schema/nodes/media.d.ts +71 -0
- package/dist/types-ts4.5/schema/nodes/mention.d.ts +30 -0
- package/dist/types-ts4.5/schema/nodes/multi-bodied-extension.d.ts +50 -0
- package/dist/types-ts4.5/schema/nodes/nested-expand.d.ts +40 -0
- package/dist/types-ts4.5/schema/nodes/ordered-list.d.ts +5 -0
- package/dist/types-ts4.5/schema/nodes/panel.d.ts +50 -0
- package/dist/types-ts4.5/schema/nodes/paragraph.d.ts +43 -0
- package/dist/types-ts4.5/schema/nodes/placeholder.d.ts +12 -0
- package/dist/types-ts4.5/schema/nodes/rule.d.ts +11 -0
- package/dist/types-ts4.5/schema/nodes/status.d.ts +24 -0
- package/dist/types-ts4.5/schema/nodes/sync-block.d.ts +22 -0
- package/dist/types-ts4.5/schema/nodes/tableNodes.d.ts +159 -0
- package/dist/types-ts4.5/schema/nodes/task-item.d.ts +33 -0
- package/dist/types-ts4.5/schema/nodes/task-list.d.ts +20 -0
- package/dist/types-ts4.5/schema/nodes/text.d.ts +12 -0
- package/dist/types-ts4.5/schema/nodes/types/block-content.d.ts +21 -0
- package/dist/types-ts4.5/schema/nodes/types/extensions.d.ts +34 -0
- package/dist/types-ts4.5/schema/nodes/types/inline-content.d.ts +28 -0
- package/dist/types-ts4.5/schema/nodes/types/list.d.ts +51 -0
- package/dist/types-ts4.5/schema/nodes/types/mark.d.ts +15 -0
- package/dist/types-ts4.5/schema/nodes/types/non-nestable-block-content.d.ts +19 -0
- package/dist/types-ts4.5/schema/nodes/types/rich-media-common.d.ts +37 -0
- package/dist/types-ts4.5/schema/nodes/unknown-block.d.ts +3 -0
- package/dist/types-ts4.5/schema/nodes/unsupported-block.d.ts +1 -0
- package/dist/types-ts4.5/schema/nodes/unsupported-inline.d.ts +1 -0
- package/dist/types-ts4.5/schema/sanitizeNodes.d.ts +8 -0
- package/dist/types-ts4.5/schema/unsupported.d.ts +1 -0
- package/dist/types-ts4.5/steps/analytics.d.ts +60 -0
- package/dist/types-ts4.5/steps/batch-attrs-step.d.ts +74 -0
- package/dist/types-ts4.5/steps/link-meta-step.d.ts +50 -0
- package/dist/types-ts4.5/steps/override-document-step.d.ts +26 -0
- package/dist/types-ts4.5/steps/set-attrs.d.ts +24 -0
- package/dist/types-ts4.5/steps/type-ahead.d.ts +35 -0
- package/dist/types-ts4.5/steps/types.d.ts +96 -0
- package/dist/types-ts4.5/steps.d.ts +10 -0
- package/dist/types-ts4.5/utils/colors.d.ts +81 -0
- package/dist/types-ts4.5/utils/confluence/emoji.d.ts +50 -0
- package/dist/types-ts4.5/utils/editor-palette.d.ts +257 -0
- package/dist/types-ts4.5/utils/extensions.d.ts +3 -0
- package/dist/types-ts4.5/utils/index.d.ts +7 -0
- package/dist/types-ts4.5/utils/lch-color-inversion.d.ts +2 -0
- package/dist/types-ts4.5/utils/parseDOM.d.ts +1 -0
- package/dist/types-ts4.5/utils/url.d.ts +40 -0
- package/dist/types-ts4.5/utils/uuid.d.ts +5 -0
- package/dist/types-ts4.5/validator-schema/generated/validatorSpec.d.ts +1981 -0
- package/eslint-plugin-warn-schema.js +2 -1
- package/eslint.config.js +12 -14
- package/json-schema/package.json +8 -1
- package/json-schema/v1/full.json +3 -0
- package/json-schema/v1/stage-0.json +6 -0
- package/package.json +90 -82
- package/schema/package.json +8 -1
- package/schema-bitbucket/package.json +8 -1
- package/schema-confluence/package.json +8 -1
- package/schema-default/package.json +8 -1
- package/schema-generators/__tests__/helpers/_utils.ts +73 -77
- package/schema-generators/__tests__/helpers/utils.unit.ts +53 -59
- package/schema-generators/__tests__/unit/adfToValidatorSpec.unit.ts +79 -84
- package/schema-generators/__tests__/unit/json-full-schema-backwards-compat.unit.ts +43 -40
- package/schema-generators/__tests__/unit/validator-schema.ts +3 -3
- package/schema-generators/helpers/writeToFile.ts +12 -11
- package/schema-generators/json-full-schema.ts +4 -4
- package/schema-generators/pm-full-schema.ts +7 -5
- package/schema-generators/validator-full-schema.ts +7 -9
- package/schema-jira/package.json +8 -1
- package/schema-next/package.json +9 -3
- package/schema-validator/package.json +9 -3
- package/steps/package.json +8 -1
- package/url/package.json +8 -1
- package/warn-schema-change.js +121 -136
- package/warn-schema-change.test.js +31 -30
- package/copy-dist-to-afe.js +0 -32
- package/dist/json-schema/package.json +0 -8
- package/dist/json-schema/v1/full.json +0 -2916
- package/dist/json-schema/v1/stage-0.json +0 -3211
- package/dist/types/json-schema/index.d.ts +0 -2
- package/sanitize-nodes/package.json +0 -8
|
@@ -37,7 +37,8 @@ var getLanguageFromCode = function getLanguageFromCode(dom) {
|
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
39
|
var extractLanguageFromClass = function extractLanguageFromClass(className) {
|
|
40
|
-
|
|
40
|
+
// @ts-ignore TS1501: This regular expression flag is only available when targeting 'es6' or later.
|
|
41
|
+
var languageRegex = /(?:^|[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])language-((?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)/;
|
|
41
42
|
var result = languageRegex.exec(className);
|
|
42
43
|
if (result && result[1]) {
|
|
43
44
|
return result[1];
|
|
@@ -47,6 +48,8 @@ var extractLanguageFromClass = function extractLanguageFromClass(className) {
|
|
|
47
48
|
var removeLastNewLine = function removeLastNewLine(dom) {
|
|
48
49
|
var parent = dom && dom.parentElement;
|
|
49
50
|
if (parent && parent.classList.contains('codehilite')) {
|
|
51
|
+
// @ts-ignore TS1501: This regular expression flag is only available when targeting 'es6' or later.
|
|
52
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
50
53
|
dom.textContent = dom.textContent.replace(/\n$/, '');
|
|
51
54
|
}
|
|
52
55
|
return dom;
|
|
@@ -79,8 +82,15 @@ var codeBlock = exports.codeBlock = (0, _nodeTypes.codeBlock)({
|
|
|
79
82
|
tag: 'pre',
|
|
80
83
|
preserveWhitespace: 'full',
|
|
81
84
|
getAttrs: function getAttrs(domNode) {
|
|
85
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
82
86
|
var dom = domNode;
|
|
83
|
-
var language =
|
|
87
|
+
var language =
|
|
88
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
89
|
+
getLanguageFromBitbucketStyle(dom.parentElement) ||
|
|
90
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
91
|
+
getLanguageFromEditorStyle(dom.parentElement) || getLanguageFromCode(dom) ||
|
|
92
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
93
|
+
dom.getAttribute('data-language');
|
|
84
94
|
dom = removeLastNewLine(dom);
|
|
85
95
|
return {
|
|
86
96
|
language: language
|
|
@@ -93,6 +103,7 @@ var codeBlock = exports.codeBlock = (0, _nodeTypes.codeBlock)({
|
|
|
93
103
|
tag: 'div[style]',
|
|
94
104
|
preserveWhitespace: 'full',
|
|
95
105
|
getAttrs: function getAttrs(domNode) {
|
|
106
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
96
107
|
var dom = domNode;
|
|
97
108
|
if (dom.style.whiteSpace === 'pre' || dom.style.fontFamily && dom.style.fontFamily.toLowerCase().indexOf('monospace') > -1) {
|
|
98
109
|
return {};
|
|
@@ -109,6 +120,7 @@ var codeBlock = exports.codeBlock = (0, _nodeTypes.codeBlock)({
|
|
|
109
120
|
tag: 'table[style]',
|
|
110
121
|
preserveWhitespace: 'full',
|
|
111
122
|
getAttrs: function getAttrs(dom) {
|
|
123
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
112
124
|
if (dom.querySelector('td[class*="blob-code"]')) {
|
|
113
125
|
return {};
|
|
114
126
|
}
|
|
@@ -118,8 +130,9 @@ var codeBlock = exports.codeBlock = (0, _nodeTypes.codeBlock)({
|
|
|
118
130
|
tag: 'div.code-block',
|
|
119
131
|
preserveWhitespace: 'full',
|
|
120
132
|
getAttrs: function getAttrs(domNode) {
|
|
133
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
121
134
|
var dom = domNode;
|
|
122
|
-
// TODO: ED-5604 Fix it inside `react-syntax-highlighter`
|
|
135
|
+
// TODO: ED-5604 - Fix it inside `react-syntax-highlighter`
|
|
123
136
|
// Remove line numbers
|
|
124
137
|
var lineNumber = dom.querySelectorAll('.react-syntax-highlighter-line-number');
|
|
125
138
|
if (lineNumber.length > 0) {
|
|
@@ -140,6 +153,7 @@ var codeBlock = exports.codeBlock = (0, _nodeTypes.codeBlock)({
|
|
|
140
153
|
});
|
|
141
154
|
var toJSON = exports.toJSON = function toJSON(node) {
|
|
142
155
|
return {
|
|
156
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
143
157
|
attrs: Object.keys(node.attrs).reduce(function (memo, key) {
|
|
144
158
|
if (key === 'uniqueId') {
|
|
145
159
|
return memo;
|
|
@@ -157,8 +171,15 @@ var codeBlockWithLocalId = exports.codeBlockWithLocalId = (0, _nodeTypes.codeBlo
|
|
|
157
171
|
tag: 'pre',
|
|
158
172
|
preserveWhitespace: 'full',
|
|
159
173
|
getAttrs: function getAttrs(domNode) {
|
|
174
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
160
175
|
var dom = domNode;
|
|
161
|
-
var language =
|
|
176
|
+
var language =
|
|
177
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
178
|
+
getLanguageFromBitbucketStyle(dom.parentElement) ||
|
|
179
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
180
|
+
getLanguageFromEditorStyle(dom.parentElement) || getLanguageFromCode(dom) ||
|
|
181
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
182
|
+
dom.getAttribute('data-language');
|
|
162
183
|
dom = removeLastNewLine(dom);
|
|
163
184
|
return {
|
|
164
185
|
language: language,
|
|
@@ -172,6 +193,7 @@ var codeBlockWithLocalId = exports.codeBlockWithLocalId = (0, _nodeTypes.codeBlo
|
|
|
172
193
|
tag: 'div[style]',
|
|
173
194
|
preserveWhitespace: 'full',
|
|
174
195
|
getAttrs: function getAttrs(domNode) {
|
|
196
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
175
197
|
var dom = domNode;
|
|
176
198
|
if (dom.style.whiteSpace === 'pre' || dom.style.fontFamily && dom.style.fontFamily.toLowerCase().indexOf('monospace') > -1) {
|
|
177
199
|
return {};
|
|
@@ -188,6 +210,7 @@ var codeBlockWithLocalId = exports.codeBlockWithLocalId = (0, _nodeTypes.codeBlo
|
|
|
188
210
|
tag: 'table[style]',
|
|
189
211
|
preserveWhitespace: 'full',
|
|
190
212
|
getAttrs: function getAttrs(dom) {
|
|
213
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
191
214
|
if (dom.querySelector('td[class*="blob-code"]')) {
|
|
192
215
|
return {};
|
|
193
216
|
}
|
|
@@ -197,8 +220,9 @@ var codeBlockWithLocalId = exports.codeBlockWithLocalId = (0, _nodeTypes.codeBlo
|
|
|
197
220
|
tag: 'div.code-block',
|
|
198
221
|
preserveWhitespace: 'full',
|
|
199
222
|
getAttrs: function getAttrs(domNode) {
|
|
223
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
200
224
|
var dom = domNode;
|
|
201
|
-
// TODO: ED-5604 Fix it inside `react-syntax-highlighter`
|
|
225
|
+
// TODO: ED-5604 - Fix it inside `react-syntax-highlighter`
|
|
202
226
|
// Remove line numbers
|
|
203
227
|
var lineNumber = dom.querySelectorAll('.react-syntax-highlighter-line-number');
|
|
204
228
|
if (lineNumber.length > 0) {
|
|
@@ -213,9 +237,10 @@ var codeBlockWithLocalId = exports.codeBlockWithLocalId = (0, _nodeTypes.codeBlo
|
|
|
213
237
|
}],
|
|
214
238
|
toDOM: function toDOM(node) {
|
|
215
239
|
var _node$attrs;
|
|
216
|
-
var attrs = {
|
|
217
|
-
|
|
218
|
-
|
|
240
|
+
var attrs = {};
|
|
241
|
+
if ((node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.localId) !== undefined) {
|
|
242
|
+
attrs['data-local-id'] = node.attrs.localId;
|
|
243
|
+
}
|
|
219
244
|
return ['pre', attrs, ['code', {
|
|
220
245
|
'data-language': node.attrs.language
|
|
221
246
|
}, 0]];
|
|
@@ -10,6 +10,7 @@ var confluenceJiraIssue = exports.confluenceJiraIssue = (0, _nodeTypes.confluenc
|
|
|
10
10
|
parseDOM: [{
|
|
11
11
|
tag: "span[data-node-type=\"".concat(name, "\"]"),
|
|
12
12
|
getAttrs: function getAttrs(domNode) {
|
|
13
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
13
14
|
var dom = domNode;
|
|
14
15
|
return {
|
|
15
16
|
issueKey: dom.textContent,
|
|
@@ -20,6 +20,7 @@ var confluenceUnsupportedBlock = exports.confluenceUnsupportedBlock = (0, _nodeT
|
|
|
20
20
|
tag: "div[data-node-type=\"".concat(name, "\"]"),
|
|
21
21
|
getAttrs: function getAttrs(dom) {
|
|
22
22
|
return {
|
|
23
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting, @typescript-eslint/no-non-null-assertion
|
|
23
24
|
cxhtml: dom.getAttribute('data-confluence-unsupported-block-cxhtml')
|
|
24
25
|
};
|
|
25
26
|
}
|
|
@@ -19,6 +19,7 @@ var confluenceUnsupportedInline = exports.confluenceUnsupportedInline = (0, _nod
|
|
|
19
19
|
tag: "div[data-node-type=\"".concat(name, "\"]"),
|
|
20
20
|
getAttrs: function getAttrs(dom) {
|
|
21
21
|
return {
|
|
22
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting, @typescript-eslint/no-non-null-assertion
|
|
22
23
|
cxhtml: dom.getAttribute('data-confluence-unsupported-inline-cxhtml')
|
|
23
24
|
};
|
|
24
25
|
}
|
|
@@ -15,6 +15,7 @@ var date = exports.date = (0, _nodeTypes.date)({
|
|
|
15
15
|
tag: 'span[data-node-type="date"]',
|
|
16
16
|
getAttrs: function getAttrs(dom) {
|
|
17
17
|
return {
|
|
18
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
18
19
|
timestamp: dom.getAttribute('data-timestamp')
|
|
19
20
|
};
|
|
20
21
|
}
|
|
@@ -32,6 +33,7 @@ var dateWithLocalId = exports.dateWithLocalId = (0, _nodeTypes.date)({
|
|
|
32
33
|
tag: 'span[data-node-type="date"]',
|
|
33
34
|
getAttrs: function getAttrs(dom) {
|
|
34
35
|
return {
|
|
36
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
35
37
|
timestamp: dom.getAttribute('data-timestamp'),
|
|
36
38
|
localId: _utils.uuid.generate()
|
|
37
39
|
};
|
|
@@ -19,6 +19,7 @@ var decisionItem = exports.decisionItem = (0, _nodeTypes.decisionItem)({
|
|
|
19
19
|
getAttrs: function getAttrs(dom) {
|
|
20
20
|
return {
|
|
21
21
|
localId: _uuid.uuid.generate(),
|
|
22
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting, @typescript-eslint/no-non-null-assertion
|
|
22
23
|
state: dom.getAttribute('data-decision-state')
|
|
23
24
|
};
|
|
24
25
|
}
|
|
@@ -15,11 +15,18 @@ var embedCard = exports.embedCard = (0, _nodeTypes.embedCard)({
|
|
|
15
15
|
tag: 'div[data-embed-card]',
|
|
16
16
|
getAttrs: function getAttrs(dom) {
|
|
17
17
|
return {
|
|
18
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
18
19
|
url: dom.getAttribute('data-card-url'),
|
|
20
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
19
21
|
layout: dom.getAttribute('data-layout') || 'center',
|
|
22
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
20
23
|
width: Number(dom.getAttribute('data-width')) || null,
|
|
21
|
-
originalWidth:
|
|
22
|
-
|
|
24
|
+
originalWidth:
|
|
25
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
26
|
+
Number(dom.getAttribute('data-card-original-width')) || null,
|
|
27
|
+
originalHeight:
|
|
28
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
29
|
+
Number(dom.getAttribute('data-card-original-height')) || null
|
|
23
30
|
};
|
|
24
31
|
}
|
|
25
32
|
}],
|
|
@@ -46,11 +53,18 @@ var embedCardWithLocalId = exports.embedCardWithLocalId = (0, _nodeTypes.embedCa
|
|
|
46
53
|
tag: 'div[data-embed-card]',
|
|
47
54
|
getAttrs: function getAttrs(dom) {
|
|
48
55
|
return {
|
|
56
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
49
57
|
url: dom.getAttribute('data-card-url'),
|
|
58
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
50
59
|
layout: dom.getAttribute('data-layout') || 'center',
|
|
60
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
51
61
|
width: Number(dom.getAttribute('data-width')) || null,
|
|
52
|
-
originalWidth:
|
|
53
|
-
|
|
62
|
+
originalWidth:
|
|
63
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
64
|
+
Number(dom.getAttribute('data-card-original-width')) || null,
|
|
65
|
+
originalHeight:
|
|
66
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
67
|
+
Number(dom.getAttribute('data-card-original-height')) || null,
|
|
54
68
|
localId: _uuid.uuid.generate()
|
|
55
69
|
};
|
|
56
70
|
}
|
|
@@ -24,10 +24,14 @@ var emoji = exports.emoji = (0, _nodeTypes.emoji)({
|
|
|
24
24
|
}, {
|
|
25
25
|
tag: 'span[data-emoji-short-name]',
|
|
26
26
|
getAttrs: function getAttrs(domNode) {
|
|
27
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
27
28
|
var dom = domNode;
|
|
28
29
|
return {
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
29
31
|
shortName: dom.getAttribute('data-emoji-short-name') || emoji.attrs.shortName.default,
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
30
33
|
id: dom.getAttribute('data-emoji-id') || emoji.attrs.id.default,
|
|
34
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
31
35
|
text: dom.getAttribute('data-emoji-text') || emoji.attrs.text.default
|
|
32
36
|
};
|
|
33
37
|
}
|
|
@@ -35,6 +39,7 @@ var emoji = exports.emoji = (0, _nodeTypes.emoji)({
|
|
|
35
39
|
// Handle copy/paste from old <ac:emoticon />
|
|
36
40
|
{
|
|
37
41
|
tag: 'img[data-emoticon-name]',
|
|
42
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
38
43
|
getAttrs: function getAttrs(dom) {
|
|
39
44
|
return (0, _emoji.acNameToEmoji)(dom.getAttribute('data-emoticon-name'));
|
|
40
45
|
}
|
|
@@ -42,6 +47,7 @@ var emoji = exports.emoji = (0, _nodeTypes.emoji)({
|
|
|
42
47
|
// Handle copy/paste from old <ac:hipchat-emoticons />
|
|
43
48
|
{
|
|
44
49
|
tag: 'img[data-hipchat-emoticon]',
|
|
50
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
45
51
|
getAttrs: function getAttrs(dom) {
|
|
46
52
|
return (0, _emoji.acShortcutToEmoji)(dom.getAttribute('data-hipchat-emoticon'));
|
|
47
53
|
}
|
|
@@ -50,10 +56,14 @@ var emoji = exports.emoji = (0, _nodeTypes.emoji)({
|
|
|
50
56
|
{
|
|
51
57
|
tag: 'img.emoji[data-emoji-short-name]',
|
|
52
58
|
getAttrs: function getAttrs(domNode) {
|
|
59
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
53
60
|
var dom = domNode;
|
|
54
61
|
return {
|
|
62
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
55
63
|
shortName: dom.getAttribute('data-emoji-short-name') || emoji.attrs.shortName.default,
|
|
64
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
56
65
|
id: dom.getAttribute('data-emoji-id') || emoji.attrs.id.default,
|
|
66
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
57
67
|
text: dom.getAttribute('data-emoji-text') || emoji.attrs.text.default
|
|
58
68
|
};
|
|
59
69
|
}
|
|
@@ -81,10 +91,14 @@ var emojiWithLocalId = exports.emojiWithLocalId = (0, _nodeTypes.emoji)({
|
|
|
81
91
|
}, {
|
|
82
92
|
tag: 'span[data-emoji-short-name]',
|
|
83
93
|
getAttrs: function getAttrs(domNode) {
|
|
94
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
84
95
|
var dom = domNode;
|
|
85
96
|
return {
|
|
97
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
86
98
|
shortName: dom.getAttribute('data-emoji-short-name') || emoji.attrs.shortName.default,
|
|
99
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
87
100
|
id: dom.getAttribute('data-emoji-id') || emoji.attrs.id.default,
|
|
101
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
88
102
|
text: dom.getAttribute('data-emoji-text') || emoji.attrs.text.default,
|
|
89
103
|
localId: _uuid.uuid.generate()
|
|
90
104
|
};
|
|
@@ -94,6 +108,7 @@ var emojiWithLocalId = exports.emojiWithLocalId = (0, _nodeTypes.emoji)({
|
|
|
94
108
|
{
|
|
95
109
|
tag: 'img[data-emoticon-name]',
|
|
96
110
|
getAttrs: function getAttrs(dom) {
|
|
111
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
97
112
|
var attrs = (0, _emoji.acNameToEmoji)(dom.getAttribute('data-emoticon-name'));
|
|
98
113
|
return _objectSpread(_objectSpread({}, attrs), {}, {
|
|
99
114
|
localId: _uuid.uuid.generate()
|
|
@@ -104,6 +119,7 @@ var emojiWithLocalId = exports.emojiWithLocalId = (0, _nodeTypes.emoji)({
|
|
|
104
119
|
{
|
|
105
120
|
tag: 'img[data-hipchat-emoticon]',
|
|
106
121
|
getAttrs: function getAttrs(dom) {
|
|
122
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
107
123
|
var attrs = (0, _emoji.acShortcutToEmoji)(dom.getAttribute('data-hipchat-emoticon'));
|
|
108
124
|
return _objectSpread(_objectSpread({}, attrs), {}, {
|
|
109
125
|
localId: _uuid.uuid.generate()
|
|
@@ -114,10 +130,14 @@ var emojiWithLocalId = exports.emojiWithLocalId = (0, _nodeTypes.emoji)({
|
|
|
114
130
|
{
|
|
115
131
|
tag: 'img.emoji[data-emoji-short-name]',
|
|
116
132
|
getAttrs: function getAttrs(domNode) {
|
|
133
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
117
134
|
var dom = domNode;
|
|
118
135
|
return {
|
|
136
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
119
137
|
shortName: dom.getAttribute('data-emoji-short-name') || emoji.attrs.shortName.default,
|
|
138
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
120
139
|
id: dom.getAttribute('data-emoji-id') || emoji.attrs.id.default,
|
|
140
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
121
141
|
text: dom.getAttribute('data-emoji-text') || emoji.attrs.text.default,
|
|
122
142
|
localId: _uuid.uuid.generate()
|
|
123
143
|
};
|
|
@@ -23,6 +23,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
25
|
function getExpandAttrs(domNode) {
|
|
26
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
26
27
|
var dom = domNode;
|
|
27
28
|
return {
|
|
28
29
|
title: dom.getAttribute('data-title'),
|
|
@@ -17,6 +17,7 @@ var _nodeTypes = require("../../next-schema/generated/nodeTypes");
|
|
|
17
17
|
var extension = exports.extension = (0, _nodeTypes.extension)({
|
|
18
18
|
parseDOM: [{
|
|
19
19
|
tag: '[data-node-type="extension"]',
|
|
20
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
20
21
|
getAttrs: function getAttrs(domNode) {
|
|
21
22
|
return (0, _extensions.getExtensionAttrs)(domNode);
|
|
22
23
|
}
|
|
@@ -24,10 +24,11 @@ var _nodeTypes = require("../../next-schema/generated/nodeTypes");
|
|
|
24
24
|
|
|
25
25
|
var getAttrs = function getAttrs(level) {
|
|
26
26
|
return function (domNode) {
|
|
27
|
-
var _heading$attrs, _heading$attrs$localI;
|
|
28
27
|
return {
|
|
29
28
|
level: level,
|
|
30
|
-
localId:
|
|
29
|
+
localId:
|
|
30
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
31
|
+
domNode.getAttribute('data-local-id') || null
|
|
31
32
|
};
|
|
32
33
|
};
|
|
33
34
|
};
|
|
@@ -17,6 +17,7 @@ var _nodeTypes = require("../../next-schema/generated/nodeTypes");
|
|
|
17
17
|
var inlineExtension = exports.inlineExtension = (0, _nodeTypes.inlineExtensionWithMarks)({
|
|
18
18
|
parseDOM: [{
|
|
19
19
|
tag: 'span[data-extension-type]',
|
|
20
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
20
21
|
getAttrs: function getAttrs(domNode) {
|
|
21
22
|
return (0, _extensions.getExtensionAttrs)(domNode, true);
|
|
22
23
|
}
|
|
@@ -18,6 +18,7 @@ var layoutColumn = exports.layoutColumn = (0, _nodeTypes.layoutColumn)({
|
|
|
18
18
|
}, {
|
|
19
19
|
tag: 'div[data-layout-column]',
|
|
20
20
|
getAttrs: function getAttrs(domNode) {
|
|
21
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
21
22
|
var dom = domNode;
|
|
22
23
|
return {
|
|
23
24
|
width: Number(dom.getAttribute('data-column-width')) || undefined
|
|
@@ -50,6 +51,7 @@ var layoutColumnWithLocalId = exports.layoutColumnWithLocalId = (0, _nodeTypes.l
|
|
|
50
51
|
}, {
|
|
51
52
|
tag: 'div[data-layout-column]',
|
|
52
53
|
getAttrs: function getAttrs(domNode) {
|
|
54
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
53
55
|
var dom = domNode;
|
|
54
56
|
return {
|
|
55
57
|
width: Number(dom.getAttribute('data-column-width')) || undefined,
|
|
@@ -60,9 +62,11 @@ var layoutColumnWithLocalId = exports.layoutColumnWithLocalId = (0, _nodeTypes.l
|
|
|
60
62
|
toDOM: function toDOM(node) {
|
|
61
63
|
var _node$attrs;
|
|
62
64
|
var attrs = {
|
|
63
|
-
'data-layout-column': 'true'
|
|
64
|
-
'data-local-id': (node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.localId) || undefined
|
|
65
|
+
'data-layout-column': 'true'
|
|
65
66
|
};
|
|
67
|
+
if ((node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.localId) !== undefined) {
|
|
68
|
+
attrs['data-local-id'] = node.attrs.localId;
|
|
69
|
+
}
|
|
66
70
|
var width = node.attrs.width;
|
|
67
71
|
if (width) {
|
|
68
72
|
attrs['style'] = "flex-basis: ".concat(width, "%");
|
|
@@ -11,7 +11,7 @@ var _nodeTypes = require("../../next-schema/generated/nodeTypes");
|
|
|
11
11
|
|
|
12
12
|
// Temporary due to an existing issue in validator below:
|
|
13
13
|
// https://product-fabric.atlassian.net/jira/servicedesk/projects/DTR/queues/issue/DTR-1429
|
|
14
|
-
// TODO: Remove border and link marks from white list
|
|
14
|
+
// TODO: ED-29537 - Remove border and link marks from white list
|
|
15
15
|
var mediaGroup = exports.mediaGroup = (0, _nodeTypes.mediaGroup)({
|
|
16
16
|
parseDOM: [{
|
|
17
17
|
tag: 'div[data-node-type="mediaGroup"]'
|
|
@@ -176,6 +176,7 @@ var mediaSingleFullWithLocalId = exports.mediaSingleFullWithLocalId = mediaSingl
|
|
|
176
176
|
});
|
|
177
177
|
var toJSON = exports.toJSON = function toJSON(node) {
|
|
178
178
|
return {
|
|
179
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
179
180
|
attrs: Object.keys(node.attrs).reduce(function (obj, key) {
|
|
180
181
|
if (node.attrs[key] !== null) {
|
|
181
182
|
obj[key] = node.attrs[key];
|
|
@@ -16,6 +16,22 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
var defaultAttrs = exports.defaultAttrs = (0, _nodeTypes.media)({}).attrs;
|
|
19
|
+
var camelCaseToKebabCase = exports.camelCaseToKebabCase = function camelCaseToKebabCase(str) {
|
|
20
|
+
return (
|
|
21
|
+
// @ts-ignore TS1501: This regular expression flag is only available when targeting 'es6' or later.
|
|
22
|
+
str.replace(/((?:[\0-@\[-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)([A-Z])/g, function (_, x, y) {
|
|
23
|
+
return "".concat(x, "-").concat(y.toLowerCase());
|
|
24
|
+
})
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
var copyPrivateAttributes = exports.copyPrivateAttributes = function copyPrivateAttributes(from, to, attributes, map) {
|
|
28
|
+
var attrs = attributes || {};
|
|
29
|
+
Object.keys(attrs).forEach(function (key) {
|
|
30
|
+
if (key[0] === '_' && key[1] === '_' && from[key]) {
|
|
31
|
+
to[map ? map(key) : key] = from[key];
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
};
|
|
19
35
|
var createMediaSpec = exports.createMediaSpec = function createMediaSpec(attributes) {
|
|
20
36
|
var inline = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
21
37
|
var generateLocalId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
@@ -27,7 +43,9 @@ var createMediaSpec = exports.createMediaSpec = function createMediaSpec(attribu
|
|
|
27
43
|
var attrs = {};
|
|
28
44
|
if (attributes) {
|
|
29
45
|
Object.keys(attributes).forEach(function (k) {
|
|
46
|
+
// @ts-ignore TS1501: This regular expression flag is only available when targeting 'es6' or later.
|
|
30
47
|
var key = camelCaseToKebabCase(k).replace(/^__/, '');
|
|
48
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
31
49
|
var value = dom.getAttribute("data-".concat(key)) || '';
|
|
32
50
|
if (value) {
|
|
33
51
|
attrs[k] = value;
|
|
@@ -78,7 +96,7 @@ var createMediaSpec = exports.createMediaSpec = function createMediaSpec(attribu
|
|
|
78
96
|
// rectangle that provides an affordance for media.
|
|
79
97
|
style: "display: inline-block; border-radius: 3px; background: ".concat(_colors.N30, "; box-shadow: 0 1px 1px rgba(9, 30, 66, 0.2), 0 0 1px 0 rgba(9, 30, 66, 0.24);")
|
|
80
98
|
};
|
|
81
|
-
copyPrivateAttributes(node.attrs, attrs, function (key) {
|
|
99
|
+
copyPrivateAttributes(node.attrs, attrs, attributes, function (key) {
|
|
82
100
|
return "data-".concat(camelCaseToKebabCase(key.slice(2)));
|
|
83
101
|
});
|
|
84
102
|
return ["".concat(domNodeType), attrs];
|
|
@@ -96,9 +114,12 @@ var createMediaSpec = exports.createMediaSpec = function createMediaSpec(attribu
|
|
|
96
114
|
// https://product-fabric.atlassian.net/browse/EDM-2996
|
|
97
115
|
tag: 'img:not(.smart-link-icon)',
|
|
98
116
|
getAttrs: function getAttrs(dom) {
|
|
117
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
99
118
|
var attrs = {
|
|
100
119
|
type: 'external',
|
|
120
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
101
121
|
url: dom.getAttribute('src') || '',
|
|
122
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
102
123
|
alt: dom.getAttribute('alt') || ''
|
|
103
124
|
};
|
|
104
125
|
if (generateLocalId) {
|
|
@@ -116,20 +137,6 @@ var mediaWithLocalId = exports.mediaWithLocalId = createMediaSpec(_objectSpread(
|
|
|
116
137
|
default: _uuid.uuid.generate()
|
|
117
138
|
}
|
|
118
139
|
}), false, true);
|
|
119
|
-
var camelCaseToKebabCase = exports.camelCaseToKebabCase = function camelCaseToKebabCase(str) {
|
|
120
|
-
return str.replace(/([^A-Z]+)([A-Z])/g, function (_, x, y) {
|
|
121
|
-
return "".concat(x, "-").concat(y.toLowerCase());
|
|
122
|
-
});
|
|
123
|
-
};
|
|
124
|
-
var copyPrivateAttributes = exports.copyPrivateAttributes = function copyPrivateAttributes(from, to, map) {
|
|
125
|
-
if (media.attrs) {
|
|
126
|
-
Object.keys(media.attrs).forEach(function (key) {
|
|
127
|
-
if (key[0] === '_' && key[1] === '_' && from[key]) {
|
|
128
|
-
to[map ? map(key) : key] = from[key];
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
140
|
|
|
134
141
|
/**
|
|
135
142
|
* There's no concept of optional property in ProseMirror. It sets value as `null`
|
|
@@ -143,7 +150,9 @@ var toJSON = exports.toJSON = function toJSON(node) {
|
|
|
143
150
|
// Strip private attributes e.g. __fileName, __fileSize, __fileMimeType, etc.
|
|
144
151
|
.filter(function (key) {
|
|
145
152
|
return !(key[0] === '_' && key[1] === '_');
|
|
146
|
-
})
|
|
153
|
+
})
|
|
154
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
155
|
+
.reduce(function (obj, key) {
|
|
147
156
|
if (node.attrs.type === 'external' && externalOnlyAttributes.indexOf(key) === -1) {
|
|
148
157
|
return obj;
|
|
149
158
|
}
|
|
@@ -23,10 +23,14 @@ var mention = exports.mention = (0, _nodeTypes.mention)({
|
|
|
23
23
|
parseDOM: [{
|
|
24
24
|
tag: 'span[data-mention-id]',
|
|
25
25
|
getAttrs: function getAttrs(domNode) {
|
|
26
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
26
27
|
var dom = domNode;
|
|
27
28
|
var attrs = {
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
28
30
|
id: dom.getAttribute('data-mention-id') || mention.attrs.id.default,
|
|
31
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
29
32
|
text: dom.textContent || mention.attrs.text.default,
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
30
34
|
accessLevel: dom.getAttribute('data-access-level') || mention.attrs.accessLevel.default,
|
|
31
35
|
localId: _utils.uuid.generate()
|
|
32
36
|
};
|
|
@@ -44,6 +48,7 @@ var mention = exports.mention = (0, _nodeTypes.mention)({
|
|
|
44
48
|
text = _node$attrs.text,
|
|
45
49
|
userType = _node$attrs.userType,
|
|
46
50
|
localId = _node$attrs.localId;
|
|
51
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
47
52
|
var attrs = {
|
|
48
53
|
'data-mention-id': id,
|
|
49
54
|
'data-access-level': accessLevel,
|
|
@@ -26,6 +26,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
26
26
|
*/
|
|
27
27
|
|
|
28
28
|
function getExpandAttrs(domNode, generateLocalId) {
|
|
29
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
29
30
|
var dom = domNode;
|
|
30
31
|
return {
|
|
31
32
|
title: dom.getAttribute('data-title'),
|
|
@@ -70,7 +71,7 @@ var nestedExpandFactoryOptions = {
|
|
|
70
71
|
*/
|
|
71
72
|
var nestedExpand = exports.nestedExpand = (0, _nodeTypes.nestedExpand)(nestedExpandFactoryOptions);
|
|
72
73
|
var nestedExpandWithLocalId = exports.nestedExpandWithLocalId = (0, _nodeTypes.nestedExpand)(_objectSpread(_objectSpread({}, nestedExpandFactoryOptions), {}, {
|
|
73
|
-
parseDOM: [].concat((0, _toConsumableArray2.default)(nestedExpandFactoryOptions.parseDOM), [{
|
|
74
|
+
parseDOM: [].concat((0, _toConsumableArray2.default)(nestedExpandFactoryOptions.parseDOM || []), [{
|
|
74
75
|
context: 'nestedExpand//',
|
|
75
76
|
tag: '[data-node-type="nestedExpand"]',
|
|
76
77
|
getAttrs: function getAttrs(domNode) {
|
|
@@ -40,6 +40,7 @@ var orderedListWithLocalId = exports.orderedListWithLocalId = (0, _nodeTypes.ord
|
|
|
40
40
|
// resolve "start" to a safe, 0+ integer, otherwise return undefined
|
|
41
41
|
// Note: Any changes to this function should also be made to "resolveOrder"
|
|
42
42
|
// in packages/editor/editor-common/src/utils/list.ts
|
|
43
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
43
44
|
var resolveStart = function resolveStart(start) {
|
|
44
45
|
var num = Number(start);
|
|
45
46
|
if (Number.isNaN(num)) {
|
|
@@ -54,6 +55,7 @@ var orderedListWithOrder = exports.orderedListWithOrder = (0, _nodeTypes.ordered
|
|
|
54
55
|
parseDOM: [{
|
|
55
56
|
tag: 'ol',
|
|
56
57
|
getAttrs: function getAttrs(domNode) {
|
|
58
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
57
59
|
var dom = domNode;
|
|
58
60
|
var startDOMAttr = dom.getAttribute('start');
|
|
59
61
|
if (startDOMAttr) {
|
|
@@ -81,6 +83,7 @@ var orderedListWithOrderAndLocalId = exports.orderedListWithOrderAndLocalId = (0
|
|
|
81
83
|
parseDOM: [{
|
|
82
84
|
tag: 'ol',
|
|
83
85
|
getAttrs: function getAttrs(domNode) {
|
|
86
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
84
87
|
var dom = domNode;
|
|
85
88
|
var startDOMAttr = dom.getAttribute('start');
|
|
86
89
|
var localId = _utils.uuid.generate();
|
|
@@ -23,6 +23,7 @@ var PanelType = exports.PanelType = /*#__PURE__*/function (PanelType) {
|
|
|
23
23
|
/**
|
|
24
24
|
* @name panel_node
|
|
25
25
|
*/
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
26
27
|
var getDomAttrs = function getDomAttrs(nodeAttrs) {
|
|
27
28
|
var attrs = {
|
|
28
29
|
'data-panel-type': nodeAttrs.panelType,
|
|
@@ -36,6 +37,7 @@ var getDomAttrs = function getDomAttrs(nodeAttrs) {
|
|
|
36
37
|
};
|
|
37
38
|
var getParseDOMAttrs = function getParseDOMAttrs(allowCustomPanel, dom, generateLocalId) {
|
|
38
39
|
var parseDOMAttrs = {
|
|
40
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting, @typescript-eslint/no-non-null-assertion
|
|
39
41
|
panelType: dom.getAttribute('data-panel-type')
|
|
40
42
|
};
|
|
41
43
|
if (generateLocalId) {
|
|
@@ -43,9 +45,13 @@ var getParseDOMAttrs = function getParseDOMAttrs(allowCustomPanel, dom, generate
|
|
|
43
45
|
}
|
|
44
46
|
if (allowCustomPanel) {
|
|
45
47
|
parseDOMAttrs = _objectSpread(_objectSpread({}, parseDOMAttrs), {}, {
|
|
48
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting, @typescript-eslint/no-non-null-assertion
|
|
46
49
|
panelIcon: dom.getAttribute('data-panel-icon'),
|
|
50
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting, @typescript-eslint/no-non-null-assertion
|
|
47
51
|
panelIconId: dom.getAttribute('data-panel-icon-id'),
|
|
52
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting, @typescript-eslint/no-non-null-assertion
|
|
48
53
|
panelIconText: dom.getAttribute('data-panel-icon-text'),
|
|
54
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting, @typescript-eslint/no-non-null-assertion
|
|
49
55
|
panelColor: dom.getAttribute('data-panel-color')
|
|
50
56
|
});
|
|
51
57
|
} else {
|
|
@@ -35,6 +35,7 @@ var paragraph = exports.paragraph = (0, _nodeTypes.paragraph)({
|
|
|
35
35
|
tag: 'p',
|
|
36
36
|
getAttrs: function getAttrs(domNode) {
|
|
37
37
|
var _paragraph$attrs, _paragraph$attrs$loca;
|
|
38
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
38
39
|
var dom = domNode;
|
|
39
40
|
var attrs = {
|
|
40
41
|
localId: dom.getAttribute('data-local-id') || ((_paragraph$attrs = paragraph.attrs) === null || _paragraph$attrs === void 0 ? void 0 : (_paragraph$attrs$loca = _paragraph$attrs.localId) === null || _paragraph$attrs$loca === void 0 ? void 0 : _paragraph$attrs$loca.default)
|
|
@@ -15,7 +15,9 @@ var placeholder = exports.placeholder = (0, _nodeTypes.placeholder)({
|
|
|
15
15
|
tag: 'span[data-placeholder]',
|
|
16
16
|
getAttrs: function getAttrs(dom) {
|
|
17
17
|
return {
|
|
18
|
-
text:
|
|
18
|
+
text:
|
|
19
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting, @typescript-eslint/no-non-null-assertion
|
|
20
|
+
dom.getAttribute('data-placeholder') || placeholder.attrs.text.default
|
|
19
21
|
};
|
|
20
22
|
}
|
|
21
23
|
}],
|
|
@@ -34,7 +36,9 @@ var placeholderWithLocalId = exports.placeholderWithLocalId = (0, _nodeTypes.pla
|
|
|
34
36
|
tag: 'span[data-placeholder]',
|
|
35
37
|
getAttrs: function getAttrs(dom) {
|
|
36
38
|
return {
|
|
37
|
-
text:
|
|
39
|
+
text:
|
|
40
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting, @typescript-eslint/no-non-null-assertion
|
|
41
|
+
dom.getAttribute('data-placeholder') || placeholder.attrs.text.default,
|
|
38
42
|
localId: _uuid.uuid.generate()
|
|
39
43
|
};
|
|
40
44
|
}
|
|
@@ -14,8 +14,11 @@ var status = exports.status = (0, _nodeTypes.status)({
|
|
|
14
14
|
parseDOM: [{
|
|
15
15
|
tag: 'span[data-node-type="status"]',
|
|
16
16
|
getAttrs: function getAttrs(domNode) {
|
|
17
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
17
18
|
var dom = domNode;
|
|
18
19
|
return {
|
|
20
|
+
// @ts-ignore TS1501: This regular expression flag is only available when targeting 'es6' or later.
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
19
22
|
text: dom.textContent.replace(/\n/, '').trim(),
|
|
20
23
|
color: dom.getAttribute('data-color'),
|
|
21
24
|
localId: _uuid.uuid.generate(),
|