@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.
Files changed (154) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/cjs/editor-next/hooks/useEditorMeasuresConstructor.js +2 -2
  3. package/dist/cjs/editor-next/utils/editorMeasureTTICallback.js +3 -2
  4. package/dist/cjs/element-browser.js +2 -3
  5. package/dist/cjs/plugins/media/index.js +59 -54
  6. package/dist/cjs/plugins/media/nodeviews/mediaInline.js +44 -29
  7. package/dist/cjs/plugins/media/ui/ToolbarMedia/index.js +20 -33
  8. package/dist/cjs/plugins/quick-insert/index.js +4 -2
  9. package/dist/cjs/{ui/ElementBrowser → plugins/quick-insert/ui/ModalElementBrowser}/ModalElementBrowser.js +8 -7
  10. package/dist/cjs/plugins/quick-insert/ui/ModalElementBrowser/index.js +10 -17
  11. package/dist/cjs/ui/ElementBrowser/InsertMenu.js +5 -6
  12. package/dist/cjs/ui/ElementBrowser/types.js +1 -8
  13. package/dist/cjs/version-wrapper.js +1 -1
  14. package/dist/es2019/editor-next/hooks/useEditorMeasuresConstructor.js +2 -2
  15. package/dist/es2019/editor-next/utils/editorMeasureTTICallback.js +3 -2
  16. package/dist/es2019/element-browser.js +1 -1
  17. package/dist/es2019/plugins/media/index.js +28 -20
  18. package/dist/es2019/plugins/media/nodeviews/mediaInline.js +45 -27
  19. package/dist/es2019/plugins/media/ui/ToolbarMedia/index.js +24 -32
  20. package/dist/es2019/plugins/quick-insert/index.js +4 -2
  21. package/dist/es2019/{ui/ElementBrowser → plugins/quick-insert/ui/ModalElementBrowser}/ModalElementBrowser.js +5 -5
  22. package/dist/es2019/plugins/quick-insert/ui/ModalElementBrowser/index.js +8 -13
  23. package/dist/es2019/ui/ElementBrowser/InsertMenu.js +2 -3
  24. package/dist/es2019/ui/ElementBrowser/types.js +1 -5
  25. package/dist/es2019/version-wrapper.js +1 -1
  26. package/dist/esm/editor-next/hooks/useEditorMeasuresConstructor.js +2 -2
  27. package/dist/esm/editor-next/utils/editorMeasureTTICallback.js +3 -2
  28. package/dist/esm/element-browser.js +1 -1
  29. package/dist/esm/plugins/media/index.js +57 -52
  30. package/dist/esm/plugins/media/nodeviews/mediaInline.js +44 -29
  31. package/dist/esm/plugins/media/ui/ToolbarMedia/index.js +20 -30
  32. package/dist/esm/plugins/quick-insert/index.js +4 -2
  33. package/dist/esm/{ui/ElementBrowser → plugins/quick-insert/ui/ModalElementBrowser}/ModalElementBrowser.js +5 -5
  34. package/dist/esm/plugins/quick-insert/ui/ModalElementBrowser/index.js +10 -17
  35. package/dist/esm/ui/ElementBrowser/InsertMenu.js +2 -3
  36. package/dist/esm/ui/ElementBrowser/types.js +1 -5
  37. package/dist/esm/version-wrapper.js +1 -1
  38. package/dist/types/editor-next/hooks/useEditorMeasuresConstructor.d.ts +4 -4
  39. package/dist/types/editor-next/utils/editorMeasureTTICallback.d.ts +5 -5
  40. package/dist/types/element-browser.d.ts +1 -1
  41. package/dist/types/labs/next/presets/default.d.ts +2 -2
  42. package/dist/types/plugins/media/index.d.ts +1 -1
  43. package/dist/types/plugins/media/nodeviews/mediaInline.d.ts +5 -4
  44. package/dist/types/plugins/media/types.d.ts +10 -1
  45. package/dist/types/plugins/media/ui/ToolbarMedia/index.d.ts +6 -10
  46. package/dist/types/plugins/quick-insert/index.d.ts +3 -3
  47. package/dist/types/{ui/ElementBrowser → plugins/quick-insert/ui/ModalElementBrowser}/ModalElementBrowser.d.ts +4 -3
  48. package/dist/types/{ui/ElementBrowser → plugins/quick-insert/ui/ModalElementBrowser}/categories.d.ts +1 -1
  49. package/dist/types/plugins/quick-insert/ui/ModalElementBrowser/index.d.ts +4 -1
  50. package/dist/types/ui/ElementBrowser/types.d.ts +6 -18
  51. package/dist/types-ts4.5/editor-next/hooks/useEditorMeasuresConstructor.d.ts +4 -4
  52. package/dist/types-ts4.5/editor-next/utils/editorMeasureTTICallback.d.ts +5 -5
  53. package/dist/types-ts4.5/element-browser.d.ts +1 -1
  54. package/dist/types-ts4.5/labs/next/presets/default.d.ts +2 -2
  55. package/dist/types-ts4.5/plugins/media/index.d.ts +1 -1
  56. package/dist/types-ts4.5/plugins/media/nodeviews/mediaInline.d.ts +5 -4
  57. package/dist/types-ts4.5/plugins/media/types.d.ts +10 -1
  58. package/dist/types-ts4.5/plugins/media/ui/ToolbarMedia/index.d.ts +6 -10
  59. package/dist/types-ts4.5/plugins/quick-insert/index.d.ts +3 -3
  60. package/dist/types-ts4.5/{ui/ElementBrowser → plugins/quick-insert/ui/ModalElementBrowser}/ModalElementBrowser.d.ts +4 -3
  61. package/dist/types-ts4.5/{ui/ElementBrowser → plugins/quick-insert/ui/ModalElementBrowser}/categories.d.ts +1 -1
  62. package/dist/types-ts4.5/plugins/quick-insert/ui/ModalElementBrowser/index.d.ts +4 -1
  63. package/dist/types-ts4.5/ui/ElementBrowser/types.d.ts +6 -18
  64. package/package.json +2 -2
  65. package/report.api.md +7 -1
  66. package/tmp/api-report-tmp.d.ts +7 -1
  67. package/dist/cjs/ui/ElementBrowser/ElementBrowser.js +0 -152
  68. package/dist/cjs/ui/ElementBrowser/ViewMore.js +0 -39
  69. package/dist/cjs/ui/ElementBrowser/components/CategoryList.js +0 -115
  70. package/dist/cjs/ui/ElementBrowser/components/ElementBrowserLoader.js +0 -36
  71. package/dist/cjs/ui/ElementBrowser/components/ElementList/ElementList.js +0 -250
  72. package/dist/cjs/ui/ElementBrowser/components/ElementList/EmptyState.js +0 -47
  73. package/dist/cjs/ui/ElementBrowser/components/ElementList/NotFoundIllustration.js +0 -69
  74. package/dist/cjs/ui/ElementBrowser/components/ElementList/cellSizeAndPositionGetter.js +0 -42
  75. package/dist/cjs/ui/ElementBrowser/components/ElementList/utils.js +0 -54
  76. package/dist/cjs/ui/ElementBrowser/components/ElementSearch.js +0 -88
  77. package/dist/cjs/ui/ElementBrowser/components/StatelessElementBrowser.js +0 -269
  78. package/dist/cjs/ui/ElementBrowser/constants.js +0 -43
  79. package/dist/cjs/ui/ElementBrowser/hooks/use-container-width.js +0 -70
  80. package/dist/cjs/ui/ElementBrowser/hooks/use-focus.js +0 -51
  81. package/dist/cjs/ui/ElementBrowser/hooks/use-select-and-focus-on-arrow-navigation.js +0 -286
  82. package/dist/cjs/ui/ElementBrowser/index.js +0 -10
  83. package/dist/es2019/ui/ElementBrowser/ElementBrowser.js +0 -117
  84. package/dist/es2019/ui/ElementBrowser/ViewMore.js +0 -40
  85. package/dist/es2019/ui/ElementBrowser/components/CategoryList.js +0 -104
  86. package/dist/es2019/ui/ElementBrowser/components/ElementBrowserLoader.js +0 -21
  87. package/dist/es2019/ui/ElementBrowser/components/ElementList/ElementList.js +0 -301
  88. package/dist/es2019/ui/ElementBrowser/components/ElementList/EmptyState.js +0 -58
  89. package/dist/es2019/ui/ElementBrowser/components/ElementList/NotFoundIllustration.js +0 -64
  90. package/dist/es2019/ui/ElementBrowser/components/ElementList/cellSizeAndPositionGetter.js +0 -39
  91. package/dist/es2019/ui/ElementBrowser/components/ElementList/utils.js +0 -50
  92. package/dist/es2019/ui/ElementBrowser/components/ElementSearch.js +0 -117
  93. package/dist/es2019/ui/ElementBrowser/components/StatelessElementBrowser.js +0 -339
  94. package/dist/es2019/ui/ElementBrowser/constants.js +0 -24
  95. package/dist/es2019/ui/ElementBrowser/hooks/use-container-width.js +0 -59
  96. package/dist/es2019/ui/ElementBrowser/hooks/use-focus.js +0 -48
  97. package/dist/es2019/ui/ElementBrowser/hooks/use-select-and-focus-on-arrow-navigation.js +0 -284
  98. package/dist/es2019/ui/ElementBrowser/index.js +0 -2
  99. package/dist/esm/ui/ElementBrowser/ElementBrowser.js +0 -142
  100. package/dist/esm/ui/ElementBrowser/ViewMore.js +0 -31
  101. package/dist/esm/ui/ElementBrowser/components/CategoryList.js +0 -104
  102. package/dist/esm/ui/ElementBrowser/components/ElementBrowserLoader.js +0 -23
  103. package/dist/esm/ui/ElementBrowser/components/ElementList/ElementList.js +0 -238
  104. package/dist/esm/ui/ElementBrowser/components/ElementList/EmptyState.js +0 -40
  105. package/dist/esm/ui/ElementBrowser/components/ElementList/NotFoundIllustration.js +0 -62
  106. package/dist/esm/ui/ElementBrowser/components/ElementList/cellSizeAndPositionGetter.js +0 -37
  107. package/dist/esm/ui/ElementBrowser/components/ElementList/utils.js +0 -46
  108. package/dist/esm/ui/ElementBrowser/components/ElementSearch.js +0 -77
  109. package/dist/esm/ui/ElementBrowser/components/StatelessElementBrowser.js +0 -258
  110. package/dist/esm/ui/ElementBrowser/constants.js +0 -24
  111. package/dist/esm/ui/ElementBrowser/hooks/use-container-width.js +0 -61
  112. package/dist/esm/ui/ElementBrowser/hooks/use-focus.js +0 -46
  113. package/dist/esm/ui/ElementBrowser/hooks/use-select-and-focus-on-arrow-navigation.js +0 -278
  114. package/dist/esm/ui/ElementBrowser/index.js +0 -2
  115. package/dist/types/ui/ElementBrowser/ElementBrowser.d.ts +0 -37
  116. package/dist/types/ui/ElementBrowser/ViewMore.d.ts +0 -6
  117. package/dist/types/ui/ElementBrowser/components/CategoryList.d.ts +0 -10
  118. package/dist/types/ui/ElementBrowser/components/ElementBrowserLoader.d.ts +0 -5
  119. package/dist/types/ui/ElementBrowser/components/ElementList/ElementList.d.ts +0 -29
  120. package/dist/types/ui/ElementBrowser/components/ElementList/EmptyState.d.ts +0 -6
  121. package/dist/types/ui/ElementBrowser/components/ElementList/NotFoundIllustration.d.ts +0 -2
  122. package/dist/types/ui/ElementBrowser/components/ElementList/cellSizeAndPositionGetter.d.ts +0 -7
  123. package/dist/types/ui/ElementBrowser/components/ElementList/utils.d.ts +0 -12
  124. package/dist/types/ui/ElementBrowser/components/ElementSearch.d.ts +0 -18
  125. package/dist/types/ui/ElementBrowser/components/StatelessElementBrowser.d.ts +0 -23
  126. package/dist/types/ui/ElementBrowser/constants.d.ts +0 -20
  127. package/dist/types/ui/ElementBrowser/hooks/use-container-width.d.ts +0 -33
  128. package/dist/types/ui/ElementBrowser/hooks/use-focus.d.ts +0 -35
  129. package/dist/types/ui/ElementBrowser/hooks/use-select-and-focus-on-arrow-navigation.d.ts +0 -72
  130. package/dist/types/ui/ElementBrowser/index.d.ts +0 -2
  131. package/dist/types-ts4.5/ui/ElementBrowser/ElementBrowser.d.ts +0 -37
  132. package/dist/types-ts4.5/ui/ElementBrowser/ViewMore.d.ts +0 -6
  133. package/dist/types-ts4.5/ui/ElementBrowser/components/CategoryList.d.ts +0 -10
  134. package/dist/types-ts4.5/ui/ElementBrowser/components/ElementBrowserLoader.d.ts +0 -5
  135. package/dist/types-ts4.5/ui/ElementBrowser/components/ElementList/ElementList.d.ts +0 -29
  136. package/dist/types-ts4.5/ui/ElementBrowser/components/ElementList/EmptyState.d.ts +0 -6
  137. package/dist/types-ts4.5/ui/ElementBrowser/components/ElementList/NotFoundIllustration.d.ts +0 -2
  138. package/dist/types-ts4.5/ui/ElementBrowser/components/ElementList/cellSizeAndPositionGetter.d.ts +0 -7
  139. package/dist/types-ts4.5/ui/ElementBrowser/components/ElementList/utils.d.ts +0 -12
  140. package/dist/types-ts4.5/ui/ElementBrowser/components/ElementSearch.d.ts +0 -18
  141. package/dist/types-ts4.5/ui/ElementBrowser/components/StatelessElementBrowser.d.ts +0 -23
  142. package/dist/types-ts4.5/ui/ElementBrowser/constants.d.ts +0 -20
  143. package/dist/types-ts4.5/ui/ElementBrowser/hooks/use-container-width.d.ts +0 -33
  144. package/dist/types-ts4.5/ui/ElementBrowser/hooks/use-focus.d.ts +0 -35
  145. package/dist/types-ts4.5/ui/ElementBrowser/hooks/use-select-and-focus-on-arrow-navigation.d.ts +0 -72
  146. package/dist/types-ts4.5/ui/ElementBrowser/index.d.ts +0 -2
  147. /package/dist/cjs/{ui/ElementBrowser → plugins/quick-insert/ui/ModalElementBrowser}/categories.js +0 -0
  148. /package/dist/cjs/{ui/ElementBrowser → plugins/quick-insert/ui/ModalElementBrowser}/messages.js +0 -0
  149. /package/dist/es2019/{ui/ElementBrowser → plugins/quick-insert/ui/ModalElementBrowser}/categories.js +0 -0
  150. /package/dist/es2019/{ui/ElementBrowser → plugins/quick-insert/ui/ModalElementBrowser}/messages.js +0 -0
  151. /package/dist/esm/{ui/ElementBrowser → plugins/quick-insert/ui/ModalElementBrowser}/categories.js +0 -0
  152. /package/dist/esm/{ui/ElementBrowser → plugins/quick-insert/ui/ModalElementBrowser}/messages.js +0 -0
  153. /package/dist/types/{ui/ElementBrowser → plugins/quick-insert/ui/ModalElementBrowser}/messages.d.ts +0 -0
  154. /package/dist/types-ts4.5/{ui/ElementBrowser → plugins/quick-insert/ui/ModalElementBrowser}/messages.d.ts +0 -0
@@ -1,37 +0,0 @@
1
- import { PureComponent } from 'react';
2
- import { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
3
- import { Category, Modes } from './types';
4
- import { EmptyStateHandler } from '../../types/empty-state-handler';
5
- export interface Props {
6
- categories?: Category[];
7
- mode: keyof typeof Modes;
8
- getItems: (query?: string, category?: string) => QuickInsertItem[];
9
- onSelectItem?: (item: QuickInsertItem) => void;
10
- onInsertItem: (item: QuickInsertItem) => void;
11
- showSearch: boolean;
12
- showCategories: boolean;
13
- defaultCategory?: string;
14
- emptyStateHandler?: EmptyStateHandler;
15
- viewMoreItem?: QuickInsertItem;
16
- }
17
- export interface State {
18
- items: QuickInsertItem[];
19
- categories: Category[];
20
- selectedCategory?: string;
21
- searchTerm?: string;
22
- }
23
- export default class ElementBrowser extends PureComponent<Props, State> {
24
- static defaultProps: {
25
- defaultCategory: string;
26
- onInsertItem: () => void;
27
- };
28
- state: State;
29
- componentDidMount(): void;
30
- getCategories: (items?: QuickInsertItem[]) => Category[];
31
- filterCategories: (items: QuickInsertItem[], categories?: Category[]) => Category[];
32
- fetchItems: (query?: string, category?: string) => QuickInsertItem[];
33
- componentDidUpdate(prevProps: Props, prevState: State): void;
34
- handleSearch: (searchTerm: string) => void;
35
- handleCategorySelection: (clickedCategory: Category) => void;
36
- render(): JSX.Element;
37
- }
@@ -1,6 +0,0 @@
1
- import { jsx } from '@emotion/react';
2
- import { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
3
- export declare const ViewMore: ({ item, focus, }: {
4
- item: QuickInsertItem;
5
- focus: boolean;
6
- }) => jsx.JSX.Element;
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
3
- import { Category } from '../types';
4
- interface Props {
5
- categories?: Category[];
6
- onSelectCategory: (category: Category) => void;
7
- selectedCategory?: string;
8
- }
9
- declare const MemoizedCategoryListWithAnalytics: React.MemoExoticComponent<React.ForwardRefExoticComponent<Pick<Props & WithAnalyticsEventsProps & import("@atlaskit/analytics-next").WithContextProps, "createAnalyticsEvent" | "analyticsContext" | keyof Props> & React.RefAttributes<any>>>;
10
- export default MemoizedCategoryListWithAnalytics;
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- import Loadable from 'react-loadable';
3
- import type { Props as ElementBrowserProps } from '../ElementBrowser';
4
- declare const ElementBrowserLoader: React.ComponentType<ElementBrowserProps> & Loadable.LoadableComponent;
5
- export default ElementBrowserLoader;
@@ -1,29 +0,0 @@
1
- /** @jsx jsx */
2
- import React from 'react';
3
- import { jsx } from '@emotion/react';
4
- import { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
5
- import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
6
- import { Modes, SelectedItemProps } from '../../types';
7
- import { EmptyStateHandler } from '../../../../types/empty-state-handler';
8
- export interface Props {
9
- items: QuickInsertItem[];
10
- mode: keyof typeof Modes;
11
- onInsertItem: (item: QuickInsertItem) => void;
12
- setColumnCount: (columnCount: number) => void;
13
- setFocusedItemIndex: (index: number) => void;
14
- emptyStateHandler?: EmptyStateHandler;
15
- selectedCategory?: string;
16
- searchTerm?: string;
17
- }
18
- type ElementItemType = {
19
- inlineMode: boolean;
20
- item: QuickInsertItem;
21
- onInsertItem: (item: QuickInsertItem) => void;
22
- selected: boolean;
23
- focus: boolean;
24
- setFocusedItemIndex: (index: number) => void;
25
- index: number;
26
- };
27
- export declare function ElementItem({ inlineMode, selected, item, index, onInsertItem, focus, setFocusedItemIndex, }: ElementItemType): jsx.JSX.Element;
28
- declare const MemoizedElementListWithAnalytics: React.MemoExoticComponent<React.ForwardRefExoticComponent<Pick<Props & SelectedItemProps & WithAnalyticsEventsProps & import("@atlaskit/analytics-next").WithContextProps, "createAnalyticsEvent" | "analyticsContext" | keyof Props | keyof SelectedItemProps> & React.RefAttributes<any>>>;
29
- export default MemoizedElementListWithAnalytics;
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- type Props = {
3
- onExternalLinkClick: () => void;
4
- };
5
- export default function EmptyState({ onExternalLinkClick, }: Props): JSX.Element;
6
- export {};
@@ -1,2 +0,0 @@
1
- /// <reference types="react" />
2
- export default function NotFoundIllustration(): JSX.Element;
@@ -1,7 +0,0 @@
1
- import { CollectionCellSizeAndPositionGetter } from 'react-virtualized/dist/commonjs/Collection';
2
- /**
3
- * Callback responsible for returning size and offset/position information
4
- * for a given cell.
5
- * https://github.com/bvaughn/react-virtualized/blob/master/docs/Collection.md
6
- **/
7
- export default function cellSizeAndPositionGetter(containerWidth: number, scrollbarWidth: number): CollectionCellSizeAndPositionGetter;
@@ -1,12 +0,0 @@
1
- export declare function getColumnCount(clientWidth: number): number;
2
- type DatumReturnType = {
3
- availableWidth: number;
4
- columnCount: number;
5
- };
6
- type Options = {
7
- gutterSize: number;
8
- scrollbarWidth: number;
9
- };
10
- export declare function generateVirtualizedContainerDatum(containerWidth: number, options: Options): DatumReturnType;
11
- export declare function getScrollbarWidth(): number;
12
- export {};
@@ -1,18 +0,0 @@
1
- /** @jsx jsx */
2
- import React from 'react';
3
- import type { WrappedComponentProps } from 'react-intl-next';
4
- import { Modes } from '../types';
5
- interface Props {
6
- onSearch: (value: string) => void;
7
- mode: keyof typeof Modes;
8
- focus: boolean;
9
- onClick: (e: React.MouseEvent) => void;
10
- onKeyDown: (e: React.KeyboardEvent) => void;
11
- searchTerm?: string;
12
- }
13
- declare const MemoizedElementSearchWithAnalytics: React.MemoExoticComponent<React.ForwardRefExoticComponent<Omit<Props & WrappedComponentProps<"intl">, "intl"> & {
14
- forwardedRef?: React.Ref<any> | undefined;
15
- } & {
16
- children?: React.ReactNode;
17
- } & import("@atlaskit/analytics-next").WithContextProps & React.RefAttributes<any>>>;
18
- export default MemoizedElementSearchWithAnalytics;
@@ -1,23 +0,0 @@
1
- /** @jsx jsx */
2
- import React from 'react';
3
- import type { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
4
- import type { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
5
- import type { Category, Modes } from '../types';
6
- import type { EmptyStateHandler } from '../../../types/empty-state-handler';
7
- export type StatelessElementBrowserProps = {
8
- categories?: Category[];
9
- items: QuickInsertItem[];
10
- onSearch: (searchTerm: string) => void;
11
- onSelectCategory: (category: Category) => void;
12
- onSelectItem?: (item: QuickInsertItem) => void;
13
- onInsertItem: (item: QuickInsertItem) => void;
14
- selectedCategory?: string;
15
- showSearch: boolean;
16
- showCategories: boolean;
17
- mode: keyof typeof Modes;
18
- searchTerm?: string;
19
- emptyStateHandler?: EmptyStateHandler;
20
- viewMoreItem?: QuickInsertItem;
21
- } & WithAnalyticsEventsProps;
22
- declare const MemoizedElementBrowser: React.MemoExoticComponent<React.ForwardRefExoticComponent<Pick<Omit<StatelessElementBrowserProps, keyof WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "key" | "mode" | "analyticsContext" | "items" | "emptyStateHandler" | "selectedCategory" | "searchTerm" | "onInsertItem" | "categories" | "onSelectCategory" | "onSearch" | "onSelectItem" | "viewMoreItem" | "showCategories" | "showSearch"> & React.RefAttributes<any>>>;
23
- export default MemoizedElementBrowser;
@@ -1,20 +0,0 @@
1
- export declare const GRID_SIZE: number;
2
- export declare const DEVICE_BREAKPOINT_NUMBERS: {
3
- small: number;
4
- medium: number;
5
- large: number;
6
- };
7
- export declare const FLEX_ITEMS_CONTAINER_BREAKPOINT_NUMBERS: {
8
- small: number;
9
- medium: number;
10
- large: number;
11
- };
12
- export declare const SIDEBAR_WIDTH: string;
13
- export declare const SIDEBAR_HEADING_WRAPPER_HEIGHT: string;
14
- export declare const SIDEBAR_HEADING_PADDING_LEFT = "12px";
15
- export declare const INLINE_SIDEBAR_HEIGHT = "54px";
16
- export declare const SEARCH_ITEM_HEIGHT_WIDTH = "20px";
17
- export declare const SCROLLBAR_WIDTH = 15;
18
- export declare const ELEMENT_LIST_PADDING = 2;
19
- export declare const MODAL_WRAPPER_PADDING = 16;
20
- export declare const ELEMENT_ITEM_HEIGHT = 75;
@@ -1,33 +0,0 @@
1
- /** @jsx jsx */
2
- import React from 'react';
3
- /**
4
- *
5
- * Problem:
6
- * While using WidthObserver, there's no initial width.
7
- * That may cause problems, but not limited to, something like a lag between
8
- * renders for conditionally rendered components.
9
- *
10
- * solution:
11
- * useContainerWidth() hook
12
- * it pre-measures the width of a parent container on initial mount
13
- * and gives you back the containerWidth.
14
- *
15
- *
16
- * Example hook usage:
17
- *
18
- * const { containerWidth, ContainerWidthMonitor } = useContainerWidth();
19
- *
20
- * return (
21
- * <>
22
- * <ContainerWidthMonitor />
23
- * {containerWidth < 600 ? <MobileComponent /> : <DesktopComponent />}
24
- * </>
25
- * );
26
- *
27
- */
28
- type useContainerWidthReturnType = {
29
- containerWidth: number;
30
- ContainerWidthMonitor: React.ElementType;
31
- };
32
- export default function useContainerWidth(): useContainerWidthReturnType;
33
- export {};
@@ -1,35 +0,0 @@
1
- /// <reference types="react" />
2
- /**
3
- * A custom hook that handles focus on a DOM element.
4
- * Takes in a boolean value and calls element.focus
5
- *
6
- * @param {boolean} focus
7
- *
8
- * Example usage:
9
- *******************************************************************************
10
- * const SearchBar = ({ focus }) => {
11
- * const ref = useFocus(focus);
12
- * return <input ref={ref} />
13
- * }
14
- *******************************************************************************
15
- * const ItemList = ({ items, focus }) => (
16
- * <ul>
17
- * {items.map((item, index) => (
18
- * <Item key={item.uuid} item={item} focus={focus} />
19
- * ))}
20
- * </ul>
21
- * );
22
- *
23
- * const Item = ({ item, focus }) => {
24
- * const ref = useFocus(focus);
25
- * return (
26
- * <li ref={ref}>
27
- * {item.name}
28
- * </li>
29
- * )
30
- * }
31
- *******************************************************************************
32
- */
33
- type RefType = null | HTMLInputElement | HTMLDivElement;
34
- export default function useFocus(focus: boolean): import("react").MutableRefObject<RefType>;
35
- export {};
@@ -1,72 +0,0 @@
1
- import React from 'react';
2
- /**
3
- * a custom hook that handles keyboard navigation for Arrow keys based on a
4
- * given listSize, and a step (for up and down arrows).
5
- *
6
- * @param {number} listSize
7
- * @param {number} upDownStep
8
- *
9
- * Example usage:
10
- * const list = ['Confluence','Jira','Atlaskit'];
11
- * const {
12
- * selectedItemIndex,
13
- * focusedItemIndex,
14
- * focusOnSearch,
15
- * focusOnViewMore,
16
- * setFocusedItemIndex,
17
- * onKeyDown
18
- * } = useSelectAndFocusOnArrowNavigation(list.length - 1, 1);
19
- *
20
- * return (
21
- * <div onKeyDown={onKeyDown}>
22
- * <SearchBar onClick={() => setFocusedItemIndex(undefined)} focus={focusOnSearch} />
23
- * {list.map((item, index) => (
24
- * <ListItem
25
- * title={item}
26
- * style={{ ..., color: selected ? 'selectedStateColor' : defaultColor }}
27
- * onClick={() => {
28
- * setFocusedItemIndex(index);
29
- * }
30
- * />
31
- * )}
32
- * </div>
33
- * );
34
- *
35
- * const SearchBar = ({ focus }) => {
36
- * const ref = useRefToFocusOrScroll(focus);
37
- * return <input ref={ref} />
38
- * }
39
- *
40
- */
41
- type ReducerState = {
42
- focusOnSearch: boolean;
43
- focusOnViewMore: boolean;
44
- selectedItemIndex?: number;
45
- focusedItemIndex?: number;
46
- listSize: number;
47
- canFocusViewMore?: boolean;
48
- };
49
- export declare enum ACTIONS {
50
- FOCUS_SEARCH = "focusOnSearch",
51
- UPDATE_STATE = "updateState",
52
- MOVE = "move"
53
- }
54
- export type ReducerAction = {
55
- type: ACTIONS;
56
- payload: Partial<ReducerState> & {
57
- positions?: number;
58
- step?: number;
59
- };
60
- };
61
- export type useSelectAndFocusReturnType = {
62
- selectedItemIndex?: number;
63
- onKeyDown: (e: React.KeyboardEvent<HTMLDivElement>) => void;
64
- focusOnSearch: boolean;
65
- focusOnViewMore: boolean;
66
- focusedItemIndex?: number;
67
- setFocusedItemIndex: (index?: number) => void;
68
- setFocusOnSearch: () => void;
69
- };
70
- declare function useSelectAndFocusOnArrowNavigation(listSize: number, step: number, canFocusViewMore: boolean): useSelectAndFocusReturnType;
71
- export declare const ensureSafeIndex: (index: number, listSize: number) => number;
72
- export default useSelectAndFocusOnArrowNavigation;
@@ -1,2 +0,0 @@
1
- import ElementBrowser from './components/ElementBrowserLoader';
2
- export default ElementBrowser;
@@ -1,37 +0,0 @@
1
- import { PureComponent } from 'react';
2
- import { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
3
- import { Category, Modes } from './types';
4
- import { EmptyStateHandler } from '../../types/empty-state-handler';
5
- export interface Props {
6
- categories?: Category[];
7
- mode: keyof typeof Modes;
8
- getItems: (query?: string, category?: string) => QuickInsertItem[];
9
- onSelectItem?: (item: QuickInsertItem) => void;
10
- onInsertItem: (item: QuickInsertItem) => void;
11
- showSearch: boolean;
12
- showCategories: boolean;
13
- defaultCategory?: string;
14
- emptyStateHandler?: EmptyStateHandler;
15
- viewMoreItem?: QuickInsertItem;
16
- }
17
- export interface State {
18
- items: QuickInsertItem[];
19
- categories: Category[];
20
- selectedCategory?: string;
21
- searchTerm?: string;
22
- }
23
- export default class ElementBrowser extends PureComponent<Props, State> {
24
- static defaultProps: {
25
- defaultCategory: string;
26
- onInsertItem: () => void;
27
- };
28
- state: State;
29
- componentDidMount(): void;
30
- getCategories: (items?: QuickInsertItem[]) => Category[];
31
- filterCategories: (items: QuickInsertItem[], categories?: Category[]) => Category[];
32
- fetchItems: (query?: string, category?: string) => QuickInsertItem[];
33
- componentDidUpdate(prevProps: Props, prevState: State): void;
34
- handleSearch: (searchTerm: string) => void;
35
- handleCategorySelection: (clickedCategory: Category) => void;
36
- render(): JSX.Element;
37
- }
@@ -1,6 +0,0 @@
1
- import { jsx } from '@emotion/react';
2
- import { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
3
- export declare const ViewMore: ({ item, focus, }: {
4
- item: QuickInsertItem;
5
- focus: boolean;
6
- }) => jsx.JSX.Element;
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
3
- import { Category } from '../types';
4
- interface Props {
5
- categories?: Category[];
6
- onSelectCategory: (category: Category) => void;
7
- selectedCategory?: string;
8
- }
9
- declare const MemoizedCategoryListWithAnalytics: React.MemoExoticComponent<React.ForwardRefExoticComponent<Pick<Props & WithAnalyticsEventsProps & import("@atlaskit/analytics-next").WithContextProps, "createAnalyticsEvent" | "analyticsContext" | keyof Props> & React.RefAttributes<any>>>;
10
- export default MemoizedCategoryListWithAnalytics;
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- import Loadable from 'react-loadable';
3
- import type { Props as ElementBrowserProps } from '../ElementBrowser';
4
- declare const ElementBrowserLoader: React.ComponentType<ElementBrowserProps> & Loadable.LoadableComponent;
5
- export default ElementBrowserLoader;
@@ -1,29 +0,0 @@
1
- /** @jsx jsx */
2
- import React from 'react';
3
- import { jsx } from '@emotion/react';
4
- import { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
5
- import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
6
- import { Modes, SelectedItemProps } from '../../types';
7
- import { EmptyStateHandler } from '../../../../types/empty-state-handler';
8
- export interface Props {
9
- items: QuickInsertItem[];
10
- mode: keyof typeof Modes;
11
- onInsertItem: (item: QuickInsertItem) => void;
12
- setColumnCount: (columnCount: number) => void;
13
- setFocusedItemIndex: (index: number) => void;
14
- emptyStateHandler?: EmptyStateHandler;
15
- selectedCategory?: string;
16
- searchTerm?: string;
17
- }
18
- type ElementItemType = {
19
- inlineMode: boolean;
20
- item: QuickInsertItem;
21
- onInsertItem: (item: QuickInsertItem) => void;
22
- selected: boolean;
23
- focus: boolean;
24
- setFocusedItemIndex: (index: number) => void;
25
- index: number;
26
- };
27
- export declare function ElementItem({ inlineMode, selected, item, index, onInsertItem, focus, setFocusedItemIndex, }: ElementItemType): jsx.JSX.Element;
28
- declare const MemoizedElementListWithAnalytics: React.MemoExoticComponent<React.ForwardRefExoticComponent<Pick<Props & SelectedItemProps & WithAnalyticsEventsProps & import("@atlaskit/analytics-next").WithContextProps, "createAnalyticsEvent" | "analyticsContext" | keyof Props | keyof SelectedItemProps> & React.RefAttributes<any>>>;
29
- export default MemoizedElementListWithAnalytics;
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- type Props = {
3
- onExternalLinkClick: () => void;
4
- };
5
- export default function EmptyState({ onExternalLinkClick, }: Props): JSX.Element;
6
- export {};
@@ -1,2 +0,0 @@
1
- /// <reference types="react" />
2
- export default function NotFoundIllustration(): JSX.Element;
@@ -1,7 +0,0 @@
1
- import { CollectionCellSizeAndPositionGetter } from 'react-virtualized/dist/commonjs/Collection';
2
- /**
3
- * Callback responsible for returning size and offset/position information
4
- * for a given cell.
5
- * https://github.com/bvaughn/react-virtualized/blob/master/docs/Collection.md
6
- **/
7
- export default function cellSizeAndPositionGetter(containerWidth: number, scrollbarWidth: number): CollectionCellSizeAndPositionGetter;
@@ -1,12 +0,0 @@
1
- export declare function getColumnCount(clientWidth: number): number;
2
- type DatumReturnType = {
3
- availableWidth: number;
4
- columnCount: number;
5
- };
6
- type Options = {
7
- gutterSize: number;
8
- scrollbarWidth: number;
9
- };
10
- export declare function generateVirtualizedContainerDatum(containerWidth: number, options: Options): DatumReturnType;
11
- export declare function getScrollbarWidth(): number;
12
- export {};
@@ -1,18 +0,0 @@
1
- /** @jsx jsx */
2
- import React from 'react';
3
- import type { WrappedComponentProps } from 'react-intl-next';
4
- import { Modes } from '../types';
5
- interface Props {
6
- onSearch: (value: string) => void;
7
- mode: keyof typeof Modes;
8
- focus: boolean;
9
- onClick: (e: React.MouseEvent) => void;
10
- onKeyDown: (e: React.KeyboardEvent) => void;
11
- searchTerm?: string;
12
- }
13
- declare const MemoizedElementSearchWithAnalytics: React.MemoExoticComponent<React.ForwardRefExoticComponent<Omit<Props & WrappedComponentProps<"intl">, "intl"> & {
14
- forwardedRef?: React.Ref<any> | undefined;
15
- } & {
16
- children?: React.ReactNode;
17
- } & import("@atlaskit/analytics-next").WithContextProps & React.RefAttributes<any>>>;
18
- export default MemoizedElementSearchWithAnalytics;
@@ -1,23 +0,0 @@
1
- /** @jsx jsx */
2
- import React from 'react';
3
- import type { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
4
- import type { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
5
- import type { Category, Modes } from '../types';
6
- import type { EmptyStateHandler } from '../../../types/empty-state-handler';
7
- export type StatelessElementBrowserProps = {
8
- categories?: Category[];
9
- items: QuickInsertItem[];
10
- onSearch: (searchTerm: string) => void;
11
- onSelectCategory: (category: Category) => void;
12
- onSelectItem?: (item: QuickInsertItem) => void;
13
- onInsertItem: (item: QuickInsertItem) => void;
14
- selectedCategory?: string;
15
- showSearch: boolean;
16
- showCategories: boolean;
17
- mode: keyof typeof Modes;
18
- searchTerm?: string;
19
- emptyStateHandler?: EmptyStateHandler;
20
- viewMoreItem?: QuickInsertItem;
21
- } & WithAnalyticsEventsProps;
22
- declare const MemoizedElementBrowser: React.MemoExoticComponent<React.ForwardRefExoticComponent<Pick<Omit<StatelessElementBrowserProps, keyof WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "key" | "mode" | "analyticsContext" | "items" | "emptyStateHandler" | "selectedCategory" | "searchTerm" | "onInsertItem" | "categories" | "onSelectCategory" | "onSearch" | "onSelectItem" | "viewMoreItem" | "showCategories" | "showSearch"> & React.RefAttributes<any>>>;
23
- export default MemoizedElementBrowser;
@@ -1,20 +0,0 @@
1
- export declare const GRID_SIZE: number;
2
- export declare const DEVICE_BREAKPOINT_NUMBERS: {
3
- small: number;
4
- medium: number;
5
- large: number;
6
- };
7
- export declare const FLEX_ITEMS_CONTAINER_BREAKPOINT_NUMBERS: {
8
- small: number;
9
- medium: number;
10
- large: number;
11
- };
12
- export declare const SIDEBAR_WIDTH: string;
13
- export declare const SIDEBAR_HEADING_WRAPPER_HEIGHT: string;
14
- export declare const SIDEBAR_HEADING_PADDING_LEFT = "12px";
15
- export declare const INLINE_SIDEBAR_HEIGHT = "54px";
16
- export declare const SEARCH_ITEM_HEIGHT_WIDTH = "20px";
17
- export declare const SCROLLBAR_WIDTH = 15;
18
- export declare const ELEMENT_LIST_PADDING = 2;
19
- export declare const MODAL_WRAPPER_PADDING = 16;
20
- export declare const ELEMENT_ITEM_HEIGHT = 75;
@@ -1,33 +0,0 @@
1
- /** @jsx jsx */
2
- import React from 'react';
3
- /**
4
- *
5
- * Problem:
6
- * While using WidthObserver, there's no initial width.
7
- * That may cause problems, but not limited to, something like a lag between
8
- * renders for conditionally rendered components.
9
- *
10
- * solution:
11
- * useContainerWidth() hook
12
- * it pre-measures the width of a parent container on initial mount
13
- * and gives you back the containerWidth.
14
- *
15
- *
16
- * Example hook usage:
17
- *
18
- * const { containerWidth, ContainerWidthMonitor } = useContainerWidth();
19
- *
20
- * return (
21
- * <>
22
- * <ContainerWidthMonitor />
23
- * {containerWidth < 600 ? <MobileComponent /> : <DesktopComponent />}
24
- * </>
25
- * );
26
- *
27
- */
28
- type useContainerWidthReturnType = {
29
- containerWidth: number;
30
- ContainerWidthMonitor: React.ElementType;
31
- };
32
- export default function useContainerWidth(): useContainerWidthReturnType;
33
- export {};
@@ -1,35 +0,0 @@
1
- /// <reference types="react" />
2
- /**
3
- * A custom hook that handles focus on a DOM element.
4
- * Takes in a boolean value and calls element.focus
5
- *
6
- * @param {boolean} focus
7
- *
8
- * Example usage:
9
- *******************************************************************************
10
- * const SearchBar = ({ focus }) => {
11
- * const ref = useFocus(focus);
12
- * return <input ref={ref} />
13
- * }
14
- *******************************************************************************
15
- * const ItemList = ({ items, focus }) => (
16
- * <ul>
17
- * {items.map((item, index) => (
18
- * <Item key={item.uuid} item={item} focus={focus} />
19
- * ))}
20
- * </ul>
21
- * );
22
- *
23
- * const Item = ({ item, focus }) => {
24
- * const ref = useFocus(focus);
25
- * return (
26
- * <li ref={ref}>
27
- * {item.name}
28
- * </li>
29
- * )
30
- * }
31
- *******************************************************************************
32
- */
33
- type RefType = null | HTMLInputElement | HTMLDivElement;
34
- export default function useFocus(focus: boolean): import("react").MutableRefObject<RefType>;
35
- export {};