@atlaskit/editor-common 72.4.1 → 72.5.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 +52 -0
- package/dist/cjs/analytics/analytics-queue.js +79 -0
- package/dist/cjs/analytics/fire-analytics-event.js +36 -0
- package/dist/cjs/analytics/index.js +15 -1
- package/dist/cjs/analytics/types/enums.js +4 -0
- package/dist/cjs/analytics/utils.js +16 -0
- package/dist/cjs/hooks/index.js +20 -0
- package/dist/cjs/hooks/useConstructor.js +22 -0
- package/dist/cjs/hooks/usePreviousState.js +23 -0
- package/dist/cjs/keymaps/index.js +1 -1
- package/dist/cjs/styles/index.js +6 -0
- package/dist/cjs/styles/shared/table.js +3 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/index.js +6 -0
- package/dist/cjs/ui-color/ColorPalette/Color/index.js +2 -3
- package/dist/cjs/ui-color/ColorPalette/Palettes/panelBackgroundPalette.js +1 -1
- package/dist/cjs/ui-color/ColorPalette/index.js +9 -11
- package/dist/cjs/ui-color/ColorPalette/utils.js +42 -0
- package/dist/cjs/ui-color/index.js +25 -0
- package/dist/cjs/ui-menu/ArrowKeyNavigationProvider/ColorPaletteArrowKeyNavigationProvider/index.js +141 -0
- package/dist/cjs/ui-menu/{MenuArrowKeyNavigationProvider → ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider}/index.js +15 -0
- package/dist/cjs/ui-menu/ArrowKeyNavigationProvider/index.js +29 -0
- package/dist/cjs/ui-menu/ArrowKeyNavigationProvider/types.js +12 -0
- package/dist/cjs/ui-menu/Dropdown/index.js +5 -7
- package/dist/cjs/ui-menu/DropdownMenu/index.js +50 -24
- package/dist/cjs/ui-menu/ToolbarButton/index.js +3 -1
- package/dist/cjs/ui-menu/index.js +21 -0
- package/dist/cjs/utils/analytics.js +5 -1
- package/dist/cjs/utils/index.js +6 -0
- package/dist/cjs/utils/referentiality.js +29 -15
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/analytics/analytics-queue.js +53 -0
- package/dist/es2019/analytics/fire-analytics-event.js +27 -0
- package/dist/es2019/analytics/index.js +3 -1
- package/dist/es2019/analytics/types/enums.js +4 -0
- package/dist/es2019/analytics/utils.js +4 -0
- package/dist/es2019/hooks/index.js +2 -0
- package/dist/es2019/hooks/useConstructor.js +17 -0
- package/dist/es2019/hooks/usePreviousState.js +18 -0
- package/dist/es2019/keymaps/index.js +1 -1
- package/dist/es2019/styles/index.js +1 -1
- package/dist/es2019/styles/shared/table.js +1 -0
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/index.js +1 -1
- package/dist/es2019/ui-color/ColorPalette/Color/index.js +7 -4
- package/dist/es2019/ui-color/ColorPalette/Palettes/panelBackgroundPalette.js +1 -1
- package/dist/es2019/ui-color/ColorPalette/index.js +9 -11
- package/dist/es2019/ui-color/ColorPalette/utils.js +31 -0
- package/dist/es2019/ui-color/index.js +1 -0
- package/dist/es2019/ui-menu/ArrowKeyNavigationProvider/ColorPaletteArrowKeyNavigationProvider/index.js +132 -0
- package/dist/es2019/ui-menu/{MenuArrowKeyNavigationProvider → ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider}/index.js +16 -1
- package/dist/es2019/ui-menu/ArrowKeyNavigationProvider/index.js +21 -0
- package/dist/es2019/ui-menu/ArrowKeyNavigationProvider/types.js +5 -0
- package/dist/es2019/ui-menu/Dropdown/index.js +5 -7
- package/dist/es2019/ui-menu/DropdownMenu/index.js +46 -23
- package/dist/es2019/ui-menu/ToolbarButton/index.js +3 -1
- package/dist/es2019/ui-menu/index.js +3 -0
- package/dist/es2019/utils/analytics.js +1 -0
- package/dist/es2019/utils/index.js +1 -1
- package/dist/es2019/utils/referentiality.js +19 -15
- package/dist/es2019/version.json +1 -1
- package/dist/esm/analytics/analytics-queue.js +71 -0
- package/dist/esm/analytics/fire-analytics-event.js +29 -0
- package/dist/esm/analytics/index.js +3 -1
- package/dist/esm/analytics/types/enums.js +4 -0
- package/dist/esm/analytics/utils.js +9 -0
- package/dist/esm/hooks/index.js +2 -0
- package/dist/esm/hooks/useConstructor.js +17 -0
- package/dist/esm/hooks/usePreviousState.js +18 -0
- package/dist/esm/keymaps/index.js +1 -1
- package/dist/esm/styles/index.js +1 -1
- package/dist/esm/styles/shared/table.js +1 -0
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/index.js +1 -1
- package/dist/esm/ui-color/ColorPalette/Color/index.js +2 -3
- package/dist/esm/ui-color/ColorPalette/Palettes/panelBackgroundPalette.js +1 -1
- package/dist/esm/ui-color/ColorPalette/index.js +9 -11
- package/dist/esm/ui-color/ColorPalette/utils.js +32 -0
- package/dist/esm/ui-color/index.js +1 -0
- package/dist/esm/ui-menu/ArrowKeyNavigationProvider/ColorPaletteArrowKeyNavigationProvider/index.js +131 -0
- package/dist/esm/ui-menu/{MenuArrowKeyNavigationProvider → ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider}/index.js +16 -1
- package/dist/esm/ui-menu/ArrowKeyNavigationProvider/index.js +21 -0
- package/dist/esm/ui-menu/ArrowKeyNavigationProvider/types.js +5 -0
- package/dist/esm/ui-menu/Dropdown/index.js +5 -7
- package/dist/esm/ui-menu/DropdownMenu/index.js +50 -24
- package/dist/esm/ui-menu/ToolbarButton/index.js +3 -1
- package/dist/esm/ui-menu/index.js +3 -0
- package/dist/esm/utils/analytics.js +3 -0
- package/dist/esm/utils/index.js +1 -1
- package/dist/esm/utils/referentiality.js +28 -15
- package/dist/esm/version.json +1 -1
- package/dist/types/analytics/analytics-queue.d.ts +10 -0
- package/dist/types/analytics/fire-analytics-event.d.ts +2 -0
- package/dist/types/analytics/index.d.ts +3 -1
- package/dist/types/analytics/types/enums.d.ts +4 -0
- package/dist/types/analytics/types/events.d.ts +2 -1
- package/dist/types/analytics/types/general-events.d.ts +2 -2
- package/dist/types/analytics/types/index.d.ts +1 -1
- package/dist/types/analytics/utils.d.ts +3 -0
- package/dist/types/extensions/types/extension-manifest.d.ts +1 -1
- package/dist/types/hooks/index.d.ts +2 -0
- package/dist/types/hooks/useConstructor.d.ts +9 -0
- package/dist/types/hooks/usePreviousState.d.ts +11 -0
- package/dist/types/styles/index.d.ts +1 -1
- package/dist/types/styles/shared/table.d.ts +1 -0
- package/dist/types/types/editor-actions.d.ts +2 -1
- package/dist/types/types/feature-flags.d.ts +11 -0
- package/dist/types/types/floating-toolbar.d.ts +1 -1
- package/dist/types/types/index.d.ts +2 -2
- package/dist/types/types/next-editor-plugin.d.ts +37 -32
- package/dist/types/ui/index.d.ts +1 -1
- package/dist/types/ui-color/ColorPalette/Color/index.d.ts +1 -5
- package/dist/types/ui-color/ColorPalette/index.d.ts +1 -0
- package/dist/types/ui-color/ColorPalette/utils.d.ts +11 -0
- package/dist/types/ui-color/index.d.ts +1 -0
- package/dist/types/ui-menu/ArrowKeyNavigationProvider/ColorPaletteArrowKeyNavigationProvider/index.d.ts +7 -0
- package/dist/types/ui-menu/ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider/index.d.ts +7 -0
- package/dist/types/ui-menu/ArrowKeyNavigationProvider/index.d.ts +3 -0
- package/dist/types/ui-menu/ArrowKeyNavigationProvider/types.d.ts +33 -0
- package/dist/types/ui-menu/Dropdown/index.d.ts +2 -3
- package/dist/types/ui-menu/DropdownMenu/index.d.ts +2 -0
- package/dist/types/ui-menu/DropdownMenu/types.d.ts +3 -6
- package/dist/types/ui-menu/ToolbarButton/index.d.ts +2 -0
- package/dist/types/ui-menu/index.d.ts +3 -0
- package/dist/types/utils/analytics.d.ts +1 -0
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types/utils/referentiality.d.ts +11 -0
- package/hooks/package.json +15 -0
- package/package.json +16 -12
- package/dist/types/ui-menu/MenuArrowKeyNavigationProvider/index.d.ts +0 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,57 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 72.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`2ee31675e66`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2ee31675e66) - [ED-16557] Refactor Editor and EditorNext to share common code in editor-core.
|
|
8
|
+
|
|
9
|
+
Introduce new hooks in editor-common including:
|
|
10
|
+
|
|
11
|
+
1. `usePreviousState` can be used to remember the last props passed to a functional component
|
|
12
|
+
|
|
13
|
+
2. `useConstructor` can be used to run only once on a functional component
|
|
14
|
+
|
|
15
|
+
- [`15059b00c15`](https://bitbucket.org/atlassian/atlassian-frontend/commits/15059b00c15) - [ED-16585] Allow editorActions.replaceSelection and processRawValue to accept fragments. Allow quickInsert actions on extensions to return a fragment.
|
|
16
|
+
- [`c22905e224e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c22905e224e) - [ux] ED-16335: First menu item gains focus when the dropdown menu is opened by keyboard.
|
|
17
|
+
- [`9a25538e0ef`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9a25538e0ef) - [ux] ED-16723 Custom panel background color is tokensied. More details at https://hello.atlassian.net/wiki/spaces/DST/pages/2382075153/Draft+Custom+panel+background+color+is+tokenised
|
|
18
|
+
- [`c14933555ee`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c14933555ee) - Add getAnalyticsEditorAppearance utility function
|
|
19
|
+
- [`1d11b24f17e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1d11b24f17e) - [ux] ED-15549 Implemented keyboard navigation in color palette
|
|
20
|
+
- [`dfb37c5d4c2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/dfb37c5d4c2) - [ED-16752] Migrated fireAnlyticsEvent, getAnalyticsEventsFromTransaction, FireAnalyticsEvent, FireAnalyticsEventPayload
|
|
21
|
+
and extended FireAnalyticsEvent type with optional createAnalyticsEvent parameter in @atlaskit/editor-common. Decoupled
|
|
22
|
+
plugin dependency in some areas of @atlaskit/editor-core to now use the migrated code from @atlaskit/editor-common instead by
|
|
23
|
+
updating import endpoints.
|
|
24
|
+
- [`56d6c797d39`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56d6c797d39) - ED-16654 Calculate correct input latency and also added other timings for it
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- [`286cc5d6e94`](https://bitbucket.org/atlassian/atlassian-frontend/commits/286cc5d6e94) - Minor improvement to WidthEmitter to stop console error logging and test migration.
|
|
29
|
+
- [`6a031b9b2da`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6a031b9b2da) - [ED-16334] Merge NextEditorPlugin interface with NextEditorPluginWithDependencies
|
|
30
|
+
- [`e907b6924cc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e907b6924cc) - [ux] ED-16505 Update confirmation dialog message shown when data source element is about to removed
|
|
31
|
+
- [`19c1c5e554a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/19c1c5e554a) - [ux] TSLA-487 Fixes horizontal scroll shadow and places the scroll bar on the last row instead of below the table. See expected behavior on TSLA-27
|
|
32
|
+
- [`2d6074f31bb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2d6074f31bb) - ED-16740: [ux] Updated the dropdown menu to shift the focus for indentation and outdentation button to their respective opposite in case they become disabled. Also added fallback case where any disabled button will adjust focus to the next button down in the dropdown menu
|
|
33
|
+
- [`710adab73cf`](https://bitbucket.org/atlassian/atlassian-frontend/commits/710adab73cf) - [ED-16557] Introduces EditorMigrationComponent which
|
|
34
|
+
can be used as a replacement for Editor. This
|
|
35
|
+
component calls Editor under the hood but if the
|
|
36
|
+
`useEditorNext` feature flag is active will start
|
|
37
|
+
using an experimental version of the Editor API.
|
|
38
|
+
|
|
39
|
+
At this stage Makers can start adopting
|
|
40
|
+
EditorMigrationComponent to replace the Editor
|
|
41
|
+
component.
|
|
42
|
+
|
|
43
|
+
This change also introduces the `useEditorNext`
|
|
44
|
+
feature flag. Activating this flag will start to use
|
|
45
|
+
the new Editor API.
|
|
46
|
+
|
|
47
|
+
Warning: This new Editor API is in development and
|
|
48
|
+
should not be used until the EditorNext component is
|
|
49
|
+
released and the API is stable.
|
|
50
|
+
|
|
51
|
+
- [`2644ff2a1e7`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2644ff2a1e7) - [ux] ED-16838: fix keyboard shortcut toggleBlockQuote, now matches shortcut listed in https://support.atlassian.com/jira-software-cloud/docs/markdown-and-keyboard-shortcuts/ and made it work on Windows
|
|
52
|
+
- [`a6cf418fe1b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a6cf418fe1b) - ED-16904 Fixed floating toolbar disappearing on clicking color picker button."
|
|
53
|
+
- Updated dependencies
|
|
54
|
+
|
|
3
55
|
## 72.4.1
|
|
4
56
|
|
|
5
57
|
### Patch Changes
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.AnalyticsQueue = void 0;
|
|
8
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
var _memoizeOne = _interopRequireDefault(require("memoize-one"));
|
|
12
|
+
var AnalyticsQueue = /*#__PURE__*/function () {
|
|
13
|
+
function AnalyticsQueue() {
|
|
14
|
+
(0, _classCallCheck2.default)(this, AnalyticsQueue);
|
|
15
|
+
(0, _defineProperty2.default)(this, "tasks", []);
|
|
16
|
+
(0, _defineProperty2.default)(this, "running", false);
|
|
17
|
+
}
|
|
18
|
+
(0, _createClass2.default)(AnalyticsQueue, [{
|
|
19
|
+
key: "request",
|
|
20
|
+
value: function request(fn) {
|
|
21
|
+
if (window.requestIdleCallback) {
|
|
22
|
+
window.requestIdleCallback(fn);
|
|
23
|
+
} else {
|
|
24
|
+
var start = performance.now();
|
|
25
|
+
setTimeout(function () {
|
|
26
|
+
fn({
|
|
27
|
+
didTimeout: false,
|
|
28
|
+
timeRemaining: function timeRemaining() {
|
|
29
|
+
return Math.max(0, 50 - (performance.now() - start));
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}, 0);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}, {
|
|
36
|
+
key: "pending",
|
|
37
|
+
value: function pending() {
|
|
38
|
+
var _window$navigator, _window$navigator$sch;
|
|
39
|
+
// Defensive coding as navigator.scheduling.isInputPending is an experimental API
|
|
40
|
+
if (typeof ((_window$navigator = window.navigator) === null || _window$navigator === void 0 ? void 0 : (_window$navigator$sch = _window$navigator.scheduling) === null || _window$navigator$sch === void 0 ? void 0 : _window$navigator$sch.isInputPending) === 'function') {
|
|
41
|
+
var _window$navigator2, _window$navigator2$sc;
|
|
42
|
+
return ((_window$navigator2 = window.navigator) === null || _window$navigator2 === void 0 ? void 0 : (_window$navigator2$sc = _window$navigator2.scheduling) === null || _window$navigator2$sc === void 0 ? void 0 : _window$navigator2$sc.isInputPending()) === true;
|
|
43
|
+
}
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
}, {
|
|
47
|
+
key: "process",
|
|
48
|
+
value: function process() {
|
|
49
|
+
var _this = this;
|
|
50
|
+
if (this.running) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
this.running = true;
|
|
54
|
+
this.request(function (deadline) {
|
|
55
|
+
while (deadline.timeRemaining() > 0 && _this.tasks.length > 0 && !_this.pending()) {
|
|
56
|
+
var task = _this.tasks.shift();
|
|
57
|
+
if (task) {
|
|
58
|
+
task();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
_this.running = false;
|
|
62
|
+
if (_this.tasks.length > 0) {
|
|
63
|
+
_this.process();
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}, {
|
|
68
|
+
key: "schedule",
|
|
69
|
+
value: function schedule(task) {
|
|
70
|
+
this.tasks.push(task);
|
|
71
|
+
this.process();
|
|
72
|
+
}
|
|
73
|
+
}]);
|
|
74
|
+
return AnalyticsQueue;
|
|
75
|
+
}();
|
|
76
|
+
exports.AnalyticsQueue = AnalyticsQueue;
|
|
77
|
+
(0, _defineProperty2.default)(AnalyticsQueue, "get", (0, _memoizeOne.default)(function () {
|
|
78
|
+
return new AnalyticsQueue();
|
|
79
|
+
}));
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.fireAnalyticsEvent = void 0;
|
|
7
|
+
var _analyticsListeners = require("@atlaskit/analytics-listeners");
|
|
8
|
+
var _analyticsQueue = require("./analytics-queue");
|
|
9
|
+
var editorAnalyticsChannel = _analyticsListeners.FabricChannel.editor;
|
|
10
|
+
var fireAnalyticsEvent = function fireAnalyticsEvent(createAnalyticsEvent) {
|
|
11
|
+
return function (_ref) {
|
|
12
|
+
var payload = _ref.payload,
|
|
13
|
+
_ref$channel = _ref.channel,
|
|
14
|
+
channel = _ref$channel === void 0 ? editorAnalyticsChannel : _ref$channel;
|
|
15
|
+
if (!createAnalyticsEvent) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// START TEMPORARY CODE ED-10584
|
|
20
|
+
// __queueAnalytics property set in ReactEditorView based on featureFlags.queueAnalytics
|
|
21
|
+
var queueAnalytics = Boolean(createAnalyticsEvent.__queueAnalytics);
|
|
22
|
+
// END TEMPORARY CODE ED-10584
|
|
23
|
+
|
|
24
|
+
if (queueAnalytics) {
|
|
25
|
+
var queue = _analyticsQueue.AnalyticsQueue.get();
|
|
26
|
+
queue.schedule(function () {
|
|
27
|
+
var _createAnalyticsEvent;
|
|
28
|
+
return (_createAnalyticsEvent = createAnalyticsEvent(payload)) === null || _createAnalyticsEvent === void 0 ? void 0 : _createAnalyticsEvent.fire(channel);
|
|
29
|
+
});
|
|
30
|
+
} else {
|
|
31
|
+
var _createAnalyticsEvent2;
|
|
32
|
+
(_createAnalyticsEvent2 = createAnalyticsEvent(payload)) === null || _createAnalyticsEvent2 === void 0 ? void 0 : _createAnalyticsEvent2.fire(channel);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
exports.fireAnalyticsEvent = fireAnalyticsEvent;
|
|
@@ -231,4 +231,18 @@ Object.defineProperty(exports, "USER_CONTEXT", {
|
|
|
231
231
|
return _types.USER_CONTEXT;
|
|
232
232
|
}
|
|
233
233
|
});
|
|
234
|
-
|
|
234
|
+
Object.defineProperty(exports, "fireAnalyticsEvent", {
|
|
235
|
+
enumerable: true,
|
|
236
|
+
get: function get() {
|
|
237
|
+
return _fireAnalyticsEvent.fireAnalyticsEvent;
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
Object.defineProperty(exports, "getAnalyticsEventsFromTransaction", {
|
|
241
|
+
enumerable: true,
|
|
242
|
+
get: function get() {
|
|
243
|
+
return _utils.getAnalyticsEventsFromTransaction;
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
var _types = require("./types");
|
|
247
|
+
var _fireAnalyticsEvent = require("./fire-analytics-event");
|
|
248
|
+
var _utils = require("./utils");
|
|
@@ -65,6 +65,10 @@ exports.ACTION = ACTION;
|
|
|
65
65
|
ACTION["INITIALISED_FRAGMENT_MARK"] = "initialisedFragmentMark";
|
|
66
66
|
ACTION["INPUT_PERF_SAMPLING"] = "inputPerfSampling";
|
|
67
67
|
ACTION["INPUT_PERF_SAMPLING_AVG"] = "inputPerfSamplingAvg";
|
|
68
|
+
ACTION["INPUT_PERF_SAMPLING_SINGLE_KEYPRESS"] = "inputPerfSamplingSingleKeypress";
|
|
69
|
+
ACTION["INPUT_PERF_SAMPLING_SINGLE_KEYPRESS_AVG"] = "inputPerfSamplingSingleKeypressAvg";
|
|
70
|
+
ACTION["INPUT_PERF_SAMPLING_RENDERED"] = "inputPerfSamplingRendered";
|
|
71
|
+
ACTION["INPUT_PERF_SAMPLING_RENDERED_AVG"] = "inputPerfSamplingRenderedAvg";
|
|
68
72
|
ACTION["INSERTED"] = "inserted";
|
|
69
73
|
ACTION["INVALID_DOCUMENT_ENCOUNTERED"] = "invalidDocumentEncountered";
|
|
70
74
|
ACTION["INVOKED"] = "invoked";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.getAnalyticsEventsFromTransaction = getAnalyticsEventsFromTransaction;
|
|
8
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
|
+
var _steps = require("@atlaskit/adf-schema/steps");
|
|
10
|
+
function getAnalyticsEventsFromTransaction(tr) {
|
|
11
|
+
return tr.steps.filter(function (step) {
|
|
12
|
+
return step instanceof _steps.AnalyticsStep;
|
|
13
|
+
}).reduce(function (acc, step) {
|
|
14
|
+
return [].concat((0, _toConsumableArray2.default)(acc), (0, _toConsumableArray2.default)(step.analyticsEvents));
|
|
15
|
+
}, []);
|
|
16
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
Object.defineProperty(exports, "useConstructor", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function get() {
|
|
10
|
+
return _useConstructor.default;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
Object.defineProperty(exports, "usePreviousState", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function get() {
|
|
16
|
+
return _usePreviousState.default;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
var _usePreviousState = _interopRequireDefault(require("./usePreviousState"));
|
|
20
|
+
var _useConstructor = _interopRequireDefault(require("./useConstructor"));
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = useConstructor;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* Hook to run code once in a functional component.
|
|
11
|
+
* Emulates the behaviour of a `constructor` in a class component
|
|
12
|
+
* Place this at the top of your functional component so that it is run first.
|
|
13
|
+
*
|
|
14
|
+
* @param callback Callback function to run once
|
|
15
|
+
*/
|
|
16
|
+
function useConstructor(callback) {
|
|
17
|
+
var hasRun = (0, _react.useRef)(false);
|
|
18
|
+
if (!hasRun.current) {
|
|
19
|
+
callback();
|
|
20
|
+
hasRun.current = true;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = usePreviousState;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* Can be used to get the previous state of a prop.
|
|
11
|
+
* This can be helpful when converting class components to functional
|
|
12
|
+
* where we don't have the `prevProps`.
|
|
13
|
+
*
|
|
14
|
+
* @param value New state of the
|
|
15
|
+
* @param initialValue Optional parameter for the inital state of the component
|
|
16
|
+
* @returns
|
|
17
|
+
*/
|
|
18
|
+
function usePreviousState(value, initialValue) {
|
|
19
|
+
var ref = (0, _react.useRef)(initialValue);
|
|
20
|
+
var prevValue = ref.current;
|
|
21
|
+
ref.current = value;
|
|
22
|
+
return prevValue;
|
|
23
|
+
}
|
|
@@ -143,7 +143,7 @@ var ctrlBackSpace = makeKeyMapWithCommon('Cmd + Backspace', 'Mod-Backspace');
|
|
|
143
143
|
exports.ctrlBackSpace = ctrlBackSpace;
|
|
144
144
|
var toggleBulletList = makeKeyMapWithCommon('Bullet list', 'Mod-Shift-8');
|
|
145
145
|
exports.toggleBulletList = toggleBulletList;
|
|
146
|
-
var toggleBlockQuote =
|
|
146
|
+
var toggleBlockQuote = makeKeyMapWithCommon('Quote', 'Mod-Shift-9');
|
|
147
147
|
exports.toggleBlockQuote = toggleBlockQuote;
|
|
148
148
|
var insertNewLine = makeKeyMapWithCommon('Insert new line', 'Shift-Enter');
|
|
149
149
|
exports.insertNewLine = insertNewLine;
|
package/dist/cjs/styles/index.js
CHANGED
|
@@ -243,6 +243,12 @@ Object.defineProperty(exports, "tableMarginTop", {
|
|
|
243
243
|
return _table.tableMarginTop;
|
|
244
244
|
}
|
|
245
245
|
});
|
|
246
|
+
Object.defineProperty(exports, "tableMarginTopWithControl", {
|
|
247
|
+
enumerable: true,
|
|
248
|
+
get: function get() {
|
|
249
|
+
return _table.tableMarginTopWithControl;
|
|
250
|
+
}
|
|
251
|
+
});
|
|
246
252
|
Object.defineProperty(exports, "tableNewColumnMinWidth", {
|
|
247
253
|
enumerable: true,
|
|
248
254
|
get: function get() {
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.tableSharedStyle = exports.tableResizeHandleWidth = exports.tableNewColumnMinWidth = exports.tableMarginTop = exports.tableMarginSides = exports.tableMarginBottom = exports.tableCellPadding = exports.tableCellMinWidth = exports.tableCellBorderWidth = exports.calcTableWidth = exports.TableSharedCssClassName = void 0;
|
|
7
|
+
exports.tableSharedStyle = exports.tableResizeHandleWidth = exports.tableNewColumnMinWidth = exports.tableMarginTopWithControl = exports.tableMarginTop = exports.tableMarginSides = exports.tableMarginBottom = exports.tableCellPadding = exports.tableCellMinWidth = exports.tableCellBorderWidth = exports.calcTableWidth = exports.TableSharedCssClassName = void 0;
|
|
8
8
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
9
|
var _react = require("@emotion/react");
|
|
10
10
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
@@ -19,6 +19,8 @@ var tableMarginTop = 24;
|
|
|
19
19
|
exports.tableMarginTop = tableMarginTop;
|
|
20
20
|
var tableMarginBottom = 16;
|
|
21
21
|
exports.tableMarginBottom = tableMarginBottom;
|
|
22
|
+
var tableMarginTopWithControl = 14;
|
|
23
|
+
exports.tableMarginTopWithControl = tableMarginTopWithControl;
|
|
22
24
|
var tableMarginSides = 8;
|
|
23
25
|
exports.tableMarginSides = tableMarginSides;
|
|
24
26
|
var tableCellMinWidth = 48;
|
|
@@ -24,7 +24,7 @@ var _templateObject, _templateObject2, _templateObject3;
|
|
|
24
24
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
25
25
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
26
26
|
var packageName = "@atlaskit/editor-common";
|
|
27
|
-
var packageVersion = "72.
|
|
27
|
+
var packageVersion = "72.5.0";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = "0, ".concat((0, _constants.gridSize)(), "px");
|
|
30
30
|
var DropList = /*#__PURE__*/function (_Component) {
|
package/dist/cjs/ui/index.js
CHANGED
|
@@ -119,6 +119,12 @@ Object.defineProperty(exports, "WidthConsumer", {
|
|
|
119
119
|
return _WidthProvider.WidthConsumer;
|
|
120
120
|
}
|
|
121
121
|
});
|
|
122
|
+
Object.defineProperty(exports, "WidthContext", {
|
|
123
|
+
enumerable: true,
|
|
124
|
+
get: function get() {
|
|
125
|
+
return _WidthProvider.WidthContext;
|
|
126
|
+
}
|
|
127
|
+
});
|
|
122
128
|
Object.defineProperty(exports, "WidthProvider", {
|
|
123
129
|
enumerable: true,
|
|
124
130
|
get: function get() {
|
|
@@ -15,7 +15,6 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
|
|
|
15
15
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
16
|
var _react = _interopRequireWildcard(require("react"));
|
|
17
17
|
var _react2 = require("@emotion/react");
|
|
18
|
-
var _editorPalette = require("@atlaskit/editor-palette");
|
|
19
18
|
var _done = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/done"));
|
|
20
19
|
var _colors = require("@atlaskit/theme/colors");
|
|
21
20
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
@@ -59,8 +58,8 @@ var Color = /*#__PURE__*/function (_PureComponent) {
|
|
|
59
58
|
borderColor = _this$props2.borderColor,
|
|
60
59
|
_this$props2$checkMar = _this$props2.checkMarkColor,
|
|
61
60
|
checkMarkColor = _this$props2$checkMar === void 0 ? _colors.N0 : _this$props2$checkMar,
|
|
62
|
-
|
|
63
|
-
var colorStyle =
|
|
61
|
+
hexToPaletteColor = _this$props2.hexToPaletteColor;
|
|
62
|
+
var colorStyle = hexToPaletteColor ? hexToPaletteColor(value) : value;
|
|
64
63
|
return (0, _react2.jsx)(_tooltip.default, {
|
|
65
64
|
content: label
|
|
66
65
|
}, (0, _react2.jsx)("span", {
|
|
@@ -78,7 +78,7 @@ var panelBackgroundPalette = [{
|
|
|
78
78
|
value: _theme.colors.P100
|
|
79
79
|
}].map(function (color) {
|
|
80
80
|
return _objectSpread(_objectSpread({}, color), {}, {
|
|
81
|
-
border: _common.DEFAULT_BORDER_COLOR
|
|
81
|
+
border: "var(--ds-border, ".concat(_common.DEFAULT_BORDER_COLOR, ")")
|
|
82
82
|
});
|
|
83
83
|
});
|
|
84
84
|
/* eslint-enable @atlaskit/design-system/ensure-design-token-usage */
|
|
@@ -15,6 +15,7 @@ var _Color = _interopRequireDefault(require("./Color"));
|
|
|
15
15
|
var _getColorMessage = _interopRequireDefault(require("./Palettes/getColorMessage"));
|
|
16
16
|
var _paletteMessagesTokenModeNames = require("./Palettes/paletteMessagesTokenModeNames");
|
|
17
17
|
var _styles = require("./styles");
|
|
18
|
+
var _utils = require("./utils");
|
|
18
19
|
/** @jsx jsx */
|
|
19
20
|
|
|
20
21
|
/**
|
|
@@ -24,12 +25,12 @@ var _styles = require("./styles");
|
|
|
24
25
|
* @param color color string, suppports HEX, RGB, RGBA etc.
|
|
25
26
|
* @return Highest contrast color in pool
|
|
26
27
|
*/
|
|
27
|
-
function getCheckMarkColor(color,
|
|
28
|
+
function getCheckMarkColor(color, useIconToken) {
|
|
28
29
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
29
30
|
var contrastColor = [_colors.N0, _colors.N500].sort(function (a, b) {
|
|
30
31
|
return _chromatism.default.difference(b, color) - _chromatism.default.difference(a, color);
|
|
31
32
|
})[0];
|
|
32
|
-
if (!
|
|
33
|
+
if (!useIconToken) {
|
|
33
34
|
return contrastColor;
|
|
34
35
|
}
|
|
35
36
|
|
|
@@ -42,24 +43,21 @@ function getCheckMarkColor(color, textPalette) {
|
|
|
42
43
|
var ColorPalette = function ColorPalette(props) {
|
|
43
44
|
var palette = props.palette,
|
|
44
45
|
_props$cols = props.cols,
|
|
45
|
-
cols = _props$cols === void 0 ?
|
|
46
|
+
cols = _props$cols === void 0 ? _utils.DEFAULT_COLOR_PICKER_COLUMNS : _props$cols,
|
|
46
47
|
onClick = props.onClick,
|
|
47
48
|
selectedColor = props.selectedColor,
|
|
48
49
|
className = props.className,
|
|
49
50
|
formatMessage = props.intl.formatMessage,
|
|
50
51
|
_props$textPalette = props.textPalette,
|
|
51
52
|
textPalette = _props$textPalette === void 0 ? false : _props$textPalette,
|
|
53
|
+
hexToPaletteColor = props.hexToPaletteColor,
|
|
52
54
|
_props$useSomewhatSem = props.useSomewhatSemanticTextColorNames,
|
|
53
55
|
useSomewhatSemanticTextColorNames = _props$useSomewhatSem === void 0 ? false : _props$useSomewhatSem;
|
|
54
56
|
var _useThemeObserver = (0, _tokens.useThemeObserver)(),
|
|
55
57
|
tokenTheme = _useThemeObserver.colorMode;
|
|
58
|
+
var useIconToken = !!hexToPaletteColor;
|
|
56
59
|
var colorsPerRow = _react.default.useMemo(function () {
|
|
57
|
-
return
|
|
58
|
-
var chunkIndex = Math.floor(index / cols);
|
|
59
|
-
resultArray[chunkIndex] = resultArray[chunkIndex] || []; // start a new chunk
|
|
60
|
-
resultArray[chunkIndex].push(item);
|
|
61
|
-
return resultArray;
|
|
62
|
-
}, []);
|
|
60
|
+
return (0, _utils.getColorsPerRowFromPalette)(palette, cols);
|
|
63
61
|
}, [palette, cols]);
|
|
64
62
|
return (0, _react2.jsx)(_react.default.Fragment, null, colorsPerRow.map(function (row, rowIdx) {
|
|
65
63
|
return (0, _react2.jsx)("div", {
|
|
@@ -87,8 +85,8 @@ var ColorPalette = function ColorPalette(props) {
|
|
|
87
85
|
label: message ? formatMessage(message) : label,
|
|
88
86
|
onClick: onClick,
|
|
89
87
|
isSelected: value === selectedColor,
|
|
90
|
-
checkMarkColor: getCheckMarkColor(value,
|
|
91
|
-
|
|
88
|
+
checkMarkColor: getCheckMarkColor(value, useIconToken),
|
|
89
|
+
hexToPaletteColor: hexToPaletteColor
|
|
92
90
|
});
|
|
93
91
|
}));
|
|
94
92
|
}));
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DEFAULT_COLOR_PICKER_COLUMNS = void 0;
|
|
7
|
+
exports.getColorsPerRowFromPalette = getColorsPerRowFromPalette;
|
|
8
|
+
exports.getSelectedRowAndColumn = getSelectedRowAndColumn;
|
|
9
|
+
exports.getSelectedRowAndColumnFromPalette = getSelectedRowAndColumnFromPalette;
|
|
10
|
+
var DEFAULT_COLOR_PICKER_COLUMNS = 7;
|
|
11
|
+
exports.DEFAULT_COLOR_PICKER_COLUMNS = DEFAULT_COLOR_PICKER_COLUMNS;
|
|
12
|
+
function getColorsPerRowFromPalette(palette) {
|
|
13
|
+
var cols = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_COLOR_PICKER_COLUMNS;
|
|
14
|
+
return palette.reduce(function (resultArray, item, index) {
|
|
15
|
+
var chunkIndex = Math.floor(index / cols);
|
|
16
|
+
resultArray[chunkIndex] = resultArray[chunkIndex] || []; // start a new chunk
|
|
17
|
+
resultArray[chunkIndex].push(item);
|
|
18
|
+
return resultArray;
|
|
19
|
+
}, []);
|
|
20
|
+
}
|
|
21
|
+
function getSelectedRowAndColumn(colorsPerRow, selectedColor) {
|
|
22
|
+
var selectedRowIndex = -1;
|
|
23
|
+
var selectedColumnIndex = -1;
|
|
24
|
+
colorsPerRow.forEach(function (row, rowIndex) {
|
|
25
|
+
row.forEach(function (_ref, columnIndex) {
|
|
26
|
+
var value = _ref.value;
|
|
27
|
+
if (value === selectedColor) {
|
|
28
|
+
selectedRowIndex = rowIndex;
|
|
29
|
+
selectedColumnIndex = columnIndex;
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
return {
|
|
34
|
+
selectedRowIndex: selectedRowIndex,
|
|
35
|
+
selectedColumnIndex: selectedColumnIndex
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function getSelectedRowAndColumnFromPalette(palette, selectedColor) {
|
|
39
|
+
var cols = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DEFAULT_COLOR_PICKER_COLUMNS;
|
|
40
|
+
var colorsPerRow = getColorsPerRowFromPalette(palette, cols);
|
|
41
|
+
return getSelectedRowAndColumn(colorsPerRow, selectedColor);
|
|
42
|
+
}
|
|
@@ -22,6 +22,12 @@ Object.defineProperty(exports, "DEFAULT_BORDER_COLOR", {
|
|
|
22
22
|
return _common.DEFAULT_BORDER_COLOR;
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
|
+
Object.defineProperty(exports, "DEFAULT_COLOR_PICKER_COLUMNS", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function get() {
|
|
28
|
+
return _utils.DEFAULT_COLOR_PICKER_COLUMNS;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
25
31
|
Object.defineProperty(exports, "cellBackgroundColorPalette", {
|
|
26
32
|
enumerable: true,
|
|
27
33
|
get: function get() {
|
|
@@ -40,6 +46,24 @@ Object.defineProperty(exports, "darkModeStatusColorPalette", {
|
|
|
40
46
|
return _statusColorPalette.darkModeStatusColorPalette;
|
|
41
47
|
}
|
|
42
48
|
});
|
|
49
|
+
Object.defineProperty(exports, "getColorsPerRowFromPalette", {
|
|
50
|
+
enumerable: true,
|
|
51
|
+
get: function get() {
|
|
52
|
+
return _utils.getColorsPerRowFromPalette;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
Object.defineProperty(exports, "getSelectedRowAndColumn", {
|
|
56
|
+
enumerable: true,
|
|
57
|
+
get: function get() {
|
|
58
|
+
return _utils.getSelectedRowAndColumn;
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
Object.defineProperty(exports, "getSelectedRowAndColumnFromPalette", {
|
|
62
|
+
enumerable: true,
|
|
63
|
+
get: function get() {
|
|
64
|
+
return _utils.getSelectedRowAndColumnFromPalette;
|
|
65
|
+
}
|
|
66
|
+
});
|
|
43
67
|
Object.defineProperty(exports, "lightModeStatusColorPalette", {
|
|
44
68
|
enumerable: true,
|
|
45
69
|
get: function get() {
|
|
@@ -66,6 +90,7 @@ Object.defineProperty(exports, "textColorPalette", {
|
|
|
66
90
|
});
|
|
67
91
|
var _ColorPalette = _interopRequireDefault(require("./ColorPalette"));
|
|
68
92
|
var _Color = _interopRequireDefault(require("./ColorPalette/Color"));
|
|
93
|
+
var _utils = require("./ColorPalette/utils");
|
|
69
94
|
var _cellBackgroundColorPalette = _interopRequireDefault(require("./ColorPalette/Palettes/cellBackgroundColorPalette"));
|
|
70
95
|
var _paletteMessages = _interopRequireDefault(require("./ColorPalette/Palettes/paletteMessages"));
|
|
71
96
|
var _panelBackgroundPalette = require("./ColorPalette/Palettes/panelBackgroundPalette");
|