@atlaskit/editor-core 190.1.14 → 190.1.15

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 (69) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/afm-cc/tsconfig.json +3 -0
  3. package/dist/cjs/plugins/index.js +0 -7
  4. package/dist/cjs/presets/default.js +2 -2
  5. package/dist/cjs/presets/universal.js +2 -1
  6. package/dist/cjs/version-wrapper.js +1 -1
  7. package/dist/es2019/plugins/index.js +0 -1
  8. package/dist/es2019/presets/default.js +1 -1
  9. package/dist/es2019/presets/universal.js +2 -1
  10. package/dist/es2019/version-wrapper.js +1 -1
  11. package/dist/esm/plugins/index.js +0 -1
  12. package/dist/esm/presets/default.js +1 -1
  13. package/dist/esm/presets/universal.js +2 -1
  14. package/dist/esm/version-wrapper.js +1 -1
  15. package/dist/types/plugins/index.d.ts +0 -1
  16. package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +2 -2
  17. package/dist/types/ui/ConfigPanel/FormErrorBoundary.d.ts +1 -1
  18. package/dist/types/ui/ContentStyles/index.d.ts +2 -2
  19. package/dist/types-ts4.5/plugins/index.d.ts +0 -1
  20. package/dist/types-ts4.5/ui/Appearance/FullPage/StyledComponents.d.ts +2 -2
  21. package/dist/types-ts4.5/ui/ConfigPanel/FormErrorBoundary.d.ts +1 -1
  22. package/dist/types-ts4.5/ui/ContentStyles/index.d.ts +2 -2
  23. package/package.json +3 -2
  24. package/tsconfig.json +1 -1
  25. package/dist/cjs/plugins/undo-redo/attach-input-meta.js +0 -26
  26. package/dist/cjs/plugins/undo-redo/commands.js +0 -13
  27. package/dist/cjs/plugins/undo-redo/enums.js +0 -12
  28. package/dist/cjs/plugins/undo-redo/index.js +0 -44
  29. package/dist/cjs/plugins/undo-redo/pm-plugins/keymaps.js +0 -23
  30. package/dist/cjs/plugins/undo-redo/pm-plugins/main.js +0 -14
  31. package/dist/cjs/plugins/undo-redo/pm-plugins/plugin-key.js +0 -8
  32. package/dist/cjs/plugins/undo-redo/types.js +0 -5
  33. package/dist/cjs/plugins/undo-redo/ui/ToolbarUndoRedo/index.js +0 -104
  34. package/dist/es2019/plugins/undo-redo/attach-input-meta.js +0 -16
  35. package/dist/es2019/plugins/undo-redo/commands.js +0 -7
  36. package/dist/es2019/plugins/undo-redo/enums.js +0 -6
  37. package/dist/es2019/plugins/undo-redo/index.js +0 -32
  38. package/dist/es2019/plugins/undo-redo/pm-plugins/keymaps.js +0 -17
  39. package/dist/es2019/plugins/undo-redo/pm-plugins/main.js +0 -9
  40. package/dist/es2019/plugins/undo-redo/pm-plugins/plugin-key.js +0 -2
  41. package/dist/es2019/plugins/undo-redo/types.js +0 -1
  42. package/dist/es2019/plugins/undo-redo/ui/ToolbarUndoRedo/index.js +0 -94
  43. package/dist/esm/plugins/undo-redo/attach-input-meta.js +0 -20
  44. package/dist/esm/plugins/undo-redo/commands.js +0 -7
  45. package/dist/esm/plugins/undo-redo/enums.js +0 -6
  46. package/dist/esm/plugins/undo-redo/index.js +0 -36
  47. package/dist/esm/plugins/undo-redo/pm-plugins/keymaps.js +0 -17
  48. package/dist/esm/plugins/undo-redo/pm-plugins/main.js +0 -8
  49. package/dist/esm/plugins/undo-redo/pm-plugins/plugin-key.js +0 -2
  50. package/dist/esm/plugins/undo-redo/types.js +0 -1
  51. package/dist/esm/plugins/undo-redo/ui/ToolbarUndoRedo/index.js +0 -93
  52. package/dist/types/plugins/undo-redo/attach-input-meta.d.ts +0 -5
  53. package/dist/types/plugins/undo-redo/commands.d.ts +0 -4
  54. package/dist/types/plugins/undo-redo/enums.d.ts +0 -4
  55. package/dist/types/plugins/undo-redo/index.d.ts +0 -3
  56. package/dist/types/plugins/undo-redo/pm-plugins/keymaps.d.ts +0 -2
  57. package/dist/types/plugins/undo-redo/pm-plugins/main.d.ts +0 -2
  58. package/dist/types/plugins/undo-redo/pm-plugins/plugin-key.d.ts +0 -2
  59. package/dist/types/plugins/undo-redo/types.d.ts +0 -6
  60. package/dist/types/plugins/undo-redo/ui/ToolbarUndoRedo/index.d.ts +0 -20
  61. package/dist/types-ts4.5/plugins/undo-redo/attach-input-meta.d.ts +0 -5
  62. package/dist/types-ts4.5/plugins/undo-redo/commands.d.ts +0 -4
  63. package/dist/types-ts4.5/plugins/undo-redo/enums.d.ts +0 -4
  64. package/dist/types-ts4.5/plugins/undo-redo/index.d.ts +0 -3
  65. package/dist/types-ts4.5/plugins/undo-redo/pm-plugins/keymaps.d.ts +0 -2
  66. package/dist/types-ts4.5/plugins/undo-redo/pm-plugins/main.d.ts +0 -2
  67. package/dist/types-ts4.5/plugins/undo-redo/pm-plugins/plugin-key.d.ts +0 -2
  68. package/dist/types-ts4.5/plugins/undo-redo/types.d.ts +0 -9
  69. package/dist/types-ts4.5/plugins/undo-redo/ui/ToolbarUndoRedo/index.d.ts +0 -20
@@ -1,93 +0,0 @@
1
- /** @jsx jsx */
2
- import { jsx } from '@emotion/react';
3
- import { injectIntl } from 'react-intl-next';
4
- import UndoIcon from '@atlaskit/icon/glyph/undo';
5
- import RedoIcon from '@atlaskit/icon/glyph/redo';
6
- import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
7
- import { undo as undoKeymap, redo as redoKeymap, ToolTipContent, tooltip } from '../../../../keymaps';
8
- import { separatorStyles, buttonGroupStyle } from '@atlaskit/editor-common/styles';
9
- import ToolbarButton, { TOOLBAR_BUTTON } from '../../../../ui/ToolbarButton';
10
- import { undoRedoMessages } from '@atlaskit/editor-common/messages';
11
- import { undoFromToolbar, redoFromToolbar } from '../../commands';
12
- import { getAriaKeyshortcuts } from '@atlaskit/editor-common/keymaps';
13
- var closeTypeAheadAndRunCommand = function closeTypeAheadAndRunCommand(editorView, api) {
14
- return function (command) {
15
- var _api$typeAhead;
16
- if (!editorView) {
17
- return;
18
- }
19
- if (api !== null && api !== void 0 && (_api$typeAhead = api.typeAhead) !== null && _api$typeAhead !== void 0 && (_api$typeAhead = _api$typeAhead.actions) !== null && _api$typeAhead !== void 0 && _api$typeAhead.isOpen(editorView.state)) {
20
- var _api$typeAhead2;
21
- api === null || api === void 0 || (_api$typeAhead2 = api.typeAhead) === null || _api$typeAhead2 === void 0 || (_api$typeAhead2 = _api$typeAhead2.actions) === null || _api$typeAhead2 === void 0 || _api$typeAhead2.close({
22
- attachCommand: command,
23
- insertCurrentQueryAsRawText: false
24
- });
25
- } else {
26
- command(editorView.state, editorView.dispatch);
27
- }
28
- };
29
- };
30
- var forceFocus = function forceFocus(editorView, api) {
31
- return function (command) {
32
- closeTypeAheadAndRunCommand(editorView, api)(command);
33
- if (!editorView.hasFocus()) {
34
- editorView.focus();
35
- }
36
- };
37
- };
38
- export var ToolbarUndoRedo = function ToolbarUndoRedo(_ref) {
39
- var disabled = _ref.disabled,
40
- isReducedSpacing = _ref.isReducedSpacing,
41
- editorView = _ref.editorView,
42
- api = _ref.api,
43
- formatMessage = _ref.intl.formatMessage;
44
- var _useSharedPluginState = useSharedPluginState(api, ['history']),
45
- historyState = _useSharedPluginState.historyState;
46
- var handleUndo = function handleUndo() {
47
- forceFocus(editorView, api)(undoFromToolbar);
48
- };
49
- var handleRedo = function handleRedo() {
50
- forceFocus(editorView, api)(redoFromToolbar);
51
- };
52
- var labelUndo = formatMessage(undoRedoMessages.undo);
53
- var labelRedo = formatMessage(undoRedoMessages.redo);
54
- var _ref2 = historyState !== null && historyState !== void 0 ? historyState : {},
55
- canUndo = _ref2.canUndo,
56
- canRedo = _ref2.canRedo;
57
- return jsx("span", {
58
- css: buttonGroupStyle
59
- }, jsx(ToolbarButton, {
60
- buttonId: TOOLBAR_BUTTON.UNDO,
61
- spacing: isReducedSpacing ? 'none' : 'default',
62
- onClick: handleUndo,
63
- disabled: !canUndo || disabled,
64
- "aria-label": tooltip(undoKeymap, labelUndo),
65
- "aria-keyshortcuts": getAriaKeyshortcuts(undoKeymap),
66
- title: jsx(ToolTipContent, {
67
- description: labelUndo,
68
- keymap: undoKeymap
69
- }),
70
- iconBefore: jsx(UndoIcon, {
71
- label: ""
72
- }),
73
- testId: "ak-editor-toolbar-button-undo"
74
- }), jsx(ToolbarButton, {
75
- spacing: isReducedSpacing ? 'none' : 'default',
76
- buttonId: TOOLBAR_BUTTON.REDO,
77
- onClick: handleRedo,
78
- disabled: !canRedo || disabled,
79
- title: jsx(ToolTipContent, {
80
- description: labelRedo,
81
- keymap: redoKeymap
82
- }),
83
- iconBefore: jsx(RedoIcon, {
84
- label: ""
85
- }),
86
- testId: "ak-editor-toolbar-button-redo",
87
- "aria-label": tooltip(redoKeymap, labelRedo),
88
- "aria-keyshortcuts": getAriaKeyshortcuts(redoKeymap)
89
- }), jsx("span", {
90
- css: separatorStyles
91
- }));
92
- };
93
- export default injectIntl(ToolbarUndoRedo);
@@ -1,5 +0,0 @@
1
- import type { HigherOrderCommand } from '../../types/command';
2
- import type { InputSource } from './enums';
3
- type AttachInputMeta = (inputSource: InputSource) => HigherOrderCommand;
4
- export declare const attachInputMeta: AttachInputMeta;
5
- export {};
@@ -1,4 +0,0 @@
1
- export declare const undoFromKeyboard: import("../..").Command;
2
- export declare const redoFromKeyboard: import("../..").Command;
3
- export declare const undoFromToolbar: import("../..").Command;
4
- export declare const redoFromToolbar: import("../..").Command;
@@ -1,4 +0,0 @@
1
- export declare enum InputSource {
2
- TOOLBAR = "toolbar",
3
- KEYBOARD = "keyboard"
4
- }
@@ -1,3 +0,0 @@
1
- import type { UndoRedoPlugin } from './types';
2
- declare const undoRedoPlugin: UndoRedoPlugin;
3
- export default undoRedoPlugin;
@@ -1,2 +0,0 @@
1
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- export declare function keymapPlugin(): SafePlugin;
@@ -1,2 +0,0 @@
1
- import { PMPluginFactory } from '../../../types';
2
- export declare const createPlugin: PMPluginFactory;
@@ -1,2 +0,0 @@
1
- import { PluginKey } from '@atlaskit/editor-prosemirror/state';
2
- export declare const pluginKey: PluginKey<any>;
@@ -1,6 +0,0 @@
1
- import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
2
- import type { TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
3
- import type { HistoryPlugin } from '@atlaskit/editor-plugin-history';
4
- export type UndoRedoPlugin = NextEditorPlugin<'undoRedoPlugin', {
5
- dependencies: [TypeAheadPlugin, HistoryPlugin];
6
- }>;
@@ -1,20 +0,0 @@
1
- /// <reference types="react" />
2
- /** @jsx jsx */
3
- import { jsx } from '@emotion/react';
4
- import type { WrappedComponentProps } from 'react-intl-next';
5
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
6
- import type { UndoRedoPlugin } from '../../types';
7
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
8
- export interface Props {
9
- undoDisabled?: boolean;
10
- redoDisabled?: boolean;
11
- disabled?: boolean;
12
- isReducedSpacing?: boolean;
13
- editorView: EditorView;
14
- api: ExtractInjectionAPI<UndoRedoPlugin> | undefined;
15
- }
16
- export declare const ToolbarUndoRedo: ({ disabled, isReducedSpacing, editorView, api, intl: { formatMessage }, }: Props & WrappedComponentProps) => jsx.JSX.Element;
17
- declare const _default: import("react").FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
18
- WrappedComponent: import("react").ComponentType<Props & WrappedComponentProps<"intl">>;
19
- };
20
- export default _default;
@@ -1,5 +0,0 @@
1
- import type { HigherOrderCommand } from '../../types/command';
2
- import type { InputSource } from './enums';
3
- type AttachInputMeta = (inputSource: InputSource) => HigherOrderCommand;
4
- export declare const attachInputMeta: AttachInputMeta;
5
- export {};
@@ -1,4 +0,0 @@
1
- export declare const undoFromKeyboard: import("../..").Command;
2
- export declare const redoFromKeyboard: import("../..").Command;
3
- export declare const undoFromToolbar: import("../..").Command;
4
- export declare const redoFromToolbar: import("../..").Command;
@@ -1,4 +0,0 @@
1
- export declare enum InputSource {
2
- TOOLBAR = "toolbar",
3
- KEYBOARD = "keyboard"
4
- }
@@ -1,3 +0,0 @@
1
- import type { UndoRedoPlugin } from './types';
2
- declare const undoRedoPlugin: UndoRedoPlugin;
3
- export default undoRedoPlugin;
@@ -1,2 +0,0 @@
1
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- export declare function keymapPlugin(): SafePlugin;
@@ -1,2 +0,0 @@
1
- import { PMPluginFactory } from '../../../types';
2
- export declare const createPlugin: PMPluginFactory;
@@ -1,2 +0,0 @@
1
- import { PluginKey } from '@atlaskit/editor-prosemirror/state';
2
- export declare const pluginKey: PluginKey<any>;
@@ -1,9 +0,0 @@
1
- import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
2
- import type { TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
3
- import type { HistoryPlugin } from '@atlaskit/editor-plugin-history';
4
- export type UndoRedoPlugin = NextEditorPlugin<'undoRedoPlugin', {
5
- dependencies: [
6
- TypeAheadPlugin,
7
- HistoryPlugin
8
- ];
9
- }>;
@@ -1,20 +0,0 @@
1
- /// <reference types="react" />
2
- /** @jsx jsx */
3
- import { jsx } from '@emotion/react';
4
- import type { WrappedComponentProps } from 'react-intl-next';
5
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
6
- import type { UndoRedoPlugin } from '../../types';
7
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
8
- export interface Props {
9
- undoDisabled?: boolean;
10
- redoDisabled?: boolean;
11
- disabled?: boolean;
12
- isReducedSpacing?: boolean;
13
- editorView: EditorView;
14
- api: ExtractInjectionAPI<UndoRedoPlugin> | undefined;
15
- }
16
- export declare const ToolbarUndoRedo: ({ disabled, isReducedSpacing, editorView, api, intl: { formatMessage }, }: Props & WrappedComponentProps) => jsx.JSX.Element;
17
- declare const _default: import("react").FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
18
- WrappedComponent: import("react").ComponentType<Props & WrappedComponentProps<"intl">>;
19
- };
20
- export default _default;