@xiping/react-components 0.0.73 → 1.0.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/dist/cjs/components/pinch-content/PinchContent.js +1 -1
- package/dist/cjs/components/txt-editor/TxtEditor.js +1 -1
- package/dist/es/components/pinch-content/PinchContent.js +1 -1
- package/dist/es/components/txt-editor/TxtEditor.js +1 -1
- package/package.json +40 -39
- /package/dist/cjs/node_modules/.pnpm/{@monaco-editor_react@4.7.0-rc.0_monaco-editor@0.52.2_react-dom@18.3.1_react@18.3.1__react@18.3.1 → @monaco-editor_react@4.7.0_monaco-editor@0.52.2_react-dom@18.3.1_react@18.3.1__react@18.3.1}/node_modules/@monaco-editor/react/dist/index.js +0 -0
- /package/dist/es/node_modules/.pnpm/{@monaco-editor_react@4.7.0-rc.0_monaco-editor@0.52.2_react-dom@18.3.1_react@18.3.1__react@18.3.1 → @monaco-editor_react@4.7.0_monaco-editor@0.52.2_react-dom@18.3.1_react@18.3.1__react@18.3.1}/node_modules/@monaco-editor/react/dist/index.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const D=require("react/jsx-runtime"),v=require("@react-spring/web"),i=require("@use-gesture/react"),B=require("react"),x=require("ahooks"),C=require("clsx"),G=i.createUseGesture([i.dragAction,i.pinchAction,i.wheelAction]),u=l=>l.preventDefault(),N=l=>{const{className:m,children:y,canPinch:h=!0,canDrag:p=!0,canRotate:b=!0,scaleBounds:d={min:.3,max:10},wheelZoomFactor:S=.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const D=require("react/jsx-runtime"),v=require("@react-spring/web"),i=require("@use-gesture/react"),B=require("react"),x=require("ahooks"),C=require("clsx"),G=i.createUseGesture([i.dragAction,i.pinchAction,i.wheelAction]),u=l=>l.preventDefault(),N=l=>{const{className:m,children:y,canPinch:h=!0,canDrag:p=!0,canRotate:b=!0,scaleBounds:d={min:.3,max:10},wheelZoomFactor:S=.001}=l,n=B.useRef(null);x.useMount(()=>{var t,e,r;(t=n.current)==null||t.addEventListener("gesturestart",u),(e=n.current)==null||e.addEventListener("gesturechange",u),(r=n.current)==null||r.addEventListener("gestureend",u)}),x.useUnmount(()=>{var t,e,r;(t=n.current)==null||t.removeEventListener("gesturestart",u),(e=n.current)==null||e.removeEventListener("gesturechange",u),(r=n.current)==null||r.removeEventListener("gestureend",u)});const[s,g]=v.useSpring(()=>({x:0,y:0,scale:1,rotateZ:0}));return G({onWheel:({event:t,delta:[,e]})=>{if(!h)return;const c=s.scale.get()*(1-e*S),o=Math.min(Math.max(c,d.min),d.max);g.start({scale:o})},onDrag:({pinching:t,cancel:e,offset:[r,c],...o})=>{if(!p||t)return e();g.start({x:r,y:c})},onPinch:({origin:[t,e],first:r,movement:[c],offset:[o,q],memo:a,cancel:w})=>{if(!h)return w();if(r){const{width:M,height:R,x:P,y:Z}=n.current.getBoundingClientRect(),j=t-(P+M/2),A=e-(Z+R/2);a=[s.x.get(),s.y.get(),j,A]}const E=a[0]-(c-1)*a[2],L=a[1]-(c-1)*a[3],f={scale:o,rotateZ:0,x:E,y:L};return b&&(f.rotateZ=q),g.start(f),a}},{target:n,drag:{from:()=>[s.x.get(),s.y.get()]},pinch:{scaleBounds:d,rubberband:!0},wheel:{enabled:!0}}),D.jsx(v.animated.div,{className:C("select-none",m),ref:n,style:s,children:y})};exports.default=N;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("react/jsx-runtime"),b=require("../../node_modules/.pnpm/@monaco-editor_react@4.7.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("react/jsx-runtime"),b=require("../../node_modules/.pnpm/@monaco-editor_react@4.7.0_monaco-editor@0.52.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@monaco-editor/react/dist/index.js"),E=require("react"),R=({height:l="500px",width:r="100%",language:n="plaintext",defaultValue:a,value:d,theme:o="light",readOnly:s=!1,onChange:t,onMount:i,className:u})=>{const c=E.useRef(null),f=(e,x)=>{c.current=e,i==null||i(e,x),e.updateOptions({minimap:{enabled:!1},lineNumbers:"on",roundedSelection:!1,scrollBeyondLastLine:!1,readOnly:s,fontSize:14})},p=e=>{t==null||t(e||"")};return m.jsx(b.default,{className:u,height:l,width:r,defaultLanguage:n,defaultValue:a,value:d,theme:o,onMount:f,onChange:p,options:{readOnly:s}})};exports.TxtEditor=R;
|
|
@@ -12,7 +12,7 @@ const q = C([G, N, U]), o = (i) => i.preventDefault(), Q = (i) => {
|
|
|
12
12
|
canDrag: p = !0,
|
|
13
13
|
canRotate: v = !0,
|
|
14
14
|
scaleBounds: l = { min: 0.3, max: 10 },
|
|
15
|
-
wheelZoomFactor: x =
|
|
15
|
+
wheelZoomFactor: x = 1e-3
|
|
16
16
|
} = i, n = j(null);
|
|
17
17
|
F(() => {
|
|
18
18
|
var t, e, r;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
-
import c from "../../node_modules/.pnpm/@monaco-editor_react@4.7.
|
|
2
|
+
import c from "../../node_modules/.pnpm/@monaco-editor_react@4.7.0_monaco-editor@0.52.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@monaco-editor/react/dist/index.js";
|
|
3
3
|
import { useRef as x } from "react";
|
|
4
4
|
const D = ({
|
|
5
5
|
height: o = "500px",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xiping/react-components",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "1.0.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/cjs/index.js",
|
|
7
7
|
"module": "./dist/es/index.js",
|
|
@@ -33,65 +33,66 @@
|
|
|
33
33
|
"react-dom": ">=18 || >= 19"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@heroui/button": "^2.2.
|
|
37
|
-
"@heroui/modal": "^2.2.
|
|
38
|
-
"@heroui/spinner": "^2.2.
|
|
39
|
-
"@monaco-editor/react": "4.7.0
|
|
36
|
+
"@heroui/button": "^2.2.17",
|
|
37
|
+
"@heroui/modal": "^2.2.14",
|
|
38
|
+
"@heroui/spinner": "^2.2.14",
|
|
39
|
+
"@monaco-editor/react": "4.7.0",
|
|
40
40
|
"@nextui-org/theme": "^2.4.5",
|
|
41
|
-
"@radix-ui/react-scroll-area": "^1.2.
|
|
41
|
+
"@radix-ui/react-scroll-area": "^1.2.4",
|
|
42
42
|
"@react-spring/web": "^9.7.5",
|
|
43
43
|
"@use-gesture/react": "^10.3.1",
|
|
44
|
+
"@xiping/llm-utils": "1.0.1",
|
|
44
45
|
"ahooks": "^3.8.4",
|
|
45
|
-
"axios": "^1.
|
|
46
|
+
"axios": "^1.8.4",
|
|
46
47
|
"class-variance-authority": "^0.7.1",
|
|
47
48
|
"clsx": "^2.1.1",
|
|
48
49
|
"dayjs": "^1.11.13",
|
|
49
50
|
"lodash-es": "^4.17.21",
|
|
50
|
-
"motion": "^12.
|
|
51
|
+
"motion": "^12.7.3",
|
|
51
52
|
"react": "^18.3.1",
|
|
52
53
|
"react-dom": "^18.3.1",
|
|
53
|
-
"react-icons": "^5.
|
|
54
|
+
"react-icons": "^5.5.0",
|
|
54
55
|
"react-resizable-panels": "^2.1.7",
|
|
55
|
-
"react-router-dom": "^7.
|
|
56
|
+
"react-router-dom": "^7.5.0",
|
|
56
57
|
"zustand": "^5.0.3"
|
|
57
58
|
},
|
|
58
59
|
"devDependencies": {
|
|
59
|
-
"@chromatic-com/storybook": "^3.2.
|
|
60
|
-
"@eslint/js": "^9.
|
|
61
|
-
"@faker-js/faker": "^9.
|
|
62
|
-
"@storybook/addon-essentials": "^8.
|
|
63
|
-
"@storybook/addon-interactions": "^8.
|
|
64
|
-
"@storybook/addon-onboarding": "^8.
|
|
65
|
-
"@storybook/blocks": "^8.
|
|
66
|
-
"@storybook/react": "^8.
|
|
67
|
-
"@storybook/react-vite": "^8.
|
|
68
|
-
"@storybook/test": "^8.
|
|
60
|
+
"@chromatic-com/storybook": "^3.2.6",
|
|
61
|
+
"@eslint/js": "^9.24.0",
|
|
62
|
+
"@faker-js/faker": "^9.7.0",
|
|
63
|
+
"@storybook/addon-essentials": "^8.6.12",
|
|
64
|
+
"@storybook/addon-interactions": "^8.6.12",
|
|
65
|
+
"@storybook/addon-onboarding": "^8.6.12",
|
|
66
|
+
"@storybook/blocks": "^8.6.12",
|
|
67
|
+
"@storybook/react": "^8.6.12",
|
|
68
|
+
"@storybook/react-vite": "^8.6.12",
|
|
69
|
+
"@storybook/test": "^8.6.12",
|
|
69
70
|
"@types/lodash-es": "^4.17.12",
|
|
70
|
-
"@types/node": "^22.
|
|
71
|
-
"@types/react": "^18.3.
|
|
72
|
-
"@types/react-dom": "^18.3.
|
|
73
|
-
"@vitejs/plugin-react": "^4.
|
|
74
|
-
"autoprefixer": "^10.4.
|
|
75
|
-
"eslint": "^9.
|
|
76
|
-
"eslint-plugin-react-hooks": "^5.
|
|
71
|
+
"@types/node": "^22.14.1",
|
|
72
|
+
"@types/react": "^18.3.20",
|
|
73
|
+
"@types/react-dom": "^18.3.6",
|
|
74
|
+
"@vitejs/plugin-react": "^4.4.0",
|
|
75
|
+
"autoprefixer": "^10.4.21",
|
|
76
|
+
"eslint": "^9.24.0",
|
|
77
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
77
78
|
"eslint-plugin-react-refresh": "^0.4.19",
|
|
78
|
-
"eslint-plugin-storybook": "^0.11.
|
|
79
|
-
"globals": "^
|
|
80
|
-
"postcss": "^8.5.
|
|
79
|
+
"eslint-plugin-storybook": "^0.11.6",
|
|
80
|
+
"globals": "^16.0.0",
|
|
81
|
+
"postcss": "^8.5.3",
|
|
81
82
|
"rollup-preserve-directives": "^1.1.3",
|
|
82
|
-
"sharp": "^0.
|
|
83
|
-
"storybook": "^8.
|
|
83
|
+
"sharp": "^0.34.1",
|
|
84
|
+
"storybook": "^8.6.12",
|
|
84
85
|
"svgo": "^3.3.2",
|
|
85
86
|
"tailwind-merge": "^2.6.0",
|
|
86
87
|
"tailwind-scrollbar": "^3.1.0",
|
|
87
88
|
"tailwindcss": "^3.4.17",
|
|
88
89
|
"tailwindcss-safe-area": "^0.6.0",
|
|
89
|
-
"typescript": "^5.
|
|
90
|
-
"typescript-eslint": "^8.
|
|
91
|
-
"vite": "^6.1
|
|
92
|
-
"vite-plugin-dts": "^4.5.
|
|
90
|
+
"typescript": "^5.8.3",
|
|
91
|
+
"typescript-eslint": "^8.30.1",
|
|
92
|
+
"vite": "^6.3.1",
|
|
93
|
+
"vite-plugin-dts": "^4.5.3",
|
|
93
94
|
"vite-plugin-image-optimizer": "^1.1.8",
|
|
94
|
-
"vite-plugin-lib-inject-css": "^2.2.
|
|
95
|
+
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
95
96
|
"vite-plugin-zip-pack": "^1.2.4",
|
|
96
97
|
"vite-tsconfig-paths": "^5.1.4"
|
|
97
98
|
},
|
|
@@ -100,7 +101,7 @@
|
|
|
100
101
|
"registry": "https://registry.npmjs.org/"
|
|
101
102
|
},
|
|
102
103
|
"engines": {
|
|
103
|
-
"node": ">=
|
|
104
|
+
"node": ">=20"
|
|
104
105
|
},
|
|
105
|
-
"gitHead": "
|
|
106
|
+
"gitHead": "87655c89458468f47fab482592fe869330e9458a"
|
|
106
107
|
}
|