@atlaskit/editor-core 187.11.0 → 187.13.0
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/create-editor/ErrorBoundary.js +4 -7
- package/dist/cjs/create-editor/ReactEditorViewInternal.js +1 -4
- package/dist/cjs/editor-next/editor-internal.js +0 -2
- package/dist/cjs/editor-next/hooks/useProviderFactory.js +2 -2
- package/dist/cjs/editor-next/index.js +0 -2
- package/dist/cjs/editor.js +6 -2
- package/dist/cjs/plugins/text-formatting/index.js +8 -14
- package/dist/cjs/ui/ErrorBoundary/index.js +3 -6
- package/dist/cjs/{editor-next/utils/deprecationWarnings.js → utils/editorDeprecationWarnings.js} +3 -3
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/create-editor/ErrorBoundary.js +4 -7
- package/dist/es2019/create-editor/ReactEditorViewInternal.js +1 -4
- package/dist/es2019/editor-next/editor-internal.js +0 -2
- package/dist/es2019/editor-next/hooks/useProviderFactory.js +2 -2
- package/dist/es2019/editor-next/index.js +0 -2
- package/dist/es2019/editor.js +5 -0
- package/dist/es2019/plugins/text-formatting/index.js +115 -119
- package/dist/es2019/ui/ErrorBoundary/index.js +3 -6
- package/dist/es2019/{editor-next/utils/deprecationWarnings.js → utils/editorDeprecationWarnings.js} +2 -2
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/create-editor/ErrorBoundary.js +4 -7
- package/dist/esm/create-editor/ReactEditorViewInternal.js +1 -4
- package/dist/esm/editor-next/editor-internal.js +0 -2
- package/dist/esm/editor-next/hooks/useProviderFactory.js +2 -2
- package/dist/esm/editor-next/index.js +0 -2
- package/dist/esm/editor.js +6 -2
- package/dist/esm/plugins/text-formatting/index.js +9 -15
- package/dist/esm/ui/ErrorBoundary/index.js +3 -6
- package/dist/esm/{editor-next/utils/deprecationWarnings.js → utils/editorDeprecationWarnings.js} +2 -2
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/create-editor/ReactEditorViewInternal.d.ts +0 -1
- package/dist/types/editor-next/hooks/useProviderFactory.d.ts +4 -4
- package/dist/types/editor.d.ts +1 -0
- package/dist/types/labs/next/presets/default.d.ts +28 -56
- package/dist/types/labs/next/presets/useUniversalPreset.d.ts +2 -2
- package/dist/types/plugins/text-formatting/actions.d.ts +11 -9
- package/dist/types/plugins/text-formatting/index.d.ts +8 -15
- package/dist/types/types/editor-props.d.ts +10 -10
- package/dist/types/ui/ErrorBoundary/index.d.ts +3 -2
- package/dist/types/utils/editorDeprecationWarnings.d.ts +2 -0
- package/dist/types-ts4.5/create-editor/ReactEditorViewInternal.d.ts +0 -1
- package/dist/types-ts4.5/editor-next/hooks/useProviderFactory.d.ts +4 -4
- package/dist/types-ts4.5/editor.d.ts +1 -0
- package/dist/types-ts4.5/labs/next/presets/default.d.ts +28 -56
- package/dist/types-ts4.5/labs/next/presets/useUniversalPreset.d.ts +2 -2
- package/dist/types-ts4.5/plugins/text-formatting/actions.d.ts +11 -9
- package/dist/types-ts4.5/plugins/text-formatting/index.d.ts +8 -15
- package/dist/types-ts4.5/types/editor-props.d.ts +10 -10
- package/dist/types-ts4.5/ui/ErrorBoundary/index.d.ts +3 -2
- package/dist/types-ts4.5/utils/editorDeprecationWarnings.d.ts +2 -0
- package/package.json +4 -7
- package/report.api.md +25 -38
- package/tmp/api-report-tmp.d.ts +25 -36
- package/dist/types/editor-next/utils/deprecationWarnings.d.ts +0 -2
- package/dist/types-ts4.5/editor-next/utils/deprecationWarnings.d.ts +0 -2
package/dist/es2019/version.json
CHANGED
|
@@ -16,7 +16,6 @@ import uuid from 'uuid';
|
|
|
16
16
|
import { ExperienceStore } from '@atlaskit/editor-common/ufo';
|
|
17
17
|
import { IntlErrorBoundary } from '@atlaskit/editor-common/ui';
|
|
18
18
|
import { sniffUserBrowserExtensions } from '@atlaskit/editor-common/utils';
|
|
19
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
20
19
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../plugins/analytics';
|
|
21
20
|
import { editorAnalyticsChannel } from '../plugins/analytics/consts';
|
|
22
21
|
import { getDocStructure } from '../utils/document-logger';
|
|
@@ -82,12 +81,10 @@ export var ErrorBoundaryWithEditorView = /*#__PURE__*/function (_React$Component
|
|
|
82
81
|
errorStack: errorStack
|
|
83
82
|
}));
|
|
84
83
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
});
|
|
90
|
-
}
|
|
84
|
+
logException(error, {
|
|
85
|
+
location: 'editor-core/create-editor',
|
|
86
|
+
product: product
|
|
87
|
+
});
|
|
91
88
|
case 11:
|
|
92
89
|
case "end":
|
|
93
90
|
return _context.stop();
|
|
@@ -151,9 +151,6 @@ export var ReactEditorView = /*#__PURE__*/function (_React$Component) {
|
|
|
151
151
|
}
|
|
152
152
|
});
|
|
153
153
|
_defineProperty(_assertThisInitialized(_this), "handleAnalyticsEvent", function (payload) {
|
|
154
|
-
if (!_this.props.allowAnalyticsGASV3) {
|
|
155
|
-
return;
|
|
156
|
-
}
|
|
157
154
|
fireAnalyticsEvent(_this.props.createAnalyticsEvent)(payload);
|
|
158
155
|
});
|
|
159
156
|
_defineProperty(_assertThisInitialized(_this), "editorPlugins", []);
|
|
@@ -500,7 +497,7 @@ export var ReactEditorView = /*#__PURE__*/function (_React$Component) {
|
|
|
500
497
|
}
|
|
501
498
|
});
|
|
502
499
|
_defineProperty(_assertThisInitialized(_this), "dispatchAnalyticsEvent", function (payload) {
|
|
503
|
-
if (_this.
|
|
500
|
+
if (_this.eventDispatcher) {
|
|
504
501
|
var dispatch = createDispatch(_this.eventDispatcher);
|
|
505
502
|
dispatch(analyticsEventKey, {
|
|
506
503
|
payload: payload
|
|
@@ -92,7 +92,6 @@ export function EditorInternalWithoutHooks(_ref) {
|
|
|
92
92
|
providerFactory: providerFactory,
|
|
93
93
|
onEditorCreated: onEditorCreated,
|
|
94
94
|
onEditorDestroyed: onEditorDestroyed,
|
|
95
|
-
allowAnalyticsGASV3: props.allowAnalyticsGASV3,
|
|
96
95
|
disabled: props.disabled,
|
|
97
96
|
preset: preset,
|
|
98
97
|
render: function render(_ref2) {
|
|
@@ -126,7 +125,6 @@ export function EditorInternalWithoutHooks(_ref) {
|
|
|
126
125
|
primaryToolbarComponents: config.primaryToolbarComponents,
|
|
127
126
|
primaryToolbarIconBefore: props.primaryToolbarIconBefore,
|
|
128
127
|
secondaryToolbarComponents: config.secondaryToolbarComponents,
|
|
129
|
-
insertMenuItems: props.insertMenuItems,
|
|
130
128
|
customContentComponents: props.contentComponents,
|
|
131
129
|
customPrimaryToolbarComponents: props.primaryToolbarComponents,
|
|
132
130
|
customSecondaryToolbarComponents: props.secondaryToolbarComponents,
|
|
@@ -30,8 +30,6 @@ export default function useProviderFactory(props, editorActions, createAnalytics
|
|
|
30
30
|
var extensionProviders = props.extensionProviders,
|
|
31
31
|
quickInsert = props.quickInsert,
|
|
32
32
|
linking = props.linking,
|
|
33
|
-
smartLinks = props.smartLinks,
|
|
34
|
-
UNSAFE_cards = props.UNSAFE_cards,
|
|
35
33
|
autoformattingProvider = props.autoformattingProvider,
|
|
36
34
|
media = props.media,
|
|
37
35
|
emojiProvider = props.emojiProvider,
|
|
@@ -45,6 +43,8 @@ export default function useProviderFactory(props, editorActions, createAnalytics
|
|
|
45
43
|
collabEdit = props.collabEdit,
|
|
46
44
|
collabEditProvider = props.collabEditProvider,
|
|
47
45
|
presenceProvider = props.presenceProvider;
|
|
46
|
+
var UNSAFE_cards = props.UNSAFE_cards;
|
|
47
|
+
var smartLinks = props.smartLinks;
|
|
48
48
|
var providerFactory = useRef(new ProviderFactory());
|
|
49
49
|
var _useState = useState(createNewState(editorActions, quickInsert, extensionProviders, createAnalyticsEvent)),
|
|
50
50
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -18,7 +18,6 @@ import { useConstructor } from '@atlaskit/editor-common/hooks';
|
|
|
18
18
|
import { useEditorContext } from '../ui/EditorContext';
|
|
19
19
|
import measurements from '../utils/performance/measure-enum';
|
|
20
20
|
import EditorInternal from './editor-internal';
|
|
21
|
-
import deprecationWarnings from './utils/deprecationWarnings';
|
|
22
21
|
import sendDurationAnalytics from './utils/sendDurationAnalytics';
|
|
23
22
|
import trackEditorActions from './utils/trackEditorActions';
|
|
24
23
|
export function Editor(passedProps) {
|
|
@@ -39,7 +38,6 @@ export function Editor(passedProps) {
|
|
|
39
38
|
return fireAnalyticsEvent(createAnalyticsEvent)(data);
|
|
40
39
|
};
|
|
41
40
|
useConstructor(function () {
|
|
42
|
-
deprecationWarnings(props);
|
|
43
41
|
trackEditorActions(editorActions.current, props.performanceTracking, function (value) {
|
|
44
42
|
return handleAnalyticsEvent(value);
|
|
45
43
|
});
|
package/dist/esm/editor.js
CHANGED
|
@@ -10,6 +10,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
10
10
|
/** @jsx jsx */
|
|
11
11
|
import React from 'react';
|
|
12
12
|
import { jsx } from '@emotion/react';
|
|
13
|
+
import editorDeprecationWarnings from './utils/editorDeprecationWarnings';
|
|
13
14
|
import EditorNext from './editor-next';
|
|
14
15
|
import useUniversalPreset from './labs/next/presets/useUniversalPreset';
|
|
15
16
|
var EditorNextWrapper = function EditorNextWrapper(_ref) {
|
|
@@ -24,9 +25,12 @@ var EditorNextWrapper = function EditorNextWrapper(_ref) {
|
|
|
24
25
|
var Editor = /*#__PURE__*/function (_React$Component) {
|
|
25
26
|
_inherits(Editor, _React$Component);
|
|
26
27
|
var _super = _createSuper(Editor);
|
|
27
|
-
function Editor() {
|
|
28
|
+
function Editor(props) {
|
|
29
|
+
var _this;
|
|
28
30
|
_classCallCheck(this, Editor);
|
|
29
|
-
|
|
31
|
+
_this = _super.call(this, props);
|
|
32
|
+
editorDeprecationWarnings(props);
|
|
33
|
+
return _this;
|
|
30
34
|
}
|
|
31
35
|
_createClass(Editor, [{
|
|
32
36
|
key: "render",
|
|
@@ -9,8 +9,9 @@ import textFormattingInputRulePlugin from './pm-plugins/input-rule';
|
|
|
9
9
|
import keymapPlugin from './pm-plugins/keymap';
|
|
10
10
|
import textFormattingSmartInputRulePlugin from './pm-plugins/smart-input-rule';
|
|
11
11
|
import Toolbar from './ui/Toolbar';
|
|
12
|
-
import {
|
|
12
|
+
import { toggleSuperscriptWithAnalytics, toggleSubscriptWithAnalytics, toggleStrikeWithAnalytics, toggleCodeWithAnalytics, toggleUnderlineWithAnalytics, toggleEmWithAnalytics, toggleStrongWithAnalytics } from './actions';
|
|
13
13
|
var textFormatting = function textFormatting() {
|
|
14
|
+
var _api$dependencies$ana7, _api$dependencies$ana8, _api$dependencies$ana9, _api$dependencies$ana10, _api$dependencies$ana11, _api$dependencies$ana12, _api$dependencies$ana13;
|
|
14
15
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
15
16
|
var api = arguments.length > 1 ? arguments[1] : undefined;
|
|
16
17
|
return {
|
|
@@ -114,20 +115,13 @@ var textFormatting = function textFormatting() {
|
|
|
114
115
|
});
|
|
115
116
|
},
|
|
116
117
|
actions: {
|
|
117
|
-
toggleSuperscript:
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
toggleCodeWithAnalytics: toggleCodeWithAnalytics,
|
|
125
|
-
toggleUnderline: toggleUnderline,
|
|
126
|
-
toggleUnderlineWithAnalytics: toggleUnderlineWithAnalytics,
|
|
127
|
-
toggleEm: toggleEm,
|
|
128
|
-
toggleEmWithAnalytics: toggleEmWithAnalytics,
|
|
129
|
-
toggleStrong: toggleStrong,
|
|
130
|
-
toggleStrongWithAnalytics: toggleStrongWithAnalytics
|
|
118
|
+
toggleSuperscript: toggleSuperscriptWithAnalytics(api === null || api === void 0 ? void 0 : (_api$dependencies$ana7 = api.dependencies.analytics) === null || _api$dependencies$ana7 === void 0 ? void 0 : _api$dependencies$ana7.actions),
|
|
119
|
+
toggleSubscript: toggleSubscriptWithAnalytics(api === null || api === void 0 ? void 0 : (_api$dependencies$ana8 = api.dependencies.analytics) === null || _api$dependencies$ana8 === void 0 ? void 0 : _api$dependencies$ana8.actions),
|
|
120
|
+
toggleStrike: toggleStrikeWithAnalytics(api === null || api === void 0 ? void 0 : (_api$dependencies$ana9 = api.dependencies.analytics) === null || _api$dependencies$ana9 === void 0 ? void 0 : _api$dependencies$ana9.actions),
|
|
121
|
+
toggleCode: toggleCodeWithAnalytics(api === null || api === void 0 ? void 0 : (_api$dependencies$ana10 = api.dependencies.analytics) === null || _api$dependencies$ana10 === void 0 ? void 0 : _api$dependencies$ana10.actions),
|
|
122
|
+
toggleUnderline: toggleUnderlineWithAnalytics(api === null || api === void 0 ? void 0 : (_api$dependencies$ana11 = api.dependencies.analytics) === null || _api$dependencies$ana11 === void 0 ? void 0 : _api$dependencies$ana11.actions),
|
|
123
|
+
toggleEm: toggleEmWithAnalytics(api === null || api === void 0 ? void 0 : (_api$dependencies$ana12 = api.dependencies.analytics) === null || _api$dependencies$ana12 === void 0 ? void 0 : _api$dependencies$ana12.actions),
|
|
124
|
+
toggleStrong: toggleStrongWithAnalytics(api === null || api === void 0 ? void 0 : (_api$dependencies$ana13 = api.dependencies.analytics) === null || _api$dependencies$ana13 === void 0 ? void 0 : _api$dependencies$ana13.actions)
|
|
131
125
|
}
|
|
132
126
|
};
|
|
133
127
|
};
|
|
@@ -9,7 +9,6 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
9
9
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
10
10
|
import React from 'react';
|
|
11
11
|
import { logException } from '@atlaskit/editor-common/monitoring';
|
|
12
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
13
12
|
import { ACTION, EVENT_TYPE } from '../../plugins/analytics';
|
|
14
13
|
export var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
15
14
|
_inherits(ErrorBoundary, _React$Component);
|
|
@@ -53,11 +52,9 @@ export var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
|
53
52
|
}
|
|
54
53
|
});
|
|
55
54
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
});
|
|
60
|
-
}
|
|
55
|
+
logException(error, {
|
|
56
|
+
location: 'editor-core/ui'
|
|
57
|
+
});
|
|
61
58
|
if (this.hasFallback()) {
|
|
62
59
|
this.setState({
|
|
63
60
|
errorCaptured: true
|
package/dist/esm/{editor-next/utils/deprecationWarnings.js → utils/editorDeprecationWarnings.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { nextMajorVersion } from '
|
|
2
|
-
export default function
|
|
1
|
+
import { nextMajorVersion } from '../version-wrapper';
|
|
2
|
+
export default function editorDeprecationWarnings(props) {
|
|
3
3
|
if (process.env.NODE_ENV === 'production') {
|
|
4
4
|
return;
|
|
5
5
|
}
|
package/dist/esm/version.json
CHANGED
|
@@ -24,7 +24,6 @@ export interface EditorViewProps {
|
|
|
24
24
|
createAnalyticsEvent?: CreateUIAnalyticsEvent;
|
|
25
25
|
providerFactory: ProviderFactory;
|
|
26
26
|
portalProviderAPI: PortalProviderAPI;
|
|
27
|
-
allowAnalyticsGASV3?: boolean;
|
|
28
27
|
disabled?: boolean;
|
|
29
28
|
experienceStore?: ExperienceStore;
|
|
30
29
|
render?: (props: {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
1
|
+
import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
2
2
|
import type { ExtensionProvider } from '@atlaskit/editor-common/extensions';
|
|
3
3
|
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
4
|
-
import EditorActions from '../../actions';
|
|
5
|
-
import { QuickInsertProvider } from '../../plugins/quick-insert/types';
|
|
6
|
-
import { EditorNextProps } from '../../types/editor-props';
|
|
4
|
+
import type EditorActions from '../../actions';
|
|
5
|
+
import type { QuickInsertProvider } from '../../plugins/quick-insert/types';
|
|
6
|
+
import type { EditorNextProps } from '../../types/editor-props';
|
|
7
7
|
export type ProviderFactoryState = {
|
|
8
8
|
extensionProvider?: ExtensionProvider;
|
|
9
9
|
quickInsertProvider?: Promise<QuickInsertProvider>;
|
package/dist/types/editor.d.ts
CHANGED
|
@@ -5,5 +5,6 @@ import type { EditorProps } from './types/editor-props';
|
|
|
5
5
|
export type { AllowedBlockTypes, Command, CommandDispatch, DomAtPos, EditorAppearance, EditorAppearanceComponentProps, EditorConfig, EditorInstance, EditorPlugin, EditorProps, ExtensionConfig, ExtensionProvidersProp, FeedbackInfo, MarkConfig, MessageDescriptor, NodeConfig, NodeViewConfig, PluginsOptions, PMPlugin, PMPluginCreateConfig, PMPluginFactory, PMPluginFactoryParams, ReactComponents, ToolbarUIComponentFactory, ToolbarUiComponentFactoryParams, UIComponentFactory, UiComponentFactoryParams, } from './types';
|
|
6
6
|
export default class Editor extends React.Component<EditorProps> {
|
|
7
7
|
static defaultProps: EditorProps;
|
|
8
|
+
constructor(props: EditorProps);
|
|
8
9
|
render(): jsx.JSX.Element;
|
|
9
10
|
}
|
|
@@ -257,20 +257,13 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
257
257
|
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
258
258
|
}>>];
|
|
259
259
|
actions: {
|
|
260
|
-
toggleSuperscript: import("../../../plugins/text-formatting/actions").
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
toggleCodeWithAnalytics: import("../../../plugins/text-formatting/actions").ToggleMarkWithAnalyticsCommand;
|
|
268
|
-
toggleUnderline: import("../../../plugins/text-formatting/actions").ToggleMarkCommand;
|
|
269
|
-
toggleUnderlineWithAnalytics: import("../../../plugins/text-formatting/actions").ToggleMarkWithAnalyticsCommand;
|
|
270
|
-
toggleEm: import("../../../plugins/text-formatting/actions").ToggleMarkCommand;
|
|
271
|
-
toggleEmWithAnalytics: import("../../../plugins/text-formatting/actions").ToggleMarkWithAnalyticsCommand;
|
|
272
|
-
toggleStrong: import("../../../plugins/text-formatting/actions").ToggleMarkCommand;
|
|
273
|
-
toggleStrongWithAnalytics: import("../../../plugins/text-formatting/actions").ToggleMarkWithAnalyticsCommand;
|
|
260
|
+
toggleSuperscript: import("../../../plugins/text-formatting/actions").ToggleMarkWithAnalyticsCommand;
|
|
261
|
+
toggleSubscript: import("../../../plugins/text-formatting/actions").ToggleMarkWithAnalyticsCommand;
|
|
262
|
+
toggleStrike: import("../../../plugins/text-formatting/actions").ToggleMarkWithAnalyticsCommand;
|
|
263
|
+
toggleCode: import("../../../plugins/text-formatting/actions").ToggleMarkWithAnalyticsCommand;
|
|
264
|
+
toggleUnderline: import("../../../plugins/text-formatting/actions").ToggleMarkWithAnalyticsCommand;
|
|
265
|
+
toggleEm: import("../../../plugins/text-formatting/actions").ToggleMarkWithAnalyticsCommand;
|
|
266
|
+
toggleStrong: import("../../../plugins/text-formatting/actions").ToggleMarkWithAnalyticsCommand;
|
|
274
267
|
};
|
|
275
268
|
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"textFormatting", {
|
|
276
269
|
pluginConfiguration: TextFormattingOptions | undefined;
|
|
@@ -304,20 +297,13 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
304
297
|
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
305
298
|
}>>];
|
|
306
299
|
actions: {
|
|
307
|
-
toggleSuperscript: import("../../../plugins/text-formatting/actions").
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
toggleCodeWithAnalytics: import("../../../plugins/text-formatting/actions").ToggleMarkWithAnalyticsCommand;
|
|
315
|
-
toggleUnderline: import("../../../plugins/text-formatting/actions").ToggleMarkCommand;
|
|
316
|
-
toggleUnderlineWithAnalytics: import("../../../plugins/text-formatting/actions").ToggleMarkWithAnalyticsCommand;
|
|
317
|
-
toggleEm: import("../../../plugins/text-formatting/actions").ToggleMarkCommand;
|
|
318
|
-
toggleEmWithAnalytics: import("../../../plugins/text-formatting/actions").ToggleMarkWithAnalyticsCommand;
|
|
319
|
-
toggleStrong: import("../../../plugins/text-formatting/actions").ToggleMarkCommand;
|
|
320
|
-
toggleStrongWithAnalytics: import("../../../plugins/text-formatting/actions").ToggleMarkWithAnalyticsCommand;
|
|
300
|
+
toggleSuperscript: import("../../../plugins/text-formatting/actions").ToggleMarkWithAnalyticsCommand;
|
|
301
|
+
toggleSubscript: import("../../../plugins/text-formatting/actions").ToggleMarkWithAnalyticsCommand;
|
|
302
|
+
toggleStrike: import("../../../plugins/text-formatting/actions").ToggleMarkWithAnalyticsCommand;
|
|
303
|
+
toggleCode: import("../../../plugins/text-formatting/actions").ToggleMarkWithAnalyticsCommand;
|
|
304
|
+
toggleUnderline: import("../../../plugins/text-formatting/actions").ToggleMarkWithAnalyticsCommand;
|
|
305
|
+
toggleEm: import("../../../plugins/text-formatting/actions").ToggleMarkWithAnalyticsCommand;
|
|
306
|
+
toggleStrong: import("../../../plugins/text-formatting/actions").ToggleMarkWithAnalyticsCommand;
|
|
321
307
|
};
|
|
322
308
|
}>, (config?: HyperlinkPluginOptions | undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"hyperlink", {
|
|
323
309
|
pluginConfiguration: HyperlinkPluginOptions | undefined;
|
|
@@ -630,20 +616,13 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
630
616
|
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
631
617
|
}>>];
|
|
632
618
|
actions: {
|
|
633
|
-
toggleSuperscript: import("../../../plugins/text-formatting/actions").
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
toggleCodeWithAnalytics: import("../../../plugins/text-formatting/actions").ToggleMarkWithAnalyticsCommand;
|
|
641
|
-
toggleUnderline: import("../../../plugins/text-formatting/actions").ToggleMarkCommand;
|
|
642
|
-
toggleUnderlineWithAnalytics: import("../../../plugins/text-formatting/actions").ToggleMarkWithAnalyticsCommand;
|
|
643
|
-
toggleEm: import("../../../plugins/text-formatting/actions").ToggleMarkCommand;
|
|
644
|
-
toggleEmWithAnalytics: import("../../../plugins/text-formatting/actions").ToggleMarkWithAnalyticsCommand;
|
|
645
|
-
toggleStrong: import("../../../plugins/text-formatting/actions").ToggleMarkCommand;
|
|
646
|
-
toggleStrongWithAnalytics: import("../../../plugins/text-formatting/actions").ToggleMarkWithAnalyticsCommand;
|
|
619
|
+
toggleSuperscript: import("../../../plugins/text-formatting/actions").ToggleMarkWithAnalyticsCommand;
|
|
620
|
+
toggleSubscript: import("../../../plugins/text-formatting/actions").ToggleMarkWithAnalyticsCommand;
|
|
621
|
+
toggleStrike: import("../../../plugins/text-formatting/actions").ToggleMarkWithAnalyticsCommand;
|
|
622
|
+
toggleCode: import("../../../plugins/text-formatting/actions").ToggleMarkWithAnalyticsCommand;
|
|
623
|
+
toggleUnderline: import("../../../plugins/text-formatting/actions").ToggleMarkWithAnalyticsCommand;
|
|
624
|
+
toggleEm: import("../../../plugins/text-formatting/actions").ToggleMarkWithAnalyticsCommand;
|
|
625
|
+
toggleStrong: import("../../../plugins/text-formatting/actions").ToggleMarkWithAnalyticsCommand;
|
|
647
626
|
};
|
|
648
627
|
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"textFormatting", {
|
|
649
628
|
pluginConfiguration: TextFormattingOptions | undefined;
|
|
@@ -677,20 +656,13 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
677
656
|
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
678
657
|
}>>];
|
|
679
658
|
actions: {
|
|
680
|
-
toggleSuperscript: import("../../../plugins/text-formatting/actions").
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
toggleCodeWithAnalytics: import("../../../plugins/text-formatting/actions").ToggleMarkWithAnalyticsCommand;
|
|
688
|
-
toggleUnderline: import("../../../plugins/text-formatting/actions").ToggleMarkCommand;
|
|
689
|
-
toggleUnderlineWithAnalytics: import("../../../plugins/text-formatting/actions").ToggleMarkWithAnalyticsCommand;
|
|
690
|
-
toggleEm: import("../../../plugins/text-formatting/actions").ToggleMarkCommand;
|
|
691
|
-
toggleEmWithAnalytics: import("../../../plugins/text-formatting/actions").ToggleMarkWithAnalyticsCommand;
|
|
692
|
-
toggleStrong: import("../../../plugins/text-formatting/actions").ToggleMarkCommand;
|
|
693
|
-
toggleStrongWithAnalytics: import("../../../plugins/text-formatting/actions").ToggleMarkWithAnalyticsCommand;
|
|
659
|
+
toggleSuperscript: import("../../../plugins/text-formatting/actions").ToggleMarkWithAnalyticsCommand;
|
|
660
|
+
toggleSubscript: import("../../../plugins/text-formatting/actions").ToggleMarkWithAnalyticsCommand;
|
|
661
|
+
toggleStrike: import("../../../plugins/text-formatting/actions").ToggleMarkWithAnalyticsCommand;
|
|
662
|
+
toggleCode: import("../../../plugins/text-formatting/actions").ToggleMarkWithAnalyticsCommand;
|
|
663
|
+
toggleUnderline: import("../../../plugins/text-formatting/actions").ToggleMarkWithAnalyticsCommand;
|
|
664
|
+
toggleEm: import("../../../plugins/text-formatting/actions").ToggleMarkWithAnalyticsCommand;
|
|
665
|
+
toggleStrong: import("../../../plugins/text-formatting/actions").ToggleMarkWithAnalyticsCommand;
|
|
694
666
|
};
|
|
695
667
|
}>, (config?: HyperlinkPluginOptions | undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"hyperlink", {
|
|
696
668
|
pluginConfiguration: HyperlinkPluginOptions | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EditorProps } from '../../../types/editor-props';
|
|
2
|
-
import { EditorPresetBuilder } from '@atlaskit/editor-common/preset';
|
|
1
|
+
import type { EditorProps } from '../../../types/editor-props';
|
|
2
|
+
import type { EditorPresetBuilder } from '@atlaskit/editor-common/preset';
|
|
3
3
|
interface PresetProps {
|
|
4
4
|
props: EditorProps;
|
|
5
5
|
}
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import type { Command, InputMethodBasic } from '@atlaskit/editor-common/types';
|
|
3
|
-
|
|
4
|
-
export type ToggleMarkWithAnalyticsCommand = (
|
|
3
|
+
type ToggleMarkCommand = () => Command;
|
|
4
|
+
export type ToggleMarkWithAnalyticsCommand = (analyticsMetadata: {
|
|
5
5
|
inputMethod: InputMethodBasic;
|
|
6
6
|
}) => Command;
|
|
7
|
+
type ToggleMarkWithAnalyticsFactory = (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => ToggleMarkWithAnalyticsCommand;
|
|
7
8
|
export declare const toggleEm: ToggleMarkCommand;
|
|
8
|
-
export declare const toggleEmWithAnalytics:
|
|
9
|
+
export declare const toggleEmWithAnalytics: ToggleMarkWithAnalyticsFactory;
|
|
9
10
|
export declare const toggleStrike: ToggleMarkCommand;
|
|
10
|
-
export declare const toggleStrikeWithAnalytics:
|
|
11
|
+
export declare const toggleStrikeWithAnalytics: ToggleMarkWithAnalyticsFactory;
|
|
11
12
|
export declare const toggleStrong: ToggleMarkCommand;
|
|
12
|
-
export declare const toggleStrongWithAnalytics:
|
|
13
|
+
export declare const toggleStrongWithAnalytics: ToggleMarkWithAnalyticsFactory;
|
|
13
14
|
export declare const toggleUnderline: ToggleMarkCommand;
|
|
14
|
-
export declare const toggleUnderlineWithAnalytics:
|
|
15
|
+
export declare const toggleUnderlineWithAnalytics: ToggleMarkWithAnalyticsFactory;
|
|
15
16
|
export declare const toggleSuperscript: ToggleMarkCommand;
|
|
16
|
-
export declare const toggleSuperscriptWithAnalytics:
|
|
17
|
+
export declare const toggleSuperscriptWithAnalytics: ToggleMarkWithAnalyticsFactory;
|
|
17
18
|
export declare const toggleSubscript: ToggleMarkCommand;
|
|
18
|
-
export declare const toggleSubscriptWithAnalytics:
|
|
19
|
+
export declare const toggleSubscriptWithAnalytics: ToggleMarkWithAnalyticsFactory;
|
|
19
20
|
export declare const toggleCode: ToggleMarkCommand;
|
|
20
|
-
export declare const toggleCodeWithAnalytics:
|
|
21
|
+
export declare const toggleCodeWithAnalytics: ToggleMarkWithAnalyticsFactory;
|
|
22
|
+
export {};
|
|
@@ -1,24 +1,17 @@
|
|
|
1
1
|
import type { NextEditorPlugin, OptionalPlugin, TextFormattingOptions } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
3
|
-
import type {
|
|
3
|
+
import type { ToggleMarkWithAnalyticsCommand } from './actions';
|
|
4
4
|
declare const textFormatting: NextEditorPlugin<'textFormatting', {
|
|
5
5
|
pluginConfiguration: TextFormattingOptions | undefined;
|
|
6
6
|
dependencies: [OptionalPlugin<typeof analyticsPlugin>];
|
|
7
7
|
actions: {
|
|
8
|
-
toggleSuperscript:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
toggleCodeWithAnalytics: ToggleMarkWithAnalyticsCommand;
|
|
16
|
-
toggleUnderline: ToggleMarkCommand;
|
|
17
|
-
toggleUnderlineWithAnalytics: ToggleMarkWithAnalyticsCommand;
|
|
18
|
-
toggleEm: ToggleMarkCommand;
|
|
19
|
-
toggleEmWithAnalytics: ToggleMarkWithAnalyticsCommand;
|
|
20
|
-
toggleStrong: ToggleMarkCommand;
|
|
21
|
-
toggleStrongWithAnalytics: ToggleMarkWithAnalyticsCommand;
|
|
8
|
+
toggleSuperscript: ToggleMarkWithAnalyticsCommand;
|
|
9
|
+
toggleSubscript: ToggleMarkWithAnalyticsCommand;
|
|
10
|
+
toggleStrike: ToggleMarkWithAnalyticsCommand;
|
|
11
|
+
toggleCode: ToggleMarkWithAnalyticsCommand;
|
|
12
|
+
toggleUnderline: ToggleMarkWithAnalyticsCommand;
|
|
13
|
+
toggleEm: ToggleMarkWithAnalyticsCommand;
|
|
14
|
+
toggleStrong: ToggleMarkWithAnalyticsCommand;
|
|
22
15
|
};
|
|
23
16
|
}>;
|
|
24
17
|
export default textFormatting;
|
|
@@ -64,7 +64,6 @@ interface EditorBaseProps {
|
|
|
64
64
|
contextPanel?: ReactComponents;
|
|
65
65
|
errorReporterHandler?: ErrorReportingHandler;
|
|
66
66
|
contentTransformerProvider?: (schema: Schema) => Transformer<string>;
|
|
67
|
-
textFormatting?: TextFormattingOptions;
|
|
68
67
|
maxHeight?: number;
|
|
69
68
|
minHeight?: number;
|
|
70
69
|
placeholder?: string;
|
|
@@ -87,7 +86,6 @@ interface EditorBaseProps {
|
|
|
87
86
|
inputSamplingLimit?: number;
|
|
88
87
|
extensionProviders?: ExtensionProvidersProp;
|
|
89
88
|
UNSAFE_useAnalyticsContext?: boolean;
|
|
90
|
-
codeBlock?: CodeBlockOptions;
|
|
91
89
|
/**
|
|
92
90
|
* @default undefined
|
|
93
91
|
* @description Enables valid transaction events to be tracked in analytics (at a sampled rate)
|
|
@@ -144,22 +142,16 @@ export interface EditorSharedPropsWithPlugins {
|
|
|
144
142
|
*/
|
|
145
143
|
performanceTracking?: PerformanceTracking;
|
|
146
144
|
sanitizePrivateContent?: boolean;
|
|
147
|
-
allowAnalyticsGASV3?: boolean;
|
|
148
145
|
media?: MediaOptions;
|
|
149
146
|
collabEdit?: CollabEditOptions;
|
|
150
|
-
|
|
147
|
+
codeBlock?: CodeBlockOptions;
|
|
148
|
+
textFormatting?: TextFormattingOptions;
|
|
151
149
|
primaryToolbarComponents?: PrimaryToolbarComponents;
|
|
152
150
|
allowUndoRedoButtons?: boolean;
|
|
153
|
-
allowTables?: boolean | TablesPluginConfig;
|
|
154
|
-
/** @deprecated Use smartLinks instead. */
|
|
155
|
-
UNSAFE_cards?: CardOptions;
|
|
156
|
-
/** @deprecated Use linking instead. */
|
|
157
|
-
smartLinks?: CardOptions;
|
|
158
151
|
/**
|
|
159
152
|
* Configure and extend editor linking behaviour
|
|
160
153
|
*/
|
|
161
154
|
linking?: LinkingOptions;
|
|
162
|
-
contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
|
|
163
155
|
}
|
|
164
156
|
export interface EditorProps extends EditorBaseProps, EditorPluginFeatureProps, EditorSharedPropsWithPlugins, EditorProviderProps {
|
|
165
157
|
/**
|
|
@@ -188,6 +180,7 @@ export interface EditorProviderProps {
|
|
|
188
180
|
mentionProvider?: Promise<MentionProvider>;
|
|
189
181
|
autoformattingProvider?: Providers['autoformattingProvider'];
|
|
190
182
|
macroProvider?: Providers['macroProvider'];
|
|
183
|
+
contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
|
|
191
184
|
}
|
|
192
185
|
export interface EditorPluginFeatureProps {
|
|
193
186
|
allowExpand?: boolean | {
|
|
@@ -253,4 +246,11 @@ export interface EditorPluginFeatureProps {
|
|
|
253
246
|
waitForMediaUpload?: boolean;
|
|
254
247
|
extensionHandlers?: ExtensionHandlers;
|
|
255
248
|
allowTextColor?: boolean | TextColorPluginConfig;
|
|
249
|
+
allowTables?: boolean | TablesPluginConfig;
|
|
250
|
+
insertMenuItems?: MenuItem[];
|
|
251
|
+
/** @deprecated Use smartLinks instead. */
|
|
252
|
+
UNSAFE_cards?: CardOptions;
|
|
253
|
+
/** @deprecated Use linking instead. */
|
|
254
|
+
smartLinks?: CardOptions;
|
|
255
|
+
allowAnalyticsGASV3?: boolean;
|
|
256
256
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { DispatchAnalyticsEvent } from '../../plugins/analytics/types';
|
|
3
|
-
import {
|
|
2
|
+
import type { DispatchAnalyticsEvent } from '../../plugins/analytics/types';
|
|
3
|
+
import type { ErrorEventPayload } from '../../plugins/analytics';
|
|
4
|
+
import { ACTION } from '../../plugins/analytics';
|
|
4
5
|
type ErrorCrashPayload = Extract<ErrorEventPayload, {
|
|
5
6
|
action: ACTION.EDITOR_CRASHED;
|
|
6
7
|
}>;
|
|
@@ -24,7 +24,6 @@ export interface EditorViewProps {
|
|
|
24
24
|
createAnalyticsEvent?: CreateUIAnalyticsEvent;
|
|
25
25
|
providerFactory: ProviderFactory;
|
|
26
26
|
portalProviderAPI: PortalProviderAPI;
|
|
27
|
-
allowAnalyticsGASV3?: boolean;
|
|
28
27
|
disabled?: boolean;
|
|
29
28
|
experienceStore?: ExperienceStore;
|
|
30
29
|
render?: (props: {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
1
|
+
import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
2
2
|
import type { ExtensionProvider } from '@atlaskit/editor-common/extensions';
|
|
3
3
|
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
4
|
-
import EditorActions from '../../actions';
|
|
5
|
-
import { QuickInsertProvider } from '../../plugins/quick-insert/types';
|
|
6
|
-
import { EditorNextProps } from '../../types/editor-props';
|
|
4
|
+
import type EditorActions from '../../actions';
|
|
5
|
+
import type { QuickInsertProvider } from '../../plugins/quick-insert/types';
|
|
6
|
+
import type { EditorNextProps } from '../../types/editor-props';
|
|
7
7
|
export type ProviderFactoryState = {
|
|
8
8
|
extensionProvider?: ExtensionProvider;
|
|
9
9
|
quickInsertProvider?: Promise<QuickInsertProvider>;
|
|
@@ -5,5 +5,6 @@ import type { EditorProps } from './types/editor-props';
|
|
|
5
5
|
export type { AllowedBlockTypes, Command, CommandDispatch, DomAtPos, EditorAppearance, EditorAppearanceComponentProps, EditorConfig, EditorInstance, EditorPlugin, EditorProps, ExtensionConfig, ExtensionProvidersProp, FeedbackInfo, MarkConfig, MessageDescriptor, NodeConfig, NodeViewConfig, PluginsOptions, PMPlugin, PMPluginCreateConfig, PMPluginFactory, PMPluginFactoryParams, ReactComponents, ToolbarUIComponentFactory, ToolbarUiComponentFactoryParams, UIComponentFactory, UiComponentFactoryParams, } from './types';
|
|
6
6
|
export default class Editor extends React.Component<EditorProps> {
|
|
7
7
|
static defaultProps: EditorProps;
|
|
8
|
+
constructor(props: EditorProps);
|
|
8
9
|
render(): jsx.JSX.Element;
|
|
9
10
|
}
|