@atlaskit/editor-common 60.1.0 → 60.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/dist/cjs/index.js +6 -0
- package/dist/cjs/styles/shared/block-marks.js +1 -1
- package/dist/cjs/styles/shared/panel.js +1 -1
- package/dist/cjs/styles/shared/table.js +1 -1
- package/dist/cjs/ufo/experience-store.js +159 -0
- package/dist/cjs/ufo/index.js +25 -0
- package/dist/cjs/utils/index.js +9 -1
- package/dist/cjs/utils/profiler/render-count.js +135 -0
- package/dist/cjs/utils/validator.js +34 -11
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/styles/shared/block-marks.js +1 -2
- package/dist/es2019/styles/shared/panel.js +5 -10
- package/dist/es2019/styles/shared/table.js +1 -1
- package/dist/es2019/ufo/experience-store.js +115 -0
- package/dist/es2019/ufo/index.js +1 -0
- package/dist/es2019/utils/index.js +2 -1
- package/dist/es2019/utils/profiler/render-count.js +107 -0
- package/dist/es2019/utils/validator.js +25 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/styles/shared/block-marks.js +1 -1
- package/dist/esm/styles/shared/panel.js +1 -1
- package/dist/esm/styles/shared/table.js +1 -1
- package/dist/esm/ufo/experience-store.js +143 -0
- package/dist/esm/ufo/index.js +1 -0
- package/dist/esm/utils/index.js +2 -1
- package/dist/esm/utils/profiler/render-count.js +123 -0
- package/dist/esm/utils/validator.js +34 -11
- package/dist/esm/version.json +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/ufo/experience-store.d.ts +32 -0
- package/dist/types/ufo/index.d.ts +1 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/profiler/render-count.d.ts +50 -0
- package/package.json +11 -9
- package/ufo/package.json +7 -0
- package/dist/cjs/ui/Caption/index.test.js +0 -82
- package/dist/cjs/utils/performance/measure-tti.test.js +0 -183
- package/dist/es2019/ui/Caption/index.test.js +0 -73
- package/dist/es2019/utils/performance/measure-tti.test.js +0 -124
- package/dist/esm/ui/Caption/index.test.js +0 -73
- package/dist/esm/utils/performance/measure-tti.test.js +0 -174
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 60.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`53d2eac387d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/53d2eac387d) - ED-12705 Fail all active editor UFO experiences from the editor error boundary
|
|
8
|
+
- [`b58f3c24179`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b58f3c24179) - ED-13643 Instrument editor interaction UFO experience
|
|
9
|
+
- [`971845eac0d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/971845eac0d) - CETI-96 Added new rule to emoji to solve the duplicate icon issue when we copy from renderer
|
|
10
|
+
- [`87ea2112afe`](https://bitbucket.org/atlassian/atlassian-frontend/commits/87ea2112afe) - ED-13214 Update ExperienceStore to use EditorView as unique identifier rather than session id
|
|
11
|
+
- [`3c5548e50da`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3c5548e50da) - [ux] Introducing new Media Inline component to renderer
|
|
12
|
+
- [`d7f62de1e40`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d7f62de1e40) - CETI-157 Fix panel selection in safari
|
|
13
|
+
- [`b53d0d54ac2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b53d0d54ac2) - ED-12887 Add render count profiler utilities
|
|
14
|
+
- [`746e1f37cb8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/746e1f37cb8) - ED-13214 Add experience store available via new entry point @atlaskit/editor-common/ufo
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- [`cbde8994bd4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cbde8994bd4) - ED-12846: Fix disappearing table borders in Chrome
|
|
19
|
+
- [`500420bcc7e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/500420bcc7e) - Updated to newest UFO API
|
|
20
|
+
- [`f897443ad45`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f897443ad45) - Revert AK-279
|
|
21
|
+
- [`99757fa97fb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/99757fa97fb) - ED-13642 added ufo session complete analytics event
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
|
|
3
24
|
## 60.1.0
|
|
4
25
|
|
|
5
26
|
### Minor Changes
|
package/dist/cjs/index.js
CHANGED
|
@@ -333,6 +333,12 @@ Object.defineProperty(exports, "sniffUserBrowserExtensions", {
|
|
|
333
333
|
return _utils.sniffUserBrowserExtensions;
|
|
334
334
|
}
|
|
335
335
|
});
|
|
336
|
+
Object.defineProperty(exports, "RenderCountProfiler", {
|
|
337
|
+
enumerable: true,
|
|
338
|
+
get: function get() {
|
|
339
|
+
return _utils.RenderCountProfiler;
|
|
340
|
+
}
|
|
341
|
+
});
|
|
336
342
|
Object.defineProperty(exports, "SortOrder", {
|
|
337
343
|
enumerable: true,
|
|
338
344
|
get: function get() {
|
|
@@ -13,5 +13,5 @@ var _styledComponents = require("styled-components");
|
|
|
13
13
|
|
|
14
14
|
var _templateObject;
|
|
15
15
|
|
|
16
|
-
var blockMarksSharedStyles = (0, _styledComponents.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n /**\n * We need to remove margin-top from first item\n * inside doc, tableCell, tableHeader, blockquote, etc.\n */\n *:not(.fabric-editor-block-mark) >,\n /* For nested block marks */\n *:not(.fabric-editor-block-mark) > div.fabric-editor-block-mark:first-child {\n p,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6
|
|
16
|
+
var blockMarksSharedStyles = (0, _styledComponents.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n /**\n * We need to remove margin-top from first item\n * inside doc, tableCell, tableHeader, blockquote, etc.\n */\n *:not(.fabric-editor-block-mark) >,\n /* For nested block marks */\n *:not(.fabric-editor-block-mark) > div.fabric-editor-block-mark:first-child {\n p,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n &:first-child {\n margin-top: 0;\n }\n }\n }\n"])));
|
|
17
17
|
exports.blockMarksSharedStyles = blockMarksSharedStyles;
|
|
@@ -149,5 +149,5 @@ var mainDynamicStyles = function mainDynamicStyles(panelType) {
|
|
|
149
149
|
};
|
|
150
150
|
};
|
|
151
151
|
|
|
152
|
-
var panelSharedStyles = (0, _styledComponents.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n border-radius: ", "px;\n margin: ", " 0 0;\n padding: ", "px;\n min-width: ", "px;\n display: flex;\n align-items: baseline;\n word-break: break-word;\n\n ", "\n\n .", " {\n
|
|
152
|
+
var panelSharedStyles = (0, _styledComponents.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n border-radius: ", "px;\n margin: ", " 0 0;\n padding: ", "px;\n min-width: ", "px;\n display: flex;\n position: relative;\n align-items: baseline;\n word-break: break-word;\n\n ", "\n\n .", " {\n flex-shrink: 0;\n height: ", "px;\n width: ", "px;\n box-sizing: content-box;\n padding-right: ", "px;\n text-align: center;\n user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n ", "\n\n > span {\n vertical-align: middle;\n display: inline;\n }\n\n .", ", .", " {\n vertical-align: ", "px;\n }\n }\n\n .ak-editor-panel__content {\n margin: 1px 0 1px;\n flex: 1 0 0;\n /*\n https://ishadeed.com/article/min-max-css/#setting-min-width-to-zero-with-flexbox\n The default value for min-width is auto, which is computed to zero. When an element is a flex item, the value of min-width doesn\u2019t compute to zero. The minimum size of a flex item is equal to the size of its contents.\n */\n min-width: 0;\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n }\n"])), PanelSharedCssClassName.prefix, (0, _constants.borderRadius)(), _editorSharedStyles.blockNodesVerticalMargin, (0, _constants.gridSize)(), _editorSharedStyles.akEditorTableCellMinWidth, mainDynamicStyles(_adfSchema.PanelType.INFO), PanelSharedCssClassName.icon, (0, _constants.gridSize)() * 3, (0, _constants.gridSize)() * 3, (0, _constants.gridSize)(), iconDynamicStyles(_adfSchema.PanelType.INFO), _emoji.emojiSprite, _emoji.emojiImage, verticalAlignment, _adfSchema.PanelType.NOTE, mainDynamicStyles(_adfSchema.PanelType.NOTE), PanelSharedCssClassName.icon, iconDynamicStyles(_adfSchema.PanelType.NOTE), _adfSchema.PanelType.TIP, mainDynamicStyles(_adfSchema.PanelType.TIP), PanelSharedCssClassName.icon, iconDynamicStyles(_adfSchema.PanelType.TIP), _adfSchema.PanelType.WARNING, mainDynamicStyles(_adfSchema.PanelType.WARNING), PanelSharedCssClassName.icon, iconDynamicStyles(_adfSchema.PanelType.WARNING), _adfSchema.PanelType.ERROR, mainDynamicStyles(_adfSchema.PanelType.ERROR), PanelSharedCssClassName.icon, iconDynamicStyles(_adfSchema.PanelType.ERROR), _adfSchema.PanelType.SUCCESS, mainDynamicStyles(_adfSchema.PanelType.SUCCESS), PanelSharedCssClassName.icon, iconDynamicStyles(_adfSchema.PanelType.SUCCESS));
|
|
153
153
|
exports.panelSharedStyles = panelSharedStyles;
|
|
@@ -60,7 +60,7 @@ var tableSharedStyle = (0, _styledComponents.css)(_templateObject || (_templateO
|
|
|
60
60
|
}), tableCellMinWidth, (0, _components.themed)({
|
|
61
61
|
light: _editorSharedStyles.akEditorTableBorder,
|
|
62
62
|
dark: _editorSharedStyles.akEditorTableBorderDark
|
|
63
|
-
}), tableCellPadding, _browser.default.gecko || _browser.default.ie ? 'background-clip: padding-box;' : '', (0, _components.themed)({
|
|
63
|
+
}), tableCellPadding, _browser.default.gecko || _browser.default.ie || _browser.default.mac && _browser.default.chrome ? 'background-clip: padding-box;' : '', (0, _components.themed)({
|
|
64
64
|
dark: _editorSharedStyles.getTableCellBackgroundDarkModeColors
|
|
65
65
|
}), (0, _components.themed)({
|
|
66
66
|
light: _editorSharedStyles.akEditorTableToolbar,
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.ExperienceStore = exports.RELIABILITY_INTERVAL = exports.EditorExperience = exports.experienceConfig = void 0;
|
|
9
|
+
|
|
10
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
+
|
|
12
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
+
|
|
14
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
+
|
|
16
|
+
var _ufo = require("@atlaskit/ufo");
|
|
17
|
+
|
|
18
|
+
var experienceConfig = {
|
|
19
|
+
type: _ufo.ExperienceTypes.Operation,
|
|
20
|
+
performanceType: _ufo.ExperiencePerformanceTypes.Custom,
|
|
21
|
+
platform: {
|
|
22
|
+
component: 'editor'
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
exports.experienceConfig = experienceConfig;
|
|
26
|
+
var EditorExperience;
|
|
27
|
+
exports.EditorExperience = EditorExperience;
|
|
28
|
+
|
|
29
|
+
(function (EditorExperience) {
|
|
30
|
+
EditorExperience["loadEditor"] = "load";
|
|
31
|
+
EditorExperience["typing"] = "type";
|
|
32
|
+
EditorExperience["interaction"] = "interact";
|
|
33
|
+
})(EditorExperience || (exports.EditorExperience = EditorExperience = {}));
|
|
34
|
+
|
|
35
|
+
var RELIABILITY_INTERVAL = 30000;
|
|
36
|
+
exports.RELIABILITY_INTERVAL = RELIABILITY_INTERVAL;
|
|
37
|
+
|
|
38
|
+
var ExperienceStore = /*#__PURE__*/function () {
|
|
39
|
+
function ExperienceStore() {
|
|
40
|
+
(0, _classCallCheck2.default)(this, ExperienceStore);
|
|
41
|
+
this.experiences = new Map();
|
|
42
|
+
|
|
43
|
+
for (var _i = 0, _Object$values = Object.values(EditorExperience); _i < _Object$values.length; _i++) {
|
|
44
|
+
var experienceId = _Object$values[_i];
|
|
45
|
+
var experience = new _ufo.UFOExperience(experienceId, experienceConfig);
|
|
46
|
+
this.experiences.set(experienceId, experience);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
(0, _createClass2.default)(ExperienceStore, [{
|
|
51
|
+
key: "get",
|
|
52
|
+
value: function get(experienceId) {
|
|
53
|
+
return this.experiences.get(experienceId);
|
|
54
|
+
}
|
|
55
|
+
}, {
|
|
56
|
+
key: "getActive",
|
|
57
|
+
value: function getActive(experienceId) {
|
|
58
|
+
var experience = this.experiences.get(experienceId);
|
|
59
|
+
|
|
60
|
+
if (!(experience !== null && experience !== void 0 && experience.state.final)) {
|
|
61
|
+
return experience;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}, {
|
|
65
|
+
key: "getAll",
|
|
66
|
+
value: function getAll() {
|
|
67
|
+
return Array.from(this.experiences.values());
|
|
68
|
+
}
|
|
69
|
+
}, {
|
|
70
|
+
key: "start",
|
|
71
|
+
value: function start(experienceId, startTime) {
|
|
72
|
+
var _this$get;
|
|
73
|
+
|
|
74
|
+
(_this$get = this.get(experienceId)) === null || _this$get === void 0 ? void 0 : _this$get.start(startTime);
|
|
75
|
+
}
|
|
76
|
+
}, {
|
|
77
|
+
key: "addMetadata",
|
|
78
|
+
value: function addMetadata(experienceId, metadata) {
|
|
79
|
+
var _this$get2;
|
|
80
|
+
|
|
81
|
+
(_this$get2 = this.get(experienceId)) === null || _this$get2 === void 0 ? void 0 : _this$get2.addMetadata(metadata);
|
|
82
|
+
}
|
|
83
|
+
}, {
|
|
84
|
+
key: "mark",
|
|
85
|
+
value: function mark(experienceId, _mark, value) {
|
|
86
|
+
var _this$get3;
|
|
87
|
+
|
|
88
|
+
(_this$get3 = this.get(experienceId)) === null || _this$get3 === void 0 ? void 0 : _this$get3.mark(_mark, value);
|
|
89
|
+
}
|
|
90
|
+
}, {
|
|
91
|
+
key: "success",
|
|
92
|
+
value: function success(experienceId, metadata) {
|
|
93
|
+
var _this$getActive;
|
|
94
|
+
|
|
95
|
+
(_this$getActive = this.getActive(experienceId)) === null || _this$getActive === void 0 ? void 0 : _this$getActive.success({
|
|
96
|
+
metadata: metadata
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
}, {
|
|
100
|
+
key: "fail",
|
|
101
|
+
value: function fail(experienceId, metadata) {
|
|
102
|
+
var _this$getActive2;
|
|
103
|
+
|
|
104
|
+
(_this$getActive2 = this.getActive(experienceId)) === null || _this$getActive2 === void 0 ? void 0 : _this$getActive2.failure({
|
|
105
|
+
metadata: metadata
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
}, {
|
|
109
|
+
key: "abort",
|
|
110
|
+
value: function abort(experienceId, metadata) {
|
|
111
|
+
var _this = this;
|
|
112
|
+
|
|
113
|
+
// We add this wait in here because when React catches an error it unmounts the component
|
|
114
|
+
// before the error boundary's componentDidCatch is called
|
|
115
|
+
// In this case we want to fail the experience, but without this wait, abort is called first
|
|
116
|
+
setTimeout(function () {
|
|
117
|
+
var _this$getActive3;
|
|
118
|
+
|
|
119
|
+
(_this$getActive3 = _this.getActive(experienceId)) === null || _this$getActive3 === void 0 ? void 0 : _this$getActive3.abort({
|
|
120
|
+
metadata: metadata
|
|
121
|
+
});
|
|
122
|
+
}, 0);
|
|
123
|
+
}
|
|
124
|
+
}, {
|
|
125
|
+
key: "abortAll",
|
|
126
|
+
value: function abortAll(metadata) {
|
|
127
|
+
var _this2 = this;
|
|
128
|
+
|
|
129
|
+
this.experiences.forEach(function (experience) {
|
|
130
|
+
_this2.abort(experience.id, metadata);
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
}, {
|
|
134
|
+
key: "failAll",
|
|
135
|
+
value: function failAll(metadata) {
|
|
136
|
+
var _this3 = this;
|
|
137
|
+
|
|
138
|
+
this.experiences.forEach(function (experience) {
|
|
139
|
+
_this3.fail(experience.id, metadata);
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
}], [{
|
|
143
|
+
key: "getInstance",
|
|
144
|
+
value: function getInstance(view) {
|
|
145
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
146
|
+
|
|
147
|
+
if (!this.stores.get(view) || options !== null && options !== void 0 && options.forceNewInstance) {
|
|
148
|
+
var store = new ExperienceStore();
|
|
149
|
+
this.stores.set(view, store);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
return this.stores.get(view);
|
|
153
|
+
}
|
|
154
|
+
}]);
|
|
155
|
+
return ExperienceStore;
|
|
156
|
+
}();
|
|
157
|
+
|
|
158
|
+
exports.ExperienceStore = ExperienceStore;
|
|
159
|
+
(0, _defineProperty2.default)(ExperienceStore, "stores", new WeakMap());
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "ExperienceStore", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _experienceStore.ExperienceStore;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "EditorExperience", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _experienceStore.EditorExperience;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "RELIABILITY_INTERVAL", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function get() {
|
|
21
|
+
return _experienceStore.RELIABILITY_INTERVAL;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
var _experienceStore = require("./experience-store");
|
package/dist/cjs/utils/index.js
CHANGED
|
@@ -335,6 +335,12 @@ Object.defineProperty(exports, "sniffUserBrowserExtensions", {
|
|
|
335
335
|
return _browserExtensions.sniffUserBrowserExtensions;
|
|
336
336
|
}
|
|
337
337
|
});
|
|
338
|
+
Object.defineProperty(exports, "RenderCountProfiler", {
|
|
339
|
+
enumerable: true,
|
|
340
|
+
get: function get() {
|
|
341
|
+
return _renderCount.RenderCountProfiler;
|
|
342
|
+
}
|
|
343
|
+
});
|
|
338
344
|
|
|
339
345
|
var _annotation = require("./annotation");
|
|
340
346
|
|
|
@@ -382,4 +388,6 @@ var _shouldForceTracking = require("./should-force-tracking");
|
|
|
382
388
|
|
|
383
389
|
var _getModeFromTheme = require("./getModeFromTheme");
|
|
384
390
|
|
|
385
|
-
var _browserExtensions = require("./browser-extensions");
|
|
391
|
+
var _browserExtensions = require("./browser-extensions");
|
|
392
|
+
|
|
393
|
+
var _renderCount = require("./profiler/render-count");
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.RenderCountProfiler = exports.PROFILER_KEY = void 0;
|
|
9
|
+
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
|
|
12
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
+
|
|
14
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
15
|
+
|
|
16
|
+
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; }
|
|
17
|
+
|
|
18
|
+
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) { (0, _defineProperty2.default)(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; }
|
|
19
|
+
|
|
20
|
+
var PROFILER_KEY = '__editorRenderCountProfiler';
|
|
21
|
+
exports.PROFILER_KEY = PROFILER_KEY;
|
|
22
|
+
|
|
23
|
+
var RenderCountProfiler = /*#__PURE__*/function () {
|
|
24
|
+
/**
|
|
25
|
+
* The singleton/cached instance of RenderCountProfiler that will be shared
|
|
26
|
+
* betweenRenderCountProfiler.getInstance() calls
|
|
27
|
+
*/
|
|
28
|
+
function RenderCountProfiler(_ref) {
|
|
29
|
+
var store = _ref.store;
|
|
30
|
+
(0, _classCallCheck2.default)(this, RenderCountProfiler);
|
|
31
|
+
this.store = store;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Returns the singleton/cached instance of RenderCountProfiler that
|
|
35
|
+
* currently exists. If it hasn't been instantiated yet, the singleton
|
|
36
|
+
* instance will be created using the given params. Returns the latest
|
|
37
|
+
* singleton/instance.
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
(0, _createClass2.default)(RenderCountProfiler, [{
|
|
42
|
+
key: "getData",
|
|
43
|
+
value: function getData(profilerKey) {
|
|
44
|
+
var _this$store;
|
|
45
|
+
|
|
46
|
+
return (_this$store = this.store) === null || _this$store === void 0 ? void 0 : _this$store[profilerKey];
|
|
47
|
+
}
|
|
48
|
+
}, {
|
|
49
|
+
key: "enable",
|
|
50
|
+
value: function enable() {
|
|
51
|
+
this.store[PROFILER_KEY] = _objectSpread(_objectSpread({}, this.store[PROFILER_KEY]), {}, {
|
|
52
|
+
enabled: true
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}, {
|
|
56
|
+
key: "remove",
|
|
57
|
+
value: function remove() {
|
|
58
|
+
delete this.store[PROFILER_KEY];
|
|
59
|
+
}
|
|
60
|
+
}, {
|
|
61
|
+
key: "isEnabled",
|
|
62
|
+
value: function isEnabled() {
|
|
63
|
+
var _this$store2, _this$store2$PROFILER;
|
|
64
|
+
|
|
65
|
+
return Boolean((_this$store2 = this.store) === null || _this$store2 === void 0 ? void 0 : (_this$store2$PROFILER = _this$store2[PROFILER_KEY]) === null || _this$store2$PROFILER === void 0 ? void 0 : _this$store2$PROFILER.enabled);
|
|
66
|
+
}
|
|
67
|
+
}, {
|
|
68
|
+
key: "setRenderCount",
|
|
69
|
+
value: function setRenderCount(_ref2) {
|
|
70
|
+
var componentId = _ref2.componentId,
|
|
71
|
+
renderCount = _ref2.renderCount,
|
|
72
|
+
instanceId = _ref2.instanceId;
|
|
73
|
+
var profilerData = this.store[PROFILER_KEY];
|
|
74
|
+
var instance = {
|
|
75
|
+
count: renderCount
|
|
76
|
+
};
|
|
77
|
+
var existingComponents = profilerData === null || profilerData === void 0 ? void 0 : profilerData.components;
|
|
78
|
+
var existingInstances = existingComponents === null || existingComponents === void 0 ? void 0 : existingComponents[componentId];
|
|
79
|
+
|
|
80
|
+
var updatedComponent = _objectSpread(_objectSpread({}, existingInstances), {}, (0, _defineProperty2.default)({}, instanceId, instance));
|
|
81
|
+
|
|
82
|
+
this.store[PROFILER_KEY] = _objectSpread(_objectSpread({}, profilerData), {}, {
|
|
83
|
+
components: _objectSpread(_objectSpread({}, existingComponents), {}, (0, _defineProperty2.default)({}, componentId, updatedComponent))
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}, {
|
|
87
|
+
key: "getInstanceRenderCounters",
|
|
88
|
+
value: function getInstanceRenderCounters(_ref3) {
|
|
89
|
+
var _this$store$PROFILER_, _this$store3, _this$store3$PROFILER, _this$store3$PROFILER2;
|
|
90
|
+
|
|
91
|
+
var componentId = _ref3.componentId;
|
|
92
|
+
var component = (_this$store$PROFILER_ = (_this$store3 = this.store) === null || _this$store3 === void 0 ? void 0 : (_this$store3$PROFILER = _this$store3[PROFILER_KEY]) === null || _this$store3$PROFILER === void 0 ? void 0 : (_this$store3$PROFILER2 = _this$store3$PROFILER.components) === null || _this$store3$PROFILER2 === void 0 ? void 0 : _this$store3$PROFILER2[componentId]) !== null && _this$store$PROFILER_ !== void 0 ? _this$store$PROFILER_ : {};
|
|
93
|
+
var counters = [];
|
|
94
|
+
|
|
95
|
+
for (var _instanceId in component) {
|
|
96
|
+
var counter = {
|
|
97
|
+
instanceId: _instanceId,
|
|
98
|
+
count: component[_instanceId].count
|
|
99
|
+
};
|
|
100
|
+
counters.push(counter);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return counters;
|
|
104
|
+
}
|
|
105
|
+
}, {
|
|
106
|
+
key: "getRenderCount",
|
|
107
|
+
value: function getRenderCount(_ref4) {
|
|
108
|
+
var _this$store$PROFILER_2, _this$store4, _this$store4$PROFILER, _this$store4$PROFILER2;
|
|
109
|
+
|
|
110
|
+
var componentId = _ref4.componentId;
|
|
111
|
+
var component = (_this$store$PROFILER_2 = (_this$store4 = this.store) === null || _this$store4 === void 0 ? void 0 : (_this$store4$PROFILER = _this$store4[PROFILER_KEY]) === null || _this$store4$PROFILER === void 0 ? void 0 : (_this$store4$PROFILER2 = _this$store4$PROFILER.components) === null || _this$store4$PROFILER2 === void 0 ? void 0 : _this$store4$PROFILER2[componentId]) !== null && _this$store$PROFILER_2 !== void 0 ? _this$store$PROFILER_2 : {};
|
|
112
|
+
var total = 0;
|
|
113
|
+
|
|
114
|
+
for (var _instanceId2 in component) {
|
|
115
|
+
total += component[_instanceId2].count;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return total;
|
|
119
|
+
}
|
|
120
|
+
}], [{
|
|
121
|
+
key: "getInstance",
|
|
122
|
+
value: function getInstance(params) {
|
|
123
|
+
if (!RenderCountProfiler.instance) {
|
|
124
|
+
RenderCountProfiler.instance = new RenderCountProfiler({
|
|
125
|
+
store: params.store
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return RenderCountProfiler.instance;
|
|
130
|
+
}
|
|
131
|
+
}]);
|
|
132
|
+
return RenderCountProfiler;
|
|
133
|
+
}();
|
|
134
|
+
|
|
135
|
+
exports.RenderCountProfiler = RenderCountProfiler;
|
|
@@ -387,21 +387,44 @@ var getValidNode = function getValidNode(originalNode) {
|
|
|
387
387
|
break;
|
|
388
388
|
}
|
|
389
389
|
|
|
390
|
-
case '
|
|
390
|
+
case 'mediaInline':
|
|
391
391
|
{
|
|
392
392
|
var mediaId = '';
|
|
393
|
-
var mediaType = '';
|
|
394
393
|
var mediaCollection = [];
|
|
395
|
-
var mediaUrl = '';
|
|
396
394
|
|
|
397
395
|
if (attrs) {
|
|
398
396
|
var id = attrs.id,
|
|
399
|
-
collection = attrs.collection
|
|
397
|
+
collection = attrs.collection;
|
|
398
|
+
mediaId = id;
|
|
399
|
+
mediaCollection = collection;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
if (mediaId && mediaCollection && adfStage === 'stage0') {
|
|
403
|
+
return {
|
|
404
|
+
type: type,
|
|
405
|
+
attrs: attrs,
|
|
406
|
+
marks: marks
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
break;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
case 'media':
|
|
414
|
+
{
|
|
415
|
+
var _mediaId = '';
|
|
416
|
+
var mediaType = '';
|
|
417
|
+
var _mediaCollection = [];
|
|
418
|
+
var mediaUrl = '';
|
|
419
|
+
|
|
420
|
+
if (attrs) {
|
|
421
|
+
var _id = attrs.id,
|
|
422
|
+
_collection = attrs.collection,
|
|
400
423
|
_type = attrs.type,
|
|
401
424
|
url = attrs.url;
|
|
402
|
-
|
|
425
|
+
_mediaId = _id;
|
|
403
426
|
mediaType = _type;
|
|
404
|
-
|
|
427
|
+
_mediaCollection = _collection;
|
|
405
428
|
mediaUrl = url;
|
|
406
429
|
}
|
|
407
430
|
|
|
@@ -421,11 +444,11 @@ var getValidNode = function getValidNode(originalNode) {
|
|
|
421
444
|
type: type,
|
|
422
445
|
attrs: mediaAttrs
|
|
423
446
|
};
|
|
424
|
-
} else if (
|
|
447
|
+
} else if (_mediaId && mediaType) {
|
|
425
448
|
var _mediaAttrs = {
|
|
426
449
|
type: mediaType,
|
|
427
|
-
id:
|
|
428
|
-
collection:
|
|
450
|
+
id: _mediaId,
|
|
451
|
+
collection: _mediaCollection
|
|
429
452
|
};
|
|
430
453
|
|
|
431
454
|
if (attrs.width) {
|
|
@@ -494,10 +517,10 @@ var getValidNode = function getValidNode(originalNode) {
|
|
|
494
517
|
if (attrs) {
|
|
495
518
|
var _text = attrs.text,
|
|
496
519
|
displayName = attrs.displayName,
|
|
497
|
-
|
|
520
|
+
_id2 = attrs.id,
|
|
498
521
|
accessLevel = attrs.accessLevel;
|
|
499
522
|
mentionText = _text || displayName;
|
|
500
|
-
mentionId =
|
|
523
|
+
mentionId = _id2;
|
|
501
524
|
mentionAccess = accessLevel;
|
|
502
525
|
}
|
|
503
526
|
|
package/dist/cjs/version.json
CHANGED
package/dist/es2019/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ADFTraversor, ErrorReporter, ZERO_WIDTH_SPACE, absoluteBreakoutWidth, browser, calcBreakoutWidth, breakoutConsts, calcTableColumnWidths, calcWideWidth, clearMeasure, compose, convertProsemirrorTableNodeToArrayOfRows, createCompareNodes, findAndTrackUnsupportedContentNodes, getAnalyticsAppearance, analyticsEventKey, getAnalyticsEventSeverity, getUnsupportedContentLevelData, UNSUPPORTED_CONTENT_LEVEL_SEVERITY_THRESHOLD_DEFAULTS, getExtensionLozengeData, getExtensionRenderer, getMarksByOrder, getModeFromTheme, getResponseEndTime, getValidContent, getValidDocument, getValidMark, getValidNode, getValidUnknownNode, hasMergedCell, isPastDate, isPerformanceAPIAvailable, isPerformanceObserverAvailable, isSameMark, isSubSupType, markOrder, measureRender, startMeasure, stopMeasure, measureTTI, getTTISeverity, TTI_SEVERITY_THRESHOLD_DEFAULTS, TTI_FROM_INVOCATION_SEVERITY_THRESHOLD_DEFAULTS, timestampToIsoFormat, timestampToString, timestampToTaskContext, timestampToUTCDate, todayTimestampInUTC, withImageLoader, canApplyAnnotationOnRange, getAnnotationIdsFromRange, SEVERITY, UNSUPPORTED_CONTENT_LEVEL_SEVERITY, shouldForceTracking, sniffUserBrowserExtensions } from './utils';
|
|
1
|
+
export { ADFTraversor, ErrorReporter, ZERO_WIDTH_SPACE, absoluteBreakoutWidth, browser, calcBreakoutWidth, breakoutConsts, calcTableColumnWidths, calcWideWidth, clearMeasure, compose, convertProsemirrorTableNodeToArrayOfRows, createCompareNodes, findAndTrackUnsupportedContentNodes, getAnalyticsAppearance, analyticsEventKey, getAnalyticsEventSeverity, getUnsupportedContentLevelData, UNSUPPORTED_CONTENT_LEVEL_SEVERITY_THRESHOLD_DEFAULTS, getExtensionLozengeData, getExtensionRenderer, getMarksByOrder, getModeFromTheme, getResponseEndTime, getValidContent, getValidDocument, getValidMark, getValidNode, getValidUnknownNode, hasMergedCell, isPastDate, isPerformanceAPIAvailable, isPerformanceObserverAvailable, isSameMark, isSubSupType, markOrder, measureRender, startMeasure, stopMeasure, measureTTI, getTTISeverity, TTI_SEVERITY_THRESHOLD_DEFAULTS, TTI_FROM_INVOCATION_SEVERITY_THRESHOLD_DEFAULTS, timestampToIsoFormat, timestampToString, timestampToTaskContext, timestampToUTCDate, todayTimestampInUTC, withImageLoader, canApplyAnnotationOnRange, getAnnotationIdsFromRange, SEVERITY, UNSUPPORTED_CONTENT_LEVEL_SEVERITY, shouldForceTracking, sniffUserBrowserExtensions, RenderCountProfiler } from './utils';
|
|
2
2
|
export { SortOrder, AnnotationUpdateEmitter, AnnotationUpdateEvent } from './types';
|
|
3
3
|
export { DefaultExtensionProvider, combineExtensionProviders, getExtensionKeyAndNodeKey, getExtensionModuleNode, getExtensionModuleNodePrivateProps, getQuickInsertItemsFromModule, getNodeRenderer, getContextualToolbarItemsFromModule, buildMenuItem, resolveImport } from './extensions';
|
|
4
4
|
export { ProviderFactory, WithProviders } from './provider-factory';
|
|
@@ -126,19 +126,23 @@ export const panelSharedStyles = css`
|
|
|
126
126
|
padding: ${gridSize()}px;
|
|
127
127
|
min-width: ${akEditorTableCellMinWidth}px;
|
|
128
128
|
display: flex;
|
|
129
|
+
position: relative;
|
|
129
130
|
align-items: baseline;
|
|
130
131
|
word-break: break-word;
|
|
131
132
|
|
|
132
133
|
${mainDynamicStyles(PanelType.INFO)}
|
|
133
134
|
|
|
134
135
|
.${PanelSharedCssClassName.icon} {
|
|
135
|
-
display: block;
|
|
136
136
|
flex-shrink: 0;
|
|
137
137
|
height: ${gridSize() * 3}px;
|
|
138
138
|
width: ${gridSize() * 3}px;
|
|
139
139
|
box-sizing: content-box;
|
|
140
140
|
padding-right: ${gridSize()}px;
|
|
141
141
|
text-align: center;
|
|
142
|
+
user-select: none;
|
|
143
|
+
-moz-user-select: none;
|
|
144
|
+
-webkit-user-select: none;
|
|
145
|
+
-ms-user-select: none;
|
|
142
146
|
${iconDynamicStyles(PanelType.INFO)}
|
|
143
147
|
|
|
144
148
|
> span {
|
|
@@ -200,14 +204,5 @@ export const panelSharedStyles = css`
|
|
|
200
204
|
${iconDynamicStyles(PanelType.SUCCESS)}
|
|
201
205
|
}
|
|
202
206
|
}
|
|
203
|
-
|
|
204
|
-
&[data-panel-type='${PanelType.CUSTOM}'] {
|
|
205
|
-
.${PanelSharedCssClassName.icon} {
|
|
206
|
-
user-select: none;
|
|
207
|
-
-moz-user-select: none;
|
|
208
|
-
-webkit-user-select: none;
|
|
209
|
-
-ms-user-select: none;
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
207
|
}
|
|
213
208
|
`;
|
|
@@ -88,7 +88,7 @@ const tableSharedStyle = css`
|
|
|
88
88
|
border-bottom-width: 0;
|
|
89
89
|
padding: ${tableCellPadding}px;
|
|
90
90
|
/* https://stackoverflow.com/questions/7517127/borders-not-shown-in-firefox-with-border-collapse-on-table-position-relative-o */
|
|
91
|
-
${browser.gecko || browser.ie ? 'background-clip: padding-box;' : ''}
|
|
91
|
+
${browser.gecko || browser.ie || browser.mac && browser.chrome ? 'background-clip: padding-box;' : ''}
|
|
92
92
|
|
|
93
93
|
${themed({
|
|
94
94
|
dark: getTableCellBackgroundDarkModeColors
|