@atlaskit/editor-plugin-grid 1.1.3 → 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 +90 -80
- 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,200 +1,210 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-grid
|
|
2
2
|
|
|
3
|
+
## 1.1.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 1.1.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 1.1.3
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
6
18
|
|
|
7
|
-
-
|
|
19
|
+
- Updated dependencies
|
|
8
20
|
|
|
9
21
|
## 1.1.2
|
|
10
22
|
|
|
11
23
|
### Patch Changes
|
|
12
24
|
|
|
13
|
-
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
|
18
30
|
|
|
19
31
|
## 1.1.1
|
|
20
32
|
|
|
21
33
|
### Patch Changes
|
|
22
34
|
|
|
23
|
-
-
|
|
35
|
+
- Updated dependencies
|
|
24
36
|
|
|
25
37
|
## 1.1.0
|
|
26
38
|
|
|
27
39
|
### Minor Changes
|
|
28
40
|
|
|
29
|
-
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
|
32
44
|
|
|
33
45
|
### Patch Changes
|
|
34
46
|
|
|
35
|
-
-
|
|
47
|
+
- Updated dependencies
|
|
36
48
|
|
|
37
49
|
## 1.0.3
|
|
38
50
|
|
|
39
51
|
### Patch Changes
|
|
40
52
|
|
|
41
|
-
-
|
|
42
|
-
|
|
43
|
-
|
|
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`
|
|
44
56
|
|
|
45
57
|
## 1.0.2
|
|
46
58
|
|
|
47
59
|
### Patch Changes
|
|
48
60
|
|
|
49
|
-
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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
|
|
53
65
|
|
|
54
66
|
## 1.0.1
|
|
55
67
|
|
|
56
68
|
### Patch Changes
|
|
57
69
|
|
|
58
|
-
-
|
|
70
|
+
- Updated dependencies
|
|
59
71
|
|
|
60
72
|
## 1.0.0
|
|
61
73
|
|
|
62
74
|
### Major Changes
|
|
63
75
|
|
|
64
|
-
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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.
|
|
68
80
|
|
|
69
81
|
### Patch Changes
|
|
70
82
|
|
|
71
|
-
-
|
|
83
|
+
- Updated dependencies
|
|
72
84
|
|
|
73
85
|
## 0.3.2
|
|
74
86
|
|
|
75
87
|
### Patch Changes
|
|
76
88
|
|
|
77
|
-
-
|
|
78
|
-
|
|
79
|
-
|
|
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
|
|
80
92
|
|
|
81
93
|
## 0.3.1
|
|
82
94
|
|
|
83
95
|
### Patch Changes
|
|
84
96
|
|
|
85
|
-
-
|
|
97
|
+
- Updated dependencies
|
|
86
98
|
|
|
87
99
|
## 0.3.0
|
|
88
100
|
|
|
89
101
|
### Minor Changes
|
|
90
102
|
|
|
91
|
-
-
|
|
92
|
-
|
|
93
|
-
|
|
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.
|
|
94
106
|
|
|
95
107
|
## 0.2.2
|
|
96
108
|
|
|
97
109
|
### Patch Changes
|
|
98
110
|
|
|
99
|
-
-
|
|
111
|
+
- Updated dependencies
|
|
100
112
|
|
|
101
113
|
## 0.2.1
|
|
102
114
|
|
|
103
115
|
### Patch Changes
|
|
104
116
|
|
|
105
|
-
-
|
|
117
|
+
- Updated dependencies
|
|
106
118
|
|
|
107
119
|
## 0.2.0
|
|
108
120
|
|
|
109
121
|
### Minor Changes
|
|
110
122
|
|
|
111
|
-
-
|
|
112
|
-
|
|
113
|
-
|
|
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.
|
|
114
126
|
|
|
115
127
|
### Patch Changes
|
|
116
128
|
|
|
117
|
-
-
|
|
129
|
+
- Updated dependencies
|
|
118
130
|
|
|
119
131
|
## 0.1.7
|
|
120
132
|
|
|
121
133
|
### Patch Changes
|
|
122
134
|
|
|
123
|
-
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
`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`.
|
|
127
138
|
|
|
128
|
-
|
|
139
|
+
Previously a `NextEditorPlugin` would be consumed as so:
|
|
129
140
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
141
|
+
```ts
|
|
142
|
+
const plugin: NextEditorPlugin< ... > = (config, api) => {
|
|
143
|
+
// Can use api like so:
|
|
144
|
+
api.dependencies.core.actions.execute( ... )
|
|
145
|
+
return { ... }
|
|
146
|
+
}
|
|
147
|
+
```
|
|
137
148
|
|
|
138
|
-
|
|
139
|
-
|
|
149
|
+
Now these have become named parameters like so and the `pluginInjectionAPI` is used without the
|
|
150
|
+
`dependencies` prop:
|
|
140
151
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
152
|
+
```ts
|
|
153
|
+
const plugin: NextEditorPlugin< ... > = ({ config, api }) => {
|
|
154
|
+
// Can use api like so:
|
|
155
|
+
api.core.actions.execute( ... )
|
|
156
|
+
return { ... }
|
|
157
|
+
}
|
|
158
|
+
```
|
|
148
159
|
|
|
149
|
-
-
|
|
160
|
+
- Updated dependencies
|
|
150
161
|
|
|
151
162
|
## 0.1.6
|
|
152
163
|
|
|
153
164
|
### Patch Changes
|
|
154
165
|
|
|
155
|
-
-
|
|
156
|
-
|
|
157
|
-
|
|
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.
|
|
158
169
|
|
|
159
170
|
## 0.1.5
|
|
160
171
|
|
|
161
172
|
### Patch Changes
|
|
162
173
|
|
|
163
|
-
-
|
|
174
|
+
- Updated dependencies
|
|
164
175
|
|
|
165
176
|
## 0.1.4
|
|
166
177
|
|
|
167
178
|
### Patch Changes
|
|
168
179
|
|
|
169
|
-
-
|
|
170
|
-
|
|
171
|
-
|
|
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
|
|
172
183
|
|
|
173
184
|
## 0.1.3
|
|
174
185
|
|
|
175
186
|
### Patch Changes
|
|
176
187
|
|
|
177
|
-
-
|
|
178
|
-
|
|
179
|
-
|
|
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
|
|
180
191
|
|
|
181
192
|
## 0.1.2
|
|
182
193
|
|
|
183
194
|
### Patch Changes
|
|
184
195
|
|
|
185
|
-
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
-
|
|
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
|
|
189
200
|
|
|
190
201
|
## 0.1.1
|
|
191
202
|
|
|
192
203
|
### Patch Changes
|
|
193
204
|
|
|
194
|
-
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
- 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
|
|