@cyberyozh/text-editor 0.1.9 → 0.1.10
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/editor.js +71 -70
- package/dist/editor.js.map +1 -1
- package/dist/editor.mjs +15 -14
- package/dist/editor.mjs.map +1 -1
- package/dist/render.js +20 -6
- package/dist/render.js.map +1 -1
- package/dist/render.mjs +18 -4
- package/dist/render.mjs.map +1 -1
- package/package.json +1 -1
- package/src/extensions/views/components/table.tsx +34 -8
package/dist/editor.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/editor/editor.tsx
|
|
2
|
-
import { useState as
|
|
2
|
+
import { useState as useState13, useEffect as useEffect10 } from "react";
|
|
3
3
|
import { NodeSelection } from "@tiptap/pm/state";
|
|
4
4
|
import { Slice } from "@tiptap/pm/model";
|
|
5
5
|
import { useEditor, EditorContent } from "@tiptap/react";
|
|
@@ -3757,7 +3757,7 @@ var BaseLegacyFigure = Image3.extend({
|
|
|
3757
3757
|
|
|
3758
3758
|
// src/extensions/views/node-views/callout.tsx
|
|
3759
3759
|
import { NodeViewContent, NodeViewWrapper } from "@tiptap/react";
|
|
3760
|
-
import { useState as
|
|
3760
|
+
import { useState as useState11 } from "react";
|
|
3761
3761
|
|
|
3762
3762
|
// src/icons/color/TiptapCalloutError.tsx
|
|
3763
3763
|
import { jsx as jsx71, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
@@ -4347,6 +4347,7 @@ var PromptContent = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ jsx8
|
|
|
4347
4347
|
) });
|
|
4348
4348
|
|
|
4349
4349
|
// src/extensions/views/components/table.tsx
|
|
4350
|
+
import { useEffect as useEffect8, useRef as useRef10, useState as useState10 } from "react";
|
|
4350
4351
|
import { jsx as jsx82, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
4351
4352
|
|
|
4352
4353
|
// src/extensions/views/components/video.tsx
|
|
@@ -4382,13 +4383,13 @@ var Video = ({ src, children }) => {
|
|
|
4382
4383
|
};
|
|
4383
4384
|
|
|
4384
4385
|
// src/editor/controls/emoji-picker.tsx
|
|
4385
|
-
import { useEffect as
|
|
4386
|
+
import { useEffect as useEffect9, useRef as useRef11 } from "react";
|
|
4386
4387
|
import EmojiPicker from "emoji-picker-react";
|
|
4387
4388
|
import { jsx as jsx84 } from "react/jsx-runtime";
|
|
4388
4389
|
var EmojiPickerComponent = ({ isOpen, onClose, onEmojiSelect }) => {
|
|
4389
|
-
const pickerRef =
|
|
4390
|
+
const pickerRef = useRef11(null);
|
|
4390
4391
|
const translations2 = useTiptapTranslations();
|
|
4391
|
-
|
|
4392
|
+
useEffect9(() => {
|
|
4392
4393
|
const handleClickOutside = (event) => {
|
|
4393
4394
|
if (pickerRef.current && !pickerRef.current.contains(event.target)) {
|
|
4394
4395
|
onClose();
|
|
@@ -4437,7 +4438,7 @@ var CalloutView = (props) => {
|
|
|
4437
4438
|
const type = props.node.attrs.type || "info";
|
|
4438
4439
|
const bgColor = props.node.attrs.bgColor;
|
|
4439
4440
|
const emoji = props.node.attrs.emoji;
|
|
4440
|
-
const [showEmojiPicker, setShowEmojiPicker] =
|
|
4441
|
+
const [showEmojiPicker, setShowEmojiPicker] = useState11(false);
|
|
4441
4442
|
const handleIconClick = (e) => {
|
|
4442
4443
|
e.preventDefault();
|
|
4443
4444
|
e.stopPropagation();
|
|
@@ -4478,11 +4479,11 @@ var CalloutView = (props) => {
|
|
|
4478
4479
|
};
|
|
4479
4480
|
|
|
4480
4481
|
// src/extensions/views/node-views/code-block.tsx
|
|
4481
|
-
import { useState as
|
|
4482
|
+
import { useState as useState12 } from "react";
|
|
4482
4483
|
import { NodeViewContent as NodeViewContent2, NodeViewWrapper as NodeViewWrapper2 } from "@tiptap/react";
|
|
4483
4484
|
import { jsx as jsx86 } from "react/jsx-runtime";
|
|
4484
4485
|
var CodeBlockView = (props) => {
|
|
4485
|
-
const [selectedLanguage, setSelectedLanguage] =
|
|
4486
|
+
const [selectedLanguage, setSelectedLanguage] = useState12(props.node.attrs.language ?? "");
|
|
4486
4487
|
const translations2 = useTiptapTranslations();
|
|
4487
4488
|
const handleLanguageChange = (language) => {
|
|
4488
4489
|
props.updateAttributes({ language });
|
|
@@ -6072,12 +6073,12 @@ function TiptapContent({
|
|
|
6072
6073
|
lang,
|
|
6073
6074
|
error
|
|
6074
6075
|
}) {
|
|
6075
|
-
const [linkDialogContext, setLinkDialogContext] =
|
|
6076
|
-
const [katexDialogContext, setKatexDialogContext] =
|
|
6076
|
+
const [linkDialogContext, setLinkDialogContext] = useState13(null);
|
|
6077
|
+
const [katexDialogContext, setKatexDialogContext] = useState13(
|
|
6077
6078
|
null
|
|
6078
6079
|
);
|
|
6079
|
-
const [editFigureContext, setEditFigureContext] =
|
|
6080
|
-
const [savedDialogCursorPos, setSavedDialogCursorPos] =
|
|
6080
|
+
const [editFigureContext, setEditFigureContext] = useState13(null);
|
|
6081
|
+
const [savedDialogCursorPos, setSavedDialogCursorPos] = useState13(void 0);
|
|
6081
6082
|
const { activeDialog, closeDialogCommand, openDialogCommand } = useDialogCommand();
|
|
6082
6083
|
const translations2 = useTiptapTranslations();
|
|
6083
6084
|
let safeContent;
|
|
@@ -6128,7 +6129,7 @@ function TiptapContent({
|
|
|
6128
6129
|
},
|
|
6129
6130
|
[lang]
|
|
6130
6131
|
);
|
|
6131
|
-
|
|
6132
|
+
useEffect10(() => {
|
|
6132
6133
|
if (activeDialog && editor && !editor.isDestroyed) {
|
|
6133
6134
|
const pos = editor.state.selection.from;
|
|
6134
6135
|
setSavedDialogCursorPos(pos);
|
|
@@ -6155,7 +6156,7 @@ function TiptapContent({
|
|
|
6155
6156
|
const katexHandler = createHandleKatexAdd(editor, handleCloseDialog, savedDialogCursorPos);
|
|
6156
6157
|
katexHandler(latex, katexDialogContext?.pos);
|
|
6157
6158
|
};
|
|
6158
|
-
|
|
6159
|
+
useEffect10(() => {
|
|
6159
6160
|
if (!editor || editor.isDestroyed) return;
|
|
6160
6161
|
editor.commands.setContent(safeContent, {
|
|
6161
6162
|
emitUpdate: false
|