@pstdio/ui 0.2.0 → 0.2.1
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/chat-ui.js +552 -544
- package/dist/chat-ui.js.map +1 -1
- package/dist/components/chat-ui/components/chat-panel.d.ts +2 -0
- package/dist/components/sidebar-next/sidebar-next-header.d.ts +1 -1
- package/dist/components/sidebar-next/sidebar-next.types.d.ts +1 -0
- package/dist/empty-state-kQR0gd4j.js +232 -0
- package/dist/empty-state-kQR0gd4j.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +759 -756
- package/dist/index.js.map +1 -1
- package/dist/rich-text.js +88 -87
- package/dist/rich-text.js.map +1 -1
- package/package.json +1 -1
- package/dist/empty-state-B8mbv7ZH.js +0 -128
- package/dist/empty-state-B8mbv7ZH.js.map +0 -1
|
@@ -6,7 +6,9 @@ interface ChatPanelProps {
|
|
|
6
6
|
emptyStateTitle: string;
|
|
7
7
|
emptyStateDescription: string;
|
|
8
8
|
chatInputPlaceholder: string;
|
|
9
|
+
chatInputDefaultValue?: string;
|
|
9
10
|
onSubmitMessage?: (text: string, attachments: string[]) => void;
|
|
11
|
+
onChatInputChange?: (text: string) => void;
|
|
10
12
|
actions?: ReactNode;
|
|
11
13
|
repoMenu?: ReactNode;
|
|
12
14
|
attachedResources?: string[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
interface SidebarNextHeaderProps {
|
|
3
3
|
children?: ReactNode;
|
|
4
|
-
onClose
|
|
4
|
+
onClose?: () => void;
|
|
5
5
|
}
|
|
6
6
|
export declare const SidebarNextHeader: (props: SidebarNextHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export {};
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import { jsx as p, jsxs as L } from "react/jsx-runtime";
|
|
2
|
+
import { c as w } from "react/compiler-runtime";
|
|
3
|
+
import { Span as k, EmptyState as x, VStack as $ } from "@chakra-ui/react";
|
|
4
|
+
import { Editor as M, DiffEditor as z } from "@monaco-editor/react";
|
|
5
|
+
import * as T from "react";
|
|
6
|
+
const _ = {
|
|
7
|
+
base: "vs-dark",
|
|
8
|
+
inherit: !0,
|
|
9
|
+
rules: [],
|
|
10
|
+
colors: {
|
|
11
|
+
"editor.background": "#0a0d15",
|
|
12
|
+
"editor.foreground": "#f5f5f5",
|
|
13
|
+
"editor.lineHighlightBackground": "#22252C",
|
|
14
|
+
"editorCursor.foreground": "#A7A7A7",
|
|
15
|
+
"editorWhitespace.foreground": "#3B3B3B",
|
|
16
|
+
"editorIndentGuide.background": "#404040",
|
|
17
|
+
"editorIndentGuide.activeBackground": "#707070"
|
|
18
|
+
}
|
|
19
|
+
}, F = (a) => {
|
|
20
|
+
const e = w(15), {
|
|
21
|
+
defaultCode: s,
|
|
22
|
+
code: t,
|
|
23
|
+
showLineNumbers: m,
|
|
24
|
+
isEditable: f,
|
|
25
|
+
language: d,
|
|
26
|
+
onChange: r,
|
|
27
|
+
disableScroll: o
|
|
28
|
+
} = a, n = d === void 0 ? "javascript" : d;
|
|
29
|
+
let i;
|
|
30
|
+
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (i = {
|
|
31
|
+
enabled: !1
|
|
32
|
+
}, e[0] = i) : i = e[0];
|
|
33
|
+
const l = !f, c = m ? "on" : "off";
|
|
34
|
+
let u;
|
|
35
|
+
e[1] !== o ? (u = o ? {
|
|
36
|
+
scrollbar: {
|
|
37
|
+
vertical: "hidden",
|
|
38
|
+
horizontal: "hidden",
|
|
39
|
+
useShadows: !1,
|
|
40
|
+
alwaysConsumeMouseWheel: !1
|
|
41
|
+
},
|
|
42
|
+
scrollBeyondLastLine: !1,
|
|
43
|
+
mouseWheelScrollSensitivity: 0,
|
|
44
|
+
overviewRulerLanes: 0
|
|
45
|
+
} : {}, e[1] = o, e[2] = u) : u = e[2];
|
|
46
|
+
let h;
|
|
47
|
+
e[3] !== l || e[4] !== c || e[5] !== u ? (h = {
|
|
48
|
+
tabSize: 2,
|
|
49
|
+
minimap: i,
|
|
50
|
+
fontSize: 12,
|
|
51
|
+
readOnly: l,
|
|
52
|
+
lineNumbers: c,
|
|
53
|
+
...u
|
|
54
|
+
}, e[3] = l, e[4] = c, e[5] = u, e[6] = h) : h = e[6];
|
|
55
|
+
const y = h;
|
|
56
|
+
let g;
|
|
57
|
+
e[7] !== r ? (g = (S) => {
|
|
58
|
+
r?.(S || "");
|
|
59
|
+
}, e[7] = r, e[8] = g) : g = e[8];
|
|
60
|
+
let b;
|
|
61
|
+
return e[9] !== t || e[10] !== s || e[11] !== n || e[12] !== y || e[13] !== g ? (b = /* @__PURE__ */ p(M, { width: "100%", height: "100%", language: n, defaultValue: s, value: t, theme: "ps-theme", options: y, onChange: g, beforeMount: R, onMount: j }), e[9] = t, e[10] = s, e[11] = n, e[12] = y, e[13] = g, e[14] = b) : b = e[14], b;
|
|
62
|
+
}, H = (a) => {
|
|
63
|
+
const e = w(11), {
|
|
64
|
+
original: s,
|
|
65
|
+
modified: t,
|
|
66
|
+
showLineNumbers: m,
|
|
67
|
+
language: f,
|
|
68
|
+
disableScroll: d
|
|
69
|
+
} = a, r = f === void 0 ? "javascript" : f;
|
|
70
|
+
let o;
|
|
71
|
+
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = {
|
|
72
|
+
enabled: !1
|
|
73
|
+
}, e[0] = o) : o = e[0];
|
|
74
|
+
const n = m ? "on" : "off";
|
|
75
|
+
let i;
|
|
76
|
+
e[1] !== d ? (i = d ? {
|
|
77
|
+
scrollbar: {
|
|
78
|
+
vertical: "hidden",
|
|
79
|
+
horizontal: "hidden",
|
|
80
|
+
useShadows: !1,
|
|
81
|
+
alwaysConsumeMouseWheel: !1
|
|
82
|
+
},
|
|
83
|
+
scrollBeyondLastLine: !1,
|
|
84
|
+
mouseWheelScrollSensitivity: 0,
|
|
85
|
+
overviewRulerLanes: 0
|
|
86
|
+
} : {}, e[1] = d, e[2] = i) : i = e[2];
|
|
87
|
+
let l;
|
|
88
|
+
e[3] !== n || e[4] !== i ? (l = {
|
|
89
|
+
tabSize: 2,
|
|
90
|
+
minimap: o,
|
|
91
|
+
fontSize: 12,
|
|
92
|
+
readOnly: !0,
|
|
93
|
+
originalEditable: !1,
|
|
94
|
+
renderSideBySide: !0,
|
|
95
|
+
useInlineViewWhenSpaceIsTooSmall: !0,
|
|
96
|
+
lineNumbers: n,
|
|
97
|
+
...i
|
|
98
|
+
}, e[3] = n, e[4] = i, e[5] = l) : l = e[5];
|
|
99
|
+
const c = l;
|
|
100
|
+
let u;
|
|
101
|
+
return e[6] !== r || e[7] !== t || e[8] !== c || e[9] !== s ? (u = /* @__PURE__ */ p(z, { width: "100%", height: "100%", language: r, original: s, modified: t, theme: "ps-theme", options: c, beforeMount: A, onMount: I }), e[6] = r, e[7] = t, e[8] = c, e[9] = s, e[10] = u) : u = e[10], u;
|
|
102
|
+
};
|
|
103
|
+
function R(a) {
|
|
104
|
+
a.editor.defineTheme("ps-theme", _);
|
|
105
|
+
}
|
|
106
|
+
async function j(a, e) {
|
|
107
|
+
e.editor.setTheme("ps-theme"), e.languages.typescript.typescriptDefaults.setCompilerOptions({
|
|
108
|
+
jsx: e.languages.typescript.JsxEmit.React
|
|
109
|
+
}), a.addCommand(e.KeyMod.CtrlCmd | e.KeyCode.KeyS, async () => {
|
|
110
|
+
await a.getAction("editor.action.formatDocument")?.run();
|
|
111
|
+
}), await a.getAction("editor.action.formatDocument")?.run();
|
|
112
|
+
}
|
|
113
|
+
function A(a) {
|
|
114
|
+
a.editor.defineTheme("ps-theme", _);
|
|
115
|
+
}
|
|
116
|
+
function I(a, e) {
|
|
117
|
+
e.editor.setTheme("ps-theme"), e.languages.typescript.typescriptDefaults.setCompilerOptions({
|
|
118
|
+
jsx: e.languages.typescript.JsxEmit.React
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
const P = (a) => {
|
|
122
|
+
const e = w(18), {
|
|
123
|
+
fileName: s,
|
|
124
|
+
additions: t,
|
|
125
|
+
deletions: m,
|
|
126
|
+
label: f,
|
|
127
|
+
variant: d,
|
|
128
|
+
size: r,
|
|
129
|
+
onClick: o,
|
|
130
|
+
onClickFileLink: n
|
|
131
|
+
} = a, i = d === void 0 ? "outline" : d, c = (r === void 0 ? "default" : r) === "small", u = i === "outline" ? "1px solid" : "none", h = i === "outline" ? c ? "3xs" : "2xs" : "2px", y = c ? "label/S/regular" : void 0, g = o ? "pointer" : "default";
|
|
132
|
+
let b;
|
|
133
|
+
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (b = {
|
|
134
|
+
background: "bg.muted"
|
|
135
|
+
}, e[0] = b) : b = e[0];
|
|
136
|
+
let S;
|
|
137
|
+
e[1] !== s || e[2] !== n ? (S = s && /* @__PURE__ */ p(k, { display: "inline-block", maxW: "24ch", truncate: !0, mr: "xs", title: s, onClick: (W) => {
|
|
138
|
+
W.stopPropagation(), n?.();
|
|
139
|
+
}, cursor: n ? "pointer" : "default", _hover: {
|
|
140
|
+
textDecoration: n ? "underline" : "none",
|
|
141
|
+
color: n ? "fg.blue-dark" : "fg.muted"
|
|
142
|
+
}, children: s }), e[1] = s, e[2] = n, e[3] = S) : S = e[3];
|
|
143
|
+
const B = `+${t}`;
|
|
144
|
+
let v;
|
|
145
|
+
e[4] !== B ? (v = /* @__PURE__ */ p(k, { color: "fg.success", children: B }), e[4] = B, e[5] = v) : v = e[5];
|
|
146
|
+
const D = `-${m}`;
|
|
147
|
+
let C;
|
|
148
|
+
e[6] !== D ? (C = /* @__PURE__ */ p(k, { color: "fg.error", children: D }), e[6] = D, e[7] = C) : C = e[7];
|
|
149
|
+
let E;
|
|
150
|
+
return e[8] !== f || e[9] !== o || e[10] !== C || e[11] !== u || e[12] !== h || e[13] !== y || e[14] !== g || e[15] !== S || e[16] !== v ? (E = /* @__PURE__ */ L(k, { display: "inline-flex", alignItems: "center", gap: "2xs", border: u, borderColor: "border.muted", color: "fg.muted", paddingX: h, paddingY: "1px", borderRadius: "xs", textStyle: y, cursor: g, onClick: o, _hover: b, children: [
|
|
151
|
+
f,
|
|
152
|
+
S,
|
|
153
|
+
v,
|
|
154
|
+
C
|
|
155
|
+
] }), e[8] = f, e[9] = o, e[10] = C, e[11] = u, e[12] = h, e[13] = y, e[14] = g, e[15] = S, e[16] = v, e[17] = E) : E = e[17], E;
|
|
156
|
+
};
|
|
157
|
+
function X(a) {
|
|
158
|
+
const e = w(11), {
|
|
159
|
+
original: s,
|
|
160
|
+
modified: t,
|
|
161
|
+
language: m,
|
|
162
|
+
sideBySide: f,
|
|
163
|
+
disableScroll: d
|
|
164
|
+
} = a, r = m === void 0 ? "plaintext" : m, o = f === void 0 ? !1 : f, n = d === void 0 ? !0 : d;
|
|
165
|
+
let i;
|
|
166
|
+
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (i = {
|
|
167
|
+
enabled: !1
|
|
168
|
+
}, e[0] = i) : i = e[0];
|
|
169
|
+
let l;
|
|
170
|
+
e[1] !== n ? (l = n ? {
|
|
171
|
+
scrollbar: {
|
|
172
|
+
vertical: "hidden",
|
|
173
|
+
horizontal: "hidden",
|
|
174
|
+
useShadows: !1,
|
|
175
|
+
alwaysConsumeMouseWheel: !1
|
|
176
|
+
},
|
|
177
|
+
overviewRulerLanes: 0
|
|
178
|
+
} : {}, e[1] = n, e[2] = l) : l = e[2];
|
|
179
|
+
let c;
|
|
180
|
+
e[3] !== o || e[4] !== l ? (c = {
|
|
181
|
+
renderSideBySide: o,
|
|
182
|
+
readOnly: !0,
|
|
183
|
+
fontSize: 11,
|
|
184
|
+
minimap: i,
|
|
185
|
+
wordWrap: "on",
|
|
186
|
+
scrollBeyondLastLine: !1,
|
|
187
|
+
...l
|
|
188
|
+
}, e[3] = o, e[4] = l, e[5] = c) : c = e[5];
|
|
189
|
+
const u = c;
|
|
190
|
+
let h;
|
|
191
|
+
return e[6] !== r || e[7] !== t || e[8] !== u || e[9] !== s ? (h = /* @__PURE__ */ p(z, { width: "100%", height: "100%", original: s, modified: t, language: r, theme: "ps-theme", options: u, beforeMount: O, onMount: N }), e[6] = r, e[7] = t, e[8] = u, e[9] = s, e[10] = h) : h = e[10], h;
|
|
192
|
+
}
|
|
193
|
+
function N(a, e) {
|
|
194
|
+
e.editor.setTheme("ps-theme");
|
|
195
|
+
}
|
|
196
|
+
function O(a) {
|
|
197
|
+
a.editor.defineTheme("ps-theme", _);
|
|
198
|
+
}
|
|
199
|
+
const Y = T.forwardRef(function(e, s) {
|
|
200
|
+
const t = w(19);
|
|
201
|
+
let m, f, d, r, o;
|
|
202
|
+
t[0] !== e ? ({
|
|
203
|
+
title: o,
|
|
204
|
+
description: f,
|
|
205
|
+
icon: d,
|
|
206
|
+
children: m,
|
|
207
|
+
...r
|
|
208
|
+
} = e, t[0] = e, t[1] = m, t[2] = f, t[3] = d, t[4] = r, t[5] = o) : (m = t[1], f = t[2], d = t[3], r = t[4], o = t[5]);
|
|
209
|
+
let n;
|
|
210
|
+
t[6] !== d ? (n = d && /* @__PURE__ */ p(x.Indicator, { children: d }), t[6] = d, t[7] = n) : n = t[7];
|
|
211
|
+
let i;
|
|
212
|
+
t[8] !== f || t[9] !== o ? (i = f ? /* @__PURE__ */ L($, { textAlign: "center", children: [
|
|
213
|
+
/* @__PURE__ */ p(x.Title, { fontWeight: "normal", children: o }),
|
|
214
|
+
/* @__PURE__ */ p(x.Description, { children: f })
|
|
215
|
+
] }) : /* @__PURE__ */ p(x.Title, { fontWeight: "normal", children: o }), t[8] = f, t[9] = o, t[10] = i) : i = t[10];
|
|
216
|
+
let l;
|
|
217
|
+
t[11] !== m || t[12] !== n || t[13] !== i ? (l = /* @__PURE__ */ L(x.Content, { children: [
|
|
218
|
+
n,
|
|
219
|
+
i,
|
|
220
|
+
m
|
|
221
|
+
] }), t[11] = m, t[12] = n, t[13] = i, t[14] = l) : l = t[14];
|
|
222
|
+
let c;
|
|
223
|
+
return t[15] !== s || t[16] !== r || t[17] !== l ? (c = /* @__PURE__ */ p(x.Root, { ref: s, ...r, children: l }), t[15] = s, t[16] = r, t[17] = l, t[18] = c) : c = t[18], c;
|
|
224
|
+
});
|
|
225
|
+
export {
|
|
226
|
+
H as C,
|
|
227
|
+
X as D,
|
|
228
|
+
Y as E,
|
|
229
|
+
P as a,
|
|
230
|
+
F as b
|
|
231
|
+
};
|
|
232
|
+
//# sourceMappingURL=empty-state-kQR0gd4j.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"empty-state-kQR0gd4j.js","sources":["../src/components/code-editor.tsx","../src/components/diff-bubble.tsx","../src/components/diff-editor.tsx","../src/components/empty-state.tsx"],"sourcesContent":["import { DiffEditor, Editor } from \"@monaco-editor/react\";\n\nexport const customTheme = {\n base: \"vs-dark\" as const,\n inherit: true,\n rules: [],\n colors: {\n \"editor.background\": \"#0a0d15\",\n \"editor.foreground\": \"#f5f5f5\",\n \"editor.lineHighlightBackground\": \"#22252C\",\n \"editorCursor.foreground\": \"#A7A7A7\",\n \"editorWhitespace.foreground\": \"#3B3B3B\",\n \"editorIndentGuide.background\": \"#404040\",\n \"editorIndentGuide.activeBackground\": \"#707070\",\n },\n};\n\ninterface CodeEditorProps {\n language: string;\n defaultCode?: string;\n code?: string;\n isEditable: boolean;\n showLineNumbers?: boolean;\n onChange?: (code: string) => void;\n disableScroll?: boolean;\n}\n\nexport const CodeEditor = (props: CodeEditorProps) => {\n const { defaultCode, code, showLineNumbers, isEditable, language = \"javascript\", onChange, disableScroll } = props;\n\n const options = {\n tabSize: 2,\n minimap: {\n enabled: false,\n },\n fontSize: 12,\n readOnly: !isEditable,\n lineNumbers: showLineNumbers ? \"on\" : \"off\",\n ...(disableScroll\n ? {\n scrollbar: {\n vertical: \"hidden\" as const,\n horizontal: \"hidden\" as const,\n useShadows: false,\n alwaysConsumeMouseWheel: false,\n },\n scrollBeyondLastLine: false,\n mouseWheelScrollSensitivity: 0,\n overviewRulerLanes: 0,\n }\n : {}),\n } as const;\n\n return (\n <Editor\n width=\"100%\"\n height=\"100%\"\n language={language}\n defaultValue={defaultCode}\n value={code}\n theme={\"ps-theme\"}\n options={options}\n onChange={(value) => {\n onChange?.(value || \"\");\n }}\n beforeMount={(monaco) => {\n monaco.editor.defineTheme(\"ps-theme\", customTheme);\n }}\n onMount={async (editor, monaco) => {\n monaco.editor.setTheme(\"ps-theme\");\n\n // Add JSX support\n monaco.languages.typescript.typescriptDefaults.setCompilerOptions({\n jsx: monaco.languages.typescript.JsxEmit.React,\n });\n\n // Format on cmd+s\n editor.addCommand(monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyS, async () => {\n await editor.getAction(\"editor.action.formatDocument\")?.run();\n });\n\n // Run format on the initial value\n await editor.getAction(\"editor.action.formatDocument\")?.run();\n }}\n />\n );\n};\n\ninterface CodeDiffEditorProps {\n language: string;\n original: string;\n modified: string;\n showLineNumbers?: boolean;\n disableScroll?: boolean;\n}\n\nexport const CodeDiffEditor = (props: CodeDiffEditorProps) => {\n const { original, modified, showLineNumbers, language = \"javascript\", disableScroll } = props;\n\n const options = {\n tabSize: 2,\n minimap: {\n enabled: false,\n },\n fontSize: 12,\n readOnly: true,\n originalEditable: false,\n renderSideBySide: true,\n useInlineViewWhenSpaceIsTooSmall: true,\n lineNumbers: showLineNumbers ? \"on\" : \"off\",\n ...(disableScroll\n ? {\n scrollbar: {\n vertical: \"hidden\" as const,\n horizontal: \"hidden\" as const,\n useShadows: false,\n alwaysConsumeMouseWheel: false,\n },\n scrollBeyondLastLine: false,\n mouseWheelScrollSensitivity: 0,\n overviewRulerLanes: 0,\n }\n : {}),\n } as const;\n\n return (\n <DiffEditor\n width=\"100%\"\n height=\"100%\"\n language={language}\n original={original}\n modified={modified}\n theme={\"ps-theme\"}\n options={options}\n beforeMount={(monaco) => {\n monaco.editor.defineTheme(\"ps-theme\", customTheme);\n }}\n onMount={(_, monaco) => {\n monaco.editor.setTheme(\"ps-theme\");\n\n monaco.languages.typescript.typescriptDefaults.setCompilerOptions({\n jsx: monaco.languages.typescript.JsxEmit.React,\n });\n }}\n />\n );\n};\n","import { Span } from \"@chakra-ui/react\";\nimport type React from \"react\";\nimport type { ComponentProps, MouseEvent } from \"react\";\n\ninterface DiffBubbleProps extends Omit<ComponentProps<typeof Span>, \"onClick\"> {\n fileName?: string;\n additions: number;\n deletions: number;\n label?: React.ReactNode;\n variant?: \"outline\" | \"ghost\";\n size?: \"default\" | \"small\";\n onClick?: (event: MouseEvent<HTMLSpanElement>) => void;\n onClickFileLink?: () => void;\n}\n\nexport const DiffBubble = (props: DiffBubbleProps) => {\n const {\n fileName,\n additions,\n deletions,\n label,\n variant = \"outline\",\n size = \"default\",\n onClick,\n onClickFileLink,\n } = props;\n\n const isSmall = size === \"small\";\n\n return (\n <Span\n display=\"inline-flex\"\n alignItems=\"center\"\n gap={\"2xs\"}\n border={variant === \"outline\" ? \"1px solid\" : \"none\"}\n borderColor=\"border.muted\"\n color=\"fg.muted\"\n paddingX={variant === \"outline\" ? (isSmall ? \"3xs\" : \"2xs\") : \"2px\"}\n paddingY=\"1px\"\n borderRadius=\"xs\"\n textStyle={isSmall ? \"label/S/regular\" : undefined}\n cursor={onClick ? \"pointer\" : \"default\"}\n onClick={onClick}\n _hover={{\n background: \"bg.muted\",\n }}\n >\n {label}\n {fileName && (\n <Span\n display=\"inline-block\"\n maxW=\"24ch\"\n truncate\n mr=\"xs\"\n title={fileName}\n onClick={(e) => {\n e.stopPropagation();\n onClickFileLink?.();\n }}\n cursor={onClickFileLink ? \"pointer\" : \"default\"}\n _hover={{\n textDecoration: onClickFileLink ? \"underline\" : \"none\",\n color: onClickFileLink ? \"fg.blue-dark\" : \"fg.muted\",\n }}\n >\n {fileName}\n </Span>\n )}\n <Span color=\"fg.success\">{`+${additions}`}</Span>\n <Span color=\"fg.error\">{`-${deletions}`}</Span>\n </Span>\n );\n};\n","import { DiffEditor as MonacoDiffEditor } from \"@monaco-editor/react\";\nimport { customTheme } from \"./code-editor\";\n\ninterface DiffEditorProps {\n original: string;\n modified: string;\n language?: string;\n sideBySide?: boolean;\n disableScroll?: boolean;\n}\n\nexport function DiffEditor(props: DiffEditorProps) {\n const { original, modified, language = \"plaintext\", sideBySide = false, disableScroll = true } = props;\n\n const options = {\n renderSideBySide: sideBySide,\n readOnly: true,\n fontSize: 11,\n minimap: { enabled: false },\n wordWrap: \"on\" as const,\n scrollBeyondLastLine: false,\n ...(disableScroll\n ? {\n scrollbar: {\n vertical: \"hidden\" as const,\n horizontal: \"hidden\" as const,\n useShadows: false,\n alwaysConsumeMouseWheel: false,\n },\n overviewRulerLanes: 0,\n }\n : {}),\n } as const;\n\n return (\n <MonacoDiffEditor\n width=\"100%\"\n height=\"100%\"\n original={original}\n modified={modified}\n language={language}\n theme=\"ps-theme\"\n options={options}\n beforeMount={(monaco) => {\n monaco.editor.defineTheme(\"ps-theme\", customTheme);\n }}\n onMount={(_editor, monaco) => {\n monaco.editor.setTheme(\"ps-theme\");\n }}\n />\n );\n}\n","import { EmptyState as ChakraEmptyState, VStack } from \"@chakra-ui/react\";\nimport * as React from \"react\";\n\nexport interface EmptyStateProps extends ChakraEmptyState.RootProps {\n title: string;\n description?: string;\n icon?: React.ReactNode;\n}\n\nexport const EmptyState = React.forwardRef<HTMLDivElement, EmptyStateProps>(function EmptyState(props, ref) {\n const { title, description, icon, children, ...rest } = props;\n return (\n <ChakraEmptyState.Root ref={ref} {...rest}>\n <ChakraEmptyState.Content>\n {icon && <ChakraEmptyState.Indicator>{icon}</ChakraEmptyState.Indicator>}\n {description ? (\n <VStack textAlign=\"center\">\n <ChakraEmptyState.Title fontWeight=\"normal\">{title}</ChakraEmptyState.Title>\n <ChakraEmptyState.Description>{description}</ChakraEmptyState.Description>\n </VStack>\n ) : (\n <ChakraEmptyState.Title fontWeight=\"normal\">{title}</ChakraEmptyState.Title>\n )}\n {children}\n </ChakraEmptyState.Content>\n </ChakraEmptyState.Root>\n );\n});\n"],"names":["customTheme","base","inherit","rules","colors","CodeEditor","props","$","_c","defaultCode","code","showLineNumbers","isEditable","language","t0","onChange","disableScroll","undefined","t1","Symbol","for","enabled","t2","t3","t4","scrollbar","vertical","horizontal","useShadows","alwaysConsumeMouseWheel","scrollBeyondLastLine","mouseWheelScrollSensitivity","overviewRulerLanes","t5","tabSize","minimap","fontSize","readOnly","lineNumbers","options","t6","value","t7","Editor","_temp","_temp2","CodeDiffEditor","original","modified","originalEditable","renderSideBySide","useInlineViewWhenSpaceIsTooSmall","jsx","DiffEditor","_temp3","_temp4","monaco","editor","defineTheme","monaco_0","setTheme","languages","typescript","typescriptDefaults","setCompilerOptions","JsxEmit","React","addCommand","KeyMod","CtrlCmd","KeyCode","KeyS","getAction","run","_","DiffBubble","fileName","additions","deletions","label","variant","size","onClick","onClickFileLink","isSmall","background","Span","e","stopPropagation","textDecoration","color","t8","t9","t10","t11","t12","sideBySide","wordWrap","MonacoDiffEditor","_editor","EmptyState","forwardRef","ref","children","description","icon","rest","title","ChakraEmptyState","jsxs","VStack"],"mappings":";;;;;AAEO,MAAMA,IAAc;AAAA,EACzBC,MAAM;AAAA,EACNC,SAAS;AAAA,EACTC,OAAO,CAAA;AAAA,EACPC,QAAQ;AAAA,IACN,qBAAqB;AAAA,IACrB,qBAAqB;AAAA,IACrB,kCAAkC;AAAA,IAClC,2BAA2B;AAAA,IAC3B,+BAA+B;AAAA,IAC/B,gCAAgC;AAAA,IAChC,sCAAsC;AAAA,EAAA;AAE1C,GAYaC,IAAaC,CAAAA,MAAA;AAAA,QAAAC,IAAAC,EAAA,EAAA,GACxB;AAAA,IAAAC,aAAAA;AAAAA,IAAAC,MAAAA;AAAAA,IAAAC,iBAAAA;AAAAA,IAAAC,YAAAA;AAAAA,IAAAC,UAAAC;AAAAA,IAAAC,UAAAA;AAAAA,IAAAC,eAAAA;AAAAA,EAAAA,IAA6GV,GAArDO,IAAAC,MAAAG,SAAA,eAAAH;AAAuB,MAAAI;AAAA,EAAAX,EA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A,EAAA,GAC7C,IAEA,gBAAApD,EAAAwD,EAAA,OAAA,EAAmC,YAAA,UAAUD,UAAAA,GAAM,GACpDpG,OAAAiG,GAAAjG,OAAAoG,GAAApG,QAAAW,KAAAA,IAAAX,EAAA,EAAA;AAAA,MAAAe;AAAA,EAAAf,EAAA,EAAA,MAAAgG,KAAAhG,UAAAO,KAAAP,EAAA,EAAA,MAAAW,KATHI,IAAA,gBAAAuF,EAAAD,EAAA,SAAA,EACG9F,UAAAA;AAAAA,IAAAA;AAAAA,IACAI;AAAAA,IAQAqF;AAAAA,EAAAA,GACH,GAA2BhG,QAAAgG,GAAAhG,QAAAO,GAAAP,QAAAW,GAAAX,QAAAe,KAAAA,IAAAf,EAAA,EAAA;AAAA,MAAAgB;AAAA,SAAAhB,EAAA,EAAA,MAAA+F,KAAA/F,UAAAmG,KAAAnG,EAAA,EAAA,MAAAe,KAZ7BC,sBAAAqF,EAAA,MAAA,EAA4BN,KAAAA,GAAG,GAAMI,GACnCpF,UAAAA,GAYF,GAAwBf,QAAA+F,GAAA/F,QAAAmG,GAAAnG,QAAAe,GAAAf,QAAAgB,KAAAA,IAAAhB,EAAA,EAAA,GAbxBgB;AAawB,CAE3B;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export { AlertMessage } from './components/alert';
|
|
|
4
4
|
export { Breadcrumb } from './components/breadcrumb';
|
|
5
5
|
export type { CheckboxProps } from './components/checkbox';
|
|
6
6
|
export { Checkbox } from './components/checkbox';
|
|
7
|
+
export { CodeDiffEditor, CodeEditor } from './components/code-editor';
|
|
7
8
|
export { ContentPlaceholder, Label as ContentPlaceholderLabel } from './components/content-placeholder';
|
|
8
9
|
export { DeleteConfirmationModal } from './components/delete-confirmation-modal';
|
|
9
10
|
export { DiffBubble } from './components/diff-bubble';
|