likec4 0.57.0 → 0.57.1
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/cli/index.js +1 -1
- package/package.json +6 -6
- package/dist/__app__/App.d.ts +0 -3
- package/dist/__app__/components/CopyToClipboard.d.ts +0 -7
- package/dist/__app__/components/DiagramNotFound.d.ts +0 -5
- package/dist/__app__/components/ThemePanelToggle.d.ts +0 -3
- package/dist/__app__/components/index.d.ts +0 -6
- package/dist/__app__/components/sidebar/DiagramsTree.d.ts +0 -3
- package/dist/__app__/components/sidebar/Sidebar.d.ts +0 -3
- package/dist/__app__/components/view-page/DisplayModeSelector.d.ts +0 -3
- package/dist/__app__/components/view-page/ExportDiagram.d.ts +0 -9
- package/dist/__app__/components/view-page/Header.d.ts +0 -8
- package/dist/__app__/components/view-page/ShareDialog.d.ts +0 -6
- package/dist/__app__/components/view-page/ViewActions.d.ts +0 -6
- package/dist/__app__/const.d.ts +0 -2
- package/dist/__app__/data/atoms.d.ts +0 -5
- package/dist/__app__/data/hooks.d.ts +0 -10
- package/dist/__app__/data/index-page.d.ts +0 -17
- package/dist/__app__/data/index.d.ts +0 -2
- package/dist/__app__/data/sidebar-diagram-tree.d.ts +0 -3
- package/dist/__app__/likec4-views.d.ts +0 -5
- package/dist/__app__/main.d.ts +0 -2
- package/dist/__app__/pages/embed.page.d.ts +0 -9
- package/dist/__app__/pages/export.page.d.ts +0 -8
- package/dist/__app__/pages/index-page/index.d.ts +0 -3
- package/dist/__app__/pages/index.d.ts +0 -5
- package/dist/__app__/pages/useTransparentBackground.d.ts +0 -2
- package/dist/__app__/pages/view-page/ViewAsReact.d.ts +0 -8
- package/dist/__app__/pages/view-page/index.d.ts +0 -4
- package/dist/__app__/pages/view-page/other-formats/ViewAsD2.d.ts +0 -7
- package/dist/__app__/pages/view-page/other-formats/ViewAsDot.d.ts +0 -7
- package/dist/__app__/pages/view-page/other-formats/ViewAsMmd.d.ts +0 -7
- package/dist/__app__/pages/view-page/other-formats.d.ts +0 -9
- package/dist/__app__/pages/view.page.d.ts +0 -10
- package/dist/__app__/router.d.ts +0 -69
- package/dist/__app__/utils/index.d.ts +0 -2
- package/dist/__app__/utils/utils.d.ts +0 -3
- /package/dist/__app__/{App.jsx → src/App.jsx} +0 -0
- /package/dist/__app__/{components → src/components}/CopyToClipboard.jsx +0 -0
- /package/dist/__app__/{components → src/components}/DiagramNotFound.jsx +0 -0
- /package/dist/__app__/{components → src/components}/ThemePanelToggle.jsx +0 -0
- /package/dist/__app__/{components → src/components}/index.js +0 -0
- /package/dist/__app__/{components → src/components}/sidebar/DiagramsTree.jsx +0 -0
- /package/dist/__app__/{components → src/components}/sidebar/Sidebar.jsx +0 -0
- /package/dist/__app__/{components → src/components}/view-page/DisplayModeSelector.jsx +0 -0
- /package/dist/__app__/{components → src/components}/view-page/ExportDiagram.jsx +0 -0
- /package/dist/__app__/{components → src/components}/view-page/Header.jsx +0 -0
- /package/dist/__app__/{components → src/components}/view-page/ShareDialog.jsx +0 -0
- /package/dist/__app__/{components → src/components}/view-page/ViewActions.jsx +0 -0
- /package/dist/__app__/{const.js → src/const.js} +0 -0
- /package/dist/__app__/{data → src/data}/atoms.js +0 -0
- /package/dist/__app__/{data → src/data}/hooks.js +0 -0
- /package/dist/__app__/{data → src/data}/index-page.js +0 -0
- /package/dist/__app__/{data → src/data}/index.js +0 -0
- /package/dist/__app__/{data → src/data}/sidebar-diagram-tree.js +0 -0
- /package/dist/__app__/{likec4-views.js → src/likec4-views.js} +0 -0
- /package/dist/__app__/{main.jsx → src/main.jsx} +0 -0
- /package/dist/__app__/{pages → src/pages}/embed.page.jsx +0 -0
- /package/dist/__app__/{pages → src/pages}/export.page.jsx +0 -0
- /package/dist/__app__/{pages → src/pages}/index-page/index.jsx +0 -0
- /package/dist/__app__/{pages → src/pages}/index.js +0 -0
- /package/dist/__app__/{pages → src/pages}/useTransparentBackground.js +0 -0
- /package/dist/__app__/{pages → src/pages}/view-page/ViewAsReact.jsx +0 -0
- /package/dist/__app__/{pages → src/pages}/view-page/index.js +0 -0
- /package/dist/__app__/{pages → src/pages}/view-page/other-formats/ViewAsD2.jsx +0 -0
- /package/dist/__app__/{pages → src/pages}/view-page/other-formats/ViewAsDot.jsx +0 -0
- /package/dist/__app__/{pages → src/pages}/view-page/other-formats/ViewAsMmd.jsx +0 -0
- /package/dist/__app__/{pages → src/pages}/view-page/other-formats.jsx +0 -0
- /package/dist/__app__/{pages → src/pages}/view.page.jsx +0 -0
- /package/dist/__app__/{router.js → src/router.js} +0 -0
- /package/dist/__app__/{utils → src/utils}/index.js +0 -0
- /package/dist/__app__/{utils → src/utils}/utils.js +0 -0
package/dist/cli/index.js
CHANGED
|
@@ -211,7 +211,7 @@ ${e}`,"wrappedToString"),_ke=Object.getOwnPropertyDescriptor(Function.prototype,
|
|
|
211
211
|
- `+d).join("")}
|
|
212
212
|
deleted (total ${f.length}):${f.map(d=>`
|
|
213
213
|
- `+d.toString()).join(`
|
|
214
|
-
`)}`),await s.update(c,f,a)}),n.onRequest(une,u=>{if("element"in u)return r.locateElement(u.element,u.property??"name");if("relation"in u)return r.locateRelation(u.relation);if("view"in u)return r.locateView(u.view);qr(u)})}}});var hw,lne=D(()=>{"use strict";Dr();ir();vv();hw=class extends Np{static{o(this,"LikeC4WorkspaceManager")}loadAdditionalDocuments(e,r){return Promise.resolve()}workspace(){return this.folders&&(0,ph.hasAtLeast)(this.folders,1)?this.folders[0]:null}get workspaceUri(){let e=this.workspace();return gt(e,"Workspace not initialized"),In.parse(e.uri)}get workspaceURL(){let e=this.workspace();return gt(e,"Workspace not initialized"),new URL(e.uri)}}});var rn,gw,fne=D(()=>{"use strict";ir();rn=le(Cr(),1);yn();gw=class{constructor(e){this.services=e}static{o(this,"NodeKindProvider")}getSymbolKind(e){let r=o(n=>"type"in e&&this.services.AstReflection.isSubtype(e.type,n),"hasType");switch(!0){case(oe.isElement(e)||r(oe.Element)||oe.isExtendElement(e)||r(oe.ExtendElement)):return rn.SymbolKind.Constructor;case(oe.isModel(e)||oe.isModelViews(e)||oe.isSpecificationRule(e)||r(oe.Model)||r(oe.ModelViews)||r(oe.SpecificationRule)):return rn.SymbolKind.Namespace;case(oe.isElementView(e)||r(oe.ElementView)):return rn.SymbolKind.Class;case(oe.isTag(e)||r(oe.Tag)||oe.isSpecificationTag(e)||r(oe.SpecificationTag)):return rn.SymbolKind.EnumMember;case(oe.isRelationshipKind(e)||r(oe.RelationshipKind)||oe.isSpecificationRelationshipKind(e)||r(oe.SpecificationRelationshipKind)):return rn.SymbolKind.Event;case(oe.isElementKind(e)||r(oe.ElementKind)||oe.isSpecificationElementKind(e)||r(oe.SpecificationElementKind)):return rn.SymbolKind.TypeParameter}return rn.SymbolKind.Constant}getCompletionItemKind(e){switch(this.getSymbolKind(e)){case rn.SymbolKind.Constructor:return rn.CompletionItemKind.Constructor;case rn.SymbolKind.Namespace:return rn.CompletionItemKind.Module;case rn.SymbolKind.Class:return rn.CompletionItemKind.Class;case rn.SymbolKind.EnumMember:return rn.CompletionItemKind.EnumMember;case rn.SymbolKind.TypeParameter:return rn.CompletionItemKind.TypeParameter;case rn.SymbolKind.Interface:return rn.CompletionItemKind.Interface;case rn.SymbolKind.Event:return rn.CompletionItemKind.Event;default:return rn.CompletionItemKind.Keyword}}}});var Dw,dne=D(()=>{"use strict";ir();Dw=class extends Id{static{o(this,"WorkspaceSymbolProvider")}}});var pne=D(()=>{"use strict";lne();fne();dne()});var mne,hne=D(()=>{"use strict";ir();mne=o(t=>{let e=t.likec4.FqnIndex;return(r,n)=>{let i=e.getFqn(r);if(!i){n("error","Not indexed element",{node:r,property:"name"});return}let s=e.byFqn(i).filter(u=>u.el!==r).head();s&&n("error",`Duplicate element name ${r.name!==i?r.name+" ("+i+")":r.name}`,{node:r,property:"name",relatedInformation:[{location:{range:s.el.$cstNode.range,uri:tt(s.el).uri.toString()},message:"Already defined here"}]})}},"elementChecks")});var gne,Dne=D(()=>{"use strict";Dr();yn();wl();yo();gne=o(t=>{let e=t.likec4.FqnIndex;return(r,n)=>{try{let i=ao(r.target),s=i&&e.getFqn(i);s||n("error","Target not found (not parsed/indexed yet)",{node:r,property:"target"});let u;if(oe.isExplicitRelation(r)){if(u=ao(r.source),!u)return n("error","Source not found (not parsed/indexed yet)",{node:r,property:"source"})}else u=r.$container.$container;let a=e.getFqn(u);a||n("error","Source not found (not parsed/indexed yet)",{node:r}),a&&s&&gh(a,s)&&n("error","Invalid parent-child relationship",{node:r}),r.tags?.value&&r.body?.tags?.value&&n("error","Relation cannot have tags in both header and body",{node:r,property:"tags"})}catch(i){Er(i)}}},"relationChecks")});var yne,Ene,Cne,vne,xne,Fne,wne=D(()=>{"use strict";yn();yne=o(t=>(e,r)=>{e.$containerIndex&&e.$containerIndex>0&&r("error","Only one specification per document is allowed",{node:e,property:"name"})},"specificationRuleChecks"),Ene=o(t=>(e,r)=>{e.$containerIndex&&e.$containerIndex>0&&r("error","Only one model per document is allowed",{node:e,property:"name"})},"modelRuleChecks"),Cne=o(t=>(e,r)=>{e.$containerIndex&&e.$containerIndex>0&&r("error","Only one views block per document is allowed",{node:e,property:"name"})},"modelViewsChecks"),vne=o(t=>{let e=t.shared.workspace.IndexManager;return(r,n)=>{e.allElements(oe.ElementKind).filter(s=>s.name===r.name).limit(2).count()>1&&n("error",`Duplicate element kind '${r.name}'`,{node:r,property:"name"})}},"elementKindChecks"),xne=o(t=>{let e=t.shared.workspace.IndexManager;return(r,n)=>{let i="#"+r.name;e.allElements(oe.Tag).filter(u=>u.name===i).limit(2).count()>1&&n("error",`Duplicate tag '${r.name}'`,{node:r,property:"name"})}},"tagChecks"),Fne=o(t=>{let e=t.shared.workspace.IndexManager;return(r,n)=>{e.allElements(oe.RelationshipKind).filter(s=>s.name===r.name).limit(2).count()>1&&n("error",`Duplicate RelationshipKind '${r.name}'`,{node:r,property:"name"})}},"relationshipChecks")});var bne,Rne=D(()=>{"use strict";yn();bne=o(t=>{let e=t.shared.workspace.IndexManager;return(r,n)=>{if(r.extends,!r.name)return;e.allElements(oe.ElementView).filter(s=>s.name===r.name).limit(2).count()>1&&n("error",`Duplicate view '${r.name}'`,{node:r,property:"name"})}},"viewChecks")});var Ane,Tne,_ne=D(()=>{"use strict";yn();Ane=le(Tr(),1),Tne=o(t=>(e,r)=>{if(oe.isWildcardExpr(e.to)&&oe.isViewRulePredicate(e.$container)){let n=e.$container.$container.$container;(0,Ane.isNil)(n.viewOf)&&r("warning","Predicate is ignored as it concerns all relationships",{node:e})}},"incomingExpressionChecks")});var Sne,Pne,kne=D(()=>{"use strict";yn();Sne=le(Tr(),1),Pne=o(t=>(e,r)=>{if(oe.isWildcardExpr(e.from)){let n=e.$container.$container.$container;(0,Sne.isNil)(n.viewOf)&&r("warning","Predicate is ignored as it concerns all relationships",{node:e})}},"outgoingExpressionChecks")});var Ine,One=D(()=>{"use strict";yn();Ine=o(t=>(e,r)=>{oe.isExcludePredicate(e.$container)&&r("error",'Invalid inside "exclude"',{node:e}),oe.isElementRef(e.target)||r("error","Invalid target for customization",{node:e,property:"target"})},"customElementExprChecks")});var Nne=D(()=>{"use strict";_ne();kne();One()});function $ne(t){yr.info("registerValidationChecks"),t.validation.ValidationRegistry.register({SpecificationRule:yne(t),Model:Ene(t),ModelViews:Cne(t),ElementView:bne(t),Element:mne(t),ElementKind:vne(t),Relation:gne(t),Tag:xne(t),CustomElementExpr:Ine(t),RelationshipKind:Fne(t),IncomingExpr:Tne(t),OutgoingExpr:Pne(t)},"slow");let r=t.shared.lsp.Connection;r&&t.shared.workspace.DocumentBuilder.onUpdate((n,i)=>{for(let s of i)r.sendDiagnostics({uri:s.toString(),diagnostics:[]})})}var Bne=D(()=>{"use strict";yn();yo();hne();Dne();wne();Rne();Nne();o($ne,"registerValidationChecks")});function So(t){return e=>new t(e)}function HI(t,e,r,n){let i=Oke(t),s=[ug({shared:i}),qee,Lne,e,r,n].reduce(Mne,{}),u=Yc(s);return i.ServiceRegistry.register(u),$ne(u),u.Rpc.init(),{shared:i,likec4:u}}function Oke(t={}){let e=t.connection;if(e){let n=yr.error.bind(yr);yr.error=i=>{if(typeof i=="string"){n(i),e.telemetry.logEvent({eventName:"error",error:i});return}let s=da(i);n(s),e.telemetry.logEvent({eventName:"error",error:s.stack??s.message})}}let r={...bx,...t};return Yc(ag(r),jee,Ike)}function Mne(t,e){if(e){for(let[r,n]of Object.entries(e))if(n!==void 0){let i=t[r];i!==null&&n!==null&&typeof i=="object"&&typeof n=="object"?t[r]=Mne(i,n):t[r]=n}}return t}var Ike,Lne,jne=D(()=>{"use strict";Dr();ir();CI();yo();ute();Vre();Jre();cne();pne();Bne();Ike={lsp:{NodeKindProvider:t=>new gw(t),WorkspaceSymbolProvider:t=>new Dw(t)},workspace:{WorkspaceManager:t=>new hw(t)}};o(So,"bind");Lne={WorkspaceCache:t=>new Fd(t.shared),Rpc:So(mw),likec4:{FqnIndex:So(ew),ModelParser:So(fw),ModelBuilder:So(uw),ModelLocator:So(aw)},lsp:{DocumentHighlightProvider:So(JF),DocumentSymbolProvider:So(YF),SemanticTokenProvider:So(XF),HoverProvider:So(QF),CodeLensProvider:So(zF),DocumentLinkProvider:So(VF)},references:{ScopeComputation:So(dw),ScopeProvider:So(pw)}};o(HI,"createCustomLanguageServices");o(Oke,"createSharedServices");o(Mne,"_merge")});var zI=D(()=>{"use strict";yo();jne()});var yw,VI=D(()=>{yw={name:"likec4",version:"0.57.0",license:"MIT",homepage:"https://likec4.dev",author:"Denis Davydkov <denis@davydkov.com>",repository:{type:"git",url:"https://github.com/likec4/likec4.git",directory:"packages/likec4"},engines:{node:"^18.0.0 || >=20.0.0"},bugs:"https://github.com/likec4/likec4/issues",files:["bin","dist","!dist/@likec4/**/*.d.ts","!**/*.map"],type:"module",bin:"./bin/likec4.mjs",scripts:{"build:turbo":"run -T turbo run build --filter='likec4'","typecheck:app":"tsc --noEmit -p ./app/tsconfig.json","typecheck:cli":"tsc --noEmit -p ./tsconfig.src.json",typecheck:"run 'typecheck:cli' && run 'typecheck:app'",build:"tsx scripts/build.ts",prepack:"tsx scripts/prepack.ts",postpack:"tsx scripts/postpack.ts",lint:"run -T eslint src/ --fix",test:"run -T vitest run","test:watch":"run -T vitest",clean:"run -T rimraf dist app/dist dev/.export dev/dist node_modules/.vite",dev:"tsx watch src/cli/index.ts serve dev","dev:bigbank":"tsx watch src/cli/index.ts serve ../../docs/likec4/bigbank","dev:index-page":"tsx watch src/cli/index.ts serve ../../docs/likec4/index-page","dev:template":"tsx watch src/cli/index.ts serve ../create-likec4/template","dev:example":"tsx watch src/cli/index.ts serve ../../examples/diagrams-dev/likec4",cli:"tsx src/cli/index.ts","cli:serve":"tsx watch src/cli/index.ts serve dev","cli:build":"tsx src/cli/index.ts build -o dev/dist dev","cli:preview":"tsx src/cli/index.ts preview -o dev/dist dev","cli:export":"tsx src/cli/index.ts export png -o dev/export dev","cli:export:json":"tsx src/cli/index.ts export json -o dev/export/likec4.json dev"},dependencies:{"@nanostores/react":"^0.7.1","@nanostores/router":"^0.11.0","@radix-ui/react-icons":"^1.3.0","@radix-ui/themes":"^2.0.3","@react-hookz/web":"^24.0.4","@vitejs/plugin-react":"^4.2.1",autoprefixer:"^10.4.17",classnames:"^2.3.2",clsx:"^1.2.1",jotai:"^2.6.4",nanostores:"^0.9.5","playwright-core":"1.41.2",postcss:"^8.4.32","postcss-nested":"^6.0.1","prop-types":"^15.8.1",react:"^18.2.0","react-accessible-treeview":"^2.8.3","react-dom":"^18.2.0","react-resizable-panels":"^0.0.63",remeda:"^1.40.1",vite:"^5.0.12"},devDependencies:{"@likec4/core":"workspace:*","@likec4/diagrams":"workspace:*","@likec4/generators":"workspace:*","@likec4/language-server":"workspace:*","@likec4/layouts":"workspace:*","@types/mermaid":"^9.2.0","@types/node":"^20.11.17","@types/prop-types":"^15.7.11","@types/react":"^18.2.0","@types/react-dom":"^18.2.0","@types/yargs":"^17.0.32",boxen:"^7.1.1","ci-info":"^3.9.0",esbuild:"^0.19.9","esbuild-node-externals":"^1.12.0",execa:"^8.0.1","get-port":"^7.0.0",json5:"^2.2.3",mkdirp:"^3.0.1","p-queue":"^7.4.1",picocolors:"^1.0.0","pretty-ms":"^8.0.0","strip-indent":"^4.0.0",tsx:"^4.7.1","type-fest":"^4.10.2",typescript:"^5.3.3","typescript-plugin-css-modules":"^5.0.2",vitest:"^1.2.2",yargs:"^17.7.2"},publishConfig:{registry:"https://registry.npmjs.org",access:"public"},packageManager:"yarn@4.1.0",volta:{extends:"../../package.json"}}});function YI(t){return typeof t=="object"&&t!==null&&typeof t.id=="string"}function Ew(t){return typeof t=="object"&&t!==null&&t.$$type==="Node"&&typeof t.id=="string"}function qne(t){return Ew(t)||YI(t)}function Up(t){return typeof t=="string"||qne(t)}function Gne(t){return Array.isArray(t)&&t.every(Up)}function $ke(t){return["n","ne","e","se","s","sw","w","nw","c"].includes(t)}function QI(t){if(qne(t))return t;let[e,r,n]=t.split(":");return $ke(n)?{id:e,port:r,compass:n}:{id:e,port:r}}function Une(t){if(t.length<2&&(Up(t[0])&&Up(t[1]))===!1)throw Error("EdgeTargets must have at least 2 elements.");return t.map(e=>QI(e))}function XI(t){return Object.assign(Object.seal(Object.assign({},lD)),t)}var lD,Cw=D(()=>{"use strict";o(YI,"isForwardRefNode");o(Ew,"isNodeModel");o(qne,"isNodeRef");o(Up,"isNodeRefLike");o(Gne,"isNodeRefGroupLike");o($ke,"isCompass");o(QI,"toNodeRef");o(Une,"toNodeRefGroup");lD=Object.seal({Graph:null,Digraph:null,Subgraph:null,Node:null,Edge:null});o(XI,"createModelsContext")});function Bke(...t){let[e,...r]=t;return(...n)=>r.reduce((i,s)=>s(i),e(...n))}function Po(t,...e){return Bke(t,...e)}var Wne,Kne,is,Pbt,Hne=D(()=>{"use strict";o(Bke,"_pipe");o(Po,"pipe");Wne=o(t=>(...e)=>r=>t(r,...e),"defer"),Kne=o(t=>({[Symbol.iterator]:t}),"toIterable"),is=Wne((t,e)=>Array.from(Kne(function*(){for(let r of t)yield e(r)}))),Pbt=Wne((t,e)=>Array.from(Kne(function*(){for(let r of t)e(r)&&(yield r)})))});function Ts(t){return e=>e.join(t)}function Mke(t){return e=>t+e+t}function sc(t,e){return r=>t+r+e}function vw(t){return e=>t+e}function Vne(t,e){let r=new JI(e).print(t);if(!r)throw new Error;return r}function ww(t,e){if(typeof e=="string"){let r=e.trim();return/^<.+>$/ms.test(r)?Jt("Attribute",{key:Jt("Literal",{value:t,quoted:!1},[]),value:Jt("Literal",{value:r.slice(1,r.length-1),quoted:"html"},[])},[]):Jt("Attribute",{key:Jt("Literal",{value:t,quoted:!1},[]),value:Jt("Literal",{value:e,quoted:!0},[])},[])}return Jt("Attribute",{key:Jt("Literal",{value:t,quoted:!1},[]),value:Jt("Literal",{value:String(e),quoted:!1},[])},[])}function Al(t,e){return Jt("Comment",{kind:e,value:t},[])}function Yne(t,e){return Array.from(function*(){for(let[r,n]of e.values)yield ww(r,n);for(let r of Object.values(e.attributes))r.size>0&&(r.comment&&(yield Al(r.comment,t.commentKind)),yield t.convert(r));for(let r of e.nodes)r.comment&&(yield Al(r.comment,t.commentKind)),yield t.convert(r);for(let r of e.subgraphs)r.comment&&(yield Al(r.comment,t.commentKind)),yield t.convert(r);for(let r of e.edges)r.comment&&(yield Al(r.comment,t.commentKind)),yield t.convert(r)}())}function Qne(t,e){return new ZI(e).convert(t)}var Fw,Jt,Lke,zne,xw,fD,Tl,jke,qke,Gke,Uke,Wke,Kke,Hke,zke,Vke,Yke,Qke,Xke,Jke,Zke,JI,eIe,tIe,rIe,nIe,iIe,oIe,ZI,Xne=D(()=>{"use strict";Hne();Cw();Fw=class{static{o(this,"Builder")}options;getLocation(){return this.options?.locationFunction?.()??null}constructor(e){this.options=e}createElement(e,r,n=[]){return{location:this.getLocation(),...r,type:e,children:n}}},Jt=Fw.prototype.createElement.bind(new Fw),Lke=/\r?\n/;o(Ts,"joinBy");o(Mke,"wrapWith");o(sc,"wrapByPair");o(vw,"leftPadWith");zne=o(t=>t.replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/"/g,'\\"'),"escape"),xw=o(t=>t.split(Lke),"splitByLine"),fD=o((t,e,r)=>Po(xw,is(vw(t==="space"?" ".repeat(e):`
|
|
214
|
+
`)}`),await s.update(c,f,a)}),n.onRequest(une,u=>{if("element"in u)return r.locateElement(u.element,u.property??"name");if("relation"in u)return r.locateRelation(u.relation);if("view"in u)return r.locateView(u.view);qr(u)})}}});var hw,lne=D(()=>{"use strict";Dr();ir();vv();hw=class extends Np{static{o(this,"LikeC4WorkspaceManager")}loadAdditionalDocuments(e,r){return Promise.resolve()}workspace(){return this.folders&&(0,ph.hasAtLeast)(this.folders,1)?this.folders[0]:null}get workspaceUri(){let e=this.workspace();return gt(e,"Workspace not initialized"),In.parse(e.uri)}get workspaceURL(){let e=this.workspace();return gt(e,"Workspace not initialized"),new URL(e.uri)}}});var rn,gw,fne=D(()=>{"use strict";ir();rn=le(Cr(),1);yn();gw=class{constructor(e){this.services=e}static{o(this,"NodeKindProvider")}getSymbolKind(e){let r=o(n=>"type"in e&&this.services.AstReflection.isSubtype(e.type,n),"hasType");switch(!0){case(oe.isElement(e)||r(oe.Element)||oe.isExtendElement(e)||r(oe.ExtendElement)):return rn.SymbolKind.Constructor;case(oe.isModel(e)||oe.isModelViews(e)||oe.isSpecificationRule(e)||r(oe.Model)||r(oe.ModelViews)||r(oe.SpecificationRule)):return rn.SymbolKind.Namespace;case(oe.isElementView(e)||r(oe.ElementView)):return rn.SymbolKind.Class;case(oe.isTag(e)||r(oe.Tag)||oe.isSpecificationTag(e)||r(oe.SpecificationTag)):return rn.SymbolKind.EnumMember;case(oe.isRelationshipKind(e)||r(oe.RelationshipKind)||oe.isSpecificationRelationshipKind(e)||r(oe.SpecificationRelationshipKind)):return rn.SymbolKind.Event;case(oe.isElementKind(e)||r(oe.ElementKind)||oe.isSpecificationElementKind(e)||r(oe.SpecificationElementKind)):return rn.SymbolKind.TypeParameter}return rn.SymbolKind.Constant}getCompletionItemKind(e){switch(this.getSymbolKind(e)){case rn.SymbolKind.Constructor:return rn.CompletionItemKind.Constructor;case rn.SymbolKind.Namespace:return rn.CompletionItemKind.Module;case rn.SymbolKind.Class:return rn.CompletionItemKind.Class;case rn.SymbolKind.EnumMember:return rn.CompletionItemKind.EnumMember;case rn.SymbolKind.TypeParameter:return rn.CompletionItemKind.TypeParameter;case rn.SymbolKind.Interface:return rn.CompletionItemKind.Interface;case rn.SymbolKind.Event:return rn.CompletionItemKind.Event;default:return rn.CompletionItemKind.Keyword}}}});var Dw,dne=D(()=>{"use strict";ir();Dw=class extends Id{static{o(this,"WorkspaceSymbolProvider")}}});var pne=D(()=>{"use strict";lne();fne();dne()});var mne,hne=D(()=>{"use strict";ir();mne=o(t=>{let e=t.likec4.FqnIndex;return(r,n)=>{let i=e.getFqn(r);if(!i){n("error","Not indexed element",{node:r,property:"name"});return}let s=e.byFqn(i).filter(u=>u.el!==r).head();s&&n("error",`Duplicate element name ${r.name!==i?r.name+" ("+i+")":r.name}`,{node:r,property:"name",relatedInformation:[{location:{range:s.el.$cstNode.range,uri:tt(s.el).uri.toString()},message:"Already defined here"}]})}},"elementChecks")});var gne,Dne=D(()=>{"use strict";Dr();yn();wl();yo();gne=o(t=>{let e=t.likec4.FqnIndex;return(r,n)=>{try{let i=ao(r.target),s=i&&e.getFqn(i);s||n("error","Target not found (not parsed/indexed yet)",{node:r,property:"target"});let u;if(oe.isExplicitRelation(r)){if(u=ao(r.source),!u)return n("error","Source not found (not parsed/indexed yet)",{node:r,property:"source"})}else u=r.$container.$container;let a=e.getFqn(u);a||n("error","Source not found (not parsed/indexed yet)",{node:r}),a&&s&&gh(a,s)&&n("error","Invalid parent-child relationship",{node:r}),r.tags?.value&&r.body?.tags?.value&&n("error","Relation cannot have tags in both header and body",{node:r,property:"tags"})}catch(i){Er(i)}}},"relationChecks")});var yne,Ene,Cne,vne,xne,Fne,wne=D(()=>{"use strict";yn();yne=o(t=>(e,r)=>{e.$containerIndex&&e.$containerIndex>0&&r("error","Only one specification per document is allowed",{node:e,property:"name"})},"specificationRuleChecks"),Ene=o(t=>(e,r)=>{e.$containerIndex&&e.$containerIndex>0&&r("error","Only one model per document is allowed",{node:e,property:"name"})},"modelRuleChecks"),Cne=o(t=>(e,r)=>{e.$containerIndex&&e.$containerIndex>0&&r("error","Only one views block per document is allowed",{node:e,property:"name"})},"modelViewsChecks"),vne=o(t=>{let e=t.shared.workspace.IndexManager;return(r,n)=>{e.allElements(oe.ElementKind).filter(s=>s.name===r.name).limit(2).count()>1&&n("error",`Duplicate element kind '${r.name}'`,{node:r,property:"name"})}},"elementKindChecks"),xne=o(t=>{let e=t.shared.workspace.IndexManager;return(r,n)=>{let i="#"+r.name;e.allElements(oe.Tag).filter(u=>u.name===i).limit(2).count()>1&&n("error",`Duplicate tag '${r.name}'`,{node:r,property:"name"})}},"tagChecks"),Fne=o(t=>{let e=t.shared.workspace.IndexManager;return(r,n)=>{e.allElements(oe.RelationshipKind).filter(s=>s.name===r.name).limit(2).count()>1&&n("error",`Duplicate RelationshipKind '${r.name}'`,{node:r,property:"name"})}},"relationshipChecks")});var bne,Rne=D(()=>{"use strict";yn();bne=o(t=>{let e=t.shared.workspace.IndexManager;return(r,n)=>{if(r.extends,!r.name)return;e.allElements(oe.ElementView).filter(s=>s.name===r.name).limit(2).count()>1&&n("error",`Duplicate view '${r.name}'`,{node:r,property:"name"})}},"viewChecks")});var Ane,Tne,_ne=D(()=>{"use strict";yn();Ane=le(Tr(),1),Tne=o(t=>(e,r)=>{if(oe.isWildcardExpr(e.to)&&oe.isViewRulePredicate(e.$container)){let n=e.$container.$container.$container;(0,Ane.isNil)(n.viewOf)&&r("warning","Predicate is ignored as it concerns all relationships",{node:e})}},"incomingExpressionChecks")});var Sne,Pne,kne=D(()=>{"use strict";yn();Sne=le(Tr(),1),Pne=o(t=>(e,r)=>{if(oe.isWildcardExpr(e.from)){let n=e.$container.$container.$container;(0,Sne.isNil)(n.viewOf)&&r("warning","Predicate is ignored as it concerns all relationships",{node:e})}},"outgoingExpressionChecks")});var Ine,One=D(()=>{"use strict";yn();Ine=o(t=>(e,r)=>{oe.isExcludePredicate(e.$container)&&r("error",'Invalid inside "exclude"',{node:e}),oe.isElementRef(e.target)||r("error","Invalid target for customization",{node:e,property:"target"})},"customElementExprChecks")});var Nne=D(()=>{"use strict";_ne();kne();One()});function $ne(t){yr.info("registerValidationChecks"),t.validation.ValidationRegistry.register({SpecificationRule:yne(t),Model:Ene(t),ModelViews:Cne(t),ElementView:bne(t),Element:mne(t),ElementKind:vne(t),Relation:gne(t),Tag:xne(t),CustomElementExpr:Ine(t),RelationshipKind:Fne(t),IncomingExpr:Tne(t),OutgoingExpr:Pne(t)},"slow");let r=t.shared.lsp.Connection;r&&t.shared.workspace.DocumentBuilder.onUpdate((n,i)=>{for(let s of i)r.sendDiagnostics({uri:s.toString(),diagnostics:[]})})}var Bne=D(()=>{"use strict";yn();yo();hne();Dne();wne();Rne();Nne();o($ne,"registerValidationChecks")});function So(t){return e=>new t(e)}function HI(t,e,r,n){let i=Oke(t),s=[ug({shared:i}),qee,Lne,e,r,n].reduce(Mne,{}),u=Yc(s);return i.ServiceRegistry.register(u),$ne(u),u.Rpc.init(),{shared:i,likec4:u}}function Oke(t={}){let e=t.connection;if(e){let n=yr.error.bind(yr);yr.error=i=>{if(typeof i=="string"){n(i),e.telemetry.logEvent({eventName:"error",error:i});return}let s=da(i);n(s),e.telemetry.logEvent({eventName:"error",error:s.stack??s.message})}}let r={...bx,...t};return Yc(ag(r),jee,Ike)}function Mne(t,e){if(e){for(let[r,n]of Object.entries(e))if(n!==void 0){let i=t[r];i!==null&&n!==null&&typeof i=="object"&&typeof n=="object"?t[r]=Mne(i,n):t[r]=n}}return t}var Ike,Lne,jne=D(()=>{"use strict";Dr();ir();CI();yo();ute();Vre();Jre();cne();pne();Bne();Ike={lsp:{NodeKindProvider:t=>new gw(t),WorkspaceSymbolProvider:t=>new Dw(t)},workspace:{WorkspaceManager:t=>new hw(t)}};o(So,"bind");Lne={WorkspaceCache:t=>new Fd(t.shared),Rpc:So(mw),likec4:{FqnIndex:So(ew),ModelParser:So(fw),ModelBuilder:So(uw),ModelLocator:So(aw)},lsp:{DocumentHighlightProvider:So(JF),DocumentSymbolProvider:So(YF),SemanticTokenProvider:So(XF),HoverProvider:So(QF),CodeLensProvider:So(zF),DocumentLinkProvider:So(VF)},references:{ScopeComputation:So(dw),ScopeProvider:So(pw)}};o(HI,"createCustomLanguageServices");o(Oke,"createSharedServices");o(Mne,"_merge")});var zI=D(()=>{"use strict";yo();jne()});var yw,VI=D(()=>{yw={name:"likec4",version:"0.57.1",license:"MIT",homepage:"https://likec4.dev",author:"Denis Davydkov <denis@davydkov.com>",repository:{type:"git",url:"https://github.com/likec4/likec4.git",directory:"packages/likec4"},engines:{node:"^18.0.0 || >=20.0.0"},bugs:"https://github.com/likec4/likec4/issues",files:["bin","dist","!dist/@likec4/**/*.d.ts","!**/*.map"],type:"module",bin:"./bin/likec4.mjs",scripts:{"build:turbo":"run -T turbo run build --filter='likec4'","typecheck:app":"tsc --noEmit -p ./app/tsconfig.json","typecheck:cli":"tsc --noEmit -p ./tsconfig.src.json",typecheck:"run 'typecheck:cli' && run 'typecheck:app'",build:"tsx scripts/build.ts",prepack:"tsx scripts/prepack.ts",postpack:"tsx scripts/postpack.ts",lint:"run -T eslint src/ --fix",test:"run -T vitest run","test:watch":"run -T vitest",clean:"run -T rimraf dist app/dist dev/.export dev/dist node_modules/.vite",dev:"tsx watch src/cli/index.ts serve dev","dev:bigbank":"tsx watch src/cli/index.ts serve ../../docs/likec4/bigbank","dev:index-page":"tsx watch src/cli/index.ts serve ../../docs/likec4/index-page","dev:template":"tsx watch src/cli/index.ts serve ../create-likec4/template","dev:example":"tsx watch src/cli/index.ts serve ../../examples/diagrams-dev/likec4",cli:"tsx src/cli/index.ts","cli:serve":"tsx watch src/cli/index.ts serve dev","cli:build":"tsx src/cli/index.ts build -o dev/dist dev","cli:preview":"tsx src/cli/index.ts preview -o dev/dist dev","cli:export":"tsx src/cli/index.ts export png -o dev/export dev","cli:export:json":"tsx src/cli/index.ts export json -o dev/export/likec4.json dev"},dependencies:{"@nanostores/react":"^0.7.1","@nanostores/router":"^0.11.0","@radix-ui/react-icons":"^1.3.0","@radix-ui/themes":"^2.0.3","@react-hookz/web":"^24.0.4","@vitejs/plugin-react":"^4.2.1",autoprefixer:"^10.4.17",classnames:"^2.3.2",clsx:"^1.2.1",jotai:"^2.6.4",nanostores:"^0.9.5","playwright-core":"1.41.2",postcss:"^8.4.32","postcss-nested":"^6.0.1","prop-types":"^15.8.1",react:"^18.2.0","react-accessible-treeview":"^2.8.3","react-dom":"^18.2.0","react-resizable-panels":"^0.0.63",remeda:"^1.40.1",vite:"^5.0.12"},devDependencies:{"@likec4/core":"workspace:*","@likec4/diagrams":"workspace:*","@likec4/generators":"workspace:*","@likec4/language-server":"workspace:*","@likec4/layouts":"workspace:*","@types/mermaid":"^9.2.0","@types/node":"^20.11.17","@types/prop-types":"^15.7.11","@types/react":"^18.2.0","@types/react-dom":"^18.2.0","@types/yargs":"^17.0.32",boxen:"^7.1.1","ci-info":"^3.9.0",esbuild:"^0.19.9","esbuild-node-externals":"^1.12.0",execa:"^8.0.1","get-port":"^7.0.0",json5:"^2.2.3",mkdirp:"^3.0.1","p-queue":"^7.4.1",picocolors:"^1.0.0","pretty-ms":"^8.0.0","strip-indent":"^4.0.0",tsx:"^4.7.1","type-fest":"^4.10.2",typescript:"^5.3.3","typescript-plugin-css-modules":"^5.0.2",vitest:"^1.2.2",yargs:"^17.7.2"},publishConfig:{registry:"https://registry.npmjs.org",access:"public"},packageManager:"yarn@4.1.0",volta:{extends:"../../package.json"}}});function YI(t){return typeof t=="object"&&t!==null&&typeof t.id=="string"}function Ew(t){return typeof t=="object"&&t!==null&&t.$$type==="Node"&&typeof t.id=="string"}function qne(t){return Ew(t)||YI(t)}function Up(t){return typeof t=="string"||qne(t)}function Gne(t){return Array.isArray(t)&&t.every(Up)}function $ke(t){return["n","ne","e","se","s","sw","w","nw","c"].includes(t)}function QI(t){if(qne(t))return t;let[e,r,n]=t.split(":");return $ke(n)?{id:e,port:r,compass:n}:{id:e,port:r}}function Une(t){if(t.length<2&&(Up(t[0])&&Up(t[1]))===!1)throw Error("EdgeTargets must have at least 2 elements.");return t.map(e=>QI(e))}function XI(t){return Object.assign(Object.seal(Object.assign({},lD)),t)}var lD,Cw=D(()=>{"use strict";o(YI,"isForwardRefNode");o(Ew,"isNodeModel");o(qne,"isNodeRef");o(Up,"isNodeRefLike");o(Gne,"isNodeRefGroupLike");o($ke,"isCompass");o(QI,"toNodeRef");o(Une,"toNodeRefGroup");lD=Object.seal({Graph:null,Digraph:null,Subgraph:null,Node:null,Edge:null});o(XI,"createModelsContext")});function Bke(...t){let[e,...r]=t;return(...n)=>r.reduce((i,s)=>s(i),e(...n))}function Po(t,...e){return Bke(t,...e)}var Wne,Kne,is,Pbt,Hne=D(()=>{"use strict";o(Bke,"_pipe");o(Po,"pipe");Wne=o(t=>(...e)=>r=>t(r,...e),"defer"),Kne=o(t=>({[Symbol.iterator]:t}),"toIterable"),is=Wne((t,e)=>Array.from(Kne(function*(){for(let r of t)yield e(r)}))),Pbt=Wne((t,e)=>Array.from(Kne(function*(){for(let r of t)e(r)&&(yield r)})))});function Ts(t){return e=>e.join(t)}function Mke(t){return e=>t+e+t}function sc(t,e){return r=>t+r+e}function vw(t){return e=>t+e}function Vne(t,e){let r=new JI(e).print(t);if(!r)throw new Error;return r}function ww(t,e){if(typeof e=="string"){let r=e.trim();return/^<.+>$/ms.test(r)?Jt("Attribute",{key:Jt("Literal",{value:t,quoted:!1},[]),value:Jt("Literal",{value:r.slice(1,r.length-1),quoted:"html"},[])},[]):Jt("Attribute",{key:Jt("Literal",{value:t,quoted:!1},[]),value:Jt("Literal",{value:e,quoted:!0},[])},[])}return Jt("Attribute",{key:Jt("Literal",{value:t,quoted:!1},[]),value:Jt("Literal",{value:String(e),quoted:!1},[])},[])}function Al(t,e){return Jt("Comment",{kind:e,value:t},[])}function Yne(t,e){return Array.from(function*(){for(let[r,n]of e.values)yield ww(r,n);for(let r of Object.values(e.attributes))r.size>0&&(r.comment&&(yield Al(r.comment,t.commentKind)),yield t.convert(r));for(let r of e.nodes)r.comment&&(yield Al(r.comment,t.commentKind)),yield t.convert(r);for(let r of e.subgraphs)r.comment&&(yield Al(r.comment,t.commentKind)),yield t.convert(r);for(let r of e.edges)r.comment&&(yield Al(r.comment,t.commentKind)),yield t.convert(r)}())}function Qne(t,e){return new ZI(e).convert(t)}var Fw,Jt,Lke,zne,xw,fD,Tl,jke,qke,Gke,Uke,Wke,Kke,Hke,zke,Vke,Yke,Qke,Xke,Jke,Zke,JI,eIe,tIe,rIe,nIe,iIe,oIe,ZI,Xne=D(()=>{"use strict";Hne();Cw();Fw=class{static{o(this,"Builder")}options;getLocation(){return this.options?.locationFunction?.()??null}constructor(e){this.options=e}createElement(e,r,n=[]){return{location:this.getLocation(),...r,type:e,children:n}}},Jt=Fw.prototype.createElement.bind(new Fw),Lke=/\r?\n/;o(Ts,"joinBy");o(Mke,"wrapWith");o(sc,"wrapByPair");o(vw,"leftPadWith");zne=o(t=>t.replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/"/g,'\\"'),"escape"),xw=o(t=>t.split(Lke),"splitByLine"),fD=o((t,e,r)=>Po(xw,is(vw(t==="space"?" ".repeat(e):`
|
|
215
215
|
`)),Ts(r)),"indent"),Tl=o(t=>{switch(t){case"crlf":return`\r
|
|
216
216
|
`;case"lf":return`
|
|
217
217
|
`}},"endOfLine"),jke={match(t){return t.type==="AttributeList"},print(t,e){if(e.children.length===0)return`${e.kind.toLocaleLowerCase()} [];`;let r=Tl(t.endOfLine);return Po(is(t.print),Ts(r),fD(t.indentStyle,t.indentSize,r),sc(`${e.kind.toLocaleLowerCase()} [${r}`,`${r}];`))(e.children)}},qke={match(t){return t.type==="Attribute"},print(t,e){return`${t.print(e.key)} = ${t.print(e.value)};`}},Gke={match(t){return t.type==="Comment"},print(t,e){let r=Tl(t.endOfLine);switch(e.kind){case"Block":return Po(xw,is(vw(" * ")),Ts(r),sc(`/**${r}`,`${r} */`))(e.value);case"Macro":return Po(xw,is(vw("# ")),Ts(r))(e.value);case"Slash":default:return Po(xw,is(vw("// ")),Ts(r))(e.value)}}},Uke={match(t){return t.type==="Dot"},print(t,e){return e.children.map(t.print).join(Tl(t.endOfLine))}},Wke={match(t){return t.type==="Edge"},print(t,e){let r=Po(is(t.print),Ts(t.directed?" -> ":" -- "))(e.targets);if(e.children.length===0)return`${r};`;let n=Tl(t.endOfLine),i=Po(is(t.print),Ts(n),fD(t.indentStyle,t.indentSize,n),sc(`[${n}`,`${n}];`))(e.children);return`${r} ${i}`}},Kke={match(t){return t.type==="Graph"},print(t,e){t.directed=e.directed;let r=[];if(e.strict&&r.push("strict"),r.push(e.directed?"digraph":"graph"),e.id&&r.push(t.print(e.id)),e.children.length===0)return`${r.join(" ")} {}`;let n=Tl(t.endOfLine),i=Po(is(t.print),Ts(n),fD(t.indentStyle,t.indentSize,n),sc(`{${n}`,`${n}}`))(e.children);return`${r.join(" ")} ${i}`}},Hke=Po(zne,Mke('"')),zke=sc("<",">"),Vke={match(t){return t.type==="Literal"},print(t,e){switch(e.quoted){case"html":return zke(e.value);case!0:return Hke(e.value);case!1:default:return zne(e.value)}}},Yke={match(t){return t.type==="Node"},print(t,e){let r=t.print(e.id);if(e.children.length===0)return`${r};`;let n=Tl(t.endOfLine),i=Po(is(t.print),Ts(n),fD(t.indentStyle,t.indentSize,n),sc(`[${n}`,`${n}];`))(e.children);return`${r} ${i}`}},Qke={match(t){return t.type==="NodeRefGroup"},print(t,e){return Po(is(t.print),Ts(" "),sc("{","}"))(e.children)}},Xke={match(t){return t.type==="NodeRef"},print(t,e){let r=[t.print(e.id)];return e.port&&r.push(t.print(e.port)),e.compass&&r.push(t.print(e.compass)),r.join(":")}},Jke={match(t){return t.type==="Subgraph"},print(t,e){let r=["subgraph"];if(e.id&&r.push(t.print(e.id)),e.children.length===0)return`${r.join(" ")} {}`;let n=Tl(t.endOfLine),i=Po(is(t.print),Ts(n),fD(t.indentStyle,t.indentSize,n),sc(`{${n}`,`${n}}`))(e.children);return`${r.join(" ")} ${i}`}},Zke=[jke,qke,Gke,Uke,Wke,Kke,Vke,Yke,Qke,Xke,Jke],JI=class{static{o(this,"Printer")}options;#e=[...Zke];constructor(e={}){this.options=e}print(e){let r=[...this.#e],{indentSize:n=2,indentStyle:i="space",endOfLine:s="lf"}=this.options,u={directed:!0,indentSize:n,indentStyle:i,endOfLine:s,print(a){for(let c of r)if(c.match(a))return c.print(u,a);throw Error()}};return u.print(e)}};o(Vne,"stringify");o(ww,"convertAttribute");o(Al,"convertComment");o(Yne,"convertClusterChildren");eIe={match(t){return t.$$type==="AttributeList"},convert(t,e){return Jt("AttributeList",{kind:e.$$kind},e.values.map(([r,n])=>ww(r,n)))}},tIe={match(t){return t.$$type==="Edge"},convert(t,e){return Jt("Edge",{targets:e.targets.map(r=>Ew(r)?Jt("NodeRef",{id:Jt("Literal",{value:r.id,quoted:!0},[])},[]):YI(r)?Jt("NodeRef",{id:Jt("Literal",{value:r.id,quoted:!0},[]),port:r.port?Jt("Literal",{value:r.port,quoted:!0},[]):void 0,compass:r.compass?Jt("Literal",{value:r.compass,quoted:!0},[]):void 0},[]):Jt("NodeRefGroup",{},r.map(n=>Ew(n)?Jt("NodeRef",{id:Jt("Literal",{value:n.id,quoted:!0},[])},[]):Jt("NodeRef",{id:Jt("Literal",{value:n.id,quoted:!0},[]),port:n.port?Jt("Literal",{value:n.port,quoted:!0},[]):void 0,compass:n.compass?Jt("Literal",{value:n.compass,quoted:!0},[]):void 0},[]))))},[...e.attributes.comment?[Al(e.attributes.comment,t.commentKind)]:[],...e.attributes.values.map(([r,n])=>ww(r,n))])}},rIe={match(t){return t.$$type==="Graph"},convert(t,e){return Jt("Dot",{},[...e.comment?[Al(e.comment,t.commentKind)]:[],Jt("Graph",{directed:e.directed,strict:e.strict,id:e.id?Jt("Literal",{value:e.id,quoted:!0},[]):void 0},Yne(t,e))])}},nIe={match(t){return t.$$type==="Node"},convert(t,e){return Jt("Node",{id:Jt("Literal",{value:e.id,quoted:!0},[])},[...e.attributes.comment?[Al(e.attributes.comment,t.commentKind)]:[],...e.attributes.values.map(([r,n])=>ww(r,n))])}},iIe={match(t){return t.$$type==="Subgraph"},convert(t,e){return Jt("Subgraph",{id:e.id?Jt("Literal",{value:e.id,quoted:!0},[]):void 0},Yne(t,e))}},oIe=[eIe,tIe,nIe,rIe,iIe],ZI=class{static{o(this,"FromModelConverter")}options;#e=[...oIe];constructor(e={}){this.options=e}convert(e){let r=[...this.#e],{commentKind:n="Slash"}=this.options,i={commentKind:n,convert(s){for(let u of r)if(u.match(s))return u.convert(i,s);throw Error()}};return i.convert(e)}};o(Qne,"fromModel")});function Jne(t,e){return(...r)=>{let n=t?this.Digraph:this.Graph,i=r.find(c=>typeof c=="string"),s=r.find(c=>typeof c=="object"),u=r.find(c=>typeof c=="function"),a=new n(i,e,s);return a.with(this),typeof u=="function"&&u(a),a}}function Zne(t,e=lD){return Object.freeze({digraph:Jne.call(e,!0,t),graph:Jne.call(e,!1,t)})}function rie(t,e){let r=Qne(t,e?.convert);return Vne(r,e?.print)}var Ee,pD,mD,dD,bw,Rw,e3,t3,r3,Aw,n3,i3,eie,tie,Gbt,Ubt,nie=D(()=>{"use strict";Cw();Xne();Ee=new Proxy(Object.freeze({}),{get:(t,e)=>e}),pD=class{static{o(this,"DotObject")}},mD=class extends pD{static{o(this,"AttributesBase")}#e=new Map;constructor(e){super(),e!==void 0&&this.apply(e)}get values(){return Array.from(this.#e.entries())}get size(){return this.#e.size}get(e){return this.#e.get(e)}set(e,r){r!=null&&this.#e.set(e,r)}delete(e){this.#e.delete(e)}apply(e){let r=Array.isArray(e)?e:Object.entries(e);for(let[n,i]of r)this.set(n,i)}clear(){this.#e.clear()}},dD=class extends mD{static{o(this,"AttributeList")}$$kind;get $$type(){return"AttributeList"}comment;constructor(e,r){super(r),this.$$kind=e}},bw=class extends mD{static{o(this,"GraphBase")}#e=lD;id;comment;attributes=Object.freeze({graph:new dD("Graph"),edge:new dD("Edge"),node:new dD("Node")});get nodes(){return Array.from(this.#t.nodes.values())}get edges(){return Array.from(this.#t.edges.values())}get subgraphs(){return Array.from(this.#t.subgraphs.values())}#t={nodes:new Map,edges:new Set,subgraphs:new Set};with(e){this.#e=XI(e)}addNode(e){this.#t.nodes.set(e.id,e)}addEdge(e){this.#t.edges.add(e)}addSubgraph(e){this.#t.subgraphs.add(e)}existNode(e){return this.#t.nodes.has(e)}existEdge(e){return this.#t.edges.has(e)}existSubgraph(e){return this.#t.subgraphs.has(e)}createSubgraph(...e){let r=new this.#e.Subgraph(...e);return r.with(this.#e),this.addSubgraph(r),r}removeNode(e){this.#t.nodes.delete(typeof e=="string"?e:e.id)}removeEdge(e){this.#t.edges.delete(e)}removeSubgraph(e){this.#t.subgraphs.delete(e)}createNode(e,r){let n=new this.#e.Node(e,r);return this.addNode(n),n}getSubgraph(e){return Array.from(this.#t.subgraphs.values()).find(r=>r.id===e)}getNode(e){return this.#t.nodes.get(e)}createEdge(e,r){let n=e.map(s=>Gne(s)?Une(s):QI(s)),i=new this.#e.Edge(n,r);return this.addEdge(i),i}subgraph(...e){let r=e.find(u=>typeof u=="string"),n=e.find(u=>typeof u=="object"&&u!==null),i=e.find(u=>typeof u=="function"),s=r?this.getSubgraph(r)??this.createSubgraph(r):this.createSubgraph();return n!==void 0&&s.apply(n),i!==void 0&&i(s),s}node(e,...r){if(typeof e=="string"){let n=e,i=r.find(a=>typeof a=="object"&&a!==null),s=r.find(a=>typeof a=="function"),u=this.getNode(n)??this.createNode(n);return i!==void 0&&u.attributes.apply(i),s!==void 0&&s(u),u}typeof e=="object"&&e!==null&&this.attributes.node.apply(e)}edge(e,...r){if(Array.isArray(e)){let n=e,i=r.find(a=>typeof a=="object"),s=r.find(a=>typeof a=="function"),u=this.createEdge(n,i);return s!==void 0&&s(u),u}typeof e=="object"&&e!==null&&this.attributes.edge.apply(e)}graph(e){this.attributes.graph.apply(e)}},Rw=class extends bw{static{o(this,"RootGraph")}get $$type(){return"Graph"}id;strict;constructor(...e){super(),this.id=e.find(n=>typeof n=="string"),this.strict=e.find(n=>typeof n=="boolean")??!1;let r=e.find(n=>typeof n=="object"&&n!==null);r!==void 0&&this.apply(r)}},e3=class extends Rw{static{o(this,"Digraph")}get directed(){return!0}},t3=class extends Rw{static{o(this,"Graph")}get directed(){return!1}},r3=class extends bw{static{o(this,"Subgraph")}get $$type(){return"Subgraph"}id;constructor(...e){super(),this.id=e.find(n=>typeof n=="string");let r=e.find(n=>typeof n=="object"&&n!==null);r!==void 0&&this.apply(r)}isSubgraphCluster(){return typeof this.id=="string"?this.id.startsWith("cluster"):!1}},Aw=class extends mD{static{o(this,"AttributesGroup")}comment},n3=class extends pD{static{o(this,"Node")}id;get $$type(){return"Node"}comment;attributes;constructor(e,r){super(),this.id=e,this.attributes=new Aw(r)}port(e){return typeof e=="string"?{id:this.id,port:e}:{id:this.id,...e}}},i3=class extends pD{static{o(this,"Edge")}targets;get $$type(){return"Edge"}comment;attributes;constructor(e,r){if(super(),this.targets=e,e.length<2&&(Up(e[0])&&Up(e[1]))===!1)throw Error("The element of Edge target is missing or not satisfied as Edge target.");this.attributes=new Aw(r)}};Object.assign(lD,{Graph:t3,Digraph:e3,Subgraph:r3,Node:n3,Edge:i3});o(Jne,"ModelFactoryBuilder");o(Zne,"createModelFactories");eie=Zne(!1),tie=eie.digraph,Gbt=eie.graph,Ubt=Zne(!0);o(rie,"toDot")});var iie=D(()=>{"use strict";Cw();nie()});var sie=I((Ybt,oie)=>{"use strict";function sIe(t){let e=t.length-1,r=t[e];for(;r===" "||r===" ";)r=t[--e];return t.substring(0,e+1)}o(sIe,"trimEnd");function uIe(t){return t.split(`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "likec4",
|
|
3
|
-
"version": "0.57.
|
|
3
|
+
"version": "0.57.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"homepage": "https://likec4.dev",
|
|
6
6
|
"author": "Denis Davydkov <denis@davydkov.com>",
|
|
@@ -79,11 +79,11 @@
|
|
|
79
79
|
"vite": "^5.0.12"
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
|
-
"@likec4/core": "0.57.
|
|
83
|
-
"@likec4/diagrams": "0.57.
|
|
84
|
-
"@likec4/generators": "0.57.
|
|
85
|
-
"@likec4/language-server": "0.57.
|
|
86
|
-
"@likec4/layouts": "0.57.
|
|
82
|
+
"@likec4/core": "0.57.1",
|
|
83
|
+
"@likec4/diagrams": "0.57.1",
|
|
84
|
+
"@likec4/generators": "0.57.1",
|
|
85
|
+
"@likec4/language-server": "0.57.1",
|
|
86
|
+
"@likec4/layouts": "0.57.1",
|
|
87
87
|
"@types/mermaid": "^9.2.0",
|
|
88
88
|
"@types/node": "^20.11.17",
|
|
89
89
|
"@types/prop-types": "^15.7.11",
|
package/dist/__app__/App.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { Sidebar } from './sidebar/Sidebar';
|
|
2
|
-
export { ViewActions } from './view-page/ViewActions';
|
|
3
|
-
export { ThemePanelToggle } from './ThemePanelToggle';
|
|
4
|
-
export { DiagramNotFound } from './DiagramNotFound';
|
|
5
|
-
export { CopyToClipboard } from './CopyToClipboard';
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { DiagramView } from '@likec4/diagrams';
|
|
3
|
-
type Props = {
|
|
4
|
-
diagram: DiagramView;
|
|
5
|
-
onCompleted: () => void;
|
|
6
|
-
};
|
|
7
|
-
declare const ExportDiagram: import("react").MemoExoticComponent<({ diagram, onCompleted }: Props) => JSX.Element>;
|
|
8
|
-
export default ExportDiagram;
|
|
9
|
-
//# sourceMappingURL=ExportDiagram.d.ts.map
|
package/dist/__app__/const.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { DiagramView } from '@likec4/core';
|
|
2
|
-
export declare const viewsAtom: import("jotai").WritableAtom<import("rambdax").Dictionary<import("jotai").WritableAtom<DiagramView, [DiagramView], void>>, [update: Record<LikeC4ViewId, DiagramView>], void>;
|
|
3
|
-
export declare const diagramsTreeAtom: import("jotai").Atom<import("react-accessible-treeview").INode<import("react-accessible-treeview/dist/TreeView/utils").IFlatMetadata>[]>;
|
|
4
|
-
export declare const selectLikeC4ViewAtom: (viewId: string) => import("jotai").Atom<DiagramView | null>;
|
|
5
|
-
//# sourceMappingURL=atoms.d.ts.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { type ViewsGroup } from './index-page';
|
|
2
|
-
export declare const useLikeC4View: (viewId: string) => import("@likec4/core").DiagramView | null;
|
|
3
|
-
export declare const useDiagramsTree: () => import("react-accessible-treeview").INode<import("react-accessible-treeview/dist/TreeView/utils").IFlatMetadata>[];
|
|
4
|
-
export type { ViewsGroup };
|
|
5
|
-
export declare const useViewGroupsAtoms: () => import("jotai").Atom<{
|
|
6
|
-
path: string;
|
|
7
|
-
isRoot: boolean;
|
|
8
|
-
views: [import("jotai").WritableAtom<import("@likec4/core").DiagramView, [import("@likec4/core").DiagramView], void>, ...import("jotai").WritableAtom<import("@likec4/core").DiagramView, [import("@likec4/core").DiagramView], void>[]];
|
|
9
|
-
}>[];
|
|
10
|
-
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { ExtractAtomValue } from 'jotai';
|
|
2
|
-
/**
|
|
3
|
-
* Views grouped by folder
|
|
4
|
-
*/
|
|
5
|
-
declare const viewGroupsAtom: import("jotai").Atom<{
|
|
6
|
-
path: string;
|
|
7
|
-
isRoot: boolean;
|
|
8
|
-
views: [import("jotai").WritableAtom<import("@likec4/core").DiagramView, [import("@likec4/core").DiagramView], void>, ...import("jotai").WritableAtom<import("@likec4/core").DiagramView, [import("@likec4/core").DiagramView], void>[]];
|
|
9
|
-
}[]>;
|
|
10
|
-
export type ViewsGroup = ExtractAtomValue<typeof viewGroupsAtom>[number];
|
|
11
|
-
export declare const viewsGroupAtomsAtom: import("jotai").Atom<import("jotai").Atom<{
|
|
12
|
-
path: string;
|
|
13
|
-
isRoot: boolean;
|
|
14
|
-
views: [import("jotai").WritableAtom<import("@likec4/core").DiagramView, [import("@likec4/core").DiagramView], void>, ...import("jotai").WritableAtom<import("@likec4/core").DiagramView, [import("@likec4/core").DiagramView], void>[]];
|
|
15
|
-
}>[]>;
|
|
16
|
-
export {};
|
|
17
|
-
//# sourceMappingURL=index-page.d.ts.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { DiagramView } from '@likec4/core';
|
|
2
|
-
export declare function buildDiagramTreeAtom(views: DiagramView[]): import("react-accessible-treeview").INode<import("react-accessible-treeview/dist/TreeView/utils").IFlatMetadata>[];
|
|
3
|
-
//# sourceMappingURL=sidebar-diagram-tree.d.ts.map
|
package/dist/__app__/main.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
type EmbedPageProps = {
|
|
3
|
-
viewId: string;
|
|
4
|
-
padding: number;
|
|
5
|
-
transparentBg?: boolean | undefined;
|
|
6
|
-
};
|
|
7
|
-
export declare function EmbedPage({ viewId, padding, transparentBg }: EmbedPageProps): JSX.Element;
|
|
8
|
-
export {};
|
|
9
|
-
//# sourceMappingURL=embed.page.d.ts.map
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { DiagramView } from '@likec4/diagrams';
|
|
3
|
-
type ViewAsReactProps = {
|
|
4
|
-
diagram: DiagramView;
|
|
5
|
-
};
|
|
6
|
-
export declare function ViewAsReact({ diagram }: ViewAsReactProps): JSX.Element;
|
|
7
|
-
export {};
|
|
8
|
-
//# sourceMappingURL=ViewAsReact.d.ts.map
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { type ViewMode } from '../../router';
|
|
3
|
-
type Props = {
|
|
4
|
-
viewMode: Exclude<ViewMode, 'react'>;
|
|
5
|
-
viewId: string;
|
|
6
|
-
};
|
|
7
|
-
export default function ViewDiagramInOtherFormats({ viewId, viewMode }: Props): JSX.Element;
|
|
8
|
-
export {};
|
|
9
|
-
//# sourceMappingURL=other-formats.d.ts.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { ViewMode } from '../router';
|
|
3
|
-
type ViewPageProps = {
|
|
4
|
-
viewId: string;
|
|
5
|
-
viewMode: ViewMode;
|
|
6
|
-
showUI?: boolean;
|
|
7
|
-
};
|
|
8
|
-
export declare function ViewPage({ viewId, viewMode, showUI }: ViewPageProps): JSX.Element;
|
|
9
|
-
export {};
|
|
10
|
-
//# sourceMappingURL=view.page.d.ts.map
|
package/dist/__app__/router.d.ts
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import type { ViewID } from '@likec4/core';
|
|
2
|
-
export declare const $router: import("@nanostores/router").Router<{
|
|
3
|
-
readonly index: string;
|
|
4
|
-
readonly view: `${string}view/:viewId?`;
|
|
5
|
-
readonly export: `${string}export/:viewId`;
|
|
6
|
-
readonly embed: `${string}embed/:viewId`;
|
|
7
|
-
}>;
|
|
8
|
-
export type ViewMode = 'react' | 'dot' | 'mmd' | 'd2';
|
|
9
|
-
declare const searchParams: import("nanostores").ReadableAtom<{
|
|
10
|
-
theme: "light" | "dark" | undefined;
|
|
11
|
-
padding: number | undefined;
|
|
12
|
-
mode: ViewMode | undefined;
|
|
13
|
-
showUI: boolean | undefined;
|
|
14
|
-
}>;
|
|
15
|
-
type SearchParams = ReturnType<(typeof searchParams)['get']>;
|
|
16
|
-
export declare function updateSearchParams(update: Partial<SearchParams>): void;
|
|
17
|
-
export declare const useSearchParams: () => {
|
|
18
|
-
theme: "light" | "dark" | undefined;
|
|
19
|
-
padding: number | undefined;
|
|
20
|
-
mode: ViewMode | undefined;
|
|
21
|
-
showUI: boolean | undefined;
|
|
22
|
-
};
|
|
23
|
-
export declare const useRoute: () => {
|
|
24
|
-
route: "view";
|
|
25
|
-
params: {
|
|
26
|
-
viewId: ViewID;
|
|
27
|
-
theme: "light" | "dark";
|
|
28
|
-
mode: ViewMode;
|
|
29
|
-
padding?: never;
|
|
30
|
-
};
|
|
31
|
-
showUI: boolean;
|
|
32
|
-
} | {
|
|
33
|
-
route: "export" | "embed";
|
|
34
|
-
params: {
|
|
35
|
-
viewId: ViewID;
|
|
36
|
-
padding: number;
|
|
37
|
-
theme: "light" | "dark" | undefined;
|
|
38
|
-
mode?: never;
|
|
39
|
-
};
|
|
40
|
-
showUI: boolean;
|
|
41
|
-
} | {
|
|
42
|
-
route: "index";
|
|
43
|
-
params: {
|
|
44
|
-
theme: "light" | "dark";
|
|
45
|
-
viewId?: never;
|
|
46
|
-
mode?: never;
|
|
47
|
-
padding?: never;
|
|
48
|
-
};
|
|
49
|
-
showUI: boolean;
|
|
50
|
-
};
|
|
51
|
-
export type Route = NonNullable<ReturnType<typeof useRoute>>;
|
|
52
|
-
export declare const isCurrentDiagram: <V extends {
|
|
53
|
-
id: string;
|
|
54
|
-
}>(view: V) => boolean;
|
|
55
|
-
export declare const $pages: {
|
|
56
|
-
readonly index: {
|
|
57
|
-
readonly url: () => string;
|
|
58
|
-
readonly open: () => void;
|
|
59
|
-
};
|
|
60
|
-
readonly view: {
|
|
61
|
-
readonly url: (viewId: string) => string;
|
|
62
|
-
readonly open: (viewId: string) => void;
|
|
63
|
-
};
|
|
64
|
-
readonly embed: {
|
|
65
|
-
readonly path: (viewId: string) => string;
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
export {};
|
|
69
|
-
//# sourceMappingURL=router.d.ts.map
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|