@atlaskit/editor-plugin-insert-block 7.0.27 → 7.0.29
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 +16 -0
- package/dist/cjs/ui/ToolbarInsertBlock/dropdown-button.js +2 -2
- package/dist/cjs/ui/ToolbarInsertBlock/index.js +3 -2
- package/dist/cjs/ui/ToolbarInsertBlock/item.js +29 -29
- package/dist/cjs/ui/toolbar-components/InsertButton.js +8 -3
- package/dist/cjs/ui/toolbar-components/hooks/filterDropdownItems.js +51 -0
- package/dist/cjs/ui/toolbar-components/hooks/useInsertButtonState.js +12 -2
- package/dist/cjs/ui/toolbar-components.js +167 -21
- package/dist/es2019/ui/ToolbarInsertBlock/dropdown-button.js +1 -1
- package/dist/es2019/ui/ToolbarInsertBlock/index.js +3 -2
- package/dist/es2019/ui/ToolbarInsertBlock/item.js +14 -14
- package/dist/es2019/ui/toolbar-components/InsertButton.js +8 -3
- package/dist/es2019/ui/toolbar-components/hooks/filterDropdownItems.js +44 -0
- package/dist/es2019/ui/toolbar-components/hooks/useInsertButtonState.js +12 -2
- package/dist/es2019/ui/toolbar-components.js +160 -21
- package/dist/esm/ui/ToolbarInsertBlock/dropdown-button.js +1 -1
- package/dist/esm/ui/ToolbarInsertBlock/index.js +3 -2
- package/dist/esm/ui/ToolbarInsertBlock/item.js +14 -14
- package/dist/esm/ui/toolbar-components/InsertButton.js +8 -3
- package/dist/esm/ui/toolbar-components/hooks/filterDropdownItems.js +44 -0
- package/dist/esm/ui/toolbar-components/hooks/useInsertButtonState.js +12 -2
- package/dist/esm/ui/toolbar-components.js +167 -21
- package/dist/types/ui/toolbar-components/InsertButton.d.ts +5 -1
- package/dist/types/ui/toolbar-components/TableSizePicker.d.ts +1 -1
- package/dist/types/ui/toolbar-components/hooks/filterDropdownItems.d.ts +5 -0
- package/dist/types/ui/toolbar-components/hooks/useInsertButtonState.d.ts +6 -2
- package/dist/types-ts4.5/ui/toolbar-components/InsertButton.d.ts +5 -1
- package/dist/types-ts4.5/ui/toolbar-components/TableSizePicker.d.ts +1 -1
- package/dist/types-ts4.5/ui/toolbar-components/hooks/filterDropdownItems.d.ts +5 -0
- package/dist/types-ts4.5/ui/toolbar-components/hooks/useInsertButtonState.d.ts +6 -2
- package/package.json +12 -9
|
@@ -256,26 +256,12 @@ export var getToolbarComponents = function getToolbarComponents(_ref) {
|
|
|
256
256
|
|
|
257
257
|
// Insert Group
|
|
258
258
|
if ((_config$insert = config.insert) !== null && _config$insert !== void 0 && _config$insert.enabled) {
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
key: INSERT_GROUP.key,
|
|
262
|
-
parents: [{
|
|
263
|
-
type: INSERT_BLOCK_SECTION.type,
|
|
264
|
-
key: INSERT_BLOCK_SECTION.key,
|
|
265
|
-
rank: INSERT_BLOCK_SECTION_RANK[INSERT_GROUP.key]
|
|
266
|
-
}]
|
|
267
|
-
});
|
|
268
|
-
components.push({
|
|
269
|
-
type: INSERT_BUTTON.type,
|
|
270
|
-
key: INSERT_BUTTON.key,
|
|
271
|
-
parents: [{
|
|
272
|
-
type: INSERT_GROUP.type,
|
|
273
|
-
key: INSERT_GROUP.key,
|
|
274
|
-
rank: INSERT_GROUP_RANK[INSERT_BUTTON.key]
|
|
275
|
-
}],
|
|
276
|
-
component: function component() {
|
|
259
|
+
var createInsertButtonComponent = function createInsertButtonComponent(breakpoint) {
|
|
260
|
+
return function () {
|
|
277
261
|
return /*#__PURE__*/React.createElement(InsertButton, {
|
|
278
262
|
api: api,
|
|
263
|
+
breakpoint: breakpoint,
|
|
264
|
+
toolbarConfig: config,
|
|
279
265
|
showElementBrowserLink: options.showElementBrowserLink,
|
|
280
266
|
tableSelectorSupported: options.tableSelectorSupported,
|
|
281
267
|
onInsertBlockType: onInsertBlockType,
|
|
@@ -283,10 +269,170 @@ export var getToolbarComponents = function getToolbarComponents(_ref) {
|
|
|
283
269
|
horizontalRuleEnabled: options.horizontalRuleEnabled,
|
|
284
270
|
expandEnabled: options.allowExpand,
|
|
285
271
|
insertMenuItems: options.insertMenuItems,
|
|
286
|
-
numberOfButtons:
|
|
272
|
+
numberOfButtons: 0
|
|
287
273
|
});
|
|
288
|
-
}
|
|
289
|
-
}
|
|
274
|
+
};
|
|
275
|
+
};
|
|
276
|
+
if (fg('platform_editor_toolbar_aifc_ga_blockers')) {
|
|
277
|
+
components.push({
|
|
278
|
+
type: INSERT_GROUP.type,
|
|
279
|
+
key: "".concat(INSERT_GROUP.key, "-none"),
|
|
280
|
+
parents: [{
|
|
281
|
+
type: INSERT_BLOCK_SECTION.type,
|
|
282
|
+
key: INSERT_BLOCK_SECTION.key,
|
|
283
|
+
rank: INSERT_BLOCK_SECTION_RANK[INSERT_GROUP.key]
|
|
284
|
+
}],
|
|
285
|
+
component: function component(_ref3) {
|
|
286
|
+
var children = _ref3.children;
|
|
287
|
+
return /*#__PURE__*/React.createElement(Show, {
|
|
288
|
+
below: "sm"
|
|
289
|
+
}, /*#__PURE__*/React.createElement(ToolbarButtonGroup, null, children));
|
|
290
|
+
}
|
|
291
|
+
});
|
|
292
|
+
components.push({
|
|
293
|
+
type: INSERT_BUTTON.type,
|
|
294
|
+
key: INSERT_BUTTON.key,
|
|
295
|
+
parents: [{
|
|
296
|
+
type: INSERT_GROUP.type,
|
|
297
|
+
key: "".concat(INSERT_GROUP.key, "-none"),
|
|
298
|
+
rank: INSERT_GROUP_RANK[INSERT_BUTTON.key]
|
|
299
|
+
}],
|
|
300
|
+
component: createInsertButtonComponent(null)
|
|
301
|
+
});
|
|
302
|
+
components.push({
|
|
303
|
+
type: INSERT_GROUP.type,
|
|
304
|
+
key: "".concat(INSERT_GROUP.key, "-sm"),
|
|
305
|
+
parents: [{
|
|
306
|
+
type: INSERT_BLOCK_SECTION.type,
|
|
307
|
+
key: INSERT_BLOCK_SECTION.key,
|
|
308
|
+
rank: INSERT_BLOCK_SECTION_RANK[INSERT_GROUP.key]
|
|
309
|
+
}],
|
|
310
|
+
component: function component(_ref4) {
|
|
311
|
+
var children = _ref4.children;
|
|
312
|
+
return /*#__PURE__*/React.createElement(Show, {
|
|
313
|
+
only: "sm"
|
|
314
|
+
}, /*#__PURE__*/React.createElement(ToolbarButtonGroup, null, children));
|
|
315
|
+
}
|
|
316
|
+
});
|
|
317
|
+
components.push({
|
|
318
|
+
type: INSERT_BUTTON.type,
|
|
319
|
+
key: INSERT_BUTTON.key,
|
|
320
|
+
parents: [{
|
|
321
|
+
type: INSERT_GROUP.type,
|
|
322
|
+
key: "".concat(INSERT_GROUP.key, "-sm"),
|
|
323
|
+
rank: INSERT_GROUP_RANK[INSERT_BUTTON.key]
|
|
324
|
+
}],
|
|
325
|
+
component: createInsertButtonComponent('sm')
|
|
326
|
+
});
|
|
327
|
+
components.push({
|
|
328
|
+
type: INSERT_GROUP.type,
|
|
329
|
+
key: "".concat(INSERT_GROUP.key, "-md"),
|
|
330
|
+
parents: [{
|
|
331
|
+
type: INSERT_BLOCK_SECTION.type,
|
|
332
|
+
key: INSERT_BLOCK_SECTION.key,
|
|
333
|
+
rank: INSERT_BLOCK_SECTION_RANK[INSERT_GROUP.key]
|
|
334
|
+
}],
|
|
335
|
+
component: function component(_ref5) {
|
|
336
|
+
var children = _ref5.children;
|
|
337
|
+
return /*#__PURE__*/React.createElement(Show, {
|
|
338
|
+
only: "md"
|
|
339
|
+
}, /*#__PURE__*/React.createElement(ToolbarButtonGroup, null, children));
|
|
340
|
+
}
|
|
341
|
+
});
|
|
342
|
+
components.push({
|
|
343
|
+
type: INSERT_BUTTON.type,
|
|
344
|
+
key: INSERT_BUTTON.key,
|
|
345
|
+
parents: [{
|
|
346
|
+
type: INSERT_GROUP.type,
|
|
347
|
+
key: "".concat(INSERT_GROUP.key, "-md"),
|
|
348
|
+
rank: INSERT_GROUP_RANK[INSERT_BUTTON.key]
|
|
349
|
+
}],
|
|
350
|
+
component: createInsertButtonComponent('md')
|
|
351
|
+
});
|
|
352
|
+
components.push({
|
|
353
|
+
type: INSERT_GROUP.type,
|
|
354
|
+
key: "".concat(INSERT_GROUP.key, "-lg"),
|
|
355
|
+
parents: [{
|
|
356
|
+
type: INSERT_BLOCK_SECTION.type,
|
|
357
|
+
key: INSERT_BLOCK_SECTION.key,
|
|
358
|
+
rank: INSERT_BLOCK_SECTION_RANK[INSERT_GROUP.key]
|
|
359
|
+
}],
|
|
360
|
+
component: function component(_ref6) {
|
|
361
|
+
var children = _ref6.children;
|
|
362
|
+
return /*#__PURE__*/React.createElement(Show, {
|
|
363
|
+
only: "lg"
|
|
364
|
+
}, /*#__PURE__*/React.createElement(ToolbarButtonGroup, null, children));
|
|
365
|
+
}
|
|
366
|
+
});
|
|
367
|
+
components.push({
|
|
368
|
+
type: INSERT_BUTTON.type,
|
|
369
|
+
key: INSERT_BUTTON.key,
|
|
370
|
+
parents: [{
|
|
371
|
+
type: INSERT_GROUP.type,
|
|
372
|
+
key: "".concat(INSERT_GROUP.key, "-lg"),
|
|
373
|
+
rank: INSERT_GROUP_RANK[INSERT_BUTTON.key]
|
|
374
|
+
}],
|
|
375
|
+
component: createInsertButtonComponent('lg')
|
|
376
|
+
});
|
|
377
|
+
components.push({
|
|
378
|
+
type: INSERT_GROUP.type,
|
|
379
|
+
key: "".concat(INSERT_GROUP.key, "-xl"),
|
|
380
|
+
parents: [{
|
|
381
|
+
type: INSERT_BLOCK_SECTION.type,
|
|
382
|
+
key: INSERT_BLOCK_SECTION.key,
|
|
383
|
+
rank: INSERT_BLOCK_SECTION_RANK[INSERT_GROUP.key]
|
|
384
|
+
}],
|
|
385
|
+
component: function component(_ref7) {
|
|
386
|
+
var children = _ref7.children;
|
|
387
|
+
return /*#__PURE__*/React.createElement(Show, {
|
|
388
|
+
only: "xl"
|
|
389
|
+
}, /*#__PURE__*/React.createElement(ToolbarButtonGroup, null, children));
|
|
390
|
+
}
|
|
391
|
+
});
|
|
392
|
+
components.push({
|
|
393
|
+
type: INSERT_BUTTON.type,
|
|
394
|
+
key: INSERT_BUTTON.key,
|
|
395
|
+
parents: [{
|
|
396
|
+
type: INSERT_GROUP.type,
|
|
397
|
+
key: "".concat(INSERT_GROUP.key, "-xl"),
|
|
398
|
+
rank: INSERT_GROUP_RANK[INSERT_BUTTON.key]
|
|
399
|
+
}],
|
|
400
|
+
component: createInsertButtonComponent('xl')
|
|
401
|
+
});
|
|
402
|
+
} else {
|
|
403
|
+
components.push({
|
|
404
|
+
type: INSERT_GROUP.type,
|
|
405
|
+
key: INSERT_GROUP.key,
|
|
406
|
+
parents: [{
|
|
407
|
+
type: INSERT_BLOCK_SECTION.type,
|
|
408
|
+
key: INSERT_BLOCK_SECTION.key,
|
|
409
|
+
rank: INSERT_BLOCK_SECTION_RANK[INSERT_GROUP.key]
|
|
410
|
+
}]
|
|
411
|
+
});
|
|
412
|
+
components.push({
|
|
413
|
+
type: INSERT_BUTTON.type,
|
|
414
|
+
key: INSERT_BUTTON.key,
|
|
415
|
+
parents: [{
|
|
416
|
+
type: INSERT_GROUP.type,
|
|
417
|
+
key: INSERT_GROUP.key,
|
|
418
|
+
rank: INSERT_GROUP_RANK[INSERT_BUTTON.key]
|
|
419
|
+
}],
|
|
420
|
+
component: function component() {
|
|
421
|
+
return /*#__PURE__*/React.createElement(InsertButton, {
|
|
422
|
+
api: api,
|
|
423
|
+
toolbarConfig: config,
|
|
424
|
+
showElementBrowserLink: options.showElementBrowserLink,
|
|
425
|
+
tableSelectorSupported: options.tableSelectorSupported,
|
|
426
|
+
onInsertBlockType: onInsertBlockType,
|
|
427
|
+
nativeStatusSupported: options.nativeStatusSupported,
|
|
428
|
+
horizontalRuleEnabled: options.horizontalRuleEnabled,
|
|
429
|
+
expandEnabled: options.allowExpand,
|
|
430
|
+
insertMenuItems: options.insertMenuItems,
|
|
431
|
+
numberOfButtons: 7 // TODO: ED-28759 - Default to 7 buttons - Remove this once we have a proper way to do toolbar responsiveness
|
|
432
|
+
});
|
|
433
|
+
}
|
|
434
|
+
});
|
|
435
|
+
}
|
|
290
436
|
}
|
|
291
437
|
return components;
|
|
292
438
|
};
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ExtractInjectionAPI, Command } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { MenuItem } from '@atlaskit/editor-common/ui-menu';
|
|
4
|
+
import type { Breakpoint } from '@atlaskit/editor-toolbar';
|
|
4
5
|
import type { InsertBlockPlugin } from '../../insertBlockPluginType';
|
|
6
|
+
import type { ToolbarInsertBlockButtonsConfig } from '../../types';
|
|
5
7
|
type InsertButtonProps = {
|
|
6
8
|
api?: ExtractInjectionAPI<InsertBlockPlugin>;
|
|
9
|
+
breakpoint?: Breakpoint | null;
|
|
7
10
|
expandEnabled?: boolean;
|
|
8
11
|
horizontalRuleEnabled?: boolean;
|
|
9
12
|
insertMenuItems?: MenuItem[];
|
|
@@ -13,6 +16,7 @@ type InsertButtonProps = {
|
|
|
13
16
|
onInsertBlockType?: (name: string) => Command;
|
|
14
17
|
showElementBrowserLink?: boolean;
|
|
15
18
|
tableSelectorSupported?: boolean;
|
|
19
|
+
toolbarConfig?: ToolbarInsertBlockButtonsConfig;
|
|
16
20
|
};
|
|
17
|
-
export declare const InsertButton: ({ api, showElementBrowserLink, isFullPageAppearance, tableSelectorSupported, nativeStatusSupported, horizontalRuleEnabled, expandEnabled, insertMenuItems, numberOfButtons, onInsertBlockType, }: InsertButtonProps) => React.JSX.Element | null;
|
|
21
|
+
export declare const InsertButton: ({ api, breakpoint, showElementBrowserLink, isFullPageAppearance, tableSelectorSupported, nativeStatusSupported, horizontalRuleEnabled, expandEnabled, insertMenuItems, numberOfButtons, onInsertBlockType, toolbarConfig, }: InsertButtonProps) => React.JSX.Element | null;
|
|
18
22
|
export {};
|
|
@@ -3,5 +3,5 @@ import type { BaseToolbarButtonProps } from './shared/types';
|
|
|
3
3
|
interface TableSizePickerProps extends BaseToolbarButtonProps {
|
|
4
4
|
tableSelectorSupported?: boolean;
|
|
5
5
|
}
|
|
6
|
-
export declare const TableSizePicker: ({ api, tableSelectorSupported }: TableSizePickerProps) => React.JSX.Element | null;
|
|
6
|
+
export declare const TableSizePicker: ({ api, tableSelectorSupported, }: TableSizePickerProps) => React.JSX.Element | null;
|
|
7
7
|
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Breakpoint } from '@atlaskit/editor-toolbar';
|
|
2
|
+
import type { ToolbarInsertBlockButtonsConfig } from '../../../types';
|
|
3
|
+
import type { BlockMenuItem } from '../../ToolbarInsertBlock/create-items';
|
|
4
|
+
export declare const LINK_BUTTON_KEY = "link";
|
|
5
|
+
export declare function filterDropdownItemsByBreakpoint(items: BlockMenuItem[], currentBreakpoint: Breakpoint | null, toolbarConfig: ToolbarInsertBlockButtonsConfig): BlockMenuItem[];
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type { MenuItem } from '@atlaskit/editor-common/ui-menu';
|
|
3
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/
|
|
3
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
+
import type { Breakpoint } from '@atlaskit/editor-toolbar';
|
|
4
5
|
import type { EmojiProvider } from '@atlaskit/emoji';
|
|
5
6
|
import type { InsertBlockPlugin } from '../../../insertBlockPluginType';
|
|
7
|
+
import type { ToolbarInsertBlockButtonsConfig } from '../../../types';
|
|
6
8
|
import type { BlockMenuItem } from '../../ToolbarInsertBlock/create-items';
|
|
7
9
|
interface UseInsertButtonStateProps {
|
|
8
10
|
api?: ExtractInjectionAPI<InsertBlockPlugin>;
|
|
11
|
+
breakpoint?: Breakpoint | null;
|
|
9
12
|
editorView?: EditorView;
|
|
10
13
|
expandEnabled?: boolean;
|
|
11
14
|
horizontalRuleEnabled?: boolean;
|
|
@@ -14,11 +17,12 @@ interface UseInsertButtonStateProps {
|
|
|
14
17
|
numberOfButtons?: number;
|
|
15
18
|
showElementBrowserLink?: boolean;
|
|
16
19
|
tableSelectorSupported?: boolean;
|
|
20
|
+
toolbarConfig?: ToolbarInsertBlockButtonsConfig;
|
|
17
21
|
}
|
|
18
22
|
export interface InsertButtonState {
|
|
19
23
|
dropdownItems: BlockMenuItem[];
|
|
20
24
|
emojiProvider?: EmojiProvider;
|
|
21
25
|
isTypeAheadAllowed?: boolean;
|
|
22
26
|
}
|
|
23
|
-
export declare const useInsertButtonState: ({ api, editorView, horizontalRuleEnabled, insertMenuItems, nativeStatusSupported, numberOfButtons, tableSelectorSupported, expandEnabled, showElementBrowserLink, }: UseInsertButtonStateProps) => InsertButtonState;
|
|
27
|
+
export declare const useInsertButtonState: ({ api, breakpoint, editorView, horizontalRuleEnabled, insertMenuItems, nativeStatusSupported, numberOfButtons, tableSelectorSupported, expandEnabled, showElementBrowserLink, toolbarConfig, }: UseInsertButtonStateProps) => InsertButtonState;
|
|
24
28
|
export {};
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ExtractInjectionAPI, Command } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { MenuItem } from '@atlaskit/editor-common/ui-menu';
|
|
4
|
+
import type { Breakpoint } from '@atlaskit/editor-toolbar';
|
|
4
5
|
import type { InsertBlockPlugin } from '../../insertBlockPluginType';
|
|
6
|
+
import type { ToolbarInsertBlockButtonsConfig } from '../../types';
|
|
5
7
|
type InsertButtonProps = {
|
|
6
8
|
api?: ExtractInjectionAPI<InsertBlockPlugin>;
|
|
9
|
+
breakpoint?: Breakpoint | null;
|
|
7
10
|
expandEnabled?: boolean;
|
|
8
11
|
horizontalRuleEnabled?: boolean;
|
|
9
12
|
insertMenuItems?: MenuItem[];
|
|
@@ -13,6 +16,7 @@ type InsertButtonProps = {
|
|
|
13
16
|
onInsertBlockType?: (name: string) => Command;
|
|
14
17
|
showElementBrowserLink?: boolean;
|
|
15
18
|
tableSelectorSupported?: boolean;
|
|
19
|
+
toolbarConfig?: ToolbarInsertBlockButtonsConfig;
|
|
16
20
|
};
|
|
17
|
-
export declare const InsertButton: ({ api, showElementBrowserLink, isFullPageAppearance, tableSelectorSupported, nativeStatusSupported, horizontalRuleEnabled, expandEnabled, insertMenuItems, numberOfButtons, onInsertBlockType, }: InsertButtonProps) => React.JSX.Element | null;
|
|
21
|
+
export declare const InsertButton: ({ api, breakpoint, showElementBrowserLink, isFullPageAppearance, tableSelectorSupported, nativeStatusSupported, horizontalRuleEnabled, expandEnabled, insertMenuItems, numberOfButtons, onInsertBlockType, toolbarConfig, }: InsertButtonProps) => React.JSX.Element | null;
|
|
18
22
|
export {};
|
|
@@ -3,5 +3,5 @@ import type { BaseToolbarButtonProps } from './shared/types';
|
|
|
3
3
|
interface TableSizePickerProps extends BaseToolbarButtonProps {
|
|
4
4
|
tableSelectorSupported?: boolean;
|
|
5
5
|
}
|
|
6
|
-
export declare const TableSizePicker: ({ api, tableSelectorSupported }: TableSizePickerProps) => React.JSX.Element | null;
|
|
6
|
+
export declare const TableSizePicker: ({ api, tableSelectorSupported, }: TableSizePickerProps) => React.JSX.Element | null;
|
|
7
7
|
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Breakpoint } from '@atlaskit/editor-toolbar';
|
|
2
|
+
import type { ToolbarInsertBlockButtonsConfig } from '../../../types';
|
|
3
|
+
import type { BlockMenuItem } from '../../ToolbarInsertBlock/create-items';
|
|
4
|
+
export declare const LINK_BUTTON_KEY = "link";
|
|
5
|
+
export declare function filterDropdownItemsByBreakpoint(items: BlockMenuItem[], currentBreakpoint: Breakpoint | null, toolbarConfig: ToolbarInsertBlockButtonsConfig): BlockMenuItem[];
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type { MenuItem } from '@atlaskit/editor-common/ui-menu';
|
|
3
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/
|
|
3
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
+
import type { Breakpoint } from '@atlaskit/editor-toolbar';
|
|
4
5
|
import type { EmojiProvider } from '@atlaskit/emoji';
|
|
5
6
|
import type { InsertBlockPlugin } from '../../../insertBlockPluginType';
|
|
7
|
+
import type { ToolbarInsertBlockButtonsConfig } from '../../../types';
|
|
6
8
|
import type { BlockMenuItem } from '../../ToolbarInsertBlock/create-items';
|
|
7
9
|
interface UseInsertButtonStateProps {
|
|
8
10
|
api?: ExtractInjectionAPI<InsertBlockPlugin>;
|
|
11
|
+
breakpoint?: Breakpoint | null;
|
|
9
12
|
editorView?: EditorView;
|
|
10
13
|
expandEnabled?: boolean;
|
|
11
14
|
horizontalRuleEnabled?: boolean;
|
|
@@ -14,11 +17,12 @@ interface UseInsertButtonStateProps {
|
|
|
14
17
|
numberOfButtons?: number;
|
|
15
18
|
showElementBrowserLink?: boolean;
|
|
16
19
|
tableSelectorSupported?: boolean;
|
|
20
|
+
toolbarConfig?: ToolbarInsertBlockButtonsConfig;
|
|
17
21
|
}
|
|
18
22
|
export interface InsertButtonState {
|
|
19
23
|
dropdownItems: BlockMenuItem[];
|
|
20
24
|
emojiProvider?: EmojiProvider;
|
|
21
25
|
isTypeAheadAllowed?: boolean;
|
|
22
26
|
}
|
|
23
|
-
export declare const useInsertButtonState: ({ api, editorView, horizontalRuleEnabled, insertMenuItems, nativeStatusSupported, numberOfButtons, tableSelectorSupported, expandEnabled, showElementBrowserLink, }: UseInsertButtonStateProps) => InsertButtonState;
|
|
27
|
+
export declare const useInsertButtonState: ({ api, breakpoint, editorView, horizontalRuleEnabled, insertMenuItems, nativeStatusSupported, numberOfButtons, tableSelectorSupported, expandEnabled, showElementBrowserLink, toolbarConfig, }: UseInsertButtonStateProps) => InsertButtonState;
|
|
24
28
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-insert-block",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.29",
|
|
4
4
|
"description": "Insert block plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"@atlaskit/editor-plugin-hyperlink": "^8.1.0",
|
|
42
42
|
"@atlaskit/editor-plugin-image-upload": "^6.0.0",
|
|
43
43
|
"@atlaskit/editor-plugin-layout": "^6.2.0",
|
|
44
|
-
"@atlaskit/editor-plugin-media": "^8.
|
|
44
|
+
"@atlaskit/editor-plugin-media": "^8.5.0",
|
|
45
45
|
"@atlaskit/editor-plugin-media-insert": "^14.0.0",
|
|
46
46
|
"@atlaskit/editor-plugin-mentions": "^8.2.0",
|
|
47
47
|
"@atlaskit/editor-plugin-metrics": "^7.1.0",
|
|
@@ -51,21 +51,21 @@
|
|
|
51
51
|
"@atlaskit/editor-plugin-quick-insert": "^6.1.0",
|
|
52
52
|
"@atlaskit/editor-plugin-rule": "^6.1.0",
|
|
53
53
|
"@atlaskit/editor-plugin-status": "^7.1.0",
|
|
54
|
-
"@atlaskit/editor-plugin-table": "^15.
|
|
54
|
+
"@atlaskit/editor-plugin-table": "^15.5.0",
|
|
55
55
|
"@atlaskit/editor-plugin-tasks-and-decisions": "^9.1.0",
|
|
56
56
|
"@atlaskit/editor-plugin-toolbar": "^3.4.0",
|
|
57
57
|
"@atlaskit/editor-plugin-type-ahead": "^6.5.0",
|
|
58
|
-
"@atlaskit/editor-prosemirror": "7.
|
|
58
|
+
"@atlaskit/editor-prosemirror": "^7.2.0",
|
|
59
59
|
"@atlaskit/editor-shared-styles": "^3.10.0",
|
|
60
60
|
"@atlaskit/editor-toolbar": "^0.18.0",
|
|
61
61
|
"@atlaskit/editor-toolbar-model": "^0.2.0",
|
|
62
62
|
"@atlaskit/emoji": "^69.9.0",
|
|
63
|
-
"@atlaskit/icon": "^29.
|
|
63
|
+
"@atlaskit/icon": "^29.1.0",
|
|
64
64
|
"@atlaskit/icon-lab": "^5.12.0",
|
|
65
65
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
66
66
|
"@atlaskit/theme": "^21.0.0",
|
|
67
|
-
"@atlaskit/tmp-editor-statsig": "^15.
|
|
68
|
-
"@atlaskit/tokens": "^8.
|
|
67
|
+
"@atlaskit/tmp-editor-statsig": "^15.12.0",
|
|
68
|
+
"@atlaskit/tokens": "^8.5.0",
|
|
69
69
|
"@babel/runtime": "^7.0.0",
|
|
70
70
|
"@emotion/react": "^11.7.1",
|
|
71
71
|
"bind-event-listener": "^3.0.0",
|
|
@@ -74,13 +74,13 @@
|
|
|
74
74
|
"react-virtualized": "^9.22.6"
|
|
75
75
|
},
|
|
76
76
|
"peerDependencies": {
|
|
77
|
-
"@atlaskit/editor-common": "^110.
|
|
77
|
+
"@atlaskit/editor-common": "^110.44.0",
|
|
78
78
|
"react": "^18.2.0",
|
|
79
79
|
"react-dom": "^18.2.0",
|
|
80
80
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
|
-
"@testing-library/react": "^
|
|
83
|
+
"@testing-library/react": "^16.3.0",
|
|
84
84
|
"@types/react-virtualized": "^9.18.12"
|
|
85
85
|
},
|
|
86
86
|
"techstack": {
|
|
@@ -120,6 +120,9 @@
|
|
|
120
120
|
}
|
|
121
121
|
},
|
|
122
122
|
"platform-feature-flags": {
|
|
123
|
+
"platform_editor_toolbar_aifc_ga_blockers": {
|
|
124
|
+
"type": "boolean"
|
|
125
|
+
},
|
|
123
126
|
"platform_editor_toolbar_responsive_fixes": {
|
|
124
127
|
"type": "boolean"
|
|
125
128
|
},
|