@atlaskit/editor-plugin-guideline 3.0.5 → 4.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 +9 -0
- package/dist/cjs/guidelinePlugin.js +5 -18
- package/dist/es2019/guidelinePlugin.js +2 -16
- package/dist/esm/guidelinePlugin.js +6 -19
- package/package.json +3 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-guideline
|
|
2
2
|
|
|
3
|
+
## 4.0.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`0fda385059db0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0fda385059db0) -
|
|
8
|
+
PR to cleanup platform_editor_usesharedpluginstatewithselector for `collab-edit`,
|
|
9
|
+
`floating-toolbar`, `grid` and `guideline`
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 3.0.5
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -65,28 +65,15 @@ var selector = function selector(states) {
|
|
|
65
65
|
rect: (_states$guidelineStat2 = states.guidelineState) === null || _states$guidelineStat2 === void 0 ? void 0 : _states$guidelineStat2.rect
|
|
66
66
|
};
|
|
67
67
|
};
|
|
68
|
-
var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
|
|
69
|
-
return (0, _hooks.useSharedPluginStateWithSelector)(api, ['width', 'guideline'], selector);
|
|
70
|
-
}, function (api) {
|
|
71
|
-
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['width', 'guideline']),
|
|
72
|
-
widthState = _useSharedPluginState.widthState,
|
|
73
|
-
guidelineState = _useSharedPluginState.guidelineState;
|
|
74
|
-
return {
|
|
75
|
-
width: widthState === null || widthState === void 0 ? void 0 : widthState.width,
|
|
76
|
-
lineLength: widthState === null || widthState === void 0 ? void 0 : widthState.lineLength,
|
|
77
|
-
guidelines: guidelineState === null || guidelineState === void 0 ? void 0 : guidelineState.guidelines,
|
|
78
|
-
rect: guidelineState === null || guidelineState === void 0 ? void 0 : guidelineState.rect
|
|
79
|
-
};
|
|
80
|
-
});
|
|
81
68
|
var ContentComponent = function ContentComponent(_ref) {
|
|
82
69
|
var api = _ref.api,
|
|
83
70
|
editorView = _ref.editorView,
|
|
84
71
|
options = _ref.options;
|
|
85
|
-
var
|
|
86
|
-
width =
|
|
87
|
-
lineLength =
|
|
88
|
-
guidelines =
|
|
89
|
-
rect =
|
|
72
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['width', 'guideline'], selector),
|
|
73
|
+
width = _useSharedPluginState.width,
|
|
74
|
+
lineLength = _useSharedPluginState.lineLength,
|
|
75
|
+
guidelines = _useSharedPluginState.guidelines,
|
|
76
|
+
rect = _useSharedPluginState.rect;
|
|
90
77
|
if (!width || !lineLength || !guidelines || guidelines.length === 0) {
|
|
91
78
|
return null;
|
|
92
79
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
6
6
|
import { css, jsx } from '@emotion/react';
|
|
7
|
-
import {
|
|
7
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
8
8
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
9
9
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
10
10
|
import { akEditorGridLineZIndex } from '@atlaskit/editor-shared-styles';
|
|
@@ -60,20 +60,6 @@ const selector = states => {
|
|
|
60
60
|
rect: (_states$guidelineStat2 = states.guidelineState) === null || _states$guidelineStat2 === void 0 ? void 0 : _states$guidelineStat2.rect
|
|
61
61
|
};
|
|
62
62
|
};
|
|
63
|
-
const useSharedState = sharedPluginStateHookMigratorFactory(api => {
|
|
64
|
-
return useSharedPluginStateWithSelector(api, ['width', 'guideline'], selector);
|
|
65
|
-
}, api => {
|
|
66
|
-
const {
|
|
67
|
-
widthState,
|
|
68
|
-
guidelineState
|
|
69
|
-
} = useSharedPluginState(api, ['width', 'guideline']);
|
|
70
|
-
return {
|
|
71
|
-
width: widthState === null || widthState === void 0 ? void 0 : widthState.width,
|
|
72
|
-
lineLength: widthState === null || widthState === void 0 ? void 0 : widthState.lineLength,
|
|
73
|
-
guidelines: guidelineState === null || guidelineState === void 0 ? void 0 : guidelineState.guidelines,
|
|
74
|
-
rect: guidelineState === null || guidelineState === void 0 ? void 0 : guidelineState.rect
|
|
75
|
-
};
|
|
76
|
-
});
|
|
77
63
|
const ContentComponent = ({
|
|
78
64
|
api,
|
|
79
65
|
editorView,
|
|
@@ -84,7 +70,7 @@ const ContentComponent = ({
|
|
|
84
70
|
lineLength,
|
|
85
71
|
guidelines,
|
|
86
72
|
rect
|
|
87
|
-
} =
|
|
73
|
+
} = useSharedPluginStateWithSelector(api, ['width', 'guideline'], selector);
|
|
88
74
|
if (!width || !lineLength || !guidelines || guidelines.length === 0) {
|
|
89
75
|
return null;
|
|
90
76
|
}
|
|
@@ -7,7 +7,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
7
7
|
*/
|
|
8
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
9
|
import { css, jsx } from '@emotion/react';
|
|
10
|
-
import {
|
|
10
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
11
11
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
12
12
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
13
13
|
import { akEditorGridLineZIndex } from '@atlaskit/editor-shared-styles';
|
|
@@ -60,28 +60,15 @@ var selector = function selector(states) {
|
|
|
60
60
|
rect: (_states$guidelineStat2 = states.guidelineState) === null || _states$guidelineStat2 === void 0 ? void 0 : _states$guidelineStat2.rect
|
|
61
61
|
};
|
|
62
62
|
};
|
|
63
|
-
var useSharedState = sharedPluginStateHookMigratorFactory(function (api) {
|
|
64
|
-
return useSharedPluginStateWithSelector(api, ['width', 'guideline'], selector);
|
|
65
|
-
}, function (api) {
|
|
66
|
-
var _useSharedPluginState = useSharedPluginState(api, ['width', 'guideline']),
|
|
67
|
-
widthState = _useSharedPluginState.widthState,
|
|
68
|
-
guidelineState = _useSharedPluginState.guidelineState;
|
|
69
|
-
return {
|
|
70
|
-
width: widthState === null || widthState === void 0 ? void 0 : widthState.width,
|
|
71
|
-
lineLength: widthState === null || widthState === void 0 ? void 0 : widthState.lineLength,
|
|
72
|
-
guidelines: guidelineState === null || guidelineState === void 0 ? void 0 : guidelineState.guidelines,
|
|
73
|
-
rect: guidelineState === null || guidelineState === void 0 ? void 0 : guidelineState.rect
|
|
74
|
-
};
|
|
75
|
-
});
|
|
76
63
|
var ContentComponent = function ContentComponent(_ref) {
|
|
77
64
|
var api = _ref.api,
|
|
78
65
|
editorView = _ref.editorView,
|
|
79
66
|
options = _ref.options;
|
|
80
|
-
var
|
|
81
|
-
width =
|
|
82
|
-
lineLength =
|
|
83
|
-
guidelines =
|
|
84
|
-
rect =
|
|
67
|
+
var _useSharedPluginState = useSharedPluginStateWithSelector(api, ['width', 'guideline'], selector),
|
|
68
|
+
width = _useSharedPluginState.width,
|
|
69
|
+
lineLength = _useSharedPluginState.lineLength,
|
|
70
|
+
guidelines = _useSharedPluginState.guidelines,
|
|
71
|
+
rect = _useSharedPluginState.rect;
|
|
85
72
|
if (!width || !lineLength || !guidelines || guidelines.length === 0) {
|
|
86
73
|
return null;
|
|
87
74
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-guideline",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "guideline 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": "^5.0.0",
|
|
28
25
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
29
26
|
"@atlaskit/editor-shared-styles": "^3.6.0",
|
|
30
27
|
"@atlaskit/theme": "^20.0.0",
|
|
@@ -33,7 +30,7 @@
|
|
|
33
30
|
"@emotion/react": "^11.7.1"
|
|
34
31
|
},
|
|
35
32
|
"peerDependencies": {
|
|
36
|
-
"@atlaskit/editor-common": "^
|
|
33
|
+
"@atlaskit/editor-common": "^108.0.0",
|
|
37
34
|
"react": "^18.2.0",
|
|
38
35
|
"react-dom": "^18.2.0"
|
|
39
36
|
},
|