crossnote 0.9.34 → 0.9.35

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/out/cjs/index.cjs CHANGED
@@ -243,7 +243,7 @@ by setting the setting "markdown-preview-enhanced.plantumlServer" to the URL of
243
243
  `;h&&h[h.length-1]!=="/"&&(h+="/");async function _(){let A=KA(),M=new A.View(A.parse(f),{loader:(0,r2.loader)({baseURL:h}),renderer:"none"}).initialize();return w+await M.toSVG()}return await EM(_)}async function Sh(f="",h=""){f=f.trim();let w;return f[0]!=="{"?w=a2.parse(f):w=JSON.parse(f),X4(w,h)}var l2=Ke(require("yaml")),c2=Ke(s2());async function fk(f="",h=""){f=f.trim();let w;return f[0]!=="{"?w=l2.parse(f):w=JSON.parse(f),yM(()=>vM(()=>Sh(JSON.stringify(c2.compile(w).spec),h)))}var u2=require("@viz-js/viz"),pk=null;async function hk(f,h){try{return pk||(pk=await(0,u2.instance)()),await pk.renderString(f,{format:"svg",...h})}catch(w){throw pk=null,w}}var d2=require("child_process"),f2=Ke(require("fs")),p2=Ke(require("imagemagick-cli"));async function h2(f,h,w=""){let _=await Qo({prefix:"crossnote-svg",suffix:".svg"});f2.writeFileSync(_.fd,f);let A=[_.path,h];try{w&&w.length?await(0,d2.execFileSync)(w,A):await p2.default.exec(`convert ${A.join(" ")}`)}catch(M){throw new Error(`imagemagick-cli failure
244
244
 
245
245
  Please make sure you have ImageMagick installed.`,{cause:M})}return h}var m2=require("child_process"),g2=Ke(require("fs"));async function b2(f,h,w,_){let A=await Qo({prefix:"crossnote-mermaid",suffix:".mmd"});g2.writeFileSync(A.fd,f),_||(_="null");try{return(0,m2.execFileSync)("npx",["-p","@mermaid-js/mermaid-cli","mmdc","--theme",_,"--input",A.path,"--output",h],{shell:!0,cwd:w}),h}catch(M){throw new Error(`mermaid CLI is required to be installed.
246
- Check https://github.com/mermaid-js/mermaid-cli for more information.`,{cause:M})}}async function y2(f,h){try{let w=(await import("sharp")).default;await w(Buffer.from(f.replace(/font-family="[\w|\-|,|\s]+"/g,'font-family="Arial, sans-serif"'))).png().toFile(h)}catch(w){throw new Error(`sharp conversion failure
246
+ Check https://github.com/mermaid-js/mermaid-cli for more information.`,{cause:M})}}async function y2(f,h){try{let w=(await import("sharp")).default;await w(Buffer.from(f.replace(/font-family="[\w|\-|,|\s]+"/g,'font-family="Arial, sans-serif"'))).png().toFile(h)}catch(w){let _=w instanceof Error?w.message:String(w);throw new Error(`sharp conversion failure: ${_}
247
247
 
248
248
  Please make sure you have libvips installed.`,{cause:w})}return h}var v2=require("child_process"),E2=Ke(require("fs"));async function w2(f,h){let w=await Qo({prefix:"crossnote-wavedrom",suffix:".js"});await E2.writeFileSync(w.fd,f);try{return(await(0,v2.execFileSync)("npx",["wavedrom-cli","-i",w.path],{shell:!0,cwd:h})).toString("utf-8")}catch(_){throw new Error(`wavedrom CLI is required to be installed.
249
249
  Check http://github.com/wavedrom/cli for more information.`,{cause:_})}}async function mk(f,{fileDirectoryPath:h,projectDirectoryPath:w,imageDirectoryPath:_,imageFilePrefix:A,useRelativeFilePath:M,codeChunksData:O,graphsCache:L,addOptionsStr:B,cacheBust:H=!0,notebook:V}){let X=H===!1?"":"?"+Math.random(),W=f.split(`
package/out/esm/index.mjs CHANGED
@@ -243,7 +243,7 @@ by setting the setting "markdown-preview-enhanced.plantumlServer" to the URL of
243
243
  `;h&&h[h.length-1]!=="/"&&(h+="/");async function _(){let A=IA(),M=new A.View(A.parse(f),{loader:a4({baseURL:h}),renderer:"none"}).initialize();return w+await M.toSVG()}return await iM(_)}async function vh(f="",h=""){f=f.trim();let w;return f[0]!=="{"?w=OM.parse(f):w=JSON.parse(f),i4(w,h)}var PM=UD(LM());import*as FM from"yaml";async function ak(f="",h=""){f=f.trim();let w;return f[0]!=="{"?w=FM.parse(f):w=JSON.parse(f),rM(()=>aM(()=>vh(JSON.stringify(PM.compile(w).spec),h)))}import{instance as s4}from"@viz-js/viz";var ik=null;async function ok(f,h){try{return ik||(ik=await s4()),await ik.renderString(f,{format:"svg",...h})}catch(w){throw ik=null,w}}import{execFileSync as l4}from"child_process";import*as $M from"fs";import c4 from"imagemagick-cli";async function BM(f,h,w=""){let _=await Xo({prefix:"crossnote-svg",suffix:".svg"});$M.writeFileSync(_.fd,f);let A=[_.path,h];try{w&&w.length?await l4(w,A):await c4.exec(`convert ${A.join(" ")}`)}catch(M){throw new Error(`imagemagick-cli failure
244
244
 
245
245
  Please make sure you have ImageMagick installed.`,{cause:M})}return h}import{execFileSync as d4}from"child_process";import*as UM from"fs";async function zM(f,h,w,_){let A=await Xo({prefix:"crossnote-mermaid",suffix:".mmd"});UM.writeFileSync(A.fd,f),_||(_="null");try{return d4("npx",["-p","@mermaid-js/mermaid-cli","mmdc","--theme",_,"--input",A.path,"--output",h],{shell:!0,cwd:w}),h}catch(M){throw new Error(`mermaid CLI is required to be installed.
246
- Check https://github.com/mermaid-js/mermaid-cli for more information.`,{cause:M})}}async function GM(f,h){try{let w=(await import("sharp")).default;await w(Buffer.from(f.replace(/font-family="[\w|\-|,|\s]+"/g,'font-family="Arial, sans-serif"'))).png().toFile(h)}catch(w){throw new Error(`sharp conversion failure
246
+ Check https://github.com/mermaid-js/mermaid-cli for more information.`,{cause:M})}}async function GM(f,h){try{let w=(await import("sharp")).default;await w(Buffer.from(f.replace(/font-family="[\w|\-|,|\s]+"/g,'font-family="Arial, sans-serif"'))).png().toFile(h)}catch(w){let _=w instanceof Error?w.message:String(w);throw new Error(`sharp conversion failure: ${_}
247
247
 
248
248
  Please make sure you have libvips installed.`,{cause:w})}return h}import{execFileSync as h4}from"child_process";import*as jM from"fs";async function HM(f,h){let w=await Xo({prefix:"crossnote-wavedrom",suffix:".js"});await jM.writeFileSync(w.fd,f);try{return(await h4("npx",["wavedrom-cli","-i",w.path],{shell:!0,cwd:h})).toString("utf-8")}catch(_){throw new Error(`wavedrom CLI is required to be installed.
249
249
  Check http://github.com/wavedrom/cli for more information.`,{cause:_})}}async function sk(f,{fileDirectoryPath:h,projectDirectoryPath:w,imageDirectoryPath:_,imageFilePrefix:A,useRelativeFilePath:M,codeChunksData:O,graphsCache:L,addOptionsStr:B,cacheBust:q=!0,notebook:V}){let X=q===!1?"":"?"+Math.random(),W=f.split(`
@@ -22,6 +22,7 @@ declare const PreviewContainer: import("unstated-next").Container<{
22
22
  isVSCodeWebExtension: boolean;
23
23
  markdown: string;
24
24
  markdownEditorExpanded: boolean;
25
+ notice: string | undefined;
25
26
  postMessage: (command: string, args?: unknown[]) => void;
26
27
  previewElement: import("react").RefObject<HTMLDivElement>;
27
28
  previewSyncSource: () => void;
@@ -29,6 +30,7 @@ declare const PreviewContainer: import("unstated-next").Container<{
29
30
  setHighlightElementBeingEdited: import("react").Dispatch<import("react").SetStateAction<HTMLElement | null>>;
30
31
  setIsMouseOverPreview: import("react").Dispatch<import("react").SetStateAction<boolean>>;
31
32
  setMarkdownEditorExpanded: import("react").Dispatch<import("react").SetStateAction<boolean>>;
33
+ setNotice: import("react").Dispatch<import("react").SetStateAction<string | undefined>>;
32
34
  setShowBacklinks: import("react").Dispatch<import("react").SetStateAction<boolean>>;
33
35
  setShowImageHelper: import("react").Dispatch<import("react").SetStateAction<boolean>>;
34
36
  showBacklinks: boolean;
@@ -0,0 +1 @@
1
+ export {};