doccupine 0.0.39 → 0.0.40

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.
@@ -1 +1 @@
1
- export declare const docsNavigationTemplate = "\"use client\";\nimport { useContext } from \"react\";\nimport { usePathname } from \"next/navigation\";\nimport Link from \"next/link\";\nimport styled, { css } from \"styled-components\";\nimport { Icon } from \"@/components/layout/Icon\";\nimport { mq, Theme } from \"@/app/theme\";\nimport { interactiveStyles } from \"@/components/layout/SharedStyled\";\nimport { ChatContext } from \"@/components/Chat\";\nconst StyledNavigationWrapper = styled.div<{\n $isChatOpen?: boolean;\n}>`\n transition: all 0.3s ease;\n padding: 0 20px 100px 20px;\n ${mq(\"lg\")} {\n padding: 0 340px 80px 340px;\n ${({ $isChatOpen }) =>\n $isChatOpen &&\n css`\n padding: 0 440px 80px 340px;\n `}\n }\n`;\nconst StyledNavigationInner = styled.div`\n display: flex;\n justify-content: space-between;\n align-items: center;\n gap: 20px;\n max-width: 640px;\n margin: auto;\n`;\nconst StyledNavButton = styled(Link)<{ theme: Theme }>`\n ${interactiveStyles};\n display: flex;\n flex-direction: column;\n text-decoration: none;\n padding: 20px;\n flex: 50%;\n max-width: 50%;\n border-radius: ${({ theme }) => theme.spacing.radius.lg};\n border: solid 1px ${({ theme }) => theme.colors.grayLight};\n color: ${({ theme }) => theme.colors.dark};\n &:hover {\n border-color: ${({ theme }) => theme.colors.primary};\n }\n &[data-direction=\"prev\"] {\n align-items: flex-start;\n }\n &[data-direction=\"next\"] {\n align-items: flex-end;\n margin-left: auto;\n text-align: right;\n }\n`;\nconst StyledNavLabel = styled.span<{ theme: Theme }>`\n color: ${({ theme }) => theme.colors.gray};\n display: flex;\n flex-direction: row;\n gap: 4px;\n & svg {\n margin: auto 0;\n }\n`;\nconst StyledNavTitle = styled.span<{ theme: Theme }>`\n color: ${({ theme }) => theme.colors.dark};\n font-weight: 600;\n margin: 0 0 4px 0;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n`;\nconst StyledSpacer = styled.div`\n flex: 1;\n`;\ninterface Page {\n slug: string;\n title: string;\n category?: string;\n [key: string]: any;\n}\ninterface NavigationItem {\n category?: string;\n slug?: string;\n title?: string;\n links?: Page[];\n items?: Page[];\n [key: string]: any;\n}\ninterface DocsNavigationProps {\n result: NavigationItem[];\n}\nfunction DocsNavigation({ result }: DocsNavigationProps) {\n const { isOpen } = useContext(ChatContext);\n const pathname = usePathname();\n const allPages: Page[] = result.flatMap((item) => {\n if (item.links && Array.isArray(item.links)) {\n return item.links;\n }\n if (item.items && Array.isArray(item.items)) {\n return item.items;\n }\n if (item.slug !== undefined) {\n return [item as Page];\n }\n return [];\n });\n const currentSlug = pathname.replace(/^\\//, \"\").replace(/\\/$/, \"\");\n const currentIndex = allPages.findIndex((page) => page.slug === currentSlug);\n const prevPage = currentIndex > 0 ? allPages[currentIndex - 1] : null;\n const nextPage =\n currentIndex < allPages.length - 1 ? allPages[currentIndex + 1] : null;\n if (currentIndex === -1 || allPages.length === 0) {\n return null;\n }\n if (!prevPage && !nextPage) {\n return null;\n }\n return (\n <StyledNavigationWrapper $isChatOpen={isOpen}>\n <StyledNavigationInner>\n {prevPage ? (\n <StyledNavButton href={`/${prevPage.slug}`} data-direction=\"prev\">\n <StyledNavTitle>{prevPage.title}</StyledNavTitle>\n <StyledNavLabel>\n <Icon name=\"arrow-left\" size={16} /> Previous\n </StyledNavLabel>\n </StyledNavButton>\n ) : (\n <StyledSpacer />\n )}\n {nextPage && (\n <StyledNavButton href={`/${nextPage.slug}`} data-direction=\"next\">\n <StyledNavTitle>{nextPage.title}</StyledNavTitle>\n <StyledNavLabel>\n Next <Icon name=\"arrow-right\" size={16} />\n </StyledNavLabel>\n </StyledNavButton>\n )}\n </StyledNavigationInner>\n </StyledNavigationWrapper>\n );\n}\nexport { DocsNavigation };\n";
1
+ export declare const docsNavigationTemplate = "\"use client\";\nimport { useContext } from \"react\";\nimport { usePathname } from \"next/navigation\";\nimport Link from \"next/link\";\nimport styled, { css } from \"styled-components\";\nimport { Icon } from \"@/components/layout/Icon\";\nimport { mq, Theme } from \"@/app/theme\";\nimport { interactiveStyles } from \"@/components/layout/SharedStyled\";\nimport { ChatContext } from \"@/components/Chat\";\n\nconst StyledNavigationWrapper = styled.div<{\n $isChatOpen?: boolean;\n}>`\n transition: all 0.3s ease;\n padding: 0 20px 100px 20px;\n ${mq(\"lg\")} {\n padding: 0 340px 80px 340px;\n ${({ $isChatOpen }) =>\n $isChatOpen &&\n css`\n padding: 0 440px 80px 340px;\n `}\n }\n`;\n\nconst StyledNavigationInner = styled.div`\n display: flex;\n justify-content: space-between;\n align-items: center;\n gap: 20px;\n max-width: 640px;\n margin: auto;\n`;\n\nconst StyledNavButton = styled(Link)<{ theme: Theme }>`\n ${interactiveStyles};\n display: flex;\n flex-direction: column;\n text-decoration: none;\n padding: 20px;\n flex: 50%;\n max-width: 50%;\n border-radius: ${({ theme }) => theme.spacing.radius.lg};\n border: solid 1px ${({ theme }) => theme.colors.grayLight};\n color: ${({ theme }) => theme.colors.dark};\n \n &:hover {\n border-color: ${({ theme }) => theme.colors.primary};\n }\n\n &[data-direction=\"prev\"] {\n align-items: flex-start;\n }\n\n &[data-direction=\"next\"] {\n align-items: flex-end;\n margin-left: auto;\n text-align: right;\n }\n`;\n\nconst StyledNavLabel = styled.span<{ theme: Theme }>`\n color: ${({ theme }) => theme.colors.gray};\n display: flex;\n flex-direction: row;\n gap: 4px;\n\n & svg {\n margin: auto 0;\n }\n`;\n\nconst StyledNavTitle = styled.span<{ theme: Theme }>`\n color: ${({ theme }) => theme.colors.dark};\n font-weight: 600;\n margin: 0 0 4px 0;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n max-width: 100%;\n`;\n\nconst StyledSpacer = styled.div`\n flex: 1;\n`;\n\ninterface Page {\n slug: string;\n title: string;\n category?: string;\n [key: string]: any;\n}\n\ninterface NavigationItem {\n category?: string;\n slug?: string;\n title?: string;\n links?: Page[];\n items?: Page[];\n [key: string]: any;\n}\n\ninterface DocsNavigationProps {\n result: NavigationItem[];\n}\n\nfunction DocsNavigation({ result }: DocsNavigationProps) {\n const { isOpen } = useContext(ChatContext);\n const pathname = usePathname();\n const allPages: Page[] = result.flatMap((item) => {\n if (item.links && Array.isArray(item.links)) {\n return item.links;\n }\n if (item.items && Array.isArray(item.items)) {\n return item.items;\n }\n if (item.slug !== undefined) {\n return [item as Page];\n }\n return [];\n });\n const currentSlug = pathname.replace(/^\\//, \"\").replace(/\\/$/, \"\");\n const currentIndex = allPages.findIndex((page) => page.slug === currentSlug);\n const prevPage = currentIndex > 0 ? allPages[currentIndex - 1] : null;\n const nextPage =\n currentIndex < allPages.length - 1 ? allPages[currentIndex + 1] : null;\n if (currentIndex === -1 || allPages.length === 0) {\n return null;\n }\n if (!prevPage && !nextPage) {\n return null;\n }\n return (\n <StyledNavigationWrapper $isChatOpen={isOpen}>\n <StyledNavigationInner>\n {prevPage ? (\n <StyledNavButton href={`/${prevPage.slug}`} data-direction=\"prev\">\n <StyledNavTitle>{prevPage.title}</StyledNavTitle>\n <StyledNavLabel>\n <Icon name=\"arrow-left\" size={16} /> Previous\n </StyledNavLabel>\n </StyledNavButton>\n ) : (\n <StyledSpacer />\n )}\n {nextPage && (\n <StyledNavButton href={`/${nextPage.slug}`} data-direction=\"next\">\n <StyledNavTitle>{nextPage.title}</StyledNavTitle>\n <StyledNavLabel>\n Next <Icon name=\"arrow-right\" size={16} />\n </StyledNavLabel>\n </StyledNavButton>\n )}\n </StyledNavigationInner>\n </StyledNavigationWrapper>\n );\n}\n\nexport { DocsNavigation };\n";
@@ -7,6 +7,7 @@ import { Icon } from "@/components/layout/Icon";
7
7
  import { mq, Theme } from "@/app/theme";
8
8
  import { interactiveStyles } from "@/components/layout/SharedStyled";
9
9
  import { ChatContext } from "@/components/Chat";
10
+
10
11
  const StyledNavigationWrapper = styled.div<{
11
12
  $isChatOpen?: boolean;
12
13
  }>\`
@@ -21,6 +22,7 @@ const StyledNavigationWrapper = styled.div<{
21
22
  \`}
22
23
  }
23
24
  \`;
25
+
24
26
  const StyledNavigationInner = styled.div\`
25
27
  display: flex;
26
28
  justify-content: space-between;
@@ -29,6 +31,7 @@ const StyledNavigationInner = styled.div\`
29
31
  max-width: 640px;
30
32
  margin: auto;
31
33
  \`;
34
+
32
35
  const StyledNavButton = styled(Link)<{ theme: Theme }>\`
33
36
  \${interactiveStyles};
34
37
  display: flex;
@@ -40,27 +43,33 @@ const StyledNavButton = styled(Link)<{ theme: Theme }>\`
40
43
  border-radius: \${({ theme }) => theme.spacing.radius.lg};
41
44
  border: solid 1px \${({ theme }) => theme.colors.grayLight};
42
45
  color: \${({ theme }) => theme.colors.dark};
46
+
43
47
  &:hover {
44
48
  border-color: \${({ theme }) => theme.colors.primary};
45
49
  }
50
+
46
51
  &[data-direction="prev"] {
47
52
  align-items: flex-start;
48
53
  }
54
+
49
55
  &[data-direction="next"] {
50
56
  align-items: flex-end;
51
57
  margin-left: auto;
52
58
  text-align: right;
53
59
  }
54
60
  \`;
61
+
55
62
  const StyledNavLabel = styled.span<{ theme: Theme }>\`
56
63
  color: \${({ theme }) => theme.colors.gray};
57
64
  display: flex;
58
65
  flex-direction: row;
59
66
  gap: 4px;
67
+
60
68
  & svg {
61
69
  margin: auto 0;
62
70
  }
63
71
  \`;
72
+
64
73
  const StyledNavTitle = styled.span<{ theme: Theme }>\`
65
74
  color: \${({ theme }) => theme.colors.dark};
66
75
  font-weight: 600;
@@ -68,16 +77,20 @@ const StyledNavTitle = styled.span<{ theme: Theme }>\`
68
77
  white-space: nowrap;
69
78
  text-overflow: ellipsis;
70
79
  overflow: hidden;
80
+ max-width: 100%;
71
81
  \`;
82
+
72
83
  const StyledSpacer = styled.div\`
73
84
  flex: 1;
74
85
  \`;
86
+
75
87
  interface Page {
76
88
  slug: string;
77
89
  title: string;
78
90
  category?: string;
79
91
  [key: string]: any;
80
92
  }
93
+
81
94
  interface NavigationItem {
82
95
  category?: string;
83
96
  slug?: string;
@@ -86,9 +99,11 @@ interface NavigationItem {
86
99
  items?: Page[];
87
100
  [key: string]: any;
88
101
  }
102
+
89
103
  interface DocsNavigationProps {
90
104
  result: NavigationItem[];
91
105
  }
106
+
92
107
  function DocsNavigation({ result }: DocsNavigationProps) {
93
108
  const { isOpen } = useContext(ChatContext);
94
109
  const pathname = usePathname();
@@ -140,5 +155,6 @@ function DocsNavigation({ result }: DocsNavigationProps) {
140
155
  </StyledNavigationWrapper>
141
156
  );
142
157
  }
158
+
143
159
  export { DocsNavigation };
144
160
  `;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "doccupine",
3
- "version": "0.0.39",
3
+ "version": "0.0.40",
4
4
  "description": "Document management system that allows you to store, organize, and share your documentation with ease. AI-ready.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {