ingeniuscliq-core 0.4.15 → 0.4.17
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/dist/components/common/logo/Logo.tsx +1 -1
- package/dist/node_modules/@radix-ui/react-accordion/dist/index.js +3 -3
- package/dist/node_modules/@radix-ui/{react-select/node_modules/@radix-ui/react-popper/node_modules/@radix-ui/react-arrow → react-arrow}/dist/index.js +1 -1
- package/dist/node_modules/@radix-ui/react-avatar/dist/index.js +1 -1
- package/dist/node_modules/@radix-ui/react-checkbox/dist/index.js +2 -2
- package/dist/node_modules/@radix-ui/{react-accordion/node_modules/@radix-ui/react-collapsible → react-collapsible}/dist/index.js +7 -7
- package/dist/node_modules/@radix-ui/{react-select/node_modules/@radix-ui/react-collection → react-collection}/dist/index.js +3 -3
- package/dist/node_modules/@radix-ui/react-dialog/dist/index.js +5 -5
- package/dist/node_modules/@radix-ui/{react-select/node_modules/@radix-ui/react-dismissable-layer → react-dismissable-layer}/dist/index.js +4 -4
- package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +2 -2
- package/dist/node_modules/@radix-ui/{react-dialog/node_modules/@radix-ui/react-focus-scope → react-focus-scope}/dist/index.js +2 -2
- package/dist/node_modules/@radix-ui/react-label/dist/index.js +1 -1
- package/dist/node_modules/@radix-ui/{react-dropdown-menu/node_modules/@radix-ui/react-menu → react-menu}/dist/index.js +17 -17
- package/dist/node_modules/@radix-ui/react-popover/dist/index.js +6 -6
- package/dist/node_modules/@radix-ui/{react-popover/node_modules/@radix-ui/react-popper → react-popper}/dist/index.js +8 -8
- package/dist/node_modules/@radix-ui/{react-popover/node_modules/@radix-ui/react-portal → react-portal}/dist/index.js +1 -1
- package/dist/node_modules/@radix-ui/{react-popover/node_modules/@radix-ui/react-presence → react-presence}/dist/index.js +2 -2
- package/dist/node_modules/@radix-ui/{react-dropdown-menu/node_modules/@radix-ui/react-primitive → react-primitive}/dist/index.js +1 -1
- package/dist/node_modules/@radix-ui/react-radio-group/dist/index.js +3 -3
- package/dist/node_modules/@radix-ui/{react-radio-group/node_modules/@radix-ui/react-roving-focus → react-roving-focus}/dist/index.js +8 -8
- package/dist/node_modules/@radix-ui/react-select/dist/index.js +7 -7
- package/dist/node_modules/@radix-ui/react-separator/dist/index.js +1 -1
- package/dist/node_modules/@radix-ui/react-slider/dist/index.js +2 -2
- package/dist/node_modules/@radix-ui/react-switch/dist/index.js +1 -1
- package/dist/node_modules/@radix-ui/react-tabs/dist/index.js +3 -3
- package/dist/node_modules/@radix-ui/react-tooltip/dist/index.js +5 -5
- package/dist/node_modules/react-i18next/dist/es/defaults.js +2 -1
- package/package.json +10 -10
- package/src/core/commands/create-core-module.js +288 -0
- package/src/core/commands/create-module.js +288 -0
- package/src/core/commands/create-template.js +169 -0
- package/src/core/commands/rollback-core-module.js +195 -0
- package/src/core/commands/rollback-module.js +208 -0
- package/dist/node_modules/@radix-ui/react-accordion/node_modules/@radix-ui/react-collapsible/node_modules/@radix-ui/react-presence/dist/index.js +0 -130
- package/dist/node_modules/@radix-ui/react-accordion/node_modules/@radix-ui/react-collection/dist/index.js +0 -70
- package/dist/node_modules/@radix-ui/react-accordion/node_modules/@radix-ui/react-primitive/dist/index.js +0 -40
- package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-primitive/dist/index.js +0 -40
- package/dist/node_modules/@radix-ui/react-checkbox/node_modules/@radix-ui/react-presence/dist/index.js +0 -130
- package/dist/node_modules/@radix-ui/react-checkbox/node_modules/@radix-ui/react-primitive/dist/index.js +0 -40
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +0 -211
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-portal/dist/index.js +0 -17
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-presence/dist/index.js +0 -130
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-primitive/dist/index.js +0 -43
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-collection/dist/index.js +0 -70
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +0 -211
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-focus-scope/dist/index.js +0 -207
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-popper/dist/index.js +0 -283
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-popper/node_modules/@radix-ui/react-arrow/dist/index.js +0 -25
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-portal/dist/index.js +0 -17
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-presence/dist/index.js +0 -130
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-roving-focus/dist/index.js +0 -223
- package/dist/node_modules/@radix-ui/react-label/node_modules/@radix-ui/react-primitive/dist/index.js +0 -40
- package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +0 -211
- package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-focus-scope/dist/index.js +0 -207
- package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-popper/node_modules/@radix-ui/react-arrow/dist/index.js +0 -25
- package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-primitive/dist/index.js +0 -43
- package/dist/node_modules/@radix-ui/react-radio-group/node_modules/@radix-ui/react-presence/dist/index.js +0 -130
- package/dist/node_modules/@radix-ui/react-radio-group/node_modules/@radix-ui/react-primitive/dist/index.js +0 -40
- package/dist/node_modules/@radix-ui/react-radio-group/node_modules/@radix-ui/react-roving-focus/node_modules/@radix-ui/react-collection/dist/index.js +0 -70
- package/dist/node_modules/@radix-ui/react-select/node_modules/@radix-ui/react-focus-scope/dist/index.js +0 -207
- package/dist/node_modules/@radix-ui/react-select/node_modules/@radix-ui/react-popper/dist/index.js +0 -283
- package/dist/node_modules/@radix-ui/react-select/node_modules/@radix-ui/react-portal/dist/index.js +0 -17
- package/dist/node_modules/@radix-ui/react-select/node_modules/@radix-ui/react-primitive/dist/index.js +0 -43
- package/dist/node_modules/@radix-ui/react-select/node_modules/@radix-ui/react-visually-hidden/dist/index.js +0 -34
- package/dist/node_modules/@radix-ui/react-separator/node_modules/@radix-ui/react-primitive/dist/index.js +0 -40
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-collection/dist/index.js +0 -70
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-primitive/dist/index.js +0 -40
- package/dist/node_modules/@radix-ui/react-switch/node_modules/@radix-ui/react-primitive/dist/index.js +0 -40
- package/dist/node_modules/@radix-ui/react-tabs/node_modules/@radix-ui/react-presence/dist/index.js +0 -130
- package/dist/node_modules/@radix-ui/react-tabs/node_modules/@radix-ui/react-primitive/dist/index.js +0 -40
- package/dist/node_modules/@radix-ui/react-tabs/node_modules/@radix-ui/react-roving-focus/dist/index.js +0 -223
- package/dist/node_modules/@radix-ui/react-tabs/node_modules/@radix-ui/react-roving-focus/node_modules/@radix-ui/react-collection/dist/index.js +0 -70
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +0 -211
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-popper/dist/index.js +0 -283
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-popper/node_modules/@radix-ui/react-arrow/dist/index.js +0 -25
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-presence/dist/index.js +0 -130
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-primitive/dist/index.js +0 -43
- /package/dist/node_modules/@radix-ui/{react-tooltip/node_modules/@radix-ui/react-visually-hidden → react-visually-hidden}/dist/index.js +0 -0
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import React__default from 'react';
|
|
2
|
-
import { createContextScope } from '../../../../../../../../react-context/dist/index.js';
|
|
3
|
-
import { useComposedRefs } from '../../../../../../../../react-compose-refs/dist/index.js';
|
|
4
|
-
import { createSlot } from '../../../../../../../../react-slot/dist/index.js';
|
|
5
|
-
import { jsx } from 'react/jsx-runtime';
|
|
6
|
-
|
|
7
|
-
function createCollection(name) {
|
|
8
|
-
const PROVIDER_NAME = name + "CollectionProvider";
|
|
9
|
-
const [createCollectionContext, createCollectionScope] = createContextScope(PROVIDER_NAME);
|
|
10
|
-
const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(
|
|
11
|
-
PROVIDER_NAME,
|
|
12
|
-
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
13
|
-
);
|
|
14
|
-
const CollectionProvider = (props) => {
|
|
15
|
-
const { scope, children } = props;
|
|
16
|
-
const ref = React__default.useRef(null);
|
|
17
|
-
const itemMap = React__default.useRef(/* @__PURE__ */ new Map()).current;
|
|
18
|
-
return /* @__PURE__ */ jsx(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });
|
|
19
|
-
};
|
|
20
|
-
CollectionProvider.displayName = PROVIDER_NAME;
|
|
21
|
-
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
|
22
|
-
const CollectionSlotImpl = createSlot(COLLECTION_SLOT_NAME);
|
|
23
|
-
const CollectionSlot = React__default.forwardRef(
|
|
24
|
-
(props, forwardedRef) => {
|
|
25
|
-
const { scope, children } = props;
|
|
26
|
-
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
27
|
-
const composedRefs = useComposedRefs(forwardedRef, context.collectionRef);
|
|
28
|
-
return /* @__PURE__ */ jsx(CollectionSlotImpl, { ref: composedRefs, children });
|
|
29
|
-
}
|
|
30
|
-
);
|
|
31
|
-
CollectionSlot.displayName = COLLECTION_SLOT_NAME;
|
|
32
|
-
const ITEM_SLOT_NAME = name + "CollectionItemSlot";
|
|
33
|
-
const ITEM_DATA_ATTR = "data-radix-collection-item";
|
|
34
|
-
const CollectionItemSlotImpl = createSlot(ITEM_SLOT_NAME);
|
|
35
|
-
const CollectionItemSlot = React__default.forwardRef(
|
|
36
|
-
(props, forwardedRef) => {
|
|
37
|
-
const { scope, children, ...itemData } = props;
|
|
38
|
-
const ref = React__default.useRef(null);
|
|
39
|
-
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
40
|
-
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
41
|
-
React__default.useEffect(() => {
|
|
42
|
-
context.itemMap.set(ref, { ref, ...itemData });
|
|
43
|
-
return () => void context.itemMap.delete(ref);
|
|
44
|
-
});
|
|
45
|
-
return /* @__PURE__ */ jsx(CollectionItemSlotImpl, { ...{ [ITEM_DATA_ATTR]: "" }, ref: composedRefs, children });
|
|
46
|
-
}
|
|
47
|
-
);
|
|
48
|
-
CollectionItemSlot.displayName = ITEM_SLOT_NAME;
|
|
49
|
-
function useCollection(scope) {
|
|
50
|
-
const context = useCollectionContext(name + "CollectionConsumer", scope);
|
|
51
|
-
const getItems = React__default.useCallback(() => {
|
|
52
|
-
const collectionNode = context.collectionRef.current;
|
|
53
|
-
if (!collectionNode) return [];
|
|
54
|
-
const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
|
|
55
|
-
const items = Array.from(context.itemMap.values());
|
|
56
|
-
const orderedItems = items.sort(
|
|
57
|
-
(a, b) => orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current)
|
|
58
|
-
);
|
|
59
|
-
return orderedItems;
|
|
60
|
-
}, [context.collectionRef, context.itemMap]);
|
|
61
|
-
return getItems;
|
|
62
|
-
}
|
|
63
|
-
return [
|
|
64
|
-
{ Provider: CollectionProvider, Slot: CollectionSlot, ItemSlot: CollectionItemSlot },
|
|
65
|
-
useCollection,
|
|
66
|
-
createCollectionScope
|
|
67
|
-
];
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export { createCollection };
|
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { composeEventHandlers } from '../../../../../primitive/dist/index.js';
|
|
3
|
-
import { Primitive, dispatchDiscreteCustomEvent } from '../../react-primitive/dist/index.js';
|
|
4
|
-
import { useComposedRefs } from '../../../../../react-compose-refs/dist/index.js';
|
|
5
|
-
import { useCallbackRef } from '../../../../../react-use-callback-ref/dist/index.js';
|
|
6
|
-
import { useEscapeKeydown } from '../../../../../react-use-escape-keydown/dist/index.js';
|
|
7
|
-
import { jsx } from 'react/jsx-runtime';
|
|
8
|
-
|
|
9
|
-
var DISMISSABLE_LAYER_NAME = "DismissableLayer";
|
|
10
|
-
var CONTEXT_UPDATE = "dismissableLayer.update";
|
|
11
|
-
var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
|
|
12
|
-
var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
|
|
13
|
-
var originalBodyPointerEvents;
|
|
14
|
-
var DismissableLayerContext = React.createContext({
|
|
15
|
-
layers: /* @__PURE__ */ new Set(),
|
|
16
|
-
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
17
|
-
branches: /* @__PURE__ */ new Set()
|
|
18
|
-
});
|
|
19
|
-
var DismissableLayer = React.forwardRef(
|
|
20
|
-
(props, forwardedRef) => {
|
|
21
|
-
const {
|
|
22
|
-
disableOutsidePointerEvents = false,
|
|
23
|
-
onEscapeKeyDown,
|
|
24
|
-
onPointerDownOutside,
|
|
25
|
-
onFocusOutside,
|
|
26
|
-
onInteractOutside,
|
|
27
|
-
onDismiss,
|
|
28
|
-
...layerProps
|
|
29
|
-
} = props;
|
|
30
|
-
const context = React.useContext(DismissableLayerContext);
|
|
31
|
-
const [node, setNode] = React.useState(null);
|
|
32
|
-
const ownerDocument = node?.ownerDocument ?? globalThis?.document;
|
|
33
|
-
const [, force] = React.useState({});
|
|
34
|
-
const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));
|
|
35
|
-
const layers = Array.from(context.layers);
|
|
36
|
-
const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);
|
|
37
|
-
const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);
|
|
38
|
-
const index = node ? layers.indexOf(node) : -1;
|
|
39
|
-
const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
|
|
40
|
-
const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;
|
|
41
|
-
const pointerDownOutside = usePointerDownOutside((event) => {
|
|
42
|
-
const target = event.target;
|
|
43
|
-
const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target));
|
|
44
|
-
if (!isPointerEventsEnabled || isPointerDownOnBranch) return;
|
|
45
|
-
onPointerDownOutside?.(event);
|
|
46
|
-
onInteractOutside?.(event);
|
|
47
|
-
if (!event.defaultPrevented) onDismiss?.();
|
|
48
|
-
}, ownerDocument);
|
|
49
|
-
const focusOutside = useFocusOutside((event) => {
|
|
50
|
-
const target = event.target;
|
|
51
|
-
const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target));
|
|
52
|
-
if (isFocusInBranch) return;
|
|
53
|
-
onFocusOutside?.(event);
|
|
54
|
-
onInteractOutside?.(event);
|
|
55
|
-
if (!event.defaultPrevented) onDismiss?.();
|
|
56
|
-
}, ownerDocument);
|
|
57
|
-
useEscapeKeydown((event) => {
|
|
58
|
-
const isHighestLayer = index === context.layers.size - 1;
|
|
59
|
-
if (!isHighestLayer) return;
|
|
60
|
-
onEscapeKeyDown?.(event);
|
|
61
|
-
if (!event.defaultPrevented && onDismiss) {
|
|
62
|
-
event.preventDefault();
|
|
63
|
-
onDismiss();
|
|
64
|
-
}
|
|
65
|
-
}, ownerDocument);
|
|
66
|
-
React.useEffect(() => {
|
|
67
|
-
if (!node) return;
|
|
68
|
-
if (disableOutsidePointerEvents) {
|
|
69
|
-
if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
|
|
70
|
-
originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
|
|
71
|
-
ownerDocument.body.style.pointerEvents = "none";
|
|
72
|
-
}
|
|
73
|
-
context.layersWithOutsidePointerEventsDisabled.add(node);
|
|
74
|
-
}
|
|
75
|
-
context.layers.add(node);
|
|
76
|
-
dispatchUpdate();
|
|
77
|
-
return () => {
|
|
78
|
-
if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) {
|
|
79
|
-
ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
}, [node, ownerDocument, disableOutsidePointerEvents, context]);
|
|
83
|
-
React.useEffect(() => {
|
|
84
|
-
return () => {
|
|
85
|
-
if (!node) return;
|
|
86
|
-
context.layers.delete(node);
|
|
87
|
-
context.layersWithOutsidePointerEventsDisabled.delete(node);
|
|
88
|
-
dispatchUpdate();
|
|
89
|
-
};
|
|
90
|
-
}, [node, context]);
|
|
91
|
-
React.useEffect(() => {
|
|
92
|
-
const handleUpdate = () => force({});
|
|
93
|
-
document.addEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
94
|
-
return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
95
|
-
}, []);
|
|
96
|
-
return /* @__PURE__ */ jsx(
|
|
97
|
-
Primitive.div,
|
|
98
|
-
{
|
|
99
|
-
...layerProps,
|
|
100
|
-
ref: composedRefs,
|
|
101
|
-
style: {
|
|
102
|
-
pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? "auto" : "none" : void 0,
|
|
103
|
-
...props.style
|
|
104
|
-
},
|
|
105
|
-
onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture),
|
|
106
|
-
onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture),
|
|
107
|
-
onPointerDownCapture: composeEventHandlers(
|
|
108
|
-
props.onPointerDownCapture,
|
|
109
|
-
pointerDownOutside.onPointerDownCapture
|
|
110
|
-
)
|
|
111
|
-
}
|
|
112
|
-
);
|
|
113
|
-
}
|
|
114
|
-
);
|
|
115
|
-
DismissableLayer.displayName = DISMISSABLE_LAYER_NAME;
|
|
116
|
-
var BRANCH_NAME = "DismissableLayerBranch";
|
|
117
|
-
var DismissableLayerBranch = React.forwardRef((props, forwardedRef) => {
|
|
118
|
-
const context = React.useContext(DismissableLayerContext);
|
|
119
|
-
const ref = React.useRef(null);
|
|
120
|
-
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
121
|
-
React.useEffect(() => {
|
|
122
|
-
const node = ref.current;
|
|
123
|
-
if (node) {
|
|
124
|
-
context.branches.add(node);
|
|
125
|
-
return () => {
|
|
126
|
-
context.branches.delete(node);
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
}, [context.branches]);
|
|
130
|
-
return /* @__PURE__ */ jsx(Primitive.div, { ...props, ref: composedRefs });
|
|
131
|
-
});
|
|
132
|
-
DismissableLayerBranch.displayName = BRANCH_NAME;
|
|
133
|
-
function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {
|
|
134
|
-
const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);
|
|
135
|
-
const isPointerInsideReactTreeRef = React.useRef(false);
|
|
136
|
-
const handleClickRef = React.useRef(() => {
|
|
137
|
-
});
|
|
138
|
-
React.useEffect(() => {
|
|
139
|
-
const handlePointerDown = (event) => {
|
|
140
|
-
if (event.target && !isPointerInsideReactTreeRef.current) {
|
|
141
|
-
let handleAndDispatchPointerDownOutsideEvent2 = function() {
|
|
142
|
-
handleAndDispatchCustomEvent(
|
|
143
|
-
POINTER_DOWN_OUTSIDE,
|
|
144
|
-
handlePointerDownOutside,
|
|
145
|
-
eventDetail,
|
|
146
|
-
{ discrete: true }
|
|
147
|
-
);
|
|
148
|
-
};
|
|
149
|
-
const eventDetail = { originalEvent: event };
|
|
150
|
-
if (event.pointerType === "touch") {
|
|
151
|
-
ownerDocument.removeEventListener("click", handleClickRef.current);
|
|
152
|
-
handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2;
|
|
153
|
-
ownerDocument.addEventListener("click", handleClickRef.current, { once: true });
|
|
154
|
-
} else {
|
|
155
|
-
handleAndDispatchPointerDownOutsideEvent2();
|
|
156
|
-
}
|
|
157
|
-
} else {
|
|
158
|
-
ownerDocument.removeEventListener("click", handleClickRef.current);
|
|
159
|
-
}
|
|
160
|
-
isPointerInsideReactTreeRef.current = false;
|
|
161
|
-
};
|
|
162
|
-
const timerId = window.setTimeout(() => {
|
|
163
|
-
ownerDocument.addEventListener("pointerdown", handlePointerDown);
|
|
164
|
-
}, 0);
|
|
165
|
-
return () => {
|
|
166
|
-
window.clearTimeout(timerId);
|
|
167
|
-
ownerDocument.removeEventListener("pointerdown", handlePointerDown);
|
|
168
|
-
ownerDocument.removeEventListener("click", handleClickRef.current);
|
|
169
|
-
};
|
|
170
|
-
}, [ownerDocument, handlePointerDownOutside]);
|
|
171
|
-
return {
|
|
172
|
-
// ensures we check React component tree (not just DOM tree)
|
|
173
|
-
onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {
|
|
177
|
-
const handleFocusOutside = useCallbackRef(onFocusOutside);
|
|
178
|
-
const isFocusInsideReactTreeRef = React.useRef(false);
|
|
179
|
-
React.useEffect(() => {
|
|
180
|
-
const handleFocus = (event) => {
|
|
181
|
-
if (event.target && !isFocusInsideReactTreeRef.current) {
|
|
182
|
-
const eventDetail = { originalEvent: event };
|
|
183
|
-
handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
|
|
184
|
-
discrete: false
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
|
-
};
|
|
188
|
-
ownerDocument.addEventListener("focusin", handleFocus);
|
|
189
|
-
return () => ownerDocument.removeEventListener("focusin", handleFocus);
|
|
190
|
-
}, [ownerDocument, handleFocusOutside]);
|
|
191
|
-
return {
|
|
192
|
-
onFocusCapture: () => isFocusInsideReactTreeRef.current = true,
|
|
193
|
-
onBlurCapture: () => isFocusInsideReactTreeRef.current = false
|
|
194
|
-
};
|
|
195
|
-
}
|
|
196
|
-
function dispatchUpdate() {
|
|
197
|
-
const event = new CustomEvent(CONTEXT_UPDATE);
|
|
198
|
-
document.dispatchEvent(event);
|
|
199
|
-
}
|
|
200
|
-
function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
|
|
201
|
-
const target = detail.originalEvent.target;
|
|
202
|
-
const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });
|
|
203
|
-
if (handler) target.addEventListener(name, handler, { once: true });
|
|
204
|
-
if (discrete) {
|
|
205
|
-
dispatchDiscreteCustomEvent(target, event);
|
|
206
|
-
} else {
|
|
207
|
-
target.dispatchEvent(event);
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
export { DismissableLayer, DismissableLayerBranch };
|
package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-popper/dist/index.js
DELETED
|
@@ -1,283 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { useFloating, offset, shift, flip, size, arrow, hide, limitShift } from '../../../../../../@floating-ui/react-dom/dist/floating-ui.react-dom.js';
|
|
3
|
-
import { Root } from '../node_modules/@radix-ui/react-arrow/dist/index.js';
|
|
4
|
-
import { useComposedRefs } from '../../../../../react-compose-refs/dist/index.js';
|
|
5
|
-
import { createContextScope } from '../../../../../react-context/dist/index.js';
|
|
6
|
-
import { Primitive } from '../../react-primitive/dist/index.js';
|
|
7
|
-
import { useCallbackRef } from '../../../../../react-use-callback-ref/dist/index.js';
|
|
8
|
-
import { useLayoutEffect as useLayoutEffect2 } from '../../../../../react-use-layout-effect/dist/index.js';
|
|
9
|
-
import { useSize } from '../../../../../react-use-size/dist/index.js';
|
|
10
|
-
import { jsx } from 'react/jsx-runtime';
|
|
11
|
-
import { autoUpdate } from '../../../../../../@floating-ui/dom/dist/floating-ui.dom.js';
|
|
12
|
-
|
|
13
|
-
var POPPER_NAME = "Popper";
|
|
14
|
-
var [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);
|
|
15
|
-
var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
|
|
16
|
-
var Popper = (props) => {
|
|
17
|
-
const { __scopePopper, children } = props;
|
|
18
|
-
const [anchor, setAnchor] = React.useState(null);
|
|
19
|
-
return /* @__PURE__ */ jsx(PopperProvider, { scope: __scopePopper, anchor, onAnchorChange: setAnchor, children });
|
|
20
|
-
};
|
|
21
|
-
Popper.displayName = POPPER_NAME;
|
|
22
|
-
var ANCHOR_NAME = "PopperAnchor";
|
|
23
|
-
var PopperAnchor = React.forwardRef(
|
|
24
|
-
(props, forwardedRef) => {
|
|
25
|
-
const { __scopePopper, virtualRef, ...anchorProps } = props;
|
|
26
|
-
const context = usePopperContext(ANCHOR_NAME, __scopePopper);
|
|
27
|
-
const ref = React.useRef(null);
|
|
28
|
-
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
29
|
-
const anchorRef = React.useRef(null);
|
|
30
|
-
React.useEffect(() => {
|
|
31
|
-
const previousAnchor = anchorRef.current;
|
|
32
|
-
anchorRef.current = virtualRef?.current || ref.current;
|
|
33
|
-
if (previousAnchor !== anchorRef.current) {
|
|
34
|
-
context.onAnchorChange(anchorRef.current);
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
return virtualRef ? null : /* @__PURE__ */ jsx(Primitive.div, { ...anchorProps, ref: composedRefs });
|
|
38
|
-
}
|
|
39
|
-
);
|
|
40
|
-
PopperAnchor.displayName = ANCHOR_NAME;
|
|
41
|
-
var CONTENT_NAME = "PopperContent";
|
|
42
|
-
var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME);
|
|
43
|
-
var PopperContent = React.forwardRef(
|
|
44
|
-
(props, forwardedRef) => {
|
|
45
|
-
const {
|
|
46
|
-
__scopePopper,
|
|
47
|
-
side = "bottom",
|
|
48
|
-
sideOffset = 0,
|
|
49
|
-
align = "center",
|
|
50
|
-
alignOffset = 0,
|
|
51
|
-
arrowPadding = 0,
|
|
52
|
-
avoidCollisions = true,
|
|
53
|
-
collisionBoundary = [],
|
|
54
|
-
collisionPadding: collisionPaddingProp = 0,
|
|
55
|
-
sticky = "partial",
|
|
56
|
-
hideWhenDetached = false,
|
|
57
|
-
updatePositionStrategy = "optimized",
|
|
58
|
-
onPlaced,
|
|
59
|
-
...contentProps
|
|
60
|
-
} = props;
|
|
61
|
-
const context = usePopperContext(CONTENT_NAME, __scopePopper);
|
|
62
|
-
const [content, setContent] = React.useState(null);
|
|
63
|
-
const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
|
|
64
|
-
const [arrow$1, setArrow] = React.useState(null);
|
|
65
|
-
const arrowSize = useSize(arrow$1);
|
|
66
|
-
const arrowWidth = arrowSize?.width ?? 0;
|
|
67
|
-
const arrowHeight = arrowSize?.height ?? 0;
|
|
68
|
-
const desiredPlacement = side + (align !== "center" ? "-" + align : "");
|
|
69
|
-
const collisionPadding = typeof collisionPaddingProp === "number" ? collisionPaddingProp : { top: 0, right: 0, bottom: 0, left: 0, ...collisionPaddingProp };
|
|
70
|
-
const boundary = Array.isArray(collisionBoundary) ? collisionBoundary : [collisionBoundary];
|
|
71
|
-
const hasExplicitBoundaries = boundary.length > 0;
|
|
72
|
-
const detectOverflowOptions = {
|
|
73
|
-
padding: collisionPadding,
|
|
74
|
-
boundary: boundary.filter(isNotNull),
|
|
75
|
-
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
76
|
-
altBoundary: hasExplicitBoundaries
|
|
77
|
-
};
|
|
78
|
-
const { refs, floatingStyles, placement, isPositioned, middlewareData } = useFloating({
|
|
79
|
-
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
|
80
|
-
strategy: "fixed",
|
|
81
|
-
placement: desiredPlacement,
|
|
82
|
-
whileElementsMounted: (...args) => {
|
|
83
|
-
const cleanup = autoUpdate(...args, {
|
|
84
|
-
animationFrame: updatePositionStrategy === "always"
|
|
85
|
-
});
|
|
86
|
-
return cleanup;
|
|
87
|
-
},
|
|
88
|
-
elements: {
|
|
89
|
-
reference: context.anchor
|
|
90
|
-
},
|
|
91
|
-
middleware: [
|
|
92
|
-
offset({ mainAxis: sideOffset + arrowHeight, alignmentAxis: alignOffset }),
|
|
93
|
-
avoidCollisions && shift({
|
|
94
|
-
mainAxis: true,
|
|
95
|
-
crossAxis: false,
|
|
96
|
-
limiter: sticky === "partial" ? limitShift() : void 0,
|
|
97
|
-
...detectOverflowOptions
|
|
98
|
-
}),
|
|
99
|
-
avoidCollisions && flip({ ...detectOverflowOptions }),
|
|
100
|
-
size({
|
|
101
|
-
...detectOverflowOptions,
|
|
102
|
-
apply: ({ elements, rects, availableWidth, availableHeight }) => {
|
|
103
|
-
const { width: anchorWidth, height: anchorHeight } = rects.reference;
|
|
104
|
-
const contentStyle = elements.floating.style;
|
|
105
|
-
contentStyle.setProperty("--radix-popper-available-width", `${availableWidth}px`);
|
|
106
|
-
contentStyle.setProperty("--radix-popper-available-height", `${availableHeight}px`);
|
|
107
|
-
contentStyle.setProperty("--radix-popper-anchor-width", `${anchorWidth}px`);
|
|
108
|
-
contentStyle.setProperty("--radix-popper-anchor-height", `${anchorHeight}px`);
|
|
109
|
-
}
|
|
110
|
-
}),
|
|
111
|
-
arrow$1 && arrow({ element: arrow$1, padding: arrowPadding }),
|
|
112
|
-
transformOrigin({ arrowWidth, arrowHeight }),
|
|
113
|
-
hideWhenDetached && hide({ strategy: "referenceHidden", ...detectOverflowOptions })
|
|
114
|
-
]
|
|
115
|
-
});
|
|
116
|
-
const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);
|
|
117
|
-
const handlePlaced = useCallbackRef(onPlaced);
|
|
118
|
-
useLayoutEffect2(() => {
|
|
119
|
-
if (isPositioned) {
|
|
120
|
-
handlePlaced?.();
|
|
121
|
-
}
|
|
122
|
-
}, [isPositioned, handlePlaced]);
|
|
123
|
-
const arrowX = middlewareData.arrow?.x;
|
|
124
|
-
const arrowY = middlewareData.arrow?.y;
|
|
125
|
-
const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
|
|
126
|
-
const [contentZIndex, setContentZIndex] = React.useState();
|
|
127
|
-
useLayoutEffect2(() => {
|
|
128
|
-
if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
129
|
-
}, [content]);
|
|
130
|
-
return /* @__PURE__ */ jsx(
|
|
131
|
-
"div",
|
|
132
|
-
{
|
|
133
|
-
ref: refs.setFloating,
|
|
134
|
-
"data-radix-popper-content-wrapper": "",
|
|
135
|
-
style: {
|
|
136
|
-
...floatingStyles,
|
|
137
|
-
transform: isPositioned ? floatingStyles.transform : "translate(0, -200%)",
|
|
138
|
-
// keep off the page when measuring
|
|
139
|
-
minWidth: "max-content",
|
|
140
|
-
zIndex: contentZIndex,
|
|
141
|
-
["--radix-popper-transform-origin"]: [
|
|
142
|
-
middlewareData.transformOrigin?.x,
|
|
143
|
-
middlewareData.transformOrigin?.y
|
|
144
|
-
].join(" "),
|
|
145
|
-
// hide the content if using the hide middleware and should be hidden
|
|
146
|
-
// set visibility to hidden and disable pointer events so the UI behaves
|
|
147
|
-
// as if the PopperContent isn't there at all
|
|
148
|
-
...middlewareData.hide?.referenceHidden && {
|
|
149
|
-
visibility: "hidden",
|
|
150
|
-
pointerEvents: "none"
|
|
151
|
-
}
|
|
152
|
-
},
|
|
153
|
-
dir: props.dir,
|
|
154
|
-
children: /* @__PURE__ */ jsx(
|
|
155
|
-
PopperContentProvider,
|
|
156
|
-
{
|
|
157
|
-
scope: __scopePopper,
|
|
158
|
-
placedSide,
|
|
159
|
-
onArrowChange: setArrow,
|
|
160
|
-
arrowX,
|
|
161
|
-
arrowY,
|
|
162
|
-
shouldHideArrow: cannotCenterArrow,
|
|
163
|
-
children: /* @__PURE__ */ jsx(
|
|
164
|
-
Primitive.div,
|
|
165
|
-
{
|
|
166
|
-
"data-side": placedSide,
|
|
167
|
-
"data-align": placedAlign,
|
|
168
|
-
...contentProps,
|
|
169
|
-
ref: composedRefs,
|
|
170
|
-
style: {
|
|
171
|
-
...contentProps.style,
|
|
172
|
-
// if the PopperContent hasn't been placed yet (not all measurements done)
|
|
173
|
-
// we prevent animations so that users's animation don't kick in too early referring wrong sides
|
|
174
|
-
animation: !isPositioned ? "none" : void 0
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
)
|
|
178
|
-
}
|
|
179
|
-
)
|
|
180
|
-
}
|
|
181
|
-
);
|
|
182
|
-
}
|
|
183
|
-
);
|
|
184
|
-
PopperContent.displayName = CONTENT_NAME;
|
|
185
|
-
var ARROW_NAME = "PopperArrow";
|
|
186
|
-
var OPPOSITE_SIDE = {
|
|
187
|
-
top: "bottom",
|
|
188
|
-
right: "left",
|
|
189
|
-
bottom: "top",
|
|
190
|
-
left: "right"
|
|
191
|
-
};
|
|
192
|
-
var PopperArrow = React.forwardRef(function PopperArrow2(props, forwardedRef) {
|
|
193
|
-
const { __scopePopper, ...arrowProps } = props;
|
|
194
|
-
const contentContext = useContentContext(ARROW_NAME, __scopePopper);
|
|
195
|
-
const baseSide = OPPOSITE_SIDE[contentContext.placedSide];
|
|
196
|
-
return (
|
|
197
|
-
// we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
|
|
198
|
-
// doesn't report size as we'd expect on SVG elements.
|
|
199
|
-
// it reports their bounding box which is effectively the largest path inside the SVG.
|
|
200
|
-
/* @__PURE__ */ jsx(
|
|
201
|
-
"span",
|
|
202
|
-
{
|
|
203
|
-
ref: contentContext.onArrowChange,
|
|
204
|
-
style: {
|
|
205
|
-
position: "absolute",
|
|
206
|
-
left: contentContext.arrowX,
|
|
207
|
-
top: contentContext.arrowY,
|
|
208
|
-
[baseSide]: 0,
|
|
209
|
-
transformOrigin: {
|
|
210
|
-
top: "",
|
|
211
|
-
right: "0 0",
|
|
212
|
-
bottom: "center 0",
|
|
213
|
-
left: "100% 0"
|
|
214
|
-
}[contentContext.placedSide],
|
|
215
|
-
transform: {
|
|
216
|
-
top: "translateY(100%)",
|
|
217
|
-
right: "translateY(50%) rotate(90deg) translateX(-50%)",
|
|
218
|
-
bottom: `rotate(180deg)`,
|
|
219
|
-
left: "translateY(50%) rotate(-90deg) translateX(50%)"
|
|
220
|
-
}[contentContext.placedSide],
|
|
221
|
-
visibility: contentContext.shouldHideArrow ? "hidden" : void 0
|
|
222
|
-
},
|
|
223
|
-
children: /* @__PURE__ */ jsx(
|
|
224
|
-
Root,
|
|
225
|
-
{
|
|
226
|
-
...arrowProps,
|
|
227
|
-
ref: forwardedRef,
|
|
228
|
-
style: {
|
|
229
|
-
...arrowProps.style,
|
|
230
|
-
// ensures the element can be measured correctly (mostly for if SVG)
|
|
231
|
-
display: "block"
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
)
|
|
235
|
-
}
|
|
236
|
-
)
|
|
237
|
-
);
|
|
238
|
-
});
|
|
239
|
-
PopperArrow.displayName = ARROW_NAME;
|
|
240
|
-
function isNotNull(value) {
|
|
241
|
-
return value !== null;
|
|
242
|
-
}
|
|
243
|
-
var transformOrigin = (options) => ({
|
|
244
|
-
name: "transformOrigin",
|
|
245
|
-
options,
|
|
246
|
-
fn(data) {
|
|
247
|
-
const { placement, rects, middlewareData } = data;
|
|
248
|
-
const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
|
|
249
|
-
const isArrowHidden = cannotCenterArrow;
|
|
250
|
-
const arrowWidth = isArrowHidden ? 0 : options.arrowWidth;
|
|
251
|
-
const arrowHeight = isArrowHidden ? 0 : options.arrowHeight;
|
|
252
|
-
const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);
|
|
253
|
-
const noArrowAlign = { start: "0%", center: "50%", end: "100%" }[placedAlign];
|
|
254
|
-
const arrowXCenter = (middlewareData.arrow?.x ?? 0) + arrowWidth / 2;
|
|
255
|
-
const arrowYCenter = (middlewareData.arrow?.y ?? 0) + arrowHeight / 2;
|
|
256
|
-
let x = "";
|
|
257
|
-
let y = "";
|
|
258
|
-
if (placedSide === "bottom") {
|
|
259
|
-
x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
|
|
260
|
-
y = `${-arrowHeight}px`;
|
|
261
|
-
} else if (placedSide === "top") {
|
|
262
|
-
x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
|
|
263
|
-
y = `${rects.floating.height + arrowHeight}px`;
|
|
264
|
-
} else if (placedSide === "right") {
|
|
265
|
-
x = `${-arrowHeight}px`;
|
|
266
|
-
y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
|
|
267
|
-
} else if (placedSide === "left") {
|
|
268
|
-
x = `${rects.floating.width + arrowHeight}px`;
|
|
269
|
-
y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
|
|
270
|
-
}
|
|
271
|
-
return { data: { x, y } };
|
|
272
|
-
}
|
|
273
|
-
});
|
|
274
|
-
function getSideAndAlignFromPlacement(placement) {
|
|
275
|
-
const [side, align = "center"] = placement.split("-");
|
|
276
|
-
return [side, align];
|
|
277
|
-
}
|
|
278
|
-
var Root2 = Popper;
|
|
279
|
-
var Anchor = PopperAnchor;
|
|
280
|
-
var Content = PopperContent;
|
|
281
|
-
var Arrow = PopperArrow;
|
|
282
|
-
|
|
283
|
-
export { Anchor, Arrow, Content, Popper, PopperAnchor, PopperArrow, PopperContent, Root2 as Root, createPopperScope };
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Primitive } from '../../../../../react-primitive/dist/index.js';
|
|
3
|
-
import { jsx } from 'react/jsx-runtime';
|
|
4
|
-
|
|
5
|
-
// src/arrow.tsx
|
|
6
|
-
var NAME = "Arrow";
|
|
7
|
-
var Arrow = React.forwardRef((props, forwardedRef) => {
|
|
8
|
-
const { children, width = 10, height = 5, ...arrowProps } = props;
|
|
9
|
-
return /* @__PURE__ */ jsx(
|
|
10
|
-
Primitive.svg,
|
|
11
|
-
{
|
|
12
|
-
...arrowProps,
|
|
13
|
-
ref: forwardedRef,
|
|
14
|
-
width,
|
|
15
|
-
height,
|
|
16
|
-
viewBox: "0 0 30 10",
|
|
17
|
-
preserveAspectRatio: "none",
|
|
18
|
-
children: props.asChild ? children : /* @__PURE__ */ jsx("polygon", { points: "0,0 30,0 15,10" })
|
|
19
|
-
}
|
|
20
|
-
);
|
|
21
|
-
});
|
|
22
|
-
Arrow.displayName = NAME;
|
|
23
|
-
var Root = Arrow;
|
|
24
|
-
|
|
25
|
-
export { Arrow, Root };
|