@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,5 +1,4 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
|
|
3
2
|
/** @jsx jsx */
|
|
4
3
|
import React, { Fragment } from 'react';
|
|
5
4
|
import { css, jsx } from '@emotion/react';
|
|
@@ -9,7 +8,6 @@ import { splitText, calcTextSplitOffset } from './text';
|
|
|
9
8
|
import { calcInsertDraftPositionOnText } from './position';
|
|
10
9
|
import { dataAttributes } from './dom';
|
|
11
10
|
import { AnnotationSharedCSSByState } from '@atlaskit/editor-common/styles';
|
|
12
|
-
|
|
13
11
|
const markStyles = props => css`
|
|
14
12
|
color: inherit;
|
|
15
13
|
background-color: unset;
|
|
@@ -17,7 +15,6 @@ const markStyles = props => css`
|
|
|
17
15
|
|
|
18
16
|
${AnnotationSharedCSSByState(props).focus};
|
|
19
17
|
`;
|
|
20
|
-
|
|
21
18
|
export const AnnotationDraft = ({
|
|
22
19
|
draftPosition,
|
|
23
20
|
children
|
|
@@ -32,15 +29,12 @@ export const getAnnotationIndex = (annotationPosition, fragmentCount) => {
|
|
|
32
29
|
if (annotationPosition === InsertDraftPosition.START) {
|
|
33
30
|
return 0;
|
|
34
31
|
}
|
|
35
|
-
|
|
36
32
|
if (annotationPosition === InsertDraftPosition.END) {
|
|
37
33
|
return fragmentCount - 1;
|
|
38
34
|
}
|
|
39
|
-
|
|
40
35
|
if (annotationPosition === InsertDraftPosition.INSIDE && fragmentCount === 3) {
|
|
41
36
|
return 1;
|
|
42
37
|
}
|
|
43
|
-
|
|
44
38
|
return -1;
|
|
45
39
|
};
|
|
46
40
|
export const applyAnnotationOnText = ({
|
|
@@ -56,7 +50,6 @@ export const applyAnnotationOnText = ({
|
|
|
56
50
|
draftPosition: draftPosition
|
|
57
51
|
}, value);
|
|
58
52
|
}
|
|
59
|
-
|
|
60
53
|
return jsx(React.Fragment, {
|
|
61
54
|
key: index
|
|
62
55
|
}, value);
|
|
@@ -76,28 +69,22 @@ export const TextWithAnnotationDraft = ({
|
|
|
76
69
|
if (!nextDraftPosition) {
|
|
77
70
|
return false;
|
|
78
71
|
}
|
|
79
|
-
|
|
80
72
|
return calcInsertDraftPositionOnText(textPosition, nextDraftPosition);
|
|
81
73
|
}, [nextDraftPosition, textPosition]);
|
|
82
|
-
|
|
83
74
|
if (shouldApplyAnnotationAt === false || !nextDraftPosition) {
|
|
84
75
|
return jsx(Fragment, null, children);
|
|
85
76
|
}
|
|
86
|
-
|
|
87
77
|
if (shouldApplyAnnotationAt === InsertDraftPosition.AROUND_TEXT) {
|
|
88
78
|
return jsx(AnnotationDraft, {
|
|
89
79
|
key: 0,
|
|
90
80
|
draftPosition: nextDraftPosition
|
|
91
81
|
}, children);
|
|
92
82
|
}
|
|
93
|
-
|
|
94
83
|
const offsets = calcTextSplitOffset(nextDraftPosition, textPosition, children);
|
|
95
84
|
const texts = splitText(children, offsets);
|
|
96
|
-
|
|
97
85
|
if (!texts) {
|
|
98
86
|
return jsx(Fragment, null, children);
|
|
99
87
|
}
|
|
100
|
-
|
|
101
88
|
const components = applyAnnotationOnText({
|
|
102
89
|
texts,
|
|
103
90
|
shouldApplyAnnotationAt,
|
|
@@ -8,25 +8,19 @@ export const dataAttributes = ({
|
|
|
8
8
|
['data-draft-end-at']: to
|
|
9
9
|
};
|
|
10
10
|
};
|
|
11
|
-
|
|
12
11
|
const buildDataAttributesQuery = pos => {
|
|
13
12
|
const a = dataAttributes(pos);
|
|
14
13
|
return Object.entries(a).map(([k, v]) => `[${k}="${v}"]`).join('');
|
|
15
14
|
};
|
|
16
|
-
|
|
17
15
|
export const updateWindowSelectionAroundDraft = pos => {
|
|
18
16
|
const sel = window.getSelection();
|
|
19
|
-
|
|
20
17
|
if (!sel) {
|
|
21
18
|
return false;
|
|
22
19
|
}
|
|
23
|
-
|
|
24
20
|
const draftNodes = document.querySelectorAll(buildDataAttributesQuery(pos));
|
|
25
|
-
|
|
26
21
|
if (!draftNodes || draftNodes.length === 0) {
|
|
27
22
|
return false;
|
|
28
23
|
}
|
|
29
|
-
|
|
30
24
|
sel.removeAllRanges();
|
|
31
25
|
const range = document.createRange();
|
|
32
26
|
range.setStart(draftNodes[0], 0);
|
|
@@ -4,28 +4,20 @@ export const calcInsertDraftPositionOnText = ({
|
|
|
4
4
|
end: endTextPosition
|
|
5
5
|
}, position) => {
|
|
6
6
|
const isRangePositionAroundText = position.from <= startTextPosition && position.to >= endTextPosition;
|
|
7
|
-
|
|
8
7
|
if (isRangePositionAroundText) {
|
|
9
8
|
return InsertDraftPosition.AROUND_TEXT;
|
|
10
9
|
}
|
|
11
|
-
|
|
12
10
|
const isRangePositionInsideText = position.from > startTextPosition && position.from < endTextPosition && position.to < endTextPosition && position.to > startTextPosition;
|
|
13
|
-
|
|
14
11
|
if (isRangePositionInsideText) {
|
|
15
12
|
return InsertDraftPosition.INSIDE;
|
|
16
13
|
}
|
|
17
|
-
|
|
18
14
|
const isRangePositionStartingAtText = position.from >= startTextPosition && position.from <= endTextPosition && position.to >= endTextPosition;
|
|
19
|
-
|
|
20
15
|
if (isRangePositionStartingAtText) {
|
|
21
16
|
return InsertDraftPosition.END;
|
|
22
17
|
}
|
|
23
|
-
|
|
24
18
|
const isRangePositionEndingAtText = position.from <= startTextPosition && position.to >= startTextPosition && position.to <= endTextPosition;
|
|
25
|
-
|
|
26
19
|
if (isRangePositionEndingAtText) {
|
|
27
20
|
return InsertDraftPosition.START;
|
|
28
21
|
}
|
|
29
|
-
|
|
30
22
|
return false;
|
|
31
23
|
};
|
|
@@ -5,7 +5,6 @@ export const splitText = (text, {
|
|
|
5
5
|
if (endOffset > text.length || endOffset - startOffset <= 0) {
|
|
6
6
|
return null;
|
|
7
7
|
}
|
|
8
|
-
|
|
9
8
|
return [text.slice(0, startOffset), text.slice(startOffset, endOffset), text.slice(endOffset)].filter(Boolean);
|
|
10
9
|
};
|
|
11
10
|
export const calcTextSplitOffset = (position, textPosition, text) => {
|
|
@@ -4,7 +4,6 @@ import { MarkComponent } from './mark';
|
|
|
4
4
|
import { useInlineCommentSubscriberContext, useHasFocusEvent, useInlineCommentsFilter } from '../hooks';
|
|
5
5
|
import { InlineCommentsStateContext } from '../context';
|
|
6
6
|
import { AnnotationUpdateEvent } from '@atlaskit/editor-common/types';
|
|
7
|
-
|
|
8
7
|
const MarkElement = ({
|
|
9
8
|
annotationParentIds,
|
|
10
9
|
children,
|
|
@@ -22,7 +21,6 @@ const MarkElement = ({
|
|
|
22
21
|
if (!updateSubscriber) {
|
|
23
22
|
return;
|
|
24
23
|
}
|
|
25
|
-
|
|
26
24
|
const {
|
|
27
25
|
eventTarget,
|
|
28
26
|
annotationIds
|
|
@@ -47,5 +45,4 @@ const MarkElement = ({
|
|
|
47
45
|
state: states[id]
|
|
48
46
|
}, children);
|
|
49
47
|
};
|
|
50
|
-
|
|
51
48
|
export { MarkElement };
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
|
|
3
2
|
/** @jsx jsx */
|
|
4
3
|
import React, { useMemo, useCallback } from 'react';
|
|
5
4
|
import { css, jsx } from '@emotion/react';
|
|
6
5
|
import { AnnotationSharedCSSByState } from '@atlaskit/editor-common/styles';
|
|
7
6
|
import { AnnotationMarkStates } from '@atlaskit/adf-schema';
|
|
8
|
-
|
|
9
7
|
const markStyles = props => css`
|
|
10
8
|
color: inherit;
|
|
11
9
|
background-color: unset;
|
|
@@ -24,7 +22,6 @@ const markStyles = props => css`
|
|
|
24
22
|
}
|
|
25
23
|
}
|
|
26
24
|
`;
|
|
27
|
-
|
|
28
25
|
export const MarkComponent = ({
|
|
29
26
|
annotationParentIds,
|
|
30
27
|
children,
|
|
@@ -39,16 +36,17 @@ export const MarkComponent = ({
|
|
|
39
36
|
// prevents multiple callback on overlapping annotations
|
|
40
37
|
if (event.defaultPrevented || state !== AnnotationMarkStates.ACTIVE) {
|
|
41
38
|
return;
|
|
42
|
-
}
|
|
43
|
-
|
|
39
|
+
}
|
|
44
40
|
|
|
41
|
+
// prevents from opening link URL inside webView in Safari
|
|
45
42
|
event.preventDefault();
|
|
46
43
|
onClick({
|
|
47
44
|
eventTarget: event.target,
|
|
48
45
|
annotationIds
|
|
49
46
|
});
|
|
50
47
|
}, [annotationIds, onClick, state]);
|
|
51
|
-
const overriddenData = !state ? dataAttributes : {
|
|
48
|
+
const overriddenData = !state ? dataAttributes : {
|
|
49
|
+
...dataAttributes,
|
|
52
50
|
'data-mark-annotation-state': state,
|
|
53
51
|
'data-has-focus': hasFocus
|
|
54
52
|
};
|
|
@@ -12,28 +12,26 @@ export const useAnnotationStateByTypeEvent = ({
|
|
|
12
12
|
if (!updateSubscriber) {
|
|
13
13
|
return;
|
|
14
14
|
}
|
|
15
|
-
|
|
16
15
|
const cb = payload => {
|
|
17
16
|
if (!payload) {
|
|
18
17
|
return;
|
|
19
18
|
}
|
|
20
|
-
|
|
21
19
|
const nextStates = Object.values(payload).reduce((acc, curr) => {
|
|
22
20
|
if (curr.id && curr.annotationType === type) {
|
|
23
21
|
// Check for empty state to prevent additional renders
|
|
24
22
|
const isEmpty = curr.state === null || curr.state === undefined;
|
|
25
|
-
return {
|
|
23
|
+
return {
|
|
24
|
+
...acc,
|
|
26
25
|
[curr.id]: !isEmpty ? curr.state : states[curr.id]
|
|
27
26
|
};
|
|
28
27
|
}
|
|
29
|
-
|
|
30
28
|
return acc;
|
|
31
29
|
}, {});
|
|
32
|
-
setStates({
|
|
30
|
+
setStates({
|
|
31
|
+
...states,
|
|
33
32
|
...nextStates
|
|
34
33
|
});
|
|
35
34
|
};
|
|
36
|
-
|
|
37
35
|
updateSubscriber.on(AnnotationUpdateEvent.SET_ANNOTATION_STATE, cb);
|
|
38
36
|
return () => {
|
|
39
37
|
updateSubscriber.off(AnnotationUpdateEvent.SET_ANNOTATION_STATE, cb);
|
|
@@ -50,15 +48,12 @@ export const useHasFocusEvent = ({
|
|
|
50
48
|
if (!updateSubscriber) {
|
|
51
49
|
return;
|
|
52
50
|
}
|
|
53
|
-
|
|
54
51
|
const cb = payload => {
|
|
55
52
|
setHasFocus(payload && payload.annotationId === id);
|
|
56
53
|
};
|
|
57
|
-
|
|
58
54
|
const removeFocus = () => {
|
|
59
55
|
setHasFocus(false);
|
|
60
56
|
};
|
|
61
|
-
|
|
62
57
|
updateSubscriber.on(AnnotationUpdateEvent.SET_ANNOTATION_FOCUS, cb);
|
|
63
58
|
updateSubscriber.on(AnnotationUpdateEvent.REMOVE_ANNOTATION_FOCUS, removeFocus);
|
|
64
59
|
return () => {
|
|
@@ -78,7 +73,6 @@ export const useAnnotationClickEvent = props => {
|
|
|
78
73
|
if (!updateSubscriber) {
|
|
79
74
|
return;
|
|
80
75
|
}
|
|
81
|
-
|
|
82
76
|
const cb = ({
|
|
83
77
|
annotationIds,
|
|
84
78
|
eventTarget
|
|
@@ -87,7 +81,6 @@ export const useAnnotationClickEvent = props => {
|
|
|
87
81
|
id,
|
|
88
82
|
type: AnnotationTypes.INLINE_COMMENT
|
|
89
83
|
}));
|
|
90
|
-
|
|
91
84
|
if (createAnalyticsEvent) {
|
|
92
85
|
createAnalyticsEvent({
|
|
93
86
|
action: ACTION.VIEWED,
|
|
@@ -99,13 +92,11 @@ export const useAnnotationClickEvent = props => {
|
|
|
99
92
|
}
|
|
100
93
|
}).fire(FabricChannel.editor);
|
|
101
94
|
}
|
|
102
|
-
|
|
103
95
|
setAnnotationClickEvent({
|
|
104
96
|
annotations: annotationsByType,
|
|
105
97
|
clickElementTarget: eventTarget
|
|
106
98
|
});
|
|
107
99
|
};
|
|
108
|
-
|
|
109
100
|
updateSubscriber.on(AnnotationUpdateEvent.ON_ANNOTATION_CLICK, cb);
|
|
110
101
|
return () => {
|
|
111
102
|
updateSubscriber.off(AnnotationUpdateEvent.ON_ANNOTATION_CLICK, cb);
|
|
@@ -2,11 +2,9 @@ import { useContext } from 'react';
|
|
|
2
2
|
import { ProvidersContext } from '../context';
|
|
3
3
|
export const useInlineCommentSubscriberContext = () => {
|
|
4
4
|
const providers = useContext(ProvidersContext);
|
|
5
|
-
|
|
6
5
|
if (!providers) {
|
|
7
6
|
return null;
|
|
8
7
|
}
|
|
9
|
-
|
|
10
8
|
const {
|
|
11
9
|
inlineComment: {
|
|
12
10
|
updateSubscriber
|
|
@@ -11,32 +11,28 @@ export const useLoadAnnotations = ({
|
|
|
11
11
|
if (!providers) {
|
|
12
12
|
return;
|
|
13
13
|
}
|
|
14
|
-
|
|
15
14
|
const {
|
|
16
15
|
inlineComment: {
|
|
17
16
|
getState: inlineCommentGetState,
|
|
18
17
|
updateSubscriber: updateSubscriberInlineComment
|
|
19
18
|
}
|
|
20
19
|
} = providers;
|
|
21
|
-
const annotations = actions.getAnnotationMarks();
|
|
22
|
-
|
|
20
|
+
const annotations = actions.getAnnotationMarks();
|
|
21
|
+
// we don't want to request integrators for state with an empty list of ids.
|
|
23
22
|
if (!annotations.length) {
|
|
24
23
|
return;
|
|
25
24
|
}
|
|
26
|
-
|
|
27
25
|
const ids = annotations.map(mark => mark.attrs.id);
|
|
28
|
-
|
|
29
26
|
const cb = data => {
|
|
30
27
|
if (!updateSubscriberInlineComment) {
|
|
31
28
|
return;
|
|
32
29
|
}
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
const payload = data.reduce((acc, value) => ({
|
|
31
|
+
...acc,
|
|
35
32
|
[value.id]: value
|
|
36
33
|
}), {});
|
|
37
34
|
updateSubscriberInlineComment.emit(AnnotationUpdateEvent.SET_ANNOTATION_STATE, payload);
|
|
38
35
|
};
|
|
39
|
-
|
|
40
36
|
inlineCommentGetState(ids).then(cb);
|
|
41
37
|
}, [actions, providers, adfDocument]);
|
|
42
38
|
};
|
|
@@ -12,25 +12,19 @@ export const useUserSelectionRange = props => {
|
|
|
12
12
|
const {
|
|
13
13
|
current: rendererDOM
|
|
14
14
|
} = rendererRef;
|
|
15
|
-
|
|
16
15
|
if (!document || !rendererDOM) {
|
|
17
16
|
return;
|
|
18
17
|
}
|
|
19
|
-
|
|
20
18
|
const onSelectionChange = event => {
|
|
21
19
|
const sel = document.getSelection();
|
|
22
|
-
|
|
23
20
|
if (!sel || sel.type !== 'Range' || sel.rangeCount !== 1 || hasAnnotationDraft) {
|
|
24
21
|
return;
|
|
25
22
|
}
|
|
26
|
-
|
|
27
23
|
const _range = sel.getRangeAt(0);
|
|
28
|
-
|
|
29
24
|
if (isRangeInsideOfRendererContainer(rendererDOM, _range)) {
|
|
30
25
|
setRange(_range.cloneRange());
|
|
31
26
|
}
|
|
32
27
|
};
|
|
33
|
-
|
|
34
28
|
document.addEventListener('selectionchange', onSelectionChange);
|
|
35
29
|
return () => {
|
|
36
30
|
document.removeEventListener('selectionchange', onSelectionChange);
|
|
@@ -24,12 +24,10 @@ export const SelectionInlineCommentMounter = /*#__PURE__*/React.memo(props => {
|
|
|
24
24
|
if (!isAnnotationAllowed || !documentPosition || !applyAnnotation) {
|
|
25
25
|
return false;
|
|
26
26
|
}
|
|
27
|
-
|
|
28
27
|
const annotation = {
|
|
29
28
|
annotationId,
|
|
30
29
|
annotationType: AnnotationTypes.INLINE_COMMENT
|
|
31
30
|
};
|
|
32
|
-
|
|
33
31
|
if (createAnalyticsEvent) {
|
|
34
32
|
createAnalyticsEvent({
|
|
35
33
|
action: ACTION.INSERTED,
|
|
@@ -39,20 +37,16 @@ export const SelectionInlineCommentMounter = /*#__PURE__*/React.memo(props => {
|
|
|
39
37
|
eventType: EVENT_TYPE.TRACK
|
|
40
38
|
}).fire(FabricChannel.editor);
|
|
41
39
|
}
|
|
42
|
-
|
|
43
40
|
return applyAnnotation(draftDocumentPosition || documentPosition, annotation);
|
|
44
41
|
}, [isAnnotationAllowed, documentPosition, applyAnnotation, draftDocumentPosition, createAnalyticsEvent]);
|
|
45
42
|
const createIndexCallback = useCallback(() => {
|
|
46
43
|
if (!documentPosition || !generateIndexMatch) {
|
|
47
44
|
return false;
|
|
48
45
|
}
|
|
49
|
-
|
|
50
46
|
const result = generateIndexMatch(documentPosition);
|
|
51
|
-
|
|
52
47
|
if (!result) {
|
|
53
48
|
return false;
|
|
54
49
|
}
|
|
55
|
-
|
|
56
50
|
return result;
|
|
57
51
|
}, [documentPosition, generateIndexMatch]);
|
|
58
52
|
const applyDraftModeCallback = useCallback((keepNativeSelection = true) => {
|
|
@@ -66,13 +60,10 @@ export const SelectionInlineCommentMounter = /*#__PURE__*/React.memo(props => {
|
|
|
66
60
|
eventType: EVENT_TYPE.TRACK
|
|
67
61
|
}).fire(FabricChannel.editor);
|
|
68
62
|
}
|
|
69
|
-
|
|
70
63
|
return;
|
|
71
64
|
}
|
|
72
|
-
|
|
73
65
|
setDraftDocumentPosition(documentPosition);
|
|
74
66
|
applyAnnotationDraftAt(documentPosition);
|
|
75
|
-
|
|
76
67
|
if (createAnalyticsEvent) {
|
|
77
68
|
const uniqueAnnotationsInRange = actions.getAnnotationsByPosition(range);
|
|
78
69
|
createAnalyticsEvent({
|
|
@@ -85,13 +76,11 @@ export const SelectionInlineCommentMounter = /*#__PURE__*/React.memo(props => {
|
|
|
85
76
|
}
|
|
86
77
|
}).fire(FabricChannel.editor);
|
|
87
78
|
}
|
|
88
|
-
|
|
89
79
|
window.requestAnimationFrame(() => {
|
|
90
80
|
if (keepNativeSelection) {
|
|
91
81
|
updateWindowSelectionAroundDraft(documentPosition);
|
|
92
82
|
} else {
|
|
93
83
|
const sel = window.getSelection();
|
|
94
|
-
|
|
95
84
|
if (sel) {
|
|
96
85
|
sel.removeAllRanges();
|
|
97
86
|
}
|
|
@@ -102,7 +91,6 @@ export const SelectionInlineCommentMounter = /*#__PURE__*/React.memo(props => {
|
|
|
102
91
|
clearAnnotationDraft();
|
|
103
92
|
setDraftDocumentPosition(null);
|
|
104
93
|
const sel = window.getSelection();
|
|
105
|
-
|
|
106
94
|
if (sel) {
|
|
107
95
|
sel.removeAllRanges();
|
|
108
96
|
}
|
|
@@ -117,7 +105,6 @@ export const SelectionInlineCommentMounter = /*#__PURE__*/React.memo(props => {
|
|
|
117
105
|
attributes: {}
|
|
118
106
|
}).fire(FabricChannel.editor);
|
|
119
107
|
}
|
|
120
|
-
|
|
121
108
|
removeDraftModeCallback();
|
|
122
109
|
onCloseProps();
|
|
123
110
|
}, [onCloseProps, removeDraftModeCallback, createAnalyticsEvent]);
|
|
@@ -14,11 +14,9 @@ export const SelectionRangeValidator = props => {
|
|
|
14
14
|
const [range, clearRange] = useUserSelectionRange({
|
|
15
15
|
rendererRef
|
|
16
16
|
});
|
|
17
|
-
|
|
18
17
|
if (!range) {
|
|
19
18
|
return null;
|
|
20
19
|
}
|
|
21
|
-
|
|
22
20
|
const documentPosition = actions.getPositionFromRange(range);
|
|
23
21
|
const isAnnotationAllowed = documentPosition && actions.isValidAnnotationPosition(documentPosition);
|
|
24
22
|
return /*#__PURE__*/React.createElement(SelectionInlineCommentMounter, {
|
|
@@ -22,10 +22,8 @@ export const Wrapper = props => {
|
|
|
22
22
|
clearAnnotationDraft: clearAnnotationDraft
|
|
23
23
|
}));
|
|
24
24
|
}, [selectionComponent, children, rendererRef, createAnalyticsEvent]);
|
|
25
|
-
|
|
26
25
|
if (!selectionComponent) {
|
|
27
26
|
return /*#__PURE__*/React.createElement(React.Fragment, null, children);
|
|
28
27
|
}
|
|
29
|
-
|
|
30
28
|
return /*#__PURE__*/React.createElement(AnnotationsDraftContextWrapper, null, render);
|
|
31
29
|
};
|
|
@@ -2,7 +2,6 @@ import React, { useContext, useMemo } from 'react';
|
|
|
2
2
|
import { ProvidersContext } from '../context';
|
|
3
3
|
import { useAnnotationClickEvent } from '../hooks';
|
|
4
4
|
import { RendererContext } from '../../../ui/RendererActionsContext';
|
|
5
|
-
|
|
6
5
|
const AnnotationView = props => {
|
|
7
6
|
const providers = useContext(ProvidersContext);
|
|
8
7
|
const actionContext = useContext(RendererContext);
|
|
@@ -14,7 +13,6 @@ const AnnotationView = props => {
|
|
|
14
13
|
});
|
|
15
14
|
const ViewComponent = inlineCommentProvider && inlineCommentProvider.viewComponent;
|
|
16
15
|
const deleteAnnotation = useMemo(() => annotationInfo => actionContext.deleteAnnotation(annotationInfo.id, annotationInfo.type), [actionContext]);
|
|
17
|
-
|
|
18
16
|
if (ViewComponent && viewComponentProps) {
|
|
19
17
|
const {
|
|
20
18
|
annotations,
|
|
@@ -26,8 +24,6 @@ const AnnotationView = props => {
|
|
|
26
24
|
deleteAnnotation: deleteAnnotation
|
|
27
25
|
});
|
|
28
26
|
}
|
|
29
|
-
|
|
30
27
|
return null;
|
|
31
28
|
};
|
|
32
|
-
|
|
33
29
|
export { AnnotationView };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { useRendererContext } from './renderer-context';
|
|
2
2
|
export const useFeatureFlags = () => {
|
|
3
3
|
var _useRendererContext;
|
|
4
|
-
|
|
5
4
|
return (_useRendererContext = useRendererContext()) === null || _useRendererContext === void 0 ? void 0 : _useRendererContext.featureFlags;
|
|
6
5
|
};
|
package/dist/es2019/utils.js
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import { defaultSchema } from '@atlaskit/adf-schema/schema-default';
|
|
2
2
|
import { JSONTransformer } from '@atlaskit/editor-json-transformer';
|
|
3
|
-
|
|
4
3
|
function createEncoder(parser, encoder) {
|
|
5
4
|
return value => encoder.encode(parser.parse(value));
|
|
6
5
|
}
|
|
7
|
-
|
|
8
6
|
export class ADFEncoder {
|
|
9
7
|
constructor(createTransformerWithSchema) {
|
|
10
8
|
const transformer = createTransformerWithSchema(defaultSchema);
|
|
11
9
|
this.encode = createEncoder(transformer, new JSONTransformer());
|
|
12
10
|
}
|
|
13
|
-
|
|
14
11
|
}
|
|
15
12
|
export const getText = node => {
|
|
16
13
|
return node.text || node.attrs && (node.attrs.text || node.attrs.shortName) || `[${typeof node.type === 'string' ? node.type : node.type.name}]`;
|
|
@@ -22,9 +19,9 @@ export const getPlatform = rendererAppearance => {
|
|
|
22
19
|
if (rendererAppearance === 'mobile') {
|
|
23
20
|
return 'mobile';
|
|
24
21
|
}
|
|
25
|
-
|
|
26
22
|
return 'web';
|
|
27
23
|
};
|
|
24
|
+
|
|
28
25
|
/**
|
|
29
26
|
* Traverse through parent elements of element. Return element for which evaluate(element) returns
|
|
30
27
|
* true. If topElement is reached before evaluate returns true, return false. Does not run evaluate
|
|
@@ -34,19 +31,15 @@ export const getPlatform = rendererAppearance => {
|
|
|
34
31
|
* @param evaluate Function which returns true or false based on the given element. eg: Checks if
|
|
35
32
|
* element has desired classname.
|
|
36
33
|
*/
|
|
37
|
-
|
|
38
34
|
export function findInTree(element, topElement, evaluate) {
|
|
39
35
|
if (element === topElement) {
|
|
40
36
|
return false;
|
|
41
37
|
}
|
|
42
|
-
|
|
43
38
|
if (evaluate(element)) {
|
|
44
39
|
return true;
|
|
45
40
|
}
|
|
46
|
-
|
|
47
41
|
if (!element.parentElement) {
|
|
48
42
|
return false;
|
|
49
43
|
}
|
|
50
|
-
|
|
51
44
|
return findInTree(element.parentElement, topElement, evaluate);
|
|
52
45
|
}
|
package/dist/es2019/version.json
CHANGED