@atlaskit/editor-plugin-grid 26.0.4 → 26.0.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
CHANGED
package/dist/cjs/gridPlugin.js
CHANGED
|
@@ -9,11 +9,11 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
9
9
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
12
|
-
var
|
|
13
|
-
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
12
|
+
var _isSsr = require("@atlaskit/editor-common/is-ssr");
|
|
14
13
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
14
|
+
var _useSharedPluginStateWithSelector = require("@atlaskit/editor-common/useSharedPluginStateWithSelector");
|
|
15
15
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
16
|
-
var
|
|
16
|
+
var _constants = require("@atlaskit/editor-shared-styles/constants");
|
|
17
17
|
var GRID_SIZE = exports.GRID_SIZE = 12;
|
|
18
18
|
// Matches the existing `.gridParent` 12px left + 12px right gutter expansion.
|
|
19
19
|
var GRID_GUTTER_WIDTH = 24;
|
|
@@ -48,7 +48,7 @@ var gutterGridLines = function gutterGridLines(editorMaxWidth, editorWidth, high
|
|
|
48
48
|
if (!shouldCalcBreakoutGridLines) {
|
|
49
49
|
return gridLines;
|
|
50
50
|
}
|
|
51
|
-
var wideSpacing = (editorMaxWidth *
|
|
51
|
+
var wideSpacing = (editorMaxWidth * _constants.breakoutWideScaleRatio - editorMaxWidth) / 2;
|
|
52
52
|
sides.forEach(function (side) {
|
|
53
53
|
gridLines.push( /*#__PURE__*/_react.default.createElement("div", {
|
|
54
54
|
key: side
|
|
@@ -69,7 +69,7 @@ var gutterGridLines = function gutterGridLines(editorMaxWidth, editorWidth, high
|
|
|
69
69
|
style: (0, _defineProperty2.default)({
|
|
70
70
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
71
71
|
position: 'absolute'
|
|
72
|
-
}, side, "-".concat((editorWidth - editorMaxWidth -
|
|
72
|
+
}, side, "-".concat((editorWidth - editorMaxWidth - _constants.akEditorBreakoutPadding) / 2, "px"))
|
|
73
73
|
}));
|
|
74
74
|
});
|
|
75
75
|
return gridLines;
|
|
@@ -101,7 +101,7 @@ var GridNext = function GridNext(_ref3) {
|
|
|
101
101
|
gridType = _ref3.gridType,
|
|
102
102
|
overlayWidth = _ref3.overlayWidth,
|
|
103
103
|
visible = _ref3.visible;
|
|
104
|
-
var editorMaxWidth =
|
|
104
|
+
var editorMaxWidth = _constants.akEditorDefaultLayoutWidth;
|
|
105
105
|
var gridLines = [].concat((0, _toConsumableArray2.default)(lineLengthGridLines(highlight)), (0, _toConsumableArray2.default)(gutterGridLines(editorMaxWidth, editorWidth, highlight, shouldCalcBreakoutGridLines)));
|
|
106
106
|
return (
|
|
107
107
|
/*#__PURE__*/
|
|
@@ -134,19 +134,19 @@ var ContentComponent = function ContentComponent(_ref4) {
|
|
|
134
134
|
var api = _ref4.api,
|
|
135
135
|
editorView = _ref4.editorView,
|
|
136
136
|
options = _ref4.options;
|
|
137
|
-
var _useSharedPluginState = (0,
|
|
137
|
+
var _useSharedPluginState = (0, _useSharedPluginStateWithSelector.useSharedPluginStateWithSelector)(api, ['width', 'grid'], selector),
|
|
138
138
|
lineLength = _useSharedPluginState.lineLength,
|
|
139
139
|
width = _useSharedPluginState.width,
|
|
140
140
|
visible = _useSharedPluginState.visible,
|
|
141
141
|
gridType = _useSharedPluginState.gridType,
|
|
142
142
|
highlight = _useSharedPluginState.highlight;
|
|
143
|
-
var overlayWidth = (lineLength || width ||
|
|
143
|
+
var overlayWidth = (lineLength || width || _constants.akEditorFullPageMaxWidth) + GRID_GUTTER_WIDTH;
|
|
144
144
|
if (!visible || !highlight) {
|
|
145
145
|
return null;
|
|
146
146
|
}
|
|
147
147
|
return /*#__PURE__*/_react.default.createElement(GridNext, {
|
|
148
148
|
shouldCalcBreakoutGridLines: options && options.shouldCalcBreakoutGridLines,
|
|
149
|
-
editorWidth: width !== null && width !== void 0 ? width :
|
|
149
|
+
editorWidth: width !== null && width !== void 0 ? width : _constants.akEditorFullPageMaxWidth
|
|
150
150
|
// Ignored via go/ees005
|
|
151
151
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
152
152
|
,
|
|
@@ -205,7 +205,7 @@ var gridPlugin = exports.gridPlugin = function gridPlugin(_ref5) {
|
|
|
205
205
|
},
|
|
206
206
|
contentComponent: function contentComponent(_ref6) {
|
|
207
207
|
var editorView = _ref6.editorView;
|
|
208
|
-
if (!editorView || (0,
|
|
208
|
+
if (!editorView || (0, _isSsr.isSSR)()) {
|
|
209
209
|
return null;
|
|
210
210
|
}
|
|
211
211
|
return /*#__PURE__*/_react.default.createElement(ContentComponent, {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
|
-
import { isSSR } from '@atlaskit/editor-common/
|
|
4
|
-
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
3
|
+
import { isSSR } from '@atlaskit/editor-common/is-ssr';
|
|
5
4
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
5
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSharedPluginStateWithSelector';
|
|
6
6
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
7
|
-
import { akEditorBreakoutPadding, akEditorDefaultLayoutWidth, akEditorFullPageMaxWidth, breakoutWideScaleRatio } from '@atlaskit/editor-shared-styles';
|
|
7
|
+
import { akEditorBreakoutPadding, akEditorDefaultLayoutWidth, akEditorFullPageMaxWidth, breakoutWideScaleRatio } from '@atlaskit/editor-shared-styles/constants';
|
|
8
8
|
export const GRID_SIZE = 12;
|
|
9
9
|
// Matches the existing `.gridParent` 12px left + 12px right gutter expansion.
|
|
10
10
|
const GRID_GUTTER_WIDTH = 24;
|
package/dist/esm/gridPlugin.js
CHANGED
|
@@ -2,11 +2,11 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import classnames from 'classnames';
|
|
5
|
-
import { isSSR } from '@atlaskit/editor-common/
|
|
6
|
-
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
5
|
+
import { isSSR } from '@atlaskit/editor-common/is-ssr';
|
|
7
6
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
7
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSharedPluginStateWithSelector';
|
|
8
8
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
9
|
-
import { akEditorBreakoutPadding, akEditorDefaultLayoutWidth, akEditorFullPageMaxWidth, breakoutWideScaleRatio } from '@atlaskit/editor-shared-styles';
|
|
9
|
+
import { akEditorBreakoutPadding, akEditorDefaultLayoutWidth, akEditorFullPageMaxWidth, breakoutWideScaleRatio } from '@atlaskit/editor-shared-styles/constants';
|
|
10
10
|
export var GRID_SIZE = 12;
|
|
11
11
|
// Matches the existing `.gridParent` 12px left + 12px right gutter expansion.
|
|
12
12
|
var GRID_GUTTER_WIDTH = 24;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
2
|
-
import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
|
|
1
|
+
import type { NextEditorPlugin } from '@atlaskit/editor-common/types/next-editor-plugin';
|
|
2
|
+
import type { WidthPlugin } from '@atlaskit/editor-plugin-width/width-plugin-type';
|
|
3
3
|
import type { CreateDisplayGrid, GridPluginOptions, GridPluginState } from './types';
|
|
4
4
|
export type GridPluginConfiguration = GridPluginOptions | undefined;
|
|
5
5
|
export type GridPluginDependencies = [WidthPlugin];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GridType } from '@atlaskit/editor-common/types';
|
|
1
|
+
import type { GridType } from '@atlaskit/editor-common/types/grid';
|
|
2
2
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
export type Highlights = Array<'wide' | 'full-width' | number>;
|
|
4
4
|
export type GridPluginState = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-grid",
|
|
3
|
-
"version": "26.0.
|
|
3
|
+
"version": "26.0.5",
|
|
4
4
|
"description": "Grid plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"@atlaskit/editor-prosemirror": "^9.0.0",
|
|
26
26
|
"@atlaskit/editor-shared-styles": "^4.4.0",
|
|
27
27
|
"@atlaskit/platform-feature-flags-react": "^1.2.0",
|
|
28
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
28
|
+
"@atlaskit/tmp-editor-statsig": "^232.0.0",
|
|
29
29
|
"@babel/runtime": "^7.0.0",
|
|
30
30
|
"@emotion/react": "^11.7.1",
|
|
31
31
|
"classnames": "^2.2.5"
|