@atlaskit/editor-plugin-guideline 0.5.2 → 0.5.3

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
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/editor-plugin-guideline
2
2
 
3
+ ## 0.5.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
3
9
  ## 0.5.2
4
10
 
5
11
  ### Patch Changes
@@ -16,7 +22,7 @@
16
22
 
17
23
  ### Minor Changes
18
24
 
19
- - [`ad3c5c21079`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ad3c5c21079) - Updating all plugins with minor version to correct issue with semver.
25
+ - [#39325](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/39325) [`ad3c5c21079`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ad3c5c21079) - Updating all plugins with minor version to correct issue with semver.
20
26
 
21
27
  ### Patch Changes
22
28
 
@@ -26,7 +32,7 @@
26
32
 
27
33
  ### Patch Changes
28
34
 
29
- - [`8467bdcdf4f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8467bdcdf4f) - Removing `dependencies` prop from PluginInjectionAPI and changing
35
+ - [#39010](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/39010) [`8467bdcdf4f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8467bdcdf4f) - Removing `dependencies` prop from PluginInjectionAPI and changing
30
36
  signature of `NextEditorPlugin`.
31
37
 
32
38
  Previously a `NextEditorPlugin` would be consumed as so:
@@ -56,13 +62,13 @@
56
62
 
57
63
  ### Patch Changes
58
64
 
59
- - [`24e27147cbd`](https://bitbucket.org/atlassian/atlassian-frontend/commits/24e27147cbd) - Added atlaskit docs to all existing plugins.
65
+ - [#39177](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/39177) [`24e27147cbd`](https://bitbucket.org/atlassian/atlassian-frontend/commits/24e27147cbd) - Added atlaskit docs to all existing plugins.
60
66
 
61
67
  ## 0.4.0
62
68
 
63
69
  ### Minor Changes
64
70
 
65
- - [`7f45581d141`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7f45581d141) - ED-19630 fixed guideline alignment issue.
71
+ - [#38980](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/38980) [`7f45581d141`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7f45581d141) - ED-19630 fixed guideline alignment issue.
66
72
 
67
73
  ### Patch Changes
68
74
 
@@ -72,7 +78,7 @@
72
78
 
73
79
  ### Patch Changes
74
80
 
75
- - [`51e6a0128eb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/51e6a0128eb) - ED-18969 Implemented relative guideline
81
+ - [#38672](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/38672) [`51e6a0128eb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/51e6a0128eb) - ED-18969 Implemented relative guideline
76
82
 
77
83
  ## 0.3.12
78
84
 
@@ -84,78 +90,78 @@
84
90
 
85
91
  ### Patch Changes
86
92
 
87
- - [`c46821ab461`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c46821ab461) - Update guideline colour to color.border.disabled to provide more contrast against table borders
93
+ - [#38341](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/38341) [`c46821ab461`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c46821ab461) - Update guideline colour to color.border.disabled to provide more contrast against table borders
88
94
  - Updated dependencies
89
95
 
90
96
  ## 0.3.10
91
97
 
92
98
  ### Patch Changes
93
99
 
94
- - [`8b9fec4c803`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8b9fec4c803) - [ux] improve guidelines styles left position
100
+ - [#38130](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/38130) [`8b9fec4c803`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8b9fec4c803) - [ux] improve guidelines styles left position
95
101
  - Updated dependencies
96
102
 
97
103
  ## 0.3.9
98
104
 
99
105
  ### Patch Changes
100
106
 
101
- - [`75fe8860154`](https://bitbucket.org/atlassian/atlassian-frontend/commits/75fe8860154) - Update styles of guidelines so they align correctly
107
+ - [#38063](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/38063) [`75fe8860154`](https://bitbucket.org/atlassian/atlassian-frontend/commits/75fe8860154) - Update styles of guidelines so they align correctly
102
108
 
103
109
  ## 0.3.8
104
110
 
105
111
  ### Patch Changes
106
112
 
107
- - [`936c30f8dc9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/936c30f8dc9) - support new image resize experience under feature flag
113
+ - [#32787](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/32787) [`936c30f8dc9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/936c30f8dc9) - support new image resize experience under feature flag
108
114
  - Updated dependencies
109
115
 
110
116
  ## 0.3.7
111
117
 
112
118
  ### Patch Changes
113
119
 
114
- - [`4e6f1bf8511`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4e6f1bf8511) - [ED-19233] Import prosemirror libraries from internal facade package
120
+ - [#37785](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/37785) [`4e6f1bf8511`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4e6f1bf8511) - [ED-19233] Import prosemirror libraries from internal facade package
115
121
 
116
122
  ## 0.3.6
117
123
 
118
124
  ### Patch Changes
119
125
 
120
- - [`3d065399b07`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3d065399b07) - ED-18969 refactor guideline plugin interface.
126
+ - [#37398](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/37398) [`3d065399b07`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3d065399b07) - ED-18969 refactor guideline plugin interface.
121
127
 
122
128
  ## 0.3.5
123
129
 
124
130
  ### Patch Changes
125
131
 
126
- - [`e8885f55db6`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e8885f55db6) - ED-18969 implement relative guides support
132
+ - [#37348](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/37348) [`e8885f55db6`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e8885f55db6) - ED-18969 implement relative guides support
127
133
 
128
134
  ## 0.3.4
129
135
 
130
136
  ### Patch Changes
131
137
 
132
- - [`5f5ba16de66`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5f5ba16de66) - [ED-13910] Fix prosemirror types
138
+ - [#36241](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/36241) [`5f5ba16de66`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5f5ba16de66) - [ED-13910] Fix prosemirror types
133
139
 
134
140
  ## 0.3.3
135
141
 
136
142
  ### Patch Changes
137
143
 
138
- - [`e118dc7562b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e118dc7562b) - ED-18897 guideline interface to use css tokens.
144
+ - [#36310](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/36310) [`e118dc7562b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e118dc7562b) - ED-18897 guideline interface to use css tokens.
139
145
 
140
146
  ## 0.3.2
141
147
 
142
148
  ### Patch Changes
143
149
 
144
- - [`73b5128036b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/73b5128036b) - [ED-17082] Mark package as a singleton one
150
+ - [#35782](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/35782) [`73b5128036b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/73b5128036b) - [ED-17082] Mark package as a singleton one
145
151
  - Updated dependencies
146
152
 
147
153
  ## 0.3.1
148
154
 
149
155
  ### Patch Changes
150
156
 
151
- - [`7cd4abcdc0d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7cd4abcdc0d) - Fix workaround in `editor-plugin-width`. This involved removing `WidthEmitter` in `editor-core`, removing `containerWidth` from `WidthPluginState`. This change also introduces `usePluginHook` for an `EditorPlugin` - this enables a react hook to be mounted for plugins (in all appearances).
157
+ - [#34938](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/34938) [`7cd4abcdc0d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7cd4abcdc0d) - Fix workaround in `editor-plugin-width`. This involved removing `WidthEmitter` in `editor-core`, removing `containerWidth` from `WidthPluginState`. This change also introduces `usePluginHook` for an `EditorPlugin` - this enables a react hook to be mounted for plugins (in all appearances).
152
158
  - Updated dependencies
153
159
 
154
160
  ## 0.3.0
155
161
 
156
162
  ### Minor Changes
157
163
 
158
- - [`d7aa08972c6`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d7aa08972c6) - add style handler for the editor guideline plugin
164
+ - [#34887](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/34887) [`d7aa08972c6`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d7aa08972c6) - add style handler for the editor guideline plugin
159
165
  - [`1dadcae5b09`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1dadcae5b09) - COLLAB-2623 Updated API to newest interface and added utils to create default gridlines
160
166
 
161
167
  ### Patch Changes
@@ -166,7 +172,7 @@
166
172
 
167
173
  ### Minor Changes
168
174
 
169
- - [`d8f19b90c43`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d8f19b90c43) - COLLAB-2622 Update editor-plugin-guideline to support position config.
175
+ - [#34644](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/34644) [`d8f19b90c43`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d8f19b90c43) - COLLAB-2622 Update editor-plugin-guideline to support position config.
170
176
 
171
177
  ### Patch Changes
172
178
 
@@ -4,7 +4,5 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.VAR_POSITION_OFFSET_Y = exports.VAR_POSITION_OFFSET_X = void 0;
7
- var VAR_POSITION_OFFSET_X = '--guideline-offset-x';
8
- exports.VAR_POSITION_OFFSET_X = VAR_POSITION_OFFSET_X;
9
- var VAR_POSITION_OFFSET_Y = '--guideline-offset-y';
10
- exports.VAR_POSITION_OFFSET_Y = VAR_POSITION_OFFSET_Y;
7
+ var VAR_POSITION_OFFSET_X = exports.VAR_POSITION_OFFSET_X = '--guideline-offset-x';
8
+ var VAR_POSITION_OFFSET_Y = exports.VAR_POSITION_OFFSET_Y = '--guideline-offset-y';
@@ -68,7 +68,7 @@ var horizontalCapStyles = (0, _react.css)({
68
68
  bottom: 0
69
69
  }
70
70
  });
71
- var Guideline = function Guideline(props) {
71
+ var Guideline = exports.Guideline = function Guideline(props) {
72
72
  var position = props.position,
73
73
  active = props.active,
74
74
  _props$show = props.show,
@@ -86,5 +86,4 @@ var Guideline = function Guideline(props) {
86
86
  }), (0, _positionStyles.getPositionStyles)(position)),
87
87
  className: "guideline"
88
88
  });
89
- };
90
- exports.Guideline = Guideline;
89
+ };
@@ -25,7 +25,7 @@ var guidelineContainerStyles = (0, _react2.css)({
25
25
  border: 'none',
26
26
  maxWidth: "".concat(_editorSharedStyles.akEditorFullWidthLayoutWidth, "px")
27
27
  });
28
- var GuidelineContainer = function GuidelineContainer(props) {
28
+ var GuidelineContainer = exports.GuidelineContainer = function GuidelineContainer(props) {
29
29
  var _style;
30
30
  var guidelines = props.guidelines,
31
31
  height = props.height,
@@ -37,7 +37,7 @@ var GuidelineContainer = function GuidelineContainer(props) {
37
37
  var ref = (0, _react.useRef)(null);
38
38
  (0, _react.useLayoutEffect)(function () {
39
39
  var _ref$current;
40
- var rect = ref === null || ref === void 0 ? void 0 : (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.getBoundingClientRect();
40
+ var rect = ref === null || ref === void 0 || (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.getBoundingClientRect();
41
41
  if (rect) {
42
42
  var centerOffset = rect.width / 2 - 0.5;
43
43
 
@@ -64,5 +64,4 @@ var GuidelineContainer = function GuidelineContainer(props) {
64
64
  key: key
65
65
  }, guidelineProps));
66
66
  }));
67
- };
68
- exports.GuidelineContainer = GuidelineContainer;
67
+ };
@@ -34,10 +34,9 @@ var displayGuideline = function displayGuideline(view) {
34
34
  return true;
35
35
  };
36
36
  };
37
- var EMPTY_STATE = {
37
+ var EMPTY_STATE = exports.EMPTY_STATE = {
38
38
  guidelines: []
39
39
  };
40
- exports.EMPTY_STATE = EMPTY_STATE;
41
40
  var guidelinePMPlugin = new _safePlugin.SafePlugin({
42
41
  key: key,
43
42
  state: {
@@ -96,7 +95,7 @@ var ContentComponent = function ContentComponent(_ref) {
96
95
  * Guideline plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
97
96
  * from `@atlaskit/editor-core`.
98
97
  */
99
- var guidelinePlugin = function guidelinePlugin(_ref4) {
98
+ var guidelinePlugin = exports.guidelinePlugin = function guidelinePlugin(_ref4) {
100
99
  var options = _ref4.config,
101
100
  api = _ref4.api;
102
101
  return {
@@ -127,5 +126,4 @@ var guidelinePlugin = function guidelinePlugin(_ref4) {
127
126
  });
128
127
  }
129
128
  };
130
- };
131
- exports.guidelinePlugin = guidelinePlugin;
129
+ };
@@ -8,17 +8,16 @@ var _guideline = require("@atlaskit/editor-common/guideline");
8
8
  var _constants = require("./constants");
9
9
  /* eslint-disable @atlaskit/design-system/ensure-design-token-usage/preview */
10
10
 
11
- var isNumber = function isNumber(x) {
11
+ var isNumber = exports.isNumber = function isNumber(x) {
12
12
  return typeof x === 'number' && !isNaN(x) && isFinite(x);
13
13
  };
14
- exports.isNumber = isNumber;
15
14
  var getXPosition = function getXPosition(pixel) {
16
15
  return isNumber(pixel) ? "calc(".concat(pixel, "px + var(").concat(_constants.VAR_POSITION_OFFSET_X, ", '0px'))") : 'unset';
17
16
  };
18
17
  var getYPosition = function getYPosition(pixel) {
19
18
  return isNumber(pixel) ? "calc(".concat(pixel, "px + var(").concat(_constants.VAR_POSITION_OFFSET_Y, ", '0px'))") : 'unset';
20
19
  };
21
- var getPositionStyles = function getPositionStyles(pos) {
20
+ var getPositionStyles = exports.getPositionStyles = function getPositionStyles(pos) {
22
21
  var _pos$y, _pos$x;
23
22
  return (0, _guideline.isVerticalPosition)(pos) ? {
24
23
  left: getXPosition(pos.x),
@@ -29,5 +28,4 @@ var getPositionStyles = function getPositionStyles(pos) {
29
28
  left: getXPosition((_pos$x = pos.x) === null || _pos$x === void 0 ? void 0 : _pos$x.start),
30
29
  width: pos.x ? "".concat(pos.x.end - pos.x.start, "px") : '100%'
31
30
  };
32
- };
33
- exports.getPositionStyles = getPositionStyles;
31
+ };
package/dist/cjs/utils.js CHANGED
@@ -8,7 +8,7 @@ exports.innerGuidelines = void 0;
8
8
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
9
9
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
10
10
  var defaultGrids = [-6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6];
11
- var innerGuidelines = function innerGuidelines(editorContainerWidth) {
11
+ var innerGuidelines = exports.innerGuidelines = function innerGuidelines(editorContainerWidth) {
12
12
  var editorWidth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _editorSharedStyles.akEditorDefaultLayoutWidth;
13
13
  var wideSpacing = editorWidth * _editorSharedStyles.breakoutWideScaleRatio / 2;
14
14
  var fullWidthPadding = (_editorSharedStyles.akEditorBreakoutPadding + editorWidth - _editorSharedStyles.akEditorDefaultLayoutWidth) / 2;
@@ -44,5 +44,4 @@ var innerGuidelines = function innerGuidelines(editorContainerWidth) {
44
44
  };
45
45
  });
46
46
  return [].concat((0, _toConsumableArray2.default)(gridGuidelines), wideGuidelines, fullWidthGuidelines);
47
- };
48
- exports.innerGuidelines = innerGuidelines;
47
+ };
@@ -30,7 +30,7 @@ export var GuidelineContainer = function GuidelineContainer(props) {
30
30
  var ref = useRef(null);
31
31
  useLayoutEffect(function () {
32
32
  var _ref$current;
33
- var rect = ref === null || ref === void 0 ? void 0 : (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.getBoundingClientRect();
33
+ var rect = ref === null || ref === void 0 || (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.getBoundingClientRect();
34
34
  if (rect) {
35
35
  var centerOffset = rect.width / 2 - 0.5;
36
36
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-guideline",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "description": "guideline plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -10,9 +10,10 @@
10
10
  "atlassian": {
11
11
  "team": "Editor: Media Experience Porygon",
12
12
  "singleton": true,
13
- "releaseModel": "continuous"
13
+ "releaseModel": "continuous",
14
+ "runReact18": false
14
15
  },
15
- "repository": "https://bitbucket.org/atlassian/atlassian-frontend",
16
+ "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
16
17
  "main": "dist/cjs/index.js",
17
18
  "module": "dist/esm/index.js",
18
19
  "module:es2019": "dist/es2019/index.js",
@@ -23,12 +24,12 @@
23
24
  ".": "./src/index.ts"
24
25
  },
25
26
  "dependencies": {
26
- "@atlaskit/editor-common": "^76.0.0",
27
+ "@atlaskit/editor-common": "^77.0.0",
27
28
  "@atlaskit/editor-plugin-width": "^0.2.0",
28
29
  "@atlaskit/editor-prosemirror": "1.1.0",
29
- "@atlaskit/editor-shared-styles": "^2.8.0",
30
+ "@atlaskit/editor-shared-styles": "^2.9.0",
30
31
  "@atlaskit/theme": "^12.6.0",
31
- "@atlaskit/tokens": "^1.25.0",
32
+ "@atlaskit/tokens": "^1.34.0",
32
33
  "@babel/runtime": "^7.0.0",
33
34
  "@emotion/react": "^11.7.1"
34
35
  },
@@ -1,26 +0,0 @@
1
- ## API Report File for "@atlaskit/editor-plugin-guideline"
2
-
3
- > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
-
5
- ```ts
6
-
7
- import { DisplayGuideline } from '@atlaskit/editor-common/guideline';
8
- import { GuidelinePluginState } from '@atlaskit/editor-common/guideline';
9
- import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
10
- import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
11
-
12
- // @public (undocumented)
13
- export type GuidelinePlugin = NextEditorPlugin<'guideline', {
14
- dependencies: [WidthPlugin];
15
- sharedState: GuidelinePluginState | null;
16
- actions: {
17
- displayGuideline: DisplayGuideline;
18
- };
19
- }>;
20
-
21
- // @public
22
- export const guidelinePlugin: GuidelinePlugin;
23
-
24
- // (No @packageDocumentation comment for this package)
25
-
26
- ```