ssovee-os-web-ui 0.1.93 → 0.1.95
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.cjs +60 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +124 -0
- package/dist/index.d.cts +8 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +61 -4
- package/dist/index.js.map +1 -1
- package/package.json +7 -3
package/dist/index.cjs
CHANGED
|
@@ -4,6 +4,8 @@ var React23 = require('react');
|
|
|
4
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
5
|
var react = require('@phosphor-icons/react');
|
|
6
6
|
var Editor = require('@monaco-editor/react');
|
|
7
|
+
var react$1 = require('@tiptap/react');
|
|
8
|
+
var StarterKit = require('@tiptap/starter-kit');
|
|
7
9
|
var uaParserJs = require('ua-parser-js');
|
|
8
10
|
|
|
9
11
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -28,6 +30,7 @@ function _interopNamespace(e) {
|
|
|
28
30
|
|
|
29
31
|
var React23__namespace = /*#__PURE__*/_interopNamespace(React23);
|
|
30
32
|
var Editor__default = /*#__PURE__*/_interopDefault(Editor);
|
|
33
|
+
var StarterKit__default = /*#__PURE__*/_interopDefault(StarterKit);
|
|
31
34
|
|
|
32
35
|
// src/components/Button.tsx
|
|
33
36
|
|
|
@@ -333,6 +336,61 @@ var CodeEditor = ({
|
|
|
333
336
|
) });
|
|
334
337
|
};
|
|
335
338
|
var CodeEditor_default = CodeEditor;
|
|
339
|
+
var RichEditor = ({ content, onChange, isDarkTheme }) => {
|
|
340
|
+
const onChangeRef = React23.useRef(onChange);
|
|
341
|
+
onChangeRef.current = onChange;
|
|
342
|
+
const editorTheme = isDarkTheme ? "vs-dark" : "light";
|
|
343
|
+
const editor = react$1.useEditor({
|
|
344
|
+
extensions: [StarterKit__default.default],
|
|
345
|
+
content,
|
|
346
|
+
immediatelyRender: false,
|
|
347
|
+
onUpdate: ({ editor: updatedEditor }) => {
|
|
348
|
+
onChangeRef.current(updatedEditor.getHTML());
|
|
349
|
+
}
|
|
350
|
+
}, []);
|
|
351
|
+
React23.useEffect(() => {
|
|
352
|
+
if (editor && content !== editor.getHTML()) {
|
|
353
|
+
editor.commands.setContent(content, { emitUpdate: false });
|
|
354
|
+
}
|
|
355
|
+
}, [content, editor]);
|
|
356
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
357
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-3 flex flex-wrap items-center gap-1 border-b border-primary pb-2 text-neutral-500 [&_button]:text-neutral-500", children: [
|
|
358
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-0.5", children: [
|
|
359
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button_default, { type: "button", variant: editor?.isActive("bold") ? "primary" : "ghost", size: "sm", onClick: () => editor?.chain().focus().toggleBold().run(), "aria-label": "Bold text", title: "Bold", children: /* @__PURE__ */ jsxRuntime.jsx("strong", { children: "B" }) }),
|
|
360
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button_default, { type: "button", variant: editor?.isActive("italic") ? "primary" : "ghost", size: "sm", onClick: () => editor?.chain().focus().toggleItalic().run(), "aria-label": "Italic text", title: "Italic", children: /* @__PURE__ */ jsxRuntime.jsx("em", { children: "I" }) }),
|
|
361
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button_default, { type: "button", variant: editor?.isActive("strike") ? "primary" : "ghost", size: "sm", onClick: () => editor?.chain().focus().toggleStrike().run(), "aria-label": "Strikethrough text", title: "Strikethrough", children: /* @__PURE__ */ jsxRuntime.jsx("s", { children: "S" }) })
|
|
362
|
+
] }),
|
|
363
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-0.5", children: [
|
|
364
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button_default, { type: "button", variant: editor?.isActive("heading", { level: 1 }) ? "primary" : "ghost", size: "sm", onClick: () => editor?.chain().focus().toggleHeading({ level: 1 }).run(), "aria-label": "Heading 1", title: "Heading 1", children: "H1" }),
|
|
365
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button_default, { type: "button", variant: editor?.isActive("heading", { level: 2 }) ? "primary" : "ghost", size: "sm", onClick: () => editor?.chain().focus().toggleHeading({ level: 2 }).run(), "aria-label": "Heading 2", title: "Heading 2", children: "H2" }),
|
|
366
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button_default, { type: "button", variant: editor?.isActive("heading", { level: 3 }) ? "primary" : "ghost", size: "sm", onClick: () => editor?.chain().focus().toggleHeading({ level: 3 }).run(), "aria-label": "Heading 3", title: "Heading 3", children: "H3" })
|
|
367
|
+
] }),
|
|
368
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-0.5", children: [
|
|
369
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button_default, { type: "button", variant: editor?.isActive("bulletList") ? "primary" : "ghost", size: "sm", onClick: () => editor?.chain().focus().toggleBulletList().run(), "aria-label": "Bullet list", title: "Bullet list", children: /* @__PURE__ */ jsxRuntime.jsx(react.ListBulletsIcon, { size: 17 }) }),
|
|
370
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button_default, { type: "button", variant: editor?.isActive("orderedList") ? "primary" : "ghost", size: "sm", onClick: () => editor?.chain().focus().toggleOrderedList().run(), "aria-label": "Numbered list", title: "Numbered list", children: /* @__PURE__ */ jsxRuntime.jsx(react.ListNumbersIcon, { size: 17 }) }),
|
|
371
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button_default, { type: "button", variant: editor?.isActive("blockquote") ? "primary" : "ghost", size: "sm", onClick: () => editor?.chain().focus().toggleBlockquote().run(), "aria-label": "Block quote", title: "Block quote", children: /* @__PURE__ */ jsxRuntime.jsx(react.QuotesIcon, { size: 17 }) })
|
|
372
|
+
] }),
|
|
373
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-0.5", children: [
|
|
374
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button_default, { type: "button", variant: editor?.isActive("code") ? "primary" : "ghost", size: "sm", onClick: () => editor?.chain().focus().toggleCode().run(), "aria-label": "Inline code", title: "Inline code", children: /* @__PURE__ */ jsxRuntime.jsx(react.CodeIcon, { size: 17 }) }),
|
|
375
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button_default, { type: "button", variant: editor?.isActive("codeBlock") ? "primary" : "ghost", size: "sm", onClick: () => editor?.chain().focus().toggleCodeBlock().run(), "aria-label": "Code block", title: "Code block", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs", children: "</>" }) }),
|
|
376
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button_default, { type: "button", variant: "ghost", size: "sm", onClick: () => editor?.chain().focus().setHorizontalRule().run(), "aria-label": "Horizontal rule", title: "Horizontal rule", children: /* @__PURE__ */ jsxRuntime.jsx(react.MinusIcon, { size: 17 }) })
|
|
377
|
+
] }),
|
|
378
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-0.5", children: [
|
|
379
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button_default, { type: "button", variant: "ghost", size: "sm", onClick: () => editor?.chain().focus().undo().run(), "aria-label": "Undo", title: "Undo", children: /* @__PURE__ */ jsxRuntime.jsx(react.ArrowCounterClockwiseIcon, { size: 17 }) }),
|
|
380
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button_default, { type: "button", variant: "ghost", size: "sm", onClick: () => editor?.chain().focus().redo().run(), "aria-label": "Redo", title: "Redo", children: /* @__PURE__ */ jsxRuntime.jsx(react.ArrowClockwiseIcon, { size: 17 }) }),
|
|
381
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button_default, { type: "button", variant: "ghost", size: "sm", onClick: () => editor?.chain().focus().clearNodes().unsetAllMarks().run(), "aria-label": "Clear formatting", title: "Clear formatting", children: /* @__PURE__ */ jsxRuntime.jsx(react.EraserIcon, { size: 17 }) })
|
|
382
|
+
] })
|
|
383
|
+
] }),
|
|
384
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
385
|
+
react$1.EditorContent,
|
|
386
|
+
{
|
|
387
|
+
editor,
|
|
388
|
+
className: `mt-4 min-h-52 rounded-md border border-primary p-3 text-sm leading-6 text-neutral-500 outline-none transition-colors focus-within:border-brand-color [&_.ProseMirror]:min-h-44 [&_.ProseMirror]:outline-none [&_.ProseMirror_p]:my-2 [&_.ProseMirror_h1]:my-3 [&_.ProseMirror_h1]:text-2xl [&_.ProseMirror_h1]:font-bold [&_.ProseMirror_h2]:my-3 [&_.ProseMirror_h2]:text-xl [&_.ProseMirror_h2]:font-bold [&_.ProseMirror_h3]:my-3 [&_.ProseMirror_h3]:text-lg [&_.ProseMirror_h3]:font-bold [&_.ProseMirror_ul]:my-2 [&_.ProseMirror_ul]:list-disc [&_.ProseMirror_ul]:pl-6 [&_.ProseMirror_ol]:my-2 [&_.ProseMirror_ol]:list-decimal [&_.ProseMirror_ol]:pl-6 [&_.ProseMirror_blockquote]:my-3 [&_.ProseMirror_blockquote]:border-l-4 [&_.ProseMirror_blockquote]:border-brand-color [&_.ProseMirror_blockquote]:pl-4 [&_.ProseMirror_pre]:my-3 [&_.ProseMirror_pre]:overflow-x-auto [&_.ProseMirror_pre]:rounded [&_.ProseMirror_pre]:bg-surface-3 [&_.ProseMirror_pre]:p-3 ${editorTheme === "vs-dark" ? "bg-primary" : "bg-secondary"}`
|
|
389
|
+
}
|
|
390
|
+
)
|
|
391
|
+
] });
|
|
392
|
+
};
|
|
393
|
+
var RichEditor_default = RichEditor;
|
|
336
394
|
var Select = React23__namespace.default.forwardRef(
|
|
337
395
|
({
|
|
338
396
|
className,
|
|
@@ -1364,7 +1422,7 @@ var Avatar = ({
|
|
|
1364
1422
|
{
|
|
1365
1423
|
src,
|
|
1366
1424
|
alt,
|
|
1367
|
-
className: "object-cover",
|
|
1425
|
+
className: "w-full h-full object-cover",
|
|
1368
1426
|
sizes: size === "sm" ? "32px" : size === "md" ? "40px" : size === "lg" ? "48px" : "64px",
|
|
1369
1427
|
onError: handleImgError
|
|
1370
1428
|
}
|
|
@@ -3471,6 +3529,7 @@ exports.Pagination = Pagination_default;
|
|
|
3471
3529
|
exports.PluginPlayground = PluginPlayground;
|
|
3472
3530
|
exports.Progress = Progress_default;
|
|
3473
3531
|
exports.Radio = Radio_default;
|
|
3532
|
+
exports.RichEditor = RichEditor_default;
|
|
3474
3533
|
exports.SearchInput = SearchInput_default;
|
|
3475
3534
|
exports.Select = Select_default;
|
|
3476
3535
|
exports.Skeleton = Skeleton_default;
|