@atlaskit/editor-plugin-grid 3.0.0 → 3.0.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.
- package/CHANGELOG.md +8 -0
- package/dist/cjs/gridPlugin.js +9 -10
- package/dist/es2019/gridPlugin.js +10 -11
- package/dist/esm/gridPlugin.js +10 -11
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-grid
|
|
2
2
|
|
|
3
|
+
## 3.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#182839](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/182839)
|
|
8
|
+
[`81f1c3383bdab`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/81f1c3383bdab) -
|
|
9
|
+
refactor: use useSharedPluginStateWithSelector instead of useSharedPluginStateSelector
|
|
10
|
+
|
|
3
11
|
## 3.0.0
|
|
4
12
|
|
|
5
13
|
### Major Changes
|
package/dist/cjs/gridPlugin.js
CHANGED
|
@@ -12,7 +12,6 @@ var _react2 = require("@emotion/react");
|
|
|
12
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
13
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
14
14
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
15
|
-
var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
|
|
16
15
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
17
16
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
18
17
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
@@ -121,17 +120,17 @@ var Grid = function Grid(_ref3) {
|
|
|
121
120
|
);
|
|
122
121
|
};
|
|
123
122
|
var ThemedGrid = (0, _react2.withTheme)(Grid);
|
|
124
|
-
var
|
|
125
|
-
var
|
|
126
|
-
var visible = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'grid.visible');
|
|
127
|
-
var gridType = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'grid.gridType');
|
|
128
|
-
var highlight = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'grid.highlight');
|
|
123
|
+
var selector = function selector(states) {
|
|
124
|
+
var _states$widthState, _states$gridState, _states$gridState2, _states$gridState3;
|
|
129
125
|
return {
|
|
130
|
-
width: width,
|
|
131
|
-
visible: visible,
|
|
132
|
-
gridType: gridType,
|
|
133
|
-
highlight: highlight
|
|
126
|
+
width: (_states$widthState = states.widthState) === null || _states$widthState === void 0 ? void 0 : _states$widthState.width,
|
|
127
|
+
visible: (_states$gridState = states.gridState) === null || _states$gridState === void 0 ? void 0 : _states$gridState.visible,
|
|
128
|
+
gridType: (_states$gridState2 = states.gridState) === null || _states$gridState2 === void 0 ? void 0 : _states$gridState2.gridType,
|
|
129
|
+
highlight: (_states$gridState3 = states.gridState) === null || _states$gridState3 === void 0 ? void 0 : _states$gridState3.highlight
|
|
134
130
|
};
|
|
131
|
+
};
|
|
132
|
+
var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
|
|
133
|
+
return (0, _hooks.useSharedPluginStateWithSelector)(api, ['width', 'grid'], selector);
|
|
135
134
|
}, function (api) {
|
|
136
135
|
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['width', 'grid']),
|
|
137
136
|
widthState = _useSharedPluginState.widthState,
|
|
@@ -3,9 +3,8 @@ import React from 'react';
|
|
|
3
3
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
4
4
|
import { withTheme } from '@emotion/react';
|
|
5
5
|
import classnames from 'classnames';
|
|
6
|
-
import { useSharedPluginState, sharedPluginStateHookMigratorFactory } from '@atlaskit/editor-common/hooks';
|
|
6
|
+
import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
7
7
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
8
|
-
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
9
8
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
10
9
|
import { akEditorBreakoutPadding, akEditorFullPageMaxWidth, breakoutWideScaleRatio } from '@atlaskit/editor-shared-styles';
|
|
11
10
|
export const GRID_SIZE = 12;
|
|
@@ -114,17 +113,17 @@ const Grid = ({
|
|
|
114
113
|
);
|
|
115
114
|
};
|
|
116
115
|
const ThemedGrid = withTheme(Grid);
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
const visible = useSharedPluginStateSelector(api, 'grid.visible');
|
|
120
|
-
const gridType = useSharedPluginStateSelector(api, 'grid.gridType');
|
|
121
|
-
const highlight = useSharedPluginStateSelector(api, 'grid.highlight');
|
|
116
|
+
const selector = states => {
|
|
117
|
+
var _states$widthState, _states$gridState, _states$gridState2, _states$gridState3;
|
|
122
118
|
return {
|
|
123
|
-
width,
|
|
124
|
-
visible,
|
|
125
|
-
gridType,
|
|
126
|
-
highlight
|
|
119
|
+
width: (_states$widthState = states.widthState) === null || _states$widthState === void 0 ? void 0 : _states$widthState.width,
|
|
120
|
+
visible: (_states$gridState = states.gridState) === null || _states$gridState === void 0 ? void 0 : _states$gridState.visible,
|
|
121
|
+
gridType: (_states$gridState2 = states.gridState) === null || _states$gridState2 === void 0 ? void 0 : _states$gridState2.gridType,
|
|
122
|
+
highlight: (_states$gridState3 = states.gridState) === null || _states$gridState3 === void 0 ? void 0 : _states$gridState3.highlight
|
|
127
123
|
};
|
|
124
|
+
};
|
|
125
|
+
const useSharedState = sharedPluginStateHookMigratorFactory(api => {
|
|
126
|
+
return useSharedPluginStateWithSelector(api, ['width', 'grid'], selector);
|
|
128
127
|
}, api => {
|
|
129
128
|
const {
|
|
130
129
|
widthState,
|
package/dist/esm/gridPlugin.js
CHANGED
|
@@ -5,9 +5,8 @@ import React from 'react';
|
|
|
5
5
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
6
6
|
import { withTheme } from '@emotion/react';
|
|
7
7
|
import classnames from 'classnames';
|
|
8
|
-
import { useSharedPluginState, sharedPluginStateHookMigratorFactory } from '@atlaskit/editor-common/hooks';
|
|
8
|
+
import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
9
9
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
10
|
-
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
11
10
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
12
11
|
import { akEditorBreakoutPadding, akEditorFullPageMaxWidth, breakoutWideScaleRatio } from '@atlaskit/editor-shared-styles';
|
|
13
12
|
export var GRID_SIZE = 12;
|
|
@@ -114,17 +113,17 @@ var Grid = function Grid(_ref3) {
|
|
|
114
113
|
);
|
|
115
114
|
};
|
|
116
115
|
var ThemedGrid = withTheme(Grid);
|
|
117
|
-
var
|
|
118
|
-
var
|
|
119
|
-
var visible = useSharedPluginStateSelector(api, 'grid.visible');
|
|
120
|
-
var gridType = useSharedPluginStateSelector(api, 'grid.gridType');
|
|
121
|
-
var highlight = useSharedPluginStateSelector(api, 'grid.highlight');
|
|
116
|
+
var selector = function selector(states) {
|
|
117
|
+
var _states$widthState, _states$gridState, _states$gridState2, _states$gridState3;
|
|
122
118
|
return {
|
|
123
|
-
width: width,
|
|
124
|
-
visible: visible,
|
|
125
|
-
gridType: gridType,
|
|
126
|
-
highlight: highlight
|
|
119
|
+
width: (_states$widthState = states.widthState) === null || _states$widthState === void 0 ? void 0 : _states$widthState.width,
|
|
120
|
+
visible: (_states$gridState = states.gridState) === null || _states$gridState === void 0 ? void 0 : _states$gridState.visible,
|
|
121
|
+
gridType: (_states$gridState2 = states.gridState) === null || _states$gridState2 === void 0 ? void 0 : _states$gridState2.gridType,
|
|
122
|
+
highlight: (_states$gridState3 = states.gridState) === null || _states$gridState3 === void 0 ? void 0 : _states$gridState3.highlight
|
|
127
123
|
};
|
|
124
|
+
};
|
|
125
|
+
var useSharedState = sharedPluginStateHookMigratorFactory(function (api) {
|
|
126
|
+
return useSharedPluginStateWithSelector(api, ['width', 'grid'], selector);
|
|
128
127
|
}, function (api) {
|
|
129
128
|
var _useSharedPluginState = useSharedPluginState(api, ['width', 'grid']),
|
|
130
129
|
widthState = _useSharedPluginState.widthState,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-grid",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "Grid plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"classnames": "^2.2.5"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@atlaskit/editor-common": "^107.
|
|
35
|
+
"@atlaskit/editor-common": "^107.7.0",
|
|
36
36
|
"react": "^18.2.0",
|
|
37
37
|
"react-dom": "^18.2.0"
|
|
38
38
|
},
|