@atlaskit/editor-plugin-grid 1.1.4 → 1.1.5
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 +85 -81
- package/LICENSE.md +6 -8
- package/dist/cjs/plugin.js +31 -15
- package/dist/es2019/plugin.js +31 -15
- package/dist/esm/plugin.js +31 -15
- package/package.json +4 -6
- package/report.api.md +18 -17
package/CHANGELOG.md
CHANGED
|
@@ -1,206 +1,210 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-grid
|
|
2
2
|
|
|
3
|
+
## 1.1.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
3
9
|
## 1.1.4
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
6
12
|
|
|
7
|
-
-
|
|
13
|
+
- Updated dependencies
|
|
8
14
|
|
|
9
15
|
## 1.1.3
|
|
10
16
|
|
|
11
17
|
### Patch Changes
|
|
12
18
|
|
|
13
|
-
-
|
|
19
|
+
- Updated dependencies
|
|
14
20
|
|
|
15
21
|
## 1.1.2
|
|
16
22
|
|
|
17
23
|
### Patch Changes
|
|
18
24
|
|
|
19
|
-
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
25
|
+
- [#97698](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/97698)
|
|
26
|
+
[`1c7b378c0d3b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/1c7b378c0d3b) -
|
|
27
|
+
[HOT-108999] We had an incident where the cursor jumps back a character in table headers for any
|
|
28
|
+
language triggering composition on an empty line.This was fixed in a patch bump of
|
|
29
|
+
prosemirror-view. https://github.com/ProseMirror/prosemirror-view/compare/1.33.4...1.33.5
|
|
24
30
|
|
|
25
31
|
## 1.1.1
|
|
26
32
|
|
|
27
33
|
### Patch Changes
|
|
28
34
|
|
|
29
|
-
-
|
|
35
|
+
- Updated dependencies
|
|
30
36
|
|
|
31
37
|
## 1.1.0
|
|
32
38
|
|
|
33
39
|
### Minor Changes
|
|
34
40
|
|
|
35
|
-
-
|
|
36
|
-
|
|
37
|
-
|
|
41
|
+
- [#91934](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/91934)
|
|
42
|
+
[`b76a78c6a199`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b76a78c6a199) -
|
|
43
|
+
bumped editor-prosemirror version to 4.0.0
|
|
38
44
|
|
|
39
45
|
### Patch Changes
|
|
40
46
|
|
|
41
|
-
-
|
|
47
|
+
- Updated dependencies
|
|
42
48
|
|
|
43
49
|
## 1.0.3
|
|
44
50
|
|
|
45
51
|
### Patch Changes
|
|
46
52
|
|
|
47
|
-
-
|
|
48
|
-
|
|
49
|
-
|
|
53
|
+
- [#83116](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83116)
|
|
54
|
+
[`8d4e99057fe0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8d4e99057fe0) -
|
|
55
|
+
Upgrade Typescript from `4.9.5` to `5.4.2`
|
|
50
56
|
|
|
51
57
|
## 1.0.2
|
|
52
58
|
|
|
53
59
|
### Patch Changes
|
|
54
60
|
|
|
55
|
-
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
61
|
+
- [#81801](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/81801)
|
|
62
|
+
[`3afc1428a56a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3afc1428a56a) -
|
|
63
|
+
Small refactor in the `overflowHighlight` utility function to improve compatibility with
|
|
64
|
+
TypeScript 5
|
|
59
65
|
|
|
60
66
|
## 1.0.1
|
|
61
67
|
|
|
62
68
|
### Patch Changes
|
|
63
69
|
|
|
64
|
-
-
|
|
70
|
+
- Updated dependencies
|
|
65
71
|
|
|
66
72
|
## 1.0.0
|
|
67
73
|
|
|
68
74
|
### Major Changes
|
|
69
75
|
|
|
70
|
-
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
76
|
+
- [#72386](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/72386)
|
|
77
|
+
[`0c52b0be40c1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0c52b0be40c1) -
|
|
78
|
+
This changeset exists to bump all editor plugins that currently don't have a major version. This
|
|
79
|
+
is to address an issue with Jira plugin consumption.
|
|
74
80
|
|
|
75
81
|
### Patch Changes
|
|
76
82
|
|
|
77
|
-
-
|
|
83
|
+
- Updated dependencies
|
|
78
84
|
|
|
79
85
|
## 0.3.2
|
|
80
86
|
|
|
81
87
|
### Patch Changes
|
|
82
88
|
|
|
83
|
-
-
|
|
84
|
-
|
|
85
|
-
|
|
89
|
+
- [#68572](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/68572)
|
|
90
|
+
[`15d407fe5143`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/15d407fe5143) -
|
|
91
|
+
Upgrading @atlaskit/editor-prosemirror dependency
|
|
86
92
|
|
|
87
93
|
## 0.3.1
|
|
88
94
|
|
|
89
95
|
### Patch Changes
|
|
90
96
|
|
|
91
|
-
-
|
|
97
|
+
- Updated dependencies
|
|
92
98
|
|
|
93
99
|
## 0.3.0
|
|
94
100
|
|
|
95
101
|
### Minor Changes
|
|
96
102
|
|
|
97
|
-
-
|
|
98
|
-
|
|
99
|
-
|
|
103
|
+
- [#40763](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/40763)
|
|
104
|
+
[`7ff70f99909`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7ff70f99909) - Decouple
|
|
105
|
+
media from editor-core and expose GridPluginState from grid plugin.
|
|
100
106
|
|
|
101
107
|
## 0.2.2
|
|
102
108
|
|
|
103
109
|
### Patch Changes
|
|
104
110
|
|
|
105
|
-
-
|
|
111
|
+
- Updated dependencies
|
|
106
112
|
|
|
107
113
|
## 0.2.1
|
|
108
114
|
|
|
109
115
|
### Patch Changes
|
|
110
116
|
|
|
111
|
-
-
|
|
117
|
+
- Updated dependencies
|
|
112
118
|
|
|
113
119
|
## 0.2.0
|
|
114
120
|
|
|
115
121
|
### Minor Changes
|
|
116
122
|
|
|
117
|
-
-
|
|
118
|
-
|
|
119
|
-
|
|
123
|
+
- [#39325](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/39325)
|
|
124
|
+
[`ad3c5c21079`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ad3c5c21079) - Updating
|
|
125
|
+
all plugins with minor version to correct issue with semver.
|
|
120
126
|
|
|
121
127
|
### Patch Changes
|
|
122
128
|
|
|
123
|
-
-
|
|
129
|
+
- Updated dependencies
|
|
124
130
|
|
|
125
131
|
## 0.1.7
|
|
126
132
|
|
|
127
133
|
### Patch Changes
|
|
128
134
|
|
|
129
|
-
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
`NextEditorPlugin`.
|
|
135
|
+
- [#39010](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/39010)
|
|
136
|
+
[`8467bdcdf4f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8467bdcdf4f) - Removing
|
|
137
|
+
`dependencies` prop from PluginInjectionAPI and changing signature of `NextEditorPlugin`.
|
|
133
138
|
|
|
134
|
-
|
|
139
|
+
Previously a `NextEditorPlugin` would be consumed as so:
|
|
135
140
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
141
|
+
```ts
|
|
142
|
+
const plugin: NextEditorPlugin< ... > = (config, api) => {
|
|
143
|
+
// Can use api like so:
|
|
144
|
+
api.dependencies.core.actions.execute( ... )
|
|
145
|
+
return { ... }
|
|
146
|
+
}
|
|
147
|
+
```
|
|
143
148
|
|
|
144
|
-
|
|
145
|
-
|
|
149
|
+
Now these have become named parameters like so and the `pluginInjectionAPI` is used without the
|
|
150
|
+
`dependencies` prop:
|
|
146
151
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
152
|
+
```ts
|
|
153
|
+
const plugin: NextEditorPlugin< ... > = ({ config, api }) => {
|
|
154
|
+
// Can use api like so:
|
|
155
|
+
api.core.actions.execute( ... )
|
|
156
|
+
return { ... }
|
|
157
|
+
}
|
|
158
|
+
```
|
|
154
159
|
|
|
155
|
-
-
|
|
160
|
+
- Updated dependencies
|
|
156
161
|
|
|
157
162
|
## 0.1.6
|
|
158
163
|
|
|
159
164
|
### Patch Changes
|
|
160
165
|
|
|
161
|
-
-
|
|
162
|
-
|
|
163
|
-
|
|
166
|
+
- [#39177](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/39177)
|
|
167
|
+
[`24e27147cbd`](https://bitbucket.org/atlassian/atlassian-frontend/commits/24e27147cbd) - Added
|
|
168
|
+
atlaskit docs to all existing plugins.
|
|
164
169
|
|
|
165
170
|
## 0.1.5
|
|
166
171
|
|
|
167
172
|
### Patch Changes
|
|
168
173
|
|
|
169
|
-
-
|
|
174
|
+
- Updated dependencies
|
|
170
175
|
|
|
171
176
|
## 0.1.4
|
|
172
177
|
|
|
173
178
|
### Patch Changes
|
|
174
179
|
|
|
175
|
-
-
|
|
176
|
-
|
|
177
|
-
|
|
180
|
+
- [#37785](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/37785)
|
|
181
|
+
[`4e6f1bf8511`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4e6f1bf8511) -
|
|
182
|
+
[ED-19233] Import prosemirror libraries from internal facade package
|
|
178
183
|
|
|
179
184
|
## 0.1.3
|
|
180
185
|
|
|
181
186
|
### Patch Changes
|
|
182
187
|
|
|
183
|
-
-
|
|
184
|
-
|
|
185
|
-
|
|
188
|
+
- [#36241](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/36241)
|
|
189
|
+
[`5f5ba16de66`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5f5ba16de66) -
|
|
190
|
+
[ED-13910] Fix prosemirror types
|
|
186
191
|
|
|
187
192
|
## 0.1.2
|
|
188
193
|
|
|
189
194
|
### Patch Changes
|
|
190
195
|
|
|
191
|
-
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
-
|
|
196
|
+
- [#35782](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/35782)
|
|
197
|
+
[`73b5128036b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/73b5128036b) -
|
|
198
|
+
[ED-17082] Mark package as a singleton one
|
|
199
|
+
- Updated dependencies
|
|
195
200
|
|
|
196
201
|
## 0.1.1
|
|
197
202
|
|
|
198
203
|
### Patch Changes
|
|
199
204
|
|
|
200
|
-
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
- Updated dependencies
|
|
205
|
+
- [#34938](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/34938)
|
|
206
|
+
[`7cd4abcdc0d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7cd4abcdc0d) - Fix
|
|
207
|
+
workaround in `editor-plugin-width`. This involved removing `WidthEmitter` in `editor-core`,
|
|
208
|
+
removing `containerWidth` from `WidthPluginState`. This change also introduces `usePluginHook` for
|
|
209
|
+
an `EditorPlugin` - this enables a react hook to be mounted for plugins (in all appearances).
|
|
210
|
+
- Updated dependencies
|
package/LICENSE.md
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
Copyright 2023 Atlassian Pty Ltd
|
|
2
2
|
|
|
3
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
|
|
5
|
-
You may obtain a copy of the License at
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
|
|
4
|
+
compliance with the License. You may obtain a copy of the License at
|
|
6
5
|
|
|
7
6
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
8
7
|
|
|
9
|
-
Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
distributed
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
limitations under the License.
|
|
8
|
+
Unless required by applicable law or agreed to in writing, software distributed under the License is
|
|
9
|
+
distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
10
|
+
implied. See the License for the specific language governing permissions and limitations under the
|
|
11
|
+
License.
|
package/dist/cjs/plugin.js
CHANGED
|
@@ -49,16 +49,23 @@ var gutterGridLines = function gutterGridLines(editorMaxWidth, editorWidth, high
|
|
|
49
49
|
var wideSpacing = (editorMaxWidth * _editorSharedStyles.breakoutWideScaleRatio - editorMaxWidth) / 2;
|
|
50
50
|
sides.forEach(function (side) {
|
|
51
51
|
gridLines.push( /*#__PURE__*/_react.default.createElement("div", {
|
|
52
|
-
key: side
|
|
53
|
-
|
|
52
|
+
key: side
|
|
53
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
54
|
+
,
|
|
55
|
+
className: (0, _classnames.default)('gridLine', overflowHighlight(highlights, side, 0, 4) ? 'highlight' : '')
|
|
56
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
57
|
+
,
|
|
54
58
|
style: (0, _defineProperty2.default)({
|
|
55
59
|
position: 'absolute'
|
|
56
60
|
}, side, "-".concat(wideSpacing, "px"))
|
|
57
61
|
}));
|
|
58
62
|
gridLines.push( /*#__PURE__*/_react.default.createElement("div", {
|
|
59
|
-
key: side + '-bk'
|
|
63
|
+
key: side + '-bk'
|
|
64
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
65
|
+
,
|
|
60
66
|
className: (0, _classnames.default)('gridLine', highlights.indexOf('full-width') > -1 ? 'highlight' : ''),
|
|
61
67
|
style: (0, _defineProperty2.default)({
|
|
68
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
62
69
|
position: 'absolute'
|
|
63
70
|
}, side, "-".concat((editorWidth - editorMaxWidth - _editorSharedStyles.akEditorBreakoutPadding) / 2, "px"))
|
|
64
71
|
}));
|
|
@@ -73,8 +80,12 @@ var lineLengthGridLines = function lineLengthGridLines(highlights) {
|
|
|
73
80
|
paddingLeft: "".concat(gridSpacing, "%")
|
|
74
81
|
};
|
|
75
82
|
gridLines.push( /*#__PURE__*/_react.default.createElement("div", {
|
|
76
|
-
key: i
|
|
77
|
-
|
|
83
|
+
key: i
|
|
84
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
85
|
+
,
|
|
86
|
+
className: (0, _classnames.default)('gridLine', highlights.indexOf(i) > -1 ? 'highlight' : '')
|
|
87
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
88
|
+
,
|
|
78
89
|
style: i < GRID_SIZE ? style : undefined
|
|
79
90
|
}));
|
|
80
91
|
}
|
|
@@ -90,16 +101,21 @@ var Grid = function Grid(_ref3) {
|
|
|
90
101
|
visible = _ref3.visible;
|
|
91
102
|
var editorMaxWidth = theme.layoutMaxWidth;
|
|
92
103
|
var gridLines = [].concat((0, _toConsumableArray2.default)(lineLengthGridLines(highlight)), (0, _toConsumableArray2.default)(gutterGridLines(editorMaxWidth, editorWidth, highlight, shouldCalcBreakoutGridLines)));
|
|
93
|
-
return
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
104
|
+
return (
|
|
105
|
+
/*#__PURE__*/
|
|
106
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
107
|
+
_react.default.createElement("div", {
|
|
108
|
+
className: "gridParent"
|
|
109
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
110
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
111
|
+
className: (0, _classnames.default)('gridContainer', gridType),
|
|
112
|
+
style: {
|
|
113
|
+
height: "".concat(containerElement.scrollHeight, "px"),
|
|
114
|
+
display: visible ? 'block' : 'none'
|
|
115
|
+
},
|
|
116
|
+
"data-testid": "gridContainer"
|
|
117
|
+
}, gridLines))
|
|
118
|
+
);
|
|
103
119
|
};
|
|
104
120
|
var ThemedGrid = (0, _react2.withTheme)(Grid);
|
|
105
121
|
var ContentComponent = function ContentComponent(_ref4) {
|
package/dist/es2019/plugin.js
CHANGED
|
@@ -38,17 +38,24 @@ const gutterGridLines = (editorMaxWidth, editorWidth, highlights, shouldCalcBrea
|
|
|
38
38
|
const wideSpacing = (editorMaxWidth * breakoutWideScaleRatio - editorMaxWidth) / 2;
|
|
39
39
|
sides.forEach(side => {
|
|
40
40
|
gridLines.push( /*#__PURE__*/React.createElement("div", {
|
|
41
|
-
key: side
|
|
42
|
-
|
|
41
|
+
key: side
|
|
42
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
43
|
+
,
|
|
44
|
+
className: classnames('gridLine', overflowHighlight(highlights, side, 0, 4) ? 'highlight' : '')
|
|
45
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
46
|
+
,
|
|
43
47
|
style: {
|
|
44
48
|
position: 'absolute',
|
|
45
49
|
[side]: `-${wideSpacing}px`
|
|
46
50
|
}
|
|
47
51
|
}));
|
|
48
52
|
gridLines.push( /*#__PURE__*/React.createElement("div", {
|
|
49
|
-
key: side + '-bk'
|
|
53
|
+
key: side + '-bk'
|
|
54
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
55
|
+
,
|
|
50
56
|
className: classnames('gridLine', highlights.indexOf('full-width') > -1 ? 'highlight' : ''),
|
|
51
57
|
style: {
|
|
58
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
52
59
|
position: 'absolute',
|
|
53
60
|
[side]: `-${(editorWidth - editorMaxWidth - akEditorBreakoutPadding) / 2}px`
|
|
54
61
|
}
|
|
@@ -64,8 +71,12 @@ const lineLengthGridLines = highlights => {
|
|
|
64
71
|
paddingLeft: `${gridSpacing}%`
|
|
65
72
|
};
|
|
66
73
|
gridLines.push( /*#__PURE__*/React.createElement("div", {
|
|
67
|
-
key: i
|
|
68
|
-
|
|
74
|
+
key: i
|
|
75
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
76
|
+
,
|
|
77
|
+
className: classnames('gridLine', highlights.indexOf(i) > -1 ? 'highlight' : '')
|
|
78
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
79
|
+
,
|
|
69
80
|
style: i < GRID_SIZE ? style : undefined
|
|
70
81
|
}));
|
|
71
82
|
}
|
|
@@ -82,16 +93,21 @@ const Grid = ({
|
|
|
82
93
|
}) => {
|
|
83
94
|
const editorMaxWidth = theme.layoutMaxWidth;
|
|
84
95
|
let gridLines = [...lineLengthGridLines(highlight), ...gutterGridLines(editorMaxWidth, editorWidth, highlight, shouldCalcBreakoutGridLines)];
|
|
85
|
-
return
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
96
|
+
return (
|
|
97
|
+
/*#__PURE__*/
|
|
98
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
99
|
+
React.createElement("div", {
|
|
100
|
+
className: "gridParent"
|
|
101
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
102
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
103
|
+
className: classnames('gridContainer', gridType),
|
|
104
|
+
style: {
|
|
105
|
+
height: `${containerElement.scrollHeight}px`,
|
|
106
|
+
display: visible ? 'block' : 'none'
|
|
107
|
+
},
|
|
108
|
+
"data-testid": "gridContainer"
|
|
109
|
+
}, gridLines))
|
|
110
|
+
);
|
|
95
111
|
};
|
|
96
112
|
const ThemedGrid = withTheme(Grid);
|
|
97
113
|
const ContentComponent = ({
|
package/dist/esm/plugin.js
CHANGED
|
@@ -42,16 +42,23 @@ var gutterGridLines = function gutterGridLines(editorMaxWidth, editorWidth, high
|
|
|
42
42
|
var wideSpacing = (editorMaxWidth * breakoutWideScaleRatio - editorMaxWidth) / 2;
|
|
43
43
|
sides.forEach(function (side) {
|
|
44
44
|
gridLines.push( /*#__PURE__*/React.createElement("div", {
|
|
45
|
-
key: side
|
|
46
|
-
|
|
45
|
+
key: side
|
|
46
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
47
|
+
,
|
|
48
|
+
className: classnames('gridLine', overflowHighlight(highlights, side, 0, 4) ? 'highlight' : '')
|
|
49
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
50
|
+
,
|
|
47
51
|
style: _defineProperty({
|
|
48
52
|
position: 'absolute'
|
|
49
53
|
}, side, "-".concat(wideSpacing, "px"))
|
|
50
54
|
}));
|
|
51
55
|
gridLines.push( /*#__PURE__*/React.createElement("div", {
|
|
52
|
-
key: side + '-bk'
|
|
56
|
+
key: side + '-bk'
|
|
57
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
58
|
+
,
|
|
53
59
|
className: classnames('gridLine', highlights.indexOf('full-width') > -1 ? 'highlight' : ''),
|
|
54
60
|
style: _defineProperty({
|
|
61
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
55
62
|
position: 'absolute'
|
|
56
63
|
}, side, "-".concat((editorWidth - editorMaxWidth - akEditorBreakoutPadding) / 2, "px"))
|
|
57
64
|
}));
|
|
@@ -66,8 +73,12 @@ var lineLengthGridLines = function lineLengthGridLines(highlights) {
|
|
|
66
73
|
paddingLeft: "".concat(gridSpacing, "%")
|
|
67
74
|
};
|
|
68
75
|
gridLines.push( /*#__PURE__*/React.createElement("div", {
|
|
69
|
-
key: i
|
|
70
|
-
|
|
76
|
+
key: i
|
|
77
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
78
|
+
,
|
|
79
|
+
className: classnames('gridLine', highlights.indexOf(i) > -1 ? 'highlight' : '')
|
|
80
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
81
|
+
,
|
|
71
82
|
style: i < GRID_SIZE ? style : undefined
|
|
72
83
|
}));
|
|
73
84
|
}
|
|
@@ -83,16 +94,21 @@ var Grid = function Grid(_ref3) {
|
|
|
83
94
|
visible = _ref3.visible;
|
|
84
95
|
var editorMaxWidth = theme.layoutMaxWidth;
|
|
85
96
|
var gridLines = [].concat(_toConsumableArray(lineLengthGridLines(highlight)), _toConsumableArray(gutterGridLines(editorMaxWidth, editorWidth, highlight, shouldCalcBreakoutGridLines)));
|
|
86
|
-
return
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
97
|
+
return (
|
|
98
|
+
/*#__PURE__*/
|
|
99
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
100
|
+
React.createElement("div", {
|
|
101
|
+
className: "gridParent"
|
|
102
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
103
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
104
|
+
className: classnames('gridContainer', gridType),
|
|
105
|
+
style: {
|
|
106
|
+
height: "".concat(containerElement.scrollHeight, "px"),
|
|
107
|
+
display: visible ? 'block' : 'none'
|
|
108
|
+
},
|
|
109
|
+
"data-testid": "gridContainer"
|
|
110
|
+
}, gridLines))
|
|
111
|
+
);
|
|
96
112
|
};
|
|
97
113
|
var ThemedGrid = withTheme(Grid);
|
|
98
114
|
var ContentComponent = function ContentComponent(_ref4) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-grid",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"description": "Grid plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
".": "./src/index.ts"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@atlaskit/editor-common": "^
|
|
27
|
+
"@atlaskit/editor-common": "^82.0.0",
|
|
28
28
|
"@atlaskit/editor-plugin-width": "^1.1.0",
|
|
29
29
|
"@atlaskit/editor-prosemirror": "4.0.1",
|
|
30
|
-
"@atlaskit/editor-shared-styles": "^2.
|
|
30
|
+
"@atlaskit/editor-shared-styles": "^2.12.0",
|
|
31
31
|
"@babel/runtime": "^7.0.0",
|
|
32
32
|
"@emotion/react": "^11.7.1",
|
|
33
33
|
"classnames": "^2.2.5"
|
|
@@ -36,7 +36,6 @@
|
|
|
36
36
|
"react": "^16.8.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
|
|
40
39
|
"@testing-library/react": "^12.1.5",
|
|
41
40
|
"react-dom": "^16.8.0",
|
|
42
41
|
"typescript": "~5.4.2",
|
|
@@ -71,6 +70,5 @@
|
|
|
71
70
|
"emotion"
|
|
72
71
|
]
|
|
73
72
|
}
|
|
74
|
-
}
|
|
75
|
-
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0"
|
|
73
|
+
}
|
|
76
74
|
}
|
package/report.api.md
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
## API Report File for "@atlaskit/editor-plugin-grid"
|
|
4
4
|
|
|
5
|
-
> Do not edit this file. This report is auto-generated using
|
|
5
|
+
> Do not edit this file. This report is auto-generated using
|
|
6
|
+
> [API Extractor](https://api-extractor.com/).
|
|
6
7
|
> [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
|
|
7
8
|
|
|
8
9
|
### Table of contents
|
|
@@ -28,15 +29,15 @@ type DisplayGrid = (props: Required_2<GridPluginState>) => boolean;
|
|
|
28
29
|
|
|
29
30
|
// @public (undocumented)
|
|
30
31
|
export type GridPlugin = NextEditorPlugin<
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
'grid',
|
|
33
|
+
{
|
|
34
|
+
pluginConfiguration: GridPluginOptions | undefined;
|
|
35
|
+
dependencies: [WidthPlugin];
|
|
36
|
+
sharedState: GridPluginState | null;
|
|
37
|
+
actions: {
|
|
38
|
+
displayGrid: CreateDisplayGrid;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
40
41
|
>;
|
|
41
42
|
|
|
42
43
|
// @public
|
|
@@ -44,15 +45,15 @@ export const gridPlugin: GridPlugin;
|
|
|
44
45
|
|
|
45
46
|
// @public (undocumented)
|
|
46
47
|
export interface GridPluginOptions {
|
|
47
|
-
|
|
48
|
-
|
|
48
|
+
// (undocumented)
|
|
49
|
+
shouldCalcBreakoutGridLines?: boolean;
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
// @public (undocumented)
|
|
52
53
|
export type GridPluginState = {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
visible: boolean;
|
|
55
|
+
gridType?: GridType;
|
|
56
|
+
highlight: Highlights;
|
|
56
57
|
};
|
|
57
58
|
|
|
58
59
|
// @public (undocumented)
|
|
@@ -60,7 +61,7 @@ export type Highlights = Array<'full-width' | 'wide' | number>;
|
|
|
60
61
|
|
|
61
62
|
// @public (undocumented)
|
|
62
63
|
type Required_2<T> = {
|
|
63
|
-
|
|
64
|
+
[P in keyof T]-?: T[P];
|
|
64
65
|
};
|
|
65
66
|
|
|
66
67
|
// (No @packageDocumentation comment for this package)
|
|
@@ -74,7 +75,7 @@ type Required_2<T> = {
|
|
|
74
75
|
|
|
75
76
|
```json
|
|
76
77
|
{
|
|
77
|
-
|
|
78
|
+
"react": "^16.8.0"
|
|
78
79
|
}
|
|
79
80
|
```
|
|
80
81
|
|