@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.js
CHANGED
|
@@ -35,10 +35,10 @@ __export(editor_exports, {
|
|
|
35
35
|
module.exports = __toCommonJS(editor_exports);
|
|
36
36
|
|
|
37
37
|
// src/editor/editor.tsx
|
|
38
|
-
var
|
|
38
|
+
var import_react37 = require("react");
|
|
39
39
|
var import_state6 = require("@tiptap/pm/state");
|
|
40
40
|
var import_model = require("@tiptap/pm/model");
|
|
41
|
-
var
|
|
41
|
+
var import_react38 = require("@tiptap/react");
|
|
42
42
|
var import_menus = require("@tiptap/react/menus");
|
|
43
43
|
var import_github_dark = require("highlight.js/styles/github-dark.css");
|
|
44
44
|
var import_katex_min = require("katex/dist/katex.min.css");
|
|
@@ -2657,7 +2657,7 @@ var import_extension_mathematics = require("@tiptap/extension-mathematics");
|
|
|
2657
2657
|
var import_extension_table = require("@tiptap/extension-table");
|
|
2658
2658
|
|
|
2659
2659
|
// src/extensions/editor/callout.ts
|
|
2660
|
-
var
|
|
2660
|
+
var import_react29 = require("@tiptap/react");
|
|
2661
2661
|
|
|
2662
2662
|
// src/utils/handle-exit-node.ts
|
|
2663
2663
|
var import_state = require("@tiptap/pm/state");
|
|
@@ -3792,8 +3792,8 @@ var BaseLegacyFigure = import_extension_image2.default.extend({
|
|
|
3792
3792
|
});
|
|
3793
3793
|
|
|
3794
3794
|
// src/extensions/views/node-views/callout.tsx
|
|
3795
|
-
var
|
|
3796
|
-
var
|
|
3795
|
+
var import_react20 = require("@tiptap/react");
|
|
3796
|
+
var import_react21 = require("react");
|
|
3797
3797
|
|
|
3798
3798
|
// src/icons/color/TiptapCalloutError.tsx
|
|
3799
3799
|
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
@@ -4383,6 +4383,7 @@ var PromptContent = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ (0,
|
|
|
4383
4383
|
) });
|
|
4384
4384
|
|
|
4385
4385
|
// src/extensions/views/components/table.tsx
|
|
4386
|
+
var import_react18 = require("react");
|
|
4386
4387
|
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
4387
4388
|
|
|
4388
4389
|
// src/extensions/views/components/video.tsx
|
|
@@ -4418,13 +4419,13 @@ var Video = ({ src, children }) => {
|
|
|
4418
4419
|
};
|
|
4419
4420
|
|
|
4420
4421
|
// src/editor/controls/emoji-picker.tsx
|
|
4421
|
-
var
|
|
4422
|
+
var import_react19 = require("react");
|
|
4422
4423
|
var import_emoji_picker_react = __toESM(require("emoji-picker-react"));
|
|
4423
4424
|
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
4424
4425
|
var EmojiPickerComponent = ({ isOpen, onClose, onEmojiSelect }) => {
|
|
4425
|
-
const pickerRef = (0,
|
|
4426
|
+
const pickerRef = (0, import_react19.useRef)(null);
|
|
4426
4427
|
const translations2 = useTiptapTranslations();
|
|
4427
|
-
(0,
|
|
4428
|
+
(0, import_react19.useEffect)(() => {
|
|
4428
4429
|
const handleClickOutside = (event) => {
|
|
4429
4430
|
if (pickerRef.current && !pickerRef.current.contains(event.target)) {
|
|
4430
4431
|
onClose();
|
|
@@ -4473,7 +4474,7 @@ var CalloutView = (props) => {
|
|
|
4473
4474
|
const type = props.node.attrs.type || "info";
|
|
4474
4475
|
const bgColor = props.node.attrs.bgColor;
|
|
4475
4476
|
const emoji = props.node.attrs.emoji;
|
|
4476
|
-
const [showEmojiPicker, setShowEmojiPicker] = (0,
|
|
4477
|
+
const [showEmojiPicker, setShowEmojiPicker] = (0, import_react21.useState)(false);
|
|
4477
4478
|
const handleIconClick = (e) => {
|
|
4478
4479
|
e.preventDefault();
|
|
4479
4480
|
e.stopPropagation();
|
|
@@ -4483,7 +4484,7 @@ var CalloutView = (props) => {
|
|
|
4483
4484
|
props.updateAttributes({ emoji: newEmoji });
|
|
4484
4485
|
setShowEmojiPicker(false);
|
|
4485
4486
|
};
|
|
4486
|
-
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
4487
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react20.NodeViewWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
4487
4488
|
Callout,
|
|
4488
4489
|
{
|
|
4489
4490
|
type,
|
|
@@ -4508,86 +4509,86 @@ var CalloutView = (props) => {
|
|
|
4508
4509
|
}
|
|
4509
4510
|
)
|
|
4510
4511
|
] }),
|
|
4511
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
4512
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react20.NodeViewContent, { as: "div" })
|
|
4512
4513
|
}
|
|
4513
4514
|
) });
|
|
4514
4515
|
};
|
|
4515
4516
|
|
|
4516
4517
|
// src/extensions/views/node-views/code-block.tsx
|
|
4517
|
-
var
|
|
4518
|
-
var
|
|
4518
|
+
var import_react22 = require("react");
|
|
4519
|
+
var import_react23 = require("@tiptap/react");
|
|
4519
4520
|
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
4520
4521
|
var CodeBlockView = (props) => {
|
|
4521
|
-
const [selectedLanguage, setSelectedLanguage] = (0,
|
|
4522
|
+
const [selectedLanguage, setSelectedLanguage] = (0, import_react22.useState)(props.node.attrs.language ?? "");
|
|
4522
4523
|
const translations2 = useTiptapTranslations();
|
|
4523
4524
|
const handleLanguageChange = (language) => {
|
|
4524
4525
|
props.updateAttributes({ language });
|
|
4525
4526
|
setSelectedLanguage(language);
|
|
4526
4527
|
};
|
|
4527
|
-
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
4528
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_react23.NodeViewWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
4528
4529
|
CodeBlock,
|
|
4529
4530
|
{
|
|
4530
4531
|
language: selectedLanguage,
|
|
4531
4532
|
isEditable: props.editor.isEditable,
|
|
4532
4533
|
onLanguageChange: handleLanguageChange,
|
|
4533
4534
|
translations: translations2,
|
|
4534
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
4535
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_react23.NodeViewContent, {})
|
|
4535
4536
|
}
|
|
4536
4537
|
) });
|
|
4537
4538
|
};
|
|
4538
4539
|
|
|
4539
4540
|
// src/extensions/views/node-views/copyable-text.tsx
|
|
4540
|
-
var
|
|
4541
|
+
var import_react24 = require("@tiptap/react");
|
|
4541
4542
|
var import_jsx_runtime87 = require("react/jsx-runtime");
|
|
4542
4543
|
var CopyableTextView = () => {
|
|
4543
|
-
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(CopyableText2, { children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
4544
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(CopyableText2, { children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_react24.MarkViewContent, {}) });
|
|
4544
4545
|
};
|
|
4545
4546
|
|
|
4546
4547
|
// src/extensions/views/node-views/custom-quote.tsx
|
|
4547
|
-
var
|
|
4548
|
+
var import_react25 = require("@tiptap/react");
|
|
4548
4549
|
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
4549
4550
|
var CustomQuoteView = () => {
|
|
4550
|
-
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
4551
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_react25.NodeViewWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(CustomQuote, { children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_react25.NodeViewContent, {}) }) });
|
|
4551
4552
|
};
|
|
4552
4553
|
var CustomQuoteTextView = (props) => {
|
|
4553
4554
|
const isEmpty = !props.node.content.size;
|
|
4554
4555
|
const translations2 = useTiptapTranslations();
|
|
4555
|
-
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
4556
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_react25.NodeViewWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
4556
4557
|
CustomQuoteText,
|
|
4557
4558
|
{
|
|
4558
4559
|
isEmpty,
|
|
4559
4560
|
placeholder: translations2.customQuote.textPlaceholder,
|
|
4560
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
4561
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_react25.NodeViewContent, { className: isEmpty ? "is-empty" : "" })
|
|
4561
4562
|
}
|
|
4562
4563
|
) });
|
|
4563
4564
|
};
|
|
4564
4565
|
var CustomQuoteAuthorView = (props) => {
|
|
4565
4566
|
const isEmpty = !props.node.content.size;
|
|
4566
4567
|
const translations2 = useTiptapTranslations();
|
|
4567
|
-
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
4568
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_react25.NodeViewWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
4568
4569
|
CustomQuoteAuthor,
|
|
4569
4570
|
{
|
|
4570
4571
|
isEmpty,
|
|
4571
4572
|
placeholder: translations2.customQuote.authorPlaceholder,
|
|
4572
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
4573
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_react25.NodeViewContent, { className: isEmpty ? "is-empty" : "" })
|
|
4573
4574
|
}
|
|
4574
4575
|
) });
|
|
4575
4576
|
};
|
|
4576
4577
|
var CustomQuoteSignView = (props) => {
|
|
4577
4578
|
const isEmpty = !props.node.content.size;
|
|
4578
4579
|
const translations2 = useTiptapTranslations();
|
|
4579
|
-
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
4580
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_react25.NodeViewWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
4580
4581
|
CustomQuoteSign,
|
|
4581
4582
|
{
|
|
4582
4583
|
isEmpty,
|
|
4583
4584
|
placeholder: translations2.customQuote.signPlaceholder,
|
|
4584
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
4585
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_react25.NodeViewContent, { className: isEmpty ? "is-empty" : "" })
|
|
4585
4586
|
}
|
|
4586
4587
|
) });
|
|
4587
4588
|
};
|
|
4588
4589
|
|
|
4589
4590
|
// src/extensions/views/node-views/figure.tsx
|
|
4590
|
-
var
|
|
4591
|
+
var import_react26 = require("@tiptap/react");
|
|
4591
4592
|
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
4592
4593
|
var FigureView = ({ node, getPos, editor }) => {
|
|
4593
4594
|
const { fileId, src, alt, title, caption, width, height, storageKey } = node.attrs;
|
|
@@ -4598,7 +4599,7 @@ var FigureView = ({ node, getPos, editor }) => {
|
|
|
4598
4599
|
onFigureClick?.(node.attrs, getPos());
|
|
4599
4600
|
};
|
|
4600
4601
|
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
4601
|
-
|
|
4602
|
+
import_react26.NodeViewWrapper,
|
|
4602
4603
|
{
|
|
4603
4604
|
className: "figure-node-view",
|
|
4604
4605
|
"data-drag-handle": true,
|
|
@@ -4622,40 +4623,40 @@ var FigureView = ({ node, getPos, editor }) => {
|
|
|
4622
4623
|
};
|
|
4623
4624
|
|
|
4624
4625
|
// src/extensions/views/node-views/prompt.tsx
|
|
4625
|
-
var
|
|
4626
|
+
var import_react27 = require("@tiptap/react");
|
|
4626
4627
|
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
4627
4628
|
var PromptHeaderView = (props) => {
|
|
4628
4629
|
const isEmpty = !props.node.content.size;
|
|
4629
4630
|
const translations2 = useTiptapTranslations();
|
|
4630
|
-
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
4631
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_react27.NodeViewWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
4631
4632
|
PromptHeader,
|
|
4632
4633
|
{
|
|
4633
4634
|
isEmpty,
|
|
4634
4635
|
placeholder: translations2.prompt.headerPlaceholder,
|
|
4635
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
4636
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_react27.NodeViewContent, { className: isEmpty ? "is-empty" : "" })
|
|
4636
4637
|
}
|
|
4637
4638
|
) });
|
|
4638
4639
|
};
|
|
4639
4640
|
var PromptContentView = (props) => {
|
|
4640
4641
|
const isEmpty = !props.node.content.size;
|
|
4641
4642
|
const translations2 = useTiptapTranslations();
|
|
4642
|
-
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
4643
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_react27.NodeViewWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
4643
4644
|
PromptContent,
|
|
4644
4645
|
{
|
|
4645
4646
|
isEmpty,
|
|
4646
4647
|
placeholder: translations2.prompt.contentPlaceholder,
|
|
4647
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
4648
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_react27.NodeViewContent, { className: isEmpty ? "is-empty" : "" })
|
|
4648
4649
|
}
|
|
4649
4650
|
) });
|
|
4650
4651
|
};
|
|
4651
4652
|
|
|
4652
4653
|
// src/extensions/views/node-views/video.tsx
|
|
4653
|
-
var
|
|
4654
|
+
var import_react28 = require("@tiptap/react");
|
|
4654
4655
|
var import_jsx_runtime91 = require("react/jsx-runtime");
|
|
4655
4656
|
var VideoView = (props) => {
|
|
4656
4657
|
const { src } = props.node.attrs;
|
|
4657
|
-
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
4658
|
-
|
|
4658
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_react28.NodeViewWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Video, { src, children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
4659
|
+
import_react28.NodeViewContent,
|
|
4659
4660
|
{
|
|
4660
4661
|
as: "div",
|
|
4661
4662
|
className: "video-content"
|
|
@@ -4666,66 +4667,66 @@ var VideoView = (props) => {
|
|
|
4666
4667
|
// src/extensions/editor/callout.ts
|
|
4667
4668
|
var Callout2 = BaseCallout.extend({
|
|
4668
4669
|
addNodeView() {
|
|
4669
|
-
return (0,
|
|
4670
|
+
return (0, import_react29.ReactNodeViewRenderer)(CalloutView);
|
|
4670
4671
|
}
|
|
4671
4672
|
});
|
|
4672
4673
|
var LegacyBookAlert = BaseLegacyBookAlert.extend({
|
|
4673
4674
|
addNodeView() {
|
|
4674
|
-
return (0,
|
|
4675
|
+
return (0, import_react29.ReactNodeViewRenderer)(CalloutView);
|
|
4675
4676
|
}
|
|
4676
4677
|
});
|
|
4677
4678
|
var LegacyBookTip = BaseLegacyBookTip.extend({
|
|
4678
4679
|
addNodeView() {
|
|
4679
|
-
return (0,
|
|
4680
|
+
return (0, import_react29.ReactNodeViewRenderer)(CalloutView);
|
|
4680
4681
|
}
|
|
4681
4682
|
});
|
|
4682
4683
|
|
|
4683
4684
|
// src/extensions/editor/code-block.ts
|
|
4684
|
-
var
|
|
4685
|
+
var import_react30 = require("@tiptap/react");
|
|
4685
4686
|
var CodeBlock2 = BaseCodeBlock.extend({
|
|
4686
4687
|
addNodeView() {
|
|
4687
|
-
return (0,
|
|
4688
|
+
return (0, import_react30.ReactNodeViewRenderer)(CodeBlockView);
|
|
4688
4689
|
}
|
|
4689
4690
|
});
|
|
4690
4691
|
|
|
4691
4692
|
// src/extensions/editor/custom-quote.ts
|
|
4692
|
-
var
|
|
4693
|
+
var import_react31 = require("@tiptap/react");
|
|
4693
4694
|
var CustomQuote2 = BaseCustomQuote.extend({
|
|
4694
4695
|
addNodeView() {
|
|
4695
|
-
return (0,
|
|
4696
|
+
return (0, import_react31.ReactNodeViewRenderer)(CustomQuoteView);
|
|
4696
4697
|
}
|
|
4697
4698
|
});
|
|
4698
4699
|
var CustomQuoteText2 = BaseCustomQuoteText.extend({
|
|
4699
4700
|
addNodeView() {
|
|
4700
|
-
return (0,
|
|
4701
|
+
return (0, import_react31.ReactNodeViewRenderer)(CustomQuoteTextView);
|
|
4701
4702
|
}
|
|
4702
4703
|
});
|
|
4703
4704
|
var CustomQuoteAuthor2 = BaseCustomQuoteAuthor.extend({
|
|
4704
4705
|
addNodeView() {
|
|
4705
|
-
return (0,
|
|
4706
|
+
return (0, import_react31.ReactNodeViewRenderer)(CustomQuoteAuthorView);
|
|
4706
4707
|
}
|
|
4707
4708
|
});
|
|
4708
4709
|
var CustomQuoteSign2 = BaseCustomQuoteSign.extend({
|
|
4709
4710
|
addNodeView() {
|
|
4710
|
-
return (0,
|
|
4711
|
+
return (0, import_react31.ReactNodeViewRenderer)(CustomQuoteSignView);
|
|
4711
4712
|
}
|
|
4712
4713
|
});
|
|
4713
4714
|
var LegacySEQuote = BaseLegacySEQuote.extend({
|
|
4714
4715
|
addNodeView() {
|
|
4715
|
-
return (0,
|
|
4716
|
+
return (0, import_react31.ReactNodeViewRenderer)(CustomQuoteView);
|
|
4716
4717
|
}
|
|
4717
4718
|
});
|
|
4718
4719
|
|
|
4719
4720
|
// src/extensions/editor/video.ts
|
|
4720
|
-
var
|
|
4721
|
+
var import_react32 = require("@tiptap/react");
|
|
4721
4722
|
var Video2 = BaseVideo.extend({
|
|
4722
4723
|
addNodeView() {
|
|
4723
|
-
return (0,
|
|
4724
|
+
return (0, import_react32.ReactNodeViewRenderer)(VideoView);
|
|
4724
4725
|
}
|
|
4725
4726
|
});
|
|
4726
4727
|
var LegacyYouTube = BaseLegacyYouTube.extend({
|
|
4727
4728
|
addNodeView() {
|
|
4728
|
-
return (0,
|
|
4729
|
+
return (0, import_react32.ReactNodeViewRenderer)(VideoView);
|
|
4729
4730
|
}
|
|
4730
4731
|
});
|
|
4731
4732
|
|
|
@@ -5141,46 +5142,46 @@ function getSharedExtensions() {
|
|
|
5141
5142
|
}
|
|
5142
5143
|
|
|
5143
5144
|
// src/extensions/editor/copyable-text.ts
|
|
5144
|
-
var
|
|
5145
|
+
var import_react33 = require("@tiptap/react");
|
|
5145
5146
|
var CopyableText3 = CopyableText.extend({
|
|
5146
5147
|
addMarkView() {
|
|
5147
|
-
return (0,
|
|
5148
|
+
return (0, import_react33.ReactMarkViewRenderer)(CopyableTextView);
|
|
5148
5149
|
}
|
|
5149
5150
|
});
|
|
5150
5151
|
|
|
5151
5152
|
// src/extensions/editor/prompt.ts
|
|
5152
|
-
var
|
|
5153
|
+
var import_react34 = require("@tiptap/react");
|
|
5153
5154
|
var PromptHeader2 = BasePromptHeader.extend({
|
|
5154
5155
|
addNodeView() {
|
|
5155
|
-
return (0,
|
|
5156
|
+
return (0, import_react34.ReactNodeViewRenderer)(PromptHeaderView);
|
|
5156
5157
|
}
|
|
5157
5158
|
});
|
|
5158
5159
|
var PromptContent2 = BasePromptContent.extend({
|
|
5159
5160
|
addNodeView() {
|
|
5160
|
-
return (0,
|
|
5161
|
+
return (0, import_react34.ReactNodeViewRenderer)(PromptContentView);
|
|
5161
5162
|
}
|
|
5162
5163
|
});
|
|
5163
5164
|
var LegacyPromptSEHeader = BaseLegacyPromptSEHeader.extend({
|
|
5164
5165
|
addNodeView() {
|
|
5165
|
-
return (0,
|
|
5166
|
+
return (0, import_react34.ReactNodeViewRenderer)(PromptHeaderView);
|
|
5166
5167
|
}
|
|
5167
5168
|
});
|
|
5168
5169
|
var LegacyPromptSEContent = BaseLegacyPromptSEContent.extend({
|
|
5169
5170
|
addNodeView() {
|
|
5170
|
-
return (0,
|
|
5171
|
+
return (0, import_react34.ReactNodeViewRenderer)(PromptContentView);
|
|
5171
5172
|
}
|
|
5172
5173
|
});
|
|
5173
5174
|
|
|
5174
5175
|
// src/extensions/editor/figure.ts
|
|
5175
|
-
var
|
|
5176
|
+
var import_react35 = require("@tiptap/react");
|
|
5176
5177
|
var Figure2 = BaseFigure.extend({
|
|
5177
5178
|
addNodeView() {
|
|
5178
|
-
return (0,
|
|
5179
|
+
return (0, import_react35.ReactNodeViewRenderer)(FigureView);
|
|
5179
5180
|
}
|
|
5180
5181
|
});
|
|
5181
5182
|
var LegacyFigure = BaseLegacyFigure.extend({
|
|
5182
5183
|
addNodeView() {
|
|
5183
|
-
return (0,
|
|
5184
|
+
return (0, import_react35.ReactNodeViewRenderer)(FigureView);
|
|
5184
5185
|
}
|
|
5185
5186
|
});
|
|
5186
5187
|
|
|
@@ -5352,7 +5353,7 @@ var createHandleKatexAdd = (editor, closeDialogCommand, savedPos) => {
|
|
|
5352
5353
|
// src/editor/commands/suggestion.tsx
|
|
5353
5354
|
var import_dom = require("@floating-ui/dom");
|
|
5354
5355
|
var import_core17 = require("@tiptap/core");
|
|
5355
|
-
var
|
|
5356
|
+
var import_react36 = require("@tiptap/react");
|
|
5356
5357
|
|
|
5357
5358
|
// src/editor/commands/items.ts
|
|
5358
5359
|
var getCommandItems = (translations2, hasImageHandlers) => [
|
|
@@ -5685,7 +5686,7 @@ var createSuggestions = (translations2, hasImageHandlers) => ({
|
|
|
5685
5686
|
render: () => {
|
|
5686
5687
|
return {
|
|
5687
5688
|
onStart: async (props) => {
|
|
5688
|
-
component = new
|
|
5689
|
+
component = new import_react36.ReactRenderer(CommandsList, {
|
|
5689
5690
|
props,
|
|
5690
5691
|
editor: props.editor
|
|
5691
5692
|
});
|
|
@@ -6108,12 +6109,12 @@ function TiptapContent({
|
|
|
6108
6109
|
lang,
|
|
6109
6110
|
error
|
|
6110
6111
|
}) {
|
|
6111
|
-
const [linkDialogContext, setLinkDialogContext] = (0,
|
|
6112
|
-
const [katexDialogContext, setKatexDialogContext] = (0,
|
|
6112
|
+
const [linkDialogContext, setLinkDialogContext] = (0, import_react37.useState)(null);
|
|
6113
|
+
const [katexDialogContext, setKatexDialogContext] = (0, import_react37.useState)(
|
|
6113
6114
|
null
|
|
6114
6115
|
);
|
|
6115
|
-
const [editFigureContext, setEditFigureContext] = (0,
|
|
6116
|
-
const [savedDialogCursorPos, setSavedDialogCursorPos] = (0,
|
|
6116
|
+
const [editFigureContext, setEditFigureContext] = (0, import_react37.useState)(null);
|
|
6117
|
+
const [savedDialogCursorPos, setSavedDialogCursorPos] = (0, import_react37.useState)(void 0);
|
|
6117
6118
|
const { activeDialog, closeDialogCommand, openDialogCommand } = useDialogCommand();
|
|
6118
6119
|
const translations2 = useTiptapTranslations();
|
|
6119
6120
|
let safeContent;
|
|
@@ -6122,7 +6123,7 @@ function TiptapContent({
|
|
|
6122
6123
|
} catch {
|
|
6123
6124
|
safeContent = { type: "doc", content: [{ type: "paragraph" }] };
|
|
6124
6125
|
}
|
|
6125
|
-
const editor = (0,
|
|
6126
|
+
const editor = (0, import_react38.useEditor)(
|
|
6126
6127
|
{
|
|
6127
6128
|
editable: isEditable && !isDisabled,
|
|
6128
6129
|
extensions: getEditorExtensions({
|
|
@@ -6164,7 +6165,7 @@ function TiptapContent({
|
|
|
6164
6165
|
},
|
|
6165
6166
|
[lang]
|
|
6166
6167
|
);
|
|
6167
|
-
(0,
|
|
6168
|
+
(0, import_react37.useEffect)(() => {
|
|
6168
6169
|
if (activeDialog && editor && !editor.isDestroyed) {
|
|
6169
6170
|
const pos = editor.state.selection.from;
|
|
6170
6171
|
setSavedDialogCursorPos(pos);
|
|
@@ -6191,7 +6192,7 @@ function TiptapContent({
|
|
|
6191
6192
|
const katexHandler = createHandleKatexAdd(editor, handleCloseDialog, savedDialogCursorPos);
|
|
6192
6193
|
katexHandler(latex, katexDialogContext?.pos);
|
|
6193
6194
|
};
|
|
6194
|
-
(0,
|
|
6195
|
+
(0, import_react37.useEffect)(() => {
|
|
6195
6196
|
if (!editor || editor.isDestroyed) return;
|
|
6196
6197
|
editor.commands.setContent(safeContent, {
|
|
6197
6198
|
emitUpdate: false
|
|
@@ -6233,7 +6234,7 @@ function TiptapContent({
|
|
|
6233
6234
|
{
|
|
6234
6235
|
className: `tiptap-content-wrapper ${!!error ? "has-error" : ""} ${isDisabled ? "is-disabled" : ""}`,
|
|
6235
6236
|
children: [
|
|
6236
|
-
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
6237
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_react38.EditorContent, { editor }),
|
|
6237
6238
|
isEditable && !isDisabled && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(CharacterCount, { editor })
|
|
6238
6239
|
]
|
|
6239
6240
|
}
|