@huanban/rulego-editor-core 1.4.0 → 1.4.2

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.
@@ -1,6 +1,6 @@
1
- import { l as s } from "./vendor-logicflow-core-runtime-Cp6IBEjB.js";
2
- import { l as h } from "./vendor-logicflow-shared-C7YynLDn.js";
3
- const c = Object.freeze({
1
+ import { l as L } from "./vendor-logicflow-core-runtime-Cp6IBEjB.js";
2
+ import { l as T } from "./vendor-logicflow-shared-C7YynLDn.js";
3
+ const I = Object.freeze({
4
4
  "font-family": 'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif',
5
5
  "font-mono": 'ui-monospace, "SFMono-Regular", "Cascadia Code", Menlo, Monaco, Consolas, monospace',
6
6
  "font-size-xs": "11px",
@@ -36,13 +36,13 @@ const c = Object.freeze({
36
36
  "ease-out": "cubic-bezier(0.25, 1, 0.5, 1)",
37
37
  "ease-expo": "cubic-bezier(0.16, 1, 0.3, 1)"
38
38
  });
39
- function _(r) {
40
- const o = {};
41
- return Object.entries(c).forEach(([t, a]) => {
42
- o[`${r}-${t}`] = a;
43
- }), o;
39
+ function R(e) {
40
+ const t = {};
41
+ return Object.entries(I).forEach(([a, r]) => {
42
+ t[`${e}-${a}`] = r;
43
+ }), t;
44
44
  }
45
- const n = Object.freeze({
45
+ const k = Object.freeze({
46
46
  chrome: 10,
47
47
  localOverlay: 190,
48
48
  floating: 1e4,
@@ -54,7 +54,7 @@ const n = Object.freeze({
54
54
  optionPicker: 10040,
55
55
  confirmation: 10050,
56
56
  notification: 10060
57
- }), f = Object.freeze({
57
+ }), O = Object.freeze({
58
58
  chrome: "--hb-z-chrome",
59
59
  localOverlay: "--hb-z-local-overlay",
60
60
  floating: "--hb-z-floating",
@@ -66,10 +66,10 @@ const n = Object.freeze({
66
66
  optionPicker: "--hb-z-option-picker",
67
67
  confirmation: "--hb-z-confirmation",
68
68
  notification: "--hb-z-notification"
69
- }), x = `:root {
70
- ${Object.keys(n).map((r) => ` ${f[r]}: ${n[r]};`).join(`
69
+ }), D = `:root {
70
+ ${Object.keys(k).map((e) => ` ${O[e]}: ${k[e]};`).join(`
71
71
  `)}
72
- }`, g = _("--hb"), i = {
72
+ }`, $ = R("--hb"), h = {
73
73
  /* ==================== 默认亮色 ==================== */
74
74
  default: {
75
75
  label: "经典",
@@ -273,7 +273,7 @@ ${Object.keys(n).map((r) => ` ${f[r]}: ${n[r]};`).join(`
273
273
  }
274
274
  },
275
275
  /* ==================== 现代风格 ==================== */
276
- /* 参考 RuleChainEditor.vue 的视觉设计: 大圆角节点、蓝色选中发光、柔和阴影 */
276
+ /* 现代主题:大圆角节点、清晰选中态和柔和阴影 */
277
277
  modern: {
278
278
  label: "现代",
279
279
  labelEn: "Modern",
@@ -295,7 +295,7 @@ ${Object.keys(n).map((r) => ` ${f[r]}: ${n[r]};`).join(`
295
295
  "--hb-text-secondary": "#64748b",
296
296
  "--hb-text-muted": "#94a3b8",
297
297
  "--hb-text-disabled": "#cbd5e1",
298
- // 主题色 — 蓝色系 (参考 #3b82f6)
298
+ // 主题色 — 清晰的蓝色操作色
299
299
  "--hb-color-primary": "#3b82f6",
300
300
  "--hb-color-primary-light": "#bfdbfe",
301
301
  "--hb-color-primary-bg": "#eff6ff",
@@ -340,58 +340,282 @@ ${Object.keys(n).map((r) => ` ${f[r]}: ${n[r]};`).join(`
340
340
  }
341
341
  }
342
342
  };
343
- function e(r) {
343
+ function _(e) {
344
344
  return {
345
- "--hb-bg-root": r.root,
346
- "--hb-bg-toolbar": r.toolbar,
347
- "--hb-bg-sidebar": r.sidebar,
348
- "--hb-bg-canvas": r.canvas,
349
- "--hb-bg-drawer": r.toolbar,
350
- "--hb-bg-modal": r.toolbar,
351
- "--hb-bg-hover": r.hover,
352
- "--hb-bg-active": r.active,
353
- "--hb-bg-section": r.section,
354
- "--hb-bg-input": r.input,
355
- "--hb-bg-tag": r.tag,
356
- "--hb-text-primary": r.text,
357
- "--hb-text-secondary": r.secondary,
358
- "--hb-text-muted": r.muted,
359
- "--hb-text-disabled": r.disabled,
360
- "--hb-color-primary": r.primary,
361
- "--hb-color-primary-light": r.primaryLight,
362
- "--hb-color-primary-bg": r.primaryBg,
363
- "--hb-color-success": r.success,
364
- "--hb-color-warning": r.warning,
365
- "--hb-color-danger": r.danger,
366
- "--hb-color-title": r.title,
367
- "--hb-border-color": r.border,
368
- "--hb-border-light": r.borderLight,
369
- "--hb-border-strong": r.borderStrong,
370
- "--hb-radius-sm": r.radiusSm || "6px",
371
- "--hb-radius-md": r.radiusMd || "8px",
372
- "--hb-radius-lg": r.radiusLg || "10px",
373
- "--hb-shadow-sm": `0 1px 4px ${r.shadowColor}`,
374
- "--hb-shadow-md": `0 4px 12px ${r.shadowColor}`,
375
- "--hb-shadow-lg": `0 8px 28px ${r.shadowColor}`,
376
- "--hb-overlay": r.overlay,
377
- "--hb-node-selected-stroke": r.primary,
378
- "--hb-node-selected-shadow": `0 0 8px ${r.shadowColor}`,
345
+ "--hb-bg-root": e.root,
346
+ "--hb-bg-toolbar": e.toolbar,
347
+ "--hb-bg-sidebar": e.sidebar,
348
+ "--hb-bg-canvas": e.canvas,
349
+ "--hb-bg-drawer": e.toolbar,
350
+ "--hb-bg-modal": e.toolbar,
351
+ "--hb-bg-hover": e.hover,
352
+ "--hb-bg-active": e.active,
353
+ "--hb-bg-section": e.section,
354
+ "--hb-bg-input": e.input,
355
+ "--hb-bg-tag": e.tag,
356
+ "--hb-text-primary": e.text,
357
+ "--hb-text-secondary": e.secondary,
358
+ "--hb-text-muted": e.muted,
359
+ "--hb-text-disabled": e.disabled,
360
+ "--hb-color-primary": e.primary,
361
+ "--hb-color-primary-light": e.primaryLight,
362
+ "--hb-color-primary-bg": e.primaryBg,
363
+ "--hb-color-success": e.success,
364
+ "--hb-color-warning": e.warning,
365
+ "--hb-color-danger": e.danger,
366
+ "--hb-color-title": e.title,
367
+ "--hb-border-color": e.border,
368
+ "--hb-border-light": e.borderLight,
369
+ "--hb-border-strong": e.borderStrong,
370
+ "--hb-radius-sm": e.radiusSm || "6px",
371
+ "--hb-radius-md": e.radiusMd || "8px",
372
+ "--hb-radius-lg": e.radiusLg || "10px",
373
+ "--hb-shadow-sm": `0 1px 4px ${e.shadowColor}`,
374
+ "--hb-shadow-md": `0 4px 12px ${e.shadowColor}`,
375
+ "--hb-shadow-lg": `0 8px 28px ${e.shadowColor}`,
376
+ "--hb-overlay": e.overlay,
377
+ "--hb-node-selected-stroke": e.primary,
378
+ "--hb-node-selected-shadow": `0 0 8px ${e.shadowColor}`,
379
379
  "--hb-node-hover-brightness": "0.96",
380
- "--hb-node-radius": r.radiusMd || "8px",
380
+ "--hb-node-radius": e.radiusMd || "8px",
381
381
  "--hb-node-shadow-offset": "2px",
382
- "--hb-port-fill": r.input,
383
- "--hb-port-stroke": r.muted,
384
- "--hb-port-hover-fill": r.primary,
385
- "--hb-port-hover-stroke": r.primary,
386
- "--hb-edge-stroke": r.muted,
387
- "--hb-edge-hover-stroke": r.primary
382
+ "--hb-port-fill": e.input,
383
+ "--hb-port-stroke": e.muted,
384
+ "--hb-port-hover-fill": e.primary,
385
+ "--hb-port-hover-stroke": e.primary,
386
+ "--hb-edge-stroke": e.muted,
387
+ "--hb-edge-hover-stroke": e.primary
388
388
  };
389
389
  }
390
- Object.assign(i, {
390
+ const v = /* @__PURE__ */ new Set(["dark", "tech", "vscode"]);
391
+ function j(e) {
392
+ const t = h[e], a = (t == null ? void 0 : t.vars) || {}, r = v.has(e), i = a["--hb-color-primary"] || "#409eff", d = a["--hb-text-muted"] || "#909399", l = a["--hb-bg-toolbar"] || "#ffffff";
393
+ return {
394
+ "--hb-canvas-grid-color": a["--hb-canvas-grid-color"] || (r ? "rgba(148,163,184,0.22)" : "rgba(100,116,139,0.16)"),
395
+ "--hb-canvas-grid-size": a["--hb-canvas-grid-size"] || "20px",
396
+ "--hb-node-selected-stroke": a["--hb-node-selected-stroke"] || i,
397
+ "--hb-node-selected-shadow": a["--hb-node-selected-shadow"] || `0 0 0 2px ${i}, 0 4px 16px ${r ? "rgba(0,0,0,0.38)" : "rgba(15,23,42,0.16)"}`,
398
+ "--hb-node-selected-filter": a["--hb-node-selected-filter"] || `drop-shadow(0 0 5px ${r ? i : `${i}55`})`,
399
+ "--hb-node-hover-brightness": a["--hb-node-hover-brightness"] || (r ? "1.08" : "0.98"),
400
+ "--hb-node-radius": a["--hb-node-radius"] || a["--hb-radius-md"] || "8px",
401
+ "--hb-node-border": a["--hb-node-border"] || a["--hb-border-color"] || "#dcdfe6",
402
+ "--hb-node-shadow-offset": a["--hb-node-shadow-offset"] || "2px",
403
+ "--hb-node-shadow-color": a["--hb-node-shadow-color"] || (r ? "rgba(0,0,0,0.34)" : "rgba(15,23,42,0.14)"),
404
+ "--hb-node-icon-bg": a["--hb-node-icon-bg"] || (r ? "rgba(255,255,255,0.08)" : "rgba(15,23,42,0.06)"),
405
+ "--hb-node-icon-divider": a["--hb-node-icon-divider"] || (r ? "rgba(255,255,255,0.16)" : "rgba(15,23,42,0.10)"),
406
+ "--hb-node-text": a["--hb-node-text"] || a["--hb-text-primary"] || "#333333",
407
+ "--hb-port-fill": a["--hb-port-fill"] || l,
408
+ "--hb-port-stroke": a["--hb-port-stroke"] || d,
409
+ "--hb-port-radius": a["--hb-port-radius"] || (e === "modern" || e === "apple" ? "50%" : "3px"),
410
+ "--hb-port-hover-fill": a["--hb-port-hover-fill"] || i,
411
+ "--hb-port-hover-stroke": a["--hb-port-hover-stroke"] || i,
412
+ "--hb-edge-stroke": a["--hb-edge-stroke"] || d,
413
+ "--hb-edge-hover-stroke": a["--hb-edge-hover-stroke"] || i,
414
+ "--hb-edge-selected-stroke": a["--hb-edge-selected-stroke"] || i,
415
+ "--hb-edge-label-bg": a["--hb-edge-label-bg"] || l,
416
+ "--hb-edge-label-color": a["--hb-edge-label-color"] || a["--hb-text-secondary"] || d
417
+ };
418
+ }
419
+ function o(e, t, a) {
420
+ return e[t] || a;
421
+ }
422
+ function q(e) {
423
+ const t = u(e), a = h[t], r = { ...a == null ? void 0 : a.vars, ...j(t) }, i = o(r, "--hb-color-primary", "#409eff"), d = o(r, "--hb-color-danger", "#f56c6c"), l = o(r, "--hb-color-warning", "#e6a23c"), f = o(r, "--hb-color-success", "#67c23a"), p = o(r, "--hb-text-muted", "#909399"), b = o(r, "--hb-text-primary", "#333333"), g = o(r, "--hb-text-secondary", "#606266"), n = o(r, "--hb-bg-toolbar", "#ffffff");
424
+ return {
425
+ "--rg-bg-primary": o(r, "--hb-bg-root", n),
426
+ "--rg-bg-secondary": o(r, "--hb-bg-section", n),
427
+ "--rg-bg-tertiary": o(r, "--hb-bg-tag", n),
428
+ "--rg-bg-hover": o(r, "--hb-bg-hover", n),
429
+ "--rg-bg-active": o(r, "--hb-bg-active", n),
430
+ "--rg-bg-overlay": o(r, "--hb-overlay", "rgba(0,0,0,0.3)"),
431
+ "--rg-text-primary": b,
432
+ "--rg-text-secondary": g,
433
+ "--rg-text-tertiary": p,
434
+ "--rg-text-inverse": "#ffffff",
435
+ "--rg-text-link": i,
436
+ "--rg-text-link-hover": i,
437
+ "--rg-border-primary": o(r, "--hb-border-color", "#dcdfe6"),
438
+ "--rg-border-secondary": o(r, "--hb-border-strong", "#cbd5e1"),
439
+ "--rg-border-focus": i,
440
+ "--rg-border-error": d,
441
+ "--rg-border-radius": o(r, "--hb-radius-md", "8px"),
442
+ "--rg-border-radius-sm": o(r, "--hb-radius-sm", "4px"),
443
+ "--rg-border-radius-lg": o(r, "--hb-radius-lg", "12px"),
444
+ "--rg-border-radius-xl": o(r, "--hb-radius-lg", "12px"),
445
+ "--rg-shadow-sm": o(r, "--hb-shadow-sm", "0 1px 4px rgba(0,0,0,0.08)"),
446
+ "--rg-shadow-md": o(r, "--hb-shadow-md", "0 4px 12px rgba(0,0,0,0.12)"),
447
+ "--rg-shadow-lg": o(r, "--hb-shadow-lg", "0 8px 28px rgba(0,0,0,0.15)"),
448
+ "--rg-shadow-xl": o(r, "--hb-shadow-lg", "0 8px 28px rgba(0,0,0,0.15)"),
449
+ "--rg-shadow-focus": `0 0 0 3px ${i}44`,
450
+ "--rg-shadow-inset": "inset 0 2px 4px rgba(0,0,0,0.04)",
451
+ "--rg-canvas-bg": o(r, "--hb-bg-canvas", n),
452
+ "--rg-canvas-grid-color": o(r, "--hb-canvas-grid-color", "#e8eaee"),
453
+ "--rg-canvas-grid-size": o(r, "--hb-canvas-grid-size", "20px"),
454
+ "--rg-node-filter-bg": o(r, "--hb-bg-tag", n),
455
+ "--rg-node-filter-border": l,
456
+ "--rg-node-filter-text": b,
457
+ "--rg-node-transform-bg": o(r, "--hb-color-primary-bg", n),
458
+ "--rg-node-transform-border": i,
459
+ "--rg-node-transform-text": b,
460
+ "--rg-node-action-bg": o(r, "--hb-color-primary-bg", n),
461
+ "--rg-node-action-border": d,
462
+ "--rg-node-action-text": b,
463
+ "--rg-node-external-bg": o(r, "--hb-bg-tag", n),
464
+ "--rg-node-external-border": l,
465
+ "--rg-node-external-text": b,
466
+ "--rg-node-flow-bg": o(r, "--hb-color-primary-bg", n),
467
+ "--rg-node-flow-border": i,
468
+ "--rg-node-flow-text": b,
469
+ "--rg-node-start-bg": i,
470
+ "--rg-node-start-border": i,
471
+ "--rg-node-start-text": "#ffffff",
472
+ "--rg-node-border": o(r, "--hb-border-color", "#dcdfe6"),
473
+ "--rg-node-shadow": o(r, "--hb-shadow-md", "0 4px 12px rgba(0,0,0,0.12)"),
474
+ "--rg-node-shadow-hover": o(r, "--hb-shadow-lg", "0 8px 28px rgba(0,0,0,0.15)"),
475
+ "--rg-node-shadow-selected": o(r, "--hb-node-selected-shadow", `0 0 0 2px ${i}`),
476
+ "--rg-node-shadow-color": o(r, "--hb-node-shadow-color", "rgba(0,0,0,0.14)"),
477
+ "--rg-node-selected-filter": o(r, "--hb-node-selected-filter", "none"),
478
+ "--rg-node-width": "120px",
479
+ "--rg-node-min-height": "30px",
480
+ "--rg-node-font-size": o(r, "--hb-font-size-base", "13px"),
481
+ "--rg-edge-color": o(r, "--hb-edge-stroke", p),
482
+ "--rg-edge-color-hover": o(r, "--hb-edge-hover-stroke", i),
483
+ "--rg-edge-color-selected": o(r, "--hb-edge-selected-stroke", i),
484
+ "--rg-edge-width": "2px",
485
+ "--rg-edge-label-bg": o(r, "--hb-edge-label-bg", n),
486
+ "--rg-edge-label-color": o(r, "--hb-edge-label-color", g),
487
+ "--rg-edge-label-font-size": "11px",
488
+ "--rg-toolbar-bg": n,
489
+ "--rg-toolbar-border": o(r, "--hb-border-color", "#dcdfe6"),
490
+ "--rg-toolbar-shadow": o(r, "--hb-shadow-sm", "0 2px 8px rgba(0,0,0,0.06)"),
491
+ "--rg-toolbar-btn-bg": "transparent",
492
+ "--rg-toolbar-btn-bg-hover": o(r, "--hb-bg-hover", n),
493
+ "--rg-toolbar-btn-bg-active": o(r, "--hb-bg-active", n),
494
+ "--rg-toolbar-btn-color": g,
495
+ "--rg-toolbar-btn-color-hover": i,
496
+ "--rg-toolbar-btn-radius": o(r, "--hb-radius-sm", "6px"),
497
+ "--rg-sidebar-bg": o(r, "--hb-bg-sidebar", n),
498
+ "--rg-sidebar-border": o(r, "--hb-border-color", "#dcdfe6"),
499
+ "--rg-sidebar-width": "200px",
500
+ "--rg-sidebar-item-bg-hover": o(r, "--hb-bg-hover", n),
501
+ "--rg-sidebar-item-bg-active": o(r, "--hb-bg-active", n),
502
+ "--rg-sidebar-group-header-bg": o(r, "--hb-bg-section", n),
503
+ "--rg-panel-bg": o(r, "--hb-bg-drawer", n),
504
+ "--rg-panel-border": o(r, "--hb-border-color", "#dcdfe6"),
505
+ "--rg-panel-width": "320px",
506
+ "--rg-panel-shadow": o(r, "--hb-shadow-md", "0 4px 12px rgba(0,0,0,0.12)"),
507
+ "--rg-input-bg": o(r, "--hb-bg-input", n),
508
+ "--rg-input-border": o(r, "--hb-border-color", "#dcdfe6"),
509
+ "--rg-input-border-focus": i,
510
+ "--rg-input-text": b,
511
+ "--rg-input-placeholder": p,
512
+ "--rg-input-shadow-focus": `0 0 0 3px ${i}33`,
513
+ "--rg-btn-primary-bg": i,
514
+ "--rg-btn-primary-bg-hover": i,
515
+ "--rg-btn-primary-text": "#ffffff",
516
+ "--rg-btn-primary-shadow": o(r, "--hb-shadow-sm", "0 2px 6px rgba(0,0,0,0.10)"),
517
+ "--rg-btn-secondary-bg": n,
518
+ "--rg-btn-secondary-bg-hover": o(r, "--hb-bg-hover", n),
519
+ "--rg-btn-secondary-text": b,
520
+ "--rg-btn-danger-bg": d,
521
+ "--rg-btn-danger-bg-hover": d,
522
+ "--rg-btn-danger-text": "#ffffff",
523
+ "--rg-color-success": f,
524
+ "--rg-color-warning": l,
525
+ "--rg-color-error": d,
526
+ "--rg-color-info": i,
527
+ // editor-ui 历史变量别名。保留别名可让纯 DOM UI 与 Core/standalone
528
+ // 使用同一套主题,不再只在 light/dark 两套固定样式之间切换。
529
+ "--rg-primary-color": i,
530
+ "--rg-success-color": f,
531
+ "--rg-warning-color": l,
532
+ "--rg-danger-color": d,
533
+ "--rg-text-color": b,
534
+ "--rg-border-color": o(r, "--hb-border-color", "#dcdfe6"),
535
+ "--rg-hover-bg": o(r, "--hb-bg-hover", n),
536
+ "--rg-active-bg": o(r, "--hb-bg-active", n),
537
+ "--rg-badge-bg": o(r, "--hb-bg-tag", n),
538
+ "--rg-switch-off-bg": o(r, "--hb-text-disabled", "#c0c4cc"),
539
+ "--rg-console-bg": x(t) ? "#10131a" : "#1f2937",
540
+ "--rg-console-text": x(t) ? "#e5edf7" : "#f8fafc",
541
+ "--rg-transition-fast": o(r, "--hb-duration-fast", "100ms"),
542
+ "--rg-transition-normal": o(r, "--hb-duration", "160ms"),
543
+ "--rg-transition-slow": o(r, "--hb-duration-slow", "240ms")
544
+ };
545
+ }
546
+ function x(e) {
547
+ return v.has(u(e));
548
+ }
549
+ function C(e) {
550
+ const t = u(e), a = h[t], r = {
551
+ ...$,
552
+ ...(a == null ? void 0 : a.vars) || {},
553
+ ...j(t)
554
+ }, i = q(t), d = o(r, "--hb-color-primary", "#409eff"), l = o(r, "--hb-color-success", "#67c23a"), f = o(r, "--hb-color-warning", "#e6a23c"), p = o(r, "--hb-color-danger", "#f56c6c"), b = o(r, "--hb-text-primary", "#303133"), g = o(r, "--hb-text-secondary", "#606266"), n = o(r, "--hb-text-muted", "#909399"), M = o(r, "--hb-text-disabled", "#c0c4cc"), s = o(r, "--hb-bg-toolbar", "#ffffff"), c = o(r, "--hb-bg-section", "#f8fafc"), m = o(r, "--hb-border-color", "#dcdfe6"), w = o(r, "--hb-border-light", "#ebeef5"), E = o(r, "--hb-radius-md", "8px"), y = o(r, "--hb-shadow-md", "0 4px 12px rgba(0,0,0,0.12)"), S = x(t) ? "#10131a" : "#f6f8fa";
555
+ return {
556
+ ...r,
557
+ ...i,
558
+ "--hb-bg-panel": s,
559
+ "--hb-bg-muted": c,
560
+ "--hb-border": m,
561
+ "--hb-success": l,
562
+ "--hb-warning": f,
563
+ "--hb-danger": p,
564
+ "--hb-warning-soft": o(r, "--hb-bg-tag", c),
565
+ "--rge-bg": o(r, "--hb-bg-root", s),
566
+ "--rge-surface": s,
567
+ "--rge-surface-muted": c,
568
+ "--rge-panel-bg": c,
569
+ "--rge-toolbar-bg": s,
570
+ "--rge-border": m,
571
+ "--rge-border-light": w,
572
+ "--rge-text": b,
573
+ "--rge-text-secondary": g,
574
+ "--rge-text-muted": n,
575
+ "--rge-text-disabled": M,
576
+ "--rge-primary": d,
577
+ "--rge-primary-soft": o(r, "--hb-color-primary-bg", c),
578
+ "--rge-success": l,
579
+ "--rge-warning": f,
580
+ "--rge-danger": p,
581
+ "--rge-danger-soft": `color-mix(in srgb, ${p} 10%, transparent)`,
582
+ "--rge-shadow-dropdown": y,
583
+ "--rge-code-bg": S,
584
+ "--rge-code-inline-bg": x(t) ? "rgba(255,255,255,0.08)" : "rgba(15,23,42,0.08)",
585
+ "--huanban-rg-bg": o(r, "--hb-bg-root", s),
586
+ "--huanban-rg-surface": c,
587
+ "--huanban-rg-card": s,
588
+ "--huanban-rg-text": b,
589
+ "--huanban-rg-text-secondary": g,
590
+ "--huanban-rg-text-muted": n,
591
+ "--huanban-rg-border": m,
592
+ "--huanban-rg-border-soft": w,
593
+ "--huanban-rg-primary": d,
594
+ "--huanban-rg-danger": p,
595
+ "--huanban-rg-success": l,
596
+ "--huanban-rg-warning": f,
597
+ "--huanban-rg-row-bg": s,
598
+ "--huanban-rg-row-hover": o(r, "--hb-bg-hover", c),
599
+ "--huanban-rg-input-bg": o(r, "--hb-bg-input", s),
600
+ "--huanban-rg-icon-bg": d,
601
+ "--huanban-rg-shadow": y,
602
+ "--huanban-rg-radius": E
603
+ };
604
+ }
605
+ function X(e) {
606
+ const t = u(e), a = h[t];
607
+ return {
608
+ name: t,
609
+ label: (a == null ? void 0 : a.labelEn) || t,
610
+ isDark: v.has(t),
611
+ variables: C(t)
612
+ };
613
+ }
614
+ Object.assign(h, {
391
615
  colorful: {
392
616
  label: "彩色",
393
617
  labelEn: "Colorful",
394
- vars: e({
618
+ vars: _({
395
619
  root: "#f8fafc",
396
620
  toolbar: "#ffffff",
397
621
  sidebar: "#ffffff",
@@ -422,7 +646,7 @@ Object.assign(i, {
422
646
  "ant-blue": {
423
647
  label: "蚂蚁蓝",
424
648
  labelEn: "Ant Blue",
425
- vars: e({
649
+ vars: _({
426
650
  root: "#f0f7ff",
427
651
  toolbar: "#ffffff",
428
652
  sidebar: "#f7fbff",
@@ -456,7 +680,7 @@ Object.assign(i, {
456
680
  material: {
457
681
  label: "Material",
458
682
  labelEn: "Material",
459
- vars: e({
683
+ vars: _({
460
684
  root: "#f8fbff",
461
685
  toolbar: "#ffffff",
462
686
  sidebar: "#ffffff",
@@ -490,7 +714,7 @@ Object.assign(i, {
490
714
  tailwind: {
491
715
  label: "Tailwind",
492
716
  labelEn: "Tailwind",
493
- vars: e({
717
+ vars: _({
494
718
  root: "#f8fafc",
495
719
  toolbar: "#ffffff",
496
720
  sidebar: "#ffffff",
@@ -524,7 +748,7 @@ Object.assign(i, {
524
748
  github: {
525
749
  label: "GitHub",
526
750
  labelEn: "GitHub",
527
- vars: e({
751
+ vars: _({
528
752
  root: "#f6f8fa",
529
753
  toolbar: "#ffffff",
530
754
  sidebar: "#ffffff",
@@ -558,7 +782,7 @@ Object.assign(i, {
558
782
  vscode: {
559
783
  label: "VS Code",
560
784
  labelEn: "VS Code",
561
- vars: e({
785
+ vars: _({
562
786
  root: "#1e1e1e",
563
787
  toolbar: "#252526",
564
788
  sidebar: "#252526",
@@ -592,7 +816,7 @@ Object.assign(i, {
592
816
  apple: {
593
817
  label: "苹果",
594
818
  labelEn: "Apple",
595
- vars: e({
819
+ vars: _({
596
820
  root: "#f5f5f7",
597
821
  toolbar: "#ffffff",
598
822
  sidebar: "#fbfbfd",
@@ -624,7 +848,7 @@ Object.assign(i, {
624
848
  })
625
849
  }
626
850
  });
627
- const u = {
851
+ const F = {
628
852
  light: "default",
629
853
  classic: "default",
630
854
  blue: "tech",
@@ -638,43 +862,43 @@ const u = {
638
862
  mac: "apple",
639
863
  macos: "apple"
640
864
  };
641
- function w(r) {
642
- const o = String(r || "").trim().toLowerCase();
643
- return o ? Object.prototype.hasOwnProperty.call(i, o) ? o : u[o] || "default" : "default";
644
- }
645
- function m() {
646
- let r = "";
647
- for (const [o, t] of Object.entries(i)) {
648
- const a = o === "default" ? '.huanban_rulego_editor_root, .huanban_rulego_editor_root[data-theme="default"]' : `.huanban_rulego_editor_root[data-theme="${o}"]`, l = Object.entries({ ...g, ...t.vars }).map(([b, p]) => ` ${b}: ${p};`).join(`
865
+ function u(e) {
866
+ const t = String(e || "").trim().toLowerCase();
867
+ return t ? Object.prototype.hasOwnProperty.call(h, t) ? t : F[t] || "default" : "default";
868
+ }
869
+ function Y() {
870
+ let e = "";
871
+ for (const t of Object.keys(h)) {
872
+ const a = t === "default" ? '.huanban_rulego_editor_root, .huanban_rulego_editor_root[data-theme="default"]' : `.huanban_rulego_editor_root[data-theme="${t}"]`, r = Object.entries(C(t)).map(([i, d]) => ` ${i}: ${d};`).join(`
649
873
  `);
650
- r += `${a} {
651
- ${l}
874
+ e += `${a} {
875
+ ${r}
652
876
  }
653
877
 
654
878
  `;
655
879
  }
656
- return r;
880
+ return e;
657
881
  }
658
- function k(r) {
659
- const o = r.toLowerCase().includes("en");
660
- return Object.entries(i).map(([t, a]) => ({
661
- id: t,
662
- label: o ? a.labelEn : a.label
882
+ function V(e) {
883
+ const t = e.toLowerCase().includes("en");
884
+ return Object.entries(h).map(([a, r]) => ({
885
+ id: a,
886
+ label: t ? r.labelEn : r.label
663
887
  }));
664
888
  }
665
- let d = !1;
666
- function z() {
667
- if (d) return;
668
- d = !0;
669
- const r = document.createElement("style");
670
- r.id = "huanban_rulego_editor_styles", r.textContent = `
889
+ let z = !1;
890
+ function N() {
891
+ if (z) return;
892
+ z = !0;
893
+ const e = document.createElement("style");
894
+ e.id = "huanban_rulego_editor_styles", e.textContent = `
671
895
  /* ========== LogicFlow 内置样式 ========== */
672
- ${s}
673
- ${h}
896
+ ${L}
897
+ ${T}
674
898
 
675
899
  /* ========== 主题 CSS 变量 ========== */
676
- ${x}
677
- ${m()}
900
+ ${D}
901
+ ${Y()}
678
902
 
679
903
 
680
904
  /* ========== 编辑器根容器 ========== */
@@ -971,12 +1195,15 @@ ${m()}
971
1195
  /* Node-RED 节点块 */
972
1196
  .huanban_rulego_editor_node_block {
973
1197
  cursor: move; margin: 6px auto; height: 25px;
974
- border-radius: 5px; border: 1px solid #999;
1198
+ border-radius: var(--hb-node-radius, 5px); border: 1px solid var(--hb-node-border, var(--hb-border-color, #999));
975
1199
  width: 90%; position: relative; user-select: none;
976
- transition: box-shadow 0.15s;
1200
+ box-shadow: var(--hb-shadow-sm, 0 1px 4px rgba(0,0,0,0.08));
1201
+ transition: box-shadow var(--hb-duration, 160ms) var(--hb-ease-out, ease-out), transform var(--hb-duration-fast, 100ms) var(--hb-ease-out, ease-out), border-color var(--hb-duration, 160ms) var(--hb-ease-out, ease-out);
977
1202
  }
978
1203
  .huanban_rulego_editor_node_block:hover {
979
- box-shadow: 0 1px 4px rgba(0,0,0,0.15);
1204
+ box-shadow: var(--hb-shadow-md, 0 4px 12px rgba(0,0,0,0.12));
1205
+ border-color: var(--hb-color-primary, #409eff);
1206
+ transform: translateY(-1px);
980
1207
  }
981
1208
  .huanban_rulego_editor_node_block:focus-visible {
982
1209
  outline: 2px solid var(--hb-color-primary, #409eff);
@@ -992,9 +1219,9 @@ ${m()}
992
1219
 
993
1220
  .huanban_rulego_editor_node_icon_area {
994
1221
  position: absolute; top: 0; bottom: 0; left: 0; width: 30px;
995
- border-right: 1px solid rgba(0,0,0,0.05);
996
- background-color: rgba(0,0,0,0.05);
997
- border-radius: 5px 0 0 5px;
1222
+ border-right: 1px solid var(--hb-node-icon-divider, rgba(0,0,0,0.05));
1223
+ background-color: var(--hb-node-icon-bg, rgba(0,0,0,0.05));
1224
+ border-radius: var(--hb-node-radius, 5px) 0 0 var(--hb-node-radius, 5px);
998
1225
  display: flex; align-items: center; justify-content: center;
999
1226
  }
1000
1227
  /* 分类标题和组件图标 */
@@ -1018,11 +1245,17 @@ ${m()}
1018
1245
  /* 端口小方块 */
1019
1246
  .huanban_rulego_editor_port {
1020
1247
  position: absolute; top: 8px; left: -5px;
1021
- background: #d9d9d9; border-radius: 3px;
1022
- width: 10px; height: 10px; border: 1px solid #999;
1248
+ background: var(--hb-port-fill, #d9d9d9); border-radius: var(--hb-port-radius, 3px);
1249
+ width: 10px; height: 10px; border: 1px solid var(--hb-port-stroke, #999);
1023
1250
  box-sizing: border-box;
1251
+ transition: background var(--hb-duration-fast, 100ms) ease, border-color var(--hb-duration-fast, 100ms) ease, transform var(--hb-duration-fast, 100ms) ease;
1024
1252
  }
1025
1253
  .huanban_rulego_editor_port_output { left: auto; right: -6px; }
1254
+ .huanban_rulego_editor_port:hover {
1255
+ background: var(--hb-port-hover-fill, var(--hb-color-primary, #409eff));
1256
+ border-color: var(--hb-port-hover-stroke, var(--hb-color-primary, #409eff));
1257
+ transform: scale(1.2);
1258
+ }
1026
1259
 
1027
1260
  /* ========== 画布 ========== */
1028
1261
  .huanban_rulego_editor_canvas {
@@ -1337,11 +1570,14 @@ ${m()}
1337
1570
 
1338
1571
  /* ========== Node-RED 风格画布样式 ========== */
1339
1572
  .custom-anchor {
1340
- stroke: #999; stroke-width: 1; fill: #d9d9d9;
1573
+ stroke: var(--hb-port-stroke, #999); stroke-width: 1.25; fill: var(--hb-port-fill, #d9d9d9);
1341
1574
  cursor: crosshair; rx: 3; ry: 3;
1575
+ transition: fill var(--hb-duration-fast, 100ms) ease, stroke var(--hb-duration-fast, 100ms) ease, transform var(--hb-duration-fast, 100ms) ease;
1342
1576
  }
1343
1577
  .custom-anchor:hover {
1344
- fill: #ff7f0e; stroke: #ff7f0e;
1578
+ fill: var(--hb-port-hover-fill, var(--hb-color-primary, #ff7f0e));
1579
+ stroke: var(--hb-port-hover-stroke, var(--hb-color-primary, #ff7f0e));
1580
+ transform: scale(1.15);
1345
1581
  }
1346
1582
  .node-red-start {
1347
1583
  cursor: pointer; pointer-events: all;
@@ -8478,7 +8714,7 @@ ${m()}
8478
8714
 
8479
8715
  /* ========================================================================
8480
8716
  现代主题 (data-theme="modern") — 节点 & 画布视觉增强
8481
- 参考 RuleChainEditor.vue 的节点设计风格:
8717
+ 设计重点:
8482
8718
  - 节点更大圆角 (10px)
8483
8719
  - 选中蓝色发光 (#3b82f6 glow)
8484
8720
  - 端口从方块变为圆形, hover 放大变蓝
@@ -8827,15 +9063,18 @@ ${m()}
8827
9063
  grid-template-columns: minmax(0, 1fr);
8828
9064
  }
8829
9065
  }
8830
- `, document.head.appendChild(r);
9066
+ `, document.head.appendChild(e);
8831
9067
  }
8832
9068
  export {
8833
- n as E,
8834
- i as T,
8835
- x as a,
8836
- f as b,
8837
- _ as c,
8838
- k as g,
8839
- z as i,
8840
- w as n
9069
+ k as E,
9070
+ h as T,
9071
+ V as a,
9072
+ X as b,
9073
+ R as c,
9074
+ D as d,
9075
+ O as e,
9076
+ C as f,
9077
+ q as g,
9078
+ N as i,
9079
+ u as n
8841
9080
  };