@atlaskit/editor-core 187.10.0 → 187.10.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 (83) hide show
  1. package/.eslintrc.js +1 -0
  2. package/CHANGELOG.md +7 -0
  3. package/dist/cjs/labs/next/presets/default.js +2 -2
  4. package/dist/cjs/plugins/floating-toolbar/index.js +154 -132
  5. package/dist/cjs/plugins/floating-toolbar/pm-plugins/force-focus/index.js +11 -10
  6. package/dist/cjs/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +14 -7
  7. package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +6 -1
  8. package/dist/cjs/plugins/index.js +0 -7
  9. package/dist/cjs/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +4 -1
  10. package/dist/cjs/plugins/media/toolbar/alt-text.js +6 -6
  11. package/dist/cjs/plugins/media/toolbar/linking.js +4 -1
  12. package/dist/cjs/plugins/media/ui/MediaLinkingToolbar.js +2 -2
  13. package/dist/cjs/ui/ColorPickerButton/index.js +3 -3
  14. package/dist/cjs/version-wrapper.js +1 -1
  15. package/dist/cjs/version.json +1 -1
  16. package/dist/es2019/labs/next/presets/default.js +1 -1
  17. package/dist/es2019/plugins/floating-toolbar/index.js +152 -128
  18. package/dist/es2019/plugins/floating-toolbar/pm-plugins/force-focus/index.js +12 -8
  19. package/dist/es2019/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +5 -4
  20. package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +12 -1
  21. package/dist/es2019/plugins/index.js +0 -1
  22. package/dist/es2019/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +3 -1
  23. package/dist/es2019/plugins/media/toolbar/alt-text.js +10 -6
  24. package/dist/es2019/plugins/media/toolbar/linking.js +8 -1
  25. package/dist/es2019/plugins/media/ui/MediaLinkingToolbar.js +5 -3
  26. package/dist/es2019/ui/ColorPickerButton/index.js +2 -2
  27. package/dist/es2019/version-wrapper.js +1 -1
  28. package/dist/es2019/version.json +1 -1
  29. package/dist/esm/labs/next/presets/default.js +1 -1
  30. package/dist/esm/plugins/floating-toolbar/index.js +153 -131
  31. package/dist/esm/plugins/floating-toolbar/pm-plugins/force-focus/index.js +9 -7
  32. package/dist/esm/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +14 -7
  33. package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +6 -1
  34. package/dist/esm/plugins/index.js +0 -1
  35. package/dist/esm/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +4 -1
  36. package/dist/esm/plugins/media/toolbar/alt-text.js +6 -6
  37. package/dist/esm/plugins/media/toolbar/linking.js +4 -1
  38. package/dist/esm/plugins/media/ui/MediaLinkingToolbar.js +2 -2
  39. package/dist/esm/ui/ColorPickerButton/index.js +3 -3
  40. package/dist/esm/version-wrapper.js +1 -1
  41. package/dist/esm/version.json +1 -1
  42. package/dist/types/labs/next/presets/default.d.ts +40 -8
  43. package/dist/types/plugins/date/index.d.ts +2 -2
  44. package/dist/types/plugins/floating-toolbar/index.d.ts +1 -7
  45. package/dist/types/plugins/floating-toolbar/pm-plugins/force-focus/index.d.ts +2 -1
  46. package/dist/types/plugins/floating-toolbar/pm-plugins/toolbar-data/plugin-factory.d.ts +1 -1
  47. package/dist/types/plugins/floating-toolbar/pm-plugins/toolbar-data/plugin-key.d.ts +1 -1
  48. package/dist/types/plugins/floating-toolbar/pm-plugins/toolbar-data/plugin.d.ts +1 -1
  49. package/dist/types/plugins/floating-toolbar/pm-plugins/toolbar-data/reducer.d.ts +2 -1
  50. package/dist/types/plugins/floating-toolbar/pm-plugins/toolbar-data/types.d.ts +0 -3
  51. package/dist/types/plugins/floating-toolbar/ui/ExtensionsPlaceholder.d.ts +1 -1
  52. package/dist/types/plugins/floating-toolbar/ui/Toolbar.d.ts +1 -1
  53. package/dist/types/plugins/index.d.ts +0 -1
  54. package/dist/types/plugins/media/index.d.ts +2 -2
  55. package/dist/types/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.d.ts +1 -0
  56. package/dist/types/plugins/media/ui/MediaLinkingToolbar.d.ts +3 -3
  57. package/dist/types/plugins/view-update-subscription/subscribe/toolbarAndPickerUpdates.d.ts +1 -1
  58. package/dist/types/ui/ColorPickerButton/index.d.ts +2 -2
  59. package/dist/types-ts4.5/labs/next/presets/default.d.ts +44 -8
  60. package/dist/types-ts4.5/plugins/date/index.d.ts +2 -2
  61. package/dist/types-ts4.5/plugins/floating-toolbar/index.d.ts +1 -7
  62. package/dist/types-ts4.5/plugins/floating-toolbar/pm-plugins/force-focus/index.d.ts +2 -1
  63. package/dist/types-ts4.5/plugins/floating-toolbar/pm-plugins/toolbar-data/plugin-factory.d.ts +1 -1
  64. package/dist/types-ts4.5/plugins/floating-toolbar/pm-plugins/toolbar-data/plugin-key.d.ts +1 -1
  65. package/dist/types-ts4.5/plugins/floating-toolbar/pm-plugins/toolbar-data/plugin.d.ts +1 -1
  66. package/dist/types-ts4.5/plugins/floating-toolbar/pm-plugins/toolbar-data/reducer.d.ts +2 -1
  67. package/dist/types-ts4.5/plugins/floating-toolbar/pm-plugins/toolbar-data/types.d.ts +0 -3
  68. package/dist/types-ts4.5/plugins/floating-toolbar/ui/ExtensionsPlaceholder.d.ts +1 -1
  69. package/dist/types-ts4.5/plugins/floating-toolbar/ui/Toolbar.d.ts +1 -1
  70. package/dist/types-ts4.5/plugins/index.d.ts +0 -1
  71. package/dist/types-ts4.5/plugins/media/index.d.ts +2 -2
  72. package/dist/types-ts4.5/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.d.ts +1 -0
  73. package/dist/types-ts4.5/plugins/media/ui/MediaLinkingToolbar.d.ts +3 -3
  74. package/dist/types-ts4.5/plugins/view-update-subscription/subscribe/toolbarAndPickerUpdates.d.ts +1 -1
  75. package/dist/types-ts4.5/ui/ColorPickerButton/index.d.ts +2 -2
  76. package/package.json +3 -2
  77. package/report.api.md +3 -21
  78. package/tmp/api-report-tmp.d.ts +3 -18
  79. package/dist/cjs/plugins/editor-disabled/index.js +0 -75
  80. package/dist/es2019/plugins/editor-disabled/index.js +0 -62
  81. package/dist/esm/plugins/editor-disabled/index.js +0 -66
  82. package/dist/types/plugins/editor-disabled/index.d.ts +0 -13
  83. package/dist/types-ts4.5/plugins/editor-disabled/index.d.ts +0 -13
package/report.api.md CHANGED
@@ -35,6 +35,7 @@ import { CardProvider } from '@atlaskit/editor-common/provider-factory';
35
35
  import { Color } from '@atlaskit/status/element';
36
36
  import { Command as Command_2 } from '@atlaskit/editor-common/types';
37
37
  import { ComponentType } from 'react';
38
+ import type { ConfigWithNodeInfo } from '@atlaskit/editor-plugin-floating-toolbar';
38
39
  import type { ContextIdentifierProvider } from '@atlaskit/editor-common/provider-factory';
39
40
  import type { ContextUpdateHandler } from '@atlaskit/editor-common/types';
40
41
  import { createTable } from '@atlaskit/editor-plugin-table/commands';
@@ -51,6 +52,7 @@ import { DropdownOptionT } from '@atlaskit/editor-common/types';
51
52
  import type { EditorActionsOptions } from '@atlaskit/editor-common/types';
52
53
  import { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
53
54
  import { EditorAppearance } from '@atlaskit/editor-common/types';
55
+ import type { EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
54
56
  import { FeatureFlags as EditorFeatureFlags } from '@atlaskit/editor-common/types';
55
57
  import { EditorPlugin } from '@atlaskit/editor-common/types';
56
58
  import type { EditorPresetBuilder } from '@atlaskit/editor-common/preset';
@@ -404,13 +406,6 @@ export type CommandDispatch = (tr: Transaction) => void;
404
406
  // @public (undocumented)
405
407
  export const commitStatusPicker: () => (editorView: EditorView) => void;
406
408
 
407
- // @public (undocumented)
408
- type ConfigWithNodeInfo = {
409
- config: FloatingToolbarConfig | undefined;
410
- pos: number;
411
- node: Node_2;
412
- };
413
-
414
409
  // @public (undocumented)
415
410
  export function ContextPanel(props: Props_4): jsx.JSX.Element;
416
411
 
@@ -766,19 +761,6 @@ type EditorContextProps = {
766
761
  editorActions?: EditorActions;
767
762
  };
768
763
 
769
- // @public (undocumented)
770
- const editorDisabledPlugin: NextEditorPlugin<
771
- 'editorDisabled',
772
- {
773
- sharedState: EditorDisabledPluginState;
774
- }
775
- >;
776
-
777
- // @public (undocumented)
778
- type EditorDisabledPluginState = {
779
- editorDisabled: boolean;
780
- };
781
-
782
764
  export { EditorFeatureFlags };
783
765
 
784
766
  // @public (undocumented)
@@ -1424,7 +1406,7 @@ export const mediaPlugin: NextEditorPlugin<
1424
1406
  typeof widthPlugin,
1425
1407
  typeof decorationsPlugin,
1426
1408
  FloatingToolbarPlugin,
1427
- typeof editorDisabledPlugin,
1409
+ EditorDisabledPlugin,
1428
1410
  ];
1429
1411
  sharedState: MediaPluginState | null;
1430
1412
  }
@@ -24,6 +24,7 @@ import { CardProvider } from '@atlaskit/editor-common/provider-factory';
24
24
  import { Color } from '@atlaskit/status/element';
25
25
  import { Command as Command_2 } from '@atlaskit/editor-common/types';
26
26
  import { ComponentType } from 'react';
27
+ import type { ConfigWithNodeInfo } from '@atlaskit/editor-plugin-floating-toolbar';
27
28
  import type { ContextIdentifierProvider } from '@atlaskit/editor-common/provider-factory';
28
29
  import type { ContextUpdateHandler } from '@atlaskit/editor-common/types';
29
30
  import { createTable } from '@atlaskit/editor-plugin-table/commands';
@@ -40,6 +41,7 @@ import { DropdownOptionT } from '@atlaskit/editor-common/types';
40
41
  import type { EditorActionsOptions } from '@atlaskit/editor-common/types';
41
42
  import { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
42
43
  import { EditorAppearance } from '@atlaskit/editor-common/types';
44
+ import type { EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
43
45
  import { FeatureFlags as EditorFeatureFlags } from '@atlaskit/editor-common/types';
44
46
  import { EditorPlugin } from '@atlaskit/editor-common/types';
45
47
  import type { EditorPresetBuilder } from '@atlaskit/editor-common/preset';
@@ -382,13 +384,6 @@ export type CommandDispatch = (tr: Transaction) => void;
382
384
  // @public (undocumented)
383
385
  export const commitStatusPicker: () => (editorView: EditorView) => void;
384
386
 
385
- // @public (undocumented)
386
- type ConfigWithNodeInfo = {
387
- config: FloatingToolbarConfig | undefined;
388
- pos: number;
389
- node: Node_2;
390
- };
391
-
392
387
  // @public (undocumented)
393
388
  export function ContextPanel(props: Props_4): jsx.JSX.Element;
394
389
 
@@ -703,16 +698,6 @@ type EditorContextProps = {
703
698
  editorActions?: EditorActions;
704
699
  };
705
700
 
706
- // @public (undocumented)
707
- const editorDisabledPlugin: NextEditorPlugin<'editorDisabled', {
708
- sharedState: EditorDisabledPluginState;
709
- }>;
710
-
711
- // @public (undocumented)
712
- type EditorDisabledPluginState = {
713
- editorDisabled: boolean;
714
- };
715
-
716
701
  export { EditorFeatureFlags }
717
702
 
718
703
  // @public (undocumented)
@@ -1280,7 +1265,7 @@ export const mediaPlugin: NextEditorPlugin<'media', {
1280
1265
  typeof widthPlugin,
1281
1266
  typeof decorationsPlugin,
1282
1267
  FloatingToolbarPlugin,
1283
- typeof editorDisabledPlugin
1268
+ EditorDisabledPlugin
1284
1269
  ];
1285
1270
  sharedState: MediaPluginState | null;
1286
1271
  }>;
@@ -1,75 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createPlugin = createPlugin;
7
- exports.pluginKey = exports.default = void 0;
8
- var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
9
- var _state = require("@atlaskit/editor-prosemirror/state");
10
- var _pluginStateFactory = require("../../utils/plugin-state-factory");
11
- var pluginKey = new _state.PluginKey('editorDisabledPlugin');
12
- exports.pluginKey = pluginKey;
13
- function reducer(_pluginState, meta) {
14
- return meta;
15
- }
16
- var _pluginFactory = (0, _pluginStateFactory.pluginFactory)(pluginKey, reducer),
17
- createPluginState = _pluginFactory.createPluginState,
18
- getPluginState = _pluginFactory.getPluginState;
19
-
20
- /*
21
- Stores the state of the editor enabled/disabled for panel and floating
22
- toolbar to subscribe to through <WithPluginState>. Otherwise the NodeViews
23
- won't re-render when it changes.
24
- */
25
- function createPlugin(dispatch) {
26
- return new _safePlugin.SafePlugin({
27
- key: pluginKey,
28
- state: createPluginState(dispatch, {
29
- editorDisabled: false
30
- }),
31
- view: function view() {
32
- return {
33
- update: function update(view) {
34
- if (getPluginState(view.state).editorDisabled !== !view.editable) {
35
- var tr = view.state.tr.setMeta(pluginKey, {
36
- editorDisabled: !view.editable
37
- });
38
- tr.setMeta('isLocal', true);
39
- view.dispatch(tr);
40
- }
41
- }
42
- };
43
- }
44
- });
45
- }
46
- var editorDisabledPlugin = function editorDisabledPlugin() {
47
- return {
48
- name: 'editorDisabled',
49
- getSharedState: function getSharedState(editorState) {
50
- if (!editorState) {
51
- return {
52
- editorDisabled: false
53
- };
54
- }
55
- var pluginState = pluginKey.getState(editorState);
56
- if (!pluginState) {
57
- return {
58
- editorDisabled: false
59
- };
60
- }
61
- return pluginState;
62
- },
63
- pmPlugins: function pmPlugins() {
64
- return [{
65
- name: 'editorDisabled',
66
- plugin: function plugin(_ref) {
67
- var dispatch = _ref.dispatch;
68
- return createPlugin(dispatch);
69
- }
70
- }];
71
- }
72
- };
73
- };
74
- var _default = editorDisabledPlugin;
75
- exports.default = _default;
@@ -1,62 +0,0 @@
1
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import { PluginKey } from '@atlaskit/editor-prosemirror/state';
3
- import { pluginFactory } from '../../utils/plugin-state-factory';
4
- export const pluginKey = new PluginKey('editorDisabledPlugin');
5
- function reducer(_pluginState, meta) {
6
- return meta;
7
- }
8
- const {
9
- createPluginState,
10
- getPluginState
11
- } = pluginFactory(pluginKey, reducer);
12
-
13
- /*
14
- Stores the state of the editor enabled/disabled for panel and floating
15
- toolbar to subscribe to through <WithPluginState>. Otherwise the NodeViews
16
- won't re-render when it changes.
17
- */
18
- export function createPlugin(dispatch) {
19
- return new SafePlugin({
20
- key: pluginKey,
21
- state: createPluginState(dispatch, {
22
- editorDisabled: false
23
- }),
24
- view: () => {
25
- return {
26
- update(view) {
27
- if (getPluginState(view.state).editorDisabled !== !view.editable) {
28
- const tr = view.state.tr.setMeta(pluginKey, {
29
- editorDisabled: !view.editable
30
- });
31
- tr.setMeta('isLocal', true);
32
- view.dispatch(tr);
33
- }
34
- }
35
- };
36
- }
37
- });
38
- }
39
- const editorDisabledPlugin = () => ({
40
- name: 'editorDisabled',
41
- getSharedState(editorState) {
42
- if (!editorState) {
43
- return {
44
- editorDisabled: false
45
- };
46
- }
47
- const pluginState = pluginKey.getState(editorState);
48
- if (!pluginState) {
49
- return {
50
- editorDisabled: false
51
- };
52
- }
53
- return pluginState;
54
- },
55
- pmPlugins: () => [{
56
- name: 'editorDisabled',
57
- plugin: ({
58
- dispatch
59
- }) => createPlugin(dispatch)
60
- }]
61
- });
62
- export default editorDisabledPlugin;
@@ -1,66 +0,0 @@
1
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import { PluginKey } from '@atlaskit/editor-prosemirror/state';
3
- import { pluginFactory } from '../../utils/plugin-state-factory';
4
- export var pluginKey = new PluginKey('editorDisabledPlugin');
5
- function reducer(_pluginState, meta) {
6
- return meta;
7
- }
8
- var _pluginFactory = pluginFactory(pluginKey, reducer),
9
- createPluginState = _pluginFactory.createPluginState,
10
- getPluginState = _pluginFactory.getPluginState;
11
-
12
- /*
13
- Stores the state of the editor enabled/disabled for panel and floating
14
- toolbar to subscribe to through <WithPluginState>. Otherwise the NodeViews
15
- won't re-render when it changes.
16
- */
17
- export function createPlugin(dispatch) {
18
- return new SafePlugin({
19
- key: pluginKey,
20
- state: createPluginState(dispatch, {
21
- editorDisabled: false
22
- }),
23
- view: function view() {
24
- return {
25
- update: function update(view) {
26
- if (getPluginState(view.state).editorDisabled !== !view.editable) {
27
- var tr = view.state.tr.setMeta(pluginKey, {
28
- editorDisabled: !view.editable
29
- });
30
- tr.setMeta('isLocal', true);
31
- view.dispatch(tr);
32
- }
33
- }
34
- };
35
- }
36
- });
37
- }
38
- var editorDisabledPlugin = function editorDisabledPlugin() {
39
- return {
40
- name: 'editorDisabled',
41
- getSharedState: function getSharedState(editorState) {
42
- if (!editorState) {
43
- return {
44
- editorDisabled: false
45
- };
46
- }
47
- var pluginState = pluginKey.getState(editorState);
48
- if (!pluginState) {
49
- return {
50
- editorDisabled: false
51
- };
52
- }
53
- return pluginState;
54
- },
55
- pmPlugins: function pmPlugins() {
56
- return [{
57
- name: 'editorDisabled',
58
- plugin: function plugin(_ref) {
59
- var dispatch = _ref.dispatch;
60
- return createPlugin(dispatch);
61
- }
62
- }];
63
- }
64
- };
65
- };
66
- export default editorDisabledPlugin;
@@ -1,13 +0,0 @@
1
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import { PluginKey } from '@atlaskit/editor-prosemirror/state';
3
- import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
4
- import type { Dispatch } from '../../event-dispatcher';
5
- export type EditorDisabledPluginState = {
6
- editorDisabled: boolean;
7
- };
8
- export declare const pluginKey: PluginKey<EditorDisabledPluginState>;
9
- export declare function createPlugin(dispatch: Dispatch<EditorDisabledPluginState>): SafePlugin | undefined;
10
- declare const editorDisabledPlugin: NextEditorPlugin<'editorDisabled', {
11
- sharedState: EditorDisabledPluginState;
12
- }>;
13
- export default editorDisabledPlugin;
@@ -1,13 +0,0 @@
1
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import { PluginKey } from '@atlaskit/editor-prosemirror/state';
3
- import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
4
- import type { Dispatch } from '../../event-dispatcher';
5
- export type EditorDisabledPluginState = {
6
- editorDisabled: boolean;
7
- };
8
- export declare const pluginKey: PluginKey<EditorDisabledPluginState>;
9
- export declare function createPlugin(dispatch: Dispatch<EditorDisabledPluginState>): SafePlugin | undefined;
10
- declare const editorDisabledPlugin: NextEditorPlugin<'editorDisabled', {
11
- sharedState: EditorDisabledPluginState;
12
- }>;
13
- export default editorDisabledPlugin;