@elia-ori/editor 0.1.13 → 0.1.15
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 +4 -3
- 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 +4 -3
- package/dist/index.js.map +1 -1
- package/dist/styles/editor.css +18 -0
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -64,8 +64,10 @@ interface EliaEditorProps {
|
|
|
64
64
|
editorClassName?: string;
|
|
65
65
|
autofocus?: boolean;
|
|
66
66
|
readOnly?: boolean;
|
|
67
|
+
/** 嵌入模式:不使用 100vh,高度由父容器決定 */
|
|
68
|
+
embedded?: boolean;
|
|
67
69
|
}
|
|
68
|
-
declare function EliaEditor({ content, onChange, placeholder, toolbar, onImageUpload, className, editorClassName, autofocus, readOnly, }: EliaEditorProps): react_jsx_runtime.JSX.Element;
|
|
70
|
+
declare function EliaEditor({ content, onChange, placeholder, toolbar, onImageUpload, className, editorClassName, autofocus, readOnly, embedded, }: EliaEditorProps): react_jsx_runtime.JSX.Element;
|
|
69
71
|
|
|
70
72
|
type CalloutType = 'success' | 'warning' | 'error' | 'info';
|
|
71
73
|
interface CalloutOptions {
|
package/dist/index.d.ts
CHANGED
|
@@ -64,8 +64,10 @@ interface EliaEditorProps {
|
|
|
64
64
|
editorClassName?: string;
|
|
65
65
|
autofocus?: boolean;
|
|
66
66
|
readOnly?: boolean;
|
|
67
|
+
/** 嵌入模式:不使用 100vh,高度由父容器決定 */
|
|
68
|
+
embedded?: boolean;
|
|
67
69
|
}
|
|
68
|
-
declare function EliaEditor({ content, onChange, placeholder, toolbar, onImageUpload, className, editorClassName, autofocus, readOnly, }: EliaEditorProps): react_jsx_runtime.JSX.Element;
|
|
70
|
+
declare function EliaEditor({ content, onChange, placeholder, toolbar, onImageUpload, className, editorClassName, autofocus, readOnly, embedded, }: EliaEditorProps): react_jsx_runtime.JSX.Element;
|
|
69
71
|
|
|
70
72
|
type CalloutType = 'success' | 'warning' | 'error' | 'info';
|
|
71
73
|
interface CalloutOptions {
|
package/dist/index.js
CHANGED
|
@@ -6150,7 +6150,8 @@ function EliaEditor({
|
|
|
6150
6150
|
className,
|
|
6151
6151
|
editorClassName,
|
|
6152
6152
|
autofocus = false,
|
|
6153
|
-
readOnly = false
|
|
6153
|
+
readOnly = false,
|
|
6154
|
+
embedded = false
|
|
6154
6155
|
}) {
|
|
6155
6156
|
const isMobile = useIsBreakpoint();
|
|
6156
6157
|
const { height } = useWindowSize();
|
|
@@ -6244,13 +6245,13 @@ function EliaEditor({
|
|
|
6244
6245
|
editor.setEditable(!readOnly);
|
|
6245
6246
|
}
|
|
6246
6247
|
}, [readOnly, editor]);
|
|
6247
|
-
return /* @__PURE__ */ jsx63("div", { className: cn("simple-editor-wrapper", className), children: /* @__PURE__ */ jsxs40(EditorContext.Provider, { value: { editor }, children: [
|
|
6248
|
+
return /* @__PURE__ */ jsx63("div", { className: cn("simple-editor-wrapper", embedded && "simple-editor-embedded", className), children: /* @__PURE__ */ jsxs40(EditorContext.Provider, { value: { editor }, children: [
|
|
6248
6249
|
/* @__PURE__ */ jsx63(
|
|
6249
6250
|
Toolbar,
|
|
6250
6251
|
{
|
|
6251
6252
|
ref: toolbarRef,
|
|
6252
6253
|
style: {
|
|
6253
|
-
...isMobile ? {
|
|
6254
|
+
...isMobile && !embedded ? {
|
|
6254
6255
|
bottom: `calc(100% - ${height - rect.y}px)`
|
|
6255
6256
|
} : {}
|
|
6256
6257
|
},
|