@pixerate/editor 0.51.0 → 0.52.0
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/chart/index.cjs +315 -7
- package/dist/chart/index.cjs.map +1 -1
- package/dist/chart/index.d.cts +107 -5
- package/dist/chart/index.d.ts +107 -5
- package/dist/chart/index.js +312 -4
- package/dist/chart/index.js.map +1 -1
- package/dist/{chunk-2Q46FKZK.cjs → chunk-2DEBI6KU.cjs} +23 -23
- package/dist/{chunk-2Q46FKZK.cjs.map → chunk-2DEBI6KU.cjs.map} +1 -1
- package/dist/{chunk-3JNRQVTS.cjs → chunk-3ZBAXET6.cjs} +323 -3
- package/dist/chunk-3ZBAXET6.cjs.map +1 -0
- package/dist/{chunk-T6XU4B54.js → chunk-5N6AQCVB.js} +6 -6
- package/dist/{chunk-MR2764X2.js → chunk-AGGUNWT6.js} +2 -322
- package/dist/chunk-AGGUNWT6.js.map +1 -0
- package/dist/{chunk-LNKZPIQD.cjs → chunk-M5Z77GFH.cjs} +21 -21
- package/dist/{chunk-LNKZPIQD.cjs.map → chunk-M5Z77GFH.cjs.map} +1 -1
- package/dist/{chunk-3CC7OPUQ.cjs → chunk-O6FO6VI3.cjs} +3 -323
- package/dist/chunk-O6FO6VI3.cjs.map +1 -0
- package/dist/{chunk-GJBIVWB2.js → chunk-UAW5FEMD.js} +322 -2
- package/dist/chunk-UAW5FEMD.js.map +1 -0
- package/dist/{chunk-DQPBQXKG.js → chunk-YMKPMXZ4.js} +6 -6
- package/dist/export/index.cjs +4 -4
- package/dist/export/index.js +3 -3
- package/dist/extensions/index.cjs +4 -4
- package/dist/extensions/index.js +3 -3
- package/dist/index.cjs +12 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -110
- package/dist/index.d.ts +3 -110
- package/dist/index.js +10 -9
- package/dist/index.js.map +1 -1
- package/dist/zip-4nG0YAH7.d.cts +110 -0
- package/dist/zip-4nG0YAH7.d.ts +110 -0
- package/package.json +1 -1
- package/dist/chunk-3CC7OPUQ.cjs.map +0 -1
- package/dist/chunk-3JNRQVTS.cjs.map +0 -1
- package/dist/chunk-GJBIVWB2.js.map +0 -1
- package/dist/chunk-MR2764X2.js.map +0 -1
- /package/dist/{chunk-T6XU4B54.js.map → chunk-5N6AQCVB.js.map} +0 -0
- /package/dist/{chunk-DQPBQXKG.js.map → chunk-YMKPMXZ4.js.map} +0 -0
|
@@ -500,332 +500,12 @@ function createStyleRegistry(options = {}) {
|
|
|
500
500
|
return new StyleRegistry(options);
|
|
501
501
|
}
|
|
502
502
|
|
|
503
|
-
// src/import/zip.ts
|
|
504
|
-
var ZipError = class extends Error {
|
|
505
|
-
code;
|
|
506
|
-
entryName;
|
|
507
|
-
constructor(code, message, details = {}) {
|
|
508
|
-
super(message, details.cause !== void 0 ? { cause: details.cause } : void 0);
|
|
509
|
-
this.name = "ZipError";
|
|
510
|
-
this.code = code;
|
|
511
|
-
this.entryName = details.entryName;
|
|
512
|
-
}
|
|
513
|
-
};
|
|
514
|
-
var DEFAULT_ZIP_MAX_ENTRIES = 1e4;
|
|
515
|
-
var DEFAULT_ZIP_MAX_TOTAL_SIZE = 256 * 1024 * 1024;
|
|
516
|
-
var SIG_EOCD = 101010256;
|
|
517
|
-
var SIG_ZIP64_EOCD = 101075792;
|
|
518
|
-
var SIG_ZIP64_LOCATOR = 117853008;
|
|
519
|
-
var SIG_CENTRAL = 33639248;
|
|
520
|
-
var SIG_LOCAL = 67324752;
|
|
521
|
-
var EOCD_SIZE = 22;
|
|
522
|
-
var MAX_COMMENT = 65535;
|
|
523
|
-
var crcTable = null;
|
|
524
|
-
function zipCrc32(data) {
|
|
525
|
-
if (!crcTable) {
|
|
526
|
-
crcTable = new Uint32Array(256);
|
|
527
|
-
for (let n = 0; n < 256; n++) {
|
|
528
|
-
let c = n;
|
|
529
|
-
for (let k = 0; k < 8; k++) c = c & 1 ? 3988292384 ^ c >>> 1 : c >>> 1;
|
|
530
|
-
crcTable[n] = c >>> 0;
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
|
-
let crc = 4294967295;
|
|
534
|
-
for (let i = 0; i < data.length; i++) crc = crcTable[(crc ^ data[i]) & 255] ^ crc >>> 8;
|
|
535
|
-
return (crc ^ 4294967295) >>> 0;
|
|
536
|
-
}
|
|
537
|
-
function toBytes(data) {
|
|
538
|
-
if (ArrayBuffer.isView(data)) return new Uint8Array(data.buffer, data.byteOffset, data.byteLength);
|
|
539
|
-
return new Uint8Array(data);
|
|
540
|
-
}
|
|
541
|
-
function isUnsafeZipPath(name) {
|
|
542
|
-
if (!name || name.includes("\0")) return true;
|
|
543
|
-
const normalized = name.replace(/\\/g, "/");
|
|
544
|
-
if (normalized.startsWith("/") || /^[a-zA-Z]:/.test(normalized)) return true;
|
|
545
|
-
return normalized.split("/").some((segment) => segment === "..");
|
|
546
|
-
}
|
|
547
|
-
var utf8 = new TextDecoder("utf-8");
|
|
548
|
-
var CP437_HIGH = "\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0";
|
|
549
|
-
function decodeName(bytes, isUtf8) {
|
|
550
|
-
if (isUtf8 || bytes.every((b) => b < 128)) return utf8.decode(bytes);
|
|
551
|
-
let out = "";
|
|
552
|
-
for (const b of bytes) out += b < 128 ? String.fromCharCode(b) : CP437_HIGH[b - 128];
|
|
553
|
-
return out;
|
|
554
|
-
}
|
|
555
|
-
var ZipArchive = class {
|
|
556
|
-
constructor(bytes, entries, maxTotalSize) {
|
|
557
|
-
this.bytes = bytes;
|
|
558
|
-
this.maxTotalSize = maxTotalSize;
|
|
559
|
-
this.entries = entries;
|
|
560
|
-
entries.forEach((entry) => {
|
|
561
|
-
if (!this.byName.has(entry.name)) this.byName.set(entry.name, entry);
|
|
562
|
-
});
|
|
563
|
-
}
|
|
564
|
-
bytes;
|
|
565
|
-
maxTotalSize;
|
|
566
|
-
/** Entries in central-directory order. */
|
|
567
|
-
entries;
|
|
568
|
-
byName = /* @__PURE__ */ new Map();
|
|
569
|
-
extracted = 0;
|
|
570
|
-
/** Looks up an entry by exact name (a leading `/` is ignored). */
|
|
571
|
-
get(name) {
|
|
572
|
-
return this.byName.get(name.replace(/^\/+/, ""));
|
|
573
|
-
}
|
|
574
|
-
has(name) {
|
|
575
|
-
return !!this.get(name);
|
|
576
|
-
}
|
|
577
|
-
/** Uncompressed bytes extracted so far (counted against `maxTotalSize`). */
|
|
578
|
-
get extractedSize() {
|
|
579
|
-
return this.extracted;
|
|
580
|
-
}
|
|
581
|
-
/** Extracts an entry's data, verifying its size and CRC-32. */
|
|
582
|
-
async read(entryOrName) {
|
|
583
|
-
const entry = typeof entryOrName === "string" ? this.get(entryOrName) : entryOrName;
|
|
584
|
-
if (!entry) {
|
|
585
|
-
throw new ZipError("entry_not_found", `ZIP entry "${String(entryOrName)}" not found.`, {
|
|
586
|
-
entryName: String(entryOrName)
|
|
587
|
-
});
|
|
588
|
-
}
|
|
589
|
-
const name = entry.name;
|
|
590
|
-
if (entry.encrypted) {
|
|
591
|
-
throw new ZipError("encrypted", `ZIP entry "${name}" is encrypted; encrypted archives are not supported.`, {
|
|
592
|
-
entryName: name
|
|
593
|
-
});
|
|
594
|
-
}
|
|
595
|
-
if (entry.isDirectory) return new Uint8Array(0);
|
|
596
|
-
const remaining = this.maxTotalSize - this.extracted;
|
|
597
|
-
if (entry.size > remaining) {
|
|
598
|
-
throw new ZipError(
|
|
599
|
-
"too_large",
|
|
600
|
-
`Extracting "${name}" (${entry.size} bytes) would exceed the ${this.maxTotalSize}-byte limit.`,
|
|
601
|
-
{ entryName: name }
|
|
602
|
-
);
|
|
603
|
-
}
|
|
604
|
-
const { bytes } = this;
|
|
605
|
-
const offset = entry.localHeaderOffset;
|
|
606
|
-
if (offset + 30 > bytes.length || readU32(bytes, offset) !== SIG_LOCAL) {
|
|
607
|
-
throw new ZipError("corrupt_entry", `ZIP entry "${name}" has no valid local header.`, { entryName: name });
|
|
608
|
-
}
|
|
609
|
-
const dataStart = offset + 30 + readU16(bytes, offset + 26) + readU16(bytes, offset + 28);
|
|
610
|
-
const dataEnd = dataStart + entry.compressedSize;
|
|
611
|
-
if (dataEnd > bytes.length) {
|
|
612
|
-
throw new ZipError("corrupt_entry", `ZIP entry "${name}" is truncated.`, { entryName: name });
|
|
613
|
-
}
|
|
614
|
-
const raw = bytes.subarray(dataStart, dataEnd);
|
|
615
|
-
let data;
|
|
616
|
-
if (entry.method === 0) {
|
|
617
|
-
if (entry.compressedSize !== entry.size) {
|
|
618
|
-
throw new ZipError("corrupt_entry", `Stored ZIP entry "${name}" has inconsistent sizes.`, { entryName: name });
|
|
619
|
-
}
|
|
620
|
-
data = raw.slice();
|
|
621
|
-
} else if (entry.method === 8) {
|
|
622
|
-
data = await inflateRaw(raw, entry.size, name);
|
|
623
|
-
} else {
|
|
624
|
-
throw new ZipError(
|
|
625
|
-
"unsupported_feature",
|
|
626
|
-
`ZIP entry "${name}" uses unsupported compression method ${entry.method}; only stored and deflate are supported.`,
|
|
627
|
-
{ entryName: name }
|
|
628
|
-
);
|
|
629
|
-
}
|
|
630
|
-
if (data.length !== entry.size) {
|
|
631
|
-
throw new ZipError("corrupt_entry", `ZIP entry "${name}" size does not match the directory.`, { entryName: name });
|
|
632
|
-
}
|
|
633
|
-
this.extracted += data.length;
|
|
634
|
-
if (zipCrc32(data) !== entry.crc32) {
|
|
635
|
-
throw new ZipError("corrupt_entry", `ZIP entry "${name}" failed its CRC-32 check.`, { entryName: name });
|
|
636
|
-
}
|
|
637
|
-
return data;
|
|
638
|
-
}
|
|
639
|
-
/** Extracts an entry and decodes it as UTF-8 (a leading BOM is removed). */
|
|
640
|
-
async readText(entryOrName) {
|
|
641
|
-
const text = utf8.decode(await this.read(entryOrName));
|
|
642
|
-
return text.charCodeAt(0) === 65279 ? text.slice(1) : text;
|
|
643
|
-
}
|
|
644
|
-
};
|
|
645
|
-
function readU16(bytes, offset) {
|
|
646
|
-
return bytes[offset] | bytes[offset + 1] << 8;
|
|
647
|
-
}
|
|
648
|
-
function readU32(bytes, offset) {
|
|
649
|
-
return (bytes[offset] | bytes[offset + 1] << 8 | bytes[offset + 2] << 16 | bytes[offset + 3] << 24) >>> 0;
|
|
650
|
-
}
|
|
651
|
-
function readU64(bytes, offset) {
|
|
652
|
-
const value = readU32(bytes, offset) + readU32(bytes, offset + 4) * 4294967296;
|
|
653
|
-
if (!Number.isSafeInteger(value)) {
|
|
654
|
-
throw new ZipError("unsupported_feature", "ZIP64 value exceeds the supported range.");
|
|
655
|
-
}
|
|
656
|
-
return value;
|
|
657
|
-
}
|
|
658
|
-
async function inflateRaw(raw, limit, entryName) {
|
|
659
|
-
const Stream = globalThis.DecompressionStream;
|
|
660
|
-
if (typeof Stream !== "function") {
|
|
661
|
-
throw new ZipError(
|
|
662
|
-
"unsupported_environment",
|
|
663
|
-
"Inflating ZIP entries needs DecompressionStream (modern browsers, Node 18+).",
|
|
664
|
-
{ entryName }
|
|
665
|
-
);
|
|
666
|
-
}
|
|
667
|
-
const stream = new Stream("deflate-raw");
|
|
668
|
-
const writer = stream.writable.getWriter();
|
|
669
|
-
const reader = stream.readable.getReader();
|
|
670
|
-
const CHUNK = 64 * 1024;
|
|
671
|
-
const feeding = (async () => {
|
|
672
|
-
for (let i = 0; i < raw.length; i += CHUNK) await writer.write(raw.subarray(i, i + CHUNK));
|
|
673
|
-
await writer.close();
|
|
674
|
-
})();
|
|
675
|
-
feeding.catch(() => {
|
|
676
|
-
});
|
|
677
|
-
const chunks = [];
|
|
678
|
-
let total = 0;
|
|
679
|
-
try {
|
|
680
|
-
for (; ; ) {
|
|
681
|
-
const { done, value } = await reader.read();
|
|
682
|
-
if (done) break;
|
|
683
|
-
total += value.length;
|
|
684
|
-
if (total > limit) {
|
|
685
|
-
throw new ZipError(
|
|
686
|
-
"corrupt_entry",
|
|
687
|
-
`ZIP entry "${entryName}" inflates beyond its declared size of ${limit} bytes.`,
|
|
688
|
-
{ entryName }
|
|
689
|
-
);
|
|
690
|
-
}
|
|
691
|
-
chunks.push(value);
|
|
692
|
-
}
|
|
693
|
-
} catch (error) {
|
|
694
|
-
reader.cancel().catch(() => {
|
|
695
|
-
});
|
|
696
|
-
writer.abort().catch(() => {
|
|
697
|
-
});
|
|
698
|
-
if (error instanceof ZipError) throw error;
|
|
699
|
-
throw new ZipError("corrupt_entry", `ZIP entry "${entryName}" has an invalid deflate stream.`, {
|
|
700
|
-
entryName,
|
|
701
|
-
cause: error
|
|
702
|
-
});
|
|
703
|
-
}
|
|
704
|
-
await feeding.catch(() => {
|
|
705
|
-
});
|
|
706
|
-
const out = new Uint8Array(total);
|
|
707
|
-
let pos = 0;
|
|
708
|
-
for (const chunk of chunks) {
|
|
709
|
-
out.set(chunk, pos);
|
|
710
|
-
pos += chunk.length;
|
|
711
|
-
}
|
|
712
|
-
return out;
|
|
713
|
-
}
|
|
714
|
-
function findEndOfCentralDirectory(bytes) {
|
|
715
|
-
const min = Math.max(0, bytes.length - EOCD_SIZE - MAX_COMMENT);
|
|
716
|
-
for (let i = bytes.length - EOCD_SIZE; i >= min; i--) {
|
|
717
|
-
if (readU32(bytes, i) === SIG_EOCD && i + EOCD_SIZE + readU16(bytes, i + 20) <= bytes.length) return i;
|
|
718
|
-
}
|
|
719
|
-
return -1;
|
|
720
|
-
}
|
|
721
|
-
async function readZip(data, options = {}) {
|
|
722
|
-
const bytes = toBytes(data);
|
|
723
|
-
const maxEntries = options.maxEntries ?? DEFAULT_ZIP_MAX_ENTRIES;
|
|
724
|
-
const maxTotalSize = options.maxTotalSize ?? DEFAULT_ZIP_MAX_TOTAL_SIZE;
|
|
725
|
-
const eocd = findEndOfCentralDirectory(bytes);
|
|
726
|
-
if (eocd < 0) throw new ZipError("invalid_archive", "Not a ZIP archive (no end of central directory record).");
|
|
727
|
-
let diskNumber = readU16(bytes, eocd + 4);
|
|
728
|
-
let cdDisk = readU16(bytes, eocd + 6);
|
|
729
|
-
let count = readU16(bytes, eocd + 10);
|
|
730
|
-
let cdSize = readU32(bytes, eocd + 12);
|
|
731
|
-
let cdOffset = readU32(bytes, eocd + 16);
|
|
732
|
-
if (count === 65535 || cdSize === 4294967295 || cdOffset === 4294967295) {
|
|
733
|
-
const locator = eocd - 20;
|
|
734
|
-
if (locator < 0 || readU32(bytes, locator) !== SIG_ZIP64_LOCATOR) {
|
|
735
|
-
throw new ZipError("invalid_archive", "ZIP64 archive is missing its end of central directory locator.");
|
|
736
|
-
}
|
|
737
|
-
const record = readU64(bytes, locator + 8);
|
|
738
|
-
if (record + 56 > bytes.length || readU32(bytes, record) !== SIG_ZIP64_EOCD) {
|
|
739
|
-
throw new ZipError("invalid_archive", "ZIP64 end of central directory record not found.");
|
|
740
|
-
}
|
|
741
|
-
diskNumber = readU32(bytes, record + 16);
|
|
742
|
-
cdDisk = readU32(bytes, record + 20);
|
|
743
|
-
count = readU64(bytes, record + 32);
|
|
744
|
-
cdSize = readU64(bytes, record + 40);
|
|
745
|
-
cdOffset = readU64(bytes, record + 48);
|
|
746
|
-
}
|
|
747
|
-
if (diskNumber !== 0 || cdDisk !== 0) {
|
|
748
|
-
throw new ZipError("unsupported_feature", "Multi-disk (spanned) ZIP archives are not supported.");
|
|
749
|
-
}
|
|
750
|
-
if (count > maxEntries) {
|
|
751
|
-
throw new ZipError("too_many_entries", `ZIP archive has ${count} entries; the limit is ${maxEntries}.`);
|
|
752
|
-
}
|
|
753
|
-
if (cdOffset + cdSize > bytes.length) {
|
|
754
|
-
throw new ZipError("invalid_archive", "ZIP central directory lies outside the file.");
|
|
755
|
-
}
|
|
756
|
-
const entries = [];
|
|
757
|
-
let p = cdOffset;
|
|
758
|
-
for (let i = 0; i < count; i++) {
|
|
759
|
-
if (p + 46 > bytes.length || readU32(bytes, p) !== SIG_CENTRAL) {
|
|
760
|
-
throw new ZipError("invalid_archive", "ZIP central directory is corrupt.");
|
|
761
|
-
}
|
|
762
|
-
const flags = readU16(bytes, p + 8);
|
|
763
|
-
const method = readU16(bytes, p + 10);
|
|
764
|
-
const crc32 = readU32(bytes, p + 16);
|
|
765
|
-
let compressedSize = readU32(bytes, p + 20);
|
|
766
|
-
let size = readU32(bytes, p + 24);
|
|
767
|
-
const nameLength = readU16(bytes, p + 28);
|
|
768
|
-
const extraLength = readU16(bytes, p + 30);
|
|
769
|
-
const commentLength = readU16(bytes, p + 32);
|
|
770
|
-
let localHeaderOffset = readU32(bytes, p + 42);
|
|
771
|
-
const nameStart = p + 46;
|
|
772
|
-
const extraStart = nameStart + nameLength;
|
|
773
|
-
const next = extraStart + extraLength + commentLength;
|
|
774
|
-
if (next > bytes.length) throw new ZipError("invalid_archive", "ZIP central directory is truncated.");
|
|
775
|
-
for (let e = extraStart; e + 4 <= extraStart + extraLength; ) {
|
|
776
|
-
const id = readU16(bytes, e);
|
|
777
|
-
const len = readU16(bytes, e + 2);
|
|
778
|
-
if (id === 1) {
|
|
779
|
-
let f = e + 4;
|
|
780
|
-
const end = f + len;
|
|
781
|
-
if (size === 4294967295 && f + 8 <= end) {
|
|
782
|
-
size = readU64(bytes, f);
|
|
783
|
-
f += 8;
|
|
784
|
-
}
|
|
785
|
-
if (compressedSize === 4294967295 && f + 8 <= end) {
|
|
786
|
-
compressedSize = readU64(bytes, f);
|
|
787
|
-
f += 8;
|
|
788
|
-
}
|
|
789
|
-
if (localHeaderOffset === 4294967295 && f + 8 <= end) localHeaderOffset = readU64(bytes, f);
|
|
790
|
-
}
|
|
791
|
-
e += 4 + len;
|
|
792
|
-
}
|
|
793
|
-
const rawName = decodeName(bytes.subarray(nameStart, extraStart), (flags & 2048) !== 0);
|
|
794
|
-
const name = rawName.replace(/\\/g, "/");
|
|
795
|
-
p = next;
|
|
796
|
-
if (isUnsafeZipPath(rawName)) {
|
|
797
|
-
if (options.unsafePaths === "skip") continue;
|
|
798
|
-
throw new ZipError("unsafe_path", `ZIP entry name "${rawName}" is absolute or escapes the archive root.`, {
|
|
799
|
-
entryName: rawName
|
|
800
|
-
});
|
|
801
|
-
}
|
|
802
|
-
entries.push({
|
|
803
|
-
name,
|
|
804
|
-
isDirectory: name.endsWith("/"),
|
|
805
|
-
encrypted: (flags & 1) !== 0,
|
|
806
|
-
method,
|
|
807
|
-
compressedSize,
|
|
808
|
-
size,
|
|
809
|
-
crc32,
|
|
810
|
-
localHeaderOffset
|
|
811
|
-
});
|
|
812
|
-
}
|
|
813
|
-
return new ZipArchive(bytes, entries, maxTotalSize);
|
|
814
|
-
}
|
|
815
|
-
|
|
816
503
|
export {
|
|
817
504
|
NORMAL_STYLE_ID,
|
|
818
505
|
isValidStyleId,
|
|
819
506
|
DEFAULT_STYLES,
|
|
820
507
|
StyleRegistry,
|
|
821
508
|
safeCSSValue,
|
|
822
|
-
createStyleRegistry
|
|
823
|
-
ZipError,
|
|
824
|
-
DEFAULT_ZIP_MAX_ENTRIES,
|
|
825
|
-
DEFAULT_ZIP_MAX_TOTAL_SIZE,
|
|
826
|
-
zipCrc32,
|
|
827
|
-
isUnsafeZipPath,
|
|
828
|
-
ZipArchive,
|
|
829
|
-
readZip
|
|
509
|
+
createStyleRegistry
|
|
830
510
|
};
|
|
831
|
-
//# sourceMappingURL=chunk-
|
|
511
|
+
//# sourceMappingURL=chunk-AGGUNWT6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/extensions/paragraph-styles/registry.ts"],"sourcesContent":["// Portions ported from wordcraft/crates/doc/src/styles.rs and wordcraft/crates/doc/src/resolve.rs (MIT OR Apache-2.0, © ArtCraft Team and contributors). See THIRD_PARTY_NOTICES.md.\n\n/** Paragraph styles format whole blocks; character styles format runs of text. */\nexport type StyleKind = \"paragraph\" | \"character\";\n\n/** Character formatting of a style (CSS values). */\nexport interface CharacterFormat {\n fontFamily?: string;\n /** CSS length, e.g. `\"1.5em\"` or `\"18px\"`. */\n fontSize?: string;\n bold?: boolean;\n italic?: boolean;\n underline?: boolean;\n strike?: boolean;\n color?: string;\n backgroundColor?: string;\n letterSpacing?: string;\n textTransform?: \"none\" | \"uppercase\" | \"lowercase\" | \"capitalize\";\n smallCaps?: boolean;\n}\n\n/** Paragraph formatting of a style (CSS values). */\nexport interface ParagraphFormat {\n textAlign?: \"left\" | \"center\" | \"right\" | \"justify\";\n lineHeight?: string;\n spaceBefore?: string;\n spaceAfter?: string;\n indentLeft?: string;\n indentRight?: string;\n indentFirstLine?: string;\n /** CSS border shorthand, e.g. `\"3px solid currentColor\"`. */\n borderLeft?: string;\n paddingLeft?: string;\n backgroundColor?: string;\n}\n\n/** The block node a paragraph style uses (`heading` with `level` for Heading N). */\nexport interface StyleBlock {\n type: string;\n attrs?: Record<string, any>;\n}\n\nexport interface StyleDefinition {\n /** Stable id (`Heading1`): letters, digits, `_` and `-`, starting with a letter. */\n id: string;\n /** Display name (`Heading 1`). */\n name: string;\n kind: StyleKind;\n /** Style this one inherits from; what it sets wins over its base. */\n basedOn?: string | null;\n /** Style of the paragraph after this one when Enter is pressed at its end (paragraph styles). */\n next?: string | null;\n /** Linked style: a paragraph style's character style, or a character style's paragraph style. */\n linked?: string | null;\n paragraph?: ParagraphFormat;\n character?: CharacterFormat;\n /** Block node of a paragraph style. Inherited along `basedOn`; `paragraph` by default. */\n block?: StyleBlock | null;\n /** Gallery order (lower first). */\n priority?: number;\n /** Shown in the styles gallery. */\n quick?: boolean;\n hidden?: boolean;\n /** Built in (cannot be removed). */\n builtin?: boolean;\n}\n\n/** A style with its `basedOn` chain and the defaults merged. */\nexport interface ResolvedStyle {\n id: string;\n paragraph: ParagraphFormat;\n character: CharacterFormat;\n block: StyleBlock;\n /** Id of the style after Enter at the end of a paragraph. */\n next: string;\n}\n\nexport interface StyleDefaults {\n paragraph?: ParagraphFormat;\n character?: CharacterFormat;\n}\n\nexport interface StyleRegistryOptions {\n /** Styles added to (or replacing) the built-in ones. */\n styles?: readonly StyleDefinition[];\n /** Include the built-in styles. Default `true`. */\n builtins?: boolean;\n /** Document defaults, applied below every style. */\n defaults?: StyleDefaults;\n}\n\nexport interface StyleRegistrySnapshot {\n styles: readonly StyleDefinition[];\n defaults: StyleDefaults;\n /** Increases on every change. */\n version: number;\n}\n\n/** Serializable registry content (`registry.toJSON()`). */\nexport interface StyleRegistryJSON {\n styles: StyleDefinition[];\n defaults: StyleDefaults;\n}\n\nexport interface StyleCSSOptions {\n /** Selector the rules are scoped to. Default `.ProseMirror`. */\n scope?: string;\n /**\n * Element selector of blocks that use a style without naming it\n * (`data-style` absent), e.g. `h2` for Heading 2. Return `null` for none.\n */\n tagFor?: (block: StyleBlock) => string | null;\n}\n\n/** Longest `basedOn` chain followed (cycle and depth guard). */\nconst MAX_CHAIN = 32;\nconst STYLE_ID = /^[A-Za-z][A-Za-z0-9_-]{0,63}$/;\n/** CSS values that could escape a declaration or load resources are dropped. */\nconst UNSAFE_CSS = /[;{}<>\\\\]|\\/\\*|url\\s*\\(|expression\\s*\\(|@import|javascript:/i;\n\nexport const NORMAL_STYLE_ID = \"Normal\";\n\nconst PREVIEW_PROPERTIES = new Set([\n \"font-family\",\n \"font-weight\",\n \"font-style\",\n \"color\",\n \"text-decoration-line\",\n \"text-transform\",\n \"letter-spacing\",\n \"font-variant-caps\",\n]);\n\n/** Whether `id` is a valid style id. */\nexport function isValidStyleId(id: unknown): id is string {\n return typeof id === \"string\" && STYLE_ID.test(id);\n}\n\nconst MUTED = \"var(--pixerate-style-muted, #6b7280)\";\nconst HEADING_SIZES = [\"2em\", \"1.5em\", \"1.25em\", \"1.1em\", \"1em\", \"0.9em\"];\n\nfunction builtinStyles(): StyleDefinition[] {\n const styles: StyleDefinition[] = [\n {\n id: NORMAL_STYLE_ID,\n name: \"Normal\",\n kind: \"paragraph\",\n block: { type: \"paragraph\" },\n priority: 0,\n quick: true,\n builtin: true,\n },\n {\n id: \"Title\",\n name: \"Title\",\n kind: \"paragraph\",\n basedOn: NORMAL_STYLE_ID,\n next: NORMAL_STYLE_ID,\n linked: \"TitleChar\",\n paragraph: { spaceAfter: \"0.25em\", lineHeight: \"1.15\" },\n character: { fontSize: \"2.5em\", bold: true, letterSpacing: \"-0.01em\" },\n priority: 10,\n quick: true,\n builtin: true,\n },\n {\n id: \"Subtitle\",\n name: \"Subtitle\",\n kind: \"paragraph\",\n basedOn: NORMAL_STYLE_ID,\n next: NORMAL_STYLE_ID,\n linked: \"SubtitleChar\",\n paragraph: { spaceAfter: \"0.75em\" },\n character: { fontSize: \"1.25em\", color: MUTED },\n priority: 11,\n quick: true,\n builtin: true,\n },\n ];\n HEADING_SIZES.forEach((fontSize, i) => {\n const level = i + 1;\n styles.push({\n id: `Heading${level}`,\n name: `Heading ${level}`,\n kind: \"paragraph\",\n basedOn: NORMAL_STYLE_ID,\n next: NORMAL_STYLE_ID,\n linked: `Heading${level}Char`,\n block: { type: \"heading\", attrs: { level } },\n paragraph: { spaceBefore: level <= 2 ? \"1em\" : \"0.75em\", spaceAfter: \"0.25em\" },\n character: { fontSize, bold: true },\n priority: 11 + level,\n quick: level <= 3,\n builtin: true,\n });\n });\n styles.push(\n {\n id: \"Quote\",\n name: \"Quote\",\n kind: \"paragraph\",\n basedOn: NORMAL_STYLE_ID,\n next: NORMAL_STYLE_ID,\n linked: \"QuoteChar\",\n paragraph: { indentLeft: \"1em\", paddingLeft: \"0.75em\", borderLeft: \"3px solid currentColor\" },\n character: { italic: true, color: MUTED },\n priority: 29,\n quick: true,\n builtin: true,\n },\n {\n id: \"Code\",\n name: \"Code\",\n kind: \"paragraph\",\n basedOn: NORMAL_STYLE_ID,\n next: NORMAL_STYLE_ID,\n block: { type: \"codeBlock\" },\n character: {\n fontFamily: \"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace\",\n fontSize: \"0.9em\",\n },\n priority: 30,\n quick: true,\n builtin: true,\n },\n {\n id: \"ListParagraph\",\n name: \"List Paragraph\",\n kind: \"paragraph\",\n basedOn: NORMAL_STYLE_ID,\n paragraph: { indentLeft: \"2em\" },\n priority: 34,\n quick: true,\n builtin: true,\n },\n );\n // Linked character styles: their formatting is the paragraph style's.\n const linked = [\"Title\", \"Subtitle\", \"Quote\", ...HEADING_SIZES.map((_, i) => `Heading${i + 1}`)];\n linked.forEach((paragraphId) => {\n const name = styles.find((s) => s.id === paragraphId)!.name;\n styles.push({\n id: `${paragraphId}Char`,\n name: `${name} Char`,\n kind: \"character\",\n linked: paragraphId,\n priority: 99,\n hidden: true,\n builtin: true,\n });\n });\n styles.push(\n {\n id: \"Emphasis\",\n name: \"Emphasis\",\n kind: \"character\",\n character: { italic: true },\n priority: 20,\n quick: true,\n builtin: true,\n },\n {\n id: \"Strong\",\n name: \"Strong\",\n kind: \"character\",\n character: { bold: true },\n priority: 22,\n quick: true,\n builtin: true,\n },\n );\n return styles;\n}\n\n/** The built-in styles: Normal, Title, Subtitle, Heading 1–6, Quote, Code, List Paragraph and character styles. */\nexport const DEFAULT_STYLES: readonly StyleDefinition[] = Object.freeze(builtinStyles());\n\nconst clone = <T>(value: T): T => (value === undefined ? value : JSON.parse(JSON.stringify(value)));\n\n/** Copies only defined values of `patch` over `base`. */\nfunction overlay<T extends object>(base: T, patch: T | undefined | null): T {\n if (!patch) return base;\n const out: Record<string, unknown> = { ...(base as Record<string, unknown>) };\n Object.entries(patch).forEach(([key, value]) => {\n if (value !== undefined && value !== null) out[key] = value;\n });\n return out as T;\n}\n\nfunction sameBlock(a: StyleBlock, type: string, attrs: Record<string, any>): boolean {\n if (a.type !== type) return false;\n return Object.entries(a.attrs ?? {}).every(([key, value]) => attrs[key] === value);\n}\n\n/**\n * Style definitions with `basedOn` inheritance, next-style and linked\n * character/paragraph styles, resolved in cascade order: document defaults →\n * style chain (base first) → direct formatting. Chains are cycle-safe.\n *\n * `subscribe` calls the listener immediately and on every change (Svelte\n * store contract); `getSnapshot` is stable between changes.\n */\nexport class StyleRegistry {\n private styles = new Map<string, StyleDefinition>();\n private defaults: StyleDefaults;\n private version = 0;\n private snapshot: StyleRegistrySnapshot | null = null;\n private listeners = new Set<(snapshot: StyleRegistrySnapshot) => void>();\n\n constructor(options: StyleRegistryOptions = {}) {\n this.defaults = clone(options.defaults ?? {});\n if (options.builtins !== false) DEFAULT_STYLES.forEach((style) => this.styles.set(style.id, clone(style)));\n (options.styles ?? []).forEach((style) => this.put(style));\n }\n\n // -- Reading --------------------------------------------------------------\n\n get(id: string | null | undefined): StyleDefinition | undefined {\n return id ? this.styles.get(id) : undefined;\n }\n\n /** Finds a style by id or display name (case-insensitive). */\n find(nameOrId: string): StyleDefinition | undefined {\n const direct = this.styles.get(nameOrId);\n if (direct) return direct;\n const lower = nameOrId.toLowerCase();\n return this.list().find((style) => style.name.toLowerCase() === lower);\n }\n\n /** All styles (optionally of one kind) in gallery order. */\n list(kind?: StyleKind): StyleDefinition[] {\n return Array.from(this.styles.values())\n .filter((style) => !kind || style.kind === kind)\n .sort((a, b) => (a.priority ?? 99) - (b.priority ?? 99) || a.name.localeCompare(b.name));\n }\n\n /** Styles shown in the gallery (`quick`, not hidden), paragraph styles by default. */\n gallery(kind: StyleKind = \"paragraph\"): StyleDefinition[] {\n return this.list(kind).filter((style) => style.quick && !style.hidden);\n }\n\n /** The `basedOn` chain from the root style down to `id` (cycle-safe, bounded). */\n chain(id: string): StyleDefinition[] {\n const out: StyleDefinition[] = [];\n let current = this.styles.get(id);\n while (current && out.length < MAX_CHAIN && !out.includes(current)) {\n out.push(current);\n current = current.basedOn ? this.styles.get(current.basedOn) : undefined;\n }\n return out.reverse();\n }\n\n /**\n * Resolves a paragraph style: defaults, then each style of the chain (base\n * first). Unknown ids resolve to the defaults in a `paragraph` block.\n */\n resolve(id: string): ResolvedStyle {\n let paragraph = overlay<ParagraphFormat>({}, this.defaults.paragraph);\n let character = overlay<CharacterFormat>({}, this.defaults.character);\n let block: StyleBlock = { type: \"paragraph\" };\n this.chain(id).forEach((style) => {\n if (style.kind !== \"paragraph\") return;\n paragraph = overlay(paragraph, style.paragraph);\n character = overlay(character, style.character);\n if (style.block) block = clone(style.block);\n });\n return { id, paragraph, character, block, next: this.nextStyleId(id) };\n }\n\n /** Character formatting a paragraph style's chain sets (without defaults). */\n private paragraphCharacter(id: string): CharacterFormat {\n let character: CharacterFormat = {};\n this.chain(id).forEach((style) => {\n if (style.kind === \"paragraph\") character = overlay(character, style.character);\n });\n return character;\n }\n\n /**\n * Character formatting of a character style's chain. A style linked to a\n * paragraph style takes that style's character formatting first.\n */\n resolveCharacterStyle(id: string): CharacterFormat {\n let character: CharacterFormat = {};\n this.chain(id).forEach((style) => {\n if (style.kind === \"character\" && style.linked && this.get(style.linked)?.kind === \"paragraph\") {\n character = overlay(character, this.paragraphCharacter(style.linked));\n }\n character = overlay(character, style.character);\n });\n return character;\n }\n\n /**\n * Character formatting of text: defaults → paragraph style chain →\n * character style chain → direct formatting.\n */\n resolveText(input: {\n paragraphStyle?: string | null;\n characterStyle?: string | null;\n direct?: CharacterFormat;\n }): CharacterFormat {\n let character = this.resolve(input.paragraphStyle || NORMAL_STYLE_ID).character;\n if (input.characterStyle) character = overlay(character, this.resolveCharacterStyle(input.characterStyle));\n return overlay(character, input.direct);\n }\n\n /** The style after Enter at the end of a paragraph of `id` (itself when unset or unknown). */\n nextStyleId(id: string): string {\n const next = this.styles.get(id)?.next;\n return next && this.styles.get(next)?.kind === \"paragraph\" ? next : id;\n }\n\n /** The linked character style of a paragraph style, if any. */\n linkedCharacterStyle(id: string): StyleDefinition | undefined {\n const style = this.styles.get(id);\n const linked = style?.linked ? this.styles.get(style.linked) : undefined;\n return style?.kind === \"paragraph\" && linked?.kind === \"character\" ? linked : undefined;\n }\n\n /**\n * The style a block uses when it names none: Normal for paragraphs,\n * Heading N for headings of level N, Code for code blocks (the built-in\n * style whose own `block` matches).\n */\n defaultStyleFor(type: string, attrs: Record<string, any> = {}): string | null {\n if (type === \"paragraph\" && this.styles.get(NORMAL_STYLE_ID)) return NORMAL_STYLE_ID;\n const candidates = this.list(\"paragraph\").filter(\n (style) => style.block && sameBlock(style.block, type, attrs),\n );\n return (candidates.find((s) => s.builtin) ?? candidates[0])?.id ?? null;\n }\n\n /** The style of a block: its `styleId` when known, otherwise the block's default style. */\n styleOfBlock(type: string, attrs: Record<string, any> = {}): string | null {\n const id = attrs.styleId;\n if (id && this.styles.get(id)?.kind === \"paragraph\") return id;\n return this.defaultStyleFor(type, attrs);\n }\n\n getSnapshot = (): StyleRegistrySnapshot => {\n if (!this.snapshot) {\n this.snapshot = Object.freeze({\n styles: Object.freeze(this.list()),\n defaults: this.defaults,\n version: this.version,\n });\n }\n return this.snapshot;\n };\n\n subscribe = (listener: (snapshot: StyleRegistrySnapshot) => void): (() => void) => {\n this.listeners.add(listener);\n listener(this.getSnapshot());\n return () => {\n this.listeners.delete(listener);\n };\n };\n\n toJSON(): StyleRegistryJSON {\n return { styles: clone(Array.from(this.styles.values())), defaults: clone(this.defaults) };\n }\n\n // -- Writing --------------------------------------------------------------\n\n /** Adds or replaces a style. Throws on an invalid id. */\n upsert(style: StyleDefinition): StyleDefinition {\n const stored = this.put(style);\n this.changed();\n return stored;\n }\n\n /** Merges `patch` into a style (formats are merged key by key). Returns `undefined` for unknown ids. */\n update(id: string, patch: Partial<Omit<StyleDefinition, \"id\">>): StyleDefinition | undefined {\n const current = this.styles.get(id);\n if (!current) return undefined;\n const next: StyleDefinition = {\n ...current,\n ...patch,\n id,\n paragraph: patch.paragraph ? { ...current.paragraph, ...patch.paragraph } : current.paragraph,\n character: patch.character ? { ...current.character, ...patch.character } : current.character,\n };\n return this.upsert(next);\n }\n\n /**\n * Removes a style and returns it. Built-in styles cannot be removed. Styles\n * based on it are rebased onto its own base, and `next`/`linked`\n * references to it are dropped.\n */\n remove(id: string): StyleDefinition | undefined {\n const gone = this.styles.get(id);\n if (!gone || gone.builtin) return undefined;\n this.styles.delete(id);\n this.styles.forEach((style, key) => {\n let changed = style;\n if (style.basedOn === id) {\n changed = { ...changed, basedOn: gone.basedOn && gone.basedOn !== key ? gone.basedOn : null };\n }\n if (style.next === id) changed = { ...changed, next: null };\n if (style.linked === id) changed = { ...changed, linked: null };\n if (changed !== style) this.styles.set(key, changed);\n });\n this.changed();\n return gone;\n }\n\n /** Replaces the document defaults. */\n setDefaults(defaults: StyleDefaults): void {\n this.defaults = clone(defaults);\n this.changed();\n }\n\n /** An unused id derived from a display name (`My Style` → `MyStyle`, then `MyStyle1`, …). */\n newId(name: string): string {\n let base = name.replace(/[^A-Za-z0-9_-]+/g, \"\").replace(/^[^A-Za-z]+/, \"\").slice(0, 56);\n if (!base) base = \"Style\";\n if (!this.styles.has(base)) return base;\n for (let i = 1; i < 100000; i++) {\n const id = `${base}${i}`;\n if (!this.styles.has(id)) return id;\n }\n return `${base}${Date.now()}`;\n }\n\n // -- CSS --------------------------------------------------------------------\n\n /** CSS declarations (`property: value`) of a resolved paragraph or character style. */\n cssDeclarations(id: string): Record<string, string> {\n const style = this.styles.get(id);\n if (style?.kind === \"character\") return characterCSS(this.resolveCharacterStyle(id));\n const resolved = this.resolve(id);\n return { ...paragraphCSS(resolved.paragraph), ...characterCSS(resolved.character) };\n }\n\n /**\n * Declarations for previewing a style in a menu or gallery: font family,\n * weight, style, color, decoration, case and letter spacing (no sizes,\n * margins or borders).\n */\n previewDeclarations(id: string): Record<string, string> {\n return Object.fromEntries(\n Object.entries(this.cssDeclarations(id)).filter(([property]) => PREVIEW_PROPERTIES.has(property)),\n );\n }\n\n /**\n * A stylesheet for the styles: `[data-style=\"Id\"]` rules for paragraph\n * styles (plus the plain element of blocks that use their default style,\n * e.g. `h2:not([data-style])`), `[data-char-style=\"Id\"]` for character\n * styles and the defaults on the scope element.\n */\n toCSS(options: StyleCSSOptions = {}): string {\n const scope = options.scope ?? \".ProseMirror\";\n const tagFor = options.tagFor ?? defaultTagFor;\n const rules: string[] = [];\n const rule = (selectors: string[], declarations: Record<string, string>) => {\n const body = Object.entries(declarations)\n .map(([property, value]) => `${property}: ${value};`)\n .join(\" \");\n if (body) rules.push(`${selectors.join(\", \")} { ${body} }`);\n };\n rule([scope], {\n ...paragraphCSS(this.defaults.paragraph ?? {}),\n ...characterCSS(this.defaults.character ?? {}),\n });\n this.list().forEach((style) => {\n if (style.kind === \"character\") {\n rule([`${scope} [data-char-style=\"${style.id}\"]`], this.cssDeclarations(style.id));\n return;\n }\n const selectors = [`${scope} [data-style=\"${style.id}\"]`];\n const block = this.resolve(style.id).block;\n if (this.defaultStyleFor(block.type, block.attrs ?? {}) === style.id) {\n const tag = tagFor(block);\n if (tag) selectors.push(`${scope} ${tag}:not([data-style])`);\n }\n // Defaults already apply to the scope; repeat only what the chain sets.\n const resolved = this.resolve(style.id);\n const own = {\n ...paragraphCSS(withoutDefaults(resolved.paragraph, this.defaults.paragraph)),\n ...characterCSS(withoutDefaults(resolved.character, this.defaults.character)),\n };\n rule(selectors, own);\n });\n return rules.join(\"\\n\");\n }\n\n // -- Internals --------------------------------------------------------------\n\n private put(style: StyleDefinition): StyleDefinition {\n if (!isValidStyleId(style.id)) throw new Error(`Invalid style id: ${String(style.id)}`);\n if (style.kind !== \"paragraph\" && style.kind !== \"character\") {\n throw new Error(`Invalid style kind: ${String(style.kind)}`);\n }\n const stored = clone({ ...style, name: style.name || style.id });\n this.styles.set(style.id, stored);\n return stored;\n }\n\n private changed(): void {\n this.version++;\n this.snapshot = null;\n const snapshot = this.getSnapshot();\n this.listeners.forEach((listener) => {\n try {\n listener(snapshot);\n } catch (err) {\n console.error(\"[StyleRegistry] Error in listener:\", err);\n }\n });\n }\n}\n\nfunction withoutDefaults<T extends object>(format: T, defaults: T | undefined): T {\n if (!defaults) return format;\n const out: Record<string, unknown> = {};\n Object.entries(format).forEach(([key, value]) => {\n if ((defaults as Record<string, unknown>)[key] !== value) out[key] = value;\n });\n return out as T;\n}\n\nfunction defaultTagFor(block: StyleBlock): string | null {\n if (block.type === \"paragraph\") return \"p\";\n if (block.type === \"heading\") {\n const level = Number(block.attrs?.level);\n return level >= 1 && level <= 6 ? `h${level}` : null;\n }\n if (block.type === \"codeBlock\") return \"pre\";\n return null;\n}\n\n/** A CSS value, or `undefined` when it is unsafe or empty. */\nexport function safeCSSValue(value: unknown): string | undefined {\n if (typeof value !== \"string\") return undefined;\n const trimmed = value.trim();\n if (!trimmed || trimmed.length > 200 || UNSAFE_CSS.test(trimmed)) return undefined;\n return trimmed;\n}\n\nfunction paragraphCSS(format: ParagraphFormat): Record<string, string> {\n const out: Record<string, string> = {};\n const set = (property: string, value: unknown) => {\n const safe = safeCSSValue(value);\n if (safe) out[property] = safe;\n };\n set(\"text-align\", format.textAlign);\n set(\"line-height\", format.lineHeight);\n set(\"margin-top\", format.spaceBefore);\n set(\"margin-bottom\", format.spaceAfter);\n set(\"margin-left\", format.indentLeft);\n set(\"margin-right\", format.indentRight);\n set(\"text-indent\", format.indentFirstLine);\n set(\"border-left\", format.borderLeft);\n set(\"padding-left\", format.paddingLeft);\n set(\"background-color\", format.backgroundColor);\n return out;\n}\n\nfunction characterCSS(format: CharacterFormat): Record<string, string> {\n const out: Record<string, string> = {};\n const set = (property: string, value: unknown) => {\n const safe = safeCSSValue(value);\n if (safe) out[property] = safe;\n };\n set(\"font-family\", format.fontFamily);\n set(\"font-size\", format.fontSize);\n if (format.bold !== undefined) out[\"font-weight\"] = format.bold ? \"700\" : \"400\";\n if (format.italic !== undefined) out[\"font-style\"] = format.italic ? \"italic\" : \"normal\";\n const lines = [format.underline && \"underline\", format.strike && \"line-through\"].filter(Boolean);\n if (format.underline !== undefined || format.strike !== undefined) {\n out[\"text-decoration-line\"] = lines.length ? lines.join(\" \") : \"none\";\n }\n set(\"color\", format.color);\n set(\"background-color\", format.backgroundColor);\n set(\"letter-spacing\", format.letterSpacing);\n set(\"text-transform\", format.textTransform);\n if (format.smallCaps !== undefined) out[\"font-variant-caps\"] = format.smallCaps ? \"small-caps\" : \"normal\";\n return out;\n}\n\n/** Creates a style registry with the built-in styles (unless `builtins: false`) and `styles`. */\nexport function createStyleRegistry(options: StyleRegistryOptions | StyleRegistryJSON = {}): StyleRegistry {\n return new StyleRegistry(options as StyleRegistryOptions);\n}\n"],"mappings":";AAmHA,IAAM,YAAY;AAClB,IAAM,WAAW;AAEjB,IAAM,aAAa;AAEZ,IAAM,kBAAkB;AAE/B,IAAM,qBAAqB,oBAAI,IAAI;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAGM,SAAS,eAAe,IAA2B;AACxD,SAAO,OAAO,OAAO,YAAY,SAAS,KAAK,EAAE;AACnD;AAEA,IAAM,QAAQ;AACd,IAAM,gBAAgB,CAAC,OAAO,SAAS,UAAU,SAAS,OAAO,OAAO;AAExE,SAAS,gBAAmC;AAC1C,QAAM,SAA4B;AAAA,IAChC;AAAA,MACE,IAAI;AAAA,MACJ,MAAM;AAAA,MACN,MAAM;AAAA,MACN,OAAO,EAAE,MAAM,YAAY;AAAA,MAC3B,UAAU;AAAA,MACV,OAAO;AAAA,MACP,SAAS;AAAA,IACX;AAAA,IACA;AAAA,MACE,IAAI;AAAA,MACJ,MAAM;AAAA,MACN,MAAM;AAAA,MACN,SAAS;AAAA,MACT,MAAM;AAAA,MACN,QAAQ;AAAA,MACR,WAAW,EAAE,YAAY,UAAU,YAAY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
6
7
|
|
|
7
|
-
var _chunk3CC7OPUQcjs = require('./chunk-3CC7OPUQ.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunk3ZBAXET6cjs = require('./chunk-3ZBAXET6.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
@@ -2461,13 +2461,13 @@ async function loadCharts(zip, Parser, root, rels, options) {
|
|
|
2461
2461
|
const charts = /* @__PURE__ */ new Map();
|
|
2462
2462
|
if (options.charts === false) return charts;
|
|
2463
2463
|
for (const el of descendants(root, "chart")) {
|
|
2464
|
-
if (el.namespaceURI !==
|
|
2464
|
+
if (el.namespaceURI !== _chunk3ZBAXET6cjs.CHART_OOXML_NS) continue;
|
|
2465
2465
|
const id = attr(el, "id");
|
|
2466
2466
|
const rel = id ? rels.get(id) : void 0;
|
|
2467
2467
|
if (!id || !rel || rel.external || charts.has(id)) continue;
|
|
2468
2468
|
const entry = zip.get(rel.target);
|
|
2469
2469
|
if (!entry) continue;
|
|
2470
|
-
const read =
|
|
2470
|
+
const read = _chunk3ZBAXET6cjs.chartFromOoxml.call(void 0, await zip.readText(entry), { DOMParser: Parser });
|
|
2471
2471
|
charts.set(id, {
|
|
2472
2472
|
id: `chart-${charts.size + 1}`,
|
|
2473
2473
|
path: rel.target,
|
|
@@ -2636,7 +2636,7 @@ function mapStyleIds(styles) {
|
|
|
2636
2636
|
if (!/^[A-Za-z]/.test(id)) id = `S${id}`;
|
|
2637
2637
|
let unique = id;
|
|
2638
2638
|
for (let n = 2; used.has(unique); n++) unique = `${id}${n}`;
|
|
2639
|
-
if (!
|
|
2639
|
+
if (!_chunkO6FO6VI3cjs.isValidStyleId.call(void 0, unique)) return;
|
|
2640
2640
|
used.add(unique);
|
|
2641
2641
|
ids.set(fileId, unique);
|
|
2642
2642
|
});
|
|
@@ -2667,12 +2667,12 @@ function styleDefinitions(styles, ids) {
|
|
|
2667
2667
|
else if (style.outlineLevel !== void 0 && style.outlineLevel >= 0 && style.outlineLevel <= 5) {
|
|
2668
2668
|
definition.block = { type: "heading", attrs: { level: style.outlineLevel + 1 } };
|
|
2669
2669
|
} else if (id === "Code") definition.block = { type: "codeBlock" };
|
|
2670
|
-
else if (id ===
|
|
2670
|
+
else if (id === _chunkO6FO6VI3cjs.NORMAL_STYLE_ID) definition.block = { type: "paragraph" };
|
|
2671
2671
|
}
|
|
2672
2672
|
if (style.priority !== void 0) definition.priority = style.priority;
|
|
2673
2673
|
if (style.quick) definition.quick = true;
|
|
2674
2674
|
if (style.hidden) definition.hidden = true;
|
|
2675
|
-
const builtin =
|
|
2675
|
+
const builtin = _chunkO6FO6VI3cjs.DEFAULT_STYLES.find((s) => s.id === id && s.kind === kind);
|
|
2676
2676
|
if (builtin) {
|
|
2677
2677
|
definition.builtin = true;
|
|
2678
2678
|
definition.block ??= builtin.block;
|
|
@@ -3134,7 +3134,7 @@ var ParagraphRenderer = (_class2 = class {
|
|
|
3134
3134
|
};
|
|
3135
3135
|
if (child.localName === "AlternateContent") {
|
|
3136
3136
|
const branch = childElements(child).find(
|
|
3137
|
-
(b) => descendants(b, "blip").length || descendants(b, "imagedata").length || descendants(b, "chart").some((el) => el.namespaceURI ===
|
|
3137
|
+
(b) => descendants(b, "blip").length || descendants(b, "imagedata").length || descendants(b, "chart").some((el) => el.namespaceURI === _chunk3ZBAXET6cjs.CHART_OOXML_NS)
|
|
3138
3138
|
);
|
|
3139
3139
|
if (branch) this.image(branch, format, push);
|
|
3140
3140
|
return;
|
|
@@ -3201,7 +3201,7 @@ var ParagraphRenderer = (_class2 = class {
|
|
|
3201
3201
|
/** Charts this paragraph contains, in order. */
|
|
3202
3202
|
__init4() {this.charts = []}
|
|
3203
3203
|
image(container, format, push) {
|
|
3204
|
-
const chartRef = descendants(container, "chart").find((el) => el.namespaceURI ===
|
|
3204
|
+
const chartRef = descendants(container, "chart").find((el) => el.namespaceURI === _chunk3ZBAXET6cjs.CHART_OOXML_NS);
|
|
3205
3205
|
const chart = chartRef ? this.part.charts.get(_nullishCoalesce(attr(chartRef, "id"), () => ( ""))) : void 0;
|
|
3206
3206
|
if (chart) {
|
|
3207
3207
|
if (!this.ctx.charts.includes(chart)) this.ctx.charts.push(chart);
|
|
@@ -3292,7 +3292,7 @@ function blockChangeAttr(pPr, ctx) {
|
|
|
3292
3292
|
const oldOutline = attr(wChild(oldPPr, "outlineLvl"), "val");
|
|
3293
3293
|
const level = oldOutline !== void 0 ? Number(oldOutline) >= 0 && Number(oldOutline) <= 5 ? Number(oldOutline) + 1 : void 0 : styleHeadingLevel(ctx.styles, oldStyle);
|
|
3294
3294
|
const mappedStyle = oldStyle ? ctx.styleIds.get(oldStyle) : void 0;
|
|
3295
|
-
const previous = level !== void 0 ? { type: "heading", attrs: { level }, wrappers: [] } : specialStyle(ctx.styles, oldStyle) === "code" ? { type: "codeBlock", attrs: {}, wrappers: [] } : { type: "paragraph", attrs: mappedStyle && mappedStyle !==
|
|
3295
|
+
const previous = level !== void 0 ? { type: "heading", attrs: { level }, wrappers: [] } : specialStyle(ctx.styles, oldStyle) === "code" ? { type: "codeBlock", attrs: {}, wrappers: [] } : { type: "paragraph", attrs: mappedStyle && mappedStyle !== _chunkO6FO6VI3cjs.NORMAL_STYLE_ID ? { styleId: mappedStyle } : {}, wrappers: [] };
|
|
3296
3296
|
const author = authorOf(ctx, attr(change, "author"));
|
|
3297
3297
|
const record = {
|
|
3298
3298
|
changeId: _chunkIFHKKVXHcjs.createReviewId.call(void 0, "change"),
|
|
@@ -3344,7 +3344,7 @@ function renderBlocks(container, ctx, part, topLevel = false) {
|
|
|
3344
3344
|
const task = list && !list.ordered ? renderer.takeTaskGlyph() : void 0;
|
|
3345
3345
|
const inner = renderer.html();
|
|
3346
3346
|
const mappedStyle = styleId ? ctx.styleIds.get(styleId) : void 0;
|
|
3347
|
-
const styleAttr = !heading && !list && mappedStyle && mappedStyle !==
|
|
3347
|
+
const styleAttr = !heading && !list && mappedStyle && mappedStyle !== _chunkO6FO6VI3cjs.NORMAL_STYLE_ID ? ` data-style="${_chunk66IMF6ODcjs.escapeHtml.call(void 0, mappedStyle)}"` : "";
|
|
3348
3348
|
const changeAttr = topLevel && !list && ctx.tracked === "marks" ? blockChangeAttr(pPr, ctx) : "";
|
|
3349
3349
|
const charts = renderer.charts.map(chartBlockHtml).join("");
|
|
3350
3350
|
const blockHtml = (charts && !inner && !heading ? "" : heading ? `<h${heading}${changeAttr}>${inner}</h${heading}>` : `<p${styleAttr}${changeAttr}>${inner}</p>`) + charts;
|
|
@@ -3438,7 +3438,7 @@ async function docxToDocumentImport(data, options = {}) {
|
|
|
3438
3438
|
const Parser = getDomParser(options);
|
|
3439
3439
|
let zip;
|
|
3440
3440
|
try {
|
|
3441
|
-
zip = await
|
|
3441
|
+
zip = await _chunk3ZBAXET6cjs.readZip.call(void 0, data, { maxTotalSize: 100 * 1024 * 1024, maxEntries: 5e3, ...options.zip });
|
|
3442
3442
|
} catch (error) {
|
|
3443
3443
|
if (_optionalChain([error, 'optionalAccess', _122 => _122.code]) === "invalid_archive") {
|
|
3444
3444
|
throw new ImportError("invalid_file", "Not a DOCX file (the file is not a ZIP package).", { cause: error });
|
|
@@ -3526,7 +3526,7 @@ async function docxToDocumentImport(data, options = {}) {
|
|
|
3526
3526
|
if (ctx.charts.length) result.charts = ctx.charts;
|
|
3527
3527
|
if (useStyles) {
|
|
3528
3528
|
const definitions = styleDefinitions(styles, styleIds);
|
|
3529
|
-
if (definitions.length) result.styles =
|
|
3529
|
+
if (definitions.length) result.styles = _chunkO6FO6VI3cjs.createStyleRegistry.call(void 0, { styles: definitions });
|
|
3530
3530
|
}
|
|
3531
3531
|
return result;
|
|
3532
3532
|
}
|
|
@@ -6012,7 +6012,7 @@ var CharacterStyle = _core.Mark.create({
|
|
|
6012
6012
|
default: null,
|
|
6013
6013
|
parseHTML: (el) => {
|
|
6014
6014
|
const id = el.getAttribute("data-char-style");
|
|
6015
|
-
return
|
|
6015
|
+
return _chunkO6FO6VI3cjs.isValidStyleId.call(void 0, id) ? id : null;
|
|
6016
6016
|
},
|
|
6017
6017
|
renderHTML: (attrs) => attrs[STYLE_ID_ATTRIBUTE] ? { "data-char-style": attrs[STYLE_ID_ATTRIBUTE] } : {}
|
|
6018
6018
|
}
|
|
@@ -6038,7 +6038,7 @@ var ParagraphStyles = _core.Extension.create({
|
|
|
6038
6038
|
};
|
|
6039
6039
|
},
|
|
6040
6040
|
addStorage() {
|
|
6041
|
-
return { registry: _nullishCoalesce(this.options.registry, () => (
|
|
6041
|
+
return { registry: _nullishCoalesce(this.options.registry, () => ( _chunkO6FO6VI3cjs.createStyleRegistry.call(void 0, ))) };
|
|
6042
6042
|
},
|
|
6043
6043
|
addExtensions() {
|
|
6044
6044
|
return [CharacterStyle];
|
|
@@ -6053,11 +6053,11 @@ var ParagraphStyles = _core.Extension.create({
|
|
|
6053
6053
|
keepOnSplit: true,
|
|
6054
6054
|
parseHTML: (el) => {
|
|
6055
6055
|
const id = el.getAttribute("data-style");
|
|
6056
|
-
return
|
|
6056
|
+
return _chunkO6FO6VI3cjs.isValidStyleId.call(void 0, id) ? id : null;
|
|
6057
6057
|
},
|
|
6058
6058
|
renderHTML: (attrs) => {
|
|
6059
6059
|
const id = attrs[STYLE_ID_ATTRIBUTE];
|
|
6060
|
-
return
|
|
6060
|
+
return _chunkO6FO6VI3cjs.isValidStyleId.call(void 0, id) ? { "data-style": id, class: `pixerate-style-${id}` } : {};
|
|
6061
6061
|
}
|
|
6062
6062
|
}
|
|
6063
6063
|
}
|
|
@@ -6084,7 +6084,7 @@ var ParagraphStyles = _core.Extension.create({
|
|
|
6084
6084
|
if (dispatch) setParagraphStyle(tr, state, id, reg);
|
|
6085
6085
|
return true;
|
|
6086
6086
|
},
|
|
6087
|
-
clearParagraphStyle: () => ({ commands }) => commands.setParagraphStyle(
|
|
6087
|
+
clearParagraphStyle: () => ({ commands }) => commands.setParagraphStyle(_chunkO6FO6VI3cjs.NORMAL_STYLE_ID),
|
|
6088
6088
|
setCharacterStyle: (id) => ({ commands }) => {
|
|
6089
6089
|
if (_optionalChain([registry, 'call', _213 => _213(), 'access', _214 => _214.get, 'call', _215 => _215(id), 'optionalAccess', _216 => _216.kind]) !== "character") return false;
|
|
6090
6090
|
return commands.setMark(CHARACTER_STYLE_MARK_NAME, { [STYLE_ID_ATTRIBUTE]: id });
|
|
@@ -6106,7 +6106,7 @@ var ParagraphStyles = _core.Extension.create({
|
|
|
6106
6106
|
const trimmed = name.trim();
|
|
6107
6107
|
if (!trimmed) return false;
|
|
6108
6108
|
const id = _nullishCoalesce(options.id, () => ( reg.newId(trimmed)));
|
|
6109
|
-
if (!
|
|
6109
|
+
if (!_chunkO6FO6VI3cjs.isValidStyleId.call(void 0, id) || reg.get(id)) return false;
|
|
6110
6110
|
const basedOn = options.basedOn === void 0 ? getParagraphStyleAt(state, reg) : options.basedOn;
|
|
6111
6111
|
if (dispatch) {
|
|
6112
6112
|
const captured = captureSelectionFormat(state);
|
|
@@ -6114,7 +6114,7 @@ var ParagraphStyles = _core.Extension.create({
|
|
|
6114
6114
|
id,
|
|
6115
6115
|
name: trimmed,
|
|
6116
6116
|
kind: "paragraph",
|
|
6117
|
-
basedOn: _nullishCoalesce(basedOn, () => (
|
|
6117
|
+
basedOn: _nullishCoalesce(basedOn, () => ( _chunkO6FO6VI3cjs.NORMAL_STYLE_ID)),
|
|
6118
6118
|
paragraph: captured.paragraph,
|
|
6119
6119
|
character: captured.character,
|
|
6120
6120
|
priority: 50,
|
|
@@ -6753,4 +6753,4 @@ function createTableCommands(editor, options = {}) {
|
|
|
6753
6753
|
|
|
6754
6754
|
|
|
6755
6755
|
exports.GradientText = GradientText; exports.SlashCommands = SlashCommands; exports.TemplateSuggestions = TemplateSuggestions; exports.LoadingNode = LoadingNode; exports.SMILIE_REPLACEMENTS = SMILIE_REPLACEMENTS; exports.smilieAutocorrectRules = smilieAutocorrectRules; exports.SmilieReplacer = SmilieReplacer; exports.findHexColors = findHexColors; exports.ColorHighlighter = ColorHighlighter; exports.FontSize = FontSize; exports.Mention = Mention; exports.getMentionNodes = getMentionNodes; exports.setMentionRoleAt = setMentionRoleAt; exports.createMentionExtension = createMentionExtension; exports.Markdown = Markdown2; exports.imagePastePluginKey = imagePastePluginKey; exports.insertImageNode = insertImageNode; exports.updateImageSrc = updateImageSrc; exports.removeImageNode = removeImageNode; exports.handleImageInsertion = handleImageInsertion; exports.Image = Image2; exports.commentsPluginKey = commentsPluginKey; exports.COMMENT_MARK_NAME = COMMENT_MARK_NAME; exports.findCommentRanges = findCommentRanges; exports.getCommentAnchors = getCommentAnchors; exports.getCommentIdsAt = getCommentIdsAt; exports.getCommentStore = getCommentStore; exports.Comments = Comments; exports.getCommentAuthor = getCommentAuthor; exports.compareInEditor = compareInEditor; exports.applyDocumentComparison = applyDocumentComparison; exports.DocumentCompare = DocumentCompare; exports.ImportError = ImportError; exports.createImportContext = createImportContext; exports.ImportAdapterRegistry = ImportAdapterRegistry; exports.DOCX_MIME_TYPES = DOCX_MIME_TYPES; exports.DEFAULT_DOCX_MAX_IMAGE_SIZE = DEFAULT_DOCX_MAX_IMAGE_SIZE; exports.docxToDocumentImport = docxToDocumentImport; exports.createDocxImportAdapter = createDocxImportAdapter; exports.docxImportAdapter = docxImportAdapter; exports.markdownImportAdapter = markdownImportAdapter; exports.htmlImportAdapter = htmlImportAdapter; exports.plainTextImportAdapter = plainTextImportAdapter; exports.rtfImportAdapter = rtfImportAdapter; exports.BUILT_IN_IMPORT_ADAPTERS = BUILT_IN_IMPORT_ADAPTERS; exports.createImportAdapterRegistry = createImportAdapterRegistry; exports.defaultImportRegistry = defaultImportRegistry; exports.registerImportAdapter = registerImportAdapter; exports.unregisterImportAdapter = unregisterImportAdapter; exports.findImportAdapter = findImportAdapter; exports.importFile = importFile; exports.getImportAccept = getImportAccept; exports.htmlToSlice = htmlToSlice; exports.insertImportedDocument = insertImportedDocument; exports.applyImportedReviewData = applyImportedReviewData; exports.importFilesIntoEditor = importFilesIntoEditor; exports.fileImportPluginKey = fileImportPluginKey; exports.FileImport = FileImport; exports.richClipboardPluginKey = richClipboardPluginKey; exports.writeRichClipboard = writeRichClipboard; exports.RichClipboard = RichClipboard; exports.smartQuoteRules = smartQuoteRules; exports.symbolRules = symbolRules; exports.fractionRules = fractionRules; exports.capitalizeSentenceRules = capitalizeSentenceRules; exports.twoInitialCapitalsRules = twoInitialCapitalsRules; exports.defaultAutocorrectRules = defaultAutocorrectRules; exports.DEFAULT_AUTOCORRECT_EXCEPTIONS = DEFAULT_AUTOCORRECT_EXCEPTIONS; exports.autocorrectPluginKey = autocorrectPluginKey; exports.findAutocorrection = findAutocorrection; exports.isInsidePromptToken = isInsidePromptToken; exports.Autocorrect = Autocorrect; exports.outlinePluginKey = outlinePluginKey; exports.computeOutline = computeOutline; exports.buildOutlineTree = buildOutlineTree; exports.getOutline = getOutline; exports.getActiveHeading = getActiveHeading; exports.createOutlineStore = createOutlineStore; exports.navigateToHeading = navigateToHeading; exports.Outline = Outline; exports.tableOfContentsMarkdownIt = tableOfContentsMarkdownIt; exports.footnotesMarkdownIt = footnotesMarkdownIt; exports.tableOfContentsPluginKey = tableOfContentsPluginKey; exports.getTableOfContentsEntries = getTableOfContentsEntries; exports.TableOfContents = TableOfContents; exports.footnotesPluginKey = footnotesPluginKey; exports.getFootnotes = getFootnotes; exports.syncFootnotes = syncFootnotes; exports.FootnoteReference = FootnoteReference; exports.Footnotes = Footnotes; exports.Footnote = Footnote; exports.getBookmarks = getBookmarks; exports.Bookmark = Bookmark; exports.crossReferencePluginKey = crossReferencePluginKey; exports.getCrossReferenceTargets = getCrossReferenceTargets; exports.CrossReference = CrossReference; exports.documentStructureCommandItems = documentStructureCommandItems; exports.getDocumentStructureCommandItems = getDocumentStructureCommandItems; exports.EMPTY_FIND_REPLACE_SNAPSHOT = EMPTY_FIND_REPLACE_SNAPSHOT; exports.FindReplaceStore = FindReplaceStore; exports.findReplacePluginKey = findReplacePluginKey; exports.getFindReplaceState = getFindReplaceState; exports.getFindReplaceStore = getFindReplaceStore; exports.FIND_OPTION_TOGGLES = FIND_OPTION_TOGGLES; exports.formatFindStatus = formatFindStatus; exports.FindReplace = FindReplace; exports.STYLE_ID_ATTRIBUTE = STYLE_ID_ATTRIBUTE; exports.CHARACTER_STYLE_MARK_NAME = CHARACTER_STYLE_MARK_NAME; exports.paragraphStylesPluginKey = paragraphStylesPluginKey; exports.getStyleRegistry = getStyleRegistry; exports.isParagraphStyleAvailable = isParagraphStyleAvailable; exports.getParagraphStyleAt = getParagraphStyleAt; exports.captureSelectionFormat = captureSelectionFormat; exports.CharacterStyle = CharacterStyle; exports.ParagraphStyles = ParagraphStyles; exports.createParagraphStylesStore = createParagraphStylesStore; exports.createRichTextPreset = createRichTextPreset; exports.createFindReplaceCommands = createFindReplaceCommands; exports.validateFindPattern = validateFindPattern; exports.createTableCommands = createTableCommands;
|
|
6756
|
-
//# sourceMappingURL=chunk-
|
|
6756
|
+
//# sourceMappingURL=chunk-M5Z77GFH.cjs.map
|