@atlaskit/editor-plugin-grid 3.1.1 → 5.0.0
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/gridPlugin.js +5 -18
- package/dist/es2019/gridPlugin.js +2 -16
- package/dist/esm/gridPlugin.js +6 -19
- package/package.json +3 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-grid
|
|
2
2
|
|
|
3
|
+
## 5.0.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 4.0.0
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`0fda385059db0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0fda385059db0) -
|
|
14
|
+
PR to cleanup platform_editor_usesharedpluginstatewithselector for `collab-edit`,
|
|
15
|
+
`floating-toolbar`, `grid` and `guideline`
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 3.1.1
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/dist/cjs/gridPlugin.js
CHANGED
|
@@ -129,28 +129,15 @@ var selector = function selector(states) {
|
|
|
129
129
|
highlight: (_states$gridState3 = states.gridState) === null || _states$gridState3 === void 0 ? void 0 : _states$gridState3.highlight
|
|
130
130
|
};
|
|
131
131
|
};
|
|
132
|
-
var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
|
|
133
|
-
return (0, _hooks.useSharedPluginStateWithSelector)(api, ['width', 'grid'], selector);
|
|
134
|
-
}, function (api) {
|
|
135
|
-
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['width', 'grid']),
|
|
136
|
-
widthState = _useSharedPluginState.widthState,
|
|
137
|
-
gridState = _useSharedPluginState.gridState;
|
|
138
|
-
return {
|
|
139
|
-
width: widthState === null || widthState === void 0 ? void 0 : widthState.width,
|
|
140
|
-
visible: gridState === null || gridState === void 0 ? void 0 : gridState.visible,
|
|
141
|
-
gridType: gridState === null || gridState === void 0 ? void 0 : gridState.gridType,
|
|
142
|
-
highlight: gridState === null || gridState === void 0 ? void 0 : gridState.highlight
|
|
143
|
-
};
|
|
144
|
-
});
|
|
145
132
|
var ContentComponent = function ContentComponent(_ref4) {
|
|
146
133
|
var api = _ref4.api,
|
|
147
134
|
editorView = _ref4.editorView,
|
|
148
135
|
options = _ref4.options;
|
|
149
|
-
var
|
|
150
|
-
width =
|
|
151
|
-
visible =
|
|
152
|
-
gridType =
|
|
153
|
-
highlight =
|
|
136
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['width', 'grid'], selector),
|
|
137
|
+
width = _useSharedPluginState.width,
|
|
138
|
+
visible = _useSharedPluginState.visible,
|
|
139
|
+
gridType = _useSharedPluginState.gridType,
|
|
140
|
+
highlight = _useSharedPluginState.highlight;
|
|
154
141
|
if (visible === undefined || !highlight) {
|
|
155
142
|
return null;
|
|
156
143
|
}
|
|
@@ -3,7 +3,7 @@ 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 {
|
|
6
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
7
7
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
8
8
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
9
9
|
import { akEditorBreakoutPadding, akEditorFullPageMaxWidth, breakoutWideScaleRatio } from '@atlaskit/editor-shared-styles';
|
|
@@ -122,20 +122,6 @@ const selector = states => {
|
|
|
122
122
|
highlight: (_states$gridState3 = states.gridState) === null || _states$gridState3 === void 0 ? void 0 : _states$gridState3.highlight
|
|
123
123
|
};
|
|
124
124
|
};
|
|
125
|
-
const useSharedState = sharedPluginStateHookMigratorFactory(api => {
|
|
126
|
-
return useSharedPluginStateWithSelector(api, ['width', 'grid'], selector);
|
|
127
|
-
}, api => {
|
|
128
|
-
const {
|
|
129
|
-
widthState,
|
|
130
|
-
gridState
|
|
131
|
-
} = useSharedPluginState(api, ['width', 'grid']);
|
|
132
|
-
return {
|
|
133
|
-
width: widthState === null || widthState === void 0 ? void 0 : widthState.width,
|
|
134
|
-
visible: gridState === null || gridState === void 0 ? void 0 : gridState.visible,
|
|
135
|
-
gridType: gridState === null || gridState === void 0 ? void 0 : gridState.gridType,
|
|
136
|
-
highlight: gridState === null || gridState === void 0 ? void 0 : gridState.highlight
|
|
137
|
-
};
|
|
138
|
-
});
|
|
139
125
|
const ContentComponent = ({
|
|
140
126
|
api,
|
|
141
127
|
editorView,
|
|
@@ -146,7 +132,7 @@ const ContentComponent = ({
|
|
|
146
132
|
visible,
|
|
147
133
|
gridType,
|
|
148
134
|
highlight
|
|
149
|
-
} =
|
|
135
|
+
} = useSharedPluginStateWithSelector(api, ['width', 'grid'], selector);
|
|
150
136
|
if (visible === undefined || !highlight) {
|
|
151
137
|
return null;
|
|
152
138
|
}
|
package/dist/esm/gridPlugin.js
CHANGED
|
@@ -5,7 +5,7 @@ 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 {
|
|
8
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
9
9
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
10
10
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
11
11
|
import { akEditorBreakoutPadding, akEditorFullPageMaxWidth, breakoutWideScaleRatio } from '@atlaskit/editor-shared-styles';
|
|
@@ -122,28 +122,15 @@ var selector = function selector(states) {
|
|
|
122
122
|
highlight: (_states$gridState3 = states.gridState) === null || _states$gridState3 === void 0 ? void 0 : _states$gridState3.highlight
|
|
123
123
|
};
|
|
124
124
|
};
|
|
125
|
-
var useSharedState = sharedPluginStateHookMigratorFactory(function (api) {
|
|
126
|
-
return useSharedPluginStateWithSelector(api, ['width', 'grid'], selector);
|
|
127
|
-
}, function (api) {
|
|
128
|
-
var _useSharedPluginState = useSharedPluginState(api, ['width', 'grid']),
|
|
129
|
-
widthState = _useSharedPluginState.widthState,
|
|
130
|
-
gridState = _useSharedPluginState.gridState;
|
|
131
|
-
return {
|
|
132
|
-
width: widthState === null || widthState === void 0 ? void 0 : widthState.width,
|
|
133
|
-
visible: gridState === null || gridState === void 0 ? void 0 : gridState.visible,
|
|
134
|
-
gridType: gridState === null || gridState === void 0 ? void 0 : gridState.gridType,
|
|
135
|
-
highlight: gridState === null || gridState === void 0 ? void 0 : gridState.highlight
|
|
136
|
-
};
|
|
137
|
-
});
|
|
138
125
|
var ContentComponent = function ContentComponent(_ref4) {
|
|
139
126
|
var api = _ref4.api,
|
|
140
127
|
editorView = _ref4.editorView,
|
|
141
128
|
options = _ref4.options;
|
|
142
|
-
var
|
|
143
|
-
width =
|
|
144
|
-
visible =
|
|
145
|
-
gridType =
|
|
146
|
-
highlight =
|
|
129
|
+
var _useSharedPluginState = useSharedPluginStateWithSelector(api, ['width', 'grid'], selector),
|
|
130
|
+
width = _useSharedPluginState.width,
|
|
131
|
+
visible = _useSharedPluginState.visible,
|
|
132
|
+
gridType = _useSharedPluginState.gridType,
|
|
133
|
+
highlight = _useSharedPluginState.highlight;
|
|
147
134
|
if (visible === undefined || !highlight) {
|
|
148
135
|
return null;
|
|
149
136
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-grid",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "Grid plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -20,11 +20,8 @@
|
|
|
20
20
|
"*.compiled.css"
|
|
21
21
|
],
|
|
22
22
|
"atlaskit:src": "src/index.ts",
|
|
23
|
-
"af:exports": {
|
|
24
|
-
".": "./src/index.ts"
|
|
25
|
-
},
|
|
26
23
|
"dependencies": {
|
|
27
|
-
"@atlaskit/editor-plugin-width": "^
|
|
24
|
+
"@atlaskit/editor-plugin-width": "^6.0.0",
|
|
28
25
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
29
26
|
"@atlaskit/editor-shared-styles": "^3.6.0",
|
|
30
27
|
"@babel/runtime": "^7.0.0",
|
|
@@ -32,7 +29,7 @@
|
|
|
32
29
|
"classnames": "^2.2.5"
|
|
33
30
|
},
|
|
34
31
|
"peerDependencies": {
|
|
35
|
-
"@atlaskit/editor-common": "^
|
|
32
|
+
"@atlaskit/editor-common": "^109.0.0",
|
|
36
33
|
"react": "^18.2.0",
|
|
37
34
|
"react-dom": "^18.2.0"
|
|
38
35
|
},
|