@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/esm/ui/Expand.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
4
|
-
|
|
5
4
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
6
|
-
|
|
7
5
|
/** @jsx jsx */
|
|
8
6
|
import React, { useRef, useCallback, useMemo } from 'react';
|
|
9
7
|
import { css, jsx } from '@emotion/react';
|
|
@@ -19,58 +17,46 @@ import { ActiveHeaderIdConsumer } from './active-header-id-provider';
|
|
|
19
17
|
import _uniqueId from 'lodash/uniqueId';
|
|
20
18
|
import { getPlatform } from '../utils';
|
|
21
19
|
var titleStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n outline: none;\n border: none;\n font-size: ", ";\n line-height: ", ";\n font-weight: normal;\n display: flex;\n flex: 1;\n margin: 0;\n padding: 0 0 0 ", "px;\n text-align: left;\n"])), relativeFontSizeToBase16(fontSize()), akEditorLineHeight, gridSize() / 2);
|
|
22
|
-
|
|
23
20
|
var Container = function Container(props) {
|
|
24
21
|
var paddingBottom = "".concat(props.expanded ? gridSize() : 0, "px");
|
|
25
22
|
var sharedContainerStyles = sharedExpandStyles.containerStyles(props);
|
|
26
|
-
|
|
27
23
|
var styles = function styles(themeProps) {
|
|
28
24
|
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", "\n padding: 0;\n padding-bottom: ", ";\n "])), sharedContainerStyles({
|
|
29
25
|
theme: themeProps
|
|
30
26
|
}), paddingBottom);
|
|
31
27
|
};
|
|
32
|
-
|
|
33
28
|
return jsx("div", _extends({
|
|
34
29
|
css: styles
|
|
35
30
|
}, props), props.children);
|
|
36
31
|
};
|
|
37
|
-
|
|
38
32
|
var TitleContainer = function TitleContainer(props) {
|
|
39
33
|
var paddingBottom = "".concat(!props.expanded ? gridSize() : 0, "px");
|
|
40
|
-
|
|
41
34
|
var styles = function styles(themeProps) {
|
|
42
35
|
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ", "\n padding: ", "px;\n padding-bottom: ", ";\n "])), sharedExpandStyles.titleContainerStyles({
|
|
43
36
|
theme: themeProps
|
|
44
37
|
}), gridSize(), paddingBottom);
|
|
45
38
|
};
|
|
46
|
-
|
|
47
39
|
return jsx("button", _extends({
|
|
48
40
|
css: styles
|
|
49
41
|
}, props), props.children);
|
|
50
42
|
};
|
|
51
|
-
|
|
52
43
|
TitleContainer.displayName = 'TitleContainerButton';
|
|
53
|
-
|
|
54
44
|
var ContentContainer = function ContentContainer(props) {
|
|
55
45
|
var sharedContentStyles = sharedExpandStyles.contentStyles(props);
|
|
56
46
|
var visibility = props.expanded ? 'visible' : 'hidden';
|
|
57
|
-
|
|
58
47
|
var styles = function styles(themeProps) {
|
|
59
48
|
return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n ", ";\n padding-right: ", "px;\n padding-left: ", "px;\n visibility: ", ";\n "])), sharedContentStyles({
|
|
60
49
|
theme: themeProps
|
|
61
50
|
}), gridSize() * 2, gridSize() * 5 - gridSize() / 2, visibility);
|
|
62
51
|
};
|
|
63
|
-
|
|
64
52
|
return jsx("div", _extends({
|
|
65
53
|
css: styles
|
|
66
54
|
}, props), props.children);
|
|
67
55
|
};
|
|
68
|
-
|
|
69
56
|
function fireExpandToggleAnalytics(nodeType, expanded, fireAnalyticsEvent) {
|
|
70
57
|
if (!fireAnalyticsEvent) {
|
|
71
58
|
return;
|
|
72
59
|
}
|
|
73
|
-
|
|
74
60
|
fireAnalyticsEvent({
|
|
75
61
|
action: ACTION.TOGGLE_EXPAND,
|
|
76
62
|
actionSubject: nodeType === 'expand' ? ACTION_SUBJECT.EXPAND : ACTION_SUBJECT.NESTED_EXPAND,
|
|
@@ -82,34 +68,28 @@ function fireExpandToggleAnalytics(nodeType, expanded, fireAnalyticsEvent) {
|
|
|
82
68
|
eventType: EVENT_TYPE.TRACK
|
|
83
69
|
});
|
|
84
70
|
}
|
|
85
|
-
|
|
86
71
|
function Expand(_ref) {
|
|
87
72
|
var title = _ref.title,
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
73
|
+
children = _ref.children,
|
|
74
|
+
nodeType = _ref.nodeType,
|
|
75
|
+
intl = _ref.intl,
|
|
76
|
+
fireAnalyticsEvent = _ref.fireAnalyticsEvent,
|
|
77
|
+
nestedHeaderIds = _ref.nestedHeaderIds,
|
|
78
|
+
rendererAppearance = _ref.rendererAppearance;
|
|
95
79
|
var _React$useState = React.useState(false),
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
80
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
81
|
+
expanded = _React$useState2[0],
|
|
82
|
+
setExpanded = _React$useState2[1];
|
|
100
83
|
var _React$useState3 = React.useState(false),
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
84
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
85
|
+
focused = _React$useState4[0],
|
|
86
|
+
setFocused = _React$useState4[1];
|
|
105
87
|
var isMobile = useMemo(function () {
|
|
106
88
|
return getPlatform(rendererAppearance) === 'mobile';
|
|
107
89
|
}, [rendererAppearance]);
|
|
108
90
|
var label = intl.formatMessage(expanded ? expandMessages.collapseNode : expandMessages.expandNode);
|
|
109
|
-
|
|
110
91
|
var _useRef = useRef(_uniqueId('expand-title-')),
|
|
111
|
-
|
|
112
|
-
|
|
92
|
+
id = _useRef.current;
|
|
113
93
|
var handleFocus = useCallback(function () {
|
|
114
94
|
return setFocused(true);
|
|
115
95
|
}, []);
|
|
@@ -132,8 +112,8 @@ function Expand(_ref) {
|
|
|
132
112
|
e.stopPropagation();
|
|
133
113
|
fireExpandToggleAnalytics(nodeType, expanded, fireAnalyticsEvent);
|
|
134
114
|
setExpanded(!expanded);
|
|
135
|
-
e.persist();
|
|
136
|
-
|
|
115
|
+
e.persist();
|
|
116
|
+
// @ts-ignore detail doesn't exist on type
|
|
137
117
|
e.detail ? handleBlur() : handleFocus();
|
|
138
118
|
},
|
|
139
119
|
onFocus: handleFocus,
|
|
@@ -166,5 +146,4 @@ function Expand(_ref) {
|
|
|
166
146
|
css: clearNextSiblingMarginTopStyle
|
|
167
147
|
}), children))));
|
|
168
148
|
}
|
|
169
|
-
|
|
170
149
|
export default injectIntl(Expand);
|
|
@@ -5,39 +5,27 @@ 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 memoizeOne from 'memoize-one';
|
|
15
12
|
import { getNodeRenderer } from '@atlaskit/editor-common/extensions';
|
|
16
13
|
import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
17
14
|
import { getExtensionRenderer } from '@atlaskit/editor-common/utils';
|
|
18
|
-
|
|
19
15
|
var ExtensionRenderer = /*#__PURE__*/function (_React$Component) {
|
|
20
16
|
_inherits(ExtensionRenderer, _React$Component);
|
|
21
|
-
|
|
22
17
|
var _super = _createSuper(ExtensionRenderer);
|
|
23
|
-
|
|
24
18
|
function ExtensionRenderer() {
|
|
25
19
|
var _this;
|
|
26
|
-
|
|
27
20
|
_classCallCheck(this, ExtensionRenderer);
|
|
28
|
-
|
|
29
21
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
30
22
|
args[_key] = arguments[_key];
|
|
31
23
|
}
|
|
32
|
-
|
|
33
24
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
34
|
-
|
|
35
25
|
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
36
26
|
extensionProvider: null
|
|
37
27
|
});
|
|
38
|
-
|
|
39
28
|
_defineProperty(_assertThisInitialized(_this), "mounted", false);
|
|
40
|
-
|
|
41
29
|
_defineProperty(_assertThisInitialized(_this), "handleProvider", function (name, providerPromise) {
|
|
42
30
|
providerPromise && providerPromise.then(function (provider) {
|
|
43
31
|
if (_this.mounted) {
|
|
@@ -45,23 +33,20 @@ var ExtensionRenderer = /*#__PURE__*/function (_React$Component) {
|
|
|
45
33
|
}
|
|
46
34
|
});
|
|
47
35
|
});
|
|
48
|
-
|
|
49
36
|
_defineProperty(_assertThisInitialized(_this), "getNodeRenderer", memoizeOne(getNodeRenderer));
|
|
50
|
-
|
|
51
37
|
_defineProperty(_assertThisInitialized(_this), "renderExtensionNode", function (extensionProvider) {
|
|
52
38
|
var _marks$find, _marks$find$attrs;
|
|
53
|
-
|
|
54
39
|
var _this$props = _this.props,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
40
|
+
extensionHandlers = _this$props.extensionHandlers,
|
|
41
|
+
rendererContext = _this$props.rendererContext,
|
|
42
|
+
extensionType = _this$props.extensionType,
|
|
43
|
+
extensionKey = _this$props.extensionKey,
|
|
44
|
+
parameters = _this$props.parameters,
|
|
45
|
+
content = _this$props.content,
|
|
46
|
+
text = _this$props.text,
|
|
47
|
+
type = _this$props.type,
|
|
48
|
+
localId = _this$props.localId,
|
|
49
|
+
marks = _this$props.marks;
|
|
65
50
|
var fragmentLocalId = marks === null || marks === void 0 ? void 0 : (_marks$find = marks.find(function (m) {
|
|
66
51
|
return m.type.name === 'fragment';
|
|
67
52
|
})) === null || _marks$find === void 0 ? void 0 : (_marks$find$attrs = _marks$find.attrs) === null || _marks$find$attrs === void 0 ? void 0 : _marks$find$attrs.localId;
|
|
@@ -75,44 +60,34 @@ var ExtensionRenderer = /*#__PURE__*/function (_React$Component) {
|
|
|
75
60
|
fragmentLocalId: fragmentLocalId
|
|
76
61
|
};
|
|
77
62
|
var result = null;
|
|
78
|
-
|
|
79
63
|
try {
|
|
80
64
|
if (extensionHandlers && extensionHandlers[extensionType]) {
|
|
81
65
|
var render = getExtensionRenderer(extensionHandlers[extensionType]);
|
|
82
66
|
result = render(node, rendererContext.adDoc);
|
|
83
67
|
}
|
|
84
|
-
|
|
85
68
|
if (!result && extensionProvider) {
|
|
86
69
|
var NodeRenderer = _this.getNodeRenderer(extensionProvider, extensionType, extensionKey);
|
|
87
|
-
|
|
88
70
|
result = /*#__PURE__*/React.createElement(NodeRenderer, {
|
|
89
71
|
node: node
|
|
90
72
|
});
|
|
91
73
|
}
|
|
92
74
|
} catch (e) {
|
|
93
75
|
/** We don't want this error to block renderer */
|
|
94
|
-
|
|
95
76
|
/** We keep rendering the default content */
|
|
96
77
|
}
|
|
97
|
-
|
|
98
78
|
return _this.props.children({
|
|
99
79
|
result: result
|
|
100
80
|
});
|
|
101
81
|
});
|
|
102
|
-
|
|
103
82
|
_defineProperty(_assertThisInitialized(_this), "setupAndRenderExtensionNode", function (providers) {
|
|
104
83
|
var extensionProvider = _this.state.extensionProvider;
|
|
105
|
-
|
|
106
84
|
if (!extensionProvider && providers.extensionProvider) {
|
|
107
85
|
_this.handleProvider('extensionProvider', providers.extensionProvider);
|
|
108
86
|
}
|
|
109
|
-
|
|
110
87
|
return _this.renderExtensionNode(extensionProvider);
|
|
111
88
|
});
|
|
112
|
-
|
|
113
89
|
return _this;
|
|
114
90
|
}
|
|
115
|
-
|
|
116
91
|
_createClass(ExtensionRenderer, [{
|
|
117
92
|
key: "UNSAFE_componentWillMount",
|
|
118
93
|
value: function UNSAFE_componentWillMount() {
|
|
@@ -127,11 +102,9 @@ var ExtensionRenderer = /*#__PURE__*/function (_React$Component) {
|
|
|
127
102
|
key: "render",
|
|
128
103
|
value: function render() {
|
|
129
104
|
var providers = this.props.providers;
|
|
130
|
-
|
|
131
105
|
if (!providers) {
|
|
132
106
|
return this.setupAndRenderExtensionNode({});
|
|
133
107
|
}
|
|
134
|
-
|
|
135
108
|
return /*#__PURE__*/React.createElement(WithProviders, {
|
|
136
109
|
providers: ['extensionProvider'],
|
|
137
110
|
providerFactory: providers,
|
|
@@ -139,8 +112,6 @@ var ExtensionRenderer = /*#__PURE__*/function (_React$Component) {
|
|
|
139
112
|
});
|
|
140
113
|
}
|
|
141
114
|
}]);
|
|
142
|
-
|
|
143
115
|
return ExtensionRenderer;
|
|
144
116
|
}(React.Component);
|
|
145
|
-
|
|
146
117
|
export { ExtensionRenderer as default };
|
package/dist/esm/ui/MediaCard.js
CHANGED
|
@@ -6,17 +6,11 @@ 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
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
15
|
-
|
|
16
12
|
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); }; }
|
|
17
|
-
|
|
18
13
|
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; } }
|
|
19
|
-
|
|
20
14
|
import React, { Component } from 'react';
|
|
21
15
|
import { filter } from '@atlaskit/adf-utils/traverse';
|
|
22
16
|
import { Card, CardLoading, CardError } from '@atlaskit/media-card';
|
|
@@ -27,16 +21,14 @@ export var getListOfIdentifiersFromDoc = function getListOfIdentifiersFromDoc(do
|
|
|
27
21
|
if (!doc) {
|
|
28
22
|
return [];
|
|
29
23
|
}
|
|
30
|
-
|
|
31
24
|
return filter(doc, function (node) {
|
|
32
25
|
return node.type === 'media';
|
|
33
26
|
}).reduce(function (identifierList, mediaNode) {
|
|
34
27
|
if (mediaNode.attrs) {
|
|
35
28
|
var _mediaNode$attrs = mediaNode.attrs,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
29
|
+
type = _mediaNode$attrs.type,
|
|
30
|
+
dataURI = _mediaNode$attrs.url,
|
|
31
|
+
id = _mediaNode$attrs.id;
|
|
40
32
|
if (type === 'file' && id) {
|
|
41
33
|
identifierList.push({
|
|
42
34
|
mediaItemType: 'file',
|
|
@@ -50,32 +42,23 @@ export var getListOfIdentifiersFromDoc = function getListOfIdentifiersFromDoc(do
|
|
|
50
42
|
});
|
|
51
43
|
}
|
|
52
44
|
}
|
|
53
|
-
|
|
54
45
|
return identifierList;
|
|
55
46
|
}, []);
|
|
56
47
|
};
|
|
57
48
|
export var MediaCardInternal = /*#__PURE__*/function (_Component) {
|
|
58
49
|
_inherits(MediaCardInternal, _Component);
|
|
59
|
-
|
|
60
50
|
var _super = _createSuper(MediaCardInternal);
|
|
61
|
-
|
|
62
51
|
function MediaCardInternal() {
|
|
63
52
|
var _this;
|
|
64
|
-
|
|
65
53
|
_classCallCheck(this, MediaCardInternal);
|
|
66
|
-
|
|
67
54
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
68
55
|
args[_key] = arguments[_key];
|
|
69
56
|
}
|
|
70
|
-
|
|
71
57
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
72
|
-
|
|
73
58
|
_defineProperty(_assertThisInitialized(_this), "state", {});
|
|
74
|
-
|
|
75
59
|
_defineProperty(_assertThisInitialized(_this), "saveFileState", /*#__PURE__*/function () {
|
|
76
60
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(id, mediaClientConfig) {
|
|
77
61
|
var _this$props, collectionName, featureFlags, mediaClient, options, fileState;
|
|
78
|
-
|
|
79
62
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
80
63
|
while (1) {
|
|
81
64
|
switch (_context.prev = _context.next) {
|
|
@@ -88,21 +71,16 @@ export var MediaCardInternal = /*#__PURE__*/function (_Component) {
|
|
|
88
71
|
_context.prev = 3;
|
|
89
72
|
_context.next = 6;
|
|
90
73
|
return mediaClient.file.getCurrentState(id, options);
|
|
91
|
-
|
|
92
74
|
case 6:
|
|
93
75
|
fileState = _context.sent;
|
|
94
|
-
|
|
95
76
|
_this.setState({
|
|
96
77
|
fileState: fileState
|
|
97
78
|
});
|
|
98
|
-
|
|
99
79
|
_context.next = 12;
|
|
100
80
|
break;
|
|
101
|
-
|
|
102
81
|
case 10:
|
|
103
82
|
_context.prev = 10;
|
|
104
83
|
_context.t0 = _context["catch"](3);
|
|
105
|
-
|
|
106
84
|
case 12:
|
|
107
85
|
case "end":
|
|
108
86
|
return _context.stop();
|
|
@@ -110,85 +88,67 @@ export var MediaCardInternal = /*#__PURE__*/function (_Component) {
|
|
|
110
88
|
}
|
|
111
89
|
}, _callee, null, [[3, 10]]);
|
|
112
90
|
}));
|
|
113
|
-
|
|
114
91
|
return function (_x, _x2) {
|
|
115
92
|
return _ref.apply(this, arguments);
|
|
116
93
|
};
|
|
117
94
|
}());
|
|
118
|
-
|
|
119
95
|
_defineProperty(_assertThisInitialized(_this), "renderLoadingCard", function () {
|
|
120
96
|
var cardDimensions = _this.props.cardDimensions;
|
|
121
97
|
return /*#__PURE__*/React.createElement(CardLoading, {
|
|
122
98
|
dimensions: cardDimensions
|
|
123
99
|
});
|
|
124
100
|
});
|
|
125
|
-
|
|
126
101
|
_defineProperty(_assertThisInitialized(_this), "getOnCardClickCallback", function (isInlinePlayer) {
|
|
127
102
|
var eventHandlers = _this.props.eventHandlers;
|
|
128
|
-
|
|
129
103
|
if (eventHandlers && eventHandlers.media && eventHandlers.media.onClick) {
|
|
130
104
|
return function (result, analyticsEvent) {
|
|
131
105
|
var isVideo = result.mediaItemDetails && result.mediaItemDetails.mediaType === 'video';
|
|
132
106
|
var isVideoWithInlinePlayer = isInlinePlayer && isVideo;
|
|
133
|
-
|
|
134
107
|
if (!isVideoWithInlinePlayer && eventHandlers && eventHandlers.media && eventHandlers.media.onClick) {
|
|
135
108
|
eventHandlers.media.onClick(result, analyticsEvent);
|
|
136
109
|
}
|
|
137
110
|
};
|
|
138
111
|
}
|
|
139
|
-
|
|
140
112
|
return undefined;
|
|
141
113
|
});
|
|
142
|
-
|
|
143
114
|
return _this;
|
|
144
115
|
}
|
|
145
|
-
|
|
146
116
|
_createClass(MediaCardInternal, [{
|
|
147
117
|
key: "componentDidMount",
|
|
148
118
|
value: function () {
|
|
149
119
|
var _componentDidMount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
150
120
|
var _this$props2, rendererContext, mediaProvider, contextIdentifierProvider, id, url, collectionName, mediaProviderObject, mediaClientConfig, nodeIsInCache;
|
|
151
|
-
|
|
152
121
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
153
122
|
while (1) {
|
|
154
123
|
switch (_context2.prev = _context2.next) {
|
|
155
124
|
case 0:
|
|
156
125
|
_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;
|
|
157
|
-
|
|
158
126
|
if (mediaProvider) {
|
|
159
127
|
_context2.next = 3;
|
|
160
128
|
break;
|
|
161
129
|
}
|
|
162
|
-
|
|
163
130
|
return _context2.abrupt("return");
|
|
164
|
-
|
|
165
131
|
case 3:
|
|
166
132
|
if (!contextIdentifierProvider) {
|
|
167
133
|
_context2.next = 10;
|
|
168
134
|
break;
|
|
169
135
|
}
|
|
170
|
-
|
|
171
136
|
_context2.t0 = this;
|
|
172
137
|
_context2.next = 7;
|
|
173
138
|
return contextIdentifierProvider;
|
|
174
|
-
|
|
175
139
|
case 7:
|
|
176
140
|
_context2.t1 = _context2.sent;
|
|
177
141
|
_context2.t2 = {
|
|
178
142
|
contextIdentifierProvider: _context2.t1
|
|
179
143
|
};
|
|
180
|
-
|
|
181
144
|
_context2.t0.setState.call(_context2.t0, _context2.t2);
|
|
182
|
-
|
|
183
145
|
case 10:
|
|
184
146
|
_context2.next = 12;
|
|
185
147
|
return mediaProvider;
|
|
186
|
-
|
|
187
148
|
case 12:
|
|
188
149
|
mediaProviderObject = _context2.sent;
|
|
189
150
|
mediaClientConfig = mediaProviderObject.viewMediaClientConfig;
|
|
190
151
|
nodeIsInCache = id && mediaIdentifierMap.has(id) || url && mediaIdentifierMap.has(url);
|
|
191
|
-
|
|
192
152
|
if (rendererContext && rendererContext.adDoc && !nodeIsInCache) {
|
|
193
153
|
getListOfIdentifiersFromDoc(rendererContext.adDoc).forEach(function (identifier) {
|
|
194
154
|
if (identifier.mediaItemType === 'file' && identifier.id === id) {
|
|
@@ -200,15 +160,12 @@ export var MediaCardInternal = /*#__PURE__*/function (_Component) {
|
|
|
200
160
|
}
|
|
201
161
|
});
|
|
202
162
|
}
|
|
203
|
-
|
|
204
163
|
this.setState({
|
|
205
164
|
mediaClientConfig: mediaClientConfig
|
|
206
165
|
});
|
|
207
|
-
|
|
208
166
|
if (id) {
|
|
209
167
|
this.saveFileState(id, mediaClientConfig);
|
|
210
168
|
}
|
|
211
|
-
|
|
212
169
|
case 18:
|
|
213
170
|
case "end":
|
|
214
171
|
return _context2.stop();
|
|
@@ -216,11 +173,9 @@ export var MediaCardInternal = /*#__PURE__*/function (_Component) {
|
|
|
216
173
|
}
|
|
217
174
|
}, _callee2, this);
|
|
218
175
|
}));
|
|
219
|
-
|
|
220
176
|
function componentDidMount() {
|
|
221
177
|
return _componentDidMount.apply(this, arguments);
|
|
222
178
|
}
|
|
223
|
-
|
|
224
179
|
return componentDidMount;
|
|
225
180
|
}()
|
|
226
181
|
}, {
|
|
@@ -228,7 +183,6 @@ export var MediaCardInternal = /*#__PURE__*/function (_Component) {
|
|
|
228
183
|
value: function UNSAFE_componentWillReceiveProps(newProps) {
|
|
229
184
|
var mediaClientConfig = this.state.mediaClientConfig;
|
|
230
185
|
var newId = newProps.id;
|
|
231
|
-
|
|
232
186
|
if (mediaClientConfig && newId && newId !== this.props.id) {
|
|
233
187
|
this.saveFileState(newId, mediaClientConfig);
|
|
234
188
|
}
|
|
@@ -237,9 +191,8 @@ export var MediaCardInternal = /*#__PURE__*/function (_Component) {
|
|
|
237
191
|
key: "componentWillUnmount",
|
|
238
192
|
value: function componentWillUnmount() {
|
|
239
193
|
var _this$props3 = this.props,
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
194
|
+
id = _this$props3.id,
|
|
195
|
+
dataURI = _this$props3.url;
|
|
243
196
|
if (id) {
|
|
244
197
|
mediaIdentifierMap.delete(id);
|
|
245
198
|
} else if (dataURI) {
|
|
@@ -251,26 +204,25 @@ export var MediaCardInternal = /*#__PURE__*/function (_Component) {
|
|
|
251
204
|
value: function renderExternal(shouldOpenMediaViewer) {
|
|
252
205
|
var mediaClientConfig = this.state.mediaClientConfig;
|
|
253
206
|
var _this$props4 = this.props,
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
207
|
+
cardDimensions = _this$props4.cardDimensions,
|
|
208
|
+
resizeMode = _this$props4.resizeMode,
|
|
209
|
+
appearance = _this$props4.appearance,
|
|
210
|
+
url = _this$props4.url,
|
|
211
|
+
imageStatus = _this$props4.imageStatus,
|
|
212
|
+
disableOverlay = _this$props4.disableOverlay,
|
|
213
|
+
alt = _this$props4.alt,
|
|
214
|
+
featureFlags = _this$props4.featureFlags,
|
|
215
|
+
ssr = _this$props4.ssr;
|
|
264
216
|
if (imageStatus === 'loading' || !url) {
|
|
265
217
|
return this.renderLoadingCard();
|
|
266
218
|
}
|
|
267
|
-
|
|
268
219
|
var identifier = {
|
|
269
220
|
dataURI: url,
|
|
270
221
|
name: url,
|
|
271
222
|
mediaItemType: 'external-image'
|
|
272
223
|
};
|
|
273
|
-
return /*#__PURE__*/React.createElement(Card
|
|
224
|
+
return /*#__PURE__*/React.createElement(Card
|
|
225
|
+
// TODO MPT-315: clean up after we move mediaClientConfig into FileIdentifier
|
|
274
226
|
// context is not really used when the type is external and we want to render the component asap
|
|
275
227
|
, {
|
|
276
228
|
mediaClientConfig: mediaClientConfig,
|
|
@@ -288,62 +240,56 @@ export var MediaCardInternal = /*#__PURE__*/function (_Component) {
|
|
|
288
240
|
ssr: ssr === null || ssr === void 0 ? void 0 : ssr.mode
|
|
289
241
|
});
|
|
290
242
|
}
|
|
243
|
+
|
|
291
244
|
/**
|
|
292
245
|
* We want to call provided `eventHandlers.media.onClick` when it's provided,
|
|
293
246
|
* but we also don't want to call it when it's a video and inline video player is enabled.
|
|
294
247
|
* This is due to consumers normally process this onClick call by opening media viewer and
|
|
295
248
|
* we don't want that to happened described above text.
|
|
296
249
|
*/
|
|
297
|
-
|
|
298
250
|
}, {
|
|
299
251
|
key: "render",
|
|
300
252
|
value: function render() {
|
|
301
253
|
var _this$state = this.state,
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
254
|
+
contextIdentifierProvider = _this$state.contextIdentifierProvider,
|
|
255
|
+
mediaClientConfigInState = _this$state.mediaClientConfig,
|
|
256
|
+
fileState = _this$state.fileState;
|
|
305
257
|
var _this$props5 = this.props,
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
258
|
+
id = _this$props5.id,
|
|
259
|
+
alt = _this$props5.alt,
|
|
260
|
+
type = _this$props5.type,
|
|
261
|
+
collection = _this$props5.collection,
|
|
262
|
+
occurrenceKey = _this$props5.occurrenceKey,
|
|
263
|
+
cardDimensions = _this$props5.cardDimensions,
|
|
264
|
+
resizeMode = _this$props5.resizeMode,
|
|
265
|
+
rendererAppearance = _this$props5.rendererAppearance,
|
|
266
|
+
disableOverlay = _this$props5.disableOverlay,
|
|
267
|
+
useInlinePlayer = _this$props5.useInlinePlayer,
|
|
268
|
+
originalDimensions = _this$props5.originalDimensions,
|
|
269
|
+
forceOpenMediaViewer = _this$props5.shouldOpenMediaViewer,
|
|
270
|
+
featureFlags = _this$props5.featureFlags,
|
|
271
|
+
shouldEnableDownloadButton = _this$props5.shouldEnableDownloadButton,
|
|
272
|
+
ssr = _this$props5.ssr;
|
|
321
273
|
var isMobile = rendererAppearance === 'mobile';
|
|
322
274
|
var shouldPlayInline = useInlinePlayer !== undefined ? useInlinePlayer : true;
|
|
323
275
|
var isInlinePlayer = isMobile ? false : shouldPlayInline;
|
|
324
276
|
var onCardClick = this.getOnCardClickCallback(isInlinePlayer);
|
|
325
277
|
var shouldOpenMediaViewer = typeof forceOpenMediaViewer === 'boolean' ? forceOpenMediaViewer : !isMobile && !onCardClick;
|
|
326
|
-
|
|
327
278
|
if (type === 'external') {
|
|
328
279
|
return this.renderExternal(shouldOpenMediaViewer);
|
|
329
280
|
}
|
|
330
|
-
|
|
331
281
|
if (type === 'link') {
|
|
332
282
|
return null;
|
|
333
283
|
}
|
|
334
|
-
|
|
335
284
|
var mediaClientConfig = !!ssr ? ssr.config : mediaClientConfigInState;
|
|
336
|
-
|
|
337
285
|
if (!mediaClientConfig || !id) {
|
|
338
286
|
return this.renderLoadingCard();
|
|
339
287
|
}
|
|
340
|
-
|
|
341
288
|
if (!id || type !== 'file') {
|
|
342
289
|
return /*#__PURE__*/React.createElement(CardError, {
|
|
343
290
|
dimensions: cardDimensions
|
|
344
291
|
});
|
|
345
292
|
}
|
|
346
|
-
|
|
347
293
|
var contextId = contextIdentifierProvider && contextIdentifierProvider.objectId;
|
|
348
294
|
var identifier = {
|
|
349
295
|
id: id,
|
|
@@ -380,31 +326,28 @@ export var MediaCardInternal = /*#__PURE__*/function (_Component) {
|
|
|
380
326
|
}));
|
|
381
327
|
}
|
|
382
328
|
}]);
|
|
383
|
-
|
|
384
329
|
return MediaCardInternal;
|
|
385
|
-
}(Component);
|
|
330
|
+
}(Component);
|
|
386
331
|
|
|
332
|
+
// Needed for copy & paste
|
|
387
333
|
export var getClipboardAttrs = function getClipboardAttrs(_ref2) {
|
|
388
334
|
var id = _ref2.id,
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
335
|
+
alt = _ref2.alt,
|
|
336
|
+
collection = _ref2.collection,
|
|
337
|
+
contextIdentifierProvider = _ref2.contextIdentifierProvider,
|
|
338
|
+
originalDimensions = _ref2.originalDimensions,
|
|
339
|
+
fileState = _ref2.fileState;
|
|
394
340
|
var contextId = contextIdentifierProvider && contextIdentifierProvider.objectId;
|
|
395
341
|
var width = originalDimensions && originalDimensions.width;
|
|
396
342
|
var height = originalDimensions && originalDimensions.height;
|
|
397
343
|
var fileName = 'file'; // default name is needed for Confluence
|
|
398
|
-
|
|
399
344
|
var fileSize = 1;
|
|
400
345
|
var fileMimeType = '';
|
|
401
|
-
|
|
402
346
|
if (fileState && fileState.status !== 'error') {
|
|
403
347
|
fileSize = fileState.size;
|
|
404
348
|
fileName = fileState.name;
|
|
405
349
|
fileMimeType = fileState.mimeType;
|
|
406
350
|
}
|
|
407
|
-
|
|
408
351
|
return {
|
|
409
352
|
'data-context-id': contextId,
|
|
410
353
|
'data-type': 'file',
|