@code0-tech/pictor 0.10.4 → 0.10.6
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/assets/components/json-view/JsonView.style.css +1 -0
- package/dist/components/breadcrumb/Breadcrumb.js +2 -2
- package/dist/components/button/Button.js +11 -11
- package/dist/components/command/Command.js +19 -22
- package/dist/components/data-table/DataTable.js +15 -15
- package/dist/components/data-table/DataTableFilterSuggestionMenu.js +15 -15
- package/dist/components/editor/Editor.js +13 -13
- package/dist/components/form/CheckboxInput.js +4 -4
- package/dist/components/form/EditorInput.js +69 -64
- package/dist/components/form/EmailInput.js +9 -9
- package/dist/components/form/InputContentEditable.hook.js +11 -11
- package/dist/components/form/InputWrapper.js +15 -15
- package/dist/components/form/NumberInput.js +9 -9
- package/dist/components/form/PasswordInput.js +4 -4
- package/dist/components/form/SwitchInput.js +7 -7
- package/dist/components/form/TextAreaInput.js +6 -6
- package/dist/components/form/TextInput.js +6 -6
- package/dist/components/form/useForm.js +2 -2
- package/dist/components/fullscreen/FullScreen.js +2 -2
- package/dist/components/gantt/Gantt.js +67 -54
- package/dist/components/gantt/GanttGroup.js +117 -98
- package/dist/components/gantt/GanttHeader.js +45 -36
- package/dist/components/json-view/JsonView.d.ts +19 -0
- package/dist/components/json-view/JsonView.js +107 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +102 -100
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.js +59 -0
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.js +34 -0
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/index.js +47 -0
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.js +12 -0
- package/dist/node_modules/framer-motion/dist/es/utils/use-composed-ref.js +28 -0
- package/dist/node_modules/react/cjs/react-compiler-runtime.development.js +2 -2
- package/dist/node_modules/react/cjs/react-compiler-runtime.production.js +8 -8
- package/dist/utils/reactiveArrayService.js +4 -4
- package/package.json +9 -7
- package/dist/components/gantt/GanttFooter.d.ts +0 -2
- package/dist/components/gantt/GanttFooter.js +0 -38
package/dist/index.js
CHANGED
|
@@ -2,75 +2,76 @@ import { Alert as t } from "./components/alert/Alert.js";
|
|
|
2
2
|
import { AuroraBackground as n } from "./components/aurora/Aurora.js";
|
|
3
3
|
import { Avatar as a } from "./components/avatar/Avatar.js";
|
|
4
4
|
import { Badge as u } from "./components/badge/Badge.js";
|
|
5
|
-
import { Breadcrumb as
|
|
5
|
+
import { Breadcrumb as l } from "./components/breadcrumb/Breadcrumb.js";
|
|
6
6
|
import { Button as f } from "./components/button/Button.js";
|
|
7
7
|
import { ButtonGroup as I } from "./components/button-group/ButtonGroup.js";
|
|
8
8
|
import { Card as S } from "./components/card/Card.js";
|
|
9
|
-
import { Col as
|
|
10
|
-
import { Command as b, CommandDialog as c, CommandEmpty as M, CommandGroup as F, CommandInput as D, CommandItem as P, CommandList as A, CommandSeparator as
|
|
9
|
+
import { Col as s } from "./components/col/Col.js";
|
|
10
|
+
import { Command as b, CommandDialog as c, CommandEmpty as M, CommandGroup as F, CommandInput as D, CommandItem as P, CommandList as A, CommandSeparator as w, CommandShortcut as v } from "./components/command/Command.js";
|
|
11
11
|
import { Container as R } from "./components/container/Container.js";
|
|
12
|
-
import { ContextMenu as L, ContextMenuArrow as y, ContextMenuContent as z, ContextMenuGroup as V, ContextMenuItem as B, ContextMenuLabel as E, ContextMenuPortal as H, ContextMenuSeparator as k, ContextMenuSub as N, ContextMenuSubContent as O, ContextMenuSubTrigger as Q, ContextMenuTrigger as
|
|
13
|
-
import { DataTable as
|
|
12
|
+
import { ContextMenu as L, ContextMenuArrow as y, ContextMenuContent as z, ContextMenuGroup as V, ContextMenuItem as B, ContextMenuLabel as E, ContextMenuPortal as H, ContextMenuSeparator as k, ContextMenuSub as N, ContextMenuSubContent as O, ContextMenuSubTrigger as Q, ContextMenuTrigger as J } from "./components/context-menu/ContextMenu.js";
|
|
13
|
+
import { DataTable as j } from "./components/data-table/DataTable.js";
|
|
14
14
|
import { DataTableColumn as K } from "./components/data-table/DataTableColumn.js";
|
|
15
15
|
import { DataTableFilterInput as W, createFilterQueryLanguage as X } from "./components/data-table/DataTableFilterInput.js";
|
|
16
16
|
import { DataTableFilterSuggestionMenu as _ } from "./components/data-table/DataTableFilterSuggestionMenu.js";
|
|
17
|
-
import { Dialog as ee, DialogClose as oe, DialogContent as te, DialogDescription as re, DialogFooter as ne, DialogHeader as pe, DialogOverlay as ae, DialogPortal as me, DialogTitle as ue, DialogTrigger as
|
|
17
|
+
import { Dialog as ee, DialogClose as oe, DialogContent as te, DialogDescription as re, DialogFooter as ne, DialogHeader as pe, DialogOverlay as ae, DialogPortal as me, DialogTitle as ue, DialogTrigger as ie } from "./components/dialog/Dialog.js";
|
|
18
18
|
import { Editor as xe } from "./components/editor/Editor.js";
|
|
19
19
|
import { FileTabsService as ge } from "./components/file-tabs/FileTabs.service.js";
|
|
20
|
-
import { FileTabs as Ce, FileTabsContent as Se, FileTabsList as Te, FileTabsTrigger as
|
|
20
|
+
import { FileTabs as Ce, FileTabsContent as Se, FileTabsList as Te, FileTabsTrigger as se } from "./components/file-tabs/FileTabs.js";
|
|
21
21
|
import { Flex as be } from "./components/flex/Flex.js";
|
|
22
22
|
import { CheckboxInput as Me } from "./components/form/CheckboxInput.js";
|
|
23
23
|
import { EditorInput as De } from "./components/form/EditorInput.js";
|
|
24
|
-
import { EmailInput as Ae, emailValidation as
|
|
24
|
+
import { EmailInput as Ae, emailValidation as we } from "./components/form/EmailInput.js";
|
|
25
25
|
import { FileInput as he, FileInputContext as Re, FileInputDropzone as Ge, FileInputHiddenInput as Le, FileInputItem as ye, FileInputItemDeleteTrigger as ze, FileInputItemGroup as Ve, FileInputItemName as Be, FileInputItemPreview as Ee, FileInputItemPreviewImage as He, FileInputItemSizeText as ke, FileInputTrigger as Ne } from "./components/form/FileInput.js";
|
|
26
26
|
import { Input as Qe } from "./components/form/Input.js";
|
|
27
|
-
import { InputDescription as
|
|
28
|
-
import { InputLabel as
|
|
27
|
+
import { InputDescription as Ze } from "./components/form/InputDescription.js";
|
|
28
|
+
import { InputLabel as qe } from "./components/form/InputLabel.js";
|
|
29
29
|
import { InputMessage as Ue } from "./components/form/InputMessage.js";
|
|
30
30
|
import { InputSuggestionMenuContent as Xe, InputSuggestionMenuContentItems as Ye } from "./components/form/InputSuggestion.js";
|
|
31
31
|
import { NumberInput as $e } from "./components/form/NumberInput.js";
|
|
32
32
|
import { PasswordInput as oo, passwordValidation as to } from "./components/form/PasswordInput.js";
|
|
33
33
|
import { PinInput as no, PinInputField as po, PinInputHiddenField as ao } from "./components/form/PinInput.js";
|
|
34
34
|
import { RadioGroup as uo } from "./components/form/RadioGroup.js";
|
|
35
|
-
import { RadioInput as
|
|
35
|
+
import { RadioInput as lo } from "./components/form/RadioInput.js";
|
|
36
36
|
import { SelectContent as fo, SelectInput as go, SelectItem as Io, SelectItemText as Co, SelectPortal as So, SelectTrigger as To, SelectValue as so, SelectViewport as bo } from "./components/form/SelectInput.js";
|
|
37
37
|
import { SwitchInput as Mo } from "./components/form/SwitchInput.js";
|
|
38
38
|
import { TextAreaInput as Do } from "./components/form/TextAreaInput.js";
|
|
39
39
|
import { TextInput as Ao } from "./components/form/TextInput.js";
|
|
40
|
-
import { useForm as
|
|
40
|
+
import { useForm as vo } from "./components/form/useForm.js";
|
|
41
41
|
import { buildDefaultSyntax as Ro } from "./components/form/Input.syntax.hook.js";
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
42
|
+
import { JsonView as Lo } from "./components/json-view/JsonView.js";
|
|
43
|
+
import { FullScreen as zo } from "./components/fullscreen/FullScreen.js";
|
|
44
|
+
import { Gantt as Bo, getRelativeValue as Eo } from "./components/gantt/Gantt.js";
|
|
45
|
+
import { Layout as ko } from "./components/layout/Layout.js";
|
|
46
|
+
import { Menu as Oo, MenuArrow as Qo, MenuCheckboxItem as Jo, MenuContent as Zo, MenuGroup as jo, MenuItem as qo, MenuItemIndicator as Ko, MenuLabel as Uo, MenuPortal as Wo, MenuSeparator as Xo, MenuSub as Yo, MenuSubContent as _o, MenuSubTrigger as $o, MenuTrigger as et } from "./components/menu/Menu.js";
|
|
47
|
+
import { Progress as tt } from "./components/progress/Progress.js";
|
|
48
|
+
import { Quote as nt } from "./components/quote/Quote.js";
|
|
49
|
+
import { ResizableHandle as at, ResizablePanel as mt, ResizablePanelGroup as ut } from "./components/resizable/Resizable.js";
|
|
50
|
+
import { Row as lt } from "./components/row/Row.js";
|
|
51
|
+
import { ScrollArea as ft, ScrollAreaCorner as gt, ScrollAreaScrollbar as It, ScrollAreaThumb as Ct, ScrollAreaViewport as St } from "./components/scroll-area/ScrollArea.js";
|
|
52
|
+
import { SegmentedControl as st, SegmentedControlItem as dt } from "./components/segmented-control/SegmentedControl.js";
|
|
53
|
+
import { Spacing as ct } from "./components/spacing/Spacing.js";
|
|
54
|
+
import { Tab as Ft, TabContent as Dt, TabList as Pt, TabTrigger as At } from "./components/tab/Tab.js";
|
|
55
|
+
import { Text as vt } from "./components/text/Text.js";
|
|
56
|
+
import { Toast as Rt, toast as Gt } from "./components/toast/Toast.js";
|
|
57
|
+
import { Tooltip as yt, TooltipArrow as zt, TooltipContent as Vt, TooltipPortal as Bt, TooltipTrigger as Et } from "./components/tooltip/Tooltip.js";
|
|
58
|
+
import { ContextStore as kt, ContextStoreProvider as Nt, useService as Ot, useStore as Qt } from "./utils/contextStore.js";
|
|
59
|
+
import { ReactiveArrayService as Zt, useReactiveArrayService as jt } from "./utils/reactiveArrayService.js";
|
|
60
|
+
import { mergeComponentProps as Kt } from "./utils/component.js";
|
|
61
|
+
import { Colors as Wt, hashToColor as Xt, withAlpha as Yt } from "./utils/color.js";
|
|
62
|
+
import { getDOMSizeFromCodeZeroSize as $t } from "./utils/size.js";
|
|
62
63
|
export {
|
|
63
64
|
t as Alert,
|
|
64
65
|
n as AuroraBackground,
|
|
65
66
|
a as Avatar,
|
|
66
67
|
u as Badge,
|
|
67
|
-
|
|
68
|
+
l as Breadcrumb,
|
|
68
69
|
f as Button,
|
|
69
70
|
I as ButtonGroup,
|
|
70
71
|
S as Card,
|
|
71
72
|
Me as CheckboxInput,
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
s as Col,
|
|
74
|
+
Wt as Colors,
|
|
74
75
|
b as Command,
|
|
75
76
|
c as CommandDialog,
|
|
76
77
|
M as CommandEmpty,
|
|
@@ -78,8 +79,8 @@ export {
|
|
|
78
79
|
D as CommandInput,
|
|
79
80
|
P as CommandItem,
|
|
80
81
|
A as CommandList,
|
|
81
|
-
|
|
82
|
-
|
|
82
|
+
w as CommandSeparator,
|
|
83
|
+
v as CommandShortcut,
|
|
83
84
|
R as Container,
|
|
84
85
|
L as ContextMenu,
|
|
85
86
|
y as ContextMenuArrow,
|
|
@@ -92,10 +93,10 @@ export {
|
|
|
92
93
|
N as ContextMenuSub,
|
|
93
94
|
O as ContextMenuSubContent,
|
|
94
95
|
Q as ContextMenuSubTrigger,
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
96
|
+
J as ContextMenuTrigger,
|
|
97
|
+
kt as ContextStore,
|
|
98
|
+
Nt as ContextStoreProvider,
|
|
99
|
+
j as DataTable,
|
|
99
100
|
K as DataTableColumn,
|
|
100
101
|
W as DataTableFilterInput,
|
|
101
102
|
_ as DataTableFilterSuggestionMenu,
|
|
@@ -108,7 +109,7 @@ export {
|
|
|
108
109
|
ae as DialogOverlay,
|
|
109
110
|
me as DialogPortal,
|
|
110
111
|
ue as DialogTitle,
|
|
111
|
-
|
|
112
|
+
ie as DialogTrigger,
|
|
112
113
|
xe as Editor,
|
|
113
114
|
De as EditorInput,
|
|
114
115
|
Ae as EmailInput,
|
|
@@ -128,52 +129,53 @@ export {
|
|
|
128
129
|
Se as FileTabsContent,
|
|
129
130
|
Te as FileTabsList,
|
|
130
131
|
ge as FileTabsService,
|
|
131
|
-
|
|
132
|
+
se as FileTabsTrigger,
|
|
132
133
|
be as Flex,
|
|
133
|
-
|
|
134
|
-
|
|
134
|
+
zo as FullScreen,
|
|
135
|
+
Bo as Gantt,
|
|
135
136
|
Qe as Input,
|
|
136
|
-
|
|
137
|
-
|
|
137
|
+
Ze as InputDescription,
|
|
138
|
+
qe as InputLabel,
|
|
138
139
|
Ue as InputMessage,
|
|
139
140
|
Xe as InputSuggestionMenuContent,
|
|
140
141
|
Ye as InputSuggestionMenuContentItems,
|
|
141
|
-
|
|
142
|
-
ko as
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
Zo as
|
|
147
|
-
jo as
|
|
148
|
-
qo as
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
142
|
+
Lo as JsonView,
|
|
143
|
+
ko as Layout,
|
|
144
|
+
Oo as Menu,
|
|
145
|
+
Qo as MenuArrow,
|
|
146
|
+
Jo as MenuCheckboxItem,
|
|
147
|
+
Zo as MenuContent,
|
|
148
|
+
jo as MenuGroup,
|
|
149
|
+
qo as MenuItem,
|
|
150
|
+
Ko as MenuItemIndicator,
|
|
151
|
+
Uo as MenuLabel,
|
|
152
|
+
Wo as MenuPortal,
|
|
153
|
+
Xo as MenuSeparator,
|
|
154
|
+
Yo as MenuSub,
|
|
155
|
+
_o as MenuSubContent,
|
|
156
|
+
$o as MenuSubTrigger,
|
|
157
|
+
et as MenuTrigger,
|
|
156
158
|
$e as NumberInput,
|
|
157
159
|
oo as PasswordInput,
|
|
158
160
|
no as PinInput,
|
|
159
161
|
po as PinInputField,
|
|
160
162
|
ao as PinInputHiddenField,
|
|
161
|
-
|
|
162
|
-
|
|
163
|
+
tt as Progress,
|
|
164
|
+
nt as Quote,
|
|
163
165
|
uo as RadioGroup,
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
166
|
+
lo as RadioInput,
|
|
167
|
+
Zt as ReactiveArrayService,
|
|
168
|
+
at as ResizableHandle,
|
|
169
|
+
mt as ResizablePanel,
|
|
170
|
+
ut as ResizablePanelGroup,
|
|
171
|
+
lt as Row,
|
|
172
|
+
ft as ScrollArea,
|
|
173
|
+
gt as ScrollAreaCorner,
|
|
174
|
+
It as ScrollAreaScrollbar,
|
|
175
|
+
Ct as ScrollAreaThumb,
|
|
176
|
+
St as ScrollAreaViewport,
|
|
177
|
+
st as SegmentedControl,
|
|
178
|
+
dt as SegmentedControlItem,
|
|
177
179
|
fo as SelectContent,
|
|
178
180
|
go as SelectInput,
|
|
179
181
|
Io as SelectItem,
|
|
@@ -182,33 +184,33 @@ export {
|
|
|
182
184
|
To as SelectTrigger,
|
|
183
185
|
so as SelectValue,
|
|
184
186
|
bo as SelectViewport,
|
|
185
|
-
|
|
187
|
+
ct as Spacing,
|
|
186
188
|
Mo as SwitchInput,
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
189
|
+
Ft as Tab,
|
|
190
|
+
Dt as TabContent,
|
|
191
|
+
Pt as TabList,
|
|
192
|
+
At as TabTrigger,
|
|
193
|
+
vt as Text,
|
|
192
194
|
Do as TextAreaInput,
|
|
193
195
|
Ao as TextInput,
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
196
|
+
Rt as Toast,
|
|
197
|
+
yt as Tooltip,
|
|
198
|
+
zt as TooltipArrow,
|
|
199
|
+
Vt as TooltipContent,
|
|
200
|
+
Bt as TooltipPortal,
|
|
201
|
+
Et as TooltipTrigger,
|
|
200
202
|
Ro as buildDefaultSyntax,
|
|
201
203
|
X as createFilterQueryLanguage,
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
204
|
+
we as emailValidation,
|
|
205
|
+
$t as getDOMSizeFromCodeZeroSize,
|
|
206
|
+
Eo as getRelativeValue,
|
|
207
|
+
Xt as hashToColor,
|
|
208
|
+
Kt as mergeComponentProps,
|
|
207
209
|
to as passwordValidation,
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
210
|
+
Gt as toast,
|
|
211
|
+
vo as useForm,
|
|
212
|
+
jt as useReactiveArrayService,
|
|
213
|
+
Ot as useService,
|
|
214
|
+
Qt as useStore,
|
|
215
|
+
Yt as withAlpha
|
|
214
216
|
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsx as H } from "react/jsx-runtime";
|
|
2
|
+
import * as x from "react";
|
|
3
|
+
import { useId as I, useRef as $, useContext as L, useInsertionEffect as M } from "react";
|
|
4
|
+
import { MotionConfigContext as S } from "../../context/MotionConfigContext.js";
|
|
5
|
+
import { useComposedRefs as T } from "../../utils/use-composed-ref.js";
|
|
6
|
+
import { isHTMLElement as h } from "../../../../../motion-dom/dist/es/utils/is-html-element.js";
|
|
7
|
+
class v extends x.Component {
|
|
8
|
+
getSnapshotBeforeUpdate(s) {
|
|
9
|
+
const e = this.props.childRef.current;
|
|
10
|
+
if (h(e) && s.isPresent && !this.props.isPresent && this.props.pop !== !1) {
|
|
11
|
+
const o = e.offsetParent, f = h(o) && o.offsetWidth || 0, p = h(o) && o.offsetHeight || 0, i = getComputedStyle(e), t = this.props.sizeRef.current;
|
|
12
|
+
t.height = parseFloat(i.height), t.width = parseFloat(i.width), t.top = e.offsetTop, t.left = e.offsetLeft, t.right = f - t.width - t.left, t.bottom = p - t.height - t.top, t.direction = i.direction;
|
|
13
|
+
}
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Required with getSnapshotBeforeUpdate to stop React complaining.
|
|
18
|
+
*/
|
|
19
|
+
componentDidUpdate() {
|
|
20
|
+
}
|
|
21
|
+
render() {
|
|
22
|
+
return this.props.children;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function B({ children: r, isPresent: s, anchorX: e, anchorY: o, root: f, pop: p }) {
|
|
26
|
+
const i = I(), t = $(null), d = $({
|
|
27
|
+
width: 0,
|
|
28
|
+
height: 0,
|
|
29
|
+
top: 0,
|
|
30
|
+
left: 0,
|
|
31
|
+
right: 0,
|
|
32
|
+
bottom: 0,
|
|
33
|
+
direction: "ltr"
|
|
34
|
+
}), { nonce: m } = L(S), C = r.props?.ref ?? r?.ref, b = T(t, C);
|
|
35
|
+
return M(() => {
|
|
36
|
+
const { width: l, height: a, top: w, left: u, right: g, bottom: y, direction: P } = d.current;
|
|
37
|
+
if (s || p === !1 || !t.current || !l || !a)
|
|
38
|
+
return;
|
|
39
|
+
const R = P === "rtl", z = e === "left" ? R ? `right: ${g}` : `left: ${u}` : R ? `left: ${u}` : `right: ${g}`, E = o === "bottom" ? `bottom: ${y}` : `top: ${w}`;
|
|
40
|
+
t.current.dataset.motionPopId = i;
|
|
41
|
+
const n = document.createElement("style");
|
|
42
|
+
m && (n.nonce = m);
|
|
43
|
+
const c = f ?? document.head;
|
|
44
|
+
return c.appendChild(n), n.sheet && n.sheet.insertRule(`
|
|
45
|
+
[data-motion-pop-id="${i}"] {
|
|
46
|
+
position: absolute !important;
|
|
47
|
+
width: ${l}px !important;
|
|
48
|
+
height: ${a}px !important;
|
|
49
|
+
${z}px !important;
|
|
50
|
+
${E}px !important;
|
|
51
|
+
}
|
|
52
|
+
`), () => {
|
|
53
|
+
t.current?.removeAttribute("data-motion-pop-id"), c.contains(n) && c.removeChild(n);
|
|
54
|
+
};
|
|
55
|
+
}, [s]), H(v, { isPresent: s, childRef: t, sizeRef: d, pop: p, children: p === !1 ? r : x.cloneElement(r, { ref: b }) });
|
|
56
|
+
}
|
|
57
|
+
export {
|
|
58
|
+
B as PopChild
|
|
59
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import * as M from "react";
|
|
3
|
+
import { useId as w, useMemo as c } from "react";
|
|
4
|
+
import { PresenceContext as x } from "../../context/PresenceContext.js";
|
|
5
|
+
import { useConstant as R } from "../../utils/use-constant.js";
|
|
6
|
+
import { PopChild as g } from "./PopChild.js";
|
|
7
|
+
const _ = ({ children: n, initial: p, isPresent: r, onExitComplete: o, custom: i, presenceAffectsLayout: m, mode: l, anchorX: d, anchorY: h, root: C }) => {
|
|
8
|
+
const e = R(j), v = w();
|
|
9
|
+
let u = !0, s = c(() => (u = !1, {
|
|
10
|
+
id: v,
|
|
11
|
+
initial: p,
|
|
12
|
+
isPresent: r,
|
|
13
|
+
custom: i,
|
|
14
|
+
onExitComplete: (t) => {
|
|
15
|
+
e.set(t, !0);
|
|
16
|
+
for (const f of e.values())
|
|
17
|
+
if (!f)
|
|
18
|
+
return;
|
|
19
|
+
o && o();
|
|
20
|
+
},
|
|
21
|
+
register: (t) => (e.set(t, !1), () => e.delete(t))
|
|
22
|
+
}), [r, e, o]);
|
|
23
|
+
return m && u && (s = { ...s }), c(() => {
|
|
24
|
+
e.forEach((t, f) => e.set(f, !1));
|
|
25
|
+
}, [r]), M.useEffect(() => {
|
|
26
|
+
!r && !e.size && o && o();
|
|
27
|
+
}, [r]), n = a(g, { pop: l === "popLayout", isPresent: r, anchorX: d, anchorY: h, root: C, children: n }), a(x.Provider, { value: s, children: n });
|
|
28
|
+
};
|
|
29
|
+
function j() {
|
|
30
|
+
return /* @__PURE__ */ new Map();
|
|
31
|
+
}
|
|
32
|
+
export {
|
|
33
|
+
_ as PresenceChild
|
|
34
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx as w, Fragment as S } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as T, useRef as a, useState as E, useContext as Y } from "react";
|
|
3
|
+
import { LayoutGroupContext as F } from "../../context/LayoutGroupContext.js";
|
|
4
|
+
import { useConstant as G } from "../../utils/use-constant.js";
|
|
5
|
+
import { useIsomorphicLayoutEffect as O } from "../../utils/use-isomorphic-effect.js";
|
|
6
|
+
import { PresenceChild as V } from "./PresenceChild.js";
|
|
7
|
+
import { usePresence as X } from "./use-presence.js";
|
|
8
|
+
import { onlyElements as v, getChildKey as c } from "./utils.js";
|
|
9
|
+
const W = ({ children: h, custom: R, initial: k = !0, onExitComplete: p, presenceAffectsLayout: A = !0, mode: u = "sync", propagate: l = !1, anchorX: L = "left", anchorY: b = "top", root: j }) => {
|
|
10
|
+
const [C, D] = X(l), n = T(() => v(h), [h]), o = l && !C ? [] : n.map(c), y = a(!0), x = a(n), s = G(() => /* @__PURE__ */ new Map()), f = a(/* @__PURE__ */ new Set()), [I, K] = E(n), [r, g] = E(n);
|
|
11
|
+
O(() => {
|
|
12
|
+
y.current = !1, x.current = n;
|
|
13
|
+
for (let t = 0; t < r.length; t++) {
|
|
14
|
+
const e = c(r[t]);
|
|
15
|
+
o.includes(e) ? (s.delete(e), f.current.delete(e)) : s.get(e) !== !0 && s.set(e, !1);
|
|
16
|
+
}
|
|
17
|
+
}, [r, o.length, o.join("-")]);
|
|
18
|
+
const d = [];
|
|
19
|
+
if (n !== I) {
|
|
20
|
+
let t = [...n];
|
|
21
|
+
for (let e = 0; e < r.length; e++) {
|
|
22
|
+
const i = r[e], m = c(i);
|
|
23
|
+
o.includes(m) || (t.splice(e, 0, i), d.push(i));
|
|
24
|
+
}
|
|
25
|
+
return u === "wait" && d.length && (t = d), g(v(t)), K(n), null;
|
|
26
|
+
}
|
|
27
|
+
process.env.NODE_ENV !== "production" && u === "wait" && r.length > 1 && console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);
|
|
28
|
+
const { forceRender: M } = Y(F);
|
|
29
|
+
return w(S, { children: r.map((t) => {
|
|
30
|
+
const e = c(t), i = l && !C ? !1 : n === r || o.includes(e), m = () => {
|
|
31
|
+
if (f.current.has(e))
|
|
32
|
+
return;
|
|
33
|
+
if (s.has(e))
|
|
34
|
+
f.current.add(e), s.set(e, !0);
|
|
35
|
+
else
|
|
36
|
+
return;
|
|
37
|
+
let P = !0;
|
|
38
|
+
s.forEach((N) => {
|
|
39
|
+
N || (P = !1);
|
|
40
|
+
}), P && (M?.(), g(x.current), l && D?.(), p && p());
|
|
41
|
+
};
|
|
42
|
+
return w(V, { isPresent: i, initial: !y.current || k ? void 0 : !1, custom: R, presenceAffectsLayout: A, mode: u, root: j, onExitComplete: i ? void 0 : m, anchorX: L, anchorY: b, children: t }, e);
|
|
43
|
+
}) });
|
|
44
|
+
};
|
|
45
|
+
export {
|
|
46
|
+
W as AnimatePresence
|
|
47
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as l from "react";
|
|
2
|
+
function f(n, u) {
|
|
3
|
+
if (typeof n == "function")
|
|
4
|
+
return n(u);
|
|
5
|
+
n != null && (n.current = u);
|
|
6
|
+
}
|
|
7
|
+
function i(...n) {
|
|
8
|
+
return (u) => {
|
|
9
|
+
let o = !1;
|
|
10
|
+
const c = n.map((e) => {
|
|
11
|
+
const t = f(e, u);
|
|
12
|
+
return !o && typeof t == "function" && (o = !0), t;
|
|
13
|
+
});
|
|
14
|
+
if (o)
|
|
15
|
+
return () => {
|
|
16
|
+
for (let e = 0; e < c.length; e++) {
|
|
17
|
+
const t = c[e];
|
|
18
|
+
typeof t == "function" ? t() : f(n[e], null);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function s(...n) {
|
|
24
|
+
return l.useCallback(i(...n), n);
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
s as useComposedRefs
|
|
28
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __exports as e } from "../../../_virtual/react-compiler-runtime.development.js";
|
|
2
2
|
import a from "react";
|
|
3
3
|
var n;
|
|
4
|
-
function
|
|
4
|
+
function l() {
|
|
5
5
|
return n ? e : (n = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
6
6
|
var t = a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
7
7
|
e.c = function(r) {
|
|
@@ -17,5 +17,5 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
|
|
|
17
17
|
})(), e);
|
|
18
18
|
}
|
|
19
19
|
export {
|
|
20
|
-
|
|
20
|
+
l as __require
|
|
21
21
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { __exports as
|
|
1
|
+
import { __exports as e } from "../../../_virtual/react-compiler-runtime.production.js";
|
|
2
2
|
import o from "react";
|
|
3
|
-
var
|
|
4
|
-
function
|
|
5
|
-
if (
|
|
6
|
-
|
|
3
|
+
var r;
|
|
4
|
+
function n() {
|
|
5
|
+
if (r) return e;
|
|
6
|
+
r = 1;
|
|
7
7
|
var t = o.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
8
|
-
return
|
|
8
|
+
return e.c = function(_) {
|
|
9
9
|
return t.H.useMemoCache(_);
|
|
10
|
-
},
|
|
10
|
+
}, e;
|
|
11
11
|
}
|
|
12
12
|
export {
|
|
13
|
-
|
|
13
|
+
n as __require
|
|
14
14
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import a from "react";
|
|
2
|
-
import { View as
|
|
2
|
+
import { View as v } from "./view.js";
|
|
3
3
|
function h(t, e, r) {
|
|
4
4
|
return (e = p(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
|
|
5
5
|
}
|
|
@@ -60,14 +60,14 @@ function w(t, e = []) {
|
|
|
60
60
|
}, l = {
|
|
61
61
|
construct: () => l
|
|
62
62
|
};
|
|
63
|
-
return ((
|
|
63
|
+
return ((d) => {
|
|
64
64
|
try {
|
|
65
|
-
return !!new new Proxy(
|
|
65
|
+
return !!new new Proxy(d, l)();
|
|
66
66
|
} catch {
|
|
67
67
|
return !1;
|
|
68
68
|
}
|
|
69
69
|
})(t) ? new t(n) : t(n);
|
|
70
|
-
}, [t, o]), u = a.useCallback((n) => new
|
|
70
|
+
}, [t, o]), u = a.useCallback((n) => new v(n), []), f = a.useRef(!1);
|
|
71
71
|
return a.useEffect(() => {
|
|
72
72
|
f.current || (f.current = !0, i.clear(), e.forEach((n) => {
|
|
73
73
|
i.add(u(n));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@code0-tech/pictor",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A simple template for a custom React component library",
|
|
6
6
|
"scripts": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@codemirror/lint": "^6.9.7",
|
|
27
27
|
"@codemirror/state": "^6.6.0",
|
|
28
28
|
"@codemirror/view": "^6.43.1",
|
|
29
|
-
"@dagrejs/dagre": "^
|
|
29
|
+
"@dagrejs/dagre": "^3.0.0",
|
|
30
30
|
"@lezer/common": "^1.5.2",
|
|
31
31
|
"@mdx-js/react": "^3.1.1",
|
|
32
32
|
"@radix-ui/react-checkbox": "^1.3.3",
|
|
@@ -35,13 +35,13 @@
|
|
|
35
35
|
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
|
36
36
|
"@radix-ui/react-hover-card": "^1.1.15",
|
|
37
37
|
"@radix-ui/react-one-time-password-field": "^0.1.8",
|
|
38
|
+
"@radix-ui/react-progress": "^1.1.8",
|
|
38
39
|
"@radix-ui/react-radio-group": "^1.3.8",
|
|
39
40
|
"@radix-ui/react-scroll-area": "^1.2.10",
|
|
40
41
|
"@radix-ui/react-select": "^2.2.6",
|
|
41
42
|
"@radix-ui/react-tabs": "^1.1.13",
|
|
42
43
|
"@radix-ui/react-toggle-group": "^1.1.11",
|
|
43
44
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
44
|
-
"@radix-ui/react-progress": "^1.1.8",
|
|
45
45
|
"@rollup/plugin-commonjs": "^29.0.2",
|
|
46
46
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
47
47
|
"@rollup/plugin-terser": "^1.0.0",
|
|
@@ -59,8 +59,9 @@
|
|
|
59
59
|
"@types/react": "^19.2.14",
|
|
60
60
|
"@types/react-dom": "^19.2.3",
|
|
61
61
|
"@types/react-syntax-highlighter": "^15.5.13",
|
|
62
|
-
"@uiw/codemirror-themes": "^4.25.
|
|
62
|
+
"@uiw/codemirror-themes": "^4.25.10",
|
|
63
63
|
"@uiw/react-codemirror": "^4.25.10",
|
|
64
|
+
"@uiw/react-json-view": "^2.0.0-alpha.43",
|
|
64
65
|
"@vitejs/plugin-react": "^5.2.0",
|
|
65
66
|
"@vitest/browser-playwright": "^4.1.2",
|
|
66
67
|
"@vitest/coverage-v8": "^4.1.2",
|
|
@@ -76,6 +77,7 @@
|
|
|
76
77
|
"jest-image-snapshot": "^6.5.2",
|
|
77
78
|
"js-md5": "^0.8.3",
|
|
78
79
|
"merge-props": "^6.0.0",
|
|
80
|
+
"motion": "^12.40.0",
|
|
79
81
|
"playwright": "1.58.1",
|
|
80
82
|
"react": "^19.2.4",
|
|
81
83
|
"react-dom": "^19.2.4",
|
|
@@ -94,7 +96,6 @@
|
|
|
94
96
|
"vite-plugin-dts": "^4.5.4",
|
|
95
97
|
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
96
98
|
"vitest": "^4.1.2",
|
|
97
|
-
"motion": "^12.40.0",
|
|
98
99
|
"zustand": "^4.3.0"
|
|
99
100
|
},
|
|
100
101
|
"main": "dist/index.js",
|
|
@@ -120,26 +121,27 @@
|
|
|
120
121
|
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
|
121
122
|
"@radix-ui/react-hover-card": "^1.1.15",
|
|
122
123
|
"@radix-ui/react-one-time-password-field": "^0.1.8",
|
|
124
|
+
"@radix-ui/react-progress": "^1.1.8",
|
|
123
125
|
"@radix-ui/react-radio-group": "^1.3.8",
|
|
124
126
|
"@radix-ui/react-scroll-area": "^1.2.10",
|
|
125
127
|
"@radix-ui/react-select": "^2.2.6",
|
|
126
128
|
"@radix-ui/react-tabs": "^1.1.13",
|
|
127
129
|
"@radix-ui/react-toggle-group": "^1.1.11",
|
|
128
130
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
129
|
-
"@radix-ui/react-progress": "^1.1.8",
|
|
130
131
|
"@tabler/icons-react": "3.41.1",
|
|
131
132
|
"@uiw/codemirror-themes": "^4.25.4",
|
|
132
133
|
"@uiw/react-codemirror": "^4.25.4",
|
|
134
|
+
"@uiw/react-json-view": "^2.0.0-alpha.43",
|
|
133
135
|
"avvvatars-react": "^0.4.2",
|
|
134
136
|
"cmdk": "^1.1.1",
|
|
135
137
|
"js-md5": "^0.8.3",
|
|
136
138
|
"merge-props": "^6.0.0",
|
|
139
|
+
"motion": "^12.40.0",
|
|
137
140
|
"react": "^18.0.0 || ^19.0.0",
|
|
138
141
|
"react-dom": "^18.0.0 || ^19.0.0",
|
|
139
142
|
"react-resizable-panels": "^4.3.1",
|
|
140
143
|
"react-zoom-pan-pinch": "^3.7.0",
|
|
141
144
|
"sonner": "^2.0.7",
|
|
142
|
-
"motion": "^12.40.0",
|
|
143
145
|
"zustand": ">=4.3.0 <5.0.0"
|
|
144
146
|
},
|
|
145
147
|
"publishConfig": {
|