@sentry/scraps 0.3.0 → 0.5.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/README.md +6 -5
- package/dist/alert/alert.js +0 -3
- package/dist/badge/badge.js +1 -2
- package/dist/badge/tag.js +0 -2
- package/dist/button/index.d.ts +0 -1
- package/dist/button/index.js +0 -1
- package/dist/clipboard/copyToClipboardButton.d.ts +15 -0
- package/dist/clipboard/copyToClipboardButton.js +32 -0
- package/dist/clipboard/index.d.ts +1 -0
- package/dist/clipboard/index.js +1 -0
- package/dist/code/index.d.ts +1 -0
- package/dist/code/index.js +1 -0
- package/dist/codeBlock/codeBlock.d.ts +68 -0
- package/dist/codeBlock/codeBlock.js +242 -0
- package/dist/codeBlock/index.d.ts +2 -0
- package/dist/codeBlock/index.js +2 -0
- package/dist/codeBlock/prism.d.ts +11 -0
- package/dist/codeBlock/prism.js +101 -0
- package/dist/codeBlock/styles.d.ts +2 -0
- package/dist/codeBlock/styles.js +133 -0
- package/dist/compactSelect/compactSelect.d.ts +21 -0
- package/dist/compactSelect/compactSelect.js +150 -0
- package/dist/compactSelect/composite.d.ts +54 -0
- package/dist/compactSelect/composite.js +101 -0
- package/dist/compactSelect/control.d.ts +112 -0
- package/dist/compactSelect/control.js +354 -0
- package/dist/compactSelect/fzf.d.ts +8 -0
- package/dist/compactSelect/fzf.js +151 -0
- package/dist/compactSelect/gridList/index.d.ts +46 -0
- package/dist/compactSelect/gridList/index.js +102 -0
- package/dist/compactSelect/gridList/option.d.ts +15 -0
- package/dist/compactSelect/gridList/option.js +111 -0
- package/dist/compactSelect/gridList/section.d.ts +15 -0
- package/dist/compactSelect/gridList/section.js +58 -0
- package/dist/compactSelect/highlightText.d.ts +6 -0
- package/dist/compactSelect/highlightText.js +33 -0
- package/dist/compactSelect/index.d.ts +9 -0
- package/dist/compactSelect/index.js +8 -0
- package/dist/compactSelect/list.d.ts +94 -0
- package/dist/compactSelect/list.js +167 -0
- package/dist/compactSelect/listBox/index.d.ts +84 -0
- package/dist/compactSelect/listBox/index.js +175 -0
- package/dist/compactSelect/listBox/option.d.ts +19 -0
- package/dist/compactSelect/listBox/option.js +101 -0
- package/dist/compactSelect/listBox/section.d.ts +21 -0
- package/dist/compactSelect/listBox/section.js +58 -0
- package/dist/compactSelect/menuComponents.d.ts +89 -0
- package/dist/compactSelect/menuComponents.js +117 -0
- package/dist/compactSelect/selectFilterContext.d.ts +2 -0
- package/dist/compactSelect/selectFilterContext.js +3 -0
- package/dist/compactSelect/styles.d.ts +39 -0
- package/dist/compactSelect/styles.js +155 -0
- package/dist/compactSelect/types.d.ts +1 -0
- package/dist/compactSelect/types.js +0 -0
- package/dist/compactSelect/useVirtualizedItems.d.ts +52 -0
- package/dist/compactSelect/useVirtualizedItems.js +74 -0
- package/dist/compactSelect/utils.d.ts +80 -0
- package/dist/compactSelect/utils.js +268 -0
- package/dist/confirm/index.d.ts +153 -0
- package/dist/confirm/index.js +132 -0
- package/dist/descriptionList/descriptionList.js +4 -3
- package/dist/disclosure/disclosure.js +2 -2
- package/dist/dragHandle/dragHandle.d.ts +3 -1
- package/dist/dragHandle/dragHandle.js +8 -5
- package/dist/drawer/components.d.ts +46 -0
- package/dist/drawer/components.js +265 -0
- package/dist/drawer/globalDrawer.d.ts +106 -0
- package/dist/drawer/globalDrawer.js +173 -0
- package/dist/drawer/index.d.ts +3 -0
- package/dist/drawer/index.js +2 -0
- package/dist/drawer/useDrawerResizing.d.ts +19 -0
- package/dist/drawer/useDrawerResizing.js +111 -0
- package/dist/drawer/useDrawerWidth.d.ts +1 -0
- package/dist/drawer/useDrawerWidth.js +42 -0
- package/dist/dropdownMenu/content.d.ts +1 -0
- package/dist/dropdownMenu/content.js +1 -0
- package/dist/dropdownMenu/context.d.ts +24 -0
- package/dist/dropdownMenu/context.js +3 -0
- package/dist/dropdownMenu/dropdownMenu.d.ts +70 -0
- package/dist/dropdownMenu/dropdownMenu.js +103 -0
- package/dist/dropdownMenu/index.d.ts +2 -0
- package/dist/dropdownMenu/index.js +1 -0
- package/dist/dropdownMenu/item.d.ts +136 -0
- package/dist/dropdownMenu/item.js +182 -0
- package/dist/dropdownMenu/list.d.ts +59 -0
- package/dist/dropdownMenu/list.js +410 -0
- package/dist/dropdownMenu/search.d.ts +16 -0
- package/dist/dropdownMenu/search.js +16 -0
- package/dist/dropdownMenu/section.d.ts +21 -0
- package/dist/dropdownMenu/section.js +40 -0
- package/dist/dropdownMenu/separator.d.ts +7 -0
- package/dist/dropdownMenu/separator.js +15 -0
- package/dist/dropdownMenu/useDropdownMenuKeyboard.d.ts +260 -0
- package/dist/dropdownMenu/useDropdownMenuKeyboard.js +55 -0
- package/dist/dropdownMenu/useDropdownMenuRowLayout.d.ts +29 -0
- package/dist/dropdownMenu/useDropdownMenuRowLayout.js +64 -0
- package/dist/dropdownMenu/useSafetyTriangle.d.ts +12 -0
- package/dist/dropdownMenu/useSafetyTriangle.js +119 -0
- package/dist/dropdownMenu/utils.d.ts +21 -0
- package/dist/dropdownMenu/utils.js +57 -0
- package/dist/form/FormSearch.d.ts +19 -0
- package/dist/form/FormSearch.js +4 -0
- package/dist/form/autoSaveForm.d.ts +110 -0
- package/dist/form/autoSaveForm.js +100 -0
- package/dist/{formPresentation → form}/displayField.js +2 -2
- package/dist/form/field/baseField.d.ts +23 -0
- package/dist/form/field/baseField.js +116 -0
- package/dist/form/field/checkboxField.d.ts +11 -0
- package/dist/form/field/checkboxField.js +42 -0
- package/dist/form/field/checkboxGroupField.d.ts +16 -0
- package/dist/form/field/checkboxGroupField.js +80 -0
- package/dist/form/field/compactSelectField.d.ts +19 -0
- package/dist/form/field/compactSelectField.js +77 -0
- package/dist/{formPresentation → form/field}/fieldIds.js +1 -1
- package/dist/form/field/inputField.d.ts +19 -0
- package/dist/form/field/inputField.js +31 -0
- package/dist/{formPresentation → form/field}/meta.js +6 -6
- package/dist/form/field/numberField.d.ts +5 -0
- package/dist/form/field/numberField.js +11 -0
- package/dist/form/field/passwordField.d.ts +3 -0
- package/dist/form/field/passwordField.js +27 -0
- package/dist/form/field/radioGroupField.d.ts +16 -0
- package/dist/form/field/radioGroupField.js +92 -0
- package/dist/form/field/rangeField.d.ts +8 -0
- package/dist/form/field/rangeField.js +34 -0
- package/dist/form/field/selectAsyncField.d.ts +31 -0
- package/dist/form/field/selectAsyncField.js +22 -0
- package/dist/form/field/selectField.d.ts +9 -0
- package/dist/form/field/selectField.js +72 -0
- package/dist/form/field/switchField.d.ts +7 -0
- package/dist/form/field/switchField.js +37 -0
- package/dist/form/field/textAreaField.d.ts +7 -0
- package/dist/form/field/textAreaField.js +25 -0
- package/dist/{formPresentation → form}/formContext.js +1 -1
- package/dist/form/formErrorContext/index.d.ts +9 -0
- package/dist/form/formErrorContext/index.js +7 -0
- package/dist/form/index.d.ts +9 -0
- package/dist/form/index.js +8 -0
- package/dist/{formPresentation → form/layout}/base.d.ts +1 -1
- package/dist/{formPresentation → form/layout}/base.js +1 -1
- package/dist/form/layout/fieldGroup.d.ts +6 -0
- package/dist/form/layout/fieldGroup.js +60 -0
- package/dist/{formPresentation/fieldLayout.d.ts → form/layout/index.d.ts} +1 -1
- package/dist/{formPresentation/fieldLayout.js → form/layout/index.js} +3 -3
- package/dist/{formPresentation → form/layout}/useStackedLayout.js +1 -1
- package/dist/form/scrapsForm.d.ts +220 -0
- package/dist/form/scrapsForm.js +126 -0
- package/dist/hotkey/hotkey.d.ts +9 -8
- package/dist/hotkey/hotkey.js +13 -6
- package/dist/hotkey/index.d.ts +2 -1
- package/dist/hotkey/index.js +2 -1
- package/dist/hotkey/keyMappings.d.ts +1 -15
- package/dist/hotkey/keyMappings.js +29 -174
- package/dist/hotkey/useHotkeys.d.ts +3 -47
- package/dist/hotkey/useHotkeys.js +8 -42
- package/dist/image/image.js +2 -1
- package/dist/info/infoTip.d.ts +1 -1
- package/dist/info/infoTip.js +4 -3
- package/dist/input/index.d.ts +0 -3
- package/dist/input/index.js +0 -2
- package/dist/input/input.d.ts +2 -0
- package/dist/input/input.js +2 -0
- package/dist/input/passwordManagerIgnoreProps.d.ts +11 -0
- package/dist/input/passwordManagerIgnoreProps.js +8 -0
- package/dist/layout/index.d.ts +2 -2
- package/dist/layout/index.js +1 -1
- package/dist/layout/styles.d.ts +1 -1
- package/dist/link/link.js +4 -3
- package/dist/link/linkBehaviorContext.d.ts +2 -0
- package/dist/link/linkBehaviorContext.js +17 -10
- package/dist/menu/controlContext.d.ts +32 -0
- package/dist/menu/controlContext.js +7 -0
- package/dist/menu/dropdownButton.d.ts +18 -0
- package/dist/menu/dropdownButton.js +66 -0
- package/dist/menu/index.d.ts +7 -0
- package/dist/menu/index.js +3 -0
- package/dist/menu/menu.d.ts +167 -0
- package/dist/menu/menu.js +568 -0
- package/dist/menu/selectTypes.d.ts +96 -0
- package/dist/menu/selectTypes.js +0 -0
- package/dist/menu/selectValue.d.ts +13 -0
- package/dist/menu/selectValue.js +0 -0
- package/dist/modal/components.d.ts +19 -0
- package/dist/modal/components.js +99 -0
- package/dist/modal/errorBoundary.d.ts +2 -0
- package/dist/modal/errorBoundary.js +35 -0
- package/dist/modal/index.d.ts +33 -0
- package/dist/modal/index.js +260 -0
- package/dist/modal/portal.d.ts +1 -0
- package/dist/modal/portal.js +10 -0
- package/dist/modal/state.d.ts +17 -0
- package/dist/modal/state.js +41 -0
- package/dist/modal/types.d.ts +75 -0
- package/dist/modal/types.js +0 -0
- package/dist/numberInput/index.d.ts +3 -0
- package/dist/numberInput/index.js +2 -0
- package/dist/{input → numberInput}/numberDragInput.d.ts +1 -1
- package/dist/{input → numberInput}/numberDragInput.js +1 -1
- package/dist/{input → numberInput}/numberInput.d.ts +1 -1
- package/dist/{input → numberInput}/numberInput.js +1 -1
- package/dist/overlayContext.d.ts +29 -0
- package/dist/overlayContext.js +7 -0
- package/dist/overlayTrigger.d.ts +22 -0
- package/dist/overlayTrigger.js +30 -0
- package/dist/pagination/index.d.ts +1 -0
- package/dist/pagination/index.js +1 -0
- package/dist/pagination/pagination.d.ts +24 -0
- package/dist/pagination/pagination.js +63 -0
- package/dist/pictureInPicture/index.d.ts +2 -0
- package/dist/pictureInPicture/index.js +2 -0
- package/dist/pictureInPicture/pictureInPicture.d.ts +47 -0
- package/dist/pictureInPicture/pictureInPicture.js +100 -0
- package/dist/pictureInPicture/pictureInPicturePortal.d.ts +16 -0
- package/dist/pictureInPicture/pictureInPicturePortal.js +46 -0
- package/dist/pictureInPicture/portalContext.d.ts +2 -0
- package/dist/pictureInPicture/portalContext.js +3 -0
- package/dist/revealOnHover/revealOnHover.js +1 -1
- package/dist/segmentedControl/segmentedControl.js +1 -1
- package/dist/select/filter.d.ts +4 -0
- package/dist/select/filter.js +12 -0
- package/dist/select/index.d.ts +3 -0
- package/dist/select/index.js +2 -0
- package/dist/select/option.d.ts +16 -0
- package/dist/select/option.js +81 -0
- package/dist/select/reactSelectWrapper.d.ts +8 -0
- package/dist/select/reactSelectWrapper.js +25 -0
- package/dist/select/select.d.ts +79 -0
- package/dist/select/select.js +454 -0
- package/dist/select/styles.d.ts +9 -0
- package/dist/select/styles.js +27 -0
- package/dist/select/types.d.ts +60 -0
- package/dist/select/types.js +0 -0
- package/dist/select/virtualizedMenuList.d.ts +24 -0
- package/dist/select/virtualizedMenuList.js +123 -0
- package/dist/slideOverPanel.d.ts +20 -0
- package/dist/slideOverPanel.js +141 -0
- package/dist/slot/knownContexts.d.ts +1 -1
- package/dist/spinner/index.d.ts +1 -0
- package/dist/spinner/index.js +1 -0
- package/dist/spinner/spinner.d.ts +14 -0
- package/dist/spinner/spinner.js +126 -0
- package/dist/splitPanel/index.d.ts +1 -0
- package/dist/splitPanel/index.js +1 -0
- package/dist/splitPanel/splitPanel.d.ts +38 -0
- package/dist/splitPanel/splitPanel.js +145 -0
- package/dist/table/table.d.ts +1 -1
- package/dist/table/table.js +39 -20
- package/dist/table/useColumnResize.d.ts +6 -5
- package/dist/table/useColumnResize.js +5 -4
- package/dist/tabs/index.d.ts +4 -0
- package/dist/tabs/index.js +3 -0
- package/dist/tabs/item.d.ts +13 -0
- package/dist/tabs/item.js +4 -0
- package/dist/tabs/tab.d.ts +22 -0
- package/dist/tabs/tab.js +205 -0
- package/dist/tabs/tabList.d.ts +18 -0
- package/dist/tabs/tabList.js +256 -0
- package/dist/tabs/tabPanels.d.ts +14 -0
- package/dist/tabs/tabPanels.js +62 -0
- package/dist/tabs/tabs.d.ts +38 -0
- package/dist/tabs/tabs.js +56 -0
- package/dist/tabs/utils.d.ts +3 -0
- package/dist/tabs/utils.js +6 -0
- package/dist/text/heading.d.ts +1 -1
- package/dist/text/heading.js +1 -1
- package/dist/text/styles.js +1 -1
- package/dist/text/text.d.ts +1 -1
- package/dist/text/text.js +1 -1
- package/dist/theme/dark.js +9 -9
- package/dist/theme/light.js +9 -9
- package/dist/toast/index.d.ts +5 -0
- package/dist/toast/index.js +4 -0
- package/dist/toast/toast.d.ts +10 -0
- package/dist/toast/toast.js +182 -0
- package/dist/toast/toastApi.d.ts +10 -0
- package/dist/toast/toastApi.js +53 -0
- package/dist/toast/toaster.d.ts +4 -0
- package/dist/toast/toaster.js +42 -0
- package/dist/toast/types.d.ts +17 -0
- package/dist/toast/types.js +2 -0
- package/dist/toggleCard/index.d.ts +1 -0
- package/dist/toggleCard/index.js +1 -0
- package/dist/toggleCard/toggleCard.d.ts +32 -0
- package/dist/toggleCard/toggleCard.js +301 -0
- package/dist/tooltip/tooltip.js +2 -5
- package/dist/useDimensions.d.ts +12 -0
- package/dist/useDimensions.js +31 -0
- package/dist/useMedia.d.ts +15 -0
- package/dist/useMedia.js +24 -0
- package/dist/useOnClickOutside.d.ts +2 -0
- package/dist/useOnClickOutside.js +22 -0
- package/dist/useOverlay.d.ts +1 -0
- package/dist/useOverlay.js +1 -0
- package/dist/useResizableDrawer.d.ts +72 -0
- package/dist/useResizableDrawer.js +136 -0
- package/dist/useVirtualCollection.d.ts +154 -0
- package/dist/useVirtualCollection.js +143 -0
- package/dist/useVirtualRows.d.ts +26 -0
- package/dist/useVirtualRows.js +26 -0
- package/dist/virtualCollectionLayout.d.ts +51 -0
- package/dist/virtualCollectionLayout.js +49 -0
- package/package.json +148 -16
- package/dist/formPresentation/index.d.ts +0 -8
- package/dist/formPresentation/index.js +0 -8
- package/dist/interactionStateLayer/index.d.ts +0 -1
- package/dist/interactionStateLayer/index.js +0 -1
- package/dist/interactionStateLayer/interactionStateLayer.d.ts +0 -23
- package/dist/interactionStateLayer/interactionStateLayer.js +0 -67
- package/dist/unreachable.d.ts +0 -1
- package/dist/unreachable.js +0 -4
- /package/dist/{formPresentation → form}/autoSaveContext.d.ts +0 -0
- /package/dist/{formPresentation → form}/autoSaveContext.js +0 -0
- /package/dist/{formPresentation → form}/displayField.d.ts +0 -0
- /package/dist/{formPresentation → form/field}/fieldIds.d.ts +0 -0
- /package/dist/{formPresentation → form/field}/groupContext.d.ts +0 -0
- /package/dist/{formPresentation → form/field}/groupContext.js +0 -0
- /package/dist/{formPresentation → form/field}/meta.d.ts +0 -0
- /package/dist/{formPresentation → form}/formContext.d.ts +0 -0
- /package/dist/{formPresentation → form}/icons.d.ts +0 -0
- /package/dist/{formPresentation → form}/icons.js +0 -0
- /package/dist/{formPresentation → form/layout}/useStackedLayout.d.ts +0 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { useLayoutEffect } from "react";
|
|
2
|
+
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
3
|
+
function useVirtualRows({ estimateKey, overscan = 5, ...options }) {
|
|
4
|
+
const virtualizer = useVirtualizer({
|
|
5
|
+
...options,
|
|
6
|
+
overscan
|
|
7
|
+
});
|
|
8
|
+
useLayoutEffect(()=>{
|
|
9
|
+
virtualizer.measure();
|
|
10
|
+
}, [
|
|
11
|
+
virtualizer,
|
|
12
|
+
estimateKey
|
|
13
|
+
]);
|
|
14
|
+
const virtualItems = virtualizer.getVirtualItems();
|
|
15
|
+
const totalSize = virtualizer.getTotalSize();
|
|
16
|
+
const first = virtualItems[0];
|
|
17
|
+
const last = virtualItems[virtualItems.length - 1];
|
|
18
|
+
return {
|
|
19
|
+
virtualizer,
|
|
20
|
+
virtualItems,
|
|
21
|
+
paddingTop: first ? Math.max(0, first.start) : 0,
|
|
22
|
+
paddingBottom: last ? Math.max(0, totalSize - last.end) : 0,
|
|
23
|
+
totalSize
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export { useVirtualRows };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { Node } from '@react-types/shared';
|
|
2
|
+
import type { FormSize } from './theme/index.js';
|
|
3
|
+
export declare const ROW_HEIGHT_ESTIMATES: {
|
|
4
|
+
readonly xs: {
|
|
5
|
+
readonly regular: 25;
|
|
6
|
+
readonly withDetails: 42;
|
|
7
|
+
};
|
|
8
|
+
readonly sm: {
|
|
9
|
+
readonly regular: 32;
|
|
10
|
+
readonly withDetails: 49;
|
|
11
|
+
};
|
|
12
|
+
readonly md: {
|
|
13
|
+
readonly regular: 36;
|
|
14
|
+
readonly withDetails: 53;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Index of the section row each node belongs to, if that section is in
|
|
19
|
+
* `nodes`. Undefined for a node that is not in a section.
|
|
20
|
+
*/
|
|
21
|
+
export declare function getSectionIndexes<T>(nodes: ReadonlyArray<Node<T>>): Array<number | undefined>;
|
|
22
|
+
interface MountedIndexesOptions {
|
|
23
|
+
/** Index of the focused row, or -1. */
|
|
24
|
+
focusedIndex: number;
|
|
25
|
+
/** Per node, the index of its section row. See `getSectionIndexes`. */
|
|
26
|
+
sectionIndexes: ReadonlyArray<number | undefined>;
|
|
27
|
+
/** Index of the row to keep mounted for the menu's width, or -1. */
|
|
28
|
+
widestIndex: number;
|
|
29
|
+
/** The rows in or near the viewport. */
|
|
30
|
+
windowIndexes: readonly number[];
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The rows to mount: those in the window, plus the focused row so it keeps DOM
|
|
34
|
+
* focus when scrolled out of view, the widest row so a list that sizes to its
|
|
35
|
+
* content does not widen while scrolling, and the section row of every mounted
|
|
36
|
+
* row, since the section's element wraps its children. Sorted by index.
|
|
37
|
+
*/
|
|
38
|
+
export declare function getMountedIndexes({ windowIndexes, focusedIndex, widestIndex, sectionIndexes, }: MountedIndexesOptions): number[];
|
|
39
|
+
/**
|
|
40
|
+
* Whether `node` is an item of `section` other than its first. These are the
|
|
41
|
+
* items a menu spaces from the item above, see `DropdownMenuSection`.
|
|
42
|
+
*/
|
|
43
|
+
export declare function isAfterFirstInSection<T>(node: Node<T>, section: Node<T> | null | undefined): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Height to assume for a row that has not been measured. A row after the
|
|
46
|
+
* first in its section includes `sectionRowSpace`, which stands for padding on
|
|
47
|
+
* the row's own element: mounted rows are measured by their border box, so
|
|
48
|
+
* they include it too.
|
|
49
|
+
*/
|
|
50
|
+
export declare function estimateRowHeight<T>(node: Node<T> | undefined, section: Node<T> | undefined, size: FormSize, sectionRowSpace: number): number;
|
|
51
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
const ROW_HEIGHT_ESTIMATES = {
|
|
2
|
+
xs: {
|
|
3
|
+
regular: 25,
|
|
4
|
+
withDetails: 42
|
|
5
|
+
},
|
|
6
|
+
sm: {
|
|
7
|
+
regular: 32,
|
|
8
|
+
withDetails: 49
|
|
9
|
+
},
|
|
10
|
+
md: {
|
|
11
|
+
regular: 36,
|
|
12
|
+
withDetails: 53
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
function getSectionIndexes(nodes) {
|
|
16
|
+
const indexByKey = new Map();
|
|
17
|
+
nodes.forEach((node, index)=>{
|
|
18
|
+
if ('section' === node.type) indexByKey.set(node.key, index);
|
|
19
|
+
});
|
|
20
|
+
return nodes.map((node)=>null === node.parentKey || void 0 === node.parentKey ? void 0 : indexByKey.get(node.parentKey));
|
|
21
|
+
}
|
|
22
|
+
function getMountedIndexes({ windowIndexes, focusedIndex, widestIndex, sectionIndexes }) {
|
|
23
|
+
const indexes = new Set(windowIndexes);
|
|
24
|
+
for (const index of [
|
|
25
|
+
focusedIndex,
|
|
26
|
+
widestIndex
|
|
27
|
+
])if (-1 !== index) indexes.add(index);
|
|
28
|
+
for (const index of [
|
|
29
|
+
...indexes
|
|
30
|
+
]){
|
|
31
|
+
const sectionIndex = sectionIndexes[index];
|
|
32
|
+
if (void 0 !== sectionIndex) indexes.add(sectionIndex);
|
|
33
|
+
}
|
|
34
|
+
return [
|
|
35
|
+
...indexes
|
|
36
|
+
].sort((a, b)=>a - b);
|
|
37
|
+
}
|
|
38
|
+
function isAfterFirstInSection(node, section) {
|
|
39
|
+
if (!section || node.parentKey !== section.key) return false;
|
|
40
|
+
const [first] = section.childNodes;
|
|
41
|
+
return void 0 !== first && first.key !== node.key;
|
|
42
|
+
}
|
|
43
|
+
function estimateRowHeight(node, section, size, sectionRowSpace) {
|
|
44
|
+
const heights = ROW_HEIGHT_ESTIMATES[size];
|
|
45
|
+
const props = node?.props;
|
|
46
|
+
const height = props?.details ? heights.withDetails : heights.regular;
|
|
47
|
+
return node && isAfterFirstInSection(node, section) ? height + sectionRowSpace : height;
|
|
48
|
+
}
|
|
49
|
+
export { ROW_HEIGHT_ESTIMATES, estimateRowHeight, getMountedIndexes, getSectionIndexes, isAfterFirstInSection };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/scraps",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/getsentry/sentry.git",
|
|
@@ -23,9 +23,17 @@
|
|
|
23
23
|
"types": "./dist/theme/index.d.ts",
|
|
24
24
|
"import": "./dist/theme/index.js"
|
|
25
25
|
},
|
|
26
|
-
"./
|
|
27
|
-
"types": "./dist/
|
|
28
|
-
"import": "./dist/
|
|
26
|
+
"./form": {
|
|
27
|
+
"types": "./dist/form/index.d.ts",
|
|
28
|
+
"import": "./dist/form/index.js"
|
|
29
|
+
},
|
|
30
|
+
"./form/formErrorContext": {
|
|
31
|
+
"types": "./dist/form/formErrorContext/index.d.ts",
|
|
32
|
+
"import": "./dist/form/formErrorContext/index.js"
|
|
33
|
+
},
|
|
34
|
+
"./confirm": {
|
|
35
|
+
"types": "./dist/confirm/index.d.ts",
|
|
36
|
+
"import": "./dist/confirm/index.js"
|
|
29
37
|
},
|
|
30
38
|
"./tokens": {
|
|
31
39
|
"types": "./dist/tokens/index.d.ts",
|
|
@@ -71,6 +79,10 @@
|
|
|
71
79
|
"types": "./dist/input/index.d.ts",
|
|
72
80
|
"import": "./dist/input/index.js"
|
|
73
81
|
},
|
|
82
|
+
"./numberInput": {
|
|
83
|
+
"types": "./dist/numberInput/index.d.ts",
|
|
84
|
+
"import": "./dist/numberInput/index.js"
|
|
85
|
+
},
|
|
74
86
|
"./textarea": {
|
|
75
87
|
"types": "./dist/textarea/index.d.ts",
|
|
76
88
|
"import": "./dist/textarea/index.js"
|
|
@@ -107,6 +119,14 @@
|
|
|
107
119
|
"types": "./dist/useScrollLock.d.ts",
|
|
108
120
|
"import": "./dist/useScrollLock.js"
|
|
109
121
|
},
|
|
122
|
+
"./useMedia": {
|
|
123
|
+
"types": "./dist/useMedia.d.ts",
|
|
124
|
+
"import": "./dist/useMedia.js"
|
|
125
|
+
},
|
|
126
|
+
"./useOnClickOutside": {
|
|
127
|
+
"types": "./dist/useOnClickOutside.d.ts",
|
|
128
|
+
"import": "./dist/useOnClickOutside.js"
|
|
129
|
+
},
|
|
110
130
|
"./link": {
|
|
111
131
|
"types": "./dist/link/index.d.ts",
|
|
112
132
|
"import": "./dist/link/index.js"
|
|
@@ -123,14 +143,14 @@
|
|
|
123
143
|
"types": "./dist/descriptionList/index.d.ts",
|
|
124
144
|
"import": "./dist/descriptionList/index.js"
|
|
125
145
|
},
|
|
126
|
-
"./interactionStateLayer": {
|
|
127
|
-
"types": "./dist/interactionStateLayer/index.d.ts",
|
|
128
|
-
"import": "./dist/interactionStateLayer/index.js"
|
|
129
|
-
},
|
|
130
146
|
"./radio": {
|
|
131
147
|
"types": "./dist/radio/index.d.ts",
|
|
132
148
|
"import": "./dist/radio/index.js"
|
|
133
149
|
},
|
|
150
|
+
"./toggleCard": {
|
|
151
|
+
"types": "./dist/toggleCard/index.d.ts",
|
|
152
|
+
"import": "./dist/toggleCard/index.js"
|
|
153
|
+
},
|
|
134
154
|
"./statusIndicator": {
|
|
135
155
|
"types": "./dist/statusIndicator/index.d.ts",
|
|
136
156
|
"import": "./dist/statusIndicator/index.js"
|
|
@@ -214,23 +234,118 @@
|
|
|
214
234
|
"./dragHandle": {
|
|
215
235
|
"types": "./dist/dragHandle/index.d.ts",
|
|
216
236
|
"import": "./dist/dragHandle/index.js"
|
|
237
|
+
},
|
|
238
|
+
"./spinner": {
|
|
239
|
+
"types": "./dist/spinner/index.d.ts",
|
|
240
|
+
"import": "./dist/spinner/index.js"
|
|
241
|
+
},
|
|
242
|
+
"./menu": {
|
|
243
|
+
"types": "./dist/menu/index.d.ts",
|
|
244
|
+
"import": "./dist/menu/index.js"
|
|
245
|
+
},
|
|
246
|
+
"./overlayTrigger": {
|
|
247
|
+
"types": "./dist/overlayTrigger.d.ts",
|
|
248
|
+
"import": "./dist/overlayTrigger.js"
|
|
249
|
+
},
|
|
250
|
+
"./splitPanel": {
|
|
251
|
+
"types": "./dist/splitPanel/index.d.ts",
|
|
252
|
+
"import": "./dist/splitPanel/index.js"
|
|
253
|
+
},
|
|
254
|
+
"./useDimensions": {
|
|
255
|
+
"types": "./dist/useDimensions.d.ts",
|
|
256
|
+
"import": "./dist/useDimensions.js"
|
|
257
|
+
},
|
|
258
|
+
"./useResizableDrawer": {
|
|
259
|
+
"types": "./dist/useResizableDrawer.d.ts",
|
|
260
|
+
"import": "./dist/useResizableDrawer.js"
|
|
261
|
+
},
|
|
262
|
+
"./toast": {
|
|
263
|
+
"types": "./dist/toast/index.d.ts",
|
|
264
|
+
"import": "./dist/toast/index.js"
|
|
265
|
+
},
|
|
266
|
+
"./dropdownMenu": {
|
|
267
|
+
"types": "./dist/dropdownMenu/index.d.ts",
|
|
268
|
+
"import": "./dist/dropdownMenu/index.js"
|
|
269
|
+
},
|
|
270
|
+
"./codeBlock": {
|
|
271
|
+
"types": "./dist/codeBlock/index.d.ts",
|
|
272
|
+
"import": "./dist/codeBlock/index.js"
|
|
273
|
+
},
|
|
274
|
+
"./code": {
|
|
275
|
+
"types": "./dist/code/index.d.ts",
|
|
276
|
+
"import": "./dist/code/index.js"
|
|
277
|
+
},
|
|
278
|
+
"./drawer": {
|
|
279
|
+
"types": "./dist/drawer/index.d.ts",
|
|
280
|
+
"import": "./dist/drawer/index.js"
|
|
281
|
+
},
|
|
282
|
+
"./slideOverPanel": {
|
|
283
|
+
"types": "./dist/slideOverPanel.d.ts",
|
|
284
|
+
"import": "./dist/slideOverPanel.js"
|
|
285
|
+
},
|
|
286
|
+
"./overlayContext": {
|
|
287
|
+
"types": "./dist/overlayContext.d.ts",
|
|
288
|
+
"import": "./dist/overlayContext.js"
|
|
289
|
+
},
|
|
290
|
+
"./select": {
|
|
291
|
+
"types": "./dist/select/index.d.ts",
|
|
292
|
+
"import": "./dist/select/index.js"
|
|
293
|
+
},
|
|
294
|
+
"./useVirtualRows": {
|
|
295
|
+
"types": "./dist/useVirtualRows.d.ts",
|
|
296
|
+
"import": "./dist/useVirtualRows.js"
|
|
297
|
+
},
|
|
298
|
+
"./useVirtualCollection": {
|
|
299
|
+
"types": "./dist/useVirtualCollection.d.ts",
|
|
300
|
+
"import": "./dist/useVirtualCollection.js"
|
|
301
|
+
},
|
|
302
|
+
"./modal": {
|
|
303
|
+
"types": "./dist/modal/index.d.ts",
|
|
304
|
+
"import": "./dist/modal/index.js"
|
|
305
|
+
},
|
|
306
|
+
"./clipboard": {
|
|
307
|
+
"types": "./dist/clipboard/index.d.ts",
|
|
308
|
+
"import": "./dist/clipboard/index.js"
|
|
309
|
+
},
|
|
310
|
+
"./compactSelect": {
|
|
311
|
+
"types": "./dist/compactSelect/index.d.ts",
|
|
312
|
+
"import": "./dist/compactSelect/index.js"
|
|
313
|
+
},
|
|
314
|
+
"./tabs": {
|
|
315
|
+
"types": "./dist/tabs/index.d.ts",
|
|
316
|
+
"import": "./dist/tabs/index.js"
|
|
317
|
+
},
|
|
318
|
+
"./pictureInPicture": {
|
|
319
|
+
"types": "./dist/pictureInPicture/index.d.ts",
|
|
320
|
+
"import": "./dist/pictureInPicture/index.js"
|
|
321
|
+
},
|
|
322
|
+
"./pagination": {
|
|
323
|
+
"types": "./dist/pagination/index.d.ts",
|
|
324
|
+
"import": "./dist/pagination/index.js"
|
|
217
325
|
}
|
|
218
326
|
},
|
|
219
327
|
"publishConfig": {
|
|
220
328
|
"access": "public"
|
|
221
329
|
},
|
|
222
330
|
"dependencies": {
|
|
331
|
+
"@emotion/cache": "^11.14.0",
|
|
223
332
|
"@emotion/is-prop-valid": "^1.4.0",
|
|
224
333
|
"@emotion/styled": "^11.14.0",
|
|
225
334
|
"@floating-ui/react-dom": "^2.1.9",
|
|
226
335
|
"@react-aria/button": "3.15.1",
|
|
227
336
|
"@react-aria/disclosure": "3.2.1",
|
|
337
|
+
"@react-aria/focus": "3.22.1",
|
|
338
|
+
"@react-aria/gridlist": "3.15.1",
|
|
228
339
|
"@react-aria/i18n": "3.13.1",
|
|
229
340
|
"@react-aria/interactions": "3.28.1",
|
|
341
|
+
"@react-aria/listbox": "3.16.1",
|
|
342
|
+
"@react-aria/menu": "3.22.1",
|
|
230
343
|
"@react-aria/numberfield": "3.13.1",
|
|
231
344
|
"@react-aria/overlays": "3.32.1",
|
|
232
345
|
"@react-aria/radio": "3.13.1",
|
|
346
|
+
"@react-aria/separator": "3.5.1",
|
|
233
347
|
"@react-aria/slider": "3.9.1",
|
|
348
|
+
"@react-aria/tabs": "3.12.1",
|
|
234
349
|
"@react-aria/utils": "3.34.1",
|
|
235
350
|
"@react-aria/visually-hidden": "3.9.1",
|
|
236
351
|
"@react-stately/collections": "3.13.1",
|
|
@@ -240,45 +355,62 @@
|
|
|
240
355
|
"@react-stately/overlays": "3.7.1",
|
|
241
356
|
"@react-stately/radio": "3.12.1",
|
|
242
357
|
"@react-stately/slider": "3.8.1",
|
|
358
|
+
"@react-stately/tabs": "3.9.1",
|
|
359
|
+
"@react-stately/tree": "3.10.1",
|
|
243
360
|
"@react-types/shared": "3.36.0",
|
|
244
361
|
"@sentry/icons": "0.1.0",
|
|
245
|
-
"@sentry/react": "11.
|
|
362
|
+
"@sentry/react": "11.12.0",
|
|
363
|
+
"@tanstack/react-hotkeys": "0.18.0",
|
|
364
|
+
"@tanstack/react-pacer": "^0.22.1",
|
|
365
|
+
"@tanstack/react-virtual": "3.14.6",
|
|
246
366
|
"@types/react": "19.3.0",
|
|
367
|
+
"@types/react-select": "4.0.18",
|
|
247
368
|
"classnames": "2.3.1",
|
|
369
|
+
"focus-trap": "8.2.2",
|
|
248
370
|
"framer-motion": "12.38.0",
|
|
249
371
|
"input-otp": "^1.5.0",
|
|
372
|
+
"prismjs": "^1.30.0",
|
|
250
373
|
"query-string": "7.0.1",
|
|
374
|
+
"react-error-boundary": "^6.1.6",
|
|
375
|
+
"react-select": "4.3.1",
|
|
251
376
|
"react-textarea-autosize": "8.5.7",
|
|
252
|
-
"
|
|
377
|
+
"sonner": "2.0.8",
|
|
378
|
+
"type-fest": "^5.10.0",
|
|
379
|
+
"zustand": "5.0.16"
|
|
253
380
|
},
|
|
254
381
|
"devDependencies": {
|
|
255
382
|
"@jest/environment": "30.5.1",
|
|
256
383
|
"@jest/environment-jsdom-abstract": "30.5.1",
|
|
257
384
|
"@rsbuild/plugin-react": "2.1.1",
|
|
258
|
-
"@rslib/core": "1.0.
|
|
259
|
-
"@swc/core": "1.16.
|
|
385
|
+
"@rslib/core": "1.0.6",
|
|
386
|
+
"@swc/core": "1.16.22",
|
|
260
387
|
"@swc/jest": "0.2.39",
|
|
261
388
|
"@tanstack/react-form": "1.28.6",
|
|
389
|
+
"@tanstack/react-query": "5.101.4",
|
|
262
390
|
"@testing-library/dom": "10.4.1",
|
|
263
391
|
"@testing-library/jest-dom": "7.0.1",
|
|
264
392
|
"@testing-library/react": "16.3.2",
|
|
265
393
|
"@testing-library/user-event": "14.6.7",
|
|
266
394
|
"@types/jest": "30.0.0",
|
|
267
395
|
"@types/node": "26.6.4",
|
|
396
|
+
"@types/prismjs": "^1.26.0",
|
|
268
397
|
"@types/react-dom": "19.3.0",
|
|
269
398
|
"expect-type": "1.4.0",
|
|
270
399
|
"jest": "30.5.1",
|
|
271
400
|
"jsdom": "30.1.1",
|
|
272
|
-
"oxlint": "1.
|
|
273
|
-
"oxlint-tsgolint": "7.0.
|
|
401
|
+
"oxlint": "1.90.0",
|
|
402
|
+
"oxlint-tsgolint": "7.0.2005",
|
|
274
403
|
"stylelint": "16.26.1",
|
|
275
|
-
"typescript": "npm:@typescript/typescript6@6.0.2"
|
|
404
|
+
"typescript": "npm:@typescript/typescript6@6.0.2",
|
|
405
|
+
"zod": "4.6.7"
|
|
276
406
|
},
|
|
277
407
|
"peerDependencies": {
|
|
278
408
|
"@emotion/react": "^11.14.0",
|
|
279
409
|
"@tanstack/react-form": "^1.28.6",
|
|
410
|
+
"@tanstack/react-query": "^5.101.4",
|
|
280
411
|
"react": "^19.0.0",
|
|
281
|
-
"react-dom": "^19.0.0"
|
|
412
|
+
"react-dom": "^19.0.0",
|
|
413
|
+
"zod": "^4.6.7"
|
|
282
414
|
},
|
|
283
415
|
"scripts": {
|
|
284
416
|
"build": "rslib build",
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { AutoSaveContextProvider, useAutoSaveContext } from './autoSaveContext.js';
|
|
2
|
-
export { DisplayField } from './displayField.js';
|
|
3
|
-
export { useFieldId, useHintTextId, useLabelId } from './fieldIds.js';
|
|
4
|
-
export { GroupProvider, useGroupItemContext, type GroupContextValue } from './groupContext.js';
|
|
5
|
-
export { FieldMeta } from './meta.js';
|
|
6
|
-
export { fieldContext, formContext, useFormContext, useFieldContext, FormElementContext, useIsInsideFormElement, } from './formContext.js';
|
|
7
|
-
export { Checkmark, Spinner } from './icons.js';
|
|
8
|
-
export { FieldLayout } from './fieldLayout.js';
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { AutoSaveContextProvider, useAutoSaveContext } from "./autoSaveContext.js";
|
|
2
|
-
export { DisplayField } from "./displayField.js";
|
|
3
|
-
export { useFieldId, useHintTextId, useLabelId } from "./fieldIds.js";
|
|
4
|
-
export { GroupProvider, useGroupItemContext } from "./groupContext.js";
|
|
5
|
-
export { FieldMeta } from "./meta.js";
|
|
6
|
-
export { FormElementContext, fieldContext, formContext, useFieldContext, useFormContext, useIsInsideFormElement } from "./formContext.js";
|
|
7
|
-
export { Checkmark, Spinner } from "./icons.js";
|
|
8
|
-
export { FieldLayout } from "./fieldLayout.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { InteractionStateLayer as default } from './interactionStateLayer.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { InteractionStateLayer as default } from "./interactionStateLayer.js";
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type * as React from 'react';
|
|
2
|
-
interface StateLayerProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
3
|
-
as?: React.ElementType;
|
|
4
|
-
color?: string;
|
|
5
|
-
/**
|
|
6
|
-
* Controls if the opacity is increased when the element is in a
|
|
7
|
-
* selected or expanded state (aria-selected='true' or aria-expanded='true')
|
|
8
|
-
*
|
|
9
|
-
* @default true
|
|
10
|
-
*/
|
|
11
|
-
hasSelectedBackground?: boolean;
|
|
12
|
-
higherOpacity?: boolean;
|
|
13
|
-
isHovered?: boolean;
|
|
14
|
-
isPressed?: boolean;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* use core components with built-in interaction states
|
|
18
|
-
* @deprecated
|
|
19
|
-
*/
|
|
20
|
-
export declare const InteractionStateLayer: import("@emotion/styled").StyledComponent<StateLayerProps & {
|
|
21
|
-
theme?: import("@emotion/react").Theme;
|
|
22
|
-
}, {}, {}>;
|
|
23
|
-
export {};
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import is_prop_valid from "@emotion/is-prop-valid";
|
|
3
|
-
import { css } from "@emotion/react";
|
|
4
|
-
import styled from "@emotion/styled";
|
|
5
|
-
function defined(value) {
|
|
6
|
-
return null != value;
|
|
7
|
-
}
|
|
8
|
-
const defaultProps = {
|
|
9
|
-
hasSelectedBackground: true
|
|
10
|
-
};
|
|
11
|
-
const InteractionStateLayer = styled((props)=>{
|
|
12
|
-
const { children, as: Element = 'span', ...rest } = props;
|
|
13
|
-
return /*#__PURE__*/ jsx(Element, {
|
|
14
|
-
...rest,
|
|
15
|
-
role: "presentation",
|
|
16
|
-
children: children
|
|
17
|
-
});
|
|
18
|
-
}, {
|
|
19
|
-
shouldForwardProp: (p)=>is_prop_valid(p) || 'as' === p
|
|
20
|
-
})`
|
|
21
|
-
position: absolute;
|
|
22
|
-
top: 50%;
|
|
23
|
-
left: 50%;
|
|
24
|
-
width: 100%;
|
|
25
|
-
height: 100%;
|
|
26
|
-
transform: translate(-50%, -50%);
|
|
27
|
-
|
|
28
|
-
box-sizing: content-box;
|
|
29
|
-
border-radius: inherit;
|
|
30
|
-
border: inherit;
|
|
31
|
-
color: ${(p)=>p.color ? p.theme[p.color] ?? p.color : 'currentcolor'};
|
|
32
|
-
background-color: currentcolor;
|
|
33
|
-
border-color: currentcolor;
|
|
34
|
-
pointer-events: none;
|
|
35
|
-
|
|
36
|
-
opacity: 0;
|
|
37
|
-
|
|
38
|
-
${(p)=>defined(p.isHovered) ? p.isHovered && css`
|
|
39
|
-
opacity: ${p.higherOpacity ? 0.085 : 0.06};
|
|
40
|
-
` : css`
|
|
41
|
-
*:hover:not(:focus-visible) > & {
|
|
42
|
-
opacity: ${p.higherOpacity ? 0.085 : 0.06};
|
|
43
|
-
}
|
|
44
|
-
`}
|
|
45
|
-
|
|
46
|
-
${(p)=>defined(p.isPressed) ? p.isPressed && css`
|
|
47
|
-
&&& {
|
|
48
|
-
opacity: ${p.higherOpacity ? 0.12 : 0.09};
|
|
49
|
-
}
|
|
50
|
-
` : css`
|
|
51
|
-
*:active > && {
|
|
52
|
-
opacity: ${p.higherOpacity ? 0.12 : 0.09};
|
|
53
|
-
}
|
|
54
|
-
${(p.hasSelectedBackground ?? defaultProps.hasSelectedBackground) && css`
|
|
55
|
-
*[aria-expanded='true'] > &&,
|
|
56
|
-
*[aria-selected='true'] > && {
|
|
57
|
-
opacity: ${p.higherOpacity ? 0.12 : 0.09};
|
|
58
|
-
}
|
|
59
|
-
`}
|
|
60
|
-
`}
|
|
61
|
-
|
|
62
|
-
*:disabled &&,
|
|
63
|
-
*[aria-disabled='true'] && {
|
|
64
|
-
opacity: 0;
|
|
65
|
-
}
|
|
66
|
-
`;
|
|
67
|
-
export { InteractionStateLayer };
|
package/dist/unreachable.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function unreachable(value: never): never;
|
package/dist/unreachable.js
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|