@atlaskit/editor-common 59.0.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 +76 -0
- package/dist/cjs/in-product.js +28 -4
- package/dist/cjs/index.js +6 -0
- package/dist/cjs/styles/shared/panel.js +13 -2
- package/dist/cjs/styles/shared/table.js +3 -2
- package/dist/cjs/type-ahead/index.js +25 -0
- package/dist/cjs/types/{typeAhead.js → type-ahead.js} +0 -0
- package/dist/cjs/ufo/experience-store.js +159 -0
- package/dist/cjs/ufo/index.js +25 -0
- package/dist/cjs/ui/Messages/index.js +1 -3
- package/dist/cjs/utils/browser.js +7 -1
- 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/in-product.js +1 -1
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/styles/shared/panel.js +20 -2
- package/dist/es2019/styles/shared/table.js +4 -3
- package/dist/es2019/type-ahead/index.js +17 -0
- package/dist/es2019/types/{typeAhead.js → type-ahead.js} +0 -0
- package/dist/es2019/ufo/experience-store.js +115 -0
- package/dist/es2019/ufo/index.js +1 -0
- package/dist/es2019/ui/Messages/index.js +1 -2
- package/dist/es2019/utils/browser.js +7 -1
- 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/in-product.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/styles/shared/panel.js +11 -2
- package/dist/esm/styles/shared/table.js +4 -3
- package/dist/esm/type-ahead/index.js +17 -0
- package/dist/esm/types/{typeAhead.js → type-ahead.js} +0 -0
- package/dist/esm/ufo/experience-store.js +143 -0
- package/dist/esm/ufo/index.js +1 -0
- package/dist/esm/ui/Messages/index.js +1 -2
- package/dist/esm/utils/browser.js +7 -1
- 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/__tests_external__/cases/fundamentals/collection.d.ts +3 -0
- package/dist/types/__tests_external__/cases/fundamentals/test-cases/editor-is-present.d.ts +3 -0
- package/dist/types/__tests_external__/cases/fundamentals/test-cases/editor-typing.d.ts +3 -0
- package/dist/types/__tests_external__/cases/media/test-cases/alt-text.d.ts +3 -0
- package/dist/types/__tests_external__/cases/media/test-cases/caption.d.ts +3 -0
- package/dist/types/__tests_external__/cases/media/test-cases/index.d.ts +3 -0
- package/dist/types/__tests_external__/cases/media/test-cases/types.d.ts +4 -0
- package/dist/types/__tests_external__/cases/media/test-cases/upload.d.ts +7 -0
- package/dist/types/__tests_external__/cases/smart-links/index.d.ts +4 -0
- package/dist/types/__tests_external__/cases/smart-links/test-cases/block/delete.d.ts +3 -0
- package/dist/types/__tests_external__/cases/smart-links/test-cases/block/edit.d.ts +4 -0
- package/dist/types/__tests_external__/cases/smart-links/test-cases/block/index.d.ts +3 -0
- package/dist/types/__tests_external__/cases/smart-links/test-cases/block/insert.d.ts +3 -0
- package/dist/types/__tests_external__/cases/smart-links/test-cases/embed/delete.d.ts +3 -0
- package/dist/types/__tests_external__/cases/smart-links/test-cases/embed/edit.d.ts +4 -0
- package/dist/types/__tests_external__/cases/smart-links/test-cases/embed/index.d.ts +3 -0
- package/dist/types/__tests_external__/cases/smart-links/test-cases/embed/insert.d.ts +3 -0
- package/dist/types/__tests_external__/cases/smart-links/test-cases/inline/delete.d.ts +3 -0
- package/dist/types/__tests_external__/cases/smart-links/test-cases/inline/edit.d.ts +4 -0
- package/dist/types/__tests_external__/cases/smart-links/test-cases/inline/index.d.ts +3 -0
- package/dist/types/__tests_external__/cases/smart-links/test-cases/inline/insert.d.ts +3 -0
- package/dist/types/__tests_external__/cases/smart-links/test-cases/inline/unlink.d.ts +3 -0
- package/dist/types/__tests_external__/cases/smart-links/test-cases/types.d.ts +4 -0
- package/dist/types/__tests_external__/cases/smart-links/test-cases/url/index.d.ts +3 -0
- package/dist/types/__tests_external__/cases/smart-links/test-cases/url/insert.d.ts +3 -0
- package/dist/types/__tests_external__/cases/types.d.ts +2 -4
- package/dist/types/__tests_external__/index.d.ts +3 -2
- package/dist/types/__tests_external__/page-objects/Editor.d.ts +6 -3
- package/dist/types/__tests_external__/page-objects/EditorMedia.d.ts +20 -0
- package/dist/types/__tests_external__/page-objects/EditorSmartLink.d.ts +41 -0
- package/dist/types/__tests_external__/page-objects/Renderer.d.ts +4 -4
- package/dist/types/collab/types.d.ts +6 -0
- package/dist/types/extensions/extension-handlers.d.ts +3 -3
- package/dist/types/extensions/index.d.ts +1 -1
- package/dist/types/extensions/types/extension-handler.d.ts +3 -0
- package/dist/types/extensions/types/index.d.ts +1 -1
- package/dist/types/extensions.d.ts +1 -1
- package/dist/types/in-product.d.ts +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/provider-factory/quick-insert-provider.d.ts +2 -2
- package/dist/types/provider-factory.d.ts +1 -1
- package/dist/types/styles/shared/panel.d.ts +6 -0
- package/dist/types/styles/shared/table.d.ts +1 -0
- package/dist/types/type-ahead/index.d.ts +12 -0
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/types/{typeAhead.d.ts → type-ahead.d.ts} +0 -0
- package/dist/types/ufo/experience-store.d.ts +32 -0
- package/dist/types/ufo/index.d.ts +1 -0
- package/dist/types/utils/browser.d.ts +3 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/profiler/render-count.d.ts +50 -0
- package/package.json +20 -16
- package/type-ahead/package.json +7 -0
- 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/dist/types/__tests_external__/cases/base-test-case.d.ts +0 -19
- package/dist/types/__tests_external__/cases/base-test-collection.d.ts +0 -12
- package/dist/types/__tests_external__/cases/editor-fundamentals/editor-fundamentals-collection.d.ts +0 -3
- package/dist/types/__tests_external__/cases/editor-fundamentals/test-cases/editor-is-present.d.ts +0 -3
- package/dist/types/__tests_external__/cases/editor-fundamentals/test-cases/editor-typing.d.ts +0 -3
- package/dist/types/__tests_external__/cases/editor-upload-media.d.ts +0 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,81 @@
|
|
|
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
|
+
|
|
24
|
+
## 60.1.0
|
|
25
|
+
|
|
26
|
+
### Minor Changes
|
|
27
|
+
|
|
28
|
+
- [`981052d2a94`](https://bitbucket.org/atlassian/atlassian-frontend/commits/981052d2a94) - COLLAB-933: Update common types to support disconnected event
|
|
29
|
+
- [`8c36177a89c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8c36177a89c) - [ux] Changed wording of 'hideEmoji' to 'removeEmoji' & disbaled th button when there is no emoji (& enabled when there was one)
|
|
30
|
+
- [`cf853e39278`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cf853e39278) - AK-279 Moved copy button outside of heading, that made heading accessible
|
|
31
|
+
- [`1a07c1caf61`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1a07c1caf61) - CETI-93 - Fixed custom panel icon sizing and alignment when icon render as image
|
|
32
|
+
|
|
33
|
+
### Patch Changes
|
|
34
|
+
|
|
35
|
+
- [`114cfd6cb20`](https://bitbucket.org/atlassian/atlassian-frontend/commits/114cfd6cb20) - CETI-7 Select custom panel through keyboard
|
|
36
|
+
- [`cf853e39278`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cf853e39278) - Internal changes to remove `@atlaskit/theme/math` usage.
|
|
37
|
+
- Updated dependencies
|
|
38
|
+
|
|
39
|
+
## 60.0.0
|
|
40
|
+
|
|
41
|
+
### Major Changes
|
|
42
|
+
|
|
43
|
+
- [`b95863772be`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b95863772be) - Support external observers.
|
|
44
|
+
Use better naming for refNode (refNode => reference).
|
|
45
|
+
In favor of further work (supporting multiple references) pass array of references to Extension component.
|
|
46
|
+
Expand node with localId for extentions.
|
|
47
|
+
|
|
48
|
+
### Minor Changes
|
|
49
|
+
|
|
50
|
+
- [`71bb1bb3cd0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/71bb1bb3cd0) - [ED-12933] Create TypeAhead common constant for mobile-bridge and editor-core
|
|
51
|
+
- [`2a6a10f9c5f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2a6a10f9c5f) - CETI-29 Updated emoji picker toolbar icon for custom panels
|
|
52
|
+
- [`d1a58a7a520`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d1a58a7a520) - [ux] ED-12460 Implement collab scroll-to-telepointer: a user can now click on a collab avatar and be scrolled to another user's position in the document
|
|
53
|
+
|
|
54
|
+
### Patch Changes
|
|
55
|
+
|
|
56
|
+
- [`53d81fa08ee`](https://bitbucket.org/atlassian/atlassian-frontend/commits/53d81fa08ee) - CETI-14 added functionality to hide emoji from custom panel
|
|
57
|
+
- [`bd510f46bff`](https://bitbucket.org/atlassian/atlassian-frontend/commits/bd510f46bff) - CETI-30 added functionality to add custom panel via the slash command
|
|
58
|
+
- [`099e8495f3d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/099e8495f3d) - CETI-37 - Fixed custom panel icon sizing and alignment
|
|
59
|
+
- [`b90c0237824`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b90c0237824) - Update package.jsons to remove unused dependencies.
|
|
60
|
+
- Updated dependencies
|
|
61
|
+
|
|
62
|
+
## 59.1.0
|
|
63
|
+
|
|
64
|
+
### Minor Changes
|
|
65
|
+
|
|
66
|
+
- [`ea1cb28fb03`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ea1cb28fb03) - CETI-3 User is able to change emoji and background color when selected
|
|
67
|
+
- [`c796dfa0ae4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c796dfa0ae4) - [ME-1589] Rearchitect the adaptive toolbar solution for the editor mobile bridge.
|
|
68
|
+
|
|
69
|
+
- Add a new plugin to editor-core that allows you to subscribe to events when the editor view is updated.
|
|
70
|
+
- Created a subscription that allows you to listen to toolbar and picker plugin updates.
|
|
71
|
+
|
|
72
|
+
- [`6de7ba8ca3b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6de7ba8ca3b) - ED-12424 Add scrollTo function to extension api
|
|
73
|
+
- [`8e6a1034cfd`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8e6a1034cfd) - EDM-1730: added in-product Cypress tests for Smart Links
|
|
74
|
+
|
|
75
|
+
### Patch Changes
|
|
76
|
+
|
|
77
|
+
- Updated dependencies
|
|
78
|
+
|
|
3
79
|
## 59.0.0
|
|
4
80
|
|
|
5
81
|
### Minor Changes
|
package/dist/cjs/in-product.js
CHANGED
|
@@ -3,16 +3,40 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
Object.defineProperty(exports, "
|
|
6
|
+
Object.defineProperty(exports, "fundamentalsTestCollection", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function get() {
|
|
9
|
-
return _tests_external__.
|
|
9
|
+
return _tests_external__.fundamentalsTestCollection;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
Object.defineProperty(exports, "
|
|
12
|
+
Object.defineProperty(exports, "blueLinksTestCollection", {
|
|
13
13
|
enumerable: true,
|
|
14
14
|
get: function get() {
|
|
15
|
-
return _tests_external__.
|
|
15
|
+
return _tests_external__.blueLinksTestCollection;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "inlineSmartLinksTestCollection", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function get() {
|
|
21
|
+
return _tests_external__.inlineSmartLinksTestCollection;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "blockSmartLinksTestCollection", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function get() {
|
|
27
|
+
return _tests_external__.blockSmartLinksTestCollection;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "embedSmartLinksTestCollection", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function get() {
|
|
33
|
+
return _tests_external__.embedSmartLinksTestCollection;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "mediaTestCollection", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function get() {
|
|
39
|
+
return _tests_external__.mediaTestCollection;
|
|
16
40
|
}
|
|
17
41
|
});
|
|
18
42
|
Object.defineProperty(exports, "EditorPageObject", {
|
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() {
|
|
@@ -17,6 +17,10 @@ var _adfSchema = require("@atlaskit/adf-schema");
|
|
|
17
17
|
|
|
18
18
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
19
19
|
|
|
20
|
+
var _consts = require("@atlaskit/editor-shared-styles/consts");
|
|
21
|
+
|
|
22
|
+
var _emoji = require("@atlaskit/emoji");
|
|
23
|
+
|
|
20
24
|
var colors = _interopRequireWildcard(require("@atlaskit/theme/colors"));
|
|
21
25
|
|
|
22
26
|
var _components = require("@atlaskit/theme/components");
|
|
@@ -78,6 +82,7 @@ var darkTextColor = {
|
|
|
78
82
|
warning: colors.Y75,
|
|
79
83
|
error: colors.R75
|
|
80
84
|
};
|
|
85
|
+
var verticalAlignment = -(((0, _constants.gridSize)() * 3 - _consts.akEditorCustomIconSize) / 2);
|
|
81
86
|
var prefix = 'ak-editor-panel';
|
|
82
87
|
var PanelSharedCssClassName = {
|
|
83
88
|
prefix: prefix,
|
|
@@ -92,7 +97,13 @@ var PanelSharedSelectors = {
|
|
|
92
97
|
errorPanel: ".".concat(prefix, "[data-panel-type=").concat(_adfSchema.PanelType.ERROR, "]"),
|
|
93
98
|
successPanel: ".".concat(prefix, "[data-panel-type=").concat(_adfSchema.PanelType.SUCCESS, "]"),
|
|
94
99
|
noteButton: "button[aria-label=\"Note\"]",
|
|
95
|
-
removeButton: "button[aria-label=\"Remove\"]"
|
|
100
|
+
removeButton: "button[aria-label=\"Remove\"]",
|
|
101
|
+
colorPalette: "[aria-label=\"Background color\"]",
|
|
102
|
+
selectedColor: "[aria-label=\"The smell\"]",
|
|
103
|
+
removeEmojiIcon: "[aria-label=\"Remove emoji\"]",
|
|
104
|
+
emojiIcon: "[aria-label=\"editor-add-emoji\"]",
|
|
105
|
+
selectedEmoji: "[aria-label=\":grinning:\"]",
|
|
106
|
+
title: "#editor-title"
|
|
96
107
|
};
|
|
97
108
|
exports.PanelSharedSelectors = PanelSharedSelectors;
|
|
98
109
|
|
|
@@ -138,5 +149,5 @@ var mainDynamicStyles = function mainDynamicStyles(panelType) {
|
|
|
138
149
|
};
|
|
139
150
|
};
|
|
140
151
|
|
|
141
|
-
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));
|
|
142
153
|
exports.panelSharedStyles = panelSharedStyles;
|
|
@@ -50,7 +50,8 @@ var TableSharedCssClassName = {
|
|
|
50
50
|
TABLE_STICKY_WRAPPER: "".concat(_adfSchema.tablePrefixSelector, "-sticky-wrapper"),
|
|
51
51
|
TABLE_STICKY_SENTINEL_TOP: "".concat(_adfSchema.tablePrefixSelector, "-sticky-sentinel-top"),
|
|
52
52
|
TABLE_STICKY_SENTINEL_BOTTOM: "".concat(_adfSchema.tablePrefixSelector, "-sticky-sentinel-bottom"),
|
|
53
|
-
TABLE_CELL_NODEVIEW_CONTENT_DOM: _adfSchema.tableCellContentDomSelector
|
|
53
|
+
TABLE_CELL_NODEVIEW_CONTENT_DOM: _adfSchema.tableCellContentDomSelector,
|
|
54
|
+
TABLE_CELL_WRAPPER: _adfSchema.tableCellSelector
|
|
54
55
|
};
|
|
55
56
|
exports.TableSharedCssClassName = TableSharedCssClassName;
|
|
56
57
|
var tableSharedStyle = (0, _styledComponents.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n position: relative;\n margin: 0 auto ", "px;\n box-sizing: border-box;\n\n /**\n * Fix block top alignment inside table cells.\n */\n .decisionItemView-content-wrap:first-child > div {\n margin-top: 0;\n }\n }\n .", "[data-number-column='true'] {\n padding-left: ", "px;\n }\n /* avoid applying styles to nested tables (possible via extensions) */\n .", " > table,\n .", " > table,\n .", " > table {\n border-collapse: collapse;\n margin: ", "px ", "px 0 0;\n border: ", "px solid\n ", ";\n table-layout: fixed;\n font-size: 1em;\n width: 100%;\n\n &[data-autosize='true'] {\n table-layout: auto;\n }\n\n & {\n * {\n box-sizing: border-box;\n }\n hr {\n box-sizing: content-box;\n }\n\n tbody {\n border-bottom: none;\n }\n th td {\n background-color: white;\n }\n th,\n td {\n min-width: ", "px;\n font-weight: normal;\n vertical-align: top;\n border: 1px solid\n ", ";\n border-right-width: 0;\n border-bottom-width: 0;\n padding: ", "px;\n /* https://stackoverflow.com/questions/7517127/borders-not-shown-in-firefox-with-border-collapse-on-table-position-relative-o */\n ", "\n\n ", ";\n\n > *:first-child {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor.-right:first-child + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-child + span + * {\n margin-top: 0;\n }\n\n th p:not(:first-of-type),\n td p:not(:first-of-type) {\n margin-top: 12px;\n }\n }\n th {\n background-color: ", ";\n text-align: left;\n\n /* only apply this styling to codeblocks in default background headercells */\n /* TODO this needs to be overhauled as it relies on unsafe selectors */\n &:not([style]) {\n .code-block {\n background-image: ", ";\n background-attachment: local, scroll, scroll;\n background-position: 100% 0, 100% 0, 0 0;\n background-color: ", ";\n\n .line-number-gutter {\n background-color: ", ";\n }\n\n /* this is only relevant to the element taken care of by renderer */\n > [data-ds--code--code-block] {\n background-image: ", "!important;\n\n background-color: ", "!important;\n\n // selector lives inside @atlaskit/code\n --ds--code--line-number-bg-color: ", ";\n }\n }\n }\n }\n }\n }\n"])), TableSharedCssClassName.TABLE_CONTAINER, tableMarginBottom, TableSharedCssClassName.TABLE_CONTAINER, _editorSharedStyles.akEditorTableNumberColumnWidth - 1, TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_NODE_WRAPPER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, tableMarginTop, tableMarginSides, tableCellBorderWidth, (0, _components.themed)({
|
|
@@ -59,7 +60,7 @@ var tableSharedStyle = (0, _styledComponents.css)(_templateObject || (_templateO
|
|
|
59
60
|
}), tableCellMinWidth, (0, _components.themed)({
|
|
60
61
|
light: _editorSharedStyles.akEditorTableBorder,
|
|
61
62
|
dark: _editorSharedStyles.akEditorTableBorderDark
|
|
62
|
-
}), 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)({
|
|
63
64
|
dark: _editorSharedStyles.getTableCellBackgroundDarkModeColors
|
|
64
65
|
}), (0, _components.themed)({
|
|
65
66
|
light: _editorSharedStyles.akEditorTableToolbar,
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SelectItemMode = exports.TypeAheadAvailableNodes = void 0;
|
|
7
|
+
var TypeAheadAvailableNodes;
|
|
8
|
+
exports.TypeAheadAvailableNodes = TypeAheadAvailableNodes;
|
|
9
|
+
|
|
10
|
+
(function (TypeAheadAvailableNodes) {
|
|
11
|
+
TypeAheadAvailableNodes["EMOJI"] = "emojiTypeAhead";
|
|
12
|
+
TypeAheadAvailableNodes["MENTION"] = "mentionTypeAhead";
|
|
13
|
+
TypeAheadAvailableNodes["QUICK_INSERT"] = "quickInsertTypeAhead";
|
|
14
|
+
})(TypeAheadAvailableNodes || (exports.TypeAheadAvailableNodes = TypeAheadAvailableNodes = {}));
|
|
15
|
+
|
|
16
|
+
var SelectItemMode;
|
|
17
|
+
exports.SelectItemMode = SelectItemMode;
|
|
18
|
+
|
|
19
|
+
(function (SelectItemMode) {
|
|
20
|
+
SelectItemMode["SHIFT_ENTER"] = "shift-enter";
|
|
21
|
+
SelectItemMode["ENTER"] = "enter";
|
|
22
|
+
SelectItemMode["SPACE"] = "space";
|
|
23
|
+
SelectItemMode["SELECTED"] = "selected";
|
|
24
|
+
SelectItemMode["TAB"] = "tab";
|
|
25
|
+
})(SelectItemMode || (exports.SelectItemMode = SelectItemMode = {}));
|
|
File without changes
|
|
@@ -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");
|
|
@@ -21,8 +21,6 @@ var _colors = require("@atlaskit/theme/colors");
|
|
|
21
21
|
|
|
22
22
|
var _constants = require("@atlaskit/theme/constants");
|
|
23
23
|
|
|
24
|
-
var _math = require("@atlaskit/theme/math");
|
|
25
|
-
|
|
26
24
|
var _typography = require("@atlaskit/theme/typography");
|
|
27
25
|
|
|
28
26
|
var _templateObject, _templateObject2;
|
|
@@ -37,7 +35,7 @@ var Message = _styledComponents.default.div(_templateObject || (_templateObject
|
|
|
37
35
|
}
|
|
38
36
|
|
|
39
37
|
return _colors.N200;
|
|
40
|
-
}, (0,
|
|
38
|
+
}, (0, _constants.gridSize)() / 2);
|
|
41
39
|
|
|
42
40
|
var IconWrapper = _styledComponents.default.span(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n margin-right: 4px;\n"])));
|
|
43
41
|
|
|
@@ -13,7 +13,10 @@ var result = {
|
|
|
13
13
|
chrome_version: 0,
|
|
14
14
|
android: false,
|
|
15
15
|
ios: false,
|
|
16
|
-
webkit: false
|
|
16
|
+
webkit: false,
|
|
17
|
+
safari: false,
|
|
18
|
+
supportsIntersectionObserver: false,
|
|
19
|
+
supportsResizeObserver: false
|
|
17
20
|
};
|
|
18
21
|
|
|
19
22
|
if (typeof navigator !== 'undefined') {
|
|
@@ -29,6 +32,9 @@ if (typeof navigator !== 'undefined') {
|
|
|
29
32
|
result.android = /Android \d/.test(navigator.userAgent);
|
|
30
33
|
result.ios = !ie && /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent);
|
|
31
34
|
result.webkit = !ie && !!document.documentElement && 'WebkitAppearance' in document.documentElement.style;
|
|
35
|
+
result.safari = Boolean(navigator.vendor && navigator.vendor.indexOf('Apple') > -1 && navigator.userAgent && navigator.userAgent.indexOf('CriOS') === -1 && navigator.userAgent.indexOf('FxiOS') === -1);
|
|
36
|
+
result.supportsIntersectionObserver = typeof window !== 'undefined' && 'IntersectionObserver' in window && 'IntersectionObserverEntry' in window && 'intersectionRatio' in window.IntersectionObserverEntry.prototype;
|
|
37
|
+
result.supportsResizeObserver = typeof window !== 'undefined' && 'ResizeObserver' in window && 'ResizeObserverEntry' in window;
|
|
32
38
|
}
|
|
33
39
|
|
|
34
40
|
var _default = result;
|
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;
|