react-science 14.0.0 → 16.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 +29 -7
- package/lib/components/accordion/accordion.d.ts.map +1 -1
- package/lib/components/accordion/accordion.js +24 -9
- package/lib/components/accordion/accordion.js.map +1 -1
- package/lib/components/accordion/accordion_context.d.ts +8 -15
- package/lib/components/accordion/accordion_context.d.ts.map +1 -1
- package/lib/components/accordion/accordion_context.js +7 -25
- package/lib/components/accordion/accordion_context.js.map +1 -1
- package/lib/components/accordion/accordion_context_provider.d.ts +7 -0
- package/lib/components/accordion/accordion_context_provider.d.ts.map +1 -0
- package/lib/components/accordion/accordion_context_provider.js +62 -0
- package/lib/components/accordion/accordion_context_provider.js.map +1 -0
- package/lib/components/accordion/accordion_context_utils.d.ts +15 -0
- package/lib/components/accordion/accordion_context_utils.d.ts.map +1 -0
- package/lib/components/accordion/accordion_context_utils.js +4 -0
- package/lib/components/accordion/accordion_context_utils.js.map +1 -0
- package/lib/components/accordion/accordion_hooks.d.ts +8 -0
- package/lib/components/accordion/accordion_hooks.d.ts.map +1 -0
- package/lib/components/accordion/accordion_hooks.js +16 -0
- package/lib/components/accordion/accordion_hooks.js.map +1 -0
- package/lib/components/accordion/index.d.ts +2 -3
- package/lib/components/accordion/index.d.ts.map +1 -1
- package/lib/components/accordion/index.js +2 -3
- package/lib/components/accordion/index.js.map +1 -1
- package/lib/components/index.d.ts +1 -1
- package/lib/components/index.js +1 -1
- package/lib/components/split_pane/index.d.ts +3 -0
- package/lib/components/split_pane/index.d.ts.map +1 -0
- package/lib/components/split_pane/index.js +3 -0
- package/lib/components/split_pane/index.js.map +1 -0
- package/lib/components/{split-pane/SplitPane.d.ts → split_pane/split_pane.d.ts} +7 -5
- package/lib/components/split_pane/split_pane.d.ts.map +1 -0
- package/lib/components/{split-pane/SplitPane.js → split_pane/split_pane.js} +25 -32
- package/lib/components/split_pane/split_pane.js.map +1 -0
- package/lib/components/split_pane/split_pane_helpers.d.ts +9 -0
- package/lib/components/split_pane/split_pane_helpers.d.ts.map +1 -0
- package/lib/components/split_pane/split_pane_helpers.js +10 -0
- package/lib/components/split_pane/split_pane_helpers.js.map +1 -0
- package/lib/components/{split-pane/useSplitPaneSize.d.ts → split_pane/use_split_pane_size.d.ts} +5 -3
- package/lib/components/split_pane/use_split_pane_size.d.ts.map +1 -0
- package/lib/components/split_pane/use_split_pane_size.js +78 -0
- package/lib/components/split_pane/use_split_pane_size.js.map +1 -0
- package/lib/components/table/index.d.ts +1 -0
- package/lib/components/table/index.d.ts.map +1 -1
- package/lib/components/table/index.js +1 -0
- package/lib/components/table/index.js.map +1 -1
- package/lib/components/table/reorder_rows/draggable_row_context.d.ts +9 -0
- package/lib/components/table/reorder_rows/draggable_row_context.d.ts.map +1 -0
- package/lib/components/table/reorder_rows/draggable_row_context.js +10 -0
- package/lib/components/table/reorder_rows/draggable_row_context.js.map +1 -0
- package/lib/components/table/reorder_rows/draggable_row_tr.d.ts +18 -0
- package/lib/components/table/reorder_rows/draggable_row_tr.d.ts.map +1 -0
- package/lib/components/table/reorder_rows/draggable_row_tr.js +107 -0
- package/lib/components/table/reorder_rows/draggable_row_tr.js.map +1 -0
- package/lib/components/table/reorder_rows/drop_indicator.d.ts +18 -0
- package/lib/components/table/reorder_rows/drop_indicator.d.ts.map +1 -0
- package/lib/components/table/reorder_rows/drop_indicator.js +19 -0
- package/lib/components/table/reorder_rows/drop_indicator.js.map +1 -0
- package/lib/components/table/reorder_rows/dropped_item_context.d.ts +3 -0
- package/lib/components/table/reorder_rows/dropped_item_context.d.ts.map +1 -0
- package/lib/components/table/reorder_rows/dropped_item_context.js +10 -0
- package/lib/components/table/reorder_rows/dropped_item_context.js.map +1 -0
- package/lib/components/table/reorder_rows/dropped_item_provider.d.ts +5 -0
- package/lib/components/table/reorder_rows/dropped_item_provider.d.ts.map +1 -0
- package/lib/components/table/reorder_rows/dropped_item_provider.js +8 -0
- package/lib/components/table/reorder_rows/dropped_item_provider.js.map +1 -0
- package/lib/components/table/reorder_rows/index.d.ts +5 -0
- package/lib/components/table/reorder_rows/index.d.ts.map +1 -0
- package/lib/components/table/reorder_rows/index.js +5 -0
- package/lib/components/table/reorder_rows/index.js.map +1 -0
- package/lib/components/table/reorder_rows/item_data.d.ts +26 -0
- package/lib/components/table/reorder_rows/item_data.d.ts.map +1 -0
- package/lib/components/table/reorder_rows/item_data.js +13 -0
- package/lib/components/table/reorder_rows/item_data.js.map +1 -0
- package/lib/components/table/reorder_rows/item_order_context.d.ts +15 -0
- package/lib/components/table/reorder_rows/item_order_context.d.ts.map +1 -0
- package/lib/components/table/reorder_rows/item_order_context.js +10 -0
- package/lib/components/table/reorder_rows/item_order_context.js.map +1 -0
- package/lib/components/table/reorder_rows/item_order_provider.d.ts +10 -0
- package/lib/components/table/reorder_rows/item_order_provider.d.ts.map +1 -0
- package/lib/components/table/reorder_rows/item_order_provider.js +34 -0
- package/lib/components/table/reorder_rows/item_order_provider.js.map +1 -0
- package/lib/components/table/reorder_rows/table_drag_row_handler.d.ts +2 -0
- package/lib/components/table/reorder_rows/table_drag_row_handler.d.ts.map +1 -0
- package/lib/components/table/reorder_rows/table_drag_row_handler.js +9 -0
- package/lib/components/table/reorder_rows/table_drag_row_handler.js.map +1 -0
- package/lib/components/table/reorder_rows/use_drop_monitor.d.ts +9 -0
- package/lib/components/table/reorder_rows/use_drop_monitor.d.ts.map +1 -0
- package/lib/components/table/reorder_rows/use_drop_monitor.js +57 -0
- package/lib/components/table/reorder_rows/use_drop_monitor.js.map +1 -0
- package/lib/components/table/table_body.d.ts +4 -1
- package/lib/components/table/table_body.d.ts.map +1 -1
- package/lib/components/table/table_body.js +20 -6
- package/lib/components/table/table_body.js.map +1 -1
- package/lib/components/table/table_root.d.ts +37 -1
- package/lib/components/table/table_root.d.ts.map +1 -1
- package/lib/components/table/table_root.js +41 -7
- package/lib/components/table/table_root.js.map +1 -1
- package/lib/components/table/table_row_cell.d.ts +2 -1
- package/lib/components/table/table_row_cell.d.ts.map +1 -1
- package/lib/components/table/table_row_cell.js +2 -2
- package/lib/components/table/table_row_cell.js.map +1 -1
- package/lib/components/table/table_utils.d.ts +11 -2
- package/lib/components/table/table_utils.d.ts.map +1 -1
- package/lib/components/table/table_utils.js.map +1 -1
- package/package.json +4 -1
- package/src/components/accordion/accordion.tsx +65 -20
- package/src/components/accordion/accordion_context.ts +17 -37
- package/src/components/accordion/accordion_context_provider.tsx +79 -0
- package/src/components/accordion/accordion_context_utils.ts +22 -0
- package/src/components/accordion/accordion_hooks.ts +32 -0
- package/src/components/accordion/index.ts +2 -6
- package/src/components/index.ts +1 -1
- package/src/components/split_pane/index.ts +2 -0
- package/src/components/{split-pane/SplitPane.tsx → split_pane/split_pane.tsx} +63 -56
- package/src/components/split_pane/split_pane_helpers.ts +19 -0
- package/src/components/split_pane/use_split_pane_size.tsx +120 -0
- package/src/components/table/index.ts +1 -0
- package/src/components/table/reorder_rows/draggable_row_context.ts +23 -0
- package/src/components/table/reorder_rows/draggable_row_tr.tsx +166 -0
- package/src/components/table/reorder_rows/drop_indicator.tsx +28 -0
- package/src/components/table/reorder_rows/dropped_item_context.ts +23 -0
- package/src/components/table/reorder_rows/dropped_item_provider.tsx +13 -0
- package/src/components/table/reorder_rows/index.ts +4 -0
- package/src/components/table/reorder_rows/item_data.ts +33 -0
- package/src/components/table/reorder_rows/item_order_context.ts +27 -0
- package/src/components/table/reorder_rows/item_order_provider.tsx +61 -0
- package/src/components/table/reorder_rows/table_drag_row_handler.tsx +22 -0
- package/src/components/table/reorder_rows/use_drop_monitor.ts +74 -0
- package/src/components/table/table_body.tsx +58 -9
- package/src/components/table/table_root.tsx +167 -35
- package/src/components/table/table_row_cell.tsx +5 -3
- package/src/components/table/table_utils.ts +16 -2
- package/lib/components/accordion/accordion_context.provider.d.ts +0 -13
- package/lib/components/accordion/accordion_context.provider.d.ts.map +0 -1
- package/lib/components/accordion/accordion_context.provider.js +0 -55
- package/lib/components/accordion/accordion_context.provider.js.map +0 -1
- package/lib/components/accordion/accordion_context.utils.d.ts +0 -23
- package/lib/components/accordion/accordion_context.utils.d.ts.map +0 -1
- package/lib/components/accordion/accordion_context.utils.js +0 -40
- package/lib/components/accordion/accordion_context.utils.js.map +0 -1
- package/lib/components/split-pane/SplitPane.d.ts.map +0 -1
- package/lib/components/split-pane/SplitPane.js.map +0 -1
- package/lib/components/split-pane/index.d.ts +0 -2
- package/lib/components/split-pane/index.d.ts.map +0 -1
- package/lib/components/split-pane/index.js +0 -2
- package/lib/components/split-pane/index.js.map +0 -1
- package/lib/components/split-pane/useSplitPaneSize.d.ts.map +0 -1
- package/lib/components/split-pane/useSplitPaneSize.js +0 -60
- package/lib/components/split-pane/useSplitPaneSize.js.map +0 -1
- package/src/components/accordion/accordion_context.provider.tsx +0 -91
- package/src/components/accordion/accordion_context.utils.ts +0 -66
- package/src/components/split-pane/index.ts +0 -1
- package/src/components/split-pane/useSplitPaneSize.tsx +0 -99
|
@@ -1,20 +1,42 @@
|
|
|
1
1
|
import type { ReactElement, ReactNode } from 'react';
|
|
2
|
-
export interface AccordionProps {
|
|
3
|
-
children?: Array<ReactElement<AccordionItemProps
|
|
2
|
+
export interface AccordionProps<T extends string = string> {
|
|
3
|
+
children?: Array<ReactElement<AccordionItemProps<T>>> | ReactElement<AccordionItemProps<T>> | boolean | null;
|
|
4
4
|
}
|
|
5
|
-
export interface AccordionItemProps {
|
|
5
|
+
export interface AccordionItemProps<T extends string = string> {
|
|
6
|
+
/**
|
|
7
|
+
* A value uniquely identifying the accordion item.
|
|
8
|
+
*/
|
|
9
|
+
id: T;
|
|
10
|
+
/**
|
|
11
|
+
* The title of the accordion item.
|
|
12
|
+
*/
|
|
6
13
|
title: string;
|
|
7
14
|
children: ReactNode;
|
|
8
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Defines whether the accordion item is initially open.
|
|
17
|
+
* This prop has no effect if the `open` prop is used.
|
|
18
|
+
* A value of `true` means the accordion item is initially open.
|
|
19
|
+
* A value of `false` means the accordion item is initially closed.
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
22
|
+
defaultOpen?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Controls the open state of the accordion item.
|
|
25
|
+
*/
|
|
26
|
+
open?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Called whenever the open state of the pane changes.
|
|
29
|
+
*/
|
|
30
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
9
31
|
/**
|
|
10
32
|
* When set to true, the item's children will not be rendered if the item is closed.
|
|
11
33
|
* When not set or set to false, the item's children will be rendered but hidden when the item is closed.
|
|
12
34
|
*/
|
|
13
35
|
unmountChildren?: boolean;
|
|
14
|
-
|
|
36
|
+
renderToolbar?: (isOpen: boolean) => ReactNode;
|
|
15
37
|
}
|
|
16
|
-
export declare function Accordion(props: AccordionProps): import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
export declare function Accordion<T extends string = string>(props: AccordionProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
17
39
|
export declare namespace Accordion {
|
|
18
|
-
var Item: (props: AccordionItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
var Item: <T extends string = string>(props: AccordionItemProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
19
41
|
}
|
|
20
42
|
//# sourceMappingURL=accordion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion.d.ts","sourceRoot":"","sources":["../../../src/components/accordion/accordion.tsx"],"names":[],"mappings":"
|
|
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;AAKf,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,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,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,SAAS,CAAC;CAChD;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"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Colors } from '@blueprintjs/core';
|
|
2
3
|
import styled from '@emotion/styled';
|
|
4
|
+
import { useControllableState } from '@radix-ui/react-use-controllable-state';
|
|
3
5
|
import { useCallback } from 'react';
|
|
4
6
|
import { useAccordionContext } from './accordion_context.js';
|
|
5
7
|
const AccordionItemHeader = styled.div `
|
|
@@ -12,11 +14,19 @@ const AccordionItemHeader = styled.div `
|
|
|
12
14
|
font-weight: bold;
|
|
13
15
|
text-decoration: none;
|
|
14
16
|
text-shadow: white 0 1px 0;
|
|
15
|
-
background: white
|
|
17
|
+
background: white
|
|
18
|
+
linear-gradient(${Colors.LIGHT_GRAY5} 5%, ${Colors.LIGHT_GRAY3} 100%) repeat
|
|
19
|
+
scroll 0 0;
|
|
16
20
|
width: 100%;
|
|
17
21
|
user-select: none;
|
|
18
22
|
justify-content: space-between;
|
|
19
|
-
padding:
|
|
23
|
+
padding-left: 12px;
|
|
24
|
+
|
|
25
|
+
&:hover {
|
|
26
|
+
background: white
|
|
27
|
+
linear-gradient(${Colors.LIGHT_GRAY4} 5%, ${Colors.LIGHT_GRAY2} 100%)
|
|
28
|
+
repeat scroll 0 0;
|
|
29
|
+
}
|
|
20
30
|
`;
|
|
21
31
|
const AccordionContainer = styled.div `
|
|
22
32
|
display: flex;
|
|
@@ -28,29 +38,34 @@ export function Accordion(props) {
|
|
|
28
38
|
return _jsx(AccordionContainer, { children: props.children });
|
|
29
39
|
}
|
|
30
40
|
Accordion.Item = function AccordionItem(props) {
|
|
31
|
-
const { title, children,
|
|
32
|
-
const
|
|
41
|
+
const { id, title, children, defaultOpen = false, open, renderToolbar, onOpenChange, } = props;
|
|
42
|
+
const [isOpen, setIsOpen] = useControllableState({
|
|
43
|
+
prop: open,
|
|
44
|
+
defaultProp: defaultOpen,
|
|
45
|
+
onChange: onOpenChange,
|
|
46
|
+
});
|
|
47
|
+
const { utils, unmountChildren } = useAccordionContext(id, setIsOpen);
|
|
33
48
|
const shouldUnmountChildren = props.unmountChildren === undefined
|
|
34
49
|
? unmountChildren
|
|
35
50
|
: props.unmountChildren;
|
|
36
51
|
const onClickHandle = useCallback((event) => {
|
|
37
52
|
if (event.shiftKey) {
|
|
38
|
-
utils.
|
|
53
|
+
utils.closeOthers();
|
|
39
54
|
}
|
|
40
55
|
else {
|
|
41
56
|
utils.toggle();
|
|
42
57
|
}
|
|
43
58
|
}, [utils]);
|
|
44
59
|
return (_jsxs("div", { style: {
|
|
45
|
-
flex:
|
|
60
|
+
flex: isOpen ? '1 1 1px' : 'none',
|
|
46
61
|
display: 'flex',
|
|
47
62
|
flexDirection: 'column',
|
|
48
63
|
isolation: 'isolate',
|
|
49
64
|
}, children: [_jsxs(AccordionItemHeader, { onClick: onClickHandle, role: "button", children: [_jsx("div", { style: {
|
|
50
65
|
padding: '5px 0px',
|
|
51
|
-
}, children: title }),
|
|
52
|
-
display:
|
|
53
|
-
flex:
|
|
66
|
+
}, children: title }), renderToolbar?.(isOpen ?? false)] }), !isOpen && shouldUnmountChildren ? null : (_jsx("div", { style: {
|
|
67
|
+
display: isOpen ? 'flex' : 'none',
|
|
68
|
+
flex: isOpen ? '1 1 1px' : 'none',
|
|
54
69
|
backgroundColor: 'white',
|
|
55
70
|
maxHeight: '100%',
|
|
56
71
|
overflow: 'hidden',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion.js","sourceRoot":"","sources":["../../../src/components/accordion/accordion.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"accordion.js","sourceRoot":"","sources":["../../../src/components/accordion/accordion.tsx"],"names":[],"mappings":"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"}
|
|
@@ -1,28 +1,21 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AccordionItemSetIsOpen, AccordionState } from './accordion_context_utils.js';
|
|
2
2
|
export type ContextType = [
|
|
3
3
|
AccordionContext,
|
|
4
4
|
{
|
|
5
|
-
|
|
6
|
-
toggle: (
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
change: (
|
|
5
|
+
closeAllExcept: (except: string) => void;
|
|
6
|
+
toggle: (id: string) => void;
|
|
7
|
+
unregister: (id: string) => void;
|
|
8
|
+
register: (id: string, setIsOpen: AccordionItemSetIsOpen) => void;
|
|
9
|
+
change: (id: string, isOpen: boolean) => void;
|
|
10
10
|
}
|
|
11
11
|
];
|
|
12
12
|
type AccordionContext = AccordionState;
|
|
13
13
|
export declare const accordionContext: import("react").Context<ContextType | null>;
|
|
14
|
-
export declare function
|
|
15
|
-
open: (title: string) => void;
|
|
16
|
-
close: (title: string) => void;
|
|
17
|
-
};
|
|
18
|
-
export declare function useAccordionContext(title: string, defaultOpened?: boolean): {
|
|
19
|
-
item: AccordionItemState | undefined;
|
|
14
|
+
export declare function useAccordionContext(id: string, setIsOpen: AccordionItemSetIsOpen): {
|
|
20
15
|
unmountChildren: boolean;
|
|
21
16
|
utils: {
|
|
22
|
-
|
|
17
|
+
closeOthers: () => void;
|
|
23
18
|
toggle: () => void;
|
|
24
|
-
remove: () => void;
|
|
25
|
-
create: (defaultOpened?: boolean) => AccordionItemState;
|
|
26
19
|
};
|
|
27
20
|
};
|
|
28
21
|
export {};
|
|
@@ -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,sBAAsB,EACtB,cAAc,EACf,MAAM,8BAA8B,CAAC;AAEtC,MAAM,MAAM,WAAW,GAAG;IACxB,gBAAgB;IAChB;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;AAEF,KAAK,gBAAgB,GAAG,cAAc,CAAC;AAEvC,eAAO,MAAM,gBAAgB,6CAA0C,CAAC;AAExE,wBAAgB,mBAAmB,CACjC,EAAE,EAAE,MAAM,EACV,SAAS,EAAE,sBAAsB;;;;;;EAyBlC"}
|
|
@@ -1,39 +1,21 @@
|
|
|
1
1
|
import { createContext, useContext, useEffect, useMemo } from 'react';
|
|
2
|
-
import { getItem } from './accordion_context.utils.js';
|
|
3
2
|
export const accordionContext = createContext(null);
|
|
4
|
-
export function
|
|
5
|
-
const context = useContext(accordionContext);
|
|
6
|
-
if (!context) {
|
|
7
|
-
throw new Error('AccordionContext was not found');
|
|
8
|
-
}
|
|
9
|
-
const [, utils] = context;
|
|
10
|
-
return useMemo(() => {
|
|
11
|
-
return {
|
|
12
|
-
open: (title) => utils.change(title, true),
|
|
13
|
-
close: (title) => utils.change(title, false),
|
|
14
|
-
};
|
|
15
|
-
}, [utils]);
|
|
16
|
-
}
|
|
17
|
-
export function useAccordionContext(title, defaultOpened) {
|
|
3
|
+
export function useAccordionContext(id, setIsOpen) {
|
|
18
4
|
const context = useContext(accordionContext);
|
|
19
5
|
if (!context) {
|
|
20
6
|
throw new Error('AccordionContext was not found');
|
|
21
7
|
}
|
|
22
8
|
const [state, utils] = context;
|
|
23
9
|
useEffect(() => {
|
|
24
|
-
utils.
|
|
25
|
-
return () => utils.
|
|
26
|
-
}, [
|
|
27
|
-
const item = getItem(title, state.items);
|
|
10
|
+
utils.register(id, setIsOpen);
|
|
11
|
+
return () => utils.unregister(id);
|
|
12
|
+
}, [id, utils, setIsOpen]);
|
|
28
13
|
return useMemo(() => ({
|
|
29
|
-
item,
|
|
30
14
|
unmountChildren: state.unmountChildren,
|
|
31
15
|
utils: {
|
|
32
|
-
|
|
33
|
-
toggle: () => utils.toggle(
|
|
34
|
-
remove: () => utils.remove(title),
|
|
35
|
-
create: (defaultOpened) => utils.create(title, defaultOpened),
|
|
16
|
+
closeOthers: () => utils.closeAllExcept(id),
|
|
17
|
+
toggle: () => utils.toggle(id),
|
|
36
18
|
},
|
|
37
|
-
}), [
|
|
19
|
+
}), [id, utils, state.unmountChildren]);
|
|
38
20
|
}
|
|
39
21
|
//# sourceMappingURL=accordion_context.js.map
|
|
@@ -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;AAoBtE,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAqB,IAAI,CAAC,CAAC;AAExE,MAAM,UAAU,mBAAmB,CACjC,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,KAAK,EAAE;YACL,WAAW,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,EAAE,CAAC;YAC3C,MAAM,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;SAC/B;KACF,CAAC,EACF,CAAC,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,eAAe,CAAC,CACnC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface AccordionProviderProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
unmountChildren?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function AccordionProvider(props: AccordionProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
//# sourceMappingURL=accordion_context_provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accordion_context_provider.d.ts","sourceRoot":"","sources":["../../../src/components/accordion/accordion_context_provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAUvC,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,SAAS,CAAC;IACpB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,2CA+D9D"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo, useRef } from 'react';
|
|
3
|
+
import { assert } from '../utils/index.js';
|
|
4
|
+
import { accordionContext } from './accordion_context.js';
|
|
5
|
+
import { getAccordionRegister } from './accordion_context_utils.js';
|
|
6
|
+
export function AccordionProvider(props) {
|
|
7
|
+
const { unmountChildren = false, children } = props;
|
|
8
|
+
const registerRef = useRef(getAccordionRegister());
|
|
9
|
+
const utils = useMemo(() => {
|
|
10
|
+
return {
|
|
11
|
+
change: (id, isOpen) => {
|
|
12
|
+
assert(registerRef.current);
|
|
13
|
+
const item = registerRef.current.get(id);
|
|
14
|
+
if (item) {
|
|
15
|
+
item.setIsOpen(isOpen);
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
closeAllExcept: (id) => {
|
|
19
|
+
assert(registerRef.current);
|
|
20
|
+
for (const [key, item] of registerRef.current.entries()) {
|
|
21
|
+
if (key === id) {
|
|
22
|
+
item.setIsOpen(true);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
item.setIsOpen(false);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
toggle: (id) => {
|
|
30
|
+
assert(registerRef.current);
|
|
31
|
+
const item = registerRef.current.get(id);
|
|
32
|
+
if (item) {
|
|
33
|
+
item.setIsOpen((prevState) => !prevState);
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
unregister: (id) => {
|
|
37
|
+
assert(registerRef.current);
|
|
38
|
+
registerRef.current.delete(id);
|
|
39
|
+
},
|
|
40
|
+
register: (id, setIsOpen) => {
|
|
41
|
+
assert(registerRef.current);
|
|
42
|
+
const item = registerRef.current.get(id);
|
|
43
|
+
if (item !== undefined) {
|
|
44
|
+
throw new Error(`Accordion item with title "${id}" already exists. Using non-unique titles can lead to unexpected behavior.`);
|
|
45
|
+
}
|
|
46
|
+
registerRef.current.set(id, {
|
|
47
|
+
setIsOpen,
|
|
48
|
+
});
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
}, [registerRef]);
|
|
52
|
+
const contextValue = useMemo(() => {
|
|
53
|
+
return [
|
|
54
|
+
{
|
|
55
|
+
unmountChildren,
|
|
56
|
+
},
|
|
57
|
+
utils,
|
|
58
|
+
];
|
|
59
|
+
}, [unmountChildren, utils]);
|
|
60
|
+
return (_jsx(accordionContext.Provider, { value: contextValue, children: children }));
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=accordion_context_provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accordion_context_provider.js","sourceRoot":"","sources":["../../../src/components/accordion/accordion_context_provider.tsx"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
export interface AccordionItemState {
|
|
3
|
+
title: string;
|
|
4
|
+
onChange: AccordionItemSetIsOpen;
|
|
5
|
+
}
|
|
6
|
+
export interface AccordionState {
|
|
7
|
+
unmountChildren: boolean;
|
|
8
|
+
}
|
|
9
|
+
export type AccordionItemSetIsOpen = Dispatch<SetStateAction<boolean | undefined>>;
|
|
10
|
+
interface AccordionRegisteredItem {
|
|
11
|
+
setIsOpen: AccordionItemSetIsOpen;
|
|
12
|
+
}
|
|
13
|
+
export declare function getAccordionRegister(): Map<string, AccordionRegisteredItem>;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=accordion_context_utils.d.ts.map
|
|
@@ -0,0 +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,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,sBAAsB,CAAC;CAClC;AAED,MAAM,WAAW,cAAc;IAC7B,eAAe,EAAE,OAAO,CAAC;CAC1B;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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accordion_context_utils.js","sourceRoot":"","sources":["../../../src/components/accordion/accordion_context_utils.ts"],"names":[],"mappings":"AAmBA,MAAM,UAAU,oBAAoB;IAClC,OAAO,IAAI,GAAG,EAAmC,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface AccordionControls<T extends string = string> {
|
|
2
|
+
open: (id: T) => void;
|
|
3
|
+
close: (id: T) => void;
|
|
4
|
+
toggle: (id: T) => void;
|
|
5
|
+
closeAllExcept: (except: T) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function useAccordionControls<T extends string = string>(): AccordionControls<T>;
|
|
8
|
+
//# sourceMappingURL=accordion_hooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accordion_hooks.d.ts","sourceRoot":"","sources":["../../../src/components/accordion/accordion_hooks.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,iBAAiB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IAC1D,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,KAAK,IAAI,CAAC;IACtB,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,KAAK,IAAI,CAAC;IACvB,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC,KAAK,IAAI,CAAC;IACxB,cAAc,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,IAAI,CAAC;CACrC;AAED,wBAAgB,oBAAoB,CAClC,CAAC,SAAS,MAAM,GAAG,MAAM,KACtB,iBAAiB,CAAC,CAAC,CAAC,CAkBxB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useContext, useMemo } from 'react';
|
|
2
|
+
import { accordionContext } from './accordion_context.js';
|
|
3
|
+
export function useAccordionControls() {
|
|
4
|
+
const context = useContext(accordionContext);
|
|
5
|
+
if (!context) {
|
|
6
|
+
throw new Error('AccordionContext was not found');
|
|
7
|
+
}
|
|
8
|
+
const [, utils] = context;
|
|
9
|
+
return useMemo(() => ({
|
|
10
|
+
open: (id) => utils.change(id, true),
|
|
11
|
+
close: (id) => utils.change(id, false),
|
|
12
|
+
toggle: (id) => utils.toggle(id),
|
|
13
|
+
closeAllExcept: (except) => utils.closeAllExcept(except),
|
|
14
|
+
}), [utils]);
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=accordion_hooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accordion_hooks.js","sourceRoot":"","sources":["../../../src/components/accordion/accordion_hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAS1D,MAAM,UAAU,oBAAoB;IAGlC,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,EAAE,KAAK,CAAC,GAAG,OAAO,CAAC;IAE1B,OAAO,OAAO,CACZ,GAAG,EAAE,CAAC,CAAC;QACL,IAAI,EAAE,CAAC,EAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC;QACvC,KAAK,EAAE,CAAC,EAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC;QACzC,MAAM,EAAE,CAAC,EAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;QACnC,cAAc,EAAE,CAAC,MAAS,EAAE,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC;KAC5D,CAAC,EACF,CAAC,KAAK,CAAC,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export * from './accordion.js';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export { AccordionProvider } from './accordion_context.provider.js';
|
|
2
|
+
export * from './accordion_context_provider.js';
|
|
3
|
+
export * from './accordion_hooks.js';
|
|
5
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/accordion/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,
|
|
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,5 +1,4 @@
|
|
|
1
1
|
export * from './accordion.js';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export { AccordionProvider } from './accordion_context.provider.js';
|
|
2
|
+
export * from './accordion_context_provider.js';
|
|
3
|
+
export * from './accordion_hooks.js';
|
|
5
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/accordion/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/accordion/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iCAAiC,CAAC;AAChD,cAAc,sBAAsB,CAAC"}
|
|
@@ -10,7 +10,7 @@ export * from './hooks/index.js';
|
|
|
10
10
|
export * from './info-panel/index.js';
|
|
11
11
|
export * from './logger/index.js';
|
|
12
12
|
export * from './root-layout/index.js';
|
|
13
|
-
export * from './
|
|
13
|
+
export * from './split_pane/index.js';
|
|
14
14
|
export * from './table/index.js';
|
|
15
15
|
export * from './toolbar/index.js';
|
|
16
16
|
export * from './activity_bar/index.js';
|
package/lib/components/index.js
CHANGED
|
@@ -10,7 +10,7 @@ export * from './hooks/index.js';
|
|
|
10
10
|
export * from './info-panel/index.js';
|
|
11
11
|
export * from './logger/index.js';
|
|
12
12
|
export * from './root-layout/index.js';
|
|
13
|
-
export * from './
|
|
13
|
+
export * from './split_pane/index.js';
|
|
14
14
|
export * from './table/index.js';
|
|
15
15
|
export * from './toolbar/index.js';
|
|
16
16
|
export * from './activity_bar/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/split_pane/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/split_pane/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
+
import type { SplitPaneSize } from './split_pane_helpers.js';
|
|
2
3
|
export type SplitPaneDirection = 'vertical' | 'horizontal';
|
|
3
4
|
export type SplitPaneSide = 'start' | 'end';
|
|
4
|
-
export type SplitPaneSize = `${number}%` | `${number}px`;
|
|
5
|
-
export type SplitPaneType = '%' | 'px';
|
|
6
5
|
export interface SplitPaneProps {
|
|
7
6
|
/**
|
|
8
7
|
* Whether the split is done in the horizontal or vertical direction.
|
|
@@ -44,8 +43,8 @@ export interface SplitPaneProps {
|
|
|
44
43
|
* If specified, closes / opens the pane automatically once the available space
|
|
45
44
|
* for the SplitPane along the axis defined by the `direction` prop becomes
|
|
46
45
|
* smaller / larger (respectively) than this value. The value is in pixels.
|
|
47
|
-
* After the user
|
|
48
|
-
*
|
|
46
|
+
* After the user interacts with the splitter, the pane will no longer open
|
|
47
|
+
* or close automatically.
|
|
49
48
|
*/
|
|
50
49
|
closeThreshold?: number;
|
|
51
50
|
/**
|
|
@@ -62,8 +61,11 @@ export interface SplitPaneProps {
|
|
|
62
61
|
onSizeChange?: (size: SplitPaneSize) => void;
|
|
63
62
|
/**
|
|
64
63
|
* The two React elements to show on both sides of the pane.
|
|
64
|
+
* If one of the elements is `null`, the splitter will disappear and the
|
|
65
|
+
* other element will take the full space.
|
|
66
|
+
* If both elements are `null`, only a container will be rendered.
|
|
65
67
|
*/
|
|
66
68
|
children: [ReactNode, ReactNode];
|
|
67
69
|
}
|
|
68
70
|
export declare function SplitPane(props: SplitPaneProps): import("react/jsx-runtime").JSX.Element;
|
|
69
|
-
//# sourceMappingURL=
|
|
71
|
+
//# sourceMappingURL=split_pane.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"split_pane.d.ts","sourceRoot":"","sources":["../../../src/components/split_pane/split_pane.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAGV,SAAS,EAEV,MAAM,OAAO,CAAC;AAKf,OAAO,KAAK,EAAE,aAAa,EAAiB,MAAM,yBAAyB,CAAC;AAI5E,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG,YAAY,CAAC;AAC3D,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,KAAK,CAAC;AAE5C,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,aAAa,CAAC;IAE/B;;;;;OAKG;IACH,WAAW,CAAC,EAAE,aAAa,CAAC;IAE5B;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IAEzC;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,aAAa,KAAK,IAAI,CAAC;IAE7C;;OAEG;IACH,IAAI,CAAC,EAAE,aAAa,CAAC;IAErB;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;IAE7C;;;;;OAKG;IACH,QAAQ,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;CAClC;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,2CAmG9C"}
|