@docx-editor.dev/core 2.31.0 → 2.33.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/README.md +25 -1
- package/THIRD_PARTY_NOTICES.md +1 -0
- package/dist/automation.cjs +1 -1
- package/dist/automation.d.ts +16 -54
- package/dist/automation.js +1 -1
- package/dist/binding.cjs +1 -1
- package/dist/binding.d.ts +17 -15
- package/dist/binding.js +1 -1
- package/dist/{chrome-print-BWvaVEhD.d.ts → chrome-print-CrPI9ZQc.d.ts} +128 -38
- package/dist/chunk-23MKR33J.js +4 -0
- package/dist/chunk-2CWQY27B.cjs +1 -0
- package/dist/chunk-2DEY5NUC.cjs +32 -0
- package/dist/chunk-2DR4TH6B.js +1 -0
- package/dist/chunk-2F2UEAE2.js +2 -0
- package/dist/chunk-2GPGAFOJ.cjs +5 -0
- package/dist/chunk-ALD626VU.cjs +2 -0
- package/dist/chunk-AU33YWEJ.js +236 -0
- package/dist/chunk-AXU63LYW.cjs +1 -0
- package/dist/chunk-CM5VZRBV.js +32 -0
- package/dist/chunk-D7FAFFTN.js +1 -0
- package/dist/chunk-DYUVJNDD.cjs +1 -0
- package/dist/chunk-ESYUKD5D.js +2 -0
- package/dist/chunk-F7TGQMVR.js +5 -0
- package/dist/chunk-FLW7KIQX.js +30 -0
- package/dist/chunk-JG4A6W6I.js +7 -0
- package/dist/chunk-JNGLSBPH.js +2 -0
- package/dist/chunk-KE6ZWRIY.cjs +236 -0
- package/dist/chunk-L3YXJDPX.js +1 -0
- package/dist/chunk-LI42N7OW.cjs +4 -0
- package/dist/chunk-PLKDS4JT.js +1 -0
- package/dist/chunk-PXMTQ73F.cjs +2 -0
- package/dist/chunk-R4R3AAE4.js +1 -0
- package/dist/chunk-RFUNFTGV.cjs +1 -0
- package/dist/chunk-SVM6PGMS.js +3 -0
- package/dist/chunk-SZURLHR3.cjs +3 -0
- package/dist/chunk-UYCGCVZ2.cjs +1 -0
- package/dist/chunk-WN7ICTA5.js +1 -0
- package/dist/chunk-X34QRAUU.cjs +1 -0
- package/dist/chunk-XNBYG4XJ.cjs +30 -0
- package/dist/chunk-ZDFJW5XS.cjs +2 -0
- package/dist/chunk-ZWO4JHNN.cjs +7 -0
- package/dist/collaboration/replication.cjs +1 -1
- package/dist/collaboration/replication.d.ts +29 -4
- package/dist/collaboration/replication.js +1 -1
- package/dist/collaboration.cjs +1 -1
- package/dist/collaboration.d.ts +5 -5
- package/dist/collaboration.js +1 -1
- package/dist/contracts/document.d.ts +3 -3
- package/dist/contracts/editor.d.ts +13 -9
- package/dist/contracts/interaction.d.ts +2 -2
- package/dist/contracts/modules.d.ts +15 -12
- package/dist/contracts/types.d.ts +135 -2
- package/dist/{custom-node-writes-TeUvMP13.d.ts → custom-node-writes-AqY5KpVx.d.ts} +7 -2
- package/dist/diagnostic-context-CuzhOX0g.d.ts +98 -0
- package/dist/{diagnostic-hints-C9JlLz1L.d.ts → diagnostic-hints-BtCaCqQC.d.ts} +4 -4
- package/dist/{document-protection-C8x3P2J6.d.ts → document-protection-BvbpSXbQ.d.ts} +1 -1
- package/dist/drawing-graphic-kind-CXYGYbB3.d.ts +324 -0
- package/dist/drawing-preview-package-B9lSLRg4.d.ts +115 -0
- package/dist/{editor-B2ShlO23.d.ts → editor-B7OOAAie.d.ts} +181 -244
- package/dist/editor-fonts-D_-vjuJi.d.ts +53 -0
- package/dist/{editor-scope-C7ke1KJG.d.ts → editor-scope-CA6egMaK.d.ts} +6 -2
- package/dist/editor.cjs +1 -1
- package/dist/editor.css +4 -4
- package/dist/editor.d.ts +259 -31
- package/dist/editor.js +1 -1
- package/dist/export.cjs +2 -2
- package/dist/export.d.ts +48 -19
- package/dist/export.js +2 -2
- package/dist/{failure-NS2lsya4.d.ts → failure-6KGFrDO9.d.ts} +1 -1
- package/dist/{font-resolver-CWh40DYp.d.ts → font-resolver-Bm9XqTNO.d.ts} +15 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +43 -26
- package/dist/index.js +1 -1
- package/dist/{layout-shaping-CWS3j0Xr.d.ts → layout-shaping-Ci_BTnSU.d.ts} +1 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.d.ts +181 -99
- package/dist/layout.js +1 -1
- package/dist/metafile-drawing-DtMFyMKq.d.ts +107 -0
- package/dist/{note-properties-QsKh24sM.d.ts → note-properties-DCIJUKIy.d.ts} +1 -1
- package/dist/output.cjs +1 -1
- package/dist/output.d.ts +11 -7
- package/dist/output.js +1 -1
- package/dist/{protocol-COZJUKUY.d.ts → protocol-Cp_QzVxS.d.ts} +75 -5
- package/dist/{review-paragraph-order-C_QbCKcH.d.ts → review-paragraph-order-BJQ43_r0.d.ts} +1 -1
- package/dist/revision-projection-OVusTS77.d.ts +258 -0
- package/dist/{semantic-cell-selection-Cub9FDa8.d.ts → semantic-cell-selection-CoI5hHBm.d.ts} +2 -2
- package/dist/{semantic-interaction-dApRIYpt.d.ts → semantic-interaction-BbA4dgEo.d.ts} +1 -1
- package/dist/{semantic-paint-DLzA8sjP.d.ts → semantic-paint-B5JcIv9c.d.ts} +19 -9
- package/dist/{semantic-record-queries-3yp9o11g.d.ts → semantic-record-queries-DnO8J5_j.d.ts} +1 -1
- package/dist/{semantic-records-B-akgRch.d.ts → semantic-records-DoK0lNjS.d.ts} +439 -418
- package/dist/store.cjs +1 -1
- package/dist/store.d.ts +511 -20
- package/dist/store.js +1 -1
- package/dist/{types-barrel-CkF2JbU4.d.ts → tree-op-types-Df4oY2u4.d.ts} +1081 -524
- package/dist/{tree-package-store-B8l8DX3Z.d.ts → tree-package-store-DXhX1PE-.d.ts} +8 -3
- package/dist/{tree-session-contract-DeLRqohz.d.ts → tree-session-contract-CF2625mv.d.ts} +5 -5
- package/dist/unsupported-elements-CUojsaCr.d.ts +23 -0
- package/docs/accept-reject-without-scrolling.md +95 -0
- package/docs/comment-on-found-text.md +72 -0
- package/docs/custom-review-cards.md +178 -0
- package/docs/highlight-ranges.md +48 -0
- package/docs/index.md +36 -0
- package/docs/propose-rewrite.md +247 -0
- package/docs/tracked-replacement.md +68 -0
- package/licenses/ECMA-376.md +29 -0
- package/package.json +3 -2
- package/dist/bookmark-names-DDuAra_V.d.ts +0 -37
- package/dist/chunk-243W4WW2.cjs +0 -2
- package/dist/chunk-2E2RPEKX.js +0 -1
- package/dist/chunk-4S24UOPG.js +0 -30
- package/dist/chunk-5JPIEN54.cjs +0 -3
- package/dist/chunk-5SO5QDMV.cjs +0 -2
- package/dist/chunk-6IDOVU6L.cjs +0 -1
- package/dist/chunk-6JIJOZDW.js +0 -1
- package/dist/chunk-BTQKU64Q.cjs +0 -1
- package/dist/chunk-DBOOTED4.cjs +0 -30
- package/dist/chunk-EOTAXOJY.cjs +0 -5
- package/dist/chunk-FDAKJ2SJ.cjs +0 -30
- package/dist/chunk-FNNOJNGY.js +0 -3
- package/dist/chunk-FT33HRZP.js +0 -5
- package/dist/chunk-HC6YNKUI.cjs +0 -1
- package/dist/chunk-HZ66UCIS.js +0 -2
- package/dist/chunk-IBRBNT37.cjs +0 -1
- package/dist/chunk-IVIN7X43.js +0 -30
- package/dist/chunk-LZY6B6IV.js +0 -4
- package/dist/chunk-MOYYRVFV.cjs +0 -2
- package/dist/chunk-N6B3BXCL.js +0 -1
- package/dist/chunk-Q5K2GGNG.js +0 -2
- package/dist/chunk-R2XINWVE.js +0 -7
- package/dist/chunk-SUEXVBPR.js +0 -1
- package/dist/chunk-T2QQHG5C.js +0 -18
- package/dist/chunk-VWIJKH4A.js +0 -1
- package/dist/chunk-WO4V6PNS.cjs +0 -18
- package/dist/chunk-XMJKFURD.cjs +0 -4
- package/dist/chunk-XSTGE3NI.cjs +0 -1
- package/dist/chunk-YQWMI6J5.cjs +0 -7
- package/dist/chunk-ZCJS7D7S.js +0 -2
- package/dist/diagnostic-context-DJ0P1uZE.d.ts +0 -31
- package/dist/headless-document-view-qOpaCF82.d.ts +0 -143
- package/dist/omml-equation-BsLAa2lX.d.ts +0 -115
package/dist/chunk-ZCJS7D7S.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {d}from'./chunk-VWIJKH4A.js';import {sa,qa,ra}from'./chunk-Q5K2GGNG.js';import {qf,db,Lf,lg,eb,ck,cb,qd,rd,bb}from'./chunk-T2QQHG5C.js';function z(n){let r=[],s=0;for(let t of n){let o=s+t.text.length;t.resultRuns?r.push({text:t.text,rawStart:t.rawStart,rawEnd:t.rawEnd,resultRuns:t.resultRuns,...t.symbolOffsets?{symbolOffsets:t.symbolOffsets}:{},...t.symbolDisplays?{symbolDisplays:t.symbolDisplays}:{},projectedStart:s,projectedEnd:o,expansion:t.text.length!==t.rawEnd-t.rawStart}):t.floatingObject?r.push({text:t.text,rawStart:t.rawStart,rawEnd:t.rawEnd,floatingObject:true,projectedStart:s,projectedEnd:o,expansion:t.text.length!==t.rawEnd-t.rawStart}):r.push({text:t.text,rawStart:t.rawStart,rawEnd:t.rawEnd,...t.symbol?{symbol:true}:{},...t.symbolOffsets?{symbolOffsets:t.symbolOffsets}:{},...t.symbolDisplays?{symbolDisplays:t.symbolDisplays}:{},projectedStart:s,projectedEnd:o,expansion:t.text.length!==t.rawEnd-t.rawStart}),s=o;}return r}function G(n,r){return r<=n.rawStart?n.projectedStart:r>=n.rawEnd?n.projectedEnd:n.expansion?n.projectedStart:n.projectedStart+r-n.rawStart}function I(n,r){return n.expansion?n.rawStart:n.rawStart+r-n.projectedStart}function L(n,r){return n.expansion?n.rawEnd:n.rawStart+r-n.projectedStart}var K=new Set([bb,"\u2011"]),Q=/[\u001e\u001f\u2011]/,Y="\uFFFF";function W(n,r){if(!Q.test(n)&&!r?.size)return {text:n,at:null};let s="",t=[];for(let o=0;o<n.length;o+=1){let l=n[o];if(r?.has(o))s+=Y;else {if(l===cb)continue;s+=K.has(l)?"-":l;}t.push(o);}return {text:s,at:t}}function U(n){let r;for(let s of n){if(s.symbol){r??=new Set;for(let t=s.projectedStart;t<s.projectedEnd;t+=1)r.add(t);}for(let t of s.symbolOffsets??[])(r??=new Set).add(s.projectedStart+t);}return r}function O(n){let r=z(n),s="";for(let o of n)s+=o.text;let t=null;return {text:s,projectedOffset(o){let l=0;for(let i of r){if(o<=i.rawEnd)return G(i,o);l=i.projectedEnd;}return l},rawRange(o,l){if(o<0||o>=l||l>s.length)return null;let i=r.find(d=>o>=d.projectedStart&&o<d.projectedEnd),e=r.find(d=>l>d.projectedStart&&l<=d.projectedEnd);return !i||!e?null:{start:I(i,o),end:L(e,l)}},sliceRaw(o,l){if(o>=l)return "";let i="";for(let e of r){if(e.expansion){o<=e.rawStart&&l>=e.rawEnd&&(i+=e.text);continue}let d=Math.max(o,e.rawStart),a=Math.min(l,e.rawEnd);d<a&&(i+=e.text.slice(d-e.rawStart,a-e.rawStart));}return i},displaySlice(o,l){let i="";for(let e of r){if(e.projectedEnd<=o||e.projectedStart>=l)continue;let d=Math.max(o,e.projectedStart)-e.projectedStart,a=Math.min(l,e.projectedEnd)-e.projectedStart;if(e.symbol){i+=e.symbolDisplays?.[0]??"";continue}let u=new Map;e.symbolOffsets?.forEach((f,c)=>u.set(f,e.symbolDisplays?.[c]??""));for(let f=d;f<a;f+=1)i+=u.get(f)??e.text[f];}return i},resultRunAddressAt(o){let l=r.find(e=>e.resultRuns!==void 0&&o>=e.projectedStart&&o<e.projectedEnd);if(!l?.resultRuns)return null;let i=o-l.projectedStart;for(let e of l.resultRuns)if(i>=e.start&&i<e.end)return {runId:e.runId,offset:i-e.start};return null},findOccurrences(o,l,i={}){let e=[];if(l<=0||!sa(o)||s.length===0)return {matches:e,truncated:false};let d=i.matchCase===true,a=i.wholeWord===true;t??=W(s,U(r));let u=t,f=W(o).text;if(f.length===0||f.includes(Y))return {matches:e,truncated:false};let c=d?f:qa(f),j=d?u.text:qa(u.text),R=p=>u.at?.[p]??p,X=p=>{if(!u.at)return p;let m=0;for(;m<u.at.length&&u.at[m]<p;)m+=1;return m},v=Math.min(s.length,i.to??s.length),D=new Set,b=j.indexOf(c,X(Math.max(0,i.from??0)));for(;b>=0;){let p=b+c.length,m=R(b),x=R(p-1)+1;if(x>v)return {matches:e,truncated:false};if(r.some(y=>y.floatingObject===true&&y.projectedStart>m&&y.projectedStart<x)){b=j.indexOf(c,b+1);continue}if(!a||ra(u.text,b,p)){let y=r.find(h=>m>=h.projectedStart&&m<h.projectedEnd),E=r.find(h=>x>h.projectedStart&&x<=h.projectedEnd);if(!y||!E)return {matches:e,truncated:false};let S=y===E&&y.expansion?y:null;if(!S||!D.has(S)){if(e.length>=l)return {matches:e,truncated:true};e.push({start:m,length:x-m,rawStart:I(y,m),rawEnd:L(E,x)}),S&&D.add(S);}}b=j.indexOf(c,p);}return {matches:e,truncated:false}}}}function q(n){return n.length===0?O([]):O([{text:n,rawStart:0,rawEnd:n.length}])}var J="http://schemas.openxmlformats.org/markup-compatibility/2006";function Z(n){if(n.kind==="textValue")return false;if(qd(n))return rd(n);let r=s=>s.kind!=="textValue"&&s.children.some(t=>t.kind==="anchoredDrawing"||t.kind!=="textValue"&&t.localName==="anchor");if(n.kind==="drawing")return r(n);if(n.namespaceUri!==J||n.localName!=="AlternateContent")return false;for(let s of n.children){if(s.kind==="textValue"||s.localName!=="Choice")continue;let t=s.children.find(o=>o.kind==="drawing"||o.kind!=="textValue"&&o.localName==="drawing");if(t)return r(t)}return false}function $(n,r,s="allMarkup"){if(!r.includes(qf)&&!r.includes(db))return r.length===0?[]:[{text:r,rawStart:0,rawEnd:r.length}];let t=Lf(n),o=lg(n,t),l=d(n,t,s),i=new Map;for(let a of t)i.set(a.node.id,a);let e=[],d$1=0;for(let a of o){let u=i.get(a.node.id),f=!u&&eb(a.node);if(!u&&!f){Z(a.node)&&(d$1<a.start&&e.push({text:r.slice(d$1,a.start),rawStart:d$1,rawEnd:a.start}),e.push({text:"",rawStart:a.start,rawEnd:a.end,floatingObject:true}),d$1=a.end);continue}if(d$1<a.start&&e.push({text:r.slice(d$1,a.start),rawStart:d$1,rawEnd:a.start}),!u){e.push({text:db,rawStart:a.start,rawEnd:a.end,symbol:true,symbolDisplays:[ck(a.node)]}),d$1=a.end;continue}let c=l.get(u.node.id);u.kind==="simple"&&c?e.push({text:c.text,rawStart:a.start,rawEnd:a.end,resultRuns:c.runs,...c.symbols?{symbolOffsets:c.symbols}:{},...c.symbolDisplays?{symbolDisplays:c.symbolDisplays}:{}}):e.push({text:c?.text??qf,rawStart:a.start,rawEnd:a.end,...c?.symbols?{symbolOffsets:c.symbols}:{},...c?.symbolDisplays?{symbolDisplays:c.symbolDisplays}:{}}),d$1=a.end;}return d$1<r.length&&e.push({text:r.slice(d$1),rawStart:d$1,rawEnd:r.length}),e}function it(n,r,s="allMarkup"){return !r.includes(qf)&&!r.includes(db)?q(r):O($(n,r,s))}
|
|
2
|
-
export{O as a,q as b,$ as c,it as d};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { D as DiagnosticErrorName, a as DocumentPartKind } from './diagnostic-hints-C9JlLz1L.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Every engine reason a diagnostic can carry as its `cause`. Causes are the engine's own
|
|
5
|
-
* reasons and can change between engine versions; match on the public `code`, and read the
|
|
6
|
-
* `cause` when you report or fix a failure.
|
|
7
|
-
*
|
|
8
|
-
* @public
|
|
9
|
-
*/
|
|
10
|
-
declare function diagnosticCauses(): readonly string[];
|
|
11
|
-
/**
|
|
12
|
-
* The engine reason token in a refusal reason, or undefined when the reason is not one the
|
|
13
|
-
* engine knows, such as a sentence. Only the token before a colon counts; the detail after it
|
|
14
|
-
* can name parts of the file and is never returned. A full reason such as
|
|
15
|
-
* `unsupported-revision:foreign-insertion` reports its token; its public code names the rule.
|
|
16
|
-
*/
|
|
17
|
-
declare function diagnosticCause(reason: string | undefined): string | undefined;
|
|
18
|
-
/** The cause of a failure the engine did not name: an exception. */
|
|
19
|
-
declare function exceptionCause(): string;
|
|
20
|
-
/**
|
|
21
|
-
* The class of an exception, never its message. A subclass with its own name, which a host or a
|
|
22
|
-
* file could shape, reports `'other'`.
|
|
23
|
-
*/
|
|
24
|
-
declare function diagnosticErrorName(error: unknown): DiagnosticErrorName;
|
|
25
|
-
/**
|
|
26
|
-
* The role of the part a failure names, from the part name at the start of a refusal detail.
|
|
27
|
-
* The name itself never leaves this function. Undefined when there is no detail.
|
|
28
|
-
*/
|
|
29
|
-
declare function documentPartKind(detail: string | undefined): DocumentPartKind | undefined;
|
|
30
|
-
|
|
31
|
-
export { diagnosticCause as a, diagnosticErrorName as b, documentPartKind as c, diagnosticCauses as d, exceptionCause as e };
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
import { H as HeaderFooterParts, a as HeaderFooterSectionResolution, T as TreePackageStore } from './tree-package-store-B8l8DX3Z.js';
|
|
2
|
-
import { Q as OoxmlPackage, O as OoxmlPart, ap as OoxmlElement, as as OoxmlPackageRejection } from './types-barrel-CkF2JbU4.js';
|
|
3
|
-
|
|
4
|
-
/** The package with a hyperlink relationship guaranteed present, and that relationship's id. */
|
|
5
|
-
interface EnsuredHyperlinkRelationship {
|
|
6
|
-
readonly pkg: OoxmlPackage;
|
|
7
|
-
readonly relationshipId: string;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* The target this engine would write for `url`, or null when it would write none.
|
|
11
|
-
*
|
|
12
|
-
* The VALIDATION half of {@link ensureHyperlinkRelationship}, exported so a caller that must decide
|
|
13
|
-
* "would this be authored?" before it is allowed to change the package can ask without changing it.
|
|
14
|
-
* A relationship outlives a refusal — it lives beside the trees, outside the undo stack — so a
|
|
15
|
-
* caller planning a batch that may yet be refused has to ask this and mint later.
|
|
16
|
-
*
|
|
17
|
-
* Same rules, one implementation: `sanitizeHref`'s allowlist, a bound on the length, XML-writable
|
|
18
|
-
* text, and the absolute-URI gate the READ side applies. There is no legitimate reason for this
|
|
19
|
-
* engine to author a scheme it would refuse to open.
|
|
20
|
-
*/
|
|
21
|
-
declare function authorableHyperlinkTarget(url: string): string | null;
|
|
22
|
-
/**
|
|
23
|
-
* The external hyperlink relationship for `url` on `ownerPart` (default: main document),
|
|
24
|
-
* reusing an existing one with the same target, or `null` when the URL is not something to
|
|
25
|
-
* write.
|
|
26
|
-
*
|
|
27
|
-
* REUSE IS BY EXACT TARGET, matching Word: linking twice to the same address produces one
|
|
28
|
-
* relationship. It is safe because a hyperlink relationship carries nothing but its target —
|
|
29
|
-
* two links sharing one are indistinguishable from two links with identical targets, and
|
|
30
|
-
* retargeting one always mints rather than rewriting (see the edit op).
|
|
31
|
-
*
|
|
32
|
-
* Ownership follows the story that holds the `w:hyperlink`: a header/footer or notes part
|
|
33
|
-
* mints into that part's `.rels`, never into `document.xml.rels`. Passing an owner the
|
|
34
|
-
* package does not declare fails closed (`null`) so a scoped insert cannot leave a stray
|
|
35
|
-
* body relationship behind.
|
|
36
|
-
*
|
|
37
|
-
* The URL is refused unless `sanitizeHref` admits it. Storing a `javascript:` target that a
|
|
38
|
-
* FILE authored is required — round-tripping never rewrites a document — but AUTHORING one
|
|
39
|
-
* here is not: there is no legitimate reason for this engine to write a scheme it would then
|
|
40
|
-
* refuse to open, and writing it would hand the next reader a live target this reader made.
|
|
41
|
-
*/
|
|
42
|
-
declare function ensureHyperlinkRelationship(pkg: OoxmlPackage, url: string, ownerPart?: string): EnsuredHyperlinkRelationship | null;
|
|
43
|
-
/**
|
|
44
|
-
* What a part's relationships answer for one `r:id`, over both maps.
|
|
45
|
-
*
|
|
46
|
-
* `relationships` holds the internal records and `externalTargets` the external ones, so a
|
|
47
|
-
* resolver reading only the first sees every hyperlink as dangling.
|
|
48
|
-
*/
|
|
49
|
-
declare function relationshipTargetIn(pkg: OoxmlPackage, ownerPart: string, relationshipId: string): {
|
|
50
|
-
readonly target: string;
|
|
51
|
-
readonly external: boolean;
|
|
52
|
-
readonly sinkSafe?: boolean;
|
|
53
|
-
} | null;
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* The document metadata Word's document-property fields render.
|
|
57
|
-
*
|
|
58
|
-
* Every member is optional: an absent part, an absent element, or an empty value all read as
|
|
59
|
-
* `undefined`, and a field over a missing property paints nothing. Keys are engine-internal
|
|
60
|
-
* names; the field → property mapping (`TITLE` → `title`, `AUTHOR` → `creator`, …) lives in
|
|
61
|
-
* `layout/field-doc-property.ts`.
|
|
62
|
-
*/
|
|
63
|
-
interface DocumentProperties {
|
|
64
|
-
/** `dc:title` — TITLE. */
|
|
65
|
-
readonly title?: string;
|
|
66
|
-
/** `dc:creator` — AUTHOR. */
|
|
67
|
-
readonly creator?: string;
|
|
68
|
-
/** `dc:subject` — SUBJECT. */
|
|
69
|
-
readonly subject?: string;
|
|
70
|
-
/** `cp:keywords` — KEYWORDS. */
|
|
71
|
-
readonly keywords?: string;
|
|
72
|
-
/** `cp:lastModifiedBy` — LASTSAVEDBY. */
|
|
73
|
-
readonly lastModifiedBy?: string;
|
|
74
|
-
/** `dc:description` — COMMENTS. */
|
|
75
|
-
readonly description?: string;
|
|
76
|
-
/** `Company` from `docProps/app.xml`. No field maps to it yet; carried for completeness. */
|
|
77
|
-
readonly company?: string;
|
|
78
|
-
/** `Manager` from `docProps/app.xml`. No field maps to it yet; carried for completeness. */
|
|
79
|
-
readonly manager?: string;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/** Theme typefaces already validated for use by layout. @public */
|
|
83
|
-
interface HeadlessThemeFonts {
|
|
84
|
-
readonly major: string | null;
|
|
85
|
-
readonly minor: string | null;
|
|
86
|
-
/** East Asian heading face; optional for backwards-compatible custom views. */
|
|
87
|
-
readonly majorEastAsia?: string | null;
|
|
88
|
-
/** East Asian body face; optional for backwards-compatible custom views. */
|
|
89
|
-
readonly minorEastAsia?: string | null;
|
|
90
|
-
/** Complex-script heading and body theme faces. */
|
|
91
|
-
readonly majorBidi?: string | null;
|
|
92
|
-
readonly minorBidi?: string | null;
|
|
93
|
-
/** Language-specific theme faces, keyed by ISO 15924 script. */
|
|
94
|
-
readonly majorSupplemental?: Readonly<Record<string, string>>;
|
|
95
|
-
readonly minorSupplemental?: Readonly<Record<string, string>>;
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* The read capabilities shared by browser layout, server export, and future renderers.
|
|
99
|
-
*
|
|
100
|
-
* It deliberately exposes resolved package facts rather than a binding or editor session.
|
|
101
|
-
* An exporter can therefore consume the live document without importing ProseMirror or a DOM.
|
|
102
|
-
* @public
|
|
103
|
-
*/
|
|
104
|
-
interface HeadlessDocumentView {
|
|
105
|
-
part(): OoxmlPart;
|
|
106
|
-
currentPackage(): OoxmlPackage;
|
|
107
|
-
packageRevision(): number;
|
|
108
|
-
stylesRoot(): OoxmlElement | null;
|
|
109
|
-
numberingRoot(): OoxmlElement | null;
|
|
110
|
-
settingsRoot(): OoxmlElement | null;
|
|
111
|
-
documentThemeFonts(): HeadlessThemeFonts;
|
|
112
|
-
documentProperties(): DocumentProperties;
|
|
113
|
-
headerFooterPartsBySection(): readonly HeaderFooterParts[];
|
|
114
|
-
/**
|
|
115
|
-
* Occurrence-specific relationship metadata for header/footer stories.
|
|
116
|
-
*
|
|
117
|
-
* Optional for backwards-compatible host views; core derives it from `currentPackage()` when
|
|
118
|
-
* absent. Hosts with a working-tree overlay should expose their canonical resolution directly.
|
|
119
|
-
*/
|
|
120
|
-
headerFooterResolutionBySection?(): readonly HeaderFooterSectionResolution[];
|
|
121
|
-
relationshipTarget(relationshipId: string): ReturnType<typeof relationshipTargetIn>;
|
|
122
|
-
}
|
|
123
|
-
/** A bad package is data, not an exceptional control path. @public */
|
|
124
|
-
type HeadlessDocumentRejection = OoxmlPackageRejection | 'no-main-document-tree';
|
|
125
|
-
/** Result of opening untrusted DOCX bytes for neutral layout. @public */
|
|
126
|
-
type OpenHeadlessDocumentResult = {
|
|
127
|
-
readonly ok: true;
|
|
128
|
-
readonly view: HeadlessDocumentView;
|
|
129
|
-
} | {
|
|
130
|
-
readonly ok: false;
|
|
131
|
-
readonly reason: HeadlessDocumentRejection;
|
|
132
|
-
readonly detail?: string;
|
|
133
|
-
};
|
|
134
|
-
/**
|
|
135
|
-
* Open DOCX bytes through the bounded store reader and expose only neutral layout reads.
|
|
136
|
-
* @public
|
|
137
|
-
*/
|
|
138
|
-
declare function openHeadlessDocument(bytes: Uint8Array): OpenHeadlessDocumentResult;
|
|
139
|
-
/** Internal live read view over the canonical store, preserving node identities for field pagination. */
|
|
140
|
-
declare function headlessViewOfStore(store: TreePackageStore): HeadlessDocumentView;
|
|
141
|
-
|
|
142
|
-
export { authorableHyperlinkTarget as c, ensureHyperlinkRelationship as e, headlessViewOfStore as h, openHeadlessDocument as o, relationshipTargetIn as r };
|
|
143
|
-
export type { DocumentProperties as D, EnsuredHyperlinkRelationship as E, HeadlessDocumentView as H, OpenHeadlessDocumentResult as O, HeadlessDocumentRejection as a, HeadlessThemeFonts as b };
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { U as OoxmlNodeId, V as OoxmlGenericElementNode, N as OoxmlNode } from './types-barrel-CkF2JbU4.js';
|
|
2
|
-
|
|
3
|
-
/** Office Math Markup Language namespace. */
|
|
4
|
-
declare const OFFICE_MATH_NAMESPACE_URI = "http://schemas.openxmlformats.org/officeDocument/2006/math";
|
|
5
|
-
declare const DEFAULT_OMML_LIMITS: Readonly<{
|
|
6
|
-
maxDepth: 24;
|
|
7
|
-
maxNodes: 256;
|
|
8
|
-
maxTextLength: 512;
|
|
9
|
-
}>;
|
|
10
|
-
/** Shared work limits for untrusted OMML and linear-math input. */
|
|
11
|
-
interface OmmlLimits {
|
|
12
|
-
readonly maxDepth?: number;
|
|
13
|
-
readonly maxNodes?: number;
|
|
14
|
-
readonly maxTextLength?: number;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Marks a structure whose property element carries `m:ctrlPr` operator run formatting that
|
|
18
|
-
* compact replacement cannot reproduce.
|
|
19
|
-
*
|
|
20
|
-
* The source keeps those properties verbatim. Layout draws the operator glyphs with the
|
|
21
|
-
* default math formatting. When every `m:ctrlPr` of the equation holds only default
|
|
22
|
-
* formatting, no structure carries this mark: compact replacement writes the same control
|
|
23
|
-
* properties back on each structure it emits.
|
|
24
|
-
*/
|
|
25
|
-
interface EquationControlSource {
|
|
26
|
-
/** The structure carries non-default `m:ctrlPr` properties, so compact replacement refuses it. */
|
|
27
|
-
readonly controlProperties?: true;
|
|
28
|
-
}
|
|
29
|
-
type EquationExpression = {
|
|
30
|
-
readonly kind: 'row';
|
|
31
|
-
readonly items: readonly EquationExpression[];
|
|
32
|
-
} | {
|
|
33
|
-
readonly kind: 'text';
|
|
34
|
-
readonly value: string;
|
|
35
|
-
readonly format?: {
|
|
36
|
-
readonly fontFamily?: string;
|
|
37
|
-
readonly bold?: boolean;
|
|
38
|
-
readonly italic?: boolean;
|
|
39
|
-
readonly literal?: boolean;
|
|
40
|
-
readonly normalText?: boolean;
|
|
41
|
-
readonly mathStyle?: 'p' | 'b' | 'i' | 'bi';
|
|
42
|
-
};
|
|
43
|
-
} | ({
|
|
44
|
-
readonly kind: 'bar';
|
|
45
|
-
readonly body: EquationExpression;
|
|
46
|
-
readonly position: 'top' | 'bottom';
|
|
47
|
-
} & EquationControlSource) | ({
|
|
48
|
-
readonly kind: 'fraction';
|
|
49
|
-
readonly numerator: EquationExpression;
|
|
50
|
-
readonly denominator: EquationExpression;
|
|
51
|
-
} & EquationControlSource) | ({
|
|
52
|
-
readonly kind: 'radical';
|
|
53
|
-
readonly radicand: EquationExpression;
|
|
54
|
-
readonly degree?: EquationExpression;
|
|
55
|
-
} & EquationControlSource) | ({
|
|
56
|
-
readonly kind: 'script';
|
|
57
|
-
readonly base: EquationExpression;
|
|
58
|
-
readonly subscript?: EquationExpression;
|
|
59
|
-
readonly superscript?: EquationExpression;
|
|
60
|
-
} & EquationControlSource) | ({
|
|
61
|
-
readonly kind: 'nary';
|
|
62
|
-
readonly operator: string;
|
|
63
|
-
readonly body: EquationExpression;
|
|
64
|
-
readonly lowerLimit?: EquationExpression;
|
|
65
|
-
readonly upperLimit?: EquationExpression;
|
|
66
|
-
} & EquationControlSource) | {
|
|
67
|
-
readonly kind: 'fallback';
|
|
68
|
-
readonly text: string;
|
|
69
|
-
};
|
|
70
|
-
interface OmmlEquationProjection {
|
|
71
|
-
readonly sourceNodeId: OoxmlNodeId;
|
|
72
|
-
readonly expression: EquationExpression;
|
|
73
|
-
readonly fallbackText: string;
|
|
74
|
-
readonly truncated: boolean;
|
|
75
|
-
readonly visitedNodes: number;
|
|
76
|
-
/**
|
|
77
|
-
* The font size, in points, that every run of the equation shares through default run
|
|
78
|
-
* properties (`w:sz`). Absent, the equation takes the size of the surrounding text.
|
|
79
|
-
*/
|
|
80
|
-
readonly fontSizePt?: number;
|
|
81
|
-
}
|
|
82
|
-
type LinearMathRejection = 'empty' | 'invalid-syntax' | 'invalid-xml-text' | 'depth-limit' | 'node-limit' | 'text-limit';
|
|
83
|
-
type LinearMathParseResult = {
|
|
84
|
-
readonly ok: true;
|
|
85
|
-
readonly expression: EquationExpression;
|
|
86
|
-
} | {
|
|
87
|
-
readonly ok: false;
|
|
88
|
-
readonly reason: LinearMathRejection;
|
|
89
|
-
};
|
|
90
|
-
type LinearMathOmmlResult = {
|
|
91
|
-
readonly ok: true;
|
|
92
|
-
readonly expression: EquationExpression;
|
|
93
|
-
readonly equation: OoxmlGenericElementNode;
|
|
94
|
-
} | {
|
|
95
|
-
readonly ok: false;
|
|
96
|
-
readonly reason: LinearMathRejection;
|
|
97
|
-
};
|
|
98
|
-
/**
|
|
99
|
-
* Project one preserved `m:oMath` generic node without changing its canonical source.
|
|
100
|
-
*/
|
|
101
|
-
declare function projectOmmlEquation(node: OoxmlNode, limits?: OmmlLimits): OmmlEquationProjection | null;
|
|
102
|
-
/** Parse the supported compact linear-math subset with fixed work limits. */
|
|
103
|
-
declare function parseLinearMath(input: string, limits?: OmmlLimits): LinearMathParseResult;
|
|
104
|
-
/**
|
|
105
|
-
* Convert a projected expression into reversible compact syntax.
|
|
106
|
-
*
|
|
107
|
-
* Returns an empty string when parsing the result would change the projected meaning.
|
|
108
|
-
*/
|
|
109
|
-
declare function equationExpressionToLinearMath(expression: EquationExpression): string;
|
|
110
|
-
type NextNodeId = () => string;
|
|
111
|
-
/** Parse compact linear math and generate fresh canonical OMML in one bounded operation. */
|
|
112
|
-
declare function linearMathToOmml(input: string, nextId: NextNodeId, limits?: OmmlLimits): LinearMathOmmlResult;
|
|
113
|
-
|
|
114
|
-
export { DEFAULT_OMML_LIMITS as D, OFFICE_MATH_NAMESPACE_URI as d, equationExpressionToLinearMath as f, projectOmmlEquation as g, linearMathToOmml as l, parseLinearMath as p };
|
|
115
|
-
export type { EquationControlSource as E, LinearMathOmmlResult as L, OmmlEquationProjection as O, EquationExpression as a, LinearMathParseResult as b, LinearMathRejection as c, OmmlLimits as e };
|