@infinilabs/doc-detail 0.0.4 → 0.0.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/index.d.ts CHANGED
@@ -57,13 +57,13 @@ declare interface DocDetailProps extends HTMLAttributes<HTMLDivElement> {
57
57
  openSource?: string;
58
58
  };
59
59
  labels?: {
60
- preview?: string;
61
- aiInterpretation?: string;
62
- createdBy?: string;
63
- updatedAt?: string;
64
- updatedBy?: string;
65
60
  type?: string;
66
61
  size?: string;
62
+ createdBy?: string;
63
+ createdAt?: string;
64
+ updatedAt?: string;
65
+ preview?: string;
66
+ aiInterpretation?: string;
67
67
  };
68
68
  };
69
69
  extraButtons?: ReactNode[];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@infinilabs/doc-detail",
3
3
  "private": false,
4
- "version": "0.0.4",
4
+ "version": "0.0.6",
5
5
  "type": "module",
6
6
  "main": "dist/doc-detail.cjs",
7
7
  "module": "dist/doc-detail.js",
@@ -22,6 +22,7 @@
22
22
  "preview": "vite preview"
23
23
  },
24
24
  "dependencies": {
25
+ "@ant-design/x": "^2.1.3",
25
26
  "@ant-design/x-markdown": "^2.1.3",
26
27
  "antd": "^6.0.0",
27
28
  "clsx": "^2.1.1",
package/src/App.tsx CHANGED
@@ -17,7 +17,72 @@ const App = () => {
17
17
  url: "http://192.168.3.181:9101/coco-server/test.pdf",
18
18
  metadata: {
19
19
  content_type: "pdf",
20
- ai_insights: `# AI Interpretation\n### Welcome to XMarkdown!\n- Project 1 \n- Project 2\n- Project 3`,
20
+ ai_insights: `
21
+ # Document Analysis: "106862408.jpg"
22
+
23
+ ## Overview
24
+ This document is a detailed textual description of a corporate event photograph titled \`106862408.jpg.\` The analysis describes an indoor professional setting during INFINI.com's 2023 All Hands Meeting, capturing the environment, participants, and cultural elements.
25
+
26
+ ## Key Insights & Themes
27
+
28
+ ### 1. **Event Context & Purpose**
29
+ The image documents a formal company-wide gathering ("All Hands Meeting") for an organization named INFINI. The timing is significant—2023, the Year of the Rabbit—as reflected in the celebratory banner. The meeting appears to be a collaborative or informational session, likely for strategic planning or a new year kickoff, emphasizing organizational unity and forward momentum.
30
+
31
+ ### 2. **Professional Environment & Atmosphere**
32
+ The setting is a modern, well-lit conference room designed for corporate functions. The structured seating, professional lighting, and presence of technology (laptops, a projector) indicate a prepared, business-focused environment. However, the casual postures of participants and personal belongings suggest a balanced atmosphere that is formal yet not overly rigid, promoting focused engagement.
33
+
34
+ ### 3. **Cultural and Symbolic Elements**
35
+ A bilingual banner (English and Chinese) serves as a central visual motif. The Chinese phrase “兔飞猛进” (Rabbits leaping forward rapidly) is a culturally specific metaphor tied to the lunar year, symbolizing rapid progress and advancement. This highlights the organization's possible multicultural nature or global outlook, blending corporate identity with traditional symbolism.
36
+
37
+ ### 4. **Visual Composition and Details**
38
+ The description notes a cohesive color palette (dominant blues, neutral tones, wood accents) and a clean, organized composition. The image perspective provides depth, drawing attention from the uniformly dressed participants toward the symbolic banner. Details like abstract artwork, branded attire, and patterned carpeting contribute to a narrative of a thoughtfully designed corporate space.
39
+
40
+ ### 5. **Human Element and Team Identity**
41
+ Approximately ten individuals, mostly men with one woman visible, are depicted wearing uniform blue jackets with logos, signaling team or organizational belonging. Their engagement with laptops, notebooks, and personal items suggests active participation. The arrangement fosters a sense of collective purpose, underscoring themes of teamwork and shared enterprise.
42
+
43
+ ## Relationships and Synthesis
44
+ The document intertwines physical setting, human activity, and symbolic communication to portray a snapshot of corporate culture. The environment supports the event's purpose, the participants' uniformity reflects organizational cohesion, and the banner bridges corporate messaging with cultural tradition. Together, these elements construct a narrative of a modern, globally-aware company marking a moment of collective planning and aspirational growth.
45
+
46
+
47
+ \`\`\`ts
48
+ const analysisSummary = {
49
+ eventContext: "INFINI.com All Hands Meeting in 2023, Year of the Rabbit",
50
+ environment: "Modern conference room with professional yet relaxed atmosphere",
51
+ culturalElements: "Bilingual banner with metaphor for rapid advancement",
52
+ visualDetails: "Cohesive color palette, organized composition, branded attire",
53
+ humanElement: "Team identity through uniform clothing and active engagement",
54
+ };
55
+ \`\`\`
56
+
57
+ \`\`\`mermaid
58
+ mindmap
59
+ root("Document Analysis: 106862408.jpg")
60
+ Event Context & Purpose
61
+ INFINI.com All Hands Meeting
62
+ 2023 – Year of the Rabbit
63
+ Corporate gathering for strategy/kickoff
64
+ Theme of progress and unity
65
+ Professional Environment & Atmosphere
66
+ Modern conference room
67
+ Structured seating with technology
68
+ Balanced formal yet relaxed tone
69
+ Professional lighting & layout
70
+ Cultural & Symbolic Elements
71
+ Bilingual banner (English/Chinese)
72
+ “兔飞猛进” – Rabbits leaping forward
73
+ Metaphor for rapid advancement
74
+ Blends corporate and traditional motifs
75
+ Visual Composition & Details
76
+ Dominant color palette: blues, neutrals, wood
77
+ Organized perspective with depth
78
+ Details: artwork, branded attire, carpet pattern
79
+ Even, professional lighting
80
+ Human Element & Team Identity
81
+ ~10 participants in uniform attire
82
+ Active engagement with tools
83
+ Sense of collective purpose
84
+ Represents organizational cohesion
85
+ \`\`\``,
21
86
  },
22
87
  owner: {
23
88
  title: "Alice Johnson",
@@ -1,12 +1,38 @@
1
- import { XMarkdown, type XMarkdownProps } from "@ant-design/x-markdown";
1
+ import {
2
+ XMarkdown,
3
+ type ComponentProps,
4
+ type XMarkdownProps,
5
+ } from "@ant-design/x-markdown";
2
6
  import { useEffect, useState, type FC } from "react";
7
+ import { Mermaid, CodeHighlighter } from "@ant-design/x";
8
+ import { Typography } from "antd";
9
+ import clsx from "clsx";
10
+
11
+ const { Text } = Typography;
12
+
13
+ const Code: FC<ComponentProps> = (props) => {
14
+ const { className, children } = props;
15
+ const lang = className?.match(/language-(\w+)/)?.[1] ?? "";
16
+
17
+ if (typeof children !== "string") return null;
18
+
19
+ if (lang === "mermaid") {
20
+ return <Mermaid>{children}</Mermaid>;
21
+ }
22
+
23
+ if (lang) {
24
+ return <CodeHighlighter lang={lang}>{children}</CodeHighlighter>;
25
+ }
26
+
27
+ return <Text code>{children}</Text>;
28
+ };
3
29
 
4
30
  interface MarkdownProps extends XMarkdownProps {
5
31
  url?: string;
6
32
  }
7
33
 
8
34
  const Markdown: FC<MarkdownProps> = (props) => {
9
- const { url, ...rest } = props;
35
+ const { url, className, ...rest } = props;
10
36
 
11
37
  const [content, setContent] = useState(rest.content);
12
38
 
@@ -24,7 +50,14 @@ const Markdown: FC<MarkdownProps> = (props) => {
24
50
  fetchContent(url);
25
51
  }, [url]);
26
52
 
27
- return <XMarkdown {...rest} content={content} />;
53
+ return (
54
+ <XMarkdown
55
+ {...rest}
56
+ className={clsx("[&_h1,h2,h3,h4,h5,h6,ul,ol,p]:[all:revert]", className)}
57
+ content={content}
58
+ components={{ code: Code }}
59
+ />
60
+ );
28
61
  };
29
62
 
30
63
  export default Markdown;
@@ -73,13 +73,13 @@ export interface DocDetailProps extends HTMLAttributes<HTMLDivElement> {
73
73
  openSource?: string;
74
74
  };
75
75
  labels?: {
76
- preview?: string;
77
- aiInterpretation?: string;
78
- createdBy?: string;
79
- updatedAt?: string;
80
- updatedBy?: string;
81
76
  type?: string;
82
77
  size?: string;
78
+ createdBy?: string;
79
+ createdAt?: string;
80
+ updatedAt?: string;
81
+ preview?: string;
82
+ aiInterpretation?: string;
83
83
  };
84
84
  };
85
85
  extraButtons?: ReactNode[];
@@ -107,14 +107,14 @@ const DocDetail: FC<DocDetailProps> = (props) => {
107
107
  label: i18n?.labels?.size ?? "Size",
108
108
  value: data?.size,
109
109
  },
110
- {
111
- label: i18n?.labels?.createdBy ?? "Created At",
112
- value: data?.created,
113
- },
114
110
  {
115
111
  label: i18n?.labels?.createdBy ?? "Created By",
116
112
  value: data?.owner?.title,
117
113
  },
114
+ {
115
+ label: i18n?.labels?.createdAt ?? "Created At",
116
+ value: data?.created,
117
+ },
118
118
  {
119
119
  label: i18n?.labels?.updatedAt ?? "Updated At",
120
120
  value: data?.updated,
package/vite.config.ts CHANGED
@@ -36,6 +36,7 @@ export default defineConfig({
36
36
  "lucide-react",
37
37
  ],
38
38
  output: {
39
+ inlineDynamicImports: true,
39
40
  globals: {
40
41
  react: "React",
41
42
  "react-dom": "ReactDOM",