@infinilabs/doc-detail 0.0.2 → 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.
@@ -85926,7 +85926,14 @@ const G2t = (n) => {
85926
85926
  }
85927
85927
  );
85928
85928
  }, { Text: V3 } = lJ, GPt = (n) => {
85929
- const { data: t, i18n: e, extraButtons: r, className: i, ...a } = n, [o, s] = Ic(!1), l = [
85929
+ const {
85930
+ data: t,
85931
+ i18n: e,
85932
+ extraButtons: r,
85933
+ className: i,
85934
+ openSourceButtonProps: a,
85935
+ ...o
85936
+ } = n, [s, l] = Ic(!1), u = [
85930
85937
  {
85931
85938
  label: e?.labels?.type ?? "Type",
85932
85939
  value: t?.type
@@ -85952,7 +85959,7 @@ const G2t = (n) => {
85952
85959
  "div",
85953
85960
  {
85954
85961
  className: LPt("flex flex-col h-full overflow-hidden", i),
85955
- ...a,
85962
+ ...o,
85956
85963
  children: [
85957
85964
  /* @__PURE__ */ co("div", { children: [
85958
85965
  /* @__PURE__ */ ae("img", { src: t?.icon, className: "size-6 mr-3 float-left" }),
@@ -85977,7 +85984,7 @@ const G2t = (n) => {
85977
85984
  {
85978
85985
  className: "pl-2 min-w-3 size-3 hover:text-primary transition cursor-pointer",
85979
85986
  onClick: () => {
85980
- s((u) => !u);
85987
+ l((c) => !c);
85981
85988
  }
85982
85989
  }
85983
85990
  )
@@ -85993,6 +86000,7 @@ const G2t = (n) => {
85993
86000
  onClick: () => {
85994
86001
  window.open(t.url);
85995
86002
  },
86003
+ ...a,
85996
86004
  children: e?.buttons?.openSource ?? "Open Source"
85997
86005
  }
85998
86006
  )
@@ -86004,22 +86012,22 @@ const G2t = (n) => {
86004
86012
  className: "bg-black/3 dark:bg-white/4 rounded-lg overflow-hidden",
86005
86013
  initial: !1,
86006
86014
  animate: {
86007
- height: o ? "auto" : 0,
86008
- opacity: o ? 1 : 0,
86009
- marginBottom: o ? "1rem" : 0
86015
+ height: s ? "auto" : 0,
86016
+ opacity: s ? 1 : 0,
86017
+ marginBottom: s ? "1rem" : 0
86010
86018
  },
86011
- children: /* @__PURE__ */ ae("div", { className: "flex flex-wrap gap-row-2 p-4", children: l.map((u) => {
86012
- const { label: c, value: h } = u;
86019
+ children: /* @__PURE__ */ ae("div", { className: "flex flex-wrap gap-row-2 p-4", children: u.map((c) => {
86020
+ const { label: h, value: f } = c;
86013
86021
  return /* @__PURE__ */ co(
86014
86022
  "div",
86015
86023
  {
86016
86024
  className: "w-1/2 inline-flex items-center <sm:w-full",
86017
86025
  children: [
86018
- /* @__PURE__ */ ae(V3, { type: "secondary", className: "w-24", children: c }),
86019
- /* @__PURE__ */ ae("span", { className: "text-3.5", children: h ?? "-" })
86026
+ /* @__PURE__ */ ae(V3, { type: "secondary", className: "w-24", children: h }),
86027
+ /* @__PURE__ */ ae("span", { className: "text-3.5", children: f ?? "-" })
86020
86028
  ]
86021
86029
  },
86022
- c
86030
+ h
86023
86031
  );
86024
86032
  }) })
86025
86033
  }
package/dist/index.d.ts CHANGED
@@ -67,6 +67,7 @@ declare interface DocDetailProps extends HTMLAttributes<HTMLDivElement> {
67
67
  };
68
68
  };
69
69
  extraButtons?: ReactNode[];
70
+ openSourceButtonProps?: ActionButtonProps;
70
71
  }
71
72
 
72
73
  declare type MetadataContentType = "image" | "video" | "markdown" | "pdf" | "docx" | "pptx" | "xlsx";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@infinilabs/doc-detail",
3
3
  "private": false,
4
- "version": "0.0.2",
4
+ "version": "0.0.3",
5
5
  "type": "module",
6
6
  "main": "dist/doc-detail.cjs",
7
7
  "module": "dist/doc-detail.js",
@@ -12,7 +12,7 @@ import { useState, type FC, type HTMLAttributes, type ReactNode } from "react";
12
12
  import Preview from "./components/Preview";
13
13
  import AIInterpretation from "./components/AIInterpretation";
14
14
  import { cn } from "@/utils/cn";
15
- import ActionButton from "../ActionButton";
15
+ import ActionButton, { type ActionButtonProps } from "../ActionButton";
16
16
 
17
17
  const { Text } = Typography;
18
18
 
@@ -83,10 +83,18 @@ export interface DocDetailProps extends HTMLAttributes<HTMLDivElement> {
83
83
  };
84
84
  };
85
85
  extraButtons?: ReactNode[];
86
+ openSourceButtonProps?: ActionButtonProps;
86
87
  }
87
88
 
88
89
  const DocDetail: FC<DocDetailProps> = (props) => {
89
- const { data, i18n, extraButtons, className, ...rest } = props;
90
+ const {
91
+ data,
92
+ i18n,
93
+ extraButtons,
94
+ className,
95
+ openSourceButtonProps,
96
+ ...rest
97
+ } = props;
90
98
 
91
99
  const [visibleMore, setVisibleMore] = useState(false);
92
100
 
@@ -153,6 +161,7 @@ const DocDetail: FC<DocDetailProps> = (props) => {
153
161
  onClick={() => {
154
162
  window.open(data.url);
155
163
  }}
164
+ {...openSourceButtonProps}
156
165
  >
157
166
  {i18n?.buttons?.openSource ?? "Open Source"}
158
167
  </ActionButton>