@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
|
@@ -9,23 +9,20 @@ import { RemoveMarkStep } from 'prosemirror-transform';
|
|
|
9
9
|
import { createAnnotationStep, getPosFromRange } from '../steps';
|
|
10
10
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
|
|
11
11
|
import { getIndexMatch } from './matches-utils';
|
|
12
|
-
|
|
13
12
|
var RendererActions = /*#__PURE__*/function () {
|
|
14
13
|
// This is our psuedo feature flag for now
|
|
15
14
|
// This module can only be used when wrapped with
|
|
16
15
|
// the <RendererContext> component for now.
|
|
16
|
+
|
|
17
17
|
function RendererActions() {
|
|
18
18
|
var initFromContext = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
19
|
-
|
|
20
19
|
_classCallCheck(this, RendererActions);
|
|
21
|
-
|
|
22
20
|
_defineProperty(this, "initFromContext", false);
|
|
23
|
-
|
|
24
21
|
this.initFromContext = initFromContext;
|
|
25
22
|
this.transformer = new JSONTransformer();
|
|
26
|
-
}
|
|
27
|
-
|
|
23
|
+
}
|
|
28
24
|
|
|
25
|
+
//#region private
|
|
29
26
|
_createClass(RendererActions, [{
|
|
30
27
|
key: "_privateRegisterRenderer",
|
|
31
28
|
value: function _privateRegisterRenderer(ref, doc, schema, onAnalyticsEvent) {
|
|
@@ -36,7 +33,6 @@ var RendererActions = /*#__PURE__*/function () {
|
|
|
36
33
|
} else if (this.ref !== ref) {
|
|
37
34
|
throw new Error("Renderer has already been registered! It's not allowed to re-register with another new Renderer instance.");
|
|
38
35
|
}
|
|
39
|
-
|
|
40
36
|
this.doc = doc;
|
|
41
37
|
this.schema = schema;
|
|
42
38
|
this.onAnalyticsEvent = onAnalyticsEvent;
|
|
@@ -48,30 +44,28 @@ var RendererActions = /*#__PURE__*/function () {
|
|
|
48
44
|
this.ref = undefined;
|
|
49
45
|
this.schema = undefined;
|
|
50
46
|
}
|
|
47
|
+
|
|
51
48
|
/**
|
|
52
49
|
* Validate whether we can create an annotation between two positions
|
|
53
50
|
*/
|
|
54
|
-
|
|
55
51
|
}, {
|
|
56
52
|
key: "_privateValidatePositionsForAnnotation",
|
|
57
53
|
value: function _privateValidatePositionsForAnnotation(from, to) {
|
|
58
54
|
if (!this.doc || !this.schema) {
|
|
59
55
|
return false;
|
|
60
56
|
}
|
|
61
|
-
|
|
62
57
|
return canApplyAnnotationOnRange({
|
|
63
58
|
from: from,
|
|
64
59
|
to: to
|
|
65
60
|
}, this.doc, this.schema);
|
|
66
|
-
}
|
|
67
|
-
|
|
61
|
+
}
|
|
62
|
+
//#endregion
|
|
68
63
|
}, {
|
|
69
64
|
key: "deleteAnnotation",
|
|
70
65
|
value: function deleteAnnotation(annotationId, annotationType) {
|
|
71
66
|
if (!this.doc || !this.schema || !this.schema.marks.annotation) {
|
|
72
67
|
return false;
|
|
73
68
|
}
|
|
74
|
-
|
|
75
69
|
var mark = this.schema.marks.annotation.create({
|
|
76
70
|
id: annotationId,
|
|
77
71
|
annotationType: annotationType
|
|
@@ -80,7 +74,6 @@ var RendererActions = /*#__PURE__*/function () {
|
|
|
80
74
|
var to;
|
|
81
75
|
this.doc.descendants(function (node, pos) {
|
|
82
76
|
var found = mark.isInSet(node.marks);
|
|
83
|
-
|
|
84
77
|
if (found && !from) {
|
|
85
78
|
// Set both here incase it only spans one node.
|
|
86
79
|
from = pos;
|
|
@@ -90,20 +83,15 @@ var RendererActions = /*#__PURE__*/function () {
|
|
|
90
83
|
// we'll keep setting the end until no longer found.
|
|
91
84
|
to = pos + node.nodeSize;
|
|
92
85
|
}
|
|
93
|
-
|
|
94
86
|
return true;
|
|
95
87
|
});
|
|
96
|
-
|
|
97
88
|
if (from === undefined || to === undefined) {
|
|
98
89
|
return false;
|
|
99
90
|
}
|
|
100
|
-
|
|
101
91
|
var step = new RemoveMarkStep(from, to, mark);
|
|
102
|
-
|
|
103
92
|
var _step$apply = step.apply(this.doc),
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
93
|
+
doc = _step$apply.doc,
|
|
94
|
+
failed = _step$apply.failed;
|
|
107
95
|
if (this.onAnalyticsEvent) {
|
|
108
96
|
var payload = {
|
|
109
97
|
action: ACTION.DELETED,
|
|
@@ -113,14 +101,12 @@ var RendererActions = /*#__PURE__*/function () {
|
|
|
113
101
|
};
|
|
114
102
|
this.onAnalyticsEvent(payload);
|
|
115
103
|
}
|
|
116
|
-
|
|
117
104
|
if (!failed && doc) {
|
|
118
105
|
return {
|
|
119
106
|
step: step,
|
|
120
107
|
doc: this.transformer.encode(doc)
|
|
121
108
|
};
|
|
122
109
|
}
|
|
123
|
-
|
|
124
110
|
return false;
|
|
125
111
|
}
|
|
126
112
|
}, {
|
|
@@ -129,22 +115,16 @@ var RendererActions = /*#__PURE__*/function () {
|
|
|
129
115
|
if (!this.doc || !this.schema || !this.schema.marks.annotation) {
|
|
130
116
|
return false;
|
|
131
117
|
}
|
|
132
|
-
|
|
133
118
|
var pos = getPosFromRange(range);
|
|
134
|
-
|
|
135
119
|
if (!pos) {
|
|
136
120
|
return false;
|
|
137
121
|
}
|
|
138
|
-
|
|
139
122
|
var from = pos.from,
|
|
140
|
-
|
|
141
|
-
|
|
123
|
+
to = pos.to;
|
|
142
124
|
var validPositions = this._privateValidatePositionsForAnnotation(from, to);
|
|
143
|
-
|
|
144
125
|
if (!validPositions) {
|
|
145
126
|
return false;
|
|
146
127
|
}
|
|
147
|
-
|
|
148
128
|
return this.applyAnnotation(pos, {
|
|
149
129
|
annotationId: annotationId,
|
|
150
130
|
annotationType: AnnotationTypes.INLINE_COMMENT
|
|
@@ -154,11 +134,9 @@ var RendererActions = /*#__PURE__*/function () {
|
|
|
154
134
|
key: "isValidAnnotationRange",
|
|
155
135
|
value: function isValidAnnotationRange(range) {
|
|
156
136
|
var pos = getPosFromRange(range);
|
|
157
|
-
|
|
158
137
|
if (!pos || !this.doc) {
|
|
159
138
|
return false;
|
|
160
139
|
}
|
|
161
|
-
|
|
162
140
|
return this._privateValidatePositionsForAnnotation(pos.from, pos.to);
|
|
163
141
|
}
|
|
164
142
|
}, {
|
|
@@ -167,7 +145,6 @@ var RendererActions = /*#__PURE__*/function () {
|
|
|
167
145
|
if (!pos || !this.doc) {
|
|
168
146
|
return false;
|
|
169
147
|
}
|
|
170
|
-
|
|
171
148
|
return this._privateValidatePositionsForAnnotation(pos.from, pos.to);
|
|
172
149
|
}
|
|
173
150
|
}, {
|
|
@@ -176,35 +153,28 @@ var RendererActions = /*#__PURE__*/function () {
|
|
|
176
153
|
if (!this.doc || !this.schema) {
|
|
177
154
|
return false;
|
|
178
155
|
}
|
|
179
|
-
|
|
180
156
|
return getPosFromRange(range);
|
|
181
157
|
}
|
|
182
158
|
}, {
|
|
183
159
|
key: "getAnnotationMarks",
|
|
184
160
|
value: function getAnnotationMarks() {
|
|
185
161
|
var schema = this.schema,
|
|
186
|
-
|
|
187
|
-
|
|
162
|
+
doc = this.doc;
|
|
188
163
|
if (!schema || !doc) {
|
|
189
164
|
return [];
|
|
190
165
|
}
|
|
191
|
-
|
|
192
166
|
var annotationMarkType = schema.marks.annotation;
|
|
193
|
-
|
|
194
167
|
if (!annotationMarkType) {
|
|
195
168
|
return [];
|
|
196
169
|
}
|
|
197
|
-
|
|
198
170
|
var marks = [];
|
|
199
171
|
doc.descendants(function (node) {
|
|
200
172
|
var annotationsMark = node.marks.filter(function (m) {
|
|
201
173
|
return m.type === annotationMarkType;
|
|
202
174
|
});
|
|
203
|
-
|
|
204
175
|
if (!annotationsMark || !annotationsMark.length) {
|
|
205
176
|
return true;
|
|
206
177
|
}
|
|
207
|
-
|
|
208
178
|
marks.push.apply(marks, _toConsumableArray(annotationsMark));
|
|
209
179
|
return false;
|
|
210
180
|
});
|
|
@@ -220,13 +190,10 @@ var RendererActions = /*#__PURE__*/function () {
|
|
|
220
190
|
if (!this.doc || !this.schema) {
|
|
221
191
|
return [];
|
|
222
192
|
}
|
|
223
|
-
|
|
224
193
|
var pos = getPosFromRange(range);
|
|
225
|
-
|
|
226
194
|
if (!pos || !this.doc) {
|
|
227
195
|
return [];
|
|
228
196
|
}
|
|
229
|
-
|
|
230
197
|
return getAnnotationIdsFromRange(pos, this.doc, this.schema);
|
|
231
198
|
}
|
|
232
199
|
}, {
|
|
@@ -235,31 +202,25 @@ var RendererActions = /*#__PURE__*/function () {
|
|
|
235
202
|
if (!this.doc || !pos || !this.schema) {
|
|
236
203
|
return false;
|
|
237
204
|
}
|
|
238
|
-
|
|
239
205
|
var from = pos.from,
|
|
240
|
-
|
|
206
|
+
to = pos.to;
|
|
241
207
|
var annotationId = annotation.annotationId,
|
|
242
|
-
|
|
208
|
+
annotationType = annotation.annotationType;
|
|
243
209
|
var step = createAnnotationStep(from, to, {
|
|
244
210
|
annotationId: annotationId,
|
|
245
211
|
annotationType: annotationType,
|
|
246
212
|
schema: this.schema
|
|
247
213
|
});
|
|
248
|
-
|
|
249
214
|
var _step$apply2 = step.apply(this.doc),
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
215
|
+
doc = _step$apply2.doc,
|
|
216
|
+
failed = _step$apply2.failed;
|
|
253
217
|
if (failed || !doc) {
|
|
254
218
|
return false;
|
|
255
219
|
}
|
|
256
|
-
|
|
257
220
|
var originalSelection = doc.textBetween(from, to);
|
|
258
|
-
|
|
259
221
|
var _getIndexMatch = getIndexMatch(this.doc, this.schema, originalSelection, from),
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
222
|
+
numMatches = _getIndexMatch.numMatches,
|
|
223
|
+
matchIndex = _getIndexMatch.matchIndex;
|
|
263
224
|
return {
|
|
264
225
|
step: step,
|
|
265
226
|
doc: this.transformer.encode(doc),
|
|
@@ -274,15 +235,12 @@ var RendererActions = /*#__PURE__*/function () {
|
|
|
274
235
|
if (!this.doc || !pos || !this.schema) {
|
|
275
236
|
return false;
|
|
276
237
|
}
|
|
277
|
-
|
|
278
238
|
var from = pos.from,
|
|
279
|
-
|
|
239
|
+
to = pos.to;
|
|
280
240
|
var originalSelection = this.doc.textBetween(from, to);
|
|
281
|
-
|
|
282
241
|
var _getIndexMatch2 = getIndexMatch(this.doc, this.schema, originalSelection, from),
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
242
|
+
numMatches = _getIndexMatch2.numMatches,
|
|
243
|
+
matchIndex = _getIndexMatch2.matchIndex;
|
|
286
244
|
return {
|
|
287
245
|
originalSelection: originalSelection,
|
|
288
246
|
numMatches: numMatches,
|
|
@@ -290,8 +248,6 @@ var RendererActions = /*#__PURE__*/function () {
|
|
|
290
248
|
};
|
|
291
249
|
}
|
|
292
250
|
}]);
|
|
293
|
-
|
|
294
251
|
return RendererActions;
|
|
295
252
|
}();
|
|
296
|
-
|
|
297
253
|
export { RendererActions as default };
|
|
@@ -11,38 +11,39 @@ export function getIndexMatch(doc, schema, selectedText, startIndex) {
|
|
|
11
11
|
// Eg: panel (invalid) > p (valid)
|
|
12
12
|
return true;
|
|
13
13
|
}
|
|
14
|
-
|
|
15
14
|
var nodeStart = pos;
|
|
16
|
-
var nodeEnd = nodeStart + node.nodeSize;
|
|
15
|
+
var nodeEnd = nodeStart + node.nodeSize;
|
|
17
16
|
|
|
17
|
+
// If the start of the annotation selection is within the current node, we scan the document for previous occurrences
|
|
18
18
|
if (startIndex >= nodeStart && startIndex <= nodeEnd) {
|
|
19
19
|
// Find the index by counting all previous instances of the selectedText in the partial textContent
|
|
20
20
|
// Need to scan from start, up to `startIndex` (which includes partial of the current node)
|
|
21
21
|
textContent += doc.textBetween(nodeStart, startIndex - 1);
|
|
22
|
-
matchIndex = countMatches(textContent, selectedText);
|
|
22
|
+
matchIndex = countMatches(textContent, selectedText);
|
|
23
23
|
|
|
24
|
+
// Complete appending of the node
|
|
24
25
|
textContent += doc.textBetween(startIndex, nodeEnd);
|
|
25
26
|
} else {
|
|
26
27
|
textContent += node.textContent;
|
|
27
28
|
}
|
|
28
|
-
|
|
29
29
|
return true;
|
|
30
|
-
});
|
|
30
|
+
});
|
|
31
31
|
|
|
32
|
+
// Count total number of matches in final text
|
|
32
33
|
var numMatches = countMatches(textContent, selectedText);
|
|
33
34
|
return {
|
|
34
35
|
numMatches: numMatches,
|
|
35
36
|
matchIndex: matchIndex,
|
|
36
37
|
textContent: textContent
|
|
37
38
|
};
|
|
38
|
-
}
|
|
39
|
+
}
|
|
39
40
|
|
|
41
|
+
// countMatches finds the total number of occurrences of `query` within a given `searchString`
|
|
40
42
|
export function countMatches(searchString, query) {
|
|
41
43
|
if (searchString === '' || query === '') {
|
|
42
44
|
return 0;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
}
|
|
46
|
+
// Escape characters that would trigger as syntax in a regex query before converting to the query
|
|
46
47
|
var reg = new RegExp(query.replace(/(?=[.\\+*?[^\]$(){}\|])/g, '\\'), 'g');
|
|
47
48
|
return (searchString.match(reg) || []).length;
|
|
48
49
|
}
|
package/dist/esm/actions.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { RendererActionsContext, RendererActionsContextConsumer } from './ui/RendererActionsContext';
|
|
2
|
-
import { WithRendererActions } from './ui/RendererActionsContext/WithRendererActions';
|
|
2
|
+
import { WithRendererActions } from './ui/RendererActionsContext/WithRendererActions';
|
|
3
3
|
|
|
4
|
+
// This file exists purely as an entry point, until they are configurable.
|
|
4
5
|
export { RendererActionsContext, RendererActionsContextConsumer, WithRendererActions };
|
|
@@ -1,20 +1,15 @@
|
|
|
1
1
|
export var PLATFORM;
|
|
2
|
-
|
|
3
2
|
(function (PLATFORM) {
|
|
4
3
|
PLATFORM["NATIVE"] = "mobileNative";
|
|
5
4
|
PLATFORM["HYBRID"] = "mobileHybrid";
|
|
6
5
|
PLATFORM["WEB"] = "web";
|
|
7
6
|
})(PLATFORM || (PLATFORM = {}));
|
|
8
|
-
|
|
9
7
|
export var MODE;
|
|
10
|
-
|
|
11
8
|
(function (MODE) {
|
|
12
9
|
MODE["RENDERER"] = "renderer";
|
|
13
10
|
MODE["EDITOR"] = "editor";
|
|
14
11
|
})(MODE || (MODE = {}));
|
|
15
|
-
|
|
16
12
|
export var RESOLVE_METHOD;
|
|
17
|
-
|
|
18
13
|
(function (RESOLVE_METHOD) {
|
|
19
14
|
RESOLVE_METHOD["COMPONENT"] = "component";
|
|
20
15
|
RESOLVE_METHOD["CONSUMER"] = "consumer";
|
|
@@ -2,16 +2,14 @@ import { getUnsupportedContentLevelData, getAnalyticsAppearance } from '@atlaski
|
|
|
2
2
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import { PLATFORM } from './events';
|
|
4
4
|
var rendersMap = {};
|
|
5
|
-
|
|
6
5
|
var processLevelsAndTrack = function processLevelsAndTrack(item, thresholds, dispatchAnalyticsEvent) {
|
|
7
6
|
try {
|
|
8
7
|
var _getUnsupportedConten = getUnsupportedContentLevelData(item.doc, thresholds),
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
severity = _getUnsupportedConten.severity,
|
|
9
|
+
percentage = _getUnsupportedConten.percentage,
|
|
10
|
+
_getUnsupportedConten2 = _getUnsupportedConten.counts,
|
|
11
|
+
supportedNodes = _getUnsupportedConten2.supportedNodes,
|
|
12
|
+
unsupportedNodes = _getUnsupportedConten2.unsupportedNodes;
|
|
15
13
|
dispatchAnalyticsEvent({
|
|
16
14
|
action: ACTION.UNSUPPORTED_CONTENT_LEVELS_TRACKING_SUCCEEDED,
|
|
17
15
|
actionSubject: ACTION_SUBJECT.RENDERER,
|
|
@@ -37,7 +35,6 @@ var processLevelsAndTrack = function processLevelsAndTrack(item, thresholds, dis
|
|
|
37
35
|
});
|
|
38
36
|
}
|
|
39
37
|
};
|
|
40
|
-
|
|
41
38
|
var schedule = function schedule(fn) {
|
|
42
39
|
if (typeof window.requestIdleCallback === 'function') {
|
|
43
40
|
window.requestIdleCallback(fn);
|
|
@@ -45,37 +42,33 @@ var schedule = function schedule(fn) {
|
|
|
45
42
|
setTimeout(fn, 0);
|
|
46
43
|
}
|
|
47
44
|
};
|
|
48
|
-
|
|
49
45
|
var DEFAULT_SAMPLING_RATE = 100;
|
|
50
46
|
export var trackUnsupportedContentLevels = function trackUnsupportedContentLevels(item, trackingOptions, dispatchAnalyticsEvent) {
|
|
51
47
|
var _item$appearance;
|
|
52
|
-
|
|
53
48
|
var thresholds = trackingOptions.thresholds,
|
|
54
|
-
|
|
49
|
+
samplingRates = trackingOptions.samplingRates;
|
|
55
50
|
var appearance = (_item$appearance = item.appearance) !== null && _item$appearance !== void 0 ? _item$appearance : 'unknown';
|
|
56
|
-
|
|
57
51
|
if (!rendersMap[appearance]) {
|
|
58
52
|
rendersMap[appearance] = new Set();
|
|
59
|
-
}
|
|
60
|
-
|
|
53
|
+
}
|
|
61
54
|
|
|
55
|
+
// bail out if already processed a render from a given renderer instance
|
|
62
56
|
var didProcessRenderer = rendersMap[appearance].has(item.rendererId);
|
|
63
|
-
|
|
64
57
|
if (didProcessRenderer) {
|
|
65
58
|
return;
|
|
66
|
-
}
|
|
67
|
-
|
|
59
|
+
}
|
|
68
60
|
|
|
61
|
+
// otherwise track the render
|
|
69
62
|
rendersMap[appearance].add(item.rendererId);
|
|
70
|
-
var sampleRate = samplingRates && samplingRates[appearance] || DEFAULT_SAMPLING_RATE;
|
|
63
|
+
var sampleRate = samplingRates && samplingRates[appearance] || DEFAULT_SAMPLING_RATE;
|
|
71
64
|
|
|
65
|
+
// sample from the first available tracked render
|
|
72
66
|
if (rendersMap[appearance].size === 1) {
|
|
73
67
|
schedule(function () {
|
|
74
68
|
return processLevelsAndTrack(item, thresholds, dispatchAnalyticsEvent);
|
|
75
69
|
});
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
70
|
+
}
|
|
71
|
+
// cleanup/refresh tracked renders at the sampling rate
|
|
79
72
|
if (rendersMap[appearance].size % sampleRate === 0) {
|
|
80
73
|
rendersMap[appearance] = new Set();
|
|
81
74
|
}
|
|
@@ -5,14 +5,13 @@ import { codeBidiWarningMessages } from '@atlaskit/editor-common/messages';
|
|
|
5
5
|
import codeBidiWarningDecorator from '@atlaskit/code/bidi-warning-decorator';
|
|
6
6
|
export var useBidiWarnings = function useBidiWarnings(_ref) {
|
|
7
7
|
var _ref$enableWarningToo = _ref.enableWarningTooltip,
|
|
8
|
-
|
|
8
|
+
enableWarningTooltip = _ref$enableWarningToo === void 0 ? true : _ref$enableWarningToo;
|
|
9
9
|
var intl = useIntl();
|
|
10
10
|
var warningLabel = intl.formatMessage(codeBidiWarningMessages.label);
|
|
11
|
-
|
|
12
11
|
var renderBidiWarnings = function renderBidiWarnings(text) {
|
|
13
12
|
return codeBidiWarningDecorator(text, function (_ref2) {
|
|
14
13
|
var bidiCharacter = _ref2.bidiCharacter,
|
|
15
|
-
|
|
14
|
+
index = _ref2.index;
|
|
16
15
|
return /*#__PURE__*/React.createElement(CodeBidiWarning, {
|
|
17
16
|
bidiCharacter: bidiCharacter,
|
|
18
17
|
key: index,
|
|
@@ -21,7 +20,6 @@ export var useBidiWarnings = function useBidiWarnings(_ref) {
|
|
|
21
20
|
});
|
|
22
21
|
});
|
|
23
22
|
};
|
|
24
|
-
|
|
25
23
|
return {
|
|
26
24
|
renderBidiWarnings: renderBidiWarnings,
|
|
27
25
|
warningLabel: warningLabel
|
|
@@ -1,34 +1,25 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
|
|
3
2
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
4
|
-
|
|
5
3
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
|
-
|
|
7
4
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
8
|
-
|
|
9
5
|
import { useEffect, useRef, useState } from 'react';
|
|
10
6
|
export var useInViewport = function useInViewport() {
|
|
11
7
|
var trackingRef = useRef(null);
|
|
12
|
-
|
|
13
8
|
var _useState = useState(false),
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
10
|
+
isInViewport = _useState2[0],
|
|
11
|
+
setIsInViewport = _useState2[1];
|
|
18
12
|
useEffect(function () {
|
|
19
13
|
if (!trackingRef || !(trackingRef !== null && trackingRef !== void 0 && trackingRef.current)) {
|
|
20
14
|
return;
|
|
21
15
|
}
|
|
22
|
-
|
|
23
16
|
var target = trackingRef.current;
|
|
24
17
|
var observer = new IntersectionObserver(function (entries) {
|
|
25
18
|
var _iterator = _createForOfIteratorHelper(entries),
|
|
26
|
-
|
|
27
|
-
|
|
19
|
+
_step;
|
|
28
20
|
try {
|
|
29
21
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
30
22
|
var entry = _step.value;
|
|
31
|
-
|
|
32
23
|
if (entry.isIntersecting) {
|
|
33
24
|
setIsInViewport(true);
|
|
34
25
|
}
|
|
@@ -1,43 +1,35 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
|
|
3
2
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
4
|
-
|
|
5
3
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
|
-
|
|
7
4
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
8
|
-
|
|
9
5
|
import React from 'react';
|
|
10
6
|
var resizeObserver;
|
|
11
7
|
var nodeToCallback = new WeakMap();
|
|
12
8
|
export var useObservedWidth = function useObservedWidth(node, useObservedWidthFlag) {
|
|
13
9
|
var _React$useState = React.useState({
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
10
|
+
x: 0,
|
|
11
|
+
y: 0,
|
|
12
|
+
width: 0,
|
|
13
|
+
height: 0,
|
|
14
|
+
top: 0,
|
|
15
|
+
left: 0,
|
|
16
|
+
bottom: 0,
|
|
17
|
+
right: 0
|
|
18
|
+
}),
|
|
19
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
20
|
+
rect = _React$useState2[0],
|
|
21
|
+
setRect = _React$useState2[1];
|
|
27
22
|
React.useEffect(function () {
|
|
28
23
|
if (!node || !useObservedWidthFlag) {
|
|
29
24
|
return;
|
|
30
25
|
}
|
|
31
|
-
|
|
32
26
|
if (!resizeObserver) {
|
|
33
27
|
resizeObserver = new ResizeObserver(function (entries) {
|
|
34
28
|
var _iterator = _createForOfIteratorHelper(entries),
|
|
35
|
-
|
|
36
|
-
|
|
29
|
+
_step;
|
|
37
30
|
try {
|
|
38
31
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
39
32
|
var entry = _step.value;
|
|
40
|
-
|
|
41
33
|
if (nodeToCallback.has(entry.target)) {
|
|
42
34
|
nodeToCallback.get(entry.target)(entry.contentRect);
|
|
43
35
|
}
|
|
@@ -49,16 +41,15 @@ export var useObservedWidth = function useObservedWidth(node, useObservedWidthFl
|
|
|
49
41
|
}
|
|
50
42
|
});
|
|
51
43
|
}
|
|
52
|
-
|
|
53
44
|
nodeToCallback.set(node, function (rect) {
|
|
54
45
|
var x = rect.x,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
46
|
+
y = rect.y,
|
|
47
|
+
width = rect.width,
|
|
48
|
+
height = rect.height,
|
|
49
|
+
top = rect.top,
|
|
50
|
+
left = rect.left,
|
|
51
|
+
bottom = rect.bottom,
|
|
52
|
+
right = rect.right;
|
|
62
53
|
return setRect({
|
|
63
54
|
x: x,
|
|
64
55
|
y: y,
|