fix: resolve properties before direct HTML generation

This commit is contained in:
2026-06-16 19:09:00 +02:00
parent a9d40aaf8c
commit 79ddb307c1
29 changed files with 1876 additions and 211 deletions

View File

@@ -304,9 +304,6 @@
}, {
"rawName" : "\"CHECK_AVAILABILITY\"",
"fullIdentifier" : "CHECK_AVAILABILITY"
}, {
"rawName" : "NEW",
"fullIdentifier" : "NEW"
}, {
"rawName" : "RETURNED",
"fullIdentifier" : "RETURNED"
@@ -316,6 +313,9 @@
}, {
"rawName" : "CANCELLED",
"fullIdentifier" : "CANCELLED"
}, {
"rawName" : "${order.initial.state:NEW}",
"fullIdentifier" : "NEW"
}, {
"rawName" : "\"PENDING_PAYMENT\"",
"fullIdentifier" : "PENDING_PAYMENT"
@@ -360,7 +360,8 @@
"guard" : {
"expression" : "(c) -> true",
"isLambda" : true,
"internalLogic" : null
"internalLogic" : "(c) -> true",
"lineNumber" : 41
},
"actions" : [ ],
"order" : 0
@@ -727,7 +728,9 @@
"lineNumber" : 17
}
} ],
"properties" : { }
"properties" : {
"default" : { }
}
}
}
</script>
@@ -931,13 +934,9 @@
let metaTrans = null;
if (isAnon) {
const parts = linkId.split('_'); // link_anon_SRC_TGT
const src = parts[2];
const tgt = parts[3];
metaTrans = transitions.find(t =>
!t.event &&
normalize(t.sourceStates[0].fullIdentifier) === src &&
normalize(t.targetStates[0].fullIdentifier) === tgt
"anon_" + normalize(t.sourceStates[0].fullIdentifier) + "_" + normalize(t.targetStates[0].fullIdentifier) === linkId
);
} else {
metaTrans = transitions.find(t => normalize(t.event) === linkId);
@@ -981,7 +980,8 @@
</div>`;
if (trans && trans.guard) {
html += `<div style="font-size:0.7rem; font-weight:800; color:#94a3b8; text-transform:uppercase; margin-bottom:4px">Guard</div>
const lineInfo = trans.guard.lineNumber ? ` <span style="color:#94a3b8; font-weight:400; font-size:0.6rem;">(Line: ${trans.guard.lineNumber})</span>` : '';
html += `<div style="font-size:0.7rem; font-weight:800; color:#94a3b8; text-transform:uppercase; margin-bottom:4px">Guard${lineInfo}</div>
<div style="background:#f1f5f9; padding:6px; border-radius:4px; font-family:monospace; font-size:0.8rem; margin-bottom:12px; border:1px solid #e2e8f0;">${trans.guard.expression}</div>`;
if (trans.guard.internalLogic) {
html += `<div style="font-size:0.65rem; font-weight:800; color:#cbd5e1; text-transform:uppercase; margin-bottom:4px">Internal Logic</div>
@@ -992,7 +992,9 @@
if (trans && trans.actions && trans.actions.length > 0) {
html += `<div style="font-size:0.7rem; font-weight:800; color:#94a3b8; text-transform:uppercase; margin-bottom:4px">Actions</div>`;
trans.actions.forEach(action => {
html += `<div style="background:#f1f5f9; padding:6px; border-radius:4px; font-family:monospace; font-size:0.8rem; margin-bottom:12px; border:1px solid #e2e8f0;">${action.expression}</div>`;
const lineInfo = action.lineNumber ? ` <span style="color:#94a3b8; font-weight:400; font-size:0.6rem;">(Line: ${action.lineNumber})</span>` : '';
html += `<div style="font-size:0.7rem; font-weight:800; color:#94a3b8; text-transform:uppercase; margin-bottom:4px">Action${lineInfo}</div>
<div style="background:#f1f5f9; padding:6px; border-radius:4px; font-family:monospace; font-size:0.8rem; margin-bottom:12px; border:1px solid #e2e8f0;">${action.expression}</div>`;
if (action.internalLogic) {
html += `<div style="font-size:0.65rem; font-weight:800; color:#cbd5e1; text-transform:uppercase; margin-bottom:4px">Internal Logic</div>
<pre style="background:#1e293b; color:#f8fafc; padding:8px; border-radius:4px; font-family:'JetBrains Mono', monospace; font-size:0.7rem; overflow-x:auto; margin-bottom:12px;"><code>${action.internalLogic.replace(/</g, '&lt;').replace(/>/g, '&gt;')}</code></pre>`;

View File

@@ -261,7 +261,9 @@
"lineNumber" : 17
}
} ],
"properties" : { }
"properties" : {
"default" : { }
}
},
"name" : "click.kamil.examples.enterprise.config.EnterpriseStateMachineConfig",
"renderChoicesAsDiamonds" : true,
@@ -294,7 +296,8 @@
"guard" : {
"expression" : "(c) -> true",
"isLambda" : true,
"internalLogic" : null
"internalLogic" : "(c) -> true",
"lineNumber" : 41
},
"actions" : [ ],
"order" : 0