oasis-editor 0.0.142 → 0.0.144

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.
@@ -2731,7 +2731,7 @@ function OasisEditorAppLazy(props = {}) {
2731
2731
  onCleanup(() => {
2732
2732
  cancelled = true;
2733
2733
  });
2734
- import("./OasisEditorApp-DNiy9Yze.js").then((m) => {
2734
+ import("./OasisEditorApp-CskQWKEC.js").then((m) => {
2735
2735
  cancelled = true;
2736
2736
  setProgress(1);
2737
2737
  setTimeout(() => setApp(() => m.OasisEditorApp), 180);
@@ -34838,38 +34838,174 @@ var dom = dom$2;
34838
34838
  var XMLSerializer = dom.XMLSerializer;
34839
34839
  var domParser = domParser$1;
34840
34840
  var DOMParser$1 = domParser.DOMParser;
34841
- const WORD_NS = "http://schemas.openxmlformats.org/wordprocessingml/2006/main";
34842
- const DRAWINGML_NS = "http://schemas.openxmlformats.org/drawingml/2006/main";
34843
- const OFFICE_REL_NS = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
34844
- const WORD14_NS = "http://schemas.microsoft.com/office/word/2010/wordml";
34845
- const MARKUP_COMPAT_NS = "http://schemas.openxmlformats.org/markup-compatibility/2006";
34846
- function getChildrenByTagNameNS(element, namespace, localName) {
34847
- if (!element) {
34848
- return [];
34849
- }
34850
- const result = [];
34841
+ const MARKUP_COMPATIBILITY_NS = "http://schemas.openxmlformats.org/markup-compatibility/2006";
34842
+ const DEFAULT_MARKUP_COMPATIBILITY_CAPABILITIES = {
34843
+ // Oasis deliberately declares no extension namespace globally. A namespace
34844
+ // is added only by a specialized parser that understands that extension's
34845
+ // semantics; otherwise AlternateContent degrades through mc:Fallback.
34846
+ supportedNamespaces: /* @__PURE__ */ new Set()
34847
+ };
34848
+ function extendMarkupCompatibilityCapabilities(base, ...namespaces) {
34849
+ return {
34850
+ supportedNamespaces: /* @__PURE__ */ new Set([
34851
+ ...base.supportedNamespaces,
34852
+ ...namespaces
34853
+ ])
34854
+ };
34855
+ }
34856
+ function directElementChildren(element) {
34857
+ const children2 = [];
34851
34858
  for (let index = 0; index < element.childNodes.length; index += 1) {
34852
34859
  const node = element.childNodes[index];
34853
- if ((node == null ? void 0 : node.nodeType) !== node.ELEMENT_NODE) continue;
34854
- const el = node;
34855
- if (el.namespaceURI === MARKUP_COMPAT_NS && el.localName === "AlternateContent") {
34856
- for (let j = 0; j < el.childNodes.length; j += 1) {
34857
- const child = el.childNodes[j];
34858
- if ((child == null ? void 0 : child.nodeType) !== child.ELEMENT_NODE) continue;
34859
- const childEl = child;
34860
- if (childEl.namespaceURI === MARKUP_COMPAT_NS && childEl.localName === "Fallback") {
34861
- result.push(...getChildrenByTagNameNS(childEl, namespace, localName));
34862
- break;
34863
- }
34860
+ if ((node == null ? void 0 : node.nodeType) === node.ELEMENT_NODE) {
34861
+ children2.push(node);
34862
+ }
34863
+ }
34864
+ return children2;
34865
+ }
34866
+ function getParentElement(element) {
34867
+ const parentNode = element.parentNode;
34868
+ return (parentNode == null ? void 0 : parentNode.nodeType) === 1 ? parentNode : null;
34869
+ }
34870
+ function lookupNamespaceUri(element, prefix2) {
34871
+ let current = element;
34872
+ const attributeName = prefix2 ? `xmlns:${prefix2}` : "xmlns";
34873
+ while (current) {
34874
+ const value = current.getAttribute(attributeName);
34875
+ if (value) {
34876
+ return value;
34877
+ }
34878
+ current = getParentElement(current);
34879
+ }
34880
+ return void 0;
34881
+ }
34882
+ function getMarkupCompatibilityAttribute(element, localName) {
34883
+ return element.getAttributeNS(MARKUP_COMPATIBILITY_NS, localName) ?? element.getAttribute(`mc:${localName}`) ?? void 0;
34884
+ }
34885
+ function inheritedMarkupCompatibilityTokens(element, attributeName) {
34886
+ const chain = [];
34887
+ let current = element;
34888
+ while (current) {
34889
+ chain.push(current);
34890
+ current = getParentElement(current);
34891
+ }
34892
+ const result = [];
34893
+ for (const owner of chain.reverse()) {
34894
+ const raw = getMarkupCompatibilityAttribute(owner, attributeName);
34895
+ if (!raw) {
34896
+ continue;
34897
+ }
34898
+ for (const token of raw.split(/\s+/).filter(Boolean)) {
34899
+ result.push({ element: owner, token });
34900
+ }
34901
+ }
34902
+ return result;
34903
+ }
34904
+ function getIgnorableNamespaces(element) {
34905
+ const namespaces = /* @__PURE__ */ new Set();
34906
+ for (const entry of inheritedMarkupCompatibilityTokens(
34907
+ element,
34908
+ "Ignorable"
34909
+ )) {
34910
+ const namespace = lookupNamespaceUri(entry.element, entry.token);
34911
+ if (namespace) {
34912
+ namespaces.add(namespace);
34913
+ }
34914
+ }
34915
+ return namespaces;
34916
+ }
34917
+ function expandedName(element, token) {
34918
+ const separator = token.indexOf(":");
34919
+ if (separator < 1 || separator === token.length - 1) {
34920
+ return void 0;
34921
+ }
34922
+ const prefix2 = token.slice(0, separator);
34923
+ const localName = token.slice(separator + 1);
34924
+ const namespace = lookupNamespaceUri(element, prefix2);
34925
+ return namespace ? `${namespace}\0${localName}` : void 0;
34926
+ }
34927
+ function getProcessContentNames(element) {
34928
+ const names = /* @__PURE__ */ new Set();
34929
+ for (const entry of inheritedMarkupCompatibilityTokens(
34930
+ element,
34931
+ "ProcessContent"
34932
+ )) {
34933
+ const name = expandedName(entry.element, entry.token);
34934
+ if (name) {
34935
+ names.add(name);
34936
+ }
34937
+ }
34938
+ return names;
34939
+ }
34940
+ function choiceIsSupported(choice, capabilities) {
34941
+ var _a2;
34942
+ const requires = (_a2 = choice.getAttribute("Requires")) == null ? void 0 : _a2.trim();
34943
+ if (!requires) {
34944
+ return false;
34945
+ }
34946
+ return requires.split(/\s+/).every((prefix2) => {
34947
+ const namespace = lookupNamespaceUri(choice, prefix2);
34948
+ return Boolean(
34949
+ namespace && capabilities.supportedNamespaces.has(namespace)
34950
+ );
34951
+ });
34952
+ }
34953
+ function resolveAlternateContentBranch(alternateContent, capabilities) {
34954
+ let fallback;
34955
+ for (const child of directElementChildren(alternateContent)) {
34956
+ if (child.namespaceURI !== MARKUP_COMPATIBILITY_NS) {
34957
+ continue;
34958
+ }
34959
+ if (child.localName === "Choice" && choiceIsSupported(child, capabilities)) {
34960
+ return child;
34961
+ }
34962
+ if (child.localName === "Fallback") {
34963
+ fallback = child;
34964
+ }
34965
+ }
34966
+ return fallback;
34967
+ }
34968
+ function getMarkupCompatibleChildren(element, capabilities = DEFAULT_MARKUP_COMPATIBILITY_CAPABILITIES) {
34969
+ const result = [];
34970
+ const ignorableNamespaces = getIgnorableNamespaces(element);
34971
+ const processContentNames = getProcessContentNames(element);
34972
+ for (const child of directElementChildren(element)) {
34973
+ if (child.namespaceURI === MARKUP_COMPATIBILITY_NS && child.localName === "AlternateContent") {
34974
+ const branch = resolveAlternateContentBranch(child, capabilities);
34975
+ if (branch) {
34976
+ result.push(...getMarkupCompatibleChildren(branch, capabilities));
34864
34977
  }
34865
34978
  continue;
34866
34979
  }
34867
- if (el.namespaceURI === namespace && el.localName === localName) {
34868
- result.push(el);
34980
+ const namespace = child.namespaceURI ?? "";
34981
+ const isUnsupportedIgnorable = ignorableNamespaces.has(namespace) && !capabilities.supportedNamespaces.has(namespace);
34982
+ if (isUnsupportedIgnorable) {
34983
+ const name = `${namespace}\0${child.localName ?? child.tagName}`;
34984
+ if (processContentNames.has(name)) {
34985
+ result.push(...getMarkupCompatibleChildren(child, capabilities));
34986
+ }
34987
+ continue;
34869
34988
  }
34989
+ result.push(child);
34870
34990
  }
34871
34991
  return result;
34872
34992
  }
34993
+ const WORD_NS = "http://schemas.openxmlformats.org/wordprocessingml/2006/main";
34994
+ const DRAWINGML_NS = "http://schemas.openxmlformats.org/drawingml/2006/main";
34995
+ const OFFICE_REL_NS = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
34996
+ const WORD14_NS = "http://schemas.microsoft.com/office/word/2010/wordml";
34997
+ const WORD14_MARKUP_COMPATIBILITY_CAPABILITIES = extendMarkupCompatibilityCapabilities(
34998
+ DEFAULT_MARKUP_COMPATIBILITY_CAPABILITIES,
34999
+ WORD14_NS
35000
+ );
35001
+ function getChildrenByTagNameNS(element, namespace, localName) {
35002
+ if (!element) {
35003
+ return [];
35004
+ }
35005
+ return getMarkupCompatibleChildren(element).filter(
35006
+ (child) => child.namespaceURI === namespace && child.localName === localName
35007
+ );
35008
+ }
34873
35009
  const DOCX_TEXT_DIRECTIONS = [
34874
35010
  "lrTb",
34875
35011
  "tbRl",
@@ -34884,33 +35020,15 @@ function getFirstChildByTagNameNS(element, namespace, localName) {
34884
35020
  return getChildrenByTagNameNS(element, namespace, localName)[0] ?? null;
34885
35021
  }
34886
35022
  function getFirstW14Child(element, localName) {
34887
- if (!element) return null;
34888
- for (let i = 0; i < element.childNodes.length; i++) {
34889
- const node = element.childNodes[i];
34890
- if ((node == null ? void 0 : node.nodeType) !== node.ELEMENT_NODE) continue;
34891
- const el = node;
34892
- if (el.namespaceURI === WORD14_NS && el.localName === localName) {
34893
- return el;
34894
- }
34895
- if (el.namespaceURI === MARKUP_COMPAT_NS && el.localName === "AlternateContent") {
34896
- for (let j = 0; j < el.childNodes.length; j++) {
34897
- const child = el.childNodes[j];
34898
- if ((child == null ? void 0 : child.nodeType) !== child.ELEMENT_NODE) continue;
34899
- const choiceEl = child;
34900
- if (choiceEl.namespaceURI === MARKUP_COMPAT_NS && choiceEl.localName === "Choice") {
34901
- for (let k = 0; k < choiceEl.childNodes.length; k++) {
34902
- const gc = choiceEl.childNodes[k];
34903
- if ((gc == null ? void 0 : gc.nodeType) !== gc.ELEMENT_NODE) continue;
34904
- const gcEl = gc;
34905
- if (gcEl.namespaceURI === WORD14_NS && gcEl.localName === localName) {
34906
- return gcEl;
34907
- }
34908
- }
34909
- }
34910
- }
34911
- }
35023
+ if (!element) {
35024
+ return null;
34912
35025
  }
34913
- return null;
35026
+ return getMarkupCompatibleChildren(
35027
+ element,
35028
+ WORD14_MARKUP_COMPATIBILITY_CAPABILITIES
35029
+ ).find(
35030
+ (child) => child.namespaceURI === WORD14_NS && child.localName === localName
35031
+ ) ?? null;
34914
35032
  }
34915
35033
  function getAttributeValue(element, localName) {
34916
35034
  if (!element) {
@@ -34937,9 +35055,12 @@ function collectExtAttributes(element) {
34937
35055
  const attr = attrs[i];
34938
35056
  if (!attr) continue;
34939
35057
  const ns = attr.namespaceURI;
34940
- if (!ns || ns === WORD_NS) continue;
35058
+ if (!ns || ns === WORD_NS || ns === MARKUP_COMPATIBILITY_NS) continue;
34941
35059
  if (attr.prefix === "xmlns" || attr.localName === "xmlns") continue;
34942
- result[`${attr.prefix}:${attr.localName}`] = attr.value;
35060
+ const localName = attr.localName ?? attr.name;
35061
+ if (!localName) continue;
35062
+ const name = attr.prefix ? `${attr.prefix}:${localName}` : localName;
35063
+ result[name] = attr.value;
34943
35064
  }
34944
35065
  return Object.keys(result).length > 0 ? result : void 0;
34945
35066
  }
@@ -35370,6 +35491,23 @@ function parseSettings(xml) {
35370
35491
  }
35371
35492
  return settings;
35372
35493
  }
35494
+ function setEditorListOoxmlNumberingMetadata(list, metadata) {
35495
+ list.ooxmlNumbering = {
35496
+ ...metadata,
35497
+ importedFormat: list.format,
35498
+ importedKind: list.kind
35499
+ };
35500
+ }
35501
+ function getEditorListOoxmlNumberingMetadata(list) {
35502
+ return list.ooxmlNumbering;
35503
+ }
35504
+ function getEffectiveEditorListOoxmlFormat(list) {
35505
+ const metadata = getEditorListOoxmlNumberingMetadata(list);
35506
+ if (!(metadata == null ? void 0 : metadata.format) || metadata.importedKind !== list.kind || metadata.importedFormat !== list.format) {
35507
+ return void 0;
35508
+ }
35509
+ return metadata.format;
35510
+ }
35373
35511
  const FORMAT_MAP = {
35374
35512
  decimal: "decimal",
35375
35513
  lowerLetter: "lowerLetter",
@@ -35381,6 +35519,14 @@ const FORMAT_MAP = {
35381
35519
  function isXmlTrue$1(value) {
35382
35520
  return value == null || value === "1" || value === "true" || value === "on";
35383
35521
  }
35522
+ function parseOptionalInteger(element) {
35523
+ const raw = getAttributeValue(element, "val");
35524
+ if (raw == null) {
35525
+ return void 0;
35526
+ }
35527
+ const value = Number.parseInt(raw, 10);
35528
+ return Number.isFinite(value) ? value : void 0;
35529
+ }
35384
35530
  function parseLevel(level) {
35385
35531
  const result = {};
35386
35532
  const formatRaw = getAttributeValue(
@@ -35390,6 +35536,7 @@ function parseLevel(level) {
35390
35536
  if (formatRaw) {
35391
35537
  result.kind = formatRaw === "bullet" ? "bullet" : "ordered";
35392
35538
  result.format = FORMAT_MAP[formatRaw];
35539
+ result.rawFormat = formatRaw;
35393
35540
  }
35394
35541
  const suffix = getAttributeValue(
35395
35542
  getFirstChildByTagNameNS(level, WORD_NS, "suff"),
@@ -35398,13 +35545,11 @@ function parseLevel(level) {
35398
35545
  if (suffix === "tab" || suffix === "space" || suffix === "nothing") {
35399
35546
  result.suffix = suffix;
35400
35547
  }
35401
- const startRaw = getAttributeValue(
35402
- getFirstChildByTagNameNS(level, WORD_NS, "start"),
35403
- "val"
35548
+ const startAt = parseOptionalInteger(
35549
+ getFirstChildByTagNameNS(level, WORD_NS, "start")
35404
35550
  );
35405
- if (startRaw != null) {
35406
- const startAt = Number.parseInt(startRaw, 10);
35407
- if (Number.isFinite(startAt)) result.startAt = startAt;
35551
+ if (startAt !== void 0) {
35552
+ result.startAt = startAt;
35408
35553
  }
35409
35554
  result.levelText = getAttributeValue(
35410
35555
  getFirstChildByTagNameNS(level, WORD_NS, "lvlText"),
@@ -35419,6 +35564,16 @@ function parseLevel(level) {
35419
35564
  }
35420
35565
  const legal = getFirstChildByTagNameNS(level, WORD_NS, "isLgl");
35421
35566
  if (legal) result.legal = isXmlTrue$1(getAttributeValue(legal, "val"));
35567
+ const restartAfterLevel = parseOptionalInteger(
35568
+ getFirstChildByTagNameNS(level, WORD_NS, "lvlRestart")
35569
+ );
35570
+ if (restartAfterLevel !== void 0) {
35571
+ result.restartAfterLevel = restartAfterLevel;
35572
+ }
35573
+ result.paragraphStyleId = getAttributeValue(
35574
+ getFirstChildByTagNameNS(level, WORD_NS, "pStyle"),
35575
+ "val"
35576
+ ) ?? void 0;
35422
35577
  if (result.kind === "bullet" && result.levelText) {
35423
35578
  result.bulletGlyph = result.levelText;
35424
35579
  }
@@ -35485,15 +35640,11 @@ function parseNumbering(numberingXml) {
35485
35640
  parseLevel(overrideLevel)
35486
35641
  );
35487
35642
  }
35488
- const startRaw = getAttributeValue(
35489
- getFirstChildByTagNameNS(override, WORD_NS, "startOverride"),
35490
- "val"
35643
+ const startAt = parseOptionalInteger(
35644
+ getFirstChildByTagNameNS(override, WORD_NS, "startOverride")
35491
35645
  );
35492
- if (startRaw != null) {
35493
- const startAt = Number.parseInt(startRaw, 10);
35494
- if (Number.isFinite(startAt)) {
35495
- maps.numStartOverrides.set(`${numId}:${ilvl}`, startAt);
35496
- }
35646
+ if (startAt !== void 0) {
35647
+ maps.numStartOverrides.set(`${numId}:${ilvl}`, startAt);
35497
35648
  }
35498
35649
  }
35499
35650
  }
@@ -35529,21 +35680,29 @@ function parseParagraphList(paragraphProperties, numberingMaps) {
35529
35680
  const isFirstInInstance = !numberingMaps.seenInstances.has(instanceKey);
35530
35681
  numberingMaps.seenInstances.add(instanceKey);
35531
35682
  const startAt = isFirstInInstance ? numberingMaps.numStartOverrides.get(instanceKey) ?? effective.startAt : void 0;
35683
+ const list = {
35684
+ kind: effective.kind ?? "ordered",
35685
+ level: safeLevel,
35686
+ instanceId: numId,
35687
+ suffix: effective.suffix ?? "tab",
35688
+ ...effective.format ? { format: effective.format } : {},
35689
+ ...levelFormats.length ? { levelFormats } : {},
35690
+ ...effective.levelText ? { levelText: effective.levelText } : {},
35691
+ ...effective.alignment ? { alignment: effective.alignment } : {},
35692
+ ...effective.legal !== void 0 ? { legal: effective.legal } : {},
35693
+ ...startAt !== void 0 && startAt !== 1 ? { startAt } : {},
35694
+ ...effective.bulletGlyph ? { bulletGlyph: effective.bulletGlyph } : {},
35695
+ ...effective.bulletFont ? { bulletFont: effective.bulletFont } : {}
35696
+ };
35697
+ if (effective.rawFormat || effective.restartAfterLevel !== void 0 || effective.paragraphStyleId) {
35698
+ setEditorListOoxmlNumberingMetadata(list, {
35699
+ ...effective.rawFormat ? { format: effective.rawFormat } : {},
35700
+ ...effective.restartAfterLevel !== void 0 ? { restartAfterLevel: effective.restartAfterLevel } : {},
35701
+ ...effective.paragraphStyleId ? { paragraphStyleId: effective.paragraphStyleId } : {}
35702
+ });
35703
+ }
35532
35704
  return {
35533
- list: {
35534
- kind: effective.kind ?? "ordered",
35535
- level: safeLevel,
35536
- instanceId: numId,
35537
- suffix: effective.suffix ?? "tab",
35538
- ...effective.format ? { format: effective.format } : {},
35539
- ...levelFormats.length ? { levelFormats } : {},
35540
- ...effective.levelText ? { levelText: effective.levelText } : {},
35541
- ...effective.alignment ? { alignment: effective.alignment } : {},
35542
- ...effective.legal !== void 0 ? { legal: effective.legal } : {},
35543
- ...startAt !== void 0 && startAt !== 1 ? { startAt } : {},
35544
- ...effective.bulletGlyph ? { bulletGlyph: effective.bulletGlyph } : {},
35545
- ...effective.bulletFont ? { bulletFont: effective.bulletFont } : {}
35546
- },
35705
+ list,
35547
35706
  indent: effective.indent
35548
35707
  };
35549
35708
  }
@@ -38494,6 +38653,162 @@ function parseDropCapFrame(paragraphProperties, runs) {
38494
38653
  style: (_a2 = runs[0]) == null ? void 0 : _a2.styles
38495
38654
  };
38496
38655
  }
38656
+ const RUN_PROPERTIES_PATTERN = /<w:rPr(?:\s|\/|>)/;
38657
+ const PARAGRAPH_PROPERTIES_PATTERN = /<w:pPr(?:\s|\/|>)/;
38658
+ function ownsEditorNodeIdentity(value) {
38659
+ return typeof value.kind === "string" || typeof value.type === "string" || Array.isArray(value.runs) || Array.isArray(value.rows) || Array.isArray(value.cells) || Array.isArray(value.blocks);
38660
+ }
38661
+ function normalizeSemanticValue(value) {
38662
+ if (Array.isArray(value)) {
38663
+ return value.map(normalizeSemanticValue);
38664
+ }
38665
+ if (!value || typeof value !== "object") {
38666
+ return value;
38667
+ }
38668
+ const record = value;
38669
+ const omitNodeId = ownsEditorNodeIdentity(record);
38670
+ const normalized = {};
38671
+ for (const [key, child] of Object.entries(record).sort(
38672
+ ([left], [right]) => left.localeCompare(right)
38673
+ )) {
38674
+ if (child === void 0 || key === "id" && omitNodeId || key === "ooxmlSource" || key.startsWith("__")) {
38675
+ continue;
38676
+ }
38677
+ normalized[key] = normalizeSemanticValue(child);
38678
+ }
38679
+ return normalized;
38680
+ }
38681
+ function stableSemanticString(value) {
38682
+ return JSON.stringify(normalizeSemanticValue(value)) ?? "undefined";
38683
+ }
38684
+ function hasRelationshipReference(xml) {
38685
+ return /\br:(?:id|embed|link)\s*=/.test(xml);
38686
+ }
38687
+ function ooxmlSourceNeedsCanonicalRunSerialization(xml) {
38688
+ return RUN_PROPERTIES_PATTERN.test(xml);
38689
+ }
38690
+ function createEditorRunSemanticSignature(run) {
38691
+ return stableSemanticString(run);
38692
+ }
38693
+ function createEditorRunStructureSignature(run) {
38694
+ const semanticRun = { ...run, text: void 0 };
38695
+ return stableSemanticString(semanticRun);
38696
+ }
38697
+ function setEditorRunOoxmlSource(run, xml) {
38698
+ run.ooxmlSource = {
38699
+ xml,
38700
+ semanticSignature: createEditorRunSemanticSignature(run),
38701
+ structureSignature: createEditorRunStructureSignature(run)
38702
+ };
38703
+ }
38704
+ function getEditorRunOoxmlSource(run) {
38705
+ return run.ooxmlSource;
38706
+ }
38707
+ function copyEditorRunOoxmlSource(source, target) {
38708
+ const sourceFragment = getEditorRunOoxmlSource(source);
38709
+ if (sourceFragment) {
38710
+ target.ooxmlSource = {
38711
+ ...sourceFragment
38712
+ };
38713
+ }
38714
+ return target;
38715
+ }
38716
+ function createEditorParagraphSemanticSignature(paragraph) {
38717
+ return stableSemanticString(paragraph);
38718
+ }
38719
+ function createEditorParagraphPropertiesSignature(paragraph) {
38720
+ return stableSemanticString({
38721
+ style: paragraph.style,
38722
+ list: paragraph.list
38723
+ });
38724
+ }
38725
+ function setEditorParagraphOoxmlSource(paragraph, source) {
38726
+ const paragraphSource = {};
38727
+ if (source.xml) {
38728
+ paragraphSource.xml = source.xml;
38729
+ paragraphSource.semanticSignature = createEditorParagraphSemanticSignature(paragraph);
38730
+ }
38731
+ if (source.attributes) {
38732
+ paragraphSource.attributes = source.attributes;
38733
+ }
38734
+ if (source.paragraphPropertiesXml) {
38735
+ paragraphSource.paragraphProperties = {
38736
+ xml: source.paragraphPropertiesXml,
38737
+ semanticSignature: createEditorParagraphPropertiesSignature(paragraph)
38738
+ };
38739
+ }
38740
+ if (paragraphSource.xml || paragraphSource.attributes || paragraphSource.paragraphProperties) {
38741
+ paragraph.ooxmlSource = paragraphSource;
38742
+ }
38743
+ }
38744
+ function getEditorParagraphOoxmlSource(paragraph) {
38745
+ return paragraph.ooxmlSource;
38746
+ }
38747
+ function getReusableEditorParagraphXml(paragraph, options) {
38748
+ const source = getEditorParagraphOoxmlSource(paragraph);
38749
+ if (!(source == null ? void 0 : source.xml) || !source.semanticSignature || options.hasOverrides || options.hasBoundaryTokens || hasRelationshipReference(source.xml) || RUN_PROPERTIES_PATTERN.test(source.xml) || PARAGRAPH_PROPERTIES_PATTERN.test(source.xml)) {
38750
+ return void 0;
38751
+ }
38752
+ return source.semanticSignature === createEditorParagraphSemanticSignature(paragraph) ? source.xml : void 0;
38753
+ }
38754
+ function getEditorParagraphOoxmlAttributes(paragraph) {
38755
+ var _a2;
38756
+ return (_a2 = getEditorParagraphOoxmlSource(paragraph)) == null ? void 0 : _a2.attributes;
38757
+ }
38758
+ function serializeShallowElementAttributes(element, serializer) {
38759
+ const shallowXml = serializer.serializeToString(element.cloneNode(false));
38760
+ const openTagEnd = shallowXml.indexOf(">");
38761
+ if (openTagEnd < 0) {
38762
+ return void 0;
38763
+ }
38764
+ const openTag = shallowXml.slice(0, openTagEnd + 1);
38765
+ const elementName = element.tagName;
38766
+ const rawAttributes = openTag.slice(`<${elementName}`.length, openTag.endsWith("/>") ? -2 : -1).trim();
38767
+ return rawAttributes || void 0;
38768
+ }
38769
+ function collectParagraphRunXml(paragraphNode, serializer) {
38770
+ const result = [];
38771
+ const visit = (container) => {
38772
+ for (let index = 0; index < container.childNodes.length; index += 1) {
38773
+ const node = container.childNodes[index];
38774
+ if ((node == null ? void 0 : node.nodeType) !== node.ELEMENT_NODE) {
38775
+ continue;
38776
+ }
38777
+ const element = node;
38778
+ if (element.namespaceURI === WORD_NS && element.localName === "r") {
38779
+ result.push(serializer.serializeToString(element));
38780
+ continue;
38781
+ }
38782
+ if (element.namespaceURI === WORD_NS && (element.localName === "pPr" || element.localName === "p" || element.localName === "tbl" || element.localName === "txbxContent")) {
38783
+ continue;
38784
+ }
38785
+ visit(element);
38786
+ }
38787
+ };
38788
+ visit(paragraphNode);
38789
+ return result;
38790
+ }
38791
+ function captureImportedParagraphSource(paragraphNode, paragraphProperties, importedRuns) {
38792
+ const serializer = new XMLSerializer();
38793
+ const attributes = serializeShallowElementAttributes(
38794
+ paragraphNode,
38795
+ serializer
38796
+ );
38797
+ const inlineSectionProperties = paragraphProperties ? getFirstChildByTagNameNS(paragraphProperties, WORD_NS, "sectPr") : null;
38798
+ const xml = !inlineSectionProperties ? serializer.serializeToString(paragraphNode) : void 0;
38799
+ const paragraphPropertiesXml = paragraphProperties && !inlineSectionProperties ? serializer.serializeToString(paragraphProperties) : void 0;
38800
+ const collectedRunXml = collectParagraphRunXml(paragraphNode, serializer);
38801
+ const runXml = collectedRunXml.length === importedRuns.length ? collectedRunXml : void 0;
38802
+ if (!xml && !attributes && !paragraphPropertiesXml && !runXml) {
38803
+ return void 0;
38804
+ }
38805
+ return {
38806
+ ...xml ? { xml } : {},
38807
+ ...attributes ? { attributes } : {},
38808
+ ...paragraphPropertiesXml ? { paragraphPropertiesXml } : {},
38809
+ ...runXml ? { runXml } : {}
38810
+ };
38811
+ }
38497
38812
  function importedRunToEditorRun(run) {
38498
38813
  const base = {
38499
38814
  id: createEditorNodeId("run"),
@@ -38537,8 +38852,8 @@ function importedRunToEditorRun(run) {
38537
38852
  }
38538
38853
  return withMarkers;
38539
38854
  }
38540
- function createImportedParagraph(runs, paragraphStyle, list, markRunStyle) {
38541
- var _a2;
38855
+ function createImportedParagraph(runs, paragraphStyle, list, markRunStyle, source) {
38856
+ var _a2, _b2;
38542
38857
  const editorRuns = runs.length > 0 ? runs.map(importedRunToEditorRun) : (
38543
38858
  // An empty paragraph still carries the formatting of its paragraph mark
38544
38859
  // (`w:pPr/w:rPr`), which Word uses to render the blank line's font/size.
@@ -38565,6 +38880,14 @@ function createImportedParagraph(runs, paragraphStyle, list, markRunStyle) {
38565
38880
  );
38566
38881
  }
38567
38882
  paragraph.list = list ? { ...list } : void 0;
38883
+ if (((_b2 = source == null ? void 0 : source.runXml) == null ? void 0 : _b2.length) === paragraph.runs.length) {
38884
+ for (let index = 0; index < paragraph.runs.length; index += 1) {
38885
+ setEditorRunOoxmlSource(paragraph.runs[index], source.runXml[index]);
38886
+ }
38887
+ }
38888
+ if (source) {
38889
+ setEditorParagraphOoxmlSource(paragraph, source);
38890
+ }
38568
38891
  return paragraph;
38569
38892
  }
38570
38893
  function splitRunsAtPageBreaks(runs) {
@@ -38644,9 +38967,20 @@ async function parseParagraphNodes(paragraphNode, numberingMaps, zip, relsMap, a
38644
38967
  }
38645
38968
  const { segments, hasPageBreak } = splitRunsAtPageBreaks(runs);
38646
38969
  if (!hasPageBreak) {
38970
+ const source = captureImportedParagraphSource(
38971
+ paragraphNode,
38972
+ paragraphProperties,
38973
+ runs
38974
+ );
38647
38975
  return {
38648
38976
  paragraphs: [
38649
- createImportedParagraph(runs, paragraphStyle, list, markRunStyle)
38977
+ createImportedParagraph(
38978
+ runs,
38979
+ paragraphStyle,
38980
+ list,
38981
+ markRunStyle,
38982
+ source
38983
+ )
38650
38984
  ],
38651
38985
  pageBreakAfter: false
38652
38986
  };
@@ -40235,13 +40569,414 @@ function remapImportedEndnoteRefsInSections(sections, byDocxId) {
40235
40569
  };
40236
40570
  walkSectionBlocks(sections, remapBlock);
40237
40571
  }
40572
+ const OPC_CONTENT_TYPES_PATH = "[Content_Types].xml";
40573
+ const OPC_ROOT_RELATIONSHIPS_PATH = "_rels/.rels";
40574
+ const OPC_RELATIONSHIPS_NAMESPACE = "http://schemas.openxmlformats.org/package/2006/relationships";
40575
+ const OPC_CONTENT_TYPES_NAMESPACE = "http://schemas.openxmlformats.org/package/2006/content-types";
40576
+ function escapeXml(value) {
40577
+ return value.replaceAll("&", "&amp;").replaceAll('"', "&quot;").replaceAll("<", "&lt;").replaceAll(">", "&gt;");
40578
+ }
40579
+ function normalizeOpcPartPath(path) {
40580
+ return path.replaceAll("\\", "/").replace(/^\/+/, "");
40581
+ }
40582
+ function resolveOpcRelationshipTarget(ownerPartPath, target) {
40583
+ const normalizedTarget = target.replaceAll("\\", "/");
40584
+ const ownerDirectory = (ownerPartPath == null ? void 0 : ownerPartPath.includes("/")) ? ownerPartPath.slice(0, ownerPartPath.lastIndexOf("/") + 1) : "";
40585
+ const rawPath = normalizedTarget.startsWith("/") ? normalizedTarget.slice(1) : `${ownerDirectory}${normalizedTarget}`;
40586
+ const segments = [];
40587
+ for (const segment of rawPath.split("/")) {
40588
+ if (!segment || segment === ".") {
40589
+ continue;
40590
+ }
40591
+ if (segment === "..") {
40592
+ if (segments.length === 0) {
40593
+ return null;
40594
+ }
40595
+ segments.pop();
40596
+ continue;
40597
+ }
40598
+ segments.push(segment);
40599
+ }
40600
+ return segments.join("/");
40601
+ }
40602
+ function getOpcRelationshipOwnerPath(path) {
40603
+ if (path === OPC_ROOT_RELATIONSHIPS_PATH) {
40604
+ return null;
40605
+ }
40606
+ const nestedMarker = "/_rels/";
40607
+ const nestedIndex = path.lastIndexOf(nestedMarker);
40608
+ if (nestedIndex >= 0 && path.endsWith(".rels")) {
40609
+ const directory = path.slice(0, nestedIndex);
40610
+ const relationshipFile = path.slice(nestedIndex + nestedMarker.length);
40611
+ return `${directory}/${relationshipFile.slice(0, -".rels".length)}`;
40612
+ }
40613
+ if (path.startsWith("_rels/") && path.endsWith(".rels")) {
40614
+ return path.slice("_rels/".length, -".rels".length);
40615
+ }
40616
+ return void 0;
40617
+ }
40618
+ function parseOpcContentTypes(xml) {
40619
+ var _a2;
40620
+ const result = { defaults: {}, overrides: {} };
40621
+ if (!xml) {
40622
+ return result;
40623
+ }
40624
+ const document2 = new DOMParser$1().parseFromString(xml, "application/xml");
40625
+ const root = document2.documentElement;
40626
+ if (!root) {
40627
+ return result;
40628
+ }
40629
+ for (let index = 0; index < root.childNodes.length; index += 1) {
40630
+ const node = root.childNodes[index];
40631
+ if ((node == null ? void 0 : node.nodeType) !== node.ELEMENT_NODE) {
40632
+ continue;
40633
+ }
40634
+ const element = node;
40635
+ if (element.localName === "Default") {
40636
+ const extension = (_a2 = element.getAttribute("Extension")) == null ? void 0 : _a2.toLowerCase();
40637
+ const contentType = element.getAttribute("ContentType");
40638
+ if (extension && contentType) {
40639
+ result.defaults[extension] = contentType;
40640
+ }
40641
+ } else if (element.localName === "Override") {
40642
+ const partName = element.getAttribute("PartName");
40643
+ const contentType = element.getAttribute("ContentType");
40644
+ if (partName && contentType) {
40645
+ result.overrides[normalizeOpcPartPath(partName)] = contentType;
40646
+ }
40647
+ }
40648
+ }
40649
+ return result;
40650
+ }
40651
+ function serializeOpcContentTypes(contentTypes) {
40652
+ const defaults = Object.entries(contentTypes.defaults).sort(([left], [right]) => left.localeCompare(right)).map(
40653
+ ([extension, contentType]) => `<Default Extension="${escapeXml(extension)}" ContentType="${escapeXml(contentType)}"/>`
40654
+ ).join("");
40655
+ const overrides = Object.entries(contentTypes.overrides).sort(([left], [right]) => left.localeCompare(right)).map(
40656
+ ([partName, contentType]) => `<Override PartName="/${escapeXml(normalizeOpcPartPath(partName))}" ContentType="${escapeXml(contentType)}"/>`
40657
+ ).join("");
40658
+ return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Types xmlns="${OPC_CONTENT_TYPES_NAMESPACE}">${defaults}${overrides}</Types>`;
40659
+ }
40660
+ function parseOpcRelationships(xml) {
40661
+ if (!xml) {
40662
+ return [];
40663
+ }
40664
+ const document2 = new DOMParser$1().parseFromString(xml, "application/xml");
40665
+ const root = document2.documentElement;
40666
+ if (!root) {
40667
+ return [];
40668
+ }
40669
+ const relationships = [];
40670
+ for (let index = 0; index < root.childNodes.length; index += 1) {
40671
+ const node = root.childNodes[index];
40672
+ if ((node == null ? void 0 : node.nodeType) !== node.ELEMENT_NODE) {
40673
+ continue;
40674
+ }
40675
+ const element = node;
40676
+ if (element.localName !== "Relationship") {
40677
+ continue;
40678
+ }
40679
+ const id = element.getAttribute("Id");
40680
+ const type = element.getAttribute("Type");
40681
+ const target = element.getAttribute("Target");
40682
+ if (!id || !type || !target) {
40683
+ continue;
40684
+ }
40685
+ const targetModeRaw = element.getAttribute("TargetMode");
40686
+ relationships.push({
40687
+ id,
40688
+ type,
40689
+ target,
40690
+ targetMode: targetModeRaw === "External" ? "External" : "Internal"
40691
+ });
40692
+ }
40693
+ return relationships;
40694
+ }
40695
+ function serializeOpcRelationships(relationships) {
40696
+ const body = relationships.map((relationship) => {
40697
+ const targetMode = relationship.targetMode === "External" ? ' TargetMode="External"' : "";
40698
+ return `<Relationship Id="${escapeXml(relationship.id)}" Type="${escapeXml(relationship.type)}" Target="${escapeXml(relationship.target)}"${targetMode}/>`;
40699
+ }).join("");
40700
+ return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="${OPC_RELATIONSHIPS_NAMESPACE}">${body}</Relationships>`;
40701
+ }
40702
+ function resolveOpcRelationships(ownerPartPath, relationships, onUnsafeTarget) {
40703
+ return relationships.map((relationship) => {
40704
+ if (relationship.targetMode === "External") {
40705
+ return { ...relationship, resolvedTarget: void 0 };
40706
+ }
40707
+ const resolvedTarget = resolveOpcRelationshipTarget(
40708
+ ownerPartPath,
40709
+ relationship.target
40710
+ );
40711
+ if (!resolvedTarget) {
40712
+ onUnsafeTarget == null ? void 0 : onUnsafeTarget(relationship);
40713
+ return relationship;
40714
+ }
40715
+ return { ...relationship, resolvedTarget };
40716
+ });
40717
+ }
40718
+ const CONVENTIONAL_MAIN_DOCUMENT_PATH$1 = "word/document.xml";
40719
+ const OFFICE_DOCUMENT_RELATIONSHIP_SUFFIX = "/officeDocument";
40720
+ function hashString(value) {
40721
+ let hash = 2166136261;
40722
+ for (let index = 0; index < value.length; index += 1) {
40723
+ hash ^= value.charCodeAt(index);
40724
+ hash = Math.imul(hash, 16777619);
40725
+ }
40726
+ return (hash >>> 0).toString(16).padStart(8, "0");
40727
+ }
40728
+ function getContentType(path, contentTypes) {
40729
+ const override = contentTypes.overrides[path];
40730
+ if (override) {
40731
+ return override;
40732
+ }
40733
+ const extension = path.includes(".") ? path.slice(path.lastIndexOf(".") + 1).toLowerCase() : "";
40734
+ return contentTypes.defaults[extension];
40735
+ }
40736
+ function isXmlPart(path, contentType) {
40737
+ if (path.endsWith(".xml") || path.endsWith(".rels")) {
40738
+ return true;
40739
+ }
40740
+ return contentType === "application/xml" || Boolean(contentType == null ? void 0 : contentType.endsWith("+xml"));
40741
+ }
40742
+ async function captureDocxSourcePackage(buffer) {
40743
+ var _a2;
40744
+ const zip = await JSZip.loadAsync(buffer);
40745
+ const diagnostics = [];
40746
+ const contentTypesXml = await ((_a2 = zip.file(OPC_CONTENT_TYPES_PATH)) == null ? void 0 : _a2.async("string"));
40747
+ const contentTypes = parseOpcContentTypes(contentTypesXml);
40748
+ if (!contentTypesXml) {
40749
+ diagnostics.push({
40750
+ level: "warning",
40751
+ code: "missing-content-types",
40752
+ message: "The DOCX package does not contain [Content_Types].xml."
40753
+ });
40754
+ }
40755
+ const parts = {};
40756
+ for (const [rawPath, entry] of Object.entries(zip.files)) {
40757
+ if (entry.dir) {
40758
+ continue;
40759
+ }
40760
+ const path = normalizeOpcPartPath(rawPath);
40761
+ const contentType = getContentType(path, contentTypes);
40762
+ const kind = isXmlPart(path, contentType) ? "xml" : "binary";
40763
+ const data = kind === "xml" ? await entry.async("string") : await entry.async("base64");
40764
+ parts[path] = {
40765
+ path,
40766
+ ...contentType ? { contentType } : {},
40767
+ kind,
40768
+ data,
40769
+ encoding: kind === "xml" ? "utf8" : "base64",
40770
+ originalHash: hashString(data)
40771
+ };
40772
+ }
40773
+ let rootRelationships = [];
40774
+ for (const [path, part] of Object.entries(parts)) {
40775
+ const ownerPartPath = getOpcRelationshipOwnerPath(path);
40776
+ if (ownerPartPath === void 0 || part.kind !== "xml") {
40777
+ continue;
40778
+ }
40779
+ const relationships = resolveOpcRelationships(
40780
+ ownerPartPath,
40781
+ parseOpcRelationships(part.data),
40782
+ (relationship) => {
40783
+ diagnostics.push({
40784
+ level: "warning",
40785
+ code: "unsafe-relationship-target",
40786
+ message: `Relationship ${relationship.id} points outside the OPC package.`,
40787
+ ...ownerPartPath ? { partPath: ownerPartPath } : {},
40788
+ relationshipId: relationship.id
40789
+ });
40790
+ }
40791
+ );
40792
+ if (ownerPartPath === null) {
40793
+ rootRelationships = relationships;
40794
+ continue;
40795
+ }
40796
+ const ownerPart = parts[ownerPartPath];
40797
+ if (ownerPart) {
40798
+ ownerPart.relationships = relationships;
40799
+ } else {
40800
+ diagnostics.push({
40801
+ level: "warning",
40802
+ code: "orphan-relationships-part",
40803
+ message: `Relationship part ${path} has no owning package part.`,
40804
+ partPath: path
40805
+ });
40806
+ }
40807
+ }
40808
+ const officeDocumentRelationship = rootRelationships.find(
40809
+ (relationship) => relationship.targetMode !== "External" && relationship.type.endsWith(OFFICE_DOCUMENT_RELATIONSHIP_SUFFIX)
40810
+ );
40811
+ let mainDocumentPart = officeDocumentRelationship == null ? void 0 : officeDocumentRelationship.resolvedTarget;
40812
+ if (!mainDocumentPart || !parts[mainDocumentPart]) {
40813
+ if (parts[CONVENTIONAL_MAIN_DOCUMENT_PATH$1]) {
40814
+ mainDocumentPart = CONVENTIONAL_MAIN_DOCUMENT_PATH$1;
40815
+ diagnostics.push({
40816
+ level: "warning",
40817
+ code: "main-document-fallback",
40818
+ message: "The officeDocument relationship was absent or invalid; word/document.xml was used as a compatibility fallback."
40819
+ });
40820
+ } else {
40821
+ throw new Error(
40822
+ "DOCX package has no resolvable officeDocument relationship or word/document.xml fallback."
40823
+ );
40824
+ }
40825
+ }
40826
+ return {
40827
+ format: "docx",
40828
+ mainDocumentPart,
40829
+ contentTypes,
40830
+ rootRelationships,
40831
+ parts,
40832
+ ...diagnostics.length > 0 ? { diagnostics } : {}
40833
+ };
40834
+ }
40835
+ const CONVENTIONAL_MAIN_DOCUMENT_PATH = "word/document.xml";
40836
+ const ALIAS_ROOT = "word/__oasis_source__";
40837
+ const CONVENTIONAL_PART_BY_RELATIONSHIP_SUFFIX = {
40838
+ "/styles": "word/styles.xml",
40839
+ "/numbering": "word/numbering.xml",
40840
+ "/settings": "word/settings.xml",
40841
+ "/fontTable": "word/fontTable.xml",
40842
+ "/theme": "word/theme/theme1.xml",
40843
+ "/footnotes": "word/footnotes.xml",
40844
+ "/endnotes": "word/endnotes.xml",
40845
+ "/comments": "word/comments.xml",
40846
+ "/commentsExtended": "word/commentsExtended.xml"
40847
+ };
40848
+ function relationshipPartPath(ownerPartPath) {
40849
+ const slashIndex = ownerPartPath.lastIndexOf("/");
40850
+ const directory = slashIndex >= 0 ? ownerPartPath.slice(0, slashIndex) : "";
40851
+ const fileName = slashIndex >= 0 ? ownerPartPath.slice(slashIndex + 1) : ownerPartPath;
40852
+ return directory ? `${directory}/_rels/${fileName}.rels` : `_rels/${fileName}.rels`;
40853
+ }
40854
+ function writePart(zip, path, part) {
40855
+ if (part.encoding === "base64") {
40856
+ zip.file(path, part.data, { base64: true });
40857
+ } else {
40858
+ zip.file(path, part.data);
40859
+ }
40860
+ }
40861
+ function aliasPath(sourcePath) {
40862
+ return `${ALIAS_ROOT}/${sourcePath}`;
40863
+ }
40864
+ function rewriteRelationshipsForImporter(relationships) {
40865
+ if (!relationships) {
40866
+ return [];
40867
+ }
40868
+ return relationships.map((relationship) => {
40869
+ if (relationship.targetMode === "External" || !relationship.resolvedTarget) {
40870
+ return relationship;
40871
+ }
40872
+ return {
40873
+ ...relationship,
40874
+ // Absolute package paths prevent a nested alias (header, note, text box,
40875
+ // etc.) from resolving the temporary prefix relative to itself twice.
40876
+ target: `/${aliasPath(relationship.resolvedTarget)}`,
40877
+ resolvedTarget: void 0
40878
+ };
40879
+ });
40880
+ }
40881
+ function conventionalPathForRelationship(relationship) {
40882
+ for (const [suffix, path] of Object.entries(
40883
+ CONVENTIONAL_PART_BY_RELATIONSHIP_SUFFIX
40884
+ )) {
40885
+ if (relationship.type.endsWith(suffix)) {
40886
+ return path;
40887
+ }
40888
+ }
40889
+ return void 0;
40890
+ }
40891
+ function requiresDocxImporterCompatibilityPackage(sourcePackage) {
40892
+ var _a2;
40893
+ if (sourcePackage.mainDocumentPart !== CONVENTIONAL_MAIN_DOCUMENT_PATH) {
40894
+ return true;
40895
+ }
40896
+ const mainPart = sourcePackage.parts[sourcePackage.mainDocumentPart];
40897
+ return Boolean(
40898
+ (_a2 = mainPart == null ? void 0 : mainPart.relationships) == null ? void 0 : _a2.some((relationship) => {
40899
+ const conventionalPath = conventionalPathForRelationship(relationship);
40900
+ return Boolean(
40901
+ conventionalPath && relationship.resolvedTarget && relationship.resolvedTarget !== conventionalPath
40902
+ );
40903
+ })
40904
+ );
40905
+ }
40906
+ async function prepareDocxForCurrentImporter(originalBuffer, sourcePackage) {
40907
+ if (!requiresDocxImporterCompatibilityPackage(sourcePackage)) {
40908
+ return originalBuffer;
40909
+ }
40910
+ const zip = new JSZip();
40911
+ for (const part of Object.values(sourcePackage.parts)) {
40912
+ writePart(zip, part.path, part);
40913
+ }
40914
+ for (const part of Object.values(sourcePackage.parts)) {
40915
+ if (part.path.endsWith(".rels") || part.path === "[Content_Types].xml") {
40916
+ continue;
40917
+ }
40918
+ const relocatedPath = aliasPath(part.path);
40919
+ writePart(zip, relocatedPath, part);
40920
+ const relationships = rewriteRelationshipsForImporter(part.relationships);
40921
+ if (relationships.length > 0) {
40922
+ zip.file(
40923
+ relationshipPartPath(relocatedPath),
40924
+ serializeOpcRelationships(relationships)
40925
+ );
40926
+ }
40927
+ }
40928
+ const mainPart = sourcePackage.parts[sourcePackage.mainDocumentPart];
40929
+ if (!mainPart) {
40930
+ throw new Error(
40931
+ `DOCX source package is missing its main part: ${sourcePackage.mainDocumentPart}`
40932
+ );
40933
+ }
40934
+ writePart(zip, CONVENTIONAL_MAIN_DOCUMENT_PATH, mainPart);
40935
+ const mainRelationships = rewriteRelationshipsForImporter(
40936
+ mainPart.relationships
40937
+ );
40938
+ if (mainRelationships.length > 0) {
40939
+ zip.file(
40940
+ relationshipPartPath(CONVENTIONAL_MAIN_DOCUMENT_PATH),
40941
+ serializeOpcRelationships(mainRelationships)
40942
+ );
40943
+ }
40944
+ for (const relationship of mainPart.relationships ?? []) {
40945
+ if (relationship.targetMode === "External" || !relationship.resolvedTarget) {
40946
+ continue;
40947
+ }
40948
+ const conventionalPath = conventionalPathForRelationship(relationship);
40949
+ const relatedPart = sourcePackage.parts[relationship.resolvedTarget];
40950
+ if (!conventionalPath || !relatedPart) {
40951
+ continue;
40952
+ }
40953
+ writePart(zip, conventionalPath, relatedPart);
40954
+ const relatedRelationships = rewriteRelationshipsForImporter(
40955
+ relatedPart.relationships
40956
+ );
40957
+ if (relatedRelationships.length > 0) {
40958
+ zip.file(
40959
+ relationshipPartPath(conventionalPath),
40960
+ serializeOpcRelationships(relatedRelationships)
40961
+ );
40962
+ }
40963
+ }
40964
+ return zip.generateAsync({ type: "arraybuffer" });
40965
+ }
40238
40966
  let nextRequestId = 1;
40239
40967
  function canUseDocxWorker() {
40240
40968
  return typeof Worker !== "undefined" && typeof URL !== "undefined";
40241
40969
  }
40242
- function importDocxInWorker(buffer, options = {}) {
40970
+ async function importDocxInWorker(buffer, options = {}) {
40243
40971
  if (!canUseDocxWorker()) {
40244
- return importDocxToEditorDocument(buffer, options);
40972
+ const sourcePackage = await captureDocxSourcePackage(buffer);
40973
+ const importerBuffer = await prepareDocxForCurrentImporter(
40974
+ buffer,
40975
+ sourcePackage
40976
+ );
40977
+ const document2 = await importDocxToEditorDocument(importerBuffer, options);
40978
+ document2.sourcePackage = sourcePackage;
40979
+ return document2;
40245
40980
  }
40246
40981
  const requestId = nextRequestId;
40247
40982
  nextRequestId += 1;
@@ -40249,7 +40984,7 @@ function importDocxInWorker(buffer, options = {}) {
40249
40984
  const worker = new Worker(
40250
40985
  new URL(
40251
40986
  /* @vite-ignore */
40252
- "" + new URL("assets/importDocxWorker-B1vHeo5L.js", import.meta.url).href,
40987
+ "" + new URL("assets/importDocxWorker-5S8lX4CZ.js", import.meta.url).href,
40253
40988
  import.meta.url
40254
40989
  ),
40255
40990
  {
@@ -47380,280 +48115,300 @@ const OASIS_MENU_ITEMS = {
47380
48115
  formatListsNumbered: "format_lists_numbered"
47381
48116
  };
47382
48117
  export {
47383
- listKindForTag as $,
47384
- getParagraphLength as A,
47385
- getActiveZone as B,
47386
- getActiveSectionIndex as C,
47387
- getParagraphs as D,
48118
+ resolveImageSrc as $,
48119
+ createEditorStyledRun as A,
48120
+ getParagraphLength as B,
48121
+ getActiveZone as C,
48122
+ getActiveSectionIndex as D,
47388
48123
  EMPTY_PROJECTION_CONTEXT as E,
47389
48124
  FOOTNOTE_MARKER_GUTTER_PX as F,
47390
- normalizeSelection as G,
47391
- positionToParagraphOffset as H,
47392
- paragraphOffsetToPosition as I,
47393
- findParagraphIndex as J,
47394
- createCollapsedSelection as K,
47395
- isSelectionCollapsed as L,
47396
- parseFontSizePtToPx as M,
47397
- formatFontSizePt as N,
47398
- createEditorParagraph as O,
47399
- resolveDefaultParagraphStyleId as P,
47400
- findParagraphTableLocation as Q,
47401
- buildTableCellLayout as R,
48125
+ getParagraphs as G,
48126
+ normalizeSelection as H,
48127
+ positionToParagraphOffset as I,
48128
+ paragraphOffsetToPosition as J,
48129
+ findParagraphIndex as K,
48130
+ createCollapsedSelection as L,
48131
+ isSelectionCollapsed as M,
48132
+ parseFontSizePtToPx as N,
48133
+ formatFontSizePt as O,
48134
+ createEditorParagraph as P,
48135
+ resolveDefaultParagraphStyleId as Q,
48136
+ findParagraphTableLocation as R,
47402
48137
  STANDARD_FONT_SIZES_PT as S,
47403
- PT_PER_PX as T,
47404
- createEditorTableCell as U,
47405
- createEditorTableRow as V,
47406
- createEditorTable as W,
47407
- clampPosition as X,
47408
- PX_PER_POINT as Y,
47409
- underlineStyleToCssDecorationStyle as Z,
47410
- resolveImageSrc as _,
48138
+ buildTableCellLayout as T,
48139
+ PT_PER_PX as U,
48140
+ createEditorTableCell as V,
48141
+ createEditorTableRow as W,
48142
+ createEditorTable as X,
48143
+ clampPosition as Y,
48144
+ PX_PER_POINT as Z,
48145
+ underlineStyleToCssDecorationStyle as _,
47411
48146
  getPageBodyBottom as a,
47412
- TABLE_BORDER_EDGE_KEYS as a$,
47413
- isParagraphTag as a0,
47414
- collectInlineRuns as a1,
47415
- parseParagraphStyle as a2,
47416
- getRunImage as a3,
47417
- InlineShell as a4,
47418
- BalloonShell as a5,
47419
- DocumentShell as a6,
47420
- createMemo as a7,
47421
- getCaretRectFromSnapshot as a8,
47422
- getParagraphRectFromSnapshot as a9,
47423
- FieldGroup as aA,
47424
- Tabs as aB,
47425
- NumberField as aC,
47426
- parseNumber as aD,
47427
- createStore as aE,
47428
- reconcile as aF,
47429
- RadioGroup as aG,
47430
- Radio as aH,
47431
- TextAreaField as aI,
47432
- Text$1 as aJ,
47433
- SurfaceButton as aK,
47434
- delegateEvents as aL,
47435
- onMount as aM,
47436
- onCleanup as aN,
47437
- CheckIcon as aO,
47438
- use as aP,
47439
- PluginUiHost as aQ,
47440
- OasisEditorEditor as aR,
47441
- OasisBrandMark as aS,
47442
- setPreciseFontPreference as aT,
47443
- setWelcomeSeen as aU,
47444
- enablePreciseFontMode as aV,
47445
- TWIPS_PER_POINT as aW,
47446
- PX_PER_INCH as aX,
47447
- TWIPS_PER_INCH as aY,
47448
- normalizeHex6 as aZ,
47449
- TABLE_CONDITIONAL_FLAG_ATTRIBUTES as a_,
47450
- createComponent as aa,
47451
- CaretOverlay as ab,
47452
- Show as ac,
47453
- createRenderEffect as ad,
47454
- style as ae,
47455
- setStyleProperty as af,
47456
- setAttribute as ag,
47457
- memo as ah,
47458
- template as ai,
47459
- Button as aj,
47460
- useI18n as ak,
47461
- createEffect as al,
47462
- TextField as am,
47463
- Dialog as an,
47464
- insert as ao,
47465
- className as ap,
47466
- Grid as aq,
47467
- SelectField as ar,
47468
- StatusText as as,
47469
- ColorField as at,
47470
- UNDERLINE_STYLE_OPTIONS as au,
47471
- Stack as av,
47472
- For as aw,
47473
- ToggleChip as ax,
47474
- FormField as ay,
47475
- Checkbox as az,
48147
+ TABLE_CONDITIONAL_FLAG_ATTRIBUTES as a$,
48148
+ listKindForTag as a0,
48149
+ isParagraphTag as a1,
48150
+ collectInlineRuns as a2,
48151
+ parseParagraphStyle as a3,
48152
+ getRunImage as a4,
48153
+ InlineShell as a5,
48154
+ BalloonShell as a6,
48155
+ DocumentShell as a7,
48156
+ createMemo as a8,
48157
+ getCaretRectFromSnapshot as a9,
48158
+ Checkbox as aA,
48159
+ FieldGroup as aB,
48160
+ Tabs as aC,
48161
+ NumberField as aD,
48162
+ parseNumber as aE,
48163
+ createStore as aF,
48164
+ reconcile as aG,
48165
+ RadioGroup as aH,
48166
+ Radio as aI,
48167
+ TextAreaField as aJ,
48168
+ Text$1 as aK,
48169
+ SurfaceButton as aL,
48170
+ delegateEvents as aM,
48171
+ onMount as aN,
48172
+ onCleanup as aO,
48173
+ CheckIcon as aP,
48174
+ use as aQ,
48175
+ PluginUiHost as aR,
48176
+ OasisEditorEditor as aS,
48177
+ OasisBrandMark as aT,
48178
+ setPreciseFontPreference as aU,
48179
+ setWelcomeSeen as aV,
48180
+ enablePreciseFontMode as aW,
48181
+ TWIPS_PER_POINT as aX,
48182
+ PX_PER_INCH as aY,
48183
+ TWIPS_PER_INCH as aZ,
48184
+ normalizeHex6 as a_,
48185
+ getParagraphRectFromSnapshot as aa,
48186
+ createComponent as ab,
48187
+ CaretOverlay as ac,
48188
+ Show as ad,
48189
+ createRenderEffect as ae,
48190
+ style as af,
48191
+ setStyleProperty as ag,
48192
+ setAttribute as ah,
48193
+ memo as ai,
48194
+ template as aj,
48195
+ Button as ak,
48196
+ useI18n as al,
48197
+ createEffect as am,
48198
+ TextField as an,
48199
+ Dialog as ao,
48200
+ insert as ap,
48201
+ className as aq,
48202
+ Grid as ar,
48203
+ SelectField as as,
48204
+ StatusText as at,
48205
+ ColorField as au,
48206
+ UNDERLINE_STYLE_OPTIONS as av,
48207
+ Stack as aw,
48208
+ For as ax,
48209
+ ToggleChip as ay,
48210
+ FormField as az,
47476
48211
  getPageBodyTop as b,
47477
- getPageHeaderZoneTop as b$,
47478
- resolveEffectiveParagraphStyle as b0,
47479
- resolveEffectiveTextStyleForParagraph as b1,
47480
- EMU_PER_PT as b2,
47481
- OOXML_ROTATION_UNITS as b3,
47482
- OOXML_PERCENT_DENOMINATOR as b4,
47483
- parseHexColorToRgb255 as b5,
47484
- EMU_PER_PX as b6,
47485
- getRunEndnoteReference as b7,
47486
- iterateFootnoteReferenceRuns as b8,
47487
- iterateEndnoteReferenceRuns as b9,
47488
- TEXT_BASELINE_RATIO as bA,
47489
- resolveRenderedTextChar as bB,
47490
- resolveOpenTypeFeatureTags as bC,
47491
- isLowercaseSmallCapsChar as bD,
47492
- resolveDecorationLineY as bE,
47493
- DOUBLE_STRIKE_OFFSET_PX as bF,
47494
- resolveListLabel as bG,
47495
- getListLabelInset as bH,
47496
- getAlignedListLabelInset as bI,
47497
- getParagraphBorderInsets as bJ,
47498
- buildSegmentTable as bK,
47499
- buildCanvasTableLayout as bL,
47500
- resolveCanvasTableWidth as bM,
47501
- resolveFloatingTableRect as bN,
47502
- paragraphBetweenBorderMatches as bO,
47503
- normalizeFamily as bP,
47504
- ROBOTO_FONT_FILES as bQ,
47505
- loadFontAsset as bR,
47506
- getRemotePdfFontFaces as bS,
47507
- OFFICE_COMPAT_FONT_FAMILIES as bT,
47508
- BinaryReader as bU,
47509
- buildSfnt as bV,
47510
- defaultFontDecoderRegistry as bW,
47511
- SfntFontProgram as bX,
47512
- zlibSync as bY,
47513
- collectPdfFontFamilies as bZ,
47514
- outlineFrom as b_,
47515
- imageContentTypeDefaults as ba,
47516
- getRunFieldChar as bb,
47517
- getRunFieldInstruction as bc,
47518
- createEditorRun as bd,
47519
- JSZip as be,
47520
- imageExtensionFromMime as bf,
47521
- pxToPt as bg,
47522
- resolveFloatingObjectRect as bh,
47523
- getTextBoxFloatingGeometry as bi,
47524
- getPresetPathSegments as bj,
47525
- buildListLabels as bk,
47526
- lineDashPatternPt as bl,
47527
- DEFAULT_FONT_SIZE_PX as bm,
47528
- resolveGradientAxis as bn,
47529
- isDoubleUnderlineStyle as bo,
47530
- isWavyUnderlineStyle as bp,
47531
- underlineStyleLineWidthPx as bq,
47532
- WAVY_UNDERLINE_WAVELENGTH_PX as br,
47533
- WAVY_UNDERLINE_AMPLITUDE_PX as bs,
47534
- DOUBLE_UNDERLINE_OFFSET_PX as bt,
47535
- underlineStyleDashArray as bu,
47536
- EMPHASIS_GLYPH as bv,
47537
- rgb255ToHex as bw,
47538
- getImageFloatingGeometry as bx,
47539
- textStyleToFontSizePt as by,
47540
- resolveTextAlignmentBaselineOffset as bz,
48212
+ getListLabelInset as b$,
48213
+ TABLE_BORDER_EDGE_KEYS as b0,
48214
+ resolveEffectiveParagraphStyle as b1,
48215
+ resolveEffectiveTextStyleForParagraph as b2,
48216
+ EMU_PER_PT as b3,
48217
+ OOXML_ROTATION_UNITS as b4,
48218
+ OOXML_PERCENT_DENOMINATOR as b5,
48219
+ parseHexColorToRgb255 as b6,
48220
+ EMU_PER_PX as b7,
48221
+ getRunEndnoteReference as b8,
48222
+ getEditorRunOoxmlSource as b9,
48223
+ pxToPt as bA,
48224
+ resolveFloatingObjectRect as bB,
48225
+ getTextBoxFloatingGeometry as bC,
48226
+ getPresetPathSegments as bD,
48227
+ buildListLabels as bE,
48228
+ lineDashPatternPt as bF,
48229
+ DEFAULT_FONT_SIZE_PX as bG,
48230
+ resolveGradientAxis as bH,
48231
+ isDoubleUnderlineStyle as bI,
48232
+ isWavyUnderlineStyle as bJ,
48233
+ underlineStyleLineWidthPx as bK,
48234
+ WAVY_UNDERLINE_WAVELENGTH_PX as bL,
48235
+ WAVY_UNDERLINE_AMPLITUDE_PX as bM,
48236
+ DOUBLE_UNDERLINE_OFFSET_PX as bN,
48237
+ underlineStyleDashArray as bO,
48238
+ EMPHASIS_GLYPH as bP,
48239
+ rgb255ToHex as bQ,
48240
+ getImageFloatingGeometry as bR,
48241
+ textStyleToFontSizePt as bS,
48242
+ resolveTextAlignmentBaselineOffset as bT,
48243
+ TEXT_BASELINE_RATIO as bU,
48244
+ resolveRenderedTextChar as bV,
48245
+ resolveOpenTypeFeatureTags as bW,
48246
+ isLowercaseSmallCapsChar as bX,
48247
+ resolveDecorationLineY as bY,
48248
+ DOUBLE_STRIKE_OFFSET_PX as bZ,
48249
+ resolveListLabel as b_,
48250
+ ooxmlSourceNeedsCanonicalRunSerialization as ba,
48251
+ createEditorRunSemanticSignature as bb,
48252
+ createEditorRunStructureSignature as bc,
48253
+ XMLSerializer as bd,
48254
+ DOMParser$1 as be,
48255
+ getEditorParagraphOoxmlSource as bf,
48256
+ createEditorParagraphPropertiesSignature as bg,
48257
+ getReusableEditorParagraphXml as bh,
48258
+ getEditorParagraphOoxmlAttributes as bi,
48259
+ iterateFootnoteReferenceRuns as bj,
48260
+ iterateEndnoteReferenceRuns as bk,
48261
+ imageContentTypeDefaults as bl,
48262
+ getEditorListOoxmlNumberingMetadata as bm,
48263
+ getEffectiveEditorListOoxmlFormat as bn,
48264
+ getRunFieldChar as bo,
48265
+ getRunFieldInstruction as bp,
48266
+ createEditorRun as bq,
48267
+ JSZip as br,
48268
+ imageExtensionFromMime as bs,
48269
+ normalizeOpcPartPath as bt,
48270
+ OPC_CONTENT_TYPES_PATH as bu,
48271
+ parseOpcRelationships as bv,
48272
+ serializeOpcRelationships as bw,
48273
+ OPC_ROOT_RELATIONSHIPS_PATH as bx,
48274
+ parseOpcContentTypes as by,
48275
+ serializeOpcContentTypes as bz,
47541
48276
  getPageContentWidth as c,
47542
- isLocalFontAccessSupported as c$,
47543
- getPageColumnRects as c0,
47544
- findFootnoteReference as c1,
47545
- resolveImporterForFile as c2,
47546
- roundTo as c3,
47547
- getDocumentSectionsCanonical as c4,
47548
- getDocumentParagraphsCanonical as c5,
47549
- getDocumentParagraphs as c6,
47550
- PX_PER_CM as c7,
47551
- getDocumentPageSettings as c8,
47552
- getTableCellContentWidthForParagraph as c9,
47553
- getParagraphEntries as cA,
47554
- getParagraphById as cB,
47555
- createEditorFootnote as cC,
47556
- createFootnoteReferenceRun as cD,
47557
- renumberFootnotes as cE,
47558
- preciseFontModeVersion as cF,
47559
- isPreciseFontModeEnabled as cG,
47560
- getHeadingLevel as cH,
47561
- togglePreciseFontMode as cI,
47562
- nextFontSizePt as cJ,
47563
- previousFontSizePt as cK,
47564
- fontSizePtToPx as cL,
47565
- resolveNamedTextStyle as cM,
47566
- resolveNamedTableStyle as cN,
47567
- resolveEffectiveTableStyle as cO,
47568
- createDefaultToolbarPreset as cP,
47569
- MenuRegistry as cQ,
47570
- createToolbarRegistry as cR,
47571
- Editor as cS,
47572
- resolveCommandRef as cT,
47573
- commandRefName as cU,
47574
- createOasisEditorClient as cV,
47575
- createEditorZoom as cW,
47576
- startLongTaskObserver as cX,
47577
- installGlobalReport as cY,
47578
- applyStoredPreciseFontPreference as cZ,
47579
- getWelcomeSeen as c_,
47580
- layoutMetricsEpoch as ca,
47581
- bumpLayoutMetricsEpoch as cb,
47582
- createCanvasLayoutSnapshotProvider as cc,
47583
- on as cd,
47584
- debounce as ce,
47585
- unwrap as cf,
47586
- perfTimer as cg,
47587
- prepareDocumentFonts as ch,
47588
- getRunTextBox as ci,
47589
- createEditorDocument as cj,
47590
- resolveResizedDimensions as ck,
47591
- axisSignForDirection as cl,
47592
- clamp as cm,
47593
- MIN_RESIZE_SIZE_PX as cn,
47594
- resolveTextBoxRenderHeight as co,
47595
- getToolbarStyleState as cp,
47596
- VERTICAL_HIT_WEIGHT as cq,
47597
- getCachedCanvasImage as cr,
47598
- measureParagraphMinContentWidthPx as cs,
47599
- getEditableBlocksForZone as ct,
47600
- findParagraphLocation as cu,
47601
- createSectionBoundaryParagraph as cv,
47602
- normalizePageSettings as cw,
47603
- DEFAULT_EDITOR_PAGE_SETTINGS as cx,
47604
- markStart as cy,
47605
- markEnd as cz,
48277
+ getHeadingLevel as c$,
48278
+ getAlignedListLabelInset as c0,
48279
+ getParagraphBorderInsets as c1,
48280
+ buildSegmentTable as c2,
48281
+ buildCanvasTableLayout as c3,
48282
+ resolveCanvasTableWidth as c4,
48283
+ resolveFloatingTableRect as c5,
48284
+ paragraphBetweenBorderMatches as c6,
48285
+ normalizeFamily as c7,
48286
+ ROBOTO_FONT_FILES as c8,
48287
+ loadFontAsset as c9,
48288
+ perfTimer as cA,
48289
+ prepareDocumentFonts as cB,
48290
+ getRunTextBox as cC,
48291
+ createEditorDocument as cD,
48292
+ resolveResizedDimensions as cE,
48293
+ axisSignForDirection as cF,
48294
+ clamp as cG,
48295
+ MIN_RESIZE_SIZE_PX as cH,
48296
+ resolveTextBoxRenderHeight as cI,
48297
+ getToolbarStyleState as cJ,
48298
+ VERTICAL_HIT_WEIGHT as cK,
48299
+ getCachedCanvasImage as cL,
48300
+ measureParagraphMinContentWidthPx as cM,
48301
+ getEditableBlocksForZone as cN,
48302
+ findParagraphLocation as cO,
48303
+ createSectionBoundaryParagraph as cP,
48304
+ normalizePageSettings as cQ,
48305
+ DEFAULT_EDITOR_PAGE_SETTINGS as cR,
48306
+ markStart as cS,
48307
+ markEnd as cT,
48308
+ getParagraphEntries as cU,
48309
+ getParagraphById as cV,
48310
+ createEditorFootnote as cW,
48311
+ createFootnoteReferenceRun as cX,
48312
+ renumberFootnotes as cY,
48313
+ preciseFontModeVersion as cZ,
48314
+ isPreciseFontModeEnabled as c_,
48315
+ getRemotePdfFontFaces as ca,
48316
+ OFFICE_COMPAT_FONT_FAMILIES as cb,
48317
+ BinaryReader as cc,
48318
+ buildSfnt as cd,
48319
+ defaultFontDecoderRegistry as ce,
48320
+ SfntFontProgram as cf,
48321
+ zlibSync as cg,
48322
+ collectPdfFontFamilies as ch,
48323
+ outlineFrom as ci,
48324
+ getPageHeaderZoneTop as cj,
48325
+ getPageColumnRects as ck,
48326
+ findFootnoteReference as cl,
48327
+ resolveImporterForFile as cm,
48328
+ roundTo as cn,
48329
+ getDocumentSectionsCanonical as co,
48330
+ getDocumentParagraphsCanonical as cp,
48331
+ getDocumentParagraphs as cq,
48332
+ PX_PER_CM as cr,
48333
+ getDocumentPageSettings as cs,
48334
+ getTableCellContentWidthForParagraph as ct,
48335
+ layoutMetricsEpoch as cu,
48336
+ bumpLayoutMetricsEpoch as cv,
48337
+ createCanvasLayoutSnapshotProvider as cw,
48338
+ on as cx,
48339
+ debounce as cy,
48340
+ unwrap as cz,
47606
48341
  domTextMeasurer as d,
47607
- EDITOR_SCROLL_PADDING_PX as d0,
47608
- Toolbar as d1,
47609
- OasisEditorLoading as d2,
47610
- I18nProvider as d3,
47611
- createTranslator as d4,
47612
- registerDomStatsSurface as d5,
47613
- createEditorLogger as d6,
47614
- ActionRow as d7,
47615
- ColorPicker as d8,
47616
- CommandRegistry as d9,
47617
- Button$1 as dA,
47618
- buildRibbonTabDefinitions as dB,
47619
- cloneDocument as dC,
47620
- createDocument as dD,
47621
- createEditorCommandBus as dE,
47622
- createHeading as dF,
47623
- createOasisEditor as dG,
47624
- createOasisEditorContainer as dH,
47625
- createParagraph as dI,
47626
- createTable as dJ,
47627
- mount as dK,
47628
- normalizeDocument as dL,
47629
- registerToolbarRenderer as dM,
47630
- validateDocument as dN,
47631
- DEFAULT_PALETTE as da,
47632
- DialogFooter as db,
47633
- EDITOR_SCHEMA_VERSION as dc,
47634
- FieldRow as dd,
47635
- FloatingActionButton as de,
47636
- GridPicker as df,
47637
- Heading as dg,
47638
- IconButton as dh,
47639
- Menu as di,
47640
- OASIS_BUILTIN_COMMANDS as dj,
47641
- OASIS_MENU_ITEMS as dk,
47642
- OASIS_TOOLBAR_ITEMS as dl,
47643
- OasisEditorAppLazy as dm,
47644
- OasisEditorContainer as dn,
47645
- PluginCollection as dp,
47646
- Popover as dq,
47647
- RIBBON_TABS as dr,
47648
- Select as ds,
47649
- Separator as dt,
47650
- SidePanel as du,
47651
- SidePanelBody as dv,
47652
- SidePanelFooter as dw,
47653
- SidePanelHeader as dx,
47654
- SplitButton as dy,
47655
- StyleGallery as dz,
48342
+ createOasisEditorContainer as d$,
48343
+ togglePreciseFontMode as d0,
48344
+ nextFontSizePt as d1,
48345
+ previousFontSizePt as d2,
48346
+ fontSizePtToPx as d3,
48347
+ resolveNamedTextStyle as d4,
48348
+ resolveNamedTableStyle as d5,
48349
+ resolveEffectiveTableStyle as d6,
48350
+ createDefaultToolbarPreset as d7,
48351
+ MenuRegistry as d8,
48352
+ createToolbarRegistry as d9,
48353
+ GridPicker as dA,
48354
+ Heading as dB,
48355
+ IconButton as dC,
48356
+ Menu as dD,
48357
+ OASIS_BUILTIN_COMMANDS as dE,
48358
+ OASIS_MENU_ITEMS as dF,
48359
+ OASIS_TOOLBAR_ITEMS as dG,
48360
+ OasisEditorAppLazy as dH,
48361
+ OasisEditorContainer as dI,
48362
+ PluginCollection as dJ,
48363
+ Popover as dK,
48364
+ RIBBON_TABS as dL,
48365
+ Select as dM,
48366
+ Separator as dN,
48367
+ SidePanel as dO,
48368
+ SidePanelBody as dP,
48369
+ SidePanelFooter as dQ,
48370
+ SidePanelHeader as dR,
48371
+ SplitButton as dS,
48372
+ StyleGallery as dT,
48373
+ Button$1 as dU,
48374
+ buildRibbonTabDefinitions as dV,
48375
+ cloneDocument as dW,
48376
+ createDocument as dX,
48377
+ createEditorCommandBus as dY,
48378
+ createHeading as dZ,
48379
+ createOasisEditor as d_,
48380
+ Editor as da,
48381
+ resolveCommandRef as db,
48382
+ commandRefName as dc,
48383
+ createOasisEditorClient as dd,
48384
+ createEditorZoom as de,
48385
+ startLongTaskObserver as df,
48386
+ installGlobalReport as dg,
48387
+ applyStoredPreciseFontPreference as dh,
48388
+ getWelcomeSeen as di,
48389
+ isLocalFontAccessSupported as dj,
48390
+ EDITOR_SCROLL_PADDING_PX as dk,
48391
+ Toolbar as dl,
48392
+ OasisEditorLoading as dm,
48393
+ I18nProvider as dn,
48394
+ createTranslator as dp,
48395
+ registerDomStatsSurface as dq,
48396
+ createEditorLogger as dr,
48397
+ ActionRow as ds,
48398
+ ColorPicker as dt,
48399
+ CommandRegistry as du,
48400
+ DEFAULT_PALETTE as dv,
48401
+ DialogFooter as dw,
48402
+ EDITOR_SCHEMA_VERSION as dx,
48403
+ FieldRow as dy,
48404
+ FloatingActionButton as dz,
47656
48405
  estimateTableBlockHeight as e,
48406
+ createParagraph as e0,
48407
+ createTable as e1,
48408
+ mount as e2,
48409
+ normalizeDocument as e3,
48410
+ registerToolbarRenderer as e4,
48411
+ validateDocument as e5,
47657
48412
  getParagraphText as f,
47658
48413
  getProjectedParagraphBlockHeight as g,
47659
48414
  getBlockParagraphs as h,
@@ -47665,14 +48420,14 @@ export {
47665
48420
  getRunField as n,
47666
48421
  projectBlocksLayout as o,
47667
48422
  projectParagraphLayout as p,
47668
- assertNever as q,
47669
- createSignal as r,
47670
- createEditorStateFromDocument as s,
47671
- createInitialEditorState as t,
47672
- fontSizePxToPt as u,
48423
+ copyEditorRunOoxmlSource as q,
48424
+ assertNever as r,
48425
+ createSignal as s,
48426
+ createEditorStateFromDocument as t,
48427
+ createInitialEditorState as u,
47673
48428
  visitRun as v,
47674
- probeLocalFontFamilies as w,
47675
- createEditorParagraphFromRuns as x,
47676
- isInlineObjectRun as y,
47677
- createEditorStyledRun as z
48429
+ fontSizePxToPt as w,
48430
+ probeLocalFontFamilies as x,
48431
+ createEditorParagraphFromRuns as y,
48432
+ isInlineObjectRun as z
47678
48433
  };