@atlaskit/renderer 105.1.1 → 106.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/cjs/actions/index.js +19 -71
- package/dist/cjs/actions/matches-utils.js +10 -11
- package/dist/cjs/actions.js +0 -2
- package/dist/cjs/analytics/analyticsContext.js +0 -4
- package/dist/cjs/analytics/events.js +0 -5
- package/dist/cjs/analytics/unsupported-content.js +14 -27
- package/dist/cjs/i18n/cs.js +0 -1
- package/dist/cjs/i18n/da.js +0 -1
- package/dist/cjs/i18n/de.js +0 -1
- package/dist/cjs/i18n/en.js +0 -1
- package/dist/cjs/i18n/en_GB.js +0 -1
- package/dist/cjs/i18n/en_ZZ.js +0 -1
- package/dist/cjs/i18n/es.js +0 -1
- package/dist/cjs/i18n/et.js +0 -1
- package/dist/cjs/i18n/fi.js +0 -1
- package/dist/cjs/i18n/fr.js +0 -1
- package/dist/cjs/i18n/hu.js +0 -1
- package/dist/cjs/i18n/index.js +0 -26
- package/dist/cjs/i18n/it.js +0 -1
- package/dist/cjs/i18n/ja.js +0 -1
- package/dist/cjs/i18n/ko.js +0 -1
- package/dist/cjs/i18n/nb.js +0 -1
- package/dist/cjs/i18n/nl.js +0 -1
- package/dist/cjs/i18n/pl.js +0 -1
- package/dist/cjs/i18n/pt_BR.js +0 -1
- package/dist/cjs/i18n/pt_PT.js +0 -1
- package/dist/cjs/i18n/ru.js +0 -1
- package/dist/cjs/i18n/sk.js +0 -1
- package/dist/cjs/i18n/sv.js +0 -1
- package/dist/cjs/i18n/th.js +0 -1
- package/dist/cjs/i18n/tr.js +0 -1
- package/dist/cjs/i18n/uk.js +0 -1
- package/dist/cjs/i18n/vi.js +0 -1
- package/dist/cjs/i18n/zh.js +0 -1
- package/dist/cjs/i18n/zh_TW.js +0 -1
- package/dist/cjs/index.js +0 -6
- package/dist/cjs/messages.js +0 -2
- package/dist/cjs/react/hooks/use-bidi-warnings.js +2 -12
- package/dist/cjs/react/hooks/use-in-viewport.js +4 -17
- package/dist/cjs/react/hooks/use-observed-width.js +20 -35
- package/dist/cjs/react/index.js +27 -114
- package/dist/cjs/react/marks/alignment.js +0 -9
- package/dist/cjs/react/marks/annotation.js +6 -21
- package/dist/cjs/react/marks/breakout.js +0 -9
- package/dist/cjs/react/marks/code.js +0 -11
- package/dist/cjs/react/marks/confluence-inline-comment.js +2 -19
- package/dist/cjs/react/marks/data-consumer.js +0 -4
- package/dist/cjs/react/marks/em.js +0 -3
- package/dist/cjs/react/marks/fragment.js +0 -4
- package/dist/cjs/react/marks/indentation.js +0 -3
- package/dist/cjs/react/marks/index.js +1 -24
- package/dist/cjs/react/marks/link.js +5 -25
- package/dist/cjs/react/marks/strike.js +0 -4
- package/dist/cjs/react/marks/strong.js +0 -3
- package/dist/cjs/react/marks/subsup.js +0 -5
- package/dist/cjs/react/marks/textColor.js +0 -9
- package/dist/cjs/react/marks/underline.js +0 -3
- package/dist/cjs/react/marks/unsupportedMark.js +0 -3
- package/dist/cjs/react/marks/unsupportedNodeAttribute.js +0 -3
- package/dist/cjs/react/nodes/blockCard.js +4 -16
- package/dist/cjs/react/nodes/blockquote.js +0 -3
- package/dist/cjs/react/nodes/bodiedExtension.js +6 -17
- package/dist/cjs/react/nodes/bulletList.js +0 -5
- package/dist/cjs/react/nodes/caption.js +1 -6
- package/dist/cjs/react/nodes/codeBlock/codeBlock.js +5 -14
- package/dist/cjs/react/nodes/codeBlock/components/codeBlockContainer.js +3 -16
- package/dist/cjs/react/nodes/codeBlock/components/lightWeightCodeBlock.js +6 -23
- package/dist/cjs/react/nodes/codeBlock/windowedCodeBlock.js +9 -32
- package/dist/cjs/react/nodes/codeBlockCopyButton.js +7 -31
- package/dist/cjs/react/nodes/date.js +5 -33
- package/dist/cjs/react/nodes/decisionItem.js +1 -5
- package/dist/cjs/react/nodes/decisionList.js +0 -20
- package/dist/cjs/react/nodes/doc.js +0 -6
- package/dist/cjs/react/nodes/embedCard.js +25 -54
- package/dist/cjs/react/nodes/emoji.js +6 -24
- package/dist/cjs/react/nodes/extension.js +12 -26
- package/dist/cjs/react/nodes/fallback.js +2 -24
- package/dist/cjs/react/nodes/hardBreak.js +1 -7
- package/dist/cjs/react/nodes/heading-anchor.js +1 -46
- package/dist/cjs/react/nodes/heading.js +4 -17
- package/dist/cjs/react/nodes/index.js +7 -62
- package/dist/cjs/react/nodes/inline.js +0 -6
- package/dist/cjs/react/nodes/inlineCard.js +6 -23
- package/dist/cjs/react/nodes/inlineExtension.js +2 -10
- package/dist/cjs/react/nodes/layoutColumn.js +0 -8
- package/dist/cjs/react/nodes/layoutSection.js +0 -3
- package/dist/cjs/react/nodes/listItem.js +0 -3
- package/dist/cjs/react/nodes/media.js +10 -49
- package/dist/cjs/react/nodes/mediaGroup.js +6 -47
- package/dist/cjs/react/nodes/mediaInline.js +7 -37
- package/dist/cjs/react/nodes/mediaSingle/index.js +38 -85
- package/dist/cjs/react/nodes/mediaSingle/styles.js +0 -5
- package/dist/cjs/react/nodes/mention.js +5 -23
- package/dist/cjs/react/nodes/orderedList.js +0 -14
- package/dist/cjs/react/nodes/panel.js +10 -38
- package/dist/cjs/react/nodes/paragraph.js +1 -5
- package/dist/cjs/react/nodes/placeholder.js +0 -4
- package/dist/cjs/react/nodes/rule.js +0 -3
- package/dist/cjs/react/nodes/status.js +3 -22
- package/dist/cjs/react/nodes/table/colgroup.js +12 -26
- package/dist/cjs/react/nodes/table/sticky.js +17 -47
- package/dist/cjs/react/nodes/table/table.js +5 -10
- package/dist/cjs/react/nodes/table.js +19 -102
- package/dist/cjs/react/nodes/tableCell.js +26 -79
- package/dist/cjs/react/nodes/tableRow.js +4 -33
- package/dist/cjs/react/nodes/task-item-with-providers.js +4 -40
- package/dist/cjs/react/nodes/taskItem.js +8 -36
- package/dist/cjs/react/nodes/taskList.js +2 -22
- package/dist/cjs/react/nodes/text-wrapper.js +1 -8
- package/dist/cjs/react/nodes/unknownBlock.js +0 -3
- package/dist/cjs/react/renderer-node.js +0 -6
- package/dist/cjs/react/utils/clipboard.js +0 -3
- package/dist/cjs/react/utils/element-selection.js +0 -13
- package/dist/cjs/react/utils/getCardClickHandler.js +0 -3
- package/dist/cjs/react/utils/inject-props.js +4 -9
- package/dist/cjs/react/utils/links.js +2 -6
- package/dist/cjs/react/utils/lists.js +0 -1
- package/dist/cjs/react/utils/performance/RenderTracking.js +2 -10
- package/dist/cjs/react/utils/use-select-all-trap.js +1 -23
- package/dist/cjs/render-document.js +42 -83
- package/dist/cjs/renderer-context.js +0 -5
- package/dist/cjs/steps/index.js +7 -39
- package/dist/cjs/text/index.js +0 -9
- package/dist/cjs/text/nodes/blockquote.js +0 -3
- package/dist/cjs/text/nodes/bulletList.js +0 -3
- package/dist/cjs/text/nodes/date.js +0 -4
- package/dist/cjs/text/nodes/decisionItem.js +0 -5
- package/dist/cjs/text/nodes/hardBreak.js +0 -2
- package/dist/cjs/text/nodes/heading.js +0 -3
- package/dist/cjs/text/nodes/index.js +0 -21
- package/dist/cjs/text/nodes/inlineCard.js +0 -4
- package/dist/cjs/text/nodes/listItem.js +0 -3
- package/dist/cjs/text/nodes/mediaGroup.js +0 -4
- package/dist/cjs/text/nodes/mention.js +0 -3
- package/dist/cjs/text/nodes/orderedList.js +0 -4
- package/dist/cjs/text/nodes/panel.js +0 -3
- package/dist/cjs/text/nodes/paragraph.js +0 -5
- package/dist/cjs/text/nodes/rule.js +0 -2
- package/dist/cjs/text/nodes/status.js +0 -3
- package/dist/cjs/text/nodes/table.js +0 -5
- package/dist/cjs/text/nodes/taskItem.js +0 -5
- package/dist/cjs/text/nodes/unknown.js +0 -6
- package/dist/cjs/text-serializer.js +0 -2
- package/dist/cjs/ui/Expand.js +15 -59
- package/dist/cjs/ui/ExtensionRenderer.js +10 -43
- package/dist/cjs/ui/MediaCard.js +40 -116
- package/dist/cjs/ui/Renderer/ErrorBoundary.js +0 -26
- package/dist/cjs/ui/Renderer/breakout-ssr.js +6 -32
- package/dist/cjs/ui/Renderer/click-to-edit.js +0 -6
- package/dist/cjs/ui/Renderer/index.js +47 -149
- package/dist/cjs/ui/Renderer/style.js +1 -39
- package/dist/cjs/ui/Renderer/truncated-wrapper.js +12 -30
- package/dist/cjs/ui/RendererActionsContext/WithRendererActions.js +0 -4
- package/dist/cjs/ui/RendererActionsContext/index.js +1 -11
- package/dist/cjs/ui/SmartCardStorage.js +0 -20
- package/dist/cjs/ui/SortingIcon.js +10 -40
- package/dist/cjs/ui/TaskItemsFormatContext/TaskItemsFormatContext.js +0 -11
- package/dist/cjs/ui/TaskItemsFormatContext/index.js +0 -1
- package/dist/cjs/ui/active-header-id-provider.js +6 -19
- package/dist/cjs/ui/annotations/context.js +0 -24
- package/dist/cjs/ui/annotations/draft/component.js +5 -42
- package/dist/cjs/ui/annotations/draft/dom.js +3 -17
- package/dist/cjs/ui/annotations/draft/index.js +0 -2
- package/dist/cjs/ui/annotations/draft/position.js +1 -12
- package/dist/cjs/ui/annotations/draft/text.js +2 -8
- package/dist/cjs/ui/annotations/element/index.js +4 -16
- package/dist/cjs/ui/annotations/element/mark.js +8 -26
- package/dist/cjs/ui/annotations/hooks/index.js +0 -3
- package/dist/cjs/ui/annotations/hooks/use-events.js +13 -45
- package/dist/cjs/ui/annotations/hooks/use-inline-comment-subscriber.js +0 -6
- package/dist/cjs/ui/annotations/hooks/use-inline-comments-filter.js +1 -8
- package/dist/cjs/ui/annotations/hooks/use-load-annotations.js +4 -19
- package/dist/cjs/ui/annotations/hooks/user-selection.js +3 -18
- package/dist/cjs/ui/annotations/hooks/utils.js +0 -2
- package/dist/cjs/ui/annotations/index.js +4 -20
- package/dist/cjs/ui/annotations/selection/index.js +0 -1
- package/dist/cjs/ui/annotations/selection/mounter.js +13 -42
- package/dist/cjs/ui/annotations/selection/range-validator.js +9 -23
- package/dist/cjs/ui/annotations/selection/wrapper.js +3 -13
- package/dist/cjs/ui/annotations/types.js +0 -1
- package/dist/cjs/ui/annotations/view/index.js +1 -12
- package/dist/cjs/ui/index.js +0 -2
- package/dist/cjs/use-feature-flags.js +0 -4
- package/dist/cjs/utils.js +1 -19
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/actions/index.js +6 -50
- package/dist/es2019/actions/matches-utils.js +10 -9
- package/dist/es2019/actions.js +2 -1
- package/dist/es2019/analytics/events.js +0 -5
- package/dist/es2019/analytics/unsupported-content.js +8 -14
- package/dist/es2019/react/hooks/use-bidi-warnings.js +0 -2
- package/dist/es2019/react/hooks/use-in-viewport.js +0 -1
- package/dist/es2019/react/hooks/use-observed-width.js +0 -2
- package/dist/es2019/react/index.js +44 -119
- package/dist/es2019/react/marks/alignment.js +0 -3
- package/dist/es2019/react/marks/annotation.js +2 -5
- package/dist/es2019/react/marks/confluence-inline-comment.js +0 -1
- package/dist/es2019/react/marks/index.js +2 -1
- package/dist/es2019/react/marks/link.js +0 -6
- package/dist/es2019/react/marks/subsup.js +0 -3
- package/dist/es2019/react/nodes/bodiedExtension.js +2 -5
- package/dist/es2019/react/nodes/caption.js +0 -2
- package/dist/es2019/react/nodes/codeBlock/codeBlock.js +0 -2
- package/dist/es2019/react/nodes/codeBlock/components/codeBlockContainer.js +1 -3
- package/dist/es2019/react/nodes/codeBlock/windowedCodeBlock.js +1 -6
- package/dist/es2019/react/nodes/codeBlockCopyButton.js +0 -4
- package/dist/es2019/react/nodes/date.js +0 -7
- package/dist/es2019/react/nodes/decisionList.js +0 -3
- package/dist/es2019/react/nodes/embedCard.js +8 -16
- package/dist/es2019/react/nodes/emoji.js +0 -1
- package/dist/es2019/react/nodes/extension.js +4 -6
- package/dist/es2019/react/nodes/fallback.js +0 -8
- package/dist/es2019/react/nodes/hardBreak.js +0 -3
- package/dist/es2019/react/nodes/heading-anchor.js +0 -15
- package/dist/es2019/react/nodes/heading.js +0 -6
- package/dist/es2019/react/nodes/index.js +28 -61
- package/dist/es2019/react/nodes/inline.js +0 -2
- package/dist/es2019/react/nodes/inlineCard.js +0 -5
- package/dist/es2019/react/nodes/inlineExtension.js +2 -5
- package/dist/es2019/react/nodes/media.js +0 -10
- package/dist/es2019/react/nodes/mediaGroup.js +2 -22
- package/dist/es2019/react/nodes/mediaInline.js +1 -8
- package/dist/es2019/react/nodes/mediaSingle/index.js +8 -29
- package/dist/es2019/react/nodes/mention.js +0 -1
- package/dist/es2019/react/nodes/orderedList.js +0 -5
- package/dist/es2019/react/nodes/panel.js +4 -17
- package/dist/es2019/react/nodes/placeholder.js +0 -1
- package/dist/es2019/react/nodes/status.js +0 -1
- package/dist/es2019/react/nodes/table/colgroup.js +9 -18
- package/dist/es2019/react/nodes/table/sticky.js +3 -16
- package/dist/es2019/react/nodes/table.js +9 -75
- package/dist/es2019/react/nodes/tableCell.js +4 -31
- package/dist/es2019/react/nodes/tableRow.js +0 -10
- package/dist/es2019/react/nodes/task-item-with-providers.js +0 -6
- package/dist/es2019/react/nodes/taskItem.js +0 -7
- package/dist/es2019/react/nodes/taskList.js +0 -3
- package/dist/es2019/react/nodes/text-wrapper.js +0 -4
- package/dist/es2019/react/utils/clipboard.js +0 -1
- package/dist/es2019/react/utils/element-selection.js +0 -12
- package/dist/es2019/react/utils/inject-props.js +5 -7
- package/dist/es2019/react/utils/links.js +2 -4
- package/dist/es2019/react/utils/performance/RenderTracking.js +0 -1
- package/dist/es2019/react/utils/use-select-all-trap.js +0 -7
- package/dist/es2019/render-document.js +16 -33
- package/dist/es2019/steps/index.js +4 -33
- package/dist/es2019/text/index.js +0 -3
- package/dist/es2019/text/nodes/blockquote.js +0 -2
- package/dist/es2019/text/nodes/bulletList.js +0 -2
- package/dist/es2019/text/nodes/date.js +0 -2
- package/dist/es2019/text/nodes/decisionItem.js +0 -4
- package/dist/es2019/text/nodes/hardBreak.js +0 -1
- package/dist/es2019/text/nodes/heading.js +0 -2
- package/dist/es2019/text/nodes/inlineCard.js +0 -3
- package/dist/es2019/text/nodes/listItem.js +0 -2
- package/dist/es2019/text/nodes/mediaGroup.js +0 -3
- package/dist/es2019/text/nodes/mention.js +0 -2
- package/dist/es2019/text/nodes/orderedList.js +0 -2
- package/dist/es2019/text/nodes/panel.js +0 -2
- package/dist/es2019/text/nodes/paragraph.js +0 -4
- package/dist/es2019/text/nodes/rule.js +0 -1
- package/dist/es2019/text/nodes/status.js +0 -2
- package/dist/es2019/text/nodes/table.js +0 -4
- package/dist/es2019/text/nodes/taskItem.js +0 -4
- package/dist/es2019/text/nodes/unknown.js +0 -4
- package/dist/es2019/ui/Expand.js +2 -17
- package/dist/es2019/ui/ExtensionRenderer.js +0 -19
- package/dist/es2019/ui/MediaCard.js +9 -40
- package/dist/es2019/ui/Renderer/ErrorBoundary.js +0 -10
- package/dist/es2019/ui/Renderer/breakout-ssr.js +6 -26
- package/dist/es2019/ui/Renderer/click-to-edit.js +1 -4
- package/dist/es2019/ui/Renderer/index.js +17 -66
- package/dist/es2019/ui/Renderer/style.js +0 -14
- package/dist/es2019/ui/Renderer/truncated-wrapper.js +2 -6
- package/dist/es2019/ui/SmartCardStorage.js +0 -1
- package/dist/es2019/ui/SortingIcon.js +3 -20
- package/dist/es2019/ui/TaskItemsFormatContext/TaskItemsFormatContext.js +0 -2
- package/dist/es2019/ui/active-header-id-provider.js +0 -3
- package/dist/es2019/ui/annotations/context.js +0 -6
- package/dist/es2019/ui/annotations/draft/component.js +0 -13
- package/dist/es2019/ui/annotations/draft/dom.js +0 -6
- package/dist/es2019/ui/annotations/draft/position.js +0 -8
- package/dist/es2019/ui/annotations/draft/text.js +0 -1
- package/dist/es2019/ui/annotations/element/index.js +0 -3
- package/dist/es2019/ui/annotations/element/mark.js +4 -6
- package/dist/es2019/ui/annotations/hooks/use-events.js +4 -13
- package/dist/es2019/ui/annotations/hooks/use-inline-comment-subscriber.js +0 -2
- package/dist/es2019/ui/annotations/hooks/use-inline-comments-filter.js +0 -1
- package/dist/es2019/ui/annotations/hooks/use-load-annotations.js +4 -8
- package/dist/es2019/ui/annotations/hooks/user-selection.js +0 -6
- package/dist/es2019/ui/annotations/selection/mounter.js +0 -13
- package/dist/es2019/ui/annotations/selection/range-validator.js +0 -2
- package/dist/es2019/ui/annotations/selection/wrapper.js +0 -2
- package/dist/es2019/ui/annotations/types.js +0 -1
- package/dist/es2019/ui/annotations/view/index.js +0 -4
- package/dist/es2019/use-feature-flags.js +0 -1
- package/dist/es2019/utils.js +1 -8
- package/dist/es2019/version.json +1 -1
- package/dist/esm/actions/index.js +19 -63
- package/dist/esm/actions/matches-utils.js +10 -9
- package/dist/esm/actions.js +2 -1
- package/dist/esm/analytics/events.js +0 -5
- package/dist/esm/analytics/unsupported-content.js +14 -21
- package/dist/esm/react/hooks/use-bidi-warnings.js +2 -4
- package/dist/esm/react/hooks/use-in-viewport.js +4 -13
- package/dist/esm/react/hooks/use-observed-width.js +20 -29
- package/dist/esm/react/index.js +27 -111
- package/dist/esm/react/marks/alignment.js +0 -4
- package/dist/esm/react/marks/annotation.js +6 -14
- package/dist/esm/react/marks/breakout.js +0 -2
- package/dist/esm/react/marks/confluence-inline-comment.js +2 -12
- package/dist/esm/react/marks/index.js +2 -1
- package/dist/esm/react/marks/link.js +5 -12
- package/dist/esm/react/marks/subsup.js +0 -3
- package/dist/esm/react/nodes/blockCard.js +4 -4
- package/dist/esm/react/nodes/bodiedExtension.js +6 -10
- package/dist/esm/react/nodes/caption.js +1 -3
- package/dist/esm/react/nodes/codeBlock/codeBlock.js +4 -6
- package/dist/esm/react/nodes/codeBlock/components/codeBlockContainer.js +4 -8
- package/dist/esm/react/nodes/codeBlock/components/lightWeightCodeBlock.js +6 -10
- package/dist/esm/react/nodes/codeBlock/windowedCodeBlock.js +10 -21
- package/dist/esm/react/nodes/codeBlockCopyButton.js +7 -15
- package/dist/esm/react/nodes/date.js +5 -20
- package/dist/esm/react/nodes/decisionItem.js +1 -1
- package/dist/esm/react/nodes/decisionList.js +0 -12
- package/dist/esm/react/nodes/embedCard.js +25 -39
- package/dist/esm/react/nodes/emoji.js +6 -16
- package/dist/esm/react/nodes/extension.js +12 -16
- package/dist/esm/react/nodes/fallback.js +2 -18
- package/dist/esm/react/nodes/hardBreak.js +1 -5
- package/dist/esm/react/nodes/heading-anchor.js +1 -32
- package/dist/esm/react/nodes/heading.js +4 -10
- package/dist/esm/react/nodes/index.js +26 -64
- package/dist/esm/react/nodes/inline.js +0 -2
- package/dist/esm/react/nodes/inlineCard.js +6 -12
- package/dist/esm/react/nodes/inlineExtension.js +2 -6
- package/dist/esm/react/nodes/layoutColumn.js +0 -2
- package/dist/esm/react/nodes/media.js +10 -34
- package/dist/esm/react/nodes/mediaGroup.js +6 -37
- package/dist/esm/react/nodes/mediaInline.js +7 -20
- package/dist/esm/react/nodes/mediaSingle/index.js +37 -66
- package/dist/esm/react/nodes/mediaSingle/styles.js +0 -2
- package/dist/esm/react/nodes/mention.js +5 -15
- package/dist/esm/react/nodes/orderedList.js +0 -5
- package/dist/esm/react/nodes/panel.js +12 -28
- package/dist/esm/react/nodes/paragraph.js +1 -1
- package/dist/esm/react/nodes/placeholder.js +0 -1
- package/dist/esm/react/nodes/status.js +3 -13
- package/dist/esm/react/nodes/table/colgroup.js +12 -21
- package/dist/esm/react/nodes/table/sticky.js +17 -32
- package/dist/esm/react/nodes/table/table.js +5 -5
- package/dist/esm/react/nodes/table.js +19 -95
- package/dist/esm/react/nodes/tableCell.js +26 -66
- package/dist/esm/react/nodes/tableRow.js +4 -25
- package/dist/esm/react/nodes/task-item-with-providers.js +4 -27
- package/dist/esm/react/nodes/taskItem.js +8 -24
- package/dist/esm/react/nodes/taskList.js +2 -14
- package/dist/esm/react/nodes/text-wrapper.js +1 -5
- package/dist/esm/react/utils/clipboard.js +0 -1
- package/dist/esm/react/utils/element-selection.js +0 -10
- package/dist/esm/react/utils/inject-props.js +5 -7
- package/dist/esm/react/utils/links.js +2 -4
- package/dist/esm/react/utils/performance/RenderTracking.js +2 -4
- package/dist/esm/react/utils/use-select-all-trap.js +1 -9
- package/dist/esm/render-document.js +42 -70
- package/dist/esm/steps/index.js +7 -36
- package/dist/esm/text/index.js +0 -6
- package/dist/esm/text/nodes/blockquote.js +0 -2
- package/dist/esm/text/nodes/bulletList.js +0 -2
- package/dist/esm/text/nodes/date.js +0 -2
- package/dist/esm/text/nodes/decisionItem.js +0 -4
- package/dist/esm/text/nodes/hardBreak.js +0 -1
- package/dist/esm/text/nodes/heading.js +0 -2
- package/dist/esm/text/nodes/inlineCard.js +0 -3
- package/dist/esm/text/nodes/listItem.js +0 -2
- package/dist/esm/text/nodes/mediaGroup.js +0 -3
- package/dist/esm/text/nodes/mention.js +0 -2
- package/dist/esm/text/nodes/orderedList.js +0 -2
- package/dist/esm/text/nodes/panel.js +0 -2
- package/dist/esm/text/nodes/paragraph.js +0 -4
- package/dist/esm/text/nodes/rule.js +0 -1
- package/dist/esm/text/nodes/status.js +0 -2
- package/dist/esm/text/nodes/table.js +0 -4
- package/dist/esm/text/nodes/taskItem.js +0 -4
- package/dist/esm/text/nodes/unknown.js +0 -4
- package/dist/esm/ui/Expand.js +15 -36
- package/dist/esm/ui/ExtensionRenderer.js +10 -39
- package/dist/esm/ui/MediaCard.js +42 -99
- package/dist/esm/ui/Renderer/ErrorBoundary.js +0 -16
- package/dist/esm/ui/Renderer/breakout-ssr.js +7 -27
- package/dist/esm/ui/Renderer/click-to-edit.js +1 -4
- package/dist/esm/ui/Renderer/index.js +47 -110
- package/dist/esm/ui/Renderer/style.js +1 -21
- package/dist/esm/ui/Renderer/truncated-wrapper.js +12 -23
- package/dist/esm/ui/RendererActionsContext/index.js +1 -1
- package/dist/esm/ui/SmartCardStorage.js +0 -9
- package/dist/esm/ui/SortingIcon.js +10 -29
- package/dist/esm/ui/TaskItemsFormatContext/TaskItemsFormatContext.js +0 -2
- package/dist/esm/ui/active-header-id-provider.js +6 -12
- package/dist/esm/ui/annotations/context.js +0 -15
- package/dist/esm/ui/annotations/draft/component.js +5 -19
- package/dist/esm/ui/annotations/draft/dom.js +3 -11
- package/dist/esm/ui/annotations/draft/position.js +1 -9
- package/dist/esm/ui/annotations/draft/text.js +2 -4
- package/dist/esm/ui/annotations/element/index.js +4 -7
- package/dist/esm/ui/annotations/element/mark.js +8 -14
- package/dist/esm/ui/annotations/hooks/use-events.js +13 -32
- package/dist/esm/ui/annotations/hooks/use-inline-comment-subscriber.js +0 -2
- package/dist/esm/ui/annotations/hooks/use-inline-comments-filter.js +1 -2
- package/dist/esm/ui/annotations/hooks/use-load-annotations.js +4 -12
- package/dist/esm/ui/annotations/hooks/user-selection.js +3 -11
- package/dist/esm/ui/annotations/index.js +4 -6
- package/dist/esm/ui/annotations/selection/mounter.js +13 -29
- package/dist/esm/ui/annotations/selection/range-validator.js +9 -12
- package/dist/esm/ui/annotations/selection/wrapper.js +3 -5
- package/dist/esm/ui/annotations/types.js +0 -1
- package/dist/esm/ui/annotations/view/index.js +1 -5
- package/dist/esm/use-feature-flags.js +0 -1
- package/dist/esm/utils.js +1 -8
- package/dist/esm/version.json +1 -1
- package/package.json +7 -7
|
@@ -21,116 +21,97 @@ import TableRow from './tableRow';
|
|
|
21
21
|
import UnknownBlock from './unknownBlock';
|
|
22
22
|
import { UnsupportedBlock, UnsupportedInline } from '@atlaskit/editor-common/ui';
|
|
23
23
|
const WindowedCodeBlock = Loadable({
|
|
24
|
-
loader: () => import(
|
|
25
|
-
/* webpackChunkName: "@atlaskit-internal_renderer-node_WindowedCodeBlock" */
|
|
24
|
+
loader: () => import( /* webpackChunkName: "@atlaskit-internal_renderer-node_WindowedCodeBlock" */
|
|
26
25
|
'./codeBlock/windowedCodeBlock').then(mod => mod.default),
|
|
27
26
|
loading: () => null
|
|
28
27
|
});
|
|
29
28
|
const CodeBlock = Loadable({
|
|
30
|
-
loader: () => import(
|
|
31
|
-
/* webpackChunkName: "@atlaskit-internal_renderer-node_CodeBlock" */
|
|
29
|
+
loader: () => import( /* webpackChunkName: "@atlaskit-internal_renderer-node_CodeBlock" */
|
|
32
30
|
'./codeBlock/codeBlock').then(mod => mod.default),
|
|
33
31
|
loading: () => null
|
|
34
32
|
});
|
|
35
33
|
const TaskList = Loadable({
|
|
36
|
-
loader: () => import(
|
|
37
|
-
/* webpackChunkName: "@atlaskit-internal_renderer-node_TaskList" */
|
|
34
|
+
loader: () => import( /* webpackChunkName: "@atlaskit-internal_renderer-node_TaskList" */
|
|
38
35
|
'./taskList').then(mod => mod.default),
|
|
39
36
|
loading: () => null
|
|
40
37
|
});
|
|
41
38
|
const TaskItem = Loadable({
|
|
42
|
-
loader: () => import(
|
|
43
|
-
/* webpackChunkName: "@atlaskit-internal_renderer-node_TaskItem" */
|
|
39
|
+
loader: () => import( /* webpackChunkName: "@atlaskit-internal_renderer-node_TaskItem" */
|
|
44
40
|
'./taskItem').then(mod => mod.default),
|
|
45
41
|
loading: () => null
|
|
46
42
|
});
|
|
47
43
|
const DecisionList = Loadable({
|
|
48
|
-
loader: () => import(
|
|
49
|
-
/* webpackChunkName: "@atlaskit-internal_renderer-node_DecisionList" */
|
|
44
|
+
loader: () => import( /* webpackChunkName: "@atlaskit-internal_renderer-node_DecisionList" */
|
|
50
45
|
'./decisionList').then(mod => mod.default),
|
|
51
46
|
loading: () => null
|
|
52
47
|
});
|
|
53
48
|
const DecisionItem = Loadable({
|
|
54
|
-
loader: () => import(
|
|
55
|
-
/* webpackChunkName: "@atlaskit-internal_renderer-node_DecisionItem" */
|
|
49
|
+
loader: () => import( /* webpackChunkName: "@atlaskit-internal_renderer-node_DecisionItem" */
|
|
56
50
|
'./decisionItem').then(mod => mod.default),
|
|
57
51
|
loading: () => null
|
|
58
52
|
});
|
|
59
53
|
const Date = Loadable({
|
|
60
|
-
loader: () => import(
|
|
61
|
-
/* webpackChunkName: "@atlaskit-internal_renderer-node_Date" */
|
|
54
|
+
loader: () => import( /* webpackChunkName: "@atlaskit-internal_renderer-node_Date" */
|
|
62
55
|
'./date').then(mod => mod.default),
|
|
63
56
|
loading: () => null
|
|
64
57
|
});
|
|
65
58
|
const Status = Loadable({
|
|
66
|
-
loader: () => import(
|
|
67
|
-
/* webpackChunkName: "@atlaskit-internal_renderer-node_Status" */
|
|
59
|
+
loader: () => import( /* webpackChunkName: "@atlaskit-internal_renderer-node_Status" */
|
|
68
60
|
'./status').then(mod => mod.default),
|
|
69
61
|
loading: () => null
|
|
70
62
|
});
|
|
71
63
|
const Emoji = Loadable({
|
|
72
|
-
loader: () => import(
|
|
73
|
-
/* webpackChunkName: "@atlaskit-internal_renderer-node_Emoji" */
|
|
64
|
+
loader: () => import( /* webpackChunkName: "@atlaskit-internal_renderer-node_Emoji" */
|
|
74
65
|
'./emoji').then(mod => mod.default),
|
|
75
66
|
loading: () => null
|
|
76
67
|
});
|
|
77
68
|
const Panel = Loadable({
|
|
78
|
-
loader: () => import(
|
|
79
|
-
/* webpackChunkName: "@atlaskit-internal_renderer-node_Panel" */
|
|
69
|
+
loader: () => import( /* webpackChunkName: "@atlaskit-internal_renderer-node_Panel" */
|
|
80
70
|
'./panel').then(mod => mod.default),
|
|
81
71
|
loading: () => null
|
|
82
72
|
});
|
|
83
73
|
const EmbedCard = Loadable({
|
|
84
|
-
loader: () => import(
|
|
85
|
-
/* webpackChunkName: "@atlaskit-internal_renderer-node_EmbedCard" */
|
|
74
|
+
loader: () => import( /* webpackChunkName: "@atlaskit-internal_renderer-node_EmbedCard" */
|
|
86
75
|
'./embedCard').then(mod => mod.default),
|
|
87
76
|
loading: () => null
|
|
88
77
|
});
|
|
89
78
|
const InlineCard = Loadable({
|
|
90
|
-
loader: () => import(
|
|
91
|
-
/* webpackChunkName: "@atlaskit-internal_renderer-node_InlineCard" */
|
|
79
|
+
loader: () => import( /* webpackChunkName: "@atlaskit-internal_renderer-node_InlineCard" */
|
|
92
80
|
'./inlineCard').then(mod => mod.default),
|
|
93
81
|
loading: () => null
|
|
94
82
|
});
|
|
95
83
|
const BlockCard = Loadable({
|
|
96
|
-
loader: () => import(
|
|
97
|
-
/* webpackChunkName: "@atlaskit-internal_renderer-node_BlockCard" */
|
|
84
|
+
loader: () => import( /* webpackChunkName: "@atlaskit-internal_renderer-node_BlockCard" */
|
|
98
85
|
'./blockCard').then(mod => mod.default),
|
|
99
86
|
loading: () => null
|
|
100
87
|
});
|
|
101
88
|
const Media = Loadable({
|
|
102
|
-
loader: () => import(
|
|
103
|
-
/* webpackChunkName: "@atlaskit-internal_renderer-node_Media" */
|
|
89
|
+
loader: () => import( /* webpackChunkName: "@atlaskit-internal_renderer-node_Media" */
|
|
104
90
|
'./media').then(mod => mod.default),
|
|
105
91
|
loading: () => null
|
|
106
92
|
});
|
|
107
93
|
const MediaGroup = Loadable({
|
|
108
|
-
loader: () => import(
|
|
109
|
-
/* webpackChunkName: "@atlaskit-internal_renderer-node_MediaGroup" */
|
|
94
|
+
loader: () => import( /* webpackChunkName: "@atlaskit-internal_renderer-node_MediaGroup" */
|
|
110
95
|
'./mediaGroup').then(mod => mod.default),
|
|
111
96
|
loading: () => null
|
|
112
97
|
});
|
|
113
98
|
const MediaInline = Loadable({
|
|
114
|
-
loader: () => import(
|
|
115
|
-
/* webpackChunkName: "@atlaskit-internal_renderer-node_MediaInline" */
|
|
99
|
+
loader: () => import( /* webpackChunkName: "@atlaskit-internal_renderer-node_MediaInline" */
|
|
116
100
|
'./mediaInline').then(mod => mod.default),
|
|
117
101
|
loading: () => null
|
|
118
102
|
});
|
|
119
103
|
const MediaSingle = Loadable({
|
|
120
|
-
loader: () => import(
|
|
121
|
-
/* webpackChunkName: "@atlaskit-internal_renderer-node_MediaSingle" */
|
|
104
|
+
loader: () => import( /* webpackChunkName: "@atlaskit-internal_renderer-node_MediaSingle" */
|
|
122
105
|
'./mediaSingle').then(mod => mod.default),
|
|
123
106
|
loading: () => null
|
|
124
107
|
});
|
|
125
108
|
const Mention = Loadable({
|
|
126
|
-
loader: () => import(
|
|
127
|
-
/* webpackChunkName: "@atlaskit-internal_renderer-node_Mention" */
|
|
109
|
+
loader: () => import( /* webpackChunkName: "@atlaskit-internal_renderer-node_Mention" */
|
|
128
110
|
'./mention').then(mod => mod.default),
|
|
129
111
|
loading: () => null
|
|
130
112
|
});
|
|
131
113
|
const Expand = Loadable({
|
|
132
|
-
loader: () => import(
|
|
133
|
-
/* webpackChunkName: "@atlaskit-internal_renderer-node_Expand" */
|
|
114
|
+
loader: () => import( /* webpackChunkName: "@atlaskit-internal_renderer-node_Expand" */
|
|
134
115
|
'../../ui/Expand').then(mod => mod.default),
|
|
135
116
|
loading: () => null
|
|
136
117
|
});
|
|
@@ -181,22 +162,20 @@ export const toReact = (node, flags, nodeComponents) => {
|
|
|
181
162
|
if (node.type.name === 'doc' && (flags === null || flags === void 0 ? void 0 : flags.allowSelectAllTrap) === true) {
|
|
182
163
|
return DocWithSelectAllTrap;
|
|
183
164
|
}
|
|
184
|
-
|
|
185
165
|
if (node.type.name === 'codeBlock') {
|
|
186
166
|
if ((flags === null || flags === void 0 ? void 0 : flags.allowWindowedCodeBlock) === true) {
|
|
187
167
|
return WindowedCodeBlock;
|
|
188
168
|
}
|
|
189
|
-
|
|
190
169
|
return CodeBlock;
|
|
191
|
-
}
|
|
192
|
-
|
|
170
|
+
}
|
|
193
171
|
|
|
194
|
-
|
|
172
|
+
// Allowing custom components to override those provided in nodeToReact
|
|
173
|
+
const nodes = {
|
|
174
|
+
...nodeToReact,
|
|
195
175
|
...nodeComponents
|
|
196
176
|
};
|
|
197
177
|
return nodes[node.type.name];
|
|
198
178
|
};
|
|
199
|
-
|
|
200
179
|
/*
|
|
201
180
|
* Wraps adjacent textnodes in a textWrapper
|
|
202
181
|
*
|
|
@@ -244,9 +223,9 @@ export const mergeTextNodes = nodes => {
|
|
|
244
223
|
if (!isText(current.type.name)) {
|
|
245
224
|
acc.push(current);
|
|
246
225
|
return acc;
|
|
247
|
-
}
|
|
248
|
-
|
|
226
|
+
}
|
|
249
227
|
|
|
228
|
+
// Append node to previous node, if it was a text wrapper
|
|
250
229
|
if (acc.length > 0 && isTextWrapper(acc[acc.length - 1])) {
|
|
251
230
|
const textWrapper = acc[acc.length - 1];
|
|
252
231
|
textWrapper.content.push(current);
|
|
@@ -260,7 +239,6 @@ export const mergeTextNodes = nodes => {
|
|
|
260
239
|
nodeSize: current.nodeSize
|
|
261
240
|
});
|
|
262
241
|
}
|
|
263
|
-
|
|
264
242
|
return acc;
|
|
265
243
|
}, []);
|
|
266
244
|
};
|
|
@@ -274,57 +252,46 @@ export function isTextNode(node) {
|
|
|
274
252
|
return node.type.name === 'text';
|
|
275
253
|
}
|
|
276
254
|
const whitespaceRegex = /^\s*$/;
|
|
255
|
+
|
|
277
256
|
/**
|
|
278
257
|
* Detects whether a fragment contains a single paragraph node
|
|
279
258
|
* whose content satisfies the condition for an emoji block
|
|
280
259
|
*/
|
|
281
|
-
|
|
282
260
|
export const isEmojiDoc = doc => {
|
|
283
261
|
if (doc.childCount !== 1) {
|
|
284
262
|
return false;
|
|
285
263
|
}
|
|
286
|
-
|
|
287
264
|
const parentNodes = [];
|
|
288
265
|
doc.forEach(child => parentNodes.push(child));
|
|
289
266
|
const node = parentNodes[0];
|
|
290
267
|
return node.type.name === 'paragraph' && isEmojiBlock(node.content);
|
|
291
268
|
};
|
|
292
|
-
|
|
293
269
|
const isEmojiBlock = pnode => {
|
|
294
|
-
const content = [];
|
|
295
|
-
|
|
270
|
+
const content = [];
|
|
271
|
+
// Optimisation for long documents - worst case block will be space-emoji-space
|
|
296
272
|
if (pnode.childCount > 7) {
|
|
297
273
|
return false;
|
|
298
274
|
}
|
|
299
|
-
|
|
300
275
|
pnode.forEach(child => content.push(child));
|
|
301
276
|
let emojiCount = 0;
|
|
302
|
-
|
|
303
277
|
for (let i = 0; i < content.length; ++i) {
|
|
304
278
|
const node = content[i];
|
|
305
|
-
|
|
306
279
|
switch (node.type.name) {
|
|
307
280
|
case 'text':
|
|
308
281
|
if (node.text && !node.text.match(whitespaceRegex)) {
|
|
309
282
|
return false;
|
|
310
283
|
}
|
|
311
|
-
|
|
312
284
|
continue;
|
|
313
|
-
|
|
314
285
|
case 'emoji':
|
|
315
286
|
if (++emojiCount > 3) {
|
|
316
287
|
return false;
|
|
317
288
|
}
|
|
318
|
-
|
|
319
289
|
continue;
|
|
320
|
-
|
|
321
290
|
default:
|
|
322
291
|
// Only text and emoji nodes are allowed
|
|
323
292
|
return false;
|
|
324
293
|
}
|
|
325
294
|
}
|
|
326
|
-
|
|
327
295
|
return emojiCount > 0;
|
|
328
296
|
};
|
|
329
|
-
|
|
330
297
|
export { Blockquote, BodiedExtension, BulletList, BlockCard, Caption, CodeBlock, WindowedCodeBlock, Date, DecisionItem, DecisionList, Doc, DocWithSelectAllTrap, Emoji, Extension, Expand, HardBreak, Heading, ListItem, InlineCard, InlineExtension, LayoutSection, LayoutColumn, Media, MediaGroup, MediaInline, MediaSingle, Mention, OrderedList, Panel, Paragraph, Placeholder, Rule, Status, TaskItem, TaskList, Table, TableCell, TableRow, UnknownBlock, EmbedCard };
|
|
@@ -7,7 +7,6 @@ import { CardErrorBoundary } from './fallback';
|
|
|
7
7
|
import { withSmartCardStorage } from '../../ui/SmartCardStorage';
|
|
8
8
|
import { getCardClickHandler } from '../utils/getCardClickHandler';
|
|
9
9
|
import { useFeatureFlags } from '../../use-feature-flags';
|
|
10
|
-
|
|
11
10
|
const InlineCard = props => {
|
|
12
11
|
const {
|
|
13
12
|
url,
|
|
@@ -28,7 +27,6 @@ const InlineCard = props => {
|
|
|
28
27
|
showAuthTooltip,
|
|
29
28
|
ssr
|
|
30
29
|
} = smartLinks || {};
|
|
31
|
-
|
|
32
30
|
if (ssr && url) {
|
|
33
31
|
return /*#__PURE__*/React.createElement(CardSSR, {
|
|
34
32
|
appearance: "inline",
|
|
@@ -36,7 +34,6 @@ const InlineCard = props => {
|
|
|
36
34
|
showAuthTooltip: showAuthTooltip
|
|
37
35
|
});
|
|
38
36
|
}
|
|
39
|
-
|
|
40
37
|
return /*#__PURE__*/React.createElement("span", {
|
|
41
38
|
"data-inline-card": true,
|
|
42
39
|
"data-card-data": data ? JSON.stringify(data) : undefined,
|
|
@@ -52,10 +49,8 @@ const InlineCard = props => {
|
|
|
52
49
|
if (!data.url || !data.title) {
|
|
53
50
|
return;
|
|
54
51
|
}
|
|
55
|
-
|
|
56
52
|
props.smartCardStorage.set(data.url, data.title);
|
|
57
53
|
}
|
|
58
54
|
}))));
|
|
59
55
|
};
|
|
60
|
-
|
|
61
56
|
export default withSmartCardStorage(InlineCard);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import ExtensionRenderer from '../../ui/ExtensionRenderer';
|
|
4
|
-
|
|
5
4
|
const InlineExtension = props => {
|
|
6
5
|
const {
|
|
7
6
|
text
|
|
@@ -18,13 +17,11 @@ const InlineExtension = props => {
|
|
|
18
17
|
}
|
|
19
18
|
} catch (e) {
|
|
20
19
|
/** We don't want this error to block renderer */
|
|
21
|
-
|
|
22
20
|
/** We keep rendering the default content */
|
|
23
|
-
}
|
|
24
|
-
|
|
21
|
+
}
|
|
25
22
|
|
|
23
|
+
// Always return default content if anything goes wrong
|
|
26
24
|
return /*#__PURE__*/React.createElement("span", null, text || 'inlineExtension');
|
|
27
25
|
});
|
|
28
26
|
};
|
|
29
|
-
|
|
30
27
|
export default InlineExtension;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
-
|
|
4
3
|
/** @jsx jsx */
|
|
5
4
|
import React from 'react';
|
|
6
5
|
import { PureComponent } from 'react';
|
|
@@ -14,7 +13,6 @@ import { MODE, PLATFORM } from '../../analytics/events';
|
|
|
14
13
|
export default class Media extends PureComponent {
|
|
15
14
|
constructor(...args) {
|
|
16
15
|
super(...args);
|
|
17
|
-
|
|
18
16
|
_defineProperty(this, "renderCard", (providers = {}) => {
|
|
19
17
|
const {
|
|
20
18
|
mediaProvider,
|
|
@@ -51,14 +49,12 @@ export default class Media extends PureComponent {
|
|
|
51
49
|
css: mediaLinkStyle
|
|
52
50
|
}, mediaComponent) : mediaComponent;
|
|
53
51
|
});
|
|
54
|
-
|
|
55
52
|
_defineProperty(this, "handleMediaLinkClick", event => {
|
|
56
53
|
const {
|
|
57
54
|
fireAnalyticsEvent,
|
|
58
55
|
isLinkMark,
|
|
59
56
|
marks
|
|
60
57
|
} = this.props;
|
|
61
|
-
|
|
62
58
|
if (fireAnalyticsEvent) {
|
|
63
59
|
fireAnalyticsEvent({
|
|
64
60
|
action: ACTION.VISITED,
|
|
@@ -71,32 +67,26 @@ export default class Media extends PureComponent {
|
|
|
71
67
|
}
|
|
72
68
|
});
|
|
73
69
|
}
|
|
74
|
-
|
|
75
70
|
const linkMark = this.props.marks.find(this.props.isLinkMark);
|
|
76
71
|
const linkHref = linkMark === null || linkMark === void 0 ? void 0 : linkMark.attrs.href;
|
|
77
72
|
const handler = getEventHandler(this.props.eventHandlers, 'link');
|
|
78
|
-
|
|
79
73
|
if (handler) {
|
|
80
74
|
const linkMark = marks.find(isLinkMark);
|
|
81
75
|
handler(event, linkMark && linkHref);
|
|
82
76
|
}
|
|
83
77
|
});
|
|
84
78
|
}
|
|
85
|
-
|
|
86
79
|
render() {
|
|
87
80
|
const {
|
|
88
81
|
providers
|
|
89
82
|
} = this.props;
|
|
90
|
-
|
|
91
83
|
if (!providers) {
|
|
92
84
|
return this.renderCard();
|
|
93
85
|
}
|
|
94
|
-
|
|
95
86
|
return jsx(WithProviders, {
|
|
96
87
|
providers: ['mediaProvider', 'contextIdentifierProvider'],
|
|
97
88
|
providerFactory: providers,
|
|
98
89
|
renderNode: this.renderCard
|
|
99
90
|
});
|
|
100
91
|
}
|
|
101
|
-
|
|
102
92
|
}
|
|
@@ -6,18 +6,15 @@ import { FilmstripView } from '@atlaskit/media-filmstrip';
|
|
|
6
6
|
export default class MediaGroup extends PureComponent {
|
|
7
7
|
constructor(...args) {
|
|
8
8
|
super(...args);
|
|
9
|
-
|
|
10
9
|
_defineProperty(this, "state", {
|
|
11
10
|
animate: false,
|
|
12
11
|
offset: 0
|
|
13
12
|
});
|
|
14
|
-
|
|
15
13
|
_defineProperty(this, "handleSize", ({
|
|
16
14
|
offset
|
|
17
15
|
}) => this.setState({
|
|
18
16
|
offset
|
|
19
17
|
}));
|
|
20
|
-
|
|
21
18
|
_defineProperty(this, "handleScroll", ({
|
|
22
19
|
animate,
|
|
23
20
|
offset
|
|
@@ -25,7 +22,6 @@ export default class MediaGroup extends PureComponent {
|
|
|
25
22
|
animate,
|
|
26
23
|
offset
|
|
27
24
|
}));
|
|
28
|
-
|
|
29
25
|
_defineProperty(this, "onMediaClick", (cardClickHandler, child, surroundingItems) => (event, analyticsEvent) => {
|
|
30
26
|
const surroundings = {
|
|
31
27
|
collectionName: child.props.collection,
|
|
@@ -34,35 +30,28 @@ export default class MediaGroup extends PureComponent {
|
|
|
34
30
|
cardClickHandler(event, surroundings, analyticsEvent);
|
|
35
31
|
});
|
|
36
32
|
}
|
|
37
|
-
|
|
38
33
|
render() {
|
|
39
34
|
const numChildren = React.Children.count(this.props.children);
|
|
40
35
|
let content;
|
|
41
|
-
|
|
42
36
|
if (numChildren === 1) {
|
|
43
37
|
const card = React.Children.toArray(this.props.children)[0];
|
|
44
|
-
|
|
45
38
|
switch (card.props.type) {
|
|
46
39
|
case 'file':
|
|
47
40
|
content = this.renderSingleFile(card);
|
|
48
41
|
break;
|
|
49
|
-
|
|
50
42
|
case 'link':
|
|
51
43
|
content = null;
|
|
52
44
|
break;
|
|
53
|
-
|
|
54
45
|
default:
|
|
55
46
|
content = this.renderSingleLink(card);
|
|
56
47
|
}
|
|
57
48
|
} else {
|
|
58
49
|
content = this.renderStrip();
|
|
59
50
|
}
|
|
60
|
-
|
|
61
51
|
return /*#__PURE__*/React.createElement("div", {
|
|
62
52
|
className: "MediaGroup"
|
|
63
53
|
}, content);
|
|
64
54
|
}
|
|
65
|
-
|
|
66
55
|
renderSingleFile(child) {
|
|
67
56
|
return /*#__PURE__*/React.cloneElement(child, {
|
|
68
57
|
resizeMode: 'stretchy-fit',
|
|
@@ -72,20 +61,19 @@ export default class MediaGroup extends PureComponent {
|
|
|
72
61
|
enableDownloadButton: this.props.enableDownloadButton
|
|
73
62
|
});
|
|
74
63
|
}
|
|
75
|
-
|
|
76
64
|
renderSingleLink(child) {
|
|
77
65
|
return /*#__PURE__*/React.cloneElement(child, {
|
|
78
66
|
appearance: 'auto',
|
|
79
67
|
featureFlags: this.props.featureFlags
|
|
80
68
|
});
|
|
81
69
|
}
|
|
82
|
-
|
|
83
70
|
cloneFileCard(child, surroundingItems) {
|
|
84
71
|
const cardClickHandler = this.props && this.props.eventHandlers && this.props.eventHandlers.media && this.props.eventHandlers.media.onClick;
|
|
85
72
|
const onClick = cardClickHandler ? this.onMediaClick(cardClickHandler, child, surroundingItems) : undefined;
|
|
86
73
|
return /*#__PURE__*/React.cloneElement(child, {
|
|
87
74
|
useInlinePlayer: false,
|
|
88
|
-
eventHandlers: {
|
|
75
|
+
eventHandlers: {
|
|
76
|
+
...child.props.eventHandlers,
|
|
89
77
|
media: {
|
|
90
78
|
onClick
|
|
91
79
|
}
|
|
@@ -94,7 +82,6 @@ export default class MediaGroup extends PureComponent {
|
|
|
94
82
|
enableDownloadButton: this.props.enableDownloadButton
|
|
95
83
|
});
|
|
96
84
|
}
|
|
97
|
-
|
|
98
85
|
renderStrip() {
|
|
99
86
|
const {
|
|
100
87
|
children
|
|
@@ -111,14 +98,11 @@ export default class MediaGroup extends PureComponent {
|
|
|
111
98
|
onScroll: this.handleScroll
|
|
112
99
|
}, React.Children.map(children, rawChild => {
|
|
113
100
|
const child = rawChild;
|
|
114
|
-
|
|
115
101
|
switch (child.props.type) {
|
|
116
102
|
case 'file':
|
|
117
103
|
return this.cloneFileCard(child, surroundingItems);
|
|
118
|
-
|
|
119
104
|
case 'link':
|
|
120
105
|
return null;
|
|
121
|
-
|
|
122
106
|
default:
|
|
123
107
|
return /*#__PURE__*/React.cloneElement(child, {
|
|
124
108
|
featureFlags: this.props.featureFlags,
|
|
@@ -127,7 +111,6 @@ export default class MediaGroup extends PureComponent {
|
|
|
127
111
|
}
|
|
128
112
|
}));
|
|
129
113
|
}
|
|
130
|
-
|
|
131
114
|
mapMediaPropsToIdentifier({
|
|
132
115
|
id,
|
|
133
116
|
type,
|
|
@@ -142,10 +125,8 @@ export default class MediaGroup extends PureComponent {
|
|
|
142
125
|
occurrenceKey,
|
|
143
126
|
collectionName: collection
|
|
144
127
|
};
|
|
145
|
-
|
|
146
128
|
case 'link':
|
|
147
129
|
return undefined;
|
|
148
|
-
|
|
149
130
|
case 'external':
|
|
150
131
|
return {
|
|
151
132
|
id: id,
|
|
@@ -155,5 +136,4 @@ export default class MediaGroup extends PureComponent {
|
|
|
155
136
|
};
|
|
156
137
|
}
|
|
157
138
|
}
|
|
158
|
-
|
|
159
139
|
}
|
|
@@ -13,33 +13,29 @@ export const RenderMediaInline = props => {
|
|
|
13
13
|
useEffect(() => {
|
|
14
14
|
updateViewMediaClientConfigState(mediaProvider);
|
|
15
15
|
}, [mediaProvider]);
|
|
16
|
-
|
|
17
16
|
const updateViewMediaClientConfigState = async mediaProvider => {
|
|
18
17
|
if (mediaProvider) {
|
|
19
18
|
const mediaClientConfig = await mediaProvider;
|
|
20
19
|
setViewMediaClientConfigState(mediaClientConfig.viewMediaClientConfig);
|
|
21
20
|
}
|
|
22
21
|
};
|
|
22
|
+
|
|
23
23
|
/*
|
|
24
24
|
* Only show the loading view if the media provider is not ready
|
|
25
25
|
* prevents calling the media API before the provider is ready
|
|
26
26
|
*/
|
|
27
|
-
|
|
28
|
-
|
|
29
27
|
if (!viewMediaClientConfigState) {
|
|
30
28
|
return /*#__PURE__*/React.createElement(MediaInlineCardLoadingView, {
|
|
31
29
|
message: "",
|
|
32
30
|
isSelected: false
|
|
33
31
|
});
|
|
34
32
|
}
|
|
35
|
-
|
|
36
33
|
return /*#__PURE__*/React.createElement(MediaInlineCard, {
|
|
37
34
|
identifier: props.identifier,
|
|
38
35
|
shouldOpenMediaViewer: true,
|
|
39
36
|
mediaClientConfig: viewMediaClientConfigState
|
|
40
37
|
});
|
|
41
38
|
};
|
|
42
|
-
|
|
43
39
|
const MediaInline = props => {
|
|
44
40
|
const {
|
|
45
41
|
collection,
|
|
@@ -67,13 +63,11 @@ const MediaInline = props => {
|
|
|
67
63
|
const {
|
|
68
64
|
mediaProvider
|
|
69
65
|
} = providers;
|
|
70
|
-
|
|
71
66
|
if (!mediaProvider) {
|
|
72
67
|
return /*#__PURE__*/React.createElement(MediaInlineCardErroredView, {
|
|
73
68
|
message: (intl || defaultIntl).formatMessage(messages.couldnt_load_file)
|
|
74
69
|
});
|
|
75
70
|
}
|
|
76
|
-
|
|
77
71
|
return /*#__PURE__*/React.createElement(RenderMediaInline, {
|
|
78
72
|
identifier: identifier,
|
|
79
73
|
mediaProvider: mediaProvider
|
|
@@ -81,5 +75,4 @@ const MediaInline = props => {
|
|
|
81
75
|
}
|
|
82
76
|
}));
|
|
83
77
|
};
|
|
84
|
-
|
|
85
78
|
export default injectIntl(MediaInline);
|