@atlaskit/editor-core 190.1.7 → 190.1.8

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 (92) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/afm-cc/tsconfig.json +3 -0
  3. package/dist/cjs/plugins/index.js +0 -7
  4. package/dist/cjs/presets/universal.js +2 -1
  5. package/dist/cjs/ui/Addon/ClickAreaInline/index.js +1 -1
  6. package/dist/cjs/utils/action.js +0 -28
  7. package/dist/cjs/version-wrapper.js +1 -1
  8. package/dist/es2019/plugins/index.js +0 -1
  9. package/dist/es2019/presets/universal.js +2 -1
  10. package/dist/es2019/ui/Addon/ClickAreaInline/index.js +1 -1
  11. package/dist/es2019/utils/action.js +0 -28
  12. package/dist/es2019/version-wrapper.js +1 -1
  13. package/dist/esm/plugins/index.js +0 -1
  14. package/dist/esm/presets/universal.js +2 -1
  15. package/dist/esm/ui/Addon/ClickAreaInline/index.js +1 -1
  16. package/dist/esm/utils/action.js +0 -28
  17. package/dist/esm/version-wrapper.js +1 -1
  18. package/dist/types/plugins/index.d.ts +0 -1
  19. package/dist/types/utils/action.d.ts +0 -6
  20. package/dist/types-ts4.5/plugins/index.d.ts +0 -1
  21. package/dist/types-ts4.5/utils/action.d.ts +0 -6
  22. package/package.json +2 -1
  23. package/dist/cjs/commands/index.js +0 -42
  24. package/dist/cjs/plugins/alignment/commands/index.js +0 -36
  25. package/dist/cjs/plugins/alignment/index.js +0 -70
  26. package/dist/cjs/plugins/alignment/pm-plugins/keymap.js +0 -14
  27. package/dist/cjs/plugins/alignment/pm-plugins/main.js +0 -45
  28. package/dist/cjs/plugins/alignment/pm-plugins/types.js +0 -5
  29. package/dist/cjs/plugins/alignment/ui/ToolbarAlignment/icon-map.js +0 -36
  30. package/dist/cjs/plugins/alignment/ui/ToolbarAlignment/index.js +0 -169
  31. package/dist/cjs/plugins/alignment/ui/ToolbarAlignment/messages.js +0 -29
  32. package/dist/cjs/plugins/alignment/ui/ToolbarAlignment/styles.js +0 -13
  33. package/dist/cjs/plugins/alignment/utils/index.js +0 -27
  34. package/dist/cjs/ui/Alignment/AlignmentButton/index.js +0 -71
  35. package/dist/cjs/ui/Alignment/index.js +0 -74
  36. package/dist/cjs/ui/Alignment/styles.js +0 -11
  37. package/dist/es2019/commands/index.js +0 -1
  38. package/dist/es2019/plugins/alignment/commands/index.js +0 -30
  39. package/dist/es2019/plugins/alignment/index.js +0 -58
  40. package/dist/es2019/plugins/alignment/pm-plugins/keymap.js +0 -8
  41. package/dist/es2019/plugins/alignment/pm-plugins/main.js +0 -34
  42. package/dist/es2019/plugins/alignment/pm-plugins/types.js +0 -1
  43. package/dist/es2019/plugins/alignment/ui/ToolbarAlignment/icon-map.js +0 -30
  44. package/dist/es2019/plugins/alignment/ui/ToolbarAlignment/index.js +0 -140
  45. package/dist/es2019/plugins/alignment/ui/ToolbarAlignment/messages.js +0 -23
  46. package/dist/es2019/plugins/alignment/ui/ToolbarAlignment/styles.js +0 -14
  47. package/dist/es2019/plugins/alignment/utils/index.js +0 -15
  48. package/dist/es2019/ui/Alignment/AlignmentButton/index.js +0 -44
  49. package/dist/es2019/ui/Alignment/index.js +0 -54
  50. package/dist/es2019/ui/Alignment/styles.js +0 -7
  51. package/dist/esm/commands/index.js +0 -1
  52. package/dist/esm/plugins/alignment/commands/index.js +0 -30
  53. package/dist/esm/plugins/alignment/index.js +0 -63
  54. package/dist/esm/plugins/alignment/pm-plugins/keymap.js +0 -8
  55. package/dist/esm/plugins/alignment/pm-plugins/main.js +0 -36
  56. package/dist/esm/plugins/alignment/pm-plugins/types.js +0 -1
  57. package/dist/esm/plugins/alignment/ui/ToolbarAlignment/icon-map.js +0 -29
  58. package/dist/esm/plugins/alignment/ui/ToolbarAlignment/index.js +0 -163
  59. package/dist/esm/plugins/alignment/ui/ToolbarAlignment/messages.js +0 -23
  60. package/dist/esm/plugins/alignment/ui/ToolbarAlignment/styles.js +0 -6
  61. package/dist/esm/plugins/alignment/utils/index.js +0 -21
  62. package/dist/esm/ui/Alignment/AlignmentButton/index.js +0 -62
  63. package/dist/esm/ui/Alignment/index.js +0 -68
  64. package/dist/esm/ui/Alignment/styles.js +0 -4
  65. package/dist/types/commands/index.d.ts +0 -1
  66. package/dist/types/plugins/alignment/commands/index.d.ts +0 -4
  67. package/dist/types/plugins/alignment/index.d.ts +0 -5
  68. package/dist/types/plugins/alignment/pm-plugins/keymap.d.ts +0 -2
  69. package/dist/types/plugins/alignment/pm-plugins/main.d.ts +0 -8
  70. package/dist/types/plugins/alignment/pm-plugins/types.d.ts +0 -5
  71. package/dist/types/plugins/alignment/ui/ToolbarAlignment/icon-map.d.ts +0 -6
  72. package/dist/types/plugins/alignment/ui/ToolbarAlignment/index.d.ts +0 -33
  73. package/dist/types/plugins/alignment/ui/ToolbarAlignment/messages.d.ts +0 -22
  74. package/dist/types/plugins/alignment/ui/ToolbarAlignment/styles.d.ts +0 -3
  75. package/dist/types/plugins/alignment/utils/index.d.ts +0 -3
  76. package/dist/types/ui/Alignment/AlignmentButton/index.d.ts +0 -17
  77. package/dist/types/ui/Alignment/index.d.ts +0 -12
  78. package/dist/types/ui/Alignment/styles.d.ts +0 -1
  79. package/dist/types-ts4.5/commands/index.d.ts +0 -1
  80. package/dist/types-ts4.5/plugins/alignment/commands/index.d.ts +0 -4
  81. package/dist/types-ts4.5/plugins/alignment/index.d.ts +0 -5
  82. package/dist/types-ts4.5/plugins/alignment/pm-plugins/keymap.d.ts +0 -2
  83. package/dist/types-ts4.5/plugins/alignment/pm-plugins/main.d.ts +0 -8
  84. package/dist/types-ts4.5/plugins/alignment/pm-plugins/types.d.ts +0 -5
  85. package/dist/types-ts4.5/plugins/alignment/ui/ToolbarAlignment/icon-map.d.ts +0 -6
  86. package/dist/types-ts4.5/plugins/alignment/ui/ToolbarAlignment/index.d.ts +0 -33
  87. package/dist/types-ts4.5/plugins/alignment/ui/ToolbarAlignment/messages.d.ts +0 -22
  88. package/dist/types-ts4.5/plugins/alignment/ui/ToolbarAlignment/styles.d.ts +0 -3
  89. package/dist/types-ts4.5/plugins/alignment/utils/index.d.ts +0 -3
  90. package/dist/types-ts4.5/ui/Alignment/AlignmentButton/index.d.ts +0 -17
  91. package/dist/types-ts4.5/ui/Alignment/index.d.ts +0 -12
  92. package/dist/types-ts4.5/ui/Alignment/styles.d.ts +0 -1
@@ -1,6 +0,0 @@
1
- import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
- var _templateObject, _templateObject2, _templateObject3;
3
- import { css } from '@emotion/react';
4
- export var triggerWrapper = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n"])));
5
- export var wrapper = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n div {\n display: flex;\n }\n"])));
6
- export var expandIconWrapper = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n margin-left: ", ";\n"])), "var(--ds-space-negative-100, -8px)");
@@ -1,21 +0,0 @@
1
- import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
2
- import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
3
- export var getActiveAlignment = function getActiveAlignment(state) {
4
- if (state.selection instanceof CellSelection) {
5
- var marks = [];
6
- state.selection.forEachCell(function (cell) {
7
- var mark = cell.firstChild.marks.filter(function (mark) {
8
- return mark.type === state.schema.marks.alignment;
9
- })[0];
10
- marks.push(mark ? mark.attrs.align : 'start');
11
- });
12
- return marks.every(function (mark) {
13
- return mark === marks[0];
14
- }) ? marks[0] : 'start';
15
- }
16
- var node = findParentNodeOfType([state.schema.nodes.paragraph, state.schema.nodes.heading])(state.selection);
17
- var getMark = node && node.node.marks.filter(function (mark) {
18
- return mark.type === state.schema.marks.alignment;
19
- })[0];
20
- return getMark && getMark.attrs.align || 'start';
21
- };
@@ -1,62 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/createClass";
3
- import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
4
- import _inherits from "@babel/runtime/helpers/inherits";
5
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
6
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
9
- 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; } }
10
- import React from 'react';
11
- import { PureComponent } from 'react';
12
- import ToolbarButton from '../../ToolbarButton';
13
- import { ToolTipContent, tooltip } from '../../../keymaps';
14
- import { getAriaKeyshortcuts } from '@atlaskit/editor-common/keymaps';
15
- var AlignmentButton = /*#__PURE__*/function (_PureComponent) {
16
- _inherits(AlignmentButton, _PureComponent);
17
- var _super = _createSuper(AlignmentButton);
18
- function AlignmentButton() {
19
- var _this;
20
- _classCallCheck(this, AlignmentButton);
21
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
22
- args[_key] = arguments[_key];
23
- }
24
- _this = _super.call.apply(_super, [this].concat(args));
25
- _defineProperty(_assertThisInitialized(_this), "onClick", function (e) {
26
- var _this$props = _this.props,
27
- onClick = _this$props.onClick,
28
- value = _this$props.value;
29
-
30
- // detect if the click event comes from keyboard where screenX and screenY are 0
31
- var isMouseEvent = e instanceof MouseEvent;
32
- e.preventDefault();
33
- onClick(value, isMouseEvent);
34
- });
35
- return _this;
36
- }
37
- _createClass(AlignmentButton, [{
38
- key: "render",
39
- value: function render() {
40
- var _this$props2 = this.props,
41
- label = _this$props2.label,
42
- isSelected = _this$props2.isSelected,
43
- content = _this$props2.content,
44
- shortcut = _this$props2.shortcut;
45
- return /*#__PURE__*/React.createElement(ToolbarButton, {
46
- disabled: false,
47
- selected: isSelected,
48
- title: /*#__PURE__*/React.createElement(ToolTipContent, {
49
- description: label,
50
- keymap: shortcut
51
- }),
52
- "aria-label": shortcut ? tooltip(shortcut, label) : label,
53
- "aria-pressed": isSelected,
54
- "aria-keyshortcuts": getAriaKeyshortcuts(shortcut),
55
- onClick: this.onClick,
56
- iconBefore: content
57
- });
58
- }
59
- }]);
60
- return AlignmentButton;
61
- }(PureComponent);
62
- export default AlignmentButton;
@@ -1,68 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/createClass";
3
- import _inherits from "@babel/runtime/helpers/inherits";
4
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
7
- 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; } }
8
- /** @jsx jsx */
9
- import { jsx } from '@emotion/react';
10
- import { PureComponent } from 'react';
11
- import { injectIntl } from 'react-intl-next';
12
- import { IconMap } from '../../plugins/alignment/ui/ToolbarAlignment/icon-map';
13
- import AlignmentButton from './AlignmentButton';
14
- import { alignmentMessages } from '@atlaskit/editor-common/messages';
15
- import { alignmentWrapper } from './styles';
16
- import { alignLeft } from '../../keymaps';
17
- var alignmentOptions = [{
18
- title: alignmentMessages.alignLeft,
19
- shortcut: alignLeft,
20
- value: 'start'
21
- }, {
22
- title: alignmentMessages.alignCenter,
23
- value: 'center'
24
- }, {
25
- title: alignmentMessages.alignRight,
26
- value: 'end'
27
- }];
28
- var Alignment = /*#__PURE__*/function (_PureComponent) {
29
- _inherits(Alignment, _PureComponent);
30
- var _super = _createSuper(Alignment);
31
- function Alignment() {
32
- _classCallCheck(this, Alignment);
33
- return _super.apply(this, arguments);
34
- }
35
- _createClass(Alignment, [{
36
- key: "render",
37
- value: function render() {
38
- var _this$props = this.props,
39
- onClick = _this$props.onClick,
40
- selectedAlignment = _this$props.selectedAlignment,
41
- className = _this$props.className,
42
- intl = _this$props.intl;
43
- return jsx("div", {
44
- "data-testid": "alignment-buttons",
45
- css: alignmentWrapper,
46
- className: className
47
- }, alignmentOptions.map(function (alignment) {
48
- var value = alignment.value,
49
- title = alignment.title,
50
- shortcut = alignment.shortcut;
51
- var message = intl.formatMessage(title);
52
- return jsx(AlignmentButton, {
53
- content: jsx(IconMap, {
54
- alignment: value
55
- }),
56
- key: value,
57
- value: value,
58
- label: message,
59
- shortcut: shortcut,
60
- onClick: onClick,
61
- isSelected: value === selectedAlignment
62
- });
63
- }));
64
- }
65
- }]);
66
- return Alignment;
67
- }(PureComponent);
68
- export default injectIntl(Alignment);
@@ -1,4 +0,0 @@
1
- import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
- var _templateObject;
3
- import { css } from '@emotion/react';
4
- export var alignmentWrapper = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding: 0 ", ";\n display: flex;\n flex-wrap: wrap;\n max-width: ", "px;\n"])), "var(--ds-space-100, 8px)", 3 * 32);
@@ -1 +0,0 @@
1
- export { addParagraphAtEnd, createParagraphAtEnd, changeImageAlignment, createToggleBlockMarkOnRange, toggleBlockMark, clearEditorContent, } from '@atlaskit/editor-common/commands';
@@ -1,4 +0,0 @@
1
- import { Command } from '../../../types/command';
2
- import { AlignmentState } from '../pm-plugins/types';
3
- export declare const isAlignable: (align?: AlignmentState) => Command;
4
- export declare const changeAlignment: (align?: AlignmentState) => Command;
@@ -1,5 +0,0 @@
1
- import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
2
- import { AlignmentPluginState } from './pm-plugins/types';
3
- export declare const defaultConfig: AlignmentPluginState;
4
- declare const alignmentPlugin: NextEditorPlugin<'alignment'>;
5
- export default alignmentPlugin;
@@ -1,2 +0,0 @@
1
- import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- export declare function keymapPlugin(): SafePlugin;
@@ -1,8 +0,0 @@
1
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import type { EditorState } from '@atlaskit/editor-prosemirror/state';
3
- import { PluginKey } from '@atlaskit/editor-prosemirror/state';
4
- import type { Dispatch } from '../../../event-dispatcher';
5
- import type { AlignmentPluginState } from './types';
6
- export declare function createInitialPluginState(editorState: EditorState, pluginConfig: AlignmentPluginState): AlignmentPluginState;
7
- export declare const pluginKey: PluginKey<AlignmentPluginState>;
8
- export declare function createPlugin(dispatch: Dispatch, pluginConfig: AlignmentPluginState): SafePlugin;
@@ -1,5 +0,0 @@
1
- export type AlignmentState = 'start' | 'end' | 'center';
2
- export type AlignmentPluginState = {
3
- align: AlignmentState;
4
- isEnabled?: boolean;
5
- };
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- type Props = {
3
- alignment: string;
4
- };
5
- export declare const IconMap: (props: Props) => JSX.Element;
6
- export {};
@@ -1,33 +0,0 @@
1
- /** @jsx jsx */
2
- import React from 'react';
3
- import { jsx } from '@emotion/react';
4
- import type { WrappedComponentProps } from 'react-intl-next';
5
- import type { AlignmentPluginState, AlignmentState } from '../../pm-plugins/types';
6
- export interface State {
7
- isOpen: boolean;
8
- }
9
- export interface Props {
10
- pluginState: AlignmentPluginState;
11
- changeAlignment: (align: AlignmentState) => void;
12
- popupsMountPoint?: HTMLElement;
13
- popupsBoundariesElement?: HTMLElement;
14
- popupsScrollableElement?: HTMLElement;
15
- isReducedSpacing?: boolean;
16
- disabled?: boolean;
17
- }
18
- export declare class AlignmentToolbar extends React.Component<Props & WrappedComponentProps, State> {
19
- static displayName: string;
20
- private toolbarItemRef;
21
- state: State;
22
- render(): jsx.JSX.Element;
23
- componentDidUpdate(prevProps: Props): void;
24
- private changeAlignment;
25
- private toggleOpen;
26
- private toggleOpenByKeyboard;
27
- private hide;
28
- private hideOnEscape;
29
- }
30
- declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
31
- WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
32
- };
33
- export default _default;
@@ -1,22 +0,0 @@
1
- export declare const messages: {
2
- alignment: {
3
- id: string;
4
- defaultMessage: string;
5
- description: string;
6
- };
7
- alignLeft: {
8
- id: string;
9
- defaultMessage: string;
10
- description: string;
11
- };
12
- alignRight: {
13
- id: string;
14
- defaultMessage: string;
15
- description: string;
16
- };
17
- alignCenter: {
18
- id: string;
19
- defaultMessage: string;
20
- description: string;
21
- };
22
- };
@@ -1,3 +0,0 @@
1
- export declare const triggerWrapper: import("@emotion/react").SerializedStyles;
2
- export declare const wrapper: import("@emotion/react").SerializedStyles;
3
- export declare const expandIconWrapper: import("@emotion/react").SerializedStyles;
@@ -1,3 +0,0 @@
1
- import type { EditorState } from '@atlaskit/editor-prosemirror/state';
2
- import type { AlignmentState } from '../pm-plugins/types';
3
- export declare const getActiveAlignment: (state: EditorState) => AlignmentState | undefined;
@@ -1,17 +0,0 @@
1
- import React from 'react';
2
- import { PureComponent } from 'react';
3
- import { AlignmentState } from '../../../plugins/alignment/pm-plugins/types';
4
- import { Keymap } from '../../../keymaps';
5
- export interface Props {
6
- value: AlignmentState;
7
- label: string;
8
- isSelected?: boolean;
9
- onClick: (value: AlignmentState, shouldClosePopup: boolean) => void;
10
- content: React.ReactElement<any>;
11
- shortcut?: Keymap;
12
- }
13
- declare class AlignmentButton extends PureComponent<Props> {
14
- render(): JSX.Element;
15
- onClick: (e: any) => void;
16
- }
17
- export default AlignmentButton;
@@ -1,12 +0,0 @@
1
- /// <reference types="react" />
2
- import type { WrappedComponentProps } from 'react-intl-next';
3
- import type { AlignmentState } from '../../plugins/alignment/pm-plugins/types';
4
- export interface Props {
5
- selectedAlignment?: string;
6
- onClick: (value: AlignmentState) => void;
7
- className?: string;
8
- }
9
- declare const _default: import("react").FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
10
- WrappedComponent: import("react").ComponentType<Props & WrappedComponentProps<"intl">>;
11
- };
12
- export default _default;
@@ -1 +0,0 @@
1
- export declare const alignmentWrapper: import("@emotion/react").SerializedStyles;
@@ -1 +0,0 @@
1
- export { addParagraphAtEnd, createParagraphAtEnd, changeImageAlignment, createToggleBlockMarkOnRange, toggleBlockMark, clearEditorContent, } from '@atlaskit/editor-common/commands';
@@ -1,4 +0,0 @@
1
- import { Command } from '../../../types/command';
2
- import { AlignmentState } from '../pm-plugins/types';
3
- export declare const isAlignable: (align?: AlignmentState) => Command;
4
- export declare const changeAlignment: (align?: AlignmentState) => Command;
@@ -1,5 +0,0 @@
1
- import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
2
- import { AlignmentPluginState } from './pm-plugins/types';
3
- export declare const defaultConfig: AlignmentPluginState;
4
- declare const alignmentPlugin: NextEditorPlugin<'alignment'>;
5
- export default alignmentPlugin;
@@ -1,2 +0,0 @@
1
- import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- export declare function keymapPlugin(): SafePlugin;
@@ -1,8 +0,0 @@
1
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import type { EditorState } from '@atlaskit/editor-prosemirror/state';
3
- import { PluginKey } from '@atlaskit/editor-prosemirror/state';
4
- import type { Dispatch } from '../../../event-dispatcher';
5
- import type { AlignmentPluginState } from './types';
6
- export declare function createInitialPluginState(editorState: EditorState, pluginConfig: AlignmentPluginState): AlignmentPluginState;
7
- export declare const pluginKey: PluginKey<AlignmentPluginState>;
8
- export declare function createPlugin(dispatch: Dispatch, pluginConfig: AlignmentPluginState): SafePlugin;
@@ -1,5 +0,0 @@
1
- export type AlignmentState = 'start' | 'end' | 'center';
2
- export type AlignmentPluginState = {
3
- align: AlignmentState;
4
- isEnabled?: boolean;
5
- };
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- type Props = {
3
- alignment: string;
4
- };
5
- export declare const IconMap: (props: Props) => JSX.Element;
6
- export {};
@@ -1,33 +0,0 @@
1
- /** @jsx jsx */
2
- import React from 'react';
3
- import { jsx } from '@emotion/react';
4
- import type { WrappedComponentProps } from 'react-intl-next';
5
- import type { AlignmentPluginState, AlignmentState } from '../../pm-plugins/types';
6
- export interface State {
7
- isOpen: boolean;
8
- }
9
- export interface Props {
10
- pluginState: AlignmentPluginState;
11
- changeAlignment: (align: AlignmentState) => void;
12
- popupsMountPoint?: HTMLElement;
13
- popupsBoundariesElement?: HTMLElement;
14
- popupsScrollableElement?: HTMLElement;
15
- isReducedSpacing?: boolean;
16
- disabled?: boolean;
17
- }
18
- export declare class AlignmentToolbar extends React.Component<Props & WrappedComponentProps, State> {
19
- static displayName: string;
20
- private toolbarItemRef;
21
- state: State;
22
- render(): jsx.JSX.Element;
23
- componentDidUpdate(prevProps: Props): void;
24
- private changeAlignment;
25
- private toggleOpen;
26
- private toggleOpenByKeyboard;
27
- private hide;
28
- private hideOnEscape;
29
- }
30
- declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
31
- WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
32
- };
33
- export default _default;
@@ -1,22 +0,0 @@
1
- export declare const messages: {
2
- alignment: {
3
- id: string;
4
- defaultMessage: string;
5
- description: string;
6
- };
7
- alignLeft: {
8
- id: string;
9
- defaultMessage: string;
10
- description: string;
11
- };
12
- alignRight: {
13
- id: string;
14
- defaultMessage: string;
15
- description: string;
16
- };
17
- alignCenter: {
18
- id: string;
19
- defaultMessage: string;
20
- description: string;
21
- };
22
- };
@@ -1,3 +0,0 @@
1
- export declare const triggerWrapper: import("@emotion/react").SerializedStyles;
2
- export declare const wrapper: import("@emotion/react").SerializedStyles;
3
- export declare const expandIconWrapper: import("@emotion/react").SerializedStyles;
@@ -1,3 +0,0 @@
1
- import type { EditorState } from '@atlaskit/editor-prosemirror/state';
2
- import type { AlignmentState } from '../pm-plugins/types';
3
- export declare const getActiveAlignment: (state: EditorState) => AlignmentState | undefined;
@@ -1,17 +0,0 @@
1
- import React from 'react';
2
- import { PureComponent } from 'react';
3
- import { AlignmentState } from '../../../plugins/alignment/pm-plugins/types';
4
- import { Keymap } from '../../../keymaps';
5
- export interface Props {
6
- value: AlignmentState;
7
- label: string;
8
- isSelected?: boolean;
9
- onClick: (value: AlignmentState, shouldClosePopup: boolean) => void;
10
- content: React.ReactElement<any>;
11
- shortcut?: Keymap;
12
- }
13
- declare class AlignmentButton extends PureComponent<Props> {
14
- render(): JSX.Element;
15
- onClick: (e: any) => void;
16
- }
17
- export default AlignmentButton;
@@ -1,12 +0,0 @@
1
- /// <reference types="react" />
2
- import type { WrappedComponentProps } from 'react-intl-next';
3
- import type { AlignmentState } from '../../plugins/alignment/pm-plugins/types';
4
- export interface Props {
5
- selectedAlignment?: string;
6
- onClick: (value: AlignmentState) => void;
7
- className?: string;
8
- }
9
- declare const _default: import("react").FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
10
- WrappedComponent: import("react").ComponentType<Props & WrappedComponentProps<"intl">>;
11
- };
12
- export default _default;
@@ -1 +0,0 @@
1
- export declare const alignmentWrapper: import("@emotion/react").SerializedStyles;