@elia-ori/editor 0.1.22 → 0.1.24
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 +3 -1
- package/dist/index.cjs +8 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/dist/styles/editor.css +99 -1
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -55,6 +55,7 @@ function MyEditor() {
|
|
|
55
55
|
| `toolbar` | `ToolbarItem[]` | 全部 | 工具列項目 |
|
|
56
56
|
| `onImageUpload` | `UploadFunction` | - | **必要** - 圖片上傳函數 |
|
|
57
57
|
| `embedded` | `boolean` | `false` | 嵌入模式(高度由父容器決定) |
|
|
58
|
+
| `card` | `boolean` | `false` | 卡片樣式(邊框 + 圓角 + 陰影) |
|
|
58
59
|
| `className` | `string` | - | 外層 class |
|
|
59
60
|
| `editorClassName` | `string` | - | 編輯器 class |
|
|
60
61
|
| `autofocus` | `boolean` | `false` | 自動聚焦 |
|
|
@@ -133,7 +134,8 @@ const handleImageUpload = async (file, onProgress) => {
|
|
|
133
134
|
```tsx
|
|
134
135
|
<EliaEditor
|
|
135
136
|
embedded
|
|
136
|
-
|
|
137
|
+
card
|
|
138
|
+
className="min-h-96"
|
|
137
139
|
// ...
|
|
138
140
|
/>
|
|
139
141
|
```
|
package/dist/index.cjs
CHANGED
|
@@ -6190,7 +6190,8 @@ function EliaEditor({
|
|
|
6190
6190
|
embedded = false,
|
|
6191
6191
|
autoHeight = false,
|
|
6192
6192
|
bottomOffset = 24,
|
|
6193
|
-
minHeight = 200
|
|
6193
|
+
minHeight = 200,
|
|
6194
|
+
card = false
|
|
6194
6195
|
}) {
|
|
6195
6196
|
const isMobile = useIsBreakpoint();
|
|
6196
6197
|
const { height } = useWindowSize();
|
|
@@ -6294,7 +6295,12 @@ function EliaEditor({
|
|
|
6294
6295
|
"div",
|
|
6295
6296
|
{
|
|
6296
6297
|
ref: containerRef,
|
|
6297
|
-
className: cn(
|
|
6298
|
+
className: cn(
|
|
6299
|
+
"simple-editor-wrapper",
|
|
6300
|
+
embedded && "simple-editor-embedded",
|
|
6301
|
+
card && "simple-editor-card",
|
|
6302
|
+
className
|
|
6303
|
+
),
|
|
6298
6304
|
style: computedHeight ? { height: computedHeight } : void 0,
|
|
6299
6305
|
children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_react87.EditorContext.Provider, { value: { editor }, children: [
|
|
6300
6306
|
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|