@thangph2146/lexical-editor 0.0.5 → 0.0.6
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 +47 -0
- package/dist/editor-x/editor.cjs +11 -11
- package/dist/editor-x/editor.cjs.map +1 -1
- package/dist/editor-x/editor.d.cts +2 -1
- package/dist/editor-x/editor.d.ts +2 -1
- package/dist/editor-x/editor.js +11 -11
- package/dist/editor-x/editor.js.map +1 -1
- package/dist/index.cjs +15 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +15 -13
- package/dist/index.js.map +1 -1
- package/package.json +86 -84
- package/src/components/lexical-editor.tsx +2 -0
- package/src/editor-x/editor.tsx +4 -2
- package/src/editor-x/plugins.tsx +2 -2
- package/src/themes/editor-theme copy.scss +0 -763
- package/src/themes/plugins copy.scss +0 -656
- package/src/themes/ui-components copy.scss +0 -1335
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { EditorState, SerializedEditorState } from 'lexical';
|
|
3
3
|
|
|
4
|
-
declare function Editor({ editorState, editorSerializedState, onChange, onSerializedChange, readOnly, }: {
|
|
4
|
+
declare function Editor({ editorState, editorSerializedState, onChange, onSerializedChange, readOnly, placeholder, }: {
|
|
5
5
|
editorState?: EditorState;
|
|
6
6
|
editorSerializedState?: SerializedEditorState;
|
|
7
7
|
onChange?: (editorState: EditorState) => void;
|
|
8
8
|
onSerializedChange?: (editorSerializedState: SerializedEditorState) => void;
|
|
9
9
|
readOnly?: boolean;
|
|
10
|
+
placeholder?: string;
|
|
10
11
|
}): react_jsx_runtime.JSX.Element;
|
|
11
12
|
|
|
12
13
|
export { Editor };
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { EditorState, SerializedEditorState } from 'lexical';
|
|
3
3
|
|
|
4
|
-
declare function Editor({ editorState, editorSerializedState, onChange, onSerializedChange, readOnly, }: {
|
|
4
|
+
declare function Editor({ editorState, editorSerializedState, onChange, onSerializedChange, readOnly, placeholder, }: {
|
|
5
5
|
editorState?: EditorState;
|
|
6
6
|
editorSerializedState?: SerializedEditorState;
|
|
7
7
|
onChange?: (editorState: EditorState) => void;
|
|
8
8
|
onSerializedChange?: (editorSerializedState: SerializedEditorState) => void;
|
|
9
9
|
readOnly?: boolean;
|
|
10
|
+
placeholder?: string;
|
|
10
11
|
}): react_jsx_runtime.JSX.Element;
|
|
11
12
|
|
|
12
13
|
export { Editor };
|
package/dist/editor-x/editor.js
CHANGED
|
@@ -5037,7 +5037,7 @@ var init_image_placeholder = __esm({
|
|
|
5037
5037
|
}
|
|
5038
5038
|
});
|
|
5039
5039
|
function ContentEditable({
|
|
5040
|
-
placeholder
|
|
5040
|
+
placeholder,
|
|
5041
5041
|
className,
|
|
5042
5042
|
placeholderClassName,
|
|
5043
5043
|
placeholderDefaults = true
|
|
@@ -5051,8 +5051,8 @@ function ContentEditable({
|
|
|
5051
5051
|
!isReadOnlyOrReview && "min-h-72 px-8 py-4",
|
|
5052
5052
|
className
|
|
5053
5053
|
),
|
|
5054
|
-
"aria-placeholder":
|
|
5055
|
-
"aria-label":
|
|
5054
|
+
"aria-placeholder": placeholder,
|
|
5055
|
+
"aria-label": placeholder || "Editor n\u1ED9i dung",
|
|
5056
5056
|
placeholder: /* @__PURE__ */ jsx(
|
|
5057
5057
|
"div",
|
|
5058
5058
|
{
|
|
@@ -5061,7 +5061,7 @@ function ContentEditable({
|
|
|
5061
5061
|
"text-muted-foreground pointer-events-none select-none",
|
|
5062
5062
|
placeholderDefaults && !isReadOnlyOrReview && "absolute top-0 left-0 overflow-hidden px-8 py-[18px] text-ellipsis"
|
|
5063
5063
|
),
|
|
5064
|
-
children:
|
|
5064
|
+
children: placeholder
|
|
5065
5065
|
}
|
|
5066
5066
|
)
|
|
5067
5067
|
}
|
|
@@ -7195,10 +7195,10 @@ function SelectTrigger({ className, children, size = "default", ...props }) {
|
|
|
7195
7195
|
}
|
|
7196
7196
|
);
|
|
7197
7197
|
}
|
|
7198
|
-
function SelectValue({ placeholder
|
|
7198
|
+
function SelectValue({ placeholder }) {
|
|
7199
7199
|
const context = React20.useContext(SelectContext);
|
|
7200
7200
|
if (!context) throw new Error("SelectValue must be used within Select");
|
|
7201
|
-
return /* @__PURE__ */ jsx("span", { children: context.value ||
|
|
7201
|
+
return /* @__PURE__ */ jsx("span", { children: context.value || placeholder });
|
|
7202
7202
|
}
|
|
7203
7203
|
function SelectContent({ className, children, ...props }) {
|
|
7204
7204
|
const context = React20.useContext(SelectContext);
|
|
@@ -32839,7 +32839,8 @@ __export(plugins_exports, {
|
|
|
32839
32839
|
Plugins: () => Plugins
|
|
32840
32840
|
});
|
|
32841
32841
|
function Plugins({
|
|
32842
|
-
readOnly = false
|
|
32842
|
+
readOnly = false,
|
|
32843
|
+
placeholder = ""
|
|
32843
32844
|
}) {
|
|
32844
32845
|
const [floatingAnchorElem, setFloatingAnchorElem] = useState(null);
|
|
32845
32846
|
const [isLinkEditMode, setIsLinkEditMode] = useState(false);
|
|
@@ -33079,7 +33080,6 @@ function Plugins({
|
|
|
33079
33080
|
] }) })
|
|
33080
33081
|
] });
|
|
33081
33082
|
}
|
|
33082
|
-
var placeholder;
|
|
33083
33083
|
var init_plugins = __esm({
|
|
33084
33084
|
"src/editor-x/plugins.tsx"() {
|
|
33085
33085
|
"use client";
|
|
@@ -33168,7 +33168,6 @@ var init_plugins = __esm({
|
|
|
33168
33168
|
init_markdown_tweet_transformer();
|
|
33169
33169
|
init_markdown_list_transformer();
|
|
33170
33170
|
init_separator();
|
|
33171
|
-
placeholder = "Press / for commands...";
|
|
33172
33171
|
}
|
|
33173
33172
|
});
|
|
33174
33173
|
|
|
@@ -33312,7 +33311,8 @@ function Editor({
|
|
|
33312
33311
|
editorSerializedState,
|
|
33313
33312
|
onChange,
|
|
33314
33313
|
onSerializedChange,
|
|
33315
|
-
readOnly = false
|
|
33314
|
+
readOnly = false,
|
|
33315
|
+
placeholder = ""
|
|
33316
33316
|
}) {
|
|
33317
33317
|
const { ref: editorRef, width: editorWidth } = useElementSize();
|
|
33318
33318
|
const editorMaxWidth = editorWidth || void 0;
|
|
@@ -33366,7 +33366,7 @@ function Editor({
|
|
|
33366
33366
|
...editorSerializedState ? { editorState: JSON.stringify(editorSerializedState) } : {}
|
|
33367
33367
|
},
|
|
33368
33368
|
children: /* @__PURE__ */ jsxs(TooltipProvider, { children: [
|
|
33369
|
-
/* @__PURE__ */ jsx(Plugins2, { readOnly }),
|
|
33369
|
+
/* @__PURE__ */ jsx(Plugins2, { readOnly, placeholder }),
|
|
33370
33370
|
!readOnly && /* @__PURE__ */ jsx(
|
|
33371
33371
|
OnChangePlugin,
|
|
33372
33372
|
{
|