@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
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable @atlaskit/editor/no-re-export */
|
|
1
2
|
export { acNameToEmoji, acShortcutToEmoji, emojiIdToAcName, getEmojiAcName } from './confluence/emoji';
|
|
2
3
|
export { generateUuid, uuid } from './uuid';
|
|
3
4
|
export { B100, B400, B50, B500, B75, G200, G300, G400, G50, G500, G75, N0, N20, N200, N30, N300, N40, N50, N500, N60, N80, N800, N90, P100, P300, P400, P50, P500, P75, R100, R300, R400, R50, R500, R75, T100, T300, T50, T500, T75, Y200, Y400, Y50, Y500, Y75, hexToRgb, hexToRgba, isHex, isRgb, normalizeHexColor, rgbToHex } from './colors';
|
|
@@ -5,10 +5,13 @@
|
|
|
5
5
|
// https://en.wikipedia.org/wiki/CIELAB_color_space
|
|
6
6
|
|
|
7
7
|
const clamp = (i, min, max) => Math.round(Math.min(Math.max(i, min), max));
|
|
8
|
-
const expandShorthandHex = input =>
|
|
8
|
+
const expandShorthandHex = input =>
|
|
9
|
+
// @ts-ignore TS1501: This regular expression flag is only available when targeting 'es6' or later.
|
|
10
|
+
input.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/iu, (m, r, g, b) => r + r + g + g + b + b);
|
|
9
11
|
const rgbFromHex = input => {
|
|
10
12
|
const fullHex = expandShorthandHex(input);
|
|
11
|
-
|
|
13
|
+
// @ts-ignore TS1501: This regular expression flag is only available when targeting 'es6' or later.
|
|
14
|
+
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/iu.exec(fullHex);
|
|
12
15
|
return result === null ? null : {
|
|
13
16
|
r: parseInt(result[1], 16),
|
|
14
17
|
g: parseInt(result[2], 16),
|
|
@@ -54,7 +57,9 @@ const labToLch = ({
|
|
|
54
57
|
}) => {
|
|
55
58
|
let h = (Math.atan2(b, a) * (180 / Math.PI) + 360) % 360;
|
|
56
59
|
const c = Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2));
|
|
57
|
-
if (Math.round(c * 10000) === 0)
|
|
60
|
+
if (Math.round(c * 10000) === 0) {
|
|
61
|
+
h = Number.NaN;
|
|
62
|
+
}
|
|
58
63
|
return {
|
|
59
64
|
l,
|
|
60
65
|
c,
|
package/dist/es2019/utils/url.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
1
2
|
/**
|
|
2
3
|
* This file has been partially duplicated in packages/linking-platform/linking-common/src/url.ts
|
|
3
4
|
* Any changes made here should be mirrored there.
|
|
@@ -5,11 +6,11 @@
|
|
|
5
6
|
* Ticket for fixing linkification of filename-like urls: https://product-fabric.atlassian.net/browse/EDM-7190
|
|
6
7
|
*/
|
|
7
8
|
import LinkifyIt from 'linkify-it';
|
|
8
|
-
const whitelistedURLPatterns = [/^https?:\/\//
|
|
9
|
+
const whitelistedURLPatterns = [/^https?:\/\//imu, /^ftps?:\/\//imu, /^gopher:\/\//imu, /^integrity:\/\//imu, /^file:\/\//imu, /^smb:\/\//imu, /^dynamicsnav:\/\//imu, /^jamfselfservice:\/\//imu, /^\//imu, /^mailto:/imu, /^skype:/imu, /^callto:/imu, /^facetime:/imu, /^git:/imu, /^irc6?:/imu, /^news:/imu, /^nntp:/imu, /^feed:/imu, /^cvs:/imu, /^svn:/imu, /^mvn:/imu, /^ssh:/imu, /^scp:\/\//imu, /^sftp:\/\//imu, /^itms:/imu,
|
|
9
10
|
// This is not a valid notes link, but we support this pattern for backwards compatibility
|
|
10
|
-
/^notes:/
|
|
11
|
+
/^notes:/imu, /^notes:\/\//imu, /^hipchat:\/\//imu,
|
|
11
12
|
// This is not a valid sourcetree link, but we support this pattern for backwards compatibility
|
|
12
|
-
/^sourcetree:/
|
|
13
|
+
/^sourcetree:/imu, /^sourcetree:\/\//imu, /^urn:/imu, /^tel:/imu, /^xmpp:/imu, /^telnet:/imu, /^vnc:/imu, /^rdp:/imu, /^whatsapp:/imu, /^slack:/imu, /^sips?:/imu, /^magnet:/imu, /^#/imu];
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* Please notify the Editor Mobile team (Slack: #help-mobilekit) if the logic for this changes.
|
|
@@ -25,7 +26,7 @@ export const linkify = LinkifyIt();
|
|
|
25
26
|
linkify.add('sourcetree:', 'http:');
|
|
26
27
|
linkify.add('jamfselfservice:', 'http:');
|
|
27
28
|
const urlWithoutSpacesValidator = {
|
|
28
|
-
validate: /[^\s]+/
|
|
29
|
+
validate: /[^\s]+/u
|
|
29
30
|
};
|
|
30
31
|
|
|
31
32
|
// `tel:` URI spec is https://datatracker.ietf.org/doc/html/rfc3966
|
|
@@ -42,7 +43,7 @@ linkify.tlds(tlds, false);
|
|
|
42
43
|
|
|
43
44
|
// linkify-it mishandles closing braces on long urls, so we preference using our own regex first:
|
|
44
45
|
// https://product-fabric.atlassian.net/browse/ED-13669
|
|
45
|
-
export const LINK_REGEXP = /(https?|ftp|jamfselfservice|gopher|dynamicsnav|integrity|file|smb):\/\/[^\s]
|
|
46
|
+
export const LINK_REGEXP = /(https?|ftp|jamfselfservice|gopher|dynamicsnav|integrity|file|smb):\/\/[^\s]+/u;
|
|
46
47
|
|
|
47
48
|
/** Attempt to find a link match using a regex string defining a URL */
|
|
48
49
|
export const linkifyMatch = text => {
|
|
@@ -52,7 +53,8 @@ export const linkifyMatch = text => {
|
|
|
52
53
|
const matches = [];
|
|
53
54
|
let startpos = 0;
|
|
54
55
|
let substr;
|
|
55
|
-
|
|
56
|
+
substr = text.substr(startpos);
|
|
57
|
+
while (substr) {
|
|
56
58
|
const link = (substr.match(LINK_REGEXP) || [''])[0];
|
|
57
59
|
if (link) {
|
|
58
60
|
const index = substr.search(LINK_REGEXP);
|
|
@@ -67,6 +69,7 @@ export const linkifyMatch = text => {
|
|
|
67
69
|
schema: ''
|
|
68
70
|
});
|
|
69
71
|
startpos += end;
|
|
72
|
+
substr = text.substr(startpos);
|
|
70
73
|
} else {
|
|
71
74
|
break;
|
|
72
75
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export const generateUuid = () =>
|
|
2
|
+
// @ts-ignore TS1501: This regular expression flag is only available when targeting 'es6' or later.
|
|
3
|
+
'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/gu, c => {
|
|
3
4
|
const r = Math.random() * 16 | 0;
|
|
4
5
|
return (c === 'x' ? r : r & 0x3 | 0x8).toString(16);
|
|
5
6
|
});
|
|
6
|
-
|
|
7
|
-
/* eslint-enable no-bitwise */
|
|
8
7
|
let staticValue = false;
|
|
9
8
|
export const uuid = {
|
|
10
9
|
setStatic(value) {
|
|
@@ -252,7 +252,7 @@ export const bodiedSyncBlock = {
|
|
|
252
252
|
},
|
|
253
253
|
content: {
|
|
254
254
|
type: 'array',
|
|
255
|
-
items: [['paragraph', 'paragraph_with_alignment', 'paragraph_with_indentation', 'paragraph_with_no_marks', 'blockCard', 'blockquote', 'bulletList', 'codeBlock', 'decisionList', 'embedCard', 'expand', 'heading', 'heading_with_alignment', 'heading_with_indentation', 'heading_with_no_marks', 'layoutSection', 'mediaGroup', 'mediaSingle', 'mediaSingle_caption', 'mediaSingle_full', 'mediaSingle_width_type', 'orderedList', 'panel', 'rule', 'table', 'taskList']],
|
|
255
|
+
items: [['paragraph', 'paragraph_with_alignment', 'paragraph_with_indentation', 'paragraph_with_no_marks', 'blockCard', 'blockquote', 'bulletList', 'codeBlock', 'decisionList', 'embedCard', 'expand', 'heading', 'heading_with_alignment', 'heading_with_indentation', 'heading_with_no_marks', 'layoutSection', 'layoutSection_with_single_column', 'layoutSection_full', 'mediaGroup', 'mediaSingle', 'mediaSingle_caption', 'mediaSingle_full', 'mediaSingle_width_type', 'orderedList', 'panel', 'rule', 'table', 'taskList']],
|
|
256
256
|
minItems: 1,
|
|
257
257
|
allowUnsupportedBlock: true
|
|
258
258
|
},
|
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
/* eslint-disable @atlaskit/editor/no-re-export */
|
|
2
|
+
export { PanelType, AnnotationTypes, alignment, alignmentPositionMap, annotation, blockCard, blockCardWithLocalId, blockquote, extendedBlockquote, extendedBlockquoteWithLocalId, bodiedExtension, breakout, bulletList, bulletListSelector, bulletListWithLocalId, caption, captionWithLocalId, code, codeBlock, codeBlockWithLocalId, codeBlockToJSON, colorPalette,
|
|
3
|
+
// eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required
|
|
4
|
+
/** @deprecated [ED-15849] The extended palette is now rolled into the main one. Use `colorPalette` instead. */
|
|
2
5
|
colorPaletteExtended, confluenceInlineComment, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, createSchema, dataConsumer, dataConsumerToJSON, date, dateWithLocalId, decisionItem, decisionList, decisionListSelector, doc, em, embedCard, embedCardWithLocalId, emoji, emojiWithLocalId, expandWithNestedExpand, expandWithNestedExpandLocalId, expandToJSON, extension, fragment, fragmentToJSON, hardBreak, heading, image, indentation, inlineCard, inlineCardWithLocalId, inlineExtension, inlineNodes, layoutColumn, layoutColumnWithLocalId, layoutSection, layoutSectionWithLocalId, layoutSectionWithSingleColumn, layoutSectionWithSingleColumnLocalId, link, linkToJSON, listItem, listItemWithLocalId, listItemWithDecisionStage0, media, mediaGroup, mediaSingle, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, mediaSingleFullWithLocalId, mediaSingleSpec, mediaInline, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, nestedExpandWithLocalId, orderedList, orderedListSelector, orderedListWithLocalId, orderedListWithOrder, orderedListWithOrderAndLocalId, extendedPanel, extendedPanelWithLocalId, paragraph, placeholder, placeholderWithLocalId, rule, ruleWithLocalId, sanitizeNodes, getCellAttrs, getCellDomAttrs, status, strike, strong, subsup, table, tableStage0, tableWithCustomWidth, tableBackgroundBorderColor, tableBackgroundColorNames, tableBackgroundColorPalette, tableCell, tableCellContentDomSelector, tableCellContentWrapperSelector, tableCellSelector, tableHeader, tableHeaderSelector, tablePrefixSelector, tableRow, tableToJSON, taskItem, blockTaskItem, taskList, taskListSelector, text, textColor, toJSONTableCell, toJSONTableHeader, typeAheadQuery, underline, unknownBlock, unsupportedBlock, unsupportedInline, unsupportedNodeTypesForMediaCards, buildAnnotationMarkDataAttributes, AnnotationMarkStates, unsupportedMark, unsupportedNodeAttribute, border, borderColorPalette, extensionFrame, multiBodiedExtension, backgroundColor, backgroundColorPalette, backgroundColorPaletteNext, syncBlock, bodiedSyncBlock, tableWithNestedTable, tableRowWithNestedTable, tableCellWithNestedTable, tableHeaderWithNestedTable, tableRowWithLocalId, tableCellWithLocalId, tableHeaderWithLocalId, tableRowWithNestedTableWithLocalId, tableCellWithNestedTableWithLocalId, tableHeaderWithNestedTableWithLocalId } from './schema';
|
|
3
6
|
export { B100, B400, B50, B500, B75, G200, G300, G400, G50, G500, G75, N0, N20, N200, N30, N300, N40, N50, N500, N60, N80, N800, N90, P100, P300, P400, P50, P500, P75, R100, R300, R400, R50, R500, R75, T100, T300, T50, T500, T75, Y200, Y400, Y50, Y500, Y75, acNameToEmoji, acShortcutToEmoji, emojiIdToAcName, generateUuid, getEmojiAcName, getLinkMatch, hexToRgb, hexToRgba, isHex, isRgb, isSafeUrl, linkify, linkifyMatch, normalizeHexColor, normalizeUrl, rgbToHex, uuid, getDarkModeLCHColor } from './utils';
|
|
4
7
|
|
|
@@ -17,7 +17,7 @@ import { taskList } from '../nodes/task';
|
|
|
17
17
|
import { unsupportedBlock } from '../nodes/unsupportedBlock';
|
|
18
18
|
|
|
19
19
|
// Not an actual group, but a collection of nodes that can't be nested inside each other
|
|
20
|
-
// TODO: make it an actual group
|
|
20
|
+
// TODO: ED-29537 - make it an actual group
|
|
21
21
|
export var nonNestableBlockContent = [paragraph.use('with_no_marks'), panel, blockquote, orderedList, bulletList, rule, heading.use('with_no_marks'), codeBlock, mediaGroup, mediaSingle.use('caption'), mediaSingle.use('full'), decisionList, taskList, table,
|
|
22
22
|
// @ts-expect-error - types don't deal well with circular references for the variant
|
|
23
23
|
table.use('with_nested_table'), blockCard, embedCard, extension.use('with_marks'), unsupportedBlock];
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { adfMark } from '@atlaskit/adf-schema-generator';
|
|
2
|
-
import { adfMarkGroup } from '@atlaskit/adf-schema-generator';
|
|
1
|
+
import { adfMark, adfMarkGroup } from '@atlaskit/adf-schema-generator';
|
|
3
2
|
|
|
4
3
|
// These marks defined together because they form a cycle within the excludes.
|
|
5
4
|
export var alignment = adfMark('alignment');
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { adfMark } from '@atlaskit/adf-schema-generator';
|
|
2
|
-
import { adfMarkGroup } from '@atlaskit/adf-schema-generator';
|
|
1
|
+
import { adfMark, adfMarkGroup } from '@atlaskit/adf-schema-generator';
|
|
3
2
|
export var backgroundColor = adfMark('backgroundColor');
|
|
4
3
|
export var textColor = adfMark('textColor');
|
|
5
4
|
export var colorGroup = adfMarkGroup('color', [textColor, backgroundColor]);
|
|
@@ -34,7 +34,7 @@ export var bodiedSyncBlock = adfNode('bodiedSyncBlock').define({
|
|
|
34
34
|
default: ''
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
|
-
content: [$onePlus($or(paragraph, paragraph.use('with_alignment'), paragraph.use('with_indentation'), paragraph.use('with_no_marks'), blockCard, blockquote, blockquote.use('legacy'), bulletList, codeBlock, confluenceUnsupportedBlock, decisionList, embedCard, expand, heading, heading.use('with_alignment'), heading.use('with_indentation'), heading.use('with_no_marks'), layoutSection, mediaGroup, mediaSingle, mediaSingle.use('caption'), mediaSingle.use('full'), mediaSingle.use('width_type'), orderedList, panel, rule, table,
|
|
37
|
+
content: [$onePlus($or(paragraph, paragraph.use('with_alignment'), paragraph.use('with_indentation'), paragraph.use('with_no_marks'), blockCard, blockquote, blockquote.use('legacy'), bulletList, codeBlock, confluenceUnsupportedBlock, decisionList, embedCard, expand, heading, heading.use('with_alignment'), heading.use('with_indentation'), heading.use('with_no_marks'), layoutSection, layoutSection.use('with_single_column'), layoutSection.use('full'), mediaGroup, mediaSingle, mediaSingle.use('caption'), mediaSingle.use('full'), mediaSingle.use('width_type'), orderedList, panel, rule, table,
|
|
38
38
|
// @ts-expect-error - types don't deal well with circular references for the variant
|
|
39
39
|
table.use('with_nested_table'), taskList, unsupportedBlock))]
|
|
40
40
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createSchema } from './create-schema';
|
|
2
2
|
|
|
3
|
+
// eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required
|
|
3
4
|
/**
|
|
4
5
|
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
|
5
6
|
**/
|
|
@@ -2,6 +2,7 @@ import { createSchema } from './create-schema';
|
|
|
2
2
|
var nodes = ['doc', 'paragraph', 'blockquote', 'codeBlock', 'panel', 'hardBreak', 'orderedList', 'bulletList', 'heading', 'mediaInline', 'mediaGroup', 'mediaSingle', 'media', 'caption', 'confluenceUnsupportedBlock', 'confluenceJiraIssue', 'expand', 'nestedExpand', 'extension', 'inlineExtension', 'bodiedExtension', 'listItem', 'mention', 'text', 'confluenceUnsupportedInline', 'media', 'rule', 'table', 'tableCell', 'tableHeader', 'tableRow', 'emoji', 'taskList', 'taskItem', 'date', 'placeholder', 'decisionList', 'decisionItem', 'layoutSection', 'layoutColumn', 'inlineCard', 'unsupportedBlock', 'unsupportedInline'];
|
|
3
3
|
var marks = ['link', 'em', 'strong', 'strike', 'subsup', 'underline', 'mentionQuery', 'code', 'textColor', 'backgroundColor', 'confluenceInlineComment', 'annotation', 'unsupportedMark', 'unsupportedNodeAttribute'];
|
|
4
4
|
|
|
5
|
+
// eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required
|
|
5
6
|
/**
|
|
6
7
|
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
|
7
8
|
**/
|
|
@@ -9,6 +10,7 @@ export var confluenceSchema = createSchema({
|
|
|
9
10
|
nodes: nodes,
|
|
10
11
|
marks: marks
|
|
11
12
|
});
|
|
13
|
+
// eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required
|
|
12
14
|
/**
|
|
13
15
|
* @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
|
|
14
16
|
**/
|
|
@@ -274,14 +274,12 @@ export function getNodesAndMarksMap() {
|
|
|
274
274
|
var nodes = nodesInOrder.reduce(function (acc, _ref2) {
|
|
275
275
|
var name = _ref2.name,
|
|
276
276
|
spec = _ref2.spec;
|
|
277
|
-
// @ts-expect-error - Type for SchemaBuiltInItem is not correct
|
|
278
277
|
acc[name] = spec;
|
|
279
278
|
return acc;
|
|
280
279
|
}, {});
|
|
281
280
|
var marks = marksInOrder.reduce(function (acc, _ref3) {
|
|
282
281
|
var name = _ref3.name,
|
|
283
282
|
spec = _ref3.spec;
|
|
284
|
-
// @ts-expect-error - Type for SchemaBuiltInItem is not correct
|
|
285
283
|
acc[name] = spec;
|
|
286
284
|
return acc;
|
|
287
285
|
}, {});
|
|
@@ -15,6 +15,7 @@ export var createPMNodeSpecFactory = function createPMNodeSpecFactory(nodeSpec)
|
|
|
15
15
|
var parseDOM = _ref.parseDOM,
|
|
16
16
|
toDOM = _ref.toDOM,
|
|
17
17
|
toDebugString = _ref.toDebugString;
|
|
18
|
+
// @ts-ignore
|
|
18
19
|
return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, nodeSpec), parseDOM && {
|
|
19
20
|
parseDOM: parseDOM
|
|
20
21
|
}), toDOM && {
|
|
@@ -39,6 +40,7 @@ export var createPMMarkSpecFactory = function createPMMarkSpecFactory(markSpec)
|
|
|
39
40
|
var parseDOM = _ref2.parseDOM,
|
|
40
41
|
toDOM = _ref2.toDOM,
|
|
41
42
|
toDebugString = _ref2.toDebugString;
|
|
43
|
+
// @ts-ignore
|
|
42
44
|
return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, markSpec), parseDOM && {
|
|
43
45
|
parseDOM: parseDOM
|
|
44
46
|
}), toDOM && {
|
package/dist/esm/schema/index.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
/* eslint-disable @atlaskit/editor/no-re-export */
|
|
1
2
|
export { PanelType, blockCard, blockCardWithLocalId, blockquote, extendedBlockquote, extendedBlockquoteWithLocalId, bodiedExtension, bulletList, bulletListSelector, bulletListWithLocalId, caption, captionWithLocalId, codeBlock, codeBlockWithLocalId, codeBlockToJSON, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, date, dateWithLocalId, decisionItem, decisionList, decisionListSelector, doc, embedCard, embedCardWithLocalId, emoji, emojiWithLocalId, expandWithNestedExpand, expandWithNestedExpandLocalId, expandToJSON, extension, hardBreak, heading, image, inlineCard, inlineCardWithLocalId, inlineExtension, layoutColumn, layoutColumnWithLocalId, layoutSection, layoutSectionWithLocalId, layoutSectionWithSingleColumn, layoutSectionWithSingleColumnLocalId, listItem, listItemWithDecisionStage0, listItemWithLocalId, media, mediaGroup, mediaSingle, mediaSingleSpec, mediaInline, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, mediaSingleFullWithLocalId, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, nestedExpandWithLocalId, orderedList, orderedListSelector, orderedListWithLocalId, orderedListWithOrder, orderedListWithOrderAndLocalId, extendedPanel, extendedPanelWithLocalId, paragraph, placeholder, placeholderWithLocalId, rule, ruleWithLocalId, getCellAttrs, getCellDomAttrs, status, table, tableStage0, tableWithCustomWidth, tableBackgroundBorderColor, tableBackgroundColorNames, tableBackgroundColorPalette, tableCell, tableCellContentDomSelector, tableCellContentWrapperSelector, tableCellSelector, tableHeader, tableHeaderSelector, tablePrefixSelector, tableRow, tableToJSON, taskItem, blockTaskItem, taskList, taskListSelector, text, toJSONTableCell, toJSONTableHeader, unknownBlock, unsupportedBlock, unsupportedInline, extensionFrame, multiBodiedExtension, syncBlock, bodiedSyncBlock, tableWithNestedTable, tableRowWithNestedTable, tableCellWithNestedTable, tableHeaderWithNestedTable, tableRowWithLocalId, tableCellWithLocalId, tableHeaderWithLocalId, tableRowWithNestedTableWithLocalId, tableCellWithNestedTableWithLocalId, tableHeaderWithNestedTableWithLocalId } from './nodes';
|
|
2
|
-
export { AnnotationTypes, alignment, alignmentPositionMap, annotation, breakout, code, colorPalette,
|
|
3
|
+
export { AnnotationTypes, alignment, alignmentPositionMap, annotation, breakout, code, colorPalette,
|
|
4
|
+
// eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required
|
|
5
|
+
/** @deprecated [ED-15849] The extended palette is now rolled into the main one. Use `colorPalette` instead. */
|
|
3
6
|
colorPaletteExtended, confluenceInlineComment, dataConsumer, dataConsumerToJSON, em, fragment, fragmentToJSON, indentation, link, linkToJSON, strike, strong, subsup, textColor, typeAheadQuery, underline, buildAnnotationMarkDataAttributes, AnnotationMarkStates, unsupportedMark, unsupportedNodeAttribute, border, borderColorPalette, backgroundColor, backgroundColorPalette, backgroundColorPaletteNext } from './marks';
|
|
4
7
|
export { unsupportedNodeTypesForMediaCards } from './unsupported';
|
|
5
8
|
export { inlineNodes } from './inline-nodes';
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
// eslint-disable-next-line import/no-namespace
|
|
1
2
|
import * as nodes from './nodes';
|
|
3
|
+
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2
5
|
var typedNodes = nodes;
|
|
3
6
|
export var inlineNodes = new Set(Object.keys(typedNodes).filter(function (key) {
|
|
4
7
|
return typedNodes[key] && typedNodes[key].group === 'inline';
|
|
@@ -37,6 +37,7 @@ export var annotation = annotationFactory({
|
|
|
37
37
|
tag: 'span[data-mark-type="annotation"]',
|
|
38
38
|
mark: 'annotation',
|
|
39
39
|
getAttrs: function getAttrs(domNode) {
|
|
40
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
40
41
|
var dom = domNode;
|
|
41
42
|
var attrs = {
|
|
42
43
|
id: dom.getAttribute('data-id'),
|
|
@@ -47,11 +48,11 @@ export var annotation = annotationFactory({
|
|
|
47
48
|
}],
|
|
48
49
|
toDOM: function toDOM(node) {
|
|
49
50
|
/*
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
Data attributes on the DOM node are a temporary means of
|
|
52
|
+
incrementally switching over to the Annotation mark. Once renderer
|
|
53
|
+
provides native support for inline comments the data attributes on the
|
|
54
|
+
DOM nodes will be removed.
|
|
55
|
+
*/
|
|
55
56
|
return ['span', _objectSpread({
|
|
56
57
|
// Prettier will remove the quotes around class. This would cause some browsers
|
|
57
58
|
// to not add this attribute properly, as its a reserved word.
|
|
@@ -41,6 +41,7 @@ var colorArrayPaletteNext = [[Neutral300, 'Gray'],
|
|
|
41
41
|
|
|
42
42
|
// @see https://product-fabric.atlassian.net/wiki/spaces/E/pages/55979455/Colour+picker+decisions#Colourpickerdecisions-Visualdesigndecisions
|
|
43
43
|
// Remove this when cleaning up platform_editor_add_orange_highlight_color
|
|
44
|
+
// eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required
|
|
44
45
|
/**
|
|
45
46
|
* @deprecated use backgroundColorPaletteNext instead, which in addition supports yellow highlight
|
|
46
47
|
*/
|
|
@@ -64,6 +65,7 @@ export var backgroundColor = backgroundColorFactory({
|
|
|
64
65
|
getAttrs: function getAttrs(maybeValue) {
|
|
65
66
|
var value = maybeValue;
|
|
66
67
|
var hexColor;
|
|
68
|
+
// @ts-ignore TS1501: This regular expression flag is only available when targeting 'es6' or later.
|
|
67
69
|
if (value.match(/^rgb/i)) {
|
|
68
70
|
hexColor = rgbToHex(value);
|
|
69
71
|
} else if (value[0] === '#') {
|
|
@@ -21,6 +21,7 @@ export var border = borderFactory({
|
|
|
21
21
|
tag: '[data-mark-type="border"]',
|
|
22
22
|
getAttrs: function getAttrs(domNode) {
|
|
23
23
|
var _dom$getAttribute, _dom$getAttribute2;
|
|
24
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
24
25
|
var dom = domNode;
|
|
25
26
|
var color = ((_dom$getAttribute = dom.getAttribute('data-color')) !== null && _dom$getAttribute !== void 0 ? _dom$getAttribute : '').toLowerCase();
|
|
26
27
|
var size = +((_dom$getAttribute2 = dom.getAttribute('data-size')) !== null && _dom$getAttribute2 !== void 0 ? _dom$getAttribute2 : '0');
|
|
@@ -9,7 +9,9 @@ export var breakout = breakoutFactory({
|
|
|
9
9
|
parseDOM: [{
|
|
10
10
|
tag: 'div.fabric-editor-breakout-mark',
|
|
11
11
|
getAttrs: function getAttrs(dom) {
|
|
12
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
12
13
|
var mode = dom.getAttribute('data-mode');
|
|
14
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
13
15
|
var width = dom.getAttribute('data-width');
|
|
14
16
|
return {
|
|
15
17
|
mode: allowedTypes.indexOf(mode || '') === -1 ? 'wide' : mode,
|
|
@@ -8,6 +8,7 @@ export var indentation = indentationFactory({
|
|
|
8
8
|
parseDOM: [{
|
|
9
9
|
tag: 'div.fabric-editor-indentation-mark',
|
|
10
10
|
getAttrs: function getAttrs(dom) {
|
|
11
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
11
12
|
var level = +(dom.getAttribute('data-level') || '0');
|
|
12
13
|
return {
|
|
13
14
|
level: level > 6 ? 6 : level < 1 ? false : level
|
|
@@ -32,7 +32,9 @@ export var link = linkFactory({
|
|
|
32
32
|
getAttrs: getLinkAttrs('data-block-link'),
|
|
33
33
|
contentElement: function contentElement(node) {
|
|
34
34
|
var clone = node.cloneNode(true);
|
|
35
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
35
36
|
clone.removeAttribute('data-block-link');
|
|
37
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
36
38
|
clone.setAttribute('data-skip-paste', 'true');
|
|
37
39
|
var wrapper = document.createElement('div');
|
|
38
40
|
wrapper.appendChild(clone);
|
|
@@ -43,6 +45,7 @@ export var link = linkFactory({
|
|
|
43
45
|
getAttrs: getLinkAttrs('href')
|
|
44
46
|
}],
|
|
45
47
|
toDOM: function toDOM(node, isInline) {
|
|
48
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
46
49
|
var attrs = Object.keys(node.attrs).reduce(function (attrs, key) {
|
|
47
50
|
if (key === '__confluenceMetadata') {
|
|
48
51
|
if (node.attrs[key] !== null) {
|
|
@@ -51,6 +54,7 @@ export var link = linkFactory({
|
|
|
51
54
|
} else if (key === 'href') {
|
|
52
55
|
attrs[key] = isSafeUrl(node.attrs[key]) ? node.attrs[key] : undefined;
|
|
53
56
|
} else {
|
|
57
|
+
// @ts-ignore
|
|
54
58
|
attrs[key] = node.attrs[key];
|
|
55
59
|
}
|
|
56
60
|
return attrs;
|
|
@@ -15,15 +15,19 @@ export var strong = strongFactory({
|
|
|
15
15
|
{
|
|
16
16
|
tag: 'b',
|
|
17
17
|
getAttrs: function getAttrs(node) {
|
|
18
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
18
19
|
var element = node;
|
|
19
20
|
return element.style.fontWeight !== 'normal' && null;
|
|
20
21
|
}
|
|
21
22
|
}, {
|
|
22
23
|
tag: 'span',
|
|
23
24
|
getAttrs: function getAttrs(node) {
|
|
25
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
24
26
|
var element = node;
|
|
25
27
|
var fontWeight = element.style.fontWeight;
|
|
26
|
-
return typeof fontWeight === 'string' && (fontWeight === 'bold' || fontWeight === 'bolder' ||
|
|
28
|
+
return typeof fontWeight === 'string' && (fontWeight === 'bold' || fontWeight === 'bolder' ||
|
|
29
|
+
// @ts-ignore TS1501: This regular expression flag is only available when targeting 'es6' or later.
|
|
30
|
+
/^(bold(er)?|[5-9][0-9]{2,})$/.test(fontWeight)) && null;
|
|
27
31
|
}
|
|
28
32
|
}],
|
|
29
33
|
toDOM: function toDOM() {
|
|
@@ -56,6 +56,7 @@ var colorArrayPalette = [
|
|
|
56
56
|
|
|
57
57
|
// @see https://product-fabric.atlassian.net/wiki/spaces/E/pages/55979455/Colour+picker+decisions#Colourpickerdecisions-Visualdesigndecisions
|
|
58
58
|
export var colorPalette = new Map();
|
|
59
|
+
// eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required
|
|
59
60
|
/** @deprecated [ED-15849] The extended palette is now rolled into the main one. Use `colorPalette` instead. */
|
|
60
61
|
export var colorPaletteExtended = colorPalette;
|
|
61
62
|
colorArrayPalette.forEach(function (_ref) {
|
|
@@ -94,6 +95,7 @@ export var textColor = textColorFactory({
|
|
|
94
95
|
getAttrs: function getAttrs(maybeValue) {
|
|
95
96
|
var value = maybeValue;
|
|
96
97
|
var hexColor;
|
|
98
|
+
// @ts-ignore TS1501: This regular expression flag is only available when targeting 'es6' or later.
|
|
97
99
|
if (value.match(/^rgb/i)) {
|
|
98
100
|
hexColor = rgbToHex(value);
|
|
99
101
|
} else if (value[0] === '#') {
|
|
@@ -14,7 +14,10 @@ var getCommonAttributesFromDom = function getCommonAttributesFromDom(dom) {
|
|
|
14
14
|
var datasource = anchor.getAttribute('data-datasource');
|
|
15
15
|
return {
|
|
16
16
|
data: data ? JSON.parse(data) : undefined,
|
|
17
|
-
layout: datasource ?
|
|
17
|
+
layout: datasource ?
|
|
18
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
19
|
+
dom.getAttribute('data-layout') || undefined : undefined,
|
|
20
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
18
21
|
width: Number(dom.getAttribute('data-width')) || undefined,
|
|
19
22
|
datasource: datasource ? JSON.parse(datasource) : undefined
|
|
20
23
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { blockquote as blockquoteFactory } from '../../next-schema/generated/nodeTypes';
|
|
2
|
-
import { blockquoteLegacy as blockquoteLegacyFactory } from '../../next-schema/generated/nodeTypes';
|
|
1
|
+
import { blockquote as blockquoteFactory, blockquoteLegacy as blockquoteLegacyFactory } from '../../next-schema/generated/nodeTypes';
|
|
3
2
|
import { uuid } from '../../utils';
|
|
4
3
|
|
|
5
4
|
/**
|
|
@@ -16,6 +16,7 @@ export var bodiedExtension = bodiedExtensionFactory({
|
|
|
16
16
|
skip: true
|
|
17
17
|
}, {
|
|
18
18
|
tag: '[data-node-type="bodied-extension"]',
|
|
19
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
19
20
|
getAttrs: function getAttrs(domNode) {
|
|
20
21
|
return getExtensionAttrs(domNode);
|
|
21
22
|
}
|
|
@@ -11,6 +11,7 @@ export var bodiedSyncBlock = bodiedSyncBlockFactory({
|
|
|
11
11
|
parseDOM: [{
|
|
12
12
|
tag: 'div[data-bodied-sync-block]',
|
|
13
13
|
getAttrs: function getAttrs(domNode) {
|
|
14
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
14
15
|
var dom = domNode;
|
|
15
16
|
var attrs = {
|
|
16
17
|
localId: dom.getAttribute('data-local-id') || uuid.generate(),
|
|
@@ -28,9 +28,11 @@ export var captionWithLocalId = captionFactory({
|
|
|
28
28
|
toDOM: function toDOM(node) {
|
|
29
29
|
var _node$attrs;
|
|
30
30
|
var attrs = {
|
|
31
|
-
'data-caption': 'true'
|
|
32
|
-
'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
|
|
31
|
+
'data-caption': 'true'
|
|
33
32
|
};
|
|
33
|
+
if ((node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.localId) !== undefined) {
|
|
34
|
+
attrs['data-local-id'] = node.attrs.localId;
|
|
35
|
+
}
|
|
34
36
|
return ['figcaption', attrs, 0];
|
|
35
37
|
}
|
|
36
38
|
});
|
|
@@ -32,7 +32,8 @@ var getLanguageFromCode = function getLanguageFromCode(dom) {
|
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
34
|
var extractLanguageFromClass = function extractLanguageFromClass(className) {
|
|
35
|
-
|
|
35
|
+
// @ts-ignore TS1501: This regular expression flag is only available when targeting 'es6' or later.
|
|
36
|
+
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])+)/;
|
|
36
37
|
var result = languageRegex.exec(className);
|
|
37
38
|
if (result && result[1]) {
|
|
38
39
|
return result[1];
|
|
@@ -42,6 +43,8 @@ var extractLanguageFromClass = function extractLanguageFromClass(className) {
|
|
|
42
43
|
var removeLastNewLine = function removeLastNewLine(dom) {
|
|
43
44
|
var parent = dom && dom.parentElement;
|
|
44
45
|
if (parent && parent.classList.contains('codehilite')) {
|
|
46
|
+
// @ts-ignore TS1501: This regular expression flag is only available when targeting 'es6' or later.
|
|
47
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
45
48
|
dom.textContent = dom.textContent.replace(/\n$/, '');
|
|
46
49
|
}
|
|
47
50
|
return dom;
|
|
@@ -74,8 +77,15 @@ export var codeBlock = codeBlockFactory({
|
|
|
74
77
|
tag: 'pre',
|
|
75
78
|
preserveWhitespace: 'full',
|
|
76
79
|
getAttrs: function getAttrs(domNode) {
|
|
80
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
77
81
|
var dom = domNode;
|
|
78
|
-
var language =
|
|
82
|
+
var language =
|
|
83
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
84
|
+
getLanguageFromBitbucketStyle(dom.parentElement) ||
|
|
85
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
86
|
+
getLanguageFromEditorStyle(dom.parentElement) || getLanguageFromCode(dom) ||
|
|
87
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
88
|
+
dom.getAttribute('data-language');
|
|
79
89
|
dom = removeLastNewLine(dom);
|
|
80
90
|
return {
|
|
81
91
|
language: language
|
|
@@ -88,6 +98,7 @@ export var codeBlock = codeBlockFactory({
|
|
|
88
98
|
tag: 'div[style]',
|
|
89
99
|
preserveWhitespace: 'full',
|
|
90
100
|
getAttrs: function getAttrs(domNode) {
|
|
101
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
91
102
|
var dom = domNode;
|
|
92
103
|
if (dom.style.whiteSpace === 'pre' || dom.style.fontFamily && dom.style.fontFamily.toLowerCase().indexOf('monospace') > -1) {
|
|
93
104
|
return {};
|
|
@@ -104,6 +115,7 @@ export var codeBlock = codeBlockFactory({
|
|
|
104
115
|
tag: 'table[style]',
|
|
105
116
|
preserveWhitespace: 'full',
|
|
106
117
|
getAttrs: function getAttrs(dom) {
|
|
118
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
107
119
|
if (dom.querySelector('td[class*="blob-code"]')) {
|
|
108
120
|
return {};
|
|
109
121
|
}
|
|
@@ -113,8 +125,9 @@ export var codeBlock = codeBlockFactory({
|
|
|
113
125
|
tag: 'div.code-block',
|
|
114
126
|
preserveWhitespace: 'full',
|
|
115
127
|
getAttrs: function getAttrs(domNode) {
|
|
128
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
116
129
|
var dom = domNode;
|
|
117
|
-
// TODO: ED-5604 Fix it inside `react-syntax-highlighter`
|
|
130
|
+
// TODO: ED-5604 - Fix it inside `react-syntax-highlighter`
|
|
118
131
|
// Remove line numbers
|
|
119
132
|
var lineNumber = dom.querySelectorAll('.react-syntax-highlighter-line-number');
|
|
120
133
|
if (lineNumber.length > 0) {
|
|
@@ -135,6 +148,7 @@ export var codeBlock = codeBlockFactory({
|
|
|
135
148
|
});
|
|
136
149
|
export var toJSON = function toJSON(node) {
|
|
137
150
|
return {
|
|
151
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
138
152
|
attrs: Object.keys(node.attrs).reduce(function (memo, key) {
|
|
139
153
|
if (key === 'uniqueId') {
|
|
140
154
|
return memo;
|
|
@@ -152,8 +166,15 @@ export var codeBlockWithLocalId = codeBlockFactory({
|
|
|
152
166
|
tag: 'pre',
|
|
153
167
|
preserveWhitespace: 'full',
|
|
154
168
|
getAttrs: function getAttrs(domNode) {
|
|
169
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
155
170
|
var dom = domNode;
|
|
156
|
-
var language =
|
|
171
|
+
var language =
|
|
172
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
173
|
+
getLanguageFromBitbucketStyle(dom.parentElement) ||
|
|
174
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
175
|
+
getLanguageFromEditorStyle(dom.parentElement) || getLanguageFromCode(dom) ||
|
|
176
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
177
|
+
dom.getAttribute('data-language');
|
|
157
178
|
dom = removeLastNewLine(dom);
|
|
158
179
|
return {
|
|
159
180
|
language: language,
|
|
@@ -167,6 +188,7 @@ export var codeBlockWithLocalId = codeBlockFactory({
|
|
|
167
188
|
tag: 'div[style]',
|
|
168
189
|
preserveWhitespace: 'full',
|
|
169
190
|
getAttrs: function getAttrs(domNode) {
|
|
191
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
170
192
|
var dom = domNode;
|
|
171
193
|
if (dom.style.whiteSpace === 'pre' || dom.style.fontFamily && dom.style.fontFamily.toLowerCase().indexOf('monospace') > -1) {
|
|
172
194
|
return {};
|
|
@@ -183,6 +205,7 @@ export var codeBlockWithLocalId = codeBlockFactory({
|
|
|
183
205
|
tag: 'table[style]',
|
|
184
206
|
preserveWhitespace: 'full',
|
|
185
207
|
getAttrs: function getAttrs(dom) {
|
|
208
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
186
209
|
if (dom.querySelector('td[class*="blob-code"]')) {
|
|
187
210
|
return {};
|
|
188
211
|
}
|
|
@@ -192,8 +215,9 @@ export var codeBlockWithLocalId = codeBlockFactory({
|
|
|
192
215
|
tag: 'div.code-block',
|
|
193
216
|
preserveWhitespace: 'full',
|
|
194
217
|
getAttrs: function getAttrs(domNode) {
|
|
218
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
195
219
|
var dom = domNode;
|
|
196
|
-
// TODO: ED-5604 Fix it inside `react-syntax-highlighter`
|
|
220
|
+
// TODO: ED-5604 - Fix it inside `react-syntax-highlighter`
|
|
197
221
|
// Remove line numbers
|
|
198
222
|
var lineNumber = dom.querySelectorAll('.react-syntax-highlighter-line-number');
|
|
199
223
|
if (lineNumber.length > 0) {
|
|
@@ -208,9 +232,10 @@ export var codeBlockWithLocalId = codeBlockFactory({
|
|
|
208
232
|
}],
|
|
209
233
|
toDOM: function toDOM(node) {
|
|
210
234
|
var _node$attrs;
|
|
211
|
-
var attrs = {
|
|
212
|
-
|
|
213
|
-
|
|
235
|
+
var attrs = {};
|
|
236
|
+
if ((node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.localId) !== undefined) {
|
|
237
|
+
attrs['data-local-id'] = node.attrs.localId;
|
|
238
|
+
}
|
|
214
239
|
return ['pre', attrs, ['code', {
|
|
215
240
|
'data-language': node.attrs.language
|
|
216
241
|
}, 0]];
|
|
@@ -4,6 +4,7 @@ export var confluenceJiraIssue = confluenceJiraIssueFactory({
|
|
|
4
4
|
parseDOM: [{
|
|
5
5
|
tag: "span[data-node-type=\"".concat(name, "\"]"),
|
|
6
6
|
getAttrs: function getAttrs(domNode) {
|
|
7
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
7
8
|
var dom = domNode;
|
|
8
9
|
return {
|
|
9
10
|
issueKey: dom.textContent,
|