@eventcatalog/visualiser 3.17.1 → 3.18.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.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +109 -32
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +120 -43
- package/dist/index.mjs.map +1 -1
- package/dist/styles-core.css +7 -0
- package/dist/styles.css +7 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1121,7 +1121,8 @@ var ServiceMessageFlow = (0, import_react5.memo)(function ServiceMessageFlow2({
|
|
|
1121
1121
|
);
|
|
1122
1122
|
});
|
|
1123
1123
|
var GlowHandle = (0, import_react5.memo)(function GlowHandle2({
|
|
1124
|
-
side
|
|
1124
|
+
side,
|
|
1125
|
+
external
|
|
1125
1126
|
}) {
|
|
1126
1127
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1127
1128
|
"div",
|
|
@@ -1134,10 +1135,10 @@ var GlowHandle = (0, import_react5.memo)(function GlowHandle2({
|
|
|
1134
1135
|
width: 12,
|
|
1135
1136
|
height: 12,
|
|
1136
1137
|
borderRadius: "50%",
|
|
1137
|
-
background: "linear-gradient(135deg, #ec4899, #be185d)",
|
|
1138
|
+
background: external ? "linear-gradient(135deg, #a855f7, #7e22ce)" : "linear-gradient(135deg, #ec4899, #be185d)",
|
|
1138
1139
|
border: "2px solid rgb(var(--ec-page-bg))",
|
|
1139
1140
|
zIndex: 20,
|
|
1140
|
-
animation: "ec-service-handle-pulse 2s ease-in-out infinite",
|
|
1141
|
+
animation: external ? "ec-external-handle-pulse 2s ease-in-out infinite" : "ec-service-handle-pulse 2s ease-in-out infinite",
|
|
1141
1142
|
pointerEvents: "none"
|
|
1142
1143
|
}
|
|
1143
1144
|
}
|
|
@@ -1146,16 +1147,86 @@ var GlowHandle = (0, import_react5.memo)(function GlowHandle2({
|
|
|
1146
1147
|
function classNames(...classes) {
|
|
1147
1148
|
return classes.filter(Boolean).join(" ");
|
|
1148
1149
|
}
|
|
1150
|
+
var POST_IT_SERVICE = {
|
|
1151
|
+
Icon: import_lucide_react3.ServerIcon,
|
|
1152
|
+
label: "Service",
|
|
1153
|
+
gradient: "linear-gradient(135deg, #fbcfe8 0%, #f9a8d4 40%, #ec4899 100%)",
|
|
1154
|
+
draftBorder: "rgba(236, 72, 153, 0.5)",
|
|
1155
|
+
corner: "#db2777",
|
|
1156
|
+
ring: "ring-2 ring-pink-400/60 ring-offset-1",
|
|
1157
|
+
iconClass: "w-3 h-3 text-pink-900/50",
|
|
1158
|
+
labelClass: "text-[8px] font-bold text-pink-900/50 uppercase tracking-widest",
|
|
1159
|
+
nameText: "text-pink-950",
|
|
1160
|
+
nameTextDeprecated: "text-pink-950/40 line-through",
|
|
1161
|
+
versionClass: "text-[9px] text-pink-900/40 font-semibold mt-0.5",
|
|
1162
|
+
summaryClass: "mt-2 pt-1.5 border-t border-pink-900/10 text-[9px] text-pink-950/60 leading-relaxed overflow-hidden"
|
|
1163
|
+
};
|
|
1164
|
+
var POST_IT_EXTERNAL = {
|
|
1165
|
+
Icon: import_lucide_react3.Globe,
|
|
1166
|
+
label: "External System",
|
|
1167
|
+
gradient: "linear-gradient(135deg, #e9d5ff 0%, #c084fc 40%, #a855f7 100%)",
|
|
1168
|
+
draftBorder: "rgba(168, 85, 247, 0.5)",
|
|
1169
|
+
corner: "#7e22ce",
|
|
1170
|
+
ring: "ring-2 ring-purple-400/60 ring-offset-1",
|
|
1171
|
+
iconClass: "w-3 h-3 text-purple-900/50",
|
|
1172
|
+
labelClass: "text-[8px] font-bold text-purple-900/50 uppercase tracking-widest",
|
|
1173
|
+
nameText: "text-purple-950",
|
|
1174
|
+
nameTextDeprecated: "text-purple-950/40 line-through",
|
|
1175
|
+
versionClass: "text-[9px] text-purple-900/40 font-semibold mt-0.5",
|
|
1176
|
+
summaryClass: "mt-2 pt-1.5 border-t border-purple-900/10 text-[9px] text-purple-950/60 leading-relaxed overflow-hidden"
|
|
1177
|
+
};
|
|
1178
|
+
var DEFAULT_SERVICE = {
|
|
1179
|
+
Icon: import_lucide_react3.ServerIcon,
|
|
1180
|
+
label: "Service",
|
|
1181
|
+
ring: "ring-2 ring-pink-400/60 ring-offset-2",
|
|
1182
|
+
borderSolid: "border-pink-500",
|
|
1183
|
+
borderDraftDark: "border-dashed border-pink-400",
|
|
1184
|
+
borderDraftLight: "border-dashed border-pink-400/60",
|
|
1185
|
+
draftStripeDark: "rgba(236,72,153,0.25)",
|
|
1186
|
+
draftStripeLight: "rgba(236,72,153,0.15)",
|
|
1187
|
+
nodeBgVar: "var(--ec-service-node-bg, rgb(var(--ec-card-bg)))",
|
|
1188
|
+
shadowColor: "rgba(236, 72, 153, 0.15)",
|
|
1189
|
+
badgeBg: "bg-pink-500",
|
|
1190
|
+
ownerAccent: "bg-pink-400",
|
|
1191
|
+
ownerBorder: "rgba(236,72,153,0.08)",
|
|
1192
|
+
ownerIcon: "text-pink-300"
|
|
1193
|
+
};
|
|
1194
|
+
var DEFAULT_EXTERNAL = {
|
|
1195
|
+
Icon: import_lucide_react3.Globe,
|
|
1196
|
+
label: "External System",
|
|
1197
|
+
ring: "ring-2 ring-purple-400/60 ring-offset-2",
|
|
1198
|
+
borderSolid: "border-purple-500",
|
|
1199
|
+
borderDraftDark: "border-dashed border-purple-400",
|
|
1200
|
+
borderDraftLight: "border-dashed border-purple-400/60",
|
|
1201
|
+
draftStripeDark: "rgba(168,85,247,0.25)",
|
|
1202
|
+
draftStripeLight: "rgba(168,85,247,0.15)",
|
|
1203
|
+
nodeBgVar: "var(--ec-external-node-bg, rgb(var(--ec-card-bg)))",
|
|
1204
|
+
shadowColor: "rgba(168, 85, 247, 0.15)",
|
|
1205
|
+
badgeBg: "bg-purple-500",
|
|
1206
|
+
ownerAccent: "bg-purple-400",
|
|
1207
|
+
ownerBorder: "rgba(168,85,247,0.08)",
|
|
1208
|
+
ownerIcon: "text-purple-300"
|
|
1209
|
+
};
|
|
1149
1210
|
function PostItService(props) {
|
|
1150
|
-
const {
|
|
1211
|
+
const {
|
|
1212
|
+
version,
|
|
1213
|
+
name,
|
|
1214
|
+
summary,
|
|
1215
|
+
deprecated,
|
|
1216
|
+
draft,
|
|
1217
|
+
notes,
|
|
1218
|
+
specifications,
|
|
1219
|
+
externalSystem
|
|
1220
|
+
} = props.data.service;
|
|
1151
1221
|
const mode = props.data.mode || "simple";
|
|
1152
1222
|
const isDark = useDarkMode();
|
|
1223
|
+
const p = externalSystem ? POST_IT_EXTERNAL : POST_IT_SERVICE;
|
|
1153
1224
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
1154
1225
|
"div",
|
|
1155
1226
|
{
|
|
1156
1227
|
className: classNames(
|
|
1157
1228
|
"relative min-w-44 max-w-56 min-h-[120px]",
|
|
1158
|
-
props?.selected ?
|
|
1229
|
+
props?.selected ? p.ring : ""
|
|
1159
1230
|
),
|
|
1160
1231
|
children: [
|
|
1161
1232
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
@@ -1180,10 +1251,10 @@ function PostItService(props) {
|
|
|
1180
1251
|
{
|
|
1181
1252
|
className: "absolute inset-0",
|
|
1182
1253
|
style: {
|
|
1183
|
-
background:
|
|
1254
|
+
background: p.gradient,
|
|
1184
1255
|
boxShadow: "1px 1px 3px rgba(0,0,0,0.15), 3px 4px 8px rgba(0,0,0,0.08)",
|
|
1185
1256
|
transform: "rotate(1deg)",
|
|
1186
|
-
border: deprecated ? "2px dashed rgba(239, 68, 68, 0.5)" : draft ?
|
|
1257
|
+
border: deprecated ? "2px dashed rgba(239, 68, 68, 0.5)" : draft ? `2px dashed ${p.draftBorder}` : "none"
|
|
1187
1258
|
},
|
|
1188
1259
|
children: [
|
|
1189
1260
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { style: FOLDED_CORNER_SHADOW_STYLE }),
|
|
@@ -1198,7 +1269,7 @@ function PostItService(props) {
|
|
|
1198
1269
|
height: 0,
|
|
1199
1270
|
borderStyle: "solid",
|
|
1200
1271
|
borderWidth: "18px 0 0 18px",
|
|
1201
|
-
borderColor:
|
|
1272
|
+
borderColor: `${p.corner} transparent transparent transparent`,
|
|
1202
1273
|
opacity: 0.3
|
|
1203
1274
|
}
|
|
1204
1275
|
}
|
|
@@ -1209,14 +1280,8 @@ function PostItService(props) {
|
|
|
1209
1280
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "relative px-3.5 py-3", children: [
|
|
1210
1281
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex items-center justify-between mb-2", children: [
|
|
1211
1282
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
1212
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1213
|
-
|
|
1214
|
-
{
|
|
1215
|
-
className: "w-3 h-3 text-pink-900/50",
|
|
1216
|
-
strokeWidth: 2.5
|
|
1217
|
-
}
|
|
1218
|
-
),
|
|
1219
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "text-[8px] font-bold text-pink-900/50 uppercase tracking-widest", children: "Service" })
|
|
1283
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(p.Icon, { className: p.iconClass, strokeWidth: 2.5 }),
|
|
1284
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: p.labelClass, children: p.label })
|
|
1220
1285
|
] }),
|
|
1221
1286
|
draft && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "text-[8px] font-extrabold text-amber-900 bg-amber-100 border border-dashed border-amber-400 px-1.5 py-0.5 rounded uppercase", children: "Draft" }),
|
|
1222
1287
|
deprecated && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "text-[7px] font-bold text-white bg-red-500 border border-red-600 px-1.5 py-0.5 rounded uppercase", children: "Deprecated" })
|
|
@@ -1226,19 +1291,19 @@ function PostItService(props) {
|
|
|
1226
1291
|
{
|
|
1227
1292
|
className: classNames(
|
|
1228
1293
|
"text-[13px] font-bold leading-snug",
|
|
1229
|
-
deprecated ?
|
|
1294
|
+
deprecated ? p.nameTextDeprecated : p.nameText
|
|
1230
1295
|
),
|
|
1231
1296
|
children: name
|
|
1232
1297
|
}
|
|
1233
1298
|
),
|
|
1234
|
-
version && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className:
|
|
1299
|
+
version && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: p.versionClass, children: [
|
|
1235
1300
|
"v",
|
|
1236
1301
|
version
|
|
1237
1302
|
] }),
|
|
1238
1303
|
mode === "full" && summary && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1239
1304
|
"div",
|
|
1240
1305
|
{
|
|
1241
|
-
className:
|
|
1306
|
+
className: p.summaryClass,
|
|
1242
1307
|
style: LINE_CLAMP_STYLE,
|
|
1243
1308
|
title: summary,
|
|
1244
1309
|
children: summary
|
|
@@ -1251,7 +1316,16 @@ function PostItService(props) {
|
|
|
1251
1316
|
);
|
|
1252
1317
|
}
|
|
1253
1318
|
function DefaultService(props) {
|
|
1254
|
-
const {
|
|
1319
|
+
const {
|
|
1320
|
+
version,
|
|
1321
|
+
name,
|
|
1322
|
+
summary,
|
|
1323
|
+
deprecated,
|
|
1324
|
+
draft,
|
|
1325
|
+
notes,
|
|
1326
|
+
specifications,
|
|
1327
|
+
externalSystem
|
|
1328
|
+
} = props.data.service;
|
|
1255
1329
|
const mode = props.data.mode || "simple";
|
|
1256
1330
|
const owners = (0, import_react5.useMemo)(
|
|
1257
1331
|
() => normalizeOwners(props.data.service.owners),
|
|
@@ -1261,17 +1335,20 @@ function DefaultService(props) {
|
|
|
1261
1335
|
const sourceConnections = (0, import_react6.useNodeConnections)({ handleType: "source" });
|
|
1262
1336
|
const isDark = useDarkMode();
|
|
1263
1337
|
const deprecatedStripe = isDark ? "rgba(239,68,68,0.25)" : "rgba(239,68,68,0.1)";
|
|
1338
|
+
const p = externalSystem ? DEFAULT_EXTERNAL : DEFAULT_SERVICE;
|
|
1339
|
+
const draftStripe = isDark ? p.draftStripeDark : p.draftStripeLight;
|
|
1340
|
+
const borderDraft = isDark ? p.borderDraftDark : p.borderDraftLight;
|
|
1264
1341
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
1265
1342
|
"div",
|
|
1266
1343
|
{
|
|
1267
1344
|
className: classNames(
|
|
1268
1345
|
"relative min-w-48 max-w-60 rounded-xl border-2 overflow-visible",
|
|
1269
|
-
props?.selected ?
|
|
1270
|
-
deprecated ? "border-dashed border-red-500" : draft ?
|
|
1346
|
+
props?.selected ? p.ring : "",
|
|
1347
|
+
deprecated ? "border-dashed border-red-500" : draft ? borderDraft : p.borderSolid
|
|
1271
1348
|
),
|
|
1272
1349
|
style: {
|
|
1273
|
-
background: deprecated ? `repeating-linear-gradient(135deg, transparent, transparent 6px, ${deprecatedStripe} 6px, ${deprecatedStripe} 7px),
|
|
1274
|
-
boxShadow:
|
|
1350
|
+
background: deprecated ? `repeating-linear-gradient(135deg, transparent, transparent 6px, ${deprecatedStripe} 6px, ${deprecatedStripe} 7px), ${p.nodeBgVar}` : draft ? `repeating-linear-gradient(135deg, transparent, transparent 4px, ${draftStripe} 4px, ${draftStripe} 4.5px), repeating-linear-gradient(45deg, transparent, transparent 4px, ${draftStripe} 4px, ${draftStripe} 4.5px), ${p.nodeBgVar}` : p.nodeBgVar,
|
|
1351
|
+
boxShadow: `0 2px 12px ${p.shadowColor}`
|
|
1275
1352
|
},
|
|
1276
1353
|
children: [
|
|
1277
1354
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
@@ -1291,18 +1368,18 @@ function DefaultService(props) {
|
|
|
1291
1368
|
}
|
|
1292
1369
|
),
|
|
1293
1370
|
notes && notes.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(NotesIndicator, { notes, resourceName: name }),
|
|
1294
|
-
targetConnections.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(GlowHandle, { side: "left" }),
|
|
1295
|
-
sourceConnections.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(GlowHandle, { side: "right" }),
|
|
1371
|
+
targetConnections.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(GlowHandle, { side: "left", external: externalSystem }),
|
|
1372
|
+
sourceConnections.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(GlowHandle, { side: "right", external: externalSystem }),
|
|
1296
1373
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "absolute -top-2.5 left-2.5 flex items-center gap-1.5 z-10", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
1297
1374
|
"span",
|
|
1298
1375
|
{
|
|
1299
1376
|
className: classNames(
|
|
1300
1377
|
"inline-flex items-center gap-1 text-[7px] font-bold uppercase tracking-widest text-white px-1.5 py-0.5 rounded shadow-sm",
|
|
1301
|
-
deprecated ? "bg-red-500" :
|
|
1378
|
+
deprecated ? "bg-red-500" : p.badgeBg
|
|
1302
1379
|
),
|
|
1303
1380
|
children: [
|
|
1304
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1305
|
-
|
|
1381
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(p.Icon, { className: "w-2.5 h-2.5", strokeWidth: 2.5 }),
|
|
1382
|
+
p.label,
|
|
1306
1383
|
draft && " (Draft)",
|
|
1307
1384
|
deprecated && " (Deprecated)"
|
|
1308
1385
|
]
|
|
@@ -1331,9 +1408,9 @@ function DefaultService(props) {
|
|
|
1331
1408
|
OwnerIndicator,
|
|
1332
1409
|
{
|
|
1333
1410
|
owners,
|
|
1334
|
-
accentColor:
|
|
1335
|
-
borderColor:
|
|
1336
|
-
iconClass:
|
|
1411
|
+
accentColor: p.ownerAccent,
|
|
1412
|
+
borderColor: p.ownerBorder,
|
|
1413
|
+
iconClass: p.ownerIcon
|
|
1337
1414
|
}
|
|
1338
1415
|
),
|
|
1339
1416
|
!!specifications && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(SpecBadges, { specifications, isDark })
|