@atlaskit/editor-plugin-guideline 0.3.5 → 0.3.6
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 +6 -0
- package/README.md +8 -4
- package/dist/cjs/guideline.js +6 -4
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/guideline.js +7 -4
- package/dist/es2019/version.json +1 -1
- package/dist/esm/guideline.js +6 -4
- package/dist/esm/version.json +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -85,15 +85,19 @@ type GuidelineConfig = {
|
|
|
85
85
|
...
|
|
86
86
|
active?: boolean;
|
|
87
87
|
show?: boolean;
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
styles: {
|
|
89
|
+
lineStyle?: 'dashed' | 'solid'; // default solid
|
|
90
|
+
color?: CSSToken;
|
|
91
|
+
capStyle?: 'line'
|
|
92
|
+
}
|
|
90
93
|
};
|
|
91
94
|
```
|
|
92
95
|
|
|
93
96
|
- `active` default `false`, equivalent to the `highlight` state in the `grid` plugin.
|
|
94
|
-
- `style` default `solid`, and we also support `dashed`
|
|
95
97
|
- `show` default `true` and you can also hide a guideline, could be useful when you need animations.
|
|
96
|
-
- `color`: default `undefined` you can override the color of a guideline with a valid `css` color
|
|
98
|
+
- `styles.color`: default `undefined` you can override the color of a guideline with a valid `css` color
|
|
99
|
+
- `styles.lineStyle` default `solid`, and we also support `dashed`
|
|
100
|
+
- `styles.capStyle` default undefined, and support `line`
|
|
97
101
|
|
|
98
102
|
## TODO
|
|
99
103
|
- [ ] Add unit/vr tests
|
package/dist/cjs/guideline.js
CHANGED
|
@@ -75,12 +75,14 @@ var Guideline = function Guideline(props) {
|
|
|
75
75
|
active = props.active,
|
|
76
76
|
_props$show = props.show,
|
|
77
77
|
show = _props$show === void 0 ? true : _props$show,
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
styles = props.styles;
|
|
78
|
+
_props$styles = props.styles,
|
|
79
|
+
styles = _props$styles === void 0 ? {} : _props$styles;
|
|
81
80
|
var isVerticalPos = (0, _guideline.isVerticalPosition)(position);
|
|
81
|
+
var lineStyle = styles.lineStyle,
|
|
82
|
+
color = styles.color,
|
|
83
|
+
capStyle = styles.capStyle;
|
|
82
84
|
return (0, _react.jsx)("div", {
|
|
83
|
-
css: [basicGuidelineStyles, isVerticalPos ? verticalStyles : horizontalStyles,
|
|
85
|
+
css: [basicGuidelineStyles, isVerticalPos ? verticalStyles : horizontalStyles, capStyle === 'line' && (isVerticalPos ? horizontalCapStyles : verticalCapStyles), active && activeGuidelineStyles, !show && hiddenGuidelineStyles, lineStyle === 'dashed' && dashedGuidelineStyles],
|
|
84
86
|
style: _objectSpread(_objectSpread({}, color && {
|
|
85
87
|
borderColor: "".concat(color)
|
|
86
88
|
}), (0, _positionStyles.getPositionStyles)(position)),
|
package/dist/cjs/version.json
CHANGED
package/dist/es2019/guideline.js
CHANGED
|
@@ -66,13 +66,16 @@ export const Guideline = props => {
|
|
|
66
66
|
position,
|
|
67
67
|
active,
|
|
68
68
|
show = true,
|
|
69
|
-
|
|
70
|
-
color,
|
|
71
|
-
styles
|
|
69
|
+
styles = {}
|
|
72
70
|
} = props;
|
|
73
71
|
const isVerticalPos = isVerticalPosition(position);
|
|
72
|
+
const {
|
|
73
|
+
lineStyle,
|
|
74
|
+
color,
|
|
75
|
+
capStyle
|
|
76
|
+
} = styles;
|
|
74
77
|
return jsx("div", {
|
|
75
|
-
css: [basicGuidelineStyles, isVerticalPos ? verticalStyles : horizontalStyles,
|
|
78
|
+
css: [basicGuidelineStyles, isVerticalPos ? verticalStyles : horizontalStyles, capStyle === 'line' && (isVerticalPos ? horizontalCapStyles : verticalCapStyles), active && activeGuidelineStyles, !show && hiddenGuidelineStyles, lineStyle === 'dashed' && dashedGuidelineStyles],
|
|
76
79
|
style: {
|
|
77
80
|
...(color && {
|
|
78
81
|
borderColor: `${color}`
|
package/dist/es2019/version.json
CHANGED
package/dist/esm/guideline.js
CHANGED
|
@@ -69,12 +69,14 @@ export var Guideline = function Guideline(props) {
|
|
|
69
69
|
active = props.active,
|
|
70
70
|
_props$show = props.show,
|
|
71
71
|
show = _props$show === void 0 ? true : _props$show,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
styles = props.styles;
|
|
72
|
+
_props$styles = props.styles,
|
|
73
|
+
styles = _props$styles === void 0 ? {} : _props$styles;
|
|
75
74
|
var isVerticalPos = isVerticalPosition(position);
|
|
75
|
+
var lineStyle = styles.lineStyle,
|
|
76
|
+
color = styles.color,
|
|
77
|
+
capStyle = styles.capStyle;
|
|
76
78
|
return jsx("div", {
|
|
77
|
-
css: [basicGuidelineStyles, isVerticalPos ? verticalStyles : horizontalStyles,
|
|
79
|
+
css: [basicGuidelineStyles, isVerticalPos ? verticalStyles : horizontalStyles, capStyle === 'line' && (isVerticalPos ? horizontalCapStyles : verticalCapStyles), active && activeGuidelineStyles, !show && hiddenGuidelineStyles, lineStyle === 'dashed' && dashedGuidelineStyles],
|
|
78
80
|
style: _objectSpread(_objectSpread({}, color && {
|
|
79
81
|
borderColor: "".concat(color)
|
|
80
82
|
}), getPositionStyles(position)),
|
package/dist/esm/version.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-guideline",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.6",
|
|
4
4
|
"description": "guideline plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@atlaskit/editor-common": "^74.26.0",
|
|
27
27
|
"@atlaskit/editor-plugin-width": "^0.1.0",
|
|
28
|
-
"@atlaskit/editor-shared-styles": "^2.
|
|
28
|
+
"@atlaskit/editor-shared-styles": "^2.5.0",
|
|
29
29
|
"@atlaskit/theme": "^12.5.0",
|
|
30
30
|
"@atlaskit/tokens": "^1.13.0",
|
|
31
31
|
"@babel/runtime": "^7.0.0",
|