@atlaskit/editor-core 165.0.0 → 166.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +43 -0
- package/dist/cjs/actions/index.js +9 -0
- package/dist/cjs/create-editor/ReactEditorView.js +14 -6
- package/dist/cjs/create-editor/create-plugins-list.js +1 -2
- package/dist/cjs/editor.js +13 -0
- package/dist/cjs/event-dispatcher/index.js +9 -0
- package/dist/cjs/nodeviews/ReactNodeView.js +1 -11
- package/dist/cjs/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
- package/dist/cjs/plugins/analytics/types/enums.js +1 -0
- package/dist/cjs/plugins/annotation/pm-plugins/inline-comment.js +2 -2
- package/dist/cjs/plugins/base/pm-plugins/frozen-editor.js +128 -79
- package/dist/cjs/plugins/base/utils/input-latency-tracking.js +157 -0
- package/dist/cjs/plugins/card/styles.js +3 -1
- package/dist/cjs/plugins/code-block/styles.js +6 -4
- package/dist/cjs/plugins/collab-edit/index.js +2 -2
- package/dist/cjs/plugins/collab-edit/plugin-state.js +23 -5
- package/dist/cjs/plugins/collab-edit/provider/channel.js +2 -2
- package/dist/cjs/plugins/date/styles.js +3 -1
- package/dist/cjs/plugins/emoji/index.js +30 -34
- package/dist/cjs/plugins/emoji/nodeviews/emoji.js +12 -66
- package/dist/cjs/plugins/emoji/styles.js +3 -17
- package/dist/cjs/plugins/expand/ui/styles.js +2 -2
- package/dist/cjs/plugins/extension/context-panel.js +2 -2
- package/dist/cjs/plugins/extension/pm-plugins/main.js +2 -2
- package/dist/cjs/plugins/extension/ui/styles.js +3 -1
- package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +20 -22
- package/dist/cjs/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +2 -2
- package/dist/cjs/plugins/hyperlink/pm-plugins/input-rule.js +1 -9
- package/dist/cjs/plugins/hyperlink/pm-plugins/keymap.js +1 -9
- package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +2 -2
- package/dist/cjs/plugins/layout/styles.js +3 -1
- package/dist/cjs/plugins/list/commands/indent-list.js +5 -1
- package/dist/cjs/plugins/list/commands/outdent-list.js +5 -1
- package/dist/cjs/plugins/list/transforms.js +11 -3
- package/dist/cjs/plugins/macro/actions.js +2 -2
- package/dist/cjs/plugins/media/nodeviews/mediaInline.js +2 -2
- package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +2 -2
- package/dist/cjs/plugins/media/styles.js +3 -1
- package/dist/cjs/plugins/media/ui/ResizableMediaSingle/index.js +2 -2
- package/dist/cjs/plugins/mentions/index.js +10 -14
- package/dist/cjs/plugins/mentions/nodeviews/mention.js +15 -67
- package/dist/cjs/plugins/mentions/pm-plugins/main.js +19 -10
- package/dist/cjs/plugins/mentions/type-ahead/index.js +7 -2
- package/dist/cjs/plugins/panel/styles.js +3 -1
- package/dist/cjs/plugins/placeholder-text/placeholder-text-nodeview.js +3 -1
- package/dist/cjs/plugins/rule/styles.js +3 -1
- package/dist/cjs/plugins/selection/utils.js +39 -23
- package/dist/cjs/plugins/table/event-handlers.js +3 -3
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +24 -0
- package/dist/cjs/plugins/table/ui/common-styles.js +1 -1
- package/dist/cjs/plugins/table/ui/consts.js +6 -4
- package/dist/cjs/plugins/tasks-and-decisions/styles.js +3 -1
- package/dist/cjs/plugins/text-formatting/utils.js +1 -1
- package/dist/cjs/plugins/type-ahead/index.js +6 -2
- package/dist/cjs/plugins/unsupported-content/index.js +22 -10
- package/dist/cjs/plugins/unsupported-content/styles.js +4 -2
- package/dist/cjs/plugins/unsupported-content/unsupported-inline-node-view.js +21 -0
- package/dist/cjs/ui/Appearance/Chromeless.js +6 -3
- package/dist/cjs/ui/Appearance/Comment/Comment.js +6 -4
- package/dist/cjs/ui/ChromeCollapsed/styles.js +3 -1
- package/dist/cjs/ui/ConfigPanel/ConfigPanel.js +2 -2
- package/dist/cjs/ui/ConfigPanel/Fields/CustomSelect.js +2 -2
- package/dist/cjs/ui/ConfigPanel/Fields/UserSelect.js +2 -2
- package/dist/cjs/ui/ConfigPanel/transformers.js +2 -2
- package/dist/cjs/ui/ContentStyles/index.js +2 -2
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/actions/index.js +12 -1
- package/dist/es2019/create-editor/ReactEditorView.js +14 -6
- package/dist/es2019/create-editor/create-plugins-list.js +1 -2
- package/dist/es2019/editor.js +14 -0
- package/dist/es2019/event-dispatcher/index.js +8 -0
- package/dist/es2019/nodeviews/ReactNodeView.js +1 -10
- package/dist/es2019/nodeviews/getInlineNodeViewProducer.styles.js +9 -0
- package/dist/es2019/plugins/analytics/types/enums.js +1 -0
- package/dist/es2019/plugins/base/pm-plugins/frozen-editor.js +138 -80
- package/dist/es2019/plugins/base/utils/input-latency-tracking.js +128 -0
- package/dist/es2019/plugins/card/styles.js +9 -5
- package/dist/es2019/plugins/code-block/styles.js +11 -8
- package/dist/es2019/plugins/collab-edit/plugin-state.js +23 -8
- package/dist/es2019/plugins/date/styles.js +3 -1
- package/dist/es2019/plugins/emoji/index.js +16 -21
- package/dist/es2019/plugins/emoji/nodeviews/emoji.js +12 -31
- package/dist/es2019/plugins/emoji/styles.js +1 -82
- package/dist/es2019/plugins/expand/ui/styles.js +2 -2
- package/dist/es2019/plugins/extension/ui/styles.js +4 -2
- package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +20 -22
- package/dist/es2019/plugins/hyperlink/pm-plugins/input-rule.js +1 -8
- package/dist/es2019/plugins/hyperlink/pm-plugins/keymap.js +1 -8
- package/dist/es2019/plugins/layout/styles.js +3 -2
- package/dist/es2019/plugins/list/commands/indent-list.js +4 -1
- package/dist/es2019/plugins/list/commands/outdent-list.js +4 -1
- package/dist/es2019/plugins/list/transforms.js +9 -4
- package/dist/es2019/plugins/media/styles.js +9 -7
- package/dist/es2019/plugins/mentions/index.js +1 -6
- package/dist/es2019/plugins/mentions/nodeviews/mention.js +16 -35
- package/dist/es2019/plugins/mentions/pm-plugins/main.js +18 -10
- package/dist/es2019/plugins/mentions/type-ahead/index.js +7 -2
- package/dist/es2019/plugins/panel/styles.js +5 -4
- package/dist/es2019/plugins/placeholder-text/placeholder-text-nodeview.js +3 -1
- package/dist/es2019/plugins/rule/styles.js +2 -1
- package/dist/es2019/plugins/selection/utils.js +35 -20
- package/dist/es2019/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +22 -0
- package/dist/es2019/plugins/table/ui/common-styles.js +4 -0
- package/dist/es2019/plugins/table/ui/consts.js +5 -4
- package/dist/es2019/plugins/tasks-and-decisions/styles.js +4 -2
- package/dist/es2019/plugins/text-formatting/utils.js +1 -1
- package/dist/es2019/plugins/type-ahead/index.js +5 -1
- package/dist/es2019/plugins/unsupported-content/index.js +23 -12
- package/dist/es2019/plugins/unsupported-content/styles.js +5 -3
- package/dist/es2019/plugins/unsupported-content/unsupported-inline-node-view.js +7 -0
- package/dist/es2019/ui/Appearance/Chromeless.js +5 -2
- package/dist/es2019/ui/Appearance/Comment/Comment.js +5 -2
- package/dist/es2019/ui/ChromeCollapsed/styles.js +2 -1
- package/dist/es2019/ui/ContentStyles/index.js +3 -3
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/actions/index.js +9 -1
- package/dist/esm/create-editor/ErrorBoundary.js +1 -1
- package/dist/esm/create-editor/ReactEditorView.js +14 -6
- package/dist/esm/create-editor/create-plugins-list.js +1 -2
- package/dist/esm/editor.js +16 -1
- package/dist/esm/event-dispatcher/index.js +9 -0
- package/dist/esm/nodeviews/ReactNodeView.js +1 -10
- package/dist/esm/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
- package/dist/esm/plugins/analytics/types/enums.js +1 -0
- package/dist/esm/plugins/annotation/pm-plugins/inline-comment.js +1 -1
- package/dist/esm/plugins/base/pm-plugins/frozen-editor.js +128 -79
- package/dist/esm/plugins/base/utils/input-latency-tracking.js +149 -0
- package/dist/esm/plugins/card/styles.js +2 -1
- package/dist/esm/plugins/code-block/styles.js +5 -4
- package/dist/esm/plugins/collab-edit/index.js +1 -1
- package/dist/esm/plugins/collab-edit/plugin-state.js +21 -6
- package/dist/esm/plugins/collab-edit/provider/channel.js +1 -1
- package/dist/esm/plugins/custom-autoformat/doc.js +1 -1
- package/dist/esm/plugins/custom-autoformat/index.js +1 -1
- package/dist/esm/plugins/date/styles.js +2 -1
- package/dist/esm/plugins/emoji/index.js +26 -29
- package/dist/esm/plugins/emoji/nodeviews/emoji.js +11 -56
- package/dist/esm/plugins/emoji/styles.js +3 -14
- package/dist/esm/plugins/expand/ui/styles.js +2 -2
- package/dist/esm/plugins/extension/actions.js +1 -1
- package/dist/esm/plugins/extension/context-panel.js +1 -1
- package/dist/esm/plugins/extension/pm-plugins/main.js +1 -1
- package/dist/esm/plugins/extension/ui/Extension/ExtensionComponent.js +1 -1
- package/dist/esm/plugins/extension/ui/styles.js +2 -1
- package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +20 -22
- package/dist/esm/plugins/feedback-dialog/index.js +1 -1
- package/dist/esm/plugins/feedback-dialog/loadJiraCollectorDialogScript.js +1 -1
- package/dist/esm/plugins/find-replace/utils/batch-decorations.js +1 -1
- package/dist/esm/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +1 -1
- package/dist/esm/plugins/hyperlink/HyperlinkToolbarAppearance.js +1 -1
- package/dist/esm/plugins/hyperlink/pm-plugins/input-rule.js +1 -8
- package/dist/esm/plugins/hyperlink/pm-plugins/keymap.js +1 -8
- package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +2 -1
- package/dist/esm/plugins/image-upload/pm-plugins/main.js +1 -1
- package/dist/esm/plugins/layout/styles.js +2 -1
- package/dist/esm/plugins/list/commands/indent-list.js +4 -1
- package/dist/esm/plugins/list/commands/outdent-list.js +4 -1
- package/dist/esm/plugins/list/transforms.js +9 -4
- package/dist/esm/plugins/macro/actions.js +1 -1
- package/dist/esm/plugins/media/nodeviews/mediaGroup.js +1 -1
- package/dist/esm/plugins/media/nodeviews/mediaInline.js +2 -1
- package/dist/esm/plugins/media/nodeviews/mediaNodeUpdater.js +1 -1
- package/dist/esm/plugins/media/nodeviews/mediaNodeView/media.js +1 -1
- package/dist/esm/plugins/media/nodeviews/mediaSingle.js +1 -1
- package/dist/esm/plugins/media/picker-facade.js +1 -1
- package/dist/esm/plugins/media/pm-plugins/main.js +1 -1
- package/dist/esm/plugins/media/styles.js +2 -1
- package/dist/esm/plugins/media/toolbar/utils.js +1 -1
- package/dist/esm/plugins/media/ui/MediaPicker/PickerFacadeProvider.js +1 -1
- package/dist/esm/plugins/media/ui/ResizableMediaSingle/index.js +1 -1
- package/dist/esm/plugins/media/utils/check-media-type.js +1 -1
- package/dist/esm/plugins/mentions/index.js +10 -14
- package/dist/esm/plugins/mentions/nodeviews/mention.js +13 -58
- package/dist/esm/plugins/mentions/pm-plugins/main.js +18 -10
- package/dist/esm/plugins/mentions/type-ahead/index.js +7 -2
- package/dist/esm/plugins/panel/styles.js +2 -1
- package/dist/esm/plugins/paste/handlers.js +1 -1
- package/dist/esm/plugins/paste/pm-plugins/main.js +1 -1
- package/dist/esm/plugins/placeholder-text/placeholder-text-nodeview.js +3 -1
- package/dist/esm/plugins/quick-insert/index.js +1 -1
- package/dist/esm/plugins/rule/styles.js +2 -1
- package/dist/esm/plugins/selection/utils.js +35 -20
- package/dist/esm/plugins/table/event-handlers.js +3 -3
- package/dist/esm/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +23 -0
- package/dist/esm/plugins/table/ui/common-styles.js +1 -1
- package/dist/esm/plugins/table/ui/consts.js +5 -4
- package/dist/esm/plugins/tasks-and-decisions/styles.js +2 -1
- package/dist/esm/plugins/tasks-and-decisions/ui/Task/task-item-with-providers.js +1 -1
- package/dist/esm/plugins/text-formatting/utils.js +1 -1
- package/dist/esm/plugins/type-ahead/index.js +6 -2
- package/dist/esm/plugins/unsupported-content/index.js +21 -11
- package/dist/esm/plugins/unsupported-content/styles.js +3 -2
- package/dist/esm/plugins/unsupported-content/unsupported-inline-node-view.js +7 -0
- package/dist/esm/ui/Appearance/Chromeless.js +6 -3
- package/dist/esm/ui/Appearance/Comment/Comment.js +6 -4
- package/dist/esm/ui/ChromeCollapsed/styles.js +2 -1
- package/dist/esm/ui/ConfigPanel/ConfigPanel.js +1 -1
- package/dist/esm/ui/ConfigPanel/Fields/CustomSelect.js +1 -1
- package/dist/esm/ui/ConfigPanel/Fields/UserSelect.js +1 -1
- package/dist/esm/ui/ConfigPanel/FormErrorBoundary.js +1 -1
- package/dist/esm/ui/ConfigPanel/transformers.js +1 -1
- package/dist/esm/ui/ContentStyles/index.js +3 -3
- package/dist/esm/ui/LinkSearch/index.js +1 -1
- package/dist/esm/ui/ToolbarFeedback/index.js +1 -1
- package/dist/esm/utils/action.js +1 -1
- package/dist/esm/utils/clipboard.js +1 -1
- package/dist/esm/utils/extensions.js +1 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/actions/index.d.ts +3 -1
- package/dist/types/editor.d.ts +3 -0
- package/dist/types/event-dispatcher/index.d.ts +1 -0
- package/dist/types/nodeviews/ReactNodeView.d.ts +1 -5
- package/dist/types/plugins/analytics/types/enums.d.ts +1 -0
- package/dist/types/plugins/analytics/types/events.d.ts +2 -2
- package/dist/types/plugins/analytics/types/general-events.d.ts +10 -1
- package/dist/types/plugins/base/utils/input-latency-tracking.d.ts +44 -0
- package/dist/types/plugins/collab-edit/plugin-state.d.ts +4 -0
- package/dist/types/plugins/emoji/index.d.ts +2 -6
- package/dist/types/plugins/emoji/nodeviews/emoji.d.ts +4 -14
- package/dist/types/plugins/emoji/styles.d.ts +0 -1
- package/dist/types/plugins/emoji/types.d.ts +0 -1
- package/dist/types/plugins/list/transforms.d.ts +10 -1
- package/dist/types/plugins/mentions/nodeviews/mention.d.ts +6 -14
- package/dist/types/plugins/mentions/pm-plugins/main.d.ts +2 -5
- package/dist/types/plugins/selection/utils.d.ts +7 -15
- package/dist/types/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.d.ts +3 -0
- package/dist/types/plugins/table/ui/consts.d.ts +2 -2
- package/dist/types/plugins/type-ahead/types.d.ts +1 -0
- package/dist/types/plugins/unsupported-content/unsupported-inline-node-view.d.ts +11 -0
- package/dist/types/types/editor-appearance-component.d.ts +1 -0
- package/dist/types/types/editor-props.d.ts +1 -0
- package/dist/types/types/feature-flags.d.ts +0 -14
- package/dist/types/ui/Appearance/Chromeless.d.ts +1 -0
- package/dist/types/ui/Appearance/Comment/Comment.d.ts +1 -0
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +4 -4
- package/dist/types/ui/ContentStyles/index.d.ts +2 -2
- package/package.json +23 -23
- package/dist/cjs/plugins/emoji/nodeviews/emoji-next.js +0 -250
- package/dist/es2019/plugins/emoji/nodeviews/emoji-next.js +0 -177
- package/dist/esm/plugins/emoji/nodeviews/emoji-next.js +0 -234
- package/dist/types/plugins/emoji/nodeviews/emoji-next.d.ts +0 -31
|
@@ -17,7 +17,9 @@ var _constants = require("@atlaskit/theme/constants");
|
|
|
17
17
|
|
|
18
18
|
var _colors = require("@atlaskit/theme/colors");
|
|
19
19
|
|
|
20
|
+
var _tokens = require("@atlaskit/tokens");
|
|
21
|
+
|
|
20
22
|
var _templateObject;
|
|
21
23
|
|
|
22
|
-
var inputStyle = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n /* Normal .className gets overridden by input[type=text] hence this hack to produce input.className */\n input& {\n background-color: white;\n border: 1px solid ", ";\n border-radius: ", "px;\n box-sizing: border-box;\n height: 40px;\n padding-left: 20px;\n padding-top: 12px;\n padding-bottom: 12px;\n font-size: ", ";\n width: 100%;\n font-weight: 400;\n line-height: 1.42857142857143;\n letter-spacing: -0.005em;\n color: ", ";\n\n &:hover {\n border-color: ", ";\n cursor: text;\n }\n }\n"])), _editorSharedStyles.akEditorSubtleAccent, (0, _constants.borderRadius)(), (0, _editorSharedStyles.relativeFontSizeToBase16)(14), _colors.N300, _colors.N50);
|
|
24
|
+
var inputStyle = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n /* Normal .className gets overridden by input[type=text] hence this hack to produce input.className */\n input& {\n background-color: white;\n border: 1px solid ", ";\n border-radius: ", "px;\n box-sizing: border-box;\n height: 40px;\n padding-left: 20px;\n padding-top: 12px;\n padding-bottom: 12px;\n font-size: ", ";\n width: 100%;\n font-weight: 400;\n line-height: 1.42857142857143;\n letter-spacing: -0.005em;\n color: ", ";\n\n &:hover {\n border-color: ", ";\n cursor: text;\n }\n }\n"])), (0, _tokens.token)('color.border.input', _editorSharedStyles.akEditorSubtleAccent), (0, _constants.borderRadius)(), (0, _editorSharedStyles.relativeFontSizeToBase16)(14), _colors.N300, _colors.N50);
|
|
23
25
|
exports.inputStyle = inputStyle;
|
|
@@ -9,10 +9,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
});
|
|
10
10
|
exports.default = void 0;
|
|
11
11
|
|
|
12
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
-
|
|
14
12
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
15
13
|
|
|
14
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
15
|
+
|
|
16
16
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
17
17
|
|
|
18
18
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
@@ -9,10 +9,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
});
|
|
10
10
|
exports.default = void 0;
|
|
11
11
|
|
|
12
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
-
|
|
14
12
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
15
13
|
|
|
14
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
15
|
+
|
|
16
16
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
17
17
|
|
|
18
18
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
@@ -9,10 +9,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
});
|
|
10
10
|
exports.default = UserSelect;
|
|
11
11
|
|
|
12
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
-
|
|
14
12
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
15
13
|
|
|
14
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
15
|
+
|
|
16
16
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
17
17
|
|
|
18
18
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
@@ -7,10 +7,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.serialize = exports.findDuplicateFields = exports.deserialize = void 0;
|
|
9
9
|
|
|
10
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
-
|
|
12
10
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
13
11
|
|
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
|
+
|
|
14
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
15
|
|
|
16
16
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
@@ -86,11 +86,11 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
86
86
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
87
87
|
|
|
88
88
|
var contentStyles = function contentStyles(props) {
|
|
89
|
-
var _props$featureFlags
|
|
89
|
+
var _props$featureFlags;
|
|
90
90
|
|
|
91
91
|
return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror {\n outline: none;\n font-size: ", "px;\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n }\n\n .ProseMirror[contenteditable='false'] .taskItemView-content-wrap {\n pointer-events: none;\n opacity: 0.7;\n }\n\n .ProseMirror-hideselection *::selection {\n background: transparent;\n }\n\n .ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n }\n\n .ProseMirror-selectednode {\n outline: none;\n }\n\n .ProseMirror-selectednode:empty {\n outline: 2px solid #8cf;\n }\n\n ", "\n ", "\n ", "\n\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\n .panelView-content-wrap {\n box-sizing: border-box;\n }\n\n .mediaGroupView-content-wrap ul {\n padding: 0;\n }\n\n /** Needed to override any cleared floats, e.g. image wrapping */\n\n div.fabric-editor-block-mark[class^='fabric-editor-align'] {\n clear: none !important;\n }\n\n .fabric-editor-align-end {\n text-align: right;\n }\n\n .fabric-editor-align-start {\n text-align: left;\n }\n\n .fabric-editor-align-center {\n text-align: center;\n }\n\n .pm-table-header-content-wrap,\n .pm-table-cell-content-wrap div.fabric-editor-block-mark {\n p:first-child {\n margin-top: 0;\n }\n }\n\n .hyperlink-floating-toolbar,\n .", " {\n padding: 0;\n }\n\n /* Link icon in the Atlaskit package\n is bigger than the others\n */\n .hyperlink-open-link {\n svg {\n max-width: 18px;\n }\n &[href] {\n padding: 0 4px;\n }\n }\n"])), (0, _editorSharedStyles.editorFontSize)({
|
|
92
92
|
theme: props.theme
|
|
93
|
-
}), _styles.whitespaceSharedStyles, _styles.paragraphSharedStyles, _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.shadowSharedStyle, _getInlineNodeViewProducer.InlineNodeViewSharedStyles, _styles17.placeholderTextStyles, _styles5.placeholderStyles, (_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.codeBlockSyntaxHighlighting ? (0, _styles7.highlightingCodeBlockStyles)(props) : (0, _styles7.codeBlockStyles)(props), (0, _styles6.blocktypeStyles)(props), (0, _styles16.textFormattingStyles)(props), _styles.textColorStyles, _styles8.listsStyles, (0, _styles9.ruleStyles)(props), _styles10.mediaStyles, _styles11.layoutStyles, _styles3.telepointerStyle, _styles4.gapCursorStyles, (0, _commonStyles.tableStyles)(props), (0, _styles12.panelStyles)(props), _styles13.fakeCursorStyles, _styles14.mentionsStyles,
|
|
93
|
+
}), _styles.whitespaceSharedStyles, _styles.paragraphSharedStyles, _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.shadowSharedStyle, _getInlineNodeViewProducer.InlineNodeViewSharedStyles, _styles17.placeholderTextStyles, _styles5.placeholderStyles, (_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.codeBlockSyntaxHighlighting ? (0, _styles7.highlightingCodeBlockStyles)(props) : (0, _styles7.codeBlockStyles)(props), (0, _styles6.blocktypeStyles)(props), (0, _styles16.textFormattingStyles)(props), _styles.textColorStyles, _styles8.listsStyles, (0, _styles9.ruleStyles)(props), _styles10.mediaStyles, _styles11.layoutStyles, _styles3.telepointerStyle, _styles4.gapCursorStyles, (0, _commonStyles.tableStyles)(props), (0, _styles12.panelStyles)(props), _styles13.fakeCursorStyles, _styles14.mentionsStyles, _styles15.emojiStyles, _styles.tasksAndDecisionsStyles, _styles18.gridStyles, _styles19.linkStyles, _styles.blockMarksSharedStyles, _styles.dateSharedStyle, _styles20.extensionStyles, (0, _styles21.expandStyles)(props), _styles22.findReplaceStyles, _styles23.taskDecisionStyles, _styles24.statusStyles, (0, _styles.annotationSharedStyles)(props), _styles25.smartCardStyles, _styles.smartCardSharedStyles, _styles26.dateStyles, _styled.embedCardStyles, _styles2.unsupportedStyles, _style.ClassNames.FLOATING_TOOLBAR_COMPONENT);
|
|
94
94
|
};
|
|
95
95
|
|
|
96
96
|
var createEditorContentStyle = function createEditorContentStyle(styles) {
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.version = exports.nextMajorVersion = exports.name = void 0;
|
|
7
7
|
var name = "@atlaskit/editor-core";
|
|
8
8
|
exports.name = name;
|
|
9
|
-
var version = "
|
|
9
|
+
var version = "166.0.2";
|
|
10
10
|
exports.version = version;
|
|
11
11
|
|
|
12
12
|
var nextMajorVersion = function nextMajorVersion() {
|
package/dist/cjs/version.json
CHANGED
|
@@ -10,6 +10,7 @@ import { analyticsEventKey } from '@atlaskit/editor-common/utils';
|
|
|
10
10
|
import { findNodePosWithLocalId } from '../plugins/extension/utils';
|
|
11
11
|
import { getFeatureFlags } from '../plugins/feature-flags-context/get-feature-flags';
|
|
12
12
|
import { getCollabProvider } from '../plugins/collab-edit/native-collab-provider-plugin';
|
|
13
|
+
import deprecationWarnings from '../utils/deprecation-warnings';
|
|
13
14
|
export default class EditorActions {
|
|
14
15
|
constructor() {
|
|
15
16
|
_defineProperty(this, "listeners", []);
|
|
@@ -196,7 +197,17 @@ export default class EditorActions {
|
|
|
196
197
|
return isEmptyDocument(this.editorView.state.doc);
|
|
197
198
|
}
|
|
198
199
|
|
|
199
|
-
replaceDocument(rawValue, shouldScrollToBottom = true,
|
|
200
|
+
replaceDocument(rawValue, shouldScrollToBottom = true,
|
|
201
|
+
/** @deprecated [ED-14158] shouldAddToHistory is not being used in this function */
|
|
202
|
+
shouldAddToHistory = true) {
|
|
203
|
+
deprecationWarnings('EditorActions.replaceDocument', {
|
|
204
|
+
shouldAddToHistory
|
|
205
|
+
}, [{
|
|
206
|
+
property: 'shouldAddToHistory',
|
|
207
|
+
description: '[ED-14158] EditorActions.replaceDocument does not use the shouldAddToHistory arg',
|
|
208
|
+
type: 'removed'
|
|
209
|
+
}]);
|
|
210
|
+
|
|
200
211
|
if (!this.editorView || rawValue === undefined || rawValue === null) {
|
|
201
212
|
return false;
|
|
202
213
|
}
|
|
@@ -534,9 +534,20 @@ export class ReactEditorView extends React.Component {
|
|
|
534
534
|
config: this.config,
|
|
535
535
|
eventDispatcher: this.eventDispatcher,
|
|
536
536
|
transformer: this.contentTransformer
|
|
537
|
-
});
|
|
537
|
+
}); // Allows us to dispatch analytics within the plugin view.destory methods
|
|
538
|
+
|
|
539
|
+
const analyticsConnected = this.eventDispatcher.has(analyticsEventKey, this.handleAnalyticsEvent);
|
|
540
|
+
|
|
541
|
+
if (!analyticsConnected) {
|
|
542
|
+
this.eventDispatcher.on(analyticsEventKey, this.handleAnalyticsEvent);
|
|
543
|
+
}
|
|
544
|
+
|
|
538
545
|
this.view.destroy(); // Destroys the dom node & all node views
|
|
539
546
|
|
|
547
|
+
if (!analyticsConnected) {
|
|
548
|
+
this.eventDispatcher.off(analyticsEventKey, this.handleAnalyticsEvent);
|
|
549
|
+
}
|
|
550
|
+
|
|
540
551
|
this.view = undefined;
|
|
541
552
|
}
|
|
542
553
|
});
|
|
@@ -667,7 +678,6 @@ export class ReactEditorView extends React.Component {
|
|
|
667
678
|
// This serves to avoid potential runtime exceptions which could arise
|
|
668
679
|
// from an async dispatched transaction after it's unmounted.
|
|
669
680
|
this.canDispatchTransactions = false;
|
|
670
|
-
this.eventDispatcher.destroy();
|
|
671
681
|
clearTimeout(this.focusTimeoutId);
|
|
672
682
|
|
|
673
683
|
if (this.reliabilityInterval) {
|
|
@@ -686,11 +696,9 @@ export class ReactEditorView extends React.Component {
|
|
|
686
696
|
state.destroy();
|
|
687
697
|
}
|
|
688
698
|
});
|
|
689
|
-
}
|
|
690
|
-
|
|
699
|
+
}
|
|
691
700
|
|
|
692
|
-
this.eventDispatcher.
|
|
693
|
-
this.eventDispatcher.off('resetEditorState', this.resetEditorState);
|
|
701
|
+
this.eventDispatcher.destroy(); // this.view will be destroyed when React unmounts in handleEditorViewRef
|
|
694
702
|
} // Helper to allow tests to inject plugins directly
|
|
695
703
|
|
|
696
704
|
|
|
@@ -192,8 +192,7 @@ export default function createPluginsList(props, prevProps, createAnalyticsEvent
|
|
|
192
192
|
|
|
193
193
|
if (props.emojiProvider) {
|
|
194
194
|
preset.add([emojiPlugin, {
|
|
195
|
-
createAnalyticsEvent
|
|
196
|
-
allowZeroWidthSpaceAfter: !isMobile
|
|
195
|
+
createAnalyticsEvent
|
|
197
196
|
}]);
|
|
198
197
|
}
|
|
199
198
|
|
package/dist/es2019/editor.js
CHANGED
|
@@ -497,6 +497,7 @@ export default class Editor extends React.Component {
|
|
|
497
497
|
eventDispatcher: eventDispatcher,
|
|
498
498
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
499
499
|
maxHeight: this.props.maxHeight,
|
|
500
|
+
minHeight: this.props.minHeight,
|
|
500
501
|
onSave: this.props.onSave ? this.handleSave : undefined,
|
|
501
502
|
onCancel: this.props.onCancel,
|
|
502
503
|
popupsMountPoint: this.props.popupsMountPoint,
|
|
@@ -536,6 +537,19 @@ _defineProperty(Editor, "defaultProps", {
|
|
|
536
537
|
quickInsert: true
|
|
537
538
|
});
|
|
538
539
|
|
|
540
|
+
_defineProperty(Editor, "propTypes", {
|
|
541
|
+
minHeight: ({
|
|
542
|
+
appearance,
|
|
543
|
+
minHeight
|
|
544
|
+
}) => {
|
|
545
|
+
if (minHeight && appearance && !['comment', 'chromeless'].includes(appearance)) {
|
|
546
|
+
return new Error('minHeight only supports editor appearance chromeless and comment');
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
return null;
|
|
550
|
+
}
|
|
551
|
+
});
|
|
552
|
+
|
|
539
553
|
_defineProperty(Editor, "contextTypes", {
|
|
540
554
|
editorActions: PropTypes.object
|
|
541
555
|
});
|
|
@@ -12,6 +12,14 @@ export class EventDispatcher {
|
|
|
12
12
|
this.listeners[event].add(cb);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
has(event, cb) {
|
|
16
|
+
if (!this.listeners[event]) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return this.listeners[event].has(cb);
|
|
21
|
+
}
|
|
22
|
+
|
|
15
23
|
off(event, cb) {
|
|
16
24
|
if (!this.listeners[event]) {
|
|
17
25
|
return;
|
|
@@ -4,7 +4,6 @@ import React from 'react';
|
|
|
4
4
|
import { createDispatch } from '../event-dispatcher';
|
|
5
5
|
import { ACTION_SUBJECT, ACTION_SUBJECT_ID } from '../plugins/analytics';
|
|
6
6
|
import { analyticsEventKey } from '../plugins/analytics/consts';
|
|
7
|
-
import { getFeatureFlags } from '../plugins/feature-flags-context';
|
|
8
7
|
import { ErrorBoundary } from '../ui/ErrorBoundary';
|
|
9
8
|
import { getPerformanceOptions, startMeasureReactNodeViewRendered, stopMeasureReactNodeViewRendered } from './getPerformanceOptions';
|
|
10
9
|
export default class ReactNodeView {
|
|
@@ -101,20 +100,12 @@ export default class ReactNodeView {
|
|
|
101
100
|
this.portalProviderAPI.render(componentWithErrorBoundary, this.domRef, this.hasAnalyticsContext, this.hasIntlContext);
|
|
102
101
|
}
|
|
103
102
|
|
|
104
|
-
createDomRef(
|
|
103
|
+
createDomRef() {
|
|
105
104
|
if (!this.node.isInline) {
|
|
106
105
|
return document.createElement('div');
|
|
107
106
|
}
|
|
108
107
|
|
|
109
108
|
const htmlElement = document.createElement('span');
|
|
110
|
-
const state = this.view.state;
|
|
111
|
-
const featureFlags = getFeatureFlags(state);
|
|
112
|
-
|
|
113
|
-
if (featureFlags && featureFlags.displayInlineBlockForInlineNodes && (options === null || options === void 0 ? void 0 : options.displayInlineBlockForInlineNodes) !== false) {
|
|
114
|
-
htmlElement.style.display = 'inline-block';
|
|
115
|
-
htmlElement.style.userSelect = 'all';
|
|
116
|
-
}
|
|
117
|
-
|
|
118
109
|
return htmlElement;
|
|
119
110
|
}
|
|
120
111
|
|
|
@@ -6,6 +6,15 @@ export const InlineNodeViewSharedStyles = css`
|
|
|
6
6
|
.inlineNodeView {
|
|
7
7
|
display: inline;
|
|
8
8
|
user-select: all;
|
|
9
|
+
/* Collapses zero width spaces inside the inline node view
|
|
10
|
+
to prevent the node from line breaking too early.
|
|
11
|
+
*/
|
|
12
|
+
white-space: nowrap;
|
|
13
|
+
/* Then reset to the Editor default so we don't interfere
|
|
14
|
+
with any component styling. */
|
|
15
|
+
& > * {
|
|
16
|
+
white-space: pre-wrap;
|
|
17
|
+
}
|
|
9
18
|
}
|
|
10
19
|
|
|
11
20
|
&.ua-chrome .inlineNodeView > span {
|
|
@@ -55,6 +55,7 @@ export let ACTION;
|
|
|
55
55
|
ACTION["INDENTED"] = "indented";
|
|
56
56
|
ACTION["INITIALISED"] = "initialised";
|
|
57
57
|
ACTION["INPUT_PERF_SAMPLING"] = "inputPerfSampling";
|
|
58
|
+
ACTION["INPUT_PERF_SAMPLING_AVG"] = "inputPerfSamplingAvg";
|
|
58
59
|
ACTION["INSERTED"] = "inserted";
|
|
59
60
|
ACTION["INVALID_DOCUMENT_ENCOUNTERED"] = "invalidDocumentEncountered";
|
|
60
61
|
ACTION["INVOKED"] = "invoked";
|
|
@@ -7,7 +7,7 @@ import { getParticipantsCount } from '../../collab-edit/get-participants-count';
|
|
|
7
7
|
import { countNodes } from '../../../utils/count-nodes';
|
|
8
8
|
import { getContextIdentifier } from './context-identifier';
|
|
9
9
|
import { setInteractionType } from '../utils/frozen-editor';
|
|
10
|
-
import
|
|
10
|
+
import InputLatencyTracker from '../utils/input-latency-tracking';
|
|
11
11
|
export const frozenEditorPluginKey = new PluginKey('frozenEditor');
|
|
12
12
|
const DEFAULT_KEYSTROKE_SAMPLING_LIMIT = 100;
|
|
13
13
|
const DEFAULT_SLOW_THRESHOLD = 300;
|
|
@@ -18,13 +18,13 @@ const DEFAULT_TRACK_SEVERITY_ENABLED = false;
|
|
|
18
18
|
export const DEFAULT_TRACK_SEVERITY_THRESHOLD_NORMAL = 100;
|
|
19
19
|
export const DEFAULT_TRACK_SEVERITY_THRESHOLD_DEGRADED = 500;
|
|
20
20
|
|
|
21
|
-
const dispatchLongTaskEvent = (dispatchAnalyticsEvent, view, time,
|
|
21
|
+
const dispatchLongTaskEvent = (dispatchAnalyticsEvent, view, time, getNodeCount, interactionType, severity) => {
|
|
22
22
|
var _getContextIdentifier;
|
|
23
23
|
|
|
24
24
|
const {
|
|
25
25
|
state
|
|
26
26
|
} = view;
|
|
27
|
-
const nodesCount =
|
|
27
|
+
const nodesCount = getNodeCount(state);
|
|
28
28
|
return dispatchAnalyticsEvent({
|
|
29
29
|
action: ACTION.BROWSER_FREEZE,
|
|
30
30
|
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
@@ -42,8 +42,8 @@ const dispatchLongTaskEvent = (dispatchAnalyticsEvent, view, time, allowCountNod
|
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
export default ((dispatchAnalyticsEvent, inputTracking, browserFreezeTracking, ufo) => {
|
|
45
|
-
let keystrokeCount = 0;
|
|
46
45
|
let interactionType;
|
|
46
|
+
let inputLatencyTracker = null;
|
|
47
47
|
|
|
48
48
|
if (browserFreezeTracking !== null && browserFreezeTracking !== void 0 && browserFreezeTracking.trackInteractionType) {
|
|
49
49
|
interactionType = setInteractionType(BROWSER_FREEZE_INTERACTION_TYPE.LOADING);
|
|
@@ -53,6 +53,20 @@ export default ((dispatchAnalyticsEvent, inputTracking, browserFreezeTracking, u
|
|
|
53
53
|
const slowThreshold = inputTracking && typeof inputTracking.slowThreshold === 'number' ? inputTracking.slowThreshold : DEFAULT_SLOW_THRESHOLD;
|
|
54
54
|
const freezeThreshold = inputTracking && typeof inputTracking.freezeThreshold === 'number' ? inputTracking.freezeThreshold : DEFAULT_FREEZE_THRESHOLD;
|
|
55
55
|
const allowCountNodes = inputTracking && inputTracking.countNodes;
|
|
56
|
+
let prevNodeCountState = null;
|
|
57
|
+
let prevNodeCount = {}; // Cache the result as we were calling this multiple times
|
|
58
|
+
// and has potential to be expensive
|
|
59
|
+
|
|
60
|
+
const getNodeCount = state => {
|
|
61
|
+
if (state === prevNodeCountState) {
|
|
62
|
+
return prevNodeCount;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
prevNodeCount = allowCountNodes ? countNodes(state) : {};
|
|
66
|
+
prevNodeCountState = state;
|
|
67
|
+
return prevNodeCount;
|
|
68
|
+
};
|
|
69
|
+
|
|
56
70
|
const shouldTrackSeverity = (inputTracking === null || inputTracking === void 0 ? void 0 : inputTracking.trackSeverity) || DEFAULT_TRACK_SEVERITY_ENABLED;
|
|
57
71
|
const severityThresholdNormal = (inputTracking === null || inputTracking === void 0 ? void 0 : inputTracking.severityNormalThreshold) || DEFAULT_TRACK_SEVERITY_THRESHOLD_NORMAL;
|
|
58
72
|
const severityThresholdDegraded = (inputTracking === null || inputTracking === void 0 ? void 0 : inputTracking.severityDegradedThreshold) || DEFAULT_TRACK_SEVERITY_THRESHOLD_DEGRADED;
|
|
@@ -60,85 +74,18 @@ export default ((dispatchAnalyticsEvent, inputTracking, browserFreezeTracking, u
|
|
|
60
74
|
key: frozenEditorPluginKey,
|
|
61
75
|
props: isPerformanceAPIAvailable() ? {
|
|
62
76
|
handleTextInput(view) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
const now = performance.now();
|
|
77
|
+
var _inputLatencyTracker;
|
|
78
|
+
|
|
79
|
+
(_inputLatencyTracker = inputLatencyTracker) === null || _inputLatencyTracker === void 0 ? void 0 : _inputLatencyTracker.start();
|
|
67
80
|
|
|
68
81
|
if (browserFreezeTracking !== null && browserFreezeTracking !== void 0 && browserFreezeTracking.trackInteractionType) {
|
|
69
82
|
interactionType = BROWSER_FREEZE_INTERACTION_TYPE.TYPING;
|
|
70
83
|
}
|
|
71
84
|
|
|
72
|
-
const experienceStore = ufo ? ExperienceStore.getInstance(view) : undefined;
|
|
73
|
-
const trackTyping = samplingRate && ++keystrokeCount === samplingRate;
|
|
74
|
-
|
|
75
|
-
if (trackTyping) {
|
|
76
|
-
experienceStore === null || experienceStore === void 0 ? void 0 : experienceStore.start(EditorExperience.typing);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
85
|
requestAnimationFrame(() => {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
if (diff > slowThreshold) {
|
|
83
|
-
const nodesCount = allowCountNodes ? countNodes(view.state) : {};
|
|
84
|
-
|
|
85
|
-
if (inputTracking !== null && inputTracking !== void 0 && inputTracking.enabled) {
|
|
86
|
-
var _getContextIdentifier2;
|
|
87
|
-
|
|
88
|
-
dispatchAnalyticsEvent({
|
|
89
|
-
action: ACTION.SLOW_INPUT,
|
|
90
|
-
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
91
|
-
attributes: {
|
|
92
|
-
time: diff,
|
|
93
|
-
nodeSize: state.doc.nodeSize,
|
|
94
|
-
...nodesCount,
|
|
95
|
-
participants: getParticipantsCount(state),
|
|
96
|
-
objectId: (_getContextIdentifier2 = getContextIdentifier(state)) === null || _getContextIdentifier2 === void 0 ? void 0 : _getContextIdentifier2.objectId
|
|
97
|
-
},
|
|
98
|
-
eventType: EVENT_TYPE.OPERATIONAL
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
experienceStore === null || experienceStore === void 0 ? void 0 : experienceStore.addMetadata(EditorExperience.typing, {
|
|
103
|
-
slowInput: true
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
if (trackTyping) {
|
|
108
|
-
var _getContextIdentifier4;
|
|
86
|
+
var _inputLatencyTracker2;
|
|
109
87
|
|
|
110
|
-
|
|
111
|
-
keystrokeCount = 0;
|
|
112
|
-
const severity = shouldTrackSeverity ? getAnalyticsEventSeverity(diff, severityThresholdNormal, severityThresholdDegraded) : undefined;
|
|
113
|
-
|
|
114
|
-
if (inputTracking !== null && inputTracking !== void 0 && inputTracking.enabled) {
|
|
115
|
-
var _getContextIdentifier3;
|
|
116
|
-
|
|
117
|
-
const payload = {
|
|
118
|
-
action: ACTION.INPUT_PERF_SAMPLING,
|
|
119
|
-
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
120
|
-
attributes: {
|
|
121
|
-
time: diff,
|
|
122
|
-
nodeSize: state.doc.nodeSize,
|
|
123
|
-
...nodesCount,
|
|
124
|
-
participants: getParticipantsCount(state),
|
|
125
|
-
objectId: (_getContextIdentifier3 = getContextIdentifier(state)) === null || _getContextIdentifier3 === void 0 ? void 0 : _getContextIdentifier3.objectId,
|
|
126
|
-
severity
|
|
127
|
-
},
|
|
128
|
-
eventType: EVENT_TYPE.OPERATIONAL
|
|
129
|
-
};
|
|
130
|
-
dispatchAnalyticsEvent(payload);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
experienceStore === null || experienceStore === void 0 ? void 0 : experienceStore.success(EditorExperience.typing, {
|
|
134
|
-
nodeSize: state.doc.nodeSize,
|
|
135
|
-
...nodesCount,
|
|
136
|
-
participants: getParticipantsCount(state),
|
|
137
|
-
objectId: (_getContextIdentifier4 = getContextIdentifier(state)) === null || _getContextIdentifier4 === void 0 ? void 0 : _getContextIdentifier4.objectId,
|
|
138
|
-
time: diff,
|
|
139
|
-
severity
|
|
140
|
-
});
|
|
141
|
-
}
|
|
88
|
+
(_inputLatencyTracker2 = inputLatencyTracker) === null || _inputLatencyTracker2 === void 0 ? void 0 : _inputLatencyTracker2.end();
|
|
142
89
|
});
|
|
143
90
|
return false;
|
|
144
91
|
},
|
|
@@ -160,6 +107,116 @@ export default ((dispatchAnalyticsEvent, inputTracking, browserFreezeTracking, u
|
|
|
160
107
|
return {};
|
|
161
108
|
}
|
|
162
109
|
|
|
110
|
+
const experienceStore = ufo ? ExperienceStore.getInstance(view) : undefined;
|
|
111
|
+
|
|
112
|
+
if (inputTracking !== null && inputTracking !== void 0 && inputTracking.enabled) {
|
|
113
|
+
inputLatencyTracker = new InputLatencyTracker({
|
|
114
|
+
samplingRate,
|
|
115
|
+
slowThreshold,
|
|
116
|
+
normalThreshold: severityThresholdNormal,
|
|
117
|
+
degradedThreshold: severityThresholdDegraded,
|
|
118
|
+
onSampleStart: () => {
|
|
119
|
+
experienceStore === null || experienceStore === void 0 ? void 0 : experienceStore.start(EditorExperience.typing);
|
|
120
|
+
},
|
|
121
|
+
onSampleEnd: (time, {
|
|
122
|
+
isSlow,
|
|
123
|
+
severity
|
|
124
|
+
}) => {
|
|
125
|
+
var _getContextIdentifier2;
|
|
126
|
+
|
|
127
|
+
const {
|
|
128
|
+
state
|
|
129
|
+
} = view;
|
|
130
|
+
const nodesCount = getNodeCount(state);
|
|
131
|
+
|
|
132
|
+
if (isSlow) {
|
|
133
|
+
experienceStore === null || experienceStore === void 0 ? void 0 : experienceStore.addMetadata(EditorExperience.typing, {
|
|
134
|
+
slowInput: true
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
experienceStore === null || experienceStore === void 0 ? void 0 : experienceStore.success(EditorExperience.typing, {
|
|
139
|
+
nodeSize: state.doc.nodeSize,
|
|
140
|
+
...nodesCount,
|
|
141
|
+
participants: getParticipantsCount(state),
|
|
142
|
+
objectId: (_getContextIdentifier2 = getContextIdentifier(state)) === null || _getContextIdentifier2 === void 0 ? void 0 : _getContextIdentifier2.objectId,
|
|
143
|
+
time,
|
|
144
|
+
severity: shouldTrackSeverity ? severity : undefined
|
|
145
|
+
});
|
|
146
|
+
},
|
|
147
|
+
dispatchSample: (time, severity) => {
|
|
148
|
+
var _getContextIdentifier3;
|
|
149
|
+
|
|
150
|
+
const {
|
|
151
|
+
state
|
|
152
|
+
} = view;
|
|
153
|
+
const nodesCount = getNodeCount(state);
|
|
154
|
+
const samplePayload = {
|
|
155
|
+
action: ACTION.INPUT_PERF_SAMPLING,
|
|
156
|
+
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
157
|
+
attributes: {
|
|
158
|
+
time,
|
|
159
|
+
nodeSize: state.doc.nodeSize,
|
|
160
|
+
...nodesCount,
|
|
161
|
+
participants: getParticipantsCount(state),
|
|
162
|
+
objectId: (_getContextIdentifier3 = getContextIdentifier(state)) === null || _getContextIdentifier3 === void 0 ? void 0 : _getContextIdentifier3.objectId,
|
|
163
|
+
severity: shouldTrackSeverity ? severity : undefined
|
|
164
|
+
},
|
|
165
|
+
eventType: EVENT_TYPE.OPERATIONAL
|
|
166
|
+
};
|
|
167
|
+
dispatchAnalyticsEvent(samplePayload);
|
|
168
|
+
},
|
|
169
|
+
dispatchAverage: ({
|
|
170
|
+
mean,
|
|
171
|
+
median,
|
|
172
|
+
sampleSize
|
|
173
|
+
}, severity) => {
|
|
174
|
+
var _getContextIdentifier4;
|
|
175
|
+
|
|
176
|
+
const {
|
|
177
|
+
state
|
|
178
|
+
} = view;
|
|
179
|
+
const nodeCount = getNodeCount(state);
|
|
180
|
+
const averagePayload = {
|
|
181
|
+
action: ACTION.INPUT_PERF_SAMPLING_AVG,
|
|
182
|
+
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
183
|
+
attributes: {
|
|
184
|
+
mean,
|
|
185
|
+
median,
|
|
186
|
+
sampleSize,
|
|
187
|
+
...nodeCount,
|
|
188
|
+
nodeSize: state.doc.nodeSize,
|
|
189
|
+
severity: shouldTrackSeverity ? severity : undefined,
|
|
190
|
+
participants: getParticipantsCount(state),
|
|
191
|
+
objectId: (_getContextIdentifier4 = getContextIdentifier(state)) === null || _getContextIdentifier4 === void 0 ? void 0 : _getContextIdentifier4.objectId
|
|
192
|
+
},
|
|
193
|
+
eventType: EVENT_TYPE.OPERATIONAL
|
|
194
|
+
};
|
|
195
|
+
dispatchAnalyticsEvent(averagePayload);
|
|
196
|
+
},
|
|
197
|
+
onSlowInput: time => {
|
|
198
|
+
var _getContextIdentifier5;
|
|
199
|
+
|
|
200
|
+
const {
|
|
201
|
+
state
|
|
202
|
+
} = view;
|
|
203
|
+
const nodesCount = getNodeCount(state);
|
|
204
|
+
dispatchAnalyticsEvent({
|
|
205
|
+
action: ACTION.SLOW_INPUT,
|
|
206
|
+
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
207
|
+
attributes: {
|
|
208
|
+
time,
|
|
209
|
+
nodeSize: state.doc.nodeSize,
|
|
210
|
+
...nodesCount,
|
|
211
|
+
participants: getParticipantsCount(state),
|
|
212
|
+
objectId: (_getContextIdentifier5 = getContextIdentifier(state)) === null || _getContextIdentifier5 === void 0 ? void 0 : _getContextIdentifier5.objectId
|
|
213
|
+
},
|
|
214
|
+
eventType: EVENT_TYPE.OPERATIONAL
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
|
|
163
220
|
let observer;
|
|
164
221
|
|
|
165
222
|
try {
|
|
@@ -172,7 +229,7 @@ export default ((dispatchAnalyticsEvent, inputTracking, browserFreezeTracking, u
|
|
|
172
229
|
} = perfEntries[i];
|
|
173
230
|
|
|
174
231
|
if (duration > freezeThreshold) {
|
|
175
|
-
dispatchLongTaskEvent(dispatchAnalyticsEvent, view, duration,
|
|
232
|
+
dispatchLongTaskEvent(dispatchAnalyticsEvent, view, duration, getNodeCount, browserFreezeTracking !== null && browserFreezeTracking !== void 0 && browserFreezeTracking.trackInteractionType ? interactionType : undefined, browserFreezeTracking !== null && browserFreezeTracking !== void 0 && browserFreezeTracking.trackSeverity ? getAnalyticsEventSeverity(duration, browserFreezeTracking.severityNormalThreshold || NORMAL_SEVERITY_THRESHOLD, browserFreezeTracking.severityDegradedThreshold || DEGRADED_SEVERITY_THRESHOLD) : undefined);
|
|
176
233
|
}
|
|
177
234
|
}
|
|
178
235
|
}); // register observer for long task notifications
|
|
@@ -184,9 +241,10 @@ export default ((dispatchAnalyticsEvent, inputTracking, browserFreezeTracking, u
|
|
|
184
241
|
|
|
185
242
|
return {
|
|
186
243
|
destroy: () => {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
244
|
+
var _inputLatencyTracker3;
|
|
245
|
+
|
|
246
|
+
(_inputLatencyTracker3 = inputLatencyTracker) === null || _inputLatencyTracker3 === void 0 ? void 0 : _inputLatencyTracker3.flush();
|
|
247
|
+
observer === null || observer === void 0 ? void 0 : observer.disconnect();
|
|
190
248
|
}
|
|
191
249
|
};
|
|
192
250
|
}
|