@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
package/dist/index.cjs
CHANGED
|
@@ -5063,7 +5063,7 @@ var init_image_placeholder = __esm({
|
|
|
5063
5063
|
}
|
|
5064
5064
|
});
|
|
5065
5065
|
function ContentEditable({
|
|
5066
|
-
placeholder
|
|
5066
|
+
placeholder,
|
|
5067
5067
|
className,
|
|
5068
5068
|
placeholderClassName,
|
|
5069
5069
|
placeholderDefaults = true
|
|
@@ -5077,8 +5077,8 @@ function ContentEditable({
|
|
|
5077
5077
|
!isReadOnlyOrReview && "min-h-72 px-8 py-4",
|
|
5078
5078
|
className
|
|
5079
5079
|
),
|
|
5080
|
-
"aria-placeholder":
|
|
5081
|
-
"aria-label":
|
|
5080
|
+
"aria-placeholder": placeholder,
|
|
5081
|
+
"aria-label": placeholder || "Editor n\u1ED9i dung",
|
|
5082
5082
|
placeholder: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5083
5083
|
"div",
|
|
5084
5084
|
{
|
|
@@ -5087,7 +5087,7 @@ function ContentEditable({
|
|
|
5087
5087
|
"text-muted-foreground pointer-events-none select-none",
|
|
5088
5088
|
placeholderDefaults && !isReadOnlyOrReview && "absolute top-0 left-0 overflow-hidden px-8 py-[18px] text-ellipsis"
|
|
5089
5089
|
),
|
|
5090
|
-
children:
|
|
5090
|
+
children: placeholder
|
|
5091
5091
|
}
|
|
5092
5092
|
)
|
|
5093
5093
|
}
|
|
@@ -7221,10 +7221,10 @@ function SelectTrigger({ className, children, size = "default", ...props }) {
|
|
|
7221
7221
|
}
|
|
7222
7222
|
);
|
|
7223
7223
|
}
|
|
7224
|
-
function SelectValue({ placeholder
|
|
7224
|
+
function SelectValue({ placeholder }) {
|
|
7225
7225
|
const context = React20__namespace.useContext(SelectContext);
|
|
7226
7226
|
if (!context) throw new Error("SelectValue must be used within Select");
|
|
7227
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", { children: context.value ||
|
|
7227
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { children: context.value || placeholder });
|
|
7228
7228
|
}
|
|
7229
7229
|
function SelectContent({ className, children, ...props }) {
|
|
7230
7230
|
const context = React20__namespace.useContext(SelectContext);
|
|
@@ -32865,7 +32865,8 @@ __export(plugins_exports, {
|
|
|
32865
32865
|
Plugins: () => Plugins
|
|
32866
32866
|
});
|
|
32867
32867
|
function Plugins({
|
|
32868
|
-
readOnly = false
|
|
32868
|
+
readOnly = false,
|
|
32869
|
+
placeholder = ""
|
|
32869
32870
|
}) {
|
|
32870
32871
|
const [floatingAnchorElem, setFloatingAnchorElem] = React20.useState(null);
|
|
32871
32872
|
const [isLinkEditMode, setIsLinkEditMode] = React20.useState(false);
|
|
@@ -33105,7 +33106,6 @@ function Plugins({
|
|
|
33105
33106
|
] }) })
|
|
33106
33107
|
] });
|
|
33107
33108
|
}
|
|
33108
|
-
var placeholder;
|
|
33109
33109
|
var init_plugins = __esm({
|
|
33110
33110
|
"src/editor-x/plugins.tsx"() {
|
|
33111
33111
|
"use client";
|
|
@@ -33194,7 +33194,6 @@ var init_plugins = __esm({
|
|
|
33194
33194
|
init_markdown_tweet_transformer();
|
|
33195
33195
|
init_markdown_list_transformer();
|
|
33196
33196
|
init_separator();
|
|
33197
|
-
placeholder = "Press / for commands...";
|
|
33198
33197
|
}
|
|
33199
33198
|
});
|
|
33200
33199
|
|
|
@@ -33338,7 +33337,8 @@ function Editor({
|
|
|
33338
33337
|
editorSerializedState,
|
|
33339
33338
|
onChange,
|
|
33340
33339
|
onSerializedChange,
|
|
33341
|
-
readOnly = false
|
|
33340
|
+
readOnly = false,
|
|
33341
|
+
placeholder = ""
|
|
33342
33342
|
}) {
|
|
33343
33343
|
const { ref: editorRef, width: editorWidth } = useElementSize();
|
|
33344
33344
|
const editorMaxWidth = editorWidth || void 0;
|
|
@@ -33392,7 +33392,7 @@ function Editor({
|
|
|
33392
33392
|
...editorSerializedState ? { editorState: JSON.stringify(editorSerializedState) } : {}
|
|
33393
33393
|
},
|
|
33394
33394
|
children: /* @__PURE__ */ jsxRuntime.jsxs(TooltipProvider, { children: [
|
|
33395
|
-
/* @__PURE__ */ jsxRuntime.jsx(Plugins2, { readOnly }),
|
|
33395
|
+
/* @__PURE__ */ jsxRuntime.jsx(Plugins2, { readOnly, placeholder }),
|
|
33396
33396
|
!readOnly && /* @__PURE__ */ jsxRuntime.jsx(
|
|
33397
33397
|
LexicalOnChangePlugin.OnChangePlugin,
|
|
33398
33398
|
{
|
|
@@ -33417,7 +33417,8 @@ function LexicalEditor11({
|
|
|
33417
33417
|
value,
|
|
33418
33418
|
onChange,
|
|
33419
33419
|
readOnly = false,
|
|
33420
|
-
className
|
|
33420
|
+
className,
|
|
33421
|
+
placeholder = ""
|
|
33421
33422
|
}) {
|
|
33422
33423
|
const [editorState, setEditorState] = React20.useState(() => {
|
|
33423
33424
|
if (value && typeof value === "object" && value !== null) {
|
|
@@ -33492,7 +33493,8 @@ function LexicalEditor11({
|
|
|
33492
33493
|
{
|
|
33493
33494
|
editorSerializedState: editorState,
|
|
33494
33495
|
onSerializedChange: handleSerializedChange,
|
|
33495
|
-
readOnly
|
|
33496
|
+
readOnly,
|
|
33497
|
+
placeholder
|
|
33496
33498
|
}
|
|
33497
33499
|
) });
|
|
33498
33500
|
}
|