tetrons 2.3.54 → 2.3.56
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/app/api/ai-action/route.cjs +34 -9
- package/dist/app/api/export/route.cjs +29 -4
- package/dist/app/api/register/route.cjs +76 -14
- package/dist/app/api/register/route.mjs +32 -5
- package/dist/app/api/save/route.cjs +48 -13
- package/dist/app/api/transcribe/route.cjs +38 -12
- package/dist/app/api/validate/route.cjs +79 -14
- package/dist/app/api/validate/route.mjs +34 -5
- package/dist/index.node.cjs +17073 -0
- package/dist/{index.cjs → index.node.mjs} +433 -433
- package/package.json +9 -10
- package/dist/app/api/ai-action/route.d.mts +0 -9
- package/dist/app/api/ai-action/route.d.ts +0 -9
- package/dist/app/api/export/route.d.mts +0 -3
- package/dist/app/api/export/route.d.ts +0 -3
- package/dist/app/api/register/route.d.mts +0 -10
- package/dist/app/api/register/route.d.ts +0 -10
- package/dist/app/api/save/route.d.mts +0 -9
- package/dist/app/api/save/route.d.ts +0 -9
- package/dist/app/api/transcribe/route.d.mts +0 -10
- package/dist/app/api/transcribe/route.d.ts +0 -10
- package/dist/app/api/validate/route.d.mts +0 -13
- package/dist/app/api/validate/route.d.ts +0 -13
- package/dist/chunk-37LFEKRW.cjs +0 -36
- package/dist/chunk-M2F2EU6B.mjs +0 -36
- package/dist/index.d.ts +0 -13
- /package/dist/{index.mjs → index.browser.js} +0 -0
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
// src/components/tetrons/EditorContent.tsx
|
|
2
|
+
import React14, { useEffect as useEffect8, useRef as useRef7, useState as useState9 } from "react";
|
|
3
|
+
import {
|
|
4
|
+
useEditor,
|
|
5
|
+
EditorContent as TiptapEditorContent
|
|
6
|
+
} from "@tiptap/react";
|
|
7
7
|
|
|
8
8
|
// node_modules/@tiptap/extension-document/dist/index.js
|
|
9
|
-
|
|
10
|
-
var Document =
|
|
9
|
+
import { Node } from "@tiptap/core";
|
|
10
|
+
var Document = Node.create({
|
|
11
11
|
name: "doc",
|
|
12
12
|
topNode: true,
|
|
13
13
|
content: "block+"
|
|
14
14
|
});
|
|
15
15
|
|
|
16
16
|
// node_modules/@tiptap/extension-paragraph/dist/index.js
|
|
17
|
-
|
|
18
|
-
var Paragraph =
|
|
17
|
+
import { Node as Node2, mergeAttributes } from "@tiptap/core";
|
|
18
|
+
var Paragraph = Node2.create({
|
|
19
19
|
name: "paragraph",
|
|
20
20
|
priority: 1e3,
|
|
21
21
|
addOptions() {
|
|
@@ -31,7 +31,7 @@ var Paragraph = _core.Node.create({
|
|
|
31
31
|
];
|
|
32
32
|
},
|
|
33
33
|
renderHTML({ HTMLAttributes }) {
|
|
34
|
-
return ["p",
|
|
34
|
+
return ["p", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
|
|
35
35
|
},
|
|
36
36
|
addCommands() {
|
|
37
37
|
return {
|
|
@@ -48,14 +48,14 @@ var Paragraph = _core.Node.create({
|
|
|
48
48
|
});
|
|
49
49
|
|
|
50
50
|
// node_modules/@tiptap/extension-text/dist/index.js
|
|
51
|
-
|
|
52
|
-
var Text =
|
|
51
|
+
import { Node as Node3 } from "@tiptap/core";
|
|
52
|
+
var Text = Node3.create({
|
|
53
53
|
name: "text",
|
|
54
54
|
group: "inline"
|
|
55
55
|
});
|
|
56
56
|
|
|
57
57
|
// node_modules/@tiptap/extension-history/dist/index.js
|
|
58
|
-
|
|
58
|
+
import { Extension } from "@tiptap/core";
|
|
59
59
|
|
|
60
60
|
// node_modules/rope-sequence/dist/index.js
|
|
61
61
|
var GOOD_LEAF_SIZE = 200;
|
|
@@ -5675,7 +5675,7 @@ var undoNoScroll = buildCommand(false, false);
|
|
|
5675
5675
|
var redoNoScroll = buildCommand(true, false);
|
|
5676
5676
|
|
|
5677
5677
|
// node_modules/@tiptap/extension-history/dist/index.js
|
|
5678
|
-
var History =
|
|
5678
|
+
var History = Extension.create({
|
|
5679
5679
|
name: "history",
|
|
5680
5680
|
addOptions() {
|
|
5681
5681
|
return {
|
|
@@ -5711,12 +5711,12 @@ var History = _core.Extension.create({
|
|
|
5711
5711
|
});
|
|
5712
5712
|
|
|
5713
5713
|
// node_modules/@tiptap/extension-bold/dist/index.js
|
|
5714
|
-
|
|
5714
|
+
import { Mark as Mark2, mergeAttributes as mergeAttributes2, markInputRule, markPasteRule } from "@tiptap/core";
|
|
5715
5715
|
var starInputRegex = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/;
|
|
5716
5716
|
var starPasteRegex = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g;
|
|
5717
5717
|
var underscoreInputRegex = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/;
|
|
5718
5718
|
var underscorePasteRegex = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g;
|
|
5719
|
-
var Bold =
|
|
5719
|
+
var Bold = Mark2.create({
|
|
5720
5720
|
name: "bold",
|
|
5721
5721
|
addOptions() {
|
|
5722
5722
|
return {
|
|
@@ -5743,7 +5743,7 @@ var Bold = _core.Mark.create({
|
|
|
5743
5743
|
];
|
|
5744
5744
|
},
|
|
5745
5745
|
renderHTML({ HTMLAttributes }) {
|
|
5746
|
-
return ["strong",
|
|
5746
|
+
return ["strong", mergeAttributes2(this.options.HTMLAttributes, HTMLAttributes), 0];
|
|
5747
5747
|
},
|
|
5748
5748
|
addCommands() {
|
|
5749
5749
|
return {
|
|
@@ -5766,11 +5766,11 @@ var Bold = _core.Mark.create({
|
|
|
5766
5766
|
},
|
|
5767
5767
|
addInputRules() {
|
|
5768
5768
|
return [
|
|
5769
|
-
|
|
5769
|
+
markInputRule({
|
|
5770
5770
|
find: starInputRegex,
|
|
5771
5771
|
type: this.type
|
|
5772
5772
|
}),
|
|
5773
|
-
|
|
5773
|
+
markInputRule({
|
|
5774
5774
|
find: underscoreInputRegex,
|
|
5775
5775
|
type: this.type
|
|
5776
5776
|
})
|
|
@@ -5778,11 +5778,11 @@ var Bold = _core.Mark.create({
|
|
|
5778
5778
|
},
|
|
5779
5779
|
addPasteRules() {
|
|
5780
5780
|
return [
|
|
5781
|
-
|
|
5781
|
+
markPasteRule({
|
|
5782
5782
|
find: starPasteRegex,
|
|
5783
5783
|
type: this.type
|
|
5784
5784
|
}),
|
|
5785
|
-
|
|
5785
|
+
markPasteRule({
|
|
5786
5786
|
find: underscorePasteRegex,
|
|
5787
5787
|
type: this.type
|
|
5788
5788
|
})
|
|
@@ -5791,12 +5791,12 @@ var Bold = _core.Mark.create({
|
|
|
5791
5791
|
});
|
|
5792
5792
|
|
|
5793
5793
|
// node_modules/@tiptap/extension-italic/dist/index.js
|
|
5794
|
-
|
|
5794
|
+
import { Mark as Mark3, mergeAttributes as mergeAttributes3, markInputRule as markInputRule2, markPasteRule as markPasteRule2 } from "@tiptap/core";
|
|
5795
5795
|
var starInputRegex2 = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/;
|
|
5796
5796
|
var starPasteRegex2 = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g;
|
|
5797
5797
|
var underscoreInputRegex2 = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/;
|
|
5798
5798
|
var underscorePasteRegex2 = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g;
|
|
5799
|
-
var Italic =
|
|
5799
|
+
var Italic = Mark3.create({
|
|
5800
5800
|
name: "italic",
|
|
5801
5801
|
addOptions() {
|
|
5802
5802
|
return {
|
|
@@ -5822,7 +5822,7 @@ var Italic = _core.Mark.create({
|
|
|
5822
5822
|
];
|
|
5823
5823
|
},
|
|
5824
5824
|
renderHTML({ HTMLAttributes }) {
|
|
5825
|
-
return ["em",
|
|
5825
|
+
return ["em", mergeAttributes3(this.options.HTMLAttributes, HTMLAttributes), 0];
|
|
5826
5826
|
},
|
|
5827
5827
|
addCommands() {
|
|
5828
5828
|
return {
|
|
@@ -5845,11 +5845,11 @@ var Italic = _core.Mark.create({
|
|
|
5845
5845
|
},
|
|
5846
5846
|
addInputRules() {
|
|
5847
5847
|
return [
|
|
5848
|
-
|
|
5848
|
+
markInputRule2({
|
|
5849
5849
|
find: starInputRegex2,
|
|
5850
5850
|
type: this.type
|
|
5851
5851
|
}),
|
|
5852
|
-
|
|
5852
|
+
markInputRule2({
|
|
5853
5853
|
find: underscoreInputRegex2,
|
|
5854
5854
|
type: this.type
|
|
5855
5855
|
})
|
|
@@ -5857,11 +5857,11 @@ var Italic = _core.Mark.create({
|
|
|
5857
5857
|
},
|
|
5858
5858
|
addPasteRules() {
|
|
5859
5859
|
return [
|
|
5860
|
-
|
|
5860
|
+
markPasteRule2({
|
|
5861
5861
|
find: starPasteRegex2,
|
|
5862
5862
|
type: this.type
|
|
5863
5863
|
}),
|
|
5864
|
-
|
|
5864
|
+
markPasteRule2({
|
|
5865
5865
|
find: underscorePasteRegex2,
|
|
5866
5866
|
type: this.type
|
|
5867
5867
|
})
|
|
@@ -5870,13 +5870,13 @@ var Italic = _core.Mark.create({
|
|
|
5870
5870
|
});
|
|
5871
5871
|
|
|
5872
5872
|
// src/components/tetrons/EditorContent.tsx
|
|
5873
|
-
|
|
5873
|
+
import Underline from "@tiptap/extension-underline";
|
|
5874
5874
|
|
|
5875
5875
|
// node_modules/@tiptap/extension-strike/dist/index.js
|
|
5876
|
-
|
|
5876
|
+
import { Mark as Mark4, mergeAttributes as mergeAttributes4, markInputRule as markInputRule3, markPasteRule as markPasteRule3 } from "@tiptap/core";
|
|
5877
5877
|
var inputRegex = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/;
|
|
5878
5878
|
var pasteRegex = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g;
|
|
5879
|
-
var Strike =
|
|
5879
|
+
var Strike = Mark4.create({
|
|
5880
5880
|
name: "strike",
|
|
5881
5881
|
addOptions() {
|
|
5882
5882
|
return {
|
|
@@ -5902,7 +5902,7 @@ var Strike = _core.Mark.create({
|
|
|
5902
5902
|
];
|
|
5903
5903
|
},
|
|
5904
5904
|
renderHTML({ HTMLAttributes }) {
|
|
5905
|
-
return ["s",
|
|
5905
|
+
return ["s", mergeAttributes4(this.options.HTMLAttributes, HTMLAttributes), 0];
|
|
5906
5906
|
},
|
|
5907
5907
|
addCommands() {
|
|
5908
5908
|
return {
|
|
@@ -5924,7 +5924,7 @@ var Strike = _core.Mark.create({
|
|
|
5924
5924
|
},
|
|
5925
5925
|
addInputRules() {
|
|
5926
5926
|
return [
|
|
5927
|
-
|
|
5927
|
+
markInputRule3({
|
|
5928
5928
|
find: inputRegex,
|
|
5929
5929
|
type: this.type
|
|
5930
5930
|
})
|
|
@@ -5932,7 +5932,7 @@ var Strike = _core.Mark.create({
|
|
|
5932
5932
|
},
|
|
5933
5933
|
addPasteRules() {
|
|
5934
5934
|
return [
|
|
5935
|
-
|
|
5935
|
+
markPasteRule3({
|
|
5936
5936
|
find: pasteRegex,
|
|
5937
5937
|
type: this.type
|
|
5938
5938
|
})
|
|
@@ -5941,10 +5941,10 @@ var Strike = _core.Mark.create({
|
|
|
5941
5941
|
});
|
|
5942
5942
|
|
|
5943
5943
|
// node_modules/@tiptap/extension-code/dist/index.js
|
|
5944
|
-
|
|
5944
|
+
import { Mark as Mark5, mergeAttributes as mergeAttributes5, markInputRule as markInputRule4, markPasteRule as markPasteRule4 } from "@tiptap/core";
|
|
5945
5945
|
var inputRegex2 = /(^|[^`])`([^`]+)`(?!`)/;
|
|
5946
5946
|
var pasteRegex2 = /(^|[^`])`([^`]+)`(?!`)/g;
|
|
5947
|
-
var Code =
|
|
5947
|
+
var Code = Mark5.create({
|
|
5948
5948
|
name: "code",
|
|
5949
5949
|
addOptions() {
|
|
5950
5950
|
return {
|
|
@@ -5960,7 +5960,7 @@ var Code = _core.Mark.create({
|
|
|
5960
5960
|
];
|
|
5961
5961
|
},
|
|
5962
5962
|
renderHTML({ HTMLAttributes }) {
|
|
5963
|
-
return ["code",
|
|
5963
|
+
return ["code", mergeAttributes5(this.options.HTMLAttributes, HTMLAttributes), 0];
|
|
5964
5964
|
},
|
|
5965
5965
|
addCommands() {
|
|
5966
5966
|
return {
|
|
@@ -5982,7 +5982,7 @@ var Code = _core.Mark.create({
|
|
|
5982
5982
|
},
|
|
5983
5983
|
addInputRules() {
|
|
5984
5984
|
return [
|
|
5985
|
-
|
|
5985
|
+
markInputRule4({
|
|
5986
5986
|
find: inputRegex2,
|
|
5987
5987
|
type: this.type
|
|
5988
5988
|
})
|
|
@@ -5990,7 +5990,7 @@ var Code = _core.Mark.create({
|
|
|
5990
5990
|
},
|
|
5991
5991
|
addPasteRules() {
|
|
5992
5992
|
return [
|
|
5993
|
-
|
|
5993
|
+
markPasteRule4({
|
|
5994
5994
|
find: pasteRegex2,
|
|
5995
5995
|
type: this.type
|
|
5996
5996
|
})
|
|
@@ -5999,9 +5999,9 @@ var Code = _core.Mark.create({
|
|
|
5999
5999
|
});
|
|
6000
6000
|
|
|
6001
6001
|
// node_modules/@tiptap/extension-blockquote/dist/index.js
|
|
6002
|
-
|
|
6002
|
+
import { Node as Node5, mergeAttributes as mergeAttributes6, wrappingInputRule } from "@tiptap/core";
|
|
6003
6003
|
var inputRegex3 = /^\s*>\s$/;
|
|
6004
|
-
var Blockquote =
|
|
6004
|
+
var Blockquote = Node5.create({
|
|
6005
6005
|
name: "blockquote",
|
|
6006
6006
|
addOptions() {
|
|
6007
6007
|
return {
|
|
@@ -6017,7 +6017,7 @@ var Blockquote = _core.Node.create({
|
|
|
6017
6017
|
];
|
|
6018
6018
|
},
|
|
6019
6019
|
renderHTML({ HTMLAttributes }) {
|
|
6020
|
-
return ["blockquote",
|
|
6020
|
+
return ["blockquote", mergeAttributes6(this.options.HTMLAttributes, HTMLAttributes), 0];
|
|
6021
6021
|
},
|
|
6022
6022
|
addCommands() {
|
|
6023
6023
|
return {
|
|
@@ -6039,7 +6039,7 @@ var Blockquote = _core.Node.create({
|
|
|
6039
6039
|
},
|
|
6040
6040
|
addInputRules() {
|
|
6041
6041
|
return [
|
|
6042
|
-
|
|
6042
|
+
wrappingInputRule({
|
|
6043
6043
|
find: inputRegex3,
|
|
6044
6044
|
type: this.type
|
|
6045
6045
|
})
|
|
@@ -6048,8 +6048,8 @@ var Blockquote = _core.Node.create({
|
|
|
6048
6048
|
});
|
|
6049
6049
|
|
|
6050
6050
|
// node_modules/@tiptap/extension-hard-break/dist/index.js
|
|
6051
|
-
|
|
6052
|
-
var HardBreak =
|
|
6051
|
+
import { Node as Node6, mergeAttributes as mergeAttributes7 } from "@tiptap/core";
|
|
6052
|
+
var HardBreak = Node6.create({
|
|
6053
6053
|
name: "hardBreak",
|
|
6054
6054
|
addOptions() {
|
|
6055
6055
|
return {
|
|
@@ -6067,7 +6067,7 @@ var HardBreak = _core.Node.create({
|
|
|
6067
6067
|
];
|
|
6068
6068
|
},
|
|
6069
6069
|
renderHTML({ HTMLAttributes }) {
|
|
6070
|
-
return ["br",
|
|
6070
|
+
return ["br", mergeAttributes7(this.options.HTMLAttributes, HTMLAttributes)];
|
|
6071
6071
|
},
|
|
6072
6072
|
renderText() {
|
|
6073
6073
|
return "\n";
|
|
@@ -6106,8 +6106,8 @@ var HardBreak = _core.Node.create({
|
|
|
6106
6106
|
});
|
|
6107
6107
|
|
|
6108
6108
|
// node_modules/@tiptap/extension-heading/dist/index.js
|
|
6109
|
-
|
|
6110
|
-
var Heading =
|
|
6109
|
+
import { Node as Node7, mergeAttributes as mergeAttributes8, textblockTypeInputRule } from "@tiptap/core";
|
|
6110
|
+
var Heading = Node7.create({
|
|
6111
6111
|
name: "heading",
|
|
6112
6112
|
addOptions() {
|
|
6113
6113
|
return {
|
|
@@ -6135,7 +6135,7 @@ var Heading = _core.Node.create({
|
|
|
6135
6135
|
renderHTML({ node, HTMLAttributes }) {
|
|
6136
6136
|
const hasLevel = this.options.levels.includes(node.attrs.level);
|
|
6137
6137
|
const level = hasLevel ? node.attrs.level : this.options.levels[0];
|
|
6138
|
-
return [`h${level}`,
|
|
6138
|
+
return [`h${level}`, mergeAttributes8(this.options.HTMLAttributes, HTMLAttributes), 0];
|
|
6139
6139
|
},
|
|
6140
6140
|
addCommands() {
|
|
6141
6141
|
return {
|
|
@@ -6163,7 +6163,7 @@ var Heading = _core.Node.create({
|
|
|
6163
6163
|
},
|
|
6164
6164
|
addInputRules() {
|
|
6165
6165
|
return this.options.levels.map((level) => {
|
|
6166
|
-
return
|
|
6166
|
+
return textblockTypeInputRule({
|
|
6167
6167
|
find: new RegExp(`^(#{${Math.min(...this.options.levels)},${level}})\\s$`),
|
|
6168
6168
|
type: this.type,
|
|
6169
6169
|
getAttributes: {
|
|
@@ -6175,8 +6175,8 @@ var Heading = _core.Node.create({
|
|
|
6175
6175
|
});
|
|
6176
6176
|
|
|
6177
6177
|
// node_modules/@tiptap/extension-horizontal-rule/dist/index.js
|
|
6178
|
-
|
|
6179
|
-
var HorizontalRule =
|
|
6178
|
+
import { Node as Node8, mergeAttributes as mergeAttributes9, canInsertNode, isNodeSelection, nodeInputRule } from "@tiptap/core";
|
|
6179
|
+
var HorizontalRule = Node8.create({
|
|
6180
6180
|
name: "horizontalRule",
|
|
6181
6181
|
addOptions() {
|
|
6182
6182
|
return {
|
|
@@ -6188,12 +6188,12 @@ var HorizontalRule = _core.Node.create({
|
|
|
6188
6188
|
return [{ tag: "hr" }];
|
|
6189
6189
|
},
|
|
6190
6190
|
renderHTML({ HTMLAttributes }) {
|
|
6191
|
-
return ["hr",
|
|
6191
|
+
return ["hr", mergeAttributes9(this.options.HTMLAttributes, HTMLAttributes)];
|
|
6192
6192
|
},
|
|
6193
6193
|
addCommands() {
|
|
6194
6194
|
return {
|
|
6195
6195
|
setHorizontalRule: () => ({ chain, state }) => {
|
|
6196
|
-
if (!
|
|
6196
|
+
if (!canInsertNode(state, state.schema.nodes[this.name])) {
|
|
6197
6197
|
return false;
|
|
6198
6198
|
}
|
|
6199
6199
|
const { selection } = state;
|
|
@@ -6206,7 +6206,7 @@ var HorizontalRule = _core.Node.create({
|
|
|
6206
6206
|
}, {
|
|
6207
6207
|
type: this.name
|
|
6208
6208
|
});
|
|
6209
|
-
} else if (
|
|
6209
|
+
} else if (isNodeSelection(selection)) {
|
|
6210
6210
|
currentChain.insertContentAt($originTo.pos, {
|
|
6211
6211
|
type: this.name
|
|
6212
6212
|
});
|
|
@@ -6242,7 +6242,7 @@ var HorizontalRule = _core.Node.create({
|
|
|
6242
6242
|
},
|
|
6243
6243
|
addInputRules() {
|
|
6244
6244
|
return [
|
|
6245
|
-
|
|
6245
|
+
nodeInputRule({
|
|
6246
6246
|
find: /^(?:---|—-|___\s|\*\*\*\s)$/,
|
|
6247
6247
|
type: this.type
|
|
6248
6248
|
})
|
|
@@ -6251,16 +6251,16 @@ var HorizontalRule = _core.Node.create({
|
|
|
6251
6251
|
});
|
|
6252
6252
|
|
|
6253
6253
|
// src/components/tetrons/EditorContent.tsx
|
|
6254
|
-
|
|
6255
|
-
|
|
6256
|
-
|
|
6257
|
-
|
|
6258
|
-
|
|
6259
|
-
|
|
6254
|
+
import TextAlign from "@tiptap/extension-text-align";
|
|
6255
|
+
import Color from "@tiptap/extension-color";
|
|
6256
|
+
import Highlight from "@tiptap/extension-highlight";
|
|
6257
|
+
import Image2 from "@tiptap/extension-image";
|
|
6258
|
+
import Link from "@tiptap/extension-link";
|
|
6259
|
+
import TextStyle from "@tiptap/extension-text-style";
|
|
6260
6260
|
|
|
6261
6261
|
// node_modules/@tiptap/extension-list-item/dist/index.js
|
|
6262
|
-
|
|
6263
|
-
var ListItem =
|
|
6262
|
+
import { Node as Node9, mergeAttributes as mergeAttributes10 } from "@tiptap/core";
|
|
6263
|
+
var ListItem = Node9.create({
|
|
6264
6264
|
name: "listItem",
|
|
6265
6265
|
addOptions() {
|
|
6266
6266
|
return {
|
|
@@ -6279,7 +6279,7 @@ var ListItem = _core.Node.create({
|
|
|
6279
6279
|
];
|
|
6280
6280
|
},
|
|
6281
6281
|
renderHTML({ HTMLAttributes }) {
|
|
6282
|
-
return ["li",
|
|
6282
|
+
return ["li", mergeAttributes10(this.options.HTMLAttributes, HTMLAttributes), 0];
|
|
6283
6283
|
},
|
|
6284
6284
|
addKeyboardShortcuts() {
|
|
6285
6285
|
return {
|
|
@@ -6291,11 +6291,11 @@ var ListItem = _core.Node.create({
|
|
|
6291
6291
|
});
|
|
6292
6292
|
|
|
6293
6293
|
// node_modules/@tiptap/extension-bullet-list/dist/index.js
|
|
6294
|
-
|
|
6294
|
+
import { Node as Node10, mergeAttributes as mergeAttributes11, wrappingInputRule as wrappingInputRule2 } from "@tiptap/core";
|
|
6295
6295
|
var ListItemName = "listItem";
|
|
6296
6296
|
var TextStyleName = "textStyle";
|
|
6297
6297
|
var inputRegex4 = /^\s*([-+*])\s$/;
|
|
6298
|
-
var BulletList =
|
|
6298
|
+
var BulletList = Node10.create({
|
|
6299
6299
|
name: "bulletList",
|
|
6300
6300
|
addOptions() {
|
|
6301
6301
|
return {
|
|
@@ -6315,7 +6315,7 @@ var BulletList = _core.Node.create({
|
|
|
6315
6315
|
];
|
|
6316
6316
|
},
|
|
6317
6317
|
renderHTML({ HTMLAttributes }) {
|
|
6318
|
-
return ["ul",
|
|
6318
|
+
return ["ul", mergeAttributes11(this.options.HTMLAttributes, HTMLAttributes), 0];
|
|
6319
6319
|
},
|
|
6320
6320
|
addCommands() {
|
|
6321
6321
|
return {
|
|
@@ -6333,12 +6333,12 @@ var BulletList = _core.Node.create({
|
|
|
6333
6333
|
};
|
|
6334
6334
|
},
|
|
6335
6335
|
addInputRules() {
|
|
6336
|
-
let inputRule =
|
|
6336
|
+
let inputRule = wrappingInputRule2({
|
|
6337
6337
|
find: inputRegex4,
|
|
6338
6338
|
type: this.type
|
|
6339
6339
|
});
|
|
6340
6340
|
if (this.options.keepMarks || this.options.keepAttributes) {
|
|
6341
|
-
inputRule =
|
|
6341
|
+
inputRule = wrappingInputRule2({
|
|
6342
6342
|
find: inputRegex4,
|
|
6343
6343
|
type: this.type,
|
|
6344
6344
|
keepMarks: this.options.keepMarks,
|
|
@@ -6356,11 +6356,11 @@ var BulletList = _core.Node.create({
|
|
|
6356
6356
|
});
|
|
6357
6357
|
|
|
6358
6358
|
// node_modules/@tiptap/extension-ordered-list/dist/index.js
|
|
6359
|
-
|
|
6359
|
+
import { Node as Node11, mergeAttributes as mergeAttributes12, wrappingInputRule as wrappingInputRule3 } from "@tiptap/core";
|
|
6360
6360
|
var ListItemName2 = "listItem";
|
|
6361
6361
|
var TextStyleName2 = "textStyle";
|
|
6362
6362
|
var inputRegex5 = /^(\d+)\.\s$/;
|
|
6363
|
-
var OrderedList =
|
|
6363
|
+
var OrderedList = Node11.create({
|
|
6364
6364
|
name: "orderedList",
|
|
6365
6365
|
addOptions() {
|
|
6366
6366
|
return {
|
|
@@ -6397,7 +6397,7 @@ var OrderedList = _core.Node.create({
|
|
|
6397
6397
|
},
|
|
6398
6398
|
renderHTML({ HTMLAttributes }) {
|
|
6399
6399
|
const { start, ...attributesWithoutStart } = HTMLAttributes;
|
|
6400
|
-
return start === 1 ? ["ol",
|
|
6400
|
+
return start === 1 ? ["ol", mergeAttributes12(this.options.HTMLAttributes, attributesWithoutStart), 0] : ["ol", mergeAttributes12(this.options.HTMLAttributes, HTMLAttributes), 0];
|
|
6401
6401
|
},
|
|
6402
6402
|
addCommands() {
|
|
6403
6403
|
return {
|
|
@@ -6415,14 +6415,14 @@ var OrderedList = _core.Node.create({
|
|
|
6415
6415
|
};
|
|
6416
6416
|
},
|
|
6417
6417
|
addInputRules() {
|
|
6418
|
-
let inputRule =
|
|
6418
|
+
let inputRule = wrappingInputRule3({
|
|
6419
6419
|
find: inputRegex5,
|
|
6420
6420
|
type: this.type,
|
|
6421
6421
|
getAttributes: (match) => ({ start: +match[1] }),
|
|
6422
6422
|
joinPredicate: (match, node) => node.childCount + node.attrs.start === +match[1]
|
|
6423
6423
|
});
|
|
6424
6424
|
if (this.options.keepMarks || this.options.keepAttributes) {
|
|
6425
|
-
inputRule =
|
|
6425
|
+
inputRule = wrappingInputRule3({
|
|
6426
6426
|
find: inputRegex5,
|
|
6427
6427
|
type: this.type,
|
|
6428
6428
|
keepMarks: this.options.keepMarks,
|
|
@@ -6439,10 +6439,10 @@ var OrderedList = _core.Node.create({
|
|
|
6439
6439
|
});
|
|
6440
6440
|
|
|
6441
6441
|
// src/components/tetrons/EditorContent.tsx
|
|
6442
|
-
|
|
6443
|
-
|
|
6444
|
-
|
|
6445
|
-
|
|
6442
|
+
import TableRow from "@tiptap/extension-table-row";
|
|
6443
|
+
import TableCell from "@tiptap/extension-table-cell";
|
|
6444
|
+
import TableHeader from "@tiptap/extension-table-header";
|
|
6445
|
+
import CodeBlockLowlight from "@tiptap/extension-code-block-lowlight";
|
|
6446
6446
|
|
|
6447
6447
|
// node_modules/highlight.js/es/languages/javascript.js
|
|
6448
6448
|
var IDENT_RE = "[A-Za-z$_][0-9A-Za-z$_]*";
|
|
@@ -7960,14 +7960,14 @@ function typescript(hljs) {
|
|
|
7960
7960
|
}
|
|
7961
7961
|
|
|
7962
7962
|
// src/components/tetrons/EditorContent.tsx
|
|
7963
|
-
|
|
7963
|
+
import { createLowlight } from "lowlight";
|
|
7964
7964
|
|
|
7965
7965
|
// src/utils/useTypo.ts
|
|
7966
|
-
|
|
7967
|
-
|
|
7966
|
+
import { useEffect, useState } from "react";
|
|
7967
|
+
import Typo from "typo-js";
|
|
7968
7968
|
function useTypo() {
|
|
7969
|
-
const [typo, setTypo] =
|
|
7970
|
-
|
|
7969
|
+
const [typo, setTypo] = useState(null);
|
|
7970
|
+
useEffect(() => {
|
|
7971
7971
|
async function loadDictionary() {
|
|
7972
7972
|
const aff = await fetch("/dictionaries/index.aff").then(
|
|
7973
7973
|
(res) => res.text()
|
|
@@ -7975,7 +7975,7 @@ function useTypo() {
|
|
|
7975
7975
|
const dic = await fetch("/dictionaries/index.dic").then(
|
|
7976
7976
|
(res) => res.text()
|
|
7977
7977
|
);
|
|
7978
|
-
const dictionary = new (
|
|
7978
|
+
const dictionary = new Typo("en_US", aff, dic, { platform: "any" });
|
|
7979
7979
|
setTypo(dictionary);
|
|
7980
7980
|
}
|
|
7981
7981
|
loadDictionary();
|
|
@@ -7984,9 +7984,9 @@ function useTypo() {
|
|
|
7984
7984
|
}
|
|
7985
7985
|
|
|
7986
7986
|
// src/components/tetrons/extensions/Spellcheck.ts
|
|
7987
|
-
|
|
7987
|
+
import { Mark as Mark6, markInputRule as markInputRule5 } from "@tiptap/core";
|
|
7988
7988
|
var wordMatchRegex = () => /(?:^|\s)([a-zA-Z]{2,})(?=\s|$)/g;
|
|
7989
|
-
var Spellcheck =
|
|
7989
|
+
var Spellcheck = Mark6.create({
|
|
7990
7990
|
name: "spellcheck",
|
|
7991
7991
|
addOptions() {
|
|
7992
7992
|
return {
|
|
@@ -7995,7 +7995,7 @@ var Spellcheck = _core.Mark.create({
|
|
|
7995
7995
|
},
|
|
7996
7996
|
addInputRules() {
|
|
7997
7997
|
return [
|
|
7998
|
-
|
|
7998
|
+
markInputRule5({
|
|
7999
7999
|
find: wordMatchRegex(),
|
|
8000
8000
|
type: this.type,
|
|
8001
8001
|
getAttributes: (match) => this.options.spellcheckFn(match[1]) ? false : { "data-spellcheck": "true" }
|
|
@@ -8023,8 +8023,8 @@ var Spellcheck = _core.Mark.create({
|
|
|
8023
8023
|
});
|
|
8024
8024
|
|
|
8025
8025
|
// src/components/tetrons/toolbar/extensions/Comment.ts
|
|
8026
|
-
|
|
8027
|
-
var Comment =
|
|
8026
|
+
import { Mark as Mark7, mergeAttributes as mergeAttributes13 } from "@tiptap/core";
|
|
8027
|
+
var Comment = Mark7.create({
|
|
8028
8028
|
name: "comment",
|
|
8029
8029
|
addOptions() {
|
|
8030
8030
|
return {
|
|
@@ -8048,7 +8048,7 @@ var Comment = _core.Mark.create({
|
|
|
8048
8048
|
renderHTML({ HTMLAttributes }) {
|
|
8049
8049
|
return [
|
|
8050
8050
|
"span",
|
|
8051
|
-
|
|
8051
|
+
mergeAttributes13(HTMLAttributes, {
|
|
8052
8052
|
"data-comment": HTMLAttributes.comment,
|
|
8053
8053
|
class: "comment-highlight",
|
|
8054
8054
|
title: HTMLAttributes.comment,
|
|
@@ -8070,8 +8070,8 @@ var Comment = _core.Mark.create({
|
|
|
8070
8070
|
});
|
|
8071
8071
|
|
|
8072
8072
|
// src/components/tetrons/toolbar/marks/Subscript.ts
|
|
8073
|
-
|
|
8074
|
-
var Subscript =
|
|
8073
|
+
import { Mark as Mark8, markInputRule as markInputRule6, markPasteRule as markPasteRule5 } from "@tiptap/core";
|
|
8074
|
+
var Subscript = Mark8.create({
|
|
8075
8075
|
name: "subscript",
|
|
8076
8076
|
excludes: "superscript",
|
|
8077
8077
|
parseHTML() {
|
|
@@ -8087,7 +8087,7 @@ var Subscript = _core.Mark.create({
|
|
|
8087
8087
|
},
|
|
8088
8088
|
addInputRules() {
|
|
8089
8089
|
return [
|
|
8090
|
-
|
|
8090
|
+
markInputRule6({
|
|
8091
8091
|
find: /~([^~]+)~/,
|
|
8092
8092
|
type: this.type
|
|
8093
8093
|
})
|
|
@@ -8095,7 +8095,7 @@ var Subscript = _core.Mark.create({
|
|
|
8095
8095
|
},
|
|
8096
8096
|
addPasteRules() {
|
|
8097
8097
|
return [
|
|
8098
|
-
|
|
8098
|
+
markPasteRule5({
|
|
8099
8099
|
find: /~([^~]+)~/g,
|
|
8100
8100
|
type: this.type
|
|
8101
8101
|
})
|
|
@@ -8104,8 +8104,8 @@ var Subscript = _core.Mark.create({
|
|
|
8104
8104
|
});
|
|
8105
8105
|
|
|
8106
8106
|
// src/components/tetrons/toolbar/marks/Superscript.ts
|
|
8107
|
-
|
|
8108
|
-
var Superscript =
|
|
8107
|
+
import { Mark as Mark9, markInputRule as markInputRule7, markPasteRule as markPasteRule6 } from "@tiptap/core";
|
|
8108
|
+
var Superscript = Mark9.create({
|
|
8109
8109
|
name: "superscript",
|
|
8110
8110
|
excludes: "subscript",
|
|
8111
8111
|
parseHTML() {
|
|
@@ -8121,7 +8121,7 @@ var Superscript = _core.Mark.create({
|
|
|
8121
8121
|
},
|
|
8122
8122
|
addInputRules() {
|
|
8123
8123
|
return [
|
|
8124
|
-
|
|
8124
|
+
markInputRule7({
|
|
8125
8125
|
find: /\^([^^]+)\^/,
|
|
8126
8126
|
type: this.type
|
|
8127
8127
|
})
|
|
@@ -8129,7 +8129,7 @@ var Superscript = _core.Mark.create({
|
|
|
8129
8129
|
},
|
|
8130
8130
|
addPasteRules() {
|
|
8131
8131
|
return [
|
|
8132
|
-
|
|
8132
|
+
markPasteRule6({
|
|
8133
8133
|
find: /\^([^^]+)\^/g,
|
|
8134
8134
|
type: this.type
|
|
8135
8135
|
})
|
|
@@ -8138,7 +8138,7 @@ var Superscript = _core.Mark.create({
|
|
|
8138
8138
|
});
|
|
8139
8139
|
|
|
8140
8140
|
// src/components/tetrons/toolbar/extensions/ResizableTable.ts
|
|
8141
|
-
|
|
8141
|
+
import { Table } from "@tiptap/extension-table";
|
|
8142
8142
|
|
|
8143
8143
|
// node_modules/prosemirror-view/dist/index.js
|
|
8144
8144
|
var domIndex = function(node) {
|
|
@@ -15195,10 +15195,10 @@ function tableEditing({
|
|
|
15195
15195
|
}
|
|
15196
15196
|
|
|
15197
15197
|
// src/components/tetrons/toolbar/extensions/ResizableTable.ts
|
|
15198
|
-
var ResizableTable =
|
|
15198
|
+
var ResizableTable = Table.extend({
|
|
15199
15199
|
addOptions() {
|
|
15200
15200
|
return {
|
|
15201
|
-
...
|
|
15201
|
+
...this.parent?.(),
|
|
15202
15202
|
resizable: true
|
|
15203
15203
|
};
|
|
15204
15204
|
},
|
|
@@ -15208,8 +15208,8 @@ var ResizableTable = _extensiontable.Table.extend({
|
|
|
15208
15208
|
});
|
|
15209
15209
|
|
|
15210
15210
|
// src/components/tetrons/toolbar/extensions/Embed.ts
|
|
15211
|
-
|
|
15212
|
-
var Embed =
|
|
15211
|
+
import { Node as Node12, mergeAttributes as mergeAttributes14 } from "@tiptap/core";
|
|
15212
|
+
var Embed = Node12.create({
|
|
15213
15213
|
name: "embed",
|
|
15214
15214
|
group: "block",
|
|
15215
15215
|
atom: true,
|
|
@@ -15224,7 +15224,7 @@ var Embed = _core.Node.create({
|
|
|
15224
15224
|
return [{ tag: "iframe[src]" }];
|
|
15225
15225
|
},
|
|
15226
15226
|
renderHTML({ HTMLAttributes }) {
|
|
15227
|
-
return ["iframe",
|
|
15227
|
+
return ["iframe", mergeAttributes14(HTMLAttributes)];
|
|
15228
15228
|
},
|
|
15229
15229
|
addCommands() {
|
|
15230
15230
|
return {
|
|
@@ -15302,8 +15302,8 @@ var Embed = _core.Node.create({
|
|
|
15302
15302
|
});
|
|
15303
15303
|
|
|
15304
15304
|
// src/components/tetrons/toolbar/extensions/FontFamily.ts
|
|
15305
|
-
|
|
15306
|
-
var FontFamily =
|
|
15305
|
+
import { Mark as Mark10, mergeAttributes as mergeAttributes15 } from "@tiptap/core";
|
|
15306
|
+
var FontFamily = Mark10.create({
|
|
15307
15307
|
name: "fontFamily",
|
|
15308
15308
|
addAttributes() {
|
|
15309
15309
|
return {
|
|
@@ -15321,7 +15321,7 @@ var FontFamily = _core.Mark.create({
|
|
|
15321
15321
|
return [{ style: "font-family" }];
|
|
15322
15322
|
},
|
|
15323
15323
|
renderHTML({ HTMLAttributes }) {
|
|
15324
|
-
return ["span",
|
|
15324
|
+
return ["span", mergeAttributes15(HTMLAttributes), 0];
|
|
15325
15325
|
},
|
|
15326
15326
|
addCommands() {
|
|
15327
15327
|
return {
|
|
@@ -15331,8 +15331,8 @@ var FontFamily = _core.Mark.create({
|
|
|
15331
15331
|
});
|
|
15332
15332
|
|
|
15333
15333
|
// src/components/tetrons/toolbar/extensions/FontSize.ts
|
|
15334
|
-
|
|
15335
|
-
var FontSize =
|
|
15334
|
+
import { Mark as Mark11, mergeAttributes as mergeAttributes16 } from "@tiptap/core";
|
|
15335
|
+
var FontSize = Mark11.create({
|
|
15336
15336
|
name: "fontSize",
|
|
15337
15337
|
addAttributes() {
|
|
15338
15338
|
return {
|
|
@@ -15350,7 +15350,7 @@ var FontSize = _core.Mark.create({
|
|
|
15350
15350
|
return [{ style: "font-size" }];
|
|
15351
15351
|
},
|
|
15352
15352
|
renderHTML({ HTMLAttributes }) {
|
|
15353
|
-
return ["span",
|
|
15353
|
+
return ["span", mergeAttributes16(HTMLAttributes), 0];
|
|
15354
15354
|
},
|
|
15355
15355
|
addCommands() {
|
|
15356
15356
|
return {
|
|
@@ -15360,24 +15360,24 @@ var FontSize = _core.Mark.create({
|
|
|
15360
15360
|
});
|
|
15361
15361
|
|
|
15362
15362
|
// src/components/tetrons/ResizableImage.ts
|
|
15363
|
-
|
|
15364
|
-
|
|
15363
|
+
import Image from "@tiptap/extension-image";
|
|
15364
|
+
import { ReactNodeViewRenderer } from "@tiptap/react";
|
|
15365
15365
|
|
|
15366
15366
|
// src/components/tetrons/ResizableImageComponent.tsx
|
|
15367
|
-
|
|
15368
|
-
|
|
15367
|
+
import React, { useRef, useEffect as useEffect2, useState as useState2 } from "react";
|
|
15368
|
+
import { NodeViewWrapper } from "@tiptap/react";
|
|
15369
15369
|
var ResizableImageComponent = ({
|
|
15370
15370
|
node,
|
|
15371
15371
|
updateAttributes,
|
|
15372
15372
|
selected
|
|
15373
15373
|
}) => {
|
|
15374
15374
|
const { src, alt, title, width, height } = node.attrs;
|
|
15375
|
-
const defaultWidth =
|
|
15376
|
-
const defaultHeight =
|
|
15375
|
+
const defaultWidth = width ?? 300;
|
|
15376
|
+
const defaultHeight = height ?? 200;
|
|
15377
15377
|
const aspectRatio = defaultHeight > 0 ? defaultWidth / defaultHeight : 4 / 3;
|
|
15378
|
-
const wrapperRef =
|
|
15379
|
-
const [isResizing, setIsResizing] =
|
|
15380
|
-
|
|
15378
|
+
const wrapperRef = useRef(null);
|
|
15379
|
+
const [isResizing, setIsResizing] = useState2(false);
|
|
15380
|
+
useEffect2(() => {
|
|
15381
15381
|
const handleMouseMove2 = (e) => {
|
|
15382
15382
|
if (!isResizing || !wrapperRef.current) return;
|
|
15383
15383
|
const rect = wrapperRef.current.getBoundingClientRect();
|
|
@@ -15402,8 +15402,8 @@ var ResizableImageComponent = ({
|
|
|
15402
15402
|
window.removeEventListener("mouseup", handleMouseUp);
|
|
15403
15403
|
};
|
|
15404
15404
|
}, [isResizing, updateAttributes, aspectRatio]);
|
|
15405
|
-
return /* @__PURE__ */
|
|
15406
|
-
|
|
15405
|
+
return /* @__PURE__ */ React.createElement(
|
|
15406
|
+
NodeViewWrapper,
|
|
15407
15407
|
{
|
|
15408
15408
|
ref: wrapperRef,
|
|
15409
15409
|
contentEditable: false,
|
|
@@ -15421,12 +15421,12 @@ var ResizableImageComponent = ({
|
|
|
15421
15421
|
padding: 2
|
|
15422
15422
|
}
|
|
15423
15423
|
},
|
|
15424
|
-
/* @__PURE__ */
|
|
15424
|
+
/* @__PURE__ */ React.createElement(
|
|
15425
15425
|
"img",
|
|
15426
15426
|
{
|
|
15427
15427
|
src,
|
|
15428
|
-
alt:
|
|
15429
|
-
title:
|
|
15428
|
+
alt: alt ?? "",
|
|
15429
|
+
title: title ?? "",
|
|
15430
15430
|
loading: "lazy",
|
|
15431
15431
|
style: {
|
|
15432
15432
|
width: "100%",
|
|
@@ -15439,7 +15439,7 @@ var ResizableImageComponent = ({
|
|
|
15439
15439
|
draggable: false
|
|
15440
15440
|
}
|
|
15441
15441
|
),
|
|
15442
|
-
/* @__PURE__ */
|
|
15442
|
+
/* @__PURE__ */ React.createElement(
|
|
15443
15443
|
"div",
|
|
15444
15444
|
{
|
|
15445
15445
|
onMouseDown: (e) => {
|
|
@@ -15464,11 +15464,11 @@ var ResizableImageComponent = ({
|
|
|
15464
15464
|
var ResizableImageComponent_default = ResizableImageComponent;
|
|
15465
15465
|
|
|
15466
15466
|
// src/components/tetrons/ResizableImage.ts
|
|
15467
|
-
var ResizableImage =
|
|
15467
|
+
var ResizableImage = Image.extend({
|
|
15468
15468
|
name: "resizableImage",
|
|
15469
15469
|
addAttributes() {
|
|
15470
15470
|
return {
|
|
15471
|
-
...
|
|
15471
|
+
...this.parent?.(),
|
|
15472
15472
|
width: { default: null },
|
|
15473
15473
|
height: { default: null }
|
|
15474
15474
|
};
|
|
@@ -15487,26 +15487,26 @@ var ResizableImage = _extensionimage2.default.extend({
|
|
|
15487
15487
|
];
|
|
15488
15488
|
},
|
|
15489
15489
|
addNodeView() {
|
|
15490
|
-
return
|
|
15490
|
+
return ReactNodeViewRenderer(ResizableImageComponent_default);
|
|
15491
15491
|
}
|
|
15492
15492
|
});
|
|
15493
15493
|
|
|
15494
15494
|
// src/components/tetrons/ResizableVideo.ts
|
|
15495
|
-
|
|
15496
|
-
|
|
15495
|
+
import { Node as Node13 } from "@tiptap/core";
|
|
15496
|
+
import { ReactNodeViewRenderer as ReactNodeViewRenderer2 } from "@tiptap/react";
|
|
15497
15497
|
|
|
15498
15498
|
// src/components/tetrons/ResizableVideoComponent.tsx
|
|
15499
|
-
|
|
15500
|
-
|
|
15499
|
+
import React2, { useRef as useRef2, useEffect as useEffect3 } from "react";
|
|
15500
|
+
import { NodeViewWrapper as NodeViewWrapper2 } from "@tiptap/react";
|
|
15501
15501
|
var ResizableVideoComponent = ({
|
|
15502
15502
|
node,
|
|
15503
15503
|
updateAttributes,
|
|
15504
15504
|
selected
|
|
15505
15505
|
}) => {
|
|
15506
15506
|
const { src, controls, width, height } = node.attrs;
|
|
15507
|
-
const wrapperRef =
|
|
15508
|
-
const videoRef =
|
|
15509
|
-
|
|
15507
|
+
const wrapperRef = useRef2(null);
|
|
15508
|
+
const videoRef = useRef2(null);
|
|
15509
|
+
useEffect3(() => {
|
|
15510
15510
|
const video = videoRef.current;
|
|
15511
15511
|
if (!video) return;
|
|
15512
15512
|
const observer = new ResizeObserver(() => {
|
|
@@ -15517,8 +15517,8 @@ var ResizableVideoComponent = ({
|
|
|
15517
15517
|
observer.observe(video);
|
|
15518
15518
|
return () => observer.disconnect();
|
|
15519
15519
|
}, [updateAttributes]);
|
|
15520
|
-
return /* @__PURE__ */
|
|
15521
|
-
|
|
15520
|
+
return /* @__PURE__ */ React2.createElement(
|
|
15521
|
+
NodeViewWrapper2,
|
|
15522
15522
|
{
|
|
15523
15523
|
ref: wrapperRef,
|
|
15524
15524
|
contentEditable: false,
|
|
@@ -15531,7 +15531,7 @@ var ResizableVideoComponent = ({
|
|
|
15531
15531
|
display: "inline-block"
|
|
15532
15532
|
}
|
|
15533
15533
|
},
|
|
15534
|
-
/* @__PURE__ */
|
|
15534
|
+
/* @__PURE__ */ React2.createElement(
|
|
15535
15535
|
"video",
|
|
15536
15536
|
{
|
|
15537
15537
|
ref: videoRef,
|
|
@@ -15548,7 +15548,7 @@ var ResizableVideoComponent = ({
|
|
|
15548
15548
|
var ResizableVideoComponent_default = ResizableVideoComponent;
|
|
15549
15549
|
|
|
15550
15550
|
// src/components/tetrons/ResizableVideo.ts
|
|
15551
|
-
var ResizableVideo =
|
|
15551
|
+
var ResizableVideo = Node13.create({
|
|
15552
15552
|
name: "video",
|
|
15553
15553
|
group: "block",
|
|
15554
15554
|
draggable: true,
|
|
@@ -15590,15 +15590,15 @@ var ResizableVideo = _core.Node.create({
|
|
|
15590
15590
|
};
|
|
15591
15591
|
},
|
|
15592
15592
|
addNodeView() {
|
|
15593
|
-
return
|
|
15593
|
+
return ReactNodeViewRenderer2(ResizableVideoComponent_default);
|
|
15594
15594
|
}
|
|
15595
15595
|
});
|
|
15596
15596
|
|
|
15597
15597
|
// src/components/tetrons/toolbar/TableContextMenu.tsx
|
|
15598
|
-
|
|
15598
|
+
import React3, { useEffect as useEffect4, useState as useState3 } from "react";
|
|
15599
15599
|
function TableContextMenu({ editor }) {
|
|
15600
|
-
const [menuPosition, setMenuPosition] =
|
|
15601
|
-
|
|
15600
|
+
const [menuPosition, setMenuPosition] = useState3(null);
|
|
15601
|
+
useEffect4(() => {
|
|
15602
15602
|
const handleContextMenu = (event) => {
|
|
15603
15603
|
const target = event.target;
|
|
15604
15604
|
if (target.closest("td") || target.closest("th")) {
|
|
@@ -15623,13 +15623,13 @@ function TableContextMenu({ editor }) {
|
|
|
15623
15623
|
const deleteRow = () => editor.chain().focus().deleteRow().run();
|
|
15624
15624
|
const deleteCol = () => editor.chain().focus().deleteColumn().run();
|
|
15625
15625
|
if (!menuPosition) return null;
|
|
15626
|
-
return /* @__PURE__ */
|
|
15626
|
+
return /* @__PURE__ */ React3.createElement(
|
|
15627
15627
|
"ul",
|
|
15628
15628
|
{
|
|
15629
15629
|
className: "absolute bg-white shadow border rounded text-sm z-50",
|
|
15630
15630
|
style: { top: menuPosition.y, left: menuPosition.x }
|
|
15631
15631
|
},
|
|
15632
|
-
/* @__PURE__ */
|
|
15632
|
+
/* @__PURE__ */ React3.createElement(
|
|
15633
15633
|
"li",
|
|
15634
15634
|
{
|
|
15635
15635
|
className: "px-3 py-1 hover:bg-gray-100 cursor-pointer",
|
|
@@ -15637,7 +15637,7 @@ function TableContextMenu({ editor }) {
|
|
|
15637
15637
|
},
|
|
15638
15638
|
"Insert Row Above"
|
|
15639
15639
|
),
|
|
15640
|
-
/* @__PURE__ */
|
|
15640
|
+
/* @__PURE__ */ React3.createElement(
|
|
15641
15641
|
"li",
|
|
15642
15642
|
{
|
|
15643
15643
|
className: "px-3 py-1 hover:bg-gray-100 cursor-pointer",
|
|
@@ -15645,7 +15645,7 @@ function TableContextMenu({ editor }) {
|
|
|
15645
15645
|
},
|
|
15646
15646
|
"Insert Row Below"
|
|
15647
15647
|
),
|
|
15648
|
-
/* @__PURE__ */
|
|
15648
|
+
/* @__PURE__ */ React3.createElement(
|
|
15649
15649
|
"li",
|
|
15650
15650
|
{
|
|
15651
15651
|
className: "px-3 py-1 hover:bg-gray-100 cursor-pointer",
|
|
@@ -15653,7 +15653,7 @@ function TableContextMenu({ editor }) {
|
|
|
15653
15653
|
},
|
|
15654
15654
|
"Insert Column Left"
|
|
15655
15655
|
),
|
|
15656
|
-
/* @__PURE__ */
|
|
15656
|
+
/* @__PURE__ */ React3.createElement(
|
|
15657
15657
|
"li",
|
|
15658
15658
|
{
|
|
15659
15659
|
className: "px-3 py-1 hover:bg-gray-100 cursor-pointer",
|
|
@@ -15661,7 +15661,7 @@ function TableContextMenu({ editor }) {
|
|
|
15661
15661
|
},
|
|
15662
15662
|
"Insert Column Right"
|
|
15663
15663
|
),
|
|
15664
|
-
/* @__PURE__ */
|
|
15664
|
+
/* @__PURE__ */ React3.createElement(
|
|
15665
15665
|
"li",
|
|
15666
15666
|
{
|
|
15667
15667
|
className: "px-3 py-1 hover:bg-red-100 cursor-pointer",
|
|
@@ -15669,7 +15669,7 @@ function TableContextMenu({ editor }) {
|
|
|
15669
15669
|
},
|
|
15670
15670
|
"Delete Row"
|
|
15671
15671
|
),
|
|
15672
|
-
/* @__PURE__ */
|
|
15672
|
+
/* @__PURE__ */ React3.createElement(
|
|
15673
15673
|
"li",
|
|
15674
15674
|
{
|
|
15675
15675
|
className: "px-3 py-1 hover:bg-red-100 cursor-pointer",
|
|
@@ -15681,34 +15681,34 @@ function TableContextMenu({ editor }) {
|
|
|
15681
15681
|
}
|
|
15682
15682
|
|
|
15683
15683
|
// src/components/tetrons/toolbar/TetronsToolbar.tsx
|
|
15684
|
-
|
|
15684
|
+
import React13, { useEffect as useEffect7, useState as useState8 } from "react";
|
|
15685
15685
|
|
|
15686
15686
|
// src/components/tetrons/toolbar/ActionGroup.tsx
|
|
15687
|
-
|
|
15688
|
-
|
|
15689
|
-
|
|
15690
|
-
|
|
15691
|
-
|
|
15692
|
-
|
|
15693
|
-
|
|
15694
|
-
|
|
15687
|
+
import React5, { useEffect as useEffect5, useRef as useRef3, useState as useState4 } from "react";
|
|
15688
|
+
import {
|
|
15689
|
+
MdZoomIn,
|
|
15690
|
+
MdZoomOut,
|
|
15691
|
+
MdPrint,
|
|
15692
|
+
MdSave,
|
|
15693
|
+
MdDownload
|
|
15694
|
+
} from "react-icons/md";
|
|
15695
15695
|
|
|
15696
15696
|
// src/components/tetrons/toolbar/ToolbarButton.tsx
|
|
15697
|
-
|
|
15698
|
-
var ToolbarButton =
|
|
15697
|
+
import React4 from "react";
|
|
15698
|
+
var ToolbarButton = React4.forwardRef(
|
|
15699
15699
|
({ icon: Icon, onClick, disabled = false, title, label, isActive = false }, ref) => {
|
|
15700
|
-
return /* @__PURE__ */
|
|
15700
|
+
return /* @__PURE__ */ React4.createElement(
|
|
15701
15701
|
"button",
|
|
15702
15702
|
{
|
|
15703
15703
|
type: "button",
|
|
15704
15704
|
ref,
|
|
15705
15705
|
onClick,
|
|
15706
15706
|
disabled,
|
|
15707
|
-
title:
|
|
15708
|
-
"aria-label":
|
|
15707
|
+
title: title ?? label,
|
|
15708
|
+
"aria-label": title ?? label,
|
|
15709
15709
|
className: `toolbar-button ${isActive ? "active" : ""}`
|
|
15710
15710
|
},
|
|
15711
|
-
/* @__PURE__ */
|
|
15711
|
+
/* @__PURE__ */ React4.createElement(Icon, { size: 20 })
|
|
15712
15712
|
);
|
|
15713
15713
|
}
|
|
15714
15714
|
);
|
|
@@ -15717,9 +15717,9 @@ var ToolbarButton_default = ToolbarButton;
|
|
|
15717
15717
|
|
|
15718
15718
|
// src/components/tetrons/toolbar/ActionGroup.tsx
|
|
15719
15719
|
function ActionGroup({ editor }) {
|
|
15720
|
-
const [dropdownOpen, setDropdownOpen] =
|
|
15721
|
-
const dropdownRef =
|
|
15722
|
-
|
|
15720
|
+
const [dropdownOpen, setDropdownOpen] = useState4(false);
|
|
15721
|
+
const dropdownRef = useRef3(null);
|
|
15722
|
+
useEffect5(() => {
|
|
15723
15723
|
const handleClickOutside = (event) => {
|
|
15724
15724
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
15725
15725
|
setDropdownOpen(false);
|
|
@@ -15797,7 +15797,7 @@ function ActionGroup({ editor }) {
|
|
|
15797
15797
|
container.classList.add("p-4", "prose");
|
|
15798
15798
|
document.body.appendChild(container);
|
|
15799
15799
|
try {
|
|
15800
|
-
const domToPdf = (await
|
|
15800
|
+
const domToPdf = (await import("dom-to-pdf")).default;
|
|
15801
15801
|
const options = {
|
|
15802
15802
|
filename: "document.pdf",
|
|
15803
15803
|
overrideWidth: 800,
|
|
@@ -15824,7 +15824,7 @@ function ActionGroup({ editor }) {
|
|
|
15824
15824
|
document.body.removeChild(link);
|
|
15825
15825
|
};
|
|
15826
15826
|
const handleDownloadDOCX = async () => {
|
|
15827
|
-
const { Document: Document2, Packer, Paragraph: Paragraph2 } = await
|
|
15827
|
+
const { Document: Document2, Packer, Paragraph: Paragraph2 } = await import("docx");
|
|
15828
15828
|
const text = editor.getText();
|
|
15829
15829
|
const doc3 = new Document2({
|
|
15830
15830
|
sections: [
|
|
@@ -15842,7 +15842,7 @@ function ActionGroup({ editor }) {
|
|
|
15842
15842
|
link.click();
|
|
15843
15843
|
document.body.removeChild(link);
|
|
15844
15844
|
};
|
|
15845
|
-
return /* @__PURE__ */
|
|
15845
|
+
return /* @__PURE__ */ React5.createElement("div", { className: "action-group", role: "group", "aria-label": "Editor actions" }, /* @__PURE__ */ React5.createElement(ToolbarButton_default, { icon: MdZoomIn, onClick: zoomIn, title: "Zoom In" }), /* @__PURE__ */ React5.createElement(ToolbarButton_default, { icon: MdZoomOut, onClick: zoomOut, title: "Zoom Out" }), /* @__PURE__ */ React5.createElement(ToolbarButton_default, { icon: MdPrint, onClick: handlePrint, title: "Print" }), /* @__PURE__ */ React5.createElement(ToolbarButton_default, { icon: MdSave, onClick: handleSave, title: "Save" }), /* @__PURE__ */ React5.createElement("div", { className: "relative", ref: dropdownRef }, /* @__PURE__ */ React5.createElement(
|
|
15846
15846
|
"button",
|
|
15847
15847
|
{
|
|
15848
15848
|
type: "button",
|
|
@@ -15852,9 +15852,9 @@ function ActionGroup({ editor }) {
|
|
|
15852
15852
|
className: "export-button",
|
|
15853
15853
|
title: "Export"
|
|
15854
15854
|
},
|
|
15855
|
-
/* @__PURE__ */
|
|
15856
|
-
/* @__PURE__ */
|
|
15857
|
-
), dropdownOpen && /* @__PURE__ */
|
|
15855
|
+
/* @__PURE__ */ React5.createElement(MdDownload, null),
|
|
15856
|
+
/* @__PURE__ */ React5.createElement("span", { className: "text-sm" })
|
|
15857
|
+
), dropdownOpen && /* @__PURE__ */ React5.createElement("div", { className: "export-dropdown" }, /* @__PURE__ */ React5.createElement(
|
|
15858
15858
|
"button",
|
|
15859
15859
|
{
|
|
15860
15860
|
type: "button",
|
|
@@ -15864,7 +15864,7 @@ function ActionGroup({ editor }) {
|
|
|
15864
15864
|
}
|
|
15865
15865
|
},
|
|
15866
15866
|
"Export as PDF"
|
|
15867
|
-
), /* @__PURE__ */
|
|
15867
|
+
), /* @__PURE__ */ React5.createElement(
|
|
15868
15868
|
"button",
|
|
15869
15869
|
{
|
|
15870
15870
|
type: "button",
|
|
@@ -15874,7 +15874,7 @@ function ActionGroup({ editor }) {
|
|
|
15874
15874
|
}
|
|
15875
15875
|
},
|
|
15876
15876
|
"Export as HTML"
|
|
15877
|
-
), /* @__PURE__ */
|
|
15877
|
+
), /* @__PURE__ */ React5.createElement(
|
|
15878
15878
|
"button",
|
|
15879
15879
|
{
|
|
15880
15880
|
type: "button",
|
|
@@ -15888,18 +15888,18 @@ function ActionGroup({ editor }) {
|
|
|
15888
15888
|
}
|
|
15889
15889
|
|
|
15890
15890
|
// src/components/tetrons/toolbar/ClipboardGroup.tsx
|
|
15891
|
-
|
|
15892
|
-
|
|
15893
|
-
|
|
15894
|
-
|
|
15895
|
-
|
|
15896
|
-
|
|
15897
|
-
|
|
15891
|
+
import {
|
|
15892
|
+
MdContentPaste,
|
|
15893
|
+
MdContentCut,
|
|
15894
|
+
MdContentCopy,
|
|
15895
|
+
MdFormatPaint
|
|
15896
|
+
} from "react-icons/md";
|
|
15897
|
+
import React6 from "react";
|
|
15898
15898
|
function ClipboardGroup({ editor }) {
|
|
15899
|
-
return /* @__PURE__ */
|
|
15899
|
+
return /* @__PURE__ */ React6.createElement("div", { className: "clipboard-group" }, /* @__PURE__ */ React6.createElement(
|
|
15900
15900
|
ToolbarButton_default,
|
|
15901
15901
|
{
|
|
15902
|
-
icon:
|
|
15902
|
+
icon: MdContentPaste,
|
|
15903
15903
|
title: "Paste",
|
|
15904
15904
|
onClick: async () => {
|
|
15905
15905
|
try {
|
|
@@ -15910,10 +15910,10 @@ function ClipboardGroup({ editor }) {
|
|
|
15910
15910
|
}
|
|
15911
15911
|
}
|
|
15912
15912
|
}
|
|
15913
|
-
), /* @__PURE__ */
|
|
15913
|
+
), /* @__PURE__ */ React6.createElement(
|
|
15914
15914
|
ToolbarButton_default,
|
|
15915
15915
|
{
|
|
15916
|
-
icon:
|
|
15916
|
+
icon: MdContentCut,
|
|
15917
15917
|
title: "Cut",
|
|
15918
15918
|
onClick: () => {
|
|
15919
15919
|
const { from: from2, to } = editor.state.selection;
|
|
@@ -15924,10 +15924,10 @@ function ClipboardGroup({ editor }) {
|
|
|
15924
15924
|
});
|
|
15925
15925
|
}
|
|
15926
15926
|
}
|
|
15927
|
-
), /* @__PURE__ */
|
|
15927
|
+
), /* @__PURE__ */ React6.createElement(
|
|
15928
15928
|
ToolbarButton_default,
|
|
15929
15929
|
{
|
|
15930
|
-
icon:
|
|
15930
|
+
icon: MdContentCopy,
|
|
15931
15931
|
title: "Copy",
|
|
15932
15932
|
onClick: () => {
|
|
15933
15933
|
const { from: from2, to } = editor.state.selection;
|
|
@@ -15936,10 +15936,10 @@ function ClipboardGroup({ editor }) {
|
|
|
15936
15936
|
navigator.clipboard.writeText(selectedText);
|
|
15937
15937
|
}
|
|
15938
15938
|
}
|
|
15939
|
-
), /* @__PURE__ */
|
|
15939
|
+
), /* @__PURE__ */ React6.createElement(
|
|
15940
15940
|
ToolbarButton_default,
|
|
15941
15941
|
{
|
|
15942
|
-
icon:
|
|
15942
|
+
icon: MdFormatPaint,
|
|
15943
15943
|
title: "Format Painter",
|
|
15944
15944
|
onClick: () => {
|
|
15945
15945
|
const currentMarks = editor.getAttributes("textStyle");
|
|
@@ -15950,34 +15950,34 @@ function ClipboardGroup({ editor }) {
|
|
|
15950
15950
|
}
|
|
15951
15951
|
|
|
15952
15952
|
// src/components/tetrons/toolbar/FontStyleGroup.tsx
|
|
15953
|
-
|
|
15954
|
-
|
|
15955
|
-
|
|
15956
|
-
|
|
15957
|
-
|
|
15958
|
-
|
|
15959
|
-
|
|
15960
|
-
|
|
15961
|
-
|
|
15962
|
-
|
|
15963
|
-
|
|
15964
|
-
|
|
15965
|
-
|
|
15953
|
+
import {
|
|
15954
|
+
MdFormatBold,
|
|
15955
|
+
MdFormatItalic,
|
|
15956
|
+
MdFormatUnderlined,
|
|
15957
|
+
MdStrikethroughS,
|
|
15958
|
+
MdSubscript,
|
|
15959
|
+
MdSuperscript,
|
|
15960
|
+
MdFormatClear,
|
|
15961
|
+
MdFormatPaint as MdFormatPaint2
|
|
15962
|
+
} from "react-icons/md";
|
|
15963
|
+
import { ImTextColor } from "react-icons/im";
|
|
15964
|
+
import { BiSolidColorFill } from "react-icons/bi";
|
|
15965
|
+
import React7, { useEffect as useEffect6, useState as useState5 } from "react";
|
|
15966
15966
|
function FontStyleGroup({ editor }) {
|
|
15967
|
-
const [textColor, setTextColor] =
|
|
15968
|
-
const [highlightColor, setHighlightColor] =
|
|
15969
|
-
const [fontFamily, setFontFamily] =
|
|
15970
|
-
const [fontSize, setFontSize] =
|
|
15971
|
-
|
|
15967
|
+
const [textColor, setTextColor] = useState5("#000000");
|
|
15968
|
+
const [highlightColor, setHighlightColor] = useState5("#ffff00");
|
|
15969
|
+
const [fontFamily, setFontFamily] = useState5("Arial");
|
|
15970
|
+
const [fontSize, setFontSize] = useState5("16px");
|
|
15971
|
+
useEffect6(() => {
|
|
15972
15972
|
if (!editor) return;
|
|
15973
15973
|
const updateStates = () => {
|
|
15974
15974
|
const highlight = editor.getAttributes("highlight");
|
|
15975
|
-
setHighlightColor(
|
|
15976
|
-
const color =
|
|
15975
|
+
setHighlightColor(highlight?.color || "#ffff00");
|
|
15976
|
+
const color = editor.getAttributes("textStyle")?.color;
|
|
15977
15977
|
setTextColor(color || "#000000");
|
|
15978
|
-
const fontAttr =
|
|
15978
|
+
const fontAttr = editor.getAttributes("fontFamily")?.font || "Arial";
|
|
15979
15979
|
setFontFamily(fontAttr);
|
|
15980
|
-
const sizeAttr =
|
|
15980
|
+
const sizeAttr = editor.getAttributes("fontSize")?.size || "16px";
|
|
15981
15981
|
setFontSize(sizeAttr);
|
|
15982
15982
|
};
|
|
15983
15983
|
updateStates();
|
|
@@ -15988,7 +15988,7 @@ function FontStyleGroup({ editor }) {
|
|
|
15988
15988
|
editor.off("transaction", updateStates);
|
|
15989
15989
|
};
|
|
15990
15990
|
}, [editor]);
|
|
15991
|
-
return /* @__PURE__ */
|
|
15991
|
+
return /* @__PURE__ */ React7.createElement("div", { className: "font-style-group" }, /* @__PURE__ */ React7.createElement(
|
|
15992
15992
|
"select",
|
|
15993
15993
|
{
|
|
15994
15994
|
title: "Font Family",
|
|
@@ -15999,12 +15999,12 @@ function FontStyleGroup({ editor }) {
|
|
|
15999
15999
|
editor.chain().focus().setFontFamily(value).run();
|
|
16000
16000
|
}
|
|
16001
16001
|
},
|
|
16002
|
-
/* @__PURE__ */
|
|
16003
|
-
/* @__PURE__ */
|
|
16004
|
-
/* @__PURE__ */
|
|
16005
|
-
/* @__PURE__ */
|
|
16006
|
-
/* @__PURE__ */
|
|
16007
|
-
), /* @__PURE__ */
|
|
16002
|
+
/* @__PURE__ */ React7.createElement("option", { value: "Arial" }, "Arial"),
|
|
16003
|
+
/* @__PURE__ */ React7.createElement("option", { value: "Georgia" }, "Georgia"),
|
|
16004
|
+
/* @__PURE__ */ React7.createElement("option", { value: "Times New Roman" }, "Times New Roman"),
|
|
16005
|
+
/* @__PURE__ */ React7.createElement("option", { value: "Courier New" }, "Courier New"),
|
|
16006
|
+
/* @__PURE__ */ React7.createElement("option", { value: "Verdana" }, "Verdana")
|
|
16007
|
+
), /* @__PURE__ */ React7.createElement(
|
|
16008
16008
|
"select",
|
|
16009
16009
|
{
|
|
16010
16010
|
title: "Font Size",
|
|
@@ -16015,64 +16015,64 @@ function FontStyleGroup({ editor }) {
|
|
|
16015
16015
|
editor.chain().focus().setFontSize(value).run();
|
|
16016
16016
|
}
|
|
16017
16017
|
},
|
|
16018
|
-
/* @__PURE__ */
|
|
16019
|
-
/* @__PURE__ */
|
|
16020
|
-
/* @__PURE__ */
|
|
16021
|
-
/* @__PURE__ */
|
|
16022
|
-
/* @__PURE__ */
|
|
16023
|
-
/* @__PURE__ */
|
|
16024
|
-
/* @__PURE__ */
|
|
16025
|
-
/* @__PURE__ */
|
|
16026
|
-
/* @__PURE__ */
|
|
16027
|
-
), /* @__PURE__ */
|
|
16018
|
+
/* @__PURE__ */ React7.createElement("option", { value: "12px" }, "12"),
|
|
16019
|
+
/* @__PURE__ */ React7.createElement("option", { value: "14px" }, "14"),
|
|
16020
|
+
/* @__PURE__ */ React7.createElement("option", { value: "16px" }, "16"),
|
|
16021
|
+
/* @__PURE__ */ React7.createElement("option", { value: "18px" }, "18"),
|
|
16022
|
+
/* @__PURE__ */ React7.createElement("option", { value: "24px" }, "24"),
|
|
16023
|
+
/* @__PURE__ */ React7.createElement("option", { value: "36px" }, "36"),
|
|
16024
|
+
/* @__PURE__ */ React7.createElement("option", { value: "48px" }, "48"),
|
|
16025
|
+
/* @__PURE__ */ React7.createElement("option", { value: "64px" }, "64"),
|
|
16026
|
+
/* @__PURE__ */ React7.createElement("option", { value: "72px" }, "72")
|
|
16027
|
+
), /* @__PURE__ */ React7.createElement(
|
|
16028
16028
|
ToolbarButton_default,
|
|
16029
16029
|
{
|
|
16030
|
-
icon:
|
|
16030
|
+
icon: MdFormatBold,
|
|
16031
16031
|
label: "Bold",
|
|
16032
16032
|
onClick: () => editor.chain().focus().toggleBold().run(),
|
|
16033
16033
|
isActive: editor.isActive("bold")
|
|
16034
16034
|
}
|
|
16035
|
-
), /* @__PURE__ */
|
|
16035
|
+
), /* @__PURE__ */ React7.createElement(
|
|
16036
16036
|
ToolbarButton_default,
|
|
16037
16037
|
{
|
|
16038
|
-
icon:
|
|
16038
|
+
icon: MdFormatItalic,
|
|
16039
16039
|
label: "Italic",
|
|
16040
16040
|
onClick: () => editor.chain().focus().toggleItalic().run(),
|
|
16041
16041
|
isActive: editor.isActive("italic")
|
|
16042
16042
|
}
|
|
16043
|
-
), /* @__PURE__ */
|
|
16043
|
+
), /* @__PURE__ */ React7.createElement(
|
|
16044
16044
|
ToolbarButton_default,
|
|
16045
16045
|
{
|
|
16046
|
-
icon:
|
|
16046
|
+
icon: MdFormatUnderlined,
|
|
16047
16047
|
label: "Underline",
|
|
16048
16048
|
onClick: () => editor.chain().focus().toggleUnderline().run(),
|
|
16049
16049
|
isActive: editor.isActive("underline")
|
|
16050
16050
|
}
|
|
16051
|
-
), /* @__PURE__ */
|
|
16051
|
+
), /* @__PURE__ */ React7.createElement(
|
|
16052
16052
|
ToolbarButton_default,
|
|
16053
16053
|
{
|
|
16054
|
-
icon:
|
|
16054
|
+
icon: MdStrikethroughS,
|
|
16055
16055
|
label: "Strikethrough",
|
|
16056
16056
|
onClick: () => editor.chain().focus().toggleStrike().run(),
|
|
16057
16057
|
isActive: editor.isActive("strike")
|
|
16058
16058
|
}
|
|
16059
|
-
), /* @__PURE__ */
|
|
16059
|
+
), /* @__PURE__ */ React7.createElement(
|
|
16060
16060
|
ToolbarButton_default,
|
|
16061
16061
|
{
|
|
16062
|
-
icon:
|
|
16062
|
+
icon: MdSubscript,
|
|
16063
16063
|
label: "Subscript",
|
|
16064
16064
|
onClick: () => editor.chain().focus().toggleSubscript().run(),
|
|
16065
16065
|
isActive: editor.isActive("subscript")
|
|
16066
16066
|
}
|
|
16067
|
-
), /* @__PURE__ */
|
|
16067
|
+
), /* @__PURE__ */ React7.createElement(
|
|
16068
16068
|
ToolbarButton_default,
|
|
16069
16069
|
{
|
|
16070
|
-
icon:
|
|
16070
|
+
icon: MdSuperscript,
|
|
16071
16071
|
label: "Superscript",
|
|
16072
16072
|
onClick: () => editor.chain().focus().toggleSuperscript().run(),
|
|
16073
16073
|
isActive: editor.isActive("superscript")
|
|
16074
16074
|
}
|
|
16075
|
-
), /* @__PURE__ */
|
|
16075
|
+
), /* @__PURE__ */ React7.createElement(
|
|
16076
16076
|
"label",
|
|
16077
16077
|
{
|
|
16078
16078
|
title: "Font Color",
|
|
@@ -16080,9 +16080,9 @@ function FontStyleGroup({ editor }) {
|
|
|
16080
16080
|
className: "color-label",
|
|
16081
16081
|
style: { "--indicator-color": textColor }
|
|
16082
16082
|
},
|
|
16083
|
-
/* @__PURE__ */
|
|
16084
|
-
/* @__PURE__ */
|
|
16085
|
-
/* @__PURE__ */
|
|
16083
|
+
/* @__PURE__ */ React7.createElement(ImTextColor, { size: 20 }),
|
|
16084
|
+
/* @__PURE__ */ React7.createElement("div", { className: "color-indicator" }),
|
|
16085
|
+
/* @__PURE__ */ React7.createElement(
|
|
16086
16086
|
"input",
|
|
16087
16087
|
{
|
|
16088
16088
|
type: "color",
|
|
@@ -16094,7 +16094,7 @@ function FontStyleGroup({ editor }) {
|
|
|
16094
16094
|
}
|
|
16095
16095
|
}
|
|
16096
16096
|
)
|
|
16097
|
-
), /* @__PURE__ */
|
|
16097
|
+
), /* @__PURE__ */ React7.createElement(
|
|
16098
16098
|
"label",
|
|
16099
16099
|
{
|
|
16100
16100
|
title: "Highlight Color",
|
|
@@ -16102,9 +16102,9 @@ function FontStyleGroup({ editor }) {
|
|
|
16102
16102
|
className: "color-label",
|
|
16103
16103
|
style: { "--indicator-color": highlightColor }
|
|
16104
16104
|
},
|
|
16105
|
-
/* @__PURE__ */
|
|
16106
|
-
/* @__PURE__ */
|
|
16107
|
-
/* @__PURE__ */
|
|
16105
|
+
/* @__PURE__ */ React7.createElement(BiSolidColorFill, { size: 20 }),
|
|
16106
|
+
/* @__PURE__ */ React7.createElement("div", { className: "color-indicator" }),
|
|
16107
|
+
/* @__PURE__ */ React7.createElement(
|
|
16108
16108
|
"input",
|
|
16109
16109
|
{
|
|
16110
16110
|
type: "color",
|
|
@@ -16116,17 +16116,17 @@ function FontStyleGroup({ editor }) {
|
|
|
16116
16116
|
}
|
|
16117
16117
|
}
|
|
16118
16118
|
)
|
|
16119
|
-
), /* @__PURE__ */
|
|
16119
|
+
), /* @__PURE__ */ React7.createElement(
|
|
16120
16120
|
ToolbarButton_default,
|
|
16121
16121
|
{
|
|
16122
|
-
icon:
|
|
16122
|
+
icon: MdFormatClear,
|
|
16123
16123
|
label: "Clear Formatting",
|
|
16124
16124
|
onClick: () => editor.chain().focus().unsetAllMarks().run()
|
|
16125
16125
|
}
|
|
16126
|
-
), /* @__PURE__ */
|
|
16126
|
+
), /* @__PURE__ */ React7.createElement(
|
|
16127
16127
|
ToolbarButton_default,
|
|
16128
16128
|
{
|
|
16129
|
-
icon:
|
|
16129
|
+
icon: MdFormatPaint2,
|
|
16130
16130
|
label: "Apply Painter Format",
|
|
16131
16131
|
onClick: () => {
|
|
16132
16132
|
const format = JSON.parse(
|
|
@@ -16142,25 +16142,25 @@ function FontStyleGroup({ editor }) {
|
|
|
16142
16142
|
}
|
|
16143
16143
|
|
|
16144
16144
|
// src/components/tetrons/toolbar/InsertGroup.tsx
|
|
16145
|
-
|
|
16146
|
-
|
|
16147
|
-
|
|
16148
|
-
|
|
16149
|
-
|
|
16150
|
-
|
|
16151
|
-
|
|
16152
|
-
|
|
16153
|
-
|
|
16154
|
-
|
|
16155
|
-
|
|
16156
|
-
|
|
16145
|
+
import React8, { useRef as useRef4, useState as useState6 } from "react";
|
|
16146
|
+
import {
|
|
16147
|
+
MdTableChart,
|
|
16148
|
+
MdInsertPhoto,
|
|
16149
|
+
MdInsertLink,
|
|
16150
|
+
MdInsertComment,
|
|
16151
|
+
MdInsertEmoticon,
|
|
16152
|
+
MdHorizontalRule,
|
|
16153
|
+
MdVideoLibrary,
|
|
16154
|
+
MdOutlineOndemandVideo
|
|
16155
|
+
} from "react-icons/md";
|
|
16156
|
+
import Picker from "@emoji-mart/react";
|
|
16157
16157
|
function InsertGroup({ editor }) {
|
|
16158
|
-
const [showTableGrid, setShowTableGrid] =
|
|
16159
|
-
const [selectedRows, setSelectedRows] =
|
|
16160
|
-
const [selectedCols, setSelectedCols] =
|
|
16161
|
-
const imageInputRef =
|
|
16162
|
-
const videoInputRef =
|
|
16163
|
-
const [showPicker, setShowPicker] =
|
|
16158
|
+
const [showTableGrid, setShowTableGrid] = useState6(false);
|
|
16159
|
+
const [selectedRows, setSelectedRows] = useState6(1);
|
|
16160
|
+
const [selectedCols, setSelectedCols] = useState6(1);
|
|
16161
|
+
const imageInputRef = useRef4(null);
|
|
16162
|
+
const videoInputRef = useRef4(null);
|
|
16163
|
+
const [showPicker, setShowPicker] = useState6(false);
|
|
16164
16164
|
const addEmoji = (emoji) => {
|
|
16165
16165
|
editor.chain().focus().insertContent(emoji.native).run();
|
|
16166
16166
|
setShowPicker(false);
|
|
@@ -16180,7 +16180,7 @@ function InsertGroup({ editor }) {
|
|
|
16180
16180
|
setSelectedCols(1);
|
|
16181
16181
|
};
|
|
16182
16182
|
const handleImageUpload = (e) => {
|
|
16183
|
-
const file =
|
|
16183
|
+
const file = e.target.files?.[0];
|
|
16184
16184
|
if (file) {
|
|
16185
16185
|
const reader = new FileReader();
|
|
16186
16186
|
reader.onload = () => {
|
|
@@ -16190,7 +16190,7 @@ function InsertGroup({ editor }) {
|
|
|
16190
16190
|
}
|
|
16191
16191
|
};
|
|
16192
16192
|
const handleVideoUpload = (e) => {
|
|
16193
|
-
const file =
|
|
16193
|
+
const file = e.target.files?.[0];
|
|
16194
16194
|
if (file) {
|
|
16195
16195
|
const reader = new FileReader();
|
|
16196
16196
|
reader.onload = () => {
|
|
@@ -16225,11 +16225,11 @@ function InsertGroup({ editor }) {
|
|
|
16225
16225
|
return url.replace("/maps/", "/maps/embed/");
|
|
16226
16226
|
}
|
|
16227
16227
|
return url;
|
|
16228
|
-
} catch
|
|
16228
|
+
} catch {
|
|
16229
16229
|
return url;
|
|
16230
16230
|
}
|
|
16231
16231
|
}
|
|
16232
|
-
return /* @__PURE__ */
|
|
16232
|
+
return /* @__PURE__ */ React8.createElement("div", { className: "insert-group" }, /* @__PURE__ */ React8.createElement(
|
|
16233
16233
|
"input",
|
|
16234
16234
|
{
|
|
16235
16235
|
type: "file",
|
|
@@ -16240,7 +16240,7 @@ function InsertGroup({ editor }) {
|
|
|
16240
16240
|
"aria-label": "Upload Image",
|
|
16241
16241
|
title: "Upload Image"
|
|
16242
16242
|
}
|
|
16243
|
-
), /* @__PURE__ */
|
|
16243
|
+
), /* @__PURE__ */ React8.createElement(
|
|
16244
16244
|
"input",
|
|
16245
16245
|
{
|
|
16246
16246
|
type: "file",
|
|
@@ -16251,23 +16251,23 @@ function InsertGroup({ editor }) {
|
|
|
16251
16251
|
"aria-label": "Upload Video",
|
|
16252
16252
|
title: "Upload Video"
|
|
16253
16253
|
}
|
|
16254
|
-
), /* @__PURE__ */
|
|
16254
|
+
), /* @__PURE__ */ React8.createElement(
|
|
16255
16255
|
ToolbarButton_default,
|
|
16256
16256
|
{
|
|
16257
|
-
icon:
|
|
16257
|
+
icon: MdTableChart,
|
|
16258
16258
|
label: "Insert Table",
|
|
16259
16259
|
onClick: () => setShowTableGrid(!showTableGrid)
|
|
16260
16260
|
}
|
|
16261
|
-
), showTableGrid && /* @__PURE__ */
|
|
16261
|
+
), showTableGrid && /* @__PURE__ */ React8.createElement(
|
|
16262
16262
|
"div",
|
|
16263
16263
|
{
|
|
16264
16264
|
className: "table-grid-popup",
|
|
16265
16265
|
onMouseLeave: () => setShowTableGrid(false)
|
|
16266
16266
|
},
|
|
16267
|
-
/* @__PURE__ */
|
|
16267
|
+
/* @__PURE__ */ React8.createElement("div", { className: "table-grid" }, [...Array(10)].map(
|
|
16268
16268
|
(_, row) => [...Array(10)].map((_2, col) => {
|
|
16269
16269
|
const isSelected = row < selectedRows && col < selectedCols;
|
|
16270
|
-
return /* @__PURE__ */
|
|
16270
|
+
return /* @__PURE__ */ React8.createElement(
|
|
16271
16271
|
"div",
|
|
16272
16272
|
{
|
|
16273
16273
|
key: `${row}-${col}`,
|
|
@@ -16278,25 +16278,25 @@ function InsertGroup({ editor }) {
|
|
|
16278
16278
|
);
|
|
16279
16279
|
})
|
|
16280
16280
|
)),
|
|
16281
|
-
/* @__PURE__ */
|
|
16282
|
-
), /* @__PURE__ */
|
|
16281
|
+
/* @__PURE__ */ React8.createElement("div", { className: "table-grid-label" }, selectedRows, " x ", selectedCols)
|
|
16282
|
+
), /* @__PURE__ */ React8.createElement(
|
|
16283
16283
|
ToolbarButton_default,
|
|
16284
16284
|
{
|
|
16285
|
-
icon:
|
|
16285
|
+
icon: MdInsertPhoto,
|
|
16286
16286
|
label: "Insert Image",
|
|
16287
|
-
onClick: () =>
|
|
16287
|
+
onClick: () => imageInputRef.current?.click()
|
|
16288
16288
|
}
|
|
16289
|
-
), /* @__PURE__ */
|
|
16289
|
+
), /* @__PURE__ */ React8.createElement(
|
|
16290
16290
|
ToolbarButton_default,
|
|
16291
16291
|
{
|
|
16292
|
-
icon:
|
|
16292
|
+
icon: MdVideoLibrary,
|
|
16293
16293
|
label: "Insert Video",
|
|
16294
|
-
onClick: () =>
|
|
16294
|
+
onClick: () => videoInputRef.current?.click()
|
|
16295
16295
|
}
|
|
16296
|
-
), /* @__PURE__ */
|
|
16296
|
+
), /* @__PURE__ */ React8.createElement(
|
|
16297
16297
|
ToolbarButton_default,
|
|
16298
16298
|
{
|
|
16299
|
-
icon:
|
|
16299
|
+
icon: MdInsertLink,
|
|
16300
16300
|
label: "Insert Link",
|
|
16301
16301
|
onClick: () => {
|
|
16302
16302
|
const url = prompt("Enter URL");
|
|
@@ -16305,10 +16305,10 @@ function InsertGroup({ editor }) {
|
|
|
16305
16305
|
}
|
|
16306
16306
|
}
|
|
16307
16307
|
}
|
|
16308
|
-
), /* @__PURE__ */
|
|
16308
|
+
), /* @__PURE__ */ React8.createElement(
|
|
16309
16309
|
ToolbarButton_default,
|
|
16310
16310
|
{
|
|
16311
|
-
icon:
|
|
16311
|
+
icon: MdInsertComment,
|
|
16312
16312
|
label: "Insert Comment",
|
|
16313
16313
|
onClick: () => {
|
|
16314
16314
|
const comment = prompt("Enter your comment");
|
|
@@ -16319,15 +16319,15 @@ function InsertGroup({ editor }) {
|
|
|
16319
16319
|
}
|
|
16320
16320
|
}
|
|
16321
16321
|
}
|
|
16322
|
-
), /* @__PURE__ */
|
|
16322
|
+
), /* @__PURE__ */ React8.createElement("div", { className: "relative" }, /* @__PURE__ */ React8.createElement(
|
|
16323
16323
|
ToolbarButton_default,
|
|
16324
16324
|
{
|
|
16325
|
-
icon:
|
|
16325
|
+
icon: MdInsertEmoticon,
|
|
16326
16326
|
label: "Emoji",
|
|
16327
16327
|
onClick: () => setShowPicker(!showPicker)
|
|
16328
16328
|
}
|
|
16329
|
-
), showPicker && /* @__PURE__ */
|
|
16330
|
-
|
|
16329
|
+
), showPicker && /* @__PURE__ */ React8.createElement("div", { className: "emoji-picker" }, /* @__PURE__ */ React8.createElement(
|
|
16330
|
+
Picker,
|
|
16331
16331
|
{
|
|
16332
16332
|
onEmojiSelect: addEmoji,
|
|
16333
16333
|
theme: "auto",
|
|
@@ -16336,17 +16336,17 @@ function InsertGroup({ editor }) {
|
|
|
16336
16336
|
showSkinTones: true,
|
|
16337
16337
|
emojiTooltip: true
|
|
16338
16338
|
}
|
|
16339
|
-
))), /* @__PURE__ */
|
|
16339
|
+
))), /* @__PURE__ */ React8.createElement(
|
|
16340
16340
|
ToolbarButton_default,
|
|
16341
16341
|
{
|
|
16342
|
-
icon:
|
|
16342
|
+
icon: MdHorizontalRule,
|
|
16343
16343
|
label: "Horizontal Line",
|
|
16344
16344
|
onClick: () => editor.chain().focus().setHorizontalRule().run()
|
|
16345
16345
|
}
|
|
16346
|
-
), /* @__PURE__ */
|
|
16346
|
+
), /* @__PURE__ */ React8.createElement(
|
|
16347
16347
|
ToolbarButton_default,
|
|
16348
16348
|
{
|
|
16349
|
-
icon:
|
|
16349
|
+
icon: MdOutlineOndemandVideo,
|
|
16350
16350
|
label: "Embed",
|
|
16351
16351
|
onClick: () => {
|
|
16352
16352
|
const url = prompt(
|
|
@@ -16367,78 +16367,78 @@ function InsertGroup({ editor }) {
|
|
|
16367
16367
|
}
|
|
16368
16368
|
|
|
16369
16369
|
// src/components/tetrons/toolbar/ListAlignGroup.tsx
|
|
16370
|
-
|
|
16371
|
-
|
|
16372
|
-
|
|
16373
|
-
|
|
16374
|
-
|
|
16375
|
-
|
|
16376
|
-
|
|
16377
|
-
|
|
16378
|
-
|
|
16379
|
-
|
|
16380
|
-
|
|
16370
|
+
import React9 from "react";
|
|
16371
|
+
import {
|
|
16372
|
+
MdFormatListBulleted,
|
|
16373
|
+
MdFormatListNumbered,
|
|
16374
|
+
MdFormatIndentDecrease,
|
|
16375
|
+
MdFormatIndentIncrease,
|
|
16376
|
+
MdFormatAlignLeft,
|
|
16377
|
+
MdFormatAlignCenter,
|
|
16378
|
+
MdFormatAlignRight,
|
|
16379
|
+
MdFormatAlignJustify
|
|
16380
|
+
} from "react-icons/md";
|
|
16381
16381
|
function ListAlignGroup({ editor }) {
|
|
16382
|
-
return /* @__PURE__ */
|
|
16382
|
+
return /* @__PURE__ */ React9.createElement("div", { className: "list-align-group" }, /* @__PURE__ */ React9.createElement(
|
|
16383
16383
|
ToolbarButton_default,
|
|
16384
16384
|
{
|
|
16385
|
-
icon:
|
|
16385
|
+
icon: MdFormatListBulleted,
|
|
16386
16386
|
title: "Bulleted List",
|
|
16387
16387
|
onClick: () => editor.chain().focus().toggleBulletList().run(),
|
|
16388
16388
|
disabled: !editor.can().toggleBulletList()
|
|
16389
16389
|
}
|
|
16390
|
-
), /* @__PURE__ */
|
|
16390
|
+
), /* @__PURE__ */ React9.createElement(
|
|
16391
16391
|
ToolbarButton_default,
|
|
16392
16392
|
{
|
|
16393
|
-
icon:
|
|
16393
|
+
icon: MdFormatListNumbered,
|
|
16394
16394
|
title: "Numbered List",
|
|
16395
16395
|
onClick: () => editor.chain().focus().toggleOrderedList().run(),
|
|
16396
16396
|
disabled: !editor.can().toggleOrderedList()
|
|
16397
16397
|
}
|
|
16398
|
-
), /* @__PURE__ */
|
|
16398
|
+
), /* @__PURE__ */ React9.createElement(
|
|
16399
16399
|
ToolbarButton_default,
|
|
16400
16400
|
{
|
|
16401
|
-
icon:
|
|
16401
|
+
icon: MdFormatIndentIncrease,
|
|
16402
16402
|
title: "Increase Indent",
|
|
16403
16403
|
onClick: () => editor.chain().focus().sinkListItem("listItem").run(),
|
|
16404
16404
|
disabled: !editor.can().sinkListItem("listItem")
|
|
16405
16405
|
}
|
|
16406
|
-
), /* @__PURE__ */
|
|
16406
|
+
), /* @__PURE__ */ React9.createElement(
|
|
16407
16407
|
ToolbarButton_default,
|
|
16408
16408
|
{
|
|
16409
|
-
icon:
|
|
16409
|
+
icon: MdFormatIndentDecrease,
|
|
16410
16410
|
title: "Decrease Indent",
|
|
16411
16411
|
onClick: () => editor.chain().focus().liftListItem("listItem").run(),
|
|
16412
16412
|
disabled: !editor.can().liftListItem("listItem")
|
|
16413
16413
|
}
|
|
16414
|
-
), /* @__PURE__ */
|
|
16414
|
+
), /* @__PURE__ */ React9.createElement(
|
|
16415
16415
|
ToolbarButton_default,
|
|
16416
16416
|
{
|
|
16417
|
-
icon:
|
|
16417
|
+
icon: MdFormatAlignLeft,
|
|
16418
16418
|
title: "Align Left",
|
|
16419
16419
|
onClick: () => editor.chain().focus().setTextAlign("left").run(),
|
|
16420
16420
|
disabled: !editor.can().setTextAlign("left")
|
|
16421
16421
|
}
|
|
16422
|
-
), /* @__PURE__ */
|
|
16422
|
+
), /* @__PURE__ */ React9.createElement(
|
|
16423
16423
|
ToolbarButton_default,
|
|
16424
16424
|
{
|
|
16425
|
-
icon:
|
|
16425
|
+
icon: MdFormatAlignCenter,
|
|
16426
16426
|
title: "Align Center",
|
|
16427
16427
|
onClick: () => editor.chain().focus().setTextAlign("center").run(),
|
|
16428
16428
|
disabled: !editor.can().setTextAlign("center")
|
|
16429
16429
|
}
|
|
16430
|
-
), /* @__PURE__ */
|
|
16430
|
+
), /* @__PURE__ */ React9.createElement(
|
|
16431
16431
|
ToolbarButton_default,
|
|
16432
16432
|
{
|
|
16433
|
-
icon:
|
|
16433
|
+
icon: MdFormatAlignRight,
|
|
16434
16434
|
title: "Align Right",
|
|
16435
16435
|
onClick: () => editor.chain().focus().setTextAlign("right").run(),
|
|
16436
16436
|
disabled: !editor.can().setTextAlign("right")
|
|
16437
16437
|
}
|
|
16438
|
-
), /* @__PURE__ */
|
|
16438
|
+
), /* @__PURE__ */ React9.createElement(
|
|
16439
16439
|
ToolbarButton_default,
|
|
16440
16440
|
{
|
|
16441
|
-
icon:
|
|
16441
|
+
icon: MdFormatAlignJustify,
|
|
16442
16442
|
title: "Justify",
|
|
16443
16443
|
onClick: () => editor.chain().focus().setTextAlign("justify").run(),
|
|
16444
16444
|
disabled: !editor.can().setTextAlign("justify")
|
|
@@ -16447,15 +16447,15 @@ function ListAlignGroup({ editor }) {
|
|
|
16447
16447
|
}
|
|
16448
16448
|
|
|
16449
16449
|
// src/components/tetrons/toolbar/MiscGroup.tsx
|
|
16450
|
-
|
|
16451
|
-
|
|
16452
|
-
|
|
16453
|
-
|
|
16454
|
-
|
|
16455
|
-
|
|
16456
|
-
|
|
16457
|
-
|
|
16458
|
-
|
|
16450
|
+
import React10 from "react";
|
|
16451
|
+
import {
|
|
16452
|
+
MdUndo,
|
|
16453
|
+
MdRedo,
|
|
16454
|
+
MdRefresh,
|
|
16455
|
+
MdVisibility,
|
|
16456
|
+
MdCode,
|
|
16457
|
+
MdSpellcheck
|
|
16458
|
+
} from "react-icons/md";
|
|
16459
16459
|
|
|
16460
16460
|
// src/utils/checkGrammar.ts
|
|
16461
16461
|
async function checkGrammar(text) {
|
|
@@ -16520,48 +16520,48 @@ Reason: ${issue.message}
|
|
|
16520
16520
|
alert("\u274C Failed to check grammar. Please try again later.");
|
|
16521
16521
|
}
|
|
16522
16522
|
};
|
|
16523
|
-
return /* @__PURE__ */
|
|
16523
|
+
return /* @__PURE__ */ React10.createElement("div", { className: "misc-group" }, /* @__PURE__ */ React10.createElement(
|
|
16524
16524
|
ToolbarButton_default,
|
|
16525
16525
|
{
|
|
16526
|
-
icon:
|
|
16526
|
+
icon: MdUndo,
|
|
16527
16527
|
label: "Undo",
|
|
16528
16528
|
onClick: () => editor.chain().focus().undo().run(),
|
|
16529
16529
|
disabled: !editor.can().undo()
|
|
16530
16530
|
}
|
|
16531
|
-
), /* @__PURE__ */
|
|
16531
|
+
), /* @__PURE__ */ React10.createElement(
|
|
16532
16532
|
ToolbarButton_default,
|
|
16533
16533
|
{
|
|
16534
|
-
icon:
|
|
16534
|
+
icon: MdRedo,
|
|
16535
16535
|
label: "Redo",
|
|
16536
16536
|
onClick: () => editor.chain().focus().redo().run(),
|
|
16537
16537
|
disabled: !editor.can().redo()
|
|
16538
16538
|
}
|
|
16539
|
-
), /* @__PURE__ */
|
|
16539
|
+
), /* @__PURE__ */ React10.createElement(
|
|
16540
16540
|
ToolbarButton_default,
|
|
16541
16541
|
{
|
|
16542
|
-
icon:
|
|
16542
|
+
icon: MdRefresh,
|
|
16543
16543
|
label: "Reset Formatting",
|
|
16544
16544
|
onClick: () => editor.chain().focus().unsetAllMarks().clearNodes().run()
|
|
16545
16545
|
}
|
|
16546
|
-
), /* @__PURE__ */
|
|
16546
|
+
), /* @__PURE__ */ React10.createElement(
|
|
16547
16547
|
ToolbarButton_default,
|
|
16548
16548
|
{
|
|
16549
|
-
icon:
|
|
16549
|
+
icon: MdCode,
|
|
16550
16550
|
label: "Toggle Code Block",
|
|
16551
16551
|
onClick: () => editor.chain().focus().toggleCodeBlock().run(),
|
|
16552
16552
|
isActive: editor.isActive("codeBlock")
|
|
16553
16553
|
}
|
|
16554
|
-
), /* @__PURE__ */
|
|
16554
|
+
), /* @__PURE__ */ React10.createElement(
|
|
16555
16555
|
ToolbarButton_default,
|
|
16556
16556
|
{
|
|
16557
|
-
icon:
|
|
16557
|
+
icon: MdVisibility,
|
|
16558
16558
|
label: "Preview",
|
|
16559
16559
|
onClick: handlePreview
|
|
16560
16560
|
}
|
|
16561
|
-
), /* @__PURE__ */
|
|
16561
|
+
), /* @__PURE__ */ React10.createElement(
|
|
16562
16562
|
ToolbarButton_default,
|
|
16563
16563
|
{
|
|
16564
|
-
icon:
|
|
16564
|
+
icon: MdSpellcheck,
|
|
16565
16565
|
label: "Check Grammar",
|
|
16566
16566
|
onClick: handleGrammarCheck
|
|
16567
16567
|
}
|
|
@@ -16569,11 +16569,11 @@ Reason: ${issue.message}
|
|
|
16569
16569
|
}
|
|
16570
16570
|
|
|
16571
16571
|
// src/components/tetrons/toolbar/FileGroup.tsx
|
|
16572
|
-
|
|
16573
|
-
|
|
16574
|
-
|
|
16572
|
+
import { FaRegFolderOpen } from "react-icons/fa";
|
|
16573
|
+
import { VscNewFile } from "react-icons/vsc";
|
|
16574
|
+
import React11, { useRef as useRef5 } from "react";
|
|
16575
16575
|
function FileGroup({ editor }) {
|
|
16576
|
-
const fileInputRef =
|
|
16576
|
+
const fileInputRef = useRef5(null);
|
|
16577
16577
|
const handleNew = () => {
|
|
16578
16578
|
if (confirm(
|
|
16579
16579
|
"Are you sure you want to create a new document? Unsaved changes will be lost."
|
|
@@ -16582,10 +16582,10 @@ function FileGroup({ editor }) {
|
|
|
16582
16582
|
}
|
|
16583
16583
|
};
|
|
16584
16584
|
const handleOpen = () => {
|
|
16585
|
-
|
|
16585
|
+
fileInputRef.current?.click();
|
|
16586
16586
|
};
|
|
16587
16587
|
const handleFileChange = async (e) => {
|
|
16588
|
-
const file =
|
|
16588
|
+
const file = e.target.files?.[0];
|
|
16589
16589
|
if (!file) return;
|
|
16590
16590
|
try {
|
|
16591
16591
|
const text = await file.text();
|
|
@@ -16600,7 +16600,7 @@ function FileGroup({ editor }) {
|
|
|
16600
16600
|
e.target.value = "";
|
|
16601
16601
|
}
|
|
16602
16602
|
};
|
|
16603
|
-
return /* @__PURE__ */
|
|
16603
|
+
return /* @__PURE__ */ React11.createElement("div", { className: "file-group", role: "group", "aria-label": "File actions" }, /* @__PURE__ */ React11.createElement(
|
|
16604
16604
|
"input",
|
|
16605
16605
|
{
|
|
16606
16606
|
type: "file",
|
|
@@ -16610,10 +16610,10 @@ function FileGroup({ editor }) {
|
|
|
16610
16610
|
className: "hidden",
|
|
16611
16611
|
"aria-label": "Open JSON file"
|
|
16612
16612
|
}
|
|
16613
|
-
), /* @__PURE__ */
|
|
16613
|
+
), /* @__PURE__ */ React11.createElement(ToolbarButton_default, { icon: VscNewFile, onClick: handleNew, title: "New" }), /* @__PURE__ */ React11.createElement(
|
|
16614
16614
|
ToolbarButton_default,
|
|
16615
16615
|
{
|
|
16616
|
-
icon:
|
|
16616
|
+
icon: FaRegFolderOpen,
|
|
16617
16617
|
onClick: handleOpen,
|
|
16618
16618
|
title: "Open File"
|
|
16619
16619
|
}
|
|
@@ -16621,21 +16621,21 @@ function FileGroup({ editor }) {
|
|
|
16621
16621
|
}
|
|
16622
16622
|
|
|
16623
16623
|
// src/components/tetrons/toolbar/AIGroup.tsx
|
|
16624
|
-
|
|
16625
|
-
|
|
16626
|
-
|
|
16627
|
-
|
|
16624
|
+
import React12, { useState as useState7, useRef as useRef6 } from "react";
|
|
16625
|
+
import { FaMicrophone, FaStop } from "react-icons/fa";
|
|
16626
|
+
import { Waveform } from "@uiball/loaders";
|
|
16627
|
+
import { motion, AnimatePresence } from "framer-motion";
|
|
16628
16628
|
function AiGroup({ editor }) {
|
|
16629
|
-
const [isRecording, setIsRecording] =
|
|
16630
|
-
const [audioBlob, setAudioBlob] =
|
|
16631
|
-
const [isTranscribing, setIsTranscribing] =
|
|
16632
|
-
const [transcriptionError, setTranscriptionError] =
|
|
16633
|
-
const [showPromptInput, setShowPromptInput] =
|
|
16634
|
-
const [prompt2, setPrompt] =
|
|
16635
|
-
const [isLoadingAI, setIsLoadingAI] =
|
|
16636
|
-
const [aiError, setAiError] =
|
|
16637
|
-
const mediaRecorderRef =
|
|
16638
|
-
const chunksRef =
|
|
16629
|
+
const [isRecording, setIsRecording] = useState7(false);
|
|
16630
|
+
const [audioBlob, setAudioBlob] = useState7(null);
|
|
16631
|
+
const [isTranscribing, setIsTranscribing] = useState7(false);
|
|
16632
|
+
const [transcriptionError, setTranscriptionError] = useState7("");
|
|
16633
|
+
const [showPromptInput, setShowPromptInput] = useState7(false);
|
|
16634
|
+
const [prompt2, setPrompt] = useState7("");
|
|
16635
|
+
const [isLoadingAI, setIsLoadingAI] = useState7(false);
|
|
16636
|
+
const [aiError, setAiError] = useState7("");
|
|
16637
|
+
const mediaRecorderRef = useRef6(null);
|
|
16638
|
+
const chunksRef = useRef6([]);
|
|
16639
16639
|
const startRecording = async () => {
|
|
16640
16640
|
setTranscriptionError("");
|
|
16641
16641
|
setAudioBlob(null);
|
|
@@ -16655,7 +16655,7 @@ function AiGroup({ editor }) {
|
|
|
16655
16655
|
setIsRecording(true);
|
|
16656
16656
|
};
|
|
16657
16657
|
const stopRecording = () => {
|
|
16658
|
-
|
|
16658
|
+
mediaRecorderRef.current?.stop();
|
|
16659
16659
|
setIsRecording(false);
|
|
16660
16660
|
};
|
|
16661
16661
|
const transcribeAudio = async (blob) => {
|
|
@@ -16708,7 +16708,7 @@ function AiGroup({ editor }) {
|
|
|
16708
16708
|
setIsLoadingAI(false);
|
|
16709
16709
|
}
|
|
16710
16710
|
};
|
|
16711
|
-
return /* @__PURE__ */
|
|
16711
|
+
return /* @__PURE__ */ React12.createElement("div", { className: "group relative space-y-3" }, /* @__PURE__ */ React12.createElement("div", { className: "flex gap-2 items-center" }, !isRecording ? /* @__PURE__ */ React12.createElement(
|
|
16712
16712
|
"button",
|
|
16713
16713
|
{
|
|
16714
16714
|
type: "button",
|
|
@@ -16716,8 +16716,8 @@ function AiGroup({ editor }) {
|
|
|
16716
16716
|
className: "icon-btn",
|
|
16717
16717
|
title: "Start Voice Input"
|
|
16718
16718
|
},
|
|
16719
|
-
/* @__PURE__ */
|
|
16720
|
-
) : /* @__PURE__ */
|
|
16719
|
+
/* @__PURE__ */ React12.createElement(FaMicrophone, { size: 18 })
|
|
16720
|
+
) : /* @__PURE__ */ React12.createElement(
|
|
16721
16721
|
"button",
|
|
16722
16722
|
{
|
|
16723
16723
|
type: "button",
|
|
@@ -16725,8 +16725,8 @@ function AiGroup({ editor }) {
|
|
|
16725
16725
|
className: "icon-btn stop-btn",
|
|
16726
16726
|
title: "Stop Recording"
|
|
16727
16727
|
},
|
|
16728
|
-
/* @__PURE__ */
|
|
16729
|
-
), /* @__PURE__ */
|
|
16728
|
+
/* @__PURE__ */ React12.createElement(FaStop, { size: 18 })
|
|
16729
|
+
), /* @__PURE__ */ React12.createElement(
|
|
16730
16730
|
"button",
|
|
16731
16731
|
{
|
|
16732
16732
|
type: "button",
|
|
@@ -16735,24 +16735,24 @@ function AiGroup({ editor }) {
|
|
|
16735
16735
|
title: "AI Assist"
|
|
16736
16736
|
},
|
|
16737
16737
|
"AI"
|
|
16738
|
-
)), isRecording && /* @__PURE__ */
|
|
16739
|
-
|
|
16738
|
+
)), isRecording && /* @__PURE__ */ React12.createElement("div", { className: "flex flex-col items-center" }, /* @__PURE__ */ React12.createElement(Waveform, { size: 30, lineWeight: 3.5, speed: 1, color: "#4F46E5" }), /* @__PURE__ */ React12.createElement("p", { className: "text-sm mt-1 text-gray-600" }, "Recording...")), isTranscribing && /* @__PURE__ */ React12.createElement("p", { className: "text-sm text-gray-500" }, "Transcribing..."), transcriptionError && /* @__PURE__ */ React12.createElement("p", { className: "text-sm text-red-600" }, transcriptionError), audioBlob && /* @__PURE__ */ React12.createElement("div", { className: "mt-2" }, /* @__PURE__ */ React12.createElement("audio", { controls: true, src: URL.createObjectURL(audioBlob) })), /* @__PURE__ */ React12.createElement(AnimatePresence, null, showPromptInput && /* @__PURE__ */ React12.createElement(
|
|
16739
|
+
motion.div,
|
|
16740
16740
|
{
|
|
16741
16741
|
className: "ai-modal-backdrop",
|
|
16742
16742
|
initial: { opacity: 0 },
|
|
16743
16743
|
animate: { opacity: 1 },
|
|
16744
16744
|
exit: { opacity: 0 }
|
|
16745
16745
|
},
|
|
16746
|
-
/* @__PURE__ */
|
|
16747
|
-
|
|
16746
|
+
/* @__PURE__ */ React12.createElement(
|
|
16747
|
+
motion.div,
|
|
16748
16748
|
{
|
|
16749
16749
|
className: "ai-modal-content",
|
|
16750
16750
|
initial: { scale: 0.9, opacity: 0 },
|
|
16751
16751
|
animate: { scale: 1, opacity: 1 },
|
|
16752
16752
|
exit: { scale: 0.9, opacity: 0 }
|
|
16753
16753
|
},
|
|
16754
|
-
/* @__PURE__ */
|
|
16755
|
-
/* @__PURE__ */
|
|
16754
|
+
/* @__PURE__ */ React12.createElement("h2", { className: "ai-modal-title" }, "AI Prompt"),
|
|
16755
|
+
/* @__PURE__ */ React12.createElement(
|
|
16756
16756
|
"textarea",
|
|
16757
16757
|
{
|
|
16758
16758
|
className: "ai-modal-textarea",
|
|
@@ -16761,15 +16761,15 @@ function AiGroup({ editor }) {
|
|
|
16761
16761
|
placeholder: "Enter your prompt here..."
|
|
16762
16762
|
}
|
|
16763
16763
|
),
|
|
16764
|
-
aiError && /* @__PURE__ */
|
|
16765
|
-
/* @__PURE__ */
|
|
16764
|
+
aiError && /* @__PURE__ */ React12.createElement("p", { className: "ai-modal-error" }, aiError),
|
|
16765
|
+
/* @__PURE__ */ React12.createElement("div", { className: "ai-modal-actions" }, /* @__PURE__ */ React12.createElement(
|
|
16766
16766
|
"button",
|
|
16767
16767
|
{
|
|
16768
16768
|
onClick: () => setShowPromptInput(false),
|
|
16769
16769
|
className: "ai-cancel-btn"
|
|
16770
16770
|
},
|
|
16771
16771
|
"Cancel"
|
|
16772
|
-
), /* @__PURE__ */
|
|
16772
|
+
), /* @__PURE__ */ React12.createElement(
|
|
16773
16773
|
"button",
|
|
16774
16774
|
{
|
|
16775
16775
|
onClick: handlePromptSubmit,
|
|
@@ -16787,8 +16787,8 @@ function TetronsToolbar({
|
|
|
16787
16787
|
editor,
|
|
16788
16788
|
version
|
|
16789
16789
|
}) {
|
|
16790
|
-
const [autoSave, setAutoSave] =
|
|
16791
|
-
|
|
16790
|
+
const [autoSave, setAutoSave] = useState8(false);
|
|
16791
|
+
useEffect7(() => {
|
|
16792
16792
|
if (!editor) return;
|
|
16793
16793
|
const handleUpdate = () => {
|
|
16794
16794
|
if (!autoSave) return;
|
|
@@ -16804,7 +16804,7 @@ function TetronsToolbar({
|
|
|
16804
16804
|
editor.off("update", handleUpdate);
|
|
16805
16805
|
};
|
|
16806
16806
|
}, [autoSave, editor]);
|
|
16807
|
-
return /* @__PURE__ */
|
|
16807
|
+
return /* @__PURE__ */ React13.createElement("div", { className: "tetrons-toolbar" }, version !== "free" && /* @__PURE__ */ React13.createElement("div", { className: "group" }, /* @__PURE__ */ React13.createElement(
|
|
16808
16808
|
"input",
|
|
16809
16809
|
{
|
|
16810
16810
|
type: "checkbox",
|
|
@@ -16812,34 +16812,34 @@ function TetronsToolbar({
|
|
|
16812
16812
|
checked: autoSave,
|
|
16813
16813
|
onChange: (e) => setAutoSave(e.target.checked)
|
|
16814
16814
|
}
|
|
16815
|
-
), /* @__PURE__ */
|
|
16815
|
+
), /* @__PURE__ */ React13.createElement("label", { htmlFor: "autoSave" }, "Auto Save")), ["pro", "premium", "platinum"].includes(version) && /* @__PURE__ */ React13.createElement(FileGroup, { editor }), /* @__PURE__ */ React13.createElement(ClipboardGroup, { editor }), /* @__PURE__ */ React13.createElement(FontStyleGroup, { editor }), /* @__PURE__ */ React13.createElement(ListAlignGroup, { editor }), ["premium", "platinum"].includes(version) && /* @__PURE__ */ React13.createElement(React13.Fragment, null, /* @__PURE__ */ React13.createElement(InsertGroup, { editor }), /* @__PURE__ */ React13.createElement(ActionGroup, { editor })), version === "platinum" && /* @__PURE__ */ React13.createElement(React13.Fragment, null, /* @__PURE__ */ React13.createElement(MiscGroup, { editor }), /* @__PURE__ */ React13.createElement(AiGroup, { editor })));
|
|
16816
16816
|
}
|
|
16817
16817
|
|
|
16818
16818
|
// src/components/tetrons/EditorContent.tsx
|
|
16819
|
-
var lowlight =
|
|
16819
|
+
var lowlight = createLowlight();
|
|
16820
16820
|
lowlight.register("js", javascript);
|
|
16821
16821
|
lowlight.register("ts", typescript);
|
|
16822
16822
|
function EditorContent({ apiKey }) {
|
|
16823
16823
|
const typo = useTypo();
|
|
16824
|
-
const [isValid, setIsValid] =
|
|
16825
|
-
const [error, setError] =
|
|
16826
|
-
const [versions, setVersions] =
|
|
16827
|
-
const [userVersion, setUserVersion] =
|
|
16828
|
-
const [currentVersionIndex, setCurrentVersionIndex] =
|
|
16824
|
+
const [isValid, setIsValid] = useState9(null);
|
|
16825
|
+
const [error, setError] = useState9(null);
|
|
16826
|
+
const [versions, setVersions] = useState9([]);
|
|
16827
|
+
const [userVersion, setUserVersion] = useState9(null);
|
|
16828
|
+
const [currentVersionIndex, setCurrentVersionIndex] = useState9(
|
|
16829
16829
|
null
|
|
16830
16830
|
);
|
|
16831
|
-
const wrapperRef =
|
|
16831
|
+
const wrapperRef = useRef7(null);
|
|
16832
16832
|
function getApiBaseUrl() {
|
|
16833
|
-
if (typeof import.meta !== "undefined" &&
|
|
16833
|
+
if (typeof import.meta !== "undefined" && import.meta.env?.VITE_TETRONS_API_URL) {
|
|
16834
16834
|
return import.meta.env.VITE_TETRONS_API_URL;
|
|
16835
16835
|
}
|
|
16836
|
-
if (typeof process !== "undefined" &&
|
|
16836
|
+
if (typeof process !== "undefined" && process.env?.NEXT_PUBLIC_TETRONS_API_URL) {
|
|
16837
16837
|
return process.env.NEXT_PUBLIC_TETRONS_API_URL;
|
|
16838
16838
|
}
|
|
16839
16839
|
return "https://staging.tetrons.com";
|
|
16840
16840
|
}
|
|
16841
16841
|
const API_BASE_URL = getApiBaseUrl();
|
|
16842
|
-
|
|
16842
|
+
useEffect8(() => {
|
|
16843
16843
|
const validateKey = async () => {
|
|
16844
16844
|
try {
|
|
16845
16845
|
const res = await fetch(`${API_BASE_URL}/api/validate`, {
|
|
@@ -16860,7 +16860,7 @@ function EditorContent({ apiKey }) {
|
|
|
16860
16860
|
};
|
|
16861
16861
|
validateKey();
|
|
16862
16862
|
}, [apiKey, API_BASE_URL]);
|
|
16863
|
-
const editor =
|
|
16863
|
+
const editor = useEditor({
|
|
16864
16864
|
extensions: [
|
|
16865
16865
|
Document,
|
|
16866
16866
|
Paragraph,
|
|
@@ -16868,39 +16868,39 @@ function EditorContent({ apiKey }) {
|
|
|
16868
16868
|
History,
|
|
16869
16869
|
Bold,
|
|
16870
16870
|
Italic,
|
|
16871
|
-
|
|
16871
|
+
Underline,
|
|
16872
16872
|
Strike,
|
|
16873
16873
|
Code,
|
|
16874
16874
|
Blockquote,
|
|
16875
16875
|
HardBreak,
|
|
16876
16876
|
Heading.configure({ levels: [1, 2, 3, 4, 5, 6] }),
|
|
16877
16877
|
HorizontalRule,
|
|
16878
|
-
|
|
16879
|
-
|
|
16880
|
-
|
|
16878
|
+
TextStyle,
|
|
16879
|
+
Color,
|
|
16880
|
+
Highlight.configure({ multicolor: true }),
|
|
16881
16881
|
FontFamily,
|
|
16882
16882
|
FontSize,
|
|
16883
|
-
|
|
16883
|
+
TextAlign.configure({ types: ["heading", "paragraph"] }),
|
|
16884
16884
|
ListItem,
|
|
16885
16885
|
BulletList,
|
|
16886
16886
|
OrderedList,
|
|
16887
16887
|
Subscript,
|
|
16888
16888
|
Superscript,
|
|
16889
|
-
|
|
16890
|
-
|
|
16889
|
+
Image2,
|
|
16890
|
+
Link.configure({
|
|
16891
16891
|
openOnClick: false,
|
|
16892
16892
|
autolink: true,
|
|
16893
16893
|
linkOnPaste: true
|
|
16894
16894
|
}),
|
|
16895
16895
|
ResizableTable.configure({ resizable: true }),
|
|
16896
|
-
|
|
16897
|
-
|
|
16898
|
-
|
|
16896
|
+
TableRow,
|
|
16897
|
+
TableCell,
|
|
16898
|
+
TableHeader,
|
|
16899
16899
|
Embed,
|
|
16900
16900
|
ResizableImage,
|
|
16901
16901
|
ResizableVideo,
|
|
16902
16902
|
Comment,
|
|
16903
|
-
|
|
16903
|
+
CodeBlockLowlight.configure({
|
|
16904
16904
|
lowlight,
|
|
16905
16905
|
HTMLAttributes: {
|
|
16906
16906
|
class: "bg-gray-100 p-2 rounded font-mono text-sm overflow-auto"
|
|
@@ -16921,9 +16921,9 @@ function EditorContent({ apiKey }) {
|
|
|
16921
16921
|
},
|
|
16922
16922
|
immediatelyRender: false
|
|
16923
16923
|
});
|
|
16924
|
-
|
|
16924
|
+
useEffect8(() => {
|
|
16925
16925
|
return () => {
|
|
16926
|
-
|
|
16926
|
+
editor?.destroy();
|
|
16927
16927
|
};
|
|
16928
16928
|
}, [editor]);
|
|
16929
16929
|
const handleEditorClick = () => {
|
|
@@ -16946,15 +16946,15 @@ function EditorContent({ apiKey }) {
|
|
|
16946
16946
|
}
|
|
16947
16947
|
};
|
|
16948
16948
|
if (isValid === false) {
|
|
16949
|
-
return /* @__PURE__ */
|
|
16949
|
+
return /* @__PURE__ */ React14.createElement("div", { className: "editor-error" }, "\u26A0\uFE0F ", error);
|
|
16950
16950
|
}
|
|
16951
16951
|
if (isValid === null) {
|
|
16952
|
-
return /* @__PURE__ */
|
|
16952
|
+
return /* @__PURE__ */ React14.createElement("div", { className: "editor-loading" }, "\u{1F50D} Validating license...");
|
|
16953
16953
|
}
|
|
16954
16954
|
if (!typo) {
|
|
16955
|
-
return /* @__PURE__ */
|
|
16955
|
+
return /* @__PURE__ */ React14.createElement("div", { className: "editor-loading" }, "\u{1F4D6} Loading dictionary...");
|
|
16956
16956
|
}
|
|
16957
|
-
return /* @__PURE__ */
|
|
16957
|
+
return /* @__PURE__ */ React14.createElement("div", { className: "editor-container" }, userVersion !== "free" && /* @__PURE__ */ React14.createElement("div", { className: "editor-toolbar" }, /* @__PURE__ */ React14.createElement(
|
|
16958
16958
|
"button",
|
|
16959
16959
|
{
|
|
16960
16960
|
type: "button",
|
|
@@ -16963,7 +16963,7 @@ function EditorContent({ apiKey }) {
|
|
|
16963
16963
|
className: "editor-save-btn"
|
|
16964
16964
|
},
|
|
16965
16965
|
"Save Version"
|
|
16966
|
-
), /* @__PURE__ */
|
|
16966
|
+
), /* @__PURE__ */ React14.createElement("div", { className: "editor-versions-wrapper" }, versions.length === 0 ? /* @__PURE__ */ React14.createElement("span", { className: "editor-no-versions" }, "No saved versions") : versions.map((_, idx) => /* @__PURE__ */ React14.createElement(
|
|
16967
16967
|
"button",
|
|
16968
16968
|
{
|
|
16969
16969
|
key: idx,
|
|
@@ -16973,14 +16973,14 @@ function EditorContent({ apiKey }) {
|
|
|
16973
16973
|
title: `Restore Version ${idx + 1}`
|
|
16974
16974
|
},
|
|
16975
16975
|
`V${idx + 1}`
|
|
16976
|
-
)))), editor && userVersion && /* @__PURE__ */
|
|
16976
|
+
)))), editor && userVersion && /* @__PURE__ */ React14.createElement(TetronsToolbar, { editor, version: userVersion }), /* @__PURE__ */ React14.createElement(
|
|
16977
16977
|
"div",
|
|
16978
16978
|
{
|
|
16979
16979
|
ref: wrapperRef,
|
|
16980
16980
|
className: "editor-content-wrapper",
|
|
16981
16981
|
onClick: handleEditorClick
|
|
16982
16982
|
},
|
|
16983
|
-
editor ? /* @__PURE__ */
|
|
16983
|
+
editor ? /* @__PURE__ */ React14.createElement(React14.Fragment, null, /* @__PURE__ */ React14.createElement(TiptapEditorContent, { editor }), /* @__PURE__ */ React14.createElement(TableContextMenu, { editor })) : /* @__PURE__ */ React14.createElement("div", { className: "editor-loading" }, "Loading editor...")
|
|
16984
16984
|
));
|
|
16985
16985
|
}
|
|
16986
16986
|
|
|
@@ -17000,8 +17000,8 @@ function getInstallDateKey() {
|
|
|
17000
17000
|
async function getOrCreateInstallDate() {
|
|
17001
17001
|
const key = getInstallDateKey();
|
|
17002
17002
|
if (isNode) {
|
|
17003
|
-
const fs = await
|
|
17004
|
-
const path = await
|
|
17003
|
+
const fs = await import("fs");
|
|
17004
|
+
const path = await import("path");
|
|
17005
17005
|
const usagePath = path.join(process.cwd(), ".tetrons-usage.json");
|
|
17006
17006
|
if (fs.existsSync(usagePath)) {
|
|
17007
17007
|
const data = JSON.parse(fs.readFileSync(usagePath, "utf-8"));
|
|
@@ -17069,11 +17069,11 @@ async function getTetronsRemainingDays() {
|
|
|
17069
17069
|
return getRemainingDays(installedAt, validityDays);
|
|
17070
17070
|
}
|
|
17071
17071
|
var index_default = EditorContent;
|
|
17072
|
-
|
|
17073
|
-
|
|
17074
|
-
|
|
17075
|
-
|
|
17076
|
-
|
|
17077
|
-
|
|
17078
|
-
|
|
17079
|
-
|
|
17072
|
+
export {
|
|
17073
|
+
EditorContent,
|
|
17074
|
+
index_default as default,
|
|
17075
|
+
getTetronsRemainingDays,
|
|
17076
|
+
getTetronsVersion,
|
|
17077
|
+
initializeTetrons,
|
|
17078
|
+
isApiKeyValid
|
|
17079
|
+
};
|