@atlaskit/renderer 105.1.1 → 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 +6 -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
package/dist/cjs/ui/MediaCard.js
CHANGED
|
@@ -1,70 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
8
|
exports.getListOfIdentifiersFromDoc = exports.getClipboardAttrs = exports.MediaCardInternal = exports.MediaCard = void 0;
|
|
11
|
-
|
|
12
9
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
13
|
-
|
|
14
10
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
15
|
-
|
|
16
11
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
17
|
-
|
|
18
12
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
19
|
-
|
|
20
13
|
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
21
|
-
|
|
22
14
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
23
|
-
|
|
24
15
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
25
|
-
|
|
26
16
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
27
|
-
|
|
28
17
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
29
|
-
|
|
30
18
|
var _react = _interopRequireWildcard(require("react"));
|
|
31
|
-
|
|
32
19
|
var _traverse = require("@atlaskit/adf-utils/traverse");
|
|
33
|
-
|
|
34
20
|
var _mediaCard = require("@atlaskit/media-card");
|
|
35
|
-
|
|
36
21
|
var _mediaClient = require("@atlaskit/media-client");
|
|
37
|
-
|
|
38
22
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
39
|
-
|
|
40
23
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
41
|
-
|
|
42
24
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
43
|
-
|
|
44
25
|
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; }
|
|
45
|
-
|
|
46
26
|
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) { (0, _defineProperty2.default)(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; }
|
|
47
|
-
|
|
48
27
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
49
|
-
|
|
50
28
|
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; } }
|
|
51
|
-
|
|
52
29
|
var mediaIdentifierMap = new Map();
|
|
53
|
-
|
|
54
30
|
var getListOfIdentifiersFromDoc = function getListOfIdentifiersFromDoc(doc) {
|
|
55
31
|
if (!doc) {
|
|
56
32
|
return [];
|
|
57
33
|
}
|
|
58
|
-
|
|
59
34
|
return (0, _traverse.filter)(doc, function (node) {
|
|
60
35
|
return node.type === 'media';
|
|
61
36
|
}).reduce(function (identifierList, mediaNode) {
|
|
62
37
|
if (mediaNode.attrs) {
|
|
63
38
|
var _mediaNode$attrs = mediaNode.attrs,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
39
|
+
type = _mediaNode$attrs.type,
|
|
40
|
+
dataURI = _mediaNode$attrs.url,
|
|
41
|
+
id = _mediaNode$attrs.id;
|
|
68
42
|
if (type === 'file' && id) {
|
|
69
43
|
identifierList.push({
|
|
70
44
|
mediaItemType: 'file',
|
|
@@ -78,33 +52,24 @@ var getListOfIdentifiersFromDoc = function getListOfIdentifiersFromDoc(doc) {
|
|
|
78
52
|
});
|
|
79
53
|
}
|
|
80
54
|
}
|
|
81
|
-
|
|
82
55
|
return identifierList;
|
|
83
56
|
}, []);
|
|
84
57
|
};
|
|
85
|
-
|
|
86
58
|
exports.getListOfIdentifiersFromDoc = getListOfIdentifiersFromDoc;
|
|
87
|
-
|
|
88
59
|
var MediaCardInternal = /*#__PURE__*/function (_Component) {
|
|
89
60
|
(0, _inherits2.default)(MediaCardInternal, _Component);
|
|
90
|
-
|
|
91
61
|
var _super = _createSuper(MediaCardInternal);
|
|
92
|
-
|
|
93
62
|
function MediaCardInternal() {
|
|
94
63
|
var _this;
|
|
95
|
-
|
|
96
64
|
(0, _classCallCheck2.default)(this, MediaCardInternal);
|
|
97
|
-
|
|
98
65
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
99
66
|
args[_key] = arguments[_key];
|
|
100
67
|
}
|
|
101
|
-
|
|
102
68
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
103
69
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", {});
|
|
104
70
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "saveFileState", /*#__PURE__*/function () {
|
|
105
71
|
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(id, mediaClientConfig) {
|
|
106
72
|
var _this$props, collectionName, featureFlags, mediaClient, options, fileState;
|
|
107
|
-
|
|
108
73
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
109
74
|
while (1) {
|
|
110
75
|
switch (_context.prev = _context.next) {
|
|
@@ -117,21 +82,16 @@ var MediaCardInternal = /*#__PURE__*/function (_Component) {
|
|
|
117
82
|
_context.prev = 3;
|
|
118
83
|
_context.next = 6;
|
|
119
84
|
return mediaClient.file.getCurrentState(id, options);
|
|
120
|
-
|
|
121
85
|
case 6:
|
|
122
86
|
fileState = _context.sent;
|
|
123
|
-
|
|
124
87
|
_this.setState({
|
|
125
88
|
fileState: fileState
|
|
126
89
|
});
|
|
127
|
-
|
|
128
90
|
_context.next = 12;
|
|
129
91
|
break;
|
|
130
|
-
|
|
131
92
|
case 10:
|
|
132
93
|
_context.prev = 10;
|
|
133
94
|
_context.t0 = _context["catch"](3);
|
|
134
|
-
|
|
135
95
|
case 12:
|
|
136
96
|
case "end":
|
|
137
97
|
return _context.stop();
|
|
@@ -139,7 +99,6 @@ var MediaCardInternal = /*#__PURE__*/function (_Component) {
|
|
|
139
99
|
}
|
|
140
100
|
}, _callee, null, [[3, 10]]);
|
|
141
101
|
}));
|
|
142
|
-
|
|
143
102
|
return function (_x, _x2) {
|
|
144
103
|
return _ref.apply(this, arguments);
|
|
145
104
|
};
|
|
@@ -152,69 +111,55 @@ var MediaCardInternal = /*#__PURE__*/function (_Component) {
|
|
|
152
111
|
});
|
|
153
112
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getOnCardClickCallback", function (isInlinePlayer) {
|
|
154
113
|
var eventHandlers = _this.props.eventHandlers;
|
|
155
|
-
|
|
156
114
|
if (eventHandlers && eventHandlers.media && eventHandlers.media.onClick) {
|
|
157
115
|
return function (result, analyticsEvent) {
|
|
158
116
|
var isVideo = result.mediaItemDetails && result.mediaItemDetails.mediaType === 'video';
|
|
159
117
|
var isVideoWithInlinePlayer = isInlinePlayer && isVideo;
|
|
160
|
-
|
|
161
118
|
if (!isVideoWithInlinePlayer && eventHandlers && eventHandlers.media && eventHandlers.media.onClick) {
|
|
162
119
|
eventHandlers.media.onClick(result, analyticsEvent);
|
|
163
120
|
}
|
|
164
121
|
};
|
|
165
122
|
}
|
|
166
|
-
|
|
167
123
|
return undefined;
|
|
168
124
|
});
|
|
169
125
|
return _this;
|
|
170
126
|
}
|
|
171
|
-
|
|
172
127
|
(0, _createClass2.default)(MediaCardInternal, [{
|
|
173
128
|
key: "componentDidMount",
|
|
174
129
|
value: function () {
|
|
175
130
|
var _componentDidMount = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
176
131
|
var _this$props2, rendererContext, mediaProvider, contextIdentifierProvider, id, url, collectionName, mediaProviderObject, mediaClientConfig, nodeIsInCache;
|
|
177
|
-
|
|
178
132
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
179
133
|
while (1) {
|
|
180
134
|
switch (_context2.prev = _context2.next) {
|
|
181
135
|
case 0:
|
|
182
136
|
_this$props2 = this.props, rendererContext = _this$props2.rendererContext, mediaProvider = _this$props2.mediaProvider, contextIdentifierProvider = _this$props2.contextIdentifierProvider, id = _this$props2.id, url = _this$props2.url, collectionName = _this$props2.collection;
|
|
183
|
-
|
|
184
137
|
if (mediaProvider) {
|
|
185
138
|
_context2.next = 3;
|
|
186
139
|
break;
|
|
187
140
|
}
|
|
188
|
-
|
|
189
141
|
return _context2.abrupt("return");
|
|
190
|
-
|
|
191
142
|
case 3:
|
|
192
143
|
if (!contextIdentifierProvider) {
|
|
193
144
|
_context2.next = 10;
|
|
194
145
|
break;
|
|
195
146
|
}
|
|
196
|
-
|
|
197
147
|
_context2.t0 = this;
|
|
198
148
|
_context2.next = 7;
|
|
199
149
|
return contextIdentifierProvider;
|
|
200
|
-
|
|
201
150
|
case 7:
|
|
202
151
|
_context2.t1 = _context2.sent;
|
|
203
152
|
_context2.t2 = {
|
|
204
153
|
contextIdentifierProvider: _context2.t1
|
|
205
154
|
};
|
|
206
|
-
|
|
207
155
|
_context2.t0.setState.call(_context2.t0, _context2.t2);
|
|
208
|
-
|
|
209
156
|
case 10:
|
|
210
157
|
_context2.next = 12;
|
|
211
158
|
return mediaProvider;
|
|
212
|
-
|
|
213
159
|
case 12:
|
|
214
160
|
mediaProviderObject = _context2.sent;
|
|
215
161
|
mediaClientConfig = mediaProviderObject.viewMediaClientConfig;
|
|
216
162
|
nodeIsInCache = id && mediaIdentifierMap.has(id) || url && mediaIdentifierMap.has(url);
|
|
217
|
-
|
|
218
163
|
if (rendererContext && rendererContext.adDoc && !nodeIsInCache) {
|
|
219
164
|
getListOfIdentifiersFromDoc(rendererContext.adDoc).forEach(function (identifier) {
|
|
220
165
|
if (identifier.mediaItemType === 'file' && identifier.id === id) {
|
|
@@ -226,15 +171,12 @@ var MediaCardInternal = /*#__PURE__*/function (_Component) {
|
|
|
226
171
|
}
|
|
227
172
|
});
|
|
228
173
|
}
|
|
229
|
-
|
|
230
174
|
this.setState({
|
|
231
175
|
mediaClientConfig: mediaClientConfig
|
|
232
176
|
});
|
|
233
|
-
|
|
234
177
|
if (id) {
|
|
235
178
|
this.saveFileState(id, mediaClientConfig);
|
|
236
179
|
}
|
|
237
|
-
|
|
238
180
|
case 18:
|
|
239
181
|
case "end":
|
|
240
182
|
return _context2.stop();
|
|
@@ -242,11 +184,9 @@ var MediaCardInternal = /*#__PURE__*/function (_Component) {
|
|
|
242
184
|
}
|
|
243
185
|
}, _callee2, this);
|
|
244
186
|
}));
|
|
245
|
-
|
|
246
187
|
function componentDidMount() {
|
|
247
188
|
return _componentDidMount.apply(this, arguments);
|
|
248
189
|
}
|
|
249
|
-
|
|
250
190
|
return componentDidMount;
|
|
251
191
|
}()
|
|
252
192
|
}, {
|
|
@@ -254,7 +194,6 @@ var MediaCardInternal = /*#__PURE__*/function (_Component) {
|
|
|
254
194
|
value: function UNSAFE_componentWillReceiveProps(newProps) {
|
|
255
195
|
var mediaClientConfig = this.state.mediaClientConfig;
|
|
256
196
|
var newId = newProps.id;
|
|
257
|
-
|
|
258
197
|
if (mediaClientConfig && newId && newId !== this.props.id) {
|
|
259
198
|
this.saveFileState(newId, mediaClientConfig);
|
|
260
199
|
}
|
|
@@ -263,9 +202,8 @@ var MediaCardInternal = /*#__PURE__*/function (_Component) {
|
|
|
263
202
|
key: "componentWillUnmount",
|
|
264
203
|
value: function componentWillUnmount() {
|
|
265
204
|
var _this$props3 = this.props,
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
205
|
+
id = _this$props3.id,
|
|
206
|
+
dataURI = _this$props3.url;
|
|
269
207
|
if (id) {
|
|
270
208
|
mediaIdentifierMap.delete(id);
|
|
271
209
|
} else if (dataURI) {
|
|
@@ -277,26 +215,25 @@ var MediaCardInternal = /*#__PURE__*/function (_Component) {
|
|
|
277
215
|
value: function renderExternal(shouldOpenMediaViewer) {
|
|
278
216
|
var mediaClientConfig = this.state.mediaClientConfig;
|
|
279
217
|
var _this$props4 = this.props,
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
218
|
+
cardDimensions = _this$props4.cardDimensions,
|
|
219
|
+
resizeMode = _this$props4.resizeMode,
|
|
220
|
+
appearance = _this$props4.appearance,
|
|
221
|
+
url = _this$props4.url,
|
|
222
|
+
imageStatus = _this$props4.imageStatus,
|
|
223
|
+
disableOverlay = _this$props4.disableOverlay,
|
|
224
|
+
alt = _this$props4.alt,
|
|
225
|
+
featureFlags = _this$props4.featureFlags,
|
|
226
|
+
ssr = _this$props4.ssr;
|
|
290
227
|
if (imageStatus === 'loading' || !url) {
|
|
291
228
|
return this.renderLoadingCard();
|
|
292
229
|
}
|
|
293
|
-
|
|
294
230
|
var identifier = {
|
|
295
231
|
dataURI: url,
|
|
296
232
|
name: url,
|
|
297
233
|
mediaItemType: 'external-image'
|
|
298
234
|
};
|
|
299
|
-
return /*#__PURE__*/_react.default.createElement(_mediaCard.Card
|
|
235
|
+
return /*#__PURE__*/_react.default.createElement(_mediaCard.Card
|
|
236
|
+
// TODO MPT-315: clean up after we move mediaClientConfig into FileIdentifier
|
|
300
237
|
// context is not really used when the type is external and we want to render the component asap
|
|
301
238
|
, {
|
|
302
239
|
mediaClientConfig: mediaClientConfig,
|
|
@@ -314,62 +251,56 @@ var MediaCardInternal = /*#__PURE__*/function (_Component) {
|
|
|
314
251
|
ssr: ssr === null || ssr === void 0 ? void 0 : ssr.mode
|
|
315
252
|
});
|
|
316
253
|
}
|
|
254
|
+
|
|
317
255
|
/**
|
|
318
256
|
* We want to call provided `eventHandlers.media.onClick` when it's provided,
|
|
319
257
|
* but we also don't want to call it when it's a video and inline video player is enabled.
|
|
320
258
|
* This is due to consumers normally process this onClick call by opening media viewer and
|
|
321
259
|
* we don't want that to happened described above text.
|
|
322
260
|
*/
|
|
323
|
-
|
|
324
261
|
}, {
|
|
325
262
|
key: "render",
|
|
326
263
|
value: function render() {
|
|
327
264
|
var _this$state = this.state,
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
265
|
+
contextIdentifierProvider = _this$state.contextIdentifierProvider,
|
|
266
|
+
mediaClientConfigInState = _this$state.mediaClientConfig,
|
|
267
|
+
fileState = _this$state.fileState;
|
|
331
268
|
var _this$props5 = this.props,
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
269
|
+
id = _this$props5.id,
|
|
270
|
+
alt = _this$props5.alt,
|
|
271
|
+
type = _this$props5.type,
|
|
272
|
+
collection = _this$props5.collection,
|
|
273
|
+
occurrenceKey = _this$props5.occurrenceKey,
|
|
274
|
+
cardDimensions = _this$props5.cardDimensions,
|
|
275
|
+
resizeMode = _this$props5.resizeMode,
|
|
276
|
+
rendererAppearance = _this$props5.rendererAppearance,
|
|
277
|
+
disableOverlay = _this$props5.disableOverlay,
|
|
278
|
+
useInlinePlayer = _this$props5.useInlinePlayer,
|
|
279
|
+
originalDimensions = _this$props5.originalDimensions,
|
|
280
|
+
forceOpenMediaViewer = _this$props5.shouldOpenMediaViewer,
|
|
281
|
+
featureFlags = _this$props5.featureFlags,
|
|
282
|
+
shouldEnableDownloadButton = _this$props5.shouldEnableDownloadButton,
|
|
283
|
+
ssr = _this$props5.ssr;
|
|
347
284
|
var isMobile = rendererAppearance === 'mobile';
|
|
348
285
|
var shouldPlayInline = useInlinePlayer !== undefined ? useInlinePlayer : true;
|
|
349
286
|
var isInlinePlayer = isMobile ? false : shouldPlayInline;
|
|
350
287
|
var onCardClick = this.getOnCardClickCallback(isInlinePlayer);
|
|
351
288
|
var shouldOpenMediaViewer = typeof forceOpenMediaViewer === 'boolean' ? forceOpenMediaViewer : !isMobile && !onCardClick;
|
|
352
|
-
|
|
353
289
|
if (type === 'external') {
|
|
354
290
|
return this.renderExternal(shouldOpenMediaViewer);
|
|
355
291
|
}
|
|
356
|
-
|
|
357
292
|
if (type === 'link') {
|
|
358
293
|
return null;
|
|
359
294
|
}
|
|
360
|
-
|
|
361
295
|
var mediaClientConfig = !!ssr ? ssr.config : mediaClientConfigInState;
|
|
362
|
-
|
|
363
296
|
if (!mediaClientConfig || !id) {
|
|
364
297
|
return this.renderLoadingCard();
|
|
365
298
|
}
|
|
366
|
-
|
|
367
299
|
if (!id || type !== 'file') {
|
|
368
300
|
return /*#__PURE__*/_react.default.createElement(_mediaCard.CardError, {
|
|
369
301
|
dimensions: cardDimensions
|
|
370
302
|
});
|
|
371
303
|
}
|
|
372
|
-
|
|
373
304
|
var contextId = contextIdentifierProvider && contextIdentifierProvider.objectId;
|
|
374
305
|
var identifier = {
|
|
375
306
|
id: id,
|
|
@@ -408,31 +339,25 @@ var MediaCardInternal = /*#__PURE__*/function (_Component) {
|
|
|
408
339
|
}]);
|
|
409
340
|
return MediaCardInternal;
|
|
410
341
|
}(_react.Component); // Needed for copy & paste
|
|
411
|
-
|
|
412
|
-
|
|
413
342
|
exports.MediaCardInternal = MediaCardInternal;
|
|
414
|
-
|
|
415
343
|
var getClipboardAttrs = function getClipboardAttrs(_ref2) {
|
|
416
344
|
var id = _ref2.id,
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
345
|
+
alt = _ref2.alt,
|
|
346
|
+
collection = _ref2.collection,
|
|
347
|
+
contextIdentifierProvider = _ref2.contextIdentifierProvider,
|
|
348
|
+
originalDimensions = _ref2.originalDimensions,
|
|
349
|
+
fileState = _ref2.fileState;
|
|
422
350
|
var contextId = contextIdentifierProvider && contextIdentifierProvider.objectId;
|
|
423
351
|
var width = originalDimensions && originalDimensions.width;
|
|
424
352
|
var height = originalDimensions && originalDimensions.height;
|
|
425
353
|
var fileName = 'file'; // default name is needed for Confluence
|
|
426
|
-
|
|
427
354
|
var fileSize = 1;
|
|
428
355
|
var fileMimeType = '';
|
|
429
|
-
|
|
430
356
|
if (fileState && fileState.status !== 'error') {
|
|
431
357
|
fileSize = fileState.size;
|
|
432
358
|
fileName = fileState.name;
|
|
433
359
|
fileMimeType = fileState.mimeType;
|
|
434
360
|
}
|
|
435
|
-
|
|
436
361
|
return {
|
|
437
362
|
'data-context-id': contextId,
|
|
438
363
|
'data-type': 'file',
|
|
@@ -447,7 +372,6 @@ var getClipboardAttrs = function getClipboardAttrs(_ref2) {
|
|
|
447
372
|
'data-alt': alt
|
|
448
373
|
};
|
|
449
374
|
};
|
|
450
|
-
|
|
451
375
|
exports.getClipboardAttrs = getClipboardAttrs;
|
|
452
376
|
var MediaCard = (0, _utils.withImageLoader)(MediaCardInternal);
|
|
453
377
|
exports.MediaCard = MediaCard;
|
|
@@ -1,64 +1,42 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.ErrorBoundary = void 0;
|
|
9
|
-
|
|
10
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
|
|
12
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
-
|
|
14
10
|
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
15
|
-
|
|
16
11
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
17
|
-
|
|
18
12
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
19
|
-
|
|
20
13
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
21
|
-
|
|
22
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
23
|
-
|
|
24
15
|
var _react = _interopRequireDefault(require("react"));
|
|
25
|
-
|
|
26
16
|
var _events = require("../../analytics/events");
|
|
27
|
-
|
|
28
17
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
29
|
-
|
|
30
18
|
var _analyticsListeners = require("@atlaskit/analytics-listeners");
|
|
31
|
-
|
|
32
19
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
33
|
-
|
|
34
20
|
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; } }
|
|
35
|
-
|
|
36
21
|
var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
37
22
|
(0, _inherits2.default)(ErrorBoundary, _React$Component);
|
|
38
|
-
|
|
39
23
|
var _super = _createSuper(ErrorBoundary);
|
|
40
|
-
|
|
41
24
|
function ErrorBoundary() {
|
|
42
25
|
var _this;
|
|
43
|
-
|
|
44
26
|
(0, _classCallCheck2.default)(this, ErrorBoundary);
|
|
45
|
-
|
|
46
27
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
47
28
|
args[_key] = arguments[_key];
|
|
48
29
|
}
|
|
49
|
-
|
|
50
30
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
51
31
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", {
|
|
52
32
|
errorCaptured: false
|
|
53
33
|
});
|
|
54
34
|
return _this;
|
|
55
35
|
}
|
|
56
|
-
|
|
57
36
|
(0, _createClass2.default)(ErrorBoundary, [{
|
|
58
37
|
key: "fireAnalyticsEvent",
|
|
59
38
|
value: function fireAnalyticsEvent(event) {
|
|
60
39
|
var createAnalyticsEvent = this.props.createAnalyticsEvent;
|
|
61
|
-
|
|
62
40
|
if (createAnalyticsEvent) {
|
|
63
41
|
var channel = _analyticsListeners.FabricChannel.editor;
|
|
64
42
|
createAnalyticsEvent(event).fire(channel);
|
|
@@ -78,7 +56,6 @@ var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
|
78
56
|
key: "componentDidCatch",
|
|
79
57
|
value: function componentDidCatch(error, errorInfo) {
|
|
80
58
|
var _this2 = this;
|
|
81
|
-
|
|
82
59
|
this.fireAnalyticsEvent({
|
|
83
60
|
action: _analytics.ACTION.CRASHED,
|
|
84
61
|
actionSubject: this.props.component,
|
|
@@ -92,7 +69,6 @@ var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
|
92
69
|
errorRethrown: Boolean(this.props.rethrowError)
|
|
93
70
|
}
|
|
94
71
|
});
|
|
95
|
-
|
|
96
72
|
if (this.hasFallback()) {
|
|
97
73
|
this.setState({
|
|
98
74
|
errorCaptured: true
|
|
@@ -109,11 +85,9 @@ var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
|
109
85
|
if (this.shouldRecover()) {
|
|
110
86
|
return this.props.fallbackComponent;
|
|
111
87
|
}
|
|
112
|
-
|
|
113
88
|
return this.props.children;
|
|
114
89
|
}
|
|
115
90
|
}]);
|
|
116
91
|
return ErrorBoundary;
|
|
117
92
|
}(_react.default.Component);
|
|
118
|
-
|
|
119
93
|
exports.ErrorBoundary = ErrorBoundary;
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.BreakoutSSRInlineScript = BreakoutSSRInlineScript;
|
|
9
8
|
exports.calcLineLength = exports.breakoutInlineScriptContext = void 0;
|
|
10
9
|
exports.createBreakoutInlineScript = createBreakoutInlineScript;
|
|
11
|
-
|
|
12
10
|
var _react = _interopRequireDefault(require("react"));
|
|
13
|
-
|
|
14
11
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
15
|
-
|
|
16
12
|
/**
|
|
17
13
|
* Inline Script that updates breakout node width on client side,
|
|
18
14
|
* before main JavaScript bundle is ready.
|
|
@@ -27,7 +23,6 @@ function BreakoutSSRInlineScript() {
|
|
|
27
23
|
if (typeof window !== 'undefined' && !window.navigator.userAgent.includes('jsdom')) {
|
|
28
24
|
return null;
|
|
29
25
|
}
|
|
30
|
-
|
|
31
26
|
var id = Math.floor(Math.random() * (9999999999 - 9999 + 1)) + 9999;
|
|
32
27
|
var context = createBreakoutInlineScript(id);
|
|
33
28
|
return /*#__PURE__*/_react.default.createElement("script", {
|
|
@@ -37,71 +32,56 @@ function BreakoutSSRInlineScript() {
|
|
|
37
32
|
}
|
|
38
33
|
});
|
|
39
34
|
}
|
|
40
|
-
|
|
41
35
|
function createBreakoutInlineScript(id) {
|
|
42
36
|
return "\n (function(window){\n ".concat(breakoutInlineScriptContext, ";\n (").concat(applyBreakoutAfterSSR.toString(), ")(\"").concat(id, "\", breakoutConsts);\n })(window);\n");
|
|
43
37
|
}
|
|
44
|
-
|
|
45
38
|
var breakoutInlineScriptContext = "\n var breakoutConsts = ".concat(JSON.stringify(_utils.breakoutConsts), ";\n breakoutConsts.mapBreakpointToLayoutMaxWidth = ").concat(_utils.breakoutConsts.mapBreakpointToLayoutMaxWidth.toString(), ";\n breakoutConsts.getBreakpoint = ").concat(_utils.breakoutConsts.getBreakpoint.toString(), ";\n breakoutConsts.calcBreakoutWidth = ").concat(_utils.breakoutConsts.calcBreakoutWidth.toString(), ";\n breakoutConsts.calcLineLength = ").concat(_utils.breakoutConsts.calcLineLength.toString(), ";\n breakoutConsts.calcWideWidth = ").concat(_utils.breakoutConsts.calcWideWidth.toString(), ";\n");
|
|
46
39
|
exports.breakoutInlineScriptContext = breakoutInlineScriptContext;
|
|
47
|
-
|
|
48
40
|
function applyBreakoutAfterSSR(id, breakoutConsts) {
|
|
49
41
|
var MEDIA_NODE_TYPE = 'mediaSingle';
|
|
50
42
|
var WIDE_LAYOUT_MODES = ['full-width', 'wide'];
|
|
51
|
-
|
|
52
43
|
function findUp(element, condition) {
|
|
53
44
|
if (!element) {
|
|
54
45
|
return;
|
|
55
46
|
}
|
|
56
|
-
|
|
57
47
|
while (element.parentElement) {
|
|
58
48
|
if (condition(element)) {
|
|
59
49
|
return element.parentElement;
|
|
60
50
|
}
|
|
61
|
-
|
|
62
51
|
element = element.parentElement;
|
|
63
52
|
}
|
|
64
53
|
}
|
|
65
|
-
|
|
66
54
|
var renderer = findUp(document.querySelector('[data-breakout-script-id="' + id + '"]'), function (elem) {
|
|
67
55
|
var _elem$parentElement;
|
|
68
|
-
|
|
69
56
|
return !!((_elem$parentElement = elem.parentElement) !== null && _elem$parentElement !== void 0 && _elem$parentElement.classList.contains('ak-renderer-wrapper'));
|
|
70
57
|
});
|
|
71
|
-
|
|
72
58
|
if (!renderer) {
|
|
73
59
|
return;
|
|
74
60
|
}
|
|
75
|
-
|
|
76
61
|
var observer = new MutationObserver(function (mutationsList) {
|
|
77
62
|
mutationsList.forEach(function (item) {
|
|
78
63
|
if (item.target.nodeType !== Node.ELEMENT_NODE) {
|
|
79
64
|
return;
|
|
80
65
|
}
|
|
81
|
-
|
|
82
66
|
if (item.target.classList.contains('ak-renderer-document')) {
|
|
83
67
|
item.addedNodes.forEach(function (maybeNode) {
|
|
84
68
|
var node = maybeNode;
|
|
85
69
|
var mode = node.dataset.mode || node.dataset.layout || '';
|
|
86
|
-
|
|
87
70
|
if (!mode || !WIDE_LAYOUT_MODES.includes(mode)) {
|
|
88
71
|
return;
|
|
89
72
|
}
|
|
90
|
-
|
|
91
73
|
var width = breakoutConsts.calcBreakoutWidth(mode, renderer.offsetWidth);
|
|
92
|
-
|
|
93
74
|
if (node.style.width === width) {
|
|
94
75
|
return;
|
|
95
76
|
}
|
|
77
|
+
node.style.width = width;
|
|
96
78
|
|
|
97
|
-
|
|
79
|
+
// Tables require some special logic, as they are not using common css transform approach,
|
|
98
80
|
// because it breaks with sticky headers. This logic is copied from a table node:
|
|
99
81
|
// https://bitbucket.org/atlassian/atlassian-frontend/src/77938aee0c140d02ff99b98a03849be1236865b4/packages/editor/renderer/src/react/nodes/table.tsx#table.tsx-235:245
|
|
100
|
-
|
|
101
82
|
if (node.classList.contains('pm-table-container')) {
|
|
102
83
|
var lineLength = breakoutConsts.calcLineLength();
|
|
103
84
|
var left = lineLength / 2 - parseInt(width) / 2;
|
|
104
|
-
|
|
105
85
|
if (left < 0) {
|
|
106
86
|
node.style.left = left + 'px';
|
|
107
87
|
}
|
|
@@ -120,36 +100,33 @@ function applyBreakoutAfterSSR(id, breakoutConsts) {
|
|
|
120
100
|
}
|
|
121
101
|
});
|
|
122
102
|
});
|
|
123
|
-
|
|
124
103
|
var applyMediaBreakout = function applyMediaBreakout(card) {
|
|
125
104
|
// width was already set by another breakout script
|
|
126
105
|
if (card.style.width) {
|
|
127
106
|
return;
|
|
128
107
|
}
|
|
129
|
-
|
|
130
108
|
var tableParent = findUp(card, function (elem) {
|
|
131
109
|
return elem instanceof HTMLTableCellElement;
|
|
132
|
-
});
|
|
133
|
-
// table sizing is not based on percentage width
|
|
110
|
+
});
|
|
134
111
|
|
|
112
|
+
// only apply the breakout to media elements not nested inside table
|
|
113
|
+
// table sizing is not based on percentage width
|
|
135
114
|
if (tableParent) {
|
|
136
115
|
return;
|
|
137
116
|
}
|
|
138
|
-
|
|
139
117
|
var mode = card.dataset.mode || card.dataset.layout || '';
|
|
140
118
|
var width = card.dataset.width;
|
|
141
|
-
|
|
142
119
|
if (WIDE_LAYOUT_MODES.includes(mode)) {
|
|
143
120
|
card.style.width = '100%';
|
|
144
121
|
} else if (width) {
|
|
145
122
|
card.style.width = "".concat(width, "%");
|
|
146
123
|
}
|
|
147
124
|
};
|
|
148
|
-
|
|
149
125
|
observer.observe(renderer, {
|
|
150
126
|
childList: true,
|
|
151
127
|
subtree: true
|
|
152
128
|
});
|
|
129
|
+
|
|
153
130
|
/**
|
|
154
131
|
* Using window load event to unsubscribe from mutation observer, as at this stage document is fully rendered.
|
|
155
132
|
* Experiment with DOMContentLoaded showed that some of the blocks were not processed at all.
|
|
@@ -160,14 +137,11 @@ function applyBreakoutAfterSSR(id, breakoutConsts) {
|
|
|
160
137
|
* – https://developer.mozilla.org/en-US/docs/Web/API/Window/load_event
|
|
161
138
|
* – https://developer.mozilla.org/en-US/docs/Web/API/Document/DOMContentLoaded_event
|
|
162
139
|
*/
|
|
163
|
-
|
|
164
140
|
var disconnect = function disconnect() {
|
|
165
141
|
observer.disconnect();
|
|
166
142
|
window.removeEventListener('load', disconnect);
|
|
167
143
|
};
|
|
168
|
-
|
|
169
144
|
window.addEventListener('load', disconnect);
|
|
170
145
|
}
|
|
171
|
-
|
|
172
146
|
var calcLineLength = _utils.breakoutConsts.calcLineLength;
|
|
173
147
|
exports.calcLineLength = calcLineLength;
|