@easyv/biz-components 0.0.1 → 0.0.3

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.
@@ -2,6 +2,10 @@ import { DashboardContext } from './types';
2
2
 
3
3
  export interface AiMessageRenderProps {
4
4
  className?: string;
5
- content: (string | DashboardContext)[];
5
+ contents: (string | DashboardContext)[];
6
+ renderDashboardContent?: (msg: DashboardContext) => React.ReactNode;
7
+ showFooterButtons?: boolean;
8
+ onCopy?: () => void;
9
+ onRedo?: () => void;
6
10
  }
7
11
  export declare const AiMessageRender: (props: AiMessageRenderProps) => JSX.Element;
@@ -1,17 +1,24 @@
1
1
  import { j as e } from "../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.es.js";
2
- import { CopyCircleOutlined as p, RedoOutlined as h } from "../../node_modules/.pnpm/@easyv_react-icons@6.3.0/node_modules/@easyv/react-icons/dist/index.esm.es.js";
3
- import u from "../../node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.es.js";
4
- import j from "./index.css.es.js";
5
- import { ShadowDom as g } from "../ShadowDom/ShadowDom.es.js";
6
- import { Markdown as v } from "../../node_modules/.pnpm/react-markdown@10.1.0_@types_react@18.2.0_react@18.2.0/node_modules/react-markdown/lib/index.es.js";
7
- const S = (l) => {
8
- const { className: d = "", content: c } = l, a = (t, r) => /* @__PURE__ */ e.jsx(g, { style: j, children: /* @__PURE__ */ e.jsx(v, { children: t }) }, r), m = (t, r) => {
9
- const { data: s, filterCode: n, plotModuleName: x, plotVersion: f } = t;
10
- let i = s;
11
- return n && (i = new Function("data", n)(s)), /* @__PURE__ */ e.jsxs("div", { children: [
2
+ import { CopyCircleOutlined as p, RedoOutlined as u } from "../../node_modules/.pnpm/@easyv_react-icons@6.3.0/node_modules/@easyv/react-icons/dist/index.esm.es.js";
3
+ import j from "../../node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.es.js";
4
+ import v from "./index.css.es.js";
5
+ import { ShadowDom as N } from "../ShadowDom/ShadowDom.es.js";
6
+ import { Markdown as w } from "../../node_modules/.pnpm/react-markdown@10.1.0_@types_react@18.2.0_react@18.2.0/node_modules/react-markdown/lib/index.es.js";
7
+ const R = (d) => {
8
+ const {
9
+ className: a = "",
10
+ renderDashboardContent: s,
11
+ showFooterButtons: l = !1,
12
+ contents: c
13
+ } = d, m = (t) => /* @__PURE__ */ e.jsx(N, { style: v, children: /* @__PURE__ */ e.jsx(w, { children: t }) }), x = (t) => {
14
+ const { data: r, filterCode: n, plotModuleName: h, plotVersion: f } = t;
15
+ if (s)
16
+ return s(t);
17
+ let o = r;
18
+ return n && (o = new Function("data", n)(r)), /* @__PURE__ */ e.jsxs("div", { children: [
12
19
  /* @__PURE__ */ e.jsxs("div", { children: [
13
20
  "组件名称:",
14
- x
21
+ h
15
22
  ] }),
16
23
  /* @__PURE__ */ e.jsxs("div", { children: [
17
24
  "组件版本:",
@@ -19,29 +26,29 @@ const S = (l) => {
19
26
  ] }),
20
27
  /* @__PURE__ */ e.jsxs("div", { children: [
21
28
  "组件数据:",
22
- i.slice(0, 5).map((o) => JSON.stringify(o))
29
+ o.slice(0, 5).map((i) => JSON.stringify(i))
23
30
  ] })
24
- ] }, r);
31
+ ] });
25
32
  };
26
33
  return /* @__PURE__ */ e.jsxs(
27
34
  "div",
28
35
  {
29
- className: u(
36
+ className: j(
30
37
  "px-4 py-3 flex flex-col gap-3 rounded-lg max-w-[516px]",
31
38
  "bg-[#FFFFFF14] select-auto",
32
- d
39
+ a
33
40
  ),
34
41
  children: [
35
- c.map((t, r) => typeof t == "string" ? a(t, r.toString()) : m(t, r.toString())),
36
- /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
42
+ c.map((t, r) => typeof t == "string" ? /* @__PURE__ */ e.jsx("div", { className: "contents", children: m(t) }, r) : /* @__PURE__ */ e.jsx("div", { className: "contents", children: x(t) }, r)),
43
+ l && /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
37
44
  /* @__PURE__ */ e.jsx("div", { className: "w-6 h-6 rounded-md flex justify-center items-center hover:bg-bg-white cursor-pointer", children: /* @__PURE__ */ e.jsx(p, { className: "w-3.5 h-3.5 text-text-2" }) }),
38
- /* @__PURE__ */ e.jsx("div", { className: "w-6 h-6 rounded-md flex justify-center items-center hover:bg-bg-white cursor-pointer", children: /* @__PURE__ */ e.jsx(h, { className: "w-3.5 h-3.5 text-text-2" }) })
45
+ /* @__PURE__ */ e.jsx("div", { className: "w-6 h-6 rounded-md flex justify-center items-center hover:bg-bg-white cursor-pointer", children: /* @__PURE__ */ e.jsx(u, { className: "w-3.5 h-3.5 text-text-2" }) })
39
46
  ] })
40
47
  ]
41
48
  }
42
49
  );
43
50
  };
44
51
  export {
45
- S as AiMessageRender
52
+ R as AiMessageRender
46
53
  };
47
54
  //# sourceMappingURL=AiMessageRender.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AiMessageRender.es.js","sources":["../../../src/components/AiMessageRender/AiMessageRender.tsx"],"sourcesContent":["import { CopyCircleOutlined, RedoOutlined } from '@easyv/react-icons';\nimport classNames from 'classnames';\nimport Markdown from 'react-markdown';\nimport { ShadowDom } from '../ShadowDom';\n// @ts-expect-error\nimport messageRenderCss from './index.css?raw';\nimport { DashboardContext } from './types';\n\nexport interface AiMessageRenderProps {\n className?: string;\n content: (string | DashboardContext)[];\n}\n\nexport const AiMessageRender = (props: AiMessageRenderProps) => {\n const { className = '', content } = props;\n\n const renderStringContent = (msg: string, key?: string) => {\n return (\n <ShadowDom style={messageRenderCss} key={key}>\n <Markdown>{msg}</Markdown>\n </ShadowDom>\n );\n };\n const renderDashboardContent = (msg: DashboardContext, key?: string) => {\n const { data, filterCode, plotModuleName, plotVersion } = msg;\n let finalData = data;\n if (filterCode) {\n const filterFunc = new Function('data', filterCode);\n finalData = filterFunc(data) as unknown[];\n }\n return (\n <div key={key}>\n <div>组件名称:{plotModuleName}</div>\n <div>组件版本:{plotVersion}</div>\n <div>组件数据:{finalData.slice(0, 5).map((i: unknown) => JSON.stringify(i))}</div>\n </div>\n );\n };\n\n return (\n <div\n className={classNames(\n 'px-4 py-3 flex flex-col gap-3 rounded-lg max-w-[516px]',\n 'bg-[#FFFFFF14] select-auto',\n className\n )}\n >\n {content.map((msg, index) => {\n if (typeof msg === 'string') {\n return renderStringContent(msg, index.toString());\n } else {\n return renderDashboardContent(msg, index.toString());\n }\n })}\n <div className='flex gap-1'>\n <div className='w-6 h-6 rounded-md flex justify-center items-center hover:bg-bg-white cursor-pointer'>\n <CopyCircleOutlined className='w-3.5 h-3.5 text-text-2' />\n </div>\n <div className='w-6 h-6 rounded-md flex justify-center items-center hover:bg-bg-white cursor-pointer'>\n <RedoOutlined className='w-3.5 h-3.5 text-text-2' />\n </div>\n </div>\n </div>\n );\n};\n"],"names":["AiMessageRender","props","className","content","renderStringContent","msg","key","jsx","ShadowDom","messageRenderCss","Markdown","renderDashboardContent","data","filterCode","plotModuleName","plotVersion","finalData","jsxs","i","classNames","index","CopyCircleOutlined","RedoOutlined"],"mappings":";;;;;;AAaa,MAAAA,IAAkB,CAACC,MAAgC;AAC9D,QAAM,EAAE,WAAAC,IAAY,IAAI,SAAAC,EAAY,IAAAF,GAE9BG,IAAsB,CAACC,GAAaC,MAEtCC,gBAAAA,EAAA,IAACC,KAAU,OAAOC,GAChB,gCAACC,GAAU,EAAA,UAAAL,EAAA,CAAI,KADwBC,CAEzC,GAGEK,IAAyB,CAACN,GAAuBC,MAAiB;AACtE,UAAM,EAAE,MAAAM,GAAM,YAAAC,GAAY,gBAAAC,GAAgB,aAAAC,EAAgB,IAAAV;AAC1D,QAAIW,IAAYJ;AAChB,WAAIC,MAEFG,IADmB,IAAI,SAAS,QAAQH,CAAU,EAC3BD,CAAI,2BAG1B,OACC,EAAA,UAAA;AAAA,MAAAK,gBAAAA,OAAC,OAAI,EAAA,UAAA;AAAA,QAAA;AAAA,QAAMH;AAAA,MAAA,GAAe;AAAA,6BACzB,OAAI,EAAA,UAAA;AAAA,QAAA;AAAA,QAAMC;AAAA,MAAA,GAAY;AAAA,6BACtB,OAAI,EAAA,UAAA;AAAA,QAAA;AAAA,QAAMC,EAAU,MAAM,GAAG,CAAC,EAAE,IAAI,CAACE,MAAe,KAAK,UAAUA,CAAC,CAAC;AAAA,MAAA,EAAE,CAAA;AAAA,IAAA,EAAA,GAHhEZ,CAIV;AAAA,EAEJ;AAGE,SAAAW,gBAAAA,EAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWE;AAAA,QACT;AAAA,QACA;AAAA,QACAjB;AAAA,MACF;AAAA,MAEC,UAAA;AAAA,QAAQC,EAAA,IAAI,CAACE,GAAKe,MACb,OAAOf,KAAQ,WACVD,EAAoBC,GAAKe,EAAM,SAAA,CAAU,IAEzCT,EAAuBN,GAAKe,EAAM,SAAA,CAAU,CAEtD;AAAA,QACDH,gBAAAA,EAAAA,KAAC,OAAI,EAAA,WAAU,cACb,UAAA;AAAA,UAAAV,gBAAAA,EAAAA,IAAC,SAAI,WAAU,wFACb,gCAACc,GAAmB,EAAA,WAAU,2BAA0B,EAC1D,CAAA;AAAA,UACAd,gBAAAA,EAAAA,IAAC,SAAI,WAAU,wFACb,gCAACe,GAAa,EAAA,WAAU,0BAA0B,CAAA,EACpD,CAAA;AAAA,QAAA,EACF,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACF;AAEJ;"}
1
+ {"version":3,"file":"AiMessageRender.es.js","sources":["../../../src/components/AiMessageRender/AiMessageRender.tsx"],"sourcesContent":["import { CopyCircleOutlined, RedoOutlined } from '@easyv/react-icons';\nimport classNames from 'classnames';\nimport Markdown from 'react-markdown';\nimport { ShadowDom } from '../ShadowDom';\n// @ts-expect-error\nimport messageRenderCss from './index.css?raw';\nimport { DashboardContext } from './types';\n\nexport interface AiMessageRenderProps {\n className?: string;\n contents: (string | DashboardContext)[];\n renderDashboardContent?: (msg: DashboardContext) => React.ReactNode;\n showFooterButtons?: boolean;\n onCopy?: () => void;\n onRedo?: () => void;\n}\n\nexport const AiMessageRender = (props: AiMessageRenderProps) => {\n const {\n className = '',\n renderDashboardContent: propsRenderDashboardContent,\n showFooterButtons = false,\n contents,\n } = props;\n\n const renderStringContent = (msg: string) => {\n return (\n <ShadowDom style={messageRenderCss}>\n <Markdown>{msg}</Markdown>\n </ShadowDom>\n );\n };\n const renderDashboardContent = (msg: DashboardContext) => {\n const { data, filterCode, plotModuleName, plotVersion } = msg;\n if (propsRenderDashboardContent) {\n return propsRenderDashboardContent(msg);\n }\n let finalData = data;\n if (filterCode) {\n const filterFunc = new Function('data', filterCode);\n finalData = filterFunc(data) as unknown[];\n }\n return (\n <div>\n <div>组件名称:{plotModuleName}</div>\n <div>组件版本:{plotVersion}</div>\n <div>组件数据:{finalData.slice(0, 5).map((i: unknown) => JSON.stringify(i))}</div>\n </div>\n );\n };\n\n return (\n <div\n className={classNames(\n 'px-4 py-3 flex flex-col gap-3 rounded-lg max-w-[516px]',\n 'bg-[#FFFFFF14] select-auto',\n className\n )}\n >\n {contents.map((msg, index) => {\n if (typeof msg === 'string') {\n return (\n <div key={index} className='contents'>\n {renderStringContent(msg)}\n </div>\n );\n } else {\n return (\n <div key={index} className='contents'>\n {renderDashboardContent(msg)}\n </div>\n );\n }\n })}\n {showFooterButtons && (\n <div className='flex gap-1'>\n <div className='w-6 h-6 rounded-md flex justify-center items-center hover:bg-bg-white cursor-pointer'>\n <CopyCircleOutlined className='w-3.5 h-3.5 text-text-2' />\n </div>\n <div className='w-6 h-6 rounded-md flex justify-center items-center hover:bg-bg-white cursor-pointer'>\n <RedoOutlined className='w-3.5 h-3.5 text-text-2' />\n </div>\n </div>\n )}\n </div>\n );\n};\n"],"names":["AiMessageRender","props","className","propsRenderDashboardContent","showFooterButtons","contents","renderStringContent","msg","ShadowDom","messageRenderCss","jsx","Markdown","renderDashboardContent","data","filterCode","plotModuleName","plotVersion","finalData","jsxs","classNames","index","CopyCircleOutlined","RedoOutlined"],"mappings":";;;;;;AAiBa,MAAAA,IAAkB,CAACC,MAAgC;AACxD,QAAA;AAAA,IACJ,WAAAC,IAAY;AAAA,IACZ,wBAAwBC;AAAA,IACxB,mBAAAC,IAAoB;AAAA,IACpB,UAAAC;AAAA,EAAA,IACEJ,GAEEK,IAAsB,CAACC,4BAExBC,GAAU,EAAA,OAAOC,GAChB,UAACC,gBAAAA,EAAA,IAAAC,GAAA,EAAU,aAAI,EACjB,CAAA,GAGEC,IAAyB,CAACL,MAA0B;AACxD,UAAM,EAAE,MAAAM,GAAM,YAAAC,GAAY,gBAAAC,GAAgB,aAAAC,EAAgB,IAAAT;AAC1D,QAAIJ;AACF,aAAOA,EAA4BI,CAAG;AAExC,QAAIU,IAAYJ;AAChB,WAAIC,MAEFG,IADmB,IAAI,SAAS,QAAQH,CAAU,EAC3BD,CAAI,2BAG1B,OACC,EAAA,UAAA;AAAA,MAAAK,gBAAAA,OAAC,OAAI,EAAA,UAAA;AAAA,QAAA;AAAA,QAAMH;AAAA,MAAA,GAAe;AAAA,6BACzB,OAAI,EAAA,UAAA;AAAA,QAAA;AAAA,QAAMC;AAAA,MAAA,GAAY;AAAA,6BACtB,OAAI,EAAA,UAAA;AAAA,QAAA;AAAA,QAAMC,EAAU,MAAM,GAAG,CAAC,EAAE,IAAI,CAAC,MAAe,KAAK,UAAU,CAAC,CAAC;AAAA,MAAA,EAAE,CAAA;AAAA,IAAA,GAC1E;AAAA,EAEJ;AAGE,SAAAC,gBAAAA,EAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC;AAAA,QACT;AAAA,QACA;AAAA,QACAjB;AAAA,MACF;AAAA,MAEC,UAAA;AAAA,QAASG,EAAA,IAAI,CAACE,GAAKa,MACd,OAAOb,KAAQ,iCAEd,OAAgB,EAAA,WAAU,YACxB,UAAoBD,EAAAC,CAAG,KADhBa,CAEV,0BAIC,OAAgB,EAAA,WAAU,YACxB,UAAuBR,EAAAL,CAAG,KADnBa,CAEV,CAGL;AAAA,QACAhB,KACCc,gBAAAA,EAAA,KAAC,OAAI,EAAA,WAAU,cACb,UAAA;AAAA,UAAAR,gBAAAA,EAAAA,IAAC,SAAI,WAAU,wFACb,gCAACW,GAAmB,EAAA,WAAU,2BAA0B,EAC1D,CAAA;AAAA,UACAX,gBAAAA,EAAAA,IAAC,SAAI,WAAU,wFACb,gCAACY,GAAa,EAAA,WAAU,0BAA0B,CAAA,EACpD,CAAA;AAAA,QAAA,EACF,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAEJ;AAEJ;"}
@@ -1,23 +1,25 @@
1
- import { j as e } from "../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.es.js";
2
- import { useRef as i, useEffect as h } from "react";
3
- import { createPortal as l } from "react-dom";
4
- const w = (c) => {
5
- var s, a;
6
- const { children: r, style: n } = c, o = i(null), t = (a = (s = o.current) == null ? void 0 : s.shadowRoot) == null ? void 0 : a.querySelector("[data-shadow-container]");
7
- return h(() => {
8
- if (o.current && !o.current.shadowRoot) {
9
- const d = o.current.attachShadow({ mode: "open" });
10
- d.innerHTML = `
1
+ import { j as o } from "../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.es.js";
2
+ import { useRef as i, useState as h, useEffect as m } from "react";
3
+ import { createPortal as u } from "react-dom";
4
+ const p = (a) => {
5
+ const { children: e, style: n } = a, t = i(null), [r, c] = h();
6
+ return m(() => {
7
+ if (t.current && !t.current.shadowRoot) {
8
+ const s = t.current.attachShadow({ mode: "open" });
9
+ s.innerHTML = `
11
10
  <style>${n}</style>
12
- <div data-shadow-container class="content">1</div>
13
- `;
11
+ <div data-shadow-container class="content"></div>
12
+ `, setTimeout(() => {
13
+ const d = s.querySelector("[data-shadow-container]");
14
+ c(d);
15
+ }, 0);
14
16
  }
15
- }, [r, n]), console.log("%c 🐱 ==== shadow container", "color: orange; font-size: 16px;", o.current, t), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
16
- t && l(r, t),
17
- /* @__PURE__ */ e.jsx("div", { ref: o })
17
+ }, [e, n]), /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
18
+ r && u(e, r),
19
+ /* @__PURE__ */ o.jsx("div", { ref: t })
18
20
  ] });
19
21
  };
20
22
  export {
21
- w as ShadowDom
23
+ p as ShadowDom
22
24
  };
23
25
  //# sourceMappingURL=ShadowDom.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ShadowDom.es.js","sources":["../../../src/components/ShadowDom/ShadowDom.tsx"],"sourcesContent":["import React, { PropsWithChildren, useEffect, useRef } from 'react';\nimport { createPortal } from 'react-dom';\n\ninterface ShadowDomProps {\n style: string;\n}\nexport const ShadowDom = (props: PropsWithChildren<ShadowDomProps>) => {\n const { children, style } = props;\n const shadowRef = useRef<HTMLDivElement>(null);\n const shadowContainer = shadowRef.current?.shadowRoot?.querySelector('[data-shadow-container]');\n\n useEffect(() => {\n if (shadowRef.current && !shadowRef.current.shadowRoot) {\n const shadowRoot = shadowRef.current.attachShadow({ mode: 'open' });\n shadowRoot.innerHTML = `\n <style>${style}</style>\n <div data-shadow-container class=\"content\">1</div>\n `;\n }\n }, [children, style]);\n console.log('%c 🐱 ==== shadow container', 'color: orange; font-size: 16px;', shadowRef.current, shadowContainer);\n\n return (\n <>\n {shadowContainer && createPortal(children, shadowContainer)}\n <div ref={shadowRef} />\n </>\n );\n};\n"],"names":["ShadowDom","props","children","style","shadowRef","useRef","shadowContainer","_b","_a","useEffect","shadowRoot","jsxs","Fragment","createPortal","jsx"],"mappings":";;;AAMa,MAAAA,IAAY,CAACC,MAA6C;;AAC/D,QAAA,EAAE,UAAAC,GAAU,OAAAC,EAAA,IAAUF,GACtBG,IAAYC,EAAuB,IAAI,GACvCC,KAAkBC,KAAAC,IAAAJ,EAAU,YAAV,gBAAAI,EAAmB,eAAnB,gBAAAD,EAA+B,cAAc;AAErE,SAAAE,EAAU,MAAM;AACd,QAAIL,EAAU,WAAW,CAACA,EAAU,QAAQ,YAAY;AACtD,YAAMM,IAAaN,EAAU,QAAQ,aAAa,EAAE,MAAM,QAAQ;AAClE,MAAAM,EAAW,YAAY;AAAA,iBACZP,CAAK;AAAA;AAAA;AAAA,IAAA;AAAA,EAGlB,GACC,CAACD,GAAUC,CAAK,CAAC,GACpB,QAAQ,IAAI,iCAAiC,mCAAmCC,EAAU,SAASE,CAAe,GAI7GK,gBAAAA,EAAA,KAAAC,YAAA,EAAA,UAAA;AAAA,IAAmBN,KAAAO,EAAaX,GAAUI,CAAe;AAAA,IAC1DQ,gBAAAA,EAAAA,IAAC,OAAI,EAAA,KAAKV,EAAW,CAAA;AAAA,EAAA,GACvB;AAEJ;"}
1
+ {"version":3,"file":"ShadowDom.es.js","sources":["../../../src/components/ShadowDom/ShadowDom.tsx"],"sourcesContent":["import React, { PropsWithChildren, useEffect, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\n\ninterface ShadowDomProps {\n style: string;\n}\nexport const ShadowDom = (props: PropsWithChildren<ShadowDomProps>) => {\n const { children, style } = props;\n const shadowRef = useRef<HTMLDivElement>(null);\n const [shadowContainer, setShadowContainer] = useState<HTMLDivElement>(); // shadowRef.current?.shadowRoot?.querySelector('[data-shadow-container]');\n\n useEffect(() => {\n if (shadowRef.current && !shadowRef.current.shadowRoot) {\n const shadowRoot = shadowRef.current.attachShadow({ mode: 'open' });\n shadowRoot.innerHTML = `\n <style>${style}</style>\n <div data-shadow-container class=\"content\"></div>\n `;\n setTimeout(() => {\n const shadowContainerInner = shadowRoot.querySelector('[data-shadow-container]');\n setShadowContainer(shadowContainerInner as HTMLDivElement);\n }, 0);\n }\n }, [children, style]);\n\n return (\n <>\n {shadowContainer && createPortal(children, shadowContainer)}\n <div ref={shadowRef} />\n </>\n );\n};\n"],"names":["ShadowDom","props","children","style","shadowRef","useRef","shadowContainer","setShadowContainer","useState","useEffect","shadowRoot","shadowContainerInner","jsxs","Fragment","createPortal","jsx"],"mappings":";;;AAMa,MAAAA,IAAY,CAACC,MAA6C;AAC/D,QAAA,EAAE,UAAAC,GAAU,OAAAC,EAAA,IAAUF,GACtBG,IAAYC,EAAuB,IAAI,GACvC,CAACC,GAAiBC,CAAkB,IAAIC,EAAyB;AAEvE,SAAAC,EAAU,MAAM;AACd,QAAIL,EAAU,WAAW,CAACA,EAAU,QAAQ,YAAY;AACtD,YAAMM,IAAaN,EAAU,QAAQ,aAAa,EAAE,MAAM,QAAQ;AAClE,MAAAM,EAAW,YAAY;AAAA,iBACZP,CAAK;AAAA;AAAA,SAGhB,WAAW,MAAM;AACT,cAAAQ,IAAuBD,EAAW,cAAc,yBAAyB;AAC/E,QAAAH,EAAmBI,CAAsC;AAAA,SACxD,CAAC;AAAA,IAAA;AAAA,EACN,GACC,CAACT,GAAUC,CAAK,CAAC,GAIfS,gBAAAA,EAAA,KAAAC,YAAA,EAAA,UAAA;AAAA,IAAmBP,KAAAQ,EAAaZ,GAAUI,CAAe;AAAA,IAC1DS,gBAAAA,EAAAA,IAAC,OAAI,EAAA,KAAKX,EAAW,CAAA;AAAA,EAAA,GACvB;AAEJ;"}
@@ -1,3 +1,2 @@
1
- export * from './Button';
2
1
  export * from './AiMessageRender';
3
2
  export * from './ShadowDom';
package/dist/index.es.js CHANGED
@@ -1,9 +1,7 @@
1
- import { Button as r } from "./components/Button/index.es.js";
2
- import { AiMessageRender as m } from "./components/AiMessageRender/AiMessageRender.es.js";
3
- import { ShadowDom as p } from "./components/ShadowDom/ShadowDom.es.js";
1
+ import { AiMessageRender as r } from "./components/AiMessageRender/AiMessageRender.es.js";
2
+ import { ShadowDom as a } from "./components/ShadowDom/ShadowDom.es.js";
4
3
  export {
5
- m as AiMessageRender,
6
- r as Button,
7
- p as ShadowDom
4
+ r as AiMessageRender,
5
+ a as ShadowDom
8
6
  };
9
7
  //# sourceMappingURL=index.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
1
+ {"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easyv/biz-components",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "type": "module",
5
5
  "main": "dist/index.es.js",
6
6
  "module": "dist/index.es.js",
@@ -1,21 +0,0 @@
1
- import { default as React } from 'react';
2
-
3
- export interface ButtonProps {
4
- /**
5
- * 按钮文本
6
- */
7
- children?: React.ReactNode;
8
- /**
9
- * 点击事件处理函数
10
- */
11
- onClick?: () => void;
12
- /**
13
- * 按钮类型
14
- */
15
- type?: 'primary' | 'default' | 'dashed' | 'link' | 'text';
16
- /**
17
- * 是否禁用
18
- */
19
- disabled?: boolean;
20
- }
21
- export declare const Button: React.FC<ButtonProps>;
@@ -1,23 +0,0 @@
1
- import { j as l } from "../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.es.js";
2
- const u = ({ children: r, onClick: t, type: o = "default", disabled: e = !1 }) => {
3
- const a = "px-4 py-2 rounded-md transition-all duration-200", s = {
4
- primary: "bg-blue-500 text-white hover:bg-blue-600",
5
- default: "bg-gray-200 text-gray-800 hover:bg-gray-300",
6
- dashed: "border-dashed border-2 border-gray-300 hover:border-gray-400",
7
- link: "text-blue-500 hover:text-blue-600 hover:underline",
8
- text: "text-gray-600 hover:bg-gray-100"
9
- }, n = e ? "opacity-50 cursor-not-allowed" : "cursor-pointer";
10
- return /* @__PURE__ */ l.jsx(
11
- "button",
12
- {
13
- className: `${a} ${s[o]} ${n}`,
14
- onClick: e ? void 0 : t,
15
- disabled: e,
16
- children: r
17
- }
18
- );
19
- };
20
- export {
21
- u as Button
22
- };
23
- //# sourceMappingURL=index.es.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.es.js","sources":["../../../src/components/Button/index.tsx"],"sourcesContent":["import React from 'react';\n\nexport interface ButtonProps {\n /**\n * 按钮文本\n */\n children?: React.ReactNode;\n /**\n * 点击事件处理函数\n */\n onClick?: () => void;\n /**\n * 按钮类型\n */\n type?: 'primary' | 'default' | 'dashed' | 'link' | 'text';\n /**\n * 是否禁用\n */\n disabled?: boolean;\n}\n\nexport const Button: React.FC<ButtonProps> = ({ children, onClick, type = 'default', disabled = false }) => {\n const baseStyles = 'px-4 py-2 rounded-md transition-all duration-200';\n const typeStyles = {\n primary: 'bg-blue-500 text-white hover:bg-blue-600',\n default: 'bg-gray-200 text-gray-800 hover:bg-gray-300',\n dashed: 'border-dashed border-2 border-gray-300 hover:border-gray-400',\n link: 'text-blue-500 hover:text-blue-600 hover:underline',\n text: 'text-gray-600 hover:bg-gray-100',\n };\n\n const disabledStyles = disabled ? 'opacity-50 cursor-not-allowed' : 'cursor-pointer';\n\n return (\n <button\n className={`${baseStyles} ${typeStyles[type]} ${disabledStyles}`}\n onClick={disabled ? undefined : onClick}\n disabled={disabled}\n >\n {children}\n </button>\n );\n};\n"],"names":["Button","children","onClick","type","disabled","baseStyles","typeStyles","disabledStyles","jsx"],"mappings":";AAqBa,MAAAA,IAAgC,CAAC,EAAE,UAAAC,GAAU,SAAAC,GAAS,MAAAC,IAAO,WAAW,UAAAC,IAAW,SAAY;AAC1G,QAAMC,IAAa,oDACbC,IAAa;AAAA,IACjB,SAAS;AAAA,IACT,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,MAAM;AAAA,EACR,GAEMC,IAAiBH,IAAW,kCAAkC;AAGlE,SAAAI,gBAAAA,EAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW,GAAGH,CAAU,IAAIC,EAAWH,CAAI,CAAC,IAAII,CAAc;AAAA,MAC9D,SAASH,IAAW,SAAYF;AAAA,MAChC,UAAAE;AAAA,MAEC,UAAAH;AAAA,IAAA;AAAA,EACH;AAEJ;"}