@pstdio/ui 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.
package/package.json CHANGED
@@ -1,22 +1,26 @@
1
1
  {
2
2
  "name": "@pstdio/ui",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
7
  "type": "module",
8
8
  "exports": {
9
9
  ".": {
10
- "import": "./src/index.ts",
11
- "types": "./src/index.ts"
10
+ "import": "./dist/index.js",
11
+ "types": "./dist/index.d.ts"
12
12
  },
13
13
  "./rich-text": {
14
- "import": "./src/components/rich-text/index.ts",
15
- "types": "./src/components/rich-text/index.ts"
14
+ "import": "./dist/rich-text.js",
15
+ "types": "./dist/components/rich-text/index.d.ts"
16
16
  },
17
17
  "./theme": {
18
- "import": "./src/theme/index.ts",
19
- "types": "./src/theme/index.ts"
18
+ "import": "./dist/theme.js",
19
+ "types": "./dist/theme/index.d.ts"
20
+ },
21
+ "./chat-ui": {
22
+ "import": "./dist/chat-ui.js",
23
+ "types": "./dist/components/chat-ui/index.d.ts"
20
24
  }
21
25
  },
22
26
  "scripts": {
@@ -27,7 +31,8 @@
27
31
  "test": "echo 'no tests — use storybook for UI'",
28
32
  "test-storybook": "vitest --project=storybook",
29
33
  "storybook": "storybook dev -p 6006",
30
- "build-storybook": "storybook build"
34
+ "build-storybook": "storybook build",
35
+ "prepublishOnly": "bun run build"
31
36
  },
32
37
  "peerDependencies": {
33
38
  "@chakra-ui/react": "^3.0.0",
@@ -1,6 +1,6 @@
1
1
  import { Box, Flex, HStack, Spacer, Text } from "@chakra-ui/react";
2
2
  import { type ReactNode, useEffect, useRef, useState } from "react";
3
- import { getTextFromSerializedEditorState, PromptEditor } from "@/components/rich-text";
3
+ import { getTextFromSerializedEditorState, PromptEditor } from "../../rich-text";
4
4
  import { SendButton } from "./send-button";
5
5
 
6
6
  interface ChatInputProps {
@@ -0,0 +1,15 @@
1
+ export { ChatMessage } from "./components/ai-message";
2
+ export type { MessageRootProps, MessageContentProps } from "./components/ai-message";
3
+
4
+ export { ChatPrimitives } from "./components/ai-conversation";
5
+ export type { ConversationRootProps, ConversationContentProps, ConversationScrollButtonProps } from "./components/ai-conversation";
6
+
7
+ export { AutoScroll } from "./components/auto-scroll";
8
+ export type { AutoScrollProps } from "./components/auto-scroll";
9
+
10
+ export { ChatInput } from "./components/chat-input";
11
+
12
+ export { SendButton } from "./components/send-button";
13
+ export type { SendButtonProps } from "./components/send-button";
14
+
15
+ export { createSerializedPromptState } from "./utils/editor-state";
@@ -1,4 +1,4 @@
1
- import { generateEditorStateFromString } from "@/components/rich-text";
1
+ import { generateEditorStateFromString } from "../../rich-text";
2
2
 
3
3
  export const createSerializedPromptState = (input = "") => {
4
4
  return JSON.stringify(generateEditorStateFromString(input));
package/vite.config.ts CHANGED
@@ -21,9 +21,12 @@ export default defineConfig({
21
21
  },
22
22
  build: {
23
23
  lib: {
24
- entry: path.resolve(__dirname, "src/index.ts"),
25
- name: "ui",
26
- fileName: () => `index.js`,
24
+ entry: {
25
+ index: path.resolve(__dirname, "src/index.ts"),
26
+ "rich-text": path.resolve(__dirname, "src/components/rich-text/index.ts"),
27
+ theme: path.resolve(__dirname, "src/theme/index.ts"),
28
+ "chat-ui": path.resolve(__dirname, "src/components/chat-ui/index.ts"),
29
+ },
27
30
  formats: ["es"],
28
31
  cssFileName: "style",
29
32
  },