@atlaskit/editor-plugin-guideline 0.5.1 → 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,17 @@
1
1
  # @atlaskit/editor-plugin-guideline
2
2
 
3
+ ## 0.5.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 0.5.2
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 0.5.1
4
16
 
5
17
  ### Patch Changes
@@ -10,7 +22,7 @@
10
22
 
11
23
  ### Minor Changes
12
24
 
13
- - [`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.
14
26
 
15
27
  ### Patch Changes
16
28
 
@@ -20,7 +32,7 @@
20
32
 
21
33
  ### Patch Changes
22
34
 
23
- - [`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
24
36
  signature of `NextEditorPlugin`.
25
37
 
26
38
  Previously a `NextEditorPlugin` would be consumed as so:
@@ -50,13 +62,13 @@
50
62
 
51
63
  ### Patch Changes
52
64
 
53
- - [`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.
54
66
 
55
67
  ## 0.4.0
56
68
 
57
69
  ### Minor Changes
58
70
 
59
- - [`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.
60
72
 
61
73
  ### Patch Changes
62
74
 
@@ -66,7 +78,7 @@
66
78
 
67
79
  ### Patch Changes
68
80
 
69
- - [`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
70
82
 
71
83
  ## 0.3.12
72
84
 
@@ -78,78 +90,78 @@
78
90
 
79
91
  ### Patch Changes
80
92
 
81
- - [`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
82
94
  - Updated dependencies
83
95
 
84
96
  ## 0.3.10
85
97
 
86
98
  ### Patch Changes
87
99
 
88
- - [`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
89
101
  - Updated dependencies
90
102
 
91
103
  ## 0.3.9
92
104
 
93
105
  ### Patch Changes
94
106
 
95
- - [`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
96
108
 
97
109
  ## 0.3.8
98
110
 
99
111
  ### Patch Changes
100
112
 
101
- - [`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
102
114
  - Updated dependencies
103
115
 
104
116
  ## 0.3.7
105
117
 
106
118
  ### Patch Changes
107
119
 
108
- - [`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
109
121
 
110
122
  ## 0.3.6
111
123
 
112
124
  ### Patch Changes
113
125
 
114
- - [`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.
115
127
 
116
128
  ## 0.3.5
117
129
 
118
130
  ### Patch Changes
119
131
 
120
- - [`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
121
133
 
122
134
  ## 0.3.4
123
135
 
124
136
  ### Patch Changes
125
137
 
126
- - [`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
127
139
 
128
140
  ## 0.3.3
129
141
 
130
142
  ### Patch Changes
131
143
 
132
- - [`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.
133
145
 
134
146
  ## 0.3.2
135
147
 
136
148
  ### Patch Changes
137
149
 
138
- - [`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
139
151
  - Updated dependencies
140
152
 
141
153
  ## 0.3.1
142
154
 
143
155
  ### Patch Changes
144
156
 
145
- - [`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).
146
158
  - Updated dependencies
147
159
 
148
160
  ## 0.3.0
149
161
 
150
162
  ### Minor Changes
151
163
 
152
- - [`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
153
165
  - [`1dadcae5b09`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1dadcae5b09) - COLLAB-2623 Updated API to newest interface and added utils to create default gridlines
154
166
 
155
167
  ### Patch Changes
@@ -160,7 +172,7 @@
160
172
 
161
173
  ### Minor Changes
162
174
 
163
- - [`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.
164
176
 
165
177
  ### Patch Changes
166
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.1",
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": "^75.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.6.0",
30
+ "@atlaskit/editor-shared-styles": "^2.9.0",
30
31
  "@atlaskit/theme": "^12.6.0",
31
- "@atlaskit/tokens": "^1.22.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
- ```