@likec4/core 1.47.0 → 1.49.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/LICENSE +1 -1
- package/dist/THIRD-PARTY-LICENSES.md +1012 -0
- package/dist/_chunks/Builder.view-element.mjs +2 -0
- package/dist/_chunks/LikeC4Model.d.mts +1283 -0
- package/dist/_chunks/RichText.mjs +1 -0
- package/dist/_chunks/_types.d.mts +777 -0
- package/dist/_chunks/_types2.d.mts +36 -0
- package/dist/_chunks/assignTagColors.mjs +1 -0
- package/dist/_chunks/calcDriftsFromSnapshot.mjs +1 -0
- package/dist/_chunks/guards.d.mts +2026 -0
- package/dist/_chunks/guards.mjs +4 -0
- package/dist/_chunks/index.d.mts +288 -0
- package/dist/_chunks/libs/@mantine/colors-generator.mjs +15 -0
- package/dist/_chunks/libs/@radix-ui/colors.mjs +1 -0
- package/dist/_chunks/libs/@ungap/structured-clone.mjs +1 -0
- package/dist/_chunks/libs/bail.mjs +1 -0
- package/dist/_chunks/libs/ccount.mjs +1 -0
- package/dist/_chunks/libs/character-entities-html4.mjs +1 -0
- package/dist/_chunks/libs/character-entities-legacy.mjs +1 -0
- package/dist/_chunks/libs/character-entities.mjs +2 -0
- package/dist/_chunks/libs/comma-separated-tokens.mjs +1 -0
- package/dist/_chunks/libs/decode-named-character-reference.mjs +1 -0
- package/dist/_chunks/libs/defu.mjs +1 -0
- package/dist/_chunks/libs/devlop.mjs +1 -0
- package/dist/_chunks/libs/escape-string-regexp.mjs +1 -0
- package/dist/_chunks/libs/extend.mjs +1 -0
- package/dist/_chunks/libs/graphology-dag.mjs +1 -0
- package/dist/_chunks/libs/graphology.mjs +1 -0
- package/dist/_chunks/libs/hast-util-sanitize.mjs +1 -0
- package/dist/_chunks/libs/hast-util-to-html.mjs +9 -0
- package/dist/_chunks/libs/is-plain-obj.mjs +1 -0
- package/dist/_chunks/libs/longest-streak.mjs +1 -0
- package/dist/_chunks/libs/markdown-table.mjs +2 -0
- package/dist/_chunks/libs/mdast-util-find-and-replace.mjs +1 -0
- package/dist/_chunks/libs/mdast-util-from-markdown.mjs +3 -0
- package/dist/_chunks/libs/mdast-util-gfm.mjs +15 -0
- package/dist/_chunks/libs/mdast-util-to-hast.mjs +11 -0
- package/dist/_chunks/libs/micromark-extension-gfm.mjs +1 -0
- package/dist/_chunks/libs/mnemonist.d.mts +164 -0
- package/dist/_chunks/libs/mnemonist.mjs +1 -0
- package/dist/_chunks/libs/natural-compare-lite.mjs +9 -0
- package/dist/_chunks/libs/ohash.mjs +1 -0
- package/dist/_chunks/libs/rehype-sanitize.mjs +1 -0
- package/dist/_chunks/libs/rehype-stringify.mjs +1 -0
- package/dist/_chunks/libs/remark-gfm.mjs +1 -0
- package/dist/_chunks/libs/remark-github-blockquote-alert.mjs +3 -0
- package/dist/_chunks/libs/remark-parse.mjs +1 -0
- package/dist/_chunks/libs/remark-rehype.mjs +1 -0
- package/dist/_chunks/libs/remeda.mjs +1 -0
- package/dist/_chunks/libs/trough.mjs +1 -0
- package/dist/_chunks/libs/unified.mjs +1 -0
- package/dist/_chunks/rolldown-runtime.mjs +1 -0
- package/dist/_chunks/theme.d.mts +148 -0
- package/dist/_chunks/to-text.d.mts +404 -0
- package/dist/_chunks/to-text.mjs +1 -0
- package/dist/_chunks/vector.d.mts +198 -0
- package/dist/_chunks/vector.mjs +1 -0
- package/dist/builder/index.d.mts +5 -775
- package/dist/builder/index.mjs +1 -1053
- package/dist/compute-view/index.d.mts +156 -56
- package/dist/compute-view/index.mjs +2 -229
- package/dist/geometry/index.d.mts +2 -109
- package/dist/geometry/index.mjs +1 -328
- package/dist/index.d.mts +14 -20
- package/dist/index.mjs +1 -18
- package/dist/model/index.d.mts +5 -57
- package/dist/model/index.mjs +1 -4
- package/dist/styles/index.d.mts +3 -117
- package/dist/styles/index.mjs +1 -63
- package/dist/types/index.d.mts +3 -47
- package/dist/types/index.mjs +1 -17
- package/dist/utils/graphology/index.d.mts +2 -1864
- package/dist/utils/graphology/index.mjs +1 -1
- package/dist/utils/index.d.mts +4 -124
- package/dist/utils/index.mjs +1 -44
- package/package.json +20 -24
- package/compute-view/relationships/package.json +0 -4
- package/dist/compute-view/relationships-view/index.d.mts +0 -51
- package/dist/compute-view/relationships-view/index.mjs +0 -185
- package/dist/model/connection/deployment/index.d.mts +0 -15
- package/dist/model/connection/deployment/index.mjs +0 -2
- package/dist/model/connection/index.d.mts +0 -75
- package/dist/model/connection/index.mjs +0 -3
- package/dist/model/connection/model/index.d.mts +0 -15
- package/dist/model/connection/model/index.mjs +0 -2
- package/dist/shared/core.3ZhnKAlZ.mjs +0 -106
- package/dist/shared/core.78IWAHAE.mjs +0 -332
- package/dist/shared/core.B85MJLTf.mjs +0 -5
- package/dist/shared/core.BFd1lU9R.mjs +0 -29
- package/dist/shared/core.BKlholso.mjs +0 -3
- package/dist/shared/core.BNN-3vPH.mjs +0 -1255
- package/dist/shared/core.BPGOjone.d.mts +0 -46
- package/dist/shared/core.BP_QHEXs.mjs +0 -785
- package/dist/shared/core.BbE4y-yl.mjs +0 -177
- package/dist/shared/core.Bdy3hhTc.mjs +0 -28382
- package/dist/shared/core.BfCKSW-g.d.mts +0 -1266
- package/dist/shared/core.BhNcrwzK.mjs +0 -7
- package/dist/shared/core.BkVA6gjl.mjs +0 -5
- package/dist/shared/core.BoYfZOBm.mjs +0 -3
- package/dist/shared/core.BsSXS-_R.mjs +0 -7
- package/dist/shared/core.C3JowhaZ.mjs +0 -32
- package/dist/shared/core.C4x8aaWa.mjs +0 -27
- package/dist/shared/core.CAgYpDtM.d.mts +0 -98
- package/dist/shared/core.CHf8VEa3.mjs +0 -1206
- package/dist/shared/core.CLSZtnFh.mjs +0 -69
- package/dist/shared/core.C_3y3eqV.d.mts +0 -139
- package/dist/shared/core.CbT8JVYL.mjs +0 -5
- package/dist/shared/core.CdNCAwq7.mjs +0 -176
- package/dist/shared/core.CmGY9blO.mjs +0 -6717
- package/dist/shared/core.CmPXpJ8l.mjs +0 -21
- package/dist/shared/core.Coi_LOUZ.mjs +0 -7
- package/dist/shared/core.CqAJJpK_.mjs +0 -3
- package/dist/shared/core.CywrQs86.d.mts +0 -31
- package/dist/shared/core.D00YbOhQ.d.mts +0 -300
- package/dist/shared/core.D0WZutNd.mjs +0 -94
- package/dist/shared/core.D4npX2q8.mjs +0 -18
- package/dist/shared/core.DB0Ue5Wx.d.mts +0 -70
- package/dist/shared/core.DC5IAaDT.d.mts +0 -334
- package/dist/shared/core.DE9qzhn8.d.mts +0 -83
- package/dist/shared/core.DGcIbsj4.mjs +0 -3946
- package/dist/shared/core.DH7TXqXf.mjs +0 -136
- package/dist/shared/core.DKhRkHRN.d.mts +0 -41
- package/dist/shared/core.DRJma0Ol.mjs +0 -22
- package/dist/shared/core.DU5SRqNF.mjs +0 -2209
- package/dist/shared/core.DXhDWKFZ.d.mts +0 -3
- package/dist/shared/core.DbfO90vF.mjs +0 -434
- package/dist/shared/core.DcS-0zys.mjs +0 -10
- package/dist/shared/core.Dh119QSP.mjs +0 -4995
- package/dist/shared/core.DjcWextK.mjs +0 -1371
- package/dist/shared/core.Dojz4bvg.d.mts +0 -504
- package/dist/shared/core.FZ305VYd.mjs +0 -21
- package/dist/shared/core.OtRNdMxy.d.mts +0 -352
- package/dist/shared/core.RfnaEmgA.mjs +0 -7
- package/dist/shared/core.btEq3i3f.mjs +0 -300
- package/dist/shared/core.oSV6SRfk.mjs +0 -13
- package/dist/shared/core.om36dXXW.mjs +0 -41
- package/dist/shared/core.osFs8tU7.d.mts +0 -466
- package/dist/shared/core.q10OP9oJ.mjs +0 -5
- package/dist/shared/core.tpvDGvdC.d.mts +0 -87
- package/dist/shared/core.uFk_o9X6.mjs +0 -13
- package/dist/types/_aux.d.mts +0 -4
- package/dist/types/_aux.mjs +0 -8
- package/dist/types/expression-model.d.mts +0 -190
- package/dist/types/expression-model.mjs +0 -109
- package/dist/types/expression.d.mts +0 -6
- package/dist/types/expression.mjs +0 -113
- package/dist/types/fqnRef.d.mts +0 -60
- package/dist/types/fqnRef.mjs +0 -45
- package/dist/types/scalar.d.mts +0 -2
- package/dist/types/scalar.mjs +0 -4
- package/dist/utils/iterable/index.d.mts +0 -132
- package/dist/utils/iterable/index.mjs +0 -62
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { G as DiagramEdge, Ji as _stage, K as DiagramNode, Oi as ProjectId, Yi as _type, at as ComputedNode, fn as BaseViewProperties, hn as ViewAutoLayout, rt as ComputedEdge } from "./guards.mjs";
|
|
2
|
+
import { i as BBox } from "./vector.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/compute-view/projects-view/_types.d.ts
|
|
5
|
+
interface ComputedProjectNode extends ComputedNode {
|
|
6
|
+
readonly projectId: ProjectId;
|
|
7
|
+
}
|
|
8
|
+
interface ComputedProjectEdge extends ComputedEdge {
|
|
9
|
+
readonly projectId: ProjectId;
|
|
10
|
+
}
|
|
11
|
+
interface LayoutedProjectNode extends DiagramNode {
|
|
12
|
+
readonly projectId: ProjectId;
|
|
13
|
+
}
|
|
14
|
+
interface LayoutedProjectEdge extends DiagramEdge {
|
|
15
|
+
readonly projectId: ProjectId;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* An overview of projects and their relationships, presented as a graph with nodes and edges.
|
|
19
|
+
* Even though it has same structure as other likec4 views, it is not mixed with them, as it represents a different kind.
|
|
20
|
+
*/
|
|
21
|
+
interface ComputedProjectsView extends BaseViewProperties<any> {
|
|
22
|
+
readonly [_type]: 'projects';
|
|
23
|
+
readonly [_stage]: 'computed';
|
|
24
|
+
readonly nodes: ReadonlyArray<ComputedProjectNode>;
|
|
25
|
+
readonly edges: ReadonlyArray<ComputedProjectEdge>;
|
|
26
|
+
readonly autoLayout: ViewAutoLayout;
|
|
27
|
+
}
|
|
28
|
+
interface LayoutedProjectsView extends BaseViewProperties<any> {
|
|
29
|
+
readonly [_type]: 'projects';
|
|
30
|
+
readonly [_stage]: 'layouted';
|
|
31
|
+
readonly nodes: ReadonlyArray<LayoutedProjectNode>;
|
|
32
|
+
readonly edges: ReadonlyArray<LayoutedProjectEdge>;
|
|
33
|
+
readonly bounds: BBox;
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { LayoutedProjectNode as a, LayoutedProjectEdge as i, ComputedProjectNode as n, LayoutedProjectsView as o, ComputedProjectsView as r, ComputedProjectEdge as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{O as e,T as t$3,X as t,et as t$1,l as t$2,m as e$1,nt as t$4,p as t$5}from"./libs/remeda.mjs";import{F as DefaultTagColors}from"./RichText.mjs";import{$ as nonNullable,J as compareNatural}from"./to-text.mjs";function assignTagColors(a){let o=[],s=[];for(let[r,i]of t(a))e(i.color)?o.push({tag:r,spec:{color:i.color}}):s.push(r);return t$1(s,t$2(compareNatural),t$3((n,r)=>({tag:n,spec:{color:nonNullable(DefaultTagColors[r%DefaultTagColors.length])}})),t$4(o),t$2((n,r)=>compareNatural(n.tag,r.tag)),t$5(e$1(`tag`),e$1(`spec`)))}export{assignTagColors as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as t$2,H as t$1,K as t$6,M as e$1,O as e$3,Q as t$9,T as t$4,V as t$8,X as t$5,Y as n,_ as t$10,c as t$7,et as t,h as t$3,i as n$1,j as e$2,m as e}from"./libs/remeda.mjs";import{g as isElementView,h as isDynamicView,ht as _layout}from"./RichText.mjs";import{D as ifilter,Q as invariant,S as ihead,l as symmetricDifference}from"./to-text.mjs";import{castDraft,produce}from"immer";function buildElementNotations(o){return t(o,n(r=>!!r.notation),t$1(e(`notation`)),t$2(t$3(t$1(e(`shape`)),t$2(t$3(t$1(e(`color`)),t$2(t$3(t$4(e(`kind`)),n$1())),t$5(),t$4(([r,i])=>({kinds:i,color:r})))),t$5(),t$6(([r,i])=>i.map(({color:i,kinds:a})=>({shape:r,color:i,kinds:a}))))),t$5(),t$6(([r,i])=>i.map(({shape:i,color:a,kinds:o})=>({title:r,shape:i,color:a,kinds:o}))),t$7(e(`shape`),e(`title`),[r=>r.kinds.length,`desc`]))}const changed=(r,i)=>r===i||e$1(r)&&e$1(i)?!1:!t$8(r,i);function autoApplyMetaAndStyles(r,i){r.color=i.color,r.kind=i.kind,r.navigateTo=i.navigateTo??null,r.links=i.links?[...i.links]:null,r.tags=[...i.tags],e$1(i.style.border)?delete r.style.border:r.style.border=i.style.border,e$2(i.style.opacity)?r.style.opacity=i.style.opacity:delete r.style.opacity,e$1(i.style.multiple)?delete r.style.multiple:r.style.multiple=i.style.multiple}function autoApplyIcon(r,i,a){if(changed(i.icon??`none`,r.icon??`none`)){let c=e$3(r.icon)&&r.icon!==`none`;switch(!0){case c&&e$3(i.icon)&&i.icon!==`none`:return r.icon=i.icon,!0;case c&&(e$1(i.icon)||i.icon===`none`):return r.icon=`none`,!0;case!c&&e$3(i.icon)&&i.icon!==`none`:return a?(r.icon=i.icon,!0):!1}}return!0}function autoApplyIconStyles(r,i,a){let s=!0;return changed(r.style.iconColor,i.style.iconColor)&&(e$1(i.style.iconColor)?delete r.style.iconColor:r.style.iconColor=i.style.iconColor),changed(r.style.iconSize,i.style.iconSize)&&(a?e$1(i.style.iconSize)?delete r.style.iconSize:r.style.iconSize=i.style.iconSize:s=!1),changed(r.style.iconPosition,i.style.iconPosition)&&(a?e$1(i.style.iconPosition)?delete r.style.iconPosition:r.style.iconPosition=i.style.iconPosition:s=!1),s}function patchMarkdownOrString(r,i){return r?`md`in i?(r.md=i.md,delete r.txt,r):(`txt`in i&&(r.txt=i.txt,delete r.md),r):i}function autoApplyLabelsToLeaf(r,i,a){let s=!0;return changed(r.title,i.title)&&(a?r.title=i.title:s=!1),changed(r.description,i.description)&&(e$1(i.description)?delete r.description:a?r.description=patchMarkdownOrString(r.description,i.description):s=!1),changed(r.technology,i.technology)&&(e$1(i.technology)?delete r.technology:a?r.technology=i.technology:s=!1),s}function autoApplyLabelsToCompound(r,i,a){return r.title=i.title,e$1(i.description)?delete r.description:r.description=patchMarkdownOrString(r.description,i.description),e$1(i.technology)?delete r.technology:r.technology=i.technology,!0}function applyManualLayout(r,i){invariant(r.id===i.id,`applyManualLayout: view ids do not match`),invariant(r._stage===`layouted`,`applyManualLayout: expected layouted view`),invariant(i._stage===`layouted`,`applyManualLayout: expected layouted snapshot`),invariant(r._layout!==`manual`,`applyManualLayout: expected auto-layouted view`);let a=new Set;r._type!==i._type&&a.add(`type-changed`);let o=applyNodesManualLayout(i.nodes,r.nodes,a),s=applyEdgesManualLayout(i.edges,r.edges,a),l=buildElementNotations(o);return produce(i,u=>{u.title=r.title??i.title,u.description=r.description??i.description,u.tags=r.tags?[...r.tags]:null,u.links=r.links?[...r.links]:null,u.sourcePath=r.sourcePath,u[_layout]=`manual`,l&&l.length>0?u.notation={nodes:l}:delete u.notation,u.nodes=castDraft(o),u.edges=castDraft(s),isDynamicView(r)&&u._type===`dynamic`&&(u.variant=r.variant),isElementView(r)&&u._type===`element`&&(r.viewOf?u.viewOf=r.viewOf:delete u.viewOf,r.extends?u.extends=r.extends:delete u.extends);let d=[...a];t$9(d,1)?u.drifts=d:(u.hash=r.hash,delete u.drifts)})}function applyNodesManualLayout(r,i,a){let s=new Map(i.map(r=>[r.id,r])),l=r.map(r=>{let i=s.get(r.id);return i?(s.delete(i.id),produce(r,s=>{autoApplyMetaAndStyles(s,i);let l=new Set,u=r.children.length>0,d=i.children.length>0;(changed(s.modelRef,i.modelRef)||changed(s.deploymentRef,i.deploymentRef))&&l.add(`modelRef-changed`),d&&!u&&l.add(`became-compound`),!d&&u&&l.add(`became-leaf`),changed(s.parent,i.parent)&&l.add(`parent-changed`);let f=s.width+5>=i.width&&s.height+5>=i.height;changed(s.shape,i.shape)&&(f?s.shape=i.shape:l.add(`shape-changed`)),autoApplyIconStyles(s,i,f)||l.add(`label-changed`),autoApplyIcon(s,i,f&&d===u)||l.add(`label-changed`),(u?autoApplyLabelsToCompound:autoApplyLabelsToLeaf)(s,i,f)||l.add(`label-changed`),changed(s.notes,i.notes)&&(e$1(i.notes)?delete s.notes:s.notes=patchMarkdownOrString(s.notes,i.notes)),changed(r.notation,i.notation)&&(s.notation=i.notation??null),u&&d&&symmetricDifference(new Set(r.children),new Set(i.children)).size>0&&l.add(`children-changed`);let p=[...l];t$9(p,1)?(a.add(`nodes-drift`),s.drifts=p):delete s.drifts})):(a.add(`nodes-removed`),{...r,drifts:[`removed`]})});return s.size>0&&a.add(`nodes-added`),l}function applyEdgesManualLayout(r,i,a){let s=new Map(i.map(r=>[r.id,r])),l=r.map(r=>{let i=s.get(r.id)??t(s.values(),ifilter(i=>i.source===r.source&&i.target===r.target),ihead());return i&&s.delete(i.id),produce(r,s=>{if(!i){s.drifts=[`removed`],a.add(`edges-removed`);return}let l=new Set,u=r.id===i.id;switch(!0){case u&&r.source==i.source&&r.target==i.target:changed(s.dir??`forward`,i.dir??`forward`)&&l.add(`direction-changed`);break;case u&&r.source==i.target&&r.target==i.source:r.source!==r.target&&l.add(`direction-changed`);break;case u:r.source!=i.source&&l.add(`source-changed`),r.target!=i.target&&l.add(`target-changed`);break;default:invariant(r.id!=i.id,`Unexpected case in edge drift detection, ids should not match`),invariant(r.source==i.source,`Unexpected case in edge drift detection, sources should match`),invariant(r.target==i.target,`Unexpected case in edge drift detection, targets should match`),changed(s.dir??`forward`,i.dir??`forward`)&&l.add(`direction-changed`);break}if(s.color=i.color,s.line=i.line,s.navigateTo=i.navigateTo??null,s.tags=i.tags?[...i.tags]:null,changed(r.notes,i.notes)&&(e$1(r.notes)!==e$1(i.notes)&&l.add(`notes-changed`),s.notes=i.notes??r.notes),i.astPath?s.astPath=i.astPath:delete s.astPath,changed(t$10(r,[`label`,`description`,`technology`,`labelBBox`]),t$10(i,[`label`,`description`,`technology`,`labelBBox`])))switch(!0){case i.labelBBox&&!r.labelBBox:l.add(`label-added`);break;case r.labelBBox&&!i.labelBBox:l.add(`label-removed`);break;case!!r.labelBBox&&!!i.labelBBox:i.labelBBox.width*i.labelBBox.height>(r.labelBBox.width+5)*(r.labelBBox.height+5)&&(s.labelBBox.width=Math.round(i.labelBBox.width),s.labelBBox.height=Math.round(i.labelBBox.height)),changed(r.label,i.label)&&(e$1(i.label)!==e$1(r.label)&&l.add(`label-changed`),s.label=i.label??r.label),changed(r.description,i.description)&&(e$1(i.description)!==e$1(r.description)&&l.add(`label-changed`),i.description&&(s.description=patchMarkdownOrString(r.description,i.description))),changed(r.technology,i.technology)&&(e$1(i.technology)!==e$1(r.technology)&&l.add(`label-changed`),s.technology=i.technology??r.technology??null);break;default:invariant(!r.labelBBox,`Unexpected case in edge labelBBox drift detection`),invariant(!i.labelBBox,`Unexpected case in next labelBBox drift detection`);break}let d=[...l];t$9(d,1)?(a.add(`edges-drift`),s.drifts=d):delete s.drifts})});return s.size>0&&a.add(`edges-added`),l}function calcDriftsFromSnapshot(r,i){let{drifts:a,...o}=applyManualLayout(r,i);if(!a||a.length===0)return produce(r,r=>{delete r.drifts,r[_layout]=`auto`});let s=new Set;a.includes(`type-changed`)&&s.add(`type-changed`);let l=new Map(o.nodes.map(r=>[r.id,r])),u=new Map(o.edges.map(r=>[r.id,r])),d=r.nodes.map(r=>{let i=l.get(r.id);return i&&l.delete(i.id),produce(r,r=>{if(!i){s.add(`nodes-added`),r.drifts=[`added`];return}i.drifts?(s.add(`nodes-drift`),r.drifts=[...i.drifts]):delete r.drifts})});l.size>0&&s.add(`nodes-removed`);let f=r.edges.map(r=>{let i=u.get(r.id)??t(u.values(),ifilter(i=>i.source===r.source&&i.target===r.target),ihead());return i&&u.delete(i.id),produce(r,r=>{if(!i){s.add(`edges-added`),r.drifts=[`added`];return}i.drifts?(s.add(`edges-drift`),r.drifts=[...i.drifts]):delete r.drifts})});u.size>0&&s.add(`edges-removed`);let p=[...s];return produce(r,r=>{t$9(p,1)?r.drifts=p:delete r.drifts,r.nodes=castDraft(d),r.edges=castDraft(f),r[_layout]=`auto`})}export{applyManualLayout as n,buildElementNotations as r,calcDriftsFromSnapshot as t};
|