@atlaskit/editor-common 112.8.1 → 112.8.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 +17 -0
- package/dist/cjs/card/ui/assets/card.js +1 -1
- package/dist/cjs/card/ui/assets/embed.js +1 -1
- package/dist/cjs/card/ui/assets/inline.js +1 -1
- package/dist/cjs/card/ui/assets/url.js +1 -1
- package/dist/cjs/extensibility/Extension/Extension/index.js +3 -3
- package/dist/cjs/extensibility/Extension/Lozenge/ExtensionLabel.js +1 -1
- package/dist/cjs/extensibility/Extension.js +1 -1
- package/dist/cjs/link/ConfigureLinkOverlay/Dropdown.js +2 -2
- package/dist/cjs/link/LinkPicker/HyperlinkAddToolbar/index.js +2 -2
- package/dist/cjs/link/LinkSearch/LinkSearchList.js +2 -2
- package/dist/cjs/link/LinkSearch/withActivityProvider.js +1 -1
- package/dist/cjs/media-inline/inline-image-card.js +1 -1
- package/dist/cjs/media-inline/media-inline-image-card.js +2 -2
- package/dist/cjs/media-single/CommentBadge.js +1 -1
- package/dist/cjs/media-single/CommentBadgeNext.js +1 -1
- package/dist/cjs/media-single/MediaBadges.js +1 -1
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/preset/core-plugin/index.js +36 -1
- package/dist/cjs/preset/core-plugin/pm-plugins/appearance-plugin.js +36 -0
- package/dist/cjs/preset/plugin-injection-api.js +27 -2
- package/dist/cjs/react-node-view/onVisibleObserverFactory.js +1 -1
- package/dist/cjs/resizer/BreakoutResizer.js +1 -1
- package/dist/cjs/resizer/Resizer.js +1 -1
- package/dist/cjs/toolbar/context.js +1 -1
- package/dist/cjs/ui/ContextPanel/context.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/FloatingToolbar/Button.js +2 -2
- package/dist/cjs/ui/Mention/index.js +1 -1
- package/dist/cjs/ui/ResizerLegacy/index.js +1 -1
- package/dist/cjs/ui/TableSelector/index.js +1 -1
- package/dist/cjs/ui-menu/ColorPickerButton/index.js +4 -4
- package/dist/cjs/ui-menu/DropdownMenu/index.js +6 -6
- package/dist/cjs/utils/commands.js +1 -2
- package/dist/es2019/card/ui/assets/card.js +1 -1
- package/dist/es2019/card/ui/assets/embed.js +1 -1
- package/dist/es2019/card/ui/assets/inline.js +1 -1
- package/dist/es2019/card/ui/assets/url.js +1 -1
- package/dist/es2019/extensibility/Extension/Extension/index.js +3 -3
- package/dist/es2019/extensibility/Extension/Lozenge/ExtensionLabel.js +1 -1
- package/dist/es2019/extensibility/Extension.js +1 -1
- package/dist/es2019/link/ConfigureLinkOverlay/Dropdown.js +2 -2
- package/dist/es2019/link/LinkPicker/HyperlinkAddToolbar/index.js +2 -2
- package/dist/es2019/link/LinkSearch/LinkSearchList.js +2 -2
- package/dist/es2019/link/LinkSearch/withActivityProvider.js +1 -1
- package/dist/es2019/media-inline/inline-image-card.js +1 -1
- package/dist/es2019/media-inline/media-inline-image-card.js +2 -2
- package/dist/es2019/media-single/CommentBadge.js +1 -1
- package/dist/es2019/media-single/CommentBadgeNext.js +1 -1
- package/dist/es2019/media-single/MediaBadges.js +1 -1
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/preset/core-plugin/index.js +34 -1
- package/dist/es2019/preset/core-plugin/pm-plugins/appearance-plugin.js +24 -0
- package/dist/es2019/preset/plugin-injection-api.js +25 -2
- package/dist/es2019/react-node-view/onVisibleObserverFactory.js +2 -0
- package/dist/es2019/resizer/BreakoutResizer.js +1 -1
- package/dist/es2019/resizer/Resizer.js +1 -1
- package/dist/es2019/toolbar/context.js +1 -1
- package/dist/es2019/ui/ContextPanel/context.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/FloatingToolbar/Button.js +2 -2
- package/dist/es2019/ui/Mention/index.js +1 -1
- package/dist/es2019/ui/ResizerLegacy/index.js +1 -1
- package/dist/es2019/ui/TableSelector/index.js +1 -1
- package/dist/es2019/ui-menu/ColorPickerButton/index.js +4 -4
- package/dist/es2019/ui-menu/DropdownMenu/index.js +6 -6
- package/dist/es2019/utils/commands.js +1 -2
- package/dist/esm/card/ui/assets/card.js +1 -1
- package/dist/esm/card/ui/assets/embed.js +1 -1
- package/dist/esm/card/ui/assets/inline.js +1 -1
- package/dist/esm/card/ui/assets/url.js +1 -1
- package/dist/esm/extensibility/Extension/Extension/index.js +3 -3
- package/dist/esm/extensibility/Extension/Lozenge/ExtensionLabel.js +1 -1
- package/dist/esm/extensibility/Extension.js +1 -1
- package/dist/esm/link/ConfigureLinkOverlay/Dropdown.js +2 -2
- package/dist/esm/link/LinkPicker/HyperlinkAddToolbar/index.js +2 -2
- package/dist/esm/link/LinkSearch/LinkSearchList.js +2 -2
- package/dist/esm/link/LinkSearch/withActivityProvider.js +1 -1
- package/dist/esm/media-inline/inline-image-card.js +1 -1
- package/dist/esm/media-inline/media-inline-image-card.js +2 -2
- package/dist/esm/media-single/CommentBadge.js +1 -1
- package/dist/esm/media-single/CommentBadgeNext.js +1 -1
- package/dist/esm/media-single/MediaBadges.js +1 -1
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/preset/core-plugin/index.js +36 -1
- package/dist/esm/preset/core-plugin/pm-plugins/appearance-plugin.js +28 -0
- package/dist/esm/preset/plugin-injection-api.js +27 -2
- package/dist/esm/react-node-view/onVisibleObserverFactory.js +2 -0
- package/dist/esm/resizer/BreakoutResizer.js +1 -1
- package/dist/esm/resizer/Resizer.js +1 -1
- package/dist/esm/toolbar/context.js +1 -1
- package/dist/esm/ui/ContextPanel/context.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/FloatingToolbar/Button.js +2 -2
- package/dist/esm/ui/Mention/index.js +1 -1
- package/dist/esm/ui/ResizerLegacy/index.js +1 -1
- package/dist/esm/ui/TableSelector/index.js +1 -1
- package/dist/esm/ui-menu/ColorPickerButton/index.js +4 -4
- package/dist/esm/ui-menu/DropdownMenu/index.js +6 -6
- package/dist/esm/utils/commands.js +1 -2
- package/dist/types/preset/core-plugin/pm-plugins/appearance-plugin.d.ts +9 -0
- package/dist/types/preset/plugin-injection-api.d.ts +11 -1
- package/dist/types/types/next-editor-plugin.d.ts +15 -0
- package/dist/types-ts4.5/preset/core-plugin/pm-plugins/appearance-plugin.d.ts +9 -0
- package/dist/types-ts4.5/preset/plugin-injection-api.d.ts +11 -1
- package/dist/types-ts4.5/types/next-editor-plugin.d.ts +15 -0
- package/package.json +3 -6
|
@@ -181,7 +181,7 @@ export var ExtensionLabel = function ExtensionLabel(_ref) {
|
|
|
181
181
|
// Ignored via go/ees005
|
|
182
182
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
183
183
|
, _extends({}, i18n.configure, {
|
|
184
|
-
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
184
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
185
185
|
values: {
|
|
186
186
|
macroName: text
|
|
187
187
|
}
|
|
@@ -77,7 +77,7 @@ export var Extension = /*#__PURE__*/function (_Component) {
|
|
|
77
77
|
key: "render",
|
|
78
78
|
value: function render() {
|
|
79
79
|
return /*#__PURE__*/React.createElement(WithProviders
|
|
80
|
-
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
80
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
81
81
|
, {
|
|
82
82
|
providers: ['extensionProvider'],
|
|
83
83
|
providerFactory: this.providerFactory,
|
|
@@ -63,7 +63,7 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
63
63
|
focusEditor();
|
|
64
64
|
}, [fireActionClickEvent, focusEditor, onConfigureClickCallback]);
|
|
65
65
|
return jsx(DropdownMenu, {
|
|
66
|
-
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
66
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
67
67
|
trigger: function trigger(_ref3) {
|
|
68
68
|
var _onClick = _ref3.onClick,
|
|
69
69
|
triggerRef = _ref3.triggerRef,
|
|
@@ -77,7 +77,7 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
77
77
|
label: configureLinkLabel,
|
|
78
78
|
size: "small"
|
|
79
79
|
})
|
|
80
|
-
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
80
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
81
81
|
,
|
|
82
82
|
onClick: function onClick(e) {
|
|
83
83
|
_onClick === null || _onClick === void 0 || _onClick(e);
|
|
@@ -37,11 +37,11 @@ export function HyperlinkAddToolbar(_ref2) {
|
|
|
37
37
|
timesViewed = _ref2.timesViewed,
|
|
38
38
|
isOffline = _ref2.isOffline;
|
|
39
39
|
return /*#__PURE__*/React.createElement(WithProviders
|
|
40
|
-
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
40
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
41
41
|
, {
|
|
42
42
|
providers: ['activityProvider', 'searchProvider'],
|
|
43
43
|
providerFactory: providerFactory
|
|
44
|
-
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
44
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
45
45
|
,
|
|
46
46
|
renderNode: function renderNode(_ref3) {
|
|
47
47
|
var activityProvider = _ref3.activityProvider,
|
|
@@ -51,7 +51,7 @@ var LinkSearchList = function LinkSearchList(_ref) {
|
|
|
51
51
|
id: "link-search-list-item-".concat(index),
|
|
52
52
|
item: item,
|
|
53
53
|
selected: selectedIndex === index
|
|
54
|
-
// eslint-disable-next-line @atlassian/perf-linting/detect-unnecessary-rerenders, @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
54
|
+
// eslint-disable-next-line @atlassian/perf-linting/detect-unnecessary-rerenders, @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
55
55
|
,
|
|
56
56
|
onFocus: function onFocus() {
|
|
57
57
|
return _onFocus === null || _onFocus === void 0 ? void 0 : _onFocus(index);
|
|
@@ -62,7 +62,7 @@ var LinkSearchList = function LinkSearchList(_ref) {
|
|
|
62
62
|
onMouseLeave: onMouseLeave,
|
|
63
63
|
onSelect: onSelect,
|
|
64
64
|
key: item.objectId
|
|
65
|
-
// eslint-disable-next-line @atlassian/perf-linting/detect-unnecessary-rerenders, @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
65
|
+
// eslint-disable-next-line @atlassian/perf-linting/detect-unnecessary-rerenders, @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
66
66
|
,
|
|
67
67
|
ref: function ref(el) {
|
|
68
68
|
return listItemRefCallback === null || listItemRefCallback === void 0 ? void 0 : listItemRefCallback(el, item.objectId);
|
|
@@ -42,7 +42,7 @@ export default function withActivityProvider(WrappedComponent) {
|
|
|
42
42
|
value: function render() {
|
|
43
43
|
var providerFactory = this.props.providerFactory;
|
|
44
44
|
return /*#__PURE__*/React.createElement(WithProviders
|
|
45
|
-
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
45
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
46
46
|
, {
|
|
47
47
|
providers: ['activityProvider'],
|
|
48
48
|
providerFactory: providerFactory,
|
|
@@ -53,7 +53,7 @@ export var InlineImageCard = function InlineImageCard(_ref) {
|
|
|
53
53
|
dataURI: preview.dataURI,
|
|
54
54
|
alt: alt,
|
|
55
55
|
previewOrientation: preview.orientation
|
|
56
|
-
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
56
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
57
57
|
,
|
|
58
58
|
onImageLoad: function onImageLoad() {
|
|
59
59
|
_onImageLoad(preview);
|
|
@@ -140,7 +140,7 @@ export var MediaInlineImageCardInternal = function MediaInlineImageCardInternal(
|
|
|
140
140
|
}, jsx(InlineImageCard, {
|
|
141
141
|
dimensions: dimensions,
|
|
142
142
|
identifier: identifier
|
|
143
|
-
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
143
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
144
144
|
,
|
|
145
145
|
renderError: function renderError() {
|
|
146
146
|
return jsx(InlineImageCardErrorView, {
|
|
@@ -213,7 +213,7 @@ export var MediaInlineImageCardInternal = function MediaInlineImageCardInternal(
|
|
|
213
213
|
if (isMediaViewerVisible && mediaClient !== null && mediaClient !== void 0 && mediaClient.mediaClientConfig) {
|
|
214
214
|
return /*#__PURE__*/ReactDOM.createPortal(jsx(MediaViewer, {
|
|
215
215
|
collectionName: identifier.collectionName || ''
|
|
216
|
-
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
216
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
217
217
|
,
|
|
218
218
|
items: [identifier],
|
|
219
219
|
mediaClientConfig: mediaClient === null || mediaClient === void 0 ? void 0 : mediaClient.mediaClientConfig,
|
|
@@ -90,7 +90,7 @@ export var CommentBadge = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
90
90
|
position: "top",
|
|
91
91
|
content: title
|
|
92
92
|
}, jsx(CustomThemeButton
|
|
93
|
-
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
93
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
94
94
|
, {
|
|
95
95
|
style: {
|
|
96
96
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
@@ -34,7 +34,7 @@ export var CommentBadgeNext = function CommentBadgeNext(_ref) {
|
|
|
34
34
|
position: "top",
|
|
35
35
|
content: title
|
|
36
36
|
}, /*#__PURE__*/React.createElement(Pressable
|
|
37
|
-
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
37
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
38
38
|
, {
|
|
39
39
|
xcss: [baseStyles, mediumBadgeStyles],
|
|
40
40
|
padding: "space.0",
|
|
@@ -82,7 +82,7 @@ export var MediaBadges = function MediaBadges(_ref) {
|
|
|
82
82
|
testId: "media-badges",
|
|
83
83
|
"data-media-badges": "true",
|
|
84
84
|
contentEditable: false
|
|
85
|
-
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
85
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
86
86
|
,
|
|
87
87
|
xcss: [containerStyles, useMinimumZIndex && hackedZIndexStyles, extendedResizeOffset && resizeOffsetStyles]
|
|
88
88
|
}, children);
|
|
@@ -10,7 +10,7 @@ import { isFedRamp } from './environment';
|
|
|
10
10
|
import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
|
|
11
11
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
12
12
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
13
|
-
var packageVersion = "112.8.
|
|
13
|
+
var packageVersion = "112.8.2";
|
|
14
14
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
15
15
|
// Remove URL as it has UGC
|
|
16
16
|
// Ignored via go/ees007
|
|
@@ -3,6 +3,7 @@ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
|
3
3
|
import { getNodeIdProvider } from '../../node-anchor/node-anchor-provider';
|
|
4
4
|
import { processRawFragmentValue, processRawValue, processRawValueWithoutValidation } from '../../utils/processRawValue';
|
|
5
5
|
import { editorCommandToPMCommand } from '../editor-commands';
|
|
6
|
+
import { appearancePluginKey, createAppearancePlugin } from './pm-plugins/appearance-plugin';
|
|
6
7
|
import { createThrottleSchedule, returnDocumentRequest, returnDocumentRequestNoThrowError } from './requestDocument';
|
|
7
8
|
|
|
8
9
|
/**
|
|
@@ -17,10 +18,23 @@ export var corePlugin = function corePlugin(_ref) {
|
|
|
17
18
|
return {
|
|
18
19
|
name: 'core',
|
|
19
20
|
getSharedState: function getSharedState(state) {
|
|
21
|
+
var pluginState = state && appearancePluginKey.getState(state);
|
|
20
22
|
return {
|
|
21
|
-
schema: state === null || state === void 0 ? void 0 : state.schema
|
|
23
|
+
schema: state === null || state === void 0 ? void 0 : state.schema,
|
|
24
|
+
appearance: expValEquals('platform_editor_appearance_shared_state', 'isEnabled', true) ? pluginState === null || pluginState === void 0 ? void 0 : pluginState.appearance : undefined
|
|
22
25
|
};
|
|
23
26
|
},
|
|
27
|
+
pmPlugins: function pmPlugins() {
|
|
28
|
+
if (expValEquals('platform_editor_appearance_shared_state', 'isEnabled', true)) {
|
|
29
|
+
return [{
|
|
30
|
+
name: 'appearancePlugin',
|
|
31
|
+
plugin: function plugin() {
|
|
32
|
+
return createAppearancePlugin(config === null || config === void 0 ? void 0 : config.appearance);
|
|
33
|
+
}
|
|
34
|
+
}];
|
|
35
|
+
}
|
|
36
|
+
return [];
|
|
37
|
+
},
|
|
24
38
|
actions: {
|
|
25
39
|
execute: function execute(command) {
|
|
26
40
|
var editorView = config === null || config === void 0 ? void 0 : config.getEditorView();
|
|
@@ -79,6 +93,27 @@ export var corePlugin = function corePlugin(_ref) {
|
|
|
79
93
|
dom.scrollIntoView(scrollOptions);
|
|
80
94
|
return true;
|
|
81
95
|
},
|
|
96
|
+
updateAppearance: function updateAppearance(newAppearance) {
|
|
97
|
+
var _appearancePluginKey$;
|
|
98
|
+
if (!expValEquals('platform_editor_appearance_shared_state', 'isEnabled', true)) {
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
var editorView = config === null || config === void 0 ? void 0 : config.getEditorView();
|
|
102
|
+
if (!editorView) {
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
// Avoid dispatching a redundant transaction if appearance hasn't changed
|
|
106
|
+
var currentAppearance = (_appearancePluginKey$ = appearancePluginKey.getState(editorView.state)) === null || _appearancePluginKey$ === void 0 ? void 0 : _appearancePluginKey$.appearance;
|
|
107
|
+
if (currentAppearance === newAppearance) {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
var tr = editorView.state.tr.setMeta(appearancePluginKey, {
|
|
111
|
+
appearance: newAppearance
|
|
112
|
+
});
|
|
113
|
+
tr.setMeta('addToHistory', false);
|
|
114
|
+
editorView.dispatch(tr);
|
|
115
|
+
return true;
|
|
116
|
+
},
|
|
82
117
|
replaceDocument: function replaceDocument(replaceValue, options) {
|
|
83
118
|
var editorView = config === null || config === void 0 ? void 0 : config.getEditorView();
|
|
84
119
|
if (!editorView || replaceValue === undefined || replaceValue === null) {
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
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; }
|
|
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
|
+
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
5
|
+
import { SafePlugin } from '../../../safe-plugin';
|
|
6
|
+
export var appearancePluginKey = new PluginKey('appearancePlugin');
|
|
7
|
+
var DEFAULT_APPEARANCE = 'comment';
|
|
8
|
+
export function createAppearancePlugin(initialAppearance) {
|
|
9
|
+
return new SafePlugin({
|
|
10
|
+
key: appearancePluginKey,
|
|
11
|
+
state: {
|
|
12
|
+
init: function init() {
|
|
13
|
+
return {
|
|
14
|
+
appearance: initialAppearance !== null && initialAppearance !== void 0 ? initialAppearance : DEFAULT_APPEARANCE
|
|
15
|
+
};
|
|
16
|
+
},
|
|
17
|
+
apply: function apply(tr, pluginState) {
|
|
18
|
+
var meta = tr.getMeta(appearancePluginKey);
|
|
19
|
+
if ((meta === null || meta === void 0 ? void 0 : meta.appearance) !== undefined) {
|
|
20
|
+
return _objectSpread(_objectSpread({}, pluginState), {}, {
|
|
21
|
+
appearance: meta.appearance
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
return pluginState;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
@@ -282,7 +282,8 @@ export var EditorPluginInjectionAPI = /*#__PURE__*/function () {
|
|
|
282
282
|
var _this2 = this;
|
|
283
283
|
var getEditorState = _ref6.getEditorState,
|
|
284
284
|
getEditorView = _ref6.getEditorView,
|
|
285
|
-
fireAnalyticsEvent = _ref6.fireAnalyticsEvent
|
|
285
|
+
fireAnalyticsEvent = _ref6.fireAnalyticsEvent,
|
|
286
|
+
appearance = _ref6.appearance;
|
|
286
287
|
_classCallCheck(this, EditorPluginInjectionAPI);
|
|
287
288
|
_defineProperty(this, "onEditorViewUpdated", function (_ref7) {
|
|
288
289
|
var newEditorState = _ref7.newEditorState,
|
|
@@ -315,15 +316,39 @@ export var EditorPluginInjectionAPI = /*#__PURE__*/function () {
|
|
|
315
316
|
this.plugins = new Map();
|
|
316
317
|
this.actionsAPI = new ActionsAPI();
|
|
317
318
|
this.commandsAPI = new EditorCommandsAPI();
|
|
319
|
+
|
|
318
320
|
// Special core plugin that is always added
|
|
319
321
|
this.addPlugin(corePlugin({
|
|
320
322
|
config: {
|
|
321
323
|
getEditorView: getEditorView,
|
|
322
|
-
fireAnalyticsEvent: fireAnalyticsEvent
|
|
324
|
+
fireAnalyticsEvent: fireAnalyticsEvent,
|
|
325
|
+
appearance: appearance
|
|
323
326
|
}
|
|
324
327
|
}));
|
|
325
328
|
}
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* Returns PM plugins from internally-registered plugins (e.g. the core plugin)
|
|
332
|
+
* that are not processed through the normal preset builder flow.
|
|
333
|
+
*/
|
|
334
|
+
// Ignored via go/ees005
|
|
335
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
326
336
|
return _createClass(EditorPluginInjectionAPI, [{
|
|
337
|
+
key: "getInternalPMPlugins",
|
|
338
|
+
value: function getInternalPMPlugins() {
|
|
339
|
+
// Ignored via go/ees005
|
|
340
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
341
|
+
var result = [];
|
|
342
|
+
var corePlugin = this.plugins.get('core');
|
|
343
|
+
if (corePlugin && typeof corePlugin.pmPlugins === 'function') {
|
|
344
|
+
var pmPlugins = corePlugin.pmPlugins();
|
|
345
|
+
if (pmPlugins) {
|
|
346
|
+
result.push.apply(result, _toConsumableArray(pmPlugins));
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
return result;
|
|
350
|
+
}
|
|
351
|
+
}, {
|
|
327
352
|
key: "createAPI",
|
|
328
353
|
value: function createAPI() {
|
|
329
354
|
var sharedStateAPI = this.sharedStateAPI,
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
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; }
|
|
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
|
+
// oxlint-disable-next-line @atlassian/no-restricted-imports
|
|
5
|
+
|
|
4
6
|
import memoize from 'lodash/memoize';
|
|
5
7
|
// Use this selector to set the intersection observer boundary for editor's inline node views
|
|
6
8
|
// If this does not exist, it will use the IntersectionObserver's default root
|
|
@@ -323,7 +323,7 @@ var BreakoutResizer = function BreakoutResizer(_ref) {
|
|
|
323
323
|
}
|
|
324
324
|
return /*#__PURE__*/React.createElement(Resizer, {
|
|
325
325
|
ref: resizerRef
|
|
326
|
-
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
326
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
327
327
|
,
|
|
328
328
|
enable: {
|
|
329
329
|
left: true,
|
|
@@ -197,7 +197,7 @@ var ResizerNext = function ResizerNext(props, ref) {
|
|
|
197
197
|
}, [snap, snapGap]);
|
|
198
198
|
return /*#__PURE__*/React.createElement(Resizable, _extends({
|
|
199
199
|
ref: resizable
|
|
200
|
-
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
200
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
201
201
|
,
|
|
202
202
|
size: {
|
|
203
203
|
width: width !== null && width !== void 0 ? width : 'auto',
|
|
@@ -24,7 +24,7 @@ export var EditorToolbarProvider = function EditorToolbarProvider(_ref) {
|
|
|
24
24
|
editorToolbarDockingPreference = _ref.editorToolbarDockingPreference,
|
|
25
25
|
isOffline = _ref.isOffline;
|
|
26
26
|
return /*#__PURE__*/React.createElement(EditorToolbarContext.Provider, {
|
|
27
|
-
// eslint-disable-next-line @atlassian/perf-linting/no-inline-context-value, @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
27
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-inline-context-value, @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
28
28
|
value: {
|
|
29
29
|
editorView: editorView,
|
|
30
30
|
editorAppearance: editorAppearance,
|
|
@@ -66,7 +66,7 @@ export var ContextPanelWidthProvider = /*#__PURE__*/function (_React$Component)
|
|
|
66
66
|
width = _this$state.width,
|
|
67
67
|
positionedOverEditor = _this$state.positionedOverEditor;
|
|
68
68
|
return /*#__PURE__*/React.createElement(Provider
|
|
69
|
-
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
69
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
70
70
|
, {
|
|
71
71
|
value: {
|
|
72
72
|
width: width,
|
|
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
21
21
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
22
22
|
import Layer from '../Layer';
|
|
23
23
|
var packageName = "@atlaskit/editor-common";
|
|
24
|
-
var packageVersion = "112.8.
|
|
24
|
+
var packageVersion = "112.8.2";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var fadeIn = keyframes({
|
|
@@ -95,7 +95,7 @@ var FloatingToolbarButton = function FloatingToolbarButton(_ref, forwardedRef) {
|
|
|
95
95
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/design-system/no-unsafe-style-overrides -- Ignored via go/DSP-18766
|
|
96
96
|
, {
|
|
97
97
|
className: className
|
|
98
|
-
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
98
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
99
99
|
,
|
|
100
100
|
ref: function ref(buttonElement) {
|
|
101
101
|
setSpotlightReferenceElement(buttonElement);
|
|
@@ -107,7 +107,7 @@ var FloatingToolbarButton = function FloatingToolbarButton(_ref, forwardedRef) {
|
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
// eslint-disable-next-line @atlaskit/design-system/no-unsafe-style-overrides, @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
110
|
+
// eslint-disable-next-line @atlaskit/design-system/no-unsafe-style-overrides, @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
111
111
|
,
|
|
112
112
|
theme: function theme(adgTheme, themeProps) {
|
|
113
113
|
var _adgTheme = adgTheme(themeProps),
|
|
@@ -51,7 +51,7 @@ var Mention = /*#__PURE__*/function (_PureComponent) {
|
|
|
51
51
|
key: "render",
|
|
52
52
|
value: function render() {
|
|
53
53
|
return /*#__PURE__*/React.createElement(WithProviders
|
|
54
|
-
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
54
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
55
55
|
, {
|
|
56
56
|
providers: ['mentionProvider', 'profilecardProvider'],
|
|
57
57
|
providerFactory: this.providerFactory,
|
|
@@ -188,7 +188,7 @@ var Resizer = /*#__PURE__*/function (_React$Component) {
|
|
|
188
188
|
// the div. For now, we just apply the same styles using CSS
|
|
189
189
|
return /*#__PURE__*/React.createElement(Resizable, {
|
|
190
190
|
ref: this.resizable
|
|
191
|
-
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
191
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
192
192
|
,
|
|
193
193
|
size: {
|
|
194
194
|
width: nonZeroWidth,
|
|
@@ -236,7 +236,7 @@ export var TableSelectorPopup = function TableSelectorPopup(props) {
|
|
|
236
236
|
}, [handleMouseMove, props.allowOutsideSelection, tablePopupRef]);
|
|
237
237
|
return jsx(Popup, {
|
|
238
238
|
target: props.target
|
|
239
|
-
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
239
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
240
240
|
,
|
|
241
241
|
offset: [0, 3],
|
|
242
242
|
mountTo: props.popupsMountPoint,
|
|
@@ -149,7 +149,7 @@ var ColorPickerButton = function ColorPickerButton(props) {
|
|
|
149
149
|
target: buttonRef.current,
|
|
150
150
|
fitHeight: 350,
|
|
151
151
|
fitWidth: 350
|
|
152
|
-
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
152
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
153
153
|
,
|
|
154
154
|
offset: [0, 10],
|
|
155
155
|
alignX: props.alignX,
|
|
@@ -170,7 +170,7 @@ var ColorPickerButton = function ColorPickerButton(props) {
|
|
|
170
170
|
selectedRowIndex: selectedRowIndex,
|
|
171
171
|
selectedColumnIndex: selectedColumnIndex,
|
|
172
172
|
closeOnTab: true
|
|
173
|
-
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
173
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
174
174
|
,
|
|
175
175
|
handleClose: function handleClose() {
|
|
176
176
|
return setIsPopupOpen(false);
|
|
@@ -184,7 +184,7 @@ var ColorPickerButton = function ColorPickerButton(props) {
|
|
|
184
184
|
onClick: onColorSelected,
|
|
185
185
|
handleClickOutside: togglePopup,
|
|
186
186
|
handleEscapeKeydown: handleEsc
|
|
187
|
-
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
187
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
188
188
|
,
|
|
189
189
|
paletteOptions: {
|
|
190
190
|
palette: props.colorPalette,
|
|
@@ -234,7 +234,7 @@ var ColorPickerButton = function ColorPickerButton(props) {
|
|
|
234
234
|
"aria-expanded": props.isAriaExpanded ? isPopupOpen : undefined,
|
|
235
235
|
spacing: editorExperiment('platform_editor_controls', 'variant1') ? 'default' : 'compact',
|
|
236
236
|
onClick: togglePopup
|
|
237
|
-
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
237
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
238
238
|
,
|
|
239
239
|
onKeyDown: function onKeyDown(event) {
|
|
240
240
|
if (event.key === 'Enter' || event.key === ' ') {
|
|
@@ -191,7 +191,7 @@ var DropdownMenuWrapper = /*#__PURE__*/function (_PureComponent) {
|
|
|
191
191
|
shouldFitContainer: true,
|
|
192
192
|
handleClickOutside: this.handleClose,
|
|
193
193
|
handleEscapeKeydown: handleEscapeKeydown || this.handleCloseAndFocus
|
|
194
|
-
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
194
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
195
195
|
,
|
|
196
196
|
handleEnterKeydown: function handleEnterKeydown(e) {
|
|
197
197
|
if (!allowEnterDefaultBehavior) {
|
|
@@ -331,7 +331,7 @@ export function DropdownMenuItem(_ref) {
|
|
|
331
331
|
iconBefore: item.elemBefore,
|
|
332
332
|
iconAfter: item.elemAfter,
|
|
333
333
|
isDisabled: item.isDisabled
|
|
334
|
-
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
334
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
335
335
|
,
|
|
336
336
|
onClick: function onClick() {
|
|
337
337
|
return onItemActivated && onItemActivated({
|
|
@@ -341,20 +341,20 @@ export function DropdownMenuItem(_ref) {
|
|
|
341
341
|
"aria-label": ariaLabel,
|
|
342
342
|
"aria-pressed": shouldUseDefaultRole ? item.isActive : undefined,
|
|
343
343
|
"aria-keyshortcuts": item['aria-keyshortcuts']
|
|
344
|
-
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
344
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
345
345
|
,
|
|
346
346
|
onMouseDown: function onMouseDown(e) {
|
|
347
347
|
e.preventDefault();
|
|
348
348
|
},
|
|
349
349
|
component: DropdownMenuItemCustomComponent
|
|
350
|
-
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
350
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
351
351
|
,
|
|
352
352
|
onMouseEnter: function onMouseEnter() {
|
|
353
353
|
return _onMouseEnter && _onMouseEnter({
|
|
354
354
|
item: item
|
|
355
355
|
});
|
|
356
356
|
}
|
|
357
|
-
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
357
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
358
358
|
,
|
|
359
359
|
onMouseLeave: function onMouseLeave() {
|
|
360
360
|
return _onMouseLeave && _onMouseLeave({
|
|
@@ -383,7 +383,7 @@ function (_ref2) {
|
|
|
383
383
|
// This context is to handle the tab, Arrow Right/Left key events for dropdown.
|
|
384
384
|
// Default context has the void callbacks for above key events
|
|
385
385
|
return jsx(DropdownMenuWrapper
|
|
386
|
-
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
386
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
387
387
|
, _extends({
|
|
388
388
|
arrowKeyNavigationProviderOptions: _objectSpread(_objectSpread({}, props.arrowKeyNavigationProviderOptions), {}, {
|
|
389
389
|
keyDownHandlerContext: keyDownHandlerContext
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
3
3
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
4
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
6
5
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '../analytics';
|
|
7
6
|
import { withAnalytics } from '../editor-analytics';
|
|
@@ -313,7 +312,7 @@ export var isEmptySelectionAtEnd = function isEmptySelectionAtEnd(state) {
|
|
|
313
312
|
|
|
314
313
|
// If blockTaskItem is in the schema,
|
|
315
314
|
// we need to check if the selection is inside a blockTaskItem
|
|
316
|
-
if (blockTaskItem && empty
|
|
315
|
+
if (blockTaskItem && empty) {
|
|
317
316
|
// If the parent is in a textblock,
|
|
318
317
|
// check if it's nested inside a blockTaskItem
|
|
319
318
|
if ($from.parent.isTextblock) {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import { SafePlugin } from '../../../safe-plugin';
|
|
3
|
+
import type { EditorAppearance } from '../../../types';
|
|
4
|
+
type AppearancePluginState = {
|
|
5
|
+
appearance: EditorAppearance | undefined;
|
|
6
|
+
};
|
|
7
|
+
export declare const appearancePluginKey: PluginKey<AppearancePluginState>;
|
|
8
|
+
export declare function createAppearancePlugin(initialAppearance: EditorAppearance | undefined): SafePlugin<AppearancePluginState>;
|
|
9
|
+
export {};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
2
2
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
import { type FireAnalyticsCallback } from '../analytics';
|
|
4
|
+
import type { EditorAppearance } from '../types';
|
|
4
5
|
import type { BasePluginDependenciesAPI, CorePlugin, NextEditorPlugin, PluginDependenciesAPI } from '../types/next-editor-plugin';
|
|
5
6
|
type NextEditorPluginInitializedType = ReturnType<NextEditorPlugin<any>>;
|
|
6
7
|
type SharedStateAPIProps = {
|
|
7
8
|
getEditorState: () => EditorState | undefined;
|
|
8
9
|
};
|
|
9
10
|
interface PluginInjectionAPIProps extends SharedStateAPIProps {
|
|
11
|
+
appearance?: EditorAppearance;
|
|
10
12
|
fireAnalyticsEvent?: FireAnalyticsCallback;
|
|
11
13
|
getEditorView: () => EditorView | undefined;
|
|
12
14
|
}
|
|
@@ -46,7 +48,15 @@ export declare class EditorPluginInjectionAPI implements PluginInjectionAPIDefin
|
|
|
46
48
|
private actionsAPI;
|
|
47
49
|
private commandsAPI;
|
|
48
50
|
private plugins;
|
|
49
|
-
constructor({ getEditorState, getEditorView, fireAnalyticsEvent }: PluginInjectionAPIProps);
|
|
51
|
+
constructor({ getEditorState, getEditorView, fireAnalyticsEvent, appearance }: PluginInjectionAPIProps);
|
|
52
|
+
/**
|
|
53
|
+
* Returns PM plugins from internally-registered plugins (e.g. the core plugin)
|
|
54
|
+
* that are not processed through the normal preset builder flow.
|
|
55
|
+
*/
|
|
56
|
+
getInternalPMPlugins(): Array<{
|
|
57
|
+
name: string;
|
|
58
|
+
plugin: (...args: any[]) => any;
|
|
59
|
+
}>;
|
|
50
60
|
private createAPI;
|
|
51
61
|
api(): GenericAPIWithCore;
|
|
52
62
|
onEditorViewUpdated: ({ newEditorState, oldEditorState }: EditorStateDiff) => void;
|
|
@@ -9,6 +9,7 @@ import type { Fragment, Node, Schema, Node as PMNode } from '@atlaskit/editor-pr
|
|
|
9
9
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
10
10
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
11
11
|
import type { FireAnalyticsCallback } from '../analytics';
|
|
12
|
+
import type { EditorAppearance } from './editor-appearance';
|
|
12
13
|
import type { EditorCommand, EditorCommandWithMetadata } from './editor-command';
|
|
13
14
|
import type { EditorPlugin } from './editor-plugin';
|
|
14
15
|
export interface Transformer<T> {
|
|
@@ -115,12 +116,26 @@ export type CorePlugin = NextEditorPlugin<'core', {
|
|
|
115
116
|
* @returns (boolean) if scroll was successful
|
|
116
117
|
*/
|
|
117
118
|
scrollToPos: (pos: number, scrollOptions?: boolean | ScrollIntoViewOptions) => boolean;
|
|
119
|
+
/**
|
|
120
|
+
* Updates the editor appearance in shared state. Dispatches a ProseMirror transaction
|
|
121
|
+
* so that shared state subscribers are correctly notified of the change.
|
|
122
|
+
*
|
|
123
|
+
* @param appearance - The new editor appearance value
|
|
124
|
+
* @returns true if the update was dispatched, false if the experiment is off or the view was unavailable
|
|
125
|
+
*/
|
|
126
|
+
updateAppearance: (appearance: EditorAppearance | undefined) => boolean;
|
|
118
127
|
};
|
|
119
128
|
pluginConfiguration: {
|
|
129
|
+
appearance?: EditorAppearance;
|
|
120
130
|
fireAnalyticsEvent?: FireAnalyticsCallback;
|
|
121
131
|
getEditorView: () => EditorView | undefined;
|
|
122
132
|
};
|
|
123
133
|
sharedState: {
|
|
134
|
+
/**
|
|
135
|
+
* The appearance configuration of the editor. Used as fallback when individual
|
|
136
|
+
* plugins don't have explicit appearance configuration.
|
|
137
|
+
*/
|
|
138
|
+
appearance: EditorAppearance | undefined;
|
|
124
139
|
/**
|
|
125
140
|
* The schema of the editor. It is guarranteed to be static for its lifecycle
|
|
126
141
|
* so is safe to use `currentState`
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import { SafePlugin } from '../../../safe-plugin';
|
|
3
|
+
import type { EditorAppearance } from '../../../types';
|
|
4
|
+
type AppearancePluginState = {
|
|
5
|
+
appearance: EditorAppearance | undefined;
|
|
6
|
+
};
|
|
7
|
+
export declare const appearancePluginKey: PluginKey<AppearancePluginState>;
|
|
8
|
+
export declare function createAppearancePlugin(initialAppearance: EditorAppearance | undefined): SafePlugin<AppearancePluginState>;
|
|
9
|
+
export {};
|