@atlaskit/editor-plugin-alignment 1.13.4 → 1.13.6
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 +15 -0
- package/dist/cjs/alignmentPluginType.js +5 -0
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/pm-plugins/keymap.js +4 -4
- package/dist/cjs/pm-plugins/main.js +3 -3
- package/dist/cjs/ui/PrimaryToolbarComponent.js +2 -2
- package/dist/es2019/alignmentPluginType.js +1 -0
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/pm-plugins/keymap.js +1 -1
- package/dist/es2019/pm-plugins/main.js +2 -2
- package/dist/es2019/ui/PrimaryToolbarComponent.js +1 -1
- package/dist/esm/alignmentPluginType.js +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/pm-plugins/keymap.js +1 -1
- package/dist/esm/pm-plugins/main.js +2 -2
- package/dist/esm/ui/PrimaryToolbarComponent.js +1 -1
- package/dist/types/alignmentPlugin.d.ts +4 -0
- package/dist/types/{plugin.d.ts → alignmentPluginType.d.ts} +0 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/types/{utils → pm-plugins/utils}/index.d.ts +1 -1
- package/dist/types/ui/PrimaryToolbarComponent.d.ts +1 -1
- package/dist/types/ui/ToolbarAlignment/index.d.ts +1 -1
- package/dist/types-ts4.5/alignmentPlugin.d.ts +4 -0
- package/dist/types-ts4.5/{plugin.d.ts → alignmentPluginType.d.ts} +0 -2
- package/dist/types-ts4.5/index.d.ts +2 -2
- package/dist/types-ts4.5/{utils → pm-plugins/utils}/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/PrimaryToolbarComponent.d.ts +1 -1
- package/dist/types-ts4.5/ui/ToolbarAlignment/index.d.ts +1 -1
- package/package.json +7 -4
- /package/dist/cjs/{plugin.js → alignmentPlugin.js} +0 -0
- /package/dist/cjs/{commands → editor-commands}/index.js +0 -0
- /package/dist/cjs/{utils → pm-plugins/utils}/index.js +0 -0
- /package/dist/es2019/{plugin.js → alignmentPlugin.js} +0 -0
- /package/dist/es2019/{commands → editor-commands}/index.js +0 -0
- /package/dist/es2019/{utils → pm-plugins/utils}/index.js +0 -0
- /package/dist/esm/{plugin.js → alignmentPlugin.js} +0 -0
- /package/dist/esm/{commands → editor-commands}/index.js +0 -0
- /package/dist/esm/{utils → pm-plugins/utils}/index.js +0 -0
- /package/dist/types/{commands → editor-commands}/index.d.ts +0 -0
- /package/dist/types-ts4.5/{commands → editor-commands}/index.d.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-alignment
|
|
2
2
|
|
|
3
|
+
## 1.13.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#167498](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/167498)
|
|
8
|
+
[`e275b9ee8b698`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e275b9ee8b698) -
|
|
9
|
+
ED-25805: refactors plugins to meet folder standards
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 1.13.5
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 1.13.4
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/dist/cjs/index.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
Object.defineProperty(exports, "alignmentPlugin", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function get() {
|
|
9
|
-
return
|
|
9
|
+
return _alignmentPlugin.alignmentPlugin;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
var
|
|
12
|
+
var _alignmentPlugin = require("./alignmentPlugin");
|
|
@@ -5,11 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.keymapPlugin = keymapPlugin;
|
|
7
7
|
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
8
|
-
var
|
|
8
|
+
var _editorCommands = require("../editor-commands");
|
|
9
9
|
function keymapPlugin() {
|
|
10
10
|
var list = {};
|
|
11
|
-
(0, _keymaps.bindKeymapWithCommand)(_keymaps.alignLeft.common, (0,
|
|
12
|
-
(0, _keymaps.bindKeymapWithCommand)(_keymaps.alignCenter.common, (0,
|
|
13
|
-
(0, _keymaps.bindKeymapWithCommand)(_keymaps.alignRight.common, (0,
|
|
11
|
+
(0, _keymaps.bindKeymapWithCommand)(_keymaps.alignLeft.common, (0, _editorCommands.changeAlignment)('start'), list);
|
|
12
|
+
(0, _keymaps.bindKeymapWithCommand)(_keymaps.alignCenter.common, (0, _editorCommands.changeAlignment)('center'), list);
|
|
13
|
+
(0, _keymaps.bindKeymapWithCommand)(_keymaps.alignRight.common, (0, _editorCommands.changeAlignment)('end'), list);
|
|
14
14
|
return (0, _keymaps.keymap)(list);
|
|
15
15
|
}
|
|
@@ -10,8 +10,8 @@ exports.pluginKey = void 0;
|
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
12
12
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
13
|
-
var
|
|
14
|
-
var _utils = require("
|
|
13
|
+
var _editorCommands = require("../editor-commands");
|
|
14
|
+
var _utils = require("./utils");
|
|
15
15
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
16
16
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
17
17
|
function createInitialPluginState(editorState, pluginConfig) {
|
|
@@ -30,7 +30,7 @@ function createPlugin(dispatch, pluginConfig) {
|
|
|
30
30
|
},
|
|
31
31
|
apply: function apply(_tr, state, _prevState, nextState) {
|
|
32
32
|
var nextPluginState = (0, _utils.getActiveAlignment)(nextState);
|
|
33
|
-
var isEnabled = (0,
|
|
33
|
+
var isEnabled = (0, _editorCommands.isAlignable)(nextPluginState)(nextState);
|
|
34
34
|
var newState = _objectSpread(_objectSpread({}, state), {}, {
|
|
35
35
|
align: nextPluginState,
|
|
36
36
|
isEnabled: isEnabled
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.PrimaryToolbarComponent = PrimaryToolbarComponent;
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
11
|
-
var
|
|
11
|
+
var _editorCommands = require("../editor-commands");
|
|
12
12
|
var _ToolbarAlignment = _interopRequireDefault(require("./ToolbarAlignment"));
|
|
13
13
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
14
14
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -23,7 +23,7 @@ function PrimaryToolbarComponent(_ref) {
|
|
|
23
23
|
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['alignment']),
|
|
24
24
|
alignmentState = _useSharedPluginState.alignmentState;
|
|
25
25
|
var changeAlignmentCallback = (0, _react.useCallback)(function (align) {
|
|
26
|
-
return (0,
|
|
26
|
+
return (0, _editorCommands.changeAlignment)(align)(editorView.state, editorView.dispatch);
|
|
27
27
|
}, [editorView]);
|
|
28
28
|
return /*#__PURE__*/_react.default.createElement(_ToolbarAlignment.default, {
|
|
29
29
|
pluginState: alignmentState,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/es2019/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { alignmentPlugin } from './
|
|
1
|
+
export { alignmentPlugin } from './alignmentPlugin';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { alignCenter, alignLeft, alignRight, bindKeymapWithCommand, keymap } from '@atlaskit/editor-common/keymaps';
|
|
2
|
-
import { changeAlignment } from '../commands';
|
|
2
|
+
import { changeAlignment } from '../editor-commands';
|
|
3
3
|
export function keymapPlugin() {
|
|
4
4
|
const list = {};
|
|
5
5
|
bindKeymapWithCommand(alignLeft.common, changeAlignment('start'), list);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import { isAlignable } from '../commands';
|
|
4
|
-
import { getActiveAlignment } from '
|
|
3
|
+
import { isAlignable } from '../editor-commands';
|
|
4
|
+
import { getActiveAlignment } from './utils';
|
|
5
5
|
export function createInitialPluginState(editorState, pluginConfig) {
|
|
6
6
|
return {
|
|
7
7
|
align: getActiveAlignment(editorState) || pluginConfig.align,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
2
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
3
|
-
import { changeAlignment } from '../commands';
|
|
3
|
+
import { changeAlignment } from '../editor-commands';
|
|
4
4
|
import ToolbarAlignment from './ToolbarAlignment';
|
|
5
5
|
export function PrimaryToolbarComponent({
|
|
6
6
|
api,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { alignmentPlugin } from './
|
|
1
|
+
export { alignmentPlugin } from './alignmentPlugin';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { alignCenter, alignLeft, alignRight, bindKeymapWithCommand, keymap } from '@atlaskit/editor-common/keymaps';
|
|
2
|
-
import { changeAlignment } from '../commands';
|
|
2
|
+
import { changeAlignment } from '../editor-commands';
|
|
3
3
|
export function keymapPlugin() {
|
|
4
4
|
var list = {};
|
|
5
5
|
bindKeymapWithCommand(alignLeft.common, changeAlignment('start'), list);
|
|
@@ -3,8 +3,8 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
5
5
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
6
|
-
import { isAlignable } from '../commands';
|
|
7
|
-
import { getActiveAlignment } from '
|
|
6
|
+
import { isAlignable } from '../editor-commands';
|
|
7
|
+
import { getActiveAlignment } from './utils';
|
|
8
8
|
export function createInitialPluginState(editorState, pluginConfig) {
|
|
9
9
|
return {
|
|
10
10
|
align: getActiveAlignment(editorState) || pluginConfig.align,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
2
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
3
|
-
import { changeAlignment } from '../commands';
|
|
3
|
+
import { changeAlignment } from '../editor-commands';
|
|
4
4
|
import ToolbarAlignment from './ToolbarAlignment';
|
|
5
5
|
export function PrimaryToolbarComponent(_ref) {
|
|
6
6
|
var api = _ref.api,
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
|
|
3
3
|
import type { AlignmentPluginState } from './pm-plugins/types';
|
|
4
|
-
export declare const defaultConfig: AlignmentPluginState;
|
|
5
4
|
export type AlignmentPlugin = NextEditorPlugin<'alignment', {
|
|
6
5
|
sharedState: AlignmentPluginState | undefined;
|
|
7
6
|
dependencies: [OptionalPlugin<PrimaryToolbarPlugin>];
|
|
8
7
|
}>;
|
|
9
|
-
export declare const alignmentPlugin: AlignmentPlugin;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { alignmentPlugin } from './
|
|
2
|
-
export type { AlignmentPlugin } from './
|
|
1
|
+
export { alignmentPlugin } from './alignmentPlugin';
|
|
2
|
+
export type { AlignmentPlugin } from './alignmentPluginType';
|
|
3
3
|
export type { AlignmentPluginState } from './pm-plugins/types';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import type { AlignmentState } from '../
|
|
2
|
+
import type { AlignmentState } from '../types';
|
|
3
3
|
export declare const getActiveAlignment: (state: EditorState) => AlignmentState | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
-
import type { AlignmentPlugin } from '../
|
|
4
|
+
import type { AlignmentPlugin } from '../alignmentPluginType';
|
|
5
5
|
interface PrimaryToolbarComponentProps {
|
|
6
6
|
api: ExtractInjectionAPI<AlignmentPlugin> | undefined;
|
|
7
7
|
editorView: EditorView;
|
|
@@ -6,7 +6,7 @@ import React from 'react';
|
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
7
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
8
8
|
import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
9
|
-
import type { AlignmentPlugin } from '../../
|
|
9
|
+
import type { AlignmentPlugin } from '../../alignmentPluginType';
|
|
10
10
|
import type { AlignmentPluginState, AlignmentState } from '../../pm-plugins/types';
|
|
11
11
|
export interface State {
|
|
12
12
|
isOpen: boolean;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
|
|
3
3
|
import type { AlignmentPluginState } from './pm-plugins/types';
|
|
4
|
-
export declare const defaultConfig: AlignmentPluginState;
|
|
5
4
|
export type AlignmentPlugin = NextEditorPlugin<'alignment', {
|
|
6
5
|
sharedState: AlignmentPluginState | undefined;
|
|
7
6
|
dependencies: [
|
|
8
7
|
OptionalPlugin<PrimaryToolbarPlugin>
|
|
9
8
|
];
|
|
10
9
|
}>;
|
|
11
|
-
export declare const alignmentPlugin: AlignmentPlugin;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { alignmentPlugin } from './
|
|
2
|
-
export type { AlignmentPlugin } from './
|
|
1
|
+
export { alignmentPlugin } from './alignmentPlugin';
|
|
2
|
+
export type { AlignmentPlugin } from './alignmentPluginType';
|
|
3
3
|
export type { AlignmentPluginState } from './pm-plugins/types';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import type { AlignmentState } from '../
|
|
2
|
+
import type { AlignmentState } from '../types';
|
|
3
3
|
export declare const getActiveAlignment: (state: EditorState) => AlignmentState | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
-
import type { AlignmentPlugin } from '../
|
|
4
|
+
import type { AlignmentPlugin } from '../alignmentPluginType';
|
|
5
5
|
interface PrimaryToolbarComponentProps {
|
|
6
6
|
api: ExtractInjectionAPI<AlignmentPlugin> | undefined;
|
|
7
7
|
editorView: EditorView;
|
|
@@ -6,7 +6,7 @@ import React from 'react';
|
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
7
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
8
8
|
import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
9
|
-
import type { AlignmentPlugin } from '../../
|
|
9
|
+
import type { AlignmentPlugin } from '../../alignmentPluginType';
|
|
10
10
|
import type { AlignmentPluginState, AlignmentState } from '../../pm-plugins/types';
|
|
11
11
|
export interface State {
|
|
12
12
|
isOpen: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-alignment",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.6",
|
|
4
4
|
"description": "Alignment plugin for @atlaskit/editor-core",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@atlaskit/adf-schema": "^44.2.0",
|
|
24
|
-
"@atlaskit/editor-common": "^
|
|
24
|
+
"@atlaskit/editor-common": "^95.6.0",
|
|
25
25
|
"@atlaskit/editor-plugin-primary-toolbar": "^2.0.0",
|
|
26
26
|
"@atlaskit/editor-prosemirror": "6.0.0",
|
|
27
27
|
"@atlaskit/editor-tables": "^2.8.0",
|
|
28
|
-
"@atlaskit/icon": "^22.
|
|
28
|
+
"@atlaskit/icon": "^22.26.0",
|
|
29
29
|
"@atlaskit/platform-feature-flags": "0.3.0",
|
|
30
|
-
"@atlaskit/tokens": "^2.
|
|
30
|
+
"@atlaskit/tokens": "^2.3.0",
|
|
31
31
|
"@babel/runtime": "^7.0.0",
|
|
32
32
|
"@emotion/react": "^11.7.1"
|
|
33
33
|
},
|
|
@@ -49,6 +49,9 @@
|
|
|
49
49
|
},
|
|
50
50
|
"techstack": {
|
|
51
51
|
"@atlassian/frontend": {
|
|
52
|
+
"code-structure": [
|
|
53
|
+
"editor-plugin"
|
|
54
|
+
],
|
|
52
55
|
"import-structure": [
|
|
53
56
|
"atlassian-conventions"
|
|
54
57
|
],
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|