ssovee-os-web-ui 0.1.70 → 0.1.72
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/README.md +53 -0
- package/dist/index.cjs +165 -91
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -3
- package/dist/index.d.ts +14 -3
- package/dist/index.js +97 -27
- package/dist/index.js.map +1 -1
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -55,6 +55,57 @@ export function Example() {
|
|
|
55
55
|
}
|
|
56
56
|
```
|
|
57
57
|
|
|
58
|
+
## Editors
|
|
59
|
+
|
|
60
|
+
### CodeEditor
|
|
61
|
+
|
|
62
|
+
`CodeEditor` is a controlled Monaco editor configured for JSON by default:
|
|
63
|
+
|
|
64
|
+
```tsx
|
|
65
|
+
import { useState } from "react";
|
|
66
|
+
import { CodeEditor } from "ssovee-os-web-ui";
|
|
67
|
+
|
|
68
|
+
export function SettingsEditor() {
|
|
69
|
+
const [value, setValue] = useState('{"enabled":true}');
|
|
70
|
+
|
|
71
|
+
return (
|
|
72
|
+
<CodeEditor
|
|
73
|
+
value={value}
|
|
74
|
+
onChange={setValue}
|
|
75
|
+
theme="light"
|
|
76
|
+
height="320px"
|
|
77
|
+
options={{ minimap: { enabled: false } }}
|
|
78
|
+
/>
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Use `theme="vs-dark"` for a dark editor. The component also accepts Monaco `language`, `height`, and `options` props.
|
|
84
|
+
|
|
85
|
+
### RichEditor
|
|
86
|
+
|
|
87
|
+
`RichEditor` provides WYSIWYG text editing for rich content and HTML output:
|
|
88
|
+
|
|
89
|
+
```tsx
|
|
90
|
+
import { useState } from "react";
|
|
91
|
+
import { RichEditor } from "ssovee-os-web-ui";
|
|
92
|
+
|
|
93
|
+
export function StoryEditor() {
|
|
94
|
+
const [value, setValue] = useState("<p><strong>Hello</strong> world</p>");
|
|
95
|
+
|
|
96
|
+
return (
|
|
97
|
+
<RichEditor
|
|
98
|
+
value={value}
|
|
99
|
+
onChange={setValue}
|
|
100
|
+
placeholder="Write something rich..."
|
|
101
|
+
height={220}
|
|
102
|
+
/>
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
`RichEditor` supports formatted text output in HTML, along with placeholder, height, and readOnly support.
|
|
108
|
+
|
|
58
109
|
## Window components
|
|
59
110
|
|
|
60
111
|
### Simple window
|
|
@@ -179,6 +230,8 @@ The package exports these components and types for external use:
|
|
|
179
230
|
- `Button`
|
|
180
231
|
- `Input`
|
|
181
232
|
- `TextArea`
|
|
233
|
+
- `CodeEditor`
|
|
234
|
+
- `RichEditor`
|
|
182
235
|
- `Select`
|
|
183
236
|
- `SelectOption`
|
|
184
237
|
- `Checkbox`
|