@harbour-enterprises/superdoc 0.22.0-next.8 → 0.22.0-next.9
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/chunks/{PdfViewer-BBQm50V3.cjs → PdfViewer-DyWe33pN.cjs} +1 -1
- package/dist/chunks/{PdfViewer-C1tow4Hk.es.js → PdfViewer-HN-tp5RN.es.js} +1 -1
- package/dist/chunks/{index-BkpP-c9A.cjs → index-BeVpZc19.cjs} +16 -9
- package/dist/chunks/{index-CJUwCOxd.es.js → index-ir6efMuz.es.js} +16 -9
- package/dist/chunks/{super-editor.es-Bg0-F_x5.es.js → super-editor.es-BwqYS285.es.js} +14 -26
- package/dist/chunks/{super-editor.es-D6u8E2n4.cjs → super-editor.es-CKfdmK-8.cjs} +14 -26
- package/dist/core/types/index.d.ts.map +1 -1
- package/dist/stores/comments-store.d.ts +4 -1
- package/dist/stores/comments-store.d.ts.map +1 -1
- package/dist/style.css +44 -44
- package/dist/super-editor/ai-writer.es.js +1 -1
- package/dist/super-editor/chunks/{editor-M2L6bDyC.js → editor-CFqh_xBx.js} +14 -26
- package/dist/super-editor/chunks/{toolbar-DsPK5x8a.js → toolbar-DdfyWgZF.js} +1 -1
- package/dist/super-editor/editor.es.js +1 -1
- package/dist/super-editor/super-editor.es.js +3 -3
- package/dist/super-editor/toolbar.es.js +2 -2
- package/dist/super-editor.cjs +1 -1
- package/dist/super-editor.es.js +1 -1
- package/dist/superdoc.cjs +2 -2
- package/dist/superdoc.es.js +2 -2
- package/dist/superdoc.umd.js +28 -33
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/style.css
CHANGED
|
@@ -253,32 +253,32 @@ span[data-v-53e13009] {
|
|
|
253
253
|
display: inline-block;
|
|
254
254
|
}
|
|
255
255
|
|
|
256
|
-
.change-type[data-v-
|
|
256
|
+
.change-type[data-v-e07f3426] {
|
|
257
257
|
font-style: italic;
|
|
258
258
|
font-weight: 600;
|
|
259
259
|
font-size: 10px;
|
|
260
260
|
color: #555;
|
|
261
261
|
}
|
|
262
|
-
.tracked-change[data-v-
|
|
262
|
+
.tracked-change[data-v-e07f3426] {
|
|
263
263
|
font-size: 12px;
|
|
264
264
|
}
|
|
265
|
-
.tracked-change-text[data-v-
|
|
265
|
+
.tracked-change-text[data-v-e07f3426] {
|
|
266
266
|
color: #111;
|
|
267
267
|
}
|
|
268
|
-
.comment-separator[data-v-
|
|
268
|
+
.comment-separator[data-v-e07f3426] {
|
|
269
269
|
background-color: #dbdbdb;
|
|
270
270
|
height: 1px;
|
|
271
271
|
width: 100%;
|
|
272
272
|
margin: 10px 0;
|
|
273
273
|
font-weight: 400;
|
|
274
274
|
}
|
|
275
|
-
.existing-internal-input[data-v-
|
|
275
|
+
.existing-internal-input[data-v-e07f3426] {
|
|
276
276
|
margin-bottom: 10px;
|
|
277
277
|
}
|
|
278
|
-
.initial-internal-dropdown[data-v-
|
|
278
|
+
.initial-internal-dropdown[data-v-e07f3426] {
|
|
279
279
|
margin-top: 10px;
|
|
280
280
|
}
|
|
281
|
-
.comments-dialog[data-v-
|
|
281
|
+
.comments-dialog[data-v-e07f3426] {
|
|
282
282
|
display: flex;
|
|
283
283
|
flex-direction: column;
|
|
284
284
|
padding: 10px 15px;
|
|
@@ -293,39 +293,39 @@ span[data-v-53e13009] {
|
|
|
293
293
|
min-width: 200px;
|
|
294
294
|
width: 100%;
|
|
295
295
|
}
|
|
296
|
-
.is-active[data-v-
|
|
296
|
+
.is-active[data-v-e07f3426] {
|
|
297
297
|
z-index: 10;
|
|
298
298
|
}
|
|
299
|
-
.input-section[data-v-
|
|
299
|
+
.input-section[data-v-e07f3426] {
|
|
300
300
|
margin-top: 10px;
|
|
301
301
|
}
|
|
302
|
-
.sd-button[data-v-
|
|
302
|
+
.sd-button[data-v-e07f3426] {
|
|
303
303
|
font-size: 12px;
|
|
304
304
|
margin-left: 5px;
|
|
305
305
|
}
|
|
306
|
-
.comment[data-v-
|
|
306
|
+
.comment[data-v-e07f3426] {
|
|
307
307
|
font-size: 13px;
|
|
308
308
|
margin: 10px 0;
|
|
309
309
|
}
|
|
310
|
-
.is-resolved[data-v-
|
|
310
|
+
.is-resolved[data-v-e07f3426] {
|
|
311
311
|
background-color: #f0f0f0;
|
|
312
312
|
}
|
|
313
|
-
.comment-footer[data-v-
|
|
313
|
+
.comment-footer[data-v-e07f3426] {
|
|
314
314
|
margin: 5px 0 5px;
|
|
315
315
|
display: flex;
|
|
316
316
|
justify-content: flex-end;
|
|
317
317
|
width: 100%;
|
|
318
318
|
}
|
|
319
|
-
.internal-dropdown[data-v-
|
|
319
|
+
.internal-dropdown[data-v-e07f3426] {
|
|
320
320
|
display: inline-block;
|
|
321
321
|
}
|
|
322
|
-
.comment-editing[data-v-
|
|
322
|
+
.comment-editing[data-v-e07f3426] {
|
|
323
323
|
padding-bottom: 10px;
|
|
324
324
|
}
|
|
325
|
-
.comment-editing button[data-v-
|
|
325
|
+
.comment-editing button[data-v-e07f3426] {
|
|
326
326
|
margin-left: 5px;
|
|
327
327
|
}
|
|
328
|
-
.tracked-change[data-v-
|
|
328
|
+
.tracked-change[data-v-e07f3426] {
|
|
329
329
|
margin: 0;
|
|
330
330
|
}
|
|
331
331
|
|
|
@@ -2432,46 +2432,46 @@ img[data-v-7dd69850] {
|
|
|
2432
2432
|
box-shadow: 0 0 5px hsla(0, 0%, 0%, 0.05);
|
|
2433
2433
|
}
|
|
2434
2434
|
|
|
2435
|
-
.superdoc[data-v-
|
|
2435
|
+
.superdoc[data-v-3f71b1bf] {
|
|
2436
2436
|
display: flex;
|
|
2437
2437
|
}
|
|
2438
|
-
.right-sidebar[data-v-
|
|
2438
|
+
.right-sidebar[data-v-3f71b1bf] {
|
|
2439
2439
|
min-width: 320px;
|
|
2440
2440
|
}
|
|
2441
|
-
.floating-comments[data-v-
|
|
2441
|
+
.floating-comments[data-v-3f71b1bf] {
|
|
2442
2442
|
min-width: 300px;
|
|
2443
2443
|
width: 300px;
|
|
2444
2444
|
}
|
|
2445
|
-
.superdoc__layers[data-v-
|
|
2445
|
+
.superdoc__layers[data-v-3f71b1bf] {
|
|
2446
2446
|
height: 100%;
|
|
2447
2447
|
position: relative;
|
|
2448
2448
|
box-sizing: border-box;
|
|
2449
2449
|
}
|
|
2450
|
-
.superdoc__document[data-v-
|
|
2450
|
+
.superdoc__document[data-v-3f71b1bf] {
|
|
2451
2451
|
width: 100%;
|
|
2452
2452
|
position: relative;
|
|
2453
2453
|
}
|
|
2454
|
-
.superdoc__sub-document[data-v-
|
|
2454
|
+
.superdoc__sub-document[data-v-3f71b1bf] {
|
|
2455
2455
|
width: 100%;
|
|
2456
2456
|
position: relative;
|
|
2457
2457
|
}
|
|
2458
|
-
.superdoc__selection-layer[data-v-
|
|
2458
|
+
.superdoc__selection-layer[data-v-3f71b1bf] {
|
|
2459
2459
|
position: absolute;
|
|
2460
2460
|
min-width: 100%;
|
|
2461
2461
|
min-height: 100%;
|
|
2462
2462
|
z-index: 10;
|
|
2463
2463
|
pointer-events: none;
|
|
2464
2464
|
}
|
|
2465
|
-
.superdoc__temp-selection[data-v-
|
|
2465
|
+
.superdoc__temp-selection[data-v-3f71b1bf] {
|
|
2466
2466
|
position: absolute;
|
|
2467
2467
|
}
|
|
2468
|
-
.superdoc__comments-layer[data-v-
|
|
2468
|
+
.superdoc__comments-layer[data-v-3f71b1bf] {
|
|
2469
2469
|
/* position: absolute; */
|
|
2470
2470
|
top: 0;
|
|
2471
2471
|
height: 100%;
|
|
2472
2472
|
position: relative;
|
|
2473
2473
|
}
|
|
2474
|
-
.superdoc__right-sidebar[data-v-
|
|
2474
|
+
.superdoc__right-sidebar[data-v-3f71b1bf] {
|
|
2475
2475
|
width: 320px;
|
|
2476
2476
|
min-width: 320px;
|
|
2477
2477
|
padding: 0 10px;
|
|
@@ -2481,14 +2481,14 @@ img[data-v-7dd69850] {
|
|
|
2481
2481
|
}
|
|
2482
2482
|
|
|
2483
2483
|
/* Tools styles */
|
|
2484
|
-
.tools[data-v-
|
|
2484
|
+
.tools[data-v-3f71b1bf] {
|
|
2485
2485
|
position: absolute;
|
|
2486
2486
|
z-index: 3;
|
|
2487
2487
|
display: flex;
|
|
2488
2488
|
flex-direction: column;
|
|
2489
2489
|
gap: 6px;
|
|
2490
2490
|
}
|
|
2491
|
-
.tools .tool-icon[data-v-
|
|
2491
|
+
.tools .tool-icon[data-v-3f71b1bf] {
|
|
2492
2492
|
font-size: 20px;
|
|
2493
2493
|
border-radius: 12px;
|
|
2494
2494
|
border: none;
|
|
@@ -2496,7 +2496,7 @@ img[data-v-7dd69850] {
|
|
|
2496
2496
|
background-color: #dbdbdb;
|
|
2497
2497
|
cursor: pointer;
|
|
2498
2498
|
}
|
|
2499
|
-
.tools-item[data-v-
|
|
2499
|
+
.tools-item[data-v-3f71b1bf] {
|
|
2500
2500
|
display: flex;
|
|
2501
2501
|
align-items: center;
|
|
2502
2502
|
justify-content: center;
|
|
@@ -2506,10 +2506,10 @@ img[data-v-7dd69850] {
|
|
|
2506
2506
|
border-radius: 12px;
|
|
2507
2507
|
cursor: pointer;
|
|
2508
2508
|
}
|
|
2509
|
-
.tools-item i[data-v-
|
|
2509
|
+
.tools-item i[data-v-3f71b1bf] {
|
|
2510
2510
|
cursor: pointer;
|
|
2511
2511
|
}
|
|
2512
|
-
.superdoc__tools-icon[data-v-
|
|
2512
|
+
.superdoc__tools-icon[data-v-3f71b1bf] {
|
|
2513
2513
|
width: 20px;
|
|
2514
2514
|
height: 20px;
|
|
2515
2515
|
flex-shrink: 0;
|
|
@@ -2524,15 +2524,15 @@ img[data-v-7dd69850] {
|
|
|
2524
2524
|
|
|
2525
2525
|
/* 834px is iPad screen size in portrait orientation */
|
|
2526
2526
|
@media (max-width: 834px) {
|
|
2527
|
-
.superdoc .superdoc__layers[data-v-
|
|
2527
|
+
.superdoc .superdoc__layers[data-v-3f71b1bf] {
|
|
2528
2528
|
margin: 0;
|
|
2529
2529
|
border: 0 !important;
|
|
2530
2530
|
box-shadow: none;
|
|
2531
2531
|
}
|
|
2532
|
-
.superdoc__sub-document[data-v-
|
|
2532
|
+
.superdoc__sub-document[data-v-3f71b1bf] {
|
|
2533
2533
|
max-width: 100%;
|
|
2534
2534
|
}
|
|
2535
|
-
.superdoc__right-sidebar[data-v-
|
|
2535
|
+
.superdoc__right-sidebar[data-v-3f71b1bf] {
|
|
2536
2536
|
padding: 10px;
|
|
2537
2537
|
width: 55px;
|
|
2538
2538
|
position: relative;
|
|
@@ -2540,7 +2540,7 @@ img[data-v-7dd69850] {
|
|
|
2540
2540
|
}
|
|
2541
2541
|
|
|
2542
2542
|
/* AI Writer styles */
|
|
2543
|
-
.ai-writer-container[data-v-
|
|
2543
|
+
.ai-writer-container[data-v-3f71b1bf] {
|
|
2544
2544
|
position: fixed;
|
|
2545
2545
|
z-index: 1000;
|
|
2546
2546
|
background: white;
|
|
@@ -2558,13 +2558,13 @@ img[data-v-7dd69850] {
|
|
|
2558
2558
|
} */
|
|
2559
2559
|
|
|
2560
2560
|
/* Tools styles */
|
|
2561
|
-
.tools[data-v-
|
|
2561
|
+
.tools[data-v-3f71b1bf] {
|
|
2562
2562
|
position: absolute;
|
|
2563
2563
|
z-index: 3;
|
|
2564
2564
|
display: flex;
|
|
2565
2565
|
gap: 6px;
|
|
2566
2566
|
}
|
|
2567
|
-
.tools .tool-icon[data-v-
|
|
2567
|
+
.tools .tool-icon[data-v-3f71b1bf] {
|
|
2568
2568
|
font-size: 20px;
|
|
2569
2569
|
border-radius: 12px;
|
|
2570
2570
|
border: none;
|
|
@@ -2572,7 +2572,7 @@ img[data-v-7dd69850] {
|
|
|
2572
2572
|
background-color: #dbdbdb;
|
|
2573
2573
|
cursor: pointer;
|
|
2574
2574
|
}
|
|
2575
|
-
.tools-item[data-v-
|
|
2575
|
+
.tools-item[data-v-3f71b1bf] {
|
|
2576
2576
|
display: flex;
|
|
2577
2577
|
align-items: center;
|
|
2578
2578
|
justify-content: center;
|
|
@@ -2583,18 +2583,18 @@ img[data-v-7dd69850] {
|
|
|
2583
2583
|
border-radius: 12px;
|
|
2584
2584
|
cursor: pointer;
|
|
2585
2585
|
}
|
|
2586
|
-
.tools-item i[data-v-
|
|
2586
|
+
.tools-item i[data-v-3f71b1bf] {
|
|
2587
2587
|
cursor: pointer;
|
|
2588
2588
|
}
|
|
2589
|
-
.superdoc__tools-icon[data-v-
|
|
2589
|
+
.superdoc__tools-icon[data-v-3f71b1bf] {
|
|
2590
2590
|
width: 20px;
|
|
2591
2591
|
height: 20px;
|
|
2592
2592
|
flex-shrink: 0;
|
|
2593
2593
|
}
|
|
2594
|
-
.ai-tool > svg[data-v-
|
|
2594
|
+
.ai-tool > svg[data-v-3f71b1bf] {
|
|
2595
2595
|
fill: transparent;
|
|
2596
2596
|
}
|
|
2597
|
-
.ai-tool[data-v-
|
|
2597
|
+
.ai-tool[data-v-3f71b1bf]::before {
|
|
2598
2598
|
content: '';
|
|
2599
2599
|
position: absolute;
|
|
2600
2600
|
width: 20px;
|
|
@@ -2615,7 +2615,7 @@ img[data-v-7dd69850] {
|
|
|
2615
2615
|
filter: brightness(1.2);
|
|
2616
2616
|
transition: filter 0.2s ease;
|
|
2617
2617
|
}
|
|
2618
|
-
.ai-tool[data-v-
|
|
2618
|
+
.ai-tool[data-v-3f71b1bf]:hover::before {
|
|
2619
2619
|
filter: brightness(1.3);
|
|
2620
2620
|
}
|
|
2621
2621
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ref, onMounted, onUnmounted, computed, createElementBlock, openBlock, withModifiers, createElementVNode, withDirectives, unref, vModelText, createCommentVNode, nextTick } from "vue";
|
|
2
2
|
import { T as TextSelection } from "./chunks/converter-BgedUNCW.js";
|
|
3
|
-
import { _ as _export_sfc } from "./chunks/editor-
|
|
3
|
+
import { _ as _export_sfc } from "./chunks/editor-CFqh_xBx.js";
|
|
4
4
|
const DEFAULT_API_ENDPOINT = "https://sd-dev-express-gateway-i6xtm.ondigitalocean.app/insights";
|
|
5
5
|
const SYSTEM_PROMPT = "You are an expert copywriter and you are immersed in a document editor. You are to provide document related text responses based on the user prompts. Only write what is asked for. Do not provide explanations. Try to keep placeholders as short as possible. Do not output your prompt. Your instructions are: ";
|
|
6
6
|
async function baseInsightsFetch(payload, options = {}) {
|
|
@@ -12107,28 +12107,25 @@ const handleTrackedChangeTransaction = (trackedChangeMeta, trackedChanges, newEd
|
|
|
12107
12107
|
if (emitParams) editor.emit("commentsUpdate", emitParams);
|
|
12108
12108
|
return newTrackedChanges;
|
|
12109
12109
|
};
|
|
12110
|
-
const getTrackedChangeText = ({ state,
|
|
12110
|
+
const getTrackedChangeText = ({ state, nodes, mark, marks, trackedChangeType, isDeletionInsertion }) => {
|
|
12111
12111
|
let trackedChangeText = "";
|
|
12112
12112
|
let deletionText = "";
|
|
12113
12113
|
if (trackedChangeType === TrackInsertMarkName) {
|
|
12114
|
-
trackedChangeText = node
|
|
12114
|
+
trackedChangeText = nodes.reduce((acc, node) => {
|
|
12115
|
+
if (!node.marks.find((nodeMark) => nodeMark.type.name === mark.type.name)) return acc;
|
|
12116
|
+
acc += node?.text || node?.textContent || "";
|
|
12117
|
+
return acc;
|
|
12118
|
+
}, "");
|
|
12115
12119
|
}
|
|
12116
12120
|
if (trackedChangeType === TrackFormatMarkName) {
|
|
12117
12121
|
trackedChangeText = translateFormatChangesToEnglish(mark.attrs);
|
|
12118
12122
|
}
|
|
12119
12123
|
if (trackedChangeType === TrackDeleteMarkName || isDeletionInsertion) {
|
|
12120
|
-
deletionText = node
|
|
12121
|
-
|
|
12122
|
-
|
|
12123
|
-
|
|
12124
|
-
|
|
12125
|
-
const changeMarks = marks2.filter((mark2) => TRACK_CHANGE_MARKS.includes(mark2.type.name));
|
|
12126
|
-
if (!changeMarks.length) return false;
|
|
12127
|
-
const hasMatchingId = changeMarks.find((mark2) => mark2.attrs.id === id);
|
|
12128
|
-
if (hasMatchingId) return true;
|
|
12129
|
-
});
|
|
12130
|
-
deletionText = deletionNode?.node.text ?? "";
|
|
12131
|
-
}
|
|
12124
|
+
deletionText = nodes.reduce((acc, node) => {
|
|
12125
|
+
if (!node.marks.find((nodeMark) => nodeMark.type.name === TrackDeleteMarkName)) return acc;
|
|
12126
|
+
acc += node?.text || node?.textContent || "";
|
|
12127
|
+
return acc;
|
|
12128
|
+
}, "");
|
|
12132
12129
|
}
|
|
12133
12130
|
return {
|
|
12134
12131
|
deletionText,
|
|
@@ -12143,18 +12140,17 @@ const createOrUpdateTrackedChangeComment = ({ event, marks, deletionNodes, nodes
|
|
|
12143
12140
|
const id = attrs.id;
|
|
12144
12141
|
const node = nodes[0];
|
|
12145
12142
|
const isDeletionInsertion = !!(marks.insertedMark && marks.deletionMark);
|
|
12146
|
-
let
|
|
12143
|
+
let nodesWithMark = [];
|
|
12147
12144
|
newEditorState.doc.descendants((node2) => {
|
|
12148
12145
|
const { marks: marks2 = [] } = node2;
|
|
12149
12146
|
const changeMarks = marks2.filter((mark) => TRACK_CHANGE_MARKS.includes(mark.type.name));
|
|
12150
12147
|
if (!changeMarks.length) return;
|
|
12151
12148
|
const hasMatchingId = changeMarks.find((mark) => mark.attrs.id === id);
|
|
12152
|
-
if (hasMatchingId)
|
|
12153
|
-
if (existingNode) return false;
|
|
12149
|
+
if (hasMatchingId) nodesWithMark.push(node2);
|
|
12154
12150
|
});
|
|
12155
12151
|
const { deletionText, trackedChangeText } = getTrackedChangeText({
|
|
12156
12152
|
state: newEditorState,
|
|
12157
|
-
|
|
12153
|
+
nodes: nodesWithMark.length ? nodesWithMark : [node],
|
|
12158
12154
|
mark: trackedMark,
|
|
12159
12155
|
marks,
|
|
12160
12156
|
trackedChangeType,
|
|
@@ -12184,14 +12180,6 @@ const createOrUpdateTrackedChangeComment = ({ event, marks, deletionNodes, nodes
|
|
|
12184
12180
|
else if (event === "update") params2.event = comments_module_events.UPDATE;
|
|
12185
12181
|
return params2;
|
|
12186
12182
|
};
|
|
12187
|
-
function findNode$1(node, predicate) {
|
|
12188
|
-
let found = null;
|
|
12189
|
-
node.descendants((node2, pos) => {
|
|
12190
|
-
if (predicate(node2)) found = { node: node2, pos };
|
|
12191
|
-
if (found) return false;
|
|
12192
|
-
});
|
|
12193
|
-
return found;
|
|
12194
|
-
}
|
|
12195
12183
|
function findRangeById(doc2, id) {
|
|
12196
12184
|
let from2 = null, to = null;
|
|
12197
12185
|
doc2.descendants((node, pos) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { computed, createElementBlock, openBlock, createElementVNode, createCommentVNode, normalizeClass, normalizeStyle, ref, withKeys, unref, withModifiers, createBlock, toDisplayString, withDirectives, vModelText, nextTick, getCurrentInstance, createVNode, readonly, watch, onMounted, onBeforeUnmount, reactive, onBeforeMount, inject, onActivated, onDeactivated, createTextVNode, Fragment, Comment, defineComponent, provide, h, Teleport, toRef, renderSlot, isVNode, shallowRef, watchEffect, mergeProps, Transition, vShow, cloneVNode, Text, renderList, withCtx } from "vue";
|
|
2
2
|
import { p as process$1 } from "./converter-BgedUNCW.js";
|
|
3
|
-
import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-
|
|
3
|
+
import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-CFqh_xBx.js";
|
|
4
4
|
const sanitizeNumber = (value, defaultNumber) => {
|
|
5
5
|
let sanitized = value.replace(/[^0-9.]/g, "");
|
|
6
6
|
sanitized = parseFloat(sanitized);
|
|
@@ -11,10 +11,10 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
11
11
|
var _SuperToolbar_instances, initToolbarGroups_fn, _interceptedCommands, makeToolbarItems_fn, initDefaultFonts_fn, updateHighlightColors_fn, deactivateAll_fn, updateToolbarHistory_fn, runCommandWithArgumentOnly_fn;
|
|
12
12
|
import { av as getDefaultExportFromCjs, V as v4, T as TextSelection$1, v as getMarkRange, ay as vClickOutside, H as findParentNode, az as getActiveFormatting, ap as isInTable, aA as readFromClipboard, aB as handleClipboardPaste, aC as getFileObject, aD as runPropertyTranslators, aE as translator, aF as translator$1, aG as translator$2, aH as translator$3, aI as translator$4, aJ as translator$5, aK as translator$6, aL as translator$7, aM as translator$8, aN as translator$9, aO as translator$a, aP as translator$b, aQ as translator$c, aR as translator$d, aS as translator$e, aT as translator$f, aU as translator$g, aV as translator$h, aW as translator$i, aX as translator$j, aY as translator$k, aZ as translator$l, a_ as translator$m, a$ as translator$n, b0 as translator$o, b1 as translator$p, b2 as translator$q, b3 as translator$r, b4 as translator$s, b5 as translator$t, b6 as translator$u, b7 as translator$v, b8 as translator$w, b9 as translator$x, ba as translator$y, bb as translator$z, bc as translator$A, bd as translator$B, be as translator$C, bf as translator$D, bg as translator$E, bh as translator$F, bi as translator$G, bj as translator$H, bk as translator$I, bl as translator$J, bm as translator$K, bn as translator$L, bo as translator$M, bp as translator$N, bq as translator$O, br as translator$P, bs as translator$Q, bt as translator$R, bu as translator$S, bv as translator$T, bw as translator$U, bx as translator$V, by as translator$W, bz as translator$X, bA as translator$Y, bB as translator$Z, bC as translator$_, bD as translator$$, bE as translator$10, a as Plugin } from "./chunks/converter-BgedUNCW.js";
|
|
13
13
|
import { bF, a5, i, a2 } from "./chunks/converter-BgedUNCW.js";
|
|
14
|
-
import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, c as getFileOpener, d as checkAndProcessImage, r as replaceSelectionWithImagePlaceholder, e as uploadAndInsertImage, y as yUndoPluginKey, f as undoDepth, h as redoDepth, s as shouldBypassContextMenu, S as SlashMenuPluginKey, E as Editor, i as getStarterExtensions, P as Placeholder, j as getRichTextExtensions, M as Mark, k as Extension, A as Attribute, N as Node } from "./chunks/editor-
|
|
15
|
-
import { n, C, o, T, l, p, m } from "./chunks/editor-
|
|
14
|
+
import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, c as getFileOpener, d as checkAndProcessImage, r as replaceSelectionWithImagePlaceholder, e as uploadAndInsertImage, y as yUndoPluginKey, f as undoDepth, h as redoDepth, s as shouldBypassContextMenu, S as SlashMenuPluginKey, E as Editor, i as getStarterExtensions, P as Placeholder, j as getRichTextExtensions, M as Mark, k as Extension, A as Attribute, N as Node } from "./chunks/editor-CFqh_xBx.js";
|
|
15
|
+
import { n, C, o, T, l, p, m } from "./chunks/editor-CFqh_xBx.js";
|
|
16
16
|
import { ref, onMounted, createElementBlock, openBlock, normalizeClass, unref, Fragment, renderList, createElementVNode, withModifiers, toDisplayString, createCommentVNode, normalizeStyle, computed, watch, withDirectives, withKeys, vModelText, createTextVNode, createVNode, h, createApp, markRaw, nextTick, onBeforeUnmount, reactive, onUnmounted, renderSlot, shallowRef, createBlock, withCtx, resolveDynamicComponent, normalizeProps, guardReactiveProps } from "vue";
|
|
17
|
-
import { t as toolbarIcons, s as sanitizeNumber, T as Toolbar, m as magicWandIcon, p as plusIconSvg, a as trashIconSvg, l as linkIconSvg, b as tableIconSvg, c as scissorsIconSvg, d as copyIconSvg, e as pasteIconSvg, f as borderNoneIconSvg, g as arrowsToDotIconSvg, h as arrowsLeftRightIconSvg, w as wrenchIconSvg, u as useMessage, N as NSkeleton } from "./chunks/toolbar-
|
|
17
|
+
import { t as toolbarIcons, s as sanitizeNumber, T as Toolbar, m as magicWandIcon, p as plusIconSvg, a as trashIconSvg, l as linkIconSvg, b as tableIconSvg, c as scissorsIconSvg, d as copyIconSvg, e as pasteIconSvg, f as borderNoneIconSvg, g as arrowsToDotIconSvg, h as arrowsLeftRightIconSvg, w as wrenchIconSvg, u as useMessage, N as NSkeleton } from "./chunks/toolbar-DdfyWgZF.js";
|
|
18
18
|
import AIWriter from "./ai-writer.es.js";
|
|
19
19
|
import { D } from "./chunks/docx-zipper-ByLK3trM.js";
|
|
20
20
|
import { createZip } from "./file-zipper.es.js";
|
package/dist/super-editor.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const superEditor_es = require("./chunks/super-editor.es-
|
|
3
|
+
const superEditor_es = require("./chunks/super-editor.es-CKfdmK-8.cjs");
|
|
4
4
|
require("./chunks/vue-DWle4Cai.cjs");
|
|
5
5
|
exports.AIWriter = superEditor_es.AIWriter;
|
|
6
6
|
exports.AnnotatorHelpers = superEditor_es.AnnotatorHelpers;
|
package/dist/super-editor.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A, a, _, C, D, E, b, S, c, d, e, f, g, T, h, i, j, k, l, m, n, o, p, r, q } from "./chunks/super-editor.es-
|
|
1
|
+
import { A, a, _, C, D, E, b, S, c, d, e, f, g, T, h, i, j, k, l, m, n, o, p, r, q } from "./chunks/super-editor.es-BwqYS285.es.js";
|
|
2
2
|
import "./chunks/vue-CXxsqYcP.es.js";
|
|
3
3
|
export {
|
|
4
4
|
A as AIWriter,
|
package/dist/superdoc.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const superEditor_es = require("./chunks/super-editor.es-
|
|
4
|
-
const superdoc = require("./chunks/index-
|
|
3
|
+
const superEditor_es = require("./chunks/super-editor.es-CKfdmK-8.cjs");
|
|
4
|
+
const superdoc = require("./chunks/index-BeVpZc19.cjs");
|
|
5
5
|
require("./chunks/vue-DWle4Cai.cjs");
|
|
6
6
|
require("./chunks/jszip-b7l8QkfH.cjs");
|
|
7
7
|
const blankDocx = require("./chunks/blank-docx-CPqX9RF5.cjs");
|
package/dist/superdoc.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-
|
|
2
|
-
import { D, H, P, S as S2, m, l } from "./chunks/index-
|
|
1
|
+
import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-BwqYS285.es.js";
|
|
2
|
+
import { D, H, P, S as S2, m, l } from "./chunks/index-ir6efMuz.es.js";
|
|
3
3
|
import "./chunks/vue-CXxsqYcP.es.js";
|
|
4
4
|
import "./chunks/jszip-B8KIZSNe.es.js";
|
|
5
5
|
import { B } from "./chunks/blank-docx-iwdyG9RH.es.js";
|
package/dist/superdoc.umd.js
CHANGED
|
@@ -56368,28 +56368,25 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
56368
56368
|
if (emitParams) editor.emit("commentsUpdate", emitParams);
|
|
56369
56369
|
return newTrackedChanges;
|
|
56370
56370
|
};
|
|
56371
|
-
const getTrackedChangeText = ({ state: state2,
|
|
56371
|
+
const getTrackedChangeText = ({ state: state2, nodes, mark, marks, trackedChangeType, isDeletionInsertion }) => {
|
|
56372
56372
|
let trackedChangeText = "";
|
|
56373
56373
|
let deletionText = "";
|
|
56374
56374
|
if (trackedChangeType === TrackInsertMarkName) {
|
|
56375
|
-
trackedChangeText = node
|
|
56375
|
+
trackedChangeText = nodes.reduce((acc, node) => {
|
|
56376
|
+
if (!node.marks.find((nodeMark) => nodeMark.type.name === mark.type.name)) return acc;
|
|
56377
|
+
acc += node?.text || node?.textContent || "";
|
|
56378
|
+
return acc;
|
|
56379
|
+
}, "");
|
|
56376
56380
|
}
|
|
56377
56381
|
if (trackedChangeType === TrackFormatMarkName) {
|
|
56378
56382
|
trackedChangeText = translateFormatChangesToEnglish(mark.attrs);
|
|
56379
56383
|
}
|
|
56380
56384
|
if (trackedChangeType === TrackDeleteMarkName || isDeletionInsertion) {
|
|
56381
|
-
deletionText = node
|
|
56382
|
-
|
|
56383
|
-
|
|
56384
|
-
|
|
56385
|
-
|
|
56386
|
-
const changeMarks = marks2.filter((mark2) => TRACK_CHANGE_MARKS.includes(mark2.type.name));
|
|
56387
|
-
if (!changeMarks.length) return false;
|
|
56388
|
-
const hasMatchingId = changeMarks.find((mark2) => mark2.attrs.id === id);
|
|
56389
|
-
if (hasMatchingId) return true;
|
|
56390
|
-
});
|
|
56391
|
-
deletionText = deletionNode?.node.text ?? "";
|
|
56392
|
-
}
|
|
56385
|
+
deletionText = nodes.reduce((acc, node) => {
|
|
56386
|
+
if (!node.marks.find((nodeMark) => nodeMark.type.name === TrackDeleteMarkName)) return acc;
|
|
56387
|
+
acc += node?.text || node?.textContent || "";
|
|
56388
|
+
return acc;
|
|
56389
|
+
}, "");
|
|
56393
56390
|
}
|
|
56394
56391
|
return {
|
|
56395
56392
|
deletionText,
|
|
@@ -56404,18 +56401,17 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
56404
56401
|
const id = attrs.id;
|
|
56405
56402
|
const node = nodes[0];
|
|
56406
56403
|
const isDeletionInsertion = !!(marks.insertedMark && marks.deletionMark);
|
|
56407
|
-
let
|
|
56404
|
+
let nodesWithMark = [];
|
|
56408
56405
|
newEditorState.doc.descendants((node2) => {
|
|
56409
56406
|
const { marks: marks2 = [] } = node2;
|
|
56410
56407
|
const changeMarks = marks2.filter((mark) => TRACK_CHANGE_MARKS.includes(mark.type.name));
|
|
56411
56408
|
if (!changeMarks.length) return;
|
|
56412
56409
|
const hasMatchingId = changeMarks.find((mark) => mark.attrs.id === id);
|
|
56413
|
-
if (hasMatchingId)
|
|
56414
|
-
if (existingNode) return false;
|
|
56410
|
+
if (hasMatchingId) nodesWithMark.push(node2);
|
|
56415
56411
|
});
|
|
56416
56412
|
const { deletionText, trackedChangeText } = getTrackedChangeText({
|
|
56417
56413
|
state: newEditorState,
|
|
56418
|
-
|
|
56414
|
+
nodes: nodesWithMark.length ? nodesWithMark : [node],
|
|
56419
56415
|
mark: trackedMark,
|
|
56420
56416
|
marks,
|
|
56421
56417
|
trackedChangeType,
|
|
@@ -56445,14 +56441,6 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
56445
56441
|
else if (event === "update") params2.event = comments_module_events$1.UPDATE;
|
|
56446
56442
|
return params2;
|
|
56447
56443
|
};
|
|
56448
|
-
function findNode$1(node, predicate) {
|
|
56449
|
-
let found2 = null;
|
|
56450
|
-
node.descendants((node2, pos) => {
|
|
56451
|
-
if (predicate(node2)) found2 = { node: node2, pos };
|
|
56452
|
-
if (found2) return false;
|
|
56453
|
-
});
|
|
56454
|
-
return found2;
|
|
56455
|
-
}
|
|
56456
56444
|
function findRangeById(doc2, id) {
|
|
56457
56445
|
let from2 = null, to = null;
|
|
56458
56446
|
doc2.descendants((node, pos) => {
|
|
@@ -96738,7 +96726,7 @@ ${reason}`);
|
|
|
96738
96726
|
const c1 = changes[i2];
|
|
96739
96727
|
const c2 = changes[i2 + 1];
|
|
96740
96728
|
const c1Key = markMetaKeys[c1.mark.type.name];
|
|
96741
|
-
if (c1 && c2 && c1.to === c2.from) {
|
|
96729
|
+
if (c1 && c2 && c1.to === c2.from && c1.mark.attrs.id === c2.mark.attrs.id) {
|
|
96742
96730
|
const c2Key = markMetaKeys[c2.mark.type.name];
|
|
96743
96731
|
grouped.push({
|
|
96744
96732
|
from: c1.from,
|
|
@@ -96783,6 +96771,7 @@ ${reason}`);
|
|
|
96783
96771
|
const isCommentsListVisible = ref$1(false);
|
|
96784
96772
|
const editorCommentIds = ref$1([]);
|
|
96785
96773
|
const editorCommentPositions = ref$1({});
|
|
96774
|
+
const isCommentHighlighted = ref$1(false);
|
|
96786
96775
|
const floatingCommentsOffset = ref$1(0);
|
|
96787
96776
|
const sortedConversations = ref$1([]);
|
|
96788
96777
|
const visibleConversations = ref$1([]);
|
|
@@ -97061,8 +97050,8 @@ ${reason}`);
|
|
|
97061
97050
|
tr.setMeta(CommentsPluginKey, { type: "forceTrackChanges" });
|
|
97062
97051
|
tr.setMeta(TrackChangesBasePluginKey, trackChangesPayload);
|
|
97063
97052
|
}
|
|
97053
|
+
dispatch(tr);
|
|
97064
97054
|
});
|
|
97065
|
-
dispatch(tr);
|
|
97066
97055
|
};
|
|
97067
97056
|
const translateCommentsForExport = () => {
|
|
97068
97057
|
const processedComments = [];
|
|
@@ -97132,6 +97121,7 @@ ${reason}`);
|
|
|
97132
97121
|
try {
|
|
97133
97122
|
const normalizedContent = normalizeCommentForEditor(commentTextJson);
|
|
97134
97123
|
const schemaContent = Array.isArray(normalizedContent) ? normalizedContent[0] : normalizedContent;
|
|
97124
|
+
if (!schemaContent.content.length) return null;
|
|
97135
97125
|
const editor = new Editor({
|
|
97136
97126
|
mode: "text",
|
|
97137
97127
|
isHeadless: true,
|
|
@@ -97165,6 +97155,7 @@ ${reason}`);
|
|
|
97165
97155
|
commentsParentElement,
|
|
97166
97156
|
editorCommentPositions,
|
|
97167
97157
|
hasInitializedLocations,
|
|
97158
|
+
isCommentHighlighted,
|
|
97168
97159
|
// Floating comments
|
|
97169
97160
|
floatingCommentsOffset,
|
|
97170
97161
|
sortedConversations,
|
|
@@ -108859,7 +108850,8 @@ ${style2}
|
|
|
108859
108850
|
currentCommentText,
|
|
108860
108851
|
isDebugging: isDebugging2,
|
|
108861
108852
|
editingCommentId,
|
|
108862
|
-
editorCommentPositions
|
|
108853
|
+
editorCommentPositions,
|
|
108854
|
+
isCommentHighlighted
|
|
108863
108855
|
} = storeToRefs(commentsStore);
|
|
108864
108856
|
const { activeZoom } = storeToRefs(superdocStore);
|
|
108865
108857
|
const isInternal = ref$1(true);
|
|
@@ -108921,13 +108913,14 @@ ${style2}
|
|
|
108921
108913
|
"track-format",
|
|
108922
108914
|
"track-format-dec"
|
|
108923
108915
|
];
|
|
108924
|
-
if (excludedClasses.some((className) => e.target.classList.contains(className))) return;
|
|
108916
|
+
if (excludedClasses.some((className) => e.target.classList.contains(className)) || isCommentHighlighted.value) return;
|
|
108925
108917
|
if (activeComment.value === props.comment.commentId) {
|
|
108926
108918
|
floatingCommentsOffset.value = 0;
|
|
108927
108919
|
emit2("dialog-exit");
|
|
108928
108920
|
}
|
|
108929
108921
|
activeComment.value = null;
|
|
108930
108922
|
commentsStore.setActiveComment(proxy.$superdoc, activeComment.value);
|
|
108923
|
+
isCommentHighlighted.value = false;
|
|
108931
108924
|
};
|
|
108932
108925
|
const handleAddComment = () => {
|
|
108933
108926
|
const options = {
|
|
@@ -109140,7 +109133,7 @@ ${style2}
|
|
|
109140
109133
|
};
|
|
109141
109134
|
}
|
|
109142
109135
|
};
|
|
109143
|
-
const CommentDialog = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-
|
|
109136
|
+
const CommentDialog = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-e07f3426"]]);
|
|
109144
109137
|
const _hoisted_1$b = { class: "comments-list" };
|
|
109145
109138
|
const _hoisted_2$5 = { key: 0 };
|
|
109146
109139
|
const _hoisted_3$3 = { class: "comment-item" };
|
|
@@ -110163,7 +110156,8 @@ ${style2}
|
|
|
110163
110156
|
getFloatingComments,
|
|
110164
110157
|
hasSyncedCollaborationComments,
|
|
110165
110158
|
editorCommentPositions,
|
|
110166
|
-
hasInitializedLocations
|
|
110159
|
+
hasInitializedLocations,
|
|
110160
|
+
isCommentHighlighted
|
|
110167
110161
|
} = storeToRefs(commentsStore);
|
|
110168
110162
|
const { showAddComment, handleEditorLocationsUpdate, handleTrackedChangeUpdate } = commentsStore;
|
|
110169
110163
|
const { proxy } = getCurrentInstance();
|
|
@@ -110358,6 +110352,7 @@ ${style2}
|
|
|
110358
110352
|
nextTick(() => {
|
|
110359
110353
|
if (pendingComment.value) return;
|
|
110360
110354
|
commentsStore.setActiveComment(proxy.$superdoc, activeCommentId);
|
|
110355
|
+
isCommentHighlighted.value = true;
|
|
110361
110356
|
});
|
|
110362
110357
|
if (typeof proxy.$superdoc.config.onCommentsUpdate === "function") {
|
|
110363
110358
|
proxy.$superdoc.config.onCommentsUpdate(params2);
|
|
@@ -110680,7 +110675,7 @@ ${style2}
|
|
|
110680
110675
|
};
|
|
110681
110676
|
}
|
|
110682
110677
|
};
|
|
110683
|
-
const App = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-
|
|
110678
|
+
const App = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-3f71b1bf"]]);
|
|
110684
110679
|
const createSuperdocVueApp = () => {
|
|
110685
110680
|
const app = createApp(App);
|
|
110686
110681
|
const pinia = createPinia();
|