@lumx/react 3.18.2-alpha.0 → 3.18.2-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_internal/index.js +236 -0
- package/_internal/index.js.map +1 -0
- package/index.js +3 -75
- package/index.js.map +1 -1
- package/package.json +3 -3
- package/src/utils/disabled/DisabledStateContext.tsx +29 -0
- package/src/utils/disabled/DisabledStateProvider.stories.tsx +88 -0
- package/src/utils/disabled/index.ts +1 -0
- package/src/utils/disabled/useDisableStateProps.tsx +4 -1
- package/src/utils/index.ts +1 -0
- package/utils/index.d.ts +20 -1
- package/utils/index.js +1 -134
- package/utils/index.js.map +1 -1
package/package.json
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
"url": "https://github.com/lumapps/design-system/issues"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@lumx/core": "^3.18.2-alpha.
|
|
10
|
-
"@lumx/icons": "^3.18.2-alpha.
|
|
9
|
+
"@lumx/core": "^3.18.2-alpha.1",
|
|
10
|
+
"@lumx/icons": "^3.18.2-alpha.1",
|
|
11
11
|
"@popperjs/core": "^2.5.4",
|
|
12
12
|
"body-scroll-lock": "^3.1.5",
|
|
13
13
|
"classnames": "^2.3.2",
|
|
@@ -105,5 +105,5 @@
|
|
|
105
105
|
"build:storybook": "storybook build"
|
|
106
106
|
},
|
|
107
107
|
"sideEffects": false,
|
|
108
|
-
"version": "3.18.2-alpha.
|
|
108
|
+
"version": "3.18.2-alpha.1"
|
|
109
109
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React, { useContext } from 'react';
|
|
2
|
+
|
|
3
|
+
/** Disable state */
|
|
4
|
+
type DisabledStateContextValue =
|
|
5
|
+
| {
|
|
6
|
+
state: 'disabled';
|
|
7
|
+
}
|
|
8
|
+
| { state: undefined | null };
|
|
9
|
+
|
|
10
|
+
export const DisabledStateContext = React.createContext<DisabledStateContextValue>({ state: null });
|
|
11
|
+
|
|
12
|
+
export type DisabledStateProviderProps = DisabledStateContextValue & {
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Disabled state provider.
|
|
18
|
+
* All nested LumX Design System components inherit this disabled state.
|
|
19
|
+
*/
|
|
20
|
+
export function DisabledStateProvider({ children, ...value }: DisabledStateProviderProps) {
|
|
21
|
+
return <DisabledStateContext.Provider value={value}>{children}</DisabledStateContext.Provider>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Get DisabledState context value
|
|
26
|
+
*/
|
|
27
|
+
export function useDisabledStateContext(): DisabledStateContextValue {
|
|
28
|
+
return useContext(DisabledStateContext);
|
|
29
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
Button,
|
|
5
|
+
Checkbox,
|
|
6
|
+
Chip,
|
|
7
|
+
DatePickerField,
|
|
8
|
+
IconButton,
|
|
9
|
+
Link,
|
|
10
|
+
List,
|
|
11
|
+
ListItem,
|
|
12
|
+
RadioButton,
|
|
13
|
+
Switch,
|
|
14
|
+
TextField,
|
|
15
|
+
} from '@lumx/react';
|
|
16
|
+
import { DisabledStateProvider } from '@lumx/react/utils';
|
|
17
|
+
import { getSelectArgType } from '@lumx/react/stories/controls/selectArgType';
|
|
18
|
+
import { disableArgTypes } from '@lumx/react/stories/utils/disableArgTypes';
|
|
19
|
+
import { mdiFoodApple } from '@lumx/icons';
|
|
20
|
+
|
|
21
|
+
export default {
|
|
22
|
+
title: 'LumX components/DisabledStateProvider',
|
|
23
|
+
component: DisabledStateProvider,
|
|
24
|
+
argTypes: {
|
|
25
|
+
state: getSelectArgType(['disabled', undefined]),
|
|
26
|
+
...disableArgTypes(['children']),
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Disabling nested children
|
|
32
|
+
*/
|
|
33
|
+
export const Disabled = {
|
|
34
|
+
args: {
|
|
35
|
+
state: 'disabled',
|
|
36
|
+
},
|
|
37
|
+
render: ({ state }: any) => (
|
|
38
|
+
<DisabledStateProvider state={state}>
|
|
39
|
+
<Button>Button</Button>
|
|
40
|
+
<Button isDisabled>Disabled Button</Button>
|
|
41
|
+
</DisabledStateProvider>
|
|
42
|
+
),
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Testing when the context is not active
|
|
47
|
+
*/
|
|
48
|
+
export const NotDisabled = {
|
|
49
|
+
args: {
|
|
50
|
+
state: undefined,
|
|
51
|
+
},
|
|
52
|
+
render: ({ state }: any) => (
|
|
53
|
+
<DisabledStateProvider state={state}>
|
|
54
|
+
<Button>Button</Button>
|
|
55
|
+
<Button isDisabled>Disabled Button</Button>
|
|
56
|
+
</DisabledStateProvider>
|
|
57
|
+
),
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Testing disabling children
|
|
62
|
+
*/
|
|
63
|
+
export const AllComponents = {
|
|
64
|
+
args: {
|
|
65
|
+
state: 'disabled',
|
|
66
|
+
},
|
|
67
|
+
render: ({ state }: any) => (
|
|
68
|
+
<DisabledStateProvider state={state}>
|
|
69
|
+
<Button>Button</Button>
|
|
70
|
+
<IconButton label="Icon button" icon={mdiFoodApple} />
|
|
71
|
+
<Checkbox label="Checkbox" />
|
|
72
|
+
<Chip onClick={() => {}}>Chip</Chip>
|
|
73
|
+
<DatePickerField
|
|
74
|
+
nextButtonProps={{ label: 'Next' }}
|
|
75
|
+
previousButtonProps={{ label: 'Previous' }}
|
|
76
|
+
value={new Date()}
|
|
77
|
+
onChange={() => {}}
|
|
78
|
+
/>
|
|
79
|
+
<Link href="https://example.com">Link</Link>
|
|
80
|
+
<List>
|
|
81
|
+
<ListItem onItemSelected={() => {}}>Clickable list item</ListItem>
|
|
82
|
+
</List>
|
|
83
|
+
<RadioButton label="Radio button" />
|
|
84
|
+
<Switch>Switch</Switch>
|
|
85
|
+
<TextField onChange={() => {}} value="" />
|
|
86
|
+
</DisabledStateProvider>
|
|
87
|
+
),
|
|
88
|
+
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { useDisabledStateContext } from './DisabledStateContext';
|
|
2
|
+
|
|
1
3
|
type GenericProps = {
|
|
2
4
|
disabled?: boolean;
|
|
3
5
|
isDisabled?: boolean;
|
|
@@ -21,8 +23,9 @@ interface Output<TProps extends GenericProps> {
|
|
|
21
23
|
*/
|
|
22
24
|
export function useDisableStateProps<TProps extends GenericProps>(props: TProps): Output<TProps> {
|
|
23
25
|
const { disabled, isDisabled = disabled, 'aria-disabled': ariaDisabled, onClick, onChange, ...otherProps } = props;
|
|
26
|
+
const disabledStateContext = useDisabledStateContext();
|
|
24
27
|
const disabledStateProps = {
|
|
25
|
-
disabled: isDisabled,
|
|
28
|
+
disabled: disabledStateContext?.state === 'disabled' || isDisabled,
|
|
26
29
|
'aria-disabled': ariaDisabled === true || ariaDisabled === 'true',
|
|
27
30
|
};
|
|
28
31
|
const isAnyDisabled = disabledStateProps['aria-disabled'] || disabledStateProps.disabled;
|
package/src/utils/index.ts
CHANGED
package/utils/index.d.ts
CHANGED
|
@@ -58,4 +58,23 @@ interface PortalProps {
|
|
|
58
58
|
*/
|
|
59
59
|
declare const Portal: React.FC<PortalProps>;
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
/** Disable state */
|
|
62
|
+
type DisabledStateContextValue = {
|
|
63
|
+
state: 'disabled';
|
|
64
|
+
} | {
|
|
65
|
+
state: undefined | null;
|
|
66
|
+
};
|
|
67
|
+
type DisabledStateProviderProps = DisabledStateContextValue & {
|
|
68
|
+
children: React.ReactNode;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Disabled state provider.
|
|
72
|
+
* All nested LumX Design System components inherit this disabled state.
|
|
73
|
+
*/
|
|
74
|
+
declare function DisabledStateProvider({ children, ...value }: DisabledStateProviderProps): React.JSX.Element;
|
|
75
|
+
/**
|
|
76
|
+
* Get DisabledState context value
|
|
77
|
+
*/
|
|
78
|
+
declare function useDisabledStateContext(): DisabledStateContextValue;
|
|
79
|
+
|
|
80
|
+
export { ClickAwayProvider, DisabledStateProvider, Portal, type PortalInit, type PortalProps, PortalProvider, type PortalProviderProps, useDisabledStateContext };
|
package/utils/index.js
CHANGED
|
@@ -1,135 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import isEmpty from 'lodash/isEmpty';
|
|
3
|
-
import { createPortal } from 'react-dom';
|
|
4
|
-
|
|
5
|
-
const EVENT_TYPES = ['mousedown', 'touchstart'];
|
|
6
|
-
function isClickAway(targets, refs) {
|
|
7
|
-
// The targets elements are not contained in any of the listed element references.
|
|
8
|
-
return !refs.some(ref => targets.some(target => {
|
|
9
|
-
var _ref$current;
|
|
10
|
-
return ref === null || ref === void 0 ? void 0 : (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.contains(target);
|
|
11
|
-
}));
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Listen to clicks away from the given elements and callback the passed in function.
|
|
15
|
-
*
|
|
16
|
-
* Warning: If you need to detect click away on nested React portals, please use the `ClickAwayProvider` component.
|
|
17
|
-
*/
|
|
18
|
-
function useClickAway({
|
|
19
|
-
callback,
|
|
20
|
-
childrenRefs
|
|
21
|
-
}) {
|
|
22
|
-
useEffect(() => {
|
|
23
|
-
const {
|
|
24
|
-
current: currentRefs
|
|
25
|
-
} = childrenRefs;
|
|
26
|
-
if (!callback || !currentRefs || isEmpty(currentRefs)) {
|
|
27
|
-
return undefined;
|
|
28
|
-
}
|
|
29
|
-
const listener = evt => {
|
|
30
|
-
var _evt$composedPath;
|
|
31
|
-
const targets = [(_evt$composedPath = evt.composedPath) === null || _evt$composedPath === void 0 ? void 0 : _evt$composedPath.call(evt)[0], evt.target];
|
|
32
|
-
if (isClickAway(targets, currentRefs)) {
|
|
33
|
-
callback(evt);
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
EVENT_TYPES.forEach(evtType => document.addEventListener(evtType, listener));
|
|
37
|
-
return () => {
|
|
38
|
-
EVENT_TYPES.forEach(evtType => document.removeEventListener(evtType, listener));
|
|
39
|
-
};
|
|
40
|
-
}, [callback, childrenRefs]);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const ClickAwayAncestorContext = /*#__PURE__*/createContext(null);
|
|
44
|
-
/**
|
|
45
|
-
* Component combining the `useClickAway` hook with a React context to hook into the React component tree and make sure
|
|
46
|
-
* we take into account both the DOM tree and the React tree to detect click away.
|
|
47
|
-
*
|
|
48
|
-
* @return the react component.
|
|
49
|
-
*/
|
|
50
|
-
const ClickAwayProvider = ({
|
|
51
|
-
children,
|
|
52
|
-
callback,
|
|
53
|
-
childrenRefs,
|
|
54
|
-
parentRef
|
|
55
|
-
}) => {
|
|
56
|
-
const parentContext = useContext(ClickAwayAncestorContext);
|
|
57
|
-
const currentContext = useMemo(() => {
|
|
58
|
-
const context = {
|
|
59
|
-
childrenRefs: [],
|
|
60
|
-
/**
|
|
61
|
-
* Add element refs to the current context and propagate to the parent context.
|
|
62
|
-
*/
|
|
63
|
-
addRefs(...newChildrenRefs) {
|
|
64
|
-
// Add element refs that should be considered as inside the click away context.
|
|
65
|
-
context.childrenRefs.push(...newChildrenRefs);
|
|
66
|
-
if (parentContext) {
|
|
67
|
-
// Also add then to the parent context
|
|
68
|
-
parentContext.addRefs(...newChildrenRefs);
|
|
69
|
-
if (parentRef) {
|
|
70
|
-
// The parent element is also considered as inside the parent click away context but not inside the current context
|
|
71
|
-
parentContext.addRefs(parentRef);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
return context;
|
|
77
|
-
}, [parentContext, parentRef]);
|
|
78
|
-
useEffect(() => {
|
|
79
|
-
const {
|
|
80
|
-
current: currentRefs
|
|
81
|
-
} = childrenRefs;
|
|
82
|
-
if (!currentRefs) {
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
currentContext.addRefs(...currentRefs);
|
|
86
|
-
}, [currentContext, childrenRefs]);
|
|
87
|
-
useClickAway({
|
|
88
|
-
callback,
|
|
89
|
-
childrenRefs: useRef(currentContext.childrenRefs)
|
|
90
|
-
});
|
|
91
|
-
return /*#__PURE__*/React__default.createElement(ClickAwayAncestorContext.Provider, {
|
|
92
|
-
value: currentContext
|
|
93
|
-
}, children);
|
|
94
|
-
};
|
|
95
|
-
ClickAwayProvider.displayName = 'ClickAwayProvider';
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* Portal initializing function.
|
|
99
|
-
* If it does not provide a container, the Portal children will render in classic React tree and not in a portal.
|
|
100
|
-
*/
|
|
101
|
-
|
|
102
|
-
const PortalContext = /*#__PURE__*/React__default.createContext(() => ({
|
|
103
|
-
container: document.body
|
|
104
|
-
}));
|
|
105
|
-
/**
|
|
106
|
-
* Customize where <Portal> wrapped elements render (tooltip, popover, dialog, etc.)
|
|
107
|
-
*/
|
|
108
|
-
const PortalProvider = PortalContext.Provider;
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* Render children in a portal outside the current DOM position
|
|
112
|
-
* (defaults to `document.body` but can be customized with the PortalContextProvider)
|
|
113
|
-
*/
|
|
114
|
-
const Portal = ({
|
|
115
|
-
children,
|
|
116
|
-
enabled = true
|
|
117
|
-
}) => {
|
|
118
|
-
const init = React__default.useContext(PortalContext);
|
|
119
|
-
const context = React__default.useMemo(() => {
|
|
120
|
-
return enabled ? init() : null;
|
|
121
|
-
},
|
|
122
|
-
// Only update on 'enabled'
|
|
123
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
124
|
-
[enabled]);
|
|
125
|
-
React__default.useLayoutEffect(() => {
|
|
126
|
-
return context === null || context === void 0 ? void 0 : context.teardown;
|
|
127
|
-
}, [context === null || context === void 0 ? void 0 : context.teardown, enabled]);
|
|
128
|
-
if (!(context !== null && context !== void 0 && context.container)) {
|
|
129
|
-
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, children);
|
|
130
|
-
}
|
|
131
|
-
return /*#__PURE__*/createPortal(children, context.container);
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
export { ClickAwayProvider, Portal, PortalProvider };
|
|
1
|
+
export { C as ClickAwayProvider, D as DisabledStateProvider, P as Portal, c as PortalProvider, u as useDisabledStateContext } from '../_internal/index.js';
|
|
135
2
|
//# sourceMappingURL=index.js.map
|
package/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/hooks/useClickAway.tsx","../../src/utils/ClickAwayProvider/ClickAwayProvider.tsx","../../src/utils/Portal/PortalProvider.tsx","../../src/utils/Portal/Portal.tsx"],"sourcesContent":["import { RefObject, useEffect } from 'react';\n\nimport { Falsy } from '@lumx/react/utils/type';\n\nimport isEmpty from 'lodash/isEmpty';\n\nconst EVENT_TYPES = ['mousedown', 'touchstart'];\n\nfunction isClickAway(targets: HTMLElement[], refs: Array<RefObject<HTMLElement>>): boolean {\n // The targets elements are not contained in any of the listed element references.\n return !refs.some((ref) => targets.some((target) => ref?.current?.contains(target)));\n}\n\nexport interface ClickAwayParameters {\n /**\n * A callback function to call when the user clicks away from the elements.\n */\n callback: EventListener | Falsy;\n /**\n * Elements considered within the click away context (clicking outside them will trigger the click away callback).\n */\n childrenRefs: RefObject<Array<RefObject<HTMLElement>>>;\n}\n\n/**\n * Listen to clicks away from the given elements and callback the passed in function.\n *\n * Warning: If you need to detect click away on nested React portals, please use the `ClickAwayProvider` component.\n */\nexport function useClickAway({ callback, childrenRefs }: ClickAwayParameters): void {\n useEffect(() => {\n const { current: currentRefs } = childrenRefs;\n if (!callback || !currentRefs || isEmpty(currentRefs)) {\n return undefined;\n }\n const listener: EventListener = (evt) => {\n const targets = [evt.composedPath?.()[0], evt.target] as HTMLElement[];\n if (isClickAway(targets, currentRefs)) {\n callback(evt);\n }\n };\n\n EVENT_TYPES.forEach((evtType) => document.addEventListener(evtType, listener));\n return () => {\n EVENT_TYPES.forEach((evtType) => document.removeEventListener(evtType, listener));\n };\n }, [callback, childrenRefs]);\n}\n","import React, { createContext, RefObject, useContext, useEffect, useMemo, useRef } from 'react';\nimport { ClickAwayParameters, useClickAway } from '@lumx/react/hooks/useClickAway';\n\ninterface ContextValue {\n childrenRefs: Array<RefObject<HTMLElement>>;\n addRefs(...newChildrenRefs: Array<RefObject<HTMLElement>>): void;\n}\n\nconst ClickAwayAncestorContext = createContext<ContextValue | null>(null);\n\ninterface ClickAwayProviderProps extends ClickAwayParameters {\n /**\n * (Optional) Element that should be considered as part of the parent\n */\n parentRef?: RefObject<HTMLElement>;\n /**\n * Children\n */\n children?: React.ReactNode;\n}\n\n/**\n * Component combining the `useClickAway` hook with a React context to hook into the React component tree and make sure\n * we take into account both the DOM tree and the React tree to detect click away.\n *\n * @return the react component.\n */\nexport const ClickAwayProvider: React.FC<ClickAwayProviderProps> = ({\n children,\n callback,\n childrenRefs,\n parentRef,\n}) => {\n const parentContext = useContext(ClickAwayAncestorContext);\n const currentContext = useMemo(() => {\n const context: ContextValue = {\n childrenRefs: [],\n /**\n * Add element refs to the current context and propagate to the parent context.\n */\n addRefs(...newChildrenRefs) {\n // Add element refs that should be considered as inside the click away context.\n context.childrenRefs.push(...newChildrenRefs);\n\n if (parentContext) {\n // Also add then to the parent context\n parentContext.addRefs(...newChildrenRefs);\n if (parentRef) {\n // The parent element is also considered as inside the parent click away context but not inside the current context\n parentContext.addRefs(parentRef);\n }\n }\n },\n };\n return context;\n }, [parentContext, parentRef]);\n\n useEffect(() => {\n const { current: currentRefs } = childrenRefs;\n if (!currentRefs) {\n return;\n }\n currentContext.addRefs(...currentRefs);\n }, [currentContext, childrenRefs]);\n\n useClickAway({ callback, childrenRefs: useRef(currentContext.childrenRefs) });\n return <ClickAwayAncestorContext.Provider value={currentContext}>{children}</ClickAwayAncestorContext.Provider>;\n};\nClickAwayProvider.displayName = 'ClickAwayProvider';\n","import React from 'react';\n\ntype Container = DocumentFragment | Element;\n\n/**\n * Portal initializing function.\n * If it does not provide a container, the Portal children will render in classic React tree and not in a portal.\n */\nexport type PortalInit = () => {\n container?: Container;\n teardown?: () => void;\n};\n\nexport const PortalContext = React.createContext<PortalInit>(() => ({ container: document.body }));\n\nexport interface PortalProviderProps {\n children?: React.ReactNode;\n value: PortalInit;\n}\n\n/**\n * Customize where <Portal> wrapped elements render (tooltip, popover, dialog, etc.)\n */\nexport const PortalProvider: React.FC<PortalProviderProps> = PortalContext.Provider;\n","import React from 'react';\nimport { createPortal } from 'react-dom';\nimport { PortalContext } from './PortalProvider';\n\nexport interface PortalProps {\n enabled?: boolean;\n children: React.ReactNode;\n}\n\n/**\n * Render children in a portal outside the current DOM position\n * (defaults to `document.body` but can be customized with the PortalContextProvider)\n */\nexport const Portal: React.FC<PortalProps> = ({ children, enabled = true }) => {\n const init = React.useContext(PortalContext);\n const context = React.useMemo(\n () => {\n return enabled ? init() : null;\n },\n // Only update on 'enabled'\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [enabled],\n );\n\n React.useLayoutEffect(() => {\n return context?.teardown;\n }, [context?.teardown, enabled]);\n\n if (!context?.container) {\n return <>{children}</>;\n }\n return createPortal(children, context.container);\n};\n"],"names":["EVENT_TYPES","isClickAway","targets","refs","some","ref","target","_ref$current","current","contains","useClickAway","callback","childrenRefs","useEffect","currentRefs","isEmpty","undefined","listener","evt","_evt$composedPath","composedPath","call","forEach","evtType","document","addEventListener","removeEventListener","ClickAwayAncestorContext","createContext","ClickAwayProvider","children","parentRef","parentContext","useContext","currentContext","useMemo","context","addRefs","newChildrenRefs","push","useRef","React","createElement","Provider","value","displayName","PortalContext","container","body","PortalProvider","Portal","enabled","init","useLayoutEffect","teardown","Fragment","createPortal"],"mappings":";;;;AAMA,MAAMA,WAAW,GAAG,CAAC,WAAW,EAAE,YAAY,CAAC,CAAA;AAE/C,SAASC,WAAWA,CAACC,OAAsB,EAAEC,IA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