@atlaskit/editor-core 172.0.3 → 172.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +56 -0
- package/dist/cjs/create-editor/ReactEditorView.js +11 -2
- package/dist/cjs/create-editor/ReactEditorViewContext.js +15 -0
- package/dist/cjs/create-editor/create-plugins-list.js +2 -1
- package/dist/cjs/editor.js +7 -1
- package/dist/cjs/labs/next/mobile.js +5 -3
- package/dist/cjs/messages.js +5 -0
- package/dist/cjs/plugins/analytics/types/enums.js +1 -0
- package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/styled.js +1 -1
- package/dist/cjs/plugins/card/nodeviews/inlineCard.js +8 -0
- package/dist/cjs/plugins/card/pm-plugins/doc.js +2 -26
- package/dist/cjs/plugins/card/toolbar.js +118 -86
- package/dist/cjs/plugins/code-block/nodeviews/code-block.js +9 -2
- package/dist/cjs/plugins/code-block/pm-plugins/ide-ux.js +37 -1
- package/dist/cjs/plugins/code-block/toolbar.js +3 -1
- package/dist/cjs/plugins/code-block/ui/class-names.js +2 -0
- package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +4 -3
- package/dist/cjs/plugins/floating-toolbar/ui/EmojiPickerButton.js +3 -1
- package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +42 -2
- package/dist/cjs/plugins/hyperlink/Toolbar.js +43 -8
- package/dist/cjs/plugins/media/commands/helpers.js +1 -8
- package/dist/cjs/plugins/media/index.js +1 -1
- package/dist/cjs/plugins/media/nodeviews/mediaNodeView/index.js +0 -10
- package/dist/cjs/plugins/media/nodeviews/mediaNodeView/media.js +2 -3
- package/dist/cjs/plugins/media/picker-facade.js +1 -0
- package/dist/cjs/plugins/media/pm-plugins/main.js +3 -13
- package/dist/cjs/plugins/paste/handlers.js +9 -20
- package/dist/cjs/plugins/paste/md.js +8 -2
- package/dist/cjs/plugins/paste/newline-md-plugin.js +67 -0
- package/dist/cjs/plugins/paste/paragraph-md-plugin.js +72 -0
- package/dist/cjs/plugins/table/commands/hover.js +4 -4
- package/dist/cjs/plugins/table/ui/TableFloatingControls/CornerControls/index.js +2 -1
- package/dist/cjs/plugins/table/ui/common-styles.js +1 -1
- package/dist/cjs/plugins/table/utils/decoration.js +53 -3
- package/dist/cjs/plugins/tasks-and-decisions/nodeviews/taskItem.js +1 -0
- package/dist/cjs/plugins/type-ahead/ui/InputQuery.js +3 -2
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadList.js +78 -53
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadPopup.js +1 -1
- package/dist/cjs/ui/Addon/ClickAreaBlock/index.js +7 -2
- package/dist/cjs/ui/Addon/ClickAreaMobile/index.js +8 -2
- package/dist/cjs/ui/Appearance/Comment/Comment.js +13 -13
- package/dist/cjs/ui/Appearance/FullPage/FullPage.js +8 -7
- package/dist/cjs/ui/Appearance/FullPage/FullPageContentArea.js +2 -1
- package/dist/cjs/ui/Appearance/Mobile.js +4 -2
- package/dist/cjs/ui/AppearanceComponents/Mobile.js +5 -4
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/DropdownMenu/index.js +5 -5
- package/dist/cjs/ui/with-outer-listeners.js +105 -50
- package/dist/cjs/utils/deprecation-warnings.js +4 -0
- package/dist/cjs/utils/linking-utils.js +40 -1
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/create-editor/ReactEditorView.js +11 -2
- package/dist/es2019/create-editor/ReactEditorViewContext.js +3 -0
- package/dist/es2019/create-editor/create-plugins-list.js +2 -1
- package/dist/es2019/editor.js +7 -1
- package/dist/es2019/labs/next/mobile.js +5 -3
- package/dist/es2019/messages.js +5 -0
- package/dist/es2019/plugins/analytics/types/enums.js +1 -0
- package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/styled.js +1 -1
- package/dist/es2019/plugins/card/nodeviews/inlineCard.js +10 -0
- package/dist/es2019/plugins/card/pm-plugins/doc.js +1 -24
- package/dist/es2019/plugins/card/toolbar.js +114 -86
- package/dist/es2019/plugins/code-block/nodeviews/code-block.js +9 -2
- package/dist/es2019/plugins/code-block/pm-plugins/ide-ux.js +40 -2
- package/dist/es2019/plugins/code-block/toolbar.js +2 -1
- package/dist/es2019/plugins/code-block/ui/class-names.js +2 -0
- package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +4 -3
- package/dist/es2019/plugins/floating-toolbar/ui/EmojiPickerButton.js +3 -2
- package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +37 -0
- package/dist/es2019/plugins/hyperlink/Toolbar.js +40 -9
- package/dist/es2019/plugins/media/commands/helpers.js +0 -2
- package/dist/es2019/plugins/media/index.js +1 -1
- package/dist/es2019/plugins/media/nodeviews/mediaNodeView/index.js +0 -7
- package/dist/es2019/plugins/media/nodeviews/mediaNodeView/media.js +2 -3
- package/dist/es2019/plugins/media/picker-facade.js +1 -0
- package/dist/es2019/plugins/media/pm-plugins/main.js +3 -13
- package/dist/es2019/plugins/paste/handlers.js +7 -19
- package/dist/es2019/plugins/paste/md.js +6 -2
- package/dist/es2019/plugins/paste/newline-md-plugin.js +56 -0
- package/dist/es2019/plugins/paste/paragraph-md-plugin.js +61 -0
- package/dist/es2019/plugins/table/commands/hover.js +4 -4
- package/dist/es2019/plugins/table/ui/TableFloatingControls/CornerControls/index.js +2 -1
- package/dist/es2019/plugins/table/ui/common-styles.js +39 -2
- package/dist/es2019/plugins/table/utils/decoration.js +60 -24
- package/dist/es2019/plugins/tasks-and-decisions/nodeviews/taskItem.js +1 -0
- package/dist/es2019/plugins/type-ahead/ui/InputQuery.js +4 -3
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadList.js +78 -59
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadPopup.js +2 -2
- package/dist/es2019/ui/Addon/ClickAreaBlock/index.js +6 -2
- package/dist/es2019/ui/Addon/ClickAreaMobile/index.js +7 -2
- package/dist/es2019/ui/Appearance/Comment/Comment.js +12 -6
- package/dist/es2019/ui/Appearance/FullPage/FullPage.js +7 -2
- package/dist/es2019/ui/Appearance/FullPage/FullPageContentArea.js +2 -1
- package/dist/es2019/ui/Appearance/Mobile.js +4 -2
- package/dist/es2019/ui/AppearanceComponents/Mobile.js +5 -4
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/DropdownMenu/index.js +10 -6
- package/dist/es2019/ui/with-outer-listeners.js +83 -33
- package/dist/es2019/utils/deprecation-warnings.js +4 -0
- package/dist/es2019/utils/linking-utils.js +37 -0
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/create-editor/ReactEditorView.js +11 -2
- package/dist/esm/create-editor/ReactEditorViewContext.js +3 -0
- package/dist/esm/create-editor/create-plugins-list.js +2 -1
- package/dist/esm/editor.js +7 -1
- package/dist/esm/labs/next/mobile.js +5 -3
- package/dist/esm/messages.js +5 -0
- package/dist/esm/plugins/analytics/types/enums.js +1 -0
- package/dist/esm/plugins/block-type/ui/ToolbarBlockType/styled.js +1 -1
- package/dist/esm/plugins/card/nodeviews/inlineCard.js +9 -0
- package/dist/esm/plugins/card/pm-plugins/doc.js +1 -20
- package/dist/esm/plugins/card/toolbar.js +108 -83
- package/dist/esm/plugins/code-block/nodeviews/code-block.js +9 -2
- package/dist/esm/plugins/code-block/pm-plugins/ide-ux.js +37 -2
- package/dist/esm/plugins/code-block/toolbar.js +2 -1
- package/dist/esm/plugins/code-block/ui/class-names.js +2 -0
- package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +4 -3
- package/dist/esm/plugins/floating-toolbar/ui/EmojiPickerButton.js +3 -2
- package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +41 -2
- package/dist/esm/plugins/hyperlink/Toolbar.js +43 -10
- package/dist/esm/plugins/media/commands/helpers.js +0 -4
- package/dist/esm/plugins/media/index.js +1 -1
- package/dist/esm/plugins/media/nodeviews/mediaNodeView/index.js +0 -8
- package/dist/esm/plugins/media/nodeviews/mediaNodeView/media.js +2 -3
- package/dist/esm/plugins/media/picker-facade.js +1 -0
- package/dist/esm/plugins/media/pm-plugins/main.js +3 -15
- package/dist/esm/plugins/paste/handlers.js +11 -22
- package/dist/esm/plugins/paste/md.js +6 -2
- package/dist/esm/plugins/paste/newline-md-plugin.js +58 -0
- package/dist/esm/plugins/paste/paragraph-md-plugin.js +63 -0
- package/dist/esm/plugins/table/commands/hover.js +4 -4
- package/dist/esm/plugins/table/ui/TableFloatingControls/CornerControls/index.js +2 -1
- package/dist/esm/plugins/table/ui/common-styles.js +1 -1
- package/dist/esm/plugins/table/utils/decoration.js +50 -3
- package/dist/esm/plugins/tasks-and-decisions/nodeviews/taskItem.js +1 -0
- package/dist/esm/plugins/type-ahead/ui/InputQuery.js +4 -3
- package/dist/esm/plugins/type-ahead/ui/TypeAheadList.js +77 -51
- package/dist/esm/plugins/type-ahead/ui/TypeAheadPopup.js +2 -2
- package/dist/esm/ui/Addon/ClickAreaBlock/index.js +7 -2
- package/dist/esm/ui/Addon/ClickAreaMobile/index.js +8 -2
- package/dist/esm/ui/Appearance/Comment/Comment.js +12 -12
- package/dist/esm/ui/Appearance/FullPage/FullPage.js +7 -6
- package/dist/esm/ui/Appearance/FullPage/FullPageContentArea.js +2 -1
- package/dist/esm/ui/Appearance/Mobile.js +4 -2
- package/dist/esm/ui/AppearanceComponents/Mobile.js +5 -4
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/DropdownMenu/index.js +5 -5
- package/dist/esm/ui/with-outer-listeners.js +105 -51
- package/dist/esm/utils/deprecation-warnings.js +4 -0
- package/dist/esm/utils/linking-utils.js +37 -0
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/create-editor/ReactEditorView.d.ts +2 -0
- package/dist/types/create-editor/ReactEditorViewContext.d.ts +8 -0
- package/dist/types/messages.d.ts +5 -0
- package/dist/types/plugins/analytics/types/enums.d.ts +1 -0
- package/dist/types/plugins/analytics/types/events.d.ts +2 -2
- package/dist/types/plugins/analytics/types/link-tool-bar-events.d.ts +1 -0
- package/dist/types/plugins/card/nodeviews/inlineCard.d.ts +3 -0
- package/dist/types/plugins/card/pm-plugins/doc.d.ts +1 -2
- package/dist/types/plugins/card/toolbar.d.ts +1 -0
- package/dist/types/plugins/code-block/pm-plugins/ide-ux.d.ts +4 -1
- package/dist/types/plugins/code-block/ui/class-names.d.ts +2 -0
- package/dist/types/plugins/hyperlink/types.d.ts +1 -0
- package/dist/types/plugins/media/commands/helpers.d.ts +0 -1
- package/dist/types/plugins/media/nodeviews/mediaNodeView/index.d.ts +0 -1
- package/dist/types/plugins/media/nodeviews/mediaNodeView/media.d.ts +0 -1
- package/dist/types/plugins/media/pm-plugins/main.d.ts +0 -2
- package/dist/types/plugins/media/pm-plugins/types.d.ts +0 -2
- package/dist/types/plugins/paste/newline-md-plugin.d.ts +2 -0
- package/dist/types/plugins/paste/paragraph-md-plugin.d.ts +2 -0
- package/dist/types/plugins/table/utils/decoration.d.ts +1 -1
- package/dist/types/types/editor-appearance-component.d.ts +1 -0
- package/dist/types/types/feature-flags.d.ts +9 -0
- package/dist/types/ui/Addon/ClickAreaBlock/index.d.ts +1 -0
- package/dist/types/ui/Addon/ClickAreaMobile/index.d.ts +1 -0
- package/dist/types/ui/Appearance/FullPage/FullPage.d.ts +1 -0
- package/dist/types/ui/Appearance/Mobile.d.ts +1 -1
- package/dist/types/ui/AppearanceComponents/Mobile.d.ts +2 -1
- package/dist/types/ui/Dropdown/index.d.ts +1 -1
- package/dist/types/ui/with-outer-listeners.d.ts +2 -1
- package/dist/types/utils/linking-utils.d.ts +1 -0
- package/package.json +31 -33
- package/dist/cjs/plugins/type-ahead/ui/DynamicHeightListItem.js +0 -77
- package/dist/cjs/plugins/type-ahead/ui/hooks/use-dynamic-list-height-calculation.js +0 -118
- package/dist/cjs/plugins/type-ahead/ui/hooks/use-resize-observer.js +0 -70
- package/dist/es2019/plugins/type-ahead/ui/DynamicHeightListItem.js +0 -51
- package/dist/es2019/plugins/type-ahead/ui/hooks/use-dynamic-list-height-calculation.js +0 -97
- package/dist/es2019/plugins/type-ahead/ui/hooks/use-resize-observer.js +0 -53
- package/dist/esm/plugins/type-ahead/ui/DynamicHeightListItem.js +0 -51
- package/dist/esm/plugins/type-ahead/ui/hooks/use-dynamic-list-height-calculation.js +0 -101
- package/dist/esm/plugins/type-ahead/ui/hooks/use-resize-observer.js +0 -48
- package/dist/types/plugins/type-ahead/ui/DynamicHeightListItem.d.ts +0 -21
- package/dist/types/plugins/type-ahead/ui/hooks/use-dynamic-list-height-calculation.d.ts +0 -25
- package/dist/types/plugins/type-ahead/ui/hooks/use-resize-observer.d.ts +0 -8
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import { useMemo, useState, useRef, useCallback, useLayoutEffect } from 'react';
|
|
3
|
-
import throttle from 'lodash/throttle';
|
|
4
|
-
export var calcVisibleListHeight = function calcVisibleListHeight(_ref) {
|
|
5
|
-
var startIndex = _ref.startIndex,
|
|
6
|
-
indexHeightMap = _ref.indexHeightMap,
|
|
7
|
-
limit = _ref.limit,
|
|
8
|
-
listMaxHeight = _ref.listMaxHeight,
|
|
9
|
-
listItemEstimatedHeight = _ref.listItemEstimatedHeight;
|
|
10
|
-
var hasSpace = true;
|
|
11
|
-
var totalHeight = 0;
|
|
12
|
-
var i = startIndex;
|
|
13
|
-
|
|
14
|
-
while (hasSpace && i < limit) {
|
|
15
|
-
var nextHeight = indexHeightMap[i] || listItemEstimatedHeight;
|
|
16
|
-
|
|
17
|
-
if (totalHeight < listMaxHeight) {
|
|
18
|
-
totalHeight += nextHeight;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
i++;
|
|
22
|
-
hasSpace = totalHeight <= listMaxHeight;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return totalHeight;
|
|
26
|
-
};
|
|
27
|
-
export var useDynamicListHeightCalculation = function useDynamicListHeightCalculation(_ref2) {
|
|
28
|
-
var redrawListAtIndex = _ref2.redrawListAtIndex,
|
|
29
|
-
getFirstVisibleIndex = _ref2.getFirstVisibleIndex,
|
|
30
|
-
listLength = _ref2.listLength,
|
|
31
|
-
listMaxHeight = _ref2.listMaxHeight,
|
|
32
|
-
listItemEstimatedHeight = _ref2.listItemEstimatedHeight;
|
|
33
|
-
|
|
34
|
-
var _useState = useState(null),
|
|
35
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
36
|
-
renderedListHeight = _useState2[0],
|
|
37
|
-
setRenderedListHeight = _useState2[1];
|
|
38
|
-
|
|
39
|
-
var indexHeightMap = useRef([]);
|
|
40
|
-
var resetScreenThrottled = useMemo(function () {
|
|
41
|
-
return throttle(function () {
|
|
42
|
-
requestAnimationFrame(function () {
|
|
43
|
-
var startIndex = getFirstVisibleIndex();
|
|
44
|
-
var lastItemRenderer = indexHeightMap.current[startIndex];
|
|
45
|
-
|
|
46
|
-
if (!lastItemRenderer) {
|
|
47
|
-
return;
|
|
48
|
-
} // This is an expensive method
|
|
49
|
-
// So, we are calling it only
|
|
50
|
-
// for the last top one visible
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
redrawListAtIndex(startIndex);
|
|
54
|
-
var nextListHeight = calcVisibleListHeight({
|
|
55
|
-
startIndex: startIndex,
|
|
56
|
-
limit: listLength,
|
|
57
|
-
indexHeightMap: indexHeightMap.current,
|
|
58
|
-
listMaxHeight: listMaxHeight,
|
|
59
|
-
listItemEstimatedHeight: listItemEstimatedHeight
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
if (nextListHeight) {
|
|
63
|
-
setRenderedListHeight(nextListHeight);
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
}, 16 // wait for one frame
|
|
67
|
-
);
|
|
68
|
-
}, [redrawListAtIndex, listLength, listMaxHeight, listItemEstimatedHeight, getFirstVisibleIndex]);
|
|
69
|
-
var setListItemHeight = useCallback(function (_ref3) {
|
|
70
|
-
var index = _ref3.index,
|
|
71
|
-
height = _ref3.height;
|
|
72
|
-
|
|
73
|
-
if (typeof height !== 'number') {
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
indexHeightMap.current[index] = height;
|
|
78
|
-
resetScreenThrottled();
|
|
79
|
-
}, [resetScreenThrottled]);
|
|
80
|
-
var getListItemHeight = useCallback(function (index) {
|
|
81
|
-
var result = indexHeightMap.current[index];
|
|
82
|
-
|
|
83
|
-
if (result && typeof result === 'number') {
|
|
84
|
-
return result;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
return listItemEstimatedHeight;
|
|
88
|
-
}, [listItemEstimatedHeight]);
|
|
89
|
-
useLayoutEffect(function () {
|
|
90
|
-
indexHeightMap.current = [];
|
|
91
|
-
return function () {
|
|
92
|
-
indexHeightMap.current = [];
|
|
93
|
-
};
|
|
94
|
-
}, [listLength]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
95
|
-
|
|
96
|
-
return {
|
|
97
|
-
getListItemHeight: getListItemHeight,
|
|
98
|
-
setListItemHeight: setListItemHeight,
|
|
99
|
-
renderedListHeight: renderedListHeight
|
|
100
|
-
};
|
|
101
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import React, { useMemo, useEffect, useContext, useLayoutEffect, createContext } from 'react';
|
|
2
|
-
import { browser } from '@atlaskit/editor-common/utils';
|
|
3
|
-
var Context = /*#__PURE__*/createContext(null);
|
|
4
|
-
export var ResizeObserverContext = Context;
|
|
5
|
-
export var ResizeObserverProvider = /*#__PURE__*/React.memo(function (_ref) {
|
|
6
|
-
var children = _ref.children;
|
|
7
|
-
var instance = useMemo(function () {
|
|
8
|
-
if (!browser.supportsResizeObserver) {
|
|
9
|
-
return null;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
return new window.ResizeObserver(function (entries) {
|
|
13
|
-
entries.forEach(function (entry) {
|
|
14
|
-
var onResize = entry.target.onResize;
|
|
15
|
-
|
|
16
|
-
if (onResize) {
|
|
17
|
-
onResize(entry);
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
});
|
|
21
|
-
}, []);
|
|
22
|
-
useEffect(function () {
|
|
23
|
-
return function () {
|
|
24
|
-
if (instance) {
|
|
25
|
-
instance.disconnect();
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
}, [instance]);
|
|
29
|
-
return /*#__PURE__*/React.createElement(Context.Provider, {
|
|
30
|
-
value: instance
|
|
31
|
-
}, children);
|
|
32
|
-
});
|
|
33
|
-
export var useResizeObserver = function useResizeObserver(targetRef, onResize) {
|
|
34
|
-
var resizeObserver = useContext(Context);
|
|
35
|
-
useLayoutEffect(function () {
|
|
36
|
-
if (!targetRef || !targetRef.current || resizeObserver === null) {
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
var target = targetRef.current;
|
|
41
|
-
target.onResize = onResize;
|
|
42
|
-
resizeObserver.observe(target);
|
|
43
|
-
return function () {
|
|
44
|
-
resizeObserver.unobserve(target);
|
|
45
|
-
delete target.onResize;
|
|
46
|
-
};
|
|
47
|
-
}, [targetRef, resizeObserver, onResize]);
|
|
48
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
|
|
3
|
-
import type { TypeAheadItem, OnSelectItem } from '../types';
|
|
4
|
-
declare type ListItemActionsContextProps = {
|
|
5
|
-
onItemHover: OnSelectItem;
|
|
6
|
-
onItemClick: (mode: SelectItemMode, index: number) => void;
|
|
7
|
-
};
|
|
8
|
-
declare type DynamicHeightListItemProps = {
|
|
9
|
-
index: number;
|
|
10
|
-
data: Array<TypeAheadItem>;
|
|
11
|
-
style: any;
|
|
12
|
-
};
|
|
13
|
-
declare type UpdateListItemHeightContextType = (props: {
|
|
14
|
-
index: number;
|
|
15
|
-
height: number;
|
|
16
|
-
}) => void;
|
|
17
|
-
export declare const SelectedIndexContext: React.Context<number>;
|
|
18
|
-
export declare const ListItemActionsContext: React.Context<ListItemActionsContextProps>;
|
|
19
|
-
export declare const UpdateListItemHeightContext: React.Context<UpdateListItemHeightContextType>;
|
|
20
|
-
export declare const DynamicHeightListItem: React.FC<DynamicHeightListItemProps>;
|
|
21
|
-
export {};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export declare const calcVisibleListHeight: ({ startIndex, indexHeightMap, limit, listMaxHeight, listItemEstimatedHeight, }: {
|
|
2
|
-
startIndex: number;
|
|
3
|
-
indexHeightMap: Array<number>;
|
|
4
|
-
limit: number;
|
|
5
|
-
listMaxHeight: number;
|
|
6
|
-
listItemEstimatedHeight: number;
|
|
7
|
-
}) => number;
|
|
8
|
-
declare type SetListItemHeight = (props: {
|
|
9
|
-
index: number;
|
|
10
|
-
height: number;
|
|
11
|
-
}) => void;
|
|
12
|
-
declare type GetListItemHeight = (index: number) => number;
|
|
13
|
-
declare type Props = {
|
|
14
|
-
redrawListAtIndex: (index: number) => void;
|
|
15
|
-
getFirstVisibleIndex: () => number;
|
|
16
|
-
listLength: number;
|
|
17
|
-
listMaxHeight: number;
|
|
18
|
-
listItemEstimatedHeight: number;
|
|
19
|
-
};
|
|
20
|
-
export declare const useDynamicListHeightCalculation: ({ redrawListAtIndex, getFirstVisibleIndex, listLength, listMaxHeight, listItemEstimatedHeight, }: Props) => {
|
|
21
|
-
getListItemHeight: GetListItemHeight;
|
|
22
|
-
setListItemHeight: SetListItemHeight;
|
|
23
|
-
renderedListHeight: number | null;
|
|
24
|
-
};
|
|
25
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface ElementResizable extends Element {
|
|
3
|
-
onResize?: (entry: ResizeObserverEntry) => void;
|
|
4
|
-
}
|
|
5
|
-
export declare const ResizeObserverContext: React.Context<ResizeObserver | null>;
|
|
6
|
-
export declare const ResizeObserverProvider: React.FC;
|
|
7
|
-
export declare const useResizeObserver: <T extends ElementResizable>(targetRef: React.MutableRefObject<T> | null, onResize: (entry: ResizeObserverEntry) => void) => void;
|
|
8
|
-
export {};
|