@atlaskit/editor-core 187.40.2 → 187.41.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 +17 -0
- package/dist/cjs/editor-next/hooks/useEditorMeasuresConstructor.js +2 -2
- package/dist/cjs/editor-next/utils/editorMeasureTTICallback.js +3 -2
- package/dist/cjs/element-browser.js +2 -3
- package/dist/cjs/plugins/media/index.js +59 -54
- package/dist/cjs/plugins/media/nodeviews/mediaInline.js +44 -29
- package/dist/cjs/plugins/media/ui/ToolbarMedia/index.js +20 -33
- package/dist/cjs/plugins/quick-insert/index.js +4 -2
- package/dist/cjs/{ui/ElementBrowser → plugins/quick-insert/ui/ModalElementBrowser}/ModalElementBrowser.js +8 -7
- package/dist/cjs/plugins/quick-insert/ui/ModalElementBrowser/index.js +10 -17
- package/dist/cjs/ui/ElementBrowser/InsertMenu.js +5 -6
- package/dist/cjs/ui/ElementBrowser/types.js +1 -8
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/editor-next/hooks/useEditorMeasuresConstructor.js +2 -2
- package/dist/es2019/editor-next/utils/editorMeasureTTICallback.js +3 -2
- package/dist/es2019/element-browser.js +1 -1
- package/dist/es2019/plugins/media/index.js +28 -20
- package/dist/es2019/plugins/media/nodeviews/mediaInline.js +45 -27
- package/dist/es2019/plugins/media/ui/ToolbarMedia/index.js +24 -32
- package/dist/es2019/plugins/quick-insert/index.js +4 -2
- package/dist/es2019/{ui/ElementBrowser → plugins/quick-insert/ui/ModalElementBrowser}/ModalElementBrowser.js +5 -5
- package/dist/es2019/plugins/quick-insert/ui/ModalElementBrowser/index.js +8 -13
- package/dist/es2019/ui/ElementBrowser/InsertMenu.js +2 -3
- package/dist/es2019/ui/ElementBrowser/types.js +1 -5
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/editor-next/hooks/useEditorMeasuresConstructor.js +2 -2
- package/dist/esm/editor-next/utils/editorMeasureTTICallback.js +3 -2
- package/dist/esm/element-browser.js +1 -1
- package/dist/esm/plugins/media/index.js +57 -52
- package/dist/esm/plugins/media/nodeviews/mediaInline.js +44 -29
- package/dist/esm/plugins/media/ui/ToolbarMedia/index.js +20 -30
- package/dist/esm/plugins/quick-insert/index.js +4 -2
- package/dist/esm/{ui/ElementBrowser → plugins/quick-insert/ui/ModalElementBrowser}/ModalElementBrowser.js +5 -5
- package/dist/esm/plugins/quick-insert/ui/ModalElementBrowser/index.js +10 -17
- package/dist/esm/ui/ElementBrowser/InsertMenu.js +2 -3
- package/dist/esm/ui/ElementBrowser/types.js +1 -5
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/editor-next/hooks/useEditorMeasuresConstructor.d.ts +4 -4
- package/dist/types/editor-next/utils/editorMeasureTTICallback.d.ts +5 -5
- package/dist/types/element-browser.d.ts +1 -1
- package/dist/types/labs/next/presets/default.d.ts +2 -2
- package/dist/types/plugins/media/index.d.ts +1 -1
- package/dist/types/plugins/media/nodeviews/mediaInline.d.ts +5 -4
- package/dist/types/plugins/media/types.d.ts +10 -1
- package/dist/types/plugins/media/ui/ToolbarMedia/index.d.ts +6 -10
- package/dist/types/plugins/quick-insert/index.d.ts +3 -3
- package/dist/types/{ui/ElementBrowser → plugins/quick-insert/ui/ModalElementBrowser}/ModalElementBrowser.d.ts +4 -3
- package/dist/types/{ui/ElementBrowser → plugins/quick-insert/ui/ModalElementBrowser}/categories.d.ts +1 -1
- package/dist/types/plugins/quick-insert/ui/ModalElementBrowser/index.d.ts +4 -1
- package/dist/types/ui/ElementBrowser/types.d.ts +6 -18
- package/dist/types-ts4.5/editor-next/hooks/useEditorMeasuresConstructor.d.ts +4 -4
- package/dist/types-ts4.5/editor-next/utils/editorMeasureTTICallback.d.ts +5 -5
- package/dist/types-ts4.5/element-browser.d.ts +1 -1
- package/dist/types-ts4.5/labs/next/presets/default.d.ts +2 -2
- package/dist/types-ts4.5/plugins/media/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/nodeviews/mediaInline.d.ts +5 -4
- package/dist/types-ts4.5/plugins/media/types.d.ts +10 -1
- package/dist/types-ts4.5/plugins/media/ui/ToolbarMedia/index.d.ts +6 -10
- package/dist/types-ts4.5/plugins/quick-insert/index.d.ts +3 -3
- package/dist/types-ts4.5/{ui/ElementBrowser → plugins/quick-insert/ui/ModalElementBrowser}/ModalElementBrowser.d.ts +4 -3
- package/dist/types-ts4.5/{ui/ElementBrowser → plugins/quick-insert/ui/ModalElementBrowser}/categories.d.ts +1 -1
- package/dist/types-ts4.5/plugins/quick-insert/ui/ModalElementBrowser/index.d.ts +4 -1
- package/dist/types-ts4.5/ui/ElementBrowser/types.d.ts +6 -18
- package/package.json +2 -2
- package/report.api.md +7 -1
- package/tmp/api-report-tmp.d.ts +7 -1
- package/dist/cjs/ui/ElementBrowser/ElementBrowser.js +0 -152
- package/dist/cjs/ui/ElementBrowser/ViewMore.js +0 -39
- package/dist/cjs/ui/ElementBrowser/components/CategoryList.js +0 -115
- package/dist/cjs/ui/ElementBrowser/components/ElementBrowserLoader.js +0 -36
- package/dist/cjs/ui/ElementBrowser/components/ElementList/ElementList.js +0 -250
- package/dist/cjs/ui/ElementBrowser/components/ElementList/EmptyState.js +0 -47
- package/dist/cjs/ui/ElementBrowser/components/ElementList/NotFoundIllustration.js +0 -69
- package/dist/cjs/ui/ElementBrowser/components/ElementList/cellSizeAndPositionGetter.js +0 -42
- package/dist/cjs/ui/ElementBrowser/components/ElementList/utils.js +0 -54
- package/dist/cjs/ui/ElementBrowser/components/ElementSearch.js +0 -88
- package/dist/cjs/ui/ElementBrowser/components/StatelessElementBrowser.js +0 -269
- package/dist/cjs/ui/ElementBrowser/constants.js +0 -43
- package/dist/cjs/ui/ElementBrowser/hooks/use-container-width.js +0 -70
- package/dist/cjs/ui/ElementBrowser/hooks/use-focus.js +0 -51
- package/dist/cjs/ui/ElementBrowser/hooks/use-select-and-focus-on-arrow-navigation.js +0 -286
- package/dist/cjs/ui/ElementBrowser/index.js +0 -10
- package/dist/es2019/ui/ElementBrowser/ElementBrowser.js +0 -117
- package/dist/es2019/ui/ElementBrowser/ViewMore.js +0 -40
- package/dist/es2019/ui/ElementBrowser/components/CategoryList.js +0 -104
- package/dist/es2019/ui/ElementBrowser/components/ElementBrowserLoader.js +0 -21
- package/dist/es2019/ui/ElementBrowser/components/ElementList/ElementList.js +0 -301
- package/dist/es2019/ui/ElementBrowser/components/ElementList/EmptyState.js +0 -58
- package/dist/es2019/ui/ElementBrowser/components/ElementList/NotFoundIllustration.js +0 -64
- package/dist/es2019/ui/ElementBrowser/components/ElementList/cellSizeAndPositionGetter.js +0 -39
- package/dist/es2019/ui/ElementBrowser/components/ElementList/utils.js +0 -50
- package/dist/es2019/ui/ElementBrowser/components/ElementSearch.js +0 -117
- package/dist/es2019/ui/ElementBrowser/components/StatelessElementBrowser.js +0 -339
- package/dist/es2019/ui/ElementBrowser/constants.js +0 -24
- package/dist/es2019/ui/ElementBrowser/hooks/use-container-width.js +0 -59
- package/dist/es2019/ui/ElementBrowser/hooks/use-focus.js +0 -48
- package/dist/es2019/ui/ElementBrowser/hooks/use-select-and-focus-on-arrow-navigation.js +0 -284
- package/dist/es2019/ui/ElementBrowser/index.js +0 -2
- package/dist/esm/ui/ElementBrowser/ElementBrowser.js +0 -142
- package/dist/esm/ui/ElementBrowser/ViewMore.js +0 -31
- package/dist/esm/ui/ElementBrowser/components/CategoryList.js +0 -104
- package/dist/esm/ui/ElementBrowser/components/ElementBrowserLoader.js +0 -23
- package/dist/esm/ui/ElementBrowser/components/ElementList/ElementList.js +0 -238
- package/dist/esm/ui/ElementBrowser/components/ElementList/EmptyState.js +0 -40
- package/dist/esm/ui/ElementBrowser/components/ElementList/NotFoundIllustration.js +0 -62
- package/dist/esm/ui/ElementBrowser/components/ElementList/cellSizeAndPositionGetter.js +0 -37
- package/dist/esm/ui/ElementBrowser/components/ElementList/utils.js +0 -46
- package/dist/esm/ui/ElementBrowser/components/ElementSearch.js +0 -77
- package/dist/esm/ui/ElementBrowser/components/StatelessElementBrowser.js +0 -258
- package/dist/esm/ui/ElementBrowser/constants.js +0 -24
- package/dist/esm/ui/ElementBrowser/hooks/use-container-width.js +0 -61
- package/dist/esm/ui/ElementBrowser/hooks/use-focus.js +0 -46
- package/dist/esm/ui/ElementBrowser/hooks/use-select-and-focus-on-arrow-navigation.js +0 -278
- package/dist/esm/ui/ElementBrowser/index.js +0 -2
- package/dist/types/ui/ElementBrowser/ElementBrowser.d.ts +0 -37
- package/dist/types/ui/ElementBrowser/ViewMore.d.ts +0 -6
- package/dist/types/ui/ElementBrowser/components/CategoryList.d.ts +0 -10
- package/dist/types/ui/ElementBrowser/components/ElementBrowserLoader.d.ts +0 -5
- package/dist/types/ui/ElementBrowser/components/ElementList/ElementList.d.ts +0 -29
- package/dist/types/ui/ElementBrowser/components/ElementList/EmptyState.d.ts +0 -6
- package/dist/types/ui/ElementBrowser/components/ElementList/NotFoundIllustration.d.ts +0 -2
- package/dist/types/ui/ElementBrowser/components/ElementList/cellSizeAndPositionGetter.d.ts +0 -7
- package/dist/types/ui/ElementBrowser/components/ElementList/utils.d.ts +0 -12
- package/dist/types/ui/ElementBrowser/components/ElementSearch.d.ts +0 -18
- package/dist/types/ui/ElementBrowser/components/StatelessElementBrowser.d.ts +0 -23
- package/dist/types/ui/ElementBrowser/constants.d.ts +0 -20
- package/dist/types/ui/ElementBrowser/hooks/use-container-width.d.ts +0 -33
- package/dist/types/ui/ElementBrowser/hooks/use-focus.d.ts +0 -35
- package/dist/types/ui/ElementBrowser/hooks/use-select-and-focus-on-arrow-navigation.d.ts +0 -72
- package/dist/types/ui/ElementBrowser/index.d.ts +0 -2
- package/dist/types-ts4.5/ui/ElementBrowser/ElementBrowser.d.ts +0 -37
- package/dist/types-ts4.5/ui/ElementBrowser/ViewMore.d.ts +0 -6
- package/dist/types-ts4.5/ui/ElementBrowser/components/CategoryList.d.ts +0 -10
- package/dist/types-ts4.5/ui/ElementBrowser/components/ElementBrowserLoader.d.ts +0 -5
- package/dist/types-ts4.5/ui/ElementBrowser/components/ElementList/ElementList.d.ts +0 -29
- package/dist/types-ts4.5/ui/ElementBrowser/components/ElementList/EmptyState.d.ts +0 -6
- package/dist/types-ts4.5/ui/ElementBrowser/components/ElementList/NotFoundIllustration.d.ts +0 -2
- package/dist/types-ts4.5/ui/ElementBrowser/components/ElementList/cellSizeAndPositionGetter.d.ts +0 -7
- package/dist/types-ts4.5/ui/ElementBrowser/components/ElementList/utils.d.ts +0 -12
- package/dist/types-ts4.5/ui/ElementBrowser/components/ElementSearch.d.ts +0 -18
- package/dist/types-ts4.5/ui/ElementBrowser/components/StatelessElementBrowser.d.ts +0 -23
- package/dist/types-ts4.5/ui/ElementBrowser/constants.d.ts +0 -20
- package/dist/types-ts4.5/ui/ElementBrowser/hooks/use-container-width.d.ts +0 -33
- package/dist/types-ts4.5/ui/ElementBrowser/hooks/use-focus.d.ts +0 -35
- package/dist/types-ts4.5/ui/ElementBrowser/hooks/use-select-and-focus-on-arrow-navigation.d.ts +0 -72
- package/dist/types-ts4.5/ui/ElementBrowser/index.d.ts +0 -2
- /package/dist/cjs/{ui/ElementBrowser → plugins/quick-insert/ui/ModalElementBrowser}/categories.js +0 -0
- /package/dist/cjs/{ui/ElementBrowser → plugins/quick-insert/ui/ModalElementBrowser}/messages.js +0 -0
- /package/dist/es2019/{ui/ElementBrowser → plugins/quick-insert/ui/ModalElementBrowser}/categories.js +0 -0
- /package/dist/es2019/{ui/ElementBrowser → plugins/quick-insert/ui/ModalElementBrowser}/messages.js +0 -0
- /package/dist/esm/{ui/ElementBrowser → plugins/quick-insert/ui/ModalElementBrowser}/categories.js +0 -0
- /package/dist/esm/{ui/ElementBrowser → plugins/quick-insert/ui/ModalElementBrowser}/messages.js +0 -0
- /package/dist/types/{ui/ElementBrowser → plugins/quick-insert/ui/ModalElementBrowser}/messages.d.ts +0 -0
- /package/dist/types-ts4.5/{ui/ElementBrowser → plugins/quick-insert/ui/ModalElementBrowser}/messages.d.ts +0 -0
|
@@ -14,11 +14,10 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
14
14
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _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; }
|
|
15
15
|
import React, { useEffect, useState } from 'react';
|
|
16
16
|
import { SelectionBasedNodeView } from '@atlaskit/editor-common/selection-based-node-view';
|
|
17
|
-
import
|
|
17
|
+
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
18
18
|
import { MediaInlineCard } from '@atlaskit/media-card';
|
|
19
19
|
import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
20
20
|
import { MediaInlineNodeSelector } from './styles';
|
|
21
|
-
import { stateKey as mediaStateKey } from '../pm-plugins/plugin-key';
|
|
22
21
|
import { MediaNodeUpdater } from './mediaNodeUpdater';
|
|
23
22
|
import { MediaInlineCardLoadingView } from '@atlaskit/media-ui';
|
|
24
23
|
export var createMediaNodeUpdater = function createMediaNodeUpdater(props) {
|
|
@@ -174,6 +173,31 @@ export var MediaInline = function MediaInline(props) {
|
|
|
174
173
|
mediaClientConfig: viewMediaClientConfig
|
|
175
174
|
});
|
|
176
175
|
};
|
|
176
|
+
var MediaInlineSharedState = function MediaInlineSharedState(_ref3) {
|
|
177
|
+
var identifier = _ref3.identifier,
|
|
178
|
+
mediaProvider = _ref3.mediaProvider,
|
|
179
|
+
node = _ref3.node,
|
|
180
|
+
isSelected = _ref3.isSelected,
|
|
181
|
+
getPos = _ref3.getPos,
|
|
182
|
+
contextIdentifierProvider = _ref3.contextIdentifierProvider,
|
|
183
|
+
api = _ref3.api,
|
|
184
|
+
view = _ref3.view;
|
|
185
|
+
var _useSharedPluginState = useSharedPluginState(api, ['media']),
|
|
186
|
+
mediaState = _useSharedPluginState.mediaState;
|
|
187
|
+
if (!mediaState) {
|
|
188
|
+
return null;
|
|
189
|
+
}
|
|
190
|
+
return /*#__PURE__*/React.createElement(MediaInline, {
|
|
191
|
+
identifier: identifier,
|
|
192
|
+
mediaProvider: mediaProvider,
|
|
193
|
+
mediaPluginState: mediaState,
|
|
194
|
+
node: node,
|
|
195
|
+
isSelected: isSelected,
|
|
196
|
+
view: view,
|
|
197
|
+
getPos: getPos,
|
|
198
|
+
contextIdentifierProvider: contextIdentifierProvider
|
|
199
|
+
});
|
|
200
|
+
};
|
|
177
201
|
export var MediaInlineNodeView = /*#__PURE__*/function (_SelectionBasedNodeVi) {
|
|
178
202
|
_inherits(MediaInlineNodeView, _SelectionBasedNodeVi);
|
|
179
203
|
var _super = _createSuper(MediaInlineNodeView);
|
|
@@ -214,38 +238,28 @@ export var MediaInlineNodeView = /*#__PURE__*/function (_SelectionBasedNodeVi) {
|
|
|
214
238
|
key: "render",
|
|
215
239
|
value: function render(props) {
|
|
216
240
|
var _this = this;
|
|
217
|
-
var providerFactory = props.providerFactory
|
|
241
|
+
var providerFactory = props.providerFactory,
|
|
242
|
+
api = props.api;
|
|
243
|
+
var view = this.view;
|
|
218
244
|
var getPos = this.getPos;
|
|
219
245
|
return /*#__PURE__*/React.createElement(WithProviders, {
|
|
220
246
|
providers: ['mediaProvider', 'contextIdentifierProvider'],
|
|
221
247
|
providerFactory: providerFactory,
|
|
222
|
-
renderNode: function renderNode(
|
|
223
|
-
var mediaProvider =
|
|
224
|
-
contextIdentifierProvider =
|
|
248
|
+
renderNode: function renderNode(_ref4) {
|
|
249
|
+
var mediaProvider = _ref4.mediaProvider,
|
|
250
|
+
contextIdentifierProvider = _ref4.contextIdentifierProvider;
|
|
225
251
|
if (!mediaProvider) {
|
|
226
252
|
return null;
|
|
227
253
|
}
|
|
228
|
-
return /*#__PURE__*/React.createElement(
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
}
|
|
238
|
-
return /*#__PURE__*/React.createElement(MediaInline, {
|
|
239
|
-
identifier: _this.node.attrs.id,
|
|
240
|
-
mediaProvider: mediaProvider,
|
|
241
|
-
mediaPluginState: mediaPluginState,
|
|
242
|
-
node: _this.node,
|
|
243
|
-
isSelected: _this.nodeInsideSelection(),
|
|
244
|
-
view: _this.view,
|
|
245
|
-
getPos: getPos,
|
|
246
|
-
contextIdentifierProvider: contextIdentifierProvider
|
|
247
|
-
});
|
|
248
|
-
}
|
|
254
|
+
return /*#__PURE__*/React.createElement(MediaInlineSharedState, {
|
|
255
|
+
identifier: _this.node.attrs.id,
|
|
256
|
+
mediaProvider: mediaProvider,
|
|
257
|
+
node: _this.node,
|
|
258
|
+
isSelected: _this.nodeInsideSelection(),
|
|
259
|
+
view: view,
|
|
260
|
+
getPos: getPos,
|
|
261
|
+
contextIdentifierProvider: contextIdentifierProvider,
|
|
262
|
+
api: api
|
|
249
263
|
});
|
|
250
264
|
}
|
|
251
265
|
});
|
|
@@ -253,11 +267,12 @@ export var MediaInlineNodeView = /*#__PURE__*/function (_SelectionBasedNodeVi) {
|
|
|
253
267
|
}]);
|
|
254
268
|
return MediaInlineNodeView;
|
|
255
269
|
}(SelectionBasedNodeView);
|
|
256
|
-
export var ReactMediaInlineNode = function ReactMediaInlineNode(portalProviderAPI, eventDispatcher, providerFactory,
|
|
270
|
+
export var ReactMediaInlineNode = function ReactMediaInlineNode(portalProviderAPI, eventDispatcher, providerFactory, api, dispatchAnalyticsEvent) {
|
|
257
271
|
return function (node, view, getPos) {
|
|
258
272
|
return new MediaInlineNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, {
|
|
259
273
|
providerFactory: providerFactory,
|
|
260
|
-
dispatchAnalyticsEvent: dispatchAnalyticsEvent
|
|
274
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
275
|
+
api: api
|
|
261
276
|
}).init();
|
|
262
277
|
};
|
|
263
278
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import AttachmentIcon from '@atlaskit/icon/glyph/editor/attachment';
|
|
3
|
-
import ToolbarButton,
|
|
4
|
-
import WithPluginState from '../../../../ui/WithPluginState';
|
|
3
|
+
import { ToolbarButton, TOOLBAR_BUTTON } from '@atlaskit/editor-common/ui-menu';
|
|
5
4
|
import { toolbarMediaMessages } from './toolbar-media-messages';
|
|
5
|
+
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
6
6
|
import { injectIntl } from 'react-intl-next';
|
|
7
7
|
var onClickMediaButton = function onClickMediaButton(pluginState) {
|
|
8
8
|
return function () {
|
|
@@ -11,35 +11,25 @@ var onClickMediaButton = function onClickMediaButton(pluginState) {
|
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
13
|
var ToolbarMedia = function ToolbarMedia(_ref) {
|
|
14
|
-
var
|
|
15
|
-
eventDispatcher = _ref.eventDispatcher,
|
|
16
|
-
pluginKey = _ref.pluginKey,
|
|
17
|
-
isDisabled = _ref.isDisabled,
|
|
14
|
+
var isDisabled = _ref.isDisabled,
|
|
18
15
|
isReducedSpacing = _ref.isReducedSpacing,
|
|
19
|
-
intl = _ref.intl
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
title: intl.formatMessage(toolbarMediaTitle),
|
|
37
|
-
spacing: isReducedSpacing ? 'none' : 'default',
|
|
38
|
-
iconBefore: /*#__PURE__*/React.createElement(AttachmentIcon, {
|
|
39
|
-
label: intl.formatMessage(toolbarMediaTitle)
|
|
40
|
-
})
|
|
41
|
-
});
|
|
42
|
-
}
|
|
16
|
+
intl = _ref.intl,
|
|
17
|
+
api = _ref.api;
|
|
18
|
+
var _useSharedPluginState = useSharedPluginState(api, ['media']),
|
|
19
|
+
mediaState = _useSharedPluginState.mediaState;
|
|
20
|
+
if (!(mediaState !== null && mediaState !== void 0 && mediaState.allowsUploads)) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
var toolbarMediaTitle = toolbarMediaMessages.toolbarMediaTitle;
|
|
24
|
+
return /*#__PURE__*/React.createElement(ToolbarButton, {
|
|
25
|
+
buttonId: TOOLBAR_BUTTON.MEDIA,
|
|
26
|
+
onClick: onClickMediaButton(mediaState),
|
|
27
|
+
disabled: isDisabled,
|
|
28
|
+
title: intl.formatMessage(toolbarMediaTitle),
|
|
29
|
+
spacing: isReducedSpacing ? 'none' : 'default',
|
|
30
|
+
iconBefore: /*#__PURE__*/React.createElement(AttachmentIcon, {
|
|
31
|
+
label: intl.formatMessage(toolbarMediaTitle)
|
|
32
|
+
})
|
|
43
33
|
});
|
|
44
34
|
};
|
|
45
35
|
export default injectIntl(ToolbarMedia);
|
|
@@ -52,7 +52,8 @@ var quickInsertPlugin = function quickInsertPlugin(_ref) {
|
|
|
52
52
|
if (options !== null && options !== void 0 && options.enableElementBrowser) {
|
|
53
53
|
return /*#__PURE__*/React.createElement(ModalElementBrowser, {
|
|
54
54
|
editorView: editorView,
|
|
55
|
-
helpUrl: options === null || options === void 0 ? void 0 : options.elementBrowserHelpUrl
|
|
55
|
+
helpUrl: options === null || options === void 0 ? void 0 : options.elementBrowserHelpUrl,
|
|
56
|
+
pluginInjectionAPI: api
|
|
56
57
|
});
|
|
57
58
|
}
|
|
58
59
|
return null;
|
|
@@ -68,7 +69,8 @@ var quickInsertPlugin = function quickInsertPlugin(_ref) {
|
|
|
68
69
|
return {
|
|
69
70
|
lazyDefaultItems: quickInsertState.lazyDefaultItems,
|
|
70
71
|
emptyStateHandler: quickInsertState.emptyStateHandler,
|
|
71
|
-
providedItems: quickInsertState.providedItems
|
|
72
|
+
providedItems: quickInsertState.providedItems,
|
|
73
|
+
isElementBrowserModalOpen: quickInsertState.isElementBrowserModalOpen
|
|
72
74
|
};
|
|
73
75
|
},
|
|
74
76
|
actions: {
|
|
@@ -11,17 +11,17 @@ import { borderRadius } from '@atlaskit/theme/constants';
|
|
|
11
11
|
import Button from '@atlaskit/button/custom-theme-button';
|
|
12
12
|
import Modal, { ModalTransition, useModal } from '@atlaskit/modal-dialog';
|
|
13
13
|
import QuestionCircleIcon from '@atlaskit/icon/glyph/question-circle';
|
|
14
|
-
import ElementBrowser from '
|
|
14
|
+
import { ElementBrowser } from '@atlaskit/editor-common/element-browser';
|
|
15
15
|
import { getCategories } from './categories';
|
|
16
|
-
import { MODAL_WRAPPER_PADDING } from './constants';
|
|
17
16
|
import { messages } from './messages';
|
|
17
|
+
export var MODAL_WRAPPER_PADDING = 16;
|
|
18
18
|
var actions = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: inline-flex;\n margin: 0 -4px;\n"])));
|
|
19
|
-
var actionItem = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n flex: 1 0 auto;\n margin: 0
|
|
20
|
-
var wrapper = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n flex: 1 1 auto;\n box-sizing: border-box;\n padding: ", "
|
|
19
|
+
var actionItem = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n flex: 1 0 auto;\n margin: 0 ", ";\n"])), "var(--ds-space-050, 4px)");
|
|
20
|
+
var wrapper = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n flex: 1 1 auto;\n box-sizing: border-box;\n padding: ", " ", " 0 10px;\n overflow: hidden;\n background-color: ", ";\n border-radius: ", "px;\n"])), "var(--ds-space-200, 16px)", "var(--ds-space-200, 16px)", themed({
|
|
21
21
|
light: "var(--ds-surface-overlay, ".concat(N0, ")"),
|
|
22
22
|
dark: "var(--ds-surface-overlay, ".concat(DN50, ")")
|
|
23
23
|
})(), borderRadius());
|
|
24
|
-
var modalFooter = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n padding: ", "
|
|
24
|
+
var modalFooter = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n padding: ", ";\n\n position: relative;\n align-items: center;\n justify-content: space-between;\n"])), "var(--ds-space-200, 16px)");
|
|
25
25
|
var ModalElementBrowser = function ModalElementBrowser(props) {
|
|
26
26
|
var _useState = useState(),
|
|
27
27
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
|
-
import
|
|
3
|
-
import { pluginKey } from '../../plugin-key';
|
|
4
|
-
import ModalElementBrowser from '../../../../ui/ElementBrowser/ModalElementBrowser';
|
|
2
|
+
import ModalElementBrowser from './ModalElementBrowser';
|
|
5
3
|
import { closeElementBrowserModal, insertItem } from '../../commands';
|
|
6
4
|
import { getQuickInsertSuggestions } from '../../search';
|
|
5
|
+
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
7
6
|
var Modal = function Modal(_ref) {
|
|
8
7
|
var quickInsertState = _ref.quickInsertState,
|
|
9
8
|
editorView = _ref.editorView,
|
|
@@ -39,19 +38,13 @@ var Modal = function Modal(_ref) {
|
|
|
39
38
|
};
|
|
40
39
|
export default (function (_ref2) {
|
|
41
40
|
var editorView = _ref2.editorView,
|
|
42
|
-
helpUrl = _ref2.helpUrl
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}, [editorView, helpUrl]);
|
|
51
|
-
return /*#__PURE__*/React.createElement(WithPluginState, {
|
|
52
|
-
plugins: {
|
|
53
|
-
quickInsertState: pluginKey
|
|
54
|
-
},
|
|
55
|
-
render: render
|
|
41
|
+
helpUrl = _ref2.helpUrl,
|
|
42
|
+
pluginInjectionAPI = _ref2.pluginInjectionAPI;
|
|
43
|
+
var _useSharedPluginState = useSharedPluginState(pluginInjectionAPI, ['quickInsert']),
|
|
44
|
+
quickInsertState = _useSharedPluginState.quickInsertState;
|
|
45
|
+
return /*#__PURE__*/React.createElement(Modal, {
|
|
46
|
+
quickInsertState: quickInsertState !== null && quickInsertState !== void 0 ? quickInsertState : undefined,
|
|
47
|
+
editorView: editorView,
|
|
48
|
+
helpUrl: helpUrl
|
|
56
49
|
});
|
|
57
50
|
});
|
|
@@ -14,9 +14,8 @@ import { borderRadius } from '@atlaskit/theme';
|
|
|
14
14
|
import { themed } from '@atlaskit/theme/components';
|
|
15
15
|
import { DN50, N0, N30A, N60A } from '@atlaskit/theme/colors';
|
|
16
16
|
import { IconCode, IconDate, IconDecision, IconDivider, IconExpand, IconPanel, IconQuote, IconStatus } from '@atlaskit/editor-common/quick-insert';
|
|
17
|
-
import withOuterListeners from '
|
|
18
|
-
import ElementBrowser from '
|
|
19
|
-
import { ELEMENT_ITEM_HEIGHT } from './constants';
|
|
17
|
+
import { withReactEditorViewOuterListeners as withOuterListeners } from '@atlaskit/editor-common/ui-react';
|
|
18
|
+
import { ElementBrowser, ELEMENT_ITEM_HEIGHT } from '@atlaskit/editor-common/element-browser';
|
|
20
19
|
var InsertMenu = function InsertMenu(_ref) {
|
|
21
20
|
var _pluginInjectionApi$q6, _pluginInjectionApi$q7, _pluginInjectionApi$q8;
|
|
22
21
|
var editorView = _ref.editorView,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
|
-
import { ExperienceStore } from '@atlaskit/editor-common/ufo';
|
|
4
|
-
import { EditorProps } from '../../types/editor-props';
|
|
5
|
-
import { PerformanceTracking } from '../../types/performance-tracking';
|
|
2
|
+
import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
|
+
import type { ExperienceStore } from '@atlaskit/editor-common/ufo';
|
|
4
|
+
import type { EditorProps } from '../../types/editor-props';
|
|
5
|
+
import type { PerformanceTracking } from '../../types/performance-tracking';
|
|
6
6
|
/**
|
|
7
7
|
*
|
|
8
8
|
* Hook to be used for running analytics on mounting the editor.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
2
|
-
import { ExperienceStore } from '@atlaskit/editor-common/ufo';
|
|
3
|
-
import { EditorProps } from '../../types/editor-props';
|
|
4
|
-
import { PerformanceTracking } from '../../types/performance-tracking';
|
|
5
|
-
export default function editorMeasureTTICallback(tti: number, ttiFromInvocation: number, canceled: boolean, performanceTracking: PerformanceTracking | undefined, featureFlags: EditorProps['featureFlags'], createAnalyticsEvent?: CreateUIAnalyticsEvent, experienceStore?: ExperienceStore): void;
|
|
1
|
+
import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
2
|
+
import type { ExperienceStore } from '@atlaskit/editor-common/ufo';
|
|
3
|
+
import type { EditorProps } from '../../types/editor-props';
|
|
4
|
+
import type { PerformanceTracking } from '../../types/performance-tracking';
|
|
5
|
+
export default function editorMeasureTTICallback(tti: number, ttiFromInvocation: number, canceled: boolean, distortedDuration: boolean, performanceTracking: PerformanceTracking | undefined, featureFlags: EditorProps['featureFlags'], createAnalyticsEvent?: CreateUIAnalyticsEvent, experienceStore?: ExperienceStore): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { ElementBrowser } from '@atlaskit/editor-common/element-browser';
|
|
@@ -129,7 +129,7 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
129
129
|
pluginConfiguration: QuickInsertPluginOptions | undefined;
|
|
130
130
|
sharedState: import("@atlaskit/editor-common/types").QuickInsertSharedState | null;
|
|
131
131
|
actions: {
|
|
132
|
-
insertItem: (item: import("@atlaskit/editor-common/provider-factory").QuickInsertItem) => import("
|
|
132
|
+
insertItem: (item: import("@atlaskit/editor-common/provider-factory").QuickInsertItem) => import("@atlaskit/editor-common/types").Command;
|
|
133
133
|
getSuggestions: (searchOptions: import("@atlaskit/editor-common/types").QuickInsertSearchOptions) => import("@atlaskit/editor-common/provider-factory").QuickInsertItem[];
|
|
134
134
|
};
|
|
135
135
|
commands: {
|
|
@@ -284,7 +284,7 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
284
284
|
pluginConfiguration: QuickInsertPluginOptions | undefined;
|
|
285
285
|
sharedState: import("@atlaskit/editor-common/types").QuickInsertSharedState | null;
|
|
286
286
|
actions: {
|
|
287
|
-
insertItem: (item: import("@atlaskit/editor-common/provider-factory").QuickInsertItem) => import("
|
|
287
|
+
insertItem: (item: import("@atlaskit/editor-common/provider-factory").QuickInsertItem) => import("@atlaskit/editor-common/types").Command;
|
|
288
288
|
getSuggestions: (searchOptions: import("@atlaskit/editor-common/types").QuickInsertSearchOptions) => import("@atlaskit/editor-common/provider-factory").QuickInsertItem[];
|
|
289
289
|
};
|
|
290
290
|
commands: {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { MediaProvider } from '@atlaskit/editor-common/provider-factory';
|
|
2
2
|
import type { MediaState } from './pm-plugins/main';
|
|
3
3
|
import type { CustomMediaPicker } from './types';
|
|
4
|
-
import type { MediaNextEditorPluginType } from './next-plugin-type';
|
|
5
4
|
export type { MediaState, MediaProvider, CustomMediaPicker };
|
|
6
5
|
export { insertMediaSingleNode } from './utils/media-single';
|
|
6
|
+
import type { MediaNextEditorPluginType } from './next-plugin-type';
|
|
7
7
|
declare const mediaPlugin: MediaNextEditorPluginType;
|
|
8
8
|
export default mediaPlugin;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import type { EventDispatcher } from '
|
|
5
|
-
import type { getPosHandler
|
|
4
|
+
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
5
|
+
import type { getPosHandler as ProsemirrorGetPosHandler, getPosHandler } from '../types';
|
|
6
6
|
import { SelectionBasedNodeView } from '@atlaskit/editor-common/selection-based-node-view';
|
|
7
7
|
import type { FileIdentifier } from '@atlaskit/media-client';
|
|
8
8
|
import type { MediaProvider, ProviderFactory, ContextIdentifierProvider } from '@atlaskit/editor-common/provider-factory';
|
|
@@ -11,7 +11,7 @@ import type { MediaPluginState } from '../pm-plugins/types';
|
|
|
11
11
|
import { MediaNodeUpdater } from './mediaNodeUpdater';
|
|
12
12
|
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
13
13
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
14
|
-
import type
|
|
14
|
+
import type { MediaNextEditorPluginType } from '../next-plugin-type';
|
|
15
15
|
export interface MediaInlineProps {
|
|
16
16
|
mediaProvider: Promise<MediaProvider>;
|
|
17
17
|
identifier: FileIdentifier;
|
|
@@ -35,6 +35,7 @@ export declare const handleNewNode: (props: MediaInlineProps) => void;
|
|
|
35
35
|
export declare const MediaInline: React.FC<MediaInlineProps>;
|
|
36
36
|
export interface MediaInlineNodeViewProps {
|
|
37
37
|
providerFactory: ProviderFactory;
|
|
38
|
+
api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
|
|
38
39
|
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
39
40
|
}
|
|
40
41
|
export declare class MediaInlineNodeView extends SelectionBasedNodeView<MediaInlineNodeViewProps> {
|
|
@@ -46,4 +47,4 @@ export declare class MediaInlineNodeView extends SelectionBasedNodeView<MediaInl
|
|
|
46
47
|
viewShouldUpdate(nextNode: PMNode): boolean;
|
|
47
48
|
render(props: MediaInlineNodeViewProps): JSX.Element;
|
|
48
49
|
}
|
|
49
|
-
export declare const ReactMediaInlineNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory,
|
|
50
|
+
export declare const ReactMediaInlineNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined, dispatchAnalyticsEvent?: DispatchAnalyticsEvent) => (node: PMNode, view: EditorView, getPos: getPosHandler) => NodeView;
|
|
@@ -8,7 +8,9 @@ import type { MediaFeatureFlags } from '@atlaskit/media-common';
|
|
|
8
8
|
import type { UploadParams, MediaFile } from '@atlaskit/media-picker/types';
|
|
9
9
|
import type { EditorSelectionAPI } from '@atlaskit/editor-common/selection';
|
|
10
10
|
import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
11
|
-
|
|
11
|
+
interface PlaceholderTextOptions {
|
|
12
|
+
allowInserting?: boolean;
|
|
13
|
+
}
|
|
12
14
|
export type MediaStateStatus = 'unknown' | 'ready' | 'cancelled' | 'preview' | 'error' | 'mobile-upload-end';
|
|
13
15
|
export type MediaSingleWithType = 'pixel' | 'percentage';
|
|
14
16
|
export interface MediaOptions {
|
|
@@ -106,3 +108,10 @@ export type MediaDecorationSpec = {
|
|
|
106
108
|
type: 'media';
|
|
107
109
|
selected: boolean;
|
|
108
110
|
};
|
|
111
|
+
export type getPosHandler = getPosHandlerNode;
|
|
112
|
+
export type getPosHandlerNode = () => number | undefined;
|
|
113
|
+
export interface ReactNodeProps {
|
|
114
|
+
selected: boolean;
|
|
115
|
+
}
|
|
116
|
+
export type ForwardRef = (node: HTMLElement | null) => void;
|
|
117
|
+
export {};
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type { EventDispatcher } from '../../../../event-dispatcher';
|
|
5
|
-
import type { MediaPluginState } from '../../pm-plugins/types';
|
|
2
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { MediaNextEditorPluginType } from '../../next-plugin-type';
|
|
6
4
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
7
|
-
export interface Props
|
|
8
|
-
editorView: EditorView;
|
|
9
|
-
pluginKey: PluginKey<T>;
|
|
10
|
-
eventDispatcher: EventDispatcher;
|
|
5
|
+
export interface Props {
|
|
11
6
|
isDisabled?: boolean;
|
|
12
7
|
isReducedSpacing?: boolean;
|
|
8
|
+
api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
|
|
13
9
|
}
|
|
14
|
-
declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props
|
|
15
|
-
WrappedComponent: React.ComponentType<Props
|
|
10
|
+
declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
|
|
11
|
+
WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
|
|
16
12
|
};
|
|
17
13
|
export default _default;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
|
|
2
|
-
import type { NextEditorPlugin, Command } from '
|
|
3
|
-
import type { QuickInsertPluginOptions, QuickInsertSharedState, EditorCommand, QuickInsertSearchOptions } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { NextEditorPlugin, Command, QuickInsertPluginOptions, QuickInsertSharedState, EditorCommand, QuickInsertSearchOptions } from '@atlaskit/editor-common/types';
|
|
4
3
|
export type { QuickInsertPluginOptions };
|
|
5
|
-
|
|
4
|
+
export type QuickInsertPlugin = NextEditorPlugin<'quickInsert', {
|
|
6
5
|
pluginConfiguration: QuickInsertPluginOptions | undefined;
|
|
7
6
|
sharedState: QuickInsertSharedState | null;
|
|
8
7
|
actions: {
|
|
@@ -13,4 +12,5 @@ declare const quickInsertPlugin: NextEditorPlugin<'quickInsert', {
|
|
|
13
12
|
openElementBrowserModal: EditorCommand;
|
|
14
13
|
};
|
|
15
14
|
}>;
|
|
15
|
+
declare const quickInsertPlugin: QuickInsertPlugin;
|
|
16
16
|
export default quickInsertPlugin;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { WrappedComponentProps } from 'react-intl-next';
|
|
4
|
-
import { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
|
|
5
|
-
import { EmptyStateHandler } from '
|
|
3
|
+
import type { WrappedComponentProps } from 'react-intl-next';
|
|
4
|
+
import type { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
|
|
5
|
+
import type { EmptyStateHandler } from '@atlaskit/editor-common/types';
|
|
6
|
+
export declare const MODAL_WRAPPER_PADDING = 16;
|
|
6
7
|
export interface Props {
|
|
7
8
|
getItems: (query?: string, category?: string) => QuickInsertItem[];
|
|
8
9
|
onInsertItem: (item: QuickInsertItem) => void;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
4
|
+
import type { QuickInsertPlugin } from '../../';
|
|
3
5
|
type Props = {
|
|
4
6
|
editorView: EditorView;
|
|
5
7
|
helpUrl: string | undefined;
|
|
8
|
+
pluginInjectionAPI: ExtractInjectionAPI<QuickInsertPlugin> | undefined;
|
|
6
9
|
};
|
|
7
|
-
declare const _default: ({ editorView, helpUrl }: Props) => JSX.Element;
|
|
10
|
+
declare const _default: ({ editorView, helpUrl, pluginInjectionAPI }: Props) => JSX.Element;
|
|
8
11
|
export default _default;
|
|
@@ -1,22 +1,10 @@
|
|
|
1
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
2
1
|
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import type {
|
|
4
|
-
import type { MenuItem } from '@atlaskit/editor-common/ui-menu';
|
|
2
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
3
|
import type { PluginInjectionAPIWithDependencies } from '@atlaskit/editor-common/types';
|
|
4
|
+
import type { MenuItem } from '@atlaskit/editor-common/ui-menu';
|
|
6
5
|
import type { InsertBlockPluginDependencies } from '../../plugins/insert-block/types';
|
|
6
|
+
import type { BlockMenuItem } from '../../plugins/insert-block/ui/ToolbarInsertBlock/create-items';
|
|
7
7
|
type SimpleEventHandler<T> = (event?: T) => void;
|
|
8
|
-
export type Category = {
|
|
9
|
-
title: string;
|
|
10
|
-
name: string;
|
|
11
|
-
};
|
|
12
|
-
export declare enum Modes {
|
|
13
|
-
full = "full",
|
|
14
|
-
inline = "inline"
|
|
15
|
-
}
|
|
16
|
-
export type SelectedItemProps = {
|
|
17
|
-
selectedItemIndex?: number;
|
|
18
|
-
focusedItemIndex?: number;
|
|
19
|
-
};
|
|
20
8
|
export interface InsertMenuProps {
|
|
21
9
|
dropdownItems: BlockMenuItem[];
|
|
22
10
|
editorView: EditorView;
|
|
@@ -25,10 +13,10 @@ export interface InsertMenuProps {
|
|
|
25
13
|
onInsert: OnInsert;
|
|
26
14
|
pluginInjectionApi: PluginInjectionAPIWithDependencies<InsertBlockPluginDependencies> | undefined;
|
|
27
15
|
}
|
|
28
|
-
export type OnInsert = ({ item }: {
|
|
29
|
-
item: MenuItem;
|
|
30
|
-
}) => Transaction;
|
|
31
16
|
export type SvgGetterParams = {
|
|
32
17
|
name: string;
|
|
33
18
|
};
|
|
19
|
+
export type OnInsert = ({ item }: {
|
|
20
|
+
item: MenuItem;
|
|
21
|
+
}) => Transaction;
|
|
34
22
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
|
-
import { ExperienceStore } from '@atlaskit/editor-common/ufo';
|
|
4
|
-
import { EditorProps } from '../../types/editor-props';
|
|
5
|
-
import { PerformanceTracking } from '../../types/performance-tracking';
|
|
2
|
+
import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
|
+
import type { ExperienceStore } from '@atlaskit/editor-common/ufo';
|
|
4
|
+
import type { EditorProps } from '../../types/editor-props';
|
|
5
|
+
import type { PerformanceTracking } from '../../types/performance-tracking';
|
|
6
6
|
/**
|
|
7
7
|
*
|
|
8
8
|
* Hook to be used for running analytics on mounting the editor.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
2
|
-
import { ExperienceStore } from '@atlaskit/editor-common/ufo';
|
|
3
|
-
import { EditorProps } from '../../types/editor-props';
|
|
4
|
-
import { PerformanceTracking } from '../../types/performance-tracking';
|
|
5
|
-
export default function editorMeasureTTICallback(tti: number, ttiFromInvocation: number, canceled: boolean, performanceTracking: PerformanceTracking | undefined, featureFlags: EditorProps['featureFlags'], createAnalyticsEvent?: CreateUIAnalyticsEvent, experienceStore?: ExperienceStore): void;
|
|
1
|
+
import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
2
|
+
import type { ExperienceStore } from '@atlaskit/editor-common/ufo';
|
|
3
|
+
import type { EditorProps } from '../../types/editor-props';
|
|
4
|
+
import type { PerformanceTracking } from '../../types/performance-tracking';
|
|
5
|
+
export default function editorMeasureTTICallback(tti: number, ttiFromInvocation: number, canceled: boolean, distortedDuration: boolean, performanceTracking: PerformanceTracking | undefined, featureFlags: EditorProps['featureFlags'], createAnalyticsEvent?: CreateUIAnalyticsEvent, experienceStore?: ExperienceStore): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { ElementBrowser } from '@atlaskit/editor-common/element-browser';
|
|
@@ -169,7 +169,7 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
169
169
|
pluginConfiguration: QuickInsertPluginOptions | undefined;
|
|
170
170
|
sharedState: import("@atlaskit/editor-common/types").QuickInsertSharedState | null;
|
|
171
171
|
actions: {
|
|
172
|
-
insertItem: (item: import("@atlaskit/editor-common/provider-factory").QuickInsertItem) => import("
|
|
172
|
+
insertItem: (item: import("@atlaskit/editor-common/provider-factory").QuickInsertItem) => import("@atlaskit/editor-common/types").Command;
|
|
173
173
|
getSuggestions: (searchOptions: import("@atlaskit/editor-common/types").QuickInsertSearchOptions) => import("@atlaskit/editor-common/provider-factory").QuickInsertItem[];
|
|
174
174
|
};
|
|
175
175
|
commands: {
|
|
@@ -378,7 +378,7 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
378
378
|
pluginConfiguration: QuickInsertPluginOptions | undefined;
|
|
379
379
|
sharedState: import("@atlaskit/editor-common/types").QuickInsertSharedState | null;
|
|
380
380
|
actions: {
|
|
381
|
-
insertItem: (item: import("@atlaskit/editor-common/provider-factory").QuickInsertItem) => import("
|
|
381
|
+
insertItem: (item: import("@atlaskit/editor-common/provider-factory").QuickInsertItem) => import("@atlaskit/editor-common/types").Command;
|
|
382
382
|
getSuggestions: (searchOptions: import("@atlaskit/editor-common/types").QuickInsertSearchOptions) => import("@atlaskit/editor-common/provider-factory").QuickInsertItem[];
|
|
383
383
|
};
|
|
384
384
|
commands: {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { MediaProvider } from '@atlaskit/editor-common/provider-factory';
|
|
2
2
|
import type { MediaState } from './pm-plugins/main';
|
|
3
3
|
import type { CustomMediaPicker } from './types';
|
|
4
|
-
import type { MediaNextEditorPluginType } from './next-plugin-type';
|
|
5
4
|
export type { MediaState, MediaProvider, CustomMediaPicker };
|
|
6
5
|
export { insertMediaSingleNode } from './utils/media-single';
|
|
6
|
+
import type { MediaNextEditorPluginType } from './next-plugin-type';
|
|
7
7
|
declare const mediaPlugin: MediaNextEditorPluginType;
|
|
8
8
|
export default mediaPlugin;
|