@atlaskit/renderer 105.1.1 → 105.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/cjs/actions/index.js +19 -71
- package/dist/cjs/actions/matches-utils.js +10 -11
- package/dist/cjs/actions.js +0 -2
- package/dist/cjs/analytics/analyticsContext.js +0 -4
- package/dist/cjs/analytics/events.js +0 -5
- package/dist/cjs/analytics/unsupported-content.js +14 -27
- package/dist/cjs/i18n/cs.js +0 -1
- package/dist/cjs/i18n/da.js +0 -1
- package/dist/cjs/i18n/de.js +0 -1
- package/dist/cjs/i18n/en.js +0 -1
- package/dist/cjs/i18n/en_GB.js +0 -1
- package/dist/cjs/i18n/en_ZZ.js +0 -1
- package/dist/cjs/i18n/es.js +0 -1
- package/dist/cjs/i18n/et.js +0 -1
- package/dist/cjs/i18n/fi.js +0 -1
- package/dist/cjs/i18n/fr.js +0 -1
- package/dist/cjs/i18n/hu.js +0 -1
- package/dist/cjs/i18n/index.js +0 -26
- package/dist/cjs/i18n/it.js +0 -1
- package/dist/cjs/i18n/ja.js +0 -1
- package/dist/cjs/i18n/ko.js +0 -1
- package/dist/cjs/i18n/nb.js +0 -1
- package/dist/cjs/i18n/nl.js +0 -1
- package/dist/cjs/i18n/pl.js +0 -1
- package/dist/cjs/i18n/pt_BR.js +0 -1
- package/dist/cjs/i18n/pt_PT.js +0 -1
- package/dist/cjs/i18n/ru.js +0 -1
- package/dist/cjs/i18n/sk.js +0 -1
- package/dist/cjs/i18n/sv.js +0 -1
- package/dist/cjs/i18n/th.js +0 -1
- package/dist/cjs/i18n/tr.js +0 -1
- package/dist/cjs/i18n/uk.js +0 -1
- package/dist/cjs/i18n/vi.js +0 -1
- package/dist/cjs/i18n/zh.js +0 -1
- package/dist/cjs/i18n/zh_TW.js +0 -1
- package/dist/cjs/index.js +0 -6
- package/dist/cjs/messages.js +0 -2
- package/dist/cjs/react/hooks/use-bidi-warnings.js +2 -12
- package/dist/cjs/react/hooks/use-in-viewport.js +4 -17
- package/dist/cjs/react/hooks/use-observed-width.js +20 -35
- package/dist/cjs/react/index.js +27 -114
- package/dist/cjs/react/marks/alignment.js +0 -9
- package/dist/cjs/react/marks/annotation.js +6 -21
- package/dist/cjs/react/marks/breakout.js +0 -9
- package/dist/cjs/react/marks/code.js +0 -11
- package/dist/cjs/react/marks/confluence-inline-comment.js +2 -19
- package/dist/cjs/react/marks/data-consumer.js +0 -4
- package/dist/cjs/react/marks/em.js +0 -3
- package/dist/cjs/react/marks/fragment.js +0 -4
- package/dist/cjs/react/marks/indentation.js +0 -3
- package/dist/cjs/react/marks/index.js +1 -24
- package/dist/cjs/react/marks/link.js +5 -25
- package/dist/cjs/react/marks/strike.js +0 -4
- package/dist/cjs/react/marks/strong.js +0 -3
- package/dist/cjs/react/marks/subsup.js +0 -5
- package/dist/cjs/react/marks/textColor.js +0 -9
- package/dist/cjs/react/marks/underline.js +0 -3
- package/dist/cjs/react/marks/unsupportedMark.js +0 -3
- package/dist/cjs/react/marks/unsupportedNodeAttribute.js +0 -3
- package/dist/cjs/react/nodes/blockCard.js +4 -16
- package/dist/cjs/react/nodes/blockquote.js +0 -3
- package/dist/cjs/react/nodes/bodiedExtension.js +6 -17
- package/dist/cjs/react/nodes/bulletList.js +0 -5
- package/dist/cjs/react/nodes/caption.js +1 -6
- package/dist/cjs/react/nodes/codeBlock/codeBlock.js +5 -14
- package/dist/cjs/react/nodes/codeBlock/components/codeBlockContainer.js +3 -16
- package/dist/cjs/react/nodes/codeBlock/components/lightWeightCodeBlock.js +6 -23
- package/dist/cjs/react/nodes/codeBlock/windowedCodeBlock.js +9 -32
- package/dist/cjs/react/nodes/codeBlockCopyButton.js +7 -31
- package/dist/cjs/react/nodes/date.js +5 -33
- package/dist/cjs/react/nodes/decisionItem.js +1 -5
- package/dist/cjs/react/nodes/decisionList.js +0 -20
- package/dist/cjs/react/nodes/doc.js +0 -6
- package/dist/cjs/react/nodes/embedCard.js +25 -54
- package/dist/cjs/react/nodes/emoji.js +6 -24
- package/dist/cjs/react/nodes/extension.js +12 -26
- package/dist/cjs/react/nodes/fallback.js +2 -24
- package/dist/cjs/react/nodes/hardBreak.js +1 -7
- package/dist/cjs/react/nodes/heading-anchor.js +1 -46
- package/dist/cjs/react/nodes/heading.js +4 -17
- package/dist/cjs/react/nodes/index.js +7 -62
- package/dist/cjs/react/nodes/inline.js +0 -6
- package/dist/cjs/react/nodes/inlineCard.js +6 -23
- package/dist/cjs/react/nodes/inlineExtension.js +2 -10
- package/dist/cjs/react/nodes/layoutColumn.js +0 -8
- package/dist/cjs/react/nodes/layoutSection.js +0 -3
- package/dist/cjs/react/nodes/listItem.js +0 -3
- package/dist/cjs/react/nodes/media.js +10 -49
- package/dist/cjs/react/nodes/mediaGroup.js +6 -47
- package/dist/cjs/react/nodes/mediaInline.js +7 -37
- package/dist/cjs/react/nodes/mediaSingle/index.js +38 -85
- package/dist/cjs/react/nodes/mediaSingle/styles.js +0 -5
- package/dist/cjs/react/nodes/mention.js +5 -23
- package/dist/cjs/react/nodes/orderedList.js +0 -14
- package/dist/cjs/react/nodes/panel.js +10 -38
- package/dist/cjs/react/nodes/paragraph.js +1 -5
- package/dist/cjs/react/nodes/placeholder.js +0 -4
- package/dist/cjs/react/nodes/rule.js +0 -3
- package/dist/cjs/react/nodes/status.js +3 -22
- package/dist/cjs/react/nodes/table/colgroup.js +12 -26
- package/dist/cjs/react/nodes/table/sticky.js +17 -47
- package/dist/cjs/react/nodes/table/table.js +5 -10
- package/dist/cjs/react/nodes/table.js +19 -102
- package/dist/cjs/react/nodes/tableCell.js +26 -79
- package/dist/cjs/react/nodes/tableRow.js +4 -33
- package/dist/cjs/react/nodes/task-item-with-providers.js +4 -40
- package/dist/cjs/react/nodes/taskItem.js +8 -36
- package/dist/cjs/react/nodes/taskList.js +2 -22
- package/dist/cjs/react/nodes/text-wrapper.js +1 -8
- package/dist/cjs/react/nodes/unknownBlock.js +0 -3
- package/dist/cjs/react/renderer-node.js +0 -6
- package/dist/cjs/react/utils/clipboard.js +0 -3
- package/dist/cjs/react/utils/element-selection.js +0 -13
- package/dist/cjs/react/utils/getCardClickHandler.js +0 -3
- package/dist/cjs/react/utils/inject-props.js +4 -9
- package/dist/cjs/react/utils/links.js +2 -6
- package/dist/cjs/react/utils/lists.js +0 -1
- package/dist/cjs/react/utils/performance/RenderTracking.js +2 -10
- package/dist/cjs/react/utils/use-select-all-trap.js +1 -23
- package/dist/cjs/render-document.js +42 -83
- package/dist/cjs/renderer-context.js +0 -5
- package/dist/cjs/steps/index.js +7 -39
- package/dist/cjs/text/index.js +0 -9
- package/dist/cjs/text/nodes/blockquote.js +0 -3
- package/dist/cjs/text/nodes/bulletList.js +0 -3
- package/dist/cjs/text/nodes/date.js +0 -4
- package/dist/cjs/text/nodes/decisionItem.js +0 -5
- package/dist/cjs/text/nodes/hardBreak.js +0 -2
- package/dist/cjs/text/nodes/heading.js +0 -3
- package/dist/cjs/text/nodes/index.js +0 -21
- package/dist/cjs/text/nodes/inlineCard.js +0 -4
- package/dist/cjs/text/nodes/listItem.js +0 -3
- package/dist/cjs/text/nodes/mediaGroup.js +0 -4
- package/dist/cjs/text/nodes/mention.js +0 -3
- package/dist/cjs/text/nodes/orderedList.js +0 -4
- package/dist/cjs/text/nodes/panel.js +0 -3
- package/dist/cjs/text/nodes/paragraph.js +0 -5
- package/dist/cjs/text/nodes/rule.js +0 -2
- package/dist/cjs/text/nodes/status.js +0 -3
- package/dist/cjs/text/nodes/table.js +0 -5
- package/dist/cjs/text/nodes/taskItem.js +0 -5
- package/dist/cjs/text/nodes/unknown.js +0 -6
- package/dist/cjs/text-serializer.js +0 -2
- package/dist/cjs/ui/Expand.js +15 -59
- package/dist/cjs/ui/ExtensionRenderer.js +10 -43
- package/dist/cjs/ui/MediaCard.js +40 -116
- package/dist/cjs/ui/Renderer/ErrorBoundary.js +0 -26
- package/dist/cjs/ui/Renderer/breakout-ssr.js +6 -32
- package/dist/cjs/ui/Renderer/click-to-edit.js +0 -6
- package/dist/cjs/ui/Renderer/index.js +47 -149
- package/dist/cjs/ui/Renderer/style.js +1 -39
- package/dist/cjs/ui/Renderer/truncated-wrapper.js +12 -30
- package/dist/cjs/ui/RendererActionsContext/WithRendererActions.js +0 -4
- package/dist/cjs/ui/RendererActionsContext/index.js +1 -11
- package/dist/cjs/ui/SmartCardStorage.js +0 -20
- package/dist/cjs/ui/SortingIcon.js +10 -40
- package/dist/cjs/ui/TaskItemsFormatContext/TaskItemsFormatContext.js +0 -11
- package/dist/cjs/ui/TaskItemsFormatContext/index.js +0 -1
- package/dist/cjs/ui/active-header-id-provider.js +6 -19
- package/dist/cjs/ui/annotations/context.js +0 -24
- package/dist/cjs/ui/annotations/draft/component.js +5 -42
- package/dist/cjs/ui/annotations/draft/dom.js +3 -17
- package/dist/cjs/ui/annotations/draft/index.js +0 -2
- package/dist/cjs/ui/annotations/draft/position.js +1 -12
- package/dist/cjs/ui/annotations/draft/text.js +2 -8
- package/dist/cjs/ui/annotations/element/index.js +4 -16
- package/dist/cjs/ui/annotations/element/mark.js +8 -26
- package/dist/cjs/ui/annotations/hooks/index.js +0 -3
- package/dist/cjs/ui/annotations/hooks/use-events.js +13 -45
- package/dist/cjs/ui/annotations/hooks/use-inline-comment-subscriber.js +0 -6
- package/dist/cjs/ui/annotations/hooks/use-inline-comments-filter.js +1 -8
- package/dist/cjs/ui/annotations/hooks/use-load-annotations.js +4 -19
- package/dist/cjs/ui/annotations/hooks/user-selection.js +3 -18
- package/dist/cjs/ui/annotations/hooks/utils.js +0 -2
- package/dist/cjs/ui/annotations/index.js +4 -20
- package/dist/cjs/ui/annotations/selection/index.js +0 -1
- package/dist/cjs/ui/annotations/selection/mounter.js +13 -42
- package/dist/cjs/ui/annotations/selection/range-validator.js +9 -23
- package/dist/cjs/ui/annotations/selection/wrapper.js +3 -13
- package/dist/cjs/ui/annotations/types.js +0 -1
- package/dist/cjs/ui/annotations/view/index.js +1 -12
- package/dist/cjs/ui/index.js +0 -2
- package/dist/cjs/use-feature-flags.js +0 -4
- package/dist/cjs/utils.js +1 -19
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/actions/index.js +6 -50
- package/dist/es2019/actions/matches-utils.js +10 -9
- package/dist/es2019/actions.js +2 -1
- package/dist/es2019/analytics/events.js +0 -5
- package/dist/es2019/analytics/unsupported-content.js +8 -14
- package/dist/es2019/react/hooks/use-bidi-warnings.js +0 -2
- package/dist/es2019/react/hooks/use-in-viewport.js +0 -1
- package/dist/es2019/react/hooks/use-observed-width.js +0 -2
- package/dist/es2019/react/index.js +44 -119
- package/dist/es2019/react/marks/alignment.js +0 -3
- package/dist/es2019/react/marks/annotation.js +2 -5
- package/dist/es2019/react/marks/confluence-inline-comment.js +0 -1
- package/dist/es2019/react/marks/index.js +2 -1
- package/dist/es2019/react/marks/link.js +0 -6
- package/dist/es2019/react/marks/subsup.js +0 -3
- package/dist/es2019/react/nodes/bodiedExtension.js +2 -5
- package/dist/es2019/react/nodes/caption.js +0 -2
- package/dist/es2019/react/nodes/codeBlock/codeBlock.js +0 -2
- package/dist/es2019/react/nodes/codeBlock/components/codeBlockContainer.js +1 -3
- package/dist/es2019/react/nodes/codeBlock/windowedCodeBlock.js +1 -6
- package/dist/es2019/react/nodes/codeBlockCopyButton.js +0 -4
- package/dist/es2019/react/nodes/date.js +0 -7
- package/dist/es2019/react/nodes/decisionList.js +0 -3
- package/dist/es2019/react/nodes/embedCard.js +8 -16
- package/dist/es2019/react/nodes/emoji.js +0 -1
- package/dist/es2019/react/nodes/extension.js +4 -6
- package/dist/es2019/react/nodes/fallback.js +0 -8
- package/dist/es2019/react/nodes/hardBreak.js +0 -3
- package/dist/es2019/react/nodes/heading-anchor.js +0 -15
- package/dist/es2019/react/nodes/heading.js +0 -6
- package/dist/es2019/react/nodes/index.js +28 -61
- package/dist/es2019/react/nodes/inline.js +0 -2
- package/dist/es2019/react/nodes/inlineCard.js +0 -5
- package/dist/es2019/react/nodes/inlineExtension.js +2 -5
- package/dist/es2019/react/nodes/media.js +0 -10
- package/dist/es2019/react/nodes/mediaGroup.js +2 -22
- package/dist/es2019/react/nodes/mediaInline.js +1 -8
- package/dist/es2019/react/nodes/mediaSingle/index.js +8 -29
- package/dist/es2019/react/nodes/mention.js +0 -1
- package/dist/es2019/react/nodes/orderedList.js +0 -5
- package/dist/es2019/react/nodes/panel.js +4 -17
- package/dist/es2019/react/nodes/placeholder.js +0 -1
- package/dist/es2019/react/nodes/status.js +0 -1
- package/dist/es2019/react/nodes/table/colgroup.js +9 -18
- package/dist/es2019/react/nodes/table/sticky.js +3 -16
- package/dist/es2019/react/nodes/table.js +9 -75
- package/dist/es2019/react/nodes/tableCell.js +4 -31
- package/dist/es2019/react/nodes/tableRow.js +0 -10
- package/dist/es2019/react/nodes/task-item-with-providers.js +0 -6
- package/dist/es2019/react/nodes/taskItem.js +0 -7
- package/dist/es2019/react/nodes/taskList.js +0 -3
- package/dist/es2019/react/nodes/text-wrapper.js +0 -4
- package/dist/es2019/react/utils/clipboard.js +0 -1
- package/dist/es2019/react/utils/element-selection.js +0 -12
- package/dist/es2019/react/utils/inject-props.js +5 -7
- package/dist/es2019/react/utils/links.js +2 -4
- package/dist/es2019/react/utils/performance/RenderTracking.js +0 -1
- package/dist/es2019/react/utils/use-select-all-trap.js +0 -7
- package/dist/es2019/render-document.js +16 -33
- package/dist/es2019/steps/index.js +4 -33
- package/dist/es2019/text/index.js +0 -3
- package/dist/es2019/text/nodes/blockquote.js +0 -2
- package/dist/es2019/text/nodes/bulletList.js +0 -2
- package/dist/es2019/text/nodes/date.js +0 -2
- package/dist/es2019/text/nodes/decisionItem.js +0 -4
- package/dist/es2019/text/nodes/hardBreak.js +0 -1
- package/dist/es2019/text/nodes/heading.js +0 -2
- package/dist/es2019/text/nodes/inlineCard.js +0 -3
- package/dist/es2019/text/nodes/listItem.js +0 -2
- package/dist/es2019/text/nodes/mediaGroup.js +0 -3
- package/dist/es2019/text/nodes/mention.js +0 -2
- package/dist/es2019/text/nodes/orderedList.js +0 -2
- package/dist/es2019/text/nodes/panel.js +0 -2
- package/dist/es2019/text/nodes/paragraph.js +0 -4
- package/dist/es2019/text/nodes/rule.js +0 -1
- package/dist/es2019/text/nodes/status.js +0 -2
- package/dist/es2019/text/nodes/table.js +0 -4
- package/dist/es2019/text/nodes/taskItem.js +0 -4
- package/dist/es2019/text/nodes/unknown.js +0 -4
- package/dist/es2019/ui/Expand.js +2 -17
- package/dist/es2019/ui/ExtensionRenderer.js +0 -19
- package/dist/es2019/ui/MediaCard.js +9 -40
- package/dist/es2019/ui/Renderer/ErrorBoundary.js +0 -10
- package/dist/es2019/ui/Renderer/breakout-ssr.js +6 -26
- package/dist/es2019/ui/Renderer/click-to-edit.js +1 -4
- package/dist/es2019/ui/Renderer/index.js +17 -66
- package/dist/es2019/ui/Renderer/style.js +0 -14
- package/dist/es2019/ui/Renderer/truncated-wrapper.js +2 -6
- package/dist/es2019/ui/SmartCardStorage.js +0 -1
- package/dist/es2019/ui/SortingIcon.js +3 -20
- package/dist/es2019/ui/TaskItemsFormatContext/TaskItemsFormatContext.js +0 -2
- package/dist/es2019/ui/active-header-id-provider.js +0 -3
- package/dist/es2019/ui/annotations/context.js +0 -6
- package/dist/es2019/ui/annotations/draft/component.js +0 -13
- package/dist/es2019/ui/annotations/draft/dom.js +0 -6
- package/dist/es2019/ui/annotations/draft/position.js +0 -8
- package/dist/es2019/ui/annotations/draft/text.js +0 -1
- package/dist/es2019/ui/annotations/element/index.js +0 -3
- package/dist/es2019/ui/annotations/element/mark.js +4 -6
- package/dist/es2019/ui/annotations/hooks/use-events.js +4 -13
- package/dist/es2019/ui/annotations/hooks/use-inline-comment-subscriber.js +0 -2
- package/dist/es2019/ui/annotations/hooks/use-inline-comments-filter.js +0 -1
- package/dist/es2019/ui/annotations/hooks/use-load-annotations.js +4 -8
- package/dist/es2019/ui/annotations/hooks/user-selection.js +0 -6
- package/dist/es2019/ui/annotations/selection/mounter.js +0 -13
- package/dist/es2019/ui/annotations/selection/range-validator.js +0 -2
- package/dist/es2019/ui/annotations/selection/wrapper.js +0 -2
- package/dist/es2019/ui/annotations/types.js +0 -1
- package/dist/es2019/ui/annotations/view/index.js +0 -4
- package/dist/es2019/use-feature-flags.js +0 -1
- package/dist/es2019/utils.js +1 -8
- package/dist/es2019/version.json +1 -1
- package/dist/esm/actions/index.js +19 -63
- package/dist/esm/actions/matches-utils.js +10 -9
- package/dist/esm/actions.js +2 -1
- package/dist/esm/analytics/events.js +0 -5
- package/dist/esm/analytics/unsupported-content.js +14 -21
- package/dist/esm/react/hooks/use-bidi-warnings.js +2 -4
- package/dist/esm/react/hooks/use-in-viewport.js +4 -13
- package/dist/esm/react/hooks/use-observed-width.js +20 -29
- package/dist/esm/react/index.js +27 -111
- package/dist/esm/react/marks/alignment.js +0 -4
- package/dist/esm/react/marks/annotation.js +6 -14
- package/dist/esm/react/marks/breakout.js +0 -2
- package/dist/esm/react/marks/confluence-inline-comment.js +2 -12
- package/dist/esm/react/marks/index.js +2 -1
- package/dist/esm/react/marks/link.js +5 -12
- package/dist/esm/react/marks/subsup.js +0 -3
- package/dist/esm/react/nodes/blockCard.js +4 -4
- package/dist/esm/react/nodes/bodiedExtension.js +6 -10
- package/dist/esm/react/nodes/caption.js +1 -3
- package/dist/esm/react/nodes/codeBlock/codeBlock.js +4 -6
- package/dist/esm/react/nodes/codeBlock/components/codeBlockContainer.js +4 -8
- package/dist/esm/react/nodes/codeBlock/components/lightWeightCodeBlock.js +6 -10
- package/dist/esm/react/nodes/codeBlock/windowedCodeBlock.js +10 -21
- package/dist/esm/react/nodes/codeBlockCopyButton.js +7 -15
- package/dist/esm/react/nodes/date.js +5 -20
- package/dist/esm/react/nodes/decisionItem.js +1 -1
- package/dist/esm/react/nodes/decisionList.js +0 -12
- package/dist/esm/react/nodes/embedCard.js +25 -39
- package/dist/esm/react/nodes/emoji.js +6 -16
- package/dist/esm/react/nodes/extension.js +12 -16
- package/dist/esm/react/nodes/fallback.js +2 -18
- package/dist/esm/react/nodes/hardBreak.js +1 -5
- package/dist/esm/react/nodes/heading-anchor.js +1 -32
- package/dist/esm/react/nodes/heading.js +4 -10
- package/dist/esm/react/nodes/index.js +26 -64
- package/dist/esm/react/nodes/inline.js +0 -2
- package/dist/esm/react/nodes/inlineCard.js +6 -12
- package/dist/esm/react/nodes/inlineExtension.js +2 -6
- package/dist/esm/react/nodes/layoutColumn.js +0 -2
- package/dist/esm/react/nodes/media.js +10 -34
- package/dist/esm/react/nodes/mediaGroup.js +6 -37
- package/dist/esm/react/nodes/mediaInline.js +7 -20
- package/dist/esm/react/nodes/mediaSingle/index.js +37 -66
- package/dist/esm/react/nodes/mediaSingle/styles.js +0 -2
- package/dist/esm/react/nodes/mention.js +5 -15
- package/dist/esm/react/nodes/orderedList.js +0 -5
- package/dist/esm/react/nodes/panel.js +12 -28
- package/dist/esm/react/nodes/paragraph.js +1 -1
- package/dist/esm/react/nodes/placeholder.js +0 -1
- package/dist/esm/react/nodes/status.js +3 -13
- package/dist/esm/react/nodes/table/colgroup.js +12 -21
- package/dist/esm/react/nodes/table/sticky.js +17 -32
- package/dist/esm/react/nodes/table/table.js +5 -5
- package/dist/esm/react/nodes/table.js +19 -95
- package/dist/esm/react/nodes/tableCell.js +26 -66
- package/dist/esm/react/nodes/tableRow.js +4 -25
- package/dist/esm/react/nodes/task-item-with-providers.js +4 -27
- package/dist/esm/react/nodes/taskItem.js +8 -24
- package/dist/esm/react/nodes/taskList.js +2 -14
- package/dist/esm/react/nodes/text-wrapper.js +1 -5
- package/dist/esm/react/utils/clipboard.js +0 -1
- package/dist/esm/react/utils/element-selection.js +0 -10
- package/dist/esm/react/utils/inject-props.js +5 -7
- package/dist/esm/react/utils/links.js +2 -4
- package/dist/esm/react/utils/performance/RenderTracking.js +2 -4
- package/dist/esm/react/utils/use-select-all-trap.js +1 -9
- package/dist/esm/render-document.js +42 -70
- package/dist/esm/steps/index.js +7 -36
- package/dist/esm/text/index.js +0 -6
- package/dist/esm/text/nodes/blockquote.js +0 -2
- package/dist/esm/text/nodes/bulletList.js +0 -2
- package/dist/esm/text/nodes/date.js +0 -2
- package/dist/esm/text/nodes/decisionItem.js +0 -4
- package/dist/esm/text/nodes/hardBreak.js +0 -1
- package/dist/esm/text/nodes/heading.js +0 -2
- package/dist/esm/text/nodes/inlineCard.js +0 -3
- package/dist/esm/text/nodes/listItem.js +0 -2
- package/dist/esm/text/nodes/mediaGroup.js +0 -3
- package/dist/esm/text/nodes/mention.js +0 -2
- package/dist/esm/text/nodes/orderedList.js +0 -2
- package/dist/esm/text/nodes/panel.js +0 -2
- package/dist/esm/text/nodes/paragraph.js +0 -4
- package/dist/esm/text/nodes/rule.js +0 -1
- package/dist/esm/text/nodes/status.js +0 -2
- package/dist/esm/text/nodes/table.js +0 -4
- package/dist/esm/text/nodes/taskItem.js +0 -4
- package/dist/esm/text/nodes/unknown.js +0 -4
- package/dist/esm/ui/Expand.js +15 -36
- package/dist/esm/ui/ExtensionRenderer.js +10 -39
- package/dist/esm/ui/MediaCard.js +42 -99
- package/dist/esm/ui/Renderer/ErrorBoundary.js +0 -16
- package/dist/esm/ui/Renderer/breakout-ssr.js +7 -27
- package/dist/esm/ui/Renderer/click-to-edit.js +1 -4
- package/dist/esm/ui/Renderer/index.js +47 -110
- package/dist/esm/ui/Renderer/style.js +1 -21
- package/dist/esm/ui/Renderer/truncated-wrapper.js +12 -23
- package/dist/esm/ui/RendererActionsContext/index.js +1 -1
- package/dist/esm/ui/SmartCardStorage.js +0 -9
- package/dist/esm/ui/SortingIcon.js +10 -29
- package/dist/esm/ui/TaskItemsFormatContext/TaskItemsFormatContext.js +0 -2
- package/dist/esm/ui/active-header-id-provider.js +6 -12
- package/dist/esm/ui/annotations/context.js +0 -15
- package/dist/esm/ui/annotations/draft/component.js +5 -19
- package/dist/esm/ui/annotations/draft/dom.js +3 -11
- package/dist/esm/ui/annotations/draft/position.js +1 -9
- package/dist/esm/ui/annotations/draft/text.js +2 -4
- package/dist/esm/ui/annotations/element/index.js +4 -7
- package/dist/esm/ui/annotations/element/mark.js +8 -14
- package/dist/esm/ui/annotations/hooks/use-events.js +13 -32
- package/dist/esm/ui/annotations/hooks/use-inline-comment-subscriber.js +0 -2
- package/dist/esm/ui/annotations/hooks/use-inline-comments-filter.js +1 -2
- package/dist/esm/ui/annotations/hooks/use-load-annotations.js +4 -12
- package/dist/esm/ui/annotations/hooks/user-selection.js +3 -11
- package/dist/esm/ui/annotations/index.js +4 -6
- package/dist/esm/ui/annotations/selection/mounter.js +13 -29
- package/dist/esm/ui/annotations/selection/range-validator.js +9 -12
- package/dist/esm/ui/annotations/selection/wrapper.js +3 -5
- package/dist/esm/ui/annotations/types.js +0 -1
- package/dist/esm/ui/annotations/view/index.js +1 -5
- package/dist/esm/use-feature-flags.js +0 -1
- package/dist/esm/utils.js +1 -8
- package/dist/esm/version.json +1 -1
- package/package.json +2 -2
|
@@ -1,78 +1,54 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
8
|
exports.getAnnotationIndex = exports.applyAnnotationOnText = exports.TextWithAnnotationDraft = exports.AnnotationDraft = void 0;
|
|
11
|
-
|
|
12
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
-
|
|
14
10
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
15
|
-
|
|
16
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
17
|
-
|
|
18
12
|
var _react2 = require("@emotion/react");
|
|
19
|
-
|
|
20
13
|
var _types = require("../types");
|
|
21
|
-
|
|
22
14
|
var _context = require("../context");
|
|
23
|
-
|
|
24
15
|
var _text = require("./text");
|
|
25
|
-
|
|
26
16
|
var _position = require("./position");
|
|
27
|
-
|
|
28
17
|
var _dom = require("./dom");
|
|
29
|
-
|
|
30
18
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
31
|
-
|
|
32
19
|
var _templateObject;
|
|
33
|
-
|
|
34
20
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
35
|
-
|
|
36
21
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
37
|
-
|
|
38
22
|
var markStyles = function markStyles(props) {
|
|
39
23
|
return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n color: inherit;\n background-color: unset;\n -webkit-tap-highlight-color: transparent;\n\n ", ";\n"])), (0, _styles.AnnotationSharedCSSByState)(props).focus);
|
|
40
24
|
};
|
|
41
|
-
|
|
42
25
|
var AnnotationDraft = function AnnotationDraft(_ref) {
|
|
43
26
|
var draftPosition = _ref.draftPosition,
|
|
44
|
-
|
|
27
|
+
children = _ref.children;
|
|
45
28
|
return (0, _react2.jsx)("mark", (0, _extends2.default)({
|
|
46
29
|
"data-renderer-mark": true
|
|
47
30
|
}, (0, _dom.dataAttributes)(draftPosition), {
|
|
48
31
|
css: markStyles
|
|
49
32
|
}), children);
|
|
50
33
|
};
|
|
51
|
-
|
|
52
34
|
exports.AnnotationDraft = AnnotationDraft;
|
|
53
|
-
|
|
54
35
|
var getAnnotationIndex = function getAnnotationIndex(annotationPosition, fragmentCount) {
|
|
55
36
|
if (annotationPosition === _types.InsertDraftPosition.START) {
|
|
56
37
|
return 0;
|
|
57
38
|
}
|
|
58
|
-
|
|
59
39
|
if (annotationPosition === _types.InsertDraftPosition.END) {
|
|
60
40
|
return fragmentCount - 1;
|
|
61
41
|
}
|
|
62
|
-
|
|
63
42
|
if (annotationPosition === _types.InsertDraftPosition.INSIDE && fragmentCount === 3) {
|
|
64
43
|
return 1;
|
|
65
44
|
}
|
|
66
|
-
|
|
67
45
|
return -1;
|
|
68
46
|
};
|
|
69
|
-
|
|
70
47
|
exports.getAnnotationIndex = getAnnotationIndex;
|
|
71
|
-
|
|
72
48
|
var applyAnnotationOnText = function applyAnnotationOnText(_ref2) {
|
|
73
49
|
var texts = _ref2.texts,
|
|
74
|
-
|
|
75
|
-
|
|
50
|
+
shouldApplyAnnotationAt = _ref2.shouldApplyAnnotationAt,
|
|
51
|
+
draftPosition = _ref2.draftPosition;
|
|
76
52
|
var annotateIndex = getAnnotationIndex(shouldApplyAnnotationAt, texts.length);
|
|
77
53
|
return texts.map(function (value, index) {
|
|
78
54
|
if (annotateIndex === index) {
|
|
@@ -81,55 +57,43 @@ var applyAnnotationOnText = function applyAnnotationOnText(_ref2) {
|
|
|
81
57
|
draftPosition: draftPosition
|
|
82
58
|
}, value);
|
|
83
59
|
}
|
|
84
|
-
|
|
85
60
|
return (0, _react2.jsx)(_react.default.Fragment, {
|
|
86
61
|
key: index
|
|
87
62
|
}, value);
|
|
88
63
|
});
|
|
89
64
|
};
|
|
90
|
-
|
|
91
65
|
exports.applyAnnotationOnText = applyAnnotationOnText;
|
|
92
|
-
|
|
93
66
|
var TextWithAnnotationDraft = function TextWithAnnotationDraft(_ref3) {
|
|
94
67
|
var startPos = _ref3.startPos,
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
68
|
+
endPos = _ref3.endPos,
|
|
69
|
+
children = _ref3.children;
|
|
98
70
|
var textPosition = _react.default.useMemo(function () {
|
|
99
71
|
return {
|
|
100
72
|
start: startPos,
|
|
101
73
|
end: endPos
|
|
102
74
|
};
|
|
103
75
|
}, [endPos, startPos]);
|
|
104
|
-
|
|
105
76
|
var nextDraftPosition = _react.default.useContext(_context.AnnotationsDraftContext);
|
|
106
|
-
|
|
107
77
|
var shouldApplyAnnotationAt = _react.default.useMemo(function () {
|
|
108
78
|
if (!nextDraftPosition) {
|
|
109
79
|
return false;
|
|
110
80
|
}
|
|
111
|
-
|
|
112
81
|
return (0, _position.calcInsertDraftPositionOnText)(textPosition, nextDraftPosition);
|
|
113
82
|
}, [nextDraftPosition, textPosition]);
|
|
114
|
-
|
|
115
83
|
if (shouldApplyAnnotationAt === false || !nextDraftPosition) {
|
|
116
84
|
return (0, _react2.jsx)(_react.Fragment, null, children);
|
|
117
85
|
}
|
|
118
|
-
|
|
119
86
|
if (shouldApplyAnnotationAt === _types.InsertDraftPosition.AROUND_TEXT) {
|
|
120
87
|
return (0, _react2.jsx)(AnnotationDraft, {
|
|
121
88
|
key: 0,
|
|
122
89
|
draftPosition: nextDraftPosition
|
|
123
90
|
}, children);
|
|
124
91
|
}
|
|
125
|
-
|
|
126
92
|
var offsets = (0, _text.calcTextSplitOffset)(nextDraftPosition, textPosition, children);
|
|
127
93
|
var texts = (0, _text.splitText)(children, offsets);
|
|
128
|
-
|
|
129
94
|
if (!texts) {
|
|
130
95
|
return (0, _react2.jsx)(_react.Fragment, null, children);
|
|
131
96
|
}
|
|
132
|
-
|
|
133
97
|
var components = applyAnnotationOnText({
|
|
134
98
|
texts: texts,
|
|
135
99
|
shouldApplyAnnotationAt: shouldApplyAnnotationAt,
|
|
@@ -137,5 +101,4 @@ var TextWithAnnotationDraft = function TextWithAnnotationDraft(_ref3) {
|
|
|
137
101
|
});
|
|
138
102
|
return (0, _react2.jsx)(_react.Fragment, null, components);
|
|
139
103
|
};
|
|
140
|
-
|
|
141
104
|
exports.TextWithAnnotationDraft = TextWithAnnotationDraft;
|
|
@@ -1,50 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.updateWindowSelectionAroundDraft = exports.dataAttributes = void 0;
|
|
9
|
-
|
|
10
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
-
|
|
12
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
-
|
|
14
10
|
var dataAttributes = function dataAttributes(_ref) {
|
|
15
11
|
var _ref2;
|
|
16
|
-
|
|
17
12
|
var from = _ref.from,
|
|
18
|
-
|
|
13
|
+
to = _ref.to;
|
|
19
14
|
return _ref2 = {}, (0, _defineProperty2.default)(_ref2, 'data-annotation-draft-mark', true), (0, _defineProperty2.default)(_ref2, 'data-draft-start-at', from), (0, _defineProperty2.default)(_ref2, 'data-draft-end-at', to), _ref2;
|
|
20
15
|
};
|
|
21
|
-
|
|
22
16
|
exports.dataAttributes = dataAttributes;
|
|
23
|
-
|
|
24
17
|
var buildDataAttributesQuery = function buildDataAttributesQuery(pos) {
|
|
25
18
|
var a = dataAttributes(pos);
|
|
26
19
|
return Object.entries(a).map(function (_ref3) {
|
|
27
20
|
var _ref4 = (0, _slicedToArray2.default)(_ref3, 2),
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
21
|
+
k = _ref4[0],
|
|
22
|
+
v = _ref4[1];
|
|
31
23
|
return "[".concat(k, "=\"").concat(v, "\"]");
|
|
32
24
|
}).join('');
|
|
33
25
|
};
|
|
34
|
-
|
|
35
26
|
var updateWindowSelectionAroundDraft = function updateWindowSelectionAroundDraft(pos) {
|
|
36
27
|
var sel = window.getSelection();
|
|
37
|
-
|
|
38
28
|
if (!sel) {
|
|
39
29
|
return false;
|
|
40
30
|
}
|
|
41
|
-
|
|
42
31
|
var draftNodes = document.querySelectorAll(buildDataAttributesQuery(pos));
|
|
43
|
-
|
|
44
32
|
if (!draftNodes || draftNodes.length === 0) {
|
|
45
33
|
return false;
|
|
46
34
|
}
|
|
47
|
-
|
|
48
35
|
sel.removeAllRanges();
|
|
49
36
|
var range = document.createRange();
|
|
50
37
|
range.setStart(draftNodes[0], 0);
|
|
@@ -52,5 +39,4 @@ var updateWindowSelectionAroundDraft = function updateWindowSelectionAroundDraft
|
|
|
52
39
|
sel.addRange(range);
|
|
53
40
|
return true;
|
|
54
41
|
};
|
|
55
|
-
|
|
56
42
|
exports.updateWindowSelectionAroundDraft = updateWindowSelectionAroundDraft;
|
|
@@ -4,37 +4,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.calcInsertDraftPositionOnText = void 0;
|
|
7
|
-
|
|
8
7
|
var _types = require("../types");
|
|
9
|
-
|
|
10
8
|
var calcInsertDraftPositionOnText = function calcInsertDraftPositionOnText(_ref, position) {
|
|
11
9
|
var startTextPosition = _ref.start,
|
|
12
|
-
|
|
10
|
+
endTextPosition = _ref.end;
|
|
13
11
|
var isRangePositionAroundText = position.from <= startTextPosition && position.to >= endTextPosition;
|
|
14
|
-
|
|
15
12
|
if (isRangePositionAroundText) {
|
|
16
13
|
return _types.InsertDraftPosition.AROUND_TEXT;
|
|
17
14
|
}
|
|
18
|
-
|
|
19
15
|
var isRangePositionInsideText = position.from > startTextPosition && position.from < endTextPosition && position.to < endTextPosition && position.to > startTextPosition;
|
|
20
|
-
|
|
21
16
|
if (isRangePositionInsideText) {
|
|
22
17
|
return _types.InsertDraftPosition.INSIDE;
|
|
23
18
|
}
|
|
24
|
-
|
|
25
19
|
var isRangePositionStartingAtText = position.from >= startTextPosition && position.from <= endTextPosition && position.to >= endTextPosition;
|
|
26
|
-
|
|
27
20
|
if (isRangePositionStartingAtText) {
|
|
28
21
|
return _types.InsertDraftPosition.END;
|
|
29
22
|
}
|
|
30
|
-
|
|
31
23
|
var isRangePositionEndingAtText = position.from <= startTextPosition && position.to >= startTextPosition && position.to <= endTextPosition;
|
|
32
|
-
|
|
33
24
|
if (isRangePositionEndingAtText) {
|
|
34
25
|
return _types.InsertDraftPosition.START;
|
|
35
26
|
}
|
|
36
|
-
|
|
37
27
|
return false;
|
|
38
28
|
};
|
|
39
|
-
|
|
40
29
|
exports.calcInsertDraftPositionOnText = calcInsertDraftPositionOnText;
|
|
@@ -4,23 +4,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.splitText = exports.calcTextSplitOffset = void 0;
|
|
7
|
-
|
|
8
7
|
var splitText = function splitText(text, _ref) {
|
|
9
8
|
var startOffset = _ref.startOffset,
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
endOffset = _ref.endOffset;
|
|
12
10
|
if (endOffset > text.length || endOffset - startOffset <= 0) {
|
|
13
11
|
return null;
|
|
14
12
|
}
|
|
15
|
-
|
|
16
13
|
return [text.slice(0, startOffset), text.slice(startOffset, endOffset), text.slice(endOffset)].filter(Boolean);
|
|
17
14
|
};
|
|
18
|
-
|
|
19
15
|
exports.splitText = splitText;
|
|
20
|
-
|
|
21
16
|
var calcTextSplitOffset = function calcTextSplitOffset(position, textPosition, text) {
|
|
22
17
|
var start = textPosition.start,
|
|
23
|
-
|
|
18
|
+
end = textPosition.end;
|
|
24
19
|
var startOffset = Math.max(position.from - start, 0);
|
|
25
20
|
var endOffset = Math.min(Math.abs(end - position.to - text.length), text.length);
|
|
26
21
|
return {
|
|
@@ -28,5 +23,4 @@ var calcTextSplitOffset = function calcTextSplitOffset(position, textPosition, t
|
|
|
28
23
|
endOffset: endOffset
|
|
29
24
|
};
|
|
30
25
|
};
|
|
31
|
-
|
|
32
26
|
exports.calcTextSplitOffset = calcTextSplitOffset;
|
|
@@ -1,33 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.MarkElement = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
9
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
13
|
-
|
|
14
10
|
var _mark = require("./mark");
|
|
15
|
-
|
|
16
11
|
var _hooks = require("../hooks");
|
|
17
|
-
|
|
18
12
|
var _context = require("../context");
|
|
19
|
-
|
|
20
13
|
var _types = require("@atlaskit/editor-common/types");
|
|
21
|
-
|
|
22
14
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
|
-
|
|
24
15
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
25
|
-
|
|
26
16
|
var MarkElement = function MarkElement(_ref) {
|
|
27
17
|
var annotationParentIds = _ref.annotationParentIds,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
18
|
+
children = _ref.children,
|
|
19
|
+
dataAttributes = _ref.dataAttributes,
|
|
20
|
+
id = _ref.id;
|
|
31
21
|
var updateSubscriber = (0, _hooks.useInlineCommentSubscriberContext)();
|
|
32
22
|
var states = (0, _react.useContext)(_context.InlineCommentsStateContext);
|
|
33
23
|
var hasFocus = (0, _hooks.useHasFocusEvent)({
|
|
@@ -41,9 +31,8 @@ var MarkElement = function MarkElement(_ref) {
|
|
|
41
31
|
if (!updateSubscriber) {
|
|
42
32
|
return;
|
|
43
33
|
}
|
|
44
|
-
|
|
45
34
|
var eventTarget = props.eventTarget,
|
|
46
|
-
|
|
35
|
+
annotationIds = props.annotationIds;
|
|
47
36
|
updateSubscriber.emit(_types.AnnotationUpdateEvent.ON_ANNOTATION_CLICK, {
|
|
48
37
|
annotationIds: annotationIds,
|
|
49
38
|
eventTarget: eventTarget
|
|
@@ -64,5 +53,4 @@ var MarkElement = function MarkElement(_ref) {
|
|
|
64
53
|
state: states[id]
|
|
65
54
|
}, children);
|
|
66
55
|
};
|
|
67
|
-
|
|
68
56
|
exports.MarkElement = MarkElement;
|
|
@@ -1,40 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
8
|
exports.MarkComponent = void 0;
|
|
11
|
-
|
|
12
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
-
|
|
14
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
-
|
|
16
11
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
17
|
-
|
|
18
12
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
19
|
-
|
|
20
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
21
|
-
|
|
22
14
|
var _react2 = require("@emotion/react");
|
|
23
|
-
|
|
24
15
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
25
|
-
|
|
26
16
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
27
|
-
|
|
28
17
|
var _templateObject;
|
|
29
|
-
|
|
30
18
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
31
|
-
|
|
32
19
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
33
|
-
|
|
34
20
|
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; }
|
|
35
|
-
|
|
36
21
|
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) { (0, _defineProperty2.default)(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; }
|
|
37
|
-
|
|
38
22
|
var markStyles = function markStyles(props) {
|
|
39
23
|
return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\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"])), _adfSchema.AnnotationMarkStates.ACTIVE, (0, _styles.AnnotationSharedCSSByState)({
|
|
40
24
|
theme: props
|
|
@@ -42,15 +26,14 @@ var markStyles = function markStyles(props) {
|
|
|
42
26
|
theme: props
|
|
43
27
|
}).focus);
|
|
44
28
|
};
|
|
45
|
-
|
|
46
29
|
var MarkComponent = function MarkComponent(_ref) {
|
|
47
30
|
var annotationParentIds = _ref.annotationParentIds,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
31
|
+
children = _ref.children,
|
|
32
|
+
dataAttributes = _ref.dataAttributes,
|
|
33
|
+
id = _ref.id,
|
|
34
|
+
state = _ref.state,
|
|
35
|
+
hasFocus = _ref.hasFocus,
|
|
36
|
+
onClick = _ref.onClick;
|
|
54
37
|
var annotationIds = (0, _react.useMemo)(function () {
|
|
55
38
|
return (0, _toConsumableArray2.default)(new Set([].concat((0, _toConsumableArray2.default)(annotationParentIds), [id])));
|
|
56
39
|
}, [id, annotationParentIds]);
|
|
@@ -58,9 +41,9 @@ var MarkComponent = function MarkComponent(_ref) {
|
|
|
58
41
|
// prevents multiple callback on overlapping annotations
|
|
59
42
|
if (event.defaultPrevented || state !== _adfSchema.AnnotationMarkStates.ACTIVE) {
|
|
60
43
|
return;
|
|
61
|
-
}
|
|
62
|
-
|
|
44
|
+
}
|
|
63
45
|
|
|
46
|
+
// prevents from opening link URL inside webView in Safari
|
|
64
47
|
event.preventDefault();
|
|
65
48
|
onClick({
|
|
66
49
|
eventTarget: event.target,
|
|
@@ -83,5 +66,4 @@ var MarkComponent = function MarkComponent(_ref) {
|
|
|
83
66
|
css: markStyles
|
|
84
67
|
}), children);
|
|
85
68
|
};
|
|
86
|
-
|
|
87
69
|
exports.MarkComponent = MarkComponent;
|
|
@@ -27,9 +27,6 @@ Object.defineProperty(exports, "useInlineCommentsFilter", {
|
|
|
27
27
|
return _useInlineCommentsFilter.useInlineCommentsFilter;
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
|
-
|
|
31
30
|
var _useEvents = require("./use-events");
|
|
32
|
-
|
|
33
31
|
var _useInlineCommentsFilter = require("./use-inline-comments-filter");
|
|
34
|
-
|
|
35
32
|
var _useInlineCommentSubscriber = require("./use-inline-comment-subscriber");
|
|
@@ -1,61 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.useHasFocusEvent = exports.useAnnotationStateByTypeEvent = exports.useAnnotationClickEvent = void 0;
|
|
9
|
-
|
|
10
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
|
-
|
|
14
10
|
var _react = require("react");
|
|
15
|
-
|
|
16
11
|
var _types = require("@atlaskit/editor-common/types");
|
|
17
|
-
|
|
18
12
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
19
|
-
|
|
20
13
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
21
|
-
|
|
22
14
|
var _analyticsListeners = require("@atlaskit/analytics-listeners");
|
|
23
|
-
|
|
24
15
|
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; }
|
|
25
|
-
|
|
26
16
|
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) { (0, _defineProperty2.default)(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; }
|
|
27
|
-
|
|
28
17
|
var useAnnotationStateByTypeEvent = function useAnnotationStateByTypeEvent(_ref) {
|
|
29
18
|
var type = _ref.type,
|
|
30
|
-
|
|
31
|
-
|
|
19
|
+
updateSubscriber = _ref.updateSubscriber;
|
|
32
20
|
var _useState = (0, _react.useState)({}),
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
21
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
22
|
+
states = _useState2[0],
|
|
23
|
+
setStates = _useState2[1];
|
|
37
24
|
(0, _react.useLayoutEffect)(function () {
|
|
38
25
|
if (!updateSubscriber) {
|
|
39
26
|
return;
|
|
40
27
|
}
|
|
41
|
-
|
|
42
28
|
var cb = function cb(payload) {
|
|
43
29
|
if (!payload) {
|
|
44
30
|
return;
|
|
45
31
|
}
|
|
46
|
-
|
|
47
32
|
var nextStates = Object.values(payload).reduce(function (acc, curr) {
|
|
48
33
|
if (curr.id && curr.annotationType === type) {
|
|
49
34
|
// Check for empty state to prevent additional renders
|
|
50
35
|
var isEmpty = curr.state === null || curr.state === undefined;
|
|
51
36
|
return _objectSpread(_objectSpread({}, acc), {}, (0, _defineProperty2.default)({}, curr.id, !isEmpty ? curr.state : states[curr.id]));
|
|
52
37
|
}
|
|
53
|
-
|
|
54
38
|
return acc;
|
|
55
39
|
}, {});
|
|
56
40
|
setStates(_objectSpread(_objectSpread({}, states), nextStates));
|
|
57
41
|
};
|
|
58
|
-
|
|
59
42
|
updateSubscriber.on(_types.AnnotationUpdateEvent.SET_ANNOTATION_STATE, cb);
|
|
60
43
|
return function () {
|
|
61
44
|
updateSubscriber.off(_types.AnnotationUpdateEvent.SET_ANNOTATION_STATE, cb);
|
|
@@ -63,31 +46,24 @@ var useAnnotationStateByTypeEvent = function useAnnotationStateByTypeEvent(_ref)
|
|
|
63
46
|
}, [states, type, updateSubscriber]);
|
|
64
47
|
return states;
|
|
65
48
|
};
|
|
66
|
-
|
|
67
49
|
exports.useAnnotationStateByTypeEvent = useAnnotationStateByTypeEvent;
|
|
68
|
-
|
|
69
50
|
var useHasFocusEvent = function useHasFocusEvent(_ref2) {
|
|
70
51
|
var id = _ref2.id,
|
|
71
|
-
|
|
72
|
-
|
|
52
|
+
updateSubscriber = _ref2.updateSubscriber;
|
|
73
53
|
var _useState3 = (0, _react.useState)(false),
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
54
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
55
|
+
hasFocus = _useState4[0],
|
|
56
|
+
setHasFocus = _useState4[1];
|
|
78
57
|
(0, _react.useLayoutEffect)(function () {
|
|
79
58
|
if (!updateSubscriber) {
|
|
80
59
|
return;
|
|
81
60
|
}
|
|
82
|
-
|
|
83
61
|
var cb = function cb(payload) {
|
|
84
62
|
setHasFocus(payload && payload.annotationId === id);
|
|
85
63
|
};
|
|
86
|
-
|
|
87
64
|
var removeFocus = function removeFocus() {
|
|
88
65
|
setHasFocus(false);
|
|
89
66
|
};
|
|
90
|
-
|
|
91
67
|
updateSubscriber.on(_types.AnnotationUpdateEvent.SET_ANNOTATION_FOCUS, cb);
|
|
92
68
|
updateSubscriber.on(_types.AnnotationUpdateEvent.REMOVE_ANNOTATION_FOCUS, removeFocus);
|
|
93
69
|
return function () {
|
|
@@ -97,25 +73,21 @@ var useHasFocusEvent = function useHasFocusEvent(_ref2) {
|
|
|
97
73
|
}, [id, updateSubscriber]);
|
|
98
74
|
return hasFocus;
|
|
99
75
|
};
|
|
100
|
-
|
|
101
76
|
exports.useHasFocusEvent = useHasFocusEvent;
|
|
102
|
-
|
|
103
77
|
var useAnnotationClickEvent = function useAnnotationClickEvent(props) {
|
|
104
78
|
var _useState5 = (0, _react.useState)(null),
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
79
|
+
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
80
|
+
annotationClickEvent = _useState6[0],
|
|
81
|
+
setAnnotationClickEvent = _useState6[1];
|
|
109
82
|
var updateSubscriber = props.updateSubscriber,
|
|
110
|
-
|
|
83
|
+
createAnalyticsEvent = props.createAnalyticsEvent;
|
|
111
84
|
(0, _react.useLayoutEffect)(function () {
|
|
112
85
|
if (!updateSubscriber) {
|
|
113
86
|
return;
|
|
114
87
|
}
|
|
115
|
-
|
|
116
88
|
var cb = function cb(_ref3) {
|
|
117
89
|
var annotationIds = _ref3.annotationIds,
|
|
118
|
-
|
|
90
|
+
eventTarget = _ref3.eventTarget;
|
|
119
91
|
var annotationsByType = annotationIds.filter(function (id) {
|
|
120
92
|
return !!id;
|
|
121
93
|
}).map(function (id) {
|
|
@@ -124,7 +96,6 @@ var useAnnotationClickEvent = function useAnnotationClickEvent(props) {
|
|
|
124
96
|
type: _adfSchema.AnnotationTypes.INLINE_COMMENT
|
|
125
97
|
};
|
|
126
98
|
});
|
|
127
|
-
|
|
128
99
|
if (createAnalyticsEvent) {
|
|
129
100
|
createAnalyticsEvent({
|
|
130
101
|
action: _analytics.ACTION.VIEWED,
|
|
@@ -136,13 +107,11 @@ var useAnnotationClickEvent = function useAnnotationClickEvent(props) {
|
|
|
136
107
|
}
|
|
137
108
|
}).fire(_analyticsListeners.FabricChannel.editor);
|
|
138
109
|
}
|
|
139
|
-
|
|
140
110
|
setAnnotationClickEvent({
|
|
141
111
|
annotations: annotationsByType,
|
|
142
112
|
clickElementTarget: eventTarget
|
|
143
113
|
});
|
|
144
114
|
};
|
|
145
|
-
|
|
146
115
|
updateSubscriber.on(_types.AnnotationUpdateEvent.ON_ANNOTATION_CLICK, cb);
|
|
147
116
|
return function () {
|
|
148
117
|
updateSubscriber.off(_types.AnnotationUpdateEvent.ON_ANNOTATION_CLICK, cb);
|
|
@@ -150,5 +119,4 @@ var useAnnotationClickEvent = function useAnnotationClickEvent(props) {
|
|
|
150
119
|
}, [updateSubscriber, createAnalyticsEvent]);
|
|
151
120
|
return annotationClickEvent;
|
|
152
121
|
};
|
|
153
|
-
|
|
154
122
|
exports.useAnnotationClickEvent = useAnnotationClickEvent;
|
|
@@ -4,20 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.useInlineCommentSubscriberContext = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = require("react");
|
|
9
|
-
|
|
10
8
|
var _context = require("../context");
|
|
11
|
-
|
|
12
9
|
var useInlineCommentSubscriberContext = function useInlineCommentSubscriberContext() {
|
|
13
10
|
var providers = (0, _react.useContext)(_context.ProvidersContext);
|
|
14
|
-
|
|
15
11
|
if (!providers) {
|
|
16
12
|
return null;
|
|
17
13
|
}
|
|
18
|
-
|
|
19
14
|
var updateSubscriber = providers.inlineComment.updateSubscriber;
|
|
20
15
|
return updateSubscriber || null;
|
|
21
16
|
};
|
|
22
|
-
|
|
23
17
|
exports.useInlineCommentSubscriberContext = useInlineCommentSubscriberContext;
|
|
@@ -1,31 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.useInlineCommentsFilter = void 0;
|
|
9
|
-
|
|
10
8
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
|
-
|
|
12
9
|
var _react = require("react");
|
|
13
|
-
|
|
14
10
|
var _context = require("../context");
|
|
15
|
-
|
|
16
11
|
var useInlineCommentsFilter = function useInlineCommentsFilter(_ref) {
|
|
17
12
|
var annotationIds = _ref.annotationIds,
|
|
18
|
-
|
|
13
|
+
stateFilter = _ref.filter.state;
|
|
19
14
|
var states = (0, _react.useContext)(_context.InlineCommentsStateContext);
|
|
20
15
|
return (0, _react.useMemo)(function () {
|
|
21
16
|
return annotationIds.reduce(function (acc, id) {
|
|
22
17
|
if (states && states[id] === stateFilter) {
|
|
23
18
|
return [].concat((0, _toConsumableArray2.default)(acc), [id]);
|
|
24
19
|
}
|
|
25
|
-
|
|
26
20
|
return acc;
|
|
27
21
|
}, []);
|
|
28
22
|
}, [annotationIds, states, stateFilter]);
|
|
29
23
|
};
|
|
30
|
-
|
|
31
24
|
exports.useInlineCommentsFilter = useInlineCommentsFilter;
|