@atlaskit/renderer 105.1.0 → 105.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/cjs/actions/index.js +19 -71
- package/dist/cjs/actions/matches-utils.js +10 -11
- package/dist/cjs/actions.js +0 -2
- package/dist/cjs/analytics/analyticsContext.js +0 -4
- package/dist/cjs/analytics/events.js +0 -5
- package/dist/cjs/analytics/unsupported-content.js +14 -27
- package/dist/cjs/i18n/cs.js +0 -1
- package/dist/cjs/i18n/da.js +0 -1
- package/dist/cjs/i18n/de.js +0 -1
- package/dist/cjs/i18n/en.js +0 -1
- package/dist/cjs/i18n/en_GB.js +0 -1
- package/dist/cjs/i18n/en_ZZ.js +0 -1
- package/dist/cjs/i18n/es.js +0 -1
- package/dist/cjs/i18n/et.js +0 -1
- package/dist/cjs/i18n/fi.js +0 -1
- package/dist/cjs/i18n/fr.js +0 -1
- package/dist/cjs/i18n/hu.js +0 -1
- package/dist/cjs/i18n/index.js +0 -26
- package/dist/cjs/i18n/it.js +0 -1
- package/dist/cjs/i18n/ja.js +0 -1
- package/dist/cjs/i18n/ko.js +0 -1
- package/dist/cjs/i18n/nb.js +0 -1
- package/dist/cjs/i18n/nl.js +0 -1
- package/dist/cjs/i18n/pl.js +0 -1
- package/dist/cjs/i18n/pt_BR.js +0 -1
- package/dist/cjs/i18n/pt_PT.js +0 -1
- package/dist/cjs/i18n/ru.js +0 -1
- package/dist/cjs/i18n/sk.js +0 -1
- package/dist/cjs/i18n/sv.js +0 -1
- package/dist/cjs/i18n/th.js +0 -1
- package/dist/cjs/i18n/tr.js +0 -1
- package/dist/cjs/i18n/uk.js +0 -1
- package/dist/cjs/i18n/vi.js +0 -1
- package/dist/cjs/i18n/zh.js +0 -1
- package/dist/cjs/i18n/zh_TW.js +0 -1
- package/dist/cjs/index.js +0 -6
- package/dist/cjs/messages.js +0 -2
- package/dist/cjs/react/hooks/use-bidi-warnings.js +2 -12
- package/dist/cjs/react/hooks/use-in-viewport.js +4 -17
- package/dist/cjs/react/hooks/use-observed-width.js +20 -35
- package/dist/cjs/react/index.js +27 -114
- package/dist/cjs/react/marks/alignment.js +0 -9
- package/dist/cjs/react/marks/annotation.js +6 -21
- package/dist/cjs/react/marks/breakout.js +0 -9
- package/dist/cjs/react/marks/code.js +0 -11
- package/dist/cjs/react/marks/confluence-inline-comment.js +2 -19
- package/dist/cjs/react/marks/data-consumer.js +0 -4
- package/dist/cjs/react/marks/em.js +0 -3
- package/dist/cjs/react/marks/fragment.js +0 -4
- package/dist/cjs/react/marks/indentation.js +0 -3
- package/dist/cjs/react/marks/index.js +1 -24
- package/dist/cjs/react/marks/link.js +5 -25
- package/dist/cjs/react/marks/strike.js +0 -4
- package/dist/cjs/react/marks/strong.js +0 -3
- package/dist/cjs/react/marks/subsup.js +0 -5
- package/dist/cjs/react/marks/textColor.js +0 -9
- package/dist/cjs/react/marks/underline.js +0 -3
- package/dist/cjs/react/marks/unsupportedMark.js +0 -3
- package/dist/cjs/react/marks/unsupportedNodeAttribute.js +0 -3
- package/dist/cjs/react/nodes/blockCard.js +4 -16
- package/dist/cjs/react/nodes/blockquote.js +0 -3
- package/dist/cjs/react/nodes/bodiedExtension.js +6 -17
- package/dist/cjs/react/nodes/bulletList.js +0 -5
- package/dist/cjs/react/nodes/caption.js +1 -6
- package/dist/cjs/react/nodes/codeBlock/codeBlock.js +5 -14
- package/dist/cjs/react/nodes/codeBlock/components/codeBlockContainer.js +3 -16
- package/dist/cjs/react/nodes/codeBlock/components/lightWeightCodeBlock.js +6 -23
- package/dist/cjs/react/nodes/codeBlock/windowedCodeBlock.js +9 -32
- package/dist/cjs/react/nodes/codeBlockCopyButton.js +7 -31
- package/dist/cjs/react/nodes/date.js +5 -33
- package/dist/cjs/react/nodes/decisionItem.js +1 -5
- package/dist/cjs/react/nodes/decisionList.js +0 -20
- package/dist/cjs/react/nodes/doc.js +0 -6
- package/dist/cjs/react/nodes/embedCard.js +25 -54
- package/dist/cjs/react/nodes/emoji.js +6 -24
- package/dist/cjs/react/nodes/extension.js +12 -26
- package/dist/cjs/react/nodes/fallback.js +2 -24
- package/dist/cjs/react/nodes/hardBreak.js +1 -7
- package/dist/cjs/react/nodes/heading-anchor.js +1 -46
- package/dist/cjs/react/nodes/heading.js +4 -17
- package/dist/cjs/react/nodes/index.js +7 -62
- package/dist/cjs/react/nodes/inline.js +0 -6
- package/dist/cjs/react/nodes/inlineCard.js +6 -23
- package/dist/cjs/react/nodes/inlineExtension.js +2 -10
- package/dist/cjs/react/nodes/layoutColumn.js +0 -8
- package/dist/cjs/react/nodes/layoutSection.js +0 -3
- package/dist/cjs/react/nodes/listItem.js +0 -3
- package/dist/cjs/react/nodes/media.js +10 -49
- package/dist/cjs/react/nodes/mediaGroup.js +6 -47
- package/dist/cjs/react/nodes/mediaInline.js +7 -37
- package/dist/cjs/react/nodes/mediaSingle/index.js +38 -85
- package/dist/cjs/react/nodes/mediaSingle/styles.js +0 -5
- package/dist/cjs/react/nodes/mention.js +5 -23
- package/dist/cjs/react/nodes/orderedList.js +0 -14
- package/dist/cjs/react/nodes/panel.js +10 -38
- package/dist/cjs/react/nodes/paragraph.js +1 -5
- package/dist/cjs/react/nodes/placeholder.js +0 -4
- package/dist/cjs/react/nodes/rule.js +0 -3
- package/dist/cjs/react/nodes/status.js +3 -22
- package/dist/cjs/react/nodes/table/colgroup.js +12 -26
- package/dist/cjs/react/nodes/table/sticky.js +17 -47
- package/dist/cjs/react/nodes/table/table.js +5 -10
- package/dist/cjs/react/nodes/table.js +19 -102
- package/dist/cjs/react/nodes/tableCell.js +26 -79
- package/dist/cjs/react/nodes/tableRow.js +4 -33
- package/dist/cjs/react/nodes/task-item-with-providers.js +4 -40
- package/dist/cjs/react/nodes/taskItem.js +8 -36
- package/dist/cjs/react/nodes/taskList.js +2 -22
- package/dist/cjs/react/nodes/text-wrapper.js +1 -8
- package/dist/cjs/react/nodes/unknownBlock.js +0 -3
- package/dist/cjs/react/renderer-node.js +0 -6
- package/dist/cjs/react/utils/clipboard.js +0 -3
- package/dist/cjs/react/utils/element-selection.js +0 -13
- package/dist/cjs/react/utils/getCardClickHandler.js +0 -3
- package/dist/cjs/react/utils/inject-props.js +4 -9
- package/dist/cjs/react/utils/links.js +2 -6
- package/dist/cjs/react/utils/lists.js +0 -1
- package/dist/cjs/react/utils/performance/RenderTracking.js +2 -10
- package/dist/cjs/react/utils/use-select-all-trap.js +1 -23
- package/dist/cjs/render-document.js +42 -83
- package/dist/cjs/renderer-context.js +0 -5
- package/dist/cjs/steps/index.js +7 -39
- package/dist/cjs/text/index.js +0 -9
- package/dist/cjs/text/nodes/blockquote.js +0 -3
- package/dist/cjs/text/nodes/bulletList.js +0 -3
- package/dist/cjs/text/nodes/date.js +0 -4
- package/dist/cjs/text/nodes/decisionItem.js +0 -5
- package/dist/cjs/text/nodes/hardBreak.js +0 -2
- package/dist/cjs/text/nodes/heading.js +0 -3
- package/dist/cjs/text/nodes/index.js +0 -21
- package/dist/cjs/text/nodes/inlineCard.js +0 -4
- package/dist/cjs/text/nodes/listItem.js +0 -3
- package/dist/cjs/text/nodes/mediaGroup.js +0 -4
- package/dist/cjs/text/nodes/mention.js +0 -3
- package/dist/cjs/text/nodes/orderedList.js +0 -4
- package/dist/cjs/text/nodes/panel.js +0 -3
- package/dist/cjs/text/nodes/paragraph.js +0 -5
- package/dist/cjs/text/nodes/rule.js +0 -2
- package/dist/cjs/text/nodes/status.js +0 -3
- package/dist/cjs/text/nodes/table.js +0 -5
- package/dist/cjs/text/nodes/taskItem.js +0 -5
- package/dist/cjs/text/nodes/unknown.js +0 -6
- package/dist/cjs/text-serializer.js +0 -2
- package/dist/cjs/ui/Expand.js +15 -59
- package/dist/cjs/ui/ExtensionRenderer.js +10 -43
- package/dist/cjs/ui/MediaCard.js +40 -116
- package/dist/cjs/ui/Renderer/ErrorBoundary.js +0 -26
- package/dist/cjs/ui/Renderer/breakout-ssr.js +6 -32
- package/dist/cjs/ui/Renderer/click-to-edit.js +0 -6
- package/dist/cjs/ui/Renderer/index.js +47 -149
- package/dist/cjs/ui/Renderer/style.js +1 -39
- package/dist/cjs/ui/Renderer/truncated-wrapper.js +12 -30
- package/dist/cjs/ui/RendererActionsContext/WithRendererActions.js +0 -4
- package/dist/cjs/ui/RendererActionsContext/index.js +1 -11
- package/dist/cjs/ui/SmartCardStorage.js +0 -20
- package/dist/cjs/ui/SortingIcon.js +10 -40
- package/dist/cjs/ui/TaskItemsFormatContext/TaskItemsFormatContext.js +0 -11
- package/dist/cjs/ui/TaskItemsFormatContext/index.js +0 -1
- package/dist/cjs/ui/active-header-id-provider.js +6 -19
- package/dist/cjs/ui/annotations/context.js +0 -24
- package/dist/cjs/ui/annotations/draft/component.js +5 -42
- package/dist/cjs/ui/annotations/draft/dom.js +3 -17
- package/dist/cjs/ui/annotations/draft/index.js +0 -2
- package/dist/cjs/ui/annotations/draft/position.js +1 -12
- package/dist/cjs/ui/annotations/draft/text.js +2 -8
- package/dist/cjs/ui/annotations/element/index.js +4 -16
- package/dist/cjs/ui/annotations/element/mark.js +8 -26
- package/dist/cjs/ui/annotations/hooks/index.js +0 -3
- package/dist/cjs/ui/annotations/hooks/use-events.js +13 -45
- package/dist/cjs/ui/annotations/hooks/use-inline-comment-subscriber.js +0 -6
- package/dist/cjs/ui/annotations/hooks/use-inline-comments-filter.js +1 -8
- package/dist/cjs/ui/annotations/hooks/use-load-annotations.js +4 -19
- package/dist/cjs/ui/annotations/hooks/user-selection.js +3 -18
- package/dist/cjs/ui/annotations/hooks/utils.js +0 -2
- package/dist/cjs/ui/annotations/index.js +4 -20
- package/dist/cjs/ui/annotations/selection/index.js +0 -1
- package/dist/cjs/ui/annotations/selection/mounter.js +13 -42
- package/dist/cjs/ui/annotations/selection/range-validator.js +9 -23
- package/dist/cjs/ui/annotations/selection/wrapper.js +3 -13
- package/dist/cjs/ui/annotations/types.js +0 -1
- package/dist/cjs/ui/annotations/view/index.js +1 -12
- package/dist/cjs/ui/index.js +0 -2
- package/dist/cjs/use-feature-flags.js +0 -4
- package/dist/cjs/utils.js +1 -19
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/actions/index.js +6 -50
- package/dist/es2019/actions/matches-utils.js +10 -9
- package/dist/es2019/actions.js +2 -1
- package/dist/es2019/analytics/events.js +0 -5
- package/dist/es2019/analytics/unsupported-content.js +8 -14
- package/dist/es2019/react/hooks/use-bidi-warnings.js +0 -2
- package/dist/es2019/react/hooks/use-in-viewport.js +0 -1
- package/dist/es2019/react/hooks/use-observed-width.js +0 -2
- package/dist/es2019/react/index.js +44 -119
- package/dist/es2019/react/marks/alignment.js +0 -3
- package/dist/es2019/react/marks/annotation.js +2 -5
- package/dist/es2019/react/marks/confluence-inline-comment.js +0 -1
- package/dist/es2019/react/marks/index.js +2 -1
- package/dist/es2019/react/marks/link.js +0 -6
- package/dist/es2019/react/marks/subsup.js +0 -3
- package/dist/es2019/react/nodes/bodiedExtension.js +2 -5
- package/dist/es2019/react/nodes/caption.js +0 -2
- package/dist/es2019/react/nodes/codeBlock/codeBlock.js +0 -2
- package/dist/es2019/react/nodes/codeBlock/components/codeBlockContainer.js +1 -3
- package/dist/es2019/react/nodes/codeBlock/windowedCodeBlock.js +1 -6
- package/dist/es2019/react/nodes/codeBlockCopyButton.js +0 -4
- package/dist/es2019/react/nodes/date.js +0 -7
- package/dist/es2019/react/nodes/decisionList.js +0 -3
- package/dist/es2019/react/nodes/embedCard.js +8 -16
- package/dist/es2019/react/nodes/emoji.js +0 -1
- package/dist/es2019/react/nodes/extension.js +4 -6
- package/dist/es2019/react/nodes/fallback.js +0 -8
- package/dist/es2019/react/nodes/hardBreak.js +0 -3
- package/dist/es2019/react/nodes/heading-anchor.js +0 -15
- package/dist/es2019/react/nodes/heading.js +0 -6
- package/dist/es2019/react/nodes/index.js +28 -61
- package/dist/es2019/react/nodes/inline.js +0 -2
- package/dist/es2019/react/nodes/inlineCard.js +0 -5
- package/dist/es2019/react/nodes/inlineExtension.js +2 -5
- package/dist/es2019/react/nodes/media.js +0 -10
- package/dist/es2019/react/nodes/mediaGroup.js +2 -22
- package/dist/es2019/react/nodes/mediaInline.js +1 -8
- package/dist/es2019/react/nodes/mediaSingle/index.js +8 -29
- package/dist/es2019/react/nodes/mention.js +0 -1
- package/dist/es2019/react/nodes/orderedList.js +0 -5
- package/dist/es2019/react/nodes/panel.js +4 -17
- package/dist/es2019/react/nodes/placeholder.js +0 -1
- package/dist/es2019/react/nodes/status.js +0 -1
- package/dist/es2019/react/nodes/table/colgroup.js +9 -18
- package/dist/es2019/react/nodes/table/sticky.js +3 -16
- package/dist/es2019/react/nodes/table.js +9 -75
- package/dist/es2019/react/nodes/tableCell.js +4 -31
- package/dist/es2019/react/nodes/tableRow.js +0 -10
- package/dist/es2019/react/nodes/task-item-with-providers.js +0 -6
- package/dist/es2019/react/nodes/taskItem.js +0 -7
- package/dist/es2019/react/nodes/taskList.js +0 -3
- package/dist/es2019/react/nodes/text-wrapper.js +0 -4
- package/dist/es2019/react/utils/clipboard.js +0 -1
- package/dist/es2019/react/utils/element-selection.js +0 -12
- package/dist/es2019/react/utils/inject-props.js +5 -7
- package/dist/es2019/react/utils/links.js +2 -4
- package/dist/es2019/react/utils/performance/RenderTracking.js +0 -1
- package/dist/es2019/react/utils/use-select-all-trap.js +0 -7
- package/dist/es2019/render-document.js +16 -33
- package/dist/es2019/steps/index.js +4 -33
- package/dist/es2019/text/index.js +0 -3
- package/dist/es2019/text/nodes/blockquote.js +0 -2
- package/dist/es2019/text/nodes/bulletList.js +0 -2
- package/dist/es2019/text/nodes/date.js +0 -2
- package/dist/es2019/text/nodes/decisionItem.js +0 -4
- package/dist/es2019/text/nodes/hardBreak.js +0 -1
- package/dist/es2019/text/nodes/heading.js +0 -2
- package/dist/es2019/text/nodes/inlineCard.js +0 -3
- package/dist/es2019/text/nodes/listItem.js +0 -2
- package/dist/es2019/text/nodes/mediaGroup.js +0 -3
- package/dist/es2019/text/nodes/mention.js +0 -2
- package/dist/es2019/text/nodes/orderedList.js +0 -2
- package/dist/es2019/text/nodes/panel.js +0 -2
- package/dist/es2019/text/nodes/paragraph.js +0 -4
- package/dist/es2019/text/nodes/rule.js +0 -1
- package/dist/es2019/text/nodes/status.js +0 -2
- package/dist/es2019/text/nodes/table.js +0 -4
- package/dist/es2019/text/nodes/taskItem.js +0 -4
- package/dist/es2019/text/nodes/unknown.js +0 -4
- package/dist/es2019/ui/Expand.js +2 -17
- package/dist/es2019/ui/ExtensionRenderer.js +0 -19
- package/dist/es2019/ui/MediaCard.js +9 -40
- package/dist/es2019/ui/Renderer/ErrorBoundary.js +0 -10
- package/dist/es2019/ui/Renderer/breakout-ssr.js +6 -26
- package/dist/es2019/ui/Renderer/click-to-edit.js +1 -4
- package/dist/es2019/ui/Renderer/index.js +17 -66
- package/dist/es2019/ui/Renderer/style.js +0 -14
- package/dist/es2019/ui/Renderer/truncated-wrapper.js +2 -6
- package/dist/es2019/ui/SmartCardStorage.js +0 -1
- package/dist/es2019/ui/SortingIcon.js +3 -20
- package/dist/es2019/ui/TaskItemsFormatContext/TaskItemsFormatContext.js +0 -2
- package/dist/es2019/ui/active-header-id-provider.js +0 -3
- package/dist/es2019/ui/annotations/context.js +0 -6
- package/dist/es2019/ui/annotations/draft/component.js +0 -13
- package/dist/es2019/ui/annotations/draft/dom.js +0 -6
- package/dist/es2019/ui/annotations/draft/position.js +0 -8
- package/dist/es2019/ui/annotations/draft/text.js +0 -1
- package/dist/es2019/ui/annotations/element/index.js +0 -3
- package/dist/es2019/ui/annotations/element/mark.js +4 -6
- package/dist/es2019/ui/annotations/hooks/use-events.js +4 -13
- package/dist/es2019/ui/annotations/hooks/use-inline-comment-subscriber.js +0 -2
- package/dist/es2019/ui/annotations/hooks/use-inline-comments-filter.js +0 -1
- package/dist/es2019/ui/annotations/hooks/use-load-annotations.js +4 -8
- package/dist/es2019/ui/annotations/hooks/user-selection.js +0 -6
- package/dist/es2019/ui/annotations/selection/mounter.js +0 -13
- package/dist/es2019/ui/annotations/selection/range-validator.js +0 -2
- package/dist/es2019/ui/annotations/selection/wrapper.js +0 -2
- package/dist/es2019/ui/annotations/types.js +0 -1
- package/dist/es2019/ui/annotations/view/index.js +0 -4
- package/dist/es2019/use-feature-flags.js +0 -1
- package/dist/es2019/utils.js +1 -8
- package/dist/es2019/version.json +1 -1
- package/dist/esm/actions/index.js +19 -63
- package/dist/esm/actions/matches-utils.js +10 -9
- package/dist/esm/actions.js +2 -1
- package/dist/esm/analytics/events.js +0 -5
- package/dist/esm/analytics/unsupported-content.js +14 -21
- package/dist/esm/react/hooks/use-bidi-warnings.js +2 -4
- package/dist/esm/react/hooks/use-in-viewport.js +4 -13
- package/dist/esm/react/hooks/use-observed-width.js +20 -29
- package/dist/esm/react/index.js +27 -111
- package/dist/esm/react/marks/alignment.js +0 -4
- package/dist/esm/react/marks/annotation.js +6 -14
- package/dist/esm/react/marks/breakout.js +0 -2
- package/dist/esm/react/marks/confluence-inline-comment.js +2 -12
- package/dist/esm/react/marks/index.js +2 -1
- package/dist/esm/react/marks/link.js +5 -12
- package/dist/esm/react/marks/subsup.js +0 -3
- package/dist/esm/react/nodes/blockCard.js +4 -4
- package/dist/esm/react/nodes/bodiedExtension.js +6 -10
- package/dist/esm/react/nodes/caption.js +1 -3
- package/dist/esm/react/nodes/codeBlock/codeBlock.js +4 -6
- package/dist/esm/react/nodes/codeBlock/components/codeBlockContainer.js +4 -8
- package/dist/esm/react/nodes/codeBlock/components/lightWeightCodeBlock.js +6 -10
- package/dist/esm/react/nodes/codeBlock/windowedCodeBlock.js +10 -21
- package/dist/esm/react/nodes/codeBlockCopyButton.js +7 -15
- package/dist/esm/react/nodes/date.js +5 -20
- package/dist/esm/react/nodes/decisionItem.js +1 -1
- package/dist/esm/react/nodes/decisionList.js +0 -12
- package/dist/esm/react/nodes/embedCard.js +25 -39
- package/dist/esm/react/nodes/emoji.js +6 -16
- package/dist/esm/react/nodes/extension.js +12 -16
- package/dist/esm/react/nodes/fallback.js +2 -18
- package/dist/esm/react/nodes/hardBreak.js +1 -5
- package/dist/esm/react/nodes/heading-anchor.js +1 -32
- package/dist/esm/react/nodes/heading.js +4 -10
- package/dist/esm/react/nodes/index.js +26 -64
- package/dist/esm/react/nodes/inline.js +0 -2
- package/dist/esm/react/nodes/inlineCard.js +6 -12
- package/dist/esm/react/nodes/inlineExtension.js +2 -6
- package/dist/esm/react/nodes/layoutColumn.js +0 -2
- package/dist/esm/react/nodes/media.js +10 -34
- package/dist/esm/react/nodes/mediaGroup.js +6 -37
- package/dist/esm/react/nodes/mediaInline.js +7 -20
- package/dist/esm/react/nodes/mediaSingle/index.js +37 -66
- package/dist/esm/react/nodes/mediaSingle/styles.js +0 -2
- package/dist/esm/react/nodes/mention.js +5 -15
- package/dist/esm/react/nodes/orderedList.js +0 -5
- package/dist/esm/react/nodes/panel.js +12 -28
- package/dist/esm/react/nodes/paragraph.js +1 -1
- package/dist/esm/react/nodes/placeholder.js +0 -1
- package/dist/esm/react/nodes/status.js +3 -13
- package/dist/esm/react/nodes/table/colgroup.js +12 -21
- package/dist/esm/react/nodes/table/sticky.js +17 -32
- package/dist/esm/react/nodes/table/table.js +5 -5
- package/dist/esm/react/nodes/table.js +19 -95
- package/dist/esm/react/nodes/tableCell.js +26 -66
- package/dist/esm/react/nodes/tableRow.js +4 -25
- package/dist/esm/react/nodes/task-item-with-providers.js +4 -27
- package/dist/esm/react/nodes/taskItem.js +8 -24
- package/dist/esm/react/nodes/taskList.js +2 -14
- package/dist/esm/react/nodes/text-wrapper.js +1 -5
- package/dist/esm/react/utils/clipboard.js +0 -1
- package/dist/esm/react/utils/element-selection.js +0 -10
- package/dist/esm/react/utils/inject-props.js +5 -7
- package/dist/esm/react/utils/links.js +2 -4
- package/dist/esm/react/utils/performance/RenderTracking.js +2 -4
- package/dist/esm/react/utils/use-select-all-trap.js +1 -9
- package/dist/esm/render-document.js +42 -70
- package/dist/esm/steps/index.js +7 -36
- package/dist/esm/text/index.js +0 -6
- package/dist/esm/text/nodes/blockquote.js +0 -2
- package/dist/esm/text/nodes/bulletList.js +0 -2
- package/dist/esm/text/nodes/date.js +0 -2
- package/dist/esm/text/nodes/decisionItem.js +0 -4
- package/dist/esm/text/nodes/hardBreak.js +0 -1
- package/dist/esm/text/nodes/heading.js +0 -2
- package/dist/esm/text/nodes/inlineCard.js +0 -3
- package/dist/esm/text/nodes/listItem.js +0 -2
- package/dist/esm/text/nodes/mediaGroup.js +0 -3
- package/dist/esm/text/nodes/mention.js +0 -2
- package/dist/esm/text/nodes/orderedList.js +0 -2
- package/dist/esm/text/nodes/panel.js +0 -2
- package/dist/esm/text/nodes/paragraph.js +0 -4
- package/dist/esm/text/nodes/rule.js +0 -1
- package/dist/esm/text/nodes/status.js +0 -2
- package/dist/esm/text/nodes/table.js +0 -4
- package/dist/esm/text/nodes/taskItem.js +0 -4
- package/dist/esm/text/nodes/unknown.js +0 -4
- package/dist/esm/ui/Expand.js +15 -36
- package/dist/esm/ui/ExtensionRenderer.js +10 -39
- package/dist/esm/ui/MediaCard.js +42 -99
- package/dist/esm/ui/Renderer/ErrorBoundary.js +0 -16
- package/dist/esm/ui/Renderer/breakout-ssr.js +7 -27
- package/dist/esm/ui/Renderer/click-to-edit.js +1 -4
- package/dist/esm/ui/Renderer/index.js +47 -110
- package/dist/esm/ui/Renderer/style.js +1 -21
- package/dist/esm/ui/Renderer/truncated-wrapper.js +12 -23
- package/dist/esm/ui/RendererActionsContext/index.js +1 -1
- package/dist/esm/ui/SmartCardStorage.js +0 -9
- package/dist/esm/ui/SortingIcon.js +10 -29
- package/dist/esm/ui/TaskItemsFormatContext/TaskItemsFormatContext.js +0 -2
- package/dist/esm/ui/active-header-id-provider.js +6 -12
- package/dist/esm/ui/annotations/context.js +0 -15
- package/dist/esm/ui/annotations/draft/component.js +5 -19
- package/dist/esm/ui/annotations/draft/dom.js +3 -11
- package/dist/esm/ui/annotations/draft/position.js +1 -9
- package/dist/esm/ui/annotations/draft/text.js +2 -4
- package/dist/esm/ui/annotations/element/index.js +4 -7
- package/dist/esm/ui/annotations/element/mark.js +8 -14
- package/dist/esm/ui/annotations/hooks/use-events.js +13 -32
- package/dist/esm/ui/annotations/hooks/use-inline-comment-subscriber.js +0 -2
- package/dist/esm/ui/annotations/hooks/use-inline-comments-filter.js +1 -2
- package/dist/esm/ui/annotations/hooks/use-load-annotations.js +4 -12
- package/dist/esm/ui/annotations/hooks/user-selection.js +3 -11
- package/dist/esm/ui/annotations/index.js +4 -6
- package/dist/esm/ui/annotations/selection/mounter.js +13 -29
- package/dist/esm/ui/annotations/selection/range-validator.js +9 -12
- package/dist/esm/ui/annotations/selection/wrapper.js +3 -5
- package/dist/esm/ui/annotations/types.js +0 -1
- package/dist/esm/ui/annotations/view/index.js +1 -5
- package/dist/esm/use-feature-flags.js +0 -1
- package/dist/esm/utils.js +1 -8
- package/dist/esm/version.json +1 -1
- package/package.json +2 -2
|
@@ -7,13 +7,12 @@ 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
|
var InlineCard = function InlineCard(props) {
|
|
12
11
|
var url = props.url,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
data = props.data,
|
|
13
|
+
eventHandlers = props.eventHandlers,
|
|
14
|
+
portal = props.portal,
|
|
15
|
+
smartLinks = props.smartLinks;
|
|
17
16
|
var onClick = getCardClickHandler(eventHandlers, url);
|
|
18
17
|
var cardProps = {
|
|
19
18
|
url: url,
|
|
@@ -22,11 +21,9 @@ var InlineCard = function InlineCard(props) {
|
|
|
22
21
|
container: portal
|
|
23
22
|
};
|
|
24
23
|
var featureFlags = useFeatureFlags();
|
|
25
|
-
|
|
26
24
|
var _ref = smartLinks || {},
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
showAuthTooltip = _ref.showAuthTooltip,
|
|
26
|
+
ssr = _ref.ssr;
|
|
30
27
|
if (ssr && url) {
|
|
31
28
|
return /*#__PURE__*/React.createElement(CardSSR, {
|
|
32
29
|
appearance: "inline",
|
|
@@ -34,7 +31,6 @@ var InlineCard = function InlineCard(props) {
|
|
|
34
31
|
showAuthTooltip: showAuthTooltip
|
|
35
32
|
});
|
|
36
33
|
}
|
|
37
|
-
|
|
38
34
|
return /*#__PURE__*/React.createElement("span", {
|
|
39
35
|
"data-inline-card": true,
|
|
40
36
|
"data-card-data": data ? JSON.stringify(data) : undefined,
|
|
@@ -50,10 +46,8 @@ var InlineCard = function InlineCard(props) {
|
|
|
50
46
|
if (!data.url || !data.title) {
|
|
51
47
|
return;
|
|
52
48
|
}
|
|
53
|
-
|
|
54
49
|
props.smartCardStorage.set(data.url, data.title);
|
|
55
50
|
}
|
|
56
51
|
}))));
|
|
57
52
|
};
|
|
58
|
-
|
|
59
53
|
export default withSmartCardStorage(InlineCard);
|
|
@@ -1,14 +1,12 @@
|
|
|
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
|
var InlineExtension = function InlineExtension(props) {
|
|
6
5
|
var text = props.text;
|
|
7
6
|
return /*#__PURE__*/React.createElement(ExtensionRenderer, _extends({}, props, {
|
|
8
7
|
type: "inlineExtension"
|
|
9
8
|
}), function (_ref) {
|
|
10
9
|
var result = _ref.result;
|
|
11
|
-
|
|
12
10
|
try {
|
|
13
11
|
// Return the result directly if it's a valid JSX.Element
|
|
14
12
|
if (result && /*#__PURE__*/React.isValidElement(result)) {
|
|
@@ -16,13 +14,11 @@ var InlineExtension = function InlineExtension(props) {
|
|
|
16
14
|
}
|
|
17
15
|
} catch (e) {
|
|
18
16
|
/** We don't want this error to block renderer */
|
|
19
|
-
|
|
20
17
|
/** We keep rendering the default content */
|
|
21
|
-
}
|
|
22
|
-
|
|
18
|
+
}
|
|
23
19
|
|
|
20
|
+
// Always return default content if anything goes wrong
|
|
24
21
|
return /*#__PURE__*/React.createElement("span", null, text || 'inlineExtension');
|
|
25
22
|
});
|
|
26
23
|
};
|
|
27
|
-
|
|
28
24
|
export default InlineExtension;
|
|
@@ -6,11 +6,8 @@ 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 _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); }; }
|
|
11
|
-
|
|
12
10
|
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; } }
|
|
13
|
-
|
|
14
11
|
/** @jsx jsx */
|
|
15
12
|
import React from 'react';
|
|
16
13
|
import { PureComponent } from 'react';
|
|
@@ -21,37 +18,28 @@ import { MediaCard } from '../../ui/MediaCard';
|
|
|
21
18
|
import { getEventHandler } from '../../utils';
|
|
22
19
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
23
20
|
import { MODE, PLATFORM } from '../../analytics/events';
|
|
24
|
-
|
|
25
21
|
var Media = /*#__PURE__*/function (_PureComponent) {
|
|
26
22
|
_inherits(Media, _PureComponent);
|
|
27
|
-
|
|
28
23
|
var _super = _createSuper(Media);
|
|
29
|
-
|
|
30
24
|
function Media() {
|
|
31
25
|
var _this;
|
|
32
|
-
|
|
33
26
|
_classCallCheck(this, Media);
|
|
34
|
-
|
|
35
27
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
36
28
|
args[_key] = arguments[_key];
|
|
37
29
|
}
|
|
38
|
-
|
|
39
30
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
40
|
-
|
|
41
31
|
_defineProperty(_assertThisInitialized(_this), "renderCard", function () {
|
|
42
32
|
var providers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
43
33
|
var mediaProvider = providers.mediaProvider,
|
|
44
|
-
|
|
34
|
+
contextIdentifierProvider = providers.contextIdentifierProvider;
|
|
45
35
|
var _this$props = _this.props,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
36
|
+
allowAltTextOnImages = _this$props.allowAltTextOnImages,
|
|
37
|
+
alt = _this$props.alt,
|
|
38
|
+
featureFlags = _this$props.featureFlags,
|
|
39
|
+
allowMediaViewer = _this$props.shouldOpenMediaViewer,
|
|
40
|
+
enableDownloadButton = _this$props.enableDownloadButton,
|
|
41
|
+
ssr = _this$props.ssr;
|
|
53
42
|
var linkMark = _this.props.marks.find(_this.props.isLinkMark);
|
|
54
|
-
|
|
55
43
|
var linkHref = linkMark === null || linkMark === void 0 ? void 0 : linkMark.attrs.href;
|
|
56
44
|
var eventHandlers = linkHref ? undefined : _this.props.eventHandlers;
|
|
57
45
|
var shouldOpenMediaViewer = !linkHref && allowMediaViewer;
|
|
@@ -74,13 +62,11 @@ var Media = /*#__PURE__*/function (_PureComponent) {
|
|
|
74
62
|
css: mediaLinkStyle
|
|
75
63
|
}, mediaComponent) : mediaComponent;
|
|
76
64
|
});
|
|
77
|
-
|
|
78
65
|
_defineProperty(_assertThisInitialized(_this), "handleMediaLinkClick", function (event) {
|
|
79
66
|
var _this$props2 = _this.props,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
67
|
+
fireAnalyticsEvent = _this$props2.fireAnalyticsEvent,
|
|
68
|
+
isLinkMark = _this$props2.isLinkMark,
|
|
69
|
+
marks = _this$props2.marks;
|
|
84
70
|
if (fireAnalyticsEvent) {
|
|
85
71
|
fireAnalyticsEvent({
|
|
86
72
|
action: ACTION.VISITED,
|
|
@@ -93,31 +79,23 @@ var Media = /*#__PURE__*/function (_PureComponent) {
|
|
|
93
79
|
}
|
|
94
80
|
});
|
|
95
81
|
}
|
|
96
|
-
|
|
97
82
|
var linkMark = _this.props.marks.find(_this.props.isLinkMark);
|
|
98
|
-
|
|
99
83
|
var linkHref = linkMark === null || linkMark === void 0 ? void 0 : linkMark.attrs.href;
|
|
100
84
|
var handler = getEventHandler(_this.props.eventHandlers, 'link');
|
|
101
|
-
|
|
102
85
|
if (handler) {
|
|
103
86
|
var _linkMark = marks.find(isLinkMark);
|
|
104
|
-
|
|
105
87
|
handler(event, _linkMark && linkHref);
|
|
106
88
|
}
|
|
107
89
|
});
|
|
108
|
-
|
|
109
90
|
return _this;
|
|
110
91
|
}
|
|
111
|
-
|
|
112
92
|
_createClass(Media, [{
|
|
113
93
|
key: "render",
|
|
114
94
|
value: function render() {
|
|
115
95
|
var providers = this.props.providers;
|
|
116
|
-
|
|
117
96
|
if (!providers) {
|
|
118
97
|
return this.renderCard();
|
|
119
98
|
}
|
|
120
|
-
|
|
121
99
|
return jsx(WithProviders, {
|
|
122
100
|
providers: ['mediaProvider', 'contextIdentifierProvider'],
|
|
123
101
|
providerFactory: providers,
|
|
@@ -125,8 +103,6 @@ var Media = /*#__PURE__*/function (_PureComponent) {
|
|
|
125
103
|
});
|
|
126
104
|
}
|
|
127
105
|
}]);
|
|
128
|
-
|
|
129
106
|
return Media;
|
|
130
107
|
}(PureComponent);
|
|
131
|
-
|
|
132
108
|
export { Media as default };
|
|
@@ -5,57 +5,42 @@ 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 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; }
|
|
10
|
-
|
|
11
9
|
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; }
|
|
12
|
-
|
|
13
10
|
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); }; }
|
|
14
|
-
|
|
15
11
|
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; } }
|
|
16
|
-
|
|
17
12
|
import React from 'react';
|
|
18
13
|
import { PureComponent } from 'react';
|
|
19
14
|
import { defaultImageCardDimensions } from '@atlaskit/media-card';
|
|
20
15
|
import { FilmstripView } from '@atlaskit/media-filmstrip';
|
|
21
|
-
|
|
22
16
|
var MediaGroup = /*#__PURE__*/function (_PureComponent) {
|
|
23
17
|
_inherits(MediaGroup, _PureComponent);
|
|
24
|
-
|
|
25
18
|
var _super = _createSuper(MediaGroup);
|
|
26
|
-
|
|
27
19
|
function MediaGroup() {
|
|
28
20
|
var _this;
|
|
29
|
-
|
|
30
21
|
_classCallCheck(this, MediaGroup);
|
|
31
|
-
|
|
32
22
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
33
23
|
args[_key] = arguments[_key];
|
|
34
24
|
}
|
|
35
|
-
|
|
36
25
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
37
|
-
|
|
38
26
|
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
39
27
|
animate: false,
|
|
40
28
|
offset: 0
|
|
41
29
|
});
|
|
42
|
-
|
|
43
30
|
_defineProperty(_assertThisInitialized(_this), "handleSize", function (_ref) {
|
|
44
31
|
var offset = _ref.offset;
|
|
45
32
|
return _this.setState({
|
|
46
33
|
offset: offset
|
|
47
34
|
});
|
|
48
35
|
});
|
|
49
|
-
|
|
50
36
|
_defineProperty(_assertThisInitialized(_this), "handleScroll", function (_ref2) {
|
|
51
37
|
var animate = _ref2.animate,
|
|
52
|
-
|
|
38
|
+
offset = _ref2.offset;
|
|
53
39
|
return _this.setState({
|
|
54
40
|
animate: animate,
|
|
55
41
|
offset: offset
|
|
56
42
|
});
|
|
57
43
|
});
|
|
58
|
-
|
|
59
44
|
_defineProperty(_assertThisInitialized(_this), "onMediaClick", function (cardClickHandler, child, surroundingItems) {
|
|
60
45
|
return function (event, analyticsEvent) {
|
|
61
46
|
var surroundings = {
|
|
@@ -65,35 +50,28 @@ var MediaGroup = /*#__PURE__*/function (_PureComponent) {
|
|
|
65
50
|
cardClickHandler(event, surroundings, analyticsEvent);
|
|
66
51
|
};
|
|
67
52
|
});
|
|
68
|
-
|
|
69
53
|
return _this;
|
|
70
54
|
}
|
|
71
|
-
|
|
72
55
|
_createClass(MediaGroup, [{
|
|
73
56
|
key: "render",
|
|
74
57
|
value: function render() {
|
|
75
58
|
var numChildren = React.Children.count(this.props.children);
|
|
76
59
|
var content;
|
|
77
|
-
|
|
78
60
|
if (numChildren === 1) {
|
|
79
61
|
var card = React.Children.toArray(this.props.children)[0];
|
|
80
|
-
|
|
81
62
|
switch (card.props.type) {
|
|
82
63
|
case 'file':
|
|
83
64
|
content = this.renderSingleFile(card);
|
|
84
65
|
break;
|
|
85
|
-
|
|
86
66
|
case 'link':
|
|
87
67
|
content = null;
|
|
88
68
|
break;
|
|
89
|
-
|
|
90
69
|
default:
|
|
91
70
|
content = this.renderSingleLink(card);
|
|
92
71
|
}
|
|
93
72
|
} else {
|
|
94
73
|
content = this.renderStrip();
|
|
95
74
|
}
|
|
96
|
-
|
|
97
75
|
return /*#__PURE__*/React.createElement("div", {
|
|
98
76
|
className: "MediaGroup"
|
|
99
77
|
}, content);
|
|
@@ -137,11 +115,10 @@ var MediaGroup = /*#__PURE__*/function (_PureComponent) {
|
|
|
137
115
|
key: "renderStrip",
|
|
138
116
|
value: function renderStrip() {
|
|
139
117
|
var _this2 = this;
|
|
140
|
-
|
|
141
118
|
var children = this.props.children;
|
|
142
119
|
var _this$state = this.state,
|
|
143
|
-
|
|
144
|
-
|
|
120
|
+
animate = _this$state.animate,
|
|
121
|
+
offset = _this$state.offset;
|
|
145
122
|
var surroundingItems = React.Children.map(children, function (child) {
|
|
146
123
|
return _this2.mapMediaPropsToIdentifier(child.props);
|
|
147
124
|
}).filter(function (identifier) {
|
|
@@ -154,14 +131,11 @@ var MediaGroup = /*#__PURE__*/function (_PureComponent) {
|
|
|
154
131
|
onScroll: this.handleScroll
|
|
155
132
|
}, React.Children.map(children, function (rawChild) {
|
|
156
133
|
var child = rawChild;
|
|
157
|
-
|
|
158
134
|
switch (child.props.type) {
|
|
159
135
|
case 'file':
|
|
160
136
|
return _this2.cloneFileCard(child, surroundingItems);
|
|
161
|
-
|
|
162
137
|
case 'link':
|
|
163
138
|
return null;
|
|
164
|
-
|
|
165
139
|
default:
|
|
166
140
|
return /*#__PURE__*/React.cloneElement(child, {
|
|
167
141
|
featureFlags: _this2.props.featureFlags,
|
|
@@ -174,10 +148,9 @@ var MediaGroup = /*#__PURE__*/function (_PureComponent) {
|
|
|
174
148
|
key: "mapMediaPropsToIdentifier",
|
|
175
149
|
value: function mapMediaPropsToIdentifier(_ref3) {
|
|
176
150
|
var id = _ref3.id,
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
151
|
+
type = _ref3.type,
|
|
152
|
+
occurrenceKey = _ref3.occurrenceKey,
|
|
153
|
+
collection = _ref3.collection;
|
|
181
154
|
switch (type) {
|
|
182
155
|
case 'file':
|
|
183
156
|
return {
|
|
@@ -186,10 +159,8 @@ var MediaGroup = /*#__PURE__*/function (_PureComponent) {
|
|
|
186
159
|
occurrenceKey: occurrenceKey,
|
|
187
160
|
collectionName: collection
|
|
188
161
|
};
|
|
189
|
-
|
|
190
162
|
case 'link':
|
|
191
163
|
return undefined;
|
|
192
|
-
|
|
193
164
|
case 'external':
|
|
194
165
|
return {
|
|
195
166
|
id: id,
|
|
@@ -200,8 +171,6 @@ var MediaGroup = /*#__PURE__*/function (_PureComponent) {
|
|
|
200
171
|
}
|
|
201
172
|
}
|
|
202
173
|
}]);
|
|
203
|
-
|
|
204
174
|
return MediaGroup;
|
|
205
175
|
}(PureComponent);
|
|
206
|
-
|
|
207
176
|
export { MediaGroup as default };
|
|
@@ -10,16 +10,13 @@ import { getClipboardAttrs } from '../../ui/MediaCard';
|
|
|
10
10
|
import { createIntl, injectIntl } from 'react-intl-next';
|
|
11
11
|
export var RenderMediaInline = function RenderMediaInline(props) {
|
|
12
12
|
var mediaProvider = props.mediaProvider;
|
|
13
|
-
|
|
14
13
|
var _useState = useState(),
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
15
|
+
viewMediaClientConfigState = _useState2[0],
|
|
16
|
+
setViewMediaClientConfigState = _useState2[1];
|
|
19
17
|
useEffect(function () {
|
|
20
18
|
updateViewMediaClientConfigState(mediaProvider);
|
|
21
19
|
}, [mediaProvider]);
|
|
22
|
-
|
|
23
20
|
var updateViewMediaClientConfigState = /*#__PURE__*/function () {
|
|
24
21
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(mediaProvider) {
|
|
25
22
|
var mediaClientConfig;
|
|
@@ -31,14 +28,11 @@ export var RenderMediaInline = function RenderMediaInline(props) {
|
|
|
31
28
|
_context.next = 5;
|
|
32
29
|
break;
|
|
33
30
|
}
|
|
34
|
-
|
|
35
31
|
_context.next = 3;
|
|
36
32
|
return mediaProvider;
|
|
37
|
-
|
|
38
33
|
case 3:
|
|
39
34
|
mediaClientConfig = _context.sent;
|
|
40
35
|
setViewMediaClientConfigState(mediaClientConfig.viewMediaClientConfig);
|
|
41
|
-
|
|
42
36
|
case 5:
|
|
43
37
|
case "end":
|
|
44
38
|
return _context.stop();
|
|
@@ -46,36 +40,32 @@ export var RenderMediaInline = function RenderMediaInline(props) {
|
|
|
46
40
|
}
|
|
47
41
|
}, _callee);
|
|
48
42
|
}));
|
|
49
|
-
|
|
50
43
|
return function updateViewMediaClientConfigState(_x) {
|
|
51
44
|
return _ref.apply(this, arguments);
|
|
52
45
|
};
|
|
53
46
|
}();
|
|
47
|
+
|
|
54
48
|
/*
|
|
55
49
|
* Only show the loading view if the media provider is not ready
|
|
56
50
|
* prevents calling the media API before the provider is ready
|
|
57
51
|
*/
|
|
58
|
-
|
|
59
|
-
|
|
60
52
|
if (!viewMediaClientConfigState) {
|
|
61
53
|
return /*#__PURE__*/React.createElement(MediaInlineCardLoadingView, {
|
|
62
54
|
message: "",
|
|
63
55
|
isSelected: false
|
|
64
56
|
});
|
|
65
57
|
}
|
|
66
|
-
|
|
67
58
|
return /*#__PURE__*/React.createElement(MediaInlineCard, {
|
|
68
59
|
identifier: props.identifier,
|
|
69
60
|
shouldOpenMediaViewer: true,
|
|
70
61
|
mediaClientConfig: viewMediaClientConfigState
|
|
71
62
|
});
|
|
72
63
|
};
|
|
73
|
-
|
|
74
64
|
var MediaInline = function MediaInline(props) {
|
|
75
65
|
var collection = props.collection,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
66
|
+
id = props.id,
|
|
67
|
+
providers = props.providers,
|
|
68
|
+
intl = props.intl;
|
|
79
69
|
var identifier = {
|
|
80
70
|
id: id,
|
|
81
71
|
mediaItemType: 'file',
|
|
@@ -94,13 +84,11 @@ var MediaInline = function MediaInline(props) {
|
|
|
94
84
|
providerFactory: providers,
|
|
95
85
|
renderNode: function renderNode(providers) {
|
|
96
86
|
var mediaProvider = providers.mediaProvider;
|
|
97
|
-
|
|
98
87
|
if (!mediaProvider) {
|
|
99
88
|
return /*#__PURE__*/React.createElement(MediaInlineCardErroredView, {
|
|
100
89
|
message: (intl || defaultIntl).formatMessage(messages.couldnt_load_file)
|
|
101
90
|
});
|
|
102
91
|
}
|
|
103
|
-
|
|
104
92
|
return /*#__PURE__*/React.createElement(RenderMediaInline, {
|
|
105
93
|
identifier: identifier,
|
|
106
94
|
mediaProvider: mediaProvider
|
|
@@ -108,5 +96,4 @@ var MediaInline = function MediaInline(props) {
|
|
|
108
96
|
}
|
|
109
97
|
}));
|
|
110
98
|
};
|
|
111
|
-
|
|
112
99
|
export default injectIntl(MediaInline);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
|
|
3
2
|
/** @jsx jsx */
|
|
4
3
|
import { default as React, Fragment } from 'react';
|
|
5
4
|
import { jsx } from '@emotion/react';
|
|
@@ -12,120 +11,100 @@ import { useObservedWidth } from '../../hooks/use-observed-width';
|
|
|
12
11
|
import { uiMediaSingleBaseStyles, uiMediaSingleLayoutStyles } from './styles';
|
|
13
12
|
var DEFAULT_WIDTH = 250;
|
|
14
13
|
var DEFAULT_HEIGHT = 200;
|
|
15
|
-
|
|
16
14
|
var isMediaElement = function isMediaElement(media) {
|
|
17
15
|
if (!media) {
|
|
18
16
|
return false;
|
|
19
17
|
}
|
|
20
|
-
|
|
21
18
|
var _ref = media.props || {},
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
// better than assume the first item in children is media
|
|
25
|
-
|
|
19
|
+
nodeType = _ref.nodeType,
|
|
20
|
+
type = _ref.type;
|
|
26
21
|
|
|
22
|
+
// Use this to perform a rough check
|
|
23
|
+
// better than assume the first item in children is media
|
|
27
24
|
return nodeType === 'media' || ['external', 'file', 'link'].indexOf(type) >= 0;
|
|
28
25
|
};
|
|
29
|
-
|
|
30
26
|
var checkForMediaElement = function checkForMediaElement(children) {
|
|
31
27
|
var _React$Children$toArr = React.Children.toArray(children),
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
_React$Children$toArr2 = _slicedToArray(_React$Children$toArr, 1),
|
|
29
|
+
media = _React$Children$toArr2[0];
|
|
35
30
|
if (media && !isMediaElement(media) && media.props.children) {
|
|
36
31
|
return checkForMediaElement(media.props.children);
|
|
37
32
|
}
|
|
38
|
-
|
|
39
33
|
return media;
|
|
40
|
-
};
|
|
41
|
-
// we return a default width value
|
|
42
|
-
|
|
34
|
+
};
|
|
43
35
|
|
|
36
|
+
// returns the existing container width if available (non SSR mode), otherwise
|
|
37
|
+
// we return a default width value
|
|
44
38
|
export var getMediaContainerWidth = function getMediaContainerWidth(currentContainerWidth, layout) {
|
|
45
39
|
return !currentContainerWidth && layout !== 'full-width' && layout !== 'wide' ? akEditorDefaultLayoutWidth : currentContainerWidth;
|
|
46
40
|
};
|
|
47
|
-
|
|
48
41
|
var MediaSingle = function MediaSingle(props) {
|
|
49
42
|
var _ref$current;
|
|
50
|
-
|
|
51
43
|
var rendererAppearance = props.rendererAppearance,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
44
|
+
featureFlags = props.featureFlags,
|
|
45
|
+
isInsideOfBlockNode = props.isInsideOfBlockNode,
|
|
46
|
+
layout = props.layout,
|
|
47
|
+
children = props.children,
|
|
48
|
+
pctWidth = props.width;
|
|
57
49
|
var isCaptionsFlaggedOn = getMediaFeatureFlag('captions', featureFlags);
|
|
58
|
-
|
|
59
50
|
var _React$useState = React.useState({
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
51
|
+
width: 0,
|
|
52
|
+
height: 0
|
|
53
|
+
}),
|
|
54
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
55
|
+
externalImageDimensions = _React$useState2[0],
|
|
56
|
+
setExternalImageDimensions = _React$useState2[1];
|
|
67
57
|
var ref = React.useRef(null);
|
|
68
58
|
var onExternalImageLoaded = React.useCallback(function (_ref2) {
|
|
69
59
|
var width = _ref2.width,
|
|
70
|
-
|
|
60
|
+
height = _ref2.height;
|
|
71
61
|
setExternalImageDimensions({
|
|
72
62
|
width: width,
|
|
73
63
|
height: height
|
|
74
64
|
});
|
|
75
65
|
}, []);
|
|
76
66
|
var observedWidthFlag = getMediaFeatureFlag('observedWidth', featureFlags);
|
|
77
|
-
|
|
78
67
|
var _useObservedWidth = useObservedWidth((_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.parentElement, observedWidthFlag),
|
|
79
|
-
|
|
80
|
-
|
|
68
|
+
observedWidth = _useObservedWidth.width;
|
|
81
69
|
var media;
|
|
82
|
-
|
|
83
70
|
var _React$Children$toArr3 = React.Children.toArray(children),
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
71
|
+
_React$Children$toArr4 = _slicedToArray(_React$Children$toArr3, 2),
|
|
72
|
+
node = _React$Children$toArr4[0],
|
|
73
|
+
caption = _React$Children$toArr4[1];
|
|
88
74
|
if (!isMediaElement(node)) {
|
|
89
75
|
var mediaElement = checkForMediaElement(node.props.children);
|
|
90
|
-
|
|
91
76
|
if (!mediaElement) {
|
|
92
77
|
return node;
|
|
93
78
|
}
|
|
94
|
-
|
|
95
79
|
media = mediaElement;
|
|
96
80
|
} else {
|
|
97
81
|
media = node;
|
|
98
82
|
}
|
|
99
|
-
|
|
100
83
|
var _media$props = media.props,
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
84
|
+
_media$props$width = _media$props.width,
|
|
85
|
+
width = _media$props$width === void 0 ? DEFAULT_WIDTH : _media$props$width,
|
|
86
|
+
_media$props$height = _media$props.height,
|
|
87
|
+
height = _media$props$height === void 0 ? DEFAULT_HEIGHT : _media$props$height,
|
|
88
|
+
type = _media$props.type;
|
|
107
89
|
if (type === 'external') {
|
|
108
90
|
var stateWidth = externalImageDimensions.width,
|
|
109
|
-
|
|
110
|
-
|
|
91
|
+
stateHeight = externalImageDimensions.height;
|
|
111
92
|
if (width === null) {
|
|
112
93
|
width = stateWidth || DEFAULT_WIDTH;
|
|
113
94
|
}
|
|
114
|
-
|
|
115
95
|
if (height === null) {
|
|
116
96
|
height = stateHeight || DEFAULT_HEIGHT;
|
|
117
97
|
}
|
|
118
98
|
}
|
|
119
|
-
|
|
120
99
|
if (width === null) {
|
|
121
100
|
width = DEFAULT_WIDTH;
|
|
122
101
|
height = DEFAULT_HEIGHT;
|
|
123
|
-
}
|
|
102
|
+
}
|
|
124
103
|
|
|
104
|
+
// TODO: put appearance-based padding into theme instead
|
|
125
105
|
|
|
126
106
|
var padding = rendererAppearance === 'full-page' ? FullPagePadding * 2 : 0;
|
|
127
107
|
var isFullWidth = rendererAppearance === 'full-width';
|
|
128
|
-
|
|
129
108
|
var calcDimensions = function calcDimensions(mediaContainerWidth, mediaBreakpoint) {
|
|
130
109
|
var containerWidth = getMediaContainerWidth(mediaContainerWidth, layout);
|
|
131
110
|
var maxWidth = containerWidth;
|
|
@@ -135,17 +114,14 @@ var MediaSingle = function MediaSingle(props) {
|
|
|
135
114
|
height: "".concat(maxHeight, "px")
|
|
136
115
|
};
|
|
137
116
|
var nonFullWidthSize = containerWidth;
|
|
138
|
-
|
|
139
117
|
if (!isInsideOfBlockNode && rendererAppearance !== 'comment') {
|
|
140
118
|
var isContainerSizeGreaterThanMaxFullPageWidth = containerWidth - padding >= akEditorDefaultLayoutWidth;
|
|
141
|
-
|
|
142
119
|
if (isContainerSizeGreaterThanMaxFullPageWidth) {
|
|
143
120
|
nonFullWidthSize = akEditorDefaultLayoutWidth;
|
|
144
121
|
} else {
|
|
145
122
|
nonFullWidthSize = containerWidth - padding;
|
|
146
123
|
}
|
|
147
124
|
}
|
|
148
|
-
|
|
149
125
|
var minWidth = Math.min(akEditorFullWidthLayoutWidth, containerWidth - padding);
|
|
150
126
|
var lineLength = isFullWidth ? minWidth : nonFullWidthSize;
|
|
151
127
|
return {
|
|
@@ -154,18 +130,15 @@ var MediaSingle = function MediaSingle(props) {
|
|
|
154
130
|
containerWidth: containerWidth
|
|
155
131
|
};
|
|
156
132
|
};
|
|
157
|
-
|
|
158
133
|
var originalDimensions = {
|
|
159
134
|
height: height,
|
|
160
135
|
width: width
|
|
161
136
|
};
|
|
162
|
-
|
|
163
137
|
var renderMediaSingle = function renderMediaSingle(renderWidth, mediaBreakpoint) {
|
|
164
138
|
var _calcDimensions = calcDimensions(renderWidth, mediaBreakpoint),
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
139
|
+
cardDimensions = _calcDimensions.cardDimensions,
|
|
140
|
+
lineLength = _calcDimensions.lineLength,
|
|
141
|
+
containerWidth = _calcDimensions.containerWidth;
|
|
169
142
|
var mediaComponent = /*#__PURE__*/React.cloneElement(media, {
|
|
170
143
|
resizeMode: 'stretchy-fit',
|
|
171
144
|
cardDimensions: cardDimensions,
|
|
@@ -187,12 +160,10 @@ var MediaSingle = function MediaSingle(props) {
|
|
|
187
160
|
fullWidthMode: isFullWidth
|
|
188
161
|
}, jsx(Fragment, null, mediaComponent), isCaptionsFlaggedOn && caption);
|
|
189
162
|
};
|
|
190
|
-
|
|
191
163
|
return observedWidthFlag ? renderMediaSingle(observedWidth || document.body.offsetWidth) : jsx(WidthConsumer, null, function (_ref3) {
|
|
192
164
|
var width = _ref3.width,
|
|
193
|
-
|
|
165
|
+
breakpoint = _ref3.breakpoint;
|
|
194
166
|
return renderMediaSingle(width, breakpoint);
|
|
195
167
|
});
|
|
196
168
|
};
|
|
197
|
-
|
|
198
169
|
export default injectIntl(MediaSingle);
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
|
|
3
2
|
var _templateObject, _templateObject2;
|
|
4
|
-
|
|
5
3
|
/** @jsx jsx */
|
|
6
4
|
import { css } from '@emotion/react';
|
|
7
5
|
export var uiMediaSingleBaseStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n transition: all 0.1s linear;\n"])));
|