@atlaskit/renderer 105.1.0 → 105.1.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 +12 -0
- package/dist/cjs/actions/index.js +19 -71
- package/dist/cjs/actions/matches-utils.js +10 -11
- package/dist/cjs/actions.js +0 -2
- package/dist/cjs/analytics/analyticsContext.js +0 -4
- package/dist/cjs/analytics/events.js +0 -5
- package/dist/cjs/analytics/unsupported-content.js +14 -27
- package/dist/cjs/i18n/cs.js +0 -1
- package/dist/cjs/i18n/da.js +0 -1
- package/dist/cjs/i18n/de.js +0 -1
- package/dist/cjs/i18n/en.js +0 -1
- package/dist/cjs/i18n/en_GB.js +0 -1
- package/dist/cjs/i18n/en_ZZ.js +0 -1
- package/dist/cjs/i18n/es.js +0 -1
- package/dist/cjs/i18n/et.js +0 -1
- package/dist/cjs/i18n/fi.js +0 -1
- package/dist/cjs/i18n/fr.js +0 -1
- package/dist/cjs/i18n/hu.js +0 -1
- package/dist/cjs/i18n/index.js +0 -26
- package/dist/cjs/i18n/it.js +0 -1
- package/dist/cjs/i18n/ja.js +0 -1
- package/dist/cjs/i18n/ko.js +0 -1
- package/dist/cjs/i18n/nb.js +0 -1
- package/dist/cjs/i18n/nl.js +0 -1
- package/dist/cjs/i18n/pl.js +0 -1
- package/dist/cjs/i18n/pt_BR.js +0 -1
- package/dist/cjs/i18n/pt_PT.js +0 -1
- package/dist/cjs/i18n/ru.js +0 -1
- package/dist/cjs/i18n/sk.js +0 -1
- package/dist/cjs/i18n/sv.js +0 -1
- package/dist/cjs/i18n/th.js +0 -1
- package/dist/cjs/i18n/tr.js +0 -1
- package/dist/cjs/i18n/uk.js +0 -1
- package/dist/cjs/i18n/vi.js +0 -1
- package/dist/cjs/i18n/zh.js +0 -1
- package/dist/cjs/i18n/zh_TW.js +0 -1
- package/dist/cjs/index.js +0 -6
- package/dist/cjs/messages.js +0 -2
- package/dist/cjs/react/hooks/use-bidi-warnings.js +2 -12
- package/dist/cjs/react/hooks/use-in-viewport.js +4 -17
- package/dist/cjs/react/hooks/use-observed-width.js +20 -35
- package/dist/cjs/react/index.js +27 -114
- package/dist/cjs/react/marks/alignment.js +0 -9
- package/dist/cjs/react/marks/annotation.js +6 -21
- package/dist/cjs/react/marks/breakout.js +0 -9
- package/dist/cjs/react/marks/code.js +0 -11
- package/dist/cjs/react/marks/confluence-inline-comment.js +2 -19
- package/dist/cjs/react/marks/data-consumer.js +0 -4
- package/dist/cjs/react/marks/em.js +0 -3
- package/dist/cjs/react/marks/fragment.js +0 -4
- package/dist/cjs/react/marks/indentation.js +0 -3
- package/dist/cjs/react/marks/index.js +1 -24
- package/dist/cjs/react/marks/link.js +5 -25
- package/dist/cjs/react/marks/strike.js +0 -4
- package/dist/cjs/react/marks/strong.js +0 -3
- package/dist/cjs/react/marks/subsup.js +0 -5
- package/dist/cjs/react/marks/textColor.js +0 -9
- package/dist/cjs/react/marks/underline.js +0 -3
- package/dist/cjs/react/marks/unsupportedMark.js +0 -3
- package/dist/cjs/react/marks/unsupportedNodeAttribute.js +0 -3
- package/dist/cjs/react/nodes/blockCard.js +4 -16
- package/dist/cjs/react/nodes/blockquote.js +0 -3
- package/dist/cjs/react/nodes/bodiedExtension.js +6 -17
- package/dist/cjs/react/nodes/bulletList.js +0 -5
- package/dist/cjs/react/nodes/caption.js +1 -6
- package/dist/cjs/react/nodes/codeBlock/codeBlock.js +5 -14
- package/dist/cjs/react/nodes/codeBlock/components/codeBlockContainer.js +3 -16
- package/dist/cjs/react/nodes/codeBlock/components/lightWeightCodeBlock.js +6 -23
- package/dist/cjs/react/nodes/codeBlock/windowedCodeBlock.js +9 -32
- package/dist/cjs/react/nodes/codeBlockCopyButton.js +7 -31
- package/dist/cjs/react/nodes/date.js +5 -33
- package/dist/cjs/react/nodes/decisionItem.js +1 -5
- package/dist/cjs/react/nodes/decisionList.js +0 -20
- package/dist/cjs/react/nodes/doc.js +0 -6
- package/dist/cjs/react/nodes/embedCard.js +25 -54
- package/dist/cjs/react/nodes/emoji.js +6 -24
- package/dist/cjs/react/nodes/extension.js +12 -26
- package/dist/cjs/react/nodes/fallback.js +2 -24
- package/dist/cjs/react/nodes/hardBreak.js +1 -7
- package/dist/cjs/react/nodes/heading-anchor.js +1 -46
- package/dist/cjs/react/nodes/heading.js +4 -17
- package/dist/cjs/react/nodes/index.js +7 -62
- package/dist/cjs/react/nodes/inline.js +0 -6
- package/dist/cjs/react/nodes/inlineCard.js +6 -23
- package/dist/cjs/react/nodes/inlineExtension.js +2 -10
- package/dist/cjs/react/nodes/layoutColumn.js +0 -8
- package/dist/cjs/react/nodes/layoutSection.js +0 -3
- package/dist/cjs/react/nodes/listItem.js +0 -3
- package/dist/cjs/react/nodes/media.js +10 -49
- package/dist/cjs/react/nodes/mediaGroup.js +6 -47
- package/dist/cjs/react/nodes/mediaInline.js +7 -37
- package/dist/cjs/react/nodes/mediaSingle/index.js +38 -85
- package/dist/cjs/react/nodes/mediaSingle/styles.js +0 -5
- package/dist/cjs/react/nodes/mention.js +5 -23
- package/dist/cjs/react/nodes/orderedList.js +0 -14
- package/dist/cjs/react/nodes/panel.js +10 -38
- package/dist/cjs/react/nodes/paragraph.js +1 -5
- package/dist/cjs/react/nodes/placeholder.js +0 -4
- package/dist/cjs/react/nodes/rule.js +0 -3
- package/dist/cjs/react/nodes/status.js +3 -22
- package/dist/cjs/react/nodes/table/colgroup.js +12 -26
- package/dist/cjs/react/nodes/table/sticky.js +17 -47
- package/dist/cjs/react/nodes/table/table.js +5 -10
- package/dist/cjs/react/nodes/table.js +19 -102
- package/dist/cjs/react/nodes/tableCell.js +26 -79
- package/dist/cjs/react/nodes/tableRow.js +4 -33
- package/dist/cjs/react/nodes/task-item-with-providers.js +4 -40
- package/dist/cjs/react/nodes/taskItem.js +8 -36
- package/dist/cjs/react/nodes/taskList.js +2 -22
- package/dist/cjs/react/nodes/text-wrapper.js +1 -8
- package/dist/cjs/react/nodes/unknownBlock.js +0 -3
- package/dist/cjs/react/renderer-node.js +0 -6
- package/dist/cjs/react/utils/clipboard.js +0 -3
- package/dist/cjs/react/utils/element-selection.js +0 -13
- package/dist/cjs/react/utils/getCardClickHandler.js +0 -3
- package/dist/cjs/react/utils/inject-props.js +4 -9
- package/dist/cjs/react/utils/links.js +2 -6
- package/dist/cjs/react/utils/lists.js +0 -1
- package/dist/cjs/react/utils/performance/RenderTracking.js +2 -10
- package/dist/cjs/react/utils/use-select-all-trap.js +1 -23
- package/dist/cjs/render-document.js +42 -83
- package/dist/cjs/renderer-context.js +0 -5
- package/dist/cjs/steps/index.js +7 -39
- package/dist/cjs/text/index.js +0 -9
- package/dist/cjs/text/nodes/blockquote.js +0 -3
- package/dist/cjs/text/nodes/bulletList.js +0 -3
- package/dist/cjs/text/nodes/date.js +0 -4
- package/dist/cjs/text/nodes/decisionItem.js +0 -5
- package/dist/cjs/text/nodes/hardBreak.js +0 -2
- package/dist/cjs/text/nodes/heading.js +0 -3
- package/dist/cjs/text/nodes/index.js +0 -21
- package/dist/cjs/text/nodes/inlineCard.js +0 -4
- package/dist/cjs/text/nodes/listItem.js +0 -3
- package/dist/cjs/text/nodes/mediaGroup.js +0 -4
- package/dist/cjs/text/nodes/mention.js +0 -3
- package/dist/cjs/text/nodes/orderedList.js +0 -4
- package/dist/cjs/text/nodes/panel.js +0 -3
- package/dist/cjs/text/nodes/paragraph.js +0 -5
- package/dist/cjs/text/nodes/rule.js +0 -2
- package/dist/cjs/text/nodes/status.js +0 -3
- package/dist/cjs/text/nodes/table.js +0 -5
- package/dist/cjs/text/nodes/taskItem.js +0 -5
- package/dist/cjs/text/nodes/unknown.js +0 -6
- package/dist/cjs/text-serializer.js +0 -2
- package/dist/cjs/ui/Expand.js +15 -59
- package/dist/cjs/ui/ExtensionRenderer.js +10 -43
- package/dist/cjs/ui/MediaCard.js +40 -116
- package/dist/cjs/ui/Renderer/ErrorBoundary.js +0 -26
- package/dist/cjs/ui/Renderer/breakout-ssr.js +6 -32
- package/dist/cjs/ui/Renderer/click-to-edit.js +0 -6
- package/dist/cjs/ui/Renderer/index.js +47 -149
- package/dist/cjs/ui/Renderer/style.js +1 -39
- package/dist/cjs/ui/Renderer/truncated-wrapper.js +12 -30
- package/dist/cjs/ui/RendererActionsContext/WithRendererActions.js +0 -4
- package/dist/cjs/ui/RendererActionsContext/index.js +1 -11
- package/dist/cjs/ui/SmartCardStorage.js +0 -20
- package/dist/cjs/ui/SortingIcon.js +10 -40
- package/dist/cjs/ui/TaskItemsFormatContext/TaskItemsFormatContext.js +0 -11
- package/dist/cjs/ui/TaskItemsFormatContext/index.js +0 -1
- package/dist/cjs/ui/active-header-id-provider.js +6 -19
- package/dist/cjs/ui/annotations/context.js +0 -24
- package/dist/cjs/ui/annotations/draft/component.js +5 -42
- package/dist/cjs/ui/annotations/draft/dom.js +3 -17
- package/dist/cjs/ui/annotations/draft/index.js +0 -2
- package/dist/cjs/ui/annotations/draft/position.js +1 -12
- package/dist/cjs/ui/annotations/draft/text.js +2 -8
- package/dist/cjs/ui/annotations/element/index.js +4 -16
- package/dist/cjs/ui/annotations/element/mark.js +8 -26
- package/dist/cjs/ui/annotations/hooks/index.js +0 -3
- package/dist/cjs/ui/annotations/hooks/use-events.js +13 -45
- package/dist/cjs/ui/annotations/hooks/use-inline-comment-subscriber.js +0 -6
- package/dist/cjs/ui/annotations/hooks/use-inline-comments-filter.js +1 -8
- package/dist/cjs/ui/annotations/hooks/use-load-annotations.js +4 -19
- package/dist/cjs/ui/annotations/hooks/user-selection.js +3 -18
- package/dist/cjs/ui/annotations/hooks/utils.js +0 -2
- package/dist/cjs/ui/annotations/index.js +4 -20
- package/dist/cjs/ui/annotations/selection/index.js +0 -1
- package/dist/cjs/ui/annotations/selection/mounter.js +13 -42
- package/dist/cjs/ui/annotations/selection/range-validator.js +9 -23
- package/dist/cjs/ui/annotations/selection/wrapper.js +3 -13
- package/dist/cjs/ui/annotations/types.js +0 -1
- package/dist/cjs/ui/annotations/view/index.js +1 -12
- package/dist/cjs/ui/index.js +0 -2
- package/dist/cjs/use-feature-flags.js +0 -4
- package/dist/cjs/utils.js +1 -19
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/actions/index.js +6 -50
- package/dist/es2019/actions/matches-utils.js +10 -9
- package/dist/es2019/actions.js +2 -1
- package/dist/es2019/analytics/events.js +0 -5
- package/dist/es2019/analytics/unsupported-content.js +8 -14
- package/dist/es2019/react/hooks/use-bidi-warnings.js +0 -2
- package/dist/es2019/react/hooks/use-in-viewport.js +0 -1
- package/dist/es2019/react/hooks/use-observed-width.js +0 -2
- package/dist/es2019/react/index.js +44 -119
- package/dist/es2019/react/marks/alignment.js +0 -3
- package/dist/es2019/react/marks/annotation.js +2 -5
- package/dist/es2019/react/marks/confluence-inline-comment.js +0 -1
- package/dist/es2019/react/marks/index.js +2 -1
- package/dist/es2019/react/marks/link.js +0 -6
- package/dist/es2019/react/marks/subsup.js +0 -3
- package/dist/es2019/react/nodes/bodiedExtension.js +2 -5
- package/dist/es2019/react/nodes/caption.js +0 -2
- package/dist/es2019/react/nodes/codeBlock/codeBlock.js +0 -2
- package/dist/es2019/react/nodes/codeBlock/components/codeBlockContainer.js +1 -3
- package/dist/es2019/react/nodes/codeBlock/windowedCodeBlock.js +1 -6
- package/dist/es2019/react/nodes/codeBlockCopyButton.js +0 -4
- package/dist/es2019/react/nodes/date.js +0 -7
- package/dist/es2019/react/nodes/decisionList.js +0 -3
- package/dist/es2019/react/nodes/embedCard.js +8 -16
- package/dist/es2019/react/nodes/emoji.js +0 -1
- package/dist/es2019/react/nodes/extension.js +4 -6
- package/dist/es2019/react/nodes/fallback.js +0 -8
- package/dist/es2019/react/nodes/hardBreak.js +0 -3
- package/dist/es2019/react/nodes/heading-anchor.js +0 -15
- package/dist/es2019/react/nodes/heading.js +0 -6
- package/dist/es2019/react/nodes/index.js +28 -61
- package/dist/es2019/react/nodes/inline.js +0 -2
- package/dist/es2019/react/nodes/inlineCard.js +0 -5
- package/dist/es2019/react/nodes/inlineExtension.js +2 -5
- package/dist/es2019/react/nodes/media.js +0 -10
- package/dist/es2019/react/nodes/mediaGroup.js +2 -22
- package/dist/es2019/react/nodes/mediaInline.js +1 -8
- package/dist/es2019/react/nodes/mediaSingle/index.js +8 -29
- package/dist/es2019/react/nodes/mention.js +0 -1
- package/dist/es2019/react/nodes/orderedList.js +0 -5
- package/dist/es2019/react/nodes/panel.js +4 -17
- package/dist/es2019/react/nodes/placeholder.js +0 -1
- package/dist/es2019/react/nodes/status.js +0 -1
- package/dist/es2019/react/nodes/table/colgroup.js +9 -18
- package/dist/es2019/react/nodes/table/sticky.js +3 -16
- package/dist/es2019/react/nodes/table.js +9 -75
- package/dist/es2019/react/nodes/tableCell.js +4 -31
- package/dist/es2019/react/nodes/tableRow.js +0 -10
- package/dist/es2019/react/nodes/task-item-with-providers.js +0 -6
- package/dist/es2019/react/nodes/taskItem.js +0 -7
- package/dist/es2019/react/nodes/taskList.js +0 -3
- package/dist/es2019/react/nodes/text-wrapper.js +0 -4
- package/dist/es2019/react/utils/clipboard.js +0 -1
- package/dist/es2019/react/utils/element-selection.js +0 -12
- package/dist/es2019/react/utils/inject-props.js +5 -7
- package/dist/es2019/react/utils/links.js +2 -4
- package/dist/es2019/react/utils/performance/RenderTracking.js +0 -1
- package/dist/es2019/react/utils/use-select-all-trap.js +0 -7
- package/dist/es2019/render-document.js +16 -33
- package/dist/es2019/steps/index.js +4 -33
- package/dist/es2019/text/index.js +0 -3
- package/dist/es2019/text/nodes/blockquote.js +0 -2
- package/dist/es2019/text/nodes/bulletList.js +0 -2
- package/dist/es2019/text/nodes/date.js +0 -2
- package/dist/es2019/text/nodes/decisionItem.js +0 -4
- package/dist/es2019/text/nodes/hardBreak.js +0 -1
- package/dist/es2019/text/nodes/heading.js +0 -2
- package/dist/es2019/text/nodes/inlineCard.js +0 -3
- package/dist/es2019/text/nodes/listItem.js +0 -2
- package/dist/es2019/text/nodes/mediaGroup.js +0 -3
- package/dist/es2019/text/nodes/mention.js +0 -2
- package/dist/es2019/text/nodes/orderedList.js +0 -2
- package/dist/es2019/text/nodes/panel.js +0 -2
- package/dist/es2019/text/nodes/paragraph.js +0 -4
- package/dist/es2019/text/nodes/rule.js +0 -1
- package/dist/es2019/text/nodes/status.js +0 -2
- package/dist/es2019/text/nodes/table.js +0 -4
- package/dist/es2019/text/nodes/taskItem.js +0 -4
- package/dist/es2019/text/nodes/unknown.js +0 -4
- package/dist/es2019/ui/Expand.js +2 -17
- package/dist/es2019/ui/ExtensionRenderer.js +0 -19
- package/dist/es2019/ui/MediaCard.js +9 -40
- package/dist/es2019/ui/Renderer/ErrorBoundary.js +0 -10
- package/dist/es2019/ui/Renderer/breakout-ssr.js +6 -26
- package/dist/es2019/ui/Renderer/click-to-edit.js +1 -4
- package/dist/es2019/ui/Renderer/index.js +17 -66
- package/dist/es2019/ui/Renderer/style.js +0 -14
- package/dist/es2019/ui/Renderer/truncated-wrapper.js +2 -6
- package/dist/es2019/ui/SmartCardStorage.js +0 -1
- package/dist/es2019/ui/SortingIcon.js +3 -20
- package/dist/es2019/ui/TaskItemsFormatContext/TaskItemsFormatContext.js +0 -2
- package/dist/es2019/ui/active-header-id-provider.js +0 -3
- package/dist/es2019/ui/annotations/context.js +0 -6
- package/dist/es2019/ui/annotations/draft/component.js +0 -13
- package/dist/es2019/ui/annotations/draft/dom.js +0 -6
- package/dist/es2019/ui/annotations/draft/position.js +0 -8
- package/dist/es2019/ui/annotations/draft/text.js +0 -1
- package/dist/es2019/ui/annotations/element/index.js +0 -3
- package/dist/es2019/ui/annotations/element/mark.js +4 -6
- package/dist/es2019/ui/annotations/hooks/use-events.js +4 -13
- package/dist/es2019/ui/annotations/hooks/use-inline-comment-subscriber.js +0 -2
- package/dist/es2019/ui/annotations/hooks/use-inline-comments-filter.js +0 -1
- package/dist/es2019/ui/annotations/hooks/use-load-annotations.js +4 -8
- package/dist/es2019/ui/annotations/hooks/user-selection.js +0 -6
- package/dist/es2019/ui/annotations/selection/mounter.js +0 -13
- package/dist/es2019/ui/annotations/selection/range-validator.js +0 -2
- package/dist/es2019/ui/annotations/selection/wrapper.js +0 -2
- package/dist/es2019/ui/annotations/types.js +0 -1
- package/dist/es2019/ui/annotations/view/index.js +0 -4
- package/dist/es2019/use-feature-flags.js +0 -1
- package/dist/es2019/utils.js +1 -8
- package/dist/es2019/version.json +1 -1
- package/dist/esm/actions/index.js +19 -63
- package/dist/esm/actions/matches-utils.js +10 -9
- package/dist/esm/actions.js +2 -1
- package/dist/esm/analytics/events.js +0 -5
- package/dist/esm/analytics/unsupported-content.js +14 -21
- package/dist/esm/react/hooks/use-bidi-warnings.js +2 -4
- package/dist/esm/react/hooks/use-in-viewport.js +4 -13
- package/dist/esm/react/hooks/use-observed-width.js +20 -29
- package/dist/esm/react/index.js +27 -111
- package/dist/esm/react/marks/alignment.js +0 -4
- package/dist/esm/react/marks/annotation.js +6 -14
- package/dist/esm/react/marks/breakout.js +0 -2
- package/dist/esm/react/marks/confluence-inline-comment.js +2 -12
- package/dist/esm/react/marks/index.js +2 -1
- package/dist/esm/react/marks/link.js +5 -12
- package/dist/esm/react/marks/subsup.js +0 -3
- package/dist/esm/react/nodes/blockCard.js +4 -4
- package/dist/esm/react/nodes/bodiedExtension.js +6 -10
- package/dist/esm/react/nodes/caption.js +1 -3
- package/dist/esm/react/nodes/codeBlock/codeBlock.js +4 -6
- package/dist/esm/react/nodes/codeBlock/components/codeBlockContainer.js +4 -8
- package/dist/esm/react/nodes/codeBlock/components/lightWeightCodeBlock.js +6 -10
- package/dist/esm/react/nodes/codeBlock/windowedCodeBlock.js +10 -21
- package/dist/esm/react/nodes/codeBlockCopyButton.js +7 -15
- package/dist/esm/react/nodes/date.js +5 -20
- package/dist/esm/react/nodes/decisionItem.js +1 -1
- package/dist/esm/react/nodes/decisionList.js +0 -12
- package/dist/esm/react/nodes/embedCard.js +25 -39
- package/dist/esm/react/nodes/emoji.js +6 -16
- package/dist/esm/react/nodes/extension.js +12 -16
- package/dist/esm/react/nodes/fallback.js +2 -18
- package/dist/esm/react/nodes/hardBreak.js +1 -5
- package/dist/esm/react/nodes/heading-anchor.js +1 -32
- package/dist/esm/react/nodes/heading.js +4 -10
- package/dist/esm/react/nodes/index.js +26 -64
- package/dist/esm/react/nodes/inline.js +0 -2
- package/dist/esm/react/nodes/inlineCard.js +6 -12
- package/dist/esm/react/nodes/inlineExtension.js +2 -6
- package/dist/esm/react/nodes/layoutColumn.js +0 -2
- package/dist/esm/react/nodes/media.js +10 -34
- package/dist/esm/react/nodes/mediaGroup.js +6 -37
- package/dist/esm/react/nodes/mediaInline.js +7 -20
- package/dist/esm/react/nodes/mediaSingle/index.js +37 -66
- package/dist/esm/react/nodes/mediaSingle/styles.js +0 -2
- package/dist/esm/react/nodes/mention.js +5 -15
- package/dist/esm/react/nodes/orderedList.js +0 -5
- package/dist/esm/react/nodes/panel.js +12 -28
- package/dist/esm/react/nodes/paragraph.js +1 -1
- package/dist/esm/react/nodes/placeholder.js +0 -1
- package/dist/esm/react/nodes/status.js +3 -13
- package/dist/esm/react/nodes/table/colgroup.js +12 -21
- package/dist/esm/react/nodes/table/sticky.js +17 -32
- package/dist/esm/react/nodes/table/table.js +5 -5
- package/dist/esm/react/nodes/table.js +19 -95
- package/dist/esm/react/nodes/tableCell.js +26 -66
- package/dist/esm/react/nodes/tableRow.js +4 -25
- package/dist/esm/react/nodes/task-item-with-providers.js +4 -27
- package/dist/esm/react/nodes/taskItem.js +8 -24
- package/dist/esm/react/nodes/taskList.js +2 -14
- package/dist/esm/react/nodes/text-wrapper.js +1 -5
- package/dist/esm/react/utils/clipboard.js +0 -1
- package/dist/esm/react/utils/element-selection.js +0 -10
- package/dist/esm/react/utils/inject-props.js +5 -7
- package/dist/esm/react/utils/links.js +2 -4
- package/dist/esm/react/utils/performance/RenderTracking.js +2 -4
- package/dist/esm/react/utils/use-select-all-trap.js +1 -9
- package/dist/esm/render-document.js +42 -70
- package/dist/esm/steps/index.js +7 -36
- package/dist/esm/text/index.js +0 -6
- package/dist/esm/text/nodes/blockquote.js +0 -2
- package/dist/esm/text/nodes/bulletList.js +0 -2
- package/dist/esm/text/nodes/date.js +0 -2
- package/dist/esm/text/nodes/decisionItem.js +0 -4
- package/dist/esm/text/nodes/hardBreak.js +0 -1
- package/dist/esm/text/nodes/heading.js +0 -2
- package/dist/esm/text/nodes/inlineCard.js +0 -3
- package/dist/esm/text/nodes/listItem.js +0 -2
- package/dist/esm/text/nodes/mediaGroup.js +0 -3
- package/dist/esm/text/nodes/mention.js +0 -2
- package/dist/esm/text/nodes/orderedList.js +0 -2
- package/dist/esm/text/nodes/panel.js +0 -2
- package/dist/esm/text/nodes/paragraph.js +0 -4
- package/dist/esm/text/nodes/rule.js +0 -1
- package/dist/esm/text/nodes/status.js +0 -2
- package/dist/esm/text/nodes/table.js +0 -4
- package/dist/esm/text/nodes/taskItem.js +0 -4
- package/dist/esm/text/nodes/unknown.js +0 -4
- package/dist/esm/ui/Expand.js +15 -36
- package/dist/esm/ui/ExtensionRenderer.js +10 -39
- package/dist/esm/ui/MediaCard.js +42 -99
- package/dist/esm/ui/Renderer/ErrorBoundary.js +0 -16
- package/dist/esm/ui/Renderer/breakout-ssr.js +7 -27
- package/dist/esm/ui/Renderer/click-to-edit.js +1 -4
- package/dist/esm/ui/Renderer/index.js +47 -110
- package/dist/esm/ui/Renderer/style.js +1 -21
- package/dist/esm/ui/Renderer/truncated-wrapper.js +12 -23
- package/dist/esm/ui/RendererActionsContext/index.js +1 -1
- package/dist/esm/ui/SmartCardStorage.js +0 -9
- package/dist/esm/ui/SortingIcon.js +10 -29
- package/dist/esm/ui/TaskItemsFormatContext/TaskItemsFormatContext.js +0 -2
- package/dist/esm/ui/active-header-id-provider.js +6 -12
- package/dist/esm/ui/annotations/context.js +0 -15
- package/dist/esm/ui/annotations/draft/component.js +5 -19
- package/dist/esm/ui/annotations/draft/dom.js +3 -11
- package/dist/esm/ui/annotations/draft/position.js +1 -9
- package/dist/esm/ui/annotations/draft/text.js +2 -4
- package/dist/esm/ui/annotations/element/index.js +4 -7
- package/dist/esm/ui/annotations/element/mark.js +8 -14
- package/dist/esm/ui/annotations/hooks/use-events.js +13 -32
- package/dist/esm/ui/annotations/hooks/use-inline-comment-subscriber.js +0 -2
- package/dist/esm/ui/annotations/hooks/use-inline-comments-filter.js +1 -2
- package/dist/esm/ui/annotations/hooks/use-load-annotations.js +4 -12
- package/dist/esm/ui/annotations/hooks/user-selection.js +3 -11
- package/dist/esm/ui/annotations/index.js +4 -6
- package/dist/esm/ui/annotations/selection/mounter.js +13 -29
- package/dist/esm/ui/annotations/selection/range-validator.js +9 -12
- package/dist/esm/ui/annotations/selection/wrapper.js +3 -5
- package/dist/esm/ui/annotations/types.js +0 -1
- package/dist/esm/ui/annotations/view/index.js +1 -5
- package/dist/esm/use-feature-flags.js +0 -1
- package/dist/esm/utils.js +1 -8
- package/dist/esm/version.json +1 -1
- package/package.json +2 -2
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Caption } from '@atlaskit/editor-common/ui';
|
|
3
|
-
|
|
4
3
|
const RenderCaption = ({
|
|
5
4
|
children,
|
|
6
5
|
dataAttributes
|
|
@@ -10,5 +9,4 @@ const RenderCaption = ({
|
|
|
10
9
|
dataAttributes: dataAttributes
|
|
11
10
|
}, children);
|
|
12
11
|
};
|
|
13
|
-
|
|
14
12
|
export default RenderCaption;
|
|
@@ -5,7 +5,6 @@ import { CodeBlockSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
|
5
5
|
import { CodeBlock as AkCodeBlock } from '@atlaskit/code';
|
|
6
6
|
import { codeBidiWarningMessages } from '@atlaskit/editor-common/messages';
|
|
7
7
|
import CodeBlockContainer from './components/codeBlockContainer';
|
|
8
|
-
|
|
9
8
|
function CodeBlock(props) {
|
|
10
9
|
const {
|
|
11
10
|
text,
|
|
@@ -26,5 +25,4 @@ function CodeBlock(props) {
|
|
|
26
25
|
codeBidiWarningTooltipEnabled: codeBidiWarningTooltipEnabled
|
|
27
26
|
}));
|
|
28
27
|
}
|
|
29
|
-
|
|
30
28
|
export default injectIntl(CodeBlock);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
+
|
|
2
3
|
import { jsx, css } from '@emotion/react';
|
|
3
4
|
import { overflowShadow, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
4
5
|
import { N20, DN50 } from '@atlaskit/theme/colors';
|
|
@@ -6,7 +7,6 @@ import { themed } from '@atlaskit/theme/components';
|
|
|
6
7
|
import { fontSize, gridSize } from '@atlaskit/theme/constants';
|
|
7
8
|
import { CodeBlockSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
8
9
|
import CopyButton from '../../codeBlockCopyButton';
|
|
9
|
-
|
|
10
10
|
const codeBlockStyleOverrides = props => css`
|
|
11
11
|
tab-size: 4;
|
|
12
12
|
background-color: ${themed({
|
|
@@ -29,7 +29,6 @@ const codeBlockStyleOverrides = props => css`
|
|
|
29
29
|
background-position: 0 0, 0 0, 100% 0, 100% 0, 100% 0, 100% 0, 0 0, 0 0;
|
|
30
30
|
}
|
|
31
31
|
`;
|
|
32
|
-
|
|
33
32
|
const CodeBlockContainer = ({
|
|
34
33
|
text,
|
|
35
34
|
className,
|
|
@@ -43,5 +42,4 @@ const CodeBlockContainer = ({
|
|
|
43
42
|
content: text
|
|
44
43
|
}) : null, children);
|
|
45
44
|
};
|
|
46
|
-
|
|
47
45
|
export default CodeBlockContainer;
|
|
@@ -7,14 +7,10 @@ import { useInViewport } from '../../hooks/use-in-viewport';
|
|
|
7
7
|
import { useBidiWarnings } from '../../hooks/use-bidi-warnings';
|
|
8
8
|
import LightWeightCodeBlock from './components/lightWeightCodeBlock';
|
|
9
9
|
import CodeBlockContainer from './components/codeBlockContainer';
|
|
10
|
-
const LazyAkCodeBlock = /*#__PURE__*/lazy(async () => import(
|
|
11
|
-
/* webpackChunkName: "@atlaskit-internal_renderer-codeBlock" */
|
|
10
|
+
const LazyAkCodeBlock = /*#__PURE__*/lazy(async () => import( /* webpackChunkName: "@atlaskit-internal_renderer-codeBlock" */
|
|
12
11
|
'@atlaskit/code/block'));
|
|
13
|
-
|
|
14
12
|
const joinWithSpaces = (...strs) => strs.join(' ');
|
|
15
|
-
|
|
16
13
|
const MemoizedLightWeightCodeBlock = /*#__PURE__*/memo(LightWeightCodeBlock);
|
|
17
|
-
|
|
18
14
|
const WindowedCodeBlock = ({
|
|
19
15
|
text,
|
|
20
16
|
language,
|
|
@@ -51,5 +47,4 @@ const WindowedCodeBlock = ({
|
|
|
51
47
|
codeBidiWarningTooltipEnabled: codeBidiWarningTooltipEnabled
|
|
52
48
|
})))) : memoizedLightWeightCodeBlock;
|
|
53
49
|
};
|
|
54
|
-
|
|
55
50
|
export default WindowedCodeBlock;
|
|
@@ -49,19 +49,16 @@ const copyButtonWrapperStyles = css`
|
|
|
49
49
|
background-color: ${`var(--ds-surface-overlay-hovered, ${N700})`};
|
|
50
50
|
}
|
|
51
51
|
`;
|
|
52
|
-
|
|
53
52
|
const CopyButton = ({
|
|
54
53
|
content,
|
|
55
54
|
intl
|
|
56
55
|
}) => {
|
|
57
56
|
const [tooltip, setTooltip] = useState(intl.formatMessage(codeBlockCopyButtonMessages.copyCodeToClipboard));
|
|
58
57
|
const [className, setClassName] = useState('copy-to-clipboard');
|
|
59
|
-
|
|
60
58
|
const onMouseLeave = () => {
|
|
61
59
|
setTooltip(intl.formatMessage(codeBlockCopyButtonMessages.copyCodeToClipboard));
|
|
62
60
|
setClassName('copy-to-clipboard');
|
|
63
61
|
};
|
|
64
|
-
|
|
65
62
|
return jsx("span", {
|
|
66
63
|
css: copyButtonWrapperStyles
|
|
67
64
|
}, jsx(Tooltip, {
|
|
@@ -86,5 +83,4 @@ const CopyButton = ({
|
|
|
86
83
|
}
|
|
87
84
|
}))));
|
|
88
85
|
};
|
|
89
|
-
|
|
90
86
|
export default injectIntl(CopyButton);
|
|
@@ -5,7 +5,6 @@ import { DateSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
|
5
5
|
import { isPastDate, timestampToString, timestampToTaskContext } from '@atlaskit/editor-common/utils';
|
|
6
6
|
import { injectIntl } from 'react-intl-next';
|
|
7
7
|
import { useTaskItemsFormatContext } from '../../ui/TaskItemsFormatContext';
|
|
8
|
-
|
|
9
8
|
class Date extends PureComponent {
|
|
10
9
|
render() {
|
|
11
10
|
const {
|
|
@@ -22,22 +21,16 @@ class Date extends PureComponent {
|
|
|
22
21
|
"data-timestamp": timestamp
|
|
23
22
|
}, parentIsIncompleteTask ? timestampToTaskContext(timestamp, intl) : timestampToString(timestamp, intl)));
|
|
24
23
|
}
|
|
25
|
-
|
|
26
24
|
}
|
|
27
|
-
|
|
28
25
|
export const DateComponent = injectIntl(Date);
|
|
29
|
-
|
|
30
26
|
function DateWithFormatContext(props) {
|
|
31
27
|
const [isChecked] = useTaskItemsFormatContext();
|
|
32
28
|
let parentIsIncompleteTask = props.parentIsIncompleteTask;
|
|
33
|
-
|
|
34
29
|
if (typeof isChecked !== 'undefined') {
|
|
35
30
|
parentIsIncompleteTask = !isChecked;
|
|
36
31
|
}
|
|
37
|
-
|
|
38
32
|
return /*#__PURE__*/React.createElement(DateComponent, _extends({}, props, {
|
|
39
33
|
parentIsIncompleteTask: parentIsIncompleteTask
|
|
40
34
|
}));
|
|
41
35
|
}
|
|
42
|
-
|
|
43
36
|
export default DateWithFormatContext;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
|
|
3
2
|
/** @jsx jsx */
|
|
4
3
|
import { css, jsx } from '@emotion/react';
|
|
5
4
|
import { useMemo, useContext, useState, useRef } from 'react';
|
|
@@ -53,63 +52,56 @@ export default function EmbedCard(props) {
|
|
|
53
52
|
};
|
|
54
53
|
const [liveHeight, setLiveHeight] = useState(null);
|
|
55
54
|
const [aspectRatio, setAspectRatio] = useState();
|
|
56
|
-
const height = liveHeight || props.originalHeight;
|
|
55
|
+
const height = liveHeight || props.originalHeight;
|
|
57
56
|
|
|
57
|
+
// We start with height and width defined with default values
|
|
58
58
|
let originalHeight = DEFAULT_EMBED_CARD_HEIGHT;
|
|
59
|
-
let originalWidth = DEFAULT_EMBED_CARD_WIDTH;
|
|
59
|
+
let originalWidth = DEFAULT_EMBED_CARD_WIDTH;
|
|
60
60
|
|
|
61
|
+
// Then can override height and width with values from ADF if available
|
|
61
62
|
if (props.originalHeight && props.originalWidth) {
|
|
62
63
|
originalHeight = props.originalHeight;
|
|
63
64
|
originalWidth = props.originalWidth;
|
|
64
|
-
}
|
|
65
|
-
|
|
65
|
+
}
|
|
66
66
|
|
|
67
|
+
// Then we can override it with aspectRatio that is comming from iframely via `resolve()`
|
|
67
68
|
if (aspectRatio) {
|
|
68
69
|
originalHeight = 1;
|
|
69
70
|
originalWidth = aspectRatio;
|
|
70
|
-
}
|
|
71
|
-
|
|
71
|
+
}
|
|
72
72
|
|
|
73
|
+
// And finally if iframe sends live `height` events we use that as most precise measure.
|
|
73
74
|
const isHeightOnlyMode = !(props.originalHeight && props.originalWidth) || liveHeight;
|
|
74
|
-
|
|
75
75
|
if (height && isHeightOnlyMode) {
|
|
76
76
|
originalHeight = height;
|
|
77
77
|
originalWidth = undefined;
|
|
78
78
|
}
|
|
79
|
-
|
|
80
79
|
const padding = rendererAppearance === 'full-page' ? FullPagePadding * 2 : 0;
|
|
81
80
|
const [hasPreview, setPreviewAvailableState] = useState(true);
|
|
82
81
|
const cardContext = useContext(SmartCardContext);
|
|
83
|
-
|
|
84
82
|
const onResolve = ({
|
|
85
83
|
aspectRatio: resolvedAspectRatio
|
|
86
84
|
}) => {
|
|
87
85
|
const hasPreviewOnResolve = !!(cardContext && url && cardContext.extractors.getPreview(url, platform));
|
|
88
|
-
|
|
89
86
|
if (!hasPreviewOnResolve) {
|
|
90
87
|
setPreviewAvailableState(false);
|
|
91
88
|
}
|
|
92
|
-
|
|
93
89
|
setAspectRatio(resolvedAspectRatio);
|
|
94
90
|
};
|
|
95
|
-
|
|
96
91
|
return jsx(WidthConsumer, null, ({
|
|
97
92
|
width: containerWidth,
|
|
98
93
|
breakpoint
|
|
99
94
|
}) => {
|
|
100
95
|
let nonFullWidthSize = containerWidth;
|
|
101
96
|
const isFullWidth = rendererAppearance === 'full-width';
|
|
102
|
-
|
|
103
97
|
if (!isInsideOfBlockNode && rendererAppearance !== 'comment') {
|
|
104
98
|
const isContainerSizeGreaterThanMaxFullPageWidth = containerWidth - padding >= akEditorDefaultLayoutWidth;
|
|
105
|
-
|
|
106
99
|
if (isContainerSizeGreaterThanMaxFullPageWidth) {
|
|
107
100
|
nonFullWidthSize = akEditorDefaultLayoutWidth;
|
|
108
101
|
} else {
|
|
109
102
|
nonFullWidthSize = containerWidth - padding;
|
|
110
103
|
}
|
|
111
104
|
}
|
|
112
|
-
|
|
113
105
|
const lineLength = isFullWidth ? Math.min(akEditorFullWidthLayoutWidth, containerWidth - padding) : nonFullWidthSize;
|
|
114
106
|
const uiMediaSingleStyles = layout === 'full-width' || layout === 'wide' ? uIMediaSingleLayoutStyles : '';
|
|
115
107
|
return jsx(CardErrorBoundary, _extends({
|
|
@@ -5,8 +5,9 @@ import { overflowShadow, WidthConsumer } from '@atlaskit/editor-common/ui';
|
|
|
5
5
|
import { calcBreakoutWidth } from '@atlaskit/editor-common/utils';
|
|
6
6
|
import { RendererCssClassName } from '../../consts';
|
|
7
7
|
export const renderExtension = (content, layout, options = {}, removeOverflow) => {
|
|
8
|
-
const overflowContainerClass = !removeOverflow ? RendererCssClassName.EXTENSION_OVERFLOW_CONTAINER : '';
|
|
8
|
+
const overflowContainerClass = !removeOverflow ? RendererCssClassName.EXTENSION_OVERFLOW_CONTAINER : '';
|
|
9
9
|
|
|
10
|
+
// by default, we assume the extension is at top level, (direct child of doc node)
|
|
10
11
|
const {
|
|
11
12
|
isTopLevel = true
|
|
12
13
|
} = options || {};
|
|
@@ -24,7 +25,6 @@ export const renderExtension = (content, layout, options = {}, removeOverflow) =
|
|
|
24
25
|
className: overflowContainerClass
|
|
25
26
|
}, content)));
|
|
26
27
|
};
|
|
27
|
-
|
|
28
28
|
const Extension = props => {
|
|
29
29
|
const {
|
|
30
30
|
text,
|
|
@@ -49,11 +49,10 @@ const Extension = props => {
|
|
|
49
49
|
}
|
|
50
50
|
} catch (e) {
|
|
51
51
|
/** We don't want this error to block renderer */
|
|
52
|
-
|
|
53
52
|
/** We keep rendering the default content */
|
|
54
|
-
}
|
|
55
|
-
|
|
53
|
+
}
|
|
56
54
|
|
|
55
|
+
// Always return default content if anything goes wrong
|
|
57
56
|
return renderExtension(text || 'extension', layout, {
|
|
58
57
|
isTopLevel: path.length < 1,
|
|
59
58
|
handleRef,
|
|
@@ -61,7 +60,6 @@ const Extension = props => {
|
|
|
61
60
|
});
|
|
62
61
|
});
|
|
63
62
|
};
|
|
64
|
-
|
|
65
63
|
export default overflowShadow(Extension, {
|
|
66
64
|
overflowSelector: `.${RendererCssClassName.EXTENSION_OVERFLOW_CONTAINER}`
|
|
67
65
|
});
|
|
@@ -3,30 +3,25 @@ import React from 'react';
|
|
|
3
3
|
export class CardErrorBoundary extends React.PureComponent {
|
|
4
4
|
constructor(...args) {
|
|
5
5
|
super(...args);
|
|
6
|
-
|
|
7
6
|
_defineProperty(this, "state", {
|
|
8
7
|
isError: false
|
|
9
8
|
});
|
|
10
|
-
|
|
11
9
|
_defineProperty(this, "onClickFallback", e => {
|
|
12
10
|
const {
|
|
13
11
|
onClick,
|
|
14
12
|
url
|
|
15
13
|
} = this.props;
|
|
16
14
|
e.preventDefault();
|
|
17
|
-
|
|
18
15
|
if (onClick) {
|
|
19
16
|
onClick(e, url);
|
|
20
17
|
}
|
|
21
18
|
});
|
|
22
19
|
}
|
|
23
|
-
|
|
24
20
|
render() {
|
|
25
21
|
if (this.state.isError) {
|
|
26
22
|
const {
|
|
27
23
|
url
|
|
28
24
|
} = this.props;
|
|
29
|
-
|
|
30
25
|
if (url) {
|
|
31
26
|
return /*#__PURE__*/React.createElement("a", {
|
|
32
27
|
href: url,
|
|
@@ -39,14 +34,11 @@ export class CardErrorBoundary extends React.PureComponent {
|
|
|
39
34
|
return /*#__PURE__*/React.createElement(UnsupportedComponent, null);
|
|
40
35
|
}
|
|
41
36
|
}
|
|
42
|
-
|
|
43
37
|
return this.props.children;
|
|
44
38
|
}
|
|
45
|
-
|
|
46
39
|
componentDidCatch(_error) {
|
|
47
40
|
this.setState({
|
|
48
41
|
isError: true
|
|
49
42
|
});
|
|
50
43
|
}
|
|
51
|
-
|
|
52
44
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
2
|
const HardBreak = ({
|
|
4
3
|
forceNewLine = false
|
|
5
4
|
}) => {
|
|
@@ -11,8 +10,6 @@ const HardBreak = ({
|
|
|
11
10
|
if (forceNewLine) {
|
|
12
11
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null));
|
|
13
12
|
}
|
|
14
|
-
|
|
15
13
|
return /*#__PURE__*/React.createElement("br", null);
|
|
16
14
|
};
|
|
17
|
-
|
|
18
15
|
export default HardBreak;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
-
|
|
4
3
|
/** @jsx jsx */
|
|
5
4
|
import React from 'react';
|
|
6
5
|
import { css, jsx } from '@emotion/react';
|
|
@@ -29,16 +28,13 @@ const copyAnchorButtonStyles = css`
|
|
|
29
28
|
cursor: pointer;
|
|
30
29
|
right: 0;
|
|
31
30
|
`;
|
|
32
|
-
|
|
33
31
|
class HeadingAnchor extends React.PureComponent {
|
|
34
32
|
constructor(...args) {
|
|
35
33
|
super(...args);
|
|
36
|
-
|
|
37
34
|
_defineProperty(this, "state", {
|
|
38
35
|
tooltipMessage: '',
|
|
39
36
|
isClicked: false
|
|
40
37
|
});
|
|
41
|
-
|
|
42
38
|
_defineProperty(this, "setTooltipState", (message, isClicked = false) => {
|
|
43
39
|
this.setState({
|
|
44
40
|
// TODO: ED-14403 investigate why this does not translate
|
|
@@ -46,21 +42,18 @@ class HeadingAnchor extends React.PureComponent {
|
|
|
46
42
|
isClicked
|
|
47
43
|
});
|
|
48
44
|
});
|
|
49
|
-
|
|
50
45
|
_defineProperty(this, "getCopyAriaLabel", () => {
|
|
51
46
|
const {
|
|
52
47
|
copyAriaLabel
|
|
53
48
|
} = headingAnchorLinkMessages;
|
|
54
49
|
return this.props.intl.formatMessage(copyAriaLabel);
|
|
55
50
|
});
|
|
56
|
-
|
|
57
51
|
_defineProperty(this, "copyToClipboard", async event => {
|
|
58
52
|
const {
|
|
59
53
|
copiedHeadingLinkToClipboard,
|
|
60
54
|
failedToCopyHeadingLink
|
|
61
55
|
} = headingAnchorLinkMessages;
|
|
62
56
|
event.stopPropagation();
|
|
63
|
-
|
|
64
57
|
try {
|
|
65
58
|
await this.props.onCopyText();
|
|
66
59
|
this.setTooltipState(copiedHeadingLinkToClipboard, true);
|
|
@@ -68,11 +61,9 @@ class HeadingAnchor extends React.PureComponent {
|
|
|
68
61
|
this.setTooltipState(failedToCopyHeadingLink);
|
|
69
62
|
}
|
|
70
63
|
});
|
|
71
|
-
|
|
72
64
|
_defineProperty(this, "resetMessage", () => {
|
|
73
65
|
this.setTooltipState(headingAnchorLinkMessages.copyHeadingLinkToClipboard);
|
|
74
66
|
});
|
|
75
|
-
|
|
76
67
|
_defineProperty(this, "renderAnchorButton", () => {
|
|
77
68
|
return jsx("button", {
|
|
78
69
|
css: copyAnchorButtonStyles,
|
|
@@ -86,16 +77,13 @@ class HeadingAnchor extends React.PureComponent {
|
|
|
86
77
|
}));
|
|
87
78
|
});
|
|
88
79
|
}
|
|
89
|
-
|
|
90
80
|
componentDidMount() {
|
|
91
81
|
this.resetMessage();
|
|
92
82
|
}
|
|
93
|
-
|
|
94
83
|
render() {
|
|
95
84
|
const {
|
|
96
85
|
tooltipMessage
|
|
97
86
|
} = this.state;
|
|
98
|
-
|
|
99
87
|
if (tooltipMessage) {
|
|
100
88
|
// We set the key to the message to ensure it remounts when the message
|
|
101
89
|
// changes, so that it correctly repositions.
|
|
@@ -108,10 +96,7 @@ class HeadingAnchor extends React.PureComponent {
|
|
|
108
96
|
key: tooltipMessage
|
|
109
97
|
}, this.renderAnchorButton());
|
|
110
98
|
}
|
|
111
|
-
|
|
112
99
|
return this.renderAnchorButton();
|
|
113
100
|
}
|
|
114
|
-
|
|
115
101
|
}
|
|
116
|
-
|
|
117
102
|
export default injectIntl(HeadingAnchor);
|
|
@@ -4,21 +4,17 @@ import HeadingAnchor from './heading-anchor';
|
|
|
4
4
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
import AnalyticsContext from '../../analytics/analyticsContext';
|
|
6
6
|
import { copyTextToClipboard } from '../utils/clipboard';
|
|
7
|
-
|
|
8
7
|
const getCurrentUrlWithHash = (hash = '') => {
|
|
9
8
|
const url = new URL(window.location.href);
|
|
10
9
|
url.hash = encodeURIComponent(hash);
|
|
11
10
|
return url.href;
|
|
12
11
|
};
|
|
13
|
-
|
|
14
12
|
function hasRightAlignmentMark(marks) {
|
|
15
13
|
if (!marks || !marks.length) {
|
|
16
14
|
return false;
|
|
17
15
|
}
|
|
18
|
-
|
|
19
16
|
return marks.some(mark => mark.type.name === 'alignment' && mark.attrs.align === 'end');
|
|
20
17
|
}
|
|
21
|
-
|
|
22
18
|
function WrapChildTextInSpan(children) {
|
|
23
19
|
// We wrap the text in a span so that we can apply CSS pseudo elements
|
|
24
20
|
// to each text node within the heading element.
|
|
@@ -26,7 +22,6 @@ function WrapChildTextInSpan(children) {
|
|
|
26
22
|
return typeof child === 'string' && !/^\s*$/.test(child) ? /*#__PURE__*/React.createElement("span", null, child) : child;
|
|
27
23
|
});
|
|
28
24
|
}
|
|
29
|
-
|
|
30
25
|
function Heading(props) {
|
|
31
26
|
const {
|
|
32
27
|
headingId,
|
|
@@ -58,5 +53,4 @@ function Heading(props) {
|
|
|
58
53
|
}
|
|
59
54
|
}))));
|
|
60
55
|
}
|
|
61
|
-
|
|
62
56
|
export default Heading;
|