@dorvyn/core 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/editor.js CHANGED
@@ -1 +1 @@
1
- import{CommandRegistry as P}from"./commands.js";import{registerEditingCommands as z}from"./controller/commands.js";import{EditorController as U,GALLERY_ORDER as A}from"./controller/editor-controller.js";import{onAnySignalChange as $}from"./controller/signals.js";import{engine as T}from"./engine/glue.js";import{engineLoaded as _,loadEngine as H}from"./engine/loader.js";import{texToMathml as M}from"./engine/docx-core.js";import{exportDocx as W,exportUrlFor as B}from"./export.js";import{GrantClient as F}from"./grants.js";import{Store as K}from"./store.js";import{BUILD_ID as Y}from"./build.js";import{keepController as J}from"./internal.js";import{ENGINE as V}from"../engine/manifest.js";const L=["1.0","1.15","1.5","2.0","2.5","3.0"];async function ue(t){const o=new K({readOnly:!0,viewing:!1,engine:t.engine===!1?"off":"loading",license:"none",saveTo:t.onSave?"page":"download",dirty:!1,bold:!1,italic:!1,underline:!1,format:null,canUndo:!1,canRedo:!1,words:0,chars:0,pages:1,findCount:0,paragraph:{lineSpacing:1.15,rtl:!1,indentLeft:0,indentRight:0,spaceBefore:0,spaceAfter:8},marks:!1,editing:"body",page:{width:8.5,height:11,orientation:"portrait",margins:{top:1,right:1,bottom:1,left:1}},pageNumbers:{position:"none",withTotal:!1,where:"footer"},zoom:100,picture:null,equation:null,findIndex:-1,comments:[],activeComment:null,headings:[],bookmarks:[],fileName:"Document",author:"Guest",currentPage:1,saveStatus:"saved",hasSelection:!1}),c=new P(()=>({readOnly:o.get().readOnly})),{key:g,serverUrl:m,getGrant:I}=t,l=new F({key:g,grantUrl:m&&`${m}/grant`,getGrant:I,api:t.api,sdkVersion:"0.1.0",build:Y,fetch:t.fetch}),E=t.origin??globalThis.location?.origin??"";let u=!1,h=!1;const C=()=>{const n=l.current,e=o.get().engine==="ready";if(e&&!n&&h&&l.grace){o.set({license:"grace",readOnly:!u||o.get().viewing});return}if(!e||!n){if(u=!1,e&&h)try{T.setGrant("",E,0)}catch{}o.set({license:n?"none":l.refused?"unavailable":h?"lapsed":l.problem?"unavailable":"none",readOnly:!0});return}try{u=!!JSON.parse(T.setGrant(n.token,E,Math.floor(Date.now()/1e3))).features?.includes("edit"),h=!0,o.set({license:"valid",readOnly:!u||o.get().viewing})}catch{u=!1,o.set({license:"refused",readOnly:!0})}};l.onChange(C);const v=l.start();if(t.engine!==!1){const n=t.engine??{},i=!!m&&!n.url&&!n.bytes&&n.integrity===void 0?v.then(s=>({...n,...s.engine}),()=>n):n,f=g?Promise.resolve(g.startsWith("dvn_pk_test_")):v.then(s=>!!s.test,()=>!1),r=Promise.resolve(i).then(s=>s.integrity===void 0||s.integrity===V.integrity||f);H(i,r).then(()=>{o.set({engine:"ready"}),C()},()=>o.set({engine:"failed",readOnly:!0}))}v.catch(()=>{for(const n of[...b])n()});const p=()=>globalThis.document?.visibilityState!=="hidden"&&l.wake();globalThis.addEventListener?.("online",p),globalThis.document?.addEventListener("visibilitychange",p);const b=new Set,S=()=>new Promise((n,e)=>{const i=()=>{const r=o.get();let s;(r.license==="valid"||r.license==="grace")&&r.engine==="ready"?s=null:(r.license==="refused"||r.engine==="failed"||r.engine==="off"||l.problem)&&(s=new Error(`No license to open documents with (${l.problem?l.problem.message:r.engine!=="ready"?`engine ${r.engine}`:"refused"}).`)),s!==void 0&&(f(),b.delete(i),s?e(s):n())},f=o.select(r=>`${r.license}/${r.engine}`,i);b.add(i),i()});c.register("viewing",{edits:!1,active:()=>o.get().viewing,run:n=>{const e=n??!o.get().viewing;o.set({viewing:e,readOnly:e||!u})}});const k={open:new Set,notice:new Set,change:new Set},y=(n,e)=>{for(const i of[...k[n]])i(e)};let d=null,O=null,N=null,D=null;if(t.document){const n=r=>q("docx",r);d=new U({...t.document,exportDocx:n,autosaveKey:t.autosaveKey===void 0?null:t.autosaveKey,onOpen:r=>y("open",r),onNotice:r=>y("notice",{message:r}),...t.drafts&&{drafts:t.drafts},...t.edition&&{edition:t.edition},onChanged:r=>y("change",{document:x(r)}),...t.onSave&&{onSave:r=>t.onSave(x(r))}});const e=d;e.readOnly.set(o.get().readOnly),D=o.select(r=>r.readOnly,r=>e.readOnly.set(r));let i=!1;const f=()=>{i=!1;const r=e.fmt(),s=t.document.body;s.contentEditable=e.readOnly()?"false":"true",s.spellcheck=e.spellcheck(),o.set({format:{...r},bold:r.bold,italic:r.italic,underline:r.underline,canUndo:e.canUndo(),canRedo:e.canRedo(),words:e.words(),chars:e.chars(),pages:e.pages(),findCount:e.findCount(),dirty:e.saveStatus()!=="saved",paragraph:{lineSpacing:e.lineSpacing(),rtl:e.isRtl(),indentLeft:e.currentIndent("left"),indentRight:e.currentIndent("right"),spaceBefore:e.currentSpacing("before"),spaceAfter:e.currentSpacing("after")},marks:e.showMarks(),editing:e.editingPart(),page:e.page(),pageNumbers:{position:e.pageNumbers().position,withTotal:!!e.pageNumbers().withTotal,where:e.pageNumbers().where??"footer"},zoom:e.zoom(),picture:j(e),equation:e.selectedEquation(),findIndex:e.findIndex(),comments:e.comments(),activeComment:e.activeComment(),headings:e.headings(),bookmarks:e.bookmarks(),fileName:e.fileName(),author:e.author(),currentPage:e.currentPage(),hasSelection:e.hasSelection(),saveStatus:e.saveStatus()})};N=$(()=>{i||(i=!0,queueMicrotask(f))}),O=z(c,e),e.attach()}async function q(n,e){const i=await l.fresh();if(n!=="docx")throw new Error(`Unknown export "${n}".`);if(!i&&l.grace)throw new Error("The license service can't be reached: saving as Word waits. Your work is safe.");if(!i?.features.includes("export.docx"))throw new Error("Saving as .docx needs a license that includes export.");return W(i.token,e,m?{endpoint:`${m}/export`,fetch:t.fetch}:{url:t.exportUrl??B(i.region),fetch:t.fetch})}const w=()=>{if(!d)throw new Error("This editor has no document to work on (give createEditor a document, or use <dorvyn-editor>).");return d},a=d,G=a?{fonts:a.fonts,sizes:a.sizes,themeColors:a.themeColors,highlights:a.highlights,styles:a.styles,gallery:A,lineSpacings:L,symbols:a.symbols,icons:a.iconList,get pageSizes(){return a.pageSizes},get margins(){return a.marginPresets},get shapes(){return a.shapeList},get equations(){return{gallery:a.eqGallery().map(({name:n,tex:e,html:i})=>({name:n,tex:e,mathml:i})),structures:a.eqStructures,symbols:a.eqSymbols}}}:{fonts:[],sizes:[],themeColors:[],highlights:[],styles:[],gallery:[],lineSpacings:L,symbols:[],icons:[],pageSizes:[],margins:[],shapes:[],equations:{gallery:[],structures:[],symbols:[]}},R={commands:c,lists:G,crossReferenceTargets:()=>a?.collectCrossRefTargets()??[],open(n){const e=a?Q(a,n):null;e&&y("open",e)},mathml:(n,e=!0)=>_()&&n.trim()?M(n,e):"",on(n,e){return k[n].add(e),()=>k[n].delete(e)},statistics:()=>a?.stats()??null,state:o,grants:l,export:q,getDocument:()=>x(w().getState()),setDocument:async n=>(await import("./documents.js")).setDocument(w(),S,n),importDocument:async(n,e)=>(await import("./documents.js")).importDocument(w(),S,n,e),exportDocument:async n=>(await import("./documents.js")).exportDocument(w(),S,n),destroy(){l.stop(),globalThis.removeEventListener?.("online",p),globalThis.document?.removeEventListener("visibilitychange",p),O?.(),N?.(),D?.(),d?.destroy()}};return d&&J(R,d),R}function j(t){if(!t.selectedImage()?.isConnected)return null;const c=t.wrapOf()||"inline";return{width:t.imgWidth(),height:t.imgHeight(),alt:t.imgAlt(),wrap:c,align:t.imagePosition()}}function Q(t,o){const c=o.dialog??o.pane??o.view??"",g=o.toggle?{toggle:!0}:{};switch(c){case"link":return{dialog:"link",...t.linkAtCursor()};case"bookmark":return{dialog:"bookmark",name:t.bookmarkSuggestion()};case"crossReference":return{dialog:"crossReference"};case"caption":return{dialog:"caption",...t.captionSetup()};case"equation":return{dialog:"equation",tex:o.tex??"",display:t.equationDisplayHere(),editing:!1};case"wordcount":case"editor":case"shortcuts":case"about":case"options":return{dialog:c};case"find":return{pane:"find",mode:o.mode??"find",query:t.findSelection(),...g};case"comments":case"navigation":return{pane:c,...g};case"focus":return{view:"focus"};default:return null}}function x(t){return{format:"dorvyn.document",version:1,title:t.fileName,author:t.author,body:t.html,header:t.headerHtml,footer:t.footerHtml,page:t.page,pageNumbers:t.pageNumbers,comments:t.comments}}export{ue as createEditor,x as toDocument};
1
+ import{CommandRegistry as P}from"./commands.js";import{registerEditingCommands as z}from"./controller/commands.js";import{EditorController as U,GALLERY_ORDER as A}from"./controller/editor-controller.js";import{onAnySignalChange as $}from"./controller/signals.js";import{engine as T}from"./engine/glue.js";import{engineLoaded as _,loadEngine as H}from"./engine/loader.js";import{texToMathml as M}from"./engine/docx-core.js";import{exportDocx as W,exportUrlFor as B}from"./export.js";import{GrantClient as F}from"./grants.js";import{Store as K}from"./store.js";import{BUILD_ID as V}from"./build.js";import{VERSION as Y}from"./version.js";import{keepController as J}from"./internal.js";import{ENGINE as j}from"../engine/manifest.js";const I=["1.0","1.15","1.5","2.0","2.5","3.0"];async function fe(t){const o=new K({readOnly:!0,viewing:!1,engine:t.engine===!1?"off":"loading",license:"none",saveTo:t.onSave?"page":"download",dirty:!1,bold:!1,italic:!1,underline:!1,format:null,canUndo:!1,canRedo:!1,words:0,chars:0,pages:1,findCount:0,paragraph:{lineSpacing:1.15,rtl:!1,indentLeft:0,indentRight:0,spaceBefore:0,spaceAfter:8},marks:!1,editing:"body",page:{width:8.5,height:11,orientation:"portrait",margins:{top:1,right:1,bottom:1,left:1}},pageNumbers:{position:"none",withTotal:!1,where:"footer"},zoom:100,picture:null,equation:null,findIndex:-1,comments:[],activeComment:null,headings:[],bookmarks:[],fileName:"Document",author:"Guest",currentPage:1,saveStatus:"saved",hasSelection:!1}),c=new P(()=>({readOnly:o.get().readOnly})),{key:g,serverUrl:m,getGrant:L}=t,l=new F({key:g,grantUrl:m&&`${m}/grant`,getGrant:L,api:t.api,sdkVersion:Y,build:V,fetch:t.fetch}),E=t.origin??globalThis.location?.origin??"";let u=!1,h=!1;const C=()=>{const n=l.current,e=o.get().engine==="ready";if(e&&!n&&h&&l.grace){o.set({license:"grace",readOnly:!u||o.get().viewing});return}if(!e||!n){if(u=!1,e&&h)try{T.setGrant("",E,0)}catch{}o.set({license:n?"none":l.refused?"unavailable":h?"lapsed":l.problem?"unavailable":"none",readOnly:!0});return}try{u=!!JSON.parse(T.setGrant(n.token,E,Math.floor(Date.now()/1e3))).features?.includes("edit"),h=!0,o.set({license:"valid",readOnly:!u||o.get().viewing})}catch{u=!1,o.set({license:"refused",readOnly:!0})}};l.onChange(C);const v=l.start();if(t.engine!==!1){const n=t.engine??{},i=!!m&&!n.url&&!n.bytes&&n.integrity===void 0?v.then(s=>({...n,...s.engine}),()=>n):n,f=g?Promise.resolve(g.startsWith("dvn_pk_test_")):v.then(s=>!!s.test,()=>!1),r=Promise.resolve(i).then(s=>s.integrity===void 0||s.integrity===j.integrity||f);H(i,r).then(()=>{o.set({engine:"ready"}),C()},()=>o.set({engine:"failed",readOnly:!0}))}v.catch(()=>{for(const n of[...b])n()});const p=()=>globalThis.document?.visibilityState!=="hidden"&&l.wake();globalThis.addEventListener?.("online",p),globalThis.document?.addEventListener("visibilitychange",p);const b=new Set,S=()=>new Promise((n,e)=>{const i=()=>{const r=o.get();let s;(r.license==="valid"||r.license==="grace")&&r.engine==="ready"?s=null:(r.license==="refused"||r.engine==="failed"||r.engine==="off"||l.problem)&&(s=new Error(`No license to open documents with (${l.problem?l.problem.message:r.engine!=="ready"?`engine ${r.engine}`:"refused"}).`)),s!==void 0&&(f(),b.delete(i),s?e(s):n())},f=o.select(r=>`${r.license}/${r.engine}`,i);b.add(i),i()});c.register("viewing",{edits:!1,active:()=>o.get().viewing,run:n=>{const e=n??!o.get().viewing;o.set({viewing:e,readOnly:e||!u})}});const k={open:new Set,notice:new Set,change:new Set},y=(n,e)=>{for(const i of[...k[n]])i(e)};let d=null,O=null,N=null,D=null;if(t.document){const n=r=>q("docx",r);d=new U({...t.document,exportDocx:n,autosaveKey:t.autosaveKey===void 0?null:t.autosaveKey,onOpen:r=>y("open",r),onNotice:r=>y("notice",{message:r}),...t.drafts&&{drafts:t.drafts},...t.edition&&{edition:t.edition},onChanged:r=>y("change",{document:x(r)}),...t.onSave&&{onSave:r=>t.onSave(x(r))}});const e=d;e.readOnly.set(o.get().readOnly),D=o.select(r=>r.readOnly,r=>e.readOnly.set(r));let i=!1;const f=()=>{i=!1;const r=e.fmt(),s=t.document.body;s.contentEditable=e.readOnly()?"false":"true",s.spellcheck=e.spellcheck(),o.set({format:{...r},bold:r.bold,italic:r.italic,underline:r.underline,canUndo:e.canUndo(),canRedo:e.canRedo(),words:e.words(),chars:e.chars(),pages:e.pages(),findCount:e.findCount(),dirty:e.saveStatus()!=="saved",paragraph:{lineSpacing:e.lineSpacing(),rtl:e.isRtl(),indentLeft:e.currentIndent("left"),indentRight:e.currentIndent("right"),spaceBefore:e.currentSpacing("before"),spaceAfter:e.currentSpacing("after")},marks:e.showMarks(),editing:e.editingPart(),page:e.page(),pageNumbers:{position:e.pageNumbers().position,withTotal:!!e.pageNumbers().withTotal,where:e.pageNumbers().where??"footer"},zoom:e.zoom(),picture:Q(e),equation:e.selectedEquation(),findIndex:e.findIndex(),comments:e.comments(),activeComment:e.activeComment(),headings:e.headings(),bookmarks:e.bookmarks(),fileName:e.fileName(),author:e.author(),currentPage:e.currentPage(),hasSelection:e.hasSelection(),saveStatus:e.saveStatus()})};N=$(()=>{i||(i=!0,queueMicrotask(f))}),O=z(c,e),e.attach()}async function q(n,e){const i=await l.fresh();if(n!=="docx")throw new Error(`Unknown export "${n}".`);if(!i&&l.grace)throw new Error("The license service can't be reached: saving as Word waits. Your work is safe.");if(!i?.features.includes("export.docx"))throw new Error("Saving as .docx needs a license that includes export.");return W(i.token,e,m?{endpoint:`${m}/export`,fetch:t.fetch}:{url:t.exportUrl??B(i.region),fetch:t.fetch})}const w=()=>{if(!d)throw new Error("This editor has no document to work on (give createEditor a document, or use <dorvyn-editor>).");return d},a=d,G=a?{fonts:a.fonts,sizes:a.sizes,themeColors:a.themeColors,highlights:a.highlights,styles:a.styles,gallery:A,lineSpacings:I,symbols:a.symbols,icons:a.iconList,get pageSizes(){return a.pageSizes},get margins(){return a.marginPresets},get shapes(){return a.shapeList},get equations(){return{gallery:a.eqGallery().map(({name:n,tex:e,html:i})=>({name:n,tex:e,mathml:i})),structures:a.eqStructures,symbols:a.eqSymbols}}}:{fonts:[],sizes:[],themeColors:[],highlights:[],styles:[],gallery:[],lineSpacings:I,symbols:[],icons:[],pageSizes:[],margins:[],shapes:[],equations:{gallery:[],structures:[],symbols:[]}},R={commands:c,lists:G,crossReferenceTargets:()=>a?.collectCrossRefTargets()??[],open(n){const e=a?X(a,n):null;e&&y("open",e)},mathml:(n,e=!0)=>_()&&n.trim()?M(n,e):"",on(n,e){return k[n].add(e),()=>k[n].delete(e)},statistics:()=>a?.stats()??null,state:o,grants:l,export:q,getDocument:()=>x(w().getState()),setDocument:async n=>(await import("./documents.js")).setDocument(w(),S,n),importDocument:async(n,e)=>(await import("./documents.js")).importDocument(w(),S,n,e),exportDocument:async n=>(await import("./documents.js")).exportDocument(w(),S,n),destroy(){l.stop(),globalThis.removeEventListener?.("online",p),globalThis.document?.removeEventListener("visibilitychange",p),O?.(),N?.(),D?.(),d?.destroy()}};return d&&J(R,d),R}function Q(t){if(!t.selectedImage()?.isConnected)return null;const c=t.wrapOf()||"inline";return{width:t.imgWidth(),height:t.imgHeight(),alt:t.imgAlt(),wrap:c,align:t.imagePosition()}}function X(t,o){const c=o.dialog??o.pane??o.view??"",g=o.toggle?{toggle:!0}:{};switch(c){case"link":return{dialog:"link",...t.linkAtCursor()};case"bookmark":return{dialog:"bookmark",name:t.bookmarkSuggestion()};case"crossReference":return{dialog:"crossReference"};case"caption":return{dialog:"caption",...t.captionSetup()};case"equation":return{dialog:"equation",tex:o.tex??"",display:t.equationDisplayHere(),editing:!1};case"wordcount":case"editor":case"shortcuts":case"about":case"options":return{dialog:c};case"find":return{pane:"find",mode:o.mode??"find",query:t.findSelection(),...g};case"comments":case"navigation":return{pane:c,...g};case"focus":return{view:"focus"};default:return null}}function x(t){return{format:"dorvyn.document",version:1,title:t.fileName,author:t.author,body:t.html,header:t.headerHtml,footer:t.footerHtml,page:t.page,pageNumbers:t.pageNumbers,comments:t.comments}}export{fe as createEditor,x as toDocument};
package/dist/export.d.ts CHANGED
@@ -1,6 +1,11 @@
1
1
  /**
2
2
  * Saving as .docx goes to Dorvyn's export service (export.dorvyn.dev): the writer never ships to the
3
3
  * browser. The document is converted in memory there and not stored.
4
+ *
5
+ * Documents over about 5 MB are uploaded first (the service takes at most 6 MB in a request): a one-time
6
+ * link from the service, the document put in its upload bucket with it, then the export naming the upload,
7
+ * which the service reads and deletes before converting. In strict mode the document goes to your server
8
+ * either way, and @dorvyn/server does the same from there.
4
9
  */
5
10
  export interface ExportClientOptions {
6
11
  /** The export service (its /v1/export is asked). */
@@ -20,4 +25,6 @@ export declare const EXPORT_URLS: {
20
25
  };
21
26
  export declare const exportUrlFor: (region: string | undefined) => "https://export.dorvyn.dev" | "https://eu.export.dorvyn.dev";
22
27
  export declare const DOCX_TYPE = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
28
+ /** The largest request sent directly; larger documents are uploaded first (the service's limit is 6 MB). */
29
+ export declare const DIRECT_LIMIT: number;
23
30
  export declare function exportDocx(grant: string, input: unknown, options?: ExportClientOptions): Promise<Blob>;
package/dist/export.js CHANGED
@@ -1 +1 @@
1
- class n extends Error{status;constructor(e,t){super(e),this.name="ExportError",this.status=t}}const s={us:"https://export.dorvyn.dev",eu:"https://eu.export.dorvyn.dev"},c=r=>r==="eu"?s.eu:s.us,p="application/vnd.openxmlformats-officedocument.wordprocessingml.document";async function i(r,e,t={}){const o=await(t.fetch??globalThis.fetch.bind(globalThis))(t.endpoint??`${t.url??"https://export.dorvyn.dev"}/v1/export`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant:r,input:e})});if(!o.ok)throw new n(await o.text()||`Export failed (${o.status}).`,o.status);return new Blob([await o.arrayBuffer()],{type:p})}export{p as DOCX_TYPE,s as EXPORT_URLS,n as ExportError,i as exportDocx,c as exportUrlFor};
1
+ class c extends Error{status;constructor(r,o){super(r),this.name="ExportError",this.status=o}}const x={us:"https://export.dorvyn.dev",eu:"https://eu.export.dorvyn.dev"},w=e=>e==="eu"?x.eu:x.us,h="application/vnd.openxmlformats-officedocument.wordprocessingml.document",f=5*1024*1024;async function y(e,r,o={}){const d=o.fetch??globalThis.fetch.bind(globalThis),a=o.url??"https://export.dorvyn.dev",i=(t,n)=>d(t,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)}),u=async t=>{throw new c(await t.text()||`Export failed (${t.status}).`,t.status)},p=new TextEncoder().encode(JSON.stringify(r));let s;if(o.endpoint||p.length+e.length+64<=f)s=await i(o.endpoint??`${a}/v1/export`,{grant:e,input:r});else{const t=await i(`${a}/v1/export/upload`,{grant:e,size:p.length});t.ok||await u(t);const n=await t.json();if(typeof n.key!="string"||typeof n.url!="string")throw new c("The export service sent an answer this SDK doesn't understand.",502);const l=await d(n.url,{method:"PUT",headers:{"content-type":"application/json"},body:p});if(!l.ok)throw new c("The document couldn't be uploaded for saving. Try again.",l.status);s=await i(`${a}/v1/export`,{grant:e,upload:n.key})}return s.ok||await u(s),new Blob([await s.arrayBuffer()],{type:h})}export{f as DIRECT_LIMIT,h as DOCX_TYPE,x as EXPORT_URLS,c as ExportError,y as exportDocx,w as exportUrlFor};
package/dist/index.d.ts CHANGED
@@ -5,7 +5,7 @@ export { exportDocx, exportUrlFor, EXPORT_URLS, ExportError, DOCX_TYPE, type Exp
5
5
  export type { EditorEdition } from "./controller/editor-controller.ts";
6
6
  export type { DocumentType, EditorDocument, ExportType } from "./editor.ts";
7
7
  export { createEditor, type Editor, type EditorFormat, type EditorLists, type EditorEvents, type EditorOptions, type OpenRequest, type EditorPage, type EditorParagraph, type EditorPicture, type EditorState } from "./editor.ts";
8
- export declare const VERSION = "0.1.0";
8
+ export { VERSION } from "./version.ts";
9
9
  export { loadEngine, engineLoaded, engineUrl, EngineIntegrityError, type EngineSource } from "./engine/loader.ts";
10
10
  export { BrowserDrafts, IndexedDbDrafts, LocalStorageDrafts, MemoryDrafts, type DraftStore } from "./drafts.ts";
11
11
  /** Called after any change to any editor's state (the document surface redraws on it). Advanced use. */
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{Store as t}from"./store.js";import{CommandRegistry as a,UnknownCommandError as x}from"./commands.js";import{GrantClient as f,GrantError as p}from"./grants.js";import{exportDocx as d,exportUrlFor as i,EXPORT_URLS as s,ExportError as g,DOCX_TYPE as D}from"./export.js";import{createEditor as S}from"./editor.js";const r="0.1.0";import{loadEngine as C,engineLoaded as I,engineUrl as O,EngineIntegrityError as R}from"./engine/loader.js";import{BrowserDrafts as y,IndexedDbDrafts as L,LocalStorageDrafts as _,MemoryDrafts as w}from"./drafts.js";import{BASE_ICONS as G,loadIcons as N}from"./icons/base.js";export{G as BASE_ICONS,y as BrowserDrafts,a as CommandRegistry,D as DOCX_TYPE,s as EXPORT_URLS,R as EngineIntegrityError,g as ExportError,f as GrantClient,p as GrantError,L as IndexedDbDrafts,_ as LocalStorageDrafts,w as MemoryDrafts,t as Store,x as UnknownCommandError,r as VERSION,S as createEditor,I as engineLoaded,O as engineUrl,d as exportDocx,i as exportUrlFor,C as loadEngine,N as loadIcons};
1
+ import{Store as e}from"./store.js";import{CommandRegistry as n,UnknownCommandError as a}from"./commands.js";import{GrantClient as x,GrantError as f}from"./grants.js";import{exportDocx as E,exportUrlFor as d,EXPORT_URLS as i,ExportError as g,DOCX_TYPE as s}from"./export.js";import{createEditor as l}from"./editor.js";import{VERSION as C}from"./version.js";import{loadEngine as c,engineLoaded as O,engineUrl as R,EngineIntegrityError as U}from"./engine/loader.js";import{BrowserDrafts as L,IndexedDbDrafts as _,LocalStorageDrafts as w,MemoryDrafts as B}from"./drafts.js";import{BASE_ICONS as N,loadIcons as P}from"./icons/base.js";export{N as BASE_ICONS,L as BrowserDrafts,n as CommandRegistry,s as DOCX_TYPE,i as EXPORT_URLS,U as EngineIntegrityError,g as ExportError,x as GrantClient,f as GrantError,_ as IndexedDbDrafts,w as LocalStorageDrafts,B as MemoryDrafts,e as Store,a as UnknownCommandError,C as VERSION,l as createEditor,O as engineLoaded,R as engineUrl,E as exportDocx,d as exportUrlFor,c as loadEngine,P as loadIcons};
@@ -0,0 +1,2 @@
1
+ /** The SDK's version: what grant requests report, and the engine's CDN folder (package.json says the same; release-sdk.yml checks the tag against it). */
2
+ export declare const VERSION = "0.2.0";
@@ -0,0 +1 @@
1
+ const o="0.2.0";export{o as VERSION};
@@ -1,2 +1,2 @@
1
1
  // Written by packages/core/scripts/engine-manifest.mjs. Do not edit.
2
- export const ENGINE = {"version":"0.1.0","integrity":"sha384-TCWH72z3Talx/iIPDKo73w/XjqV9Jx1etIjEcRS03mdJvX2zI1h+itjEXR6DIs8T"};
2
+ export const ENGINE = {"version":"0.2.0","integrity":"sha384-Z38Mi1Ofp1LuHIsy8BQReaeX0hDhxrCVOrH3QerH48zWJobEqk1xOyfWe9zOjFYJ"};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dorvyn/core",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "The Dorvyn editor without a UI: commands, state, licensing, the engine loader and export.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "author": "Dorvyn Pvt Ltd <support@dorvyn.dev>",