@atlaskit/renderer 105.1.1 → 106.0.0
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 +7 -7
|
@@ -5,43 +5,31 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
5
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
|
|
9
8
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
-
|
|
11
9
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
|
-
|
|
13
10
|
import React from 'react';
|
|
14
11
|
import { PLATFORM } from '../../analytics/events';
|
|
15
12
|
import { ACTION, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
16
13
|
import { FabricChannel } from '@atlaskit/analytics-listeners';
|
|
17
14
|
export var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
18
15
|
_inherits(ErrorBoundary, _React$Component);
|
|
19
|
-
|
|
20
16
|
var _super = _createSuper(ErrorBoundary);
|
|
21
|
-
|
|
22
17
|
function ErrorBoundary() {
|
|
23
18
|
var _this;
|
|
24
|
-
|
|
25
19
|
_classCallCheck(this, ErrorBoundary);
|
|
26
|
-
|
|
27
20
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
28
21
|
args[_key] = arguments[_key];
|
|
29
22
|
}
|
|
30
|
-
|
|
31
23
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
32
|
-
|
|
33
24
|
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
34
25
|
errorCaptured: false
|
|
35
26
|
});
|
|
36
|
-
|
|
37
27
|
return _this;
|
|
38
28
|
}
|
|
39
|
-
|
|
40
29
|
_createClass(ErrorBoundary, [{
|
|
41
30
|
key: "fireAnalyticsEvent",
|
|
42
31
|
value: function fireAnalyticsEvent(event) {
|
|
43
32
|
var createAnalyticsEvent = this.props.createAnalyticsEvent;
|
|
44
|
-
|
|
45
33
|
if (createAnalyticsEvent) {
|
|
46
34
|
var channel = FabricChannel.editor;
|
|
47
35
|
createAnalyticsEvent(event).fire(channel);
|
|
@@ -61,7 +49,6 @@ export var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
|
61
49
|
key: "componentDidCatch",
|
|
62
50
|
value: function componentDidCatch(error, errorInfo) {
|
|
63
51
|
var _this2 = this;
|
|
64
|
-
|
|
65
52
|
this.fireAnalyticsEvent({
|
|
66
53
|
action: ACTION.CRASHED,
|
|
67
54
|
actionSubject: this.props.component,
|
|
@@ -75,7 +62,6 @@ export var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
|
75
62
|
errorRethrown: Boolean(this.props.rethrowError)
|
|
76
63
|
}
|
|
77
64
|
});
|
|
78
|
-
|
|
79
65
|
if (this.hasFallback()) {
|
|
80
66
|
this.setState({
|
|
81
67
|
errorCaptured: true
|
|
@@ -92,10 +78,8 @@ export var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
|
92
78
|
if (this.shouldRecover()) {
|
|
93
79
|
return this.props.fallbackComponent;
|
|
94
80
|
}
|
|
95
|
-
|
|
96
81
|
return this.props.children;
|
|
97
82
|
}
|
|
98
83
|
}]);
|
|
99
|
-
|
|
100
84
|
return ErrorBoundary;
|
|
101
85
|
}(React.Component);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { breakoutConsts } from '@atlaskit/editor-common/utils';
|
|
3
|
+
|
|
3
4
|
/**
|
|
4
5
|
* Inline Script that updates breakout node width on client side,
|
|
5
6
|
* before main JavaScript bundle is ready.
|
|
6
7
|
*
|
|
7
8
|
* More info: https://product-fabric.atlassian.net/wiki/spaces/E/pages/1216218119/Renderer+SSR+for+Breakout+Nodes
|
|
8
9
|
*/
|
|
9
|
-
|
|
10
10
|
export function BreakoutSSRInlineScript() {
|
|
11
11
|
/**
|
|
12
12
|
* Should only inline this script while SSR,
|
|
@@ -15,7 +15,6 @@ export function BreakoutSSRInlineScript() {
|
|
|
15
15
|
if (typeof window !== 'undefined' && !window.navigator.userAgent.includes('jsdom')) {
|
|
16
16
|
return null;
|
|
17
17
|
}
|
|
18
|
-
|
|
19
18
|
var id = Math.floor(Math.random() * (9999999999 - 9999 + 1)) + 9999;
|
|
20
19
|
var context = createBreakoutInlineScript(id);
|
|
21
20
|
return /*#__PURE__*/React.createElement("script", {
|
|
@@ -29,64 +28,51 @@ export function createBreakoutInlineScript(id) {
|
|
|
29
28
|
return "\n (function(window){\n ".concat(breakoutInlineScriptContext, ";\n (").concat(applyBreakoutAfterSSR.toString(), ")(\"").concat(id, "\", breakoutConsts);\n })(window);\n");
|
|
30
29
|
}
|
|
31
30
|
export var breakoutInlineScriptContext = "\n var breakoutConsts = ".concat(JSON.stringify(breakoutConsts), ";\n breakoutConsts.mapBreakpointToLayoutMaxWidth = ").concat(breakoutConsts.mapBreakpointToLayoutMaxWidth.toString(), ";\n breakoutConsts.getBreakpoint = ").concat(breakoutConsts.getBreakpoint.toString(), ";\n breakoutConsts.calcBreakoutWidth = ").concat(breakoutConsts.calcBreakoutWidth.toString(), ";\n breakoutConsts.calcLineLength = ").concat(breakoutConsts.calcLineLength.toString(), ";\n breakoutConsts.calcWideWidth = ").concat(breakoutConsts.calcWideWidth.toString(), ";\n");
|
|
32
|
-
|
|
33
31
|
function applyBreakoutAfterSSR(id, breakoutConsts) {
|
|
34
32
|
var MEDIA_NODE_TYPE = 'mediaSingle';
|
|
35
33
|
var WIDE_LAYOUT_MODES = ['full-width', 'wide'];
|
|
36
|
-
|
|
37
34
|
function findUp(element, condition) {
|
|
38
35
|
if (!element) {
|
|
39
36
|
return;
|
|
40
37
|
}
|
|
41
|
-
|
|
42
38
|
while (element.parentElement) {
|
|
43
39
|
if (condition(element)) {
|
|
44
40
|
return element.parentElement;
|
|
45
41
|
}
|
|
46
|
-
|
|
47
42
|
element = element.parentElement;
|
|
48
43
|
}
|
|
49
44
|
}
|
|
50
|
-
|
|
51
45
|
var renderer = findUp(document.querySelector('[data-breakout-script-id="' + id + '"]'), function (elem) {
|
|
52
46
|
var _elem$parentElement;
|
|
53
|
-
|
|
54
47
|
return !!((_elem$parentElement = elem.parentElement) !== null && _elem$parentElement !== void 0 && _elem$parentElement.classList.contains('ak-renderer-wrapper'));
|
|
55
48
|
});
|
|
56
|
-
|
|
57
49
|
if (!renderer) {
|
|
58
50
|
return;
|
|
59
51
|
}
|
|
60
|
-
|
|
61
52
|
var observer = new MutationObserver(function (mutationsList) {
|
|
62
53
|
mutationsList.forEach(function (item) {
|
|
63
54
|
if (item.target.nodeType !== Node.ELEMENT_NODE) {
|
|
64
55
|
return;
|
|
65
56
|
}
|
|
66
|
-
|
|
67
57
|
if (item.target.classList.contains('ak-renderer-document')) {
|
|
68
58
|
item.addedNodes.forEach(function (maybeNode) {
|
|
69
59
|
var node = maybeNode;
|
|
70
60
|
var mode = node.dataset.mode || node.dataset.layout || '';
|
|
71
|
-
|
|
72
61
|
if (!mode || !WIDE_LAYOUT_MODES.includes(mode)) {
|
|
73
62
|
return;
|
|
74
63
|
}
|
|
75
|
-
|
|
76
64
|
var width = breakoutConsts.calcBreakoutWidth(mode, renderer.offsetWidth);
|
|
77
|
-
|
|
78
65
|
if (node.style.width === width) {
|
|
79
66
|
return;
|
|
80
67
|
}
|
|
68
|
+
node.style.width = width;
|
|
81
69
|
|
|
82
|
-
|
|
70
|
+
// Tables require some special logic, as they are not using common css transform approach,
|
|
83
71
|
// because it breaks with sticky headers. This logic is copied from a table node:
|
|
84
72
|
// https://bitbucket.org/atlassian/atlassian-frontend/src/77938aee0c140d02ff99b98a03849be1236865b4/packages/editor/renderer/src/react/nodes/table.tsx#table.tsx-235:245
|
|
85
|
-
|
|
86
73
|
if (node.classList.contains('pm-table-container')) {
|
|
87
74
|
var lineLength = breakoutConsts.calcLineLength();
|
|
88
75
|
var left = lineLength / 2 - parseInt(width) / 2;
|
|
89
|
-
|
|
90
76
|
if (left < 0) {
|
|
91
77
|
node.style.left = left + 'px';
|
|
92
78
|
}
|
|
@@ -105,36 +91,33 @@ function applyBreakoutAfterSSR(id, breakoutConsts) {
|
|
|
105
91
|
}
|
|
106
92
|
});
|
|
107
93
|
});
|
|
108
|
-
|
|
109
94
|
var applyMediaBreakout = function applyMediaBreakout(card) {
|
|
110
95
|
// width was already set by another breakout script
|
|
111
96
|
if (card.style.width) {
|
|
112
97
|
return;
|
|
113
98
|
}
|
|
114
|
-
|
|
115
99
|
var tableParent = findUp(card, function (elem) {
|
|
116
100
|
return elem instanceof HTMLTableCellElement;
|
|
117
|
-
});
|
|
118
|
-
// table sizing is not based on percentage width
|
|
101
|
+
});
|
|
119
102
|
|
|
103
|
+
// only apply the breakout to media elements not nested inside table
|
|
104
|
+
// table sizing is not based on percentage width
|
|
120
105
|
if (tableParent) {
|
|
121
106
|
return;
|
|
122
107
|
}
|
|
123
|
-
|
|
124
108
|
var mode = card.dataset.mode || card.dataset.layout || '';
|
|
125
109
|
var width = card.dataset.width;
|
|
126
|
-
|
|
127
110
|
if (WIDE_LAYOUT_MODES.includes(mode)) {
|
|
128
111
|
card.style.width = '100%';
|
|
129
112
|
} else if (width) {
|
|
130
113
|
card.style.width = "".concat(width, "%");
|
|
131
114
|
}
|
|
132
115
|
};
|
|
133
|
-
|
|
134
116
|
observer.observe(renderer, {
|
|
135
117
|
childList: true,
|
|
136
118
|
subtree: true
|
|
137
119
|
});
|
|
120
|
+
|
|
138
121
|
/**
|
|
139
122
|
* Using window load event to unsubscribe from mutation observer, as at this stage document is fully rendered.
|
|
140
123
|
* Experiment with DOMContentLoaded showed that some of the blocks were not processed at all.
|
|
@@ -145,13 +128,10 @@ function applyBreakoutAfterSSR(id, breakoutConsts) {
|
|
|
145
128
|
* – https://developer.mozilla.org/en-US/docs/Web/API/Window/load_event
|
|
146
129
|
* – https://developer.mozilla.org/en-US/docs/Web/API/Document/DOMContentLoaded_event
|
|
147
130
|
*/
|
|
148
|
-
|
|
149
131
|
var disconnect = function disconnect() {
|
|
150
132
|
observer.disconnect();
|
|
151
133
|
window.removeEventListener('load', disconnect);
|
|
152
134
|
};
|
|
153
|
-
|
|
154
135
|
window.addEventListener('load', disconnect);
|
|
155
136
|
}
|
|
156
|
-
|
|
157
137
|
export var calcLineLength = breakoutConsts.calcLineLength;
|
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
import { fileCardImageViewSelector } from '@atlaskit/media-card/classnames';
|
|
2
2
|
import { mediaViewerPopupClass } from '@atlaskit/media-viewer/classnames';
|
|
3
|
+
|
|
3
4
|
/**
|
|
4
5
|
* Check if an element is interactive (or otherwise if clicking on it shouldn't transition the
|
|
5
6
|
* renderer to the editor in somewhere like the Jira description
|
|
6
7
|
* @param element
|
|
7
8
|
*/
|
|
8
|
-
|
|
9
9
|
export function isInteractiveElement(element) {
|
|
10
10
|
if ('href' in element && element.href != null) {
|
|
11
11
|
return true;
|
|
12
12
|
}
|
|
13
|
-
|
|
14
13
|
if (element.classList.contains(mediaViewerPopupClass)) {
|
|
15
14
|
return true;
|
|
16
15
|
}
|
|
17
|
-
|
|
18
16
|
if (element.classList.contains(fileCardImageViewSelector)) {
|
|
19
17
|
return true;
|
|
20
18
|
}
|
|
21
|
-
|
|
22
19
|
return false;
|
|
23
20
|
}
|
|
@@ -6,15 +6,10 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
6
6
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
7
7
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
-
|
|
10
9
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11
|
-
|
|
12
10
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
13
|
-
|
|
14
11
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
15
|
-
|
|
16
12
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
17
|
-
|
|
18
13
|
/** @jsx jsx */
|
|
19
14
|
import React, { Fragment, useContext, useLayoutEffect, useRef } from 'react';
|
|
20
15
|
import { jsx } from '@emotion/react';
|
|
@@ -50,25 +45,20 @@ import { RenderTracking } from '../../react/utils/performance/RenderTracking';
|
|
|
50
45
|
export var NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
51
46
|
export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
52
47
|
var packageName = "@atlaskit/renderer";
|
|
53
|
-
var packageVersion = "
|
|
48
|
+
var packageVersion = "106.0.0";
|
|
54
49
|
export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
55
50
|
_inherits(Renderer, _PureComponent);
|
|
56
|
-
|
|
57
51
|
var _super = _createSuper(Renderer);
|
|
58
|
-
|
|
59
52
|
/**
|
|
60
53
|
* This is used in measuring the Renderer Mount time and is then
|
|
61
54
|
* deleted once that measurement occurs.
|
|
62
55
|
*/
|
|
56
|
+
|
|
63
57
|
function Renderer(props) {
|
|
64
58
|
var _this;
|
|
65
|
-
|
|
66
59
|
_classCallCheck(this, Renderer);
|
|
67
|
-
|
|
68
60
|
_this = _super.call(this, props);
|
|
69
|
-
|
|
70
61
|
_defineProperty(_assertThisInitialized(_this), "renderedMeasurementDistortedDurationMonitor", getDistortedDurationMonitor());
|
|
71
|
-
|
|
72
62
|
_defineProperty(_assertThisInitialized(_this), "featureFlags", memoizeOne(function (featureFlags) {
|
|
73
63
|
var normalizedFeatureFlags = normalizeFeatureFlags(featureFlags, {
|
|
74
64
|
objectFlagKeys: ['rendererRenderTracking']
|
|
@@ -77,24 +67,19 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
77
67
|
featureFlags: normalizedFeatureFlags
|
|
78
68
|
};
|
|
79
69
|
}));
|
|
80
|
-
|
|
81
70
|
_defineProperty(_assertThisInitialized(_this), "fireAnalyticsEvent", function (event) {
|
|
82
71
|
var createAnalyticsEvent = _this.props.createAnalyticsEvent;
|
|
83
|
-
|
|
84
72
|
if (createAnalyticsEvent) {
|
|
85
73
|
var channel = FabricChannel.editor;
|
|
86
74
|
createAnalyticsEvent(event).fire(channel);
|
|
87
75
|
}
|
|
88
76
|
});
|
|
89
|
-
|
|
90
77
|
_defineProperty(_assertThisInitialized(_this), "getSchema", memoizeOne(function (schema, adfStage) {
|
|
91
78
|
if (schema) {
|
|
92
79
|
return schema;
|
|
93
80
|
}
|
|
94
|
-
|
|
95
81
|
return getSchemaBasedOnStage(adfStage);
|
|
96
82
|
}));
|
|
97
|
-
|
|
98
83
|
_defineProperty(_assertThisInitialized(_this), "onMouseDownEditView", function () {
|
|
99
84
|
// When the user is deselecting text on the screen by clicking, if they are clicking outside
|
|
100
85
|
// the current selection, by the time the onclick handler is called the window.getSelection()
|
|
@@ -103,72 +88,55 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
103
88
|
var windowSelection = window.getSelection();
|
|
104
89
|
_this.mouseDownSelection = windowSelection !== null ? windowSelection.toString() : undefined;
|
|
105
90
|
});
|
|
106
|
-
|
|
107
91
|
_defineProperty(_assertThisInitialized(_this), "handleMouseTripleClickInTables", function (event) {
|
|
108
92
|
var _parentElement, _parentElement2;
|
|
109
|
-
|
|
110
93
|
if (browser.ios || browser.android) {
|
|
111
94
|
return;
|
|
112
95
|
}
|
|
113
|
-
|
|
114
96
|
var badBrowser = browser.chrome || browser.safari;
|
|
115
97
|
var tripleClick = event.detail >= 3;
|
|
116
|
-
|
|
117
98
|
if (!(badBrowser && tripleClick)) {
|
|
118
99
|
return;
|
|
119
100
|
}
|
|
120
|
-
|
|
121
101
|
var selection = window.getSelection();
|
|
122
|
-
|
|
123
102
|
if (!selection) {
|
|
124
103
|
return;
|
|
125
104
|
}
|
|
126
|
-
|
|
127
105
|
var type = selection.type,
|
|
128
|
-
|
|
129
|
-
|
|
106
|
+
anchorNode = selection.anchorNode,
|
|
107
|
+
focusNode = selection.focusNode;
|
|
130
108
|
var rangeSelection = Boolean(type === 'Range' && anchorNode && focusNode);
|
|
131
|
-
|
|
132
109
|
if (!rangeSelection) {
|
|
133
110
|
return;
|
|
134
111
|
}
|
|
135
|
-
|
|
136
112
|
var target = event.target;
|
|
137
113
|
var tableCell = target.closest('td,th');
|
|
138
114
|
var clickedInCell = Boolean(tableCell);
|
|
139
|
-
|
|
140
115
|
if (!clickedInCell) {
|
|
141
116
|
return;
|
|
142
117
|
}
|
|
143
|
-
|
|
144
118
|
var anchorInCell = tableCell.contains(anchorNode);
|
|
145
119
|
var focusInCell = tableCell.contains(focusNode);
|
|
146
120
|
var selectionStartsOrEndsOutsideClickedCell = !(anchorInCell && focusInCell);
|
|
147
|
-
|
|
148
121
|
if (!selectionStartsOrEndsOutsideClickedCell) {
|
|
149
122
|
return;
|
|
150
|
-
}
|
|
123
|
+
}
|
|
124
|
+
// If selection starts or ends in a different cell than the clicked cell,
|
|
151
125
|
// we select the node inside the clicked cell (or if both are in a different
|
|
152
126
|
// cell, we select the cell's contents instead). We want to select the nearest
|
|
153
127
|
// parent block, so that a whole line of text/content is selected (rather than
|
|
154
128
|
// selecting a span that would select one specific chunk of text).
|
|
155
|
-
|
|
156
|
-
|
|
157
129
|
var elementToSelect = anchorInCell ? (_parentElement = anchorNode.parentElement) === null || _parentElement === void 0 ? void 0 : _parentElement.closest('div,p') : focusInCell ? (_parentElement2 = focusNode.parentElement) === null || _parentElement2 === void 0 ? void 0 : _parentElement2.closest('div,p') : tableCell;
|
|
158
|
-
|
|
159
130
|
if (elementToSelect) {
|
|
160
131
|
selection.selectAllChildren(elementToSelect);
|
|
161
132
|
}
|
|
162
133
|
});
|
|
163
|
-
|
|
164
134
|
_this.providerFactory = props.dataProviders || new ProviderFactory();
|
|
165
135
|
_this.serializer = new ReactSerializer(_this.deriveSerializerProps(props));
|
|
166
136
|
_this.editorRef = props.innerRef || /*#__PURE__*/React.createRef();
|
|
167
137
|
_this.id = uuid();
|
|
168
138
|
startMeasure("Renderer Render Time: ".concat(_this.id));
|
|
169
|
-
|
|
170
139
|
var _featureFlags = _this.featureFlags(_this.props.featureFlags).featureFlags;
|
|
171
|
-
|
|
172
140
|
if (_featureFlags !== null && _featureFlags !== void 0 && _featureFlags.rendererTtiTracking) {
|
|
173
141
|
measureTTI(function (tti, ttiFromInvocation, canceled) {
|
|
174
142
|
_this.fireAnalyticsEvent({
|
|
@@ -183,20 +151,17 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
183
151
|
});
|
|
184
152
|
});
|
|
185
153
|
}
|
|
186
|
-
|
|
187
154
|
return _this;
|
|
188
155
|
}
|
|
189
|
-
|
|
190
156
|
_createClass(Renderer, [{
|
|
191
157
|
key: "anchorLinkAnalytics",
|
|
192
158
|
value: function anchorLinkAnalytics() {
|
|
193
159
|
var hash = window.location.hash && decodeURIComponent(window.location.hash.slice(1));
|
|
194
160
|
var disableHeadingIDs = this.props.disableHeadingIDs;
|
|
195
|
-
|
|
196
161
|
if (!disableHeadingIDs && hash && this.editorRef && this.editorRef.current instanceof HTMLElement) {
|
|
197
|
-
var anchorLinkElement = document.getElementById(hash);
|
|
162
|
+
var anchorLinkElement = document.getElementById(hash);
|
|
163
|
+
// We are not use this.editorRef.querySelector here, instead we have this.editorRef.contains
|
|
198
164
|
// because querySelector might fail if there are special characters in hash, and CSS.escape is still experimental.
|
|
199
|
-
|
|
200
165
|
if (anchorLinkElement && this.editorRef.current.contains(anchorLinkElement)) {
|
|
201
166
|
this.fireAnalyticsEvent({
|
|
202
167
|
action: ACTION.VIEWED,
|
|
@@ -214,7 +179,6 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
214
179
|
key: "componentDidMount",
|
|
215
180
|
value: function componentDidMount() {
|
|
216
181
|
var _this2 = this;
|
|
217
|
-
|
|
218
182
|
this.fireAnalyticsEvent({
|
|
219
183
|
action: ACTION.STARTED,
|
|
220
184
|
actionSubject: ACTION_SUBJECT.RENDERER,
|
|
@@ -226,11 +190,9 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
226
190
|
this.rafID = requestAnimationFrame(function () {
|
|
227
191
|
stopMeasure("Renderer Render Time: ".concat(_this2.id), function (duration) {
|
|
228
192
|
var _analyticsEventSeveri, _analyticsEventSeveri2;
|
|
229
|
-
|
|
230
193
|
var analyticsEventSeverityTracking = _this2.props.analyticsEventSeverityTracking;
|
|
231
194
|
var forceSeverityTracking = typeof analyticsEventSeverityTracking === 'undefined' && shouldForceTracking();
|
|
232
195
|
var severity = !!forceSeverityTracking || analyticsEventSeverityTracking !== null && analyticsEventSeverityTracking !== void 0 && analyticsEventSeverityTracking.enabled ? getAnalyticsEventSeverity(duration, (_analyticsEventSeveri = analyticsEventSeverityTracking === null || analyticsEventSeverityTracking === void 0 ? void 0 : analyticsEventSeverityTracking.severityNormalThreshold) !== null && _analyticsEventSeveri !== void 0 ? _analyticsEventSeveri : NORMAL_SEVERITY_THRESHOLD, (_analyticsEventSeveri2 = analyticsEventSeverityTracking === null || analyticsEventSeverityTracking === void 0 ? void 0 : analyticsEventSeverityTracking.severityDegradedThreshold) !== null && _analyticsEventSeveri2 !== void 0 ? _analyticsEventSeveri2 : DEGRADED_SEVERITY_THRESHOLD) : undefined;
|
|
233
|
-
|
|
234
196
|
_this2.fireAnalyticsEvent({
|
|
235
197
|
action: ACTION.RENDERED,
|
|
236
198
|
actionSubject: ACTION_SUBJECT.RENDERER,
|
|
@@ -247,12 +209,9 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
247
209
|
},
|
|
248
210
|
eventType: EVENT_TYPE.OPERATIONAL
|
|
249
211
|
});
|
|
250
|
-
|
|
251
212
|
_this2.renderedMeasurementDistortedDurationMonitor.cleanup();
|
|
252
|
-
|
|
253
213
|
delete _this2.renderedMeasurementDistortedDurationMonitor;
|
|
254
214
|
});
|
|
255
|
-
|
|
256
215
|
_this2.anchorLinkAnalytics();
|
|
257
216
|
});
|
|
258
217
|
}
|
|
@@ -261,7 +220,6 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
261
220
|
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
262
221
|
var nextMedia = nextProps.media || {};
|
|
263
222
|
var media = this.props.media || {};
|
|
264
|
-
|
|
265
223
|
if (nextProps.portal !== this.props.portal || nextProps.appearance !== this.props.appearance || nextProps.stickyHeaders !== this.props.stickyHeaders || nextProps.disableActions !== this.props.disableActions || nextProps.allowCustomPanels !== this.props.allowCustomPanels || nextProps.allowHeadingAnchorLinks !== this.props.allowHeadingAnchorLinks || nextMedia.allowLinking !== media.allowLinking) {
|
|
266
224
|
this.serializer = new ReactSerializer(this.deriveSerializerProps(nextProps));
|
|
267
225
|
}
|
|
@@ -273,10 +231,8 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
273
231
|
var stickyHeaders = props.stickyHeaders ? props.stickyHeaders === true ? {} : props.stickyHeaders : undefined;
|
|
274
232
|
var annotationProvider = props.annotationProvider;
|
|
275
233
|
var allowAnnotationsDraftMode = Boolean(annotationProvider && annotationProvider.inlineComment && annotationProvider.inlineComment.allowDraftMode);
|
|
276
|
-
|
|
277
234
|
var _this$featureFlags = this.featureFlags(props.featureFlags),
|
|
278
|
-
|
|
279
|
-
|
|
235
|
+
featureFlags = _this$featureFlags.featureFlags;
|
|
280
236
|
return {
|
|
281
237
|
providers: this.providerFactory,
|
|
282
238
|
eventHandlers: props.eventHandlers,
|
|
@@ -314,22 +270,21 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
314
270
|
key: "render",
|
|
315
271
|
value: function render() {
|
|
316
272
|
var _this3 = this;
|
|
317
|
-
|
|
318
273
|
var _this$props = this.props,
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
274
|
+
adfDocument = _this$props.document,
|
|
275
|
+
onComplete = _this$props.onComplete,
|
|
276
|
+
onError = _this$props.onError,
|
|
277
|
+
appearance = _this$props.appearance,
|
|
278
|
+
adfStage = _this$props.adfStage,
|
|
279
|
+
truncated = _this$props.truncated,
|
|
280
|
+
maxHeight = _this$props.maxHeight,
|
|
281
|
+
fadeOutHeight = _this$props.fadeOutHeight,
|
|
282
|
+
enableSsrInlineScripts = _this$props.enableSsrInlineScripts,
|
|
283
|
+
allowHeadingAnchorLinks = _this$props.allowHeadingAnchorLinks,
|
|
284
|
+
allowPlaceholderText = _this$props.allowPlaceholderText,
|
|
285
|
+
allowColumnSorting = _this$props.allowColumnSorting,
|
|
286
|
+
allowCopyToClipboard = _this$props.allowCopyToClipboard,
|
|
287
|
+
allowCustomPanels = _this$props.allowCustomPanels;
|
|
333
288
|
var allowNestedHeaderLinks = isNestedHeaderLinksEnabled(allowHeadingAnchorLinks);
|
|
334
289
|
/**
|
|
335
290
|
* Handle clicks inside renderer. If the click isn't on media, in the media picker, or on a
|
|
@@ -337,64 +292,55 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
337
292
|
* renderer out for the editor).
|
|
338
293
|
* @param event Click event anywhere inside renderer
|
|
339
294
|
*/
|
|
340
|
-
|
|
341
295
|
var handleWrapperOnClick = function handleWrapperOnClick(event) {
|
|
342
296
|
var _this3$props$eventHan;
|
|
297
|
+
var targetElement = event.target;
|
|
343
298
|
|
|
344
|
-
|
|
299
|
+
// ED-14862: When a user triple clicks to select a line of content inside a
|
|
345
300
|
// a table cell, but the browser incorrectly moves the selection start or end into
|
|
346
301
|
// a different table cell, we manually set the selection back to within the original
|
|
347
302
|
// table cell the user intended to target
|
|
348
|
-
|
|
349
303
|
_this3.handleMouseTripleClickInTables(event);
|
|
350
|
-
|
|
351
304
|
if (!((_this3$props$eventHan = _this3.props.eventHandlers) !== null && _this3$props$eventHan !== void 0 && _this3$props$eventHan.onUnhandledClick)) {
|
|
352
305
|
return;
|
|
353
306
|
}
|
|
354
|
-
|
|
355
307
|
if (!(targetElement instanceof window.Element)) {
|
|
356
308
|
return;
|
|
357
309
|
}
|
|
310
|
+
var rendererWrapper = event.currentTarget;
|
|
358
311
|
|
|
359
|
-
|
|
360
|
-
|
|
312
|
+
// Check if the click was on an interactive element
|
|
361
313
|
var isInteractiveElementInTree = findInTree(targetElement, rendererWrapper, isInteractiveElement);
|
|
362
|
-
|
|
363
314
|
if (isInteractiveElementInTree) {
|
|
364
315
|
return;
|
|
365
|
-
}
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
// Ensure that selecting text in the renderer doesn't trigger onUnhandledClick
|
|
366
319
|
// This logic originated in jira-frontend:
|
|
367
320
|
// src/packages/issue/issue-view/src/views/field/rich-text/rich-text-inline-edit-view.js
|
|
321
|
+
|
|
368
322
|
// The selection is required to be checked in `onMouseDown` and here. If not here, a new
|
|
369
323
|
// selection isn't reported; if not in `onMouseDown`, a click outside the selection will
|
|
370
324
|
// return an empty selection, which will erroneously fire onUnhandledClick.
|
|
371
|
-
|
|
372
|
-
|
|
373
325
|
var windowSelection = window.getSelection();
|
|
374
326
|
var selection = windowSelection !== null ? windowSelection.toString() : undefined;
|
|
375
327
|
var hasSelection = selection && selection.length !== 0;
|
|
376
328
|
var hasSelectionMouseDown = _this3.mouseDownSelection && _this3.mouseDownSelection.length !== 0;
|
|
377
329
|
var allowEditBasedOnSelection = !hasSelection && !hasSelectionMouseDown;
|
|
378
|
-
|
|
379
330
|
if (allowEditBasedOnSelection) {
|
|
380
331
|
_this3.props.eventHandlers.onUnhandledClick(event);
|
|
381
332
|
}
|
|
382
333
|
};
|
|
383
|
-
|
|
384
334
|
try {
|
|
385
335
|
var _this$featureFlags2, _this$featureFlags2$f, _this$featureFlags2$f2;
|
|
386
|
-
|
|
387
336
|
var schema = this.getSchema(this.props.schema, this.props.adfStage);
|
|
388
|
-
|
|
389
337
|
var _renderDocument = renderDocument(adfDocument, this.serializer, schema, adfStage, this.props.useSpecBasedValidator, this.id, this.fireAnalyticsEvent, this.props.unsupportedContentLevelsTracking, this.props.appearance),
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
338
|
+
result = _renderDocument.result,
|
|
339
|
+
stat = _renderDocument.stat,
|
|
340
|
+
pmDoc = _renderDocument.pmDoc;
|
|
394
341
|
if (onComplete) {
|
|
395
342
|
onComplete(stat);
|
|
396
343
|
}
|
|
397
|
-
|
|
398
344
|
var rendererOutput = jsx(RendererContextProvider, {
|
|
399
345
|
value: this.featureFlags(this.props.featureFlags)
|
|
400
346
|
}, jsx(ActiveHeaderIdProvider, {
|
|
@@ -437,7 +383,6 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
437
383
|
if (onError) {
|
|
438
384
|
onError(e);
|
|
439
385
|
}
|
|
440
|
-
|
|
441
386
|
return jsx(RendererWrapper, {
|
|
442
387
|
appearance: appearance,
|
|
443
388
|
allowCopyToClipboard: allowCopyToClipboard,
|
|
@@ -452,19 +397,17 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
452
397
|
key: "componentWillUnmount",
|
|
453
398
|
value: function componentWillUnmount() {
|
|
454
399
|
var dataProviders = this.props.dataProviders;
|
|
455
|
-
|
|
456
400
|
if (this.rafID) {
|
|
457
401
|
window.cancelAnimationFrame(this.rafID);
|
|
458
|
-
}
|
|
459
|
-
// it's safe to destroy it on Renderer unmount
|
|
460
|
-
|
|
402
|
+
}
|
|
461
403
|
|
|
404
|
+
// if this is the ProviderFactory which was created in constructor
|
|
405
|
+
// it's safe to destroy it on Renderer unmount
|
|
462
406
|
if (!dataProviders) {
|
|
463
407
|
this.providerFactory.destroy();
|
|
464
408
|
}
|
|
465
409
|
}
|
|
466
410
|
}]);
|
|
467
|
-
|
|
468
411
|
return Renderer;
|
|
469
412
|
}(PureComponent);
|
|
470
413
|
var RendererWithAnalytics = /*#__PURE__*/React.memo(function (props) {
|
|
@@ -492,12 +435,12 @@ var RendererWithAnalytics = /*#__PURE__*/React.memo(function (props) {
|
|
|
492
435
|
});
|
|
493
436
|
var RendererWrapper = /*#__PURE__*/React.memo(function (props) {
|
|
494
437
|
var allowColumnSorting = props.allowColumnSorting,
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
438
|
+
allowNestedHeaderLinks = props.allowNestedHeaderLinks,
|
|
439
|
+
innerRef = props.innerRef,
|
|
440
|
+
appearance = props.appearance,
|
|
441
|
+
children = props.children,
|
|
442
|
+
onClick = props.onClick,
|
|
443
|
+
onMouseDown = props.onMouseDown;
|
|
501
444
|
return jsx(WidthProvider, {
|
|
502
445
|
className: "ak-renderer-wrapper"
|
|
503
446
|
}, jsx(BaseTheme, {
|
|
@@ -513,12 +456,11 @@ var RendererWrapper = /*#__PURE__*/React.memo(function (props) {
|
|
|
513
456
|
})
|
|
514
457
|
}, children)));
|
|
515
458
|
});
|
|
516
|
-
|
|
517
459
|
function RendererActionsInternalUpdater(_ref) {
|
|
518
460
|
var children = _ref.children,
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
461
|
+
doc = _ref.doc,
|
|
462
|
+
schema = _ref.schema,
|
|
463
|
+
onAnalyticsEvent = _ref.onAnalyticsEvent;
|
|
522
464
|
var actions = useContext(ActionsContext);
|
|
523
465
|
var rendererRef = useRef(null);
|
|
524
466
|
useLayoutEffect(function () {
|
|
@@ -527,26 +469,22 @@ function RendererActionsInternalUpdater(_ref) {
|
|
|
527
469
|
} else {
|
|
528
470
|
actions._privateUnregisterRenderer();
|
|
529
471
|
}
|
|
530
|
-
|
|
531
472
|
return function () {
|
|
532
473
|
return actions._privateUnregisterRenderer();
|
|
533
474
|
};
|
|
534
475
|
}, [actions, schema, doc, onAnalyticsEvent]);
|
|
535
476
|
return children;
|
|
536
477
|
}
|
|
537
|
-
|
|
538
478
|
var RendererWithAnnotationSelection = function RendererWithAnnotationSelection(props) {
|
|
539
479
|
var allowAnnotations = props.allowAnnotations,
|
|
540
|
-
|
|
480
|
+
adfDocument = props.document;
|
|
541
481
|
var localRef = React.useRef(null);
|
|
542
482
|
var innerRef = props.innerRef || localRef;
|
|
543
|
-
|
|
544
483
|
if (!allowAnnotations) {
|
|
545
484
|
return jsx(RendererWithAnalytics, _extends({
|
|
546
485
|
innerRef: innerRef
|
|
547
486
|
}, props));
|
|
548
487
|
}
|
|
549
|
-
|
|
550
488
|
return jsx(RendererActionsContext, null, jsx(AnnotationsWrapper, {
|
|
551
489
|
rendererRef: innerRef,
|
|
552
490
|
adfDocument: adfDocument,
|
|
@@ -557,5 +495,4 @@ var RendererWithAnnotationSelection = function RendererWithAnnotationSelection(p
|
|
|
557
495
|
featureFlags: props.featureFlags
|
|
558
496
|
}))));
|
|
559
497
|
};
|
|
560
|
-
|
|
561
498
|
export default RendererWithAnnotationSelection;
|