@likec4/generators 1.50.0 → 1.52.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/index.mjs
CHANGED
|
@@ -524,17 +524,18 @@ function inferKind(style, parentCell) {
|
|
|
524
524
|
const s = style?.toLowerCase() ?? "";
|
|
525
525
|
switch (true) {
|
|
526
526
|
case !style: return parentCell?.style?.toLowerCase().includes("container=1") ? "component" : "container";
|
|
527
|
-
case s.includes("umlactor") || s.includes("shape=person"): return "actor";
|
|
527
|
+
case s.includes("umlactor") || s.includes("shape=person") || s.includes("shape=actor"): return "actor";
|
|
528
528
|
case s.includes("swimlane"):
|
|
529
529
|
case s.includes("container=1"): return "system";
|
|
530
530
|
case !!parentCell?.style?.toLowerCase().includes("container=1"): return "component";
|
|
531
531
|
default: return "container";
|
|
532
532
|
}
|
|
533
533
|
}
|
|
534
|
-
/** Infer LikeC4 shape from DrawIO style when possible (cylinder, document, etc.). */
|
|
534
|
+
/** Infer LikeC4 shape from DrawIO style when possible (person, cylinder, document, etc.). */
|
|
535
535
|
function inferShape(style) {
|
|
536
536
|
if (!style) return void 0;
|
|
537
537
|
const s = style.toLowerCase();
|
|
538
|
+
if (s.includes("shape=actor") || s.includes("shape=person") || s.includes("umlactor")) return "person";
|
|
538
539
|
if (s.includes("shape=cylinder") || s.includes("cylinder3")) return "cylinder";
|
|
539
540
|
if (s.includes("shape=document")) return "document";
|
|
540
541
|
if (s.includes("shape=rectangle") && s.includes("rounded")) return "rectangle";
|
|
@@ -1525,7 +1526,7 @@ function getThemeColorValues(viewmodel, color, fallback) {
|
|
|
1525
1526
|
function drawioShape(shape) {
|
|
1526
1527
|
const rectStyle = "shape=rectangle;rounded=1;arcSize=12;";
|
|
1527
1528
|
switch (shape) {
|
|
1528
|
-
case "person": return "shape=
|
|
1529
|
+
case "person": return "shape=actor;";
|
|
1529
1530
|
case "rectangle":
|
|
1530
1531
|
case "browser":
|
|
1531
1532
|
case "mobile":
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@likec4/generators",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.52.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"bugs": "https://github.com/likec4/likec4/issues",
|
|
6
6
|
"homepage": "https://likec4.dev",
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"langium": "3.5.0",
|
|
41
41
|
"pako": "^2.1.0",
|
|
42
|
-
"remeda": "^2.33.
|
|
42
|
+
"remeda": "^2.33.6",
|
|
43
43
|
"json5": "^2.2.3",
|
|
44
|
-
"@likec4/core": "1.
|
|
45
|
-
"@likec4/log": "1.
|
|
44
|
+
"@likec4/core": "1.52.0",
|
|
45
|
+
"@likec4/log": "1.52.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/node": "~22.19.11",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"typescript": "5.9.3",
|
|
51
51
|
"obuild": "^0.4.31",
|
|
52
52
|
"vitest": "4.0.18",
|
|
53
|
-
"@likec4/tsconfig": "1.
|
|
53
|
+
"@likec4/tsconfig": "1.52.0",
|
|
54
54
|
"@likec4/devops": "1.42.0"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|
|
@@ -236,7 +236,7 @@ function drawioShape(shape: Node['shape']): string {
|
|
|
236
236
|
const rectStyle = 'shape=rectangle;rounded=1;arcSize=12;'
|
|
237
237
|
switch (shape) {
|
|
238
238
|
case 'person':
|
|
239
|
-
return 'shape=
|
|
239
|
+
return 'shape=actor;'
|
|
240
240
|
case 'rectangle':
|
|
241
241
|
case 'browser':
|
|
242
242
|
case 'mobile':
|
|
@@ -138,7 +138,7 @@ function findOpenTagEnd(xml: string, start: number): number {
|
|
|
138
138
|
let i = start
|
|
139
139
|
while (i < xml.length) {
|
|
140
140
|
const c = xml[i]
|
|
141
|
-
if (c === '"' || c ===
|
|
141
|
+
if (c === '"' || c === '\'') {
|
|
142
142
|
if (quoteChar === '') quoteChar = c
|
|
143
143
|
else if (quoteChar === c) quoteChar = ''
|
|
144
144
|
} else if (c === '>' && quoteChar === '') return i
|
|
@@ -561,7 +561,7 @@ function inferKind(
|
|
|
561
561
|
switch (true) {
|
|
562
562
|
case !style:
|
|
563
563
|
return parentCell?.style?.toLowerCase().includes('container=1') ? 'component' : 'container'
|
|
564
|
-
case s.includes('umlactor') || s.includes('shape=person'):
|
|
564
|
+
case s.includes('umlactor') || s.includes('shape=person') || s.includes('shape=actor'):
|
|
565
565
|
return 'actor'
|
|
566
566
|
case s.includes('swimlane'):
|
|
567
567
|
case s.includes('container=1'):
|
|
@@ -573,10 +573,12 @@ function inferKind(
|
|
|
573
573
|
}
|
|
574
574
|
}
|
|
575
575
|
|
|
576
|
-
/** Infer LikeC4 shape from DrawIO style when possible (cylinder, document, etc.). */
|
|
576
|
+
/** Infer LikeC4 shape from DrawIO style when possible (person, cylinder, document, etc.). */
|
|
577
577
|
function inferShape(style: string | undefined): string | undefined {
|
|
578
578
|
if (!style) return undefined
|
|
579
579
|
const s = style.toLowerCase()
|
|
580
|
+
// Actor/person shape (export may use shape=actor or shape=umlActor; legacy may have shape=person)
|
|
581
|
+
if (s.includes('shape=actor') || s.includes('shape=person') || s.includes('umlactor')) return 'person'
|
|
580
582
|
if (s.includes('shape=cylinder') || s.includes('cylinder3')) return 'cylinder'
|
|
581
583
|
if (s.includes('shape=document')) return 'document'
|
|
582
584
|
if (s.includes('shape=rectangle') && s.includes('rounded')) return 'rectangle'
|