@atlaskit/renderer 105.1.1 → 106.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/cjs/actions/index.js +19 -71
- package/dist/cjs/actions/matches-utils.js +10 -11
- package/dist/cjs/actions.js +0 -2
- package/dist/cjs/analytics/analyticsContext.js +0 -4
- package/dist/cjs/analytics/events.js +0 -5
- package/dist/cjs/analytics/unsupported-content.js +14 -27
- package/dist/cjs/i18n/cs.js +0 -1
- package/dist/cjs/i18n/da.js +0 -1
- package/dist/cjs/i18n/de.js +0 -1
- package/dist/cjs/i18n/en.js +0 -1
- package/dist/cjs/i18n/en_GB.js +0 -1
- package/dist/cjs/i18n/en_ZZ.js +0 -1
- package/dist/cjs/i18n/es.js +0 -1
- package/dist/cjs/i18n/et.js +0 -1
- package/dist/cjs/i18n/fi.js +0 -1
- package/dist/cjs/i18n/fr.js +0 -1
- package/dist/cjs/i18n/hu.js +0 -1
- package/dist/cjs/i18n/index.js +0 -26
- package/dist/cjs/i18n/it.js +0 -1
- package/dist/cjs/i18n/ja.js +0 -1
- package/dist/cjs/i18n/ko.js +0 -1
- package/dist/cjs/i18n/nb.js +0 -1
- package/dist/cjs/i18n/nl.js +0 -1
- package/dist/cjs/i18n/pl.js +0 -1
- package/dist/cjs/i18n/pt_BR.js +0 -1
- package/dist/cjs/i18n/pt_PT.js +0 -1
- package/dist/cjs/i18n/ru.js +0 -1
- package/dist/cjs/i18n/sk.js +0 -1
- package/dist/cjs/i18n/sv.js +0 -1
- package/dist/cjs/i18n/th.js +0 -1
- package/dist/cjs/i18n/tr.js +0 -1
- package/dist/cjs/i18n/uk.js +0 -1
- package/dist/cjs/i18n/vi.js +0 -1
- package/dist/cjs/i18n/zh.js +0 -1
- package/dist/cjs/i18n/zh_TW.js +0 -1
- package/dist/cjs/index.js +0 -6
- package/dist/cjs/messages.js +0 -2
- package/dist/cjs/react/hooks/use-bidi-warnings.js +2 -12
- package/dist/cjs/react/hooks/use-in-viewport.js +4 -17
- package/dist/cjs/react/hooks/use-observed-width.js +20 -35
- package/dist/cjs/react/index.js +27 -114
- package/dist/cjs/react/marks/alignment.js +0 -9
- package/dist/cjs/react/marks/annotation.js +6 -21
- package/dist/cjs/react/marks/breakout.js +0 -9
- package/dist/cjs/react/marks/code.js +0 -11
- package/dist/cjs/react/marks/confluence-inline-comment.js +2 -19
- package/dist/cjs/react/marks/data-consumer.js +0 -4
- package/dist/cjs/react/marks/em.js +0 -3
- package/dist/cjs/react/marks/fragment.js +0 -4
- package/dist/cjs/react/marks/indentation.js +0 -3
- package/dist/cjs/react/marks/index.js +1 -24
- package/dist/cjs/react/marks/link.js +5 -25
- package/dist/cjs/react/marks/strike.js +0 -4
- package/dist/cjs/react/marks/strong.js +0 -3
- package/dist/cjs/react/marks/subsup.js +0 -5
- package/dist/cjs/react/marks/textColor.js +0 -9
- package/dist/cjs/react/marks/underline.js +0 -3
- package/dist/cjs/react/marks/unsupportedMark.js +0 -3
- package/dist/cjs/react/marks/unsupportedNodeAttribute.js +0 -3
- package/dist/cjs/react/nodes/blockCard.js +4 -16
- package/dist/cjs/react/nodes/blockquote.js +0 -3
- package/dist/cjs/react/nodes/bodiedExtension.js +6 -17
- package/dist/cjs/react/nodes/bulletList.js +0 -5
- package/dist/cjs/react/nodes/caption.js +1 -6
- package/dist/cjs/react/nodes/codeBlock/codeBlock.js +5 -14
- package/dist/cjs/react/nodes/codeBlock/components/codeBlockContainer.js +3 -16
- package/dist/cjs/react/nodes/codeBlock/components/lightWeightCodeBlock.js +6 -23
- package/dist/cjs/react/nodes/codeBlock/windowedCodeBlock.js +9 -32
- package/dist/cjs/react/nodes/codeBlockCopyButton.js +7 -31
- package/dist/cjs/react/nodes/date.js +5 -33
- package/dist/cjs/react/nodes/decisionItem.js +1 -5
- package/dist/cjs/react/nodes/decisionList.js +0 -20
- package/dist/cjs/react/nodes/doc.js +0 -6
- package/dist/cjs/react/nodes/embedCard.js +25 -54
- package/dist/cjs/react/nodes/emoji.js +6 -24
- package/dist/cjs/react/nodes/extension.js +12 -26
- package/dist/cjs/react/nodes/fallback.js +2 -24
- package/dist/cjs/react/nodes/hardBreak.js +1 -7
- package/dist/cjs/react/nodes/heading-anchor.js +1 -46
- package/dist/cjs/react/nodes/heading.js +4 -17
- package/dist/cjs/react/nodes/index.js +7 -62
- package/dist/cjs/react/nodes/inline.js +0 -6
- package/dist/cjs/react/nodes/inlineCard.js +6 -23
- package/dist/cjs/react/nodes/inlineExtension.js +2 -10
- package/dist/cjs/react/nodes/layoutColumn.js +0 -8
- package/dist/cjs/react/nodes/layoutSection.js +0 -3
- package/dist/cjs/react/nodes/listItem.js +0 -3
- package/dist/cjs/react/nodes/media.js +10 -49
- package/dist/cjs/react/nodes/mediaGroup.js +6 -47
- package/dist/cjs/react/nodes/mediaInline.js +7 -37
- package/dist/cjs/react/nodes/mediaSingle/index.js +38 -85
- package/dist/cjs/react/nodes/mediaSingle/styles.js +0 -5
- package/dist/cjs/react/nodes/mention.js +5 -23
- package/dist/cjs/react/nodes/orderedList.js +0 -14
- package/dist/cjs/react/nodes/panel.js +10 -38
- package/dist/cjs/react/nodes/paragraph.js +1 -5
- package/dist/cjs/react/nodes/placeholder.js +0 -4
- package/dist/cjs/react/nodes/rule.js +0 -3
- package/dist/cjs/react/nodes/status.js +3 -22
- package/dist/cjs/react/nodes/table/colgroup.js +12 -26
- package/dist/cjs/react/nodes/table/sticky.js +17 -47
- package/dist/cjs/react/nodes/table/table.js +5 -10
- package/dist/cjs/react/nodes/table.js +19 -102
- package/dist/cjs/react/nodes/tableCell.js +26 -79
- package/dist/cjs/react/nodes/tableRow.js +4 -33
- package/dist/cjs/react/nodes/task-item-with-providers.js +4 -40
- package/dist/cjs/react/nodes/taskItem.js +8 -36
- package/dist/cjs/react/nodes/taskList.js +2 -22
- package/dist/cjs/react/nodes/text-wrapper.js +1 -8
- package/dist/cjs/react/nodes/unknownBlock.js +0 -3
- package/dist/cjs/react/renderer-node.js +0 -6
- package/dist/cjs/react/utils/clipboard.js +0 -3
- package/dist/cjs/react/utils/element-selection.js +0 -13
- package/dist/cjs/react/utils/getCardClickHandler.js +0 -3
- package/dist/cjs/react/utils/inject-props.js +4 -9
- package/dist/cjs/react/utils/links.js +2 -6
- package/dist/cjs/react/utils/lists.js +0 -1
- package/dist/cjs/react/utils/performance/RenderTracking.js +2 -10
- package/dist/cjs/react/utils/use-select-all-trap.js +1 -23
- package/dist/cjs/render-document.js +42 -83
- package/dist/cjs/renderer-context.js +0 -5
- package/dist/cjs/steps/index.js +7 -39
- package/dist/cjs/text/index.js +0 -9
- package/dist/cjs/text/nodes/blockquote.js +0 -3
- package/dist/cjs/text/nodes/bulletList.js +0 -3
- package/dist/cjs/text/nodes/date.js +0 -4
- package/dist/cjs/text/nodes/decisionItem.js +0 -5
- package/dist/cjs/text/nodes/hardBreak.js +0 -2
- package/dist/cjs/text/nodes/heading.js +0 -3
- package/dist/cjs/text/nodes/index.js +0 -21
- package/dist/cjs/text/nodes/inlineCard.js +0 -4
- package/dist/cjs/text/nodes/listItem.js +0 -3
- package/dist/cjs/text/nodes/mediaGroup.js +0 -4
- package/dist/cjs/text/nodes/mention.js +0 -3
- package/dist/cjs/text/nodes/orderedList.js +0 -4
- package/dist/cjs/text/nodes/panel.js +0 -3
- package/dist/cjs/text/nodes/paragraph.js +0 -5
- package/dist/cjs/text/nodes/rule.js +0 -2
- package/dist/cjs/text/nodes/status.js +0 -3
- package/dist/cjs/text/nodes/table.js +0 -5
- package/dist/cjs/text/nodes/taskItem.js +0 -5
- package/dist/cjs/text/nodes/unknown.js +0 -6
- package/dist/cjs/text-serializer.js +0 -2
- package/dist/cjs/ui/Expand.js +15 -59
- package/dist/cjs/ui/ExtensionRenderer.js +10 -43
- package/dist/cjs/ui/MediaCard.js +40 -116
- package/dist/cjs/ui/Renderer/ErrorBoundary.js +0 -26
- package/dist/cjs/ui/Renderer/breakout-ssr.js +6 -32
- package/dist/cjs/ui/Renderer/click-to-edit.js +0 -6
- package/dist/cjs/ui/Renderer/index.js +47 -149
- package/dist/cjs/ui/Renderer/style.js +1 -39
- package/dist/cjs/ui/Renderer/truncated-wrapper.js +12 -30
- package/dist/cjs/ui/RendererActionsContext/WithRendererActions.js +0 -4
- package/dist/cjs/ui/RendererActionsContext/index.js +1 -11
- package/dist/cjs/ui/SmartCardStorage.js +0 -20
- package/dist/cjs/ui/SortingIcon.js +10 -40
- package/dist/cjs/ui/TaskItemsFormatContext/TaskItemsFormatContext.js +0 -11
- package/dist/cjs/ui/TaskItemsFormatContext/index.js +0 -1
- package/dist/cjs/ui/active-header-id-provider.js +6 -19
- package/dist/cjs/ui/annotations/context.js +0 -24
- package/dist/cjs/ui/annotations/draft/component.js +5 -42
- package/dist/cjs/ui/annotations/draft/dom.js +3 -17
- package/dist/cjs/ui/annotations/draft/index.js +0 -2
- package/dist/cjs/ui/annotations/draft/position.js +1 -12
- package/dist/cjs/ui/annotations/draft/text.js +2 -8
- package/dist/cjs/ui/annotations/element/index.js +4 -16
- package/dist/cjs/ui/annotations/element/mark.js +8 -26
- package/dist/cjs/ui/annotations/hooks/index.js +0 -3
- package/dist/cjs/ui/annotations/hooks/use-events.js +13 -45
- package/dist/cjs/ui/annotations/hooks/use-inline-comment-subscriber.js +0 -6
- package/dist/cjs/ui/annotations/hooks/use-inline-comments-filter.js +1 -8
- package/dist/cjs/ui/annotations/hooks/use-load-annotations.js +4 -19
- package/dist/cjs/ui/annotations/hooks/user-selection.js +3 -18
- package/dist/cjs/ui/annotations/hooks/utils.js +0 -2
- package/dist/cjs/ui/annotations/index.js +4 -20
- package/dist/cjs/ui/annotations/selection/index.js +0 -1
- package/dist/cjs/ui/annotations/selection/mounter.js +13 -42
- package/dist/cjs/ui/annotations/selection/range-validator.js +9 -23
- package/dist/cjs/ui/annotations/selection/wrapper.js +3 -13
- package/dist/cjs/ui/annotations/types.js +0 -1
- package/dist/cjs/ui/annotations/view/index.js +1 -12
- package/dist/cjs/ui/index.js +0 -2
- package/dist/cjs/use-feature-flags.js +0 -4
- package/dist/cjs/utils.js +1 -19
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/actions/index.js +6 -50
- package/dist/es2019/actions/matches-utils.js +10 -9
- package/dist/es2019/actions.js +2 -1
- package/dist/es2019/analytics/events.js +0 -5
- package/dist/es2019/analytics/unsupported-content.js +8 -14
- package/dist/es2019/react/hooks/use-bidi-warnings.js +0 -2
- package/dist/es2019/react/hooks/use-in-viewport.js +0 -1
- package/dist/es2019/react/hooks/use-observed-width.js +0 -2
- package/dist/es2019/react/index.js +44 -119
- package/dist/es2019/react/marks/alignment.js +0 -3
- package/dist/es2019/react/marks/annotation.js +2 -5
- package/dist/es2019/react/marks/confluence-inline-comment.js +0 -1
- package/dist/es2019/react/marks/index.js +2 -1
- package/dist/es2019/react/marks/link.js +0 -6
- package/dist/es2019/react/marks/subsup.js +0 -3
- package/dist/es2019/react/nodes/bodiedExtension.js +2 -5
- package/dist/es2019/react/nodes/caption.js +0 -2
- package/dist/es2019/react/nodes/codeBlock/codeBlock.js +0 -2
- package/dist/es2019/react/nodes/codeBlock/components/codeBlockContainer.js +1 -3
- package/dist/es2019/react/nodes/codeBlock/windowedCodeBlock.js +1 -6
- package/dist/es2019/react/nodes/codeBlockCopyButton.js +0 -4
- package/dist/es2019/react/nodes/date.js +0 -7
- package/dist/es2019/react/nodes/decisionList.js +0 -3
- package/dist/es2019/react/nodes/embedCard.js +8 -16
- package/dist/es2019/react/nodes/emoji.js +0 -1
- package/dist/es2019/react/nodes/extension.js +4 -6
- package/dist/es2019/react/nodes/fallback.js +0 -8
- package/dist/es2019/react/nodes/hardBreak.js +0 -3
- package/dist/es2019/react/nodes/heading-anchor.js +0 -15
- package/dist/es2019/react/nodes/heading.js +0 -6
- package/dist/es2019/react/nodes/index.js +28 -61
- package/dist/es2019/react/nodes/inline.js +0 -2
- package/dist/es2019/react/nodes/inlineCard.js +0 -5
- package/dist/es2019/react/nodes/inlineExtension.js +2 -5
- package/dist/es2019/react/nodes/media.js +0 -10
- package/dist/es2019/react/nodes/mediaGroup.js +2 -22
- package/dist/es2019/react/nodes/mediaInline.js +1 -8
- package/dist/es2019/react/nodes/mediaSingle/index.js +8 -29
- package/dist/es2019/react/nodes/mention.js +0 -1
- package/dist/es2019/react/nodes/orderedList.js +0 -5
- package/dist/es2019/react/nodes/panel.js +4 -17
- package/dist/es2019/react/nodes/placeholder.js +0 -1
- package/dist/es2019/react/nodes/status.js +0 -1
- package/dist/es2019/react/nodes/table/colgroup.js +9 -18
- package/dist/es2019/react/nodes/table/sticky.js +3 -16
- package/dist/es2019/react/nodes/table.js +9 -75
- package/dist/es2019/react/nodes/tableCell.js +4 -31
- package/dist/es2019/react/nodes/tableRow.js +0 -10
- package/dist/es2019/react/nodes/task-item-with-providers.js +0 -6
- package/dist/es2019/react/nodes/taskItem.js +0 -7
- package/dist/es2019/react/nodes/taskList.js +0 -3
- package/dist/es2019/react/nodes/text-wrapper.js +0 -4
- package/dist/es2019/react/utils/clipboard.js +0 -1
- package/dist/es2019/react/utils/element-selection.js +0 -12
- package/dist/es2019/react/utils/inject-props.js +5 -7
- package/dist/es2019/react/utils/links.js +2 -4
- package/dist/es2019/react/utils/performance/RenderTracking.js +0 -1
- package/dist/es2019/react/utils/use-select-all-trap.js +0 -7
- package/dist/es2019/render-document.js +16 -33
- package/dist/es2019/steps/index.js +4 -33
- package/dist/es2019/text/index.js +0 -3
- package/dist/es2019/text/nodes/blockquote.js +0 -2
- package/dist/es2019/text/nodes/bulletList.js +0 -2
- package/dist/es2019/text/nodes/date.js +0 -2
- package/dist/es2019/text/nodes/decisionItem.js +0 -4
- package/dist/es2019/text/nodes/hardBreak.js +0 -1
- package/dist/es2019/text/nodes/heading.js +0 -2
- package/dist/es2019/text/nodes/inlineCard.js +0 -3
- package/dist/es2019/text/nodes/listItem.js +0 -2
- package/dist/es2019/text/nodes/mediaGroup.js +0 -3
- package/dist/es2019/text/nodes/mention.js +0 -2
- package/dist/es2019/text/nodes/orderedList.js +0 -2
- package/dist/es2019/text/nodes/panel.js +0 -2
- package/dist/es2019/text/nodes/paragraph.js +0 -4
- package/dist/es2019/text/nodes/rule.js +0 -1
- package/dist/es2019/text/nodes/status.js +0 -2
- package/dist/es2019/text/nodes/table.js +0 -4
- package/dist/es2019/text/nodes/taskItem.js +0 -4
- package/dist/es2019/text/nodes/unknown.js +0 -4
- package/dist/es2019/ui/Expand.js +2 -17
- package/dist/es2019/ui/ExtensionRenderer.js +0 -19
- package/dist/es2019/ui/MediaCard.js +9 -40
- package/dist/es2019/ui/Renderer/ErrorBoundary.js +0 -10
- package/dist/es2019/ui/Renderer/breakout-ssr.js +6 -26
- package/dist/es2019/ui/Renderer/click-to-edit.js +1 -4
- package/dist/es2019/ui/Renderer/index.js +17 -66
- package/dist/es2019/ui/Renderer/style.js +0 -14
- package/dist/es2019/ui/Renderer/truncated-wrapper.js +2 -6
- package/dist/es2019/ui/SmartCardStorage.js +0 -1
- package/dist/es2019/ui/SortingIcon.js +3 -20
- package/dist/es2019/ui/TaskItemsFormatContext/TaskItemsFormatContext.js +0 -2
- package/dist/es2019/ui/active-header-id-provider.js +0 -3
- package/dist/es2019/ui/annotations/context.js +0 -6
- package/dist/es2019/ui/annotations/draft/component.js +0 -13
- package/dist/es2019/ui/annotations/draft/dom.js +0 -6
- package/dist/es2019/ui/annotations/draft/position.js +0 -8
- package/dist/es2019/ui/annotations/draft/text.js +0 -1
- package/dist/es2019/ui/annotations/element/index.js +0 -3
- package/dist/es2019/ui/annotations/element/mark.js +4 -6
- package/dist/es2019/ui/annotations/hooks/use-events.js +4 -13
- package/dist/es2019/ui/annotations/hooks/use-inline-comment-subscriber.js +0 -2
- package/dist/es2019/ui/annotations/hooks/use-inline-comments-filter.js +0 -1
- package/dist/es2019/ui/annotations/hooks/use-load-annotations.js +4 -8
- package/dist/es2019/ui/annotations/hooks/user-selection.js +0 -6
- package/dist/es2019/ui/annotations/selection/mounter.js +0 -13
- package/dist/es2019/ui/annotations/selection/range-validator.js +0 -2
- package/dist/es2019/ui/annotations/selection/wrapper.js +0 -2
- package/dist/es2019/ui/annotations/types.js +0 -1
- package/dist/es2019/ui/annotations/view/index.js +0 -4
- package/dist/es2019/use-feature-flags.js +0 -1
- package/dist/es2019/utils.js +1 -8
- package/dist/es2019/version.json +1 -1
- package/dist/esm/actions/index.js +19 -63
- package/dist/esm/actions/matches-utils.js +10 -9
- package/dist/esm/actions.js +2 -1
- package/dist/esm/analytics/events.js +0 -5
- package/dist/esm/analytics/unsupported-content.js +14 -21
- package/dist/esm/react/hooks/use-bidi-warnings.js +2 -4
- package/dist/esm/react/hooks/use-in-viewport.js +4 -13
- package/dist/esm/react/hooks/use-observed-width.js +20 -29
- package/dist/esm/react/index.js +27 -111
- package/dist/esm/react/marks/alignment.js +0 -4
- package/dist/esm/react/marks/annotation.js +6 -14
- package/dist/esm/react/marks/breakout.js +0 -2
- package/dist/esm/react/marks/confluence-inline-comment.js +2 -12
- package/dist/esm/react/marks/index.js +2 -1
- package/dist/esm/react/marks/link.js +5 -12
- package/dist/esm/react/marks/subsup.js +0 -3
- package/dist/esm/react/nodes/blockCard.js +4 -4
- package/dist/esm/react/nodes/bodiedExtension.js +6 -10
- package/dist/esm/react/nodes/caption.js +1 -3
- package/dist/esm/react/nodes/codeBlock/codeBlock.js +4 -6
- package/dist/esm/react/nodes/codeBlock/components/codeBlockContainer.js +4 -8
- package/dist/esm/react/nodes/codeBlock/components/lightWeightCodeBlock.js +6 -10
- package/dist/esm/react/nodes/codeBlock/windowedCodeBlock.js +10 -21
- package/dist/esm/react/nodes/codeBlockCopyButton.js +7 -15
- package/dist/esm/react/nodes/date.js +5 -20
- package/dist/esm/react/nodes/decisionItem.js +1 -1
- package/dist/esm/react/nodes/decisionList.js +0 -12
- package/dist/esm/react/nodes/embedCard.js +25 -39
- package/dist/esm/react/nodes/emoji.js +6 -16
- package/dist/esm/react/nodes/extension.js +12 -16
- package/dist/esm/react/nodes/fallback.js +2 -18
- package/dist/esm/react/nodes/hardBreak.js +1 -5
- package/dist/esm/react/nodes/heading-anchor.js +1 -32
- package/dist/esm/react/nodes/heading.js +4 -10
- package/dist/esm/react/nodes/index.js +26 -64
- package/dist/esm/react/nodes/inline.js +0 -2
- package/dist/esm/react/nodes/inlineCard.js +6 -12
- package/dist/esm/react/nodes/inlineExtension.js +2 -6
- package/dist/esm/react/nodes/layoutColumn.js +0 -2
- package/dist/esm/react/nodes/media.js +10 -34
- package/dist/esm/react/nodes/mediaGroup.js +6 -37
- package/dist/esm/react/nodes/mediaInline.js +7 -20
- package/dist/esm/react/nodes/mediaSingle/index.js +37 -66
- package/dist/esm/react/nodes/mediaSingle/styles.js +0 -2
- package/dist/esm/react/nodes/mention.js +5 -15
- package/dist/esm/react/nodes/orderedList.js +0 -5
- package/dist/esm/react/nodes/panel.js +12 -28
- package/dist/esm/react/nodes/paragraph.js +1 -1
- package/dist/esm/react/nodes/placeholder.js +0 -1
- package/dist/esm/react/nodes/status.js +3 -13
- package/dist/esm/react/nodes/table/colgroup.js +12 -21
- package/dist/esm/react/nodes/table/sticky.js +17 -32
- package/dist/esm/react/nodes/table/table.js +5 -5
- package/dist/esm/react/nodes/table.js +19 -95
- package/dist/esm/react/nodes/tableCell.js +26 -66
- package/dist/esm/react/nodes/tableRow.js +4 -25
- package/dist/esm/react/nodes/task-item-with-providers.js +4 -27
- package/dist/esm/react/nodes/taskItem.js +8 -24
- package/dist/esm/react/nodes/taskList.js +2 -14
- package/dist/esm/react/nodes/text-wrapper.js +1 -5
- package/dist/esm/react/utils/clipboard.js +0 -1
- package/dist/esm/react/utils/element-selection.js +0 -10
- package/dist/esm/react/utils/inject-props.js +5 -7
- package/dist/esm/react/utils/links.js +2 -4
- package/dist/esm/react/utils/performance/RenderTracking.js +2 -4
- package/dist/esm/react/utils/use-select-all-trap.js +1 -9
- package/dist/esm/render-document.js +42 -70
- package/dist/esm/steps/index.js +7 -36
- package/dist/esm/text/index.js +0 -6
- package/dist/esm/text/nodes/blockquote.js +0 -2
- package/dist/esm/text/nodes/bulletList.js +0 -2
- package/dist/esm/text/nodes/date.js +0 -2
- package/dist/esm/text/nodes/decisionItem.js +0 -4
- package/dist/esm/text/nodes/hardBreak.js +0 -1
- package/dist/esm/text/nodes/heading.js +0 -2
- package/dist/esm/text/nodes/inlineCard.js +0 -3
- package/dist/esm/text/nodes/listItem.js +0 -2
- package/dist/esm/text/nodes/mediaGroup.js +0 -3
- package/dist/esm/text/nodes/mention.js +0 -2
- package/dist/esm/text/nodes/orderedList.js +0 -2
- package/dist/esm/text/nodes/panel.js +0 -2
- package/dist/esm/text/nodes/paragraph.js +0 -4
- package/dist/esm/text/nodes/rule.js +0 -1
- package/dist/esm/text/nodes/status.js +0 -2
- package/dist/esm/text/nodes/table.js +0 -4
- package/dist/esm/text/nodes/taskItem.js +0 -4
- package/dist/esm/text/nodes/unknown.js +0 -4
- package/dist/esm/ui/Expand.js +15 -36
- package/dist/esm/ui/ExtensionRenderer.js +10 -39
- package/dist/esm/ui/MediaCard.js +42 -99
- package/dist/esm/ui/Renderer/ErrorBoundary.js +0 -16
- package/dist/esm/ui/Renderer/breakout-ssr.js +7 -27
- package/dist/esm/ui/Renderer/click-to-edit.js +1 -4
- package/dist/esm/ui/Renderer/index.js +47 -110
- package/dist/esm/ui/Renderer/style.js +1 -21
- package/dist/esm/ui/Renderer/truncated-wrapper.js +12 -23
- package/dist/esm/ui/RendererActionsContext/index.js +1 -1
- package/dist/esm/ui/SmartCardStorage.js +0 -9
- package/dist/esm/ui/SortingIcon.js +10 -29
- package/dist/esm/ui/TaskItemsFormatContext/TaskItemsFormatContext.js +0 -2
- package/dist/esm/ui/active-header-id-provider.js +6 -12
- package/dist/esm/ui/annotations/context.js +0 -15
- package/dist/esm/ui/annotations/draft/component.js +5 -19
- package/dist/esm/ui/annotations/draft/dom.js +3 -11
- package/dist/esm/ui/annotations/draft/position.js +1 -9
- package/dist/esm/ui/annotations/draft/text.js +2 -4
- package/dist/esm/ui/annotations/element/index.js +4 -7
- package/dist/esm/ui/annotations/element/mark.js +8 -14
- package/dist/esm/ui/annotations/hooks/use-events.js +13 -32
- package/dist/esm/ui/annotations/hooks/use-inline-comment-subscriber.js +0 -2
- package/dist/esm/ui/annotations/hooks/use-inline-comments-filter.js +1 -2
- package/dist/esm/ui/annotations/hooks/use-load-annotations.js +4 -12
- package/dist/esm/ui/annotations/hooks/user-selection.js +3 -11
- package/dist/esm/ui/annotations/index.js +4 -6
- package/dist/esm/ui/annotations/selection/mounter.js +13 -29
- package/dist/esm/ui/annotations/selection/range-validator.js +9 -12
- package/dist/esm/ui/annotations/selection/wrapper.js +3 -5
- package/dist/esm/ui/annotations/types.js +0 -1
- package/dist/esm/ui/annotations/view/index.js +1 -5
- package/dist/esm/use-feature-flags.js +0 -1
- package/dist/esm/utils.js +1 -8
- package/dist/esm/version.json +1 -1
- package/package.json +7 -7
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
|
|
3
2
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
4
|
-
|
|
5
3
|
import { css } from '@emotion/react';
|
|
6
4
|
import { themed } from '@atlaskit/theme/components';
|
|
7
5
|
import { gridSize, fontFamily, fontSize, borderRadius } from '@atlaskit/theme/constants';
|
|
@@ -16,11 +14,9 @@ import { HeadingAnchorWrapperClassName } from '../../react/nodes/heading-anchor'
|
|
|
16
14
|
import { shadowObserverClassNames } from '@atlaskit/editor-common/ui';
|
|
17
15
|
import { getLightWeightCodeBlockStylesForRootRendererStyleSheet } from '../../react/nodes/codeBlock/components/lightWeightCodeBlock';
|
|
18
16
|
export var FullPagePadding = 32;
|
|
19
|
-
|
|
20
17
|
var getLineHeight = function getLineHeight(fontCode) {
|
|
21
18
|
return headingSizesImport[fontCode].lineHeight / headingSizesImport[fontCode].size;
|
|
22
19
|
};
|
|
23
|
-
|
|
24
20
|
export var headingSizes = {
|
|
25
21
|
h1: {
|
|
26
22
|
lineHeight: getLineHeight('h700')
|
|
@@ -41,59 +37,43 @@ export var headingSizes = {
|
|
|
41
37
|
lineHeight: getLineHeight('h100')
|
|
42
38
|
}
|
|
43
39
|
};
|
|
44
|
-
|
|
45
40
|
var headingAnchorStyle = function headingAnchorStyle(headingTag) {
|
|
46
41
|
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n /**\n * The copy link button doesn't reserve space in the DOM so that\n * the text alignment isn't impacted by the button/icon's space.\n */\n .", " {\n position: absolute;\n height: ", "em;\n\n margin-left: 6px;\n\n button {\n padding-left: 0;\n padding-right: 0;\n }\n }\n\n /**\n * Applies hover effects to the heading anchor link button\n * to fade in when the user rolls over the heading.\n *\n * The link is persistent on mobile, so we use feature detection\n * to enable hover effects for systems that support it (desktop).\n *\n * @see https://caniuse.com/mdn-css_at-rules_media_hover\n */\n @media (hover: hover) and (pointer: fine) {\n .", " {\n > button {\n opacity: 0;\n transform: translate(-8px, 0px);\n transition: opacity 0.2s ease 0s, transform 0.2s ease 0s;\n }\n }\n\n &:hover {\n .", " > button {\n opacity: 1;\n transform: none !important;\n }\n }\n }\n "])), HeadingAnchorWrapperClassName, headingSizes[headingTag].lineHeight, HeadingAnchorWrapperClassName, HeadingAnchorWrapperClassName);
|
|
47
42
|
};
|
|
48
|
-
|
|
49
43
|
var alignedHeadingAnchorStyle = function alignedHeadingAnchorStyle(_ref) {
|
|
50
44
|
var allowNestedHeaderLinks = _ref.allowNestedHeaderLinks;
|
|
51
|
-
|
|
52
45
|
if (!allowNestedHeaderLinks) {
|
|
53
46
|
return '';
|
|
54
47
|
}
|
|
55
|
-
|
|
56
48
|
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .fabric-editor-block-mark[data-align] > {\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n position: relative;\n }\n }\n\n /**\n * For right-alignment we flip the link to be before the heading\n * text so that the text is flush up against the edge of the editor's\n * container edge.\n */\n .fabric-editor-block-mark:not([data-align='center'])[data-align] {\n > {\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n // Using right to left text to achieve the inverse effect\n // of where the copy link button icon sits for left/center\n // alignment.\n // Although this is unorthodox it's the only approach which\n // allows the button to sit flush against the left edge of\n // bottom line of text.\n direction: rtl;\n\n // By default RTL will negatively impact the layout of special\n // characters within the heading text, and potentially other\n // nested inline nodes. To prevent this we insert pseudo elements\n // containing HTML entities to retain LTR for all heading content\n // except for the copy link button.\n > *:not(.", "):not(br) {\n ::before {\n // Open LTR: https://www.fileformat.info/info/unicode/char/202a/index.htm\n content: '\u202A';\n }\n ::after {\n // Close LTR: https://www.fileformat.info/info/unicode/char/202c/index.htm\n content: '\u202C';\n }\n }\n }\n }\n .", " {\n margin: 0 6px 0 0;\n }\n\n @media (hover: hover) and (pointer: fine) {\n .", " > button {\n transform: translate(8px, 0px);\n }\n }\n }\n "], ["\n .fabric-editor-block-mark[data-align] > {\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n position: relative;\n }\n }\n\n /**\n * For right-alignment we flip the link to be before the heading\n * text so that the text is flush up against the edge of the editor's\n * container edge.\n */\n .fabric-editor-block-mark:not([data-align='center'])[data-align] {\n > {\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n // Using right to left text to achieve the inverse effect\n // of where the copy link button icon sits for left/center\n // alignment.\n // Although this is unorthodox it's the only approach which\n // allows the button to sit flush against the left edge of\n // bottom line of text.\n direction: rtl;\n\n // By default RTL will negatively impact the layout of special\n // characters within the heading text, and potentially other\n // nested inline nodes. To prevent this we insert pseudo elements\n // containing HTML entities to retain LTR for all heading content\n // except for the copy link button.\n > *:not(.", "):not(br) {\n ::before {\n // Open LTR: https://www.fileformat.info/info/unicode/char/202a/index.htm\n content: '\\u202A';\n }\n ::after {\n // Close LTR: https://www.fileformat.info/info/unicode/char/202c/index.htm\n content: '\\u202C';\n }\n }\n }\n }\n .", " {\n margin: 0 6px 0 0;\n }\n\n @media (hover: hover) and (pointer: fine) {\n .", " > button {\n transform: translate(8px, 0px);\n }\n }\n }\n "])), HeadingAnchorWrapperClassName, HeadingAnchorWrapperClassName, HeadingAnchorWrapperClassName);
|
|
57
49
|
};
|
|
58
|
-
|
|
59
50
|
var tableSortableColumnStyle = function tableSortableColumnStyle(_ref2) {
|
|
60
51
|
var allowColumnSorting = _ref2.allowColumnSorting,
|
|
61
|
-
|
|
62
|
-
|
|
52
|
+
allowNestedHeaderLinks = _ref2.allowNestedHeaderLinks;
|
|
63
53
|
if (!allowColumnSorting) {
|
|
64
54
|
return '';
|
|
65
55
|
}
|
|
66
|
-
|
|
67
56
|
var headingsCss = '';
|
|
68
|
-
|
|
69
57
|
if (allowNestedHeaderLinks) {
|
|
70
58
|
headingsCss = "\n /**\n * When the sort button is enabled we want the heading's copy link button\n * to reserve space so that it can prematurely wrap to avoid the button\n * being displayed underneath the sort button (hidden or obscured).\n *\n * The two buttons fight each other since the sort button is displayed\n * on hover of the <th /> and the copy link button is displayed on hover\n * of the heading.\n *\n * Note that this can break the WYSIWYG experience in the case where\n * a heading fills the width of the table cell and the only thing which\n * wraps is the copy link button. This is hopefully a rare fringe case.\n */\n .".concat(HeadingAnchorWrapperClassName, " {\n position: unset;\n }\n > {\n h1, h2, h3, h4, h5, h6 {\n margin-right: 30px;\n }\n }\n ");
|
|
71
59
|
}
|
|
72
|
-
|
|
73
60
|
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n .", " {\n padding: 0;\n\n .", " {\n width: 100%;\n height: 100%;\n padding: ", "px;\n border-width: 1.5px;\n border-style: solid;\n border-color: transparent;\n\n > *:first-child {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-child + *,\n > style:first-child + .ProseMirror-gapcursor + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-child + span + *,\n > style:first-child + .ProseMirror-gapcursor + span + * {\n margin-top: 0;\n }\n\n @supports selector(:focus-visible) {\n &:focus {\n outline: unset;\n }\n &:focus-visible {\n border-color: ", ";\n }\n }\n\n ", "\n }\n\n .", " {\n margin: 0;\n .", " {\n opacity: 1;\n transition: opacity 0.2s ease-in-out;\n }\n }\n\n .", " {\n .", " {\n opacity: 0;\n &:focus {\n opacity: 1;\n }\n }\n }\n\n &:hover {\n .", " {\n .", " {\n opacity: 1;\n }\n }\n }\n }\n "])), RendererCssClassName.SORTABLE_COLUMN_WRAPPER, RendererCssClassName.SORTABLE_COLUMN, tableCellPadding, "var(--ds-border-focused, ".concat(colors.B300, ")"), headingsCss, RendererCssClassName.SORTABLE_COLUMN_ICON_WRAPPER, RendererCssClassName.SORTABLE_COLUMN_ICON, RendererCssClassName.SORTABLE_COLUMN_NO_ORDER, RendererCssClassName.SORTABLE_COLUMN_ICON, RendererCssClassName.SORTABLE_COLUMN_NO_ORDER, RendererCssClassName.SORTABLE_COLUMN_ICON);
|
|
74
61
|
};
|
|
75
|
-
|
|
76
62
|
var fullPageStyles = function fullPageStyles(_ref3, _ref4) {
|
|
77
63
|
var appearance = _ref3.appearance;
|
|
78
64
|
var theme = _ref4.theme;
|
|
79
|
-
|
|
80
65
|
if (appearance !== 'full-page' && appearance !== 'mobile') {
|
|
81
66
|
return '';
|
|
82
67
|
}
|
|
83
|
-
|
|
84
68
|
return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n max-width: ", ";\n margin: 0 auto;\n padding: 0 ", "px;\n "])), theme && theme.layoutMaxWidth ? "".concat(theme.layoutMaxWidth, "px") : 'none', appearance === 'full-page' ? FullPagePadding : 0);
|
|
85
69
|
};
|
|
86
|
-
|
|
87
70
|
var fullWidthStyles = function fullWidthStyles(_ref5) {
|
|
88
71
|
var appearance = _ref5.appearance;
|
|
89
|
-
|
|
90
72
|
if (appearance !== 'full-width') {
|
|
91
73
|
return '';
|
|
92
74
|
}
|
|
93
|
-
|
|
94
75
|
return css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n max-width: ", "px;\n margin: 0 auto;\n\n .fabric-editor-breakout-mark,\n .pm-table-container,\n .ak-renderer-extension {\n width: 100% !important;\n }\n "])), akEditorFullWidthLayoutWidth);
|
|
95
76
|
};
|
|
96
|
-
|
|
97
77
|
export var rendererStyles = function rendererStyles(wrapperProps) {
|
|
98
78
|
return function (theme) {
|
|
99
79
|
// This is required to be compatible with styled-components prop structure.
|
|
@@ -4,56 +4,46 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
4
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
6
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
7
|
-
|
|
8
7
|
var _templateObject;
|
|
9
|
-
|
|
10
8
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
11
|
-
|
|
12
9
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
13
|
-
|
|
14
10
|
/** @jsx jsx */
|
|
15
11
|
import { css, jsx } from '@emotion/react';
|
|
16
12
|
import { Component } from 'react';
|
|
17
|
-
|
|
18
13
|
var fadeOutStyles = function fadeOutStyles(maxHeight, top, backgroundColor) {
|
|
19
14
|
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n overflow-y: hidden;\n max-height: ", "px;\n &::after {\n content: '';\n position: absolute;\n top: ", "px;\n bottom: 0;\n left: 0;\n right: 0;\n background-image: linear-gradient(\n ", ",\n ", "\n );\n }\n"])), maxHeight, top, "var(--ds-background-neutral-subtle, rgba(255, 255, 255, 0))", backgroundColor);
|
|
20
15
|
};
|
|
21
|
-
|
|
22
16
|
var FadeOut = function FadeOut(props) {
|
|
23
17
|
var children = props.children,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
backgroundColor = props.backgroundColor,
|
|
19
|
+
fadeHeight = props.fadeHeight,
|
|
20
|
+
height = props.height;
|
|
27
21
|
var top = height - fadeHeight;
|
|
28
22
|
var styles = fadeOutStyles(height, top, backgroundColor);
|
|
29
23
|
return jsx("div", {
|
|
30
24
|
css: styles
|
|
31
25
|
}, children);
|
|
32
26
|
};
|
|
33
|
-
|
|
34
27
|
export var TruncatedWrapper = /*#__PURE__*/function (_Component) {
|
|
35
28
|
_inherits(TruncatedWrapper, _Component);
|
|
36
|
-
|
|
37
29
|
var _super = _createSuper(TruncatedWrapper);
|
|
38
|
-
|
|
39
30
|
function TruncatedWrapper(props) {
|
|
40
31
|
_classCallCheck(this, TruncatedWrapper);
|
|
41
|
-
|
|
42
32
|
return _super.call(this, props);
|
|
43
|
-
}
|
|
44
|
-
|
|
33
|
+
}
|
|
45
34
|
|
|
35
|
+
// TODO: Quality ticket as elevation.surface will be issue when sits top of modal. https://product-fabric.atlassian.net/browse/DSP-4123
|
|
46
36
|
_createClass(TruncatedWrapper, [{
|
|
47
37
|
key: "render",
|
|
48
38
|
value: function render() {
|
|
49
39
|
var _this$props = this.props,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
40
|
+
_this$props$height = _this$props.height,
|
|
41
|
+
height = _this$props$height === void 0 ? 95 : _this$props$height,
|
|
42
|
+
_this$props$fadeHeigh = _this$props.fadeHeight,
|
|
43
|
+
fadeHeight = _this$props$fadeHeigh === void 0 ? 24 : _this$props$fadeHeigh,
|
|
44
|
+
_this$props$backgroun = _this$props.backgroundColor,
|
|
45
|
+
backgroundColor = _this$props$backgroun === void 0 ? "var(--ds-surface, white)" : _this$props$backgroun,
|
|
46
|
+
children = _this$props.children;
|
|
57
47
|
return jsx(FadeOut, {
|
|
58
48
|
height: height,
|
|
59
49
|
fadeHeight: fadeHeight,
|
|
@@ -61,6 +51,5 @@ export var TruncatedWrapper = /*#__PURE__*/function (_Component) {
|
|
|
61
51
|
}, children);
|
|
62
52
|
}
|
|
63
53
|
}]);
|
|
64
|
-
|
|
65
54
|
return TruncatedWrapper;
|
|
66
55
|
}(Component);
|
|
@@ -3,7 +3,7 @@ import RendererActions from '../../actions/index';
|
|
|
3
3
|
export var RendererContext = /*#__PURE__*/React.createContext(new RendererActions());
|
|
4
4
|
export function RendererActionsContext(_ref) {
|
|
5
5
|
var children = _ref.children,
|
|
6
|
-
|
|
6
|
+
context = _ref.context;
|
|
7
7
|
var actions = useMemo(function () {
|
|
8
8
|
return new RendererActions(true);
|
|
9
9
|
}, []);
|
|
@@ -4,11 +4,8 @@ import _createClass from "@babel/runtime/helpers/createClass";
|
|
|
4
4
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
-
|
|
8
7
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
9
|
-
|
|
10
8
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
11
|
-
|
|
12
9
|
import React from 'react';
|
|
13
10
|
export var Context = /*#__PURE__*/React.createContext(new Map());
|
|
14
11
|
export var Provider = function Provider(_ref) {
|
|
@@ -20,20 +17,15 @@ export var Provider = function Provider(_ref) {
|
|
|
20
17
|
export var withSmartCardStorage = function withSmartCardStorage(WrappedComponent) {
|
|
21
18
|
return /*#__PURE__*/function (_React$Component) {
|
|
22
19
|
_inherits(_class, _React$Component);
|
|
23
|
-
|
|
24
20
|
var _super = _createSuper(_class);
|
|
25
|
-
|
|
26
21
|
function _class() {
|
|
27
22
|
_classCallCheck(this, _class);
|
|
28
|
-
|
|
29
23
|
return _super.apply(this, arguments);
|
|
30
24
|
}
|
|
31
|
-
|
|
32
25
|
_createClass(_class, [{
|
|
33
26
|
key: "render",
|
|
34
27
|
value: function render() {
|
|
35
28
|
var _this = this;
|
|
36
|
-
|
|
37
29
|
return /*#__PURE__*/React.createElement(Context.Consumer, null, function (storage) {
|
|
38
30
|
return /*#__PURE__*/React.createElement(WrappedComponent, _extends({}, _this.props, {
|
|
39
31
|
smartCardStorage: storage
|
|
@@ -41,7 +33,6 @@ export var withSmartCardStorage = function withSmartCardStorage(WrappedComponent
|
|
|
41
33
|
});
|
|
42
34
|
}
|
|
43
35
|
}]);
|
|
44
|
-
|
|
45
36
|
return _class;
|
|
46
37
|
}(React.Component);
|
|
47
38
|
};
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
|
|
3
2
|
var _templateObject, _templateObject2, _templateObject3;
|
|
4
|
-
|
|
5
3
|
/** @jsx jsx */
|
|
6
4
|
import { css, jsx } from '@emotion/react';
|
|
7
5
|
import Tooltip from '@atlaskit/tooltip';
|
|
@@ -12,86 +10,70 @@ import { sortingIconMessages } from '../messages';
|
|
|
12
10
|
import { injectIntl } from 'react-intl-next';
|
|
13
11
|
import { RendererCssClassName } from '../consts';
|
|
14
12
|
export var StatusClassNames;
|
|
15
|
-
|
|
16
13
|
(function (StatusClassNames) {
|
|
17
14
|
StatusClassNames["ASC"] = "sorting-icon-svg__asc";
|
|
18
15
|
StatusClassNames["DESC"] = "sorting-icon-svg__desc";
|
|
19
16
|
StatusClassNames["NO_ORDER"] = "sorting-icon-svg__no_order";
|
|
20
17
|
StatusClassNames["SORTING_NOT_ALLOWED"] = "sorting-icon-svg__not-allowed";
|
|
21
18
|
})(StatusClassNames || (StatusClassNames = {}));
|
|
22
|
-
|
|
23
19
|
var buttonStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n display: flex;\n height: 28px;\n width: 28px;\n margin: 6px;\n right: 0;\n top: 0;\n border: 2px solid ", ";\n border-radius: ", "px;\n background-color: ", ";\n justify-content: center;\n align-items: center;\n cursor: pointer;\n\n &:hover {\n background-color: ", ";\n }\n\n &:active {\n background-color: ", ";\n }\n\n &.", "__not-allowed {\n cursor: not-allowed;\n }\n"])), "var(--ds-border, #fff)", gridSize() / 2, "var(--ds-surface-overlay, ".concat(N20, ")"), "var(--ds-surface-overlay-hovered, ".concat(N30, ")"), "var(--ds-surface-overlay-pressed, rgba(179, 212, 255, 0.6))", RendererCssClassName.SORTABLE_COLUMN_ICON);
|
|
24
|
-
var iconWrapperStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 8px;\n height: 12px;\n transition: transform 0.3s cubic-bezier(0.15, 1, 0.3, 1);\n transform-origin: 50% 50%;\n display: flex;\n justify-content: center;\n\n &.", " {\n transform: rotate(-180deg);\n }\n\n &.", "-inactive {\n opacity: 0.7;\n }\n"])), StatusClassNames.DESC, RendererCssClassName.SORTABLE_COLUMN_ICON);
|
|
20
|
+
var iconWrapperStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 8px;\n height: 12px;\n transition: transform 0.3s cubic-bezier(0.15, 1, 0.3, 1);\n transform-origin: 50% 50%;\n display: flex;\n justify-content: center;\n\n &.", " {\n transform: rotate(-180deg);\n }\n\n &.", "-inactive {\n opacity: 0.7;\n }\n"])), StatusClassNames.DESC, RendererCssClassName.SORTABLE_COLUMN_ICON);
|
|
21
|
+
|
|
22
|
+
// The icon is created with CSS due to the following Firefox issue: https://product-fabric.atlassian.net/browse/ED-8001
|
|
25
23
|
// The TL;DR is that svg's in tables mess up how HTML is copied in Firefox. Using a styled div instead solves the problem.
|
|
26
24
|
// For this reason, svg's should be avoided in tables until this issue is fixed: https://bugzilla.mozilla.org/show_bug.cgi?id=1664350
|
|
27
|
-
|
|
28
25
|
var iconStyles = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n height: 100%;\n width: 2px;\n border-radius: 50px;\n background: ", ";\n\n &::before,\n &::after {\n background: ", ";\n content: '';\n height: 2px;\n width: 6px;\n position: absolute;\n border-radius: 50px;\n }\n\n &::before {\n transform: rotate(45deg) translate(3.4px, 8.5px);\n }\n\n &::after {\n transform: rotate(-45deg) translate(-6.3px, 5.7px);\n }\n"])), "var(--ds-icon, #42526E)", "var(--ds-icon, #42526E)");
|
|
29
|
-
|
|
30
26
|
var getIconClassName = function getIconClassName(isSortingAllowed, sortOrdered) {
|
|
31
27
|
var activated = sortOrdered !== SortOrder.NO_ORDER;
|
|
32
28
|
var activeStatusClass = "".concat(RendererCssClassName.SORTABLE_COLUMN_ICON, "-").concat(activated ? 'active' : 'inactive');
|
|
33
|
-
|
|
34
29
|
if (!isSortingAllowed) {
|
|
35
30
|
return "".concat(StatusClassNames.SORTING_NOT_ALLOWED, " ").concat(activeStatusClass);
|
|
36
31
|
}
|
|
37
|
-
|
|
38
32
|
switch (sortOrdered) {
|
|
39
33
|
case SortOrder.ASC:
|
|
40
34
|
return "".concat(StatusClassNames.ASC, " ").concat(activeStatusClass);
|
|
41
|
-
|
|
42
35
|
case SortOrder.DESC:
|
|
43
36
|
return "".concat(StatusClassNames.DESC, " ").concat(activeStatusClass);
|
|
44
|
-
|
|
45
37
|
default:
|
|
46
38
|
return "".concat(StatusClassNames.NO_ORDER, " ").concat(activeStatusClass);
|
|
47
39
|
}
|
|
48
40
|
};
|
|
49
|
-
|
|
50
41
|
var getTooltipTitle = function getTooltipTitle(intl, isSortingAllowed, sortOrdered) {
|
|
51
42
|
var noOrderLabel = sortingIconMessages.noOrderLabel,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
43
|
+
ascOrderLabel = sortingIconMessages.ascOrderLabel,
|
|
44
|
+
descOrderLabel = sortingIconMessages.descOrderLabel,
|
|
45
|
+
invalidLabel = sortingIconMessages.invalidLabel;
|
|
56
46
|
if (!isSortingAllowed) {
|
|
57
47
|
return intl.formatMessage(invalidLabel);
|
|
58
48
|
}
|
|
59
|
-
|
|
60
49
|
switch (sortOrdered) {
|
|
61
50
|
case SortOrder.NO_ORDER:
|
|
62
51
|
return intl.formatMessage(noOrderLabel);
|
|
63
|
-
|
|
64
52
|
case SortOrder.ASC:
|
|
65
53
|
return intl.formatMessage(ascOrderLabel);
|
|
66
|
-
|
|
67
54
|
case SortOrder.DESC:
|
|
68
55
|
return intl.formatMessage(descOrderLabel);
|
|
69
56
|
}
|
|
70
|
-
|
|
71
57
|
return '';
|
|
72
58
|
};
|
|
73
|
-
|
|
74
59
|
var SortingIcon = function SortingIcon(_ref) {
|
|
75
60
|
var isSortingAllowed = _ref.isSortingAllowed,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
61
|
+
sortOrdered = _ref.sortOrdered,
|
|
62
|
+
intl = _ref.intl,
|
|
63
|
+
onClick = _ref.onClick,
|
|
64
|
+
onKeyDown = _ref.onKeyDown;
|
|
80
65
|
var buttonClassName = "".concat(RendererCssClassName.SORTABLE_COLUMN_ICON).concat(isSortingAllowed ? '' : " ".concat(RendererCssClassName.SORTABLE_COLUMN_ICON, "__not-allowed"));
|
|
81
66
|
var content = getTooltipTitle(intl, isSortingAllowed, sortOrdered);
|
|
82
|
-
|
|
83
67
|
var handleClick = function handleClick() {
|
|
84
68
|
if (isSortingAllowed) {
|
|
85
69
|
onClick();
|
|
86
70
|
}
|
|
87
71
|
};
|
|
88
|
-
|
|
89
72
|
var handleKeyDown = function handleKeyDown(event) {
|
|
90
73
|
if (isSortingAllowed) {
|
|
91
74
|
onKeyDown(event);
|
|
92
75
|
}
|
|
93
76
|
};
|
|
94
|
-
|
|
95
77
|
return jsx(Tooltip, {
|
|
96
78
|
delay: 0,
|
|
97
79
|
content: content,
|
|
@@ -112,5 +94,4 @@ var SortingIcon = function SortingIcon(_ref) {
|
|
|
112
94
|
css: iconStyles
|
|
113
95
|
}))));
|
|
114
96
|
};
|
|
115
|
-
|
|
116
97
|
export default injectIntl(SortingIcon);
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
var defaultValue = [undefined, function () {}];
|
|
3
3
|
export var TaskItemsFormatContext = /*#__PURE__*/React.createContext(defaultValue);
|
|
4
|
-
|
|
5
4
|
var reducer = function reducer(_state, action) {
|
|
6
5
|
return action;
|
|
7
6
|
};
|
|
8
|
-
|
|
9
7
|
export function TaskItemsFormatProvider(_ref) {
|
|
10
8
|
var children = _ref.children;
|
|
11
9
|
var value = React.useReducer(reducer, undefined);
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import React, { useState } from 'react';
|
|
3
|
-
|
|
4
3
|
var _React$createContext = /*#__PURE__*/React.createContext(undefined),
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
Provider = _React$createContext.Provider,
|
|
5
|
+
Consumer = _React$createContext.Consumer;
|
|
8
6
|
/**
|
|
9
7
|
* We need to expose this abstraction on top of the native Consumer in order to control when
|
|
10
8
|
* The consumer will get notified when a match has happened. If we use the Consumer directly in
|
|
@@ -17,13 +15,11 @@ var _React$createContext = /*#__PURE__*/React.createContext(undefined),
|
|
|
17
15
|
*/
|
|
18
16
|
var ActiveHeaderIdConsumer = function ActiveHeaderIdConsumer(_ref) {
|
|
19
17
|
var nestedHeaderIds = _ref.nestedHeaderIds,
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
onNestedHeaderIdMatch = _ref.onNestedHeaderIdMatch;
|
|
22
19
|
var _useState = useState(),
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
21
|
+
activeHeaderId = _useState2[0],
|
|
22
|
+
setActiveHeaderId = _useState2[1];
|
|
27
23
|
return /*#__PURE__*/React.createElement(Consumer, null, function (newActiveHeaderId) {
|
|
28
24
|
if (!newActiveHeaderId || !nestedHeaderIds.includes(newActiveHeaderId)) {
|
|
29
25
|
setActiveHeaderId(undefined);
|
|
@@ -31,9 +27,7 @@ var ActiveHeaderIdConsumer = function ActiveHeaderIdConsumer(_ref) {
|
|
|
31
27
|
setActiveHeaderId(newActiveHeaderId);
|
|
32
28
|
onNestedHeaderIdMatch();
|
|
33
29
|
}
|
|
34
|
-
|
|
35
30
|
return null;
|
|
36
31
|
});
|
|
37
32
|
};
|
|
38
|
-
|
|
39
33
|
export { Provider as ActiveHeaderIdProvider, ActiveHeaderIdConsumer };
|
|
@@ -5,54 +5,40 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
5
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
|
|
9
8
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
-
|
|
11
9
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
|
-
|
|
13
10
|
import React, { createContext } from 'react';
|
|
14
11
|
export var AnnotationsDraftContext = /*#__PURE__*/createContext(null);
|
|
15
12
|
export var ProvidersContext = /*#__PURE__*/createContext(null);
|
|
16
13
|
export var InlineCommentsStateContext = /*#__PURE__*/createContext({});
|
|
17
14
|
export var AnnotationsDraftContextWrapper = /*#__PURE__*/function (_React$Component) {
|
|
18
15
|
_inherits(AnnotationsDraftContextWrapper, _React$Component);
|
|
19
|
-
|
|
20
16
|
var _super = _createSuper(AnnotationsDraftContextWrapper);
|
|
21
|
-
|
|
22
17
|
function AnnotationsDraftContextWrapper() {
|
|
23
18
|
var _this;
|
|
24
|
-
|
|
25
19
|
_classCallCheck(this, AnnotationsDraftContextWrapper);
|
|
26
|
-
|
|
27
20
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
28
21
|
args[_key] = arguments[_key];
|
|
29
22
|
}
|
|
30
|
-
|
|
31
23
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
32
|
-
|
|
33
24
|
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
34
25
|
position: null
|
|
35
26
|
});
|
|
36
|
-
|
|
37
27
|
_defineProperty(_assertThisInitialized(_this), "applyAnnotationDraftAt", function (nextPosition) {
|
|
38
28
|
var position = _this.state.position;
|
|
39
|
-
|
|
40
29
|
if (!position) {
|
|
41
30
|
_this.setState({
|
|
42
31
|
position: nextPosition
|
|
43
32
|
});
|
|
44
33
|
}
|
|
45
34
|
});
|
|
46
|
-
|
|
47
35
|
_defineProperty(_assertThisInitialized(_this), "clearAnnotationDraft", function () {
|
|
48
36
|
_this.setState({
|
|
49
37
|
position: null
|
|
50
38
|
});
|
|
51
39
|
});
|
|
52
|
-
|
|
53
40
|
return _this;
|
|
54
41
|
}
|
|
55
|
-
|
|
56
42
|
_createClass(AnnotationsDraftContextWrapper, [{
|
|
57
43
|
key: "render",
|
|
58
44
|
value: function render() {
|
|
@@ -68,6 +54,5 @@ export var AnnotationsDraftContextWrapper = /*#__PURE__*/function (_React$Compon
|
|
|
68
54
|
}));
|
|
69
55
|
}
|
|
70
56
|
}]);
|
|
71
|
-
|
|
72
57
|
return AnnotationsDraftContextWrapper;
|
|
73
58
|
}(React.Component);
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
3
|
-
|
|
4
3
|
var _templateObject;
|
|
5
|
-
|
|
6
4
|
/** @jsx jsx */
|
|
7
5
|
import React, { Fragment } from 'react';
|
|
8
6
|
import { css, jsx } from '@emotion/react';
|
|
@@ -12,14 +10,12 @@ import { splitText, calcTextSplitOffset } from './text';
|
|
|
12
10
|
import { calcInsertDraftPositionOnText } from './position';
|
|
13
11
|
import { dataAttributes } from './dom';
|
|
14
12
|
import { AnnotationSharedCSSByState } from '@atlaskit/editor-common/styles';
|
|
15
|
-
|
|
16
13
|
var markStyles = function markStyles(props) {
|
|
17
14
|
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: inherit;\n background-color: unset;\n -webkit-tap-highlight-color: transparent;\n\n ", ";\n"])), AnnotationSharedCSSByState(props).focus);
|
|
18
15
|
};
|
|
19
|
-
|
|
20
16
|
export var AnnotationDraft = function AnnotationDraft(_ref) {
|
|
21
17
|
var draftPosition = _ref.draftPosition,
|
|
22
|
-
|
|
18
|
+
children = _ref.children;
|
|
23
19
|
return jsx("mark", _extends({
|
|
24
20
|
"data-renderer-mark": true
|
|
25
21
|
}, dataAttributes(draftPosition), {
|
|
@@ -30,21 +26,18 @@ export var getAnnotationIndex = function getAnnotationIndex(annotationPosition,
|
|
|
30
26
|
if (annotationPosition === InsertDraftPosition.START) {
|
|
31
27
|
return 0;
|
|
32
28
|
}
|
|
33
|
-
|
|
34
29
|
if (annotationPosition === InsertDraftPosition.END) {
|
|
35
30
|
return fragmentCount - 1;
|
|
36
31
|
}
|
|
37
|
-
|
|
38
32
|
if (annotationPosition === InsertDraftPosition.INSIDE && fragmentCount === 3) {
|
|
39
33
|
return 1;
|
|
40
34
|
}
|
|
41
|
-
|
|
42
35
|
return -1;
|
|
43
36
|
};
|
|
44
37
|
export var applyAnnotationOnText = function applyAnnotationOnText(_ref2) {
|
|
45
38
|
var texts = _ref2.texts,
|
|
46
|
-
|
|
47
|
-
|
|
39
|
+
shouldApplyAnnotationAt = _ref2.shouldApplyAnnotationAt,
|
|
40
|
+
draftPosition = _ref2.draftPosition;
|
|
48
41
|
var annotateIndex = getAnnotationIndex(shouldApplyAnnotationAt, texts.length);
|
|
49
42
|
return texts.map(function (value, index) {
|
|
50
43
|
if (annotateIndex === index) {
|
|
@@ -53,7 +46,6 @@ export var applyAnnotationOnText = function applyAnnotationOnText(_ref2) {
|
|
|
53
46
|
draftPosition: draftPosition
|
|
54
47
|
}, value);
|
|
55
48
|
}
|
|
56
|
-
|
|
57
49
|
return jsx(React.Fragment, {
|
|
58
50
|
key: index
|
|
59
51
|
}, value);
|
|
@@ -61,8 +53,8 @@ export var applyAnnotationOnText = function applyAnnotationOnText(_ref2) {
|
|
|
61
53
|
};
|
|
62
54
|
export var TextWithAnnotationDraft = function TextWithAnnotationDraft(_ref3) {
|
|
63
55
|
var startPos = _ref3.startPos,
|
|
64
|
-
|
|
65
|
-
|
|
56
|
+
endPos = _ref3.endPos,
|
|
57
|
+
children = _ref3.children;
|
|
66
58
|
var textPosition = React.useMemo(function () {
|
|
67
59
|
return {
|
|
68
60
|
start: startPos,
|
|
@@ -74,28 +66,22 @@ export var TextWithAnnotationDraft = function TextWithAnnotationDraft(_ref3) {
|
|
|
74
66
|
if (!nextDraftPosition) {
|
|
75
67
|
return false;
|
|
76
68
|
}
|
|
77
|
-
|
|
78
69
|
return calcInsertDraftPositionOnText(textPosition, nextDraftPosition);
|
|
79
70
|
}, [nextDraftPosition, textPosition]);
|
|
80
|
-
|
|
81
71
|
if (shouldApplyAnnotationAt === false || !nextDraftPosition) {
|
|
82
72
|
return jsx(Fragment, null, children);
|
|
83
73
|
}
|
|
84
|
-
|
|
85
74
|
if (shouldApplyAnnotationAt === InsertDraftPosition.AROUND_TEXT) {
|
|
86
75
|
return jsx(AnnotationDraft, {
|
|
87
76
|
key: 0,
|
|
88
77
|
draftPosition: nextDraftPosition
|
|
89
78
|
}, children);
|
|
90
79
|
}
|
|
91
|
-
|
|
92
80
|
var offsets = calcTextSplitOffset(nextDraftPosition, textPosition, children);
|
|
93
81
|
var texts = splitText(children, offsets);
|
|
94
|
-
|
|
95
82
|
if (!texts) {
|
|
96
83
|
return jsx(Fragment, null, children);
|
|
97
84
|
}
|
|
98
|
-
|
|
99
85
|
var components = applyAnnotationOnText({
|
|
100
86
|
texts: texts,
|
|
101
87
|
shouldApplyAnnotationAt: shouldApplyAnnotationAt,
|
|
@@ -2,36 +2,28 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
export var dataAttributes = function dataAttributes(_ref) {
|
|
4
4
|
var _ref2;
|
|
5
|
-
|
|
6
5
|
var from = _ref.from,
|
|
7
|
-
|
|
6
|
+
to = _ref.to;
|
|
8
7
|
return _ref2 = {}, _defineProperty(_ref2, 'data-annotation-draft-mark', true), _defineProperty(_ref2, 'data-draft-start-at', from), _defineProperty(_ref2, 'data-draft-end-at', to), _ref2;
|
|
9
8
|
};
|
|
10
|
-
|
|
11
9
|
var buildDataAttributesQuery = function buildDataAttributesQuery(pos) {
|
|
12
10
|
var a = dataAttributes(pos);
|
|
13
11
|
return Object.entries(a).map(function (_ref3) {
|
|
14
12
|
var _ref4 = _slicedToArray(_ref3, 2),
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
k = _ref4[0],
|
|
14
|
+
v = _ref4[1];
|
|
18
15
|
return "[".concat(k, "=\"").concat(v, "\"]");
|
|
19
16
|
}).join('');
|
|
20
17
|
};
|
|
21
|
-
|
|
22
18
|
export var updateWindowSelectionAroundDraft = function updateWindowSelectionAroundDraft(pos) {
|
|
23
19
|
var sel = window.getSelection();
|
|
24
|
-
|
|
25
20
|
if (!sel) {
|
|
26
21
|
return false;
|
|
27
22
|
}
|
|
28
|
-
|
|
29
23
|
var draftNodes = document.querySelectorAll(buildDataAttributesQuery(pos));
|
|
30
|
-
|
|
31
24
|
if (!draftNodes || draftNodes.length === 0) {
|
|
32
25
|
return false;
|
|
33
26
|
}
|
|
34
|
-
|
|
35
27
|
sel.removeAllRanges();
|
|
36
28
|
var range = document.createRange();
|
|
37
29
|
range.setStart(draftNodes[0], 0);
|
|
@@ -1,30 +1,22 @@
|
|
|
1
1
|
import { InsertDraftPosition } from '../types';
|
|
2
2
|
export var calcInsertDraftPositionOnText = function calcInsertDraftPositionOnText(_ref, position) {
|
|
3
3
|
var startTextPosition = _ref.start,
|
|
4
|
-
|
|
4
|
+
endTextPosition = _ref.end;
|
|
5
5
|
var isRangePositionAroundText = position.from <= startTextPosition && position.to >= endTextPosition;
|
|
6
|
-
|
|
7
6
|
if (isRangePositionAroundText) {
|
|
8
7
|
return InsertDraftPosition.AROUND_TEXT;
|
|
9
8
|
}
|
|
10
|
-
|
|
11
9
|
var isRangePositionInsideText = position.from > startTextPosition && position.from < endTextPosition && position.to < endTextPosition && position.to > startTextPosition;
|
|
12
|
-
|
|
13
10
|
if (isRangePositionInsideText) {
|
|
14
11
|
return InsertDraftPosition.INSIDE;
|
|
15
12
|
}
|
|
16
|
-
|
|
17
13
|
var isRangePositionStartingAtText = position.from >= startTextPosition && position.from <= endTextPosition && position.to >= endTextPosition;
|
|
18
|
-
|
|
19
14
|
if (isRangePositionStartingAtText) {
|
|
20
15
|
return InsertDraftPosition.END;
|
|
21
16
|
}
|
|
22
|
-
|
|
23
17
|
var isRangePositionEndingAtText = position.from <= startTextPosition && position.to >= startTextPosition && position.to <= endTextPosition;
|
|
24
|
-
|
|
25
18
|
if (isRangePositionEndingAtText) {
|
|
26
19
|
return InsertDraftPosition.START;
|
|
27
20
|
}
|
|
28
|
-
|
|
29
21
|
return false;
|
|
30
22
|
};
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
export var splitText = function splitText(text, _ref) {
|
|
2
2
|
var startOffset = _ref.startOffset,
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
endOffset = _ref.endOffset;
|
|
5
4
|
if (endOffset > text.length || endOffset - startOffset <= 0) {
|
|
6
5
|
return null;
|
|
7
6
|
}
|
|
8
|
-
|
|
9
7
|
return [text.slice(0, startOffset), text.slice(startOffset, endOffset), text.slice(endOffset)].filter(Boolean);
|
|
10
8
|
};
|
|
11
9
|
export var calcTextSplitOffset = function calcTextSplitOffset(position, textPosition, text) {
|
|
12
10
|
var start = textPosition.start,
|
|
13
|
-
|
|
11
|
+
end = textPosition.end;
|
|
14
12
|
var startOffset = Math.max(position.from - start, 0);
|
|
15
13
|
var endOffset = Math.min(Math.abs(end - position.to - text.length), text.length);
|
|
16
14
|
return {
|