@harbour-enterprises/superdoc 0.25.0-next.2 → 0.25.0-next.4
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-CEc5ST9t.cjs → PdfViewer-BETK3Bs4.cjs} +1 -1
- package/dist/chunks/{PdfViewer-CoEXViCu.es.js → PdfViewer-D4F3H-Ay.es.js} +1 -1
- package/dist/chunks/{index-ChgYIPZ8.cjs → index-BHS2aLqo.cjs} +5 -7
- package/dist/chunks/{index-DtXgSPMT.es.js → index-D9KYAvvg.es.js} +5 -7
- package/dist/chunks/{super-editor.es-B-E_YaLO.cjs → super-editor.es-BJzqCihw.cjs} +126 -125
- package/dist/chunks/{super-editor.es-BePxEtE8.es.js → super-editor.es-Beeng5kU.es.js} +126 -125
- package/dist/core/types/index.d.ts.map +1 -1
- package/dist/style.css +57 -54
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-gSy6s2VK.js → converter-DOkexB95.js} +89 -72
- package/dist/super-editor/chunks/{docx-zipper-CceGxV02.js → docx-zipper-Ci5JbfjE.js} +1 -1
- package/dist/super-editor/chunks/{editor-yaef8OIs.js → editor-DC9ZOqdt.js} +25 -59
- package/dist/super-editor/chunks/{toolbar-Dc5uyyIp.js → toolbar-SPGEoEi0.js} +4 -4
- package/dist/super-editor/converter.es.js +1 -1
- package/dist/super-editor/docx-zipper.es.js +2 -2
- package/dist/super-editor/editor.es.js +3 -3
- package/dist/super-editor/file-zipper.es.js +1 -1
- package/dist/super-editor/style.css +30 -27
- package/dist/super-editor/super-editor/src/components/toolbar/use-toolbar-item.d.ts +1 -1
- package/dist/super-editor/super-editor/src/core/super-converter/v3/handlers/mc/altermateContent/alternate-content-translator.d.ts +11 -0
- package/dist/super-editor/super-editor/src/index.d.ts +8 -2
- package/dist/super-editor/super-editor.es.js +31 -18
- 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 +129 -130
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/style.css
CHANGED
|
@@ -438,20 +438,20 @@ span[data-v-53e13009] {
|
|
|
438
438
|
width: 16px;
|
|
439
439
|
}
|
|
440
440
|
|
|
441
|
-
.toolbar-item[data-v-
|
|
441
|
+
.toolbar-item[data-v-ea93b080] {
|
|
442
442
|
position: relative;
|
|
443
443
|
z-index: 1;
|
|
444
444
|
min-width: 30px;
|
|
445
445
|
margin: 0 1px;
|
|
446
446
|
}
|
|
447
|
-
.visually-hidden[data-v-
|
|
447
|
+
.visually-hidden[data-v-ea93b080] {
|
|
448
448
|
position: absolute;
|
|
449
449
|
left: -9999px;
|
|
450
450
|
height: 1px;
|
|
451
451
|
width: 1px;
|
|
452
452
|
overflow: hidden;
|
|
453
453
|
}
|
|
454
|
-
.toolbar-button[data-v-
|
|
454
|
+
.toolbar-button[data-v-ea93b080] {
|
|
455
455
|
padding: 5px;
|
|
456
456
|
height: 32px;
|
|
457
457
|
max-height: 32px;
|
|
@@ -467,21 +467,21 @@ span[data-v-53e13009] {
|
|
|
467
467
|
position: relative;
|
|
468
468
|
box-sizing: border-box;
|
|
469
469
|
}
|
|
470
|
-
.toolbar-button[data-v-
|
|
470
|
+
.toolbar-button[data-v-ea93b080]:hover {
|
|
471
471
|
background-color: #dbdbdb;
|
|
472
472
|
}
|
|
473
|
-
.toolbar-button:hover .toolbar-icon.high-contrast[data-v-
|
|
473
|
+
.toolbar-button:hover .toolbar-icon.high-contrast[data-v-ea93b080] {
|
|
474
474
|
color: #fff;
|
|
475
475
|
}
|
|
476
|
-
.toolbar-button:hover.high-contrast[data-v-
|
|
476
|
+
.toolbar-button:hover.high-contrast[data-v-ea93b080] {
|
|
477
477
|
background-color: #000;
|
|
478
478
|
color: #fff;
|
|
479
479
|
}
|
|
480
|
-
.toolbar-button[data-v-
|
|
481
|
-
.active[data-v-
|
|
480
|
+
.toolbar-button[data-v-ea93b080]:active,
|
|
481
|
+
.active[data-v-ea93b080] {
|
|
482
482
|
background-color: #c8d0d8;
|
|
483
483
|
}
|
|
484
|
-
.button-label[data-v-
|
|
484
|
+
.button-label[data-v-ea93b080] {
|
|
485
485
|
overflow: hidden;
|
|
486
486
|
width: 100%;
|
|
487
487
|
text-align: center;
|
|
@@ -491,37 +491,37 @@ span[data-v-53e13009] {
|
|
|
491
491
|
font-size: 15px;
|
|
492
492
|
margin: 5px;
|
|
493
493
|
}
|
|
494
|
-
.toolbar-icon + .dropdown-caret[data-v-
|
|
494
|
+
.toolbar-icon + .dropdown-caret[data-v-ea93b080] {
|
|
495
495
|
margin-left: 4px;
|
|
496
496
|
}
|
|
497
|
-
.left[data-v-
|
|
498
|
-
.right[data-v-
|
|
497
|
+
.left[data-v-ea93b080],
|
|
498
|
+
.right[data-v-ea93b080] {
|
|
499
499
|
width: 50%;
|
|
500
500
|
height: 100%;
|
|
501
501
|
background-color: #dbdbdb;
|
|
502
502
|
border-radius: 60%;
|
|
503
503
|
}
|
|
504
|
-
.has-inline-text-input[data-v-
|
|
504
|
+
.has-inline-text-input[data-v-ea93b080]:hover {
|
|
505
505
|
cursor: text;
|
|
506
506
|
}
|
|
507
|
-
.disabled[data-v-
|
|
507
|
+
.disabled[data-v-ea93b080] {
|
|
508
508
|
cursor: default;
|
|
509
509
|
}
|
|
510
|
-
.disabled[data-v-
|
|
510
|
+
.disabled[data-v-ea93b080]:hover {
|
|
511
511
|
cursor: default;
|
|
512
512
|
background-color: initial;
|
|
513
513
|
}
|
|
514
|
-
.disabled .toolbar-icon[data-v-
|
|
515
|
-
.disabled .caret[data-v-
|
|
516
|
-
.disabled .button-label[data-v-
|
|
514
|
+
.disabled .toolbar-icon[data-v-ea93b080],
|
|
515
|
+
.disabled .caret[data-v-ea93b080],
|
|
516
|
+
.disabled .button-label[data-v-ea93b080] {
|
|
517
517
|
opacity: 0.35;
|
|
518
518
|
}
|
|
519
|
-
.caret[data-v-
|
|
519
|
+
.caret[data-v-ea93b080] {
|
|
520
520
|
font-size: 1em;
|
|
521
521
|
padding-left: 2px;
|
|
522
522
|
padding-right: 2px;
|
|
523
523
|
}
|
|
524
|
-
.button-text-input[data-v-
|
|
524
|
+
.button-text-input[data-v-ea93b080] {
|
|
525
525
|
color: #47484a;
|
|
526
526
|
border-radius: 4px;
|
|
527
527
|
text-align: center;
|
|
@@ -535,13 +535,16 @@ span[data-v-53e13009] {
|
|
|
535
535
|
border: 1px solid #d8dee5;
|
|
536
536
|
box-sizing: border-box;
|
|
537
537
|
}
|
|
538
|
-
.button-text-input.high-contrast[data-v-
|
|
538
|
+
.button-text-input.high-contrast[data-v-ea93b080] {
|
|
539
539
|
background-color: #fff;
|
|
540
540
|
}
|
|
541
|
-
.button-text-input[data-v-
|
|
541
|
+
.button-text-input--font-size[data-v-ea93b080] {
|
|
542
|
+
width: 36px;
|
|
543
|
+
}
|
|
544
|
+
.button-text-input[data-v-ea93b080]::placeholder {
|
|
542
545
|
color: #47484a;
|
|
543
546
|
}
|
|
544
|
-
.dropdown-caret[data-v-
|
|
547
|
+
.dropdown-caret[data-v-ea93b080] {
|
|
545
548
|
display: inline-flex;
|
|
546
549
|
align-items: center;
|
|
547
550
|
justify-content: center;
|
|
@@ -551,16 +554,16 @@ span[data-v-53e13009] {
|
|
|
551
554
|
height: 10px;
|
|
552
555
|
}
|
|
553
556
|
@media (max-width: 1280px) {
|
|
554
|
-
.toolbar-item--doc-mode .button-label[data-v-
|
|
557
|
+
.toolbar-item--doc-mode .button-label[data-v-ea93b080] {
|
|
555
558
|
display: none;
|
|
556
559
|
}
|
|
557
|
-
.toolbar-item--doc-mode .toolbar-icon[data-v-
|
|
560
|
+
.toolbar-item--doc-mode .toolbar-icon[data-v-ea93b080] {
|
|
558
561
|
margin-right: 5px;
|
|
559
562
|
}
|
|
560
|
-
.toolbar-item--linked-styles[data-v-
|
|
563
|
+
.toolbar-item--linked-styles[data-v-ea93b080] {
|
|
561
564
|
width: auto !important;
|
|
562
565
|
}
|
|
563
|
-
.toolbar-item--linked-styles .button-label[data-v-
|
|
566
|
+
.toolbar-item--linked-styles .button-label[data-v-ea93b080] {
|
|
564
567
|
display: none;
|
|
565
568
|
}
|
|
566
569
|
}
|
|
@@ -2471,46 +2474,46 @@ img[data-v-7dd69850] {
|
|
|
2471
2474
|
box-shadow: 0 0 5px hsla(0, 0%, 0%, 0.05);
|
|
2472
2475
|
}
|
|
2473
2476
|
|
|
2474
|
-
.superdoc[data-v-
|
|
2477
|
+
.superdoc[data-v-715d68b1] {
|
|
2475
2478
|
display: flex;
|
|
2476
2479
|
}
|
|
2477
|
-
.right-sidebar[data-v-
|
|
2480
|
+
.right-sidebar[data-v-715d68b1] {
|
|
2478
2481
|
min-width: 320px;
|
|
2479
2482
|
}
|
|
2480
|
-
.floating-comments[data-v-
|
|
2483
|
+
.floating-comments[data-v-715d68b1] {
|
|
2481
2484
|
min-width: 300px;
|
|
2482
2485
|
width: 300px;
|
|
2483
2486
|
}
|
|
2484
|
-
.superdoc__layers[data-v-
|
|
2487
|
+
.superdoc__layers[data-v-715d68b1] {
|
|
2485
2488
|
height: 100%;
|
|
2486
2489
|
position: relative;
|
|
2487
2490
|
box-sizing: border-box;
|
|
2488
2491
|
}
|
|
2489
|
-
.superdoc__document[data-v-
|
|
2492
|
+
.superdoc__document[data-v-715d68b1] {
|
|
2490
2493
|
width: 100%;
|
|
2491
2494
|
position: relative;
|
|
2492
2495
|
}
|
|
2493
|
-
.superdoc__sub-document[data-v-
|
|
2496
|
+
.superdoc__sub-document[data-v-715d68b1] {
|
|
2494
2497
|
width: 100%;
|
|
2495
2498
|
position: relative;
|
|
2496
2499
|
}
|
|
2497
|
-
.superdoc__selection-layer[data-v-
|
|
2500
|
+
.superdoc__selection-layer[data-v-715d68b1] {
|
|
2498
2501
|
position: absolute;
|
|
2499
2502
|
min-width: 100%;
|
|
2500
2503
|
min-height: 100%;
|
|
2501
2504
|
z-index: 10;
|
|
2502
2505
|
pointer-events: none;
|
|
2503
2506
|
}
|
|
2504
|
-
.superdoc__temp-selection[data-v-
|
|
2507
|
+
.superdoc__temp-selection[data-v-715d68b1] {
|
|
2505
2508
|
position: absolute;
|
|
2506
2509
|
}
|
|
2507
|
-
.superdoc__comments-layer[data-v-
|
|
2510
|
+
.superdoc__comments-layer[data-v-715d68b1] {
|
|
2508
2511
|
/* position: absolute; */
|
|
2509
2512
|
top: 0;
|
|
2510
2513
|
height: 100%;
|
|
2511
2514
|
position: relative;
|
|
2512
2515
|
}
|
|
2513
|
-
.superdoc__right-sidebar[data-v-
|
|
2516
|
+
.superdoc__right-sidebar[data-v-715d68b1] {
|
|
2514
2517
|
width: 320px;
|
|
2515
2518
|
min-width: 320px;
|
|
2516
2519
|
padding: 0 10px;
|
|
@@ -2520,14 +2523,14 @@ img[data-v-7dd69850] {
|
|
|
2520
2523
|
}
|
|
2521
2524
|
|
|
2522
2525
|
/* Tools styles */
|
|
2523
|
-
.tools[data-v-
|
|
2526
|
+
.tools[data-v-715d68b1] {
|
|
2524
2527
|
position: absolute;
|
|
2525
2528
|
z-index: 3;
|
|
2526
2529
|
display: flex;
|
|
2527
2530
|
flex-direction: column;
|
|
2528
2531
|
gap: 6px;
|
|
2529
2532
|
}
|
|
2530
|
-
.tools .tool-icon[data-v-
|
|
2533
|
+
.tools .tool-icon[data-v-715d68b1] {
|
|
2531
2534
|
font-size: 20px;
|
|
2532
2535
|
border-radius: 12px;
|
|
2533
2536
|
border: none;
|
|
@@ -2535,7 +2538,7 @@ img[data-v-7dd69850] {
|
|
|
2535
2538
|
background-color: #dbdbdb;
|
|
2536
2539
|
cursor: pointer;
|
|
2537
2540
|
}
|
|
2538
|
-
.tools-item[data-v-
|
|
2541
|
+
.tools-item[data-v-715d68b1] {
|
|
2539
2542
|
display: flex;
|
|
2540
2543
|
align-items: center;
|
|
2541
2544
|
justify-content: center;
|
|
@@ -2545,10 +2548,10 @@ img[data-v-7dd69850] {
|
|
|
2545
2548
|
border-radius: 12px;
|
|
2546
2549
|
cursor: pointer;
|
|
2547
2550
|
}
|
|
2548
|
-
.tools-item i[data-v-
|
|
2551
|
+
.tools-item i[data-v-715d68b1] {
|
|
2549
2552
|
cursor: pointer;
|
|
2550
2553
|
}
|
|
2551
|
-
.superdoc__tools-icon[data-v-
|
|
2554
|
+
.superdoc__tools-icon[data-v-715d68b1] {
|
|
2552
2555
|
width: 20px;
|
|
2553
2556
|
height: 20px;
|
|
2554
2557
|
flex-shrink: 0;
|
|
@@ -2563,15 +2566,15 @@ img[data-v-7dd69850] {
|
|
|
2563
2566
|
|
|
2564
2567
|
/* 834px is iPad screen size in portrait orientation */
|
|
2565
2568
|
@media (max-width: 834px) {
|
|
2566
|
-
.superdoc .superdoc__layers[data-v-
|
|
2569
|
+
.superdoc .superdoc__layers[data-v-715d68b1] {
|
|
2567
2570
|
margin: 0;
|
|
2568
2571
|
border: 0 !important;
|
|
2569
2572
|
box-shadow: none;
|
|
2570
2573
|
}
|
|
2571
|
-
.superdoc__sub-document[data-v-
|
|
2574
|
+
.superdoc__sub-document[data-v-715d68b1] {
|
|
2572
2575
|
max-width: 100%;
|
|
2573
2576
|
}
|
|
2574
|
-
.superdoc__right-sidebar[data-v-
|
|
2577
|
+
.superdoc__right-sidebar[data-v-715d68b1] {
|
|
2575
2578
|
padding: 10px;
|
|
2576
2579
|
width: 55px;
|
|
2577
2580
|
position: relative;
|
|
@@ -2579,7 +2582,7 @@ img[data-v-7dd69850] {
|
|
|
2579
2582
|
}
|
|
2580
2583
|
|
|
2581
2584
|
/* AI Writer styles */
|
|
2582
|
-
.ai-writer-container[data-v-
|
|
2585
|
+
.ai-writer-container[data-v-715d68b1] {
|
|
2583
2586
|
position: fixed;
|
|
2584
2587
|
z-index: 1000;
|
|
2585
2588
|
background: white;
|
|
@@ -2597,13 +2600,13 @@ img[data-v-7dd69850] {
|
|
|
2597
2600
|
} */
|
|
2598
2601
|
|
|
2599
2602
|
/* Tools styles */
|
|
2600
|
-
.tools[data-v-
|
|
2603
|
+
.tools[data-v-715d68b1] {
|
|
2601
2604
|
position: absolute;
|
|
2602
2605
|
z-index: 3;
|
|
2603
2606
|
display: flex;
|
|
2604
2607
|
gap: 6px;
|
|
2605
2608
|
}
|
|
2606
|
-
.tools .tool-icon[data-v-
|
|
2609
|
+
.tools .tool-icon[data-v-715d68b1] {
|
|
2607
2610
|
font-size: 20px;
|
|
2608
2611
|
border-radius: 12px;
|
|
2609
2612
|
border: none;
|
|
@@ -2611,7 +2614,7 @@ img[data-v-7dd69850] {
|
|
|
2611
2614
|
background-color: #dbdbdb;
|
|
2612
2615
|
cursor: pointer;
|
|
2613
2616
|
}
|
|
2614
|
-
.tools-item[data-v-
|
|
2617
|
+
.tools-item[data-v-715d68b1] {
|
|
2615
2618
|
display: flex;
|
|
2616
2619
|
align-items: center;
|
|
2617
2620
|
justify-content: center;
|
|
@@ -2622,18 +2625,18 @@ img[data-v-7dd69850] {
|
|
|
2622
2625
|
border-radius: 12px;
|
|
2623
2626
|
cursor: pointer;
|
|
2624
2627
|
}
|
|
2625
|
-
.tools-item i[data-v-
|
|
2628
|
+
.tools-item i[data-v-715d68b1] {
|
|
2626
2629
|
cursor: pointer;
|
|
2627
2630
|
}
|
|
2628
|
-
.superdoc__tools-icon[data-v-
|
|
2631
|
+
.superdoc__tools-icon[data-v-715d68b1] {
|
|
2629
2632
|
width: 20px;
|
|
2630
2633
|
height: 20px;
|
|
2631
2634
|
flex-shrink: 0;
|
|
2632
2635
|
}
|
|
2633
|
-
.ai-tool > svg[data-v-
|
|
2636
|
+
.ai-tool > svg[data-v-715d68b1] {
|
|
2634
2637
|
fill: transparent;
|
|
2635
2638
|
}
|
|
2636
|
-
.ai-tool[data-v-
|
|
2639
|
+
.ai-tool[data-v-715d68b1]::before {
|
|
2637
2640
|
content: '';
|
|
2638
2641
|
position: absolute;
|
|
2639
2642
|
width: 20px;
|
|
@@ -2654,7 +2657,7 @@ img[data-v-7dd69850] {
|
|
|
2654
2657
|
filter: brightness(1.2);
|
|
2655
2658
|
transition: filter 0.2s ease;
|
|
2656
2659
|
}
|
|
2657
|
-
.ai-tool[data-v-
|
|
2660
|
+
.ai-tool[data-v-715d68b1]:hover::before {
|
|
2658
2661
|
filter: brightness(1.3);
|
|
2659
2662
|
}
|
|
2660
2663
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ref, onMounted, onUnmounted, computed, createElementBlock, openBlock, withModifiers, createElementVNode, withDirectives, unref, vModelText, createCommentVNode, nextTick } from "vue";
|
|
2
|
-
import { T as TextSelection } from "./chunks/converter-
|
|
3
|
-
import { _ as _export_sfc } from "./chunks/editor-
|
|
2
|
+
import { T as TextSelection } from "./chunks/converter-DOkexB95.js";
|
|
3
|
+
import { _ as _export_sfc } from "./chunks/editor-DC9ZOqdt.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 = {}) {
|
|
@@ -32322,8 +32322,7 @@ const bookmarkEndNodeHandlerEntity = {
|
|
|
32322
32322
|
handlerName: "w:bookmarkEndTranslator",
|
|
32323
32323
|
handler: handleBookmarkEndNode
|
|
32324
32324
|
};
|
|
32325
|
-
const
|
|
32326
|
-
const SUPPORTED_REQUIRES = /* @__PURE__ */ new Set([
|
|
32325
|
+
const SUPPORTED_ALTERNATE_CONTENT_REQUIRES = /* @__PURE__ */ new Set([
|
|
32327
32326
|
"wps",
|
|
32328
32327
|
"wp14",
|
|
32329
32328
|
"w14",
|
|
@@ -32336,22 +32335,85 @@ const SUPPORTED_REQUIRES = /* @__PURE__ */ new Set([
|
|
|
32336
32335
|
"w16sdtfl",
|
|
32337
32336
|
"w16se"
|
|
32338
32337
|
]);
|
|
32338
|
+
const XML_NODE_NAME$1 = "mc:AlternateContent";
|
|
32339
|
+
const SD_NODE_NAME$1 = [];
|
|
32340
|
+
const validXmlAttributes$1 = [];
|
|
32341
|
+
function encode$1(params) {
|
|
32342
|
+
const { nodeListHandler } = params;
|
|
32343
|
+
const { node } = params.extraParams;
|
|
32344
|
+
if (!node || !node.type) {
|
|
32345
|
+
return null;
|
|
32346
|
+
}
|
|
32347
|
+
const { branch, elements } = selectAlternateContentElements(node);
|
|
32348
|
+
if (!elements) {
|
|
32349
|
+
return null;
|
|
32350
|
+
}
|
|
32351
|
+
return nodeListHandler.handler({
|
|
32352
|
+
...params,
|
|
32353
|
+
nodes: elements,
|
|
32354
|
+
path: buildPath(params.path, node, branch)
|
|
32355
|
+
});
|
|
32356
|
+
}
|
|
32357
|
+
function decode$1(params) {
|
|
32358
|
+
const { node } = params;
|
|
32359
|
+
const { drawingContent } = node.attrs;
|
|
32360
|
+
const drawing = {
|
|
32361
|
+
name: "w:drawing",
|
|
32362
|
+
elements: [...drawingContent ? [...drawingContent.elements || []] : []]
|
|
32363
|
+
};
|
|
32364
|
+
const choice = {
|
|
32365
|
+
name: "mc:Choice",
|
|
32366
|
+
attributes: { Requires: "wps" },
|
|
32367
|
+
elements: [drawing]
|
|
32368
|
+
};
|
|
32369
|
+
return {
|
|
32370
|
+
name: "mc:AlternateContent",
|
|
32371
|
+
elements: [choice]
|
|
32372
|
+
};
|
|
32373
|
+
}
|
|
32374
|
+
const config$1 = {
|
|
32375
|
+
xmlName: XML_NODE_NAME$1,
|
|
32376
|
+
sdNodeOrKeyName: SD_NODE_NAME$1,
|
|
32377
|
+
type: NodeTranslator.translatorTypes.NODE,
|
|
32378
|
+
encode: encode$1,
|
|
32379
|
+
decode: decode$1,
|
|
32380
|
+
attributes: validXmlAttributes$1
|
|
32381
|
+
};
|
|
32382
|
+
function selectAlternateContentElements(node) {
|
|
32383
|
+
if (!node?.elements?.length) {
|
|
32384
|
+
return { branch: null, elements: null };
|
|
32385
|
+
}
|
|
32386
|
+
const choices = node.elements.filter((el) => el?.name === "mc:Choice");
|
|
32387
|
+
const fallback = node.elements.find((el) => el?.name === "mc:Fallback");
|
|
32388
|
+
const supportedChoice = choices.find((choice) => {
|
|
32389
|
+
const requiresAttr = choice?.attributes?.Requires || choice?.attributes?.requires;
|
|
32390
|
+
if (!requiresAttr) return false;
|
|
32391
|
+
return requiresAttr.split(/\s+/).filter(Boolean).some((namespace) => SUPPORTED_ALTERNATE_CONTENT_REQUIRES.has(namespace));
|
|
32392
|
+
});
|
|
32393
|
+
const branch = supportedChoice || fallback || choices[0] || null;
|
|
32394
|
+
const selectedElements = branch?.elements;
|
|
32395
|
+
if (!selectedElements) {
|
|
32396
|
+
return { branch, elements: null };
|
|
32397
|
+
}
|
|
32398
|
+
return {
|
|
32399
|
+
branch,
|
|
32400
|
+
elements: carbonCopy(selectedElements)
|
|
32401
|
+
};
|
|
32402
|
+
}
|
|
32403
|
+
const translator$1 = NodeTranslator.from(config$1);
|
|
32404
|
+
function buildPath(existingPath = [], node, branch) {
|
|
32405
|
+
const path = [...existingPath];
|
|
32406
|
+
if (node) path.push(node);
|
|
32407
|
+
if (branch) path.push(branch);
|
|
32408
|
+
return path;
|
|
32409
|
+
}
|
|
32410
|
+
const ALTERNATE_CONTENT_NODE = "mc:AlternateContent";
|
|
32339
32411
|
const skipHandlerResponse = { nodes: [], consumed: 0 };
|
|
32340
32412
|
const isAlternateContentNode = (node) => node?.name === ALTERNATE_CONTENT_NODE;
|
|
32341
|
-
const isSupportedChoice = (choice) => {
|
|
32342
|
-
if (!choice?.attributes) return false;
|
|
32343
|
-
const requires = choice.attributes.Requires || choice.attributes.requires;
|
|
32344
|
-
if (!requires) return false;
|
|
32345
|
-
return requires.split(/\s+/).filter(Boolean).some((namespace) => SUPPORTED_REQUIRES.has(namespace));
|
|
32346
|
-
};
|
|
32347
32413
|
const resolveAlternateContentElements = (alternateContent) => {
|
|
32348
|
-
|
|
32349
|
-
|
|
32350
|
-
|
|
32351
|
-
const supportedChoice = choices.find(isSupportedChoice);
|
|
32352
|
-
const selectedElements = supportedChoice?.elements || fallback?.elements || choices[0]?.elements;
|
|
32353
|
-
if (!selectedElements) return null;
|
|
32354
|
-
return carbonCopy(selectedElements);
|
|
32414
|
+
const { elements } = selectAlternateContentElements(alternateContent);
|
|
32415
|
+
if (!elements) return null;
|
|
32416
|
+
return elements;
|
|
32355
32417
|
};
|
|
32356
32418
|
const buildNodeWithoutAlternateContent = (node) => {
|
|
32357
32419
|
const { elements } = node || {};
|
|
@@ -32383,16 +32445,20 @@ const handleAlternateChoice = (params) => {
|
|
|
32383
32445
|
}
|
|
32384
32446
|
const [currentNode] = nodes;
|
|
32385
32447
|
if (isAlternateContentNode(currentNode)) {
|
|
32386
|
-
const
|
|
32387
|
-
|
|
32388
|
-
|
|
32389
|
-
}
|
|
32390
|
-
const
|
|
32448
|
+
const nodeForTranslator = currentNode?.type ? currentNode : {
|
|
32449
|
+
...currentNode,
|
|
32450
|
+
type: "element"
|
|
32451
|
+
};
|
|
32452
|
+
const translated = translator$1.encode({
|
|
32391
32453
|
...params,
|
|
32392
|
-
nodes:
|
|
32393
|
-
|
|
32454
|
+
nodes: [nodeForTranslator],
|
|
32455
|
+
extraParams: { ...params.extraParams || {}, node: nodeForTranslator }
|
|
32394
32456
|
});
|
|
32395
|
-
|
|
32457
|
+
if (!translated) {
|
|
32458
|
+
return skipHandlerResponse;
|
|
32459
|
+
}
|
|
32460
|
+
const nodesArray = Array.isArray(translated) ? translated : [translated];
|
|
32461
|
+
return { nodes: nodesArray, consumed: 1 };
|
|
32396
32462
|
}
|
|
32397
32463
|
const sanitizedNode = buildNodeWithoutAlternateContent(currentNode);
|
|
32398
32464
|
if (!sanitizedNode) {
|
|
@@ -33690,55 +33756,6 @@ function translateShapeTextbox(params) {
|
|
|
33690
33756
|
};
|
|
33691
33757
|
return textbox;
|
|
33692
33758
|
}
|
|
33693
|
-
const XML_NODE_NAME$1 = "mc:AlternateContent";
|
|
33694
|
-
const SD_NODE_NAME$1 = [];
|
|
33695
|
-
const validXmlAttributes$1 = [];
|
|
33696
|
-
function encode$1(params) {
|
|
33697
|
-
const { nodeListHandler } = params;
|
|
33698
|
-
const { node } = params.extraParams;
|
|
33699
|
-
if (!node || !node.type) {
|
|
33700
|
-
return null;
|
|
33701
|
-
}
|
|
33702
|
-
const allowedNamespaces = ["wps", "wp14", "w14", "w15"];
|
|
33703
|
-
const wpsNode = node.elements.find(
|
|
33704
|
-
(el) => el.name === "mc:Choice" && allowedNamespaces.includes(el.attributes["Requires"])
|
|
33705
|
-
);
|
|
33706
|
-
if (!wpsNode) {
|
|
33707
|
-
return null;
|
|
33708
|
-
}
|
|
33709
|
-
const contents = wpsNode.elements;
|
|
33710
|
-
return nodeListHandler.handler({
|
|
33711
|
-
...params,
|
|
33712
|
-
nodes: contents,
|
|
33713
|
-
path: [...params.path || [], wpsNode]
|
|
33714
|
-
});
|
|
33715
|
-
}
|
|
33716
|
-
function decode$1(params) {
|
|
33717
|
-
const { node } = params;
|
|
33718
|
-
const { drawingContent } = node.attrs;
|
|
33719
|
-
const drawing = {
|
|
33720
|
-
name: "w:drawing",
|
|
33721
|
-
elements: [...drawingContent ? [...drawingContent.elements || []] : []]
|
|
33722
|
-
};
|
|
33723
|
-
const choice = {
|
|
33724
|
-
name: "mc:Choice",
|
|
33725
|
-
attributes: { Requires: "wps" },
|
|
33726
|
-
elements: [drawing]
|
|
33727
|
-
};
|
|
33728
|
-
return {
|
|
33729
|
-
name: "mc:AlternateContent",
|
|
33730
|
-
elements: [choice]
|
|
33731
|
-
};
|
|
33732
|
-
}
|
|
33733
|
-
const config$1 = {
|
|
33734
|
-
xmlName: XML_NODE_NAME$1,
|
|
33735
|
-
sdNodeOrKeyName: SD_NODE_NAME$1,
|
|
33736
|
-
type: NodeTranslator.translatorTypes.NODE,
|
|
33737
|
-
encode: encode$1,
|
|
33738
|
-
decode: decode$1,
|
|
33739
|
-
attributes: validXmlAttributes$1
|
|
33740
|
-
};
|
|
33741
|
-
const translator$1 = NodeTranslator.from(config$1);
|
|
33742
33759
|
function translateContentBlock(params) {
|
|
33743
33760
|
const { node } = params;
|
|
33744
33761
|
const { vmlAttributes, horizontalRule } = node.attrs;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as process$1, az as commonjsGlobal, B as Buffer, aA as getDefaultExportFromCjs, aB as getContentTypesFromXml, aC as xmljs } from "./converter-
|
|
1
|
+
import { p as process$1, az as commonjsGlobal, B as Buffer, aA as getDefaultExportFromCjs, aB as getContentTypesFromXml, aC as xmljs } from "./converter-DOkexB95.js";
|
|
2
2
|
function commonjsRequire(path) {
|
|
3
3
|
throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
|
4
4
|
}
|