@nous-excalidraw/excalidraw 0.18.2 → 0.18.3

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.
@@ -1 +1 @@
1
- import"../../chunk-EB5FYFLH.js";import"../../chunk-SRAX5OIU.js";import{useEffect as l,useRef as c}from"react";import{Decoration as d,EditorView as o,keymap as v,lineNumbers as T,placeholder as M,drawSelection as H}from"@codemirror/view";import{Compartment as w,EditorState as N}from"@codemirror/state";import{defaultKeymap as P,history as z,historyKeymap as G,redo as K}from"@codemirror/commands";import{syntaxHighlighting as L,HighlightStyle as x}from"@codemirror/language";import{tags as e}from"@lezer/highlight";import{StreamLanguage as S}from"@codemirror/language";var R=S.define({token(r){return r.match(/^%%.*$/)?"comment":r.match(/^"(?:[^"\\]|\\.)*"/)?"string":r.match(/^(flowchart|graph|sequenceDiagram|classDiagram|stateDiagram|erDiagram|gantt|pie|mindmap|journey|gitGraph|timeline|quadrantChart|sankey|xychart)\b/i)||r.match(/^(TB|TD|BT|RL|LR)\b/)||r.match(/^(subgraph|end|participant|actor|loop|alt|else|opt|par|critical|break|rect|note|over|activate|deactivate|title|section|class|style|linkStyle|classDef|click)\b/i)?"keyword":r.match(/^[-.=<>|ox]+>/)||r.match(/^<[-.=<>|ox]+/)||r.match(/^--+|\.\.+|==+/)?"operator":r.match(/^[[\](){}|<>]/)?"bracket":r.match(/^[A-Za-z_][A-Za-z0-9_]*/)?"variableName":r.match(/^\d+(\.\d+)?/)?"number":r.match(/^[,:;]/)?"punctuation":(r.eatSpace()||r.next(),null)}});function y(){return R}import{jsx as $}from"react/jsx-runtime";var q=o.theme({"&":{backgroundColor:"#1e1e1e",color:"#d4d4d4"},".cm-content":{caretColor:"#fff"},".cm-cursor":{borderLeftColor:"#fff"},".cm-gutters":{backgroundColor:"#1e1e1e",color:"#858585",border:"none"},".cm-activeLineGutter":{backgroundColor:"#2a2a2a"},".cm-activeLine":{backgroundColor:"#2a2a2a"},".cm-errorLine":{backgroundColor:"rgba(255, 0, 0, 0.15)"}},{dark:!0}),A=x.define([{tag:e.keyword,color:"#569cd6"},{tag:e.string,color:"#ce9178"},{tag:e.comment,color:"#6a9955"},{tag:e.number,color:"#b5cea8"},{tag:e.operator,color:"#d4d4d4"},{tag:e.punctuation,color:"#d4d4d4"},{tag:e.variableName,color:"#9cdcfe"},{tag:e.bracket,color:"#ffd700"}]),B=o.theme({"&":{backgroundColor:"#ffffff",color:"#1e1e1e"},".cm-content":{caretColor:"#000"},".cm-cursor":{borderLeftColor:"#000"},".cm-gutters":{backgroundColor:"#fff",color:"#999",border:"none"},".cm-activeLineGutter":{backgroundColor:"#e8e8e8"},".cm-activeLine":{backgroundColor:"#e8e8e8"},".cm-errorLine":{backgroundColor:"rgba(255, 0, 0, 0.1)"}}),V=x.define([{tag:e.keyword,color:"#0000ff"},{tag:e.string,color:"#a31515"},{tag:e.comment,color:"#008000"},{tag:e.number,color:"#098658"},{tag:e.operator,color:"#1e1e1e"},{tag:e.punctuation,color:"#1e1e1e"},{tag:e.variableName,color:"#001080"},{tag:e.bracket,color:"#af00db"}]),Z=d.line({class:"cm-errorLine"}),_=(r,a)=>{if(!r||r<1||r>a.lines)return o.decorations.of(d.none);let u=a.line(r);return o.decorations.of(d.set([Z.range(u.from)]))},E=r=>r==="dark"?[q,L(A)]:[B,L(V)],W=({value:r,onChange:a,onKeyboardSubmit:u,placeholder:s,theme:f,errorLine:g})=>{let m=c(null),i=c(null),p=c(a),h=c(u),b=c(new w),k=c(new w);return p.current=a,h.current=u,l(()=>{if(!m.current)return;let t=b.current,n=new o({state:N.create({doc:r,extensions:[v.of([{key:"Mod-Enter",run:()=>(h.current?.(),!0)},{key:"Mod-Shift-z",run:K,preventDefault:!0}]),o.updateListener.of(C=>{C.docChanged&&p.current(C.state.doc.toString())}),z(),v.of([...P,...G]),T(),o.lineWrapping,t.of(E(f)),k.current.of([]),y(),H({drawRangeCursor:!0}),...s?[M(s)]:[]]}),parent:m.current});return i.current=n,n.focus(),()=>{n.destroy(),i.current=null}},[]),l(()=>{let t=i.current;t&&t.dispatch({effects:b.current.reconfigure(E(f))})},[f]),l(()=>{let t=i.current;t&&t.dispatch({effects:k.current.reconfigure(_(g,t.state.doc))})},[g]),l(()=>{let t=i.current;if(!t)return;let n=t.state.doc.toString();r!==n&&t.dispatch({changes:{from:0,to:n.length,insert:r}})},[r]),$("div",{ref:m,className:"ttd-dialog-input ttd-dialog-input--codemirror"})},er=W;export{er as default};
1
+ import"../../chunk-CB2MQ4HV.js";import"../../chunk-SRAX5OIU.js";import{useEffect as l,useRef as c}from"react";import{Decoration as d,EditorView as o,keymap as v,lineNumbers as T,placeholder as M,drawSelection as H}from"@codemirror/view";import{Compartment as w,EditorState as N}from"@codemirror/state";import{defaultKeymap as P,history as z,historyKeymap as G,redo as K}from"@codemirror/commands";import{syntaxHighlighting as L,HighlightStyle as x}from"@codemirror/language";import{tags as e}from"@lezer/highlight";import{StreamLanguage as S}from"@codemirror/language";var R=S.define({token(r){return r.match(/^%%.*$/)?"comment":r.match(/^"(?:[^"\\]|\\.)*"/)?"string":r.match(/^(flowchart|graph|sequenceDiagram|classDiagram|stateDiagram|erDiagram|gantt|pie|mindmap|journey|gitGraph|timeline|quadrantChart|sankey|xychart)\b/i)||r.match(/^(TB|TD|BT|RL|LR)\b/)||r.match(/^(subgraph|end|participant|actor|loop|alt|else|opt|par|critical|break|rect|note|over|activate|deactivate|title|section|class|style|linkStyle|classDef|click)\b/i)?"keyword":r.match(/^[-.=<>|ox]+>/)||r.match(/^<[-.=<>|ox]+/)||r.match(/^--+|\.\.+|==+/)?"operator":r.match(/^[[\](){}|<>]/)?"bracket":r.match(/^[A-Za-z_][A-Za-z0-9_]*/)?"variableName":r.match(/^\d+(\.\d+)?/)?"number":r.match(/^[,:;]/)?"punctuation":(r.eatSpace()||r.next(),null)}});function y(){return R}import{jsx as $}from"react/jsx-runtime";var q=o.theme({"&":{backgroundColor:"#1e1e1e",color:"#d4d4d4"},".cm-content":{caretColor:"#fff"},".cm-cursor":{borderLeftColor:"#fff"},".cm-gutters":{backgroundColor:"#1e1e1e",color:"#858585",border:"none"},".cm-activeLineGutter":{backgroundColor:"#2a2a2a"},".cm-activeLine":{backgroundColor:"#2a2a2a"},".cm-errorLine":{backgroundColor:"rgba(255, 0, 0, 0.15)"}},{dark:!0}),A=x.define([{tag:e.keyword,color:"#569cd6"},{tag:e.string,color:"#ce9178"},{tag:e.comment,color:"#6a9955"},{tag:e.number,color:"#b5cea8"},{tag:e.operator,color:"#d4d4d4"},{tag:e.punctuation,color:"#d4d4d4"},{tag:e.variableName,color:"#9cdcfe"},{tag:e.bracket,color:"#ffd700"}]),B=o.theme({"&":{backgroundColor:"#ffffff",color:"#1e1e1e"},".cm-content":{caretColor:"#000"},".cm-cursor":{borderLeftColor:"#000"},".cm-gutters":{backgroundColor:"#fff",color:"#999",border:"none"},".cm-activeLineGutter":{backgroundColor:"#e8e8e8"},".cm-activeLine":{backgroundColor:"#e8e8e8"},".cm-errorLine":{backgroundColor:"rgba(255, 0, 0, 0.1)"}}),V=x.define([{tag:e.keyword,color:"#0000ff"},{tag:e.string,color:"#a31515"},{tag:e.comment,color:"#008000"},{tag:e.number,color:"#098658"},{tag:e.operator,color:"#1e1e1e"},{tag:e.punctuation,color:"#1e1e1e"},{tag:e.variableName,color:"#001080"},{tag:e.bracket,color:"#af00db"}]),Z=d.line({class:"cm-errorLine"}),_=(r,a)=>{if(!r||r<1||r>a.lines)return o.decorations.of(d.none);let u=a.line(r);return o.decorations.of(d.set([Z.range(u.from)]))},E=r=>r==="dark"?[q,L(A)]:[B,L(V)],W=({value:r,onChange:a,onKeyboardSubmit:u,placeholder:s,theme:f,errorLine:g})=>{let m=c(null),i=c(null),p=c(a),h=c(u),b=c(new w),k=c(new w);return p.current=a,h.current=u,l(()=>{if(!m.current)return;let t=b.current,n=new o({state:N.create({doc:r,extensions:[v.of([{key:"Mod-Enter",run:()=>(h.current?.(),!0)},{key:"Mod-Shift-z",run:K,preventDefault:!0}]),o.updateListener.of(C=>{C.docChanged&&p.current(C.state.doc.toString())}),z(),v.of([...P,...G]),T(),o.lineWrapping,t.of(E(f)),k.current.of([]),y(),H({drawRangeCursor:!0}),...s?[M(s)]:[]]}),parent:m.current});return i.current=n,n.focus(),()=>{n.destroy(),i.current=null}},[]),l(()=>{let t=i.current;t&&t.dispatch({effects:b.current.reconfigure(E(f))})},[f]),l(()=>{let t=i.current;t&&t.dispatch({effects:k.current.reconfigure(_(g,t.state.doc))})},[g]),l(()=>{let t=i.current;if(!t)return;let n=t.state.doc.toString();r!==n&&t.dispatch({changes:{from:0,to:n.length,insert:r}})},[r]),$("div",{ref:m,className:"ttd-dialog-input ttd-dialog-input--codemirror"})},er=W;export{er as default};
@@ -0,0 +1 @@
1
+ import{T as a,U as b,V as c}from"../chunk-J2BPLTM2.js";import"../chunk-CB2MQ4HV.js";import"../chunk-SRAX5OIU.js";export{c as decodePngMetadata,b as encodePngMetadata,a as getTEXtChunk};