@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
|
@@ -4,12 +4,11 @@ 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
|
var MarkElement = function MarkElement(_ref) {
|
|
9
8
|
var annotationParentIds = _ref.annotationParentIds,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
children = _ref.children,
|
|
10
|
+
dataAttributes = _ref.dataAttributes,
|
|
11
|
+
id = _ref.id;
|
|
13
12
|
var updateSubscriber = useInlineCommentSubscriberContext();
|
|
14
13
|
var states = useContext(InlineCommentsStateContext);
|
|
15
14
|
var hasFocus = useHasFocusEvent({
|
|
@@ -23,9 +22,8 @@ var MarkElement = function MarkElement(_ref) {
|
|
|
23
22
|
if (!updateSubscriber) {
|
|
24
23
|
return;
|
|
25
24
|
}
|
|
26
|
-
|
|
27
25
|
var eventTarget = props.eventTarget,
|
|
28
|
-
|
|
26
|
+
annotationIds = props.annotationIds;
|
|
29
27
|
updateSubscriber.emit(AnnotationUpdateEvent.ON_ANNOTATION_CLICK, {
|
|
30
28
|
annotationIds: annotationIds,
|
|
31
29
|
eventTarget: eventTarget
|
|
@@ -46,5 +44,4 @@ var MarkElement = function MarkElement(_ref) {
|
|
|
46
44
|
state: states[id]
|
|
47
45
|
}, children);
|
|
48
46
|
};
|
|
49
|
-
|
|
50
47
|
export { MarkElement };
|
|
@@ -2,19 +2,14 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
4
4
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
5
|
-
|
|
6
5
|
var _templateObject;
|
|
7
|
-
|
|
8
6
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9
|
-
|
|
10
7
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
11
|
-
|
|
12
8
|
/** @jsx jsx */
|
|
13
9
|
import React, { useMemo, useCallback } from 'react';
|
|
14
10
|
import { css, jsx } from '@emotion/react';
|
|
15
11
|
import { AnnotationSharedCSSByState } from '@atlaskit/editor-common/styles';
|
|
16
12
|
import { AnnotationMarkStates } from '@atlaskit/adf-schema';
|
|
17
|
-
|
|
18
13
|
var markStyles = function markStyles(props) {
|
|
19
14
|
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: inherit;\n background-color: unset;\n -webkit-tap-highlight-color: transparent;\n\n &[data-mark-annotation-state='", "'] {\n ", ";\n\n &:focus,\n &[data-has-focus='true'] {\n ", ";\n }\n }\n"])), AnnotationMarkStates.ACTIVE, AnnotationSharedCSSByState({
|
|
20
15
|
theme: props
|
|
@@ -22,15 +17,14 @@ var markStyles = function markStyles(props) {
|
|
|
22
17
|
theme: props
|
|
23
18
|
}).focus);
|
|
24
19
|
};
|
|
25
|
-
|
|
26
20
|
export var MarkComponent = function MarkComponent(_ref) {
|
|
27
21
|
var annotationParentIds = _ref.annotationParentIds,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
22
|
+
children = _ref.children,
|
|
23
|
+
dataAttributes = _ref.dataAttributes,
|
|
24
|
+
id = _ref.id,
|
|
25
|
+
state = _ref.state,
|
|
26
|
+
hasFocus = _ref.hasFocus,
|
|
27
|
+
onClick = _ref.onClick;
|
|
34
28
|
var annotationIds = useMemo(function () {
|
|
35
29
|
return _toConsumableArray(new Set([].concat(_toConsumableArray(annotationParentIds), [id])));
|
|
36
30
|
}, [id, annotationParentIds]);
|
|
@@ -38,9 +32,9 @@ export var MarkComponent = function MarkComponent(_ref) {
|
|
|
38
32
|
// prevents multiple callback on overlapping annotations
|
|
39
33
|
if (event.defaultPrevented || state !== AnnotationMarkStates.ACTIVE) {
|
|
40
34
|
return;
|
|
41
|
-
}
|
|
42
|
-
|
|
35
|
+
}
|
|
43
36
|
|
|
37
|
+
// prevents from opening link URL inside webView in Safari
|
|
44
38
|
event.preventDefault();
|
|
45
39
|
onClick({
|
|
46
40
|
eventTarget: event.target,
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
-
|
|
4
3
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
|
-
|
|
6
4
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
|
-
|
|
8
5
|
import { useLayoutEffect, useState } from 'react';
|
|
9
6
|
import { AnnotationUpdateEvent } from '@atlaskit/editor-common/types';
|
|
10
7
|
import { AnnotationTypes } from '@atlaskit/adf-schema';
|
|
@@ -12,35 +9,29 @@ import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from '@atlaskit
|
|
|
12
9
|
import { FabricChannel } from '@atlaskit/analytics-listeners';
|
|
13
10
|
export var useAnnotationStateByTypeEvent = function useAnnotationStateByTypeEvent(_ref) {
|
|
14
11
|
var type = _ref.type,
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
updateSubscriber = _ref.updateSubscriber;
|
|
17
13
|
var _useState = useState({}),
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
15
|
+
states = _useState2[0],
|
|
16
|
+
setStates = _useState2[1];
|
|
22
17
|
useLayoutEffect(function () {
|
|
23
18
|
if (!updateSubscriber) {
|
|
24
19
|
return;
|
|
25
20
|
}
|
|
26
|
-
|
|
27
21
|
var cb = function cb(payload) {
|
|
28
22
|
if (!payload) {
|
|
29
23
|
return;
|
|
30
24
|
}
|
|
31
|
-
|
|
32
25
|
var nextStates = Object.values(payload).reduce(function (acc, curr) {
|
|
33
26
|
if (curr.id && curr.annotationType === type) {
|
|
34
27
|
// Check for empty state to prevent additional renders
|
|
35
28
|
var isEmpty = curr.state === null || curr.state === undefined;
|
|
36
29
|
return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, curr.id, !isEmpty ? curr.state : states[curr.id]));
|
|
37
30
|
}
|
|
38
|
-
|
|
39
31
|
return acc;
|
|
40
32
|
}, {});
|
|
41
33
|
setStates(_objectSpread(_objectSpread({}, states), nextStates));
|
|
42
34
|
};
|
|
43
|
-
|
|
44
35
|
updateSubscriber.on(AnnotationUpdateEvent.SET_ANNOTATION_STATE, cb);
|
|
45
36
|
return function () {
|
|
46
37
|
updateSubscriber.off(AnnotationUpdateEvent.SET_ANNOTATION_STATE, cb);
|
|
@@ -50,26 +41,21 @@ export var useAnnotationStateByTypeEvent = function useAnnotationStateByTypeEven
|
|
|
50
41
|
};
|
|
51
42
|
export var useHasFocusEvent = function useHasFocusEvent(_ref2) {
|
|
52
43
|
var id = _ref2.id,
|
|
53
|
-
|
|
54
|
-
|
|
44
|
+
updateSubscriber = _ref2.updateSubscriber;
|
|
55
45
|
var _useState3 = useState(false),
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
46
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
47
|
+
hasFocus = _useState4[0],
|
|
48
|
+
setHasFocus = _useState4[1];
|
|
60
49
|
useLayoutEffect(function () {
|
|
61
50
|
if (!updateSubscriber) {
|
|
62
51
|
return;
|
|
63
52
|
}
|
|
64
|
-
|
|
65
53
|
var cb = function cb(payload) {
|
|
66
54
|
setHasFocus(payload && payload.annotationId === id);
|
|
67
55
|
};
|
|
68
|
-
|
|
69
56
|
var removeFocus = function removeFocus() {
|
|
70
57
|
setHasFocus(false);
|
|
71
58
|
};
|
|
72
|
-
|
|
73
59
|
updateSubscriber.on(AnnotationUpdateEvent.SET_ANNOTATION_FOCUS, cb);
|
|
74
60
|
updateSubscriber.on(AnnotationUpdateEvent.REMOVE_ANNOTATION_FOCUS, removeFocus);
|
|
75
61
|
return function () {
|
|
@@ -81,20 +67,18 @@ export var useHasFocusEvent = function useHasFocusEvent(_ref2) {
|
|
|
81
67
|
};
|
|
82
68
|
export var useAnnotationClickEvent = function useAnnotationClickEvent(props) {
|
|
83
69
|
var _useState5 = useState(null),
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
70
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
71
|
+
annotationClickEvent = _useState6[0],
|
|
72
|
+
setAnnotationClickEvent = _useState6[1];
|
|
88
73
|
var updateSubscriber = props.updateSubscriber,
|
|
89
|
-
|
|
74
|
+
createAnalyticsEvent = props.createAnalyticsEvent;
|
|
90
75
|
useLayoutEffect(function () {
|
|
91
76
|
if (!updateSubscriber) {
|
|
92
77
|
return;
|
|
93
78
|
}
|
|
94
|
-
|
|
95
79
|
var cb = function cb(_ref3) {
|
|
96
80
|
var annotationIds = _ref3.annotationIds,
|
|
97
|
-
|
|
81
|
+
eventTarget = _ref3.eventTarget;
|
|
98
82
|
var annotationsByType = annotationIds.filter(function (id) {
|
|
99
83
|
return !!id;
|
|
100
84
|
}).map(function (id) {
|
|
@@ -103,7 +87,6 @@ export var useAnnotationClickEvent = function useAnnotationClickEvent(props) {
|
|
|
103
87
|
type: AnnotationTypes.INLINE_COMMENT
|
|
104
88
|
};
|
|
105
89
|
});
|
|
106
|
-
|
|
107
90
|
if (createAnalyticsEvent) {
|
|
108
91
|
createAnalyticsEvent({
|
|
109
92
|
action: ACTION.VIEWED,
|
|
@@ -115,13 +98,11 @@ export var useAnnotationClickEvent = function useAnnotationClickEvent(props) {
|
|
|
115
98
|
}
|
|
116
99
|
}).fire(FabricChannel.editor);
|
|
117
100
|
}
|
|
118
|
-
|
|
119
101
|
setAnnotationClickEvent({
|
|
120
102
|
annotations: annotationsByType,
|
|
121
103
|
clickElementTarget: eventTarget
|
|
122
104
|
});
|
|
123
105
|
};
|
|
124
|
-
|
|
125
106
|
updateSubscriber.on(AnnotationUpdateEvent.ON_ANNOTATION_CLICK, cb);
|
|
126
107
|
return function () {
|
|
127
108
|
updateSubscriber.off(AnnotationUpdateEvent.ON_ANNOTATION_CLICK, cb);
|
|
@@ -2,11 +2,9 @@ import { useContext } from 'react';
|
|
|
2
2
|
import { ProvidersContext } from '../context';
|
|
3
3
|
export var useInlineCommentSubscriberContext = function useInlineCommentSubscriberContext() {
|
|
4
4
|
var providers = useContext(ProvidersContext);
|
|
5
|
-
|
|
6
5
|
if (!providers) {
|
|
7
6
|
return null;
|
|
8
7
|
}
|
|
9
|
-
|
|
10
8
|
var updateSubscriber = providers.inlineComment.updateSubscriber;
|
|
11
9
|
return updateSubscriber || null;
|
|
12
10
|
};
|
|
@@ -3,14 +3,13 @@ import { useMemo, useContext } from 'react';
|
|
|
3
3
|
import { InlineCommentsStateContext } from '../context';
|
|
4
4
|
export var useInlineCommentsFilter = function useInlineCommentsFilter(_ref) {
|
|
5
5
|
var annotationIds = _ref.annotationIds,
|
|
6
|
-
|
|
6
|
+
stateFilter = _ref.filter.state;
|
|
7
7
|
var states = useContext(InlineCommentsStateContext);
|
|
8
8
|
return useMemo(function () {
|
|
9
9
|
return annotationIds.reduce(function (acc, id) {
|
|
10
10
|
if (states && states[id] === stateFilter) {
|
|
11
11
|
return [].concat(_toConsumableArray(acc), [id]);
|
|
12
12
|
}
|
|
13
|
-
|
|
14
13
|
return acc;
|
|
15
14
|
}, []);
|
|
16
15
|
}, [annotationIds, states, stateFilter]);
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
|
|
3
2
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
-
|
|
5
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
-
|
|
7
4
|
import { useContext, useEffect } from 'react';
|
|
8
5
|
import { AnnotationUpdateEvent } from '@atlaskit/editor-common/types';
|
|
9
6
|
import { ProvidersContext } from '../context';
|
|
@@ -16,31 +13,26 @@ export var useLoadAnnotations = function useLoadAnnotations(_ref) {
|
|
|
16
13
|
if (!providers) {
|
|
17
14
|
return;
|
|
18
15
|
}
|
|
19
|
-
|
|
20
16
|
var _providers$inlineComm = providers.inlineComment,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
var annotations = actions.getAnnotationMarks();
|
|
24
|
-
|
|
17
|
+
inlineCommentGetState = _providers$inlineComm.getState,
|
|
18
|
+
updateSubscriberInlineComment = _providers$inlineComm.updateSubscriber;
|
|
19
|
+
var annotations = actions.getAnnotationMarks();
|
|
20
|
+
// we don't want to request integrators for state with an empty list of ids.
|
|
25
21
|
if (!annotations.length) {
|
|
26
22
|
return;
|
|
27
23
|
}
|
|
28
|
-
|
|
29
24
|
var ids = annotations.map(function (mark) {
|
|
30
25
|
return mark.attrs.id;
|
|
31
26
|
});
|
|
32
|
-
|
|
33
27
|
var cb = function cb(data) {
|
|
34
28
|
if (!updateSubscriberInlineComment) {
|
|
35
29
|
return;
|
|
36
30
|
}
|
|
37
|
-
|
|
38
31
|
var payload = data.reduce(function (acc, value) {
|
|
39
32
|
return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, value.id, value));
|
|
40
33
|
}, {});
|
|
41
34
|
updateSubscriberInlineComment.emit(AnnotationUpdateEvent.SET_ANNOTATION_STATE, payload);
|
|
42
35
|
};
|
|
43
|
-
|
|
44
36
|
inlineCommentGetState(ids).then(cb);
|
|
45
37
|
}, [actions, providers, adfDocument]);
|
|
46
38
|
};
|
|
@@ -4,35 +4,27 @@ import { AnnotationsDraftContext } from '../context';
|
|
|
4
4
|
import { isRangeInsideOfRendererContainer } from './utils';
|
|
5
5
|
export var useUserSelectionRange = function useUserSelectionRange(props) {
|
|
6
6
|
var rendererRef = props.rendererRef;
|
|
7
|
-
|
|
8
7
|
var _useState = useState(null),
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
9
|
+
range = _useState2[0],
|
|
10
|
+
setRange = _useState2[1];
|
|
13
11
|
var annotationDraftPosition = useContext(AnnotationsDraftContext);
|
|
14
12
|
var hasAnnotationDraft = !!annotationDraftPosition;
|
|
15
13
|
useEffect(function () {
|
|
16
14
|
var rendererDOM = rendererRef.current;
|
|
17
|
-
|
|
18
15
|
if (!document || !rendererDOM) {
|
|
19
16
|
return;
|
|
20
17
|
}
|
|
21
|
-
|
|
22
18
|
var onSelectionChange = function onSelectionChange(event) {
|
|
23
19
|
var sel = document.getSelection();
|
|
24
|
-
|
|
25
20
|
if (!sel || sel.type !== 'Range' || sel.rangeCount !== 1 || hasAnnotationDraft) {
|
|
26
21
|
return;
|
|
27
22
|
}
|
|
28
|
-
|
|
29
23
|
var _range = sel.getRangeAt(0);
|
|
30
|
-
|
|
31
24
|
if (isRangeInsideOfRendererContainer(rendererDOM, _range)) {
|
|
32
25
|
setRange(_range.cloneRange());
|
|
33
26
|
}
|
|
34
27
|
};
|
|
35
|
-
|
|
36
28
|
document.addEventListener('selectionchange', onSelectionChange);
|
|
37
29
|
return function () {
|
|
38
30
|
document.removeEventListener('selectionchange', onSelectionChange);
|
|
@@ -15,18 +15,16 @@ var LoadAnnotations = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
15
15
|
});
|
|
16
16
|
export var AnnotationsWrapper = function AnnotationsWrapper(props) {
|
|
17
17
|
var children = props.children,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
annotationProvider = props.annotationProvider,
|
|
19
|
+
rendererRef = props.rendererRef,
|
|
20
|
+
adfDocument = props.adfDocument;
|
|
21
21
|
var updateSubscriber = annotationProvider && annotationProvider.inlineComment && annotationProvider.inlineComment.updateSubscriber;
|
|
22
22
|
var inlineCommentAnnotationsState = useAnnotationStateByTypeEvent({
|
|
23
23
|
type: AnnotationTypes.INLINE_COMMENT,
|
|
24
24
|
updateSubscriber: updateSubscriber || null
|
|
25
25
|
});
|
|
26
|
-
|
|
27
26
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
30
28
|
return /*#__PURE__*/React.createElement(ProvidersContext.Provider, {
|
|
31
29
|
value: annotationProvider
|
|
32
30
|
}, /*#__PURE__*/React.createElement(InlineCommentsStateContext.Provider, {
|
|
@@ -7,33 +7,29 @@ import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from '@atlaskit
|
|
|
7
7
|
import { RendererContext as ActionsContext } from '../../RendererActionsContext';
|
|
8
8
|
export var SelectionInlineCommentMounter = /*#__PURE__*/React.memo(function (props) {
|
|
9
9
|
var Component = props.component,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
10
|
+
range = props.range,
|
|
11
|
+
isAnnotationAllowed = props.isAnnotationAllowed,
|
|
12
|
+
wrapperDOM = props.wrapperDOM,
|
|
13
|
+
onCloseProps = props.onClose,
|
|
14
|
+
clearAnnotationDraft = props.clearAnnotationDraft,
|
|
15
|
+
applyAnnotationDraftAt = props.applyAnnotationDraftAt,
|
|
16
|
+
documentPosition = props.documentPosition,
|
|
17
|
+
applyAnnotation = props.applyAnnotation,
|
|
18
|
+
createAnalyticsEvent = props.createAnalyticsEvent,
|
|
19
|
+
generateIndexMatch = props.generateIndexMatch;
|
|
21
20
|
var _useState = useState(),
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
22
|
+
draftDocumentPosition = _useState2[0],
|
|
23
|
+
setDraftDocumentPosition = _useState2[1];
|
|
26
24
|
var actions = useContext(ActionsContext);
|
|
27
25
|
var onCreateCallback = useCallback(function (annotationId) {
|
|
28
26
|
if (!isAnnotationAllowed || !documentPosition || !applyAnnotation) {
|
|
29
27
|
return false;
|
|
30
28
|
}
|
|
31
|
-
|
|
32
29
|
var annotation = {
|
|
33
30
|
annotationId: annotationId,
|
|
34
31
|
annotationType: AnnotationTypes.INLINE_COMMENT
|
|
35
32
|
};
|
|
36
|
-
|
|
37
33
|
if (createAnalyticsEvent) {
|
|
38
34
|
createAnalyticsEvent({
|
|
39
35
|
action: ACTION.INSERTED,
|
|
@@ -43,25 +39,20 @@ export var SelectionInlineCommentMounter = /*#__PURE__*/React.memo(function (pro
|
|
|
43
39
|
eventType: EVENT_TYPE.TRACK
|
|
44
40
|
}).fire(FabricChannel.editor);
|
|
45
41
|
}
|
|
46
|
-
|
|
47
42
|
return applyAnnotation(draftDocumentPosition || documentPosition, annotation);
|
|
48
43
|
}, [isAnnotationAllowed, documentPosition, applyAnnotation, draftDocumentPosition, createAnalyticsEvent]);
|
|
49
44
|
var createIndexCallback = useCallback(function () {
|
|
50
45
|
if (!documentPosition || !generateIndexMatch) {
|
|
51
46
|
return false;
|
|
52
47
|
}
|
|
53
|
-
|
|
54
48
|
var result = generateIndexMatch(documentPosition);
|
|
55
|
-
|
|
56
49
|
if (!result) {
|
|
57
50
|
return false;
|
|
58
51
|
}
|
|
59
|
-
|
|
60
52
|
return result;
|
|
61
53
|
}, [documentPosition, generateIndexMatch]);
|
|
62
54
|
var applyDraftModeCallback = useCallback(function () {
|
|
63
55
|
var keepNativeSelection = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
64
|
-
|
|
65
56
|
if (!documentPosition || !isAnnotationAllowed) {
|
|
66
57
|
if (createAnalyticsEvent) {
|
|
67
58
|
createAnalyticsEvent({
|
|
@@ -72,13 +63,10 @@ export var SelectionInlineCommentMounter = /*#__PURE__*/React.memo(function (pro
|
|
|
72
63
|
eventType: EVENT_TYPE.TRACK
|
|
73
64
|
}).fire(FabricChannel.editor);
|
|
74
65
|
}
|
|
75
|
-
|
|
76
66
|
return;
|
|
77
67
|
}
|
|
78
|
-
|
|
79
68
|
setDraftDocumentPosition(documentPosition);
|
|
80
69
|
applyAnnotationDraftAt(documentPosition);
|
|
81
|
-
|
|
82
70
|
if (createAnalyticsEvent) {
|
|
83
71
|
var uniqueAnnotationsInRange = actions.getAnnotationsByPosition(range);
|
|
84
72
|
createAnalyticsEvent({
|
|
@@ -91,13 +79,11 @@ export var SelectionInlineCommentMounter = /*#__PURE__*/React.memo(function (pro
|
|
|
91
79
|
}
|
|
92
80
|
}).fire(FabricChannel.editor);
|
|
93
81
|
}
|
|
94
|
-
|
|
95
82
|
window.requestAnimationFrame(function () {
|
|
96
83
|
if (keepNativeSelection) {
|
|
97
84
|
updateWindowSelectionAroundDraft(documentPosition);
|
|
98
85
|
} else {
|
|
99
86
|
var sel = window.getSelection();
|
|
100
|
-
|
|
101
87
|
if (sel) {
|
|
102
88
|
sel.removeAllRanges();
|
|
103
89
|
}
|
|
@@ -108,7 +94,6 @@ export var SelectionInlineCommentMounter = /*#__PURE__*/React.memo(function (pro
|
|
|
108
94
|
clearAnnotationDraft();
|
|
109
95
|
setDraftDocumentPosition(null);
|
|
110
96
|
var sel = window.getSelection();
|
|
111
|
-
|
|
112
97
|
if (sel) {
|
|
113
98
|
sel.removeAllRanges();
|
|
114
99
|
}
|
|
@@ -123,7 +108,6 @@ export var SelectionInlineCommentMounter = /*#__PURE__*/React.memo(function (pro
|
|
|
123
108
|
attributes: {}
|
|
124
109
|
}).fire(FabricChannel.editor);
|
|
125
110
|
}
|
|
126
|
-
|
|
127
111
|
removeDraftModeCallback();
|
|
128
112
|
onCloseProps();
|
|
129
113
|
}, [onCloseProps, removeDraftModeCallback, createAnalyticsEvent]);
|
|
@@ -5,23 +5,20 @@ import { SelectionInlineCommentMounter } from './mounter';
|
|
|
5
5
|
import { RendererContext as ActionsContext } from '../../RendererActionsContext';
|
|
6
6
|
export var SelectionRangeValidator = function SelectionRangeValidator(props) {
|
|
7
7
|
var selectionComponent = props.selectionComponent,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
rendererRef = props.rendererRef,
|
|
9
|
+
applyAnnotationDraftAt = props.applyAnnotationDraftAt,
|
|
10
|
+
clearAnnotationDraft = props.clearAnnotationDraft,
|
|
11
|
+
createAnalyticsEvent = props.createAnalyticsEvent;
|
|
12
12
|
var actions = useContext(ActionsContext);
|
|
13
|
-
|
|
14
13
|
var _useUserSelectionRang = useUserSelectionRange({
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
rendererRef: rendererRef
|
|
15
|
+
}),
|
|
16
|
+
_useUserSelectionRang2 = _slicedToArray(_useUserSelectionRang, 2),
|
|
17
|
+
range = _useUserSelectionRang2[0],
|
|
18
|
+
clearRange = _useUserSelectionRang2[1];
|
|
21
19
|
if (!range) {
|
|
22
20
|
return null;
|
|
23
21
|
}
|
|
24
|
-
|
|
25
22
|
var documentPosition = actions.getPositionFromRange(range);
|
|
26
23
|
var isAnnotationAllowed = documentPosition && actions.isValidAnnotationPosition(documentPosition);
|
|
27
24
|
return /*#__PURE__*/React.createElement(SelectionInlineCommentMounter, {
|
|
@@ -4,13 +4,13 @@ import { SelectionRangeValidator } from './range-validator';
|
|
|
4
4
|
export var Wrapper = function Wrapper(props) {
|
|
5
5
|
var providers = useContext(ProvidersContext);
|
|
6
6
|
var rendererRef = props.rendererRef,
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
createAnalyticsEvent = props.createAnalyticsEvent,
|
|
8
|
+
children = props.children;
|
|
9
9
|
var inlineCommentProvider = providers && providers.inlineComment;
|
|
10
10
|
var selectionComponent = inlineCommentProvider && inlineCommentProvider.selectionComponent;
|
|
11
11
|
var render = useCallback(function (_ref) {
|
|
12
12
|
var applyAnnotationDraftAt = _ref.applyAnnotationDraftAt,
|
|
13
|
-
|
|
13
|
+
clearAnnotationDraft = _ref.clearAnnotationDraft;
|
|
14
14
|
return /*#__PURE__*/React.createElement(React.Fragment, null, children, /*#__PURE__*/React.createElement(SelectionRangeValidator, {
|
|
15
15
|
createAnalyticsEvent: createAnalyticsEvent,
|
|
16
16
|
rendererRef: rendererRef,
|
|
@@ -19,10 +19,8 @@ export var Wrapper = function Wrapper(props) {
|
|
|
19
19
|
clearAnnotationDraft: clearAnnotationDraft
|
|
20
20
|
}));
|
|
21
21
|
}, [selectionComponent, children, rendererRef, createAnalyticsEvent]);
|
|
22
|
-
|
|
23
22
|
if (!selectionComponent) {
|
|
24
23
|
return /*#__PURE__*/React.createElement(React.Fragment, null, children);
|
|
25
24
|
}
|
|
26
|
-
|
|
27
25
|
return /*#__PURE__*/React.createElement(AnnotationsDraftContextWrapper, null, render);
|
|
28
26
|
};
|
|
@@ -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
|
var AnnotationView = function AnnotationView(props) {
|
|
7
6
|
var providers = useContext(ProvidersContext);
|
|
8
7
|
var actionContext = useContext(RendererContext);
|
|
@@ -18,18 +17,15 @@ var AnnotationView = function AnnotationView(props) {
|
|
|
18
17
|
return actionContext.deleteAnnotation(annotationInfo.id, annotationInfo.type);
|
|
19
18
|
};
|
|
20
19
|
}, [actionContext]);
|
|
21
|
-
|
|
22
20
|
if (ViewComponent && viewComponentProps) {
|
|
23
21
|
var annotations = viewComponentProps.annotations,
|
|
24
|
-
|
|
22
|
+
clickElementTarget = viewComponentProps.clickElementTarget;
|
|
25
23
|
return /*#__PURE__*/React.createElement(ViewComponent, {
|
|
26
24
|
annotations: annotations,
|
|
27
25
|
clickElementTarget: clickElementTarget,
|
|
28
26
|
deleteAnnotation: deleteAnnotation
|
|
29
27
|
});
|
|
30
28
|
}
|
|
31
|
-
|
|
32
29
|
return null;
|
|
33
30
|
};
|
|
34
|
-
|
|
35
31
|
export { AnnotationView };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { useRendererContext } from './renderer-context';
|
|
2
2
|
export var useFeatureFlags = function useFeatureFlags() {
|
|
3
3
|
var _useRendererContext;
|
|
4
|
-
|
|
5
4
|
return (_useRendererContext = useRendererContext()) === null || _useRendererContext === void 0 ? void 0 : _useRendererContext.featureFlags;
|
|
6
5
|
};
|
package/dist/esm/utils.js
CHANGED
|
@@ -2,16 +2,13 @@ import _createClass from "@babel/runtime/helpers/createClass";
|
|
|
2
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
3
|
import { defaultSchema } from '@atlaskit/adf-schema/schema-default';
|
|
4
4
|
import { JSONTransformer } from '@atlaskit/editor-json-transformer';
|
|
5
|
-
|
|
6
5
|
function createEncoder(parser, encoder) {
|
|
7
6
|
return function (value) {
|
|
8
7
|
return encoder.encode(parser.parse(value));
|
|
9
8
|
};
|
|
10
9
|
}
|
|
11
|
-
|
|
12
10
|
export var ADFEncoder = /*#__PURE__*/_createClass(function ADFEncoder(createTransformerWithSchema) {
|
|
13
11
|
_classCallCheck(this, ADFEncoder);
|
|
14
|
-
|
|
15
12
|
var transformer = createTransformerWithSchema(defaultSchema);
|
|
16
13
|
this.encode = createEncoder(transformer, new JSONTransformer());
|
|
17
14
|
});
|
|
@@ -26,9 +23,9 @@ export var getPlatform = function getPlatform(rendererAppearance) {
|
|
|
26
23
|
if (rendererAppearance === 'mobile') {
|
|
27
24
|
return 'mobile';
|
|
28
25
|
}
|
|
29
|
-
|
|
30
26
|
return 'web';
|
|
31
27
|
};
|
|
28
|
+
|
|
32
29
|
/**
|
|
33
30
|
* Traverse through parent elements of element. Return element for which evaluate(element) returns
|
|
34
31
|
* true. If topElement is reached before evaluate returns true, return false. Does not run evaluate
|
|
@@ -38,19 +35,15 @@ export var getPlatform = function getPlatform(rendererAppearance) {
|
|
|
38
35
|
* @param evaluate Function which returns true or false based on the given element. eg: Checks if
|
|
39
36
|
* element has desired classname.
|
|
40
37
|
*/
|
|
41
|
-
|
|
42
38
|
export function findInTree(element, topElement, evaluate) {
|
|
43
39
|
if (element === topElement) {
|
|
44
40
|
return false;
|
|
45
41
|
}
|
|
46
|
-
|
|
47
42
|
if (evaluate(element)) {
|
|
48
43
|
return true;
|
|
49
44
|
}
|
|
50
|
-
|
|
51
45
|
if (!element.parentElement) {
|
|
52
46
|
return false;
|
|
53
47
|
}
|
|
54
|
-
|
|
55
48
|
return findInTree(element.parentElement, topElement, evaluate);
|
|
56
49
|
}
|
package/dist/esm/version.json
CHANGED