@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
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
import { fileCardImageViewSelector } from '@atlaskit/media-card/classnames';
|
|
2
2
|
import { mediaViewerPopupClass } from '@atlaskit/media-viewer/classnames';
|
|
3
|
+
|
|
3
4
|
/**
|
|
4
5
|
* Check if an element is interactive (or otherwise if clicking on it shouldn't transition the
|
|
5
6
|
* renderer to the editor in somewhere like the Jira description
|
|
6
7
|
* @param element
|
|
7
8
|
*/
|
|
8
|
-
|
|
9
9
|
export function isInteractiveElement(element) {
|
|
10
10
|
if ('href' in element && element.href != null) {
|
|
11
11
|
return true;
|
|
12
12
|
}
|
|
13
|
-
|
|
14
13
|
if (element.classList.contains(mediaViewerPopupClass)) {
|
|
15
14
|
return true;
|
|
16
15
|
}
|
|
17
|
-
|
|
18
16
|
if (element.classList.contains(fileCardImageViewSelector)) {
|
|
19
17
|
return true;
|
|
20
18
|
}
|
|
21
|
-
|
|
22
19
|
return false;
|
|
23
20
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
-
|
|
4
3
|
/** @jsx jsx */
|
|
5
4
|
import React, { Fragment, useContext, useLayoutEffect, useRef } from 'react';
|
|
6
5
|
import { jsx } from '@emotion/react';
|
|
@@ -36,17 +35,16 @@ import { RenderTracking } from '../../react/utils/performance/RenderTracking';
|
|
|
36
35
|
export const NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
37
36
|
export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
38
37
|
const packageName = "@atlaskit/renderer";
|
|
39
|
-
const packageVersion = "
|
|
38
|
+
const packageVersion = "106.0.0";
|
|
40
39
|
export class Renderer extends PureComponent {
|
|
41
40
|
/**
|
|
42
41
|
* This is used in measuring the Renderer Mount time and is then
|
|
43
42
|
* deleted once that measurement occurs.
|
|
44
43
|
*/
|
|
44
|
+
|
|
45
45
|
constructor(props) {
|
|
46
46
|
super(props);
|
|
47
|
-
|
|
48
47
|
_defineProperty(this, "renderedMeasurementDistortedDurationMonitor", getDistortedDurationMonitor());
|
|
49
|
-
|
|
50
48
|
_defineProperty(this, "featureFlags", memoizeOne(featureFlags => {
|
|
51
49
|
const normalizedFeatureFlags = normalizeFeatureFlags(featureFlags, {
|
|
52
50
|
objectFlagKeys: ['rendererRenderTracking']
|
|
@@ -55,26 +53,21 @@ export class Renderer extends PureComponent {
|
|
|
55
53
|
featureFlags: normalizedFeatureFlags
|
|
56
54
|
};
|
|
57
55
|
}));
|
|
58
|
-
|
|
59
56
|
_defineProperty(this, "fireAnalyticsEvent", event => {
|
|
60
57
|
const {
|
|
61
58
|
createAnalyticsEvent
|
|
62
59
|
} = this.props;
|
|
63
|
-
|
|
64
60
|
if (createAnalyticsEvent) {
|
|
65
61
|
const channel = FabricChannel.editor;
|
|
66
62
|
createAnalyticsEvent(event).fire(channel);
|
|
67
63
|
}
|
|
68
64
|
});
|
|
69
|
-
|
|
70
65
|
_defineProperty(this, "getSchema", memoizeOne((schema, adfStage) => {
|
|
71
66
|
if (schema) {
|
|
72
67
|
return schema;
|
|
73
68
|
}
|
|
74
|
-
|
|
75
69
|
return getSchemaBasedOnStage(adfStage);
|
|
76
70
|
}));
|
|
77
|
-
|
|
78
71
|
_defineProperty(this, "onMouseDownEditView", () => {
|
|
79
72
|
// When the user is deselecting text on the screen by clicking, if they are clicking outside
|
|
80
73
|
// the current selection, by the time the onclick handler is called the window.getSelection()
|
|
@@ -83,73 +76,57 @@ export class Renderer extends PureComponent {
|
|
|
83
76
|
const windowSelection = window.getSelection();
|
|
84
77
|
this.mouseDownSelection = windowSelection !== null ? windowSelection.toString() : undefined;
|
|
85
78
|
});
|
|
86
|
-
|
|
87
79
|
_defineProperty(this, "handleMouseTripleClickInTables", event => {
|
|
88
80
|
var _parentElement, _parentElement2;
|
|
89
|
-
|
|
90
81
|
if (browser.ios || browser.android) {
|
|
91
82
|
return;
|
|
92
83
|
}
|
|
93
|
-
|
|
94
84
|
const badBrowser = browser.chrome || browser.safari;
|
|
95
85
|
const tripleClick = event.detail >= 3;
|
|
96
|
-
|
|
97
86
|
if (!(badBrowser && tripleClick)) {
|
|
98
87
|
return;
|
|
99
88
|
}
|
|
100
|
-
|
|
101
89
|
const selection = window.getSelection();
|
|
102
|
-
|
|
103
90
|
if (!selection) {
|
|
104
91
|
return;
|
|
105
92
|
}
|
|
106
|
-
|
|
107
93
|
const {
|
|
108
94
|
type,
|
|
109
95
|
anchorNode,
|
|
110
96
|
focusNode
|
|
111
97
|
} = selection;
|
|
112
98
|
const rangeSelection = Boolean(type === 'Range' && anchorNode && focusNode);
|
|
113
|
-
|
|
114
99
|
if (!rangeSelection) {
|
|
115
100
|
return;
|
|
116
101
|
}
|
|
117
|
-
|
|
118
102
|
const target = event.target;
|
|
119
103
|
const tableCell = target.closest('td,th');
|
|
120
104
|
const clickedInCell = Boolean(tableCell);
|
|
121
|
-
|
|
122
105
|
if (!clickedInCell) {
|
|
123
106
|
return;
|
|
124
107
|
}
|
|
125
|
-
|
|
126
108
|
const anchorInCell = tableCell.contains(anchorNode);
|
|
127
109
|
const focusInCell = tableCell.contains(focusNode);
|
|
128
110
|
const selectionStartsOrEndsOutsideClickedCell = !(anchorInCell && focusInCell);
|
|
129
|
-
|
|
130
111
|
if (!selectionStartsOrEndsOutsideClickedCell) {
|
|
131
112
|
return;
|
|
132
|
-
}
|
|
113
|
+
}
|
|
114
|
+
// If selection starts or ends in a different cell than the clicked cell,
|
|
133
115
|
// we select the node inside the clicked cell (or if both are in a different
|
|
134
116
|
// cell, we select the cell's contents instead). We want to select the nearest
|
|
135
117
|
// parent block, so that a whole line of text/content is selected (rather than
|
|
136
118
|
// selecting a span that would select one specific chunk of text).
|
|
137
|
-
|
|
138
|
-
|
|
139
119
|
const elementToSelect = anchorInCell ? (_parentElement = anchorNode.parentElement) === null || _parentElement === void 0 ? void 0 : _parentElement.closest('div,p') : focusInCell ? (_parentElement2 = focusNode.parentElement) === null || _parentElement2 === void 0 ? void 0 : _parentElement2.closest('div,p') : tableCell;
|
|
140
|
-
|
|
141
120
|
if (elementToSelect) {
|
|
142
121
|
selection.selectAllChildren(elementToSelect);
|
|
143
122
|
}
|
|
144
123
|
});
|
|
145
|
-
|
|
146
124
|
this.providerFactory = props.dataProviders || new ProviderFactory();
|
|
147
125
|
this.serializer = new ReactSerializer(this.deriveSerializerProps(props));
|
|
148
126
|
this.editorRef = props.innerRef || /*#__PURE__*/React.createRef();
|
|
149
127
|
this.id = uuid();
|
|
150
128
|
startMeasure(`Renderer Render Time: ${this.id}`);
|
|
151
129
|
const _featureFlags = this.featureFlags(this.props.featureFlags).featureFlags;
|
|
152
|
-
|
|
153
130
|
if (_featureFlags !== null && _featureFlags !== void 0 && _featureFlags.rendererTtiTracking) {
|
|
154
131
|
measureTTI((tti, ttiFromInvocation, canceled) => {
|
|
155
132
|
this.fireAnalyticsEvent({
|
|
@@ -165,17 +142,15 @@ export class Renderer extends PureComponent {
|
|
|
165
142
|
});
|
|
166
143
|
}
|
|
167
144
|
}
|
|
168
|
-
|
|
169
145
|
anchorLinkAnalytics() {
|
|
170
146
|
const hash = window.location.hash && decodeURIComponent(window.location.hash.slice(1));
|
|
171
147
|
const {
|
|
172
148
|
disableHeadingIDs
|
|
173
149
|
} = this.props;
|
|
174
|
-
|
|
175
150
|
if (!disableHeadingIDs && hash && this.editorRef && this.editorRef.current instanceof HTMLElement) {
|
|
176
|
-
const anchorLinkElement = document.getElementById(hash);
|
|
151
|
+
const anchorLinkElement = document.getElementById(hash);
|
|
152
|
+
// We are not use this.editorRef.querySelector here, instead we have this.editorRef.contains
|
|
177
153
|
// because querySelector might fail if there are special characters in hash, and CSS.escape is still experimental.
|
|
178
|
-
|
|
179
154
|
if (anchorLinkElement && this.editorRef.current.contains(anchorLinkElement)) {
|
|
180
155
|
this.fireAnalyticsEvent({
|
|
181
156
|
action: ACTION.VIEWED,
|
|
@@ -189,7 +164,6 @@ export class Renderer extends PureComponent {
|
|
|
189
164
|
}
|
|
190
165
|
}
|
|
191
166
|
}
|
|
192
|
-
|
|
193
167
|
componentDidMount() {
|
|
194
168
|
this.fireAnalyticsEvent({
|
|
195
169
|
action: ACTION.STARTED,
|
|
@@ -202,7 +176,6 @@ export class Renderer extends PureComponent {
|
|
|
202
176
|
this.rafID = requestAnimationFrame(() => {
|
|
203
177
|
stopMeasure(`Renderer Render Time: ${this.id}`, duration => {
|
|
204
178
|
var _analyticsEventSeveri, _analyticsEventSeveri2;
|
|
205
|
-
|
|
206
179
|
const {
|
|
207
180
|
analyticsEventSeverityTracking
|
|
208
181
|
} = this.props;
|
|
@@ -230,16 +203,13 @@ export class Renderer extends PureComponent {
|
|
|
230
203
|
this.anchorLinkAnalytics();
|
|
231
204
|
});
|
|
232
205
|
}
|
|
233
|
-
|
|
234
206
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
235
207
|
const nextMedia = nextProps.media || {};
|
|
236
208
|
const media = this.props.media || {};
|
|
237
|
-
|
|
238
209
|
if (nextProps.portal !== this.props.portal || nextProps.appearance !== this.props.appearance || nextProps.stickyHeaders !== this.props.stickyHeaders || nextProps.disableActions !== this.props.disableActions || nextProps.allowCustomPanels !== this.props.allowCustomPanels || nextProps.allowHeadingAnchorLinks !== this.props.allowHeadingAnchorLinks || nextMedia.allowLinking !== media.allowLinking) {
|
|
239
210
|
this.serializer = new ReactSerializer(this.deriveSerializerProps(nextProps));
|
|
240
211
|
}
|
|
241
212
|
}
|
|
242
|
-
|
|
243
213
|
deriveSerializerProps(props) {
|
|
244
214
|
// if just passed a boolean, change shape into object to simplify type
|
|
245
215
|
const stickyHeaders = props.stickyHeaders ? props.stickyHeaders === true ? {} : props.stickyHeaders : undefined;
|
|
@@ -284,7 +254,6 @@ export class Renderer extends PureComponent {
|
|
|
284
254
|
allowWindowedCodeBlock: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.allowWindowedCodeBlock
|
|
285
255
|
};
|
|
286
256
|
}
|
|
287
|
-
|
|
288
257
|
render() {
|
|
289
258
|
const {
|
|
290
259
|
document: adfDocument,
|
|
@@ -309,64 +278,56 @@ export class Renderer extends PureComponent {
|
|
|
309
278
|
* renderer out for the editor).
|
|
310
279
|
* @param event Click event anywhere inside renderer
|
|
311
280
|
*/
|
|
312
|
-
|
|
313
281
|
const handleWrapperOnClick = event => {
|
|
314
282
|
var _this$props$eventHand;
|
|
283
|
+
const targetElement = event.target;
|
|
315
284
|
|
|
316
|
-
|
|
285
|
+
// ED-14862: When a user triple clicks to select a line of content inside a
|
|
317
286
|
// a table cell, but the browser incorrectly moves the selection start or end into
|
|
318
287
|
// a different table cell, we manually set the selection back to within the original
|
|
319
288
|
// table cell the user intended to target
|
|
320
|
-
|
|
321
289
|
this.handleMouseTripleClickInTables(event);
|
|
322
|
-
|
|
323
290
|
if (!((_this$props$eventHand = this.props.eventHandlers) !== null && _this$props$eventHand !== void 0 && _this$props$eventHand.onUnhandledClick)) {
|
|
324
291
|
return;
|
|
325
292
|
}
|
|
326
|
-
|
|
327
293
|
if (!(targetElement instanceof window.Element)) {
|
|
328
294
|
return;
|
|
329
295
|
}
|
|
296
|
+
const rendererWrapper = event.currentTarget;
|
|
330
297
|
|
|
331
|
-
|
|
332
|
-
|
|
298
|
+
// Check if the click was on an interactive element
|
|
333
299
|
const isInteractiveElementInTree = findInTree(targetElement, rendererWrapper, isInteractiveElement);
|
|
334
|
-
|
|
335
300
|
if (isInteractiveElementInTree) {
|
|
336
301
|
return;
|
|
337
|
-
}
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
// Ensure that selecting text in the renderer doesn't trigger onUnhandledClick
|
|
338
305
|
// This logic originated in jira-frontend:
|
|
339
306
|
// src/packages/issue/issue-view/src/views/field/rich-text/rich-text-inline-edit-view.js
|
|
307
|
+
|
|
340
308
|
// The selection is required to be checked in `onMouseDown` and here. If not here, a new
|
|
341
309
|
// selection isn't reported; if not in `onMouseDown`, a click outside the selection will
|
|
342
310
|
// return an empty selection, which will erroneously fire onUnhandledClick.
|
|
343
|
-
|
|
344
|
-
|
|
345
311
|
const windowSelection = window.getSelection();
|
|
346
312
|
const selection = windowSelection !== null ? windowSelection.toString() : undefined;
|
|
347
313
|
const hasSelection = selection && selection.length !== 0;
|
|
348
314
|
const hasSelectionMouseDown = this.mouseDownSelection && this.mouseDownSelection.length !== 0;
|
|
349
315
|
const allowEditBasedOnSelection = !hasSelection && !hasSelectionMouseDown;
|
|
350
|
-
|
|
351
316
|
if (allowEditBasedOnSelection) {
|
|
352
317
|
this.props.eventHandlers.onUnhandledClick(event);
|
|
353
318
|
}
|
|
354
319
|
};
|
|
355
|
-
|
|
356
320
|
try {
|
|
357
321
|
var _this$featureFlags, _this$featureFlags$fe, _this$featureFlags$fe2;
|
|
358
|
-
|
|
359
322
|
const schema = this.getSchema(this.props.schema, this.props.adfStage);
|
|
360
323
|
const {
|
|
361
324
|
result,
|
|
362
325
|
stat,
|
|
363
326
|
pmDoc
|
|
364
327
|
} = renderDocument(adfDocument, this.serializer, schema, adfStage, this.props.useSpecBasedValidator, this.id, this.fireAnalyticsEvent, this.props.unsupportedContentLevelsTracking, this.props.appearance);
|
|
365
|
-
|
|
366
328
|
if (onComplete) {
|
|
367
329
|
onComplete(stat);
|
|
368
330
|
}
|
|
369
|
-
|
|
370
331
|
const rendererOutput = jsx(RendererContextProvider, {
|
|
371
332
|
value: this.featureFlags(this.props.featureFlags)
|
|
372
333
|
}, jsx(ActiveHeaderIdProvider, {
|
|
@@ -407,7 +368,6 @@ export class Renderer extends PureComponent {
|
|
|
407
368
|
if (onError) {
|
|
408
369
|
onError(e);
|
|
409
370
|
}
|
|
410
|
-
|
|
411
371
|
return jsx(RendererWrapper, {
|
|
412
372
|
appearance: appearance,
|
|
413
373
|
allowCopyToClipboard: allowCopyToClipboard,
|
|
@@ -418,23 +378,20 @@ export class Renderer extends PureComponent {
|
|
|
418
378
|
}, jsx(UnsupportedBlock, null));
|
|
419
379
|
}
|
|
420
380
|
}
|
|
421
|
-
|
|
422
381
|
componentWillUnmount() {
|
|
423
382
|
const {
|
|
424
383
|
dataProviders
|
|
425
384
|
} = this.props;
|
|
426
|
-
|
|
427
385
|
if (this.rafID) {
|
|
428
386
|
window.cancelAnimationFrame(this.rafID);
|
|
429
|
-
}
|
|
430
|
-
// it's safe to destroy it on Renderer unmount
|
|
431
|
-
|
|
387
|
+
}
|
|
432
388
|
|
|
389
|
+
// if this is the ProviderFactory which was created in constructor
|
|
390
|
+
// it's safe to destroy it on Renderer unmount
|
|
433
391
|
if (!dataProviders) {
|
|
434
392
|
this.providerFactory.destroy();
|
|
435
393
|
}
|
|
436
394
|
}
|
|
437
|
-
|
|
438
395
|
}
|
|
439
396
|
const RendererWithAnalytics = /*#__PURE__*/React.memo(props => jsx(FabricEditorAnalyticsContext, {
|
|
440
397
|
data: {
|
|
@@ -482,7 +439,6 @@ const RendererWrapper = /*#__PURE__*/React.memo(props => {
|
|
|
482
439
|
})
|
|
483
440
|
}, children)));
|
|
484
441
|
});
|
|
485
|
-
|
|
486
442
|
function RendererActionsInternalUpdater({
|
|
487
443
|
children,
|
|
488
444
|
doc,
|
|
@@ -497,12 +453,10 @@ function RendererActionsInternalUpdater({
|
|
|
497
453
|
} else {
|
|
498
454
|
actions._privateUnregisterRenderer();
|
|
499
455
|
}
|
|
500
|
-
|
|
501
456
|
return () => actions._privateUnregisterRenderer();
|
|
502
457
|
}, [actions, schema, doc, onAnalyticsEvent]);
|
|
503
458
|
return children;
|
|
504
459
|
}
|
|
505
|
-
|
|
506
460
|
const RendererWithAnnotationSelection = props => {
|
|
507
461
|
const {
|
|
508
462
|
allowAnnotations,
|
|
@@ -510,13 +464,11 @@ const RendererWithAnnotationSelection = props => {
|
|
|
510
464
|
} = props;
|
|
511
465
|
const localRef = React.useRef(null);
|
|
512
466
|
const innerRef = props.innerRef || localRef;
|
|
513
|
-
|
|
514
467
|
if (!allowAnnotations) {
|
|
515
468
|
return jsx(RendererWithAnalytics, _extends({
|
|
516
469
|
innerRef: innerRef
|
|
517
470
|
}, props));
|
|
518
471
|
}
|
|
519
|
-
|
|
520
472
|
return jsx(RendererActionsContext, null, jsx(AnnotationsWrapper, {
|
|
521
473
|
rendererRef: innerRef,
|
|
522
474
|
adfDocument: adfDocument,
|
|
@@ -527,5 +479,4 @@ const RendererWithAnnotationSelection = props => {
|
|
|
527
479
|
featureFlags: props.featureFlags
|
|
528
480
|
}))));
|
|
529
481
|
};
|
|
530
|
-
|
|
531
482
|
export default RendererWithAnnotationSelection;
|
|
@@ -12,9 +12,7 @@ import { HeadingAnchorWrapperClassName } from '../../react/nodes/heading-anchor'
|
|
|
12
12
|
import { shadowObserverClassNames } from '@atlaskit/editor-common/ui';
|
|
13
13
|
import { getLightWeightCodeBlockStylesForRootRendererStyleSheet } from '../../react/nodes/codeBlock/components/lightWeightCodeBlock';
|
|
14
14
|
export const FullPagePadding = 32;
|
|
15
|
-
|
|
16
15
|
const getLineHeight = fontCode => headingSizesImport[fontCode].lineHeight / headingSizesImport[fontCode].size;
|
|
17
|
-
|
|
18
16
|
export const headingSizes = {
|
|
19
17
|
h1: {
|
|
20
18
|
lineHeight: getLineHeight('h700')
|
|
@@ -35,7 +33,6 @@ export const headingSizes = {
|
|
|
35
33
|
lineHeight: getLineHeight('h100')
|
|
36
34
|
}
|
|
37
35
|
};
|
|
38
|
-
|
|
39
36
|
const headingAnchorStyle = headingTag => css`
|
|
40
37
|
/**
|
|
41
38
|
* The copy link button doesn't reserve space in the DOM so that
|
|
@@ -79,14 +76,12 @@ const headingAnchorStyle = headingTag => css`
|
|
|
79
76
|
}
|
|
80
77
|
}
|
|
81
78
|
`;
|
|
82
|
-
|
|
83
79
|
const alignedHeadingAnchorStyle = ({
|
|
84
80
|
allowNestedHeaderLinks
|
|
85
81
|
}) => {
|
|
86
82
|
if (!allowNestedHeaderLinks) {
|
|
87
83
|
return '';
|
|
88
84
|
}
|
|
89
|
-
|
|
90
85
|
return css`
|
|
91
86
|
.fabric-editor-block-mark[data-align] > {
|
|
92
87
|
h1,
|
|
@@ -149,7 +144,6 @@ const alignedHeadingAnchorStyle = ({
|
|
|
149
144
|
}
|
|
150
145
|
`;
|
|
151
146
|
};
|
|
152
|
-
|
|
153
147
|
const tableSortableColumnStyle = ({
|
|
154
148
|
allowColumnSorting,
|
|
155
149
|
allowNestedHeaderLinks
|
|
@@ -157,9 +151,7 @@ const tableSortableColumnStyle = ({
|
|
|
157
151
|
if (!allowColumnSorting) {
|
|
158
152
|
return '';
|
|
159
153
|
}
|
|
160
|
-
|
|
161
154
|
let headingsCss = '';
|
|
162
|
-
|
|
163
155
|
if (allowNestedHeaderLinks) {
|
|
164
156
|
headingsCss = `
|
|
165
157
|
/**
|
|
@@ -185,7 +177,6 @@ const tableSortableColumnStyle = ({
|
|
|
185
177
|
}
|
|
186
178
|
`;
|
|
187
179
|
}
|
|
188
|
-
|
|
189
180
|
return css`
|
|
190
181
|
.${RendererCssClassName.SORTABLE_COLUMN_WRAPPER} {
|
|
191
182
|
padding: 0;
|
|
@@ -251,7 +242,6 @@ const tableSortableColumnStyle = ({
|
|
|
251
242
|
}
|
|
252
243
|
`;
|
|
253
244
|
};
|
|
254
|
-
|
|
255
245
|
const fullPageStyles = ({
|
|
256
246
|
appearance
|
|
257
247
|
}, {
|
|
@@ -260,21 +250,18 @@ const fullPageStyles = ({
|
|
|
260
250
|
if (appearance !== 'full-page' && appearance !== 'mobile') {
|
|
261
251
|
return '';
|
|
262
252
|
}
|
|
263
|
-
|
|
264
253
|
return css`
|
|
265
254
|
max-width: ${theme && theme.layoutMaxWidth ? `${theme.layoutMaxWidth}px` : 'none'};
|
|
266
255
|
margin: 0 auto;
|
|
267
256
|
padding: 0 ${appearance === 'full-page' ? FullPagePadding : 0}px;
|
|
268
257
|
`;
|
|
269
258
|
};
|
|
270
|
-
|
|
271
259
|
const fullWidthStyles = ({
|
|
272
260
|
appearance
|
|
273
261
|
}) => {
|
|
274
262
|
if (appearance !== 'full-width') {
|
|
275
263
|
return '';
|
|
276
264
|
}
|
|
277
|
-
|
|
278
265
|
return css`
|
|
279
266
|
max-width: ${akEditorFullWidthLayoutWidth}px;
|
|
280
267
|
margin: 0 auto;
|
|
@@ -286,7 +273,6 @@ const fullWidthStyles = ({
|
|
|
286
273
|
}
|
|
287
274
|
`;
|
|
288
275
|
};
|
|
289
|
-
|
|
290
276
|
export const rendererStyles = wrapperProps => theme => {
|
|
291
277
|
// This is required to be compatible with styled-components prop structure.
|
|
292
278
|
const themeProps = {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { css, jsx } from '@emotion/react';
|
|
3
3
|
import { Component } from 'react';
|
|
4
|
-
|
|
5
4
|
const fadeOutStyles = (maxHeight, top, backgroundColor) => css`
|
|
6
5
|
position: relative;
|
|
7
6
|
overflow-y: hidden;
|
|
@@ -19,7 +18,6 @@ const fadeOutStyles = (maxHeight, top, backgroundColor) => css`
|
|
|
19
18
|
);
|
|
20
19
|
}
|
|
21
20
|
`;
|
|
22
|
-
|
|
23
21
|
const FadeOut = props => {
|
|
24
22
|
const {
|
|
25
23
|
children,
|
|
@@ -33,13 +31,12 @@ const FadeOut = props => {
|
|
|
33
31
|
css: styles
|
|
34
32
|
}, children);
|
|
35
33
|
};
|
|
36
|
-
|
|
37
34
|
export class TruncatedWrapper extends Component {
|
|
38
35
|
constructor(props) {
|
|
39
36
|
super(props);
|
|
40
|
-
}
|
|
41
|
-
|
|
37
|
+
}
|
|
42
38
|
|
|
39
|
+
// TODO: Quality ticket as elevation.surface will be issue when sits top of modal. https://product-fabric.atlassian.net/browse/DSP-4123
|
|
43
40
|
render() {
|
|
44
41
|
const {
|
|
45
42
|
height = 95,
|
|
@@ -53,5 +50,4 @@ export class TruncatedWrapper extends Component {
|
|
|
53
50
|
backgroundColor: backgroundColor
|
|
54
51
|
}, children);
|
|
55
52
|
}
|
|
56
|
-
|
|
57
53
|
}
|
|
@@ -8,14 +8,12 @@ import { sortingIconMessages } from '../messages';
|
|
|
8
8
|
import { injectIntl } from 'react-intl-next';
|
|
9
9
|
import { RendererCssClassName } from '../consts';
|
|
10
10
|
export let StatusClassNames;
|
|
11
|
-
|
|
12
11
|
(function (StatusClassNames) {
|
|
13
12
|
StatusClassNames["ASC"] = "sorting-icon-svg__asc";
|
|
14
13
|
StatusClassNames["DESC"] = "sorting-icon-svg__desc";
|
|
15
14
|
StatusClassNames["NO_ORDER"] = "sorting-icon-svg__no_order";
|
|
16
15
|
StatusClassNames["SORTING_NOT_ALLOWED"] = "sorting-icon-svg__not-allowed";
|
|
17
16
|
})(StatusClassNames || (StatusClassNames = {}));
|
|
18
|
-
|
|
19
17
|
const buttonStyles = css`
|
|
20
18
|
position: absolute;
|
|
21
19
|
display: flex;
|
|
@@ -58,10 +56,11 @@ const iconWrapperStyles = css`
|
|
|
58
56
|
&.${RendererCssClassName.SORTABLE_COLUMN_ICON}-inactive {
|
|
59
57
|
opacity: 0.7;
|
|
60
58
|
}
|
|
61
|
-
`;
|
|
59
|
+
`;
|
|
60
|
+
|
|
61
|
+
// The icon is created with CSS due to the following Firefox issue: https://product-fabric.atlassian.net/browse/ED-8001
|
|
62
62
|
// The TL;DR is that svg's in tables mess up how HTML is copied in Firefox. Using a styled div instead solves the problem.
|
|
63
63
|
// For this reason, svg's should be avoided in tables until this issue is fixed: https://bugzilla.mozilla.org/show_bug.cgi?id=1664350
|
|
64
|
-
|
|
65
64
|
const iconStyles = css`
|
|
66
65
|
height: 100%;
|
|
67
66
|
width: 2px;
|
|
@@ -86,27 +85,21 @@ const iconStyles = css`
|
|
|
86
85
|
transform: rotate(-45deg) translate(-6.3px, 5.7px);
|
|
87
86
|
}
|
|
88
87
|
`;
|
|
89
|
-
|
|
90
88
|
const getIconClassName = (isSortingAllowed, sortOrdered) => {
|
|
91
89
|
const activated = sortOrdered !== SortOrder.NO_ORDER;
|
|
92
90
|
const activeStatusClass = `${RendererCssClassName.SORTABLE_COLUMN_ICON}-${activated ? 'active' : 'inactive'}`;
|
|
93
|
-
|
|
94
91
|
if (!isSortingAllowed) {
|
|
95
92
|
return `${StatusClassNames.SORTING_NOT_ALLOWED} ${activeStatusClass}`;
|
|
96
93
|
}
|
|
97
|
-
|
|
98
94
|
switch (sortOrdered) {
|
|
99
95
|
case SortOrder.ASC:
|
|
100
96
|
return `${StatusClassNames.ASC} ${activeStatusClass}`;
|
|
101
|
-
|
|
102
97
|
case SortOrder.DESC:
|
|
103
98
|
return `${StatusClassNames.DESC} ${activeStatusClass}`;
|
|
104
|
-
|
|
105
99
|
default:
|
|
106
100
|
return `${StatusClassNames.NO_ORDER} ${activeStatusClass}`;
|
|
107
101
|
}
|
|
108
102
|
};
|
|
109
|
-
|
|
110
103
|
const getTooltipTitle = (intl, isSortingAllowed, sortOrdered) => {
|
|
111
104
|
const {
|
|
112
105
|
noOrderLabel,
|
|
@@ -114,25 +107,19 @@ const getTooltipTitle = (intl, isSortingAllowed, sortOrdered) => {
|
|
|
114
107
|
descOrderLabel,
|
|
115
108
|
invalidLabel
|
|
116
109
|
} = sortingIconMessages;
|
|
117
|
-
|
|
118
110
|
if (!isSortingAllowed) {
|
|
119
111
|
return intl.formatMessage(invalidLabel);
|
|
120
112
|
}
|
|
121
|
-
|
|
122
113
|
switch (sortOrdered) {
|
|
123
114
|
case SortOrder.NO_ORDER:
|
|
124
115
|
return intl.formatMessage(noOrderLabel);
|
|
125
|
-
|
|
126
116
|
case SortOrder.ASC:
|
|
127
117
|
return intl.formatMessage(ascOrderLabel);
|
|
128
|
-
|
|
129
118
|
case SortOrder.DESC:
|
|
130
119
|
return intl.formatMessage(descOrderLabel);
|
|
131
120
|
}
|
|
132
|
-
|
|
133
121
|
return '';
|
|
134
122
|
};
|
|
135
|
-
|
|
136
123
|
const SortingIcon = ({
|
|
137
124
|
isSortingAllowed,
|
|
138
125
|
sortOrdered,
|
|
@@ -142,19 +129,16 @@ const SortingIcon = ({
|
|
|
142
129
|
}) => {
|
|
143
130
|
const buttonClassName = `${RendererCssClassName.SORTABLE_COLUMN_ICON}${isSortingAllowed ? '' : ` ${RendererCssClassName.SORTABLE_COLUMN_ICON}__not-allowed`}`;
|
|
144
131
|
const content = getTooltipTitle(intl, isSortingAllowed, sortOrdered);
|
|
145
|
-
|
|
146
132
|
const handleClick = () => {
|
|
147
133
|
if (isSortingAllowed) {
|
|
148
134
|
onClick();
|
|
149
135
|
}
|
|
150
136
|
};
|
|
151
|
-
|
|
152
137
|
const handleKeyDown = event => {
|
|
153
138
|
if (isSortingAllowed) {
|
|
154
139
|
onKeyDown(event);
|
|
155
140
|
}
|
|
156
141
|
};
|
|
157
|
-
|
|
158
142
|
return jsx(Tooltip, {
|
|
159
143
|
delay: 0,
|
|
160
144
|
content: content,
|
|
@@ -175,5 +159,4 @@ const SortingIcon = ({
|
|
|
175
159
|
css: iconStyles
|
|
176
160
|
}))));
|
|
177
161
|
};
|
|
178
|
-
|
|
179
162
|
export default injectIntl(SortingIcon);
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
const defaultValue = [undefined, () => {}];
|
|
3
3
|
export const TaskItemsFormatContext = /*#__PURE__*/React.createContext(defaultValue);
|
|
4
|
-
|
|
5
4
|
const reducer = (_state, action) => {
|
|
6
5
|
return action;
|
|
7
6
|
};
|
|
8
|
-
|
|
9
7
|
export function TaskItemsFormatProvider({
|
|
10
8
|
children
|
|
11
9
|
}) {
|
|
@@ -3,7 +3,6 @@ const {
|
|
|
3
3
|
Provider,
|
|
4
4
|
Consumer
|
|
5
5
|
} = /*#__PURE__*/React.createContext(undefined);
|
|
6
|
-
|
|
7
6
|
/**
|
|
8
7
|
* We need to expose this abstraction on top of the native Consumer in order to control when
|
|
9
8
|
* The consumer will get notified when a match has happened. If we use the Consumer directly in
|
|
@@ -26,9 +25,7 @@ const ActiveHeaderIdConsumer = ({
|
|
|
26
25
|
setActiveHeaderId(newActiveHeaderId);
|
|
27
26
|
onNestedHeaderIdMatch();
|
|
28
27
|
}
|
|
29
|
-
|
|
30
28
|
return null;
|
|
31
29
|
});
|
|
32
30
|
};
|
|
33
|
-
|
|
34
31
|
export { Provider as ActiveHeaderIdProvider, ActiveHeaderIdConsumer };
|
|
@@ -6,30 +6,25 @@ export const InlineCommentsStateContext = /*#__PURE__*/createContext({});
|
|
|
6
6
|
export class AnnotationsDraftContextWrapper extends React.Component {
|
|
7
7
|
constructor(...args) {
|
|
8
8
|
super(...args);
|
|
9
|
-
|
|
10
9
|
_defineProperty(this, "state", {
|
|
11
10
|
position: null
|
|
12
11
|
});
|
|
13
|
-
|
|
14
12
|
_defineProperty(this, "applyAnnotationDraftAt", nextPosition => {
|
|
15
13
|
const {
|
|
16
14
|
position
|
|
17
15
|
} = this.state;
|
|
18
|
-
|
|
19
16
|
if (!position) {
|
|
20
17
|
this.setState({
|
|
21
18
|
position: nextPosition
|
|
22
19
|
});
|
|
23
20
|
}
|
|
24
21
|
});
|
|
25
|
-
|
|
26
22
|
_defineProperty(this, "clearAnnotationDraft", () => {
|
|
27
23
|
this.setState({
|
|
28
24
|
position: null
|
|
29
25
|
});
|
|
30
26
|
});
|
|
31
27
|
}
|
|
32
|
-
|
|
33
28
|
render() {
|
|
34
29
|
const {
|
|
35
30
|
children
|
|
@@ -46,5 +41,4 @@ export class AnnotationsDraftContextWrapper extends React.Component {
|
|
|
46
41
|
clearAnnotationDraft
|
|
47
42
|
}));
|
|
48
43
|
}
|
|
49
|
-
|
|
50
44
|
}
|