@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
|
@@ -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
|
import React from 'react';
|
|
15
12
|
import { calcTableWidth, TableSharedCssClassName, tableMarginTop } from '@atlaskit/editor-common/styles';
|
|
16
13
|
import { WidthConsumer, overflowShadow } from '@atlaskit/editor-common/ui';
|
|
@@ -22,23 +19,19 @@ import { withSmartCardStorage } from '../../ui/SmartCardStorage';
|
|
|
22
19
|
import { StickyTable, tableStickyPadding, OverflowParent } from './table/sticky';
|
|
23
20
|
import { Table } from './table/table';
|
|
24
21
|
import { akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
25
|
-
|
|
26
22
|
var orderChildren = function orderChildren(children, tableNode, smartCardStorage, tableOrderStatus) {
|
|
27
23
|
if (!tableOrderStatus || tableOrderStatus.order === SortOrder.NO_ORDER) {
|
|
28
24
|
return children;
|
|
29
25
|
}
|
|
30
|
-
|
|
31
26
|
var order = tableOrderStatus.order,
|
|
32
|
-
|
|
27
|
+
columnIndex = tableOrderStatus.columnIndex;
|
|
33
28
|
var compareNodesInOrder = createCompareNodes({
|
|
34
29
|
getInlineCardTextFromStore: function getInlineCardTextFromStore(attrs) {
|
|
35
30
|
var _ref = attrs,
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
url = _ref.url;
|
|
38
32
|
if (!url) {
|
|
39
33
|
return null;
|
|
40
34
|
}
|
|
41
|
-
|
|
42
35
|
return smartCardStorage.get(url) || null;
|
|
43
36
|
}
|
|
44
37
|
}, order);
|
|
@@ -53,16 +46,13 @@ var orderChildren = function orderChildren(children, tableNode, smartCardStorage
|
|
|
53
46
|
var sortedTable = tableArrayWithChildren.sort(function (rowA, rowB) {
|
|
54
47
|
return compareNodesInOrder(rowA.rowNodes[columnIndex], rowB.rowNodes[columnIndex]);
|
|
55
48
|
});
|
|
56
|
-
|
|
57
49
|
if (headerRow) {
|
|
58
50
|
sortedTable.unshift(headerRow);
|
|
59
51
|
}
|
|
60
|
-
|
|
61
52
|
return sortedTable.map(function (elem) {
|
|
62
53
|
return elem.rowReact;
|
|
63
54
|
});
|
|
64
55
|
};
|
|
65
|
-
|
|
66
56
|
var hasRowspan = function hasRowspan(row) {
|
|
67
57
|
var hasRowspan = false;
|
|
68
58
|
row.forEach(function (cell) {
|
|
@@ -70,19 +60,15 @@ var hasRowspan = function hasRowspan(row) {
|
|
|
70
60
|
});
|
|
71
61
|
return hasRowspan;
|
|
72
62
|
};
|
|
73
|
-
|
|
74
63
|
var getRefTop = function getRefTop(refElement) {
|
|
75
64
|
return Math.round(refElement.getBoundingClientRect().top);
|
|
76
65
|
};
|
|
77
|
-
|
|
78
66
|
var shouldHeaderStick = function shouldHeaderStick(scrollTop, tableTop, tableBottom, rowHeight) {
|
|
79
67
|
return tableTop <= scrollTop && !(tableBottom - rowHeight <= scrollTop);
|
|
80
68
|
};
|
|
81
|
-
|
|
82
69
|
var shouldHeaderPinBottom = function shouldHeaderPinBottom(scrollTop, tableBottom, rowHeight) {
|
|
83
70
|
return tableBottom - rowHeight <= scrollTop && !(tableBottom < scrollTop);
|
|
84
71
|
};
|
|
85
|
-
|
|
86
72
|
var addSortableColumn = function addSortableColumn(rows, tableOrderStatus, onSorting) {
|
|
87
73
|
return React.Children.map(rows, function (row, index) {
|
|
88
74
|
if (index === 0) {
|
|
@@ -91,129 +77,96 @@ var addSortableColumn = function addSortableColumn(rows, tableOrderStatus, onSor
|
|
|
91
77
|
onSorting: onSorting
|
|
92
78
|
});
|
|
93
79
|
}
|
|
94
|
-
|
|
95
80
|
return row;
|
|
96
81
|
});
|
|
97
82
|
};
|
|
98
|
-
|
|
99
83
|
var isHeaderRowEnabled = function isHeaderRowEnabled(rows) {
|
|
100
84
|
if (!rows.length) {
|
|
101
85
|
return false;
|
|
102
86
|
}
|
|
103
|
-
|
|
104
87
|
var children = rows[0].props.children;
|
|
105
|
-
|
|
106
88
|
if (!children.length) {
|
|
107
89
|
return false;
|
|
108
90
|
}
|
|
109
|
-
|
|
110
91
|
if (children.length === 1) {
|
|
111
92
|
return children[0].type === TableHeader;
|
|
112
93
|
}
|
|
113
|
-
|
|
114
94
|
return children.every(function (node) {
|
|
115
95
|
return node.type === TableHeader;
|
|
116
96
|
});
|
|
117
97
|
};
|
|
118
|
-
|
|
119
98
|
var tableCanBeSticky = function tableCanBeSticky(node, children) {
|
|
120
99
|
return isHeaderRowEnabled(children) && node && node.firstChild && !hasRowspan(node.firstChild);
|
|
121
100
|
};
|
|
122
|
-
|
|
123
101
|
var canUseLinelength = function canUseLinelength(appearance) {
|
|
124
102
|
return appearance === 'full-page' || appearance === 'mobile';
|
|
125
103
|
};
|
|
126
|
-
|
|
127
104
|
export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
128
105
|
_inherits(TableContainer, _React$Component);
|
|
129
|
-
|
|
130
106
|
var _super = _createSuper(TableContainer);
|
|
131
|
-
|
|
132
107
|
function TableContainer() {
|
|
133
108
|
var _this;
|
|
134
|
-
|
|
135
109
|
_classCallCheck(this, TableContainer);
|
|
136
|
-
|
|
137
110
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
138
111
|
args[_key] = arguments[_key];
|
|
139
112
|
}
|
|
140
|
-
|
|
141
113
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
142
|
-
|
|
143
114
|
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
144
115
|
stickyMode: 'none'
|
|
145
116
|
});
|
|
146
|
-
|
|
147
117
|
_defineProperty(_assertThisInitialized(_this), "tableRef", /*#__PURE__*/React.createRef());
|
|
148
|
-
|
|
149
118
|
_defineProperty(_assertThisInitialized(_this), "stickyHeaderRef", /*#__PURE__*/React.createRef());
|
|
150
|
-
|
|
151
119
|
_defineProperty(_assertThisInitialized(_this), "stickyWrapperRef", /*#__PURE__*/React.createRef());
|
|
152
|
-
|
|
153
120
|
_defineProperty(_assertThisInitialized(_this), "wrapperRef", /*#__PURE__*/React.createRef());
|
|
154
|
-
|
|
155
121
|
_defineProperty(_assertThisInitialized(_this), "overflowParent", null);
|
|
156
|
-
|
|
157
122
|
_defineProperty(_assertThisInitialized(_this), "componentWillUnmount", function () {
|
|
158
123
|
if (_this.overflowParent) {
|
|
159
124
|
_this.overflowParent.removeEventListener('scroll', _this.onScroll);
|
|
160
125
|
}
|
|
161
|
-
|
|
162
126
|
if (_this.nextFrame) {
|
|
163
127
|
cancelAnimationFrame(_this.nextFrame);
|
|
164
128
|
}
|
|
165
129
|
});
|
|
166
|
-
|
|
167
130
|
_defineProperty(_assertThisInitialized(_this), "getScrollTop", function () {
|
|
168
131
|
var stickyHeaders = _this.props.stickyHeaders;
|
|
169
132
|
var offsetTop = stickyHeaders && stickyHeaders.offsetTop || 0;
|
|
170
133
|
return (_this.overflowParent ? _this.overflowParent.top : 0) + offsetTop;
|
|
171
134
|
});
|
|
172
|
-
|
|
173
135
|
_defineProperty(_assertThisInitialized(_this), "updateSticky", function () {
|
|
174
136
|
var tableElem = _this.tableRef.current;
|
|
175
137
|
var refElem = _this.stickyHeaderRef.current;
|
|
176
|
-
|
|
177
138
|
if (!tableElem || !refElem) {
|
|
178
139
|
return;
|
|
179
140
|
}
|
|
180
|
-
|
|
181
141
|
var scrollTop = _this.getScrollTop() + tableStickyPadding;
|
|
182
142
|
var tableTop = getRefTop(tableElem);
|
|
183
143
|
var tableBottom = tableTop + tableElem.clientHeight;
|
|
184
144
|
var shouldSticky = shouldHeaderStick(scrollTop, tableTop, tableBottom, refElem.clientHeight);
|
|
185
145
|
var shouldPin = shouldHeaderPinBottom(scrollTop, tableBottom, refElem.clientHeight);
|
|
186
146
|
var stickyMode = 'none';
|
|
187
|
-
|
|
188
147
|
if (shouldPin) {
|
|
189
148
|
stickyMode = 'pin-bottom';
|
|
190
149
|
} else if (shouldSticky) {
|
|
191
150
|
stickyMode = 'stick';
|
|
192
151
|
}
|
|
193
|
-
|
|
194
152
|
if (_this.state.stickyMode !== stickyMode) {
|
|
195
153
|
_this.setState({
|
|
196
154
|
stickyMode: stickyMode
|
|
197
155
|
});
|
|
198
156
|
}
|
|
199
|
-
|
|
200
157
|
_this.nextFrame = undefined;
|
|
201
158
|
});
|
|
202
|
-
|
|
203
159
|
_defineProperty(_assertThisInitialized(_this), "onScroll", function () {
|
|
204
160
|
if (!_this.nextFrame) {
|
|
205
161
|
_this.nextFrame = requestAnimationFrame(_this.updateSticky);
|
|
206
162
|
}
|
|
207
163
|
});
|
|
208
|
-
|
|
209
164
|
_defineProperty(_assertThisInitialized(_this), "onWrapperScrolled", function () {
|
|
210
165
|
if (!_this.wrapperRef.current || !_this.stickyWrapperRef.current) {
|
|
211
166
|
return;
|
|
212
167
|
}
|
|
213
|
-
|
|
214
168
|
_this.stickyWrapperRef.current.scrollLeft = _this.wrapperRef.current.scrollLeft;
|
|
215
169
|
});
|
|
216
|
-
|
|
217
170
|
_defineProperty(_assertThisInitialized(_this), "grabFirstRowRef", function (children) {
|
|
218
171
|
return React.Children.map(children, function (child, idx) {
|
|
219
172
|
if (idx === 0 && /*#__PURE__*/React.isValidElement(child)) {
|
|
@@ -221,14 +174,11 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
221
174
|
innerRef: _this.stickyHeaderRef
|
|
222
175
|
});
|
|
223
176
|
}
|
|
224
|
-
|
|
225
177
|
return child;
|
|
226
178
|
});
|
|
227
179
|
});
|
|
228
|
-
|
|
229
180
|
return _this;
|
|
230
181
|
}
|
|
231
|
-
|
|
232
182
|
_createClass(TableContainer, [{
|
|
233
183
|
key: "componentDidMount",
|
|
234
184
|
value: function componentDidMount() {
|
|
@@ -246,14 +196,14 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
246
196
|
} else if (!this.props.stickyHeaders && this.overflowParent) {
|
|
247
197
|
this.overflowParent.removeEventListener('scroll', this.onScroll);
|
|
248
198
|
this.overflowParent = null;
|
|
249
|
-
}
|
|
250
|
-
|
|
199
|
+
}
|
|
251
200
|
|
|
201
|
+
// offsetTop might have changed, re-position sticky header
|
|
252
202
|
if (this.props.stickyHeaders !== prevProps.stickyHeaders) {
|
|
253
203
|
this.updateSticky();
|
|
254
|
-
}
|
|
255
|
-
|
|
204
|
+
}
|
|
256
205
|
|
|
206
|
+
// sync horizontal scroll in floating div when toggling modes
|
|
257
207
|
if (prevState.stickyMode !== this.state.stickyMode) {
|
|
258
208
|
this.onWrapperScrolled();
|
|
259
209
|
}
|
|
@@ -264,7 +214,6 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
264
214
|
if (!this.tableRef.current || !this.stickyHeaderRef.current) {
|
|
265
215
|
return;
|
|
266
216
|
}
|
|
267
|
-
|
|
268
217
|
return this.tableRef.current.offsetHeight - this.stickyHeaderRef.current.offsetHeight + tableMarginTop - tableStickyPadding;
|
|
269
218
|
}
|
|
270
219
|
}, {
|
|
@@ -273,10 +222,8 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
273
222
|
switch (this.state.stickyMode) {
|
|
274
223
|
case 'pin-bottom':
|
|
275
224
|
return this.pinTop;
|
|
276
|
-
|
|
277
225
|
case 'stick':
|
|
278
226
|
return this.props.stickyHeaders && this.props.stickyHeaders.offsetTop;
|
|
279
|
-
|
|
280
227
|
default:
|
|
281
228
|
return undefined;
|
|
282
229
|
}
|
|
@@ -290,22 +237,20 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
290
237
|
key: "render",
|
|
291
238
|
value: function render() {
|
|
292
239
|
var _this$props = this.props,
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
240
|
+
isNumberColumnEnabled = _this$props.isNumberColumnEnabled,
|
|
241
|
+
layout = _this$props.layout,
|
|
242
|
+
renderWidth = _this$props.renderWidth,
|
|
243
|
+
columnWidths = _this$props.columnWidths,
|
|
244
|
+
stickyHeaders = _this$props.stickyHeaders,
|
|
245
|
+
tableNode = _this$props.tableNode;
|
|
299
246
|
var stickyMode = this.state.stickyMode;
|
|
300
247
|
var tableWidth = calcTableWidth(layout, renderWidth, false);
|
|
301
248
|
var lineLength = akEditorDefaultLayoutWidth;
|
|
302
249
|
var left;
|
|
303
|
-
|
|
304
250
|
if (canUseLinelength(this.props.rendererAppearance) && tableWidth !== 'inherit') {
|
|
305
251
|
var tableWidthPx = Number(tableWidth.substring(0, tableWidth.length - 2));
|
|
306
252
|
left = lineLength / 2 - tableWidthPx / 2;
|
|
307
253
|
}
|
|
308
|
-
|
|
309
254
|
var wrapperWidth = this.wrapperRef.current ? this.wrapperRef.current.clientWidth : 0;
|
|
310
255
|
var children = React.Children.toArray(this.props.children);
|
|
311
256
|
return /*#__PURE__*/React.createElement(React.Fragment, null, stickyHeaders && tableCanBeSticky(tableNode, children) && /*#__PURE__*/React.createElement(StickyTable, {
|
|
@@ -343,43 +288,32 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
343
288
|
}, this.grabFirstRowRef(children)))));
|
|
344
289
|
}
|
|
345
290
|
}]);
|
|
346
|
-
|
|
347
291
|
return TableContainer;
|
|
348
292
|
}(React.Component);
|
|
349
293
|
export var TableProcessor = /*#__PURE__*/function (_React$Component2) {
|
|
350
294
|
_inherits(TableProcessor, _React$Component2);
|
|
351
|
-
|
|
352
295
|
var _super2 = _createSuper(TableProcessor);
|
|
353
|
-
|
|
354
296
|
function TableProcessor() {
|
|
355
297
|
var _this2;
|
|
356
|
-
|
|
357
298
|
_classCallCheck(this, TableProcessor);
|
|
358
|
-
|
|
359
299
|
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
360
300
|
args[_key2] = arguments[_key2];
|
|
361
301
|
}
|
|
362
|
-
|
|
363
302
|
_this2 = _super2.call.apply(_super2, [this].concat(args));
|
|
364
|
-
|
|
365
303
|
_defineProperty(_assertThisInitialized(_this2), "state", {
|
|
366
304
|
tableOrderStatus: undefined
|
|
367
305
|
});
|
|
368
|
-
|
|
369
306
|
_defineProperty(_assertThisInitialized(_this2), "addSortableColumn", function (childrenArray) {
|
|
370
307
|
var _this2$props = _this2.props,
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
308
|
+
tableNode = _this2$props.tableNode,
|
|
309
|
+
allowColumnSorting = _this2$props.allowColumnSorting,
|
|
310
|
+
smartCardStorage = _this2$props.smartCardStorage;
|
|
374
311
|
var tableOrderStatus = _this2.state.tableOrderStatus;
|
|
375
|
-
|
|
376
312
|
if (allowColumnSorting && isHeaderRowEnabled(childrenArray) && tableNode && !hasMergedCell(tableNode)) {
|
|
377
313
|
return addSortableColumn(orderChildren(childrenArray, tableNode, smartCardStorage, tableOrderStatus), tableOrderStatus, _this2.changeSortOrder);
|
|
378
314
|
}
|
|
379
|
-
|
|
380
315
|
return childrenArray;
|
|
381
316
|
});
|
|
382
|
-
|
|
383
317
|
_defineProperty(_assertThisInitialized(_this2), "changeSortOrder", function (columnIndex, sortOrder) {
|
|
384
318
|
_this2.setState({
|
|
385
319
|
tableOrderStatus: {
|
|
@@ -388,7 +322,6 @@ export var TableProcessor = /*#__PURE__*/function (_React$Component2) {
|
|
|
388
322
|
}
|
|
389
323
|
});
|
|
390
324
|
});
|
|
391
|
-
|
|
392
325
|
_defineProperty(_assertThisInitialized(_this2), "addNumberColumnIndexes", function (rows) {
|
|
393
326
|
var isNumberColumnEnabled = _this2.props.isNumberColumnEnabled;
|
|
394
327
|
var headerRowEnabled = isHeaderRowEnabled(rows);
|
|
@@ -399,54 +332,45 @@ export var TableProcessor = /*#__PURE__*/function (_React$Component2) {
|
|
|
399
332
|
});
|
|
400
333
|
});
|
|
401
334
|
});
|
|
402
|
-
|
|
403
335
|
return _this2;
|
|
404
336
|
}
|
|
405
|
-
|
|
406
337
|
_createClass(TableProcessor, [{
|
|
407
338
|
key: "render",
|
|
408
339
|
value: function render() {
|
|
409
340
|
var children = this.props.children;
|
|
410
|
-
|
|
411
341
|
if (!children) {
|
|
412
342
|
return null;
|
|
413
343
|
}
|
|
414
|
-
|
|
415
344
|
var childrenArray = React.Children.toArray(children);
|
|
416
345
|
var orderedChildren = compose(this.addNumberColumnIndexes, this.addSortableColumn)(childrenArray);
|
|
417
346
|
return /*#__PURE__*/React.createElement(TableContainer, this.props, orderedChildren);
|
|
418
|
-
}
|
|
347
|
+
}
|
|
419
348
|
|
|
349
|
+
// adds sortable + re-orders children
|
|
420
350
|
}]);
|
|
421
|
-
|
|
422
351
|
return TableProcessor;
|
|
423
352
|
}(React.Component);
|
|
424
353
|
var TableWithShadows = overflowShadow(TableProcessor, {
|
|
425
354
|
overflowSelector: ".".concat(TableSharedCssClassName.TABLE_NODE_WRAPPER),
|
|
426
355
|
useShadowObserver: true
|
|
427
356
|
});
|
|
428
|
-
|
|
429
357
|
var TableWithWidth = function TableWithWidth(props) {
|
|
430
358
|
return /*#__PURE__*/React.createElement(WidthConsumer, null, function (_ref2) {
|
|
431
359
|
var _props$columnWidths;
|
|
432
|
-
|
|
433
360
|
var width = _ref2.width;
|
|
434
361
|
var renderWidth = props.rendererAppearance === 'full-page' ? width - FullPagePadding * 2 : width;
|
|
435
362
|
var colWidthsSum = ((_props$columnWidths = props.columnWidths) === null || _props$columnWidths === void 0 ? void 0 : _props$columnWidths.reduce(function (total, val) {
|
|
436
363
|
return total + val;
|
|
437
364
|
}, 0)) || 0;
|
|
438
|
-
|
|
439
365
|
if (colWidthsSum) {
|
|
440
366
|
return /*#__PURE__*/React.createElement(TableWithShadows, _extends({
|
|
441
367
|
renderWidth: renderWidth
|
|
442
368
|
}, props));
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
|
|
369
|
+
}
|
|
370
|
+
// there should not be a case when colWidthsSum is 0 and table is in overflow state - so no need to render shadows in this case
|
|
446
371
|
return /*#__PURE__*/React.createElement(TableProcessor, _extends({
|
|
447
372
|
renderWidth: renderWidth
|
|
448
373
|
}, props));
|
|
449
374
|
});
|
|
450
375
|
};
|
|
451
|
-
|
|
452
376
|
export default withSmartCardStorage(TableWithWidth);
|
|
@@ -6,11 +6,8 @@ import _createClass from "@babel/runtime/helpers/createClass";
|
|
|
6
6
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
7
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
8
8
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
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
|
import React from 'react';
|
|
15
12
|
import { tableBackgroundColorPalette } from '@atlaskit/adf-schema';
|
|
16
13
|
import { compose } from '@atlaskit/editor-common/utils';
|
|
@@ -22,98 +19,77 @@ import { RendererCssClassName } from '../../consts';
|
|
|
22
19
|
import { injectIntl } from 'react-intl-next';
|
|
23
20
|
import { tableCellMessages } from '../../messages';
|
|
24
21
|
var IgnoreSorting = ['LABEL', 'INPUT'];
|
|
25
|
-
|
|
26
22
|
var nextStatusOrder = function nextStatusOrder(currentSortOrder) {
|
|
27
23
|
switch (currentSortOrder) {
|
|
28
24
|
case SortOrder.NO_ORDER:
|
|
29
25
|
return SortOrder.ASC;
|
|
30
|
-
|
|
31
26
|
case SortOrder.ASC:
|
|
32
27
|
return SortOrder.DESC;
|
|
33
|
-
|
|
34
28
|
case SortOrder.DESC:
|
|
35
29
|
return SortOrder.NO_ORDER;
|
|
36
30
|
}
|
|
37
|
-
|
|
38
31
|
return SortOrder.NO_ORDER;
|
|
39
32
|
};
|
|
40
|
-
|
|
41
33
|
var getSortOrderLabel = function getSortOrderLabel(intl, currentSortOrder) {
|
|
42
34
|
var noneSortingLabel = tableCellMessages.noneSortingLabel,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
35
|
+
ascSortingLabel = tableCellMessages.ascSortingLabel,
|
|
36
|
+
descSortingLabel = tableCellMessages.descSortingLabel;
|
|
46
37
|
switch (currentSortOrder) {
|
|
47
38
|
case SortOrder.NO_ORDER:
|
|
48
39
|
return intl.formatMessage(noneSortingLabel);
|
|
49
|
-
|
|
50
40
|
case SortOrder.ASC:
|
|
51
41
|
return intl.formatMessage(ascSortingLabel);
|
|
52
|
-
|
|
53
42
|
case SortOrder.DESC:
|
|
54
43
|
return intl.formatMessage(descSortingLabel);
|
|
55
|
-
|
|
56
44
|
default:
|
|
57
45
|
return intl.formatMessage(noneSortingLabel);
|
|
58
46
|
}
|
|
59
47
|
};
|
|
60
|
-
|
|
61
48
|
var getDataAttributes = function getDataAttributes(colwidth) {
|
|
62
49
|
var attrs = {};
|
|
63
|
-
|
|
64
50
|
if (colwidth) {
|
|
65
51
|
attrs['data-colwidth'] = colwidth.join(',');
|
|
66
52
|
}
|
|
67
|
-
|
|
68
53
|
return attrs;
|
|
69
54
|
};
|
|
70
|
-
|
|
71
55
|
var getStyle = function getStyle(background, colGroupWidth, offsetTop) {
|
|
72
56
|
var style = {};
|
|
73
|
-
|
|
74
|
-
|
|
57
|
+
if (background &&
|
|
58
|
+
// ignore setting inline styles if ds neutral token is detected
|
|
75
59
|
!background.includes('--ds-background-neutral')) {
|
|
76
60
|
style.backgroundColor = background;
|
|
77
61
|
}
|
|
78
|
-
|
|
79
62
|
if (colGroupWidth) {
|
|
80
63
|
style.width = colGroupWidth;
|
|
81
64
|
style.minWidth = colGroupWidth;
|
|
82
65
|
}
|
|
83
|
-
|
|
84
66
|
if (offsetTop !== undefined) {
|
|
85
67
|
style.top = offsetTop;
|
|
86
68
|
}
|
|
87
|
-
|
|
88
69
|
return style;
|
|
89
70
|
};
|
|
90
|
-
|
|
91
71
|
var withCellProps = function withCellProps(WrapperComponent) {
|
|
92
72
|
return /*#__PURE__*/function (_React$Component) {
|
|
93
73
|
_inherits(WithCellProps, _React$Component);
|
|
94
|
-
|
|
95
74
|
var _super = _createSuper(WithCellProps);
|
|
96
|
-
|
|
97
75
|
function WithCellProps() {
|
|
98
76
|
_classCallCheck(this, WithCellProps);
|
|
99
|
-
|
|
100
77
|
return _super.apply(this, arguments);
|
|
101
78
|
}
|
|
102
|
-
|
|
103
79
|
_createClass(WithCellProps, [{
|
|
104
80
|
key: "render",
|
|
105
81
|
value: function render() {
|
|
106
82
|
var _this$props = this.props,
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
83
|
+
children = _this$props.children,
|
|
84
|
+
className = _this$props.className,
|
|
85
|
+
onClick = _this$props.onClick,
|
|
86
|
+
colwidth = _this$props.colwidth,
|
|
87
|
+
colGroupWidth = _this$props.colGroupWidth,
|
|
88
|
+
rowspan = _this$props.rowspan,
|
|
89
|
+
colspan = _this$props.colspan,
|
|
90
|
+
background = _this$props.background,
|
|
91
|
+
offsetTop = _this$props.offsetTop,
|
|
92
|
+
ariaSort = _this$props.ariaSort;
|
|
117
93
|
var colorName = background ? tableBackgroundColorPalette.get(background) : '';
|
|
118
94
|
return /*#__PURE__*/React.createElement(WrapperComponent, _extends({
|
|
119
95
|
rowSpan: rowspan,
|
|
@@ -127,43 +103,33 @@ var withCellProps = function withCellProps(WrapperComponent) {
|
|
|
127
103
|
}), children);
|
|
128
104
|
}
|
|
129
105
|
}]);
|
|
130
|
-
|
|
131
106
|
return WithCellProps;
|
|
132
107
|
}(React.Component);
|
|
133
108
|
};
|
|
134
|
-
|
|
135
109
|
export var withSortableColumn = function withSortableColumn(WrapperComponent) {
|
|
136
110
|
var WithSortableColumn = /*#__PURE__*/function (_React$Component2) {
|
|
137
111
|
_inherits(WithSortableColumn, _React$Component2);
|
|
138
|
-
|
|
139
112
|
var _super2 = _createSuper(WithSortableColumn);
|
|
140
|
-
|
|
141
113
|
function WithSortableColumn(props) {
|
|
142
114
|
var _this;
|
|
143
|
-
|
|
144
115
|
_classCallCheck(this, WithSortableColumn);
|
|
145
|
-
|
|
146
116
|
_this = _super2.call(this, props);
|
|
147
|
-
|
|
148
117
|
_defineProperty(_assertThisInitialized(_this), "onKeyPress", function (event) {
|
|
149
118
|
var keys = [' ', 'Enter', 'Spacebar'];
|
|
150
119
|
var _ref = event.target,
|
|
151
|
-
|
|
152
|
-
|
|
120
|
+
tagName = _ref.tagName;
|
|
121
|
+
// trigger sorting if space or enter are clicked but not when in an input field (template variables)
|
|
153
122
|
if (keys.includes(event.key) && !IgnoreSorting.includes(tagName)) {
|
|
154
123
|
event.preventDefault();
|
|
155
|
-
|
|
156
124
|
_this.sort();
|
|
157
125
|
}
|
|
158
126
|
});
|
|
159
|
-
|
|
160
127
|
_defineProperty(_assertThisInitialized(_this), "sort", function () {
|
|
161
128
|
var _this$props2 = _this.props,
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
129
|
+
fireAnalyticsEvent = _this$props2.fireAnalyticsEvent,
|
|
130
|
+
onSorting = _this$props2.onSorting,
|
|
131
|
+
columnIndex = _this$props2.columnIndex,
|
|
132
|
+
sortOrdered = _this$props2.sortOrdered;
|
|
167
133
|
if (onSorting && columnIndex != null) {
|
|
168
134
|
var sortOrder = nextStatusOrder(sortOrdered);
|
|
169
135
|
onSorting(columnIndex, sortOrder);
|
|
@@ -190,26 +156,22 @@ export var withSortableColumn = function withSortableColumn(WrapperComponent) {
|
|
|
190
156
|
});
|
|
191
157
|
}
|
|
192
158
|
});
|
|
193
|
-
|
|
194
159
|
return _this;
|
|
195
160
|
}
|
|
196
|
-
|
|
197
161
|
_createClass(WithSortableColumn, [{
|
|
198
162
|
key: "render",
|
|
199
163
|
value: function render() {
|
|
200
164
|
var _this$props3 = this.props,
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
165
|
+
allowColumnSorting = _this$props3.allowColumnSorting,
|
|
166
|
+
onSorting = _this$props3.onSorting,
|
|
167
|
+
children = _this$props3.children,
|
|
168
|
+
sortOrdered = _this$props3.sortOrdered,
|
|
169
|
+
isHeaderRow = _this$props3.isHeaderRow,
|
|
170
|
+
intl = _this$props3.intl;
|
|
207
171
|
var sortOrderedClassName = sortOrdered === SortOrder.NO_ORDER ? RendererCssClassName.SORTABLE_COLUMN_NO_ORDER : '';
|
|
208
|
-
|
|
209
172
|
if (!allowColumnSorting || !isHeaderRow) {
|
|
210
173
|
return /*#__PURE__*/React.createElement(WrapperComponent, this.props);
|
|
211
174
|
}
|
|
212
|
-
|
|
213
175
|
return /*#__PURE__*/React.createElement(WrapperComponent, _extends({}, this.props, {
|
|
214
176
|
className: RendererCssClassName.SORTABLE_COLUMN_WRAPPER,
|
|
215
177
|
ariaSort: getSortOrderLabel(intl, sortOrdered)
|
|
@@ -225,10 +187,8 @@ export var withSortableColumn = function withSortableColumn(WrapperComponent) {
|
|
|
225
187
|
}))));
|
|
226
188
|
}
|
|
227
189
|
}]);
|
|
228
|
-
|
|
229
190
|
return WithSortableColumn;
|
|
230
191
|
}(React.Component);
|
|
231
|
-
|
|
232
192
|
return injectIntl(WithSortableColumn);
|
|
233
193
|
};
|
|
234
194
|
export var TableHeader = compose(withSortableColumn, withCellProps)('th');
|