@atlaskit/editor-core 150.0.2 → 151.1.1
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 +69 -0
- package/dist/cjs/actions/index.js +5 -23
- package/dist/cjs/create-editor/ErrorBoundary.js +113 -79
- package/dist/cjs/create-editor/ReactEditorView.js +145 -31
- package/dist/cjs/create-editor/create-plugins-list.js +8 -2
- package/dist/cjs/editor.js +101 -40
- package/dist/cjs/labs/next/presets/cxhtml.js +2 -1
- package/dist/cjs/plugins/analytics/types/enums.js +3 -1
- package/dist/cjs/plugins/base/index.js +4 -3
- package/dist/cjs/plugins/base/pm-plugins/frozen-editor.js +66 -36
- package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/styled.js +3 -1
- package/dist/cjs/plugins/card/index.js +13 -2
- package/dist/cjs/plugins/card/nodeviews/embedCard.js +1 -0
- package/dist/cjs/plugins/card/pm-plugins/main.js +7 -2
- package/dist/cjs/plugins/card/pm-plugins/util/resolve.js +10 -3
- package/dist/cjs/plugins/code-bidi-warning/index.js +25 -0
- package/dist/cjs/plugins/code-bidi-warning/plugin-key.js +11 -0
- package/dist/cjs/plugins/code-bidi-warning/pm-plugins/main.js +43 -0
- package/dist/cjs/plugins/code-bidi-warning/pm-plugins/plugin-factory.js +118 -0
- package/dist/cjs/plugins/code-bidi-warning/pm-plugins/reducer.js +12 -0
- package/dist/cjs/plugins/code-bidi-warning/pm-plugins/types.js +5 -0
- package/dist/cjs/plugins/code-block/index.js +10 -6
- package/dist/cjs/plugins/code-block/nodeviews/highlighting-code-block.js +16 -5
- package/dist/cjs/plugins/code-block/pm-plugins/main.js +12 -3
- package/dist/cjs/plugins/code-block/toolbar.js +1 -1
- package/dist/cjs/plugins/emoji/styles.js +1 -1
- package/dist/cjs/plugins/extension/pm-plugins/main.js +1 -4
- package/dist/cjs/plugins/extension/toolbar.js +28 -23
- package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +9 -3
- package/dist/cjs/plugins/find-replace/ui/Find.js +27 -7
- package/dist/cjs/plugins/hyperlink/HyperlinkToolbarAppearance.js +2 -2
- package/dist/cjs/plugins/hyperlink/pm-plugins/keymap.js +3 -3
- package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +7 -4
- package/dist/cjs/plugins/hyperlink/utils.js +6 -69
- package/dist/cjs/plugins/index.js +8 -0
- package/dist/cjs/plugins/media/index.js +14 -3
- package/dist/cjs/plugins/media/nodeviews/mediaGroup.js +24 -10
- package/dist/cjs/plugins/media/nodeviews/mediaInline.js +179 -0
- package/dist/cjs/plugins/media/pm-plugins/main.js +18 -9
- package/dist/cjs/plugins/media/toolbar/index.js +49 -17
- package/dist/cjs/plugins/media/toolbar/utils.js +20 -2
- package/dist/cjs/plugins/media/utils/media-files.js +67 -1
- package/dist/cjs/plugins/mentions/type-ahead/index.js +39 -3
- package/dist/cjs/plugins/panel/index.js +2 -3
- package/dist/cjs/plugins/panel/message.js +47 -0
- package/dist/cjs/plugins/panel/toolbar.js +64 -84
- package/dist/cjs/plugins/panel/utils.js +2 -2
- package/dist/cjs/plugins/paste/linkify-md-plugin.js +3 -3
- package/dist/cjs/plugins/rank.js +1 -1
- package/dist/cjs/plugins/status/styles.js +1 -1
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +18 -2
- package/dist/cjs/profiler/render-count.js +82 -0
- package/dist/cjs/ui/Appearance/Comment/Comment.js +6 -5
- package/dist/cjs/utils/react-hooks/use-component-renderer-tracking/index.js +55 -19
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/actions/index.js +6 -28
- package/dist/es2019/create-editor/ErrorBoundary.js +73 -60
- package/dist/es2019/create-editor/ReactEditorView.js +130 -23
- package/dist/es2019/create-editor/create-plugins-list.js +9 -3
- package/dist/es2019/editor.js +74 -35
- package/dist/es2019/labs/next/presets/cxhtml.js +2 -1
- package/dist/es2019/plugins/analytics/types/enums.js +3 -1
- package/dist/es2019/plugins/base/index.js +4 -3
- package/dist/es2019/plugins/base/pm-plugins/frozen-editor.js +63 -35
- package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/styled.js +2 -1
- package/dist/es2019/plugins/card/index.js +7 -2
- package/dist/es2019/plugins/card/nodeviews/embedCard.js +1 -0
- package/dist/es2019/plugins/card/pm-plugins/main.js +9 -2
- package/dist/es2019/plugins/card/pm-plugins/util/resolve.js +12 -5
- package/dist/es2019/plugins/code-bidi-warning/index.js +15 -0
- package/dist/es2019/plugins/code-bidi-warning/plugin-key.js +2 -0
- package/dist/es2019/plugins/code-bidi-warning/pm-plugins/main.js +31 -0
- package/dist/es2019/plugins/code-bidi-warning/pm-plugins/plugin-factory.js +88 -0
- package/dist/es2019/plugins/code-bidi-warning/pm-plugins/reducer.js +3 -0
- package/dist/es2019/plugins/code-bidi-warning/pm-plugins/types.js +1 -0
- package/dist/es2019/plugins/code-block/index.js +6 -1
- package/dist/es2019/plugins/code-block/nodeviews/highlighting-code-block.js +16 -4
- package/dist/es2019/plugins/code-block/pm-plugins/main.js +50 -39
- package/dist/es2019/plugins/code-block/toolbar.js +1 -1
- package/dist/es2019/plugins/emoji/styles.js +2 -0
- package/dist/es2019/plugins/extension/pm-plugins/main.js +1 -4
- package/dist/es2019/plugins/extension/toolbar.js +30 -25
- package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +9 -4
- package/dist/es2019/plugins/find-replace/ui/Find.js +27 -6
- package/dist/es2019/plugins/hyperlink/HyperlinkToolbarAppearance.js +1 -1
- package/dist/es2019/plugins/hyperlink/pm-plugins/keymap.js +1 -1
- package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +7 -4
- package/dist/es2019/plugins/hyperlink/utils.js +3 -59
- package/dist/es2019/plugins/index.js +2 -1
- package/dist/es2019/plugins/media/index.js +13 -4
- package/dist/es2019/plugins/media/nodeviews/mediaGroup.js +16 -7
- package/dist/es2019/plugins/media/nodeviews/mediaInline.js +88 -0
- package/dist/es2019/plugins/media/pm-plugins/main.js +20 -11
- package/dist/es2019/plugins/media/toolbar/index.js +44 -15
- package/dist/es2019/plugins/media/toolbar/utils.js +16 -0
- package/dist/es2019/plugins/media/utils/media-files.js +68 -2
- package/dist/es2019/plugins/mentions/type-ahead/index.js +21 -2
- package/dist/es2019/plugins/panel/index.js +3 -4
- package/dist/es2019/plugins/panel/message.js +38 -0
- package/dist/es2019/plugins/panel/toolbar.js +52 -71
- package/dist/es2019/plugins/panel/utils.js +2 -2
- package/dist/es2019/plugins/paste/linkify-md-plugin.js +2 -2
- package/dist/es2019/plugins/rank.js +1 -1
- package/dist/es2019/plugins/status/styles.js +2 -0
- package/dist/es2019/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +18 -2
- package/dist/es2019/profiler/render-count.js +60 -0
- package/dist/es2019/ui/Appearance/Comment/Comment.js +4 -2
- package/dist/es2019/utils/react-hooks/use-component-renderer-tracking/index.js +51 -18
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/actions/index.js +6 -24
- package/dist/esm/create-editor/ErrorBoundary.js +113 -78
- package/dist/esm/create-editor/ReactEditorView.js +146 -31
- package/dist/esm/create-editor/create-plugins-list.js +9 -3
- package/dist/esm/editor.js +100 -40
- package/dist/esm/labs/next/presets/cxhtml.js +2 -1
- package/dist/esm/plugins/analytics/types/enums.js +3 -1
- package/dist/esm/plugins/base/index.js +4 -3
- package/dist/esm/plugins/base/pm-plugins/frozen-editor.js +64 -36
- package/dist/esm/plugins/block-type/ui/ToolbarBlockType/styled.js +3 -1
- package/dist/esm/plugins/card/index.js +13 -2
- package/dist/esm/plugins/card/nodeviews/embedCard.js +1 -0
- package/dist/esm/plugins/card/pm-plugins/main.js +7 -2
- package/dist/esm/plugins/card/pm-plugins/util/resolve.js +12 -5
- package/dist/esm/plugins/code-bidi-warning/index.js +17 -0
- package/dist/esm/plugins/code-bidi-warning/plugin-key.js +2 -0
- package/dist/esm/plugins/code-bidi-warning/pm-plugins/main.js +30 -0
- package/dist/esm/plugins/code-bidi-warning/pm-plugins/plugin-factory.js +96 -0
- package/dist/esm/plugins/code-bidi-warning/pm-plugins/reducer.js +3 -0
- package/dist/esm/plugins/code-bidi-warning/pm-plugins/types.js +1 -0
- package/dist/esm/plugins/code-block/index.js +10 -6
- package/dist/esm/plugins/code-block/nodeviews/highlighting-code-block.js +16 -5
- package/dist/esm/plugins/code-block/pm-plugins/main.js +11 -3
- package/dist/esm/plugins/code-block/toolbar.js +1 -1
- package/dist/esm/plugins/emoji/styles.js +1 -1
- package/dist/esm/plugins/extension/pm-plugins/main.js +1 -4
- package/dist/esm/plugins/extension/toolbar.js +28 -23
- package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +9 -4
- package/dist/esm/plugins/find-replace/ui/Find.js +27 -7
- package/dist/esm/plugins/hyperlink/HyperlinkToolbarAppearance.js +2 -2
- package/dist/esm/plugins/hyperlink/pm-plugins/keymap.js +1 -1
- package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +7 -4
- package/dist/esm/plugins/hyperlink/utils.js +3 -59
- package/dist/esm/plugins/index.js +2 -1
- package/dist/esm/plugins/media/index.js +14 -4
- package/dist/esm/plugins/media/nodeviews/mediaGroup.js +24 -10
- package/dist/esm/plugins/media/nodeviews/mediaInline.js +147 -0
- package/dist/esm/plugins/media/pm-plugins/main.js +19 -11
- package/dist/esm/plugins/media/toolbar/index.js +47 -19
- package/dist/esm/plugins/media/toolbar/utils.js +15 -1
- package/dist/esm/plugins/media/utils/media-files.js +60 -2
- package/dist/esm/plugins/mentions/type-ahead/index.js +39 -3
- package/dist/esm/plugins/panel/index.js +3 -4
- package/dist/esm/plugins/panel/message.js +38 -0
- package/dist/esm/plugins/panel/toolbar.js +57 -77
- package/dist/esm/plugins/panel/utils.js +2 -2
- package/dist/esm/plugins/paste/linkify-md-plugin.js +2 -2
- package/dist/esm/plugins/rank.js +1 -1
- package/dist/esm/plugins/status/styles.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +18 -2
- package/dist/esm/profiler/render-count.js +57 -0
- package/dist/esm/ui/Appearance/Comment/Comment.js +6 -5
- package/dist/esm/utils/react-hooks/use-component-renderer-tracking/index.js +53 -20
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/create-editor/ErrorBoundary.d.ts +6 -6
- package/dist/types/create-editor/ReactEditorView.d.ts +15 -3
- package/dist/types/editor.d.ts +2 -0
- package/dist/types/plugins/analytics/index.d.ts +1 -1
- package/dist/types/plugins/analytics/types/enums.d.ts +4 -2
- package/dist/types/plugins/analytics/types/events.d.ts +7 -2
- package/dist/types/plugins/analytics/types/general-events.d.ts +4 -1
- package/dist/types/plugins/analytics/types/index.d.ts +1 -1
- package/dist/types/plugins/analytics/types/insert-events.d.ts +6 -1
- package/dist/types/plugins/analytics/types/link-tool-bar-events.d.ts +1 -0
- package/dist/types/plugins/base/index.d.ts +1 -0
- package/dist/types/plugins/base/pm-plugins/frozen-editor.d.ts +3 -2
- package/dist/types/plugins/card/pm-plugins/main.d.ts +2 -3
- package/dist/types/plugins/card/pm-plugins/util/resolve.d.ts +2 -1
- package/dist/types/plugins/card/types.d.ts +6 -0
- package/dist/types/plugins/code-bidi-warning/index.d.ts +3 -0
- package/dist/types/plugins/code-bidi-warning/plugin-key.d.ts +2 -0
- package/dist/types/plugins/code-bidi-warning/pm-plugins/main.d.ts +3 -0
- package/dist/types/plugins/code-bidi-warning/pm-plugins/plugin-factory.d.ts +7 -0
- package/dist/types/plugins/code-bidi-warning/pm-plugins/reducer.d.ts +3 -0
- package/dist/types/plugins/code-bidi-warning/pm-plugins/types.d.ts +5 -0
- package/dist/types/plugins/code-block/nodeviews/highlighting-code-block.d.ts +11 -2
- package/dist/types/plugins/code-block/pm-plugins/main.d.ts +5 -1
- package/dist/types/plugins/extension/types.d.ts +0 -2
- package/dist/types/plugins/feature-flags-context/get-enabled-feature-flag-keys.d.ts +1 -1
- package/dist/types/plugins/floating-toolbar/types.d.ts +1 -1
- package/dist/types/plugins/floating-toolbar/ui/Select.d.ts +1 -1
- package/dist/types/plugins/hyperlink/HyperlinkToolbarAppearance.d.ts +1 -1
- package/dist/types/plugins/hyperlink/utils.d.ts +0 -21
- package/dist/types/plugins/index.d.ts +1 -0
- package/dist/types/plugins/media/nodeviews/mediaInline.d.ts +27 -0
- package/dist/types/plugins/media/pm-plugins/main.d.ts +2 -2
- package/dist/types/plugins/media/toolbar/utils.d.ts +2 -0
- package/dist/types/plugins/media/utils/media-files.d.ts +8 -0
- package/dist/types/plugins/panel/message.d.ts +37 -0
- package/dist/types/plugins/panel/toolbar.d.ts +4 -37
- package/dist/types/plugins/panel/types.d.ts +1 -0
- package/dist/types/profiler/render-count.d.ts +14 -0
- package/dist/types/types/feature-flags.d.ts +17 -0
- package/dist/types/ui/LinkSearch/types.d.ts +1 -0
- package/dist/types/utils/react-hooks/use-component-renderer-tracking/index.d.ts +17 -1
- package/package.json +21 -18
- package/dist/cjs/plugins/caption/nodeviews/index.test.js +0 -135
- package/dist/cjs/plugins/caption/pm-plugins/keymap.test.js +0 -203
- package/dist/cjs/plugins/caption/pm-plugins/main.test.js +0 -141
- package/dist/cjs/plugins/code-block/language-list.test.js +0 -74
- package/dist/cjs/plugins/extension/ui/SaveIndicator/SaveIndicator.test.js +0 -101
- package/dist/cjs/plugins/floating-toolbar/ui/EmojiPickerButton.test.js +0 -98
- package/dist/cjs/plugins/media/commands/captions.test.js +0 -149
- package/dist/cjs/plugins/media/commands/linking.test.js +0 -296
- package/dist/cjs/plugins/media/ui/CaptionPlaceholder/index.test.js +0 -50
- package/dist/cjs/plugins/panel/toolbar.test.js +0 -250
- package/dist/cjs/ui/ColorPickerButton/index.test.js +0 -123
- package/dist/cjs/ui/PortalProvider/index.test.js +0 -139
- package/dist/es2019/plugins/caption/nodeviews/index.test.js +0 -122
- package/dist/es2019/plugins/caption/pm-plugins/keymap.test.js +0 -193
- package/dist/es2019/plugins/caption/pm-plugins/main.test.js +0 -132
- package/dist/es2019/plugins/code-block/language-list.test.js +0 -69
- package/dist/es2019/plugins/extension/ui/SaveIndicator/SaveIndicator.test.js +0 -83
- package/dist/es2019/plugins/floating-toolbar/ui/EmojiPickerButton.test.js +0 -85
- package/dist/es2019/plugins/media/commands/captions.test.js +0 -126
- package/dist/es2019/plugins/media/commands/linking.test.js +0 -208
- package/dist/es2019/plugins/media/ui/CaptionPlaceholder/index.test.js +0 -41
- package/dist/es2019/plugins/panel/toolbar.test.js +0 -200
- package/dist/es2019/ui/ColorPickerButton/index.test.js +0 -88
- package/dist/es2019/ui/PortalProvider/index.test.js +0 -115
- package/dist/esm/plugins/caption/nodeviews/index.test.js +0 -125
- package/dist/esm/plugins/caption/pm-plugins/keymap.test.js +0 -195
- package/dist/esm/plugins/caption/pm-plugins/main.test.js +0 -124
- package/dist/esm/plugins/code-block/language-list.test.js +0 -71
- package/dist/esm/plugins/extension/ui/SaveIndicator/SaveIndicator.test.js +0 -92
- package/dist/esm/plugins/floating-toolbar/ui/EmojiPickerButton.test.js +0 -85
- package/dist/esm/plugins/media/commands/captions.test.js +0 -135
- package/dist/esm/plugins/media/commands/linking.test.js +0 -268
- package/dist/esm/plugins/media/ui/CaptionPlaceholder/index.test.js +0 -41
- package/dist/esm/plugins/panel/toolbar.test.js +0 -230
- package/dist/esm/ui/ColorPickerButton/index.test.js +0 -107
- package/dist/esm/ui/PortalProvider/index.test.js +0 -129
|
@@ -5,7 +5,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
5
5
|
|
|
6
6
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
7
7
|
|
|
8
|
-
import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, datePlugin, emojiPlugin, extensionPlugin, helpDialogPlugin, imageUploadPlugin, insertBlockPlugin, jiraIssuePlugin, layoutPlugin, listPlugin, macroPlugin, maxContentSizePlugin, mediaPlugin, mentionsPlugin, panelPlugin, placeholderTextPlugin, rulePlugin, saveOnEnterPlugin, tablesPlugin, tasksAndDecisionsPlugin, textColorPlugin, cardPlugin, gridPlugin, statusPlugin, alignmentPlugin, indentationPlugin, analyticsPlugin, customAutoformatPlugin, feedbackDialogPlugin, historyPlugin, expandPlugin, isExpandInsertionEnabled, scrollIntoViewPlugin, mobileDimensionsPlugin, findReplacePlugin, contextPanelPlugin, mobileSelectionPlugin, annotationPlugin, captionPlugin, avatarGroupPlugin, viewUpdateSubscriptionPlugin } from '../plugins';
|
|
8
|
+
import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, datePlugin, emojiPlugin, extensionPlugin, helpDialogPlugin, imageUploadPlugin, insertBlockPlugin, jiraIssuePlugin, layoutPlugin, listPlugin, macroPlugin, maxContentSizePlugin, mediaPlugin, mentionsPlugin, panelPlugin, placeholderTextPlugin, rulePlugin, saveOnEnterPlugin, tablesPlugin, tasksAndDecisionsPlugin, textColorPlugin, cardPlugin, gridPlugin, statusPlugin, alignmentPlugin, indentationPlugin, analyticsPlugin, customAutoformatPlugin, feedbackDialogPlugin, historyPlugin, expandPlugin, isExpandInsertionEnabled, scrollIntoViewPlugin, mobileDimensionsPlugin, findReplacePlugin, contextPanelPlugin, mobileSelectionPlugin, annotationPlugin, captionPlugin, avatarGroupPlugin, viewUpdateSubscriptionPlugin, codeBidiWarningPlugin } from '../plugins';
|
|
9
9
|
import { isFullPage as fullPageCheck } from '../utils/is-full-page';
|
|
10
10
|
import { GUTTER_SIZE_MOBILE_IN_PX } from '../plugins/base/pm-plugins/scroll-gutter';
|
|
11
11
|
import { createFeatureFlagsFromProps } from '../plugins/feature-flags-context/feature-flags-from-props';
|
|
@@ -66,7 +66,8 @@ export function getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEve
|
|
|
66
66
|
allowInlineCursorTarget: !isMobile,
|
|
67
67
|
allowScrollGutter: getScrollGutterOptions(props),
|
|
68
68
|
inputTracking: inputTracking,
|
|
69
|
-
browserFreezeTracking: (_props$performanceTra2 = props.performanceTracking) === null || _props$performanceTra2 === void 0 ? void 0 : _props$performanceTra2.bFreezeTracking
|
|
69
|
+
browserFreezeTracking: (_props$performanceTra2 = props.performanceTracking) === null || _props$performanceTra2 === void 0 ? void 0 : _props$performanceTra2.bFreezeTracking,
|
|
70
|
+
ufo: createFeatureFlagsFromProps(props).ufo
|
|
70
71
|
},
|
|
71
72
|
blockType: {
|
|
72
73
|
lastNodeMustBeParagraph: appearance === 'comment' || appearance === 'chromeless',
|
|
@@ -276,7 +277,8 @@ export default function createPluginsList(props, prevProps, createAnalyticsEvent
|
|
|
276
277
|
if (props.allowPanel) {
|
|
277
278
|
preset.add([panelPlugin, {
|
|
278
279
|
useLongPressSelection: false,
|
|
279
|
-
UNSAFE_allowCustomPanel: props.allowPanel.UNSAFE_allowCustomPanel
|
|
280
|
+
UNSAFE_allowCustomPanel: props.allowPanel.UNSAFE_allowCustomPanel,
|
|
281
|
+
UNSAFE_allowCustomPanelEdit: props.allowPanel.UNSAFE_allowCustomPanelEdit
|
|
280
282
|
}]);
|
|
281
283
|
}
|
|
282
284
|
|
|
@@ -391,6 +393,10 @@ export default function createPluginsList(props, prevProps, createAnalyticsEvent
|
|
|
391
393
|
preset.add([viewUpdateSubscriptionPlugin]);
|
|
392
394
|
}
|
|
393
395
|
|
|
396
|
+
if (featureFlags.codeBidiWarnings) {
|
|
397
|
+
preset.add(codeBidiWarningPlugin);
|
|
398
|
+
}
|
|
399
|
+
|
|
394
400
|
var excludes = new Set();
|
|
395
401
|
|
|
396
402
|
if (!isCodeBlockAllowed({
|
package/dist/esm/editor.js
CHANGED
|
@@ -27,6 +27,7 @@ import memoizeOne from 'memoize-one';
|
|
|
27
27
|
import uuid from 'uuid/v4';
|
|
28
28
|
import { name, version } from './version-wrapper';
|
|
29
29
|
import { ProviderFactory, BaseTheme, getAnalyticsAppearance, WithCreateAnalyticsEvent, startMeasure, stopMeasure, clearMeasure, measureTTI, getTTISeverity, combineExtensionProviders, WidthProvider } from '@atlaskit/editor-common';
|
|
30
|
+
import { EditorExperience, ExperienceStore } from '@atlaskit/editor-common/ufo';
|
|
30
31
|
import { akEditorFullPageDefaultFontSize } from '@atlaskit/editor-shared-styles';
|
|
31
32
|
import { FabricEditorAnalyticsContext } from '@atlaskit/analytics-namespaced-context';
|
|
32
33
|
import { getUiComponent } from './create-editor';
|
|
@@ -50,6 +51,8 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
50
51
|
var _super = _createSuper(Editor);
|
|
51
52
|
|
|
52
53
|
function Editor(props, context) {
|
|
54
|
+
var _props$performanceTra, _props$performanceTra2, _props$featureFlags;
|
|
55
|
+
|
|
53
56
|
var _this;
|
|
54
57
|
|
|
55
58
|
_classCallCheck(this, Editor);
|
|
@@ -97,11 +100,16 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
97
100
|
_this.trackEditorActions(_this.editorActions, props);
|
|
98
101
|
|
|
99
102
|
_this.editorSessionId = uuid();
|
|
103
|
+
_this.startTime = performance.now();
|
|
100
104
|
startMeasure(measurements.EDITOR_MOUNTED);
|
|
101
105
|
|
|
102
|
-
if (props.performanceTracking &&
|
|
106
|
+
if ((_props$performanceTra = props.performanceTracking) !== null && _props$performanceTra !== void 0 && (_props$performanceTra2 = _props$performanceTra.ttiTracking) !== null && _props$performanceTra2 !== void 0 && _props$performanceTra2.enabled || (_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.ufo) {
|
|
107
|
+
var _props$performanceTra5, _props$performanceTra6, _props$performanceTra7, _props$performanceTra8;
|
|
108
|
+
|
|
103
109
|
measureTTI(function (tti, ttiFromInvocation, canceled) {
|
|
104
|
-
|
|
110
|
+
var _props$performanceTra3, _props$performanceTra4, _props$featureFlags2;
|
|
111
|
+
|
|
112
|
+
if ((_props$performanceTra3 = props.performanceTracking) !== null && _props$performanceTra3 !== void 0 && (_props$performanceTra4 = _props$performanceTra3.ttiTracking) !== null && _props$performanceTra4 !== void 0 && _props$performanceTra4.enabled && _this.createAnalyticsEvent) {
|
|
105
113
|
var _ttiTracking;
|
|
106
114
|
|
|
107
115
|
var ttiEvent = {
|
|
@@ -134,7 +142,14 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
134
142
|
|
|
135
143
|
fireAnalyticsEvent(_this.createAnalyticsEvent)(ttiEvent);
|
|
136
144
|
}
|
|
137
|
-
|
|
145
|
+
|
|
146
|
+
if ((_props$featureFlags2 = props.featureFlags) !== null && _props$featureFlags2 !== void 0 && _props$featureFlags2.ufo) {
|
|
147
|
+
var _this$experienceStore, _this$experienceStore2;
|
|
148
|
+
|
|
149
|
+
(_this$experienceStore = _this.experienceStore) === null || _this$experienceStore === void 0 ? void 0 : _this$experienceStore.mark(EditorExperience.loadEditor, ACTION.EDITOR_TTI, tti);
|
|
150
|
+
(_this$experienceStore2 = _this.experienceStore) === null || _this$experienceStore2 === void 0 ? void 0 : _this$experienceStore2.success(EditorExperience.loadEditor);
|
|
151
|
+
}
|
|
152
|
+
}, (_props$performanceTra5 = props.performanceTracking) === null || _props$performanceTra5 === void 0 ? void 0 : (_props$performanceTra6 = _props$performanceTra5.ttiTracking) === null || _props$performanceTra6 === void 0 ? void 0 : _props$performanceTra6.ttiIdleThreshold, (_props$performanceTra7 = props.performanceTracking) === null || _props$performanceTra7 === void 0 ? void 0 : (_props$performanceTra8 = _props$performanceTra7.ttiTracking) === null || _props$performanceTra8 === void 0 ? void 0 : _props$performanceTra8.ttiCancelTimeout);
|
|
138
153
|
}
|
|
139
154
|
|
|
140
155
|
var _extensionProvider = _this.prepareExtensionProvider(props.extensionProviders);
|
|
@@ -180,21 +195,29 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
180
195
|
}, {
|
|
181
196
|
key: "componentWillUnmount",
|
|
182
197
|
value: function componentWillUnmount() {
|
|
183
|
-
var _this$props2, _this$props2$performa, _this$props2$performa2;
|
|
198
|
+
var _this$props2, _this$props2$performa, _this$props2$performa2, _this$props$featureFl;
|
|
184
199
|
|
|
185
200
|
this.unregisterEditorFromActions();
|
|
186
201
|
this.providerFactory.destroy();
|
|
187
202
|
clearMeasure(measurements.EDITOR_MOUNTED);
|
|
188
203
|
((_this$props2 = this.props) === null || _this$props2 === void 0 ? void 0 : (_this$props2$performa = _this$props2.performanceTracking) === null || _this$props2$performa === void 0 ? void 0 : (_this$props2$performa2 = _this$props2$performa.onEditorReadyCallbackTracking) === null || _this$props2$performa2 === void 0 ? void 0 : _this$props2$performa2.enabled) && clearMeasure(measurements.ON_EDITOR_READY_CALLBACK);
|
|
204
|
+
|
|
205
|
+
if ((_this$props$featureFl = this.props.featureFlags) !== null && _this$props$featureFl !== void 0 && _this$props$featureFl.ufo) {
|
|
206
|
+
var _this$experienceStore3;
|
|
207
|
+
|
|
208
|
+
(_this$experienceStore3 = this.experienceStore) === null || _this$experienceStore3 === void 0 ? void 0 : _this$experienceStore3.abortAll({
|
|
209
|
+
reason: 'editor component unmounted'
|
|
210
|
+
});
|
|
211
|
+
}
|
|
189
212
|
}
|
|
190
213
|
}, {
|
|
191
214
|
key: "trackEditorActions",
|
|
192
215
|
value: function trackEditorActions(editorActions, props) {
|
|
193
|
-
var _props$
|
|
194
|
-
_props$
|
|
216
|
+
var _props$performanceTra9,
|
|
217
|
+
_props$performanceTra10,
|
|
195
218
|
_this3 = this;
|
|
196
219
|
|
|
197
|
-
if (props !== null && props !== void 0 && (_props$
|
|
220
|
+
if (props !== null && props !== void 0 && (_props$performanceTra9 = props.performanceTracking) !== null && _props$performanceTra9 !== void 0 && (_props$performanceTra10 = _props$performanceTra9.contentRetrievalTracking) !== null && _props$performanceTra10 !== void 0 && _props$performanceTra10.enabled) {
|
|
198
221
|
var DEFAULT_SAMPLING_RATE = 100;
|
|
199
222
|
var getValue = editorActions.getValue.bind(editorActions);
|
|
200
223
|
|
|
@@ -215,7 +238,7 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
215
238
|
if (!getValueTracked) {
|
|
216
239
|
var getValueWithTracking = /*#__PURE__*/function () {
|
|
217
240
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
218
|
-
var _props$
|
|
241
|
+
var _props$performanceTra11, _props$performanceTra12, _props$performanceTra13, value, _props$performanceTra14, _props$performanceTra15, _props$performanceTra16, _props$performanceTra17, _props$performanceTra18;
|
|
219
242
|
|
|
220
243
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
221
244
|
while (1) {
|
|
@@ -228,7 +251,7 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
228
251
|
case 3:
|
|
229
252
|
value = _context.sent;
|
|
230
253
|
|
|
231
|
-
if (samplingCounters.success === ((_props$
|
|
254
|
+
if (samplingCounters.success === ((_props$performanceTra11 = props === null || props === void 0 ? void 0 : (_props$performanceTra12 = props.performanceTracking) === null || _props$performanceTra12 === void 0 ? void 0 : (_props$performanceTra13 = _props$performanceTra12.contentRetrievalTracking) === null || _props$performanceTra13 === void 0 ? void 0 : _props$performanceTra13.successSamplingRate) !== null && _props$performanceTra11 !== void 0 ? _props$performanceTra11 : DEFAULT_SAMPLING_RATE)) {
|
|
232
255
|
_this3.handleAnalyticsEvent({
|
|
233
256
|
payload: {
|
|
234
257
|
action: ACTION.EDITOR_CONTENT_RETRIEVAL_PERFORMED,
|
|
@@ -250,7 +273,7 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
250
273
|
_context.prev = 9;
|
|
251
274
|
_context.t0 = _context["catch"](0);
|
|
252
275
|
|
|
253
|
-
if (samplingCounters.failure === ((_props$
|
|
276
|
+
if (samplingCounters.failure === ((_props$performanceTra14 = props === null || props === void 0 ? void 0 : (_props$performanceTra15 = props.performanceTracking) === null || _props$performanceTra15 === void 0 ? void 0 : (_props$performanceTra16 = _props$performanceTra15.contentRetrievalTracking) === null || _props$performanceTra16 === void 0 ? void 0 : _props$performanceTra16.failureSamplingRate) !== null && _props$performanceTra14 !== void 0 ? _props$performanceTra14 : DEFAULT_SAMPLING_RATE)) {
|
|
254
277
|
_this3.handleAnalyticsEvent({
|
|
255
278
|
payload: {
|
|
256
279
|
action: ACTION.EDITOR_CONTENT_RETRIEVAL_PERFORMED,
|
|
@@ -258,7 +281,7 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
258
281
|
attributes: {
|
|
259
282
|
success: false,
|
|
260
283
|
errorInfo: _context.t0.toString(),
|
|
261
|
-
errorStack: props !== null && props !== void 0 && (_props$
|
|
284
|
+
errorStack: props !== null && props !== void 0 && (_props$performanceTra17 = props.performanceTracking) !== null && _props$performanceTra17 !== void 0 && (_props$performanceTra18 = _props$performanceTra17.contentRetrievalTracking) !== null && _props$performanceTra18 !== void 0 && _props$performanceTra18.reportErrorStack ? _context.t0.stack : undefined
|
|
262
285
|
},
|
|
263
286
|
eventType: EVENT_TYPE.OPERATIONAL
|
|
264
287
|
}
|
|
@@ -293,14 +316,22 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
293
316
|
}, {
|
|
294
317
|
key: "onEditorCreated",
|
|
295
318
|
value: function onEditorCreated(instance) {
|
|
319
|
+
var _this$props$featureFl2;
|
|
320
|
+
|
|
296
321
|
this.registerEditorForActions(instance.view, instance.eventDispatcher, instance.transformer);
|
|
297
322
|
|
|
323
|
+
if ((_this$props$featureFl2 = this.props.featureFlags) !== null && _this$props$featureFl2 !== void 0 && _this$props$featureFl2.ufo) {
|
|
324
|
+
this.experienceStore = ExperienceStore.getInstance(instance.view);
|
|
325
|
+
this.experienceStore.start(EditorExperience.loadEditor, this.startTime);
|
|
326
|
+
}
|
|
327
|
+
|
|
298
328
|
if (this.props.onEditorReady) {
|
|
299
|
-
var _this$props3, _this$props3$performa, _this$props3$performa2, _this$
|
|
329
|
+
var _this$props3, _this$props3$performa, _this$props3$performa2, _this$props$featureFl3;
|
|
300
330
|
|
|
301
|
-
((_this$props3 = this.props) === null || _this$props3 === void 0 ? void 0 : (_this$props3$performa = _this$props3.performanceTracking) === null || _this$props3$performa === void 0 ? void 0 : (_this$props3$performa2 = _this$props3$performa.onEditorReadyCallbackTracking) === null || _this$props3$performa2 === void 0 ? void 0 : _this$props3$performa2.enabled)
|
|
331
|
+
var measureEditorReady = ((_this$props3 = this.props) === null || _this$props3 === void 0 ? void 0 : (_this$props3$performa = _this$props3.performanceTracking) === null || _this$props3$performa === void 0 ? void 0 : (_this$props3$performa2 = _this$props3$performa.onEditorReadyCallbackTracking) === null || _this$props3$performa2 === void 0 ? void 0 : _this$props3$performa2.enabled) || ((_this$props$featureFl3 = this.props.featureFlags) === null || _this$props$featureFl3 === void 0 ? void 0 : _this$props$featureFl3.ufo);
|
|
332
|
+
measureEditorReady && startMeasure(measurements.ON_EDITOR_READY_CALLBACK);
|
|
302
333
|
this.props.onEditorReady(this.editorActions);
|
|
303
|
-
|
|
334
|
+
measureEditorReady && stopMeasure(measurements.ON_EDITOR_READY_CALLBACK, this.sendDurationAnalytics(ACTION.ON_EDITOR_READY_CALLBACK));
|
|
304
335
|
}
|
|
305
336
|
}
|
|
306
337
|
}, {
|
|
@@ -308,28 +339,57 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
308
339
|
value: function sendDurationAnalytics(action) {
|
|
309
340
|
var _this4 = this;
|
|
310
341
|
|
|
311
|
-
return function (
|
|
312
|
-
|
|
313
|
-
var
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
342
|
+
return /*#__PURE__*/function () {
|
|
343
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(duration, startTime) {
|
|
344
|
+
var _this4$props$featureF;
|
|
345
|
+
|
|
346
|
+
var contextIdentifier, objectId, _this4$experienceStor, _this4$experienceStor2;
|
|
347
|
+
|
|
348
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
349
|
+
while (1) {
|
|
350
|
+
switch (_context2.prev = _context2.next) {
|
|
351
|
+
case 0:
|
|
352
|
+
_context2.next = 2;
|
|
353
|
+
return _this4.props.contextIdentifierProvider;
|
|
354
|
+
|
|
355
|
+
case 2:
|
|
356
|
+
contextIdentifier = _context2.sent;
|
|
357
|
+
objectId = contextIdentifier === null || contextIdentifier === void 0 ? void 0 : contextIdentifier.objectId;
|
|
358
|
+
|
|
359
|
+
if (_this4.createAnalyticsEvent) {
|
|
360
|
+
fireAnalyticsEvent(_this4.createAnalyticsEvent)({
|
|
361
|
+
payload: {
|
|
362
|
+
action: action,
|
|
363
|
+
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
364
|
+
attributes: {
|
|
365
|
+
duration: duration,
|
|
366
|
+
startTime: startTime,
|
|
367
|
+
objectId: objectId
|
|
368
|
+
},
|
|
369
|
+
eventType: EVENT_TYPE.OPERATIONAL
|
|
370
|
+
}
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
if ((_this4$props$featureF = _this4.props.featureFlags) !== null && _this4$props$featureF !== void 0 && _this4$props$featureF.ufo) {
|
|
375
|
+
(_this4$experienceStor = _this4.experienceStore) === null || _this4$experienceStor === void 0 ? void 0 : _this4$experienceStor.mark(EditorExperience.loadEditor, action, startTime + duration);
|
|
376
|
+
(_this4$experienceStor2 = _this4.experienceStore) === null || _this4$experienceStor2 === void 0 ? void 0 : _this4$experienceStor2.addMetadata(EditorExperience.loadEditor, {
|
|
377
|
+
objectId: objectId
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
case 6:
|
|
382
|
+
case "end":
|
|
383
|
+
return _context2.stop();
|
|
324
384
|
}
|
|
325
|
-
}
|
|
326
|
-
};
|
|
385
|
+
}
|
|
386
|
+
}, _callee2);
|
|
387
|
+
}));
|
|
327
388
|
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
};
|
|
389
|
+
return function (_x, _x2) {
|
|
390
|
+
return _ref2.apply(this, arguments);
|
|
391
|
+
};
|
|
392
|
+
}();
|
|
333
393
|
}
|
|
334
394
|
}, {
|
|
335
395
|
key: "deprecationWarnings",
|
|
@@ -487,14 +547,14 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
487
547
|
onEditorDestroyed: _this5.onEditorDestroyed,
|
|
488
548
|
allowAnalyticsGASV3: _this5.props.allowAnalyticsGASV3,
|
|
489
549
|
disabled: _this5.props.disabled,
|
|
490
|
-
render: function render(
|
|
550
|
+
render: function render(_ref3) {
|
|
491
551
|
var _this5$props$featureF, _this5$props$featureF2;
|
|
492
552
|
|
|
493
|
-
var editor =
|
|
494
|
-
view =
|
|
495
|
-
eventDispatcher =
|
|
496
|
-
config =
|
|
497
|
-
dispatchAnalyticsEvent =
|
|
553
|
+
var editor = _ref3.editor,
|
|
554
|
+
view = _ref3.view,
|
|
555
|
+
eventDispatcher = _ref3.eventDispatcher,
|
|
556
|
+
config = _ref3.config,
|
|
557
|
+
dispatchAnalyticsEvent = _ref3.dispatchAnalyticsEvent;
|
|
498
558
|
return /*#__PURE__*/React.createElement(BaseTheme, {
|
|
499
559
|
dynamicTextSizing: _this5.props.allowDynamicTextSizing && _this5.props.appearance !== 'full-width',
|
|
500
560
|
baseFontSize: _this5.getBaseFontSize()
|
|
@@ -94,6 +94,7 @@ export var ACTION;
|
|
|
94
94
|
ACTION["ON_EDITOR_READY_CALLBACK"] = "onEditorReadyCallback";
|
|
95
95
|
ACTION["ON_CHANGE_CALLBACK"] = "onChangeCalled";
|
|
96
96
|
ACTION["REMOVE_ICON"] = "removedIcon";
|
|
97
|
+
ACTION["UFO_SESSION_COMPLETE"] = "ufoSessionComplete";
|
|
97
98
|
})(ACTION || (ACTION = {}));
|
|
98
99
|
|
|
99
100
|
export var INPUT_METHOD;
|
|
@@ -234,8 +235,9 @@ export var ACTION_SUBJECT_ID;
|
|
|
234
235
|
ACTION_SUBJECT_ID["LINK"] = "link";
|
|
235
236
|
ACTION_SUBJECT_ID["LINK_PREVIEW"] = "linkPreview";
|
|
236
237
|
ACTION_SUBJECT_ID["MEDIA"] = "media";
|
|
237
|
-
ACTION_SUBJECT_ID["MEDIA_SINGLE"] = "mediaSingle";
|
|
238
238
|
ACTION_SUBJECT_ID["MEDIA_GROUP"] = "mediaGroup";
|
|
239
|
+
ACTION_SUBJECT_ID["MEDIA_INLINE"] = "mediaInline";
|
|
240
|
+
ACTION_SUBJECT_ID["MEDIA_SINGLE"] = "mediaSingle";
|
|
239
241
|
ACTION_SUBJECT_ID["MEDIA_LINK"] = "mediaLink";
|
|
240
242
|
ACTION_SUBJECT_ID["MENTION"] = "mention";
|
|
241
243
|
ACTION_SUBJECT_ID["NESTED_EXPAND"] = "nestedExpand";
|
|
@@ -55,9 +55,10 @@ var basePlugin = function basePlugin(options) {
|
|
|
55
55
|
}, {
|
|
56
56
|
name: 'frozenEditor',
|
|
57
57
|
plugin: function plugin(_ref3) {
|
|
58
|
-
var
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
var _options$inputTrackin;
|
|
59
|
+
|
|
60
|
+
var dispatchAnalyticsEvent = _ref3.dispatchAnalyticsEvent;
|
|
61
|
+
return options !== null && options !== void 0 && (_options$inputTrackin = options.inputTracking) !== null && _options$inputTrackin !== void 0 && _options$inputTrackin.enabled || options !== null && options !== void 0 && options.ufo ? frozenEditor(dispatchAnalyticsEvent, options.inputTracking, options.browserFreezeTracking, options.ufo) : undefined;
|
|
61
62
|
}
|
|
62
63
|
}, {
|
|
63
64
|
name: 'decorationPlugin',
|
|
@@ -4,14 +4,16 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
4
4
|
|
|
5
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
6
6
|
|
|
7
|
-
import { Plugin } from 'prosemirror-state';
|
|
7
|
+
import { Plugin, PluginKey } from 'prosemirror-state';
|
|
8
8
|
import { isPerformanceObserverAvailable, isPerformanceAPIAvailable, getAnalyticsEventSeverity } from '@atlaskit/editor-common';
|
|
9
|
+
import { EditorExperience, ExperienceStore } from '@atlaskit/editor-common/ufo';
|
|
9
10
|
import { ACTION, ACTION_SUBJECT, BROWSER_FREEZE_INTERACTION_TYPE, EVENT_TYPE } from '../../analytics';
|
|
10
11
|
import { getParticipantsCount } from '../../collab-edit/get-participants-count';
|
|
11
12
|
import { countNodes } from '../../../utils/count-nodes';
|
|
12
13
|
import { getContextIdentifier } from './context-identifier';
|
|
13
14
|
import { setInteractionType } from '../utils/frozen-editor';
|
|
14
15
|
import { getTimeSince } from '../../../utils/performance/get-performance-timing';
|
|
16
|
+
export var frozenEditorPluginKey = new PluginKey('frozenEditor');
|
|
15
17
|
var DEFAULT_KEYSTROKE_SAMPLING_LIMIT = 100;
|
|
16
18
|
var DEFAULT_SLOW_THRESHOLD = 300;
|
|
17
19
|
export var DEFAULT_FREEZE_THRESHOLD = 600;
|
|
@@ -42,7 +44,7 @@ var dispatchLongTaskEvent = function dispatchLongTaskEvent(dispatchAnalyticsEven
|
|
|
42
44
|
});
|
|
43
45
|
};
|
|
44
46
|
|
|
45
|
-
export default (function (dispatchAnalyticsEvent, inputTracking, browserFreezeTracking) {
|
|
47
|
+
export default (function (dispatchAnalyticsEvent, inputTracking, browserFreezeTracking, ufo) {
|
|
46
48
|
var keystrokeCount = 0;
|
|
47
49
|
var interactionType;
|
|
48
50
|
|
|
@@ -58,6 +60,7 @@ export default (function (dispatchAnalyticsEvent, inputTracking, browserFreezeTr
|
|
|
58
60
|
var severityThresholdNormal = (inputTracking === null || inputTracking === void 0 ? void 0 : inputTracking.severityNormalThreshold) || DEFAULT_TRACK_SEVERITY_THRESHOLD_NORMAL;
|
|
59
61
|
var severityThresholdDegraded = (inputTracking === null || inputTracking === void 0 ? void 0 : inputTracking.severityDegradedThreshold) || DEFAULT_TRACK_SEVERITY_THRESHOLD_DEGRADED;
|
|
60
62
|
return new Plugin({
|
|
63
|
+
key: frozenEditorPluginKey,
|
|
61
64
|
props: isPerformanceAPIAvailable() ? {
|
|
62
65
|
handleTextInput: function handleTextInput(view) {
|
|
63
66
|
var state = view.state;
|
|
@@ -67,51 +70,76 @@ export default (function (dispatchAnalyticsEvent, inputTracking, browserFreezeTr
|
|
|
67
70
|
interactionType = BROWSER_FREEZE_INTERACTION_TYPE.TYPING;
|
|
68
71
|
}
|
|
69
72
|
|
|
73
|
+
var experienceStore = ufo ? ExperienceStore.getInstance(view) : undefined;
|
|
74
|
+
var trackTyping = samplingRate && ++keystrokeCount === samplingRate;
|
|
75
|
+
|
|
76
|
+
if (trackTyping) {
|
|
77
|
+
experienceStore === null || experienceStore === void 0 ? void 0 : experienceStore.start(EditorExperience.typing);
|
|
78
|
+
}
|
|
79
|
+
|
|
70
80
|
requestAnimationFrame(function () {
|
|
71
81
|
var diff = getTimeSince(now);
|
|
72
82
|
|
|
73
|
-
if (
|
|
74
|
-
var _getContextIdentifier2;
|
|
75
|
-
|
|
83
|
+
if (diff > slowThreshold) {
|
|
76
84
|
var nodesCount = allowCountNodes ? countNodes(view.state) : {};
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
85
|
+
|
|
86
|
+
if (inputTracking !== null && inputTracking !== void 0 && inputTracking.enabled) {
|
|
87
|
+
var _getContextIdentifier2;
|
|
88
|
+
|
|
89
|
+
dispatchAnalyticsEvent({
|
|
90
|
+
action: ACTION.SLOW_INPUT,
|
|
91
|
+
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
92
|
+
attributes: _objectSpread(_objectSpread({
|
|
93
|
+
time: diff,
|
|
94
|
+
nodeSize: state.doc.nodeSize
|
|
95
|
+
}, nodesCount), {}, {
|
|
96
|
+
participants: getParticipantsCount(state),
|
|
97
|
+
objectId: (_getContextIdentifier2 = getContextIdentifier(state)) === null || _getContextIdentifier2 === void 0 ? void 0 : _getContextIdentifier2.objectId
|
|
98
|
+
}),
|
|
99
|
+
eventType: EVENT_TYPE.OPERATIONAL
|
|
100
|
+
});
|
|
93
101
|
}
|
|
94
102
|
|
|
95
|
-
|
|
103
|
+
experienceStore === null || experienceStore === void 0 ? void 0 : experienceStore.addMetadata(EditorExperience.typing, {
|
|
104
|
+
slowInput: true
|
|
105
|
+
});
|
|
96
106
|
}
|
|
97
107
|
|
|
98
|
-
if (
|
|
99
|
-
var
|
|
108
|
+
if (trackTyping) {
|
|
109
|
+
var _getContextIdentifier4;
|
|
100
110
|
|
|
101
111
|
var _nodesCount = allowCountNodes ? countNodes(view.state) : {};
|
|
102
112
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
113
|
+
keystrokeCount = 0;
|
|
114
|
+
var severity = shouldTrackSeverity ? getAnalyticsEventSeverity(diff, severityThresholdNormal, severityThresholdDegraded) : undefined;
|
|
115
|
+
|
|
116
|
+
if (inputTracking !== null && inputTracking !== void 0 && inputTracking.enabled) {
|
|
117
|
+
var _getContextIdentifier3;
|
|
118
|
+
|
|
119
|
+
var payload = {
|
|
120
|
+
action: ACTION.INPUT_PERF_SAMPLING,
|
|
121
|
+
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
122
|
+
attributes: _objectSpread(_objectSpread({
|
|
123
|
+
time: diff,
|
|
124
|
+
nodeSize: state.doc.nodeSize
|
|
125
|
+
}, _nodesCount), {}, {
|
|
126
|
+
participants: getParticipantsCount(state),
|
|
127
|
+
objectId: (_getContextIdentifier3 = getContextIdentifier(state)) === null || _getContextIdentifier3 === void 0 ? void 0 : _getContextIdentifier3.objectId,
|
|
128
|
+
severity: severity
|
|
129
|
+
}),
|
|
130
|
+
eventType: EVENT_TYPE.OPERATIONAL
|
|
131
|
+
};
|
|
132
|
+
dispatchAnalyticsEvent(payload);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
experienceStore === null || experienceStore === void 0 ? void 0 : experienceStore.success(EditorExperience.typing, _objectSpread(_objectSpread({
|
|
136
|
+
nodeSize: state.doc.nodeSize
|
|
137
|
+
}, _nodesCount), {}, {
|
|
138
|
+
participants: getParticipantsCount(state),
|
|
139
|
+
objectId: (_getContextIdentifier4 = getContextIdentifier(state)) === null || _getContextIdentifier4 === void 0 ? void 0 : _getContextIdentifier4.objectId,
|
|
140
|
+
time: diff,
|
|
141
|
+
severity: severity
|
|
142
|
+
}));
|
|
115
143
|
}
|
|
116
144
|
});
|
|
117
145
|
return false;
|
|
@@ -7,7 +7,9 @@ import styled from 'styled-components';
|
|
|
7
7
|
import { headingsSharedStyles } from '@atlaskit/editor-common';
|
|
8
8
|
import { Shortcut } from '../../../../ui/styles';
|
|
9
9
|
export var BlockTypeMenuItem = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", ";\n > {\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n margin-top: 0;\n }\n }\n ", ";\n"])), headingsSharedStyles, function (props) {
|
|
10
|
-
return
|
|
10
|
+
return (// TEMP FIX: See https://product-fabric.atlassian.net/browse/ED-13878
|
|
11
|
+
props.selected ? "".concat(props.tagName, " { color: white !important; }") : ''
|
|
12
|
+
);
|
|
11
13
|
});
|
|
12
14
|
export var KeyboardShortcut = styled(Shortcut)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", "\n margin-left: 16px;\n"])), function (props) {
|
|
13
15
|
return props.selected ? "color: ".concat(N400, ";") : '';
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
|
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
6
|
+
|
|
1
7
|
import React from 'react';
|
|
2
8
|
import { inlineCard, blockCard, embedCard } from '@atlaskit/adf-schema';
|
|
3
9
|
import { createPlugin } from './pm-plugins/main';
|
|
@@ -26,13 +32,18 @@ var cardPlugin = function cardPlugin(options) {
|
|
|
26
32
|
return nodes;
|
|
27
33
|
},
|
|
28
34
|
pmPlugins: function pmPlugins() {
|
|
29
|
-
var _options$allowResizin, _options$useAlternati;
|
|
35
|
+
var _options$allowBlockCa, _options$allowResizin, _options$useAlternati;
|
|
30
36
|
|
|
37
|
+
var allowBlockCards = (_options$allowBlockCa = options.allowBlockCards) !== null && _options$allowBlockCa !== void 0 ? _options$allowBlockCa : true;
|
|
31
38
|
var allowResizing = (_options$allowResizin = options.allowResizing) !== null && _options$allowResizin !== void 0 ? _options$allowResizin : true;
|
|
32
39
|
var useAlternativePreloader = (_options$useAlternati = options.useAlternativePreloader) !== null && _options$useAlternati !== void 0 ? _options$useAlternati : true;
|
|
33
40
|
return [{
|
|
34
41
|
name: 'card',
|
|
35
|
-
plugin: createPlugin(
|
|
42
|
+
plugin: createPlugin(_objectSpread(_objectSpread({}, options), {}, {
|
|
43
|
+
allowBlockCards: allowBlockCards,
|
|
44
|
+
allowResizing: allowResizing,
|
|
45
|
+
useAlternativePreloader: useAlternativePreloader
|
|
46
|
+
}))
|
|
36
47
|
}];
|
|
37
48
|
},
|
|
38
49
|
contentComponent: function contentComponent(_ref) {
|
|
@@ -258,6 +258,7 @@ export var EmbedCardComponent = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
258
258
|
|
|
259
259
|
var containerWidth = isRichMediaInsideOfBlockNode(view, pos) ? lineLength : widthStateWidth;
|
|
260
260
|
var smartCard = /*#__PURE__*/React.createElement(SmartCard, {
|
|
261
|
+
key: url,
|
|
261
262
|
url: url,
|
|
262
263
|
appearance: "embed",
|
|
263
264
|
onClick: _this2.onClick,
|
|
@@ -8,12 +8,17 @@ import { EmbedCard } from '../nodeviews/embedCard';
|
|
|
8
8
|
import { BlockCard } from '../nodeviews/blockCard';
|
|
9
9
|
import { InlineCard } from '../nodeviews/inlineCard';
|
|
10
10
|
export { pluginKey } from './plugin-key';
|
|
11
|
-
export var createPlugin = function createPlugin(
|
|
11
|
+
export var createPlugin = function createPlugin(options) {
|
|
12
12
|
return function (_ref) {
|
|
13
13
|
var portalProviderAPI = _ref.portalProviderAPI,
|
|
14
14
|
eventDispatcher = _ref.eventDispatcher,
|
|
15
15
|
providerFactory = _ref.providerFactory,
|
|
16
16
|
dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent;
|
|
17
|
+
var platform = options.platform,
|
|
18
|
+
allowResizing = options.allowResizing,
|
|
19
|
+
useAlternativePreloader = options.useAlternativePreloader,
|
|
20
|
+
fullWidthMode = options.fullWidthMode,
|
|
21
|
+
createAnalyticsEvent = options.createAnalyticsEvent;
|
|
17
22
|
return new Plugin({
|
|
18
23
|
state: {
|
|
19
24
|
init: function init() {
|
|
@@ -71,7 +76,7 @@ export var createPlugin = function createPlugin(platform, allowResizing, useAlte
|
|
|
71
76
|
* other tasks as per common implementations of the JavaScript event loop in browsers.
|
|
72
77
|
*/
|
|
73
78
|
var invoke = rafSchedule(function () {
|
|
74
|
-
return resolveWithProvider(view, outstandingRequests, provider, request);
|
|
79
|
+
return resolveWithProvider(view, outstandingRequests, provider, request, options);
|
|
75
80
|
});
|
|
76
81
|
rafCancellationCallbacks.push(invoke.cancel);
|
|
77
82
|
invoke();
|
|
@@ -1,21 +1,28 @@
|
|
|
1
1
|
import { setProvider } from '../actions';
|
|
2
|
-
import { replaceQueuedUrlWithCard, handleFallbackWithAnalytics } from '../doc';
|
|
2
|
+
import { replaceQueuedUrlWithCard, handleFallbackWithAnalytics } from '../doc';
|
|
3
|
+
// ============================================================================ //
|
|
3
4
|
// ============================== PROVIDER UTILS ============================== //
|
|
4
5
|
// ============================================================================ //
|
|
5
6
|
// Used for all interactions with the EditorCardProvider.
|
|
6
7
|
// ============================================================================ //
|
|
7
|
-
|
|
8
|
-
export var resolveWithProvider = function resolveWithProvider(view, outstandingRequests, provider, request) {
|
|
8
|
+
export var resolveWithProvider = function resolveWithProvider(view, outstandingRequests, provider, request, options) {
|
|
9
9
|
var handleResolve = provider.resolve(request.url, request.appearance).then(function (resolvedCard) {
|
|
10
10
|
delete outstandingRequests[request.url];
|
|
11
11
|
return resolvedCard;
|
|
12
|
-
}).then(handleResolved(view, request), handleRejected(view, request));
|
|
12
|
+
}).then(handleResolved(view, request, options), handleRejected(view, request));
|
|
13
13
|
outstandingRequests[request.url] = handleResolve;
|
|
14
14
|
return handleResolve;
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var updateCardType = function updateCardType(resolvedCard, options) {
|
|
18
|
+
if ((resolvedCard === null || resolvedCard === void 0 ? void 0 : resolvedCard.type) === 'blockCard' && !options.allowBlockCards || (resolvedCard === null || resolvedCard === void 0 ? void 0 : resolvedCard.type) === 'embedCard' && !options.allowEmbeds) {
|
|
19
|
+
resolvedCard.type = 'inlineCard';
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
var handleResolved = function handleResolved(view, request, options) {
|
|
18
24
|
return function (resolvedCard) {
|
|
25
|
+
updateCardType(resolvedCard, options);
|
|
19
26
|
replaceQueuedUrlWithCard(request.url, resolvedCard, request.analyticsAction)(view.state, view.dispatch);
|
|
20
27
|
return resolvedCard;
|
|
21
28
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createPlugin } from './pm-plugins/main';
|
|
2
|
+
|
|
3
|
+
var codeBidiWarning = function codeBidiWarning() {
|
|
4
|
+
return {
|
|
5
|
+
name: 'codeBidiWarning',
|
|
6
|
+
pmPlugins: function pmPlugins() {
|
|
7
|
+
return [{
|
|
8
|
+
name: 'codeBidiWarning',
|
|
9
|
+
plugin: function plugin(options) {
|
|
10
|
+
return createPlugin(options);
|
|
11
|
+
}
|
|
12
|
+
}];
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default codeBidiWarning;
|