@atlaskit/editor-plugin-extension 1.5.4 → 1.6.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 +19 -0
- package/dist/cjs/actions.js +37 -1
- package/dist/cjs/plugin.js +36 -0
- package/dist/cjs/ui/ConfigPanel/ErrorMessage/ErrorImage.js +1 -0
- package/dist/cjs/ui/ConfigPanel/Fields/Boolean.js +2 -1
- package/dist/cjs/ui/ConfigPanel/Fields/CheckboxGroup.js +1 -0
- package/dist/cjs/ui/ConfigPanel/Fields/ColorPicker.js +3 -2
- package/dist/cjs/ui/ConfigPanel/Fields/DateRange.js +1 -1
- package/dist/cjs/ui/ConfigPanel/Fields/Expand.js +3 -1
- package/dist/cjs/ui/ConfigPanel/Fields/Fieldset.js +1 -1
- package/dist/cjs/ui/ConfigPanel/Fields/SelectItem.js +2 -1
- package/dist/cjs/ui/ConfigPanel/Fields/TabGroup.js +2 -0
- package/dist/cjs/ui/ConfigPanel/Fields/common/RequiredIndicator.js +3 -0
- package/dist/cjs/ui/ConfigPanel/Header.js +7 -2
- package/dist/cjs/ui/ConfigPanel/LoadingState.js +1 -0
- package/dist/cjs/ui/ConfigPanel/NestedForms/RemovableField.js +2 -0
- package/dist/cjs/ui/SaveIndicator/SaveIndicator.js +2 -0
- package/dist/es2019/actions.js +36 -0
- package/dist/es2019/plugin.js +35 -1
- package/dist/es2019/ui/ConfigPanel/ErrorMessage/ErrorImage.js +1 -0
- package/dist/es2019/ui/ConfigPanel/Fields/Boolean.js +3 -1
- package/dist/es2019/ui/ConfigPanel/Fields/CheckboxGroup.js +2 -0
- package/dist/es2019/ui/ConfigPanel/Fields/ColorPicker.js +4 -1
- package/dist/es2019/ui/ConfigPanel/Fields/DateRange.js +2 -0
- package/dist/es2019/ui/ConfigPanel/Fields/Expand.js +3 -1
- package/dist/es2019/ui/ConfigPanel/Fields/Fieldset.js +2 -0
- package/dist/es2019/ui/ConfigPanel/Fields/SelectItem.js +2 -1
- package/dist/es2019/ui/ConfigPanel/Fields/TabGroup.js +2 -0
- package/dist/es2019/ui/ConfigPanel/Fields/common/RequiredIndicator.js +2 -0
- package/dist/es2019/ui/ConfigPanel/Header.js +7 -2
- package/dist/es2019/ui/ConfigPanel/LoadingState.js +1 -0
- package/dist/es2019/ui/ConfigPanel/NestedForms/RemovableField.js +2 -0
- package/dist/es2019/ui/SaveIndicator/SaveIndicator.js +2 -0
- package/dist/esm/actions.js +36 -0
- package/dist/esm/plugin.js +37 -1
- package/dist/esm/ui/ConfigPanel/ErrorMessage/ErrorImage.js +1 -0
- package/dist/esm/ui/ConfigPanel/Fields/Boolean.js +3 -1
- package/dist/esm/ui/ConfigPanel/Fields/CheckboxGroup.js +2 -0
- package/dist/esm/ui/ConfigPanel/Fields/ColorPicker.js +4 -1
- package/dist/esm/ui/ConfigPanel/Fields/DateRange.js +2 -0
- package/dist/esm/ui/ConfigPanel/Fields/Expand.js +3 -1
- package/dist/esm/ui/ConfigPanel/Fields/Fieldset.js +2 -0
- package/dist/esm/ui/ConfigPanel/Fields/SelectItem.js +2 -1
- package/dist/esm/ui/ConfigPanel/Fields/TabGroup.js +2 -0
- package/dist/esm/ui/ConfigPanel/Fields/common/RequiredIndicator.js +2 -0
- package/dist/esm/ui/ConfigPanel/Header.js +7 -2
- package/dist/esm/ui/ConfigPanel/LoadingState.js +1 -0
- package/dist/esm/ui/ConfigPanel/NestedForms/RemovableField.js +2 -0
- package/dist/esm/ui/SaveIndicator/SaveIndicator.js +2 -0
- package/dist/types/actions.d.ts +4 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/types.d.ts +14 -2
- package/dist/types-ts4.5/actions.d.ts +4 -0
- package/dist/types-ts4.5/index.d.ts +1 -1
- package/dist/types-ts4.5/types.d.ts +14 -2
- package/example-utils/config-panel/ConfigPanelWithExtensionPicker.tsx +4 -0
- package/package.json +117 -117
package/dist/esm/actions.js
CHANGED
|
@@ -221,4 +221,40 @@ export var createEditSelectedExtensionAction = function createEditSelectedExtens
|
|
|
221
221
|
updateExtension = _getPluginState2.updateExtension;
|
|
222
222
|
return editExtension(null, applyChangeToContextPanel, editorAnalyticsAPI, updateExtension)(view.state, view.dispatch, view);
|
|
223
223
|
};
|
|
224
|
+
};
|
|
225
|
+
export var insertOrReplaceExtension = function insertOrReplaceExtension(_ref3) {
|
|
226
|
+
var editorView = _ref3.editorView,
|
|
227
|
+
action = _ref3.action,
|
|
228
|
+
attrs = _ref3.attrs,
|
|
229
|
+
content = _ref3.content,
|
|
230
|
+
position = _ref3.position,
|
|
231
|
+
_ref3$size = _ref3.size,
|
|
232
|
+
size = _ref3$size === void 0 ? 0 : _ref3$size,
|
|
233
|
+
tr = _ref3.tr;
|
|
234
|
+
var newNode = editorView.state.schema.node('extension', attrs, content);
|
|
235
|
+
if (action === 'insert') {
|
|
236
|
+
tr = editorView.state.tr.insert(position, newNode);
|
|
237
|
+
return tr;
|
|
238
|
+
} else {
|
|
239
|
+
tr.replaceWith(position, position + size, newNode);
|
|
240
|
+
return tr;
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
export var insertOrReplaceBodiedExtension = function insertOrReplaceBodiedExtension(_ref4) {
|
|
244
|
+
var editorView = _ref4.editorView,
|
|
245
|
+
action = _ref4.action,
|
|
246
|
+
attrs = _ref4.attrs,
|
|
247
|
+
content = _ref4.content,
|
|
248
|
+
position = _ref4.position,
|
|
249
|
+
_ref4$size = _ref4.size,
|
|
250
|
+
size = _ref4$size === void 0 ? 0 : _ref4$size,
|
|
251
|
+
tr = _ref4.tr;
|
|
252
|
+
var newNode = editorView.state.schema.node('bodiedExtension', attrs, content);
|
|
253
|
+
if (action === 'insert') {
|
|
254
|
+
tr = editorView.state.tr.insert(position, newNode);
|
|
255
|
+
return tr;
|
|
256
|
+
} else {
|
|
257
|
+
tr.replaceWith(position, position + size, newNode);
|
|
258
|
+
return tr;
|
|
259
|
+
}
|
|
224
260
|
};
|
package/dist/esm/plugin.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { bodiedExtension, extension, extensionFrame, inlineExtension, multiBodiedExtension } from '@atlaskit/adf-schema';
|
|
2
2
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
3
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
4
|
-
import { createEditSelectedExtensionAction } from './actions';
|
|
4
|
+
import { createEditSelectedExtensionAction, insertOrReplaceBodiedExtension as _insertOrReplaceBodiedExtension, insertOrReplaceExtension as _insertOrReplaceExtension } from './actions';
|
|
5
5
|
import { forceAutoSave } from './commands';
|
|
6
6
|
import { getContextPanel } from './context-panel';
|
|
7
7
|
import { createExtensionAPI } from './extension-api';
|
|
@@ -117,6 +117,42 @@ export var extensionPlugin = function extensionPlugin(_ref) {
|
|
|
117
117
|
});
|
|
118
118
|
},
|
|
119
119
|
insertMacroFromMacroBrowser: insertMacroFromMacroBrowser(_api === null || _api === void 0 || (_api$analytics2 = _api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions),
|
|
120
|
+
insertOrReplaceExtension: function insertOrReplaceExtension(_ref4) {
|
|
121
|
+
var editorView = _ref4.editorView,
|
|
122
|
+
action = _ref4.action,
|
|
123
|
+
attrs = _ref4.attrs,
|
|
124
|
+
content = _ref4.content,
|
|
125
|
+
position = _ref4.position,
|
|
126
|
+
size = _ref4.size,
|
|
127
|
+
tr = _ref4.tr;
|
|
128
|
+
return _insertOrReplaceExtension({
|
|
129
|
+
editorView: editorView,
|
|
130
|
+
action: action,
|
|
131
|
+
attrs: attrs,
|
|
132
|
+
content: content,
|
|
133
|
+
position: position,
|
|
134
|
+
size: size,
|
|
135
|
+
tr: tr
|
|
136
|
+
});
|
|
137
|
+
},
|
|
138
|
+
insertOrReplaceBodiedExtension: function insertOrReplaceBodiedExtension(_ref5) {
|
|
139
|
+
var editorView = _ref5.editorView,
|
|
140
|
+
action = _ref5.action,
|
|
141
|
+
attrs = _ref5.attrs,
|
|
142
|
+
content = _ref5.content,
|
|
143
|
+
position = _ref5.position,
|
|
144
|
+
size = _ref5.size,
|
|
145
|
+
tr = _ref5.tr;
|
|
146
|
+
return _insertOrReplaceBodiedExtension({
|
|
147
|
+
editorView: editorView,
|
|
148
|
+
action: action,
|
|
149
|
+
attrs: attrs,
|
|
150
|
+
content: content,
|
|
151
|
+
position: position,
|
|
152
|
+
size: size,
|
|
153
|
+
tr: tr
|
|
154
|
+
});
|
|
155
|
+
},
|
|
120
156
|
editSelectedExtension: createEditSelectedExtensionAction({
|
|
121
157
|
editorViewRef: editorViewRef,
|
|
122
158
|
editorAnalyticsAPI: _api === null || _api === void 0 || (_api$analytics3 = _api.analytics) === null || _api$analytics3 === void 0 ? void 0 : _api$analytics3.actions,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
2
2
|
// Quality Ticket: https://product-fabric.atlassian.net/browse/DSP-4249
|
|
3
3
|
/** @jsx jsx */
|
|
4
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
4
5
|
import { css, jsx } from '@emotion/react';
|
|
5
6
|
var imageContainerStyles = css({
|
|
6
7
|
margin: "0 auto ".concat("var(--ds-space-300, 24px)"),
|
|
@@ -4,6 +4,8 @@ var _excluded = ["value"],
|
|
|
4
4
|
_excluded2 = ["id", "value"];
|
|
5
5
|
/** @jsx jsx */
|
|
6
6
|
import React, { Fragment } from 'react';
|
|
7
|
+
|
|
8
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
7
9
|
import { css, jsx } from '@emotion/react';
|
|
8
10
|
import { Checkbox as AKCheckbox } from '@atlaskit/checkbox';
|
|
9
11
|
import { Field } from '@atlaskit/form';
|
|
@@ -106,7 +108,7 @@ function Toggle(_ref3) {
|
|
|
106
108
|
id: id,
|
|
107
109
|
htmlFor: id
|
|
108
110
|
}, label, isRequired ?
|
|
109
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
111
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
110
112
|
jsx("span", {
|
|
111
113
|
css: requiredIndicator,
|
|
112
114
|
"aria-hidden": "true"
|
|
@@ -5,6 +5,8 @@ var _excluded = ["onChange", "value"];
|
|
|
5
5
|
/** @jsx jsx */
|
|
6
6
|
|
|
7
7
|
import { Fragment, useCallback } from 'react';
|
|
8
|
+
|
|
9
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
10
|
import { css, jsx } from '@emotion/react';
|
|
9
11
|
import { Checkbox as AKCheckbox } from '@atlaskit/checkbox';
|
|
10
12
|
import { Fieldset as AKFieldset, Field } from '@atlaskit/form';
|
|
@@ -3,6 +3,8 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
3
3
|
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) { _defineProperty(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; }
|
|
4
4
|
/** @jsx jsx */
|
|
5
5
|
import { Fragment } from 'react';
|
|
6
|
+
|
|
7
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
6
8
|
import { css, jsx } from '@emotion/react';
|
|
7
9
|
import { chartsColorPaletteTooltipMessages, DEFAULT_BORDER_COLOR } from '@atlaskit/editor-common/ui-color';
|
|
8
10
|
import { ColorPickerButton } from '@atlaskit/editor-common/ui-menu';
|
|
@@ -326,6 +328,7 @@ var colorPickerWrapperStyles = css({
|
|
|
326
328
|
paddingRight: "var(--ds-space-100, 8px)"
|
|
327
329
|
});
|
|
328
330
|
var colorPickerLabelStyles = css({
|
|
331
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
329
332
|
fontSize: "".concat(headingSizes.h400.size, "px"),
|
|
330
333
|
marginTop: 0
|
|
331
334
|
});
|
|
@@ -389,7 +392,7 @@ var ColorPickerField = function ColorPickerField(_ref) {
|
|
|
389
392
|
}, jsx("label", {
|
|
390
393
|
css: colorPickerLabelStyles
|
|
391
394
|
}, label, isRequired &&
|
|
392
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
395
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
393
396
|
jsx("span", {
|
|
394
397
|
css: requiredIndicator,
|
|
395
398
|
"aria-hidden": "true"
|
|
@@ -6,6 +6,8 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
6
6
|
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) { _defineProperty(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; }
|
|
7
7
|
/** @jsx jsx */
|
|
8
8
|
import { Fragment, useEffect, useMemo, useState } from 'react';
|
|
9
|
+
|
|
10
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
11
|
import { css, jsx } from '@emotion/react';
|
|
10
12
|
import { injectIntl } from 'react-intl-next';
|
|
11
13
|
import { DatePicker } from '@atlaskit/datetime-picker';
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
/** @jsx jsx */
|
|
3
3
|
import React, { useState } from 'react';
|
|
4
|
+
|
|
5
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
4
6
|
import { css, jsx } from '@emotion/react';
|
|
5
7
|
import { injectIntl } from 'react-intl-next';
|
|
6
8
|
import Button from '@atlaskit/button';
|
|
@@ -20,7 +22,7 @@ var expandControlStyles = css({
|
|
|
20
22
|
var chevronContainerStyles = css({
|
|
21
23
|
display: 'flex',
|
|
22
24
|
alignItems: 'center',
|
|
23
|
-
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles
|
|
25
|
+
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
24
26
|
'& > button': {
|
|
25
27
|
width: "var(--ds-space-300, 24px)",
|
|
26
28
|
height: "var(--ds-space-300, 24px)"
|
|
@@ -13,6 +13,8 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
13
13
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
14
14
|
/** @jsx jsx */
|
|
15
15
|
import React, { Fragment } from 'react';
|
|
16
|
+
|
|
17
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
16
18
|
import { css, jsx } from '@emotion/react';
|
|
17
19
|
import { injectIntl } from 'react-intl-next';
|
|
18
20
|
import Button from '@atlaskit/button/custom-theme-button';
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
2
3
|
import { css, jsx } from '@emotion/react';
|
|
3
4
|
import Avatar from '@atlaskit/avatar';
|
|
4
5
|
var itemWrapperStyles = css({
|
|
5
6
|
display: 'flex',
|
|
6
7
|
alignItems: 'center',
|
|
7
|
-
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles
|
|
8
|
+
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
8
9
|
small: {
|
|
9
10
|
margin: 0,
|
|
10
11
|
display: 'block',
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
/** @jsx jsx */
|
|
3
3
|
import React, { useState } from 'react';
|
|
4
|
+
|
|
5
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
4
6
|
import { css, jsx } from '@emotion/react';
|
|
5
7
|
import { injectIntl } from 'react-intl-next';
|
|
6
8
|
import Tabs, { Tab, TabList, TabPanel } from '@atlaskit/tabs';
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
1
2
|
import { css } from '@emotion/react';
|
|
2
3
|
import { R500 } from '@atlaskit/theme/colors';
|
|
4
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
3
5
|
export var requiredIndicator = css({
|
|
4
6
|
color: "var(--ds-text-danger, ".concat(R500, ")")
|
|
5
7
|
});
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { Fragment } from 'react';
|
|
3
|
+
|
|
4
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
3
5
|
import { css, jsx } from '@emotion/react';
|
|
4
6
|
import { injectIntl } from 'react-intl-next';
|
|
5
7
|
import Loadable from 'react-loadable';
|
|
@@ -22,12 +24,13 @@ var itemIconStyles = css({
|
|
|
22
24
|
height: iconWidth,
|
|
23
25
|
overflow: 'hidden',
|
|
24
26
|
border: "1px solid ".concat("var(--ds-border, rgba(223, 225, 229, 0.5))"),
|
|
27
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
25
28
|
borderRadius: "".concat(borderRadius(), "px"),
|
|
26
29
|
boxSizing: 'border-box',
|
|
27
30
|
display: 'flex',
|
|
28
31
|
justifyContent: 'center',
|
|
29
32
|
alignItems: 'center',
|
|
30
|
-
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles
|
|
33
|
+
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
31
34
|
div: {
|
|
32
35
|
width: iconWidth,
|
|
33
36
|
height: iconWidth
|
|
@@ -41,6 +44,7 @@ var itemBodyStyles = css({
|
|
|
41
44
|
lineHeight: 1.4,
|
|
42
45
|
margin: "0 ".concat("var(--ds-space-200, 16px)"),
|
|
43
46
|
flexGrow: 3,
|
|
47
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
44
48
|
maxWidth: "calc(100% - ".concat(gapSizeForEllipsis, "px)")
|
|
45
49
|
});
|
|
46
50
|
var centeredItemTitleStyles = css({
|
|
@@ -51,8 +55,9 @@ var centeredItemTitleStyles = css({
|
|
|
51
55
|
var itemTextStyles = css({
|
|
52
56
|
maxWidth: '100%',
|
|
53
57
|
whiteSpace: 'initial',
|
|
54
|
-
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles
|
|
58
|
+
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
55
59
|
itemSummary: {
|
|
60
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
56
61
|
fontSize: relativeFontSizeToBase16(11.67),
|
|
57
62
|
color: "var(--ds-text-subtlest, ".concat(N200, ")"),
|
|
58
63
|
marginTop: "var(--ds-space-050, 4px)",
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React from 'react';
|
|
3
|
+
|
|
4
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
3
5
|
import { css, jsx } from '@emotion/react';
|
|
4
6
|
import { injectIntl } from 'react-intl-next';
|
|
5
7
|
import { configPanelMessages as messages } from '@atlaskit/editor-common/extensions';
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
/** @jsx jsx */
|
|
3
3
|
import { Fragment, useCallback, useEffect, useRef, useState } from 'react';
|
|
4
|
+
|
|
5
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
4
6
|
import { css, jsx } from '@emotion/react';
|
|
5
7
|
import { FormattedMessage } from 'react-intl-next';
|
|
6
8
|
import { messages } from '@atlaskit/editor-common/extensions';
|
package/dist/types/actions.d.ts
CHANGED
|
@@ -5,7 +5,9 @@ import type { MacroProvider } from '@atlaskit/editor-common/provider-factory';
|
|
|
5
5
|
import type { Command } from '@atlaskit/editor-common/types';
|
|
6
6
|
import type { ApplyChangeHandler } from '@atlaskit/editor-plugin-context-panel';
|
|
7
7
|
import type { Fragment, Mark, Node as PmNode, Schema } from '@atlaskit/editor-prosemirror/model';
|
|
8
|
+
import { type Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
8
9
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
10
|
+
import type { InsertOrReplaceExtensionType } from './types';
|
|
9
11
|
export declare const buildExtensionNode: <S extends Schema<any, any>>(type: 'inlineExtension' | 'extension' | 'bodiedExtension' | 'multiBodiedExtension', schema: S, attrs: object, content?: Fragment, marks?: readonly Mark[]) => PmNode;
|
|
10
12
|
export declare const performNodeUpdate: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (type: 'inlineExtension' | 'extension' | 'bodiedExtension' | 'multiBodiedExtension', newAttrs: object, content: Fragment, marks: readonly Mark[], shouldScrollIntoView: boolean) => Command;
|
|
11
13
|
export declare const editExtension: (macroProvider: MacroProvider | null | undefined, applyChangeToContextPanel: ApplyChangeHandler | undefined, editorAnalyticsAPI: EditorAnalyticsAPI | undefined, updateExtension?: Promise<UpdateExtension<object> | void>) => Command;
|
|
@@ -15,3 +17,5 @@ type Props = {
|
|
|
15
17
|
applyChangeToContextPanel: ApplyChangeHandler | undefined;
|
|
16
18
|
};
|
|
17
19
|
export declare const createEditSelectedExtensionAction: ({ editorViewRef, editorAnalyticsAPI, applyChangeToContextPanel }: Props) => () => boolean;
|
|
20
|
+
export declare const insertOrReplaceExtension: ({ editorView, action, attrs, content, position, size, tr, }: InsertOrReplaceExtensionType) => Transaction;
|
|
21
|
+
export declare const insertOrReplaceBodiedExtension: ({ editorView, action, attrs, content, position, size, tr, }: InsertOrReplaceExtensionType) => Transaction;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type { CreateExtensionAPI, ExtensionPlugin, ExtensionPluginOptions, RunMacroAutoConvert, RejectSave, } from './types';
|
|
1
|
+
export type { CreateExtensionAPI, ExtensionPlugin, ExtensionPluginOptions, InsertOrReplaceExtensionType, RunMacroAutoConvert, RejectSave, } from './types';
|
|
2
2
|
export { extensionPlugin } from './plugin';
|
package/dist/types/types.d.ts
CHANGED
|
@@ -8,8 +8,8 @@ import type { ApplyChangeHandler, ContextPanelPlugin } from '@atlaskit/editor-pl
|
|
|
8
8
|
import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
9
9
|
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
10
10
|
import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
|
|
11
|
-
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
12
|
-
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
11
|
+
import type { Fragment, Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
12
|
+
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
13
13
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
14
14
|
import type { forceAutoSave } from './commands';
|
|
15
15
|
export type RejectSave = (reason?: any) => void;
|
|
@@ -44,6 +44,16 @@ export interface ExtensionPluginOptions extends LongPressSelectionPluginOptions
|
|
|
44
44
|
}
|
|
45
45
|
type InsertMacroFromMacroBrowser = (macroProvider: MacroProvider, macroNode?: PmNode, isEditing?: boolean) => (view: EditorView) => Promise<boolean>;
|
|
46
46
|
export type RunMacroAutoConvert = (state: EditorState, text: string) => PmNode | null;
|
|
47
|
+
export type InsertOrReplaceExtensionType = {
|
|
48
|
+
editorView: EditorView;
|
|
49
|
+
action: 'insert' | 'replace';
|
|
50
|
+
attrs: object;
|
|
51
|
+
content: Fragment;
|
|
52
|
+
position: number;
|
|
53
|
+
size: number;
|
|
54
|
+
tr: Transaction;
|
|
55
|
+
};
|
|
56
|
+
type InsertOrReplaceExtensionAction = ({ editorView, action, attrs, content, position, size, tr, }: InsertOrReplaceExtensionType) => Transaction;
|
|
47
57
|
export type ExtensionPlugin = NextEditorPlugin<'extension', {
|
|
48
58
|
pluginConfiguration: ExtensionPluginOptions | undefined;
|
|
49
59
|
dependencies: [
|
|
@@ -61,6 +71,8 @@ export type ExtensionPlugin = NextEditorPlugin<'extension', {
|
|
|
61
71
|
editSelectedExtension: () => boolean;
|
|
62
72
|
api: () => ExtensionAPI;
|
|
63
73
|
insertMacroFromMacroBrowser: InsertMacroFromMacroBrowser;
|
|
74
|
+
insertOrReplaceExtension: InsertOrReplaceExtensionAction;
|
|
75
|
+
insertOrReplaceBodiedExtension: InsertOrReplaceExtensionAction;
|
|
64
76
|
runMacroAutoConvert: RunMacroAutoConvert;
|
|
65
77
|
forceAutoSave: typeof forceAutoSave;
|
|
66
78
|
};
|
|
@@ -5,7 +5,9 @@ import type { MacroProvider } from '@atlaskit/editor-common/provider-factory';
|
|
|
5
5
|
import type { Command } from '@atlaskit/editor-common/types';
|
|
6
6
|
import type { ApplyChangeHandler } from '@atlaskit/editor-plugin-context-panel';
|
|
7
7
|
import type { Fragment, Mark, Node as PmNode, Schema } from '@atlaskit/editor-prosemirror/model';
|
|
8
|
+
import { type Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
8
9
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
10
|
+
import type { InsertOrReplaceExtensionType } from './types';
|
|
9
11
|
export declare const buildExtensionNode: <S extends Schema<any, any>>(type: 'inlineExtension' | 'extension' | 'bodiedExtension' | 'multiBodiedExtension', schema: S, attrs: object, content?: Fragment, marks?: readonly Mark[]) => PmNode;
|
|
10
12
|
export declare const performNodeUpdate: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (type: 'inlineExtension' | 'extension' | 'bodiedExtension' | 'multiBodiedExtension', newAttrs: object, content: Fragment, marks: readonly Mark[], shouldScrollIntoView: boolean) => Command;
|
|
11
13
|
export declare const editExtension: (macroProvider: MacroProvider | null | undefined, applyChangeToContextPanel: ApplyChangeHandler | undefined, editorAnalyticsAPI: EditorAnalyticsAPI | undefined, updateExtension?: Promise<UpdateExtension<object> | void>) => Command;
|
|
@@ -15,3 +17,5 @@ type Props = {
|
|
|
15
17
|
applyChangeToContextPanel: ApplyChangeHandler | undefined;
|
|
16
18
|
};
|
|
17
19
|
export declare const createEditSelectedExtensionAction: ({ editorViewRef, editorAnalyticsAPI, applyChangeToContextPanel }: Props) => () => boolean;
|
|
20
|
+
export declare const insertOrReplaceExtension: ({ editorView, action, attrs, content, position, size, tr, }: InsertOrReplaceExtensionType) => Transaction;
|
|
21
|
+
export declare const insertOrReplaceBodiedExtension: ({ editorView, action, attrs, content, position, size, tr, }: InsertOrReplaceExtensionType) => Transaction;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type { CreateExtensionAPI, ExtensionPlugin, ExtensionPluginOptions, RunMacroAutoConvert, RejectSave, } from './types';
|
|
1
|
+
export type { CreateExtensionAPI, ExtensionPlugin, ExtensionPluginOptions, InsertOrReplaceExtensionType, RunMacroAutoConvert, RejectSave, } from './types';
|
|
2
2
|
export { extensionPlugin } from './plugin';
|
|
@@ -8,8 +8,8 @@ import type { ApplyChangeHandler, ContextPanelPlugin } from '@atlaskit/editor-pl
|
|
|
8
8
|
import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
9
9
|
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
10
10
|
import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
|
|
11
|
-
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
12
|
-
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
11
|
+
import type { Fragment, Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
12
|
+
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
13
13
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
14
14
|
import type { forceAutoSave } from './commands';
|
|
15
15
|
export type RejectSave = (reason?: any) => void;
|
|
@@ -44,6 +44,16 @@ export interface ExtensionPluginOptions extends LongPressSelectionPluginOptions
|
|
|
44
44
|
}
|
|
45
45
|
type InsertMacroFromMacroBrowser = (macroProvider: MacroProvider, macroNode?: PmNode, isEditing?: boolean) => (view: EditorView) => Promise<boolean>;
|
|
46
46
|
export type RunMacroAutoConvert = (state: EditorState, text: string) => PmNode | null;
|
|
47
|
+
export type InsertOrReplaceExtensionType = {
|
|
48
|
+
editorView: EditorView;
|
|
49
|
+
action: 'insert' | 'replace';
|
|
50
|
+
attrs: object;
|
|
51
|
+
content: Fragment;
|
|
52
|
+
position: number;
|
|
53
|
+
size: number;
|
|
54
|
+
tr: Transaction;
|
|
55
|
+
};
|
|
56
|
+
type InsertOrReplaceExtensionAction = ({ editorView, action, attrs, content, position, size, tr, }: InsertOrReplaceExtensionType) => Transaction;
|
|
47
57
|
export type ExtensionPlugin = NextEditorPlugin<'extension', {
|
|
48
58
|
pluginConfiguration: ExtensionPluginOptions | undefined;
|
|
49
59
|
dependencies: [
|
|
@@ -61,6 +71,8 @@ export type ExtensionPlugin = NextEditorPlugin<'extension', {
|
|
|
61
71
|
editSelectedExtension: () => boolean;
|
|
62
72
|
api: () => ExtensionAPI;
|
|
63
73
|
insertMacroFromMacroBrowser: InsertMacroFromMacroBrowser;
|
|
74
|
+
insertOrReplaceExtension: InsertOrReplaceExtensionAction;
|
|
75
|
+
insertOrReplaceBodiedExtension: InsertOrReplaceExtensionAction;
|
|
64
76
|
runMacroAutoConvert: RunMacroAutoConvert;
|
|
65
77
|
forceAutoSave: typeof forceAutoSave;
|
|
66
78
|
};
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
/** @jsx jsx */
|
|
3
3
|
import { useEffect, useState } from 'react';
|
|
4
4
|
|
|
5
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
5
6
|
import { css, jsx } from '@emotion/react';
|
|
6
7
|
import { IntlProvider } from 'react-intl-next';
|
|
7
8
|
|
|
@@ -31,9 +32,12 @@ const exampleWrapperStyles = css({ display: 'flex', flexDirection: 'row' });
|
|
|
31
32
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
32
33
|
const column = (width: number | string) =>
|
|
33
34
|
css({
|
|
35
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
34
36
|
width: `${width}px`,
|
|
35
37
|
margin: token('space.200', '16px'),
|
|
38
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
36
39
|
h3: {
|
|
40
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
37
41
|
borderBottom: `1px solid ${colors.N50}`,
|
|
38
42
|
marginBottom: token('space.200', '16px'),
|
|
39
43
|
},
|