@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
package/CHANGELOG.md
CHANGED
|
@@ -1,47 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
|
-
|
|
12
9
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
-
|
|
14
10
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
15
|
-
|
|
16
11
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
17
|
-
|
|
18
12
|
var _editorJsonTransformer = require("@atlaskit/editor-json-transformer");
|
|
19
|
-
|
|
20
13
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
21
|
-
|
|
22
14
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
23
|
-
|
|
24
15
|
var _prosemirrorTransform = require("prosemirror-transform");
|
|
25
|
-
|
|
26
16
|
var _steps = require("../steps");
|
|
27
|
-
|
|
28
17
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
29
|
-
|
|
30
18
|
var _matchesUtils = require("./matches-utils");
|
|
31
|
-
|
|
32
19
|
var RendererActions = /*#__PURE__*/function () {
|
|
33
20
|
// This is our psuedo feature flag for now
|
|
34
21
|
// This module can only be used when wrapped with
|
|
35
22
|
// the <RendererContext> component for now.
|
|
23
|
+
|
|
36
24
|
function RendererActions() {
|
|
37
25
|
var initFromContext = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
38
26
|
(0, _classCallCheck2.default)(this, RendererActions);
|
|
39
27
|
(0, _defineProperty2.default)(this, "initFromContext", false);
|
|
40
28
|
this.initFromContext = initFromContext;
|
|
41
29
|
this.transformer = new _editorJsonTransformer.JSONTransformer();
|
|
42
|
-
}
|
|
43
|
-
|
|
30
|
+
}
|
|
44
31
|
|
|
32
|
+
//#region private
|
|
45
33
|
(0, _createClass2.default)(RendererActions, [{
|
|
46
34
|
key: "_privateRegisterRenderer",
|
|
47
35
|
value: function _privateRegisterRenderer(ref, doc, schema, onAnalyticsEvent) {
|
|
@@ -52,7 +40,6 @@ var RendererActions = /*#__PURE__*/function () {
|
|
|
52
40
|
} else if (this.ref !== ref) {
|
|
53
41
|
throw new Error("Renderer has already been registered! It's not allowed to re-register with another new Renderer instance.");
|
|
54
42
|
}
|
|
55
|
-
|
|
56
43
|
this.doc = doc;
|
|
57
44
|
this.schema = schema;
|
|
58
45
|
this.onAnalyticsEvent = onAnalyticsEvent;
|
|
@@ -64,30 +51,28 @@ var RendererActions = /*#__PURE__*/function () {
|
|
|
64
51
|
this.ref = undefined;
|
|
65
52
|
this.schema = undefined;
|
|
66
53
|
}
|
|
54
|
+
|
|
67
55
|
/**
|
|
68
56
|
* Validate whether we can create an annotation between two positions
|
|
69
57
|
*/
|
|
70
|
-
|
|
71
58
|
}, {
|
|
72
59
|
key: "_privateValidatePositionsForAnnotation",
|
|
73
60
|
value: function _privateValidatePositionsForAnnotation(from, to) {
|
|
74
61
|
if (!this.doc || !this.schema) {
|
|
75
62
|
return false;
|
|
76
63
|
}
|
|
77
|
-
|
|
78
64
|
return (0, _utils.canApplyAnnotationOnRange)({
|
|
79
65
|
from: from,
|
|
80
66
|
to: to
|
|
81
67
|
}, this.doc, this.schema);
|
|
82
|
-
}
|
|
83
|
-
|
|
68
|
+
}
|
|
69
|
+
//#endregion
|
|
84
70
|
}, {
|
|
85
71
|
key: "deleteAnnotation",
|
|
86
72
|
value: function deleteAnnotation(annotationId, annotationType) {
|
|
87
73
|
if (!this.doc || !this.schema || !this.schema.marks.annotation) {
|
|
88
74
|
return false;
|
|
89
75
|
}
|
|
90
|
-
|
|
91
76
|
var mark = this.schema.marks.annotation.create({
|
|
92
77
|
id: annotationId,
|
|
93
78
|
annotationType: annotationType
|
|
@@ -96,7 +81,6 @@ var RendererActions = /*#__PURE__*/function () {
|
|
|
96
81
|
var to;
|
|
97
82
|
this.doc.descendants(function (node, pos) {
|
|
98
83
|
var found = mark.isInSet(node.marks);
|
|
99
|
-
|
|
100
84
|
if (found && !from) {
|
|
101
85
|
// Set both here incase it only spans one node.
|
|
102
86
|
from = pos;
|
|
@@ -106,20 +90,15 @@ var RendererActions = /*#__PURE__*/function () {
|
|
|
106
90
|
// we'll keep setting the end until no longer found.
|
|
107
91
|
to = pos + node.nodeSize;
|
|
108
92
|
}
|
|
109
|
-
|
|
110
93
|
return true;
|
|
111
94
|
});
|
|
112
|
-
|
|
113
95
|
if (from === undefined || to === undefined) {
|
|
114
96
|
return false;
|
|
115
97
|
}
|
|
116
|
-
|
|
117
98
|
var step = new _prosemirrorTransform.RemoveMarkStep(from, to, mark);
|
|
118
|
-
|
|
119
99
|
var _step$apply = step.apply(this.doc),
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
100
|
+
doc = _step$apply.doc,
|
|
101
|
+
failed = _step$apply.failed;
|
|
123
102
|
if (this.onAnalyticsEvent) {
|
|
124
103
|
var payload = {
|
|
125
104
|
action: _analytics.ACTION.DELETED,
|
|
@@ -129,14 +108,12 @@ var RendererActions = /*#__PURE__*/function () {
|
|
|
129
108
|
};
|
|
130
109
|
this.onAnalyticsEvent(payload);
|
|
131
110
|
}
|
|
132
|
-
|
|
133
111
|
if (!failed && doc) {
|
|
134
112
|
return {
|
|
135
113
|
step: step,
|
|
136
114
|
doc: this.transformer.encode(doc)
|
|
137
115
|
};
|
|
138
116
|
}
|
|
139
|
-
|
|
140
117
|
return false;
|
|
141
118
|
}
|
|
142
119
|
}, {
|
|
@@ -145,22 +122,16 @@ var RendererActions = /*#__PURE__*/function () {
|
|
|
145
122
|
if (!this.doc || !this.schema || !this.schema.marks.annotation) {
|
|
146
123
|
return false;
|
|
147
124
|
}
|
|
148
|
-
|
|
149
125
|
var pos = (0, _steps.getPosFromRange)(range);
|
|
150
|
-
|
|
151
126
|
if (!pos) {
|
|
152
127
|
return false;
|
|
153
128
|
}
|
|
154
|
-
|
|
155
129
|
var from = pos.from,
|
|
156
|
-
|
|
157
|
-
|
|
130
|
+
to = pos.to;
|
|
158
131
|
var validPositions = this._privateValidatePositionsForAnnotation(from, to);
|
|
159
|
-
|
|
160
132
|
if (!validPositions) {
|
|
161
133
|
return false;
|
|
162
134
|
}
|
|
163
|
-
|
|
164
135
|
return this.applyAnnotation(pos, {
|
|
165
136
|
annotationId: annotationId,
|
|
166
137
|
annotationType: _adfSchema.AnnotationTypes.INLINE_COMMENT
|
|
@@ -170,11 +141,9 @@ var RendererActions = /*#__PURE__*/function () {
|
|
|
170
141
|
key: "isValidAnnotationRange",
|
|
171
142
|
value: function isValidAnnotationRange(range) {
|
|
172
143
|
var pos = (0, _steps.getPosFromRange)(range);
|
|
173
|
-
|
|
174
144
|
if (!pos || !this.doc) {
|
|
175
145
|
return false;
|
|
176
146
|
}
|
|
177
|
-
|
|
178
147
|
return this._privateValidatePositionsForAnnotation(pos.from, pos.to);
|
|
179
148
|
}
|
|
180
149
|
}, {
|
|
@@ -183,7 +152,6 @@ var RendererActions = /*#__PURE__*/function () {
|
|
|
183
152
|
if (!pos || !this.doc) {
|
|
184
153
|
return false;
|
|
185
154
|
}
|
|
186
|
-
|
|
187
155
|
return this._privateValidatePositionsForAnnotation(pos.from, pos.to);
|
|
188
156
|
}
|
|
189
157
|
}, {
|
|
@@ -192,35 +160,28 @@ var RendererActions = /*#__PURE__*/function () {
|
|
|
192
160
|
if (!this.doc || !this.schema) {
|
|
193
161
|
return false;
|
|
194
162
|
}
|
|
195
|
-
|
|
196
163
|
return (0, _steps.getPosFromRange)(range);
|
|
197
164
|
}
|
|
198
165
|
}, {
|
|
199
166
|
key: "getAnnotationMarks",
|
|
200
167
|
value: function getAnnotationMarks() {
|
|
201
168
|
var schema = this.schema,
|
|
202
|
-
|
|
203
|
-
|
|
169
|
+
doc = this.doc;
|
|
204
170
|
if (!schema || !doc) {
|
|
205
171
|
return [];
|
|
206
172
|
}
|
|
207
|
-
|
|
208
173
|
var annotationMarkType = schema.marks.annotation;
|
|
209
|
-
|
|
210
174
|
if (!annotationMarkType) {
|
|
211
175
|
return [];
|
|
212
176
|
}
|
|
213
|
-
|
|
214
177
|
var marks = [];
|
|
215
178
|
doc.descendants(function (node) {
|
|
216
179
|
var annotationsMark = node.marks.filter(function (m) {
|
|
217
180
|
return m.type === annotationMarkType;
|
|
218
181
|
});
|
|
219
|
-
|
|
220
182
|
if (!annotationsMark || !annotationsMark.length) {
|
|
221
183
|
return true;
|
|
222
184
|
}
|
|
223
|
-
|
|
224
185
|
marks.push.apply(marks, (0, _toConsumableArray2.default)(annotationsMark));
|
|
225
186
|
return false;
|
|
226
187
|
});
|
|
@@ -236,13 +197,10 @@ var RendererActions = /*#__PURE__*/function () {
|
|
|
236
197
|
if (!this.doc || !this.schema) {
|
|
237
198
|
return [];
|
|
238
199
|
}
|
|
239
|
-
|
|
240
200
|
var pos = (0, _steps.getPosFromRange)(range);
|
|
241
|
-
|
|
242
201
|
if (!pos || !this.doc) {
|
|
243
202
|
return [];
|
|
244
203
|
}
|
|
245
|
-
|
|
246
204
|
return (0, _utils.getAnnotationIdsFromRange)(pos, this.doc, this.schema);
|
|
247
205
|
}
|
|
248
206
|
}, {
|
|
@@ -251,31 +209,25 @@ var RendererActions = /*#__PURE__*/function () {
|
|
|
251
209
|
if (!this.doc || !pos || !this.schema) {
|
|
252
210
|
return false;
|
|
253
211
|
}
|
|
254
|
-
|
|
255
212
|
var from = pos.from,
|
|
256
|
-
|
|
213
|
+
to = pos.to;
|
|
257
214
|
var annotationId = annotation.annotationId,
|
|
258
|
-
|
|
215
|
+
annotationType = annotation.annotationType;
|
|
259
216
|
var step = (0, _steps.createAnnotationStep)(from, to, {
|
|
260
217
|
annotationId: annotationId,
|
|
261
218
|
annotationType: annotationType,
|
|
262
219
|
schema: this.schema
|
|
263
220
|
});
|
|
264
|
-
|
|
265
221
|
var _step$apply2 = step.apply(this.doc),
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
222
|
+
doc = _step$apply2.doc,
|
|
223
|
+
failed = _step$apply2.failed;
|
|
269
224
|
if (failed || !doc) {
|
|
270
225
|
return false;
|
|
271
226
|
}
|
|
272
|
-
|
|
273
227
|
var originalSelection = doc.textBetween(from, to);
|
|
274
|
-
|
|
275
228
|
var _getIndexMatch = (0, _matchesUtils.getIndexMatch)(this.doc, this.schema, originalSelection, from),
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
229
|
+
numMatches = _getIndexMatch.numMatches,
|
|
230
|
+
matchIndex = _getIndexMatch.matchIndex;
|
|
279
231
|
return {
|
|
280
232
|
step: step,
|
|
281
233
|
doc: this.transformer.encode(doc),
|
|
@@ -290,15 +242,12 @@ var RendererActions = /*#__PURE__*/function () {
|
|
|
290
242
|
if (!this.doc || !pos || !this.schema) {
|
|
291
243
|
return false;
|
|
292
244
|
}
|
|
293
|
-
|
|
294
245
|
var from = pos.from,
|
|
295
|
-
|
|
246
|
+
to = pos.to;
|
|
296
247
|
var originalSelection = this.doc.textBetween(from, to);
|
|
297
|
-
|
|
298
248
|
var _getIndexMatch2 = (0, _matchesUtils.getIndexMatch)(this.doc, this.schema, originalSelection, from),
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
249
|
+
numMatches = _getIndexMatch2.numMatches,
|
|
250
|
+
matchIndex = _getIndexMatch2.matchIndex;
|
|
302
251
|
return {
|
|
303
252
|
originalSelection: originalSelection,
|
|
304
253
|
numMatches: numMatches,
|
|
@@ -308,5 +257,4 @@ var RendererActions = /*#__PURE__*/function () {
|
|
|
308
257
|
}]);
|
|
309
258
|
return RendererActions;
|
|
310
259
|
}();
|
|
311
|
-
|
|
312
260
|
exports.default = RendererActions;
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.countMatches = countMatches;
|
|
7
7
|
exports.getIndexMatch = getIndexMatch;
|
|
8
|
-
|
|
9
8
|
// getIndexMatch finds the position of a given string within a given document, in accordance to the Confluence Annotation backend
|
|
10
9
|
// The document is serialised into one large string, excluding any nodes that can not have annotations (eg: emojis, media).
|
|
11
10
|
// Finds where the given query string is relative to the serialised partial document
|
|
@@ -19,39 +18,39 @@ function getIndexMatch(doc, schema, selectedText, startIndex) {
|
|
|
19
18
|
// Eg: panel (invalid) > p (valid)
|
|
20
19
|
return true;
|
|
21
20
|
}
|
|
22
|
-
|
|
23
21
|
var nodeStart = pos;
|
|
24
|
-
var nodeEnd = nodeStart + node.nodeSize;
|
|
22
|
+
var nodeEnd = nodeStart + node.nodeSize;
|
|
25
23
|
|
|
24
|
+
// If the start of the annotation selection is within the current node, we scan the document for previous occurrences
|
|
26
25
|
if (startIndex >= nodeStart && startIndex <= nodeEnd) {
|
|
27
26
|
// Find the index by counting all previous instances of the selectedText in the partial textContent
|
|
28
27
|
// Need to scan from start, up to `startIndex` (which includes partial of the current node)
|
|
29
28
|
textContent += doc.textBetween(nodeStart, startIndex - 1);
|
|
30
|
-
matchIndex = countMatches(textContent, selectedText);
|
|
29
|
+
matchIndex = countMatches(textContent, selectedText);
|
|
31
30
|
|
|
31
|
+
// Complete appending of the node
|
|
32
32
|
textContent += doc.textBetween(startIndex, nodeEnd);
|
|
33
33
|
} else {
|
|
34
34
|
textContent += node.textContent;
|
|
35
35
|
}
|
|
36
|
-
|
|
37
36
|
return true;
|
|
38
|
-
});
|
|
37
|
+
});
|
|
39
38
|
|
|
39
|
+
// Count total number of matches in final text
|
|
40
40
|
var numMatches = countMatches(textContent, selectedText);
|
|
41
41
|
return {
|
|
42
42
|
numMatches: numMatches,
|
|
43
43
|
matchIndex: matchIndex,
|
|
44
44
|
textContent: textContent
|
|
45
45
|
};
|
|
46
|
-
}
|
|
47
|
-
|
|
46
|
+
}
|
|
48
47
|
|
|
48
|
+
// countMatches finds the total number of occurrences of `query` within a given `searchString`
|
|
49
49
|
function countMatches(searchString, query) {
|
|
50
50
|
if (searchString === '' || query === '') {
|
|
51
51
|
return 0;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
}
|
|
53
|
+
// Escape characters that would trigger as syntax in a regex query before converting to the query
|
|
55
54
|
var reg = new RegExp(query.replace(/(?=[.\\+*?[^\]$(){}\|])/g, '\\'), 'g');
|
|
56
55
|
return (searchString.match(reg) || []).length;
|
|
57
56
|
}
|
package/dist/cjs/actions.js
CHANGED
|
@@ -21,7 +21,5 @@ Object.defineProperty(exports, "WithRendererActions", {
|
|
|
21
21
|
return _WithRendererActions.WithRendererActions;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
|
|
25
24
|
var _RendererActionsContext = require("./ui/RendererActionsContext");
|
|
26
|
-
|
|
27
25
|
var _WithRendererActions = require("./ui/RendererActionsContext/WithRendererActions");
|
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
9
|
var AnalyticsContext = /*#__PURE__*/_react.default.createContext({
|
|
13
10
|
fireAnalyticsEvent: function fireAnalyticsEvent(_event) {
|
|
14
11
|
return null;
|
|
15
12
|
}
|
|
16
13
|
});
|
|
17
|
-
|
|
18
14
|
var _default = AnalyticsContext;
|
|
19
15
|
exports.default = _default;
|
|
@@ -6,24 +6,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.RESOLVE_METHOD = exports.PLATFORM = exports.MODE = void 0;
|
|
7
7
|
var PLATFORM;
|
|
8
8
|
exports.PLATFORM = PLATFORM;
|
|
9
|
-
|
|
10
9
|
(function (PLATFORM) {
|
|
11
10
|
PLATFORM["NATIVE"] = "mobileNative";
|
|
12
11
|
PLATFORM["HYBRID"] = "mobileHybrid";
|
|
13
12
|
PLATFORM["WEB"] = "web";
|
|
14
13
|
})(PLATFORM || (exports.PLATFORM = PLATFORM = {}));
|
|
15
|
-
|
|
16
14
|
var MODE;
|
|
17
15
|
exports.MODE = MODE;
|
|
18
|
-
|
|
19
16
|
(function (MODE) {
|
|
20
17
|
MODE["RENDERER"] = "renderer";
|
|
21
18
|
MODE["EDITOR"] = "editor";
|
|
22
19
|
})(MODE || (exports.MODE = MODE = {}));
|
|
23
|
-
|
|
24
20
|
var RESOLVE_METHOD;
|
|
25
21
|
exports.RESOLVE_METHOD = RESOLVE_METHOD;
|
|
26
|
-
|
|
27
22
|
(function (RESOLVE_METHOD) {
|
|
28
23
|
RESOLVE_METHOD["COMPONENT"] = "component";
|
|
29
24
|
RESOLVE_METHOD["CONSUMER"] = "consumer";
|
|
@@ -4,24 +4,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.trackUnsupportedContentLevels = void 0;
|
|
7
|
-
|
|
8
7
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
9
|
-
|
|
10
8
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
11
|
-
|
|
12
9
|
var _events = require("./events");
|
|
13
|
-
|
|
14
10
|
var rendersMap = {};
|
|
15
|
-
|
|
16
11
|
var processLevelsAndTrack = function processLevelsAndTrack(item, thresholds, dispatchAnalyticsEvent) {
|
|
17
12
|
try {
|
|
18
13
|
var _getUnsupportedConten = (0, _utils.getUnsupportedContentLevelData)(item.doc, thresholds),
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
14
|
+
severity = _getUnsupportedConten.severity,
|
|
15
|
+
percentage = _getUnsupportedConten.percentage,
|
|
16
|
+
_getUnsupportedConten2 = _getUnsupportedConten.counts,
|
|
17
|
+
supportedNodes = _getUnsupportedConten2.supportedNodes,
|
|
18
|
+
unsupportedNodes = _getUnsupportedConten2.unsupportedNodes;
|
|
25
19
|
dispatchAnalyticsEvent({
|
|
26
20
|
action: _analytics.ACTION.UNSUPPORTED_CONTENT_LEVELS_TRACKING_SUCCEEDED,
|
|
27
21
|
actionSubject: _analytics.ACTION_SUBJECT.RENDERER,
|
|
@@ -47,7 +41,6 @@ var processLevelsAndTrack = function processLevelsAndTrack(item, thresholds, dis
|
|
|
47
41
|
});
|
|
48
42
|
}
|
|
49
43
|
};
|
|
50
|
-
|
|
51
44
|
var schedule = function schedule(fn) {
|
|
52
45
|
if (typeof window.requestIdleCallback === 'function') {
|
|
53
46
|
window.requestIdleCallback(fn);
|
|
@@ -55,41 +48,35 @@ var schedule = function schedule(fn) {
|
|
|
55
48
|
setTimeout(fn, 0);
|
|
56
49
|
}
|
|
57
50
|
};
|
|
58
|
-
|
|
59
51
|
var DEFAULT_SAMPLING_RATE = 100;
|
|
60
|
-
|
|
61
52
|
var trackUnsupportedContentLevels = function trackUnsupportedContentLevels(item, trackingOptions, dispatchAnalyticsEvent) {
|
|
62
53
|
var _item$appearance;
|
|
63
|
-
|
|
64
54
|
var thresholds = trackingOptions.thresholds,
|
|
65
|
-
|
|
55
|
+
samplingRates = trackingOptions.samplingRates;
|
|
66
56
|
var appearance = (_item$appearance = item.appearance) !== null && _item$appearance !== void 0 ? _item$appearance : 'unknown';
|
|
67
|
-
|
|
68
57
|
if (!rendersMap[appearance]) {
|
|
69
58
|
rendersMap[appearance] = new Set();
|
|
70
|
-
}
|
|
71
|
-
|
|
59
|
+
}
|
|
72
60
|
|
|
61
|
+
// bail out if already processed a render from a given renderer instance
|
|
73
62
|
var didProcessRenderer = rendersMap[appearance].has(item.rendererId);
|
|
74
|
-
|
|
75
63
|
if (didProcessRenderer) {
|
|
76
64
|
return;
|
|
77
|
-
}
|
|
78
|
-
|
|
65
|
+
}
|
|
79
66
|
|
|
67
|
+
// otherwise track the render
|
|
80
68
|
rendersMap[appearance].add(item.rendererId);
|
|
81
|
-
var sampleRate = samplingRates && samplingRates[appearance] || DEFAULT_SAMPLING_RATE;
|
|
69
|
+
var sampleRate = samplingRates && samplingRates[appearance] || DEFAULT_SAMPLING_RATE;
|
|
82
70
|
|
|
71
|
+
// sample from the first available tracked render
|
|
83
72
|
if (rendersMap[appearance].size === 1) {
|
|
84
73
|
schedule(function () {
|
|
85
74
|
return processLevelsAndTrack(item, thresholds, dispatchAnalyticsEvent);
|
|
86
75
|
});
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
|
|
76
|
+
}
|
|
77
|
+
// cleanup/refresh tracked renders at the sampling rate
|
|
90
78
|
if (rendersMap[appearance].size % sampleRate === 0) {
|
|
91
79
|
rendersMap[appearance] = new Set();
|
|
92
80
|
}
|
|
93
81
|
};
|
|
94
|
-
|
|
95
82
|
exports.trackUnsupportedContentLevels = trackUnsupportedContentLevels;
|
package/dist/cjs/i18n/cs.js
CHANGED
package/dist/cjs/i18n/da.js
CHANGED
package/dist/cjs/i18n/de.js
CHANGED
package/dist/cjs/i18n/en.js
CHANGED
package/dist/cjs/i18n/en_GB.js
CHANGED
package/dist/cjs/i18n/en_ZZ.js
CHANGED
package/dist/cjs/i18n/es.js
CHANGED
package/dist/cjs/i18n/et.js
CHANGED
package/dist/cjs/i18n/fi.js
CHANGED
package/dist/cjs/i18n/fr.js
CHANGED
package/dist/cjs/i18n/hu.js
CHANGED
package/dist/cjs/i18n/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
@@ -155,53 +154,28 @@ Object.defineProperty(exports, "zh_TW", {
|
|
|
155
154
|
return _zh_TW.default;
|
|
156
155
|
}
|
|
157
156
|
});
|
|
158
|
-
|
|
159
157
|
var _zh = _interopRequireDefault(require("./zh"));
|
|
160
|
-
|
|
161
158
|
var _zh_TW = _interopRequireDefault(require("./zh_TW"));
|
|
162
|
-
|
|
163
159
|
var _cs = _interopRequireDefault(require("./cs"));
|
|
164
|
-
|
|
165
160
|
var _da = _interopRequireDefault(require("./da"));
|
|
166
|
-
|
|
167
161
|
var _nl = _interopRequireDefault(require("./nl"));
|
|
168
|
-
|
|
169
162
|
var _et = _interopRequireDefault(require("./et"));
|
|
170
|
-
|
|
171
163
|
var _fi = _interopRequireDefault(require("./fi"));
|
|
172
|
-
|
|
173
164
|
var _fr = _interopRequireDefault(require("./fr"));
|
|
174
|
-
|
|
175
165
|
var _de = _interopRequireDefault(require("./de"));
|
|
176
|
-
|
|
177
166
|
var _hu = _interopRequireDefault(require("./hu"));
|
|
178
|
-
|
|
179
167
|
var _it = _interopRequireDefault(require("./it"));
|
|
180
|
-
|
|
181
168
|
var _ja = _interopRequireDefault(require("./ja"));
|
|
182
|
-
|
|
183
169
|
var _ko = _interopRequireDefault(require("./ko"));
|
|
184
|
-
|
|
185
170
|
var _nb = _interopRequireDefault(require("./nb"));
|
|
186
|
-
|
|
187
171
|
var _pl = _interopRequireDefault(require("./pl"));
|
|
188
|
-
|
|
189
172
|
var _pt_BR = _interopRequireDefault(require("./pt_BR"));
|
|
190
|
-
|
|
191
173
|
var _pt_PT = _interopRequireDefault(require("./pt_PT"));
|
|
192
|
-
|
|
193
174
|
var _ru = _interopRequireDefault(require("./ru"));
|
|
194
|
-
|
|
195
175
|
var _sk = _interopRequireDefault(require("./sk"));
|
|
196
|
-
|
|
197
176
|
var _es = _interopRequireDefault(require("./es"));
|
|
198
|
-
|
|
199
177
|
var _sv = _interopRequireDefault(require("./sv"));
|
|
200
|
-
|
|
201
178
|
var _th = _interopRequireDefault(require("./th"));
|
|
202
|
-
|
|
203
179
|
var _tr = _interopRequireDefault(require("./tr"));
|
|
204
|
-
|
|
205
180
|
var _uk = _interopRequireDefault(require("./uk"));
|
|
206
|
-
|
|
207
181
|
var _vi = _interopRequireDefault(require("./vi"));
|