@atlaskit/editor-plugin-rule 18.0.0 → 18.1.1
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 +18 -0
- package/dist/cjs/pm-plugins/commands.js +69 -2
- package/dist/cjs/rulePlugin.js +1 -1
- package/dist/cjs/ui/DividerOptions.compiled.css +12 -0
- package/dist/cjs/ui/DividerOptions.js +165 -0
- package/dist/cjs/ui/constants.js +8 -0
- package/dist/cjs/ui/icons/DashedStrokeIcon.js +33 -0
- package/dist/cjs/ui/icons/DottedStrokeIcon.js +34 -0
- package/dist/cjs/ui/icons/FadeStrokeIcon.js +43 -0
- package/dist/cjs/ui/icons/SketchStrokeIcon.js +24 -0
- package/dist/cjs/ui/icons/SolidStrokeIcon.js +32 -0
- package/dist/cjs/ui/toolbar.js +39 -8
- package/dist/es2019/pm-plugins/commands.js +66 -1
- package/dist/es2019/rulePlugin.js +2 -2
- package/dist/es2019/ui/DividerOptions.compiled.css +12 -0
- package/dist/es2019/ui/DividerOptions.js +147 -0
- package/dist/es2019/ui/constants.js +2 -0
- package/dist/es2019/ui/icons/DashedStrokeIcon.js +24 -0
- package/dist/es2019/ui/icons/DottedStrokeIcon.js +25 -0
- package/dist/es2019/ui/icons/FadeStrokeIcon.js +34 -0
- package/dist/es2019/ui/icons/SketchStrokeIcon.js +15 -0
- package/dist/es2019/ui/icons/SolidStrokeIcon.js +23 -0
- package/dist/es2019/ui/toolbar.js +39 -9
- package/dist/esm/pm-plugins/commands.js +67 -1
- package/dist/esm/rulePlugin.js +2 -2
- package/dist/esm/ui/DividerOptions.compiled.css +12 -0
- package/dist/esm/ui/DividerOptions.js +156 -0
- package/dist/esm/ui/constants.js +2 -0
- package/dist/esm/ui/icons/DashedStrokeIcon.js +26 -0
- package/dist/esm/ui/icons/DottedStrokeIcon.js +27 -0
- package/dist/esm/ui/icons/FadeStrokeIcon.js +36 -0
- package/dist/esm/ui/icons/SketchStrokeIcon.js +17 -0
- package/dist/esm/ui/icons/SolidStrokeIcon.js +25 -0
- package/dist/esm/ui/toolbar.js +40 -9
- package/dist/types/pm-plugins/commands.d.ts +3 -0
- package/dist/types/ui/DividerOptions.d.ts +14 -0
- package/dist/types/ui/constants.d.ts +5 -0
- package/dist/types/ui/icons/DashedStrokeIcon.d.ts +2 -0
- package/dist/types/ui/icons/DottedStrokeIcon.d.ts +2 -0
- package/dist/types/ui/icons/FadeStrokeIcon.d.ts +2 -0
- package/dist/types/ui/icons/SketchStrokeIcon.d.ts +2 -0
- package/dist/types/ui/icons/SolidStrokeIcon.d.ts +2 -0
- package/package.json +9 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-rule
|
|
2
2
|
|
|
3
|
+
## 18.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 18.1.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`27b897435a350`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/27b897435a350) -
|
|
14
|
+
[ux] [EDITOR-8345] This change adds a menu to the feature-gated floating toolbar with options to
|
|
15
|
+
toggle Divider weights and styles, behind platform_editor_lovability_dividers.
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 18.0.0
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
|
-
exports.removeHorizontalRule = exports.insertHorizontalRule = void 0;
|
|
7
|
+
exports.updateHorizontalRuleWeight = exports.updateHorizontalRuleStyle = exports.removeHorizontalRule = exports.insertHorizontalRule = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
7
9
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
8
|
-
var _inputRule = require("./input-rule");
|
|
9
10
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
11
|
+
var _constants = require("../ui/constants");
|
|
12
|
+
var _inputRule = require("./input-rule");
|
|
13
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
14
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
10
15
|
var insertHorizontalRule = exports.insertHorizontalRule = function insertHorizontalRule(editorAnalyticsAPI) {
|
|
11
16
|
return function (inputMethod) {
|
|
12
17
|
return function (state, dispatch) {
|
|
@@ -42,4 +47,66 @@ var removeHorizontalRule = exports.removeHorizontalRule = function removeHorizon
|
|
|
42
47
|
}
|
|
43
48
|
return true;
|
|
44
49
|
};
|
|
50
|
+
};
|
|
51
|
+
var updateHorizontalRuleWeight = exports.updateHorizontalRuleWeight = function updateHorizontalRuleWeight(weight, editorAnalyticsAPI) {
|
|
52
|
+
return function (state, dispatch) {
|
|
53
|
+
var _selectedRule$node$at;
|
|
54
|
+
var rule = state.schema.nodes.rule;
|
|
55
|
+
var selectedRule = (0, _utils.findSelectedNodeOfType)(rule)(state.selection);
|
|
56
|
+
if (!selectedRule) {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
var previousWeight = (_selectedRule$node$at = selectedRule.node.attrs.weight) !== null && _selectedRule$node$at !== void 0 ? _selectedRule$node$at : _constants.DEFAULT_DIVIDER_WEIGHT;
|
|
60
|
+
if (previousWeight === weight) {
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
if (dispatch) {
|
|
64
|
+
var updateTr = state.tr.setNodeMarkup(selectedRule.pos, undefined, _objectSpread(_objectSpread({}, selectedRule.node.attrs), {}, {
|
|
65
|
+
weight: weight
|
|
66
|
+
}));
|
|
67
|
+
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent({
|
|
68
|
+
action: _analytics.ACTION.UPDATED,
|
|
69
|
+
actionSubject: _analytics.ACTION_SUBJECT.DIVIDER,
|
|
70
|
+
attributes: {
|
|
71
|
+
inputMethod: _analytics.INPUT_METHOD.FLOATING_TB,
|
|
72
|
+
previousWeight: previousWeight,
|
|
73
|
+
weight: weight
|
|
74
|
+
},
|
|
75
|
+
eventType: _analytics.EVENT_TYPE.TRACK
|
|
76
|
+
})(updateTr);
|
|
77
|
+
dispatch(updateTr);
|
|
78
|
+
}
|
|
79
|
+
return true;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
var updateHorizontalRuleStyle = exports.updateHorizontalRuleStyle = function updateHorizontalRuleStyle(style, editorAnalyticsAPI) {
|
|
83
|
+
return function (state, dispatch) {
|
|
84
|
+
var _selectedRule$node$at2;
|
|
85
|
+
var rule = state.schema.nodes.rule;
|
|
86
|
+
var selectedRule = (0, _utils.findSelectedNodeOfType)(rule)(state.selection);
|
|
87
|
+
if (!selectedRule) {
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
var previousStyle = (_selectedRule$node$at2 = selectedRule.node.attrs.style) !== null && _selectedRule$node$at2 !== void 0 ? _selectedRule$node$at2 : _constants.DEFAULT_DIVIDER_STYLE;
|
|
91
|
+
if (previousStyle === style) {
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
if (dispatch) {
|
|
95
|
+
var updateTr = state.tr.setNodeMarkup(selectedRule.pos, undefined, _objectSpread(_objectSpread({}, selectedRule.node.attrs), {}, {
|
|
96
|
+
style: style
|
|
97
|
+
}));
|
|
98
|
+
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent({
|
|
99
|
+
action: _analytics.ACTION.UPDATED,
|
|
100
|
+
actionSubject: _analytics.ACTION_SUBJECT.DIVIDER,
|
|
101
|
+
attributes: {
|
|
102
|
+
inputMethod: _analytics.INPUT_METHOD.FLOATING_TB,
|
|
103
|
+
previousStyle: previousStyle,
|
|
104
|
+
style: style
|
|
105
|
+
},
|
|
106
|
+
eventType: _analytics.EVENT_TYPE.TRACK
|
|
107
|
+
})(updateTr);
|
|
108
|
+
dispatch(updateTr);
|
|
109
|
+
}
|
|
110
|
+
return true;
|
|
111
|
+
};
|
|
45
112
|
};
|
package/dist/cjs/rulePlugin.js
CHANGED
|
@@ -38,7 +38,7 @@ var rulePlugin = exports.rulePlugin = function rulePlugin(_ref) {
|
|
|
38
38
|
nodes: function nodes() {
|
|
39
39
|
return [{
|
|
40
40
|
name: 'rule',
|
|
41
|
-
node: (0, _fg.fg)('platform_editor_adf_with_localid') ? _rule.ruleWithLocalId : _rule.rule
|
|
41
|
+
node: (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_lovability_dividers_attributes') ? _rule.ruleWithAttrs : (0, _fg.fg)('platform_editor_adf_with_localid') ? _rule.ruleWithLocalId : _rule.rule
|
|
42
42
|
}];
|
|
43
43
|
},
|
|
44
44
|
actions: {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
._1vy41mok>button{border-radius:var(--ds-radius-large,8px)}
|
|
2
|
+
._2rko1mok{border-radius:var(--ds-radius-large,8px)}
|
|
3
|
+
._zulpu2gc{gap:var(--ds-space-100,8px)}
|
|
4
|
+
._18zrutpp{padding-inline:var(--ds-space-150,9pt)}
|
|
5
|
+
._1rjc1b66{padding-block:var(--ds-space-050,4px)}._16jlkb7n{flex-grow:1}
|
|
6
|
+
._18m915vq{overflow-y:hidden}
|
|
7
|
+
._1bsb1osq{width:100%}
|
|
8
|
+
._1e0c1txw{display:flex}
|
|
9
|
+
._1reo15vq{overflow-x:hidden}
|
|
10
|
+
._4t3i5jys{height:11pc}
|
|
11
|
+
._r55q1osq>button{width:100%}
|
|
12
|
+
._ug5l1h6o>button{justify-content:center}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/* DividerOptions.tsx generated by @compiled/babel-plugin v3.0.1 */
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
Object.defineProperty(exports, "__esModule", {
|
|
7
|
+
value: true
|
|
8
|
+
});
|
|
9
|
+
exports.DividerOptions = void 0;
|
|
10
|
+
require("./DividerOptions.compiled.css");
|
|
11
|
+
var _runtime = require("@compiled/react/runtime");
|
|
12
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
+
var _reactIntl = require("react-intl");
|
|
14
|
+
var _button = _interopRequireDefault(require("@atlaskit/button/icon/button"));
|
|
15
|
+
var _rule = require("@atlaskit/editor-common/messages/rule");
|
|
16
|
+
var _strokeWeightLarge = _interopRequireDefault(require("@atlaskit/icon/core/stroke-weight-large"));
|
|
17
|
+
var _strokeWeightMedium = _interopRequireDefault(require("@atlaskit/icon/core/stroke-weight-medium"));
|
|
18
|
+
var _strokeWeightSmall = _interopRequireDefault(require("@atlaskit/icon/core/stroke-weight-small"));
|
|
19
|
+
var _compiled = require("@atlaskit/primitives/compiled");
|
|
20
|
+
var _constants = require("./constants");
|
|
21
|
+
var _FadeStrokeIcon = require("./icons/FadeStrokeIcon");
|
|
22
|
+
var _SketchStrokeIcon = require("./icons/SketchStrokeIcon");
|
|
23
|
+
var _SolidStrokeIcon = require("./icons/SolidStrokeIcon");
|
|
24
|
+
var _DashedStrokeIcon = require("./icons/DashedStrokeIcon");
|
|
25
|
+
var _DottedStrokeIcon = require("./icons/DottedStrokeIcon");
|
|
26
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
27
|
+
var styles = {
|
|
28
|
+
container: "_18zrutpp _4t3i5jys",
|
|
29
|
+
section: "_1rjc1b66",
|
|
30
|
+
dividerOptionsContainer: "_zulpu2gc _1e0c1txw _1bsb1osq",
|
|
31
|
+
dividerOptionsButtonContainer: "_1rjc1b66"
|
|
32
|
+
};
|
|
33
|
+
var dividerOptionsButtonStyles = null;
|
|
34
|
+
var SmallWeightIcon = function SmallWeightIcon(iconProps) {
|
|
35
|
+
return /*#__PURE__*/_react.default.createElement(_strokeWeightSmall.default, {
|
|
36
|
+
color: "var(--ds-icon-subtle, #505258)",
|
|
37
|
+
label: iconProps.label
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
var MediumWeightIcon = function MediumWeightIcon(iconProps) {
|
|
41
|
+
return /*#__PURE__*/_react.default.createElement(_strokeWeightMedium.default, {
|
|
42
|
+
color: "var(--ds-icon-subtle, #505258)",
|
|
43
|
+
label: iconProps.label
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
var LargeWeightIcon = function LargeWeightIcon(iconProps) {
|
|
47
|
+
return /*#__PURE__*/_react.default.createElement(_strokeWeightLarge.default, {
|
|
48
|
+
color: "var(--ds-icon-subtle, #505258)",
|
|
49
|
+
label: iconProps.label
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
var weightOptions = [{
|
|
53
|
+
icon: SmallWeightIcon,
|
|
54
|
+
label: _rule.ruleMessages.smallDivider,
|
|
55
|
+
value: 1
|
|
56
|
+
}, {
|
|
57
|
+
icon: MediumWeightIcon,
|
|
58
|
+
label: _rule.ruleMessages.mediumDivider,
|
|
59
|
+
value: 2
|
|
60
|
+
}, {
|
|
61
|
+
icon: LargeWeightIcon,
|
|
62
|
+
label: _rule.ruleMessages.largeDivider,
|
|
63
|
+
value: 3
|
|
64
|
+
}];
|
|
65
|
+
var styleOptionRows = [
|
|
66
|
+
// row 1
|
|
67
|
+
[{
|
|
68
|
+
icon: _SolidStrokeIcon.SolidStrokeIcon,
|
|
69
|
+
label: _rule.ruleMessages.solidDivider,
|
|
70
|
+
value: 'solid'
|
|
71
|
+
}, {
|
|
72
|
+
icon: _DashedStrokeIcon.DashedStrokeIcon,
|
|
73
|
+
label: _rule.ruleMessages.dashedDivider,
|
|
74
|
+
value: 'dashed'
|
|
75
|
+
}, {
|
|
76
|
+
icon: _DottedStrokeIcon.DottedStrokeIcon,
|
|
77
|
+
label: _rule.ruleMessages.dottedDivider,
|
|
78
|
+
value: 'dotted'
|
|
79
|
+
}],
|
|
80
|
+
// row 2
|
|
81
|
+
[{
|
|
82
|
+
icon: _SketchStrokeIcon.SketchStrokeIcon,
|
|
83
|
+
label: _rule.ruleMessages.sketchDivider,
|
|
84
|
+
value: 'sketch'
|
|
85
|
+
}, {
|
|
86
|
+
icon: _FadeStrokeIcon.FadeStrokeIcon,
|
|
87
|
+
label: _rule.ruleMessages.fadeDivider,
|
|
88
|
+
value: 'fade'
|
|
89
|
+
}]];
|
|
90
|
+
var DividerOptionButton = function DividerOptionButton(_ref) {
|
|
91
|
+
var icon = _ref.icon,
|
|
92
|
+
isSelected = _ref.isSelected,
|
|
93
|
+
label = _ref.label,
|
|
94
|
+
onSelect = _ref.onSelect,
|
|
95
|
+
value = _ref.value;
|
|
96
|
+
var handleClick = (0, _react.useCallback)(function () {
|
|
97
|
+
return onSelect === null || onSelect === void 0 ? void 0 : onSelect(value);
|
|
98
|
+
}, [onSelect, value]);
|
|
99
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
100
|
+
className: (0, _runtime.ax)(["_2rko1mok _1reo15vq _18m915vq _16jlkb7n _1vy41mok _ug5l1h6o _r55q1osq"])
|
|
101
|
+
}, /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
102
|
+
icon: icon,
|
|
103
|
+
isSelected: isSelected,
|
|
104
|
+
label: label,
|
|
105
|
+
onClick: handleClick
|
|
106
|
+
}));
|
|
107
|
+
};
|
|
108
|
+
var DividerOptions = exports.DividerOptions = function DividerOptions(_ref2) {
|
|
109
|
+
var onStyleChange = _ref2.onStyleChange,
|
|
110
|
+
onWeightChange = _ref2.onWeightChange,
|
|
111
|
+
style = _ref2.style,
|
|
112
|
+
weight = _ref2.weight;
|
|
113
|
+
var _useIntl = (0, _reactIntl.useIntl)(),
|
|
114
|
+
formatMessage = _useIntl.formatMessage;
|
|
115
|
+
var selectedStyle = style !== null && style !== void 0 ? style : _constants.DEFAULT_DIVIDER_STYLE;
|
|
116
|
+
var selectedWeight = weight !== null && weight !== void 0 ? weight : _constants.DEFAULT_DIVIDER_WEIGHT;
|
|
117
|
+
return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
118
|
+
xcss: styles.container
|
|
119
|
+
}, /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
120
|
+
xcss: styles.section
|
|
121
|
+
}, /*#__PURE__*/_react.default.createElement(_compiled.Text, {
|
|
122
|
+
weight: "bold",
|
|
123
|
+
color: "color.text.subtle"
|
|
124
|
+
}, formatMessage(_rule.ruleMessages.weight)), /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
125
|
+
xcss: styles.dividerOptionsButtonContainer
|
|
126
|
+
}, /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
127
|
+
xcss: styles.dividerOptionsContainer
|
|
128
|
+
}, weightOptions.map(function (_ref3) {
|
|
129
|
+
var icon = _ref3.icon,
|
|
130
|
+
label = _ref3.label,
|
|
131
|
+
value = _ref3.value;
|
|
132
|
+
return /*#__PURE__*/_react.default.createElement(DividerOptionButton, {
|
|
133
|
+
key: value,
|
|
134
|
+
icon: icon,
|
|
135
|
+
isSelected: selectedWeight === value,
|
|
136
|
+
label: formatMessage(label),
|
|
137
|
+
onSelect: onWeightChange,
|
|
138
|
+
value: value
|
|
139
|
+
});
|
|
140
|
+
})))), /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
141
|
+
xcss: styles.section
|
|
142
|
+
}, /*#__PURE__*/_react.default.createElement(_compiled.Text, {
|
|
143
|
+
weight: "bold",
|
|
144
|
+
color: "color.text.subtle"
|
|
145
|
+
}, formatMessage(_rule.ruleMessages.style)), styleOptionRows.map(function (options) {
|
|
146
|
+
return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
147
|
+
key: options[0].value,
|
|
148
|
+
xcss: styles.dividerOptionsButtonContainer
|
|
149
|
+
}, /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
150
|
+
xcss: styles.dividerOptionsContainer
|
|
151
|
+
}, options.map(function (_ref4) {
|
|
152
|
+
var icon = _ref4.icon,
|
|
153
|
+
label = _ref4.label,
|
|
154
|
+
value = _ref4.value;
|
|
155
|
+
return /*#__PURE__*/_react.default.createElement(DividerOptionButton, {
|
|
156
|
+
key: value,
|
|
157
|
+
icon: icon,
|
|
158
|
+
isSelected: selectedStyle === value,
|
|
159
|
+
label: formatMessage(label),
|
|
160
|
+
onSelect: onStyleChange,
|
|
161
|
+
value: value
|
|
162
|
+
});
|
|
163
|
+
})));
|
|
164
|
+
})));
|
|
165
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DEFAULT_DIVIDER_WEIGHT = exports.DEFAULT_DIVIDER_STYLE = void 0;
|
|
7
|
+
var DEFAULT_DIVIDER_STYLE = exports.DEFAULT_DIVIDER_STYLE = 'solid';
|
|
8
|
+
var DEFAULT_DIVIDER_WEIGHT = exports.DEFAULT_DIVIDER_WEIGHT = 2;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.DashedStrokeIcon = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var CustomGlyph = function CustomGlyph() {
|
|
10
|
+
return /*#__PURE__*/_react.default.createElement("svg", {
|
|
11
|
+
width: "44",
|
|
12
|
+
height: "8",
|
|
13
|
+
viewBox: "0 0 44 8",
|
|
14
|
+
fill: "none",
|
|
15
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
16
|
+
}, /*#__PURE__*/_react.default.createElement("g", {
|
|
17
|
+
clipPath: "url(#clip0_238_17349)"
|
|
18
|
+
}, /*#__PURE__*/_react.default.createElement("path", {
|
|
19
|
+
d: "M-78 4H122",
|
|
20
|
+
stroke: "var(--ds-icon-subtle, #505258)",
|
|
21
|
+
strokeWidth: "2",
|
|
22
|
+
strokeDasharray: "4 6"
|
|
23
|
+
})), /*#__PURE__*/_react.default.createElement("defs", null, /*#__PURE__*/_react.default.createElement("clipPath", {
|
|
24
|
+
id: "clip0_238_17349"
|
|
25
|
+
}, /*#__PURE__*/_react.default.createElement("rect", {
|
|
26
|
+
width: "44",
|
|
27
|
+
height: "8",
|
|
28
|
+
fill: "white"
|
|
29
|
+
}))));
|
|
30
|
+
};
|
|
31
|
+
var DashedStrokeIcon = exports.DashedStrokeIcon = function DashedStrokeIcon() {
|
|
32
|
+
return /*#__PURE__*/_react.default.createElement(CustomGlyph, null);
|
|
33
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.DottedStrokeIcon = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var CustomGlyph = function CustomGlyph() {
|
|
10
|
+
return /*#__PURE__*/_react.default.createElement("svg", {
|
|
11
|
+
width: "44",
|
|
12
|
+
height: "8",
|
|
13
|
+
viewBox: "0 0 44 8",
|
|
14
|
+
fill: "none",
|
|
15
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
16
|
+
}, /*#__PURE__*/_react.default.createElement("g", {
|
|
17
|
+
clipPath: "url(#clip0_238_2909)"
|
|
18
|
+
}, /*#__PURE__*/_react.default.createElement("path", {
|
|
19
|
+
d: "M-78 4H122",
|
|
20
|
+
stroke: "var(--ds-icon, #292A2E)",
|
|
21
|
+
strokeWidth: "2",
|
|
22
|
+
strokeLinecap: "round",
|
|
23
|
+
strokeDasharray: "0.01 6"
|
|
24
|
+
})), /*#__PURE__*/_react.default.createElement("defs", null, /*#__PURE__*/_react.default.createElement("clipPath", {
|
|
25
|
+
id: "clip0_238_2909"
|
|
26
|
+
}, /*#__PURE__*/_react.default.createElement("rect", {
|
|
27
|
+
width: "44",
|
|
28
|
+
height: "8",
|
|
29
|
+
fill: "white"
|
|
30
|
+
}))));
|
|
31
|
+
};
|
|
32
|
+
var DottedStrokeIcon = exports.DottedStrokeIcon = function DottedStrokeIcon() {
|
|
33
|
+
return /*#__PURE__*/_react.default.createElement(CustomGlyph, null);
|
|
34
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.FadeStrokeIcon = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var CustomGlyph = function CustomGlyph() {
|
|
10
|
+
return /*#__PURE__*/_react.default.createElement("svg", {
|
|
11
|
+
width: "79",
|
|
12
|
+
height: "2",
|
|
13
|
+
viewBox: "0 0 79 2",
|
|
14
|
+
fill: "none",
|
|
15
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
16
|
+
}, /*#__PURE__*/_react.default.createElement("path", {
|
|
17
|
+
d: "M0 1C1.31667 1.06667 2.63333 1.13 3.95 1.19C15.8 1.73 27.65 2 39.5 2C51.35 2 63.2 1.73 75.05 1.19C76.3667 1.13 77.6833 1.06667 79 1C77.6833 0.933333 76.3667 0.87 75.05 0.81C63.2 0.27 51.35 0 39.5 0C27.65 0 15.8 0.27 3.95 0.81C2.63333 0.87 1.31667 0.933333 0 1Z",
|
|
18
|
+
fill: "url(#paint0_linear_238_2941)"
|
|
19
|
+
}), /*#__PURE__*/_react.default.createElement("defs", null, /*#__PURE__*/_react.default.createElement("linearGradient", {
|
|
20
|
+
id: "paint0_linear_238_2941",
|
|
21
|
+
x1: "0",
|
|
22
|
+
y1: "1.5",
|
|
23
|
+
x2: "79",
|
|
24
|
+
y2: "1.5",
|
|
25
|
+
gradientUnits: "userSpaceOnUse"
|
|
26
|
+
}, /*#__PURE__*/_react.default.createElement("stop", {
|
|
27
|
+
stopColor: "var(--ds-icon, #292A2E)",
|
|
28
|
+
stopOpacity: 0
|
|
29
|
+
}), /*#__PURE__*/_react.default.createElement("stop", {
|
|
30
|
+
offset: "0.274038",
|
|
31
|
+
stopColor: "var(--ds-icon, #292A2E)"
|
|
32
|
+
}), /*#__PURE__*/_react.default.createElement("stop", {
|
|
33
|
+
offset: "0.740385",
|
|
34
|
+
stopColor: "var(--ds-icon, #292A2E)"
|
|
35
|
+
}), /*#__PURE__*/_react.default.createElement("stop", {
|
|
36
|
+
offset: "1",
|
|
37
|
+
stopColor: "var(--ds-icon, #292A2E)",
|
|
38
|
+
stopOpacity: 0
|
|
39
|
+
}))));
|
|
40
|
+
};
|
|
41
|
+
var FadeStrokeIcon = exports.FadeStrokeIcon = function FadeStrokeIcon() {
|
|
42
|
+
return /*#__PURE__*/_react.default.createElement(CustomGlyph, null);
|
|
43
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.SketchStrokeIcon = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var CustomGlyph = function CustomGlyph() {
|
|
10
|
+
return /*#__PURE__*/_react.default.createElement("svg", {
|
|
11
|
+
width: "83",
|
|
12
|
+
height: "6",
|
|
13
|
+
viewBox: "0 0 83 6",
|
|
14
|
+
fill: "none",
|
|
15
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
16
|
+
}, /*#__PURE__*/_react.default.createElement("path", {
|
|
17
|
+
d: "M0.428223 4.0112C0.428223 4.0112 6.35543 1.20063 10.4282 1.0112C15.2535 0.786762 17.5977 4.0112 22.4282 4.0112C27.2587 4.0112 29.5977 1.01007 34.4282 1.0112C38.8335 1.01222 41.0265 3.33342 45.4282 3.5112C50.7856 3.72757 53.5691 0.845277 58.9282 1.0112C63.5219 1.15342 65.8325 3.47137 70.4282 3.5112C75.215 3.55267 77.6415 1.04949 82.4282 1.0112",
|
|
18
|
+
stroke: "var(--ds-icon, #292A2E)",
|
|
19
|
+
strokeWidth: "2"
|
|
20
|
+
}));
|
|
21
|
+
};
|
|
22
|
+
var SketchStrokeIcon = exports.SketchStrokeIcon = function SketchStrokeIcon() {
|
|
23
|
+
return /*#__PURE__*/_react.default.createElement(CustomGlyph, null);
|
|
24
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.SolidStrokeIcon = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var CustomGlyph = function CustomGlyph() {
|
|
10
|
+
return /*#__PURE__*/_react.default.createElement("svg", {
|
|
11
|
+
width: "44",
|
|
12
|
+
height: "8",
|
|
13
|
+
viewBox: "0 0 44 8",
|
|
14
|
+
fill: "none",
|
|
15
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
16
|
+
}, /*#__PURE__*/_react.default.createElement("g", {
|
|
17
|
+
clipPath: "url(#clip0_238_17340)"
|
|
18
|
+
}, /*#__PURE__*/_react.default.createElement("path", {
|
|
19
|
+
d: "M-78 4H122",
|
|
20
|
+
stroke: "var(--ds-icon, #292A2E)",
|
|
21
|
+
strokeWidth: "2"
|
|
22
|
+
})), /*#__PURE__*/_react.default.createElement("defs", null, /*#__PURE__*/_react.default.createElement("clipPath", {
|
|
23
|
+
id: "clip0_238_17340"
|
|
24
|
+
}, /*#__PURE__*/_react.default.createElement("rect", {
|
|
25
|
+
width: "44",
|
|
26
|
+
height: "8",
|
|
27
|
+
fill: "white"
|
|
28
|
+
}))));
|
|
29
|
+
};
|
|
30
|
+
var SolidStrokeIcon = exports.SolidStrokeIcon = function SolidStrokeIcon() {
|
|
31
|
+
return /*#__PURE__*/_react.default.createElement(CustomGlyph, null);
|
|
32
|
+
};
|
package/dist/cjs/ui/toolbar.js
CHANGED
|
@@ -10,14 +10,17 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
10
10
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
11
11
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
12
12
|
var _messages = _interopRequireDefault(require("@atlaskit/editor-common/messages"));
|
|
13
|
+
var _rule = require("@atlaskit/editor-common/messages/rule");
|
|
13
14
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
14
15
|
var _copy = _interopRequireDefault(require("@atlaskit/icon/core/copy"));
|
|
16
|
+
var _customize = _interopRequireDefault(require("@atlaskit/icon/core/customize"));
|
|
15
17
|
var _delete = _interopRequireDefault(require("@atlaskit/icon/core/delete"));
|
|
16
18
|
var _commands = require("../pm-plugins/commands");
|
|
19
|
+
var _DividerOptions = require("./DividerOptions");
|
|
17
20
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
18
21
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
19
|
-
var getToolbarItems = function getToolbarItems(formatMessage, ruleNodeType, api) {
|
|
20
|
-
var _api$decorations, _api$
|
|
22
|
+
var getToolbarItems = function getToolbarItems(formatMessage, ruleNodeType, ruleAttrs, api) {
|
|
23
|
+
var _api$decorations, _api$analytics3;
|
|
21
24
|
var hoverDecoration = api === null || api === void 0 || (_api$decorations = api.decorations) === null || _api$decorations === void 0 ? void 0 : _api$decorations.actions.hoverDecoration;
|
|
22
25
|
var hoverDecorationProps = function hoverDecorationProps(className) {
|
|
23
26
|
return {
|
|
@@ -27,7 +30,35 @@ var getToolbarItems = function getToolbarItems(formatMessage, ruleNodeType, api)
|
|
|
27
30
|
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(ruleNodeType, false, className)
|
|
28
31
|
};
|
|
29
32
|
};
|
|
30
|
-
var items = [
|
|
33
|
+
var items = [{
|
|
34
|
+
id: 'divider-options',
|
|
35
|
+
type: 'dropdown',
|
|
36
|
+
testId: 'divider-options',
|
|
37
|
+
title: formatMessage(_rule.ruleMessages.dividerOptions),
|
|
38
|
+
iconBefore: _customize.default,
|
|
39
|
+
options: {
|
|
40
|
+
width: 272,
|
|
41
|
+
height: 184,
|
|
42
|
+
render: function render(_ref) {
|
|
43
|
+
var dispatchCommand = _ref.dispatchCommand;
|
|
44
|
+
return /*#__PURE__*/_react.default.createElement(_DividerOptions.DividerOptions, {
|
|
45
|
+
style: ruleAttrs.style,
|
|
46
|
+
weight: ruleAttrs.weight,
|
|
47
|
+
onStyleChange: function onStyleChange(style) {
|
|
48
|
+
var _api$analytics;
|
|
49
|
+
return dispatchCommand((0, _commands.updateHorizontalRuleStyle)(style, api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions));
|
|
50
|
+
},
|
|
51
|
+
onWeightChange: function onWeightChange(weight) {
|
|
52
|
+
var _api$analytics2;
|
|
53
|
+
return dispatchCommand((0, _commands.updateHorizontalRuleWeight)(weight, api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions));
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}, {
|
|
59
|
+
type: 'separator',
|
|
60
|
+
fullHeight: true
|
|
61
|
+
}];
|
|
31
62
|
var overflowMenuItems = [{
|
|
32
63
|
type: 'overflow-dropdown',
|
|
33
64
|
options: [_objectSpread({
|
|
@@ -45,7 +76,7 @@ var getToolbarItems = function getToolbarItems(formatMessage, ruleNodeType, api)
|
|
|
45
76
|
icon: /*#__PURE__*/_react.default.createElement(_delete.default, {
|
|
46
77
|
label: ""
|
|
47
78
|
}),
|
|
48
|
-
onClick: (0, _commands.removeHorizontalRule)(api === null || api === void 0 || (_api$
|
|
79
|
+
onClick: (0, _commands.removeHorizontalRule)(api === null || api === void 0 || (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 ? void 0 : _api$analytics3.actions)
|
|
49
80
|
}, hoverDecorationProps())]
|
|
50
81
|
}];
|
|
51
82
|
items.push.apply(items, overflowMenuItems);
|
|
@@ -55,8 +86,8 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(stat
|
|
|
55
86
|
var formatMessage = intl.formatMessage;
|
|
56
87
|
var selection = state.selection;
|
|
57
88
|
var rule = state.schema.nodes.rule;
|
|
58
|
-
var
|
|
59
|
-
if (!
|
|
89
|
+
var ruleNode = (0, _utils.findSelectedNodeOfType)(state.schema.nodes.rule)(state.selection);
|
|
90
|
+
if (!ruleNode) {
|
|
60
91
|
return undefined;
|
|
61
92
|
}
|
|
62
93
|
var getDomRef = function getDomRef(editorView) {
|
|
@@ -65,10 +96,10 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(stat
|
|
|
65
96
|
return element;
|
|
66
97
|
};
|
|
67
98
|
return {
|
|
68
|
-
title:
|
|
99
|
+
title: formatMessage(_rule.ruleMessages.dividerFloatingControls),
|
|
69
100
|
getDomRef: getDomRef,
|
|
70
101
|
nodeType: [rule],
|
|
71
|
-
items: getToolbarItems(formatMessage, rule, api),
|
|
102
|
+
items: getToolbarItems(formatMessage, rule, ruleNode.node.attrs, api),
|
|
72
103
|
scrollable: true
|
|
73
104
|
};
|
|
74
105
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import { createHorizontalRule } from './input-rule';
|
|
3
2
|
import { findSelectedNodeOfType, removeSelectedNode } from '@atlaskit/editor-prosemirror/utils';
|
|
3
|
+
import { DEFAULT_DIVIDER_STYLE, DEFAULT_DIVIDER_WEIGHT } from '../ui/constants';
|
|
4
|
+
import { createHorizontalRule } from './input-rule';
|
|
4
5
|
export const insertHorizontalRule = editorAnalyticsAPI => inputMethod => (state, dispatch) => {
|
|
5
6
|
const tr = createHorizontalRule(state, state.selection.from, state.selection.to, inputMethod, editorAnalyticsAPI);
|
|
6
7
|
if (tr) {
|
|
@@ -32,4 +33,68 @@ export const removeHorizontalRule = editorAnalyticsAPI => (state, dispatch) => {
|
|
|
32
33
|
dispatch(deleteTr);
|
|
33
34
|
}
|
|
34
35
|
return true;
|
|
36
|
+
};
|
|
37
|
+
export const updateHorizontalRuleWeight = (weight, editorAnalyticsAPI) => (state, dispatch) => {
|
|
38
|
+
var _selectedRule$node$at;
|
|
39
|
+
const {
|
|
40
|
+
rule
|
|
41
|
+
} = state.schema.nodes;
|
|
42
|
+
const selectedRule = findSelectedNodeOfType(rule)(state.selection);
|
|
43
|
+
if (!selectedRule) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
const previousWeight = (_selectedRule$node$at = selectedRule.node.attrs.weight) !== null && _selectedRule$node$at !== void 0 ? _selectedRule$node$at : DEFAULT_DIVIDER_WEIGHT;
|
|
47
|
+
if (previousWeight === weight) {
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
if (dispatch) {
|
|
51
|
+
const updateTr = state.tr.setNodeMarkup(selectedRule.pos, undefined, {
|
|
52
|
+
...selectedRule.node.attrs,
|
|
53
|
+
weight
|
|
54
|
+
});
|
|
55
|
+
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent({
|
|
56
|
+
action: ACTION.UPDATED,
|
|
57
|
+
actionSubject: ACTION_SUBJECT.DIVIDER,
|
|
58
|
+
attributes: {
|
|
59
|
+
inputMethod: INPUT_METHOD.FLOATING_TB,
|
|
60
|
+
previousWeight,
|
|
61
|
+
weight
|
|
62
|
+
},
|
|
63
|
+
eventType: EVENT_TYPE.TRACK
|
|
64
|
+
})(updateTr);
|
|
65
|
+
dispatch(updateTr);
|
|
66
|
+
}
|
|
67
|
+
return true;
|
|
68
|
+
};
|
|
69
|
+
export const updateHorizontalRuleStyle = (style, editorAnalyticsAPI) => (state, dispatch) => {
|
|
70
|
+
var _selectedRule$node$at2;
|
|
71
|
+
const {
|
|
72
|
+
rule
|
|
73
|
+
} = state.schema.nodes;
|
|
74
|
+
const selectedRule = findSelectedNodeOfType(rule)(state.selection);
|
|
75
|
+
if (!selectedRule) {
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
const previousStyle = (_selectedRule$node$at2 = selectedRule.node.attrs.style) !== null && _selectedRule$node$at2 !== void 0 ? _selectedRule$node$at2 : DEFAULT_DIVIDER_STYLE;
|
|
79
|
+
if (previousStyle === style) {
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
if (dispatch) {
|
|
83
|
+
const updateTr = state.tr.setNodeMarkup(selectedRule.pos, undefined, {
|
|
84
|
+
...selectedRule.node.attrs,
|
|
85
|
+
style
|
|
86
|
+
});
|
|
87
|
+
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent({
|
|
88
|
+
action: ACTION.UPDATED,
|
|
89
|
+
actionSubject: ACTION_SUBJECT.DIVIDER,
|
|
90
|
+
attributes: {
|
|
91
|
+
inputMethod: INPUT_METHOD.FLOATING_TB,
|
|
92
|
+
previousStyle,
|
|
93
|
+
style
|
|
94
|
+
},
|
|
95
|
+
eventType: EVENT_TYPE.TRACK
|
|
96
|
+
})(updateTr);
|
|
97
|
+
dispatch(updateTr);
|
|
98
|
+
}
|
|
99
|
+
return true;
|
|
35
100
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { rule, ruleWithLocalId } from '@atlaskit/adf-schema/rule';
|
|
2
|
+
import { rule, ruleWithAttrs, ruleWithLocalId } from '@atlaskit/adf-schema/rule';
|
|
3
3
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
5
5
|
import { IconDivider } from '@atlaskit/editor-common/assets';
|
|
@@ -30,7 +30,7 @@ export const rulePlugin = ({
|
|
|
30
30
|
nodes() {
|
|
31
31
|
return [{
|
|
32
32
|
name: 'rule',
|
|
33
|
-
node: fg('platform_editor_adf_with_localid') ? ruleWithLocalId : rule
|
|
33
|
+
node: isExperimentEnabled('platform_editor_lovability_dividers_attributes') ? ruleWithAttrs : fg('platform_editor_adf_with_localid') ? ruleWithLocalId : rule
|
|
34
34
|
}];
|
|
35
35
|
},
|
|
36
36
|
actions: {
|