react-science 16.1.0 → 18.0.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/lib/components/accordion/accordion.d.ts +12 -1
- package/lib/components/accordion/accordion.d.ts.map +1 -1
- package/lib/components/accordion/accordion.js +12 -8
- package/lib/components/accordion/accordion.js.map +1 -1
- package/lib/components/accordion/accordion_context.d.ts +7 -13
- package/lib/components/accordion/accordion_context.d.ts.map +1 -1
- package/lib/components/accordion/accordion_context.js +4 -2
- package/lib/components/accordion/accordion_context.js.map +1 -1
- package/lib/components/accordion/accordion_context_provider.js.map +1 -1
- package/lib/components/accordion/accordion_context_utils.d.ts +7 -4
- package/lib/components/accordion/accordion_context_utils.d.ts.map +1 -1
- package/lib/components/accordion/accordion_context_utils.js.map +1 -1
- package/lib/components/accordion/index.d.ts +1 -0
- package/lib/components/accordion/index.d.ts.map +1 -1
- package/lib/components/fullscreen/fullscreen_context.provider.d.ts +14 -5
- package/lib/components/fullscreen/fullscreen_context.provider.d.ts.map +1 -1
- package/lib/components/fullscreen/fullscreen_context.provider.js +20 -56
- package/lib/components/fullscreen/fullscreen_context.provider.js.map +1 -1
- package/lib/components/pdnd.cjs +29 -0
- package/lib/components/pdnd.cjs.map +1 -0
- package/lib/components/pdnd.d.cts +10 -0
- package/lib/components/pdnd.d.cts.map +1 -0
- package/lib/components/root-layout/css-reset/customPreflight.d.ts.map +1 -1
- package/lib/components/root-layout/css-reset/customPreflight.js +6 -0
- package/lib/components/root-layout/css-reset/customPreflight.js.map +1 -1
- package/lib/components/root-layout/root_layout.d.ts +3 -1
- package/lib/components/root-layout/root_layout.d.ts.map +1 -1
- package/lib/components/root-layout/root_layout.js +12 -5
- package/lib/components/root-layout/root_layout.js.map +1 -1
- package/lib/components/table/reorder_rows/draggable_row_tr.d.ts.map +1 -1
- package/lib/components/table/reorder_rows/draggable_row_tr.js +1 -5
- package/lib/components/table/reorder_rows/draggable_row_tr.js.map +1 -1
- package/lib/components/table/reorder_rows/item_order_provider.d.ts.map +1 -1
- package/lib/components/table/reorder_rows/item_order_provider.js +1 -2
- package/lib/components/table/reorder_rows/item_order_provider.js.map +1 -1
- package/lib/components/table/reorder_rows/use_drop_monitor.d.ts.map +1 -1
- package/lib/components/table/reorder_rows/use_drop_monitor.js +1 -4
- package/lib/components/table/reorder_rows/use_drop_monitor.js.map +1 -1
- package/package.json +2 -1
- package/src/components/accordion/accordion.tsx +33 -9
- package/src/components/accordion/accordion_context.ts +13 -10
- package/src/components/accordion/accordion_context_provider.tsx +3 -3
- package/src/components/accordion/accordion_context_utils.ts +7 -4
- package/src/components/accordion/index.ts +3 -0
- package/src/components/fullscreen/fullscreen_context.provider.tsx +37 -81
- package/src/components/pdnd.cts +20 -0
- package/src/components/root-layout/css-reset/customPreflight.ts +6 -0
- package/src/components/root-layout/root_layout.tsx +34 -19
- package/src/components/table/reorder_rows/draggable_row_tr.tsx +9 -11
- package/src/components/table/reorder_rows/item_order_provider.tsx +2 -2
- package/src/components/table/reorder_rows/use_drop_monitor.ts +6 -4
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import type { ReactElement, ReactNode } from 'react';
|
|
2
|
+
import type { AccordionItemControls } from './accordion_context_utils.js';
|
|
2
3
|
export interface AccordionProps<T extends string = string> {
|
|
3
4
|
children?: Array<ReactElement<AccordionItemProps<T>>> | ReactElement<AccordionItemProps<T>> | boolean | null;
|
|
4
5
|
}
|
|
6
|
+
export interface AccordionRenderToolbarProps<T extends string = string> {
|
|
7
|
+
id: T;
|
|
8
|
+
isOpen: boolean;
|
|
9
|
+
controls: AccordionItemControls;
|
|
10
|
+
}
|
|
5
11
|
export interface AccordionItemProps<T extends string = string> {
|
|
6
12
|
/**
|
|
7
13
|
* A value uniquely identifying the accordion item.
|
|
@@ -33,7 +39,12 @@ export interface AccordionItemProps<T extends string = string> {
|
|
|
33
39
|
* When not set or set to false, the item's children will be rendered but hidden when the item is closed.
|
|
34
40
|
*/
|
|
35
41
|
unmountChildren?: boolean;
|
|
36
|
-
|
|
42
|
+
/**
|
|
43
|
+
* A custom render function to display in the toolbar on the right of the accordion item.
|
|
44
|
+
* Click events will not be propagated down to the accordion item to prevent it from opening/closing.
|
|
45
|
+
* @param data
|
|
46
|
+
*/
|
|
47
|
+
renderToolbar?: (renderProps: AccordionRenderToolbarProps<T>) => ReactNode;
|
|
37
48
|
}
|
|
38
49
|
export declare function Accordion<T extends string = string>(props: AccordionProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
39
50
|
export declare namespace Accordion {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion.d.ts","sourceRoot":"","sources":["../../../src/components/accordion/accordion.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAEV,YAAY,EACZ,SAAS,EACV,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"accordion.d.ts","sourceRoot":"","sources":["../../../src/components/accordion/accordion.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAEV,YAAY,EACZ,SAAS,EACV,MAAM,OAAO,CAAC;AAIf,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAE1E,MAAM,WAAW,cAAc,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IACvD,QAAQ,CAAC,EACL,KAAK,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,GAC1C,YAAY,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,GACnC,OAAO,GACP,IAAI,CAAC;CACV;AAED,MAAM,WAAW,2BAA2B,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IACpE,EAAE,EAAE,CAAC,CAAC;IACN,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,qBAAqB,CAAC;CACjC;AAED,MAAM,WAAW,kBAAkB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IAC3D;;OAEG;IACH,EAAE,EAAE,CAAC,CAAC;IACN;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,SAAS,CAAC;IACpB;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;OAIG;IACH,aAAa,CAAC,EAAE,CAAC,WAAW,EAAE,2BAA2B,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC;CAC5E;AAkCD,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC,2CAE5E;yBAFe,SAAS;eAIe,CAAC,SAAS,MAAM,kBAC/C,kBAAkB,CAAC,CAAC,CAAC"}
|
|
@@ -2,8 +2,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Colors } from '@blueprintjs/core';
|
|
3
3
|
import styled from '@emotion/styled';
|
|
4
4
|
import { useControllableState } from '@radix-ui/react-use-controllable-state';
|
|
5
|
-
import { useCallback } from 'react';
|
|
6
|
-
import {
|
|
5
|
+
import { useCallback, useRef } from 'react';
|
|
6
|
+
import { useAccordionItemContext } from './accordion_context.js';
|
|
7
7
|
const AccordionItemHeader = styled.div `
|
|
8
8
|
cursor: pointer;
|
|
9
9
|
display: flex;
|
|
@@ -44,26 +44,27 @@ Accordion.Item = function AccordionItem(props) {
|
|
|
44
44
|
defaultProp: defaultOpen,
|
|
45
45
|
onChange: onOpenChange,
|
|
46
46
|
});
|
|
47
|
-
const {
|
|
47
|
+
const { controls, unmountChildren } = useAccordionItemContext(id, setIsOpen);
|
|
48
|
+
const headerRef = useRef(null);
|
|
48
49
|
const shouldUnmountChildren = props.unmountChildren === undefined
|
|
49
50
|
? unmountChildren
|
|
50
51
|
: props.unmountChildren;
|
|
51
52
|
const onClickHandle = useCallback((event) => {
|
|
52
53
|
if (event.shiftKey) {
|
|
53
|
-
|
|
54
|
+
controls.closeOthers();
|
|
54
55
|
}
|
|
55
56
|
else {
|
|
56
|
-
|
|
57
|
+
controls.toggle();
|
|
57
58
|
}
|
|
58
|
-
}, [
|
|
59
|
+
}, [controls]);
|
|
59
60
|
return (_jsxs("div", { style: {
|
|
60
61
|
flex: isOpen ? '1 1 1px' : 'none',
|
|
61
62
|
display: 'flex',
|
|
62
63
|
flexDirection: 'column',
|
|
63
64
|
isolation: 'isolate',
|
|
64
|
-
}, children: [_jsxs(AccordionItemHeader, { onClick: onClickHandle, role: "button", children: [_jsx("div", { style: {
|
|
65
|
+
}, children: [_jsxs(AccordionItemHeader, { onClick: onClickHandle, role: "button", ref: headerRef, children: [_jsx("div", { style: {
|
|
65
66
|
padding: '5px 0px',
|
|
66
|
-
}, children: title }), renderToolbar?.(isOpen ?? false)] }), !isOpen && shouldUnmountChildren ? null : (_jsx("div", { style: {
|
|
67
|
+
}, children: title }), _jsx(ToolbarContainer, { onClick: (event) => event.stopPropagation(), children: renderToolbar?.({ id, isOpen: isOpen ?? false, controls }) })] }), !isOpen && shouldUnmountChildren ? null : (_jsx("div", { style: {
|
|
67
68
|
display: isOpen ? 'flex' : 'none',
|
|
68
69
|
flex: isOpen ? '1 1 1px' : 'none',
|
|
69
70
|
backgroundColor: 'white',
|
|
@@ -77,4 +78,7 @@ Accordion.Item = function AccordionItem(props) {
|
|
|
77
78
|
flexDirection: 'column',
|
|
78
79
|
}, children: children }) }))] }));
|
|
79
80
|
};
|
|
81
|
+
const ToolbarContainer = styled.div `
|
|
82
|
+
display: flex;
|
|
83
|
+
`;
|
|
80
84
|
//# sourceMappingURL=accordion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion.js","sourceRoot":"","sources":["../../../src/components/accordion/accordion.tsx"],"names":[],"mappings":";AAAA,OAAO,E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AM,CAAC,CAAC,CAAC,MAAM;oBACjC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM;oBACjC,eAAe,EAAE,OAAO;oBACxB,SAAS,EAAE,MAAM;oBACjB,QAAQ,EAAE,QAAQ;iBACnB,YAED,cACE,KAAK,EAAE;wBACL,MAAM,EAAE,MAAM;wBACd,KAAK,EAAE,MAAM;wBACb,QAAQ,EAAE,MAAM;wBAChB,OAAO,EAAE,MAAM;wBACf,aAAa,EAAE,QAAQ;qBACxB,YAEA,QAAQ,GACL,GACF,CACP,IACG,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAA;;CAElC,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export type
|
|
3
|
-
|
|
1
|
+
import type { AccordionItemContextValue, AccordionItemSetIsOpen } from './accordion_context_utils.js';
|
|
2
|
+
export type AccordionContextValue = [
|
|
3
|
+
{
|
|
4
|
+
unmountChildren: boolean;
|
|
5
|
+
},
|
|
4
6
|
{
|
|
5
7
|
closeAllExcept: (except: string) => void;
|
|
6
8
|
toggle: (id: string) => void;
|
|
@@ -9,14 +11,6 @@ export type ContextType = [
|
|
|
9
11
|
change: (id: string, isOpen: boolean) => void;
|
|
10
12
|
}
|
|
11
13
|
];
|
|
12
|
-
|
|
13
|
-
export declare
|
|
14
|
-
export declare function useAccordionContext(id: string, setIsOpen: AccordionItemSetIsOpen): {
|
|
15
|
-
unmountChildren: boolean;
|
|
16
|
-
utils: {
|
|
17
|
-
closeOthers: () => void;
|
|
18
|
-
toggle: () => void;
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
export {};
|
|
14
|
+
export declare const accordionContext: import("react").Context<AccordionContextValue | null>;
|
|
15
|
+
export declare function useAccordionItemContext(id: string, setIsOpen: AccordionItemSetIsOpen): AccordionItemContextValue;
|
|
22
16
|
//# sourceMappingURL=accordion_context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion_context.d.ts","sourceRoot":"","sources":["../../../src/components/accordion/accordion_context.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,
|
|
1
|
+
{"version":3,"file":"accordion_context.d.ts","sourceRoot":"","sources":["../../../src/components/accordion/accordion_context.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,yBAAyB,EACzB,sBAAsB,EACvB,MAAM,8BAA8B,CAAC;AAEtC,MAAM,MAAM,qBAAqB,GAAG;IAClC;QACE,eAAe,EAAE,OAAO,CAAC;KAC1B;IACD;QACE,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;QACzC,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;QAC7B,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;QACjC,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,sBAAsB,KAAK,IAAI,CAAC;QAClE,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;KAC/C;CACF,CAAC;AACF,eAAO,MAAM,gBAAgB,uDAE5B,CAAC;AAEF,wBAAgB,uBAAuB,CACrC,EAAE,EAAE,MAAM,EACV,SAAS,EAAE,sBAAsB,GAChC,yBAAyB,CA0B3B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createContext, useContext, useEffect, useMemo } from 'react';
|
|
2
2
|
export const accordionContext = createContext(null);
|
|
3
|
-
export function
|
|
3
|
+
export function useAccordionItemContext(id, setIsOpen) {
|
|
4
4
|
const context = useContext(accordionContext);
|
|
5
5
|
if (!context) {
|
|
6
6
|
throw new Error('AccordionContext was not found');
|
|
@@ -12,9 +12,11 @@ export function useAccordionContext(id, setIsOpen) {
|
|
|
12
12
|
}, [id, utils, setIsOpen]);
|
|
13
13
|
return useMemo(() => ({
|
|
14
14
|
unmountChildren: state.unmountChildren,
|
|
15
|
-
|
|
15
|
+
controls: {
|
|
16
16
|
closeOthers: () => utils.closeAllExcept(id),
|
|
17
17
|
toggle: () => utils.toggle(id),
|
|
18
|
+
open: () => utils.change(id, true),
|
|
19
|
+
close: () => utils.change(id, false),
|
|
18
20
|
},
|
|
19
21
|
}), [id, utils, state.unmountChildren]);
|
|
20
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion_context.js","sourceRoot":"","sources":["../../../src/components/accordion/accordion_context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"accordion_context.js","sourceRoot":"","sources":["../../../src/components/accordion/accordion_context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAmBtE,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAC3C,IAAI,CACL,CAAC;AAEF,MAAM,UAAU,uBAAuB,CACrC,EAAU,EACV,SAAiC;IAEjC,MAAM,OAAO,GAAG,UAAU,CAAC,gBAAgB,CAAC,CAAC;IAE7C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;IACpD,CAAC;IAED,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,OAAO,CAAC;IAE/B,SAAS,CAAC,GAAG,EAAE;QACb,KAAK,CAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;QAC9B,OAAO,GAAG,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;IACpC,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC;IAE3B,OAAO,OAAO,CACZ,GAAG,EAAE,CAAC,CAAC;QACL,eAAe,EAAE,KAAK,CAAC,eAAe;QACtC,QAAQ,EAAE;YACR,WAAW,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,EAAE,CAAC;YAC3C,MAAM,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;YAC9B,IAAI,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC;YAClC,KAAK,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC;SACrC;KACF,CAAC,EACF,CAAC,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,eAAe,CAAC,CACnC,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion_context_provider.js","sourceRoot":"","sources":["../../../src/components/accordion/accordion_context_provider.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAG3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAOpE,MAAM,UAAU,iBAAiB,CAAC,KAA6B;IAC7D,MAAM,EAAE,eAAe,GAAG,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IACpD,MAAM,WAAW,GAAG,MAAM,CAAC,oBAAoB,EAAE,CAAC,CAAC;IAEnD,MAAM,KAAK,GAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"accordion_context_provider.js","sourceRoot":"","sources":["../../../src/components/accordion/accordion_context_provider.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,MAAM,EAA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C,IAAI,IAAI,EAAE,CAAC;oBACT,IAAI,CAAC,SAAS,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC;gBAC5C,CAAC;YACH,CAAC;YACD,UAAU,EAAE,CAAC,EAAU,EAAE,EAAE;gBACzB,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;gBAC5B,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;YACjC,CAAC;YACD,QAAQ,EAAE,CAAC,EAAU,EAAE,SAAiC,EAAE,EAAE;gBAC1D,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;gBAC5B,MAAM,IAAI,GAAG,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;gBACzC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;oBACvB,MAAM,IAAI,KAAK,CACb,8BAA8B,EAAE,4EAA4E,CAC7G,CAAC;gBACJ,CAAC;gBACD,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE;oBAC1B,SAAS;iBACV,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;IAElB,MAAM,YAAY,GAAG,OAAO,CAAwB,GAAG,EAAE;QACvD,OAAO;YACL;gBACE,eAAe;aAChB;YACD,KAAK;SACN,CAAC;IACJ,CAAC,EAAE,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC,CAAC;IAE7B,OAAO,CACL,KAAC,gBAAgB,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,YAC3C,QAAQ,GACiB,CAC7B,CAAC;AACJ,CAAC"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import type { Dispatch, SetStateAction } from 'react';
|
|
2
|
-
export interface
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
export interface AccordionItemControls {
|
|
3
|
+
closeOthers: () => void;
|
|
4
|
+
toggle: () => void;
|
|
5
|
+
open: () => void;
|
|
6
|
+
close: () => void;
|
|
5
7
|
}
|
|
6
|
-
export interface
|
|
8
|
+
export interface AccordionItemContextValue {
|
|
7
9
|
unmountChildren: boolean;
|
|
10
|
+
controls: AccordionItemControls;
|
|
8
11
|
}
|
|
9
12
|
export type AccordionItemSetIsOpen = Dispatch<SetStateAction<boolean | undefined>>;
|
|
10
13
|
interface AccordionRegisteredItem {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion_context_utils.d.ts","sourceRoot":"","sources":["../../../src/components/accordion/accordion_context_utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEtD,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"accordion_context_utils.d.ts","sourceRoot":"","sources":["../../../src/components/accordion/accordion_context_utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEtD,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,MAAM,WAAW,yBAAyB;IACxC,eAAe,EAAE,OAAO,CAAC;IACzB,QAAQ,EAAE,qBAAqB,CAAC;CACjC;AAED,MAAM,MAAM,sBAAsB,GAAG,QAAQ,CAC3C,cAAc,CAAC,OAAO,GAAG,SAAS,CAAC,CACpC,CAAC;AAEF,UAAU,uBAAuB;IAC/B,SAAS,EAAE,sBAAsB,CAAC;CACnC;AAED,wBAAgB,oBAAoB,yCAEnC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion_context_utils.js","sourceRoot":"","sources":["../../../src/components/accordion/accordion_context_utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"accordion_context_utils.js","sourceRoot":"","sources":["../../../src/components/accordion/accordion_context_utils.ts"],"names":[],"mappings":"AAsBA,MAAM,UAAU,oBAAoB;IAClC,OAAO,IAAI,GAAG,EAAmC,CAAC;AACpD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/accordion/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iCAAiC,CAAC;AAChD,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/accordion/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iCAAiC,CAAC;AAChD,cAAc,sBAAsB,CAAC;AAGrC,YAAY,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -1,7 +1,16 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
interface
|
|
3
|
-
|
|
1
|
+
import type { MutableRefObject, ReactNode } from 'react';
|
|
2
|
+
export interface FullscreenProviderProps {
|
|
3
|
+
/**
|
|
4
|
+
* Callback providing the ref which should be passed to the element that can be displayed fullscreen.
|
|
5
|
+
* @param ref
|
|
6
|
+
*/
|
|
7
|
+
children: (ref: MutableRefObject<HTMLDivElement | null>) => ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Callback which will be called in case toggling results in an error.
|
|
10
|
+
* @param error - The error that happened. Value is not necessarily an instance of `Error` and may even be `undefined`.
|
|
11
|
+
* @param step - Indicates if the error happened when entering or exiting the full screen.
|
|
12
|
+
*/
|
|
13
|
+
onToggleError?: (error: unknown, step: 'enter' | 'exit') => void;
|
|
4
14
|
}
|
|
5
|
-
export declare function FullScreenProvider(props:
|
|
6
|
-
export {};
|
|
15
|
+
export declare function FullScreenProvider(props: FullscreenProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
7
16
|
//# sourceMappingURL=fullscreen_context.provider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fullscreen_context.provider.d.ts","sourceRoot":"","sources":["../../../src/components/fullscreen/fullscreen_context.provider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fullscreen_context.provider.d.ts","sourceRoot":"","sources":["../../../src/components/fullscreen/fullscreen_context.provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMzD,MAAM,WAAW,uBAAuB;IACtC;;;OAGG;IACH,QAAQ,EAAE,CAAC,GAAG,EAAE,gBAAgB,CAAC,cAAc,GAAG,IAAI,CAAC,KAAK,SAAS,CAAC;IACtE;;;;OAIG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,GAAG,MAAM,KAAK,IAAI,CAAC;CAClE;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,2CA4BhE"}
|
|
@@ -1,64 +1,28 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { useFullScreenHandle } from 'react-full-screen';
|
|
4
|
+
import { fullscreenContext } from './fullscreen_context.js';
|
|
4
5
|
export function FullScreenProvider(props) {
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const ref = useRef(null);
|
|
13
|
-
useEffect(() => {
|
|
14
|
-
function onFullscreenChange() {
|
|
15
|
-
const document = window.document;
|
|
16
|
-
const value = Boolean(document.fullscreenElement || document.webkitFullscreenElement);
|
|
17
|
-
if (!value && isFullScreen)
|
|
18
|
-
toggle();
|
|
19
|
-
}
|
|
20
|
-
const div = ref.current;
|
|
21
|
-
if (!div) {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
div.addEventListener('fullscreenchange', onFullscreenChange);
|
|
25
|
-
div.addEventListener('webkitfullscreenchange', onFullscreenChange);
|
|
26
|
-
return () => {
|
|
27
|
-
div.removeEventListener('fullscreenchange', onFullscreenChange);
|
|
28
|
-
div.removeEventListener('webkitfullscreenchange', onFullscreenChange);
|
|
29
|
-
};
|
|
30
|
-
}, [isFullScreen, toggle]);
|
|
31
|
-
useEffect(() => {
|
|
32
|
-
if (isFullScreen && ref.current) {
|
|
33
|
-
if (ref.current.requestFullscreen) {
|
|
34
|
-
ref.current.requestFullscreen().catch(() => {
|
|
35
|
-
window.alert('Fullscreen is not supported');
|
|
36
|
-
});
|
|
6
|
+
const { children, onToggleError } = props;
|
|
7
|
+
const handle = useFullScreenHandle();
|
|
8
|
+
const value = useMemo(() => {
|
|
9
|
+
function toggle() {
|
|
10
|
+
const handleToggle = handle.active ? handle.exit : handle.enter;
|
|
11
|
+
function handleError(error) {
|
|
12
|
+
onToggleError?.(error, handle.active ? 'exit' : 'enter');
|
|
37
13
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
window.alert('Fullscreen is not supported');
|
|
41
|
-
});
|
|
14
|
+
try {
|
|
15
|
+
handleToggle().catch(handleError);
|
|
42
16
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
if (!isFullScreen && document.fullscreenElement) {
|
|
46
|
-
if (document.exitFullscreen) {
|
|
47
|
-
document.exitFullscreen().catch(() => {
|
|
48
|
-
window.alert("Can't exit fullscreen");
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
else if (document.webkitExitFullscreen) {
|
|
52
|
-
document.webkitExitFullscreen().catch(() => {
|
|
53
|
-
window.alert("Can't exit fullscreen");
|
|
54
|
-
});
|
|
17
|
+
catch (error) {
|
|
18
|
+
handleError(error);
|
|
55
19
|
}
|
|
56
20
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
21
|
+
return {
|
|
22
|
+
isFullScreen: handle.active,
|
|
23
|
+
toggle,
|
|
24
|
+
};
|
|
25
|
+
}, [handle, onToggleError]);
|
|
26
|
+
return (_jsx(fullscreenContext.Provider, { value: value, children: children(handle.node) }));
|
|
63
27
|
}
|
|
64
28
|
//# sourceMappingURL=fullscreen_context.provider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fullscreen_context.provider.js","sourceRoot":"","sources":["../../../src/components/fullscreen/fullscreen_context.provider.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"fullscreen_context.provider.js","sourceRoot":"","sources":["../../../src/components/fullscreen/fullscreen_context.provider.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAgB5D,MAAM,UAAU,kBAAkB,CAAC,KAA8B;IAC/D,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,KAAK,CAAC;IAE1C,MAAM,MAAM,GAAG,mBAAmB,EAAE,CAAC;IAErC,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,EAAE;QACzB,SAAS,MAAM;YACb,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;YAChE,SAAS,WAAW,CAAC,KAAc;gBACjC,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;YAC3D,CAAC;YACD,IAAI,CAAC;gBACH,YAAY,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;YACpC,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,WAAW,CAAC,KAAK,CAAC,CAAC;YACrB,CAAC;QACH,CAAC;QACD,OAAO;YACL,YAAY,EAAE,MAAM,CAAC,MAAM;YAC3B,MAAM;SACP,CAAC;IACJ,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC;IAE5B,OAAO,CACL,KAAC,iBAAiB,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YACrC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,GACK,CAC9B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getReorderDestinationIndex = exports.attachClosestEdge = exports.extractClosestEdge = exports.autoScrollForElements = exports.monitorForElements = exports.dropTargetForElements = exports.draggable = exports.reorder = exports.combine = exports.setCustomNativeDragPreview = exports.pointerOutsideOfPreview = void 0;
|
|
4
|
+
// https://github.com/atlassian/pragmatic-drag-and-drop/issues/27
|
|
5
|
+
// Given how `@atlaskit/pragmatic-drag-and-drop` publishes ESM in a non-native way,
|
|
6
|
+
// we have to trick TS into using the CJS build so that our build is compatible
|
|
7
|
+
// with native ESM.
|
|
8
|
+
// We cannot use `verbatimModuleSyntax` ts config option with this pattern.
|
|
9
|
+
var pointer_outside_of_preview_1 = require("@atlaskit/pragmatic-drag-and-drop/element/pointer-outside-of-preview");
|
|
10
|
+
Object.defineProperty(exports, "pointerOutsideOfPreview", { enumerable: true, get: function () { return pointer_outside_of_preview_1.pointerOutsideOfPreview; } });
|
|
11
|
+
var set_custom_native_drag_preview_1 = require("@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview");
|
|
12
|
+
Object.defineProperty(exports, "setCustomNativeDragPreview", { enumerable: true, get: function () { return set_custom_native_drag_preview_1.setCustomNativeDragPreview; } });
|
|
13
|
+
var combine_1 = require("@atlaskit/pragmatic-drag-and-drop/combine");
|
|
14
|
+
Object.defineProperty(exports, "combine", { enumerable: true, get: function () { return combine_1.combine; } });
|
|
15
|
+
var reorder_1 = require("@atlaskit/pragmatic-drag-and-drop/reorder");
|
|
16
|
+
Object.defineProperty(exports, "reorder", { enumerable: true, get: function () { return reorder_1.reorder; } });
|
|
17
|
+
var adapter_1 = require("@atlaskit/pragmatic-drag-and-drop/element/adapter");
|
|
18
|
+
Object.defineProperty(exports, "draggable", { enumerable: true, get: function () { return adapter_1.draggable; } });
|
|
19
|
+
Object.defineProperty(exports, "dropTargetForElements", { enumerable: true, get: function () { return adapter_1.dropTargetForElements; } });
|
|
20
|
+
var adapter_2 = require("@atlaskit/pragmatic-drag-and-drop/element/adapter");
|
|
21
|
+
Object.defineProperty(exports, "monitorForElements", { enumerable: true, get: function () { return adapter_2.monitorForElements; } });
|
|
22
|
+
var element_1 = require("@atlaskit/pragmatic-drag-and-drop-auto-scroll/element");
|
|
23
|
+
Object.defineProperty(exports, "autoScrollForElements", { enumerable: true, get: function () { return element_1.autoScrollForElements; } });
|
|
24
|
+
var closest_edge_1 = require("@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge");
|
|
25
|
+
Object.defineProperty(exports, "extractClosestEdge", { enumerable: true, get: function () { return closest_edge_1.extractClosestEdge; } });
|
|
26
|
+
Object.defineProperty(exports, "attachClosestEdge", { enumerable: true, get: function () { return closest_edge_1.attachClosestEdge; } });
|
|
27
|
+
var get_reorder_destination_index_1 = require("@atlaskit/pragmatic-drag-and-drop-hitbox/util/get-reorder-destination-index");
|
|
28
|
+
Object.defineProperty(exports, "getReorderDestinationIndex", { enumerable: true, get: function () { return get_reorder_destination_index_1.getReorderDestinationIndex; } });
|
|
29
|
+
//# sourceMappingURL=pdnd.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pdnd.cjs","sourceRoot":"","sources":["../../src/components/pdnd.cts"],"names":[],"mappings":";;;AAAA,iEAAiE;AACjE,mFAAmF;AACnF,+EAA+E;AAC/E,mBAAmB;AACnB,2EAA2E;AAC3E,mHAA+G;AAAtG,qIAAA,uBAAuB,OAAA;AAChC,2HAAsH;AAA7G,4IAAA,0BAA0B,OAAA;AACnC,qEAAoE;AAA3D,kGAAA,OAAO,OAAA;AAChB,qEAAoE;AAA3D,kGAAA,OAAO,OAAA;AAChB,6EAG2D;AAFzD,oGAAA,SAAS,OAAA;AACT,gHAAA,qBAAqB,OAAA;AAEvB,6EAAuF;AAA9E,6GAAA,kBAAkB,OAAA;AAC3B,iFAA8F;AAArF,gHAAA,qBAAqB,OAAA;AAC9B,sFAG+D;AAF7D,kHAAA,kBAAkB,OAAA;AAClB,iHAAA,iBAAiB,OAAA;AAEnB,6HAAyH;AAAhH,2IAAA,0BAA0B,OAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { pointerOutsideOfPreview } from '@atlaskit/pragmatic-drag-and-drop/element/pointer-outside-of-preview';
|
|
2
|
+
export { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';
|
|
3
|
+
export { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';
|
|
4
|
+
export { reorder } from '@atlaskit/pragmatic-drag-and-drop/reorder';
|
|
5
|
+
export { draggable, dropTargetForElements, } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
|
|
6
|
+
export { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
|
|
7
|
+
export { autoScrollForElements } from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/element';
|
|
8
|
+
export { extractClosestEdge, attachClosestEdge, } from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';
|
|
9
|
+
export { getReorderDestinationIndex } from '@atlaskit/pragmatic-drag-and-drop-hitbox/util/get-reorder-destination-index';
|
|
10
|
+
//# sourceMappingURL=pdnd.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pdnd.d.cts","sourceRoot":"","sources":["../../src/components/pdnd.cts"],"names":[],"mappings":"AAKA,OAAO,EAAE,uBAAuB,EAAE,MAAM,sEAAsE,CAAC;AAC/G,OAAO,EAAE,0BAA0B,EAAE,MAAM,0EAA0E,CAAC;AACtH,OAAO,EAAE,OAAO,EAAE,MAAM,2CAA2C,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,2CAA2C,CAAC;AACpE,OAAO,EACL,SAAS,EACT,qBAAqB,GACtB,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,mDAAmD,CAAC;AACvF,OAAO,EAAE,qBAAqB,EAAE,MAAM,uDAAuD,CAAC;AAC9F,OAAO,EACL,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,uDAAuD,CAAC;AAC/D,OAAO,EAAE,0BAA0B,EAAE,MAAM,6EAA6E,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customPreflight.d.ts","sourceRoot":"","sources":["../../../../src/components/root-layout/css-reset/customPreflight.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,kBAAkB;;SAsBtB,MAAO,
|
|
1
|
+
{"version":3,"file":"customPreflight.d.ts","sourceRoot":"","sources":["../../../../src/components/root-layout/css-reset/customPreflight.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,kBAAkB;;SAsBtB,MAAO,WAEZ;yGAKH,CAAC"}
|
|
@@ -23,5 +23,11 @@ export const CustomDivPreflight = styled.div `
|
|
|
23
23
|
width: 100%;
|
|
24
24
|
height: 100%;
|
|
25
25
|
position: relative;
|
|
26
|
+
|
|
27
|
+
&:fullscreen::backdrop,
|
|
28
|
+
*:fullscreen::backdrop {
|
|
29
|
+
/* Override user agent default */
|
|
30
|
+
background-color: white;
|
|
31
|
+
}
|
|
26
32
|
`;
|
|
27
33
|
//# sourceMappingURL=customPreflight.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customPreflight.js","sourceRoot":"","sources":["../../../../src/components/root-layout/css-reset/customPreflight.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,qFAAqF;AACrF,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"customPreflight.js","sourceRoot":"","sources":["../../../../src/components/root-layout/css-reset/customPreflight.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,qFAAqF;AACrF,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6B3C,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import type { FullscreenProviderProps } from '../fullscreen/index.js';
|
|
2
3
|
interface RootLayoutProps {
|
|
3
|
-
style?: CSSProperties;
|
|
4
4
|
children: ReactNode;
|
|
5
|
+
style?: CSSProperties;
|
|
6
|
+
onFullscreenToggleError?: FullscreenProviderProps['onToggleError'];
|
|
5
7
|
}
|
|
6
8
|
export declare function RootLayout(props: RootLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
7
9
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"root_layout.d.ts","sourceRoot":"","sources":["../../../src/components/root-layout/root_layout.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"root_layout.d.ts","sourceRoot":"","sources":["../../../src/components/root-layout/root_layout.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAoB,SAAS,EAAE,MAAM,OAAO,CAAC;AAIxE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAQtE,UAAU,eAAe;IACvB,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,uBAAuB,CAAC,EAAE,uBAAuB,CAAC,eAAe,CAAC,CAAC;CACpE;AAUD,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,2CAyChD"}
|
|
@@ -2,6 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { BlueprintProvider, FocusStyleManager } from '@blueprintjs/core';
|
|
3
3
|
import { useCallback, useState } from 'react';
|
|
4
4
|
import { AccordionProvider } from '../accordion/index.js';
|
|
5
|
+
import { FullScreenProvider } from '../fullscreen/index.js';
|
|
5
6
|
import { CustomDivPreflight } from './css-reset/customPreflight.js';
|
|
6
7
|
import { RootLayoutProvider } from './root_layout_context.provider.js';
|
|
7
8
|
FocusStyleManager.onlyShowFocusOnTabs();
|
|
@@ -14,14 +15,20 @@ const style = {
|
|
|
14
15
|
};
|
|
15
16
|
export function RootLayout(props) {
|
|
16
17
|
const [rootRef, setRootRef] = useState(typeof document !== 'undefined' ? document.body : null);
|
|
17
|
-
const
|
|
18
|
+
const refCallback = useCallback((node) => {
|
|
18
19
|
if (node !== null) {
|
|
19
20
|
setRootRef(node);
|
|
20
21
|
}
|
|
21
22
|
}, []);
|
|
22
|
-
return (_jsx(CustomDivPreflight, {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
return (_jsx(FullScreenProvider, { onToggleError: props.onFullscreenToggleError, children: (fullscreenRef) => (_jsx(CustomDivPreflight, { id: "root-layout", ref: (node) => {
|
|
24
|
+
if (node) {
|
|
25
|
+
const mutableRef = fullscreenRef;
|
|
26
|
+
mutableRef.current = node;
|
|
27
|
+
refCallback(node);
|
|
28
|
+
}
|
|
29
|
+
}, style: {
|
|
30
|
+
...style,
|
|
31
|
+
...props.style,
|
|
32
|
+
}, translate: "no", children: _jsx(BlueprintProvider, { ...(rootRef ? { portalContainer: rootRef } : undefined), children: _jsx(RootLayoutProvider, { innerRef: rootRef, children: _jsx(AccordionProvider, { children: props.children }) }) }) })) }));
|
|
26
33
|
}
|
|
27
34
|
//# sourceMappingURL=root_layout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"root_layout.js","sourceRoot":"","sources":["../../../src/components/root-layout/root_layout.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEzE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAEvE,iBAAiB,CAAC,mBAAmB,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"root_layout.js","sourceRoot":"","sources":["../../../src/components/root-layout/root_layout.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEzE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAEvE,iBAAiB,CAAC,mBAAmB,EAAE,CAAC;AAQxC,MAAM,KAAK,GAAkB;IAC3B,KAAK,EAAE,MAAM;IACb,MAAM,EAAE,MAAM;IACd,QAAQ,EAAE,MAAM;IAChB,OAAO,EAAE,MAAM;IACf,aAAa,EAAE,QAAQ;CACxB,CAAC;AAEF,MAAM,UAAU,UAAU,CAAC,KAAsB;IAC/C,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CACpC,OAAO,QAAQ,KAAK,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CACvD,CAAC;IAEF,MAAM,WAAW,GAAG,WAAW,CAAC,CAAC,IAAoB,EAAE,EAAE;QACvD,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YAClB,UAAU,CAAC,IAAI,CAAC,CAAC;QACnB,CAAC;IACH,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,KAAC,kBAAkB,IAAC,aAAa,EAAE,KAAK,CAAC,uBAAuB,YAC7D,CAAC,aAAa,EAAE,EAAE,CAAC,CAClB,KAAC,kBAAkB,IACjB,EAAE,EAAC,aAAa,EAChB,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE;gBACZ,IAAI,IAAI,EAAE,CAAC;oBACT,MAAM,UAAU,GACd,aAAiD,CAAC;oBACpD,UAAU,CAAC,OAAO,GAAG,IAAI,CAAC;oBAC1B,WAAW,CAAC,IAAI,CAAC,CAAC;gBACpB,CAAC;YACH,CAAC,EACD,KAAK,EAAE;gBACL,GAAG,KAAK;gBACR,GAAG,KAAK,CAAC,KAAK;aACf,EACD,SAAS,EAAC,IAAI,YAEd,KAAC,iBAAiB,OACZ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,YAExD,KAAC,kBAAkB,IAAC,QAAQ,EAAE,OAAO,YACnC,KAAC,iBAAiB,cAAE,KAAK,CAAC,QAAQ,GAAqB,GACpC,GACH,GACD,CACtB,GACkB,CACtB,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"draggable_row_tr.d.ts","sourceRoot":"","sources":["../../../../src/components/table/reorder_rows/draggable_row_tr.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"draggable_row_tr.d.ts","sourceRoot":"","sources":["../../../../src/components/table/reorder_rows/draggable_row_tr.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAiB1D,OAAO,KAAK,EACV,uBAAuB,EACvB,qBAAqB,EACtB,MAAM,mBAAmB,CAAC;AAQ3B,MAAM,WAAW,wBAAwB,CAAC,KAAK,SAAS,OAAO;IAC7D;;OAEG;IACH,OAAO,EAAE,qBAAqB,CAAC;IAC/B;;OAEG;IACH,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;IAChB;;OAEG;IACH,gBAAgB,CAAC,EAAE,uBAAuB,CAAC,KAAK,CAAC,CAAC;CACnD;AAED,wBAAgB,mBAAmB,CAAC,KAAK,SAAS,OAAO,EACvD,KAAK,EAAE,wBAAwB,CAAC,KAAK,CAAC,2CA6GvC"}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';
|
|
3
|
-
import { draggable, dropTargetForElements, } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
|
|
4
|
-
import { pointerOutsideOfPreview } from '@atlaskit/pragmatic-drag-and-drop/element/pointer-outside-of-preview';
|
|
5
|
-
import { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';
|
|
6
|
-
import { attachClosestEdge, extractClosestEdge, } from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';
|
|
7
2
|
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
8
3
|
import { createPortal } from 'react-dom';
|
|
4
|
+
import { attachClosestEdge, combine, draggable, dropTargetForElements, extractClosestEdge, pointerOutsideOfPreview, setCustomNativeDragPreview, } from '../../pdnd.cjs';
|
|
9
5
|
import { assert } from '../../utils/index.js';
|
|
10
6
|
import { useFlashRowEffect } from '../flash_row/use_flash_row_effect.js';
|
|
11
7
|
import { PreviewTable } from '../preview_table.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"draggable_row_tr.js","sourceRoot":"","sources":["../../../../src/components/table/reorder_rows/draggable_row_tr.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"draggable_row_tr.js","sourceRoot":"","sources":["../../../../src/components/table/reorder_rows/draggable_row_tr.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EACL,iBAAiB,EACjB,OAAO,EACP,SAAS,EACT,qBAAqB,EACrB,kBAAkB,EAClB,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAOhE,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEjE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAiBvD,MAAM,UAAU,mBAAmB,CACjC,KAAsC;IAEtC,MAAM,EACJ,OAAO,EACP,GAAG,EACH,gBAAgB,GAAG,CAAC,GAAG,EAAE,EAAE,CAAC,KAAC,YAAY,IAAC,GAAG,EAAE,GAAG,GAAI,GACvD,GAAG,KAAK,CAAC;IACV,MAAM,EAAE,UAAU,EAAE,GAAG,YAAY,EAAE,CAAC;IACtC,MAAM,SAAS,GAAG,iBAAiB,EAAE,CAAC;IACtC,MAAM,WAAW,GAAG,MAAM,CAAsB,IAAI,CAAC,CAAC;IACtD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAqB,SAA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AQ,OAAO,EAAE,GAAG,EAAE,WAAW,GAAI,GACR,EAC9B,KAAK,CAAC,IAAI,KAAK,SAAS;gBACvB,YAAY,CAAC,gBAAgB,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,IACrD,CACJ,CAAC;AACJ,CAAC;AAED,MAAM,SAAS,GAAuB,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AACvD,MAAM,aAAa,GAAuB,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item_order_provider.d.ts","sourceRoot":"","sources":["../../../../src/components/table/reorder_rows/item_order_provider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"item_order_provider.d.ts","sourceRoot":"","sources":["../../../../src/components/table/reorder_rows/item_order_provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAQvC,UAAU,sBAAsB,CAAC,CAAC;IAChC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACrB,cAAc,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IAC/C,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,wBAAgB,iBAAiB,CAAC,CAAC,GAAG,OAAO,EAC3C,KAAK,EAAE,sBAAsB,CAAC,CAAC,CAAC,2CA4CjC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { reorder } from '@atlaskit/pragmatic-drag-and-drop/reorder';
|
|
3
|
-
import { getReorderDestinationIndex } from '@atlaskit/pragmatic-drag-and-drop-hitbox/util/get-reorder-destination-index';
|
|
4
2
|
import { useCallback, useMemo, useState } from 'react';
|
|
3
|
+
import { getReorderDestinationIndex, reorder } from '../../pdnd.cjs';
|
|
5
4
|
import { itemOrderContext } from './item_order_context.js';
|
|
6
5
|
export function ItemOrderProvider(props) {
|
|
7
6
|
// Isolated instances of this component from one another
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item_order_provider.js","sourceRoot":"","sources":["../../../../src/components/table/reorder_rows/item_order_provider.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"item_order_provider.js","sourceRoot":"","sources":["../../../../src/components/table/reorder_rows/item_order_provider.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,EAAE,0BAA0B,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAGrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAQ3D,MAAM,UAAU,iBAAiB,CAC/B,KAAgC;IAEhC,wDAAwD;IACxD,MAAM,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC,CAAC;IACjE,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAClD,MAAM,WAAW,GAAG,WAAW,CAC7B,CAAC,EAAE,UAAU,EAAE,aAAa,EAAE,mBAAmB,EAAE,EAAE,EAAE;QACrD,MAAM,WAAW,GAAG,0BAA0B,CAAC;YAC7C,UAAU;YACV,mBAAmB;YACnB,aAAa;YACb,IAAI,EAAE,UAAU;SACjB,CAAC,CAAC;QAEH,IAAI,WAAW,KAAK,UAAU,EAAE,CAAC;YAC/B,4CAA4C;YAC5C,OAAO;QACT,CAAC;QAED,cAAc,CACZ,OAAO,CAAC;YACN,IAAI,EAAE,KAAK;YACX,UAAU;YACV,WAAW;SACZ,CAAC,CACH,CAAC;IACJ,CAAC,EACD,CAAC,KAAK,EAAE,cAAc,CAAC,CACxB,CAAC;IAEF,MAAM,KAAK,GAAG,OAAO,CACnB,GAAG,EAAE,CAAC,CAAC;QACL,WAAW;QACX,KAAK,EAAE,KAA4B;QACnC,UAAU;KACX,CAAC,EACF,CAAC,WAAW,EAAE,KAAK,EAAE,UAAU,CAAC,CACjC,CAAC;IAEF,OAAO,CACL,KAAC,gBAAgB,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YACpC,QAAQ,GACiB,CAC7B,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use_drop_monitor.d.ts","sourceRoot":"","sources":["../../../../src/components/table/reorder_rows/use_drop_monitor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use_drop_monitor.d.ts","sourceRoot":"","sources":["../../../../src/components/table/reorder_rows/use_drop_monitor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAevC;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,gBAAgB,EAAE,SAAS,CAAC,OAAO,CAAC,EACpC,OAAO,EAAE,OAAO,QAmDjB"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';
|
|
2
|
-
import { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
|
|
3
|
-
import { autoScrollForElements } from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/element';
|
|
4
|
-
import { extractClosestEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';
|
|
5
1
|
import { useEffect } from 'react';
|
|
2
|
+
import { autoScrollForElements, combine, extractClosestEdge, monitorForElements, } from '../../pdnd.cjs';
|
|
6
3
|
import { assert } from '../../utils/index.js';
|
|
7
4
|
import { useFlashedRowContext } from '../flash_row/flashed_row_context.js';
|
|
8
5
|
import { isItemData } from './item_data.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use_drop_monitor.js","sourceRoot":"","sources":["../../../../src/components/table/reorder_rows/use_drop_monitor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use_drop_monitor.js","sourceRoot":"","sources":["../../../../src/components/table/reorder_rows/use_drop_monitor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EACL,qBAAqB,EACrB,OAAO,EACP,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAE3E,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAC5B,gBAAoC,EACpC,OAAgB;IAEhB,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,YAAY,EAAE,CAAC;IAC9C,MAAM,CAAC,EAAE,aAAa,CAAC,GAAG,oBAAoB,EAAE,CAAC;IACjD,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,eAAe,GAAG,gBAAgB,CAAC,OAAO,CAAC;QACjD,MAAM,CAAC,eAAe,EAAE,8BAA8B,CAAC,CAAC;QAExD,IAAI,OAAO,EAAE,CAAC;YACZ,SAAS,UAAU,CAAC,EAAE,MAAM,EAAkC;gBAC5D,OAAO,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YACjC,CAAC;YACD,OAAO,OAAO,CACZ,kBAAkB,CAAC;gBACjB,UAAU,EAAE,UAAU;gBACtB,MAAM,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE;oBACzB,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;oBAC/C,IAAI,CAAC,MAAM,EAAE,CAAC;wBACZ,OAAO;oBACT,CAAC;oBAED,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC;oBAC/B,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC;oBAC/B,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;wBACvD,OAAO;oBACT,CAAC;oBAED,MAAM,aAAa,GAAG,KAAK,CAAC,SAAS,CACnC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,UAAU,CAAC,EAAE,CACpC,CAAC;oBACF,IAAI,aAAa,KAAK,CAAC,CAAC,EAAE,CAAC;wBACzB,OAAO;oBACT,CAAC;oBAED,MAAM,mBAAmB,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC;oBAE3D,WAAW,CAAC;wBACV,UAAU,EAAE,UAAU,CAAC,KAAK;wBAC5B,aAAa;wBACb,mBAAmB;qBACpB,CAAC,CAAC;oBACH,aAAa,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;gBAC/B,CAAC;aACF,CAAC,EACF,qBAAqB,CAAC;gBACpB,SAAS,EAAE,UAAU;gBACrB,OAAO,EAAE,eAAe;aACzB,CAAC,CACH,CAAC;QACJ,CAAC;IACH,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC,CAAC;AACrE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-science",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "18.0.0",
|
|
4
4
|
"description": "React components to build scientific applications UI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -65,6 +65,7 @@
|
|
|
65
65
|
"@tanstack/react-virtual": "^3.13.2",
|
|
66
66
|
"d3-scale-chromatic": "^3.1.0",
|
|
67
67
|
"react-dropzone": "^14.3.8",
|
|
68
|
+
"react-full-screen": "^1.1.1",
|
|
68
69
|
"react-icons": "^5.5.0",
|
|
69
70
|
"react-inspector": "^6.0.2",
|
|
70
71
|
"tinycolor2": "^1.6.0",
|
|
@@ -6,9 +6,10 @@ import type {
|
|
|
6
6
|
ReactElement,
|
|
7
7
|
ReactNode,
|
|
8
8
|
} from 'react';
|
|
9
|
-
import { useCallback } from 'react';
|
|
9
|
+
import { useCallback, useRef } from 'react';
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import { useAccordionItemContext } from './accordion_context.js';
|
|
12
|
+
import type { AccordionItemControls } from './accordion_context_utils.js';
|
|
12
13
|
|
|
13
14
|
export interface AccordionProps<T extends string = string> {
|
|
14
15
|
children?:
|
|
@@ -18,6 +19,12 @@ export interface AccordionProps<T extends string = string> {
|
|
|
18
19
|
| null;
|
|
19
20
|
}
|
|
20
21
|
|
|
22
|
+
export interface AccordionRenderToolbarProps<T extends string = string> {
|
|
23
|
+
id: T;
|
|
24
|
+
isOpen: boolean;
|
|
25
|
+
controls: AccordionItemControls;
|
|
26
|
+
}
|
|
27
|
+
|
|
21
28
|
export interface AccordionItemProps<T extends string = string> {
|
|
22
29
|
/**
|
|
23
30
|
* A value uniquely identifying the accordion item.
|
|
@@ -49,7 +56,12 @@ export interface AccordionItemProps<T extends string = string> {
|
|
|
49
56
|
* When not set or set to false, the item's children will be rendered but hidden when the item is closed.
|
|
50
57
|
*/
|
|
51
58
|
unmountChildren?: boolean;
|
|
52
|
-
|
|
59
|
+
/**
|
|
60
|
+
* A custom render function to display in the toolbar on the right of the accordion item.
|
|
61
|
+
* Click events will not be propagated down to the accordion item to prevent it from opening/closing.
|
|
62
|
+
* @param data
|
|
63
|
+
*/
|
|
64
|
+
renderToolbar?: (renderProps: AccordionRenderToolbarProps<T>) => ReactNode;
|
|
53
65
|
}
|
|
54
66
|
|
|
55
67
|
const AccordionItemHeader = styled.div`
|
|
@@ -106,7 +118,9 @@ Accordion.Item = function AccordionItem<T extends string = string>(
|
|
|
106
118
|
defaultProp: defaultOpen,
|
|
107
119
|
onChange: onOpenChange,
|
|
108
120
|
});
|
|
109
|
-
const {
|
|
121
|
+
const { controls, unmountChildren } = useAccordionItemContext(id, setIsOpen);
|
|
122
|
+
|
|
123
|
+
const headerRef = useRef<HTMLDivElement>(null);
|
|
110
124
|
|
|
111
125
|
const shouldUnmountChildren =
|
|
112
126
|
props.unmountChildren === undefined
|
|
@@ -116,12 +130,12 @@ Accordion.Item = function AccordionItem<T extends string = string>(
|
|
|
116
130
|
const onClickHandle = useCallback(
|
|
117
131
|
(event: ReactMouseEvent<HTMLDivElement>) => {
|
|
118
132
|
if (event.shiftKey) {
|
|
119
|
-
|
|
133
|
+
controls.closeOthers();
|
|
120
134
|
} else {
|
|
121
|
-
|
|
135
|
+
controls.toggle();
|
|
122
136
|
}
|
|
123
137
|
},
|
|
124
|
-
[
|
|
138
|
+
[controls],
|
|
125
139
|
);
|
|
126
140
|
|
|
127
141
|
return (
|
|
@@ -133,7 +147,11 @@ Accordion.Item = function AccordionItem<T extends string = string>(
|
|
|
133
147
|
isolation: 'isolate',
|
|
134
148
|
}}
|
|
135
149
|
>
|
|
136
|
-
<AccordionItemHeader
|
|
150
|
+
<AccordionItemHeader
|
|
151
|
+
onClick={onClickHandle}
|
|
152
|
+
role="button"
|
|
153
|
+
ref={headerRef}
|
|
154
|
+
>
|
|
137
155
|
<div
|
|
138
156
|
style={{
|
|
139
157
|
padding: '5px 0px',
|
|
@@ -141,7 +159,9 @@ Accordion.Item = function AccordionItem<T extends string = string>(
|
|
|
141
159
|
>
|
|
142
160
|
{title}
|
|
143
161
|
</div>
|
|
144
|
-
{
|
|
162
|
+
<ToolbarContainer onClick={(event) => event.stopPropagation()}>
|
|
163
|
+
{renderToolbar?.({ id, isOpen: isOpen ?? false, controls })}
|
|
164
|
+
</ToolbarContainer>
|
|
145
165
|
</AccordionItemHeader>
|
|
146
166
|
{!isOpen && shouldUnmountChildren ? null : (
|
|
147
167
|
<div
|
|
@@ -169,3 +189,7 @@ Accordion.Item = function AccordionItem<T extends string = string>(
|
|
|
169
189
|
</div>
|
|
170
190
|
);
|
|
171
191
|
};
|
|
192
|
+
|
|
193
|
+
const ToolbarContainer = styled.div`
|
|
194
|
+
display: flex;
|
|
195
|
+
`;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { createContext, useContext, useEffect, useMemo } from 'react';
|
|
2
2
|
|
|
3
3
|
import type {
|
|
4
|
+
AccordionItemContextValue,
|
|
4
5
|
AccordionItemSetIsOpen,
|
|
5
|
-
AccordionState,
|
|
6
6
|
} from './accordion_context_utils.js';
|
|
7
7
|
|
|
8
|
-
export type
|
|
9
|
-
|
|
8
|
+
export type AccordionContextValue = [
|
|
9
|
+
{
|
|
10
|
+
unmountChildren: boolean;
|
|
11
|
+
},
|
|
10
12
|
{
|
|
11
13
|
closeAllExcept: (except: string) => void;
|
|
12
14
|
toggle: (id: string) => void;
|
|
@@ -15,15 +17,14 @@ export type ContextType = [
|
|
|
15
17
|
change: (id: string, isOpen: boolean) => void;
|
|
16
18
|
},
|
|
17
19
|
];
|
|
20
|
+
export const accordionContext = createContext<AccordionContextValue | null>(
|
|
21
|
+
null,
|
|
22
|
+
);
|
|
18
23
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
export const accordionContext = createContext<ContextType | null>(null);
|
|
22
|
-
|
|
23
|
-
export function useAccordionContext(
|
|
24
|
+
export function useAccordionItemContext(
|
|
24
25
|
id: string,
|
|
25
26
|
setIsOpen: AccordionItemSetIsOpen,
|
|
26
|
-
) {
|
|
27
|
+
): AccordionItemContextValue {
|
|
27
28
|
const context = useContext(accordionContext);
|
|
28
29
|
|
|
29
30
|
if (!context) {
|
|
@@ -40,9 +41,11 @@ export function useAccordionContext(
|
|
|
40
41
|
return useMemo(
|
|
41
42
|
() => ({
|
|
42
43
|
unmountChildren: state.unmountChildren,
|
|
43
|
-
|
|
44
|
+
controls: {
|
|
44
45
|
closeOthers: () => utils.closeAllExcept(id),
|
|
45
46
|
toggle: () => utils.toggle(id),
|
|
47
|
+
open: () => utils.change(id, true),
|
|
48
|
+
close: () => utils.change(id, false),
|
|
46
49
|
},
|
|
47
50
|
}),
|
|
48
51
|
[id, utils, state.unmountChildren],
|
|
@@ -3,7 +3,7 @@ import { useMemo, useRef } from 'react';
|
|
|
3
3
|
|
|
4
4
|
import { assert } from '../utils/index.js';
|
|
5
5
|
|
|
6
|
-
import type {
|
|
6
|
+
import type { AccordionContextValue } from './accordion_context.js';
|
|
7
7
|
import { accordionContext } from './accordion_context.js';
|
|
8
8
|
import type { AccordionItemSetIsOpen } from './accordion_context_utils.js';
|
|
9
9
|
import { getAccordionRegister } from './accordion_context_utils.js';
|
|
@@ -17,7 +17,7 @@ export function AccordionProvider(props: AccordionProviderProps) {
|
|
|
17
17
|
const { unmountChildren = false, children } = props;
|
|
18
18
|
const registerRef = useRef(getAccordionRegister());
|
|
19
19
|
|
|
20
|
-
const utils = useMemo<
|
|
20
|
+
const utils = useMemo<AccordionContextValue[1]>(() => {
|
|
21
21
|
return {
|
|
22
22
|
change: (id: string, isOpen: boolean) => {
|
|
23
23
|
assert(registerRef.current);
|
|
@@ -62,7 +62,7 @@ export function AccordionProvider(props: AccordionProviderProps) {
|
|
|
62
62
|
};
|
|
63
63
|
}, [registerRef]);
|
|
64
64
|
|
|
65
|
-
const contextValue = useMemo<
|
|
65
|
+
const contextValue = useMemo<AccordionContextValue>(() => {
|
|
66
66
|
return [
|
|
67
67
|
{
|
|
68
68
|
unmountChildren,
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import type { Dispatch, SetStateAction } from 'react';
|
|
2
2
|
|
|
3
|
-
export interface
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
export interface AccordionItemControls {
|
|
4
|
+
closeOthers: () => void;
|
|
5
|
+
toggle: () => void;
|
|
6
|
+
open: () => void;
|
|
7
|
+
close: () => void;
|
|
6
8
|
}
|
|
7
9
|
|
|
8
|
-
export interface
|
|
10
|
+
export interface AccordionItemContextValue {
|
|
9
11
|
unmountChildren: boolean;
|
|
12
|
+
controls: AccordionItemControls;
|
|
10
13
|
}
|
|
11
14
|
|
|
12
15
|
export type AccordionItemSetIsOpen = Dispatch<
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
export * from './accordion.js';
|
|
2
2
|
export * from './accordion_context_provider.js';
|
|
3
3
|
export * from './accordion_hooks.js';
|
|
4
|
+
|
|
5
|
+
// Exported because part of AccordionRenderToolbarProps, which is also exported.
|
|
6
|
+
export type { AccordionItemControls } from './accordion_context_utils.js';
|
|
@@ -1,93 +1,49 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
1
|
+
import type { MutableRefObject, ReactNode } from 'react';
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { useFullScreenHandle } from 'react-full-screen';
|
|
4
4
|
|
|
5
|
-
import { fullscreenContext
|
|
5
|
+
import { fullscreenContext } from './fullscreen_context.js';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
export interface FullscreenProviderProps {
|
|
8
|
+
/**
|
|
9
|
+
* Callback providing the ref which should be passed to the element that can be displayed fullscreen.
|
|
10
|
+
* @param ref
|
|
11
|
+
*/
|
|
12
|
+
children: (ref: MutableRefObject<HTMLDivElement | null>) => ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Callback which will be called in case toggling results in an error.
|
|
15
|
+
* @param error - The error that happened. Value is not necessarily an instance of `Error` and may even be `undefined`.
|
|
16
|
+
* @param step - Indicates if the error happened when entering or exiting the full screen.
|
|
17
|
+
*/
|
|
18
|
+
onToggleError?: (error: unknown, step: 'enter' | 'exit') => void;
|
|
17
19
|
}
|
|
18
20
|
|
|
19
|
-
export function FullScreenProvider(props:
|
|
20
|
-
const
|
|
21
|
+
export function FullScreenProvider(props: FullscreenProviderProps) {
|
|
22
|
+
const { children, onToggleError } = props;
|
|
21
23
|
|
|
22
|
-
const
|
|
23
|
-
() => ({ isFullScreen, toggle }),
|
|
24
|
-
[isFullScreen, toggle],
|
|
25
|
-
);
|
|
26
|
-
return (
|
|
27
|
-
<fullscreenContext.Provider value={value}>
|
|
28
|
-
<FullscreenInner {...props} />
|
|
29
|
-
</fullscreenContext.Provider>
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
function FullscreenInner(props: FullscreenProps) {
|
|
33
|
-
const { children } = props;
|
|
34
|
-
const { isFullScreen, toggle } = useFullscreen();
|
|
35
|
-
const ref = useRef<ElementType>(null);
|
|
36
|
-
useEffect(() => {
|
|
37
|
-
function onFullscreenChange() {
|
|
38
|
-
const document = window.document as DocumentType;
|
|
39
|
-
const value = Boolean(
|
|
40
|
-
document.fullscreenElement || document.webkitFullscreenElement,
|
|
41
|
-
);
|
|
42
|
-
if (!value && isFullScreen) toggle();
|
|
43
|
-
}
|
|
44
|
-
const div = ref.current;
|
|
45
|
-
if (!div) {
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
div.addEventListener('fullscreenchange', onFullscreenChange);
|
|
49
|
-
div.addEventListener('webkitfullscreenchange', onFullscreenChange);
|
|
24
|
+
const handle = useFullScreenHandle();
|
|
50
25
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
useEffect(() => {
|
|
57
|
-
if (isFullScreen && ref.current) {
|
|
58
|
-
if (ref.current.requestFullscreen) {
|
|
59
|
-
ref.current.requestFullscreen().catch(() => {
|
|
60
|
-
window.alert('Fullscreen is not supported');
|
|
61
|
-
});
|
|
62
|
-
} else if (ref.current.webkitRequestFullscreen) {
|
|
63
|
-
ref.current.webkitRequestFullscreen()?.catch(() => {
|
|
64
|
-
window.alert('Fullscreen is not supported');
|
|
65
|
-
});
|
|
26
|
+
const value = useMemo(() => {
|
|
27
|
+
function toggle() {
|
|
28
|
+
const handleToggle = handle.active ? handle.exit : handle.enter;
|
|
29
|
+
function handleError(error: unknown) {
|
|
30
|
+
onToggleError?.(error, handle.active ? 'exit' : 'enter');
|
|
66
31
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
document.exitFullscreen().catch(() => {
|
|
72
|
-
window.alert("Can't exit fullscreen");
|
|
73
|
-
});
|
|
74
|
-
} else if (document.webkitExitFullscreen) {
|
|
75
|
-
document.webkitExitFullscreen().catch(() => {
|
|
76
|
-
window.alert("Can't exit fullscreen");
|
|
77
|
-
});
|
|
32
|
+
try {
|
|
33
|
+
handleToggle().catch(handleError);
|
|
34
|
+
} catch (error) {
|
|
35
|
+
handleError(error);
|
|
78
36
|
}
|
|
79
37
|
}
|
|
80
|
-
|
|
38
|
+
return {
|
|
39
|
+
isFullScreen: handle.active,
|
|
40
|
+
toggle,
|
|
41
|
+
};
|
|
42
|
+
}, [handle, onToggleError]);
|
|
43
|
+
|
|
81
44
|
return (
|
|
82
|
-
<
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
width: '100%',
|
|
86
|
-
height: '100%',
|
|
87
|
-
backgroundColor: 'white',
|
|
88
|
-
}}
|
|
89
|
-
>
|
|
90
|
-
{children}
|
|
91
|
-
</div>
|
|
45
|
+
<fullscreenContext.Provider value={value}>
|
|
46
|
+
{children(handle.node)}
|
|
47
|
+
</fullscreenContext.Provider>
|
|
92
48
|
);
|
|
93
49
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// https://github.com/atlassian/pragmatic-drag-and-drop/issues/27
|
|
2
|
+
// Given how `@atlaskit/pragmatic-drag-and-drop` publishes ESM in a non-native way,
|
|
3
|
+
// we have to trick TS into using the CJS build so that our build is compatible
|
|
4
|
+
// with native ESM.
|
|
5
|
+
// We cannot use `verbatimModuleSyntax` ts config option with this pattern.
|
|
6
|
+
export { pointerOutsideOfPreview } from '@atlaskit/pragmatic-drag-and-drop/element/pointer-outside-of-preview';
|
|
7
|
+
export { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';
|
|
8
|
+
export { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';
|
|
9
|
+
export { reorder } from '@atlaskit/pragmatic-drag-and-drop/reorder';
|
|
10
|
+
export {
|
|
11
|
+
draggable,
|
|
12
|
+
dropTargetForElements,
|
|
13
|
+
} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
|
|
14
|
+
export { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
|
|
15
|
+
export { autoScrollForElements } from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/element';
|
|
16
|
+
export {
|
|
17
|
+
extractClosestEdge,
|
|
18
|
+
attachClosestEdge,
|
|
19
|
+
} from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';
|
|
20
|
+
export { getReorderDestinationIndex } from '@atlaskit/pragmatic-drag-and-drop-hitbox/util/get-reorder-destination-index';
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { BlueprintProvider, FocusStyleManager } from '@blueprintjs/core';
|
|
2
|
-
import type { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import type { CSSProperties, MutableRefObject, ReactNode } from 'react';
|
|
3
3
|
import { useCallback, useState } from 'react';
|
|
4
4
|
|
|
5
5
|
import { AccordionProvider } from '../accordion/index.js';
|
|
6
|
+
import type { FullscreenProviderProps } from '../fullscreen/index.js';
|
|
7
|
+
import { FullScreenProvider } from '../fullscreen/index.js';
|
|
6
8
|
|
|
7
9
|
import { CustomDivPreflight } from './css-reset/customPreflight.js';
|
|
8
10
|
import { RootLayoutProvider } from './root_layout_context.provider.js';
|
|
@@ -10,8 +12,9 @@ import { RootLayoutProvider } from './root_layout_context.provider.js';
|
|
|
10
12
|
FocusStyleManager.onlyShowFocusOnTabs();
|
|
11
13
|
|
|
12
14
|
interface RootLayoutProps {
|
|
13
|
-
style?: CSSProperties;
|
|
14
15
|
children: ReactNode;
|
|
16
|
+
style?: CSSProperties;
|
|
17
|
+
onFullscreenToggleError?: FullscreenProviderProps['onToggleError'];
|
|
15
18
|
}
|
|
16
19
|
|
|
17
20
|
const style: CSSProperties = {
|
|
@@ -27,28 +30,40 @@ export function RootLayout(props: RootLayoutProps) {
|
|
|
27
30
|
typeof document !== 'undefined' ? document.body : null,
|
|
28
31
|
);
|
|
29
32
|
|
|
30
|
-
const
|
|
33
|
+
const refCallback = useCallback((node: HTMLDivElement) => {
|
|
31
34
|
if (node !== null) {
|
|
32
35
|
setRootRef(node);
|
|
33
36
|
}
|
|
34
37
|
}, []);
|
|
35
38
|
|
|
36
39
|
return (
|
|
37
|
-
<
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
40
|
+
<FullScreenProvider onToggleError={props.onFullscreenToggleError}>
|
|
41
|
+
{(fullscreenRef) => (
|
|
42
|
+
<CustomDivPreflight
|
|
43
|
+
id="root-layout"
|
|
44
|
+
ref={(node) => {
|
|
45
|
+
if (node) {
|
|
46
|
+
const mutableRef =
|
|
47
|
+
fullscreenRef as MutableRefObject<HTMLDivElement>;
|
|
48
|
+
mutableRef.current = node;
|
|
49
|
+
refCallback(node);
|
|
50
|
+
}
|
|
51
|
+
}}
|
|
52
|
+
style={{
|
|
53
|
+
...style,
|
|
54
|
+
...props.style,
|
|
55
|
+
}}
|
|
56
|
+
translate="no"
|
|
57
|
+
>
|
|
58
|
+
<BlueprintProvider
|
|
59
|
+
{...(rootRef ? { portalContainer: rootRef } : undefined)}
|
|
60
|
+
>
|
|
61
|
+
<RootLayoutProvider innerRef={rootRef}>
|
|
62
|
+
<AccordionProvider>{props.children}</AccordionProvider>
|
|
63
|
+
</RootLayoutProvider>
|
|
64
|
+
</BlueprintProvider>
|
|
65
|
+
</CustomDivPreflight>
|
|
66
|
+
)}
|
|
67
|
+
</FullScreenProvider>
|
|
53
68
|
);
|
|
54
69
|
}
|
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
import { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';
|
|
2
1
|
import type { ElementDragPayload } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
|
|
3
|
-
import {
|
|
4
|
-
draggable,
|
|
5
|
-
dropTargetForElements,
|
|
6
|
-
} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
|
|
7
|
-
import { pointerOutsideOfPreview } from '@atlaskit/pragmatic-drag-and-drop/element/pointer-outside-of-preview';
|
|
8
|
-
import { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';
|
|
9
|
-
import {
|
|
10
|
-
attachClosestEdge,
|
|
11
|
-
extractClosestEdge,
|
|
12
|
-
} from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';
|
|
13
2
|
import type { Row, RowData } from '@tanstack/react-table';
|
|
14
3
|
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
15
4
|
import { createPortal } from 'react-dom';
|
|
16
5
|
|
|
6
|
+
import {
|
|
7
|
+
attachClosestEdge,
|
|
8
|
+
combine,
|
|
9
|
+
draggable,
|
|
10
|
+
dropTargetForElements,
|
|
11
|
+
extractClosestEdge,
|
|
12
|
+
pointerOutsideOfPreview,
|
|
13
|
+
setCustomNativeDragPreview,
|
|
14
|
+
} from '../../pdnd.cjs';
|
|
17
15
|
import { assert } from '../../utils/index.js';
|
|
18
16
|
import { useFlashRowEffect } from '../flash_row/use_flash_row_effect.js';
|
|
19
17
|
import { PreviewTable } from '../preview_table.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { reorder } from '@atlaskit/pragmatic-drag-and-drop/reorder';
|
|
2
|
-
import { getReorderDestinationIndex } from '@atlaskit/pragmatic-drag-and-drop-hitbox/util/get-reorder-destination-index';
|
|
3
1
|
import type { Row } from '@tanstack/react-table';
|
|
4
2
|
import type { ReactNode } from 'react';
|
|
5
3
|
import { useCallback, useMemo, useState } from 'react';
|
|
6
4
|
|
|
5
|
+
import { getReorderDestinationIndex, reorder } from '../../pdnd.cjs';
|
|
6
|
+
|
|
7
7
|
import type { ReorderItemCallback } from './item_order_context.js';
|
|
8
8
|
import { itemOrderContext } from './item_order_context.js';
|
|
9
9
|
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';
|
|
2
1
|
import type { ElementDragPayload } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
|
|
3
|
-
import { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
|
|
4
|
-
import { autoScrollForElements } from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/element';
|
|
5
|
-
import { extractClosestEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';
|
|
6
2
|
import type { RefObject } from 'react';
|
|
7
3
|
import { useEffect } from 'react';
|
|
8
4
|
|
|
5
|
+
import {
|
|
6
|
+
autoScrollForElements,
|
|
7
|
+
combine,
|
|
8
|
+
extractClosestEdge,
|
|
9
|
+
monitorForElements,
|
|
10
|
+
} from '../../pdnd.cjs';
|
|
9
11
|
import { assert } from '../../utils/index.js';
|
|
10
12
|
import { useFlashedRowContext } from '../flash_row/flashed_row_context.js';
|
|
11
13
|
|