@atlaskit/editor-common 74.41.2 → 74.42.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/cjs/analytics/types/table-events.js +1 -0
  3. package/dist/cjs/monitoring/error.js +1 -1
  4. package/dist/cjs/preset/plugin-commands.js +10 -0
  5. package/dist/cjs/preset/plugin-injection-api.js +17 -2
  6. package/dist/cjs/quick-insert/assets/action.js +23 -6
  7. package/dist/cjs/quick-insert/assets/code.js +31 -8
  8. package/dist/cjs/quick-insert/assets/decision.js +19 -5
  9. package/dist/cjs/quick-insert/assets/divider.js +35 -9
  10. package/dist/cjs/quick-insert/use-icon-themed.js +20 -0
  11. package/dist/cjs/ui/DropList/index.js +1 -1
  12. package/dist/cjs/version.json +1 -1
  13. package/dist/es2019/analytics/types/table-events.js +1 -0
  14. package/dist/es2019/monitoring/error.js +1 -1
  15. package/dist/es2019/preset/plugin-commands.js +10 -0
  16. package/dist/es2019/preset/plugin-injection-api.js +17 -2
  17. package/dist/es2019/quick-insert/assets/action.js +24 -6
  18. package/dist/es2019/quick-insert/assets/code.js +32 -8
  19. package/dist/es2019/quick-insert/assets/decision.js +20 -5
  20. package/dist/es2019/quick-insert/assets/divider.js +36 -9
  21. package/dist/es2019/quick-insert/use-icon-themed.js +14 -0
  22. package/dist/es2019/ui/DropList/index.js +1 -1
  23. package/dist/es2019/version.json +1 -1
  24. package/dist/esm/analytics/types/table-events.js +1 -0
  25. package/dist/esm/monitoring/error.js +1 -1
  26. package/dist/esm/preset/plugin-commands.js +10 -0
  27. package/dist/esm/preset/plugin-injection-api.js +17 -2
  28. package/dist/esm/quick-insert/assets/action.js +23 -6
  29. package/dist/esm/quick-insert/assets/code.js +31 -8
  30. package/dist/esm/quick-insert/assets/decision.js +19 -5
  31. package/dist/esm/quick-insert/assets/divider.js +35 -9
  32. package/dist/esm/quick-insert/use-icon-themed.js +13 -0
  33. package/dist/esm/ui/DropList/index.js +1 -1
  34. package/dist/esm/version.json +1 -1
  35. package/dist/types/analytics/types/table-events.d.ts +11 -3
  36. package/dist/types/hooks/useSharedPluginState.d.ts +5 -5
  37. package/dist/types/preset/plugin-commands.d.ts +10 -0
  38. package/dist/types/preset/plugin-injection-api.d.ts +9 -1
  39. package/dist/types/quick-insert/use-icon-themed.d.ts +9 -0
  40. package/dist/types/types/next-editor-plugin.d.ts +8 -0
  41. package/dist/types-ts4.5/analytics/types/table-events.d.ts +11 -3
  42. package/dist/types-ts4.5/hooks/useSharedPluginState.d.ts +5 -5
  43. package/dist/types-ts4.5/preset/plugin-commands.d.ts +10 -0
  44. package/dist/types-ts4.5/preset/plugin-injection-api.d.ts +9 -1
  45. package/dist/types-ts4.5/quick-insert/use-icon-themed.d.ts +9 -0
  46. package/dist/types-ts4.5/types/next-editor-plugin.d.ts +8 -0
  47. package/package.json +1 -1
@@ -1,7 +1,10 @@
1
- // TODO: https://product-fabric.atlassian.net/browse/DSP-4138
2
1
  /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
3
2
  import React from 'react';
3
+ import { useIconThemed } from '../use-icon-themed';
4
4
  export default function IconDecision() {
5
+ const {
6
+ iconThemed
7
+ } = useIconThemed();
5
8
  return /*#__PURE__*/React.createElement("svg", {
6
9
  focusable: "false",
7
10
  "aria-hidden": true,
@@ -11,16 +14,28 @@ export default function IconDecision() {
11
14
  fill: "none",
12
15
  fillRule: "evenodd"
13
16
  }, /*#__PURE__*/React.createElement("path", {
14
- fill: "#FFF",
17
+ fill: iconThemed({
18
+ light: '#FFF',
19
+ dark: '#161A1D'
20
+ }),
15
21
  d: "M0 0h40v40H0z"
16
22
  }), /*#__PURE__*/React.createElement("path", {
17
23
  d: "M10 10h29v20H10a3 3 0 01-3-3V13a3 3 0 013-3z",
18
- fill: "#ECEDF0"
24
+ fill: iconThemed({
25
+ light: '#ECEDF0',
26
+ dark: '#454F59'
27
+ })
19
28
  }), /*#__PURE__*/React.createElement("path", {
20
29
  d: "M14.414 16l3.293 3.293c.187.187.293.442.293.707v5a1 1 0 01-2 0v-4.586l-3-3V18.5a1 1 0 01-2 0V15a1 1 0 011-1h3.5a1 1 0 010 2h-1.086zm8.293-1.707a.999.999 0 010 1.414l-2.5 2.5a.997.997 0 01-1.414 0 .999.999 0 010-1.414l2.5-2.5a.999.999 0 011.414 0z",
21
- fill: "#36B37E"
30
+ fill: iconThemed({
31
+ light: '#36B37E',
32
+ dark: '#1F845A'
33
+ })
22
34
  }), /*#__PURE__*/React.createElement("path", {
23
35
  d: "M27 19h12v2H27a1 1 0 010-2z",
24
- fill: "#C1C7D0"
36
+ fill: iconThemed({
37
+ light: '#C1C7D0',
38
+ dark: '#738496'
39
+ })
25
40
  })));
26
41
  }
@@ -1,7 +1,10 @@
1
- // TODO: https://product-fabric.atlassian.net/browse/DSP-4138
2
1
  /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
3
2
  import React from 'react';
3
+ import { useIconThemed } from '../use-icon-themed';
4
4
  export default function IconDivider() {
5
+ const {
6
+ iconThemed
7
+ } = useIconThemed();
5
8
  return /*#__PURE__*/React.createElement("svg", {
6
9
  focusable: "false",
7
10
  "aria-hidden": true,
@@ -11,52 +14,76 @@ export default function IconDivider() {
11
14
  fill: "none",
12
15
  fillRule: "evenodd"
13
16
  }, /*#__PURE__*/React.createElement("path", {
14
- fill: "#FFF",
17
+ fill: iconThemed({
18
+ light: '#FFF',
19
+ dark: '#161A1D'
20
+ }),
15
21
  d: "M0 0h40v40H0z"
16
22
  }), /*#__PURE__*/React.createElement("rect", {
17
- fill: "#C1C7D0",
23
+ fill: iconThemed({
24
+ light: '#C1C7D0',
25
+ dark: '#5A6977'
26
+ }),
18
27
  x: 6,
19
28
  y: 19,
20
29
  width: 28,
21
30
  height: 2,
22
31
  rx: 1
23
32
  }), /*#__PURE__*/React.createElement("rect", {
24
- fill: "#C1C7D0",
33
+ fill: iconThemed({
34
+ light: '#C1C7D0',
35
+ dark: '#5A6977'
36
+ }),
25
37
  x: 12,
26
38
  y: 14,
27
39
  width: 16,
28
40
  height: 1,
29
41
  rx: 0.5
30
42
  }), /*#__PURE__*/React.createElement("rect", {
31
- fill: "#C1C7D0",
43
+ fill: iconThemed({
44
+ light: '#C1C7D0',
45
+ dark: '#5A6977'
46
+ }),
32
47
  x: 12,
33
48
  y: 11,
34
49
  width: 16,
35
50
  height: 1,
36
51
  rx: 0.5
37
52
  }), /*#__PURE__*/React.createElement("rect", {
38
- fill: "#C1C7D0",
53
+ fill: iconThemed({
54
+ light: '#C1C7D0',
55
+ dark: '#5A6977'
56
+ }),
39
57
  x: 12,
40
58
  y: 8,
41
59
  width: 16,
42
60
  height: 1,
43
61
  rx: 0.5
44
62
  }), /*#__PURE__*/React.createElement("rect", {
45
- fill: "#C1C7D0",
63
+ fill: iconThemed({
64
+ light: '#C1C7D0',
65
+ dark: '#5A6977'
66
+ }),
46
67
  x: 12,
47
68
  y: 31,
48
69
  width: 9,
49
70
  height: 1,
50
71
  rx: 0.5
51
72
  }), /*#__PURE__*/React.createElement("rect", {
52
- fill: "#C1C7D0",
73
+ fill: iconThemed({
74
+ light: '#C1C7D0',
75
+ dark: '#5A6977'
76
+ }),
53
77
  x: 12,
54
78
  y: 28,
55
79
  width: 16,
56
80
  height: 1,
57
81
  rx: 0.5
58
82
  }), /*#__PURE__*/React.createElement("rect", {
59
- fill: "#C1C7D0",
83
+ fill: iconThemed({
84
+ light: '#C1C7D0',
85
+ dark: '#5A6977'
86
+ }),
60
87
  x: 12,
61
88
  y: 25,
62
89
  width: 16,
@@ -0,0 +1,14 @@
1
+ import { useThemeObserver } from '@atlaskit/tokens';
2
+ /**
3
+ * Warning -- if additional color modes beyond light and dark are added in future -- this will have unexpected behaviour
4
+ */
5
+ export const useIconThemed = () => {
6
+ const {
7
+ colorMode
8
+ } = useThemeObserver();
9
+ return {
10
+ iconThemed: colors => {
11
+ return colorMode && colorMode === 'dark' ? colors['dark'] : colors['light'];
12
+ }
13
+ };
14
+ };
@@ -8,7 +8,7 @@ import { themed } from '@atlaskit/theme/components';
8
8
  import { borderRadius } from '@atlaskit/theme/constants';
9
9
  import Layer from '../Layer';
10
10
  const packageName = "@atlaskit/editor-common";
11
- const packageVersion = "74.41.2";
11
+ const packageVersion = "74.42.1";
12
12
  const halfFocusRing = 1;
13
13
  const dropOffset = '0, 8';
14
14
  class DropList extends Component {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "74.41.2",
3
+ "version": "74.42.1",
4
4
  "sideEffects": false
5
5
  }
@@ -22,6 +22,7 @@ export var TABLE_ACTION = /*#__PURE__*/function (TABLE_ACTION) {
22
22
  TABLE_ACTION["DISTRIBUTED_COLUMNS_WIDTHS"] = "distributedColumnsWidths";
23
23
  TABLE_ACTION["FIXED"] = "fixed";
24
24
  TABLE_ACTION["RESIZED"] = "resized";
25
+ TABLE_ACTION["RESIZE_PERF_SAMPLING"] = "resizePerfSampling";
25
26
  return TABLE_ACTION;
26
27
  }({});
27
28
  export var TABLE_BREAKOUT = /*#__PURE__*/function (TABLE_BREAKOUT) {
@@ -6,7 +6,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
6
6
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
7
7
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
8
8
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
9
- var packageVersion = "74.41.2";
9
+ var packageVersion = "74.42.1";
10
10
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
11
11
  // Remove URL as it has UGC
12
12
  // TODO: Sanitise the URL instead of just removing it
@@ -1,3 +1,13 @@
1
+ /**
2
+ * Convert a PluginCommand to a standard Prosemirror Command.
3
+ * The preferred approach to dispatching a `PluginCommand` is via the
4
+ * `executeCommand` on `pluginInjectionAPI`. In some cases
5
+ * the type may require a Command until we refactor this out and this
6
+ * function is suitable for those cases.
7
+ *
8
+ * @param command A plugin command (a function that modifies and returns a `Transaction`)
9
+ * @returns Command
10
+ */
1
11
  export function pluginCommandToPMCommand(command) {
2
12
  return function (_ref, dispatch) {
3
13
  var tr = _ref.tr;
@@ -9,6 +9,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
9
9
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
10
10
  import isEqual from 'lodash/isEqual';
11
11
  import throttle from 'lodash/throttle';
12
+ import { pluginCommandToPMCommand } from './plugin-commands';
12
13
  function hasGetSharedState(plugin) {
13
14
  return typeof plugin.getSharedState === 'function';
14
15
  }
@@ -234,7 +235,8 @@ export var SharedStateAPI = /*#__PURE__*/function () {
234
235
  export var EditorPluginInjectionAPI = /*#__PURE__*/function () {
235
236
  function EditorPluginInjectionAPI(_ref6) {
236
237
  var _this2 = this;
237
- var getEditorState = _ref6.getEditorState;
238
+ var getEditorState = _ref6.getEditorState,
239
+ getEditorView = _ref6.getEditorView;
238
240
  _classCallCheck(this, EditorPluginInjectionAPI);
239
241
  _defineProperty(this, "onEditorViewUpdated", function (_ref7) {
240
242
  var newEditorState = _ref7.newEditorState,
@@ -261,6 +263,7 @@ export var EditorPluginInjectionAPI = /*#__PURE__*/function () {
261
263
  this.plugins = new Map();
262
264
  this.actionsAPI = new ActionsAPI();
263
265
  this.commandsAPI = new PluginCommandsAPI();
266
+ this.getEditorView = getEditorView;
264
267
  }
265
268
  _createClass(EditorPluginInjectionAPI, [{
266
269
  key: "api",
@@ -296,9 +299,21 @@ export var EditorPluginInjectionAPI = /*#__PURE__*/function () {
296
299
  }
297
300
  });
298
301
  return {
299
- dependencies: dependencies
302
+ dependencies: dependencies,
303
+ executeCommand: this.executeCommand.bind(this)
300
304
  };
301
305
  }
306
+ }, {
307
+ key: "executeCommand",
308
+ value: function executeCommand(command) {
309
+ var editorView = this.getEditorView();
310
+ if (!editorView || !command) {
311
+ return false;
312
+ }
313
+ var state = editorView.state,
314
+ dispatch = editorView.dispatch;
315
+ return pluginCommandToPMCommand(command)(state, dispatch);
316
+ }
302
317
  }]);
303
318
  return EditorPluginInjectionAPI;
304
319
  }();
@@ -1,7 +1,9 @@
1
- // TODO: https://product-fabric.atlassian.net/browse/DSP-4138
2
1
  /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
3
2
  import React from 'react';
3
+ import { useIconThemed } from '../use-icon-themed';
4
4
  export default function IconAction() {
5
+ var _useIconThemed = useIconThemed(),
6
+ iconThemed = _useIconThemed.iconThemed;
5
7
  return /*#__PURE__*/React.createElement("svg", {
6
8
  focusable: "false",
7
9
  "aria-hidden": true,
@@ -11,15 +13,24 @@ export default function IconAction() {
11
13
  fill: "none",
12
14
  fillRule: "evenodd"
13
15
  }, /*#__PURE__*/React.createElement("path", {
14
- fill: "#FFF",
16
+ fill: iconThemed({
17
+ light: '#FFF',
18
+ dark: '#161A1D'
19
+ }),
15
20
  d: "M0 0h40v40H0z"
16
21
  }), /*#__PURE__*/React.createElement("g", {
17
22
  transform: "translate(7 10)"
18
23
  }, /*#__PURE__*/React.createElement("path", {
19
24
  d: "M3 0h30v20H3a3 3 0 01-3-3V3a3 3 0 013-3z",
20
- fill: "#ECEDF0"
25
+ fill: iconThemed({
26
+ light: '#ECEDF0',
27
+ dark: '#454F59'
28
+ })
21
29
  }), /*#__PURE__*/React.createElement("rect", {
22
- fill: "#0052CC",
30
+ fill: iconThemed({
31
+ light: '#0052CC',
32
+ dark: '#09326C'
33
+ }),
23
34
  x: 5,
24
35
  y: 5,
25
36
  width: 10,
@@ -27,9 +38,15 @@ export default function IconAction() {
27
38
  rx: 2
28
39
  }), /*#__PURE__*/React.createElement("path", {
29
40
  d: "M8.81 12.365l.05.055a.5.5 0 00.77-.042l.048-.065 3.11-4.205a.666.666 0 00-.09-.886.554.554 0 00-.82.098l-2.703 3.655-1.096-1.184a.553.553 0 00-.825 0 .667.667 0 000 .892l1.556 1.682z",
30
- fill: "#FFF"
41
+ fill: iconThemed({
42
+ light: '#FFF',
43
+ dark: '#8696A7'
44
+ })
31
45
  }), /*#__PURE__*/React.createElement("path", {
32
46
  d: "M20 9h13v2H20a1 1 0 010-2z",
33
- fill: "#C1C7D0"
47
+ fill: iconThemed({
48
+ light: '#C1C7D0',
49
+ dark: '#738496'
50
+ })
34
51
  }))));
35
52
  }
@@ -1,7 +1,9 @@
1
- // TODO: https://product-fabric.atlassian.net/browse/DSP-4138
2
1
  /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
3
2
  import React from 'react';
3
+ import { useIconThemed } from '../use-icon-themed';
4
4
  export default function IconCode() {
5
+ var _useIconThemed = useIconThemed(),
6
+ iconThemed = _useIconThemed.iconThemed;
5
7
  return /*#__PURE__*/React.createElement("svg", {
6
8
  focusable: "false",
7
9
  "aria-hidden": true,
@@ -9,16 +11,28 @@ export default function IconCode() {
9
11
  height: 40,
10
12
  fillRule: "evenodd"
11
13
  }, /*#__PURE__*/React.createElement("path", {
12
- fill: "#fff",
14
+ fill: iconThemed({
15
+ light: '#fff',
16
+ dark: '#161A1D'
17
+ }),
13
18
  d: "M0 0h40v40H0z"
14
19
  }), /*#__PURE__*/React.createElement("path", {
15
- fill: "#ebecf0",
20
+ fill: iconThemed({
21
+ light: '#ebecf0',
22
+ dark: '#2C333A'
23
+ }),
16
24
  d: "M13 6h26v28H13z"
17
25
  }), /*#__PURE__*/React.createElement("path", {
18
26
  d: "M9 6h4v28H9a2 2 0 01-2-2V8a2 2 0 012-2z",
19
- fill: "#dfe1e6"
27
+ fill: iconThemed({
28
+ light: '#dfe1e6',
29
+ dark: '#454F59'
30
+ })
20
31
  }), /*#__PURE__*/React.createElement("g", {
21
- fill: "#a5adba"
32
+ fill: iconThemed({
33
+ light: '#a5adba',
34
+ dark: '#8696A7'
35
+ })
22
36
  }, /*#__PURE__*/React.createElement("rect", {
23
37
  x: 9,
24
38
  y: 9,
@@ -44,7 +58,10 @@ export default function IconCode() {
44
58
  height: 1,
45
59
  rx: 0.5
46
60
  })), /*#__PURE__*/React.createElement("g", {
47
- fill: "#4c9aff"
61
+ fill: iconThemed({
62
+ light: '#4c9aff',
63
+ dark: '#1D7AFC'
64
+ })
48
65
  }, /*#__PURE__*/React.createElement("rect", {
49
66
  x: 28,
50
67
  y: 25,
@@ -58,7 +75,10 @@ export default function IconCode() {
58
75
  height: 1,
59
76
  rx: 0.5
60
77
  })), /*#__PURE__*/React.createElement("g", {
61
- fill: "#ff7452"
78
+ fill: iconThemed({
79
+ light: '#ff7452',
80
+ dark: '#B22515'
81
+ })
62
82
  }, /*#__PURE__*/React.createElement("rect", {
63
83
  x: 16,
64
84
  y: 17,
@@ -72,7 +92,10 @@ export default function IconCode() {
72
92
  height: 1,
73
93
  rx: 0.5
74
94
  })), /*#__PURE__*/React.createElement("g", {
75
- fill: "#a5adba"
95
+ fill: iconThemed({
96
+ light: '#a5adba',
97
+ dark: '#8696A7'
98
+ })
76
99
  }, /*#__PURE__*/React.createElement("rect", {
77
100
  x: 9,
78
101
  y: 13,
@@ -1,7 +1,9 @@
1
- // TODO: https://product-fabric.atlassian.net/browse/DSP-4138
2
1
  /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
3
2
  import React from 'react';
3
+ import { useIconThemed } from '../use-icon-themed';
4
4
  export default function IconDecision() {
5
+ var _useIconThemed = useIconThemed(),
6
+ iconThemed = _useIconThemed.iconThemed;
5
7
  return /*#__PURE__*/React.createElement("svg", {
6
8
  focusable: "false",
7
9
  "aria-hidden": true,
@@ -11,16 +13,28 @@ export default function IconDecision() {
11
13
  fill: "none",
12
14
  fillRule: "evenodd"
13
15
  }, /*#__PURE__*/React.createElement("path", {
14
- fill: "#FFF",
16
+ fill: iconThemed({
17
+ light: '#FFF',
18
+ dark: '#161A1D'
19
+ }),
15
20
  d: "M0 0h40v40H0z"
16
21
  }), /*#__PURE__*/React.createElement("path", {
17
22
  d: "M10 10h29v20H10a3 3 0 01-3-3V13a3 3 0 013-3z",
18
- fill: "#ECEDF0"
23
+ fill: iconThemed({
24
+ light: '#ECEDF0',
25
+ dark: '#454F59'
26
+ })
19
27
  }), /*#__PURE__*/React.createElement("path", {
20
28
  d: "M14.414 16l3.293 3.293c.187.187.293.442.293.707v5a1 1 0 01-2 0v-4.586l-3-3V18.5a1 1 0 01-2 0V15a1 1 0 011-1h3.5a1 1 0 010 2h-1.086zm8.293-1.707a.999.999 0 010 1.414l-2.5 2.5a.997.997 0 01-1.414 0 .999.999 0 010-1.414l2.5-2.5a.999.999 0 011.414 0z",
21
- fill: "#36B37E"
29
+ fill: iconThemed({
30
+ light: '#36B37E',
31
+ dark: '#1F845A'
32
+ })
22
33
  }), /*#__PURE__*/React.createElement("path", {
23
34
  d: "M27 19h12v2H27a1 1 0 010-2z",
24
- fill: "#C1C7D0"
35
+ fill: iconThemed({
36
+ light: '#C1C7D0',
37
+ dark: '#738496'
38
+ })
25
39
  })));
26
40
  }
@@ -1,7 +1,9 @@
1
- // TODO: https://product-fabric.atlassian.net/browse/DSP-4138
2
1
  /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
3
2
  import React from 'react';
3
+ import { useIconThemed } from '../use-icon-themed';
4
4
  export default function IconDivider() {
5
+ var _useIconThemed = useIconThemed(),
6
+ iconThemed = _useIconThemed.iconThemed;
5
7
  return /*#__PURE__*/React.createElement("svg", {
6
8
  focusable: "false",
7
9
  "aria-hidden": true,
@@ -11,52 +13,76 @@ export default function IconDivider() {
11
13
  fill: "none",
12
14
  fillRule: "evenodd"
13
15
  }, /*#__PURE__*/React.createElement("path", {
14
- fill: "#FFF",
16
+ fill: iconThemed({
17
+ light: '#FFF',
18
+ dark: '#161A1D'
19
+ }),
15
20
  d: "M0 0h40v40H0z"
16
21
  }), /*#__PURE__*/React.createElement("rect", {
17
- fill: "#C1C7D0",
22
+ fill: iconThemed({
23
+ light: '#C1C7D0',
24
+ dark: '#5A6977'
25
+ }),
18
26
  x: 6,
19
27
  y: 19,
20
28
  width: 28,
21
29
  height: 2,
22
30
  rx: 1
23
31
  }), /*#__PURE__*/React.createElement("rect", {
24
- fill: "#C1C7D0",
32
+ fill: iconThemed({
33
+ light: '#C1C7D0',
34
+ dark: '#5A6977'
35
+ }),
25
36
  x: 12,
26
37
  y: 14,
27
38
  width: 16,
28
39
  height: 1,
29
40
  rx: 0.5
30
41
  }), /*#__PURE__*/React.createElement("rect", {
31
- fill: "#C1C7D0",
42
+ fill: iconThemed({
43
+ light: '#C1C7D0',
44
+ dark: '#5A6977'
45
+ }),
32
46
  x: 12,
33
47
  y: 11,
34
48
  width: 16,
35
49
  height: 1,
36
50
  rx: 0.5
37
51
  }), /*#__PURE__*/React.createElement("rect", {
38
- fill: "#C1C7D0",
52
+ fill: iconThemed({
53
+ light: '#C1C7D0',
54
+ dark: '#5A6977'
55
+ }),
39
56
  x: 12,
40
57
  y: 8,
41
58
  width: 16,
42
59
  height: 1,
43
60
  rx: 0.5
44
61
  }), /*#__PURE__*/React.createElement("rect", {
45
- fill: "#C1C7D0",
62
+ fill: iconThemed({
63
+ light: '#C1C7D0',
64
+ dark: '#5A6977'
65
+ }),
46
66
  x: 12,
47
67
  y: 31,
48
68
  width: 9,
49
69
  height: 1,
50
70
  rx: 0.5
51
71
  }), /*#__PURE__*/React.createElement("rect", {
52
- fill: "#C1C7D0",
72
+ fill: iconThemed({
73
+ light: '#C1C7D0',
74
+ dark: '#5A6977'
75
+ }),
53
76
  x: 12,
54
77
  y: 28,
55
78
  width: 16,
56
79
  height: 1,
57
80
  rx: 0.5
58
81
  }), /*#__PURE__*/React.createElement("rect", {
59
- fill: "#C1C7D0",
82
+ fill: iconThemed({
83
+ light: '#C1C7D0',
84
+ dark: '#5A6977'
85
+ }),
60
86
  x: 12,
61
87
  y: 25,
62
88
  width: 16,
@@ -0,0 +1,13 @@
1
+ import { useThemeObserver } from '@atlaskit/tokens';
2
+ /**
3
+ * Warning -- if additional color modes beyond light and dark are added in future -- this will have unexpected behaviour
4
+ */
5
+ export var useIconThemed = function useIconThemed() {
6
+ var _useThemeObserver = useThemeObserver(),
7
+ colorMode = _useThemeObserver.colorMode;
8
+ return {
9
+ iconThemed: function iconThemed(colors) {
10
+ return colorMode && colorMode === 'dark' ? colors['dark'] : colors['light'];
11
+ }
12
+ };
13
+ };
@@ -18,7 +18,7 @@ import { themed } from '@atlaskit/theme/components';
18
18
  import { borderRadius } from '@atlaskit/theme/constants';
19
19
  import Layer from '../Layer';
20
20
  var packageName = "@atlaskit/editor-common";
21
- var packageVersion = "74.41.2";
21
+ var packageVersion = "74.42.1";
22
22
  var halfFocusRing = 1;
23
23
  var dropOffset = '0, 8';
24
24
  var DropList = /*#__PURE__*/function (_Component) {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "74.41.2",
3
+ "version": "74.42.1",
4
4
  "sideEffects": false
5
5
  }
@@ -1,6 +1,6 @@
1
1
  import type { TableSortOrder as SortOrder } from '@atlaskit/adf-schema/steps';
2
2
  import type { ACTION_SUBJECT, INPUT_METHOD } from './enums';
3
- import type { TableAEP, UIAEP } from './utils';
3
+ import type { OperationalAEP, TableAEP, UIAEP } from './utils';
4
4
  export declare enum TABLE_ACTION {
5
5
  DELETED = "deleted",
6
6
  CLEARED = "cleared",
@@ -23,7 +23,8 @@ export declare enum TABLE_ACTION {
23
23
  ATTEMPTED_TABLE_WIDTH_CHANGE = "attemptedTableWidthChange",
24
24
  DISTRIBUTED_COLUMNS_WIDTHS = "distributedColumnsWidths",
25
25
  FIXED = "fixed",
26
- RESIZED = "resized"
26
+ RESIZED = "resized",
27
+ RESIZE_PERF_SAMPLING = "resizePerfSampling"
27
28
  }
28
29
  export declare enum TABLE_BREAKOUT {
29
30
  WIDE = "wide",
@@ -57,6 +58,12 @@ type ResizedInfo = {
57
58
  totalTableWidth: number | null;
58
59
  nodeSize: number;
59
60
  } & TotalRowAndColCount;
61
+ type ResizePreviewInfo = {
62
+ frameRate: number;
63
+ isInitialSample: boolean;
64
+ docSize: number;
65
+ nodeSize: number;
66
+ };
60
67
  type TableDeleteAEP = TableAEP<TABLE_ACTION.DELETED, {
61
68
  inputMethod: INPUT_METHOD.KEYBOARD | INPUT_METHOD.FLOATING_TB;
62
69
  } & TotalRowAndColCount, undefined>;
@@ -106,5 +113,6 @@ type TableFixedAEP = TableAEP<TABLE_ACTION.FIXED, {
106
113
  reason: string;
107
114
  }, undefined>;
108
115
  type TableResizedAEP = TableAEP<TABLE_ACTION.RESIZED, ResizedInfo, undefined>;
109
- export type TableEventPayload = TableDeleteAEP | TableClearAEP | TableMergeSplitAEP | TableColorAEP | TableToggleHeaderAEP | TableChangeBreakoutAEP | TableCopyAndCutAEP | TableAddRowOrColumnAEP | TableSortColumnAEP | TableDeleteRowOrColumnAEP | TableReplaceAEP | TableAttemptedResizeAEP | TableDistributeColumnsWidthsAEP | TableCollapsedAEP | TableFixedAEP | TableResizedAEP;
116
+ type TableResizePerfSamplingAEP = OperationalAEP<TABLE_ACTION.RESIZE_PERF_SAMPLING, ACTION_SUBJECT.TABLE, undefined, ResizePreviewInfo, undefined>;
117
+ export type TableEventPayload = TableDeleteAEP | TableClearAEP | TableMergeSplitAEP | TableColorAEP | TableToggleHeaderAEP | TableChangeBreakoutAEP | TableCopyAndCutAEP | TableAddRowOrColumnAEP | TableSortColumnAEP | TableDeleteRowOrColumnAEP | TableReplaceAEP | TableAttemptedResizeAEP | TableDistributeColumnsWidthsAEP | TableCollapsedAEP | TableFixedAEP | TableResizedAEP | TableResizePerfSamplingAEP;
110
118
  export {};
@@ -1,8 +1,8 @@
1
- import type { ExtractPluginSharedState, NextEditorPluginMetadata, PluginDependenciesAPI, PluginInjectionAPI } from '../types/next-editor-plugin';
2
- type NamedPluginStatesFromInjectionAPI<API extends PluginInjectionAPI<any, any> | undefined, PluginList extends string[]> = Readonly<{
3
- [K in PluginList[number] as `${K}State`]: API extends PluginInjectionAPI<any, any> ? API['dependencies'][K] extends PluginDependenciesAPI<infer Plugin> | undefined ? ExtractPluginSharedState<Plugin> | undefined : never : never;
1
+ import type { ExtractPluginSharedState, NextEditorPlugin, PluginDependenciesAPI, PluginInjectionAPIWithDependencies } from '../types/next-editor-plugin';
2
+ type NamedPluginStatesFromInjectionAPI<API extends PluginInjectionAPIWithDependencies<any> | undefined, PluginList extends string[]> = Readonly<{
3
+ [K in PluginList[number] as `${K}State`]: API extends PluginInjectionAPIWithDependencies<any> ? API['dependencies'][K] extends PluginDependenciesAPI<infer Plugin> | undefined ? ExtractPluginSharedState<Plugin> | undefined : never : never;
4
4
  }>;
5
- type ExtractPluginNames<Name extends string, Metadata extends NextEditorPluginMetadata> = keyof PluginInjectionAPI<Name, Metadata>['dependencies'];
5
+ type ExtractPluginNames<API extends PluginInjectionAPIWithDependencies<any>> = API extends PluginInjectionAPIWithDependencies<any> ? keyof API['dependencies'] : never;
6
6
  /**
7
7
  *
8
8
  * Used to return the current plugin state of
@@ -35,5 +35,5 @@ type ExtractPluginNames<Name extends string, Metadata extends NextEditorPluginMe
35
35
  * @returns A corresponding object, the keys are names of the plugin with `State` appended,
36
36
  * the values are the shared state exposed by that plugin.
37
37
  */
38
- export declare function useSharedPluginState<Name extends string, Metadata extends NextEditorPluginMetadata, PluginNames extends ExtractPluginNames<Name, Metadata>[]>(injectionApi: PluginInjectionAPI<Name, Metadata> | undefined, plugins: PluginNames): NamedPluginStatesFromInjectionAPI<typeof injectionApi, PluginNames>;
38
+ export declare function useSharedPluginState<Plugins extends NextEditorPlugin<any, any>[], PluginNames extends ExtractPluginNames<PluginInjectionAPIWithDependencies<Plugins>>[]>(injectionApi: PluginInjectionAPIWithDependencies<Plugins> | undefined, plugins: PluginNames): NamedPluginStatesFromInjectionAPI<typeof injectionApi, PluginNames>;
39
39
  export {};
@@ -1,3 +1,13 @@
1
1
  import type { Command } from '../types/command';
2
2
  import type { PluginCommand } from '../types/plugin-command';
3
+ /**
4
+ * Convert a PluginCommand to a standard Prosemirror Command.
5
+ * The preferred approach to dispatching a `PluginCommand` is via the
6
+ * `executeCommand` on `pluginInjectionAPI`. In some cases
7
+ * the type may require a Command until we refactor this out and this
8
+ * function is suitable for those cases.
9
+ *
10
+ * @param command A plugin command (a function that modifies and returns a `Transaction`)
11
+ * @returns Command
12
+ */
3
13
  export declare function pluginCommandToPMCommand(command: PluginCommand | undefined): Command;