@timeax/service-builder 0.2.1 → 0.2.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.
- package/dist/index.js +1227 -926
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -409,8 +409,150 @@ function AlertDialogCancel({
|
|
|
409
409
|
);
|
|
410
410
|
}
|
|
411
411
|
|
|
412
|
+
// src/workspace/permissions.ts
|
|
413
|
+
var BUILDER_PERMISSIONS = {
|
|
414
|
+
WORKSPACE_READ: "workspace.read",
|
|
415
|
+
WORKSPACE_WRITE: "workspace.write",
|
|
416
|
+
BRANCHES_READ: "branches.read",
|
|
417
|
+
BRANCHES_CREATE: "branches.create",
|
|
418
|
+
BRANCHES_WRITE: "branches.write",
|
|
419
|
+
BRANCHES_DELETE: "branches.delete",
|
|
420
|
+
BRANCHES_MERGE: "branches.merge",
|
|
421
|
+
BRANCHES_PUBLISH: "branches.publish",
|
|
422
|
+
BRANCHES_MANAGE: "branches.manage",
|
|
423
|
+
TEMPLATES_READ: "templates.read",
|
|
424
|
+
TEMPLATES_WRITE: "templates.write",
|
|
425
|
+
TEMPLATES_DELETE: "templates.delete",
|
|
426
|
+
TEMPLATES_MANAGE: "templates.manage",
|
|
427
|
+
COMMENTS_READ: "comments.read",
|
|
428
|
+
COMMENTS_WRITE: "comments.write",
|
|
429
|
+
COMMENTS_MODERATE: "comments.moderate",
|
|
430
|
+
POLICIES_READ: "policies.read",
|
|
431
|
+
POLICIES_WRITE: "policies.write",
|
|
432
|
+
POLICIES_MANAGE: "policies.manage",
|
|
433
|
+
PARTICIPANTS_READ: "participants.read",
|
|
434
|
+
PARTICIPANTS_WRITE: "participants.write",
|
|
435
|
+
PARTICIPANTS_MANAGE: "participants.manage",
|
|
436
|
+
SERVICES_READ: "services.read"
|
|
437
|
+
};
|
|
438
|
+
var BUILDER_PERMISSION_KEYS = new Set(Object.values(BUILDER_PERMISSIONS));
|
|
439
|
+
function toBuilderPermissionsMap(permissions2) {
|
|
440
|
+
if (!permissions2) return {};
|
|
441
|
+
const result = {};
|
|
442
|
+
for (const [key, value] of Object.entries(permissions2)) {
|
|
443
|
+
if (!BUILDER_PERMISSION_KEYS.has(key)) continue;
|
|
444
|
+
result[key] = value === true;
|
|
445
|
+
}
|
|
446
|
+
return result;
|
|
447
|
+
}
|
|
448
|
+
function can(map, permission) {
|
|
449
|
+
if (!map) return false;
|
|
450
|
+
return map[permission] === true;
|
|
451
|
+
}
|
|
452
|
+
function canReadWorkspace(map) {
|
|
453
|
+
return can(map, BUILDER_PERMISSIONS.WORKSPACE_READ);
|
|
454
|
+
}
|
|
455
|
+
function canEditBranch(map) {
|
|
456
|
+
return can(map, BUILDER_PERMISSIONS.BRANCHES_WRITE);
|
|
457
|
+
}
|
|
458
|
+
function canCreateBranch(map) {
|
|
459
|
+
return can(map, BUILDER_PERMISSIONS.BRANCHES_CREATE);
|
|
460
|
+
}
|
|
461
|
+
function canMergeBranch(map) {
|
|
462
|
+
return can(map, BUILDER_PERMISSIONS.BRANCHES_MERGE);
|
|
463
|
+
}
|
|
464
|
+
function canPublishBranch(map) {
|
|
465
|
+
return can(map, BUILDER_PERMISSIONS.BRANCHES_PUBLISH);
|
|
466
|
+
}
|
|
467
|
+
function canDeleteBranch(map) {
|
|
468
|
+
return can(map, BUILDER_PERMISSIONS.BRANCHES_DELETE);
|
|
469
|
+
}
|
|
470
|
+
function canManageBranches(map) {
|
|
471
|
+
return can(map, BUILDER_PERMISSIONS.BRANCHES_MANAGE);
|
|
472
|
+
}
|
|
473
|
+
function canWriteTemplates(map) {
|
|
474
|
+
return can(map, BUILDER_PERMISSIONS.TEMPLATES_WRITE);
|
|
475
|
+
}
|
|
476
|
+
function canManageTemplates(map) {
|
|
477
|
+
return can(map, BUILDER_PERMISSIONS.TEMPLATES_MANAGE);
|
|
478
|
+
}
|
|
479
|
+
function canReadComments(map) {
|
|
480
|
+
return can(map, BUILDER_PERMISSIONS.COMMENTS_READ);
|
|
481
|
+
}
|
|
482
|
+
function canWriteComments(map) {
|
|
483
|
+
return can(map, BUILDER_PERMISSIONS.COMMENTS_WRITE);
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
// src/workspace/authorization.ts
|
|
487
|
+
function resolveActorAuthorId(actor, authors2) {
|
|
488
|
+
if (!actor) return "unknown";
|
|
489
|
+
const fromMeta = actor?.meta && typeof actor.meta.authorId === "string" ? actor.meta.authorId : void 0;
|
|
490
|
+
if (fromMeta) return fromMeta;
|
|
491
|
+
if ((authors2 ?? []).some((author) => author.id === actor.id)) return actor.id;
|
|
492
|
+
return actor.id;
|
|
493
|
+
}
|
|
494
|
+
function deriveWorkspaceAuthorization(args) {
|
|
495
|
+
const { actor, permissions: permissions2 = null, participants = null, authors: authors2 = null } = args;
|
|
496
|
+
const authorId = resolveActorAuthorId(actor, authors2);
|
|
497
|
+
const participant = (participants ?? []).find((row) => row.authorId === authorId) ?? null;
|
|
498
|
+
const permissionMap = toBuilderPermissionsMap(permissions2);
|
|
499
|
+
const readWorkspace = canReadWorkspace(permissionMap);
|
|
500
|
+
const editBranch = canEditBranch(permissionMap);
|
|
501
|
+
const createBranch = canCreateBranch(permissionMap);
|
|
502
|
+
const mergeBranches = canMergeBranch(permissionMap);
|
|
503
|
+
const publishBranches = canPublishBranch(permissionMap);
|
|
504
|
+
const deleteBranches = canDeleteBranch(permissionMap);
|
|
505
|
+
const manageBranches = canManageBranches(permissionMap);
|
|
506
|
+
const writeTemplates = canWriteTemplates(permissionMap);
|
|
507
|
+
const manageTemplates = canManageTemplates(permissionMap);
|
|
508
|
+
const commentRead = canReadComments(permissionMap);
|
|
509
|
+
const commentWrite = canWriteComments(permissionMap);
|
|
510
|
+
return {
|
|
511
|
+
authorId,
|
|
512
|
+
participant,
|
|
513
|
+
permissions: permissionMap,
|
|
514
|
+
canReadWorkspace: readWorkspace,
|
|
515
|
+
canEditBranchContent: editBranch,
|
|
516
|
+
canCreateBranch: createBranch,
|
|
517
|
+
canMergeBranches: mergeBranches,
|
|
518
|
+
canPublishBranches: publishBranches,
|
|
519
|
+
canDeleteBranches: deleteBranches,
|
|
520
|
+
canManageBranches: manageBranches,
|
|
521
|
+
canWriteTemplates: writeTemplates,
|
|
522
|
+
canManageTemplates: manageTemplates,
|
|
523
|
+
canCommentRead: readWorkspace && commentRead,
|
|
524
|
+
canCommentWrite: readWorkspace && commentWrite
|
|
525
|
+
};
|
|
526
|
+
}
|
|
527
|
+
function getAuthorizationDecision(auth, action) {
|
|
528
|
+
switch (action) {
|
|
529
|
+
case "branch-content-edit":
|
|
530
|
+
case "snapshot-write":
|
|
531
|
+
return auth.canEditBranchContent ? { ok: true } : { ok: false, reason: "Editing is disabled. You need branches.write." };
|
|
532
|
+
case "template-write":
|
|
533
|
+
return auth.canWriteTemplates ? { ok: true } : { ok: false, reason: "Template editing requires templates.write." };
|
|
534
|
+
case "branch-create":
|
|
535
|
+
return auth.canCreateBranch ? { ok: true } : { ok: false, reason: "Branch creation requires branches.create." };
|
|
536
|
+
case "branch-merge":
|
|
537
|
+
return auth.canMergeBranches ? { ok: true } : { ok: false, reason: "Branch merge requires branches.merge." };
|
|
538
|
+
case "branch-publish":
|
|
539
|
+
return auth.canPublishBranches ? { ok: true } : { ok: false, reason: "Branch publish requires branches.publish." };
|
|
540
|
+
case "branch-delete":
|
|
541
|
+
return auth.canDeleteBranches ? { ok: true } : { ok: false, reason: "Branch deletion requires branches.delete." };
|
|
542
|
+
case "branch-manage":
|
|
543
|
+
return auth.canManageBranches ? { ok: true } : { ok: false, reason: "Branch management requires branches.manage." };
|
|
544
|
+
case "comment-read":
|
|
545
|
+
return auth.canCommentRead ? { ok: true } : { ok: false, reason: "Comment read access is disabled for this actor." };
|
|
546
|
+
case "comment-write":
|
|
547
|
+
return auth.canCommentWrite ? { ok: true } : { ok: false, reason: "Comment write access is disabled for this actor." };
|
|
548
|
+
default:
|
|
549
|
+
return { ok: false, reason: "Action is not authorized." };
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
|
|
412
553
|
// src/builder/node-context-menu.tsx
|
|
413
554
|
import { useCanvas as useCanvas3, useWorkspace as useWorkspace3 } from "@timeax/digital-service-engine/workspace";
|
|
555
|
+
import { InputField as InputField3 } from "@timeax/form-palette";
|
|
414
556
|
import { createContext as createContext2, useCallback as useCallback4, useContext as useContext2, useEffect as useEffect4, useMemo as useMemo4, useRef as useRef2, useState as useState3 } from "react";
|
|
415
557
|
import { createPortal as createPortal2 } from "react-dom";
|
|
416
558
|
|
|
@@ -617,147 +759,6 @@ function normalizeRole(value) {
|
|
|
617
759
|
return value === "utility" ? "utility" : "base";
|
|
618
760
|
}
|
|
619
761
|
|
|
620
|
-
// src/workspace/permissions.ts
|
|
621
|
-
var BUILDER_PERMISSIONS = {
|
|
622
|
-
WORKSPACE_READ: "workspace.read",
|
|
623
|
-
WORKSPACE_WRITE: "workspace.write",
|
|
624
|
-
BRANCHES_READ: "branches.read",
|
|
625
|
-
BRANCHES_CREATE: "branches.create",
|
|
626
|
-
BRANCHES_WRITE: "branches.write",
|
|
627
|
-
BRANCHES_DELETE: "branches.delete",
|
|
628
|
-
BRANCHES_MERGE: "branches.merge",
|
|
629
|
-
BRANCHES_PUBLISH: "branches.publish",
|
|
630
|
-
BRANCHES_MANAGE: "branches.manage",
|
|
631
|
-
TEMPLATES_READ: "templates.read",
|
|
632
|
-
TEMPLATES_WRITE: "templates.write",
|
|
633
|
-
TEMPLATES_DELETE: "templates.delete",
|
|
634
|
-
TEMPLATES_MANAGE: "templates.manage",
|
|
635
|
-
COMMENTS_READ: "comments.read",
|
|
636
|
-
COMMENTS_WRITE: "comments.write",
|
|
637
|
-
COMMENTS_MODERATE: "comments.moderate",
|
|
638
|
-
POLICIES_READ: "policies.read",
|
|
639
|
-
POLICIES_WRITE: "policies.write",
|
|
640
|
-
POLICIES_MANAGE: "policies.manage",
|
|
641
|
-
PARTICIPANTS_READ: "participants.read",
|
|
642
|
-
PARTICIPANTS_WRITE: "participants.write",
|
|
643
|
-
PARTICIPANTS_MANAGE: "participants.manage",
|
|
644
|
-
SERVICES_READ: "services.read"
|
|
645
|
-
};
|
|
646
|
-
var BUILDER_PERMISSION_KEYS = new Set(Object.values(BUILDER_PERMISSIONS));
|
|
647
|
-
function toBuilderPermissionsMap(permissions2) {
|
|
648
|
-
if (!permissions2) return {};
|
|
649
|
-
const result = {};
|
|
650
|
-
for (const [key, value] of Object.entries(permissions2)) {
|
|
651
|
-
if (!BUILDER_PERMISSION_KEYS.has(key)) continue;
|
|
652
|
-
result[key] = value === true;
|
|
653
|
-
}
|
|
654
|
-
return result;
|
|
655
|
-
}
|
|
656
|
-
function can(map, permission) {
|
|
657
|
-
if (!map) return false;
|
|
658
|
-
return map[permission] === true;
|
|
659
|
-
}
|
|
660
|
-
function canReadWorkspace(map) {
|
|
661
|
-
return can(map, BUILDER_PERMISSIONS.WORKSPACE_READ);
|
|
662
|
-
}
|
|
663
|
-
function canEditBranch(map) {
|
|
664
|
-
return can(map, BUILDER_PERMISSIONS.BRANCHES_WRITE);
|
|
665
|
-
}
|
|
666
|
-
function canCreateBranch(map) {
|
|
667
|
-
return can(map, BUILDER_PERMISSIONS.BRANCHES_CREATE);
|
|
668
|
-
}
|
|
669
|
-
function canMergeBranch(map) {
|
|
670
|
-
return can(map, BUILDER_PERMISSIONS.BRANCHES_MERGE);
|
|
671
|
-
}
|
|
672
|
-
function canPublishBranch(map) {
|
|
673
|
-
return can(map, BUILDER_PERMISSIONS.BRANCHES_PUBLISH);
|
|
674
|
-
}
|
|
675
|
-
function canDeleteBranch(map) {
|
|
676
|
-
return can(map, BUILDER_PERMISSIONS.BRANCHES_DELETE);
|
|
677
|
-
}
|
|
678
|
-
function canManageBranches(map) {
|
|
679
|
-
return can(map, BUILDER_PERMISSIONS.BRANCHES_MANAGE);
|
|
680
|
-
}
|
|
681
|
-
function canWriteTemplates(map) {
|
|
682
|
-
return can(map, BUILDER_PERMISSIONS.TEMPLATES_WRITE);
|
|
683
|
-
}
|
|
684
|
-
function canManageTemplates(map) {
|
|
685
|
-
return can(map, BUILDER_PERMISSIONS.TEMPLATES_MANAGE);
|
|
686
|
-
}
|
|
687
|
-
function canReadComments(map) {
|
|
688
|
-
return can(map, BUILDER_PERMISSIONS.COMMENTS_READ);
|
|
689
|
-
}
|
|
690
|
-
function canWriteComments(map) {
|
|
691
|
-
return can(map, BUILDER_PERMISSIONS.COMMENTS_WRITE);
|
|
692
|
-
}
|
|
693
|
-
|
|
694
|
-
// src/workspace/authorization.ts
|
|
695
|
-
function resolveActorAuthorId(actor, authors2) {
|
|
696
|
-
if (!actor) return "unknown";
|
|
697
|
-
const fromMeta = actor?.meta && typeof actor.meta.authorId === "string" ? actor.meta.authorId : void 0;
|
|
698
|
-
if (fromMeta) return fromMeta;
|
|
699
|
-
if ((authors2 ?? []).some((author) => author.id === actor.id)) return actor.id;
|
|
700
|
-
return actor.id;
|
|
701
|
-
}
|
|
702
|
-
function deriveWorkspaceAuthorization(args) {
|
|
703
|
-
const { actor, permissions: permissions2 = null, participants = null, authors: authors2 = null } = args;
|
|
704
|
-
const authorId = resolveActorAuthorId(actor, authors2);
|
|
705
|
-
const participant = (participants ?? []).find((row) => row.authorId === authorId) ?? null;
|
|
706
|
-
const permissionMap = toBuilderPermissionsMap(permissions2);
|
|
707
|
-
const readWorkspace = canReadWorkspace(permissionMap);
|
|
708
|
-
const editBranch = canEditBranch(permissionMap);
|
|
709
|
-
const createBranch = canCreateBranch(permissionMap);
|
|
710
|
-
const mergeBranches = canMergeBranch(permissionMap);
|
|
711
|
-
const publishBranches = canPublishBranch(permissionMap);
|
|
712
|
-
const deleteBranches = canDeleteBranch(permissionMap);
|
|
713
|
-
const manageBranches = canManageBranches(permissionMap);
|
|
714
|
-
const writeTemplates = canWriteTemplates(permissionMap);
|
|
715
|
-
const manageTemplates = canManageTemplates(permissionMap);
|
|
716
|
-
const commentRead = canReadComments(permissionMap);
|
|
717
|
-
const commentWrite = canWriteComments(permissionMap);
|
|
718
|
-
return {
|
|
719
|
-
authorId,
|
|
720
|
-
participant,
|
|
721
|
-
permissions: permissionMap,
|
|
722
|
-
canReadWorkspace: readWorkspace,
|
|
723
|
-
canEditBranchContent: editBranch,
|
|
724
|
-
canCreateBranch: createBranch,
|
|
725
|
-
canMergeBranches: mergeBranches,
|
|
726
|
-
canPublishBranches: publishBranches,
|
|
727
|
-
canDeleteBranches: deleteBranches,
|
|
728
|
-
canManageBranches: manageBranches,
|
|
729
|
-
canWriteTemplates: writeTemplates,
|
|
730
|
-
canManageTemplates: manageTemplates,
|
|
731
|
-
canCommentRead: readWorkspace && commentRead,
|
|
732
|
-
canCommentWrite: readWorkspace && commentWrite
|
|
733
|
-
};
|
|
734
|
-
}
|
|
735
|
-
function getAuthorizationDecision(auth, action) {
|
|
736
|
-
switch (action) {
|
|
737
|
-
case "branch-content-edit":
|
|
738
|
-
case "snapshot-write":
|
|
739
|
-
return auth.canEditBranchContent ? { ok: true } : { ok: false, reason: "Editing is disabled. You need branches.write." };
|
|
740
|
-
case "template-write":
|
|
741
|
-
return auth.canWriteTemplates ? { ok: true } : { ok: false, reason: "Template editing requires templates.write." };
|
|
742
|
-
case "branch-create":
|
|
743
|
-
return auth.canCreateBranch ? { ok: true } : { ok: false, reason: "Branch creation requires branches.create." };
|
|
744
|
-
case "branch-merge":
|
|
745
|
-
return auth.canMergeBranches ? { ok: true } : { ok: false, reason: "Branch merge requires branches.merge." };
|
|
746
|
-
case "branch-publish":
|
|
747
|
-
return auth.canPublishBranches ? { ok: true } : { ok: false, reason: "Branch publish requires branches.publish." };
|
|
748
|
-
case "branch-delete":
|
|
749
|
-
return auth.canDeleteBranches ? { ok: true } : { ok: false, reason: "Branch deletion requires branches.delete." };
|
|
750
|
-
case "branch-manage":
|
|
751
|
-
return auth.canManageBranches ? { ok: true } : { ok: false, reason: "Branch management requires branches.manage." };
|
|
752
|
-
case "comment-read":
|
|
753
|
-
return auth.canCommentRead ? { ok: true } : { ok: false, reason: "Comment read access is disabled for this actor." };
|
|
754
|
-
case "comment-write":
|
|
755
|
-
return auth.canCommentWrite ? { ok: true } : { ok: false, reason: "Comment write access is disabled for this actor." };
|
|
756
|
-
default:
|
|
757
|
-
return { ok: false, reason: "Action is not authorized." };
|
|
758
|
-
}
|
|
759
|
-
}
|
|
760
|
-
|
|
761
762
|
// src/workspace/fallback-quick-add-helpers.ts
|
|
762
763
|
import {
|
|
763
764
|
getAssignedServiceIds as coreGetAssignedServiceIds,
|
|
@@ -2543,8 +2544,66 @@ function RenameNodeField({ value, onChange, onEscape }) {
|
|
|
2543
2544
|
);
|
|
2544
2545
|
}
|
|
2545
2546
|
|
|
2547
|
+
// src/components/ui/scroll-area.tsx
|
|
2548
|
+
import "react";
|
|
2549
|
+
import { ScrollArea as ScrollAreaPrimitive } from "radix-ui";
|
|
2550
|
+
import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2551
|
+
function ScrollArea({
|
|
2552
|
+
className,
|
|
2553
|
+
children,
|
|
2554
|
+
...props
|
|
2555
|
+
}) {
|
|
2556
|
+
return /* @__PURE__ */ jsxs6(
|
|
2557
|
+
ScrollAreaPrimitive.Root,
|
|
2558
|
+
{
|
|
2559
|
+
"data-slot": "scroll-area",
|
|
2560
|
+
className: cn("relative", className),
|
|
2561
|
+
...props,
|
|
2562
|
+
children: [
|
|
2563
|
+
/* @__PURE__ */ jsx9(
|
|
2564
|
+
ScrollAreaPrimitive.Viewport,
|
|
2565
|
+
{
|
|
2566
|
+
"data-slot": "scroll-area-viewport",
|
|
2567
|
+
className: "size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1",
|
|
2568
|
+
children
|
|
2569
|
+
}
|
|
2570
|
+
),
|
|
2571
|
+
/* @__PURE__ */ jsx9(ScrollBar, {}),
|
|
2572
|
+
/* @__PURE__ */ jsx9(ScrollAreaPrimitive.Corner, {})
|
|
2573
|
+
]
|
|
2574
|
+
}
|
|
2575
|
+
);
|
|
2576
|
+
}
|
|
2577
|
+
function ScrollBar({
|
|
2578
|
+
className,
|
|
2579
|
+
orientation = "vertical",
|
|
2580
|
+
...props
|
|
2581
|
+
}) {
|
|
2582
|
+
return /* @__PURE__ */ jsx9(
|
|
2583
|
+
ScrollAreaPrimitive.ScrollAreaScrollbar,
|
|
2584
|
+
{
|
|
2585
|
+
"data-slot": "scroll-area-scrollbar",
|
|
2586
|
+
orientation,
|
|
2587
|
+
className: cn(
|
|
2588
|
+
"flex touch-none p-px transition-colors select-none",
|
|
2589
|
+
orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent",
|
|
2590
|
+
orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent",
|
|
2591
|
+
className
|
|
2592
|
+
),
|
|
2593
|
+
...props,
|
|
2594
|
+
children: /* @__PURE__ */ jsx9(
|
|
2595
|
+
ScrollAreaPrimitive.ScrollAreaThumb,
|
|
2596
|
+
{
|
|
2597
|
+
"data-slot": "scroll-area-thumb",
|
|
2598
|
+
className: "relative flex-1 rounded-full bg-border"
|
|
2599
|
+
}
|
|
2600
|
+
)
|
|
2601
|
+
}
|
|
2602
|
+
);
|
|
2603
|
+
}
|
|
2604
|
+
|
|
2546
2605
|
// src/builder/node-context-menu.tsx
|
|
2547
|
-
import { Fragment as Fragment3, jsx as
|
|
2606
|
+
import { Fragment as Fragment3, jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2548
2607
|
var NodeContextMenuContext = createContext2(null);
|
|
2549
2608
|
function NodeContextMenuProvider({ children }) {
|
|
2550
2609
|
const canvas = useCanvas3();
|
|
@@ -2565,6 +2624,8 @@ function NodeContextMenuProvider({ children }) {
|
|
|
2565
2624
|
const [templateSaveFieldId, setTemplateSaveFieldId] = useState3(null);
|
|
2566
2625
|
const [templateSaveMode, setTemplateSaveMode] = useState3("single");
|
|
2567
2626
|
const [templateLabel, setTemplateLabel] = useState3("");
|
|
2627
|
+
const [templateName, setTemplateName] = useState3("");
|
|
2628
|
+
const [templateSaveToCurrentBranch, setTemplateSaveToCurrentBranch] = useState3(true);
|
|
2568
2629
|
const [templateGroupSelection, setTemplateGroupSelection] = useState3({});
|
|
2569
2630
|
const [templateFieldChecks, setTemplateFieldChecks] = useState3({});
|
|
2570
2631
|
const [edgeTypeSubmenuOpen, setEdgeTypeSubmenuOpen] = useState3(false);
|
|
@@ -2859,6 +2920,8 @@ function NodeContextMenuProvider({ children }) {
|
|
|
2859
2920
|
setTemplateSaveFieldId(fieldId);
|
|
2860
2921
|
setTemplateSaveMode("single");
|
|
2861
2922
|
setTemplateLabel("");
|
|
2923
|
+
setTemplateName("");
|
|
2924
|
+
setTemplateSaveToCurrentBranch(true);
|
|
2862
2925
|
setTemplateGroupSelection({});
|
|
2863
2926
|
setTemplateFieldChecks({});
|
|
2864
2927
|
setTemplateSaveOpen(true);
|
|
@@ -2879,6 +2942,7 @@ function NodeContextMenuProvider({ children }) {
|
|
|
2879
2942
|
setTemplateGroupSelection((current) => Object.keys(current).length ? current : initialGroupSelection);
|
|
2880
2943
|
setTemplateFieldChecks((current) => Object.keys(current).length ? current : initialChecks);
|
|
2881
2944
|
setTemplateLabel((current) => current || `${templateSaveDraft.rootLabel} group`);
|
|
2945
|
+
setTemplateName((current) => current || `${templateSaveDraft.rootLabel} Template`);
|
|
2882
2946
|
}, [templateSaveDraft, templateSaveFieldId]);
|
|
2883
2947
|
const handleTemplateSave = useCallback4(async () => {
|
|
2884
2948
|
if (!templateSaveDraft || !templateSaveFieldId) return;
|
|
@@ -2891,6 +2955,7 @@ function NodeContextMenuProvider({ children }) {
|
|
|
2891
2955
|
if (!rootEntry) throw new Error("Selected field no longer exists.");
|
|
2892
2956
|
if (templateSaveMode === "single") {
|
|
2893
2957
|
const field = pickCheckedProperties(rootEntry.field, templateFieldChecks[templateSaveFieldId] ?? {});
|
|
2958
|
+
const resolvedName = templateName.trim() || `${templateSaveDraft.rootLabel} Template`;
|
|
2894
2959
|
const definition = {
|
|
2895
2960
|
templateType: "field",
|
|
2896
2961
|
mode: "single",
|
|
@@ -2898,15 +2963,16 @@ function NodeContextMenuProvider({ children }) {
|
|
|
2898
2963
|
field
|
|
2899
2964
|
};
|
|
2900
2965
|
const result = await ws.createTemplate({
|
|
2901
|
-
name:
|
|
2902
|
-
key: makeTemplateKey(templateSaveDraft.rootLabel
|
|
2966
|
+
name: resolvedName,
|
|
2967
|
+
key: makeTemplateKey(resolvedName || templateSaveDraft.rootLabel || "field"),
|
|
2903
2968
|
kind: templateSaveDraft.rootType,
|
|
2904
|
-
branchId: ws.branches.currentId ?? void 0,
|
|
2969
|
+
branchId: templateSaveToCurrentBranch ? ws.branches.currentId ?? void 0 : null,
|
|
2905
2970
|
definition,
|
|
2906
2971
|
defaults: canvas.selector.getNode(templateSaveFieldId)?.raw?.defaults,
|
|
2907
2972
|
published: false
|
|
2908
2973
|
});
|
|
2909
|
-
if (!result.ok)
|
|
2974
|
+
if (!result.ok)
|
|
2975
|
+
throw new Error(("error" in result ? result.error.message : "Failed to create template") ?? "Failed to create template");
|
|
2910
2976
|
} else {
|
|
2911
2977
|
const selected = new Set(
|
|
2912
2978
|
Object.entries(templateGroupSelection).filter(([, included]) => included).map(([fieldId]) => fieldId)
|
|
@@ -2927,16 +2993,18 @@ function NodeContextMenuProvider({ children }) {
|
|
|
2927
2993
|
fields,
|
|
2928
2994
|
relations: filteredRelations
|
|
2929
2995
|
};
|
|
2996
|
+
const resolvedName = templateName.trim() || definition.label;
|
|
2930
2997
|
const result = await ws.createTemplate({
|
|
2931
|
-
name:
|
|
2932
|
-
key: makeTemplateKey(
|
|
2998
|
+
name: resolvedName,
|
|
2999
|
+
key: makeTemplateKey(resolvedName || "field-group"),
|
|
2933
3000
|
kind: templateSaveDraft.rootType,
|
|
2934
|
-
branchId: ws.branches.currentId ?? void 0,
|
|
3001
|
+
branchId: templateSaveToCurrentBranch ? ws.branches.currentId ?? void 0 : null,
|
|
2935
3002
|
definition,
|
|
2936
3003
|
defaults: canvas.selector.getNode(templateSaveFieldId)?.raw?.defaults,
|
|
2937
3004
|
published: false
|
|
2938
3005
|
});
|
|
2939
|
-
if (!result.ok)
|
|
3006
|
+
if (!result.ok)
|
|
3007
|
+
throw new Error(("error" in result ? result.error.message : "Failed to create template") ?? "Failed to create template");
|
|
2940
3008
|
}
|
|
2941
3009
|
await ws.refresh.templates({ branchId: ws.branches.currentId ?? void 0 });
|
|
2942
3010
|
setTemplateSaveOpen(false);
|
|
@@ -2954,6 +3022,8 @@ function NodeContextMenuProvider({ children }) {
|
|
|
2954
3022
|
templateFieldChecks,
|
|
2955
3023
|
templateGroupSelection,
|
|
2956
3024
|
templateLabel,
|
|
3025
|
+
templateName,
|
|
3026
|
+
templateSaveToCurrentBranch,
|
|
2957
3027
|
templateSaveDraft,
|
|
2958
3028
|
templateSaveFieldId,
|
|
2959
3029
|
templateSaveMode,
|
|
@@ -3027,11 +3097,11 @@ function NodeContextMenuProvider({ children }) {
|
|
|
3027
3097
|
]
|
|
3028
3098
|
);
|
|
3029
3099
|
const hasPortalContent = Boolean(target || edgeTarget || dropIntent || renameOpen || deleteOpen || noticeManagerOpen || templateSaveOpen);
|
|
3030
|
-
return /* @__PURE__ */
|
|
3100
|
+
return /* @__PURE__ */ jsxs7(NodeContextMenuContext.Provider, { value, children: [
|
|
3031
3101
|
children,
|
|
3032
3102
|
typeof document !== "undefined" && hasPortalContent ? createPortal2(
|
|
3033
|
-
/* @__PURE__ */
|
|
3034
|
-
target && anchorStyle ? /* @__PURE__ */
|
|
3103
|
+
/* @__PURE__ */ jsxs7(Fragment3, { children: [
|
|
3104
|
+
target && anchorStyle ? /* @__PURE__ */ jsx10(
|
|
3035
3105
|
ContextMenu,
|
|
3036
3106
|
{
|
|
3037
3107
|
target,
|
|
@@ -3046,7 +3116,7 @@ function NodeContextMenuProvider({ children }) {
|
|
|
3046
3116
|
setRenameValue
|
|
3047
3117
|
}
|
|
3048
3118
|
) : null,
|
|
3049
|
-
edgeTarget && edgeAnchorStyle ? /* @__PURE__ */
|
|
3119
|
+
edgeTarget && edgeAnchorStyle ? /* @__PURE__ */ jsxs7(
|
|
3050
3120
|
"div",
|
|
3051
3121
|
{
|
|
3052
3122
|
ref: menuRef,
|
|
@@ -3054,7 +3124,7 @@ function NodeContextMenuProvider({ children }) {
|
|
|
3054
3124
|
style: { left: edgeAnchorStyle.left, top: edgeAnchorStyle.top },
|
|
3055
3125
|
role: "menu",
|
|
3056
3126
|
children: [
|
|
3057
|
-
/* @__PURE__ */
|
|
3127
|
+
/* @__PURE__ */ jsx10(
|
|
3058
3128
|
"button",
|
|
3059
3129
|
{
|
|
3060
3130
|
type: "button",
|
|
@@ -3063,53 +3133,46 @@ function NodeContextMenuProvider({ children }) {
|
|
|
3063
3133
|
children: "Disconnect"
|
|
3064
3134
|
}
|
|
3065
3135
|
),
|
|
3066
|
-
/* @__PURE__ */
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3136
|
+
/* @__PURE__ */ jsxs7("div", { className: "relative", onMouseLeave: () => setEdgeTypeSubmenuOpen(false), children: [
|
|
3137
|
+
/* @__PURE__ */ jsxs7(
|
|
3138
|
+
"button",
|
|
3139
|
+
{
|
|
3140
|
+
type: "button",
|
|
3141
|
+
className: "flex w-full items-center justify-between rounded-lg px-3 py-2 text-left text-sm text-slate-700 hover:bg-slate-100 dark:text-slate-200 dark:hover:bg-slate-900",
|
|
3142
|
+
onMouseEnter: () => setEdgeTypeSubmenuOpen(true),
|
|
3143
|
+
onFocus: () => setEdgeTypeSubmenuOpen(true),
|
|
3144
|
+
onClick: () => setEdgeTypeSubmenuOpen((current) => !current),
|
|
3145
|
+
"aria-haspopup": "menu",
|
|
3146
|
+
"aria-expanded": edgeTypeSubmenuOpen,
|
|
3147
|
+
children: [
|
|
3148
|
+
/* @__PURE__ */ jsx10("span", { children: "Change type" }),
|
|
3149
|
+
/* @__PURE__ */ jsx10("span", { className: "text-slate-400", children: "\u25B8" })
|
|
3150
|
+
]
|
|
3151
|
+
}
|
|
3152
|
+
),
|
|
3153
|
+
edgeTypeSubmenuOpen ? /* @__PURE__ */ jsx10(
|
|
3154
|
+
"div",
|
|
3155
|
+
{
|
|
3156
|
+
className: "absolute top-0 left-full z-50 ml-1 min-w-40 rounded-xl border border-slate-200 bg-white p-1.5 shadow-2xl dark:border-slate-700 dark:bg-slate-950",
|
|
3157
|
+
role: "menu",
|
|
3158
|
+
children: ["bind", "include", "exclude"].map((kind) => /* @__PURE__ */ jsx10(
|
|
3073
3159
|
"button",
|
|
3074
3160
|
{
|
|
3075
3161
|
type: "button",
|
|
3076
|
-
className: "
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
}
|
|
3087
|
-
),
|
|
3088
|
-
edgeTypeSubmenuOpen ? /* @__PURE__ */ jsx9(
|
|
3089
|
-
"div",
|
|
3090
|
-
{
|
|
3091
|
-
className: "absolute top-0 left-full z-50 ml-1 min-w-40 rounded-xl border border-slate-200 bg-white p-1.5 shadow-2xl dark:border-slate-700 dark:bg-slate-950",
|
|
3092
|
-
role: "menu",
|
|
3093
|
-
children: ["bind", "include", "exclude"].map((kind) => /* @__PURE__ */ jsx9(
|
|
3094
|
-
"button",
|
|
3095
|
-
{
|
|
3096
|
-
type: "button",
|
|
3097
|
-
className: "w-full rounded-lg px-3 py-2 text-left text-sm text-slate-700 hover:bg-slate-100 disabled:cursor-not-allowed disabled:opacity-50 dark:text-slate-200 dark:hover:bg-slate-900",
|
|
3098
|
-
onClick: () => handleEdgeTypeChange(kind),
|
|
3099
|
-
disabled: edgeTarget.kind === kind,
|
|
3100
|
-
children: kind
|
|
3101
|
-
},
|
|
3102
|
-
kind
|
|
3103
|
-
))
|
|
3104
|
-
}
|
|
3105
|
-
) : null
|
|
3106
|
-
]
|
|
3107
|
-
}
|
|
3108
|
-
)
|
|
3162
|
+
className: "w-full rounded-lg px-3 py-2 text-left text-sm text-slate-700 hover:bg-slate-100 disabled:cursor-not-allowed disabled:opacity-50 dark:text-slate-200 dark:hover:bg-slate-900",
|
|
3163
|
+
onClick: () => handleEdgeTypeChange(kind),
|
|
3164
|
+
disabled: edgeTarget.kind === kind,
|
|
3165
|
+
children: kind
|
|
3166
|
+
},
|
|
3167
|
+
kind
|
|
3168
|
+
))
|
|
3169
|
+
}
|
|
3170
|
+
) : null
|
|
3171
|
+
] })
|
|
3109
3172
|
]
|
|
3110
3173
|
}
|
|
3111
3174
|
) : null,
|
|
3112
|
-
dropIntent && dialAnchorStyle ? /* @__PURE__ */
|
|
3175
|
+
dropIntent && dialAnchorStyle ? /* @__PURE__ */ jsx10(
|
|
3113
3176
|
Dial,
|
|
3114
3177
|
{
|
|
3115
3178
|
dialActions,
|
|
@@ -3120,7 +3183,7 @@ function NodeContextMenuProvider({ children }) {
|
|
|
3120
3183
|
setDropIntent
|
|
3121
3184
|
}
|
|
3122
3185
|
) : null,
|
|
3123
|
-
noticeManagerOpen ? /* @__PURE__ */
|
|
3186
|
+
noticeManagerOpen ? /* @__PURE__ */ jsx10(
|
|
3124
3187
|
NoticeManager,
|
|
3125
3188
|
{
|
|
3126
3189
|
noticeManagerOpen,
|
|
@@ -3141,7 +3204,7 @@ function NodeContextMenuProvider({ children }) {
|
|
|
3141
3204
|
handleNoticeSave
|
|
3142
3205
|
}
|
|
3143
3206
|
) : null,
|
|
3144
|
-
/* @__PURE__ */
|
|
3207
|
+
/* @__PURE__ */ jsx10(
|
|
3145
3208
|
AlertDialog,
|
|
3146
3209
|
{
|
|
3147
3210
|
open: renameOpen,
|
|
@@ -3149,12 +3212,12 @@ function NodeContextMenuProvider({ children }) {
|
|
|
3149
3212
|
setRenameOpen(open);
|
|
3150
3213
|
if (!open) setDialogTarget(null);
|
|
3151
3214
|
},
|
|
3152
|
-
children: /* @__PURE__ */
|
|
3153
|
-
/* @__PURE__ */
|
|
3154
|
-
/* @__PURE__ */
|
|
3155
|
-
/* @__PURE__ */
|
|
3215
|
+
children: /* @__PURE__ */ jsxs7(AlertDialogContent, { children: [
|
|
3216
|
+
/* @__PURE__ */ jsxs7(AlertDialogHeader, { children: [
|
|
3217
|
+
/* @__PURE__ */ jsx10(AlertDialogTitle, { children: "Rename node" }),
|
|
3218
|
+
/* @__PURE__ */ jsx10(AlertDialogDescription, { children: "Update the node label across canvas, layers, and wireframe." })
|
|
3156
3219
|
] }),
|
|
3157
|
-
/* @__PURE__ */
|
|
3220
|
+
/* @__PURE__ */ jsxs7(
|
|
3158
3221
|
"form",
|
|
3159
3222
|
{
|
|
3160
3223
|
onSubmit: (event) => {
|
|
@@ -3163,17 +3226,10 @@ function NodeContextMenuProvider({ children }) {
|
|
|
3163
3226
|
},
|
|
3164
3227
|
className: "space-y-4",
|
|
3165
3228
|
children: [
|
|
3166
|
-
/* @__PURE__ */
|
|
3167
|
-
|
|
3168
|
-
{
|
|
3169
|
-
|
|
3170
|
-
onChange: setRenameValue,
|
|
3171
|
-
onEscape: () => setRenameOpen(false)
|
|
3172
|
-
}
|
|
3173
|
-
),
|
|
3174
|
-
/* @__PURE__ */ jsxs6(AlertDialogFooter, { children: [
|
|
3175
|
-
/* @__PURE__ */ jsx9(AlertDialogCancel, { type: "button", children: "Cancel" }),
|
|
3176
|
-
/* @__PURE__ */ jsx9(AlertDialogAction, { type: "submit", children: "Save" })
|
|
3229
|
+
/* @__PURE__ */ jsx10(RenameNodeField, { value: renameValue, onChange: setRenameValue, onEscape: () => setRenameOpen(false) }),
|
|
3230
|
+
/* @__PURE__ */ jsxs7(AlertDialogFooter, { children: [
|
|
3231
|
+
/* @__PURE__ */ jsx10(AlertDialogCancel, { type: "button", children: "Cancel" }),
|
|
3232
|
+
/* @__PURE__ */ jsx10(AlertDialogAction, { type: "submit", children: "Save" })
|
|
3177
3233
|
] })
|
|
3178
3234
|
]
|
|
3179
3235
|
}
|
|
@@ -3181,7 +3237,7 @@ function NodeContextMenuProvider({ children }) {
|
|
|
3181
3237
|
] })
|
|
3182
3238
|
}
|
|
3183
3239
|
),
|
|
3184
|
-
/* @__PURE__ */
|
|
3240
|
+
/* @__PURE__ */ jsx10(
|
|
3185
3241
|
AlertDialog,
|
|
3186
3242
|
{
|
|
3187
3243
|
open: deleteOpen,
|
|
@@ -3189,19 +3245,19 @@ function NodeContextMenuProvider({ children }) {
|
|
|
3189
3245
|
setDeleteOpen(open);
|
|
3190
3246
|
if (!open) setDialogTarget(null);
|
|
3191
3247
|
},
|
|
3192
|
-
children: /* @__PURE__ */
|
|
3193
|
-
/* @__PURE__ */
|
|
3194
|
-
/* @__PURE__ */
|
|
3195
|
-
/* @__PURE__ */
|
|
3248
|
+
children: /* @__PURE__ */ jsxs7(AlertDialogContent, { children: [
|
|
3249
|
+
/* @__PURE__ */ jsxs7(AlertDialogHeader, { children: [
|
|
3250
|
+
/* @__PURE__ */ jsx10(AlertDialogTitle, { children: "Delete node" }),
|
|
3251
|
+
/* @__PURE__ */ jsx10(AlertDialogDescription, { children: "This action removes the selected node from the builder graph." })
|
|
3196
3252
|
] }),
|
|
3197
|
-
/* @__PURE__ */
|
|
3198
|
-
/* @__PURE__ */
|
|
3199
|
-
/* @__PURE__ */
|
|
3253
|
+
/* @__PURE__ */ jsxs7(AlertDialogFooter, { children: [
|
|
3254
|
+
/* @__PURE__ */ jsx10(AlertDialogCancel, { type: "button", children: "Cancel" }),
|
|
3255
|
+
/* @__PURE__ */ jsx10(AlertDialogAction, { type: "button", className: "bg-rose-600 hover:bg-rose-700", onClick: handleDelete, children: "Delete" })
|
|
3200
3256
|
] })
|
|
3201
3257
|
] })
|
|
3202
3258
|
}
|
|
3203
3259
|
),
|
|
3204
|
-
/* @__PURE__ */
|
|
3260
|
+
/* @__PURE__ */ jsx10(
|
|
3205
3261
|
AlertDialog,
|
|
3206
3262
|
{
|
|
3207
3263
|
open: templateSaveOpen,
|
|
@@ -3209,46 +3265,38 @@ function NodeContextMenuProvider({ children }) {
|
|
|
3209
3265
|
setTemplateSaveOpen(open);
|
|
3210
3266
|
if (!open) setTemplateSaveFieldId(null);
|
|
3211
3267
|
},
|
|
3212
|
-
children: /* @__PURE__ */
|
|
3213
|
-
/* @__PURE__ */
|
|
3214
|
-
/* @__PURE__ */
|
|
3215
|
-
/* @__PURE__ */
|
|
3268
|
+
children: /* @__PURE__ */ jsxs7(AlertDialogContent, { children: [
|
|
3269
|
+
/* @__PURE__ */ jsxs7(AlertDialogHeader, { children: [
|
|
3270
|
+
/* @__PURE__ */ jsx10(AlertDialogTitle, { children: "Save Field Template" }),
|
|
3271
|
+
/* @__PURE__ */ jsx10(AlertDialogDescription, { children: "Choose how to save this field and review copied properties." })
|
|
3216
3272
|
] }),
|
|
3217
|
-
templateSaveDraft ? /* @__PURE__ */
|
|
3218
|
-
/* @__PURE__ */
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
children: "Field group/tree"
|
|
3235
|
-
}
|
|
3236
|
-
)
|
|
3237
|
-
] }),
|
|
3238
|
-
templateSaveMode === "group" ? /* @__PURE__ */ jsxs6("div", { className: "space-y-2", children: [
|
|
3239
|
-
/* @__PURE__ */ jsx9("label", { className: "block text-sm font-medium", children: "Template label" }),
|
|
3240
|
-
/* @__PURE__ */ jsx9(
|
|
3241
|
-
"input",
|
|
3273
|
+
templateSaveDraft ? /* @__PURE__ */ jsxs7("div", { className: "space-y-4", children: [
|
|
3274
|
+
/* @__PURE__ */ jsx10("div", { className: "flex gap-2", children: /* @__PURE__ */ jsx10(
|
|
3275
|
+
InputField3,
|
|
3276
|
+
{
|
|
3277
|
+
variant: "toggle-group",
|
|
3278
|
+
options: [
|
|
3279
|
+
{ label: "Single Field", value: "single" },
|
|
3280
|
+
{ label: "Field Group/Tree", value: "group" }
|
|
3281
|
+
],
|
|
3282
|
+
value: templateSaveMode,
|
|
3283
|
+
onChange: (e) => setTemplateSaveMode(e.value)
|
|
3284
|
+
}
|
|
3285
|
+
) }),
|
|
3286
|
+
templateSaveMode === "group" ? /* @__PURE__ */ jsxs7("div", { className: "space-y-2", children: [
|
|
3287
|
+
/* @__PURE__ */ jsx10("label", { className: "block text-sm font-medium", children: "Template label" }),
|
|
3288
|
+
/* @__PURE__ */ jsx10(
|
|
3289
|
+
InputField3,
|
|
3242
3290
|
{
|
|
3291
|
+
variant: "text",
|
|
3243
3292
|
value: templateLabel,
|
|
3244
|
-
onChange: (event) => setTemplateLabel(event.
|
|
3245
|
-
className: "w-full rounded-md border border-slate-300 px-3 py-2 text-sm"
|
|
3293
|
+
onChange: (event) => setTemplateLabel(event.value)
|
|
3246
3294
|
}
|
|
3247
3295
|
),
|
|
3248
|
-
/* @__PURE__ */
|
|
3249
|
-
/* @__PURE__ */
|
|
3250
|
-
templateSaveDraft.discoveredFields.map((entry) => /* @__PURE__ */
|
|
3251
|
-
/* @__PURE__ */
|
|
3296
|
+
/* @__PURE__ */ jsxs7("div", { className: "space-y-1", children: [
|
|
3297
|
+
/* @__PURE__ */ jsx10("p", { className: "text-sm font-medium", children: "Fields in group" }),
|
|
3298
|
+
templateSaveDraft.discoveredFields.map((entry) => /* @__PURE__ */ jsxs7("label", { className: "flex items-center gap-2 text-sm", children: [
|
|
3299
|
+
/* @__PURE__ */ jsx10(
|
|
3252
3300
|
"input",
|
|
3253
3301
|
{
|
|
3254
3302
|
type: "checkbox",
|
|
@@ -3259,19 +3307,43 @@ function NodeContextMenuProvider({ children }) {
|
|
|
3259
3307
|
}))
|
|
3260
3308
|
}
|
|
3261
3309
|
),
|
|
3262
|
-
/* @__PURE__ */
|
|
3310
|
+
/* @__PURE__ */ jsx10("span", { children: String(entry.field.label ?? entry.originalId) })
|
|
3263
3311
|
] }, entry.originalId))
|
|
3264
3312
|
] })
|
|
3265
3313
|
] }) : null,
|
|
3266
|
-
/* @__PURE__ */
|
|
3267
|
-
/* @__PURE__ */
|
|
3314
|
+
/* @__PURE__ */ jsxs7("div", { className: "space-y-2", children: [
|
|
3315
|
+
/* @__PURE__ */ jsx10("label", { className: "block text-sm font-medium", children: "Template name" }),
|
|
3316
|
+
/* @__PURE__ */ jsx10(
|
|
3317
|
+
InputField3,
|
|
3318
|
+
{
|
|
3319
|
+
variant: "text",
|
|
3320
|
+
value: templateName,
|
|
3321
|
+
onChange: (event) => setTemplateName(String(event.value ?? ""))
|
|
3322
|
+
}
|
|
3323
|
+
),
|
|
3324
|
+
/* @__PURE__ */ jsxs7("label", { className: "flex items-center gap-2 text-sm", children: [
|
|
3325
|
+
/* @__PURE__ */ jsx10(
|
|
3326
|
+
"input",
|
|
3327
|
+
{
|
|
3328
|
+
type: "checkbox",
|
|
3329
|
+
checked: templateSaveToCurrentBranch,
|
|
3330
|
+
onChange: (event) => setTemplateSaveToCurrentBranch(event.target.checked)
|
|
3331
|
+
}
|
|
3332
|
+
),
|
|
3333
|
+
/* @__PURE__ */ jsx10("span", { children: "Save to current branch" })
|
|
3334
|
+
] })
|
|
3335
|
+
] }),
|
|
3336
|
+
/* @__PURE__ */ jsx10(ScrollArea, { className: "max-h-72 space-y-2 h-full", children: (templateSaveMode === "single" ? templateSaveDraft.discoveredFields.filter((entry) => entry.originalId === templateSaveFieldId) : templateSaveDraft.discoveredFields.filter(
|
|
3337
|
+
(entry) => templateGroupSelection[entry.originalId] !== false
|
|
3338
|
+
)).map((entry) => /* @__PURE__ */ jsxs7("details", { open: true, className: "rounded border border-slate-200 dark:border-slate-700 p-2", children: [
|
|
3339
|
+
/* @__PURE__ */ jsxs7("summary", { className: "cursor-pointer text-sm font-medium", children: [
|
|
3268
3340
|
String(entry.field.label ?? entry.originalId),
|
|
3269
3341
|
" (",
|
|
3270
3342
|
entry.originalId,
|
|
3271
3343
|
")"
|
|
3272
3344
|
] }),
|
|
3273
|
-
/* @__PURE__ */
|
|
3274
|
-
/* @__PURE__ */
|
|
3345
|
+
/* @__PURE__ */ jsx10("div", { className: "mt-2 grid grid-cols-1 gap-1", children: Object.keys(entry.field).map((key) => /* @__PURE__ */ jsxs7("label", { className: "flex items-center gap-2 text-xs", children: [
|
|
3346
|
+
/* @__PURE__ */ jsx10(
|
|
3275
3347
|
"input",
|
|
3276
3348
|
{
|
|
3277
3349
|
type: "checkbox",
|
|
@@ -3285,12 +3357,12 @@ function NodeContextMenuProvider({ children }) {
|
|
|
3285
3357
|
}))
|
|
3286
3358
|
}
|
|
3287
3359
|
),
|
|
3288
|
-
/* @__PURE__ */
|
|
3360
|
+
/* @__PURE__ */ jsx10("span", { className: "font-mono", children: key })
|
|
3289
3361
|
] }, key)) })
|
|
3290
3362
|
] }, entry.originalId)) }),
|
|
3291
|
-
/* @__PURE__ */
|
|
3292
|
-
/* @__PURE__ */
|
|
3293
|
-
/* @__PURE__ */
|
|
3363
|
+
/* @__PURE__ */ jsxs7(AlertDialogFooter, { children: [
|
|
3364
|
+
/* @__PURE__ */ jsx10(AlertDialogCancel, { type: "button", children: "Cancel" }),
|
|
3365
|
+
/* @__PURE__ */ jsx10(AlertDialogAction, { type: "button", disabled: !templateName.trim(), onClick: () => void handleTemplateSave(), children: "Save template" })
|
|
3294
3366
|
] })
|
|
3295
3367
|
] }) : null
|
|
3296
3368
|
] })
|
|
@@ -3310,12 +3382,12 @@ function useNodeContextMenu() {
|
|
|
3310
3382
|
// src/components/ui/avatar.tsx
|
|
3311
3383
|
import "react";
|
|
3312
3384
|
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
3313
|
-
import { jsx as
|
|
3385
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
3314
3386
|
function Avatar({
|
|
3315
3387
|
className,
|
|
3316
3388
|
...props
|
|
3317
3389
|
}) {
|
|
3318
|
-
return /* @__PURE__ */
|
|
3390
|
+
return /* @__PURE__ */ jsx11(
|
|
3319
3391
|
AvatarPrimitive.Root,
|
|
3320
3392
|
{
|
|
3321
3393
|
"data-slot": "avatar",
|
|
@@ -3331,7 +3403,7 @@ function AvatarImage({
|
|
|
3331
3403
|
className,
|
|
3332
3404
|
...props
|
|
3333
3405
|
}) {
|
|
3334
|
-
return /* @__PURE__ */
|
|
3406
|
+
return /* @__PURE__ */ jsx11(
|
|
3335
3407
|
AvatarPrimitive.Image,
|
|
3336
3408
|
{
|
|
3337
3409
|
"data-slot": "avatar-image",
|
|
@@ -3344,7 +3416,7 @@ function AvatarFallback({
|
|
|
3344
3416
|
className,
|
|
3345
3417
|
...props
|
|
3346
3418
|
}) {
|
|
3347
|
-
return /* @__PURE__ */
|
|
3419
|
+
return /* @__PURE__ */ jsx11(
|
|
3348
3420
|
AvatarPrimitive.Fallback,
|
|
3349
3421
|
{
|
|
3350
3422
|
"data-slot": "avatar-fallback",
|
|
@@ -3362,14 +3434,14 @@ import { forwardRef as forwardRef2 } from "react";
|
|
|
3362
3434
|
import { FiMoreHorizontal } from "react-icons/fi";
|
|
3363
3435
|
import { HiOutlineSparkles } from "react-icons/hi2";
|
|
3364
3436
|
import { LuSearch } from "react-icons/lu";
|
|
3365
|
-
import { jsx as
|
|
3437
|
+
import { jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
3366
3438
|
function BuilderIconButton({
|
|
3367
3439
|
className,
|
|
3368
3440
|
active,
|
|
3369
3441
|
children,
|
|
3370
3442
|
...props
|
|
3371
3443
|
}) {
|
|
3372
|
-
return /* @__PURE__ */
|
|
3444
|
+
return /* @__PURE__ */ jsx12(
|
|
3373
3445
|
"button",
|
|
3374
3446
|
{
|
|
3375
3447
|
type: "button",
|
|
@@ -3386,7 +3458,7 @@ function BuilderIconButton({
|
|
|
3386
3458
|
);
|
|
3387
3459
|
}
|
|
3388
3460
|
var PanelSearch = forwardRef2(function PanelSearch2({ className, value, onChange, placeholder = "Search", ...inputProps }, ref) {
|
|
3389
|
-
return /* @__PURE__ */
|
|
3461
|
+
return /* @__PURE__ */ jsxs8(
|
|
3390
3462
|
"label",
|
|
3391
3463
|
{
|
|
3392
3464
|
className: cn(
|
|
@@ -3396,8 +3468,8 @@ var PanelSearch = forwardRef2(function PanelSearch2({ className, value, onChange
|
|
|
3396
3468
|
className
|
|
3397
3469
|
),
|
|
3398
3470
|
children: [
|
|
3399
|
-
/* @__PURE__ */
|
|
3400
|
-
/* @__PURE__ */
|
|
3471
|
+
/* @__PURE__ */ jsx12(LuSearch, { className: "text-base" }),
|
|
3472
|
+
/* @__PURE__ */ jsx12(
|
|
3401
3473
|
"input",
|
|
3402
3474
|
{
|
|
3403
3475
|
ref,
|
|
@@ -3415,7 +3487,7 @@ var PanelSearch = forwardRef2(function PanelSearch2({ className, value, onChange
|
|
|
3415
3487
|
function SelectionBadge({ active, selected, className }) {
|
|
3416
3488
|
const label = active ? "Active" : selected ? "Selected" : "Idle";
|
|
3417
3489
|
const tone = active ? "bg-blue-600 text-white" : selected ? "bg-blue-100 text-blue-700 dark:bg-blue-500/15 dark:text-blue-200" : "bg-slate-100 text-slate-500 dark:bg-slate-800 dark:text-slate-400";
|
|
3418
|
-
return /* @__PURE__ */
|
|
3490
|
+
return /* @__PURE__ */ jsx12("span", { className: cn("rounded-full px-2.5 py-1 text-[10px] font-semibold uppercase tracking-[0.18em]", tone, className), children: label });
|
|
3419
3491
|
}
|
|
3420
3492
|
function EmptyState({
|
|
3421
3493
|
title,
|
|
@@ -3423,7 +3495,7 @@ function EmptyState({
|
|
|
3423
3495
|
action,
|
|
3424
3496
|
className
|
|
3425
3497
|
}) {
|
|
3426
|
-
return /* @__PURE__ */
|
|
3498
|
+
return /* @__PURE__ */ jsxs8(
|
|
3427
3499
|
"div",
|
|
3428
3500
|
{
|
|
3429
3501
|
className: cn(
|
|
@@ -3432,23 +3504,23 @@ function EmptyState({
|
|
|
3432
3504
|
className
|
|
3433
3505
|
),
|
|
3434
3506
|
children: [
|
|
3435
|
-
/* @__PURE__ */
|
|
3436
|
-
/* @__PURE__ */
|
|
3437
|
-
/* @__PURE__ */
|
|
3438
|
-
action ? /* @__PURE__ */
|
|
3507
|
+
/* @__PURE__ */ jsx12("div", { className: "mb-3 rounded-full bg-white p-3 text-blue-500 shadow-sm dark:bg-slate-950", children: /* @__PURE__ */ jsx12(HiOutlineSparkles, { className: "text-xl" }) }),
|
|
3508
|
+
/* @__PURE__ */ jsx12("h4", { className: "text-sm font-semibold text-slate-900 dark:text-slate-100", children: title }),
|
|
3509
|
+
/* @__PURE__ */ jsx12("p", { className: "mt-2 max-w-sm text-sm text-slate-500 dark:text-slate-400", children: description }),
|
|
3510
|
+
action ? /* @__PURE__ */ jsx12("div", { className: "mt-4", children: action }) : null
|
|
3439
3511
|
]
|
|
3440
3512
|
}
|
|
3441
3513
|
);
|
|
3442
3514
|
}
|
|
3443
3515
|
function PropertyList({ items, className }) {
|
|
3444
|
-
return /* @__PURE__ */
|
|
3445
|
-
/* @__PURE__ */
|
|
3446
|
-
/* @__PURE__ */
|
|
3516
|
+
return /* @__PURE__ */ jsx12("div", { className: cn("space-y-2", className), children: items.map((item, index) => /* @__PURE__ */ jsxs8("div", { className: "flex items-center justify-between gap-3 rounded-xl bg-slate-50 px-3 py-2 text-sm dark:bg-slate-900", children: [
|
|
3517
|
+
/* @__PURE__ */ jsx12("span", { className: "text-slate-500 dark:text-slate-400", children: item.label }),
|
|
3518
|
+
/* @__PURE__ */ jsx12("span", { className: "truncate font-medium text-slate-900 dark:text-slate-100", children: item.value })
|
|
3447
3519
|
] }, index)) });
|
|
3448
3520
|
}
|
|
3449
3521
|
function StatusDot({ tone = "default", className }) {
|
|
3450
3522
|
const palette = tone === "success" ? "bg-emerald-500" : tone === "warning" ? "bg-amber-500" : tone === "danger" ? "bg-rose-500" : "bg-slate-400";
|
|
3451
|
-
return /* @__PURE__ */
|
|
3523
|
+
return /* @__PURE__ */ jsx12("span", { className: cn("inline-flex h-2.5 w-2.5 rounded-full", palette, className) });
|
|
3452
3524
|
}
|
|
3453
3525
|
|
|
3454
3526
|
// src/builder/service-context.ts
|
|
@@ -3896,21 +3968,21 @@ import { FiAlertCircle as FiAlertCircle2 } from "react-icons/fi";
|
|
|
3896
3968
|
import "react";
|
|
3897
3969
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
3898
3970
|
import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react";
|
|
3899
|
-
import { jsx as
|
|
3971
|
+
import { jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
3900
3972
|
function DropdownMenu({
|
|
3901
3973
|
...props
|
|
3902
3974
|
}) {
|
|
3903
|
-
return /* @__PURE__ */
|
|
3975
|
+
return /* @__PURE__ */ jsx13(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
|
|
3904
3976
|
}
|
|
3905
3977
|
function DropdownMenuPortal({
|
|
3906
3978
|
...props
|
|
3907
3979
|
}) {
|
|
3908
|
-
return /* @__PURE__ */
|
|
3980
|
+
return /* @__PURE__ */ jsx13(DropdownMenuPrimitive.Portal, { "data-slot": "dropdown-menu-portal", ...props });
|
|
3909
3981
|
}
|
|
3910
3982
|
function DropdownMenuTrigger({
|
|
3911
3983
|
...props
|
|
3912
3984
|
}) {
|
|
3913
|
-
return /* @__PURE__ */
|
|
3985
|
+
return /* @__PURE__ */ jsx13(
|
|
3914
3986
|
DropdownMenuPrimitive.Trigger,
|
|
3915
3987
|
{
|
|
3916
3988
|
"data-slot": "dropdown-menu-trigger",
|
|
@@ -3923,7 +3995,7 @@ function DropdownMenuContent({
|
|
|
3923
3995
|
sideOffset = 4,
|
|
3924
3996
|
...props
|
|
3925
3997
|
}) {
|
|
3926
|
-
return /* @__PURE__ */
|
|
3998
|
+
return /* @__PURE__ */ jsx13(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx13(
|
|
3927
3999
|
DropdownMenuPrimitive.Content,
|
|
3928
4000
|
{
|
|
3929
4001
|
"data-slot": "dropdown-menu-content",
|
|
@@ -3939,7 +4011,7 @@ function DropdownMenuContent({
|
|
|
3939
4011
|
function DropdownMenuGroup({
|
|
3940
4012
|
...props
|
|
3941
4013
|
}) {
|
|
3942
|
-
return /* @__PURE__ */
|
|
4014
|
+
return /* @__PURE__ */ jsx13(DropdownMenuPrimitive.Group, { "data-slot": "dropdown-menu-group", ...props });
|
|
3943
4015
|
}
|
|
3944
4016
|
function DropdownMenuItem({
|
|
3945
4017
|
className,
|
|
@@ -3947,7 +4019,7 @@ function DropdownMenuItem({
|
|
|
3947
4019
|
variant = "default",
|
|
3948
4020
|
...props
|
|
3949
4021
|
}) {
|
|
3950
|
-
return /* @__PURE__ */
|
|
4022
|
+
return /* @__PURE__ */ jsx13(
|
|
3951
4023
|
DropdownMenuPrimitive.Item,
|
|
3952
4024
|
{
|
|
3953
4025
|
"data-slot": "dropdown-menu-item",
|
|
@@ -3967,7 +4039,7 @@ function DropdownMenuCheckboxItem({
|
|
|
3967
4039
|
checked,
|
|
3968
4040
|
...props
|
|
3969
4041
|
}) {
|
|
3970
|
-
return /* @__PURE__ */
|
|
4042
|
+
return /* @__PURE__ */ jsxs9(
|
|
3971
4043
|
DropdownMenuPrimitive.CheckboxItem,
|
|
3972
4044
|
{
|
|
3973
4045
|
"data-slot": "dropdown-menu-checkbox-item",
|
|
@@ -3978,7 +4050,7 @@ function DropdownMenuCheckboxItem({
|
|
|
3978
4050
|
checked,
|
|
3979
4051
|
...props,
|
|
3980
4052
|
children: [
|
|
3981
|
-
/* @__PURE__ */
|
|
4053
|
+
/* @__PURE__ */ jsx13("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx13(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx13(CheckIcon, { className: "size-4" }) }) }),
|
|
3982
4054
|
children
|
|
3983
4055
|
]
|
|
3984
4056
|
}
|
|
@@ -3987,7 +4059,7 @@ function DropdownMenuCheckboxItem({
|
|
|
3987
4059
|
function DropdownMenuRadioGroup({
|
|
3988
4060
|
...props
|
|
3989
4061
|
}) {
|
|
3990
|
-
return /* @__PURE__ */
|
|
4062
|
+
return /* @__PURE__ */ jsx13(
|
|
3991
4063
|
DropdownMenuPrimitive.RadioGroup,
|
|
3992
4064
|
{
|
|
3993
4065
|
"data-slot": "dropdown-menu-radio-group",
|
|
@@ -4000,7 +4072,7 @@ function DropdownMenuRadioItem({
|
|
|
4000
4072
|
children,
|
|
4001
4073
|
...props
|
|
4002
4074
|
}) {
|
|
4003
|
-
return /* @__PURE__ */
|
|
4075
|
+
return /* @__PURE__ */ jsxs9(
|
|
4004
4076
|
DropdownMenuPrimitive.RadioItem,
|
|
4005
4077
|
{
|
|
4006
4078
|
"data-slot": "dropdown-menu-radio-item",
|
|
@@ -4010,7 +4082,7 @@ function DropdownMenuRadioItem({
|
|
|
4010
4082
|
),
|
|
4011
4083
|
...props,
|
|
4012
4084
|
children: [
|
|
4013
|
-
/* @__PURE__ */
|
|
4085
|
+
/* @__PURE__ */ jsx13("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx13(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx13(CircleIcon, { className: "size-2 fill-current" }) }) }),
|
|
4014
4086
|
children
|
|
4015
4087
|
]
|
|
4016
4088
|
}
|
|
@@ -4021,7 +4093,7 @@ function DropdownMenuLabel({
|
|
|
4021
4093
|
inset,
|
|
4022
4094
|
...props
|
|
4023
4095
|
}) {
|
|
4024
|
-
return /* @__PURE__ */
|
|
4096
|
+
return /* @__PURE__ */ jsx13(
|
|
4025
4097
|
DropdownMenuPrimitive.Label,
|
|
4026
4098
|
{
|
|
4027
4099
|
"data-slot": "dropdown-menu-label",
|
|
@@ -4038,7 +4110,7 @@ function DropdownMenuSeparator({
|
|
|
4038
4110
|
className,
|
|
4039
4111
|
...props
|
|
4040
4112
|
}) {
|
|
4041
|
-
return /* @__PURE__ */
|
|
4113
|
+
return /* @__PURE__ */ jsx13(
|
|
4042
4114
|
DropdownMenuPrimitive.Separator,
|
|
4043
4115
|
{
|
|
4044
4116
|
"data-slot": "dropdown-menu-separator",
|
|
@@ -4050,7 +4122,7 @@ function DropdownMenuSeparator({
|
|
|
4050
4122
|
function DropdownMenuSub({
|
|
4051
4123
|
...props
|
|
4052
4124
|
}) {
|
|
4053
|
-
return /* @__PURE__ */
|
|
4125
|
+
return /* @__PURE__ */ jsx13(DropdownMenuPrimitive.Sub, { "data-slot": "dropdown-menu-sub", ...props });
|
|
4054
4126
|
}
|
|
4055
4127
|
function DropdownMenuSubTrigger({
|
|
4056
4128
|
className,
|
|
@@ -4058,7 +4130,7 @@ function DropdownMenuSubTrigger({
|
|
|
4058
4130
|
children,
|
|
4059
4131
|
...props
|
|
4060
4132
|
}) {
|
|
4061
|
-
return /* @__PURE__ */
|
|
4133
|
+
return /* @__PURE__ */ jsxs9(
|
|
4062
4134
|
DropdownMenuPrimitive.SubTrigger,
|
|
4063
4135
|
{
|
|
4064
4136
|
"data-slot": "dropdown-menu-sub-trigger",
|
|
@@ -4070,7 +4142,7 @@ function DropdownMenuSubTrigger({
|
|
|
4070
4142
|
...props,
|
|
4071
4143
|
children: [
|
|
4072
4144
|
children,
|
|
4073
|
-
/* @__PURE__ */
|
|
4145
|
+
/* @__PURE__ */ jsx13(ChevronRightIcon, { className: "ml-auto size-4" })
|
|
4074
4146
|
]
|
|
4075
4147
|
}
|
|
4076
4148
|
);
|
|
@@ -4079,7 +4151,7 @@ function DropdownMenuSubContent({
|
|
|
4079
4151
|
className,
|
|
4080
4152
|
...props
|
|
4081
4153
|
}) {
|
|
4082
|
-
return /* @__PURE__ */
|
|
4154
|
+
return /* @__PURE__ */ jsx13(
|
|
4083
4155
|
DropdownMenuPrimitive.SubContent,
|
|
4084
4156
|
{
|
|
4085
4157
|
"data-slot": "dropdown-menu-sub-content",
|
|
@@ -4108,7 +4180,7 @@ function toolbarIconButtonClass(active = false, className) {
|
|
|
4108
4180
|
}
|
|
4109
4181
|
|
|
4110
4182
|
// src/panels/canvas/app-toolbar.tsx
|
|
4111
|
-
import { jsx as
|
|
4183
|
+
import { jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
4112
4184
|
function AppToolbar({
|
|
4113
4185
|
bootActionReason,
|
|
4114
4186
|
editDisabledReason,
|
|
@@ -4138,9 +4210,9 @@ function AppToolbar({
|
|
|
4138
4210
|
setShowErrorBadges,
|
|
4139
4211
|
pendingAction
|
|
4140
4212
|
}) {
|
|
4141
|
-
return /* @__PURE__ */
|
|
4142
|
-
/* @__PURE__ */
|
|
4143
|
-
/* @__PURE__ */
|
|
4213
|
+
return /* @__PURE__ */ jsxs10("div", { className: "pointer-events-none absolute top-4 right-4 z-20 flex items-center gap-2", children: [
|
|
4214
|
+
/* @__PURE__ */ jsxs10("div", { className: toolbarSplitSurfaceClass(), children: [
|
|
4215
|
+
/* @__PURE__ */ jsx14(
|
|
4144
4216
|
Button,
|
|
4145
4217
|
{
|
|
4146
4218
|
size: "icon",
|
|
@@ -4150,11 +4222,11 @@ function AppToolbar({
|
|
|
4150
4222
|
onClick: onSave,
|
|
4151
4223
|
disabled: pendingAction === "save" || !canSave,
|
|
4152
4224
|
title: (bootActionReason && !canSave ? bootActionReason : void 0) ?? (!canSave ? editDisabledReason : void 0) ?? "Save snapshot",
|
|
4153
|
-
children: /* @__PURE__ */
|
|
4225
|
+
children: /* @__PURE__ */ jsx14(FiSave, {})
|
|
4154
4226
|
}
|
|
4155
4227
|
),
|
|
4156
|
-
/* @__PURE__ */
|
|
4157
|
-
/* @__PURE__ */
|
|
4228
|
+
/* @__PURE__ */ jsx14("div", { className: "h-5 w-px bg-slate-200 dark:bg-slate-800" }),
|
|
4229
|
+
/* @__PURE__ */ jsx14(
|
|
4158
4230
|
Button,
|
|
4159
4231
|
{
|
|
4160
4232
|
size: "icon",
|
|
@@ -4164,22 +4236,22 @@ function AppToolbar({
|
|
|
4164
4236
|
onClick: onPublish,
|
|
4165
4237
|
disabled: pendingAction === "publish" || !canPublish,
|
|
4166
4238
|
title: (bootActionReason && !canPublish ? bootActionReason : void 0) ?? (!canPublish ? publishDisabledReason : void 0) ?? "Publish commit",
|
|
4167
|
-
children: /* @__PURE__ */
|
|
4239
|
+
children: /* @__PURE__ */ jsx14(LuGitCommitHorizontal, {})
|
|
4168
4240
|
}
|
|
4169
4241
|
)
|
|
4170
4242
|
] }),
|
|
4171
|
-
/* @__PURE__ */
|
|
4172
|
-
/* @__PURE__ */
|
|
4173
|
-
/* @__PURE__ */
|
|
4174
|
-
/* @__PURE__ */
|
|
4175
|
-
/* @__PURE__ */
|
|
4176
|
-
/* @__PURE__ */
|
|
4243
|
+
/* @__PURE__ */ jsxs10("div", { className: toolbarSurfaceClass(), children: [
|
|
4244
|
+
/* @__PURE__ */ jsxs10(DropdownMenu, { children: [
|
|
4245
|
+
/* @__PURE__ */ jsx14(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx14(Button, { size: "icon", variant: "ghost", className: toolbarIconButtonClass(), title: "Import JSON", "aria-label": "Import JSON", children: /* @__PURE__ */ jsx14(LuImport, {}) }) }),
|
|
4246
|
+
/* @__PURE__ */ jsxs10(DropdownMenuContent, { align: "end", className: "w-44", children: [
|
|
4247
|
+
/* @__PURE__ */ jsx14(DropdownMenuItem, { onClick: onImportProps, disabled: !canImport, title: !canImport ? editDisabledReason : void 0, children: "Import props" }),
|
|
4248
|
+
/* @__PURE__ */ jsx14(DropdownMenuItem, { onClick: onImportCatalog, disabled: !canImport, title: !canImport ? editDisabledReason : void 0, children: "Import catalog" })
|
|
4177
4249
|
] })
|
|
4178
4250
|
] }),
|
|
4179
|
-
/* @__PURE__ */
|
|
4180
|
-
/* @__PURE__ */
|
|
4181
|
-
/* @__PURE__ */
|
|
4182
|
-
/* @__PURE__ */
|
|
4251
|
+
/* @__PURE__ */ jsx14(Button, { size: "icon", variant: "ghost", className: toolbarIconButtonClass(), title: "Undo", onClick: onUndo, disabled: !canUndo, children: /* @__PURE__ */ jsx14(LuUndo2, {}) }),
|
|
4252
|
+
/* @__PURE__ */ jsx14(Button, { size: "icon", variant: "ghost", className: toolbarIconButtonClass(), title: "Redo", onClick: onRedo, disabled: !canRedo, children: /* @__PURE__ */ jsx14(LuRedo2, {}) }),
|
|
4253
|
+
/* @__PURE__ */ jsx14(Button, { size: "icon", variant: "ghost", className: toolbarIconButtonClass(), title: "Relayout (coming soon)", onClick: onRelayout, children: /* @__PURE__ */ jsx14(LuHistory, {}) }),
|
|
4254
|
+
/* @__PURE__ */ jsx14(
|
|
4183
4255
|
Button,
|
|
4184
4256
|
{
|
|
4185
4257
|
size: "icon",
|
|
@@ -4188,10 +4260,10 @@ function AppToolbar({
|
|
|
4188
4260
|
className: toolbarIconButtonClass(commentPlacementActive),
|
|
4189
4261
|
title: !canPlaceComment ? commentDisabledReason : commentPlacementActive ? "Cancel add comment" : "Add comment on canvas",
|
|
4190
4262
|
onClick: onToggleCommentPlacement,
|
|
4191
|
-
children: /* @__PURE__ */
|
|
4263
|
+
children: /* @__PURE__ */ jsx14(FiMessageSquare, {})
|
|
4192
4264
|
}
|
|
4193
4265
|
),
|
|
4194
|
-
/* @__PURE__ */
|
|
4266
|
+
/* @__PURE__ */ jsx14(
|
|
4195
4267
|
Button,
|
|
4196
4268
|
{
|
|
4197
4269
|
size: "icon",
|
|
@@ -4199,10 +4271,10 @@ function AppToolbar({
|
|
|
4199
4271
|
className: toolbarIconButtonClass(showErrorBadges),
|
|
4200
4272
|
title: "Toggle error markers",
|
|
4201
4273
|
onClick: () => setShowErrorBadges(!showErrorBadges),
|
|
4202
|
-
children: showErrorBadges ? /* @__PURE__ */
|
|
4274
|
+
children: showErrorBadges ? /* @__PURE__ */ jsx14(FiEye, {}) : /* @__PURE__ */ jsx14(FiEyeOff, {})
|
|
4203
4275
|
}
|
|
4204
4276
|
),
|
|
4205
|
-
/* @__PURE__ */
|
|
4277
|
+
/* @__PURE__ */ jsxs10(
|
|
4206
4278
|
Button,
|
|
4207
4279
|
{
|
|
4208
4280
|
size: "icon",
|
|
@@ -4211,12 +4283,12 @@ function AppToolbar({
|
|
|
4211
4283
|
title: "Toggle console",
|
|
4212
4284
|
onClick: onConsoleToggle,
|
|
4213
4285
|
children: [
|
|
4214
|
-
/* @__PURE__ */
|
|
4215
|
-
errors.merged.counts.total > 0 ? /* @__PURE__ */
|
|
4286
|
+
/* @__PURE__ */ jsx14(FiTerminal, {}),
|
|
4287
|
+
errors.merged.counts.total > 0 ? /* @__PURE__ */ jsx14("span", { className: "absolute top-1.5 right-1.5 inline-flex h-2.5 w-2.5 rounded-full bg-rose-500" }) : null
|
|
4216
4288
|
]
|
|
4217
4289
|
}
|
|
4218
4290
|
),
|
|
4219
|
-
/* @__PURE__ */
|
|
4291
|
+
/* @__PURE__ */ jsx14(
|
|
4220
4292
|
Button,
|
|
4221
4293
|
{
|
|
4222
4294
|
size: "icon",
|
|
@@ -4224,7 +4296,7 @@ function AppToolbar({
|
|
|
4224
4296
|
className: toolbarIconButtonClass(noticesOpen),
|
|
4225
4297
|
title: "Toggle notices manager",
|
|
4226
4298
|
onClick: onNoticesToggle,
|
|
4227
|
-
children: /* @__PURE__ */
|
|
4299
|
+
children: /* @__PURE__ */ jsx14(FiAlertCircle, {})
|
|
4228
4300
|
}
|
|
4229
4301
|
)
|
|
4230
4302
|
] })
|
|
@@ -4982,7 +5054,7 @@ import { BsChatSquareQuote as BsChatSquareQuote2 } from "react-icons/bs";
|
|
|
4982
5054
|
import { LuTags as LuTags2 } from "react-icons/lu";
|
|
4983
5055
|
import { MdOutlineRadioButtonChecked as MdOutlineRadioButtonChecked2 } from "react-icons/md";
|
|
4984
5056
|
import { RxInput as RxInput2 } from "react-icons/rx";
|
|
4985
|
-
import { Fragment as Fragment4, jsx as
|
|
5057
|
+
import { Fragment as Fragment4, jsx as jsx15, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
4986
5058
|
var SELECTED_NODE_RING_CLASS = "ring-2 ring-sky-300 shadow-lg shadow-sky-300/20 dark:ring-sky-400";
|
|
4987
5059
|
var ACTIVE_NODE_OUTLINE_CLASS = "outline-2 outline-solid outline-emerald-500 dark:outline-emerald-400";
|
|
4988
5060
|
var HIGHLIGHT_NODE_OUTLINE_CLASS = "outline-2 outline-solid outline-amber-300 dark:outline-amber-200";
|
|
@@ -5005,7 +5077,7 @@ function NodeShell({
|
|
|
5005
5077
|
focusDimLevel
|
|
5006
5078
|
}) {
|
|
5007
5079
|
const dimClass = focusDimLevel === "soft" ? "opacity-80 " : focusDimLevel === "medium" ? "opacity-[0.55] " : focusDimLevel === "strong" ? "opacity-35 " : "";
|
|
5008
|
-
return /* @__PURE__ */
|
|
5080
|
+
return /* @__PURE__ */ jsxs11(
|
|
5009
5081
|
"div",
|
|
5010
5082
|
{
|
|
5011
5083
|
"data-node-state": [
|
|
@@ -5024,25 +5096,25 @@ function NodeShell({
|
|
|
5024
5096
|
},
|
|
5025
5097
|
onDrop,
|
|
5026
5098
|
children: [
|
|
5027
|
-
/* @__PURE__ */
|
|
5028
|
-
/* @__PURE__ */
|
|
5029
|
-
/* @__PURE__ */
|
|
5099
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2", children: [
|
|
5100
|
+
/* @__PURE__ */ jsx15("span", { className: "text-slate-400 group-hover:text-blue-500", children: icon }),
|
|
5101
|
+
/* @__PURE__ */ jsx15("span", { className: "max-w-52 truncate text-sm font-medium text-slate-800 dark:text-slate-100", children: label })
|
|
5030
5102
|
] }),
|
|
5031
|
-
showCurrentTagDot ? /* @__PURE__ */
|
|
5032
|
-
showErrorBadge && hasError ? /* @__PURE__ */
|
|
5103
|
+
showCurrentTagDot ? /* @__PURE__ */ jsx15("span", { className: "absolute top-2 left-2 h-2.5 w-2.5 rounded-full bg-emerald-500 shadow-[0_0_0_2px_rgba(255,255,255,0.85)] dark:shadow-[0_0_0_2px_rgba(15,23,42,0.8)]" }) : null,
|
|
5104
|
+
showErrorBadge && hasError ? /* @__PURE__ */ jsx15("span", { className: "absolute -top-1.5 -right-1.5 inline-flex h-3 w-3 rounded-full bg-rose-500" }) : null
|
|
5033
5105
|
]
|
|
5034
5106
|
}
|
|
5035
5107
|
);
|
|
5036
5108
|
}
|
|
5037
5109
|
function TagNode(props) {
|
|
5038
5110
|
const id = props.data.node?.id ?? props.id;
|
|
5039
|
-
return /* @__PURE__ */
|
|
5040
|
-
/* @__PURE__ */
|
|
5041
|
-
/* @__PURE__ */
|
|
5111
|
+
return /* @__PURE__ */ jsxs11(Fragment4, { children: [
|
|
5112
|
+
/* @__PURE__ */ jsx15(Handle, { type: "target", position: Position.Left, className: "!h-2 !w-2 !bg-slate-400" }),
|
|
5113
|
+
/* @__PURE__ */ jsx15(
|
|
5042
5114
|
NodeShell,
|
|
5043
5115
|
{
|
|
5044
5116
|
label: props.data.node?.label ?? props.id,
|
|
5045
|
-
icon: /* @__PURE__ */
|
|
5117
|
+
icon: /* @__PURE__ */ jsx15(LuTags2, {}),
|
|
5046
5118
|
selected: props.selected,
|
|
5047
5119
|
hasError: props.data.hasError,
|
|
5048
5120
|
showErrorBadge: props.data.showErrorBadge,
|
|
@@ -5063,18 +5135,18 @@ function TagNode(props) {
|
|
|
5063
5135
|
focusDimLevel: props.data.focusDimLevel
|
|
5064
5136
|
}
|
|
5065
5137
|
),
|
|
5066
|
-
/* @__PURE__ */
|
|
5138
|
+
/* @__PURE__ */ jsx15(Handle, { type: "source", position: Position.Right, className: "!h-2 !w-2 !bg-slate-400" })
|
|
5067
5139
|
] });
|
|
5068
5140
|
}
|
|
5069
5141
|
function FieldNode(props) {
|
|
5070
5142
|
const id = props.data.node?.id ?? props.id;
|
|
5071
|
-
return /* @__PURE__ */
|
|
5072
|
-
/* @__PURE__ */
|
|
5073
|
-
/* @__PURE__ */
|
|
5143
|
+
return /* @__PURE__ */ jsxs11(Fragment4, { children: [
|
|
5144
|
+
/* @__PURE__ */ jsx15(Handle, { type: "target", position: Position.Left, className: "!h-2 !w-2 !bg-slate-400" }),
|
|
5145
|
+
/* @__PURE__ */ jsx15(
|
|
5074
5146
|
NodeShell,
|
|
5075
5147
|
{
|
|
5076
5148
|
label: props.data.node?.label ?? props.id,
|
|
5077
|
-
icon: /* @__PURE__ */
|
|
5149
|
+
icon: /* @__PURE__ */ jsx15(RxInput2, {}),
|
|
5078
5150
|
selected: props.selected,
|
|
5079
5151
|
hasError: props.data.hasError,
|
|
5080
5152
|
showErrorBadge: props.data.showErrorBadge,
|
|
@@ -5095,14 +5167,14 @@ function FieldNode(props) {
|
|
|
5095
5167
|
focusDimLevel: props.data.focusDimLevel
|
|
5096
5168
|
}
|
|
5097
5169
|
),
|
|
5098
|
-
/* @__PURE__ */
|
|
5170
|
+
/* @__PURE__ */ jsx15(Handle, { type: "source", position: Position.Right, className: "!h-2 !w-2 !bg-slate-400" })
|
|
5099
5171
|
] });
|
|
5100
5172
|
}
|
|
5101
5173
|
function OptionNode(props) {
|
|
5102
5174
|
const id = props.data.node?.id ?? props.id;
|
|
5103
|
-
return /* @__PURE__ */
|
|
5104
|
-
/* @__PURE__ */
|
|
5105
|
-
/* @__PURE__ */
|
|
5175
|
+
return /* @__PURE__ */ jsxs11(Fragment4, { children: [
|
|
5176
|
+
/* @__PURE__ */ jsx15(Handle, { type: "target", position: Position.Left, className: "!h-2 !w-2 !bg-slate-400" }),
|
|
5177
|
+
/* @__PURE__ */ jsxs11(
|
|
5106
5178
|
"div",
|
|
5107
5179
|
{
|
|
5108
5180
|
"data-node-state": [
|
|
@@ -5125,32 +5197,32 @@ function OptionNode(props) {
|
|
|
5125
5197
|
props.data.onNodeDrop?.({ nodeId: id, clientX: event.clientX, clientY: event.clientY, dataTransfer: event.dataTransfer });
|
|
5126
5198
|
},
|
|
5127
5199
|
children: [
|
|
5128
|
-
/* @__PURE__ */
|
|
5129
|
-
/* @__PURE__ */
|
|
5130
|
-
/* @__PURE__ */
|
|
5200
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2", children: [
|
|
5201
|
+
/* @__PURE__ */ jsx15(MdOutlineRadioButtonChecked2, { className: "text-slate-400" }),
|
|
5202
|
+
/* @__PURE__ */ jsx15("span", { className: "max-w-36 truncate", children: props.data.node?.label ?? props.id })
|
|
5131
5203
|
] }),
|
|
5132
|
-
props.data.showCurrentTagDot ? /* @__PURE__ */
|
|
5133
|
-
props.data.showErrorBadge && props.data.hasError ? /* @__PURE__ */
|
|
5204
|
+
props.data.showCurrentTagDot ? /* @__PURE__ */ jsx15("span", { className: "absolute top-1 left-1 h-2 w-2 rounded-full bg-emerald-500 shadow-[0_0_0_2px_rgba(255,255,255,0.85)] dark:shadow-[0_0_0_2px_rgba(15,23,42,0.8)]" }) : null,
|
|
5205
|
+
props.data.showErrorBadge && props.data.hasError ? /* @__PURE__ */ jsx15("span", { className: "absolute -top-1 -right-1 inline-flex h-3 w-3 rounded-full bg-rose-500" }) : null
|
|
5134
5206
|
]
|
|
5135
5207
|
}
|
|
5136
5208
|
),
|
|
5137
|
-
/* @__PURE__ */
|
|
5209
|
+
/* @__PURE__ */ jsx15(Handle, { type: "source", position: Position.Right, className: "!h-2 !w-2 !bg-slate-400" })
|
|
5138
5210
|
] });
|
|
5139
5211
|
}
|
|
5140
5212
|
function CommentNode(props) {
|
|
5141
5213
|
const thread = props.data.thread;
|
|
5142
5214
|
const main = thread?.messages?.find((message) => message.isMain) ?? thread?.messages?.[0];
|
|
5143
|
-
return /* @__PURE__ */
|
|
5215
|
+
return /* @__PURE__ */ jsxs11(
|
|
5144
5216
|
"div",
|
|
5145
5217
|
{
|
|
5146
5218
|
className: "h-48 w-64 rounded-lg border border-[#E0E0E0] bg-[#FEFBEA] shadow-md transition-all hover:shadow-lg dark:border-[#555] dark:bg-[#4a4a38] " + (props.selected ? `${SELECTED_NODE_RING_CLASS} ` : ""),
|
|
5147
5219
|
children: [
|
|
5148
|
-
/* @__PURE__ */
|
|
5149
|
-
/* @__PURE__ */
|
|
5150
|
-
/* @__PURE__ */
|
|
5220
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2 border-b border-[#E0E0E0]/70 px-3 py-2 text-xs font-medium text-slate-600 dark:border-[#555] dark:text-slate-300", children: [
|
|
5221
|
+
/* @__PURE__ */ jsx15(BsChatSquareQuote2, {}),
|
|
5222
|
+
/* @__PURE__ */ jsx15("span", { children: main?.authorName ?? "Comment" })
|
|
5151
5223
|
] }),
|
|
5152
|
-
/* @__PURE__ */
|
|
5153
|
-
/* @__PURE__ */
|
|
5224
|
+
/* @__PURE__ */ jsx15("div", { className: "px-3 py-2 text-sm leading-5 text-slate-700 dark:text-slate-200", children: main?.body ?? "" }),
|
|
5225
|
+
/* @__PURE__ */ jsx15("div", { className: "absolute bottom-2 right-2 text-[10px] uppercase tracking-[0.14em] text-slate-400", children: thread?.resolved ? "Resolved" : "Open" })
|
|
5154
5226
|
]
|
|
5155
5227
|
}
|
|
5156
5228
|
);
|
|
@@ -5158,27 +5230,27 @@ function CommentNode(props) {
|
|
|
5158
5230
|
function ServiceContextSystemNode(props) {
|
|
5159
5231
|
const context = props.data.serviceContext;
|
|
5160
5232
|
const services2 = context?.services ?? [];
|
|
5161
|
-
return /* @__PURE__ */
|
|
5233
|
+
return /* @__PURE__ */ jsxs11(
|
|
5162
5234
|
"div",
|
|
5163
5235
|
{
|
|
5164
5236
|
className: "min-w-80 max-w-96 rounded-xl border border-slate-200 bg-white/95 p-3 shadow-xl backdrop-blur-sm dark:border-slate-800 dark:bg-slate-950/95 " + (props.selected ? `${SELECTED_NODE_RING_CLASS} ` : ""),
|
|
5165
5237
|
children: [
|
|
5166
|
-
/* @__PURE__ */
|
|
5167
|
-
/* @__PURE__ */
|
|
5238
|
+
/* @__PURE__ */ jsx15("div", { className: "text-base font-semibold text-slate-900 dark:text-slate-100", children: "Service context" }),
|
|
5239
|
+
/* @__PURE__ */ jsxs11("div", { className: "mt-2 text-sm text-slate-500 dark:text-slate-400", children: [
|
|
5168
5240
|
"Active tag: ",
|
|
5169
5241
|
context?.selectedTagLabel ?? "No tag selected"
|
|
5170
5242
|
] }),
|
|
5171
|
-
/* @__PURE__ */
|
|
5243
|
+
/* @__PURE__ */ jsxs11("div", { className: "text-sm text-slate-500 dark:text-slate-400", children: [
|
|
5172
5244
|
"Selected buttons: ",
|
|
5173
5245
|
context?.selectedButtonsCount ?? 0
|
|
5174
5246
|
] }),
|
|
5175
|
-
/* @__PURE__ */
|
|
5176
|
-
/* @__PURE__ */
|
|
5177
|
-
/* @__PURE__ */
|
|
5178
|
-
/* @__PURE__ */
|
|
5247
|
+
/* @__PURE__ */ jsx15("div", { className: "mt-3 space-y-2", children: services2.length === 0 ? /* @__PURE__ */ jsx15("div", { className: "rounded-lg bg-slate-50 px-2 py-2 text-sm text-slate-500 dark:bg-slate-900 dark:text-slate-400", children: "No active services in current context" }) : services2.slice(0, 4).map((service) => /* @__PURE__ */ jsxs11("div", { className: "rounded-lg bg-slate-50 px-2 py-2 dark:bg-slate-900", children: [
|
|
5248
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex items-center justify-between gap-2", children: [
|
|
5249
|
+
/* @__PURE__ */ jsx15("span", { className: "truncate text-sm font-medium text-slate-800 dark:text-slate-100", children: service.name }),
|
|
5250
|
+
/* @__PURE__ */ jsx15("span", { className: "text-xs text-slate-500 dark:text-slate-400", children: service.rateLabel })
|
|
5179
5251
|
] }),
|
|
5180
|
-
/* @__PURE__ */
|
|
5181
|
-
service.reasonLabels.length ? /* @__PURE__ */
|
|
5252
|
+
/* @__PURE__ */ jsx15("div", { className: "mt-1 text-xs text-slate-500 dark:text-slate-400", children: service.statusLabel }),
|
|
5253
|
+
service.reasonLabels.length ? /* @__PURE__ */ jsx15("div", { className: "mt-1 truncate text-[11px] text-slate-400 dark:text-slate-500", children: service.reasonLabels.join(", ") }) : null
|
|
5182
5254
|
] }, service.id)) })
|
|
5183
5255
|
]
|
|
5184
5256
|
}
|
|
@@ -5201,16 +5273,16 @@ import { useReactFlow } from "@xyflow/react";
|
|
|
5201
5273
|
// src/components/ui/popover.tsx
|
|
5202
5274
|
import "react";
|
|
5203
5275
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
5204
|
-
import { jsx as
|
|
5276
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
5205
5277
|
function Popover({
|
|
5206
5278
|
...props
|
|
5207
5279
|
}) {
|
|
5208
|
-
return /* @__PURE__ */
|
|
5280
|
+
return /* @__PURE__ */ jsx16(PopoverPrimitive.Root, { "data-slot": "popover", ...props });
|
|
5209
5281
|
}
|
|
5210
5282
|
function PopoverTrigger({
|
|
5211
5283
|
...props
|
|
5212
5284
|
}) {
|
|
5213
|
-
return /* @__PURE__ */
|
|
5285
|
+
return /* @__PURE__ */ jsx16(PopoverPrimitive.Trigger, { "data-slot": "popover-trigger", ...props });
|
|
5214
5286
|
}
|
|
5215
5287
|
function PopoverContent({
|
|
5216
5288
|
className,
|
|
@@ -5218,7 +5290,7 @@ function PopoverContent({
|
|
|
5218
5290
|
sideOffset = 4,
|
|
5219
5291
|
...props
|
|
5220
5292
|
}) {
|
|
5221
|
-
return /* @__PURE__ */
|
|
5293
|
+
return /* @__PURE__ */ jsx16(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx16(
|
|
5222
5294
|
PopoverPrimitive.Content,
|
|
5223
5295
|
{
|
|
5224
5296
|
"data-slot": "popover-content",
|
|
@@ -5295,27 +5367,27 @@ function sortWithAnchors(list) {
|
|
|
5295
5367
|
import { FiEye as FiEye2, FiGrid, FiLink, FiMap, FiMinus, FiPlus, FiTarget } from "react-icons/fi";
|
|
5296
5368
|
import { LuAlignCenterVertical, LuBetweenHorizontalStart, LuGitCompareArrows, LuMoveUpRight } from "react-icons/lu";
|
|
5297
5369
|
import { MdOutlineFitScreen, MdOutlineKeyboardArrowDown } from "react-icons/md";
|
|
5298
|
-
import { jsx as
|
|
5370
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
5299
5371
|
var Icons = {
|
|
5300
|
-
bind: (active = false) => /* @__PURE__ */
|
|
5301
|
-
include: (active = false) => /* @__PURE__ */
|
|
5302
|
-
exclude: (active = false) => /* @__PURE__ */
|
|
5303
|
-
bindVisible: (active = false) => /* @__PURE__ */
|
|
5304
|
-
includeVisible: (active = false) => /* @__PURE__ */
|
|
5305
|
-
excludeVisible: (active = false) => /* @__PURE__ */
|
|
5306
|
-
focusContext: (active = false) => /* @__PURE__ */
|
|
5307
|
-
visibilityMenu: (active = false) => /* @__PURE__ */
|
|
5308
|
-
grid: (active = false) => /* @__PURE__ */
|
|
5309
|
-
minimap: (active = false) => /* @__PURE__ */
|
|
5310
|
-
zoomIn: () => /* @__PURE__ */
|
|
5311
|
-
zoomOut: () => /* @__PURE__ */
|
|
5312
|
-
fit: () => /* @__PURE__ */
|
|
5313
|
-
viewport: () => /* @__PURE__ */
|
|
5314
|
-
chevronDown: () => /* @__PURE__ */
|
|
5372
|
+
bind: (active = false) => /* @__PURE__ */ jsx17(LuGitCompareArrows, { className: active ? "text-blue-600" : "" }),
|
|
5373
|
+
include: (active = false) => /* @__PURE__ */ jsx17(LuMoveUpRight, { className: active ? "text-blue-600" : "" }),
|
|
5374
|
+
exclude: (active = false) => /* @__PURE__ */ jsx17(LuBetweenHorizontalStart, { className: active ? "text-blue-600" : "" }),
|
|
5375
|
+
bindVisible: (active = false) => /* @__PURE__ */ jsx17(FiLink, { className: active ? "text-blue-600" : "" }),
|
|
5376
|
+
includeVisible: (active = false) => /* @__PURE__ */ jsx17(LuMoveUpRight, { className: active ? "text-blue-600" : "opacity-80" }),
|
|
5377
|
+
excludeVisible: (active = false) => /* @__PURE__ */ jsx17(LuBetweenHorizontalStart, { className: active ? "text-rose-600" : "opacity-80" }),
|
|
5378
|
+
focusContext: (active = false) => /* @__PURE__ */ jsx17(FiTarget, { className: active ? "text-emerald-600" : "" }),
|
|
5379
|
+
visibilityMenu: (active = false) => /* @__PURE__ */ jsx17(FiEye2, { className: active ? "text-blue-600" : "" }),
|
|
5380
|
+
grid: (active = false) => /* @__PURE__ */ jsx17(FiGrid, { className: active ? "text-blue-600" : "" }),
|
|
5381
|
+
minimap: (active = false) => /* @__PURE__ */ jsx17(FiMap, { className: active ? "text-blue-600" : "" }),
|
|
5382
|
+
zoomIn: () => /* @__PURE__ */ jsx17(FiPlus, {}),
|
|
5383
|
+
zoomOut: () => /* @__PURE__ */ jsx17(FiMinus, {}),
|
|
5384
|
+
fit: () => /* @__PURE__ */ jsx17(MdOutlineFitScreen, {}),
|
|
5385
|
+
viewport: () => /* @__PURE__ */ jsx17(LuAlignCenterVertical, {}),
|
|
5386
|
+
chevronDown: () => /* @__PURE__ */ jsx17(MdOutlineKeyboardArrowDown, {})
|
|
5315
5387
|
};
|
|
5316
5388
|
|
|
5317
5389
|
// src/panels/canvas/toolbar/index.tsx
|
|
5318
|
-
import { Fragment as Fragment5, jsx as
|
|
5390
|
+
import { Fragment as Fragment5, jsx as jsx18, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
5319
5391
|
function Toolbar({
|
|
5320
5392
|
api,
|
|
5321
5393
|
mode = "dev",
|
|
@@ -5441,11 +5513,11 @@ function Toolbar({
|
|
|
5441
5513
|
const groups = groupBy(items, (item) => item.group ?? "view");
|
|
5442
5514
|
const relationTools = groups.relation ?? [];
|
|
5443
5515
|
const viewMenu = items.find((item) => item.id === "view:menu");
|
|
5444
|
-
return /* @__PURE__ */
|
|
5445
|
-
relationTools.length ? /* @__PURE__ */
|
|
5446
|
-
(button) => renderButton ? renderButton(button, button.id) : /* @__PURE__ */
|
|
5516
|
+
return /* @__PURE__ */ jsx18("div", { className: className ?? "pointer-events-none absolute top-4 left-4 z-20", children: /* @__PURE__ */ jsxs12("div", { className: orientation === "horizontal" ? "flex items-center gap-2" : "grid gap-2", children: [
|
|
5517
|
+
relationTools.length ? /* @__PURE__ */ jsx18("div", { className: toolbarSurfaceClass(orientation === "vertical" ? "flex flex-col items-stretch" : void 0), children: relationTools.map(
|
|
5518
|
+
(button) => renderButton ? renderButton(button, button.id) : /* @__PURE__ */ jsx18(DefaultTool, { ...button, labelPlacement, orientation }, button.id)
|
|
5447
5519
|
) }) : null,
|
|
5448
|
-
viewMenu ? /* @__PURE__ */
|
|
5520
|
+
viewMenu ? /* @__PURE__ */ jsx18(
|
|
5449
5521
|
ViewMenuTool,
|
|
5450
5522
|
{
|
|
5451
5523
|
tool: viewMenu,
|
|
@@ -5453,7 +5525,7 @@ function Toolbar({
|
|
|
5453
5525
|
renderButton
|
|
5454
5526
|
}
|
|
5455
5527
|
) : null,
|
|
5456
|
-
/* @__PURE__ */
|
|
5528
|
+
/* @__PURE__ */ jsx18("div", { className: toolbarSurfaceClass(), children: /* @__PURE__ */ jsx18(
|
|
5457
5529
|
Button,
|
|
5458
5530
|
{
|
|
5459
5531
|
type: "button",
|
|
@@ -5463,7 +5535,7 @@ function Toolbar({
|
|
|
5463
5535
|
"aria-label": orientation === "horizontal" ? "Switch to vertical toolbar" : "Switch to horizontal toolbar",
|
|
5464
5536
|
className: toolbarIconButtonClass(),
|
|
5465
5537
|
title: orientation === "horizontal" ? "Switch to vertical toolbar" : "Switch to horizontal toolbar",
|
|
5466
|
-
children: orientation === "horizontal" ? /* @__PURE__ */
|
|
5538
|
+
children: orientation === "horizontal" ? /* @__PURE__ */ jsx18(LuPanelRight, {}) : /* @__PURE__ */ jsx18(LuPanelBottom, {})
|
|
5467
5539
|
}
|
|
5468
5540
|
) })
|
|
5469
5541
|
] }) });
|
|
@@ -5597,14 +5669,14 @@ function DefaultTool({
|
|
|
5597
5669
|
}) {
|
|
5598
5670
|
const title = labelPlacement === "tooltip" ? disabled ? disabledReason ?? label : label : void 0;
|
|
5599
5671
|
const buttonClass = toolbarIconButtonClass(active) + (orientation === "vertical" && labelPlacement !== "tooltip" ? " w-full justify-start px-2" : "") + (labelPlacement === "below" ? " flex-col" : "");
|
|
5600
|
-
const content = /* @__PURE__ */
|
|
5672
|
+
const content = /* @__PURE__ */ jsxs12(Fragment5, { children: [
|
|
5601
5673
|
icon ?? null,
|
|
5602
|
-
labelPlacement === "inline" && label ? /* @__PURE__ */
|
|
5603
|
-
labelPlacement === "below" && label ? /* @__PURE__ */
|
|
5604
|
-
hasMenu ? /* @__PURE__ */
|
|
5674
|
+
labelPlacement === "inline" && label ? /* @__PURE__ */ jsx18("span", { className: "ml-1", children: label }) : null,
|
|
5675
|
+
labelPlacement === "below" && label ? /* @__PURE__ */ jsx18("span", { className: "mt-0.5 block text-[10px] leading-3 text-slate-500 dark:text-slate-400", children: label }) : null,
|
|
5676
|
+
hasMenu ? /* @__PURE__ */ jsx18("span", { className: "ml-1", children: Icons.chevronDown() }) : null
|
|
5605
5677
|
] });
|
|
5606
5678
|
if (!hasMenu) {
|
|
5607
|
-
return /* @__PURE__ */
|
|
5679
|
+
return /* @__PURE__ */ jsx18(
|
|
5608
5680
|
Button,
|
|
5609
5681
|
{
|
|
5610
5682
|
type: "button",
|
|
@@ -5619,8 +5691,8 @@ function DefaultTool({
|
|
|
5619
5691
|
}
|
|
5620
5692
|
);
|
|
5621
5693
|
}
|
|
5622
|
-
return /* @__PURE__ */
|
|
5623
|
-
/* @__PURE__ */
|
|
5694
|
+
return /* @__PURE__ */ jsxs12("div", { className: "relative", children: [
|
|
5695
|
+
/* @__PURE__ */ jsx18(
|
|
5624
5696
|
Button,
|
|
5625
5697
|
{
|
|
5626
5698
|
type: "button",
|
|
@@ -5634,7 +5706,7 @@ function DefaultTool({
|
|
|
5634
5706
|
children: content
|
|
5635
5707
|
}
|
|
5636
5708
|
),
|
|
5637
|
-
open ? /* @__PURE__ */
|
|
5709
|
+
open ? /* @__PURE__ */ jsx18("div", { className: "absolute left-0 z-20 mt-1 min-w-[10rem] overflow-hidden rounded-md border border-slate-200 bg-white shadow-lg dark:border-slate-700 dark:bg-slate-900", role: "menu", children: /* @__PURE__ */ jsx18("ul", { className: "divide-y divide-slate-200 dark:divide-slate-800", children: children?.map((child) => /* @__PURE__ */ jsx18("li", { children: /* @__PURE__ */ jsxs12(
|
|
5638
5710
|
"button",
|
|
5639
5711
|
{
|
|
5640
5712
|
type: "button",
|
|
@@ -5646,8 +5718,8 @@ function DefaultTool({
|
|
|
5646
5718
|
className: "flex w-full items-center gap-2 px-3 py-2 text-sm hover:bg-slate-100 hover:text-slate-900 dark:hover:bg-slate-800 dark:hover:text-slate-100 " + (child.active ? "bg-slate-100 text-slate-900 dark:bg-slate-800 dark:text-slate-100 " : "") + (child.disabled ? "cursor-not-allowed opacity-50" : ""),
|
|
5647
5719
|
children: [
|
|
5648
5720
|
child.icon ?? null,
|
|
5649
|
-
/* @__PURE__ */
|
|
5650
|
-
child.active ? /* @__PURE__ */
|
|
5721
|
+
/* @__PURE__ */ jsx18("span", { children: child.label }),
|
|
5722
|
+
child.active ? /* @__PURE__ */ jsx18("span", { className: "ml-auto text-[11px] font-medium text-blue-600 dark:text-blue-300", children: "On" }) : null
|
|
5651
5723
|
]
|
|
5652
5724
|
}
|
|
5653
5725
|
) }, child.id)) }) }) : null
|
|
@@ -5662,8 +5734,8 @@ function ViewMenuTool({
|
|
|
5662
5734
|
return renderButton(tool, tool.id);
|
|
5663
5735
|
}
|
|
5664
5736
|
const indicatorCount = tool.children?.filter((child) => child.active).length ?? 0;
|
|
5665
|
-
return /* @__PURE__ */
|
|
5666
|
-
/* @__PURE__ */
|
|
5737
|
+
return /* @__PURE__ */ jsxs12(Popover, { open: tool.open, onOpenChange: () => tool.onToggleMenu?.(), children: [
|
|
5738
|
+
/* @__PURE__ */ jsx18(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx18("div", { className: toolbarSurfaceClass(), children: /* @__PURE__ */ jsxs12(
|
|
5667
5739
|
Button,
|
|
5668
5740
|
{
|
|
5669
5741
|
type: "button",
|
|
@@ -5675,24 +5747,24 @@ function ViewMenuTool({
|
|
|
5675
5747
|
className: toolbarIconButtonClass(tool.active, "relative"),
|
|
5676
5748
|
children: [
|
|
5677
5749
|
tool.icon,
|
|
5678
|
-
tool.active ? /* @__PURE__ */
|
|
5679
|
-
indicatorCount > 0 ? /* @__PURE__ */
|
|
5750
|
+
tool.active ? /* @__PURE__ */ jsx18("span", { className: "absolute top-1.5 right-1.5 inline-flex h-2.5 w-2.5 rounded-full bg-rose-500" }) : null,
|
|
5751
|
+
indicatorCount > 0 ? /* @__PURE__ */ jsxs12("span", { className: "sr-only", children: [
|
|
5680
5752
|
indicatorCount,
|
|
5681
5753
|
" active view options"
|
|
5682
5754
|
] }) : null
|
|
5683
5755
|
]
|
|
5684
5756
|
}
|
|
5685
5757
|
) }) }),
|
|
5686
|
-
/* @__PURE__ */
|
|
5687
|
-
/* @__PURE__ */
|
|
5688
|
-
/* @__PURE__ */
|
|
5758
|
+
/* @__PURE__ */ jsxs12(PopoverContent, { align: "start", className: "w-64 rounded-2xl border-slate-200/90 bg-white/98 p-2 shadow-[0_18px_40px_rgba(15,23,42,0.18)] dark:border-slate-800 dark:bg-slate-950/98", children: [
|
|
5759
|
+
/* @__PURE__ */ jsx18(ViewSection, { title: "Edge Layers", items: tool.children?.filter((child) => child.id.startsWith("view:") && child.id.includes("edges")) ?? [] }),
|
|
5760
|
+
/* @__PURE__ */ jsx18(ViewSection, { title: "Canvas", items: tool.children?.filter((child) => !child.id.includes("edges")) ?? [], className: "mt-2 border-t border-slate-200 pt-2 dark:border-slate-800" })
|
|
5689
5761
|
] })
|
|
5690
5762
|
] });
|
|
5691
5763
|
}
|
|
5692
5764
|
function ViewSection({ title, items, className }) {
|
|
5693
|
-
return /* @__PURE__ */
|
|
5694
|
-
/* @__PURE__ */
|
|
5695
|
-
/* @__PURE__ */
|
|
5765
|
+
return /* @__PURE__ */ jsxs12("div", { className, children: [
|
|
5766
|
+
/* @__PURE__ */ jsx18("div", { className: "px-2 pb-1 text-[11px] font-semibold uppercase tracking-[0.14em] text-slate-400 dark:text-slate-500", children: title }),
|
|
5767
|
+
/* @__PURE__ */ jsx18("div", { className: "grid gap-1", children: items.map((item) => /* @__PURE__ */ jsxs12(
|
|
5696
5768
|
"button",
|
|
5697
5769
|
{
|
|
5698
5770
|
type: "button",
|
|
@@ -5703,9 +5775,9 @@ function ViewSection({ title, items, className }) {
|
|
|
5703
5775
|
onClick: item.onClick,
|
|
5704
5776
|
className: "flex w-full items-center gap-3 rounded-xl px-2.5 py-2 text-left text-sm text-slate-700 transition hover:bg-slate-100 hover:text-slate-950 dark:text-slate-200 dark:hover:bg-slate-900 dark:hover:text-slate-50 " + (item.active ? "bg-slate-100 dark:bg-slate-900 " : "") + (item.disabled ? "cursor-not-allowed opacity-50" : ""),
|
|
5705
5777
|
children: [
|
|
5706
|
-
/* @__PURE__ */
|
|
5707
|
-
/* @__PURE__ */
|
|
5708
|
-
/* @__PURE__ */
|
|
5778
|
+
/* @__PURE__ */ jsx18("span", { className: "flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border border-slate-200 bg-white text-slate-600 dark:border-slate-700 dark:bg-slate-950 dark:text-slate-300", children: item.icon }),
|
|
5779
|
+
/* @__PURE__ */ jsx18("span", { className: "min-w-0 flex-1 truncate font-medium", children: compactLabel(item.label) }),
|
|
5780
|
+
/* @__PURE__ */ jsx18(
|
|
5709
5781
|
"span",
|
|
5710
5782
|
{
|
|
5711
5783
|
"aria-hidden": "true",
|
|
@@ -5752,7 +5824,7 @@ function mapIcon(token, active) {
|
|
|
5752
5824
|
case "minimap":
|
|
5753
5825
|
return Icons.minimap(active);
|
|
5754
5826
|
default:
|
|
5755
|
-
return /* @__PURE__ */
|
|
5827
|
+
return /* @__PURE__ */ jsx18("span", { className: "text-xs text-slate-500", children: token });
|
|
5756
5828
|
}
|
|
5757
5829
|
}
|
|
5758
5830
|
function groupBy(arr, key) {
|
|
@@ -5766,7 +5838,7 @@ function groupBy(arr, key) {
|
|
|
5766
5838
|
}
|
|
5767
5839
|
|
|
5768
5840
|
// src/panels/canvas/canvas-surface.tsx
|
|
5769
|
-
import { jsx as
|
|
5841
|
+
import { jsx as jsx19, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
5770
5842
|
function hasPersistedViewport(viewport) {
|
|
5771
5843
|
if (!viewport) return false;
|
|
5772
5844
|
return Math.abs(viewport.x) > 0.5 || Math.abs(viewport.y) > 0.5 || Math.abs(viewport.zoom - 1) > 1e-4;
|
|
@@ -5862,7 +5934,7 @@ function CanvasSurface({
|
|
|
5862
5934
|
if (!persistToolbarOrientation || typeof window === "undefined") return;
|
|
5863
5935
|
window.localStorage.setItem(orientationStorageKey, orientation);
|
|
5864
5936
|
}, [orientation, orientationStorageKey, persistToolbarOrientation]);
|
|
5865
|
-
return /* @__PURE__ */
|
|
5937
|
+
return /* @__PURE__ */ jsx19("div", { className: "relative h-full w-full", children: /* @__PURE__ */ jsxs13(
|
|
5866
5938
|
ReactFlow,
|
|
5867
5939
|
{
|
|
5868
5940
|
nodes,
|
|
@@ -5925,8 +5997,8 @@ function CanvasSurface({
|
|
|
5925
5997
|
});
|
|
5926
5998
|
},
|
|
5927
5999
|
children: [
|
|
5928
|
-
/* @__PURE__ */
|
|
5929
|
-
showToolbar ? /* @__PURE__ */
|
|
6000
|
+
/* @__PURE__ */ jsx19(InitialFitController, { enabled: shouldInitialFit, nodeCount: nodes.length }),
|
|
6001
|
+
showToolbar ? /* @__PURE__ */ jsx19("div", { className: `pointer-events-none absolute z-10 ${toolbarPositionClassName}`, children: /* @__PURE__ */ jsx19(
|
|
5930
6002
|
Toolbar,
|
|
5931
6003
|
{
|
|
5932
6004
|
api,
|
|
@@ -5953,8 +6025,8 @@ function CanvasSurface({
|
|
|
5953
6025
|
className: "pointer-events-none"
|
|
5954
6026
|
}
|
|
5955
6027
|
) }) : null,
|
|
5956
|
-
showMiniMap ? /* @__PURE__ */
|
|
5957
|
-
showGrid ? /* @__PURE__ */
|
|
6028
|
+
showMiniMap ? /* @__PURE__ */ jsx19(MiniMap, {}) : null,
|
|
6029
|
+
showGrid ? /* @__PURE__ */ jsx19(Background, { gap: 32, size: 1, color: "rgba(148,163,184,0.25)" }) : null,
|
|
5958
6030
|
children
|
|
5959
6031
|
]
|
|
5960
6032
|
}
|
|
@@ -5962,7 +6034,7 @@ function CanvasSurface({
|
|
|
5962
6034
|
}
|
|
5963
6035
|
|
|
5964
6036
|
// src/panels/canvas/flow-canvas.tsx
|
|
5965
|
-
import { jsx as
|
|
6037
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
5966
6038
|
function FlowCanvas({
|
|
5967
6039
|
tools,
|
|
5968
6040
|
showToolbar = true,
|
|
@@ -5990,7 +6062,7 @@ function FlowCanvas({
|
|
|
5990
6062
|
children
|
|
5991
6063
|
}) {
|
|
5992
6064
|
const api = useCanvasAPI();
|
|
5993
|
-
return /* @__PURE__ */
|
|
6065
|
+
return /* @__PURE__ */ jsx20(
|
|
5994
6066
|
CanvasSurface,
|
|
5995
6067
|
{
|
|
5996
6068
|
api,
|
|
@@ -6025,7 +6097,7 @@ function FlowCanvas({
|
|
|
6025
6097
|
// src/components/ui/alert.tsx
|
|
6026
6098
|
import "react";
|
|
6027
6099
|
import { cva as cva2 } from "class-variance-authority";
|
|
6028
|
-
import { jsx as
|
|
6100
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
6029
6101
|
var alertVariants = cva2(
|
|
6030
6102
|
"relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",
|
|
6031
6103
|
{
|
|
@@ -6045,7 +6117,7 @@ function Alert({
|
|
|
6045
6117
|
variant,
|
|
6046
6118
|
...props
|
|
6047
6119
|
}) {
|
|
6048
|
-
return /* @__PURE__ */
|
|
6120
|
+
return /* @__PURE__ */ jsx21(
|
|
6049
6121
|
"div",
|
|
6050
6122
|
{
|
|
6051
6123
|
"data-slot": "alert",
|
|
@@ -6056,7 +6128,7 @@ function Alert({
|
|
|
6056
6128
|
);
|
|
6057
6129
|
}
|
|
6058
6130
|
function AlertTitle({ className, ...props }) {
|
|
6059
|
-
return /* @__PURE__ */
|
|
6131
|
+
return /* @__PURE__ */ jsx21(
|
|
6060
6132
|
"div",
|
|
6061
6133
|
{
|
|
6062
6134
|
"data-slot": "alert-title",
|
|
@@ -6072,7 +6144,7 @@ function AlertDescription({
|
|
|
6072
6144
|
className,
|
|
6073
6145
|
...props
|
|
6074
6146
|
}) {
|
|
6075
|
-
return /* @__PURE__ */
|
|
6147
|
+
return /* @__PURE__ */ jsx21(
|
|
6076
6148
|
"div",
|
|
6077
6149
|
{
|
|
6078
6150
|
"data-slot": "alert-description",
|
|
@@ -6090,7 +6162,7 @@ import cloneDeep2 from "lodash/cloneDeep";
|
|
|
6090
6162
|
import { useEffect as useEffect7, useMemo as useMemo8, useState as useState7 } from "react";
|
|
6091
6163
|
import { createPortal as createPortal3 } from "react-dom";
|
|
6092
6164
|
import { FiUpload, FiX as FiX2 } from "react-icons/fi";
|
|
6093
|
-
import { jsx as
|
|
6165
|
+
import { jsx as jsx22, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
6094
6166
|
function ImportJsonModal({ open, target, onClose, onImportProps, onImportCatalog }) {
|
|
6095
6167
|
const [rawInput, setRawInput] = useState7("");
|
|
6096
6168
|
const [source, setSource] = useState7("paste");
|
|
@@ -6174,39 +6246,39 @@ function ImportJsonModal({ open, target, onClose, onImportProps, onImportCatalog
|
|
|
6174
6246
|
}
|
|
6175
6247
|
};
|
|
6176
6248
|
return createPortal3(
|
|
6177
|
-
/* @__PURE__ */
|
|
6249
|
+
/* @__PURE__ */ jsx22(
|
|
6178
6250
|
"div",
|
|
6179
6251
|
{
|
|
6180
6252
|
className: "fixed inset-0 z-50 flex items-center justify-center bg-slate-950/60 p-4 backdrop-blur-sm",
|
|
6181
6253
|
onMouseDown: (event) => {
|
|
6182
6254
|
if (event.target === event.currentTarget && !pending) onClose();
|
|
6183
6255
|
},
|
|
6184
|
-
children: /* @__PURE__ */
|
|
6185
|
-
/* @__PURE__ */
|
|
6186
|
-
/* @__PURE__ */
|
|
6187
|
-
/* @__PURE__ */
|
|
6188
|
-
/* @__PURE__ */
|
|
6256
|
+
children: /* @__PURE__ */ jsxs14("div", { className: "flex h-[min(90vh,52rem)] w-[min(96vw,56rem)] flex-col overflow-hidden rounded-[28px] border border-slate-200 bg-white shadow-2xl dark:border-slate-800 dark:bg-slate-950", children: [
|
|
6257
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex items-start justify-between gap-4 border-b border-slate-200 px-6 py-4 dark:border-slate-800", children: [
|
|
6258
|
+
/* @__PURE__ */ jsxs14("div", { className: "min-w-0", children: [
|
|
6259
|
+
/* @__PURE__ */ jsx22("h2", { className: "text-lg font-semibold text-slate-900 dark:text-slate-100", children: title }),
|
|
6260
|
+
/* @__PURE__ */ jsx22("p", { className: "mt-1 text-sm text-slate-500 dark:text-slate-400", children: subtitle })
|
|
6189
6261
|
] }),
|
|
6190
|
-
/* @__PURE__ */
|
|
6262
|
+
/* @__PURE__ */ jsx22(Button, { type: "button", variant: "ghost", size: "sm", onClick: onClose, disabled: pending, className: "h-9 rounded-xl px-2", children: /* @__PURE__ */ jsx22(FiX2, {}) })
|
|
6191
6263
|
] }),
|
|
6192
|
-
/* @__PURE__ */
|
|
6193
|
-
/* @__PURE__ */
|
|
6194
|
-
/* @__PURE__ */
|
|
6195
|
-
/* @__PURE__ */
|
|
6196
|
-
/* @__PURE__ */
|
|
6197
|
-
/* @__PURE__ */
|
|
6198
|
-
/* @__PURE__ */
|
|
6264
|
+
/* @__PURE__ */ jsx22("div", { className: "min-h-0 flex-1 overflow-auto px-6 py-5", children: /* @__PURE__ */ jsxs14("div", { className: "grid gap-5 lg:grid-cols-[minmax(0,1.7fr)_minmax(18rem,1fr)]", children: [
|
|
6265
|
+
/* @__PURE__ */ jsxs14("div", { className: "space-y-4", children: [
|
|
6266
|
+
/* @__PURE__ */ jsxs14("section", { className: "rounded-2xl border border-slate-200/80 bg-slate-50/80 p-4 dark:border-slate-800 dark:bg-slate-900/60", children: [
|
|
6267
|
+
/* @__PURE__ */ jsx22("div", { className: "mb-2 text-sm font-semibold text-slate-900 dark:text-slate-100", children: "Input" }),
|
|
6268
|
+
/* @__PURE__ */ jsx22("label", { className: "block text-sm font-medium text-slate-700 dark:text-slate-300", htmlFor: "import-json-file", children: "Load JSON file" }),
|
|
6269
|
+
/* @__PURE__ */ jsxs14("div", { className: "mt-2 flex flex-wrap items-center gap-3", children: [
|
|
6270
|
+
/* @__PURE__ */ jsxs14(
|
|
6199
6271
|
"label",
|
|
6200
6272
|
{
|
|
6201
6273
|
htmlFor: "import-json-file",
|
|
6202
6274
|
className: "inline-flex cursor-pointer items-center gap-2 rounded-xl border border-slate-200 bg-white px-3 py-2 text-sm font-medium text-slate-700 shadow-sm transition hover:bg-slate-100 dark:border-slate-700 dark:bg-slate-950 dark:text-slate-200 dark:hover:bg-slate-900",
|
|
6203
6275
|
children: [
|
|
6204
|
-
/* @__PURE__ */
|
|
6276
|
+
/* @__PURE__ */ jsx22(FiUpload, {}),
|
|
6205
6277
|
"Choose file"
|
|
6206
6278
|
]
|
|
6207
6279
|
}
|
|
6208
6280
|
),
|
|
6209
|
-
/* @__PURE__ */
|
|
6281
|
+
/* @__PURE__ */ jsx22(
|
|
6210
6282
|
"input",
|
|
6211
6283
|
{
|
|
6212
6284
|
id: "import-json-file",
|
|
@@ -6226,13 +6298,13 @@ function ImportJsonModal({ open, target, onClose, onImportProps, onImportCatalog
|
|
|
6226
6298
|
}
|
|
6227
6299
|
}
|
|
6228
6300
|
),
|
|
6229
|
-
/* @__PURE__ */
|
|
6301
|
+
/* @__PURE__ */ jsx22("span", { className: "text-xs text-slate-500 dark:text-slate-400", children: fileName ?? "No file selected" })
|
|
6230
6302
|
] }),
|
|
6231
|
-
/* @__PURE__ */
|
|
6303
|
+
/* @__PURE__ */ jsx22("p", { className: "mt-3 text-xs text-slate-500 dark:text-slate-400", children: "You can also paste JSON directly below." })
|
|
6232
6304
|
] }),
|
|
6233
|
-
/* @__PURE__ */
|
|
6234
|
-
/* @__PURE__ */
|
|
6235
|
-
/* @__PURE__ */
|
|
6305
|
+
/* @__PURE__ */ jsxs14("section", { children: [
|
|
6306
|
+
/* @__PURE__ */ jsx22("label", { className: "mb-2 block text-sm font-medium text-slate-700 dark:text-slate-300", htmlFor: "import-json-textarea", children: "JSON payload" }),
|
|
6307
|
+
/* @__PURE__ */ jsx22(
|
|
6236
6308
|
"textarea",
|
|
6237
6309
|
{
|
|
6238
6310
|
id: "import-json-textarea",
|
|
@@ -6252,22 +6324,22 @@ function ImportJsonModal({ open, target, onClose, onImportProps, onImportCatalog
|
|
|
6252
6324
|
)
|
|
6253
6325
|
] })
|
|
6254
6326
|
] }),
|
|
6255
|
-
/* @__PURE__ */
|
|
6256
|
-
/* @__PURE__ */
|
|
6257
|
-
/* @__PURE__ */
|
|
6258
|
-
/* @__PURE__ */
|
|
6327
|
+
/* @__PURE__ */ jsxs14("aside", { className: "space-y-4", children: [
|
|
6328
|
+
/* @__PURE__ */ jsxs14("section", { className: "rounded-2xl border border-slate-200 bg-white p-4 shadow-sm dark:border-slate-800 dark:bg-slate-950", children: [
|
|
6329
|
+
/* @__PURE__ */ jsx22("div", { className: "mb-2 text-sm font-semibold text-slate-900 dark:text-slate-100", children: "Preview" }),
|
|
6330
|
+
/* @__PURE__ */ jsx22(PreviewContent, { parseState })
|
|
6259
6331
|
] }),
|
|
6260
|
-
applyError ? /* @__PURE__ */
|
|
6261
|
-
/* @__PURE__ */
|
|
6262
|
-
/* @__PURE__ */
|
|
6332
|
+
applyError ? /* @__PURE__ */ jsxs14(Alert, { variant: "destructive", children: [
|
|
6333
|
+
/* @__PURE__ */ jsx22(AlertTitle, { children: "Import failed" }),
|
|
6334
|
+
/* @__PURE__ */ jsx22(AlertDescription, { children: applyError })
|
|
6263
6335
|
] }) : null
|
|
6264
6336
|
] })
|
|
6265
6337
|
] }) }),
|
|
6266
|
-
/* @__PURE__ */
|
|
6267
|
-
/* @__PURE__ */
|
|
6268
|
-
/* @__PURE__ */
|
|
6269
|
-
/* @__PURE__ */
|
|
6270
|
-
/* @__PURE__ */
|
|
6338
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex items-center justify-between gap-3 border-t border-slate-200 px-6 py-4 dark:border-slate-800", children: [
|
|
6339
|
+
/* @__PURE__ */ jsx22("div", { className: "text-xs text-slate-500 dark:text-slate-400", children: parseState.status === "ready" ? `Ready to import from ${parseState.source === "file" ? fileName ?? "file" : "pasted JSON"}.` : "Import will stay disabled until the JSON is valid." }),
|
|
6340
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-2", children: [
|
|
6341
|
+
/* @__PURE__ */ jsx22(Button, { type: "button", variant: "ghost", onClick: onClose, disabled: pending, children: "Cancel" }),
|
|
6342
|
+
/* @__PURE__ */ jsx22(Button, { type: "button", onClick: () => void handleApply(), disabled: parseState.status !== "ready" || pending, children: pending ? "Importing..." : target === "props" ? "Import props" : "Import catalog" })
|
|
6271
6343
|
] })
|
|
6272
6344
|
] })
|
|
6273
6345
|
] })
|
|
@@ -6278,32 +6350,32 @@ function ImportJsonModal({ open, target, onClose, onImportProps, onImportCatalog
|
|
|
6278
6350
|
}
|
|
6279
6351
|
function PreviewContent({ parseState }) {
|
|
6280
6352
|
if (parseState.status === "idle") {
|
|
6281
|
-
return /* @__PURE__ */
|
|
6353
|
+
return /* @__PURE__ */ jsx22("p", { className: "text-sm text-slate-500 dark:text-slate-400", children: "Paste JSON or load a file to preview what will be imported." });
|
|
6282
6354
|
}
|
|
6283
6355
|
if (parseState.status === "error") {
|
|
6284
|
-
return /* @__PURE__ */
|
|
6285
|
-
/* @__PURE__ */
|
|
6286
|
-
/* @__PURE__ */
|
|
6356
|
+
return /* @__PURE__ */ jsxs14(Alert, { variant: "destructive", children: [
|
|
6357
|
+
/* @__PURE__ */ jsx22(AlertTitle, { children: "Validation error" }),
|
|
6358
|
+
/* @__PURE__ */ jsx22(AlertDescription, { children: parseState.message })
|
|
6287
6359
|
] });
|
|
6288
6360
|
}
|
|
6289
|
-
return /* @__PURE__ */
|
|
6290
|
-
/* @__PURE__ */
|
|
6361
|
+
return /* @__PURE__ */ jsxs14("div", { className: "space-y-3", children: [
|
|
6362
|
+
/* @__PURE__ */ jsxs14("div", { className: "rounded-xl bg-slate-50 px-3 py-2 text-xs font-medium text-slate-600 dark:bg-slate-900 dark:text-slate-300", children: [
|
|
6291
6363
|
"Source: ",
|
|
6292
6364
|
parseState.source === "file" ? "File upload" : "Pasted JSON"
|
|
6293
6365
|
] }),
|
|
6294
|
-
parseState.summary.kind === "props" ? /* @__PURE__ */
|
|
6295
|
-
/* @__PURE__ */
|
|
6296
|
-
/* @__PURE__ */
|
|
6297
|
-
/* @__PURE__ */
|
|
6298
|
-
/* @__PURE__ */
|
|
6299
|
-
/* @__PURE__ */
|
|
6300
|
-
] }) : /* @__PURE__ */
|
|
6301
|
-
/* @__PURE__ */
|
|
6302
|
-
/* @__PURE__ */
|
|
6303
|
-
/* @__PURE__ */
|
|
6304
|
-
/* @__PURE__ */
|
|
6366
|
+
parseState.summary.kind === "props" ? /* @__PURE__ */ jsxs14("dl", { className: "grid grid-cols-2 gap-3 text-sm", children: [
|
|
6367
|
+
/* @__PURE__ */ jsx22(Metric, { label: "Name", value: parseState.summary.name ?? "Unnamed", className: "col-span-2" }),
|
|
6368
|
+
/* @__PURE__ */ jsx22(Metric, { label: "Tags", value: String(parseState.summary.tagCount) }),
|
|
6369
|
+
/* @__PURE__ */ jsx22(Metric, { label: "Fields", value: String(parseState.summary.fieldCount) }),
|
|
6370
|
+
/* @__PURE__ */ jsx22(Metric, { label: "Notices", value: String(parseState.summary.noticeCount) }),
|
|
6371
|
+
/* @__PURE__ */ jsx22(Metric, { label: "Fallbacks", value: String(parseState.summary.fallbackCount) })
|
|
6372
|
+
] }) : /* @__PURE__ */ jsxs14("dl", { className: "grid grid-cols-2 gap-3 text-sm", children: [
|
|
6373
|
+
/* @__PURE__ */ jsx22(Metric, { label: "Groups", value: String(parseState.summary.groupCount) }),
|
|
6374
|
+
/* @__PURE__ */ jsx22(Metric, { label: "Smart groups", value: String(parseState.summary.smartGroupCount) }),
|
|
6375
|
+
/* @__PURE__ */ jsx22(Metric, { label: "Active node", value: parseState.summary.activeNodeId ?? "None", className: "col-span-2" }),
|
|
6376
|
+
/* @__PURE__ */ jsx22(Metric, { label: "View mode", value: parseState.summary.viewMode ?? "Default", className: "col-span-2" })
|
|
6305
6377
|
] }),
|
|
6306
|
-
/* @__PURE__ */
|
|
6378
|
+
/* @__PURE__ */ jsxs14("p", { className: "text-xs text-slate-500 dark:text-slate-400", children: [
|
|
6307
6379
|
"Applying this will replace the current ",
|
|
6308
6380
|
parseState.summary.kind,
|
|
6309
6381
|
" as a single undoable change."
|
|
@@ -6311,9 +6383,9 @@ function PreviewContent({ parseState }) {
|
|
|
6311
6383
|
] });
|
|
6312
6384
|
}
|
|
6313
6385
|
function Metric({ label, value, className }) {
|
|
6314
|
-
return /* @__PURE__ */
|
|
6315
|
-
/* @__PURE__ */
|
|
6316
|
-
/* @__PURE__ */
|
|
6386
|
+
return /* @__PURE__ */ jsxs14("div", { className: cn("rounded-xl border border-slate-200/80 bg-slate-50 px-3 py-2 dark:border-slate-800 dark:bg-slate-900", className), children: [
|
|
6387
|
+
/* @__PURE__ */ jsx22("dt", { className: "text-[11px] font-semibold uppercase tracking-[0.12em] text-slate-400 dark:text-slate-500", children: label }),
|
|
6388
|
+
/* @__PURE__ */ jsx22("dd", { className: "mt-1 truncate text-sm font-medium text-slate-900 dark:text-slate-100", children: value })
|
|
6317
6389
|
] });
|
|
6318
6390
|
}
|
|
6319
6391
|
function isObjectRecord(value) {
|
|
@@ -6417,7 +6489,7 @@ function toStableValue(value) {
|
|
|
6417
6489
|
}
|
|
6418
6490
|
|
|
6419
6491
|
// src/panels/canvas/index.tsx
|
|
6420
|
-
import { jsx as
|
|
6492
|
+
import { jsx as jsx23, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
6421
6493
|
var EDITOR_GUARD_ORIGINALS = /* @__PURE__ */ Symbol("service-builder.editor-guard-originals");
|
|
6422
6494
|
var EDITOR_GUARD_WRAPPED = /* @__PURE__ */ Symbol("service-builder.editor-guard-wrapped");
|
|
6423
6495
|
function CanvasPanel({
|
|
@@ -6916,7 +6988,7 @@ function CanvasPanel({
|
|
|
6916
6988
|
[canCommentWrite, canvas, commentWriteDecision.reason, emitPermissionDenied, ws]
|
|
6917
6989
|
);
|
|
6918
6990
|
if (!canvas.graph.nodes.length) {
|
|
6919
|
-
return /* @__PURE__ */
|
|
6991
|
+
return /* @__PURE__ */ jsx23("div", { className: "relative flex min-h-0 flex-1 overflow-hidden bg-[radial-gradient(circle_at_top,rgba(19,91,236,0.08),transparent_35%),linear-gradient(180deg,#f8fafc_0%,#eef2ff_100%)] dark:bg-[radial-gradient(circle_at_top,rgba(19,91,236,0.12),transparent_35%),linear-gradient(180deg,#0f172a_0%,#020617_100%)]", children: /* @__PURE__ */ jsx23("div", { className: "m-auto w-full max-w-xl px-6", children: /* @__PURE__ */ jsx23(
|
|
6920
6992
|
EmptyState,
|
|
6921
6993
|
{
|
|
6922
6994
|
title: "Your service map is ready for components",
|
|
@@ -6924,7 +6996,7 @@ function CanvasPanel({
|
|
|
6924
6996
|
}
|
|
6925
6997
|
) }) });
|
|
6926
6998
|
}
|
|
6927
|
-
return /* @__PURE__ */
|
|
6999
|
+
return /* @__PURE__ */ jsx23("div", { className: "relative min-h-0 flex-1 overflow-hidden bg-[radial-gradient(circle_at_top,rgba(19,91,236,0.08),transparent_35%),linear-gradient(180deg,#f8fafc_0%,#eef2ff_100%)] dark:bg-[radial-gradient(circle_at_top,rgba(19,91,236,0.12),transparent_35%),linear-gradient(180deg,#0f172a_0%,#020617_100%)]", children: /* @__PURE__ */ jsxs15(
|
|
6928
7000
|
FlowCanvas,
|
|
6929
7001
|
{
|
|
6930
7002
|
tools,
|
|
@@ -7002,7 +7074,7 @@ function CanvasPanel({
|
|
|
7002
7074
|
},
|
|
7003
7075
|
toolbarPositionClassName: "left-4 top-4",
|
|
7004
7076
|
children: [
|
|
7005
|
-
showAppTools ? /* @__PURE__ */
|
|
7077
|
+
showAppTools ? /* @__PURE__ */ jsx23(
|
|
7006
7078
|
AppToolbar,
|
|
7007
7079
|
{
|
|
7008
7080
|
bootActionReason,
|
|
@@ -7097,7 +7169,7 @@ function CanvasPanel({
|
|
|
7097
7169
|
pendingAction: actionPending
|
|
7098
7170
|
}
|
|
7099
7171
|
) : null,
|
|
7100
|
-
/* @__PURE__ */
|
|
7172
|
+
/* @__PURE__ */ jsx23(
|
|
7101
7173
|
ImportJsonModal,
|
|
7102
7174
|
{
|
|
7103
7175
|
open: activeImportTarget != null,
|
|
@@ -7107,11 +7179,11 @@ function CanvasPanel({
|
|
|
7107
7179
|
onImportCatalog: importCatalog
|
|
7108
7180
|
}
|
|
7109
7181
|
),
|
|
7110
|
-
failedBlockingSections.length ? /* @__PURE__ */
|
|
7111
|
-
/* @__PURE__ */
|
|
7112
|
-
/* @__PURE__ */
|
|
7113
|
-
/* @__PURE__ */
|
|
7114
|
-
/* @__PURE__ */
|
|
7182
|
+
failedBlockingSections.length ? /* @__PURE__ */ jsx23("div", { className: "pointer-events-none absolute inset-0 z-10 flex items-center justify-center px-6", children: /* @__PURE__ */ jsx23("div", { className: "pointer-events-auto w-full max-w-xl rounded-[28px] border border-rose-200 bg-white/96 p-5 shadow-2xl backdrop-blur dark:border-rose-500/30 dark:bg-slate-950/96", children: /* @__PURE__ */ jsxs15("div", { className: "flex items-start gap-3", children: [
|
|
7183
|
+
/* @__PURE__ */ jsx23(FiAlertCircle2, { className: "mt-0.5 text-xl text-rose-500" }),
|
|
7184
|
+
/* @__PURE__ */ jsxs15("div", { children: [
|
|
7185
|
+
/* @__PURE__ */ jsx23("h3", { className: "text-base font-semibold text-slate-900 dark:text-slate-100", children: "Editor waiting for required workspace data" }),
|
|
7186
|
+
/* @__PURE__ */ jsxs15("p", { className: "mt-2 text-sm text-slate-600 dark:text-slate-300", children: [
|
|
7115
7187
|
"The canvas stays visible, but editing should wait until these required sections recover:",
|
|
7116
7188
|
" ",
|
|
7117
7189
|
failedBlockingSections.map((section) => BOOT_SECTION_LABELS[section]).join(", "),
|
|
@@ -7127,12 +7199,12 @@ function CanvasPanel({
|
|
|
7127
7199
|
// src/components/ui/tooltip.tsx
|
|
7128
7200
|
import "react";
|
|
7129
7201
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
7130
|
-
import { jsx as
|
|
7202
|
+
import { jsx as jsx24, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
7131
7203
|
function TooltipProvider({
|
|
7132
7204
|
delayDuration = 0,
|
|
7133
7205
|
...props
|
|
7134
7206
|
}) {
|
|
7135
|
-
return /* @__PURE__ */
|
|
7207
|
+
return /* @__PURE__ */ jsx24(
|
|
7136
7208
|
TooltipPrimitive.Provider,
|
|
7137
7209
|
{
|
|
7138
7210
|
"data-slot": "tooltip-provider",
|
|
@@ -7144,12 +7216,12 @@ function TooltipProvider({
|
|
|
7144
7216
|
function Tooltip({
|
|
7145
7217
|
...props
|
|
7146
7218
|
}) {
|
|
7147
|
-
return /* @__PURE__ */
|
|
7219
|
+
return /* @__PURE__ */ jsx24(TooltipProvider, { children: /* @__PURE__ */ jsx24(TooltipPrimitive.Root, { "data-slot": "tooltip", ...props }) });
|
|
7148
7220
|
}
|
|
7149
7221
|
function TooltipTrigger({
|
|
7150
7222
|
...props
|
|
7151
7223
|
}) {
|
|
7152
|
-
return /* @__PURE__ */
|
|
7224
|
+
return /* @__PURE__ */ jsx24(TooltipPrimitive.Trigger, { "data-slot": "tooltip-trigger", ...props });
|
|
7153
7225
|
}
|
|
7154
7226
|
function TooltipContent({
|
|
7155
7227
|
className,
|
|
@@ -7157,7 +7229,7 @@ function TooltipContent({
|
|
|
7157
7229
|
children,
|
|
7158
7230
|
...props
|
|
7159
7231
|
}) {
|
|
7160
|
-
return /* @__PURE__ */
|
|
7232
|
+
return /* @__PURE__ */ jsx24(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsxs16(
|
|
7161
7233
|
TooltipPrimitive.Content,
|
|
7162
7234
|
{
|
|
7163
7235
|
"data-slot": "tooltip-content",
|
|
@@ -7169,7 +7241,7 @@ function TooltipContent({
|
|
|
7169
7241
|
...props,
|
|
7170
7242
|
children: [
|
|
7171
7243
|
children,
|
|
7172
|
-
/* @__PURE__ */
|
|
7244
|
+
/* @__PURE__ */ jsx24(TooltipPrimitive.Arrow, { className: "bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" })
|
|
7173
7245
|
]
|
|
7174
7246
|
}
|
|
7175
7247
|
) });
|
|
@@ -7177,24 +7249,24 @@ function TooltipContent({
|
|
|
7177
7249
|
|
|
7178
7250
|
// src/components/dropdown/index.tsx
|
|
7179
7251
|
import { Loader2 } from "lucide-react";
|
|
7180
|
-
import * as
|
|
7181
|
-
import { Fragment as Fragment6, jsx as
|
|
7252
|
+
import * as React12 from "react";
|
|
7253
|
+
import { Fragment as Fragment6, jsx as jsx25, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
7182
7254
|
var IconNode = ({ icon, className }) => {
|
|
7183
7255
|
if (!icon) return null;
|
|
7184
7256
|
if (typeof icon === "function") {
|
|
7185
7257
|
const C = icon;
|
|
7186
|
-
return /* @__PURE__ */
|
|
7258
|
+
return /* @__PURE__ */ jsx25(C, { className: cn("mr-2 size-4 shrink-0", className) });
|
|
7187
7259
|
}
|
|
7188
|
-
return /* @__PURE__ */
|
|
7260
|
+
return /* @__PURE__ */ jsx25("span", { className: cn("mr-2 inline-flex items-center", className), children: icon });
|
|
7189
7261
|
};
|
|
7190
7262
|
var RightSide = ({ badge, suffix, shortcut, loading }) => {
|
|
7191
7263
|
if (loading) {
|
|
7192
|
-
return /* @__PURE__ */
|
|
7264
|
+
return /* @__PURE__ */ jsx25(Loader2, { className: "ml-auto size-4 animate-spin text-muted-foreground" });
|
|
7193
7265
|
}
|
|
7194
|
-
if (suffix) return /* @__PURE__ */
|
|
7195
|
-
return /* @__PURE__ */
|
|
7196
|
-
badge ? /* @__PURE__ */
|
|
7197
|
-
shortcut ? /* @__PURE__ */
|
|
7266
|
+
if (suffix) return /* @__PURE__ */ jsx25("span", { className: "ml-auto", children: suffix });
|
|
7267
|
+
return /* @__PURE__ */ jsxs17(Fragment6, { children: [
|
|
7268
|
+
badge ? /* @__PURE__ */ jsx25("span", { className: "ml-auto", children: badge }) : null,
|
|
7269
|
+
shortcut ? /* @__PURE__ */ jsx25("span", { className: "ml-2 text-xs text-muted-foreground tabular-nums", children: shortcut }) : null
|
|
7198
7270
|
] });
|
|
7199
7271
|
};
|
|
7200
7272
|
var rowClass = (size, node) => cn(
|
|
@@ -7286,7 +7358,7 @@ var Dropdown = ({
|
|
|
7286
7358
|
renderGroupHeader,
|
|
7287
7359
|
renderSeparator
|
|
7288
7360
|
}) => {
|
|
7289
|
-
const [loadingIds, setLoadingIds] =
|
|
7361
|
+
const [loadingIds, setLoadingIds] = React12.useState(/* @__PURE__ */ new Set());
|
|
7290
7362
|
const setLoading = (id, state) => {
|
|
7291
7363
|
if (id == null) return;
|
|
7292
7364
|
setLoadingIds((prev) => {
|
|
@@ -7295,9 +7367,9 @@ var Dropdown = ({
|
|
|
7295
7367
|
return next;
|
|
7296
7368
|
});
|
|
7297
7369
|
};
|
|
7298
|
-
const [confirmNode, setConfirmNode] =
|
|
7299
|
-
const [confirmEvent, setConfirmEvent] =
|
|
7300
|
-
const filterTree2 =
|
|
7370
|
+
const [confirmNode, setConfirmNode] = React12.useState(null);
|
|
7371
|
+
const [confirmEvent, setConfirmEvent] = React12.useState(null);
|
|
7372
|
+
const filterTree2 = React12.useCallback(
|
|
7301
7373
|
(nodes) => {
|
|
7302
7374
|
const visible = nodes.filter((n) => {
|
|
7303
7375
|
if ("hidden" in n && n.hidden) return false;
|
|
@@ -7318,8 +7390,8 @@ var Dropdown = ({
|
|
|
7318
7390
|
},
|
|
7319
7391
|
[visibilityCtx]
|
|
7320
7392
|
);
|
|
7321
|
-
const prunedMenu =
|
|
7322
|
-
const flat =
|
|
7393
|
+
const prunedMenu = React12.useMemo(() => filterTree2(menu), [menu, filterTree2]);
|
|
7394
|
+
const flat = React12.useMemo(() => {
|
|
7323
7395
|
const acc = [];
|
|
7324
7396
|
const walk = (nodes) => {
|
|
7325
7397
|
for (const n of nodes) {
|
|
@@ -7333,7 +7405,7 @@ var Dropdown = ({
|
|
|
7333
7405
|
walk(prunedMenu);
|
|
7334
7406
|
return acc;
|
|
7335
7407
|
}, [prunedMenu]);
|
|
7336
|
-
|
|
7408
|
+
React12.useEffect(() => {
|
|
7337
7409
|
const bindings = flat.map((n) => ({ n, hot: parseShortcut(n.shortcut) })).filter((x) => x.hot);
|
|
7338
7410
|
if (!bindings.length) return;
|
|
7339
7411
|
const onKey = async (ev) => {
|
|
@@ -7435,10 +7507,10 @@ var Dropdown = ({
|
|
|
7435
7507
|
...matchTriggerWidth ? { ["--dropdown-min-w"]: "var(--radix-dropdown-menu-trigger-width)" } : {}
|
|
7436
7508
|
};
|
|
7437
7509
|
const contentWidthClass = matchTriggerWidth ? "min-w-[--dropdown-min-w]" : "min-w-44";
|
|
7438
|
-
return /* @__PURE__ */
|
|
7439
|
-
/* @__PURE__ */
|
|
7440
|
-
/* @__PURE__ */
|
|
7441
|
-
/* @__PURE__ */
|
|
7510
|
+
return /* @__PURE__ */ jsxs17(Fragment6, { children: [
|
|
7511
|
+
/* @__PURE__ */ jsxs17(DropdownMenu, { onOpenChange, open, defaultOpen, children: [
|
|
7512
|
+
/* @__PURE__ */ jsx25(DropdownMenuTrigger, { asChild: true, children: children ?? trigger }),
|
|
7513
|
+
/* @__PURE__ */ jsx25(DropdownMenuPortal, { container: container ?? void 0, children: /* @__PURE__ */ jsx25(
|
|
7442
7514
|
DropdownMenuContent,
|
|
7443
7515
|
{
|
|
7444
7516
|
side,
|
|
@@ -7448,8 +7520,8 @@ var Dropdown = ({
|
|
|
7448
7520
|
collisionPadding,
|
|
7449
7521
|
className: cn(contentWidthClass, contentClassName, "p-0"),
|
|
7450
7522
|
style: contentStyle,
|
|
7451
|
-
children: /* @__PURE__ */
|
|
7452
|
-
/* @__PURE__ */
|
|
7523
|
+
children: /* @__PURE__ */ jsxs17("div", { className: "relative", children: [
|
|
7524
|
+
/* @__PURE__ */ jsx25(
|
|
7453
7525
|
"div",
|
|
7454
7526
|
{
|
|
7455
7527
|
className: cn(
|
|
@@ -7457,7 +7529,7 @@ var Dropdown = ({
|
|
|
7457
7529
|
// Provide a CSS var for numeric or string heights
|
|
7458
7530
|
),
|
|
7459
7531
|
style: { ["--menu-max-h"]: typeof maxHeight === "number" ? `${maxHeight}px` : String(maxHeight) },
|
|
7460
|
-
children: /* @__PURE__ */
|
|
7532
|
+
children: /* @__PURE__ */ jsx25(TooltipProvider, { delayDuration: 250, children: prunedMenu.map((node, idx) => /* @__PURE__ */ jsx25(
|
|
7461
7533
|
RenderNode,
|
|
7462
7534
|
{
|
|
7463
7535
|
node,
|
|
@@ -7478,38 +7550,38 @@ var Dropdown = ({
|
|
|
7478
7550
|
)) })
|
|
7479
7551
|
}
|
|
7480
7552
|
),
|
|
7481
|
-
/* @__PURE__ */
|
|
7482
|
-
/* @__PURE__ */
|
|
7553
|
+
/* @__PURE__ */ jsx25("div", { className: "pointer-events-none absolute inset-x-0 top-0 h-3 bg-linear-to-b from-black/5 to-transparent" }),
|
|
7554
|
+
/* @__PURE__ */ jsx25("div", { className: "pointer-events-none absolute inset-x-0 bottom-0 h-3 bg-linear-to-t from-black/5 to-transparent" })
|
|
7483
7555
|
] })
|
|
7484
7556
|
}
|
|
7485
7557
|
) })
|
|
7486
7558
|
] }),
|
|
7487
|
-
/* @__PURE__ */
|
|
7488
|
-
/* @__PURE__ */
|
|
7489
|
-
/* @__PURE__ */
|
|
7490
|
-
/* @__PURE__ */
|
|
7559
|
+
/* @__PURE__ */ jsx25(AlertDialog, { open: !!confirmNode, onOpenChange: (o) => !o && (setConfirmNode(null), setConfirmEvent(null)), children: /* @__PURE__ */ jsxs17(AlertDialogContent, { children: [
|
|
7560
|
+
/* @__PURE__ */ jsxs17(AlertDialogHeader, { children: [
|
|
7561
|
+
/* @__PURE__ */ jsx25(AlertDialogTitle, { children: "Are you sure?" }),
|
|
7562
|
+
/* @__PURE__ */ jsx25(AlertDialogDescription, { children: typeof confirmNode?.["confirm"] === "string" ? confirmNode.confirm : confirmNode?.confirm ?? "Please confirm this action." })
|
|
7491
7563
|
] }),
|
|
7492
|
-
/* @__PURE__ */
|
|
7493
|
-
/* @__PURE__ */
|
|
7494
|
-
/* @__PURE__ */
|
|
7564
|
+
/* @__PURE__ */ jsxs17(AlertDialogFooter, { children: [
|
|
7565
|
+
/* @__PURE__ */ jsx25(AlertDialogCancel, { children: "Cancel" }),
|
|
7566
|
+
/* @__PURE__ */ jsx25(AlertDialogAction, { onClick: confirmProceed, children: "Continue" })
|
|
7495
7567
|
] })
|
|
7496
7568
|
] }) })
|
|
7497
7569
|
] });
|
|
7498
7570
|
};
|
|
7499
|
-
var MaybeTooltip = ({ tooltip, children, disabled }) => tooltip && !disabled ? /* @__PURE__ */
|
|
7500
|
-
/* @__PURE__ */
|
|
7501
|
-
/* @__PURE__ */
|
|
7502
|
-
] }) : /* @__PURE__ */
|
|
7571
|
+
var MaybeTooltip = ({ tooltip, children, disabled }) => tooltip && !disabled ? /* @__PURE__ */ jsxs17(Tooltip, { children: [
|
|
7572
|
+
/* @__PURE__ */ jsx25(TooltipTrigger, { asChild: true, children }),
|
|
7573
|
+
/* @__PURE__ */ jsx25(TooltipContent, { side: "right", children: tooltip })
|
|
7574
|
+
] }) : /* @__PURE__ */ jsx25(Fragment6, { children });
|
|
7503
7575
|
var RowInner = ({ node, size, renderItem, right }) => {
|
|
7504
|
-
const defaultContent = /* @__PURE__ */
|
|
7505
|
-
/* @__PURE__ */
|
|
7506
|
-
/* @__PURE__ */
|
|
7507
|
-
/* @__PURE__ */
|
|
7576
|
+
const defaultContent = /* @__PURE__ */ jsxs17("div", { className: "flex min-w-0 flex-col", children: [
|
|
7577
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex min-w-0 items-center gap-0.5", children: [
|
|
7578
|
+
/* @__PURE__ */ jsx25(IconNode, { icon: node.icon }),
|
|
7579
|
+
/* @__PURE__ */ jsx25("span", { className: "truncate", children: node.label }),
|
|
7508
7580
|
right
|
|
7509
7581
|
] }),
|
|
7510
|
-
node.description ? /* @__PURE__ */
|
|
7582
|
+
node.description ? /* @__PURE__ */ jsx25("span", { className: "mt-0.5 line-clamp-2 text-xs text-muted-foreground", children: node.description }) : null
|
|
7511
7583
|
] });
|
|
7512
|
-
return /* @__PURE__ */
|
|
7584
|
+
return /* @__PURE__ */ jsx25(Fragment6, { children: renderItem?.({ node, defaultContent, size }) ?? defaultContent });
|
|
7513
7585
|
};
|
|
7514
7586
|
var RenderNode = ({
|
|
7515
7587
|
node,
|
|
@@ -7527,13 +7599,13 @@ var RenderNode = ({
|
|
|
7527
7599
|
renderSeparator
|
|
7528
7600
|
}) => {
|
|
7529
7601
|
if (node.type === "separator") {
|
|
7530
|
-
return renderSeparator ? /* @__PURE__ */
|
|
7602
|
+
return renderSeparator ? /* @__PURE__ */ jsx25(Fragment6, { children: renderSeparator() }) : /* @__PURE__ */ jsx25(DropdownMenuSeparator, {});
|
|
7531
7603
|
}
|
|
7532
7604
|
if (isGroup(node)) {
|
|
7533
7605
|
if (!node.items?.length) return null;
|
|
7534
|
-
return /* @__PURE__ */
|
|
7535
|
-
renderGroupHeader ? renderGroupHeader(node.label) : node.label ? /* @__PURE__ */
|
|
7536
|
-
/* @__PURE__ */
|
|
7606
|
+
return /* @__PURE__ */ jsxs17("div", { className: cn(node.className), children: [
|
|
7607
|
+
renderGroupHeader ? renderGroupHeader(node.label) : node.label ? /* @__PURE__ */ jsx25(DropdownMenuLabel, { children: node.label }) : null,
|
|
7608
|
+
/* @__PURE__ */ jsx25(DropdownMenuGroup, { children: node.items.map((child, i) => /* @__PURE__ */ jsx25(
|
|
7537
7609
|
RenderNode,
|
|
7538
7610
|
{
|
|
7539
7611
|
node: child,
|
|
@@ -7556,9 +7628,9 @@ var RenderNode = ({
|
|
|
7556
7628
|
}
|
|
7557
7629
|
if (isSubmenu(node)) {
|
|
7558
7630
|
if (!node.items?.length) return null;
|
|
7559
|
-
const right2 = /* @__PURE__ */
|
|
7560
|
-
const inner2 = /* @__PURE__ */
|
|
7561
|
-
const subTrigger = /* @__PURE__ */
|
|
7631
|
+
const right2 = /* @__PURE__ */ jsx25(RightSide, { badge: node.badge, suffix: node.suffix, shortcut: node.shortcut, loading });
|
|
7632
|
+
const inner2 = /* @__PURE__ */ jsx25(RowInner, { node, size, renderItem, right: right2 });
|
|
7633
|
+
const subTrigger = /* @__PURE__ */ jsx25(
|
|
7562
7634
|
DropdownMenuSubTrigger,
|
|
7563
7635
|
{
|
|
7564
7636
|
"aria-label": node.ariaLabel,
|
|
@@ -7568,9 +7640,9 @@ var RenderNode = ({
|
|
|
7568
7640
|
children: inner2
|
|
7569
7641
|
}
|
|
7570
7642
|
);
|
|
7571
|
-
return /* @__PURE__ */
|
|
7572
|
-
/* @__PURE__ */
|
|
7573
|
-
/* @__PURE__ */
|
|
7643
|
+
return /* @__PURE__ */ jsxs17(DropdownMenuSub, { children: [
|
|
7644
|
+
/* @__PURE__ */ jsx25(MaybeTooltip, { tooltip: node.tooltip, disabled: node.disabled, children: subTrigger }),
|
|
7645
|
+
/* @__PURE__ */ jsx25(DropdownMenuSubContent, { children: node.items.map((child, i) => /* @__PURE__ */ jsx25(
|
|
7574
7646
|
RenderNode,
|
|
7575
7647
|
{
|
|
7576
7648
|
node: child,
|
|
@@ -7592,9 +7664,9 @@ var RenderNode = ({
|
|
|
7592
7664
|
] });
|
|
7593
7665
|
}
|
|
7594
7666
|
if (isCheckbox(node)) {
|
|
7595
|
-
const right2 = /* @__PURE__ */
|
|
7596
|
-
const inner2 = /* @__PURE__ */
|
|
7597
|
-
return /* @__PURE__ */
|
|
7667
|
+
const right2 = /* @__PURE__ */ jsx25(RightSide, { badge: node.badge, suffix: node.suffix, shortcut: node.shortcut, loading });
|
|
7668
|
+
const inner2 = /* @__PURE__ */ jsx25(RowInner, { node, size, renderItem, right: right2 });
|
|
7669
|
+
return /* @__PURE__ */ jsx25(MaybeTooltip, { tooltip: node.tooltip, disabled: node.disabled, children: /* @__PURE__ */ jsx25(
|
|
7598
7670
|
DropdownMenuCheckboxItem,
|
|
7599
7671
|
{
|
|
7600
7672
|
"aria-label": node.ariaLabel,
|
|
@@ -7618,7 +7690,7 @@ var RenderNode = ({
|
|
|
7618
7690
|
}
|
|
7619
7691
|
if (isRadioGroup(node)) {
|
|
7620
7692
|
if (!node.items?.length) return null;
|
|
7621
|
-
return /* @__PURE__ */
|
|
7693
|
+
return /* @__PURE__ */ jsx25(
|
|
7622
7694
|
DropdownMenuRadioGroup,
|
|
7623
7695
|
{
|
|
7624
7696
|
value: node.value,
|
|
@@ -7631,9 +7703,9 @@ var RenderNode = ({
|
|
|
7631
7703
|
}
|
|
7632
7704
|
},
|
|
7633
7705
|
children: node.items.map((opt, i) => {
|
|
7634
|
-
const right2 = /* @__PURE__ */
|
|
7635
|
-
const inner2 = /* @__PURE__ */
|
|
7636
|
-
return /* @__PURE__ */
|
|
7706
|
+
const right2 = /* @__PURE__ */ jsx25(RightSide, { badge: opt.badge, suffix: opt.suffix, shortcut: opt.shortcut, loading });
|
|
7707
|
+
const inner2 = /* @__PURE__ */ jsx25(RowInner, { node: opt, size, renderItem, right: right2 });
|
|
7708
|
+
return /* @__PURE__ */ jsx25(MaybeTooltip, { tooltip: opt.tooltip, disabled: opt.disabled, children: /* @__PURE__ */ jsx25(
|
|
7637
7709
|
DropdownMenuRadioItem,
|
|
7638
7710
|
{
|
|
7639
7711
|
"aria-label": opt.ariaLabel,
|
|
@@ -7652,8 +7724,8 @@ var RenderNode = ({
|
|
|
7652
7724
|
}
|
|
7653
7725
|
if (isLink(node)) {
|
|
7654
7726
|
const dest = node[linkKey];
|
|
7655
|
-
const right2 = /* @__PURE__ */
|
|
7656
|
-
const inner2 = /* @__PURE__ */
|
|
7727
|
+
const right2 = /* @__PURE__ */ jsx25(RightSide, { badge: node.badge, suffix: node.suffix, shortcut: node.shortcut, loading });
|
|
7728
|
+
const inner2 = /* @__PURE__ */ jsx25(RowInner, { node, size, renderItem, right: right2 });
|
|
7657
7729
|
const commit2 = async () => {
|
|
7658
7730
|
setLoading(node.id, true);
|
|
7659
7731
|
try {
|
|
@@ -7662,7 +7734,7 @@ var RenderNode = ({
|
|
|
7662
7734
|
setLoading(node.id, false);
|
|
7663
7735
|
}
|
|
7664
7736
|
};
|
|
7665
|
-
return /* @__PURE__ */
|
|
7737
|
+
return /* @__PURE__ */ jsx25(MaybeTooltip, { tooltip: node.tooltip, disabled: node.disabled, children: /* @__PURE__ */ jsx25(
|
|
7666
7738
|
DropdownMenuItem,
|
|
7667
7739
|
{
|
|
7668
7740
|
"aria-current": node.ariaCurrent,
|
|
@@ -7672,7 +7744,7 @@ var RenderNode = ({
|
|
|
7672
7744
|
onPointerMove: () => onItemHover?.(node),
|
|
7673
7745
|
onSelect: (ev) => handleSelect(node, ev, commit2),
|
|
7674
7746
|
"data-testid": node.testId,
|
|
7675
|
-
children: LinkComponent && (typeof dest === "string" || dest instanceof URL) ? /* @__PURE__ */
|
|
7747
|
+
children: LinkComponent && (typeof dest === "string" || dest instanceof URL) ? /* @__PURE__ */ jsx25(LinkComponent, { ...{ [linkKey]: dest, className: "flex min-w-0 items-center gap-0.5" }, children: inner2 }) : /* @__PURE__ */ jsx25(
|
|
7676
7748
|
"a",
|
|
7677
7749
|
{
|
|
7678
7750
|
href: typeof dest === "string" ? dest : String(dest ?? ""),
|
|
@@ -7686,8 +7758,8 @@ var RenderNode = ({
|
|
|
7686
7758
|
) });
|
|
7687
7759
|
}
|
|
7688
7760
|
const item = node;
|
|
7689
|
-
const right = /* @__PURE__ */
|
|
7690
|
-
const inner = /* @__PURE__ */
|
|
7761
|
+
const right = /* @__PURE__ */ jsx25(RightSide, { badge: item.badge, suffix: item.suffix, shortcut: item.shortcut, loading });
|
|
7762
|
+
const inner = /* @__PURE__ */ jsx25(RowInner, { node: item, size, renderItem, right });
|
|
7691
7763
|
const commit = async (ev) => {
|
|
7692
7764
|
setLoading(item.id, true);
|
|
7693
7765
|
try {
|
|
@@ -7696,7 +7768,7 @@ var RenderNode = ({
|
|
|
7696
7768
|
setLoading(item.id, false);
|
|
7697
7769
|
}
|
|
7698
7770
|
};
|
|
7699
|
-
return /* @__PURE__ */
|
|
7771
|
+
return /* @__PURE__ */ jsx25(MaybeTooltip, { tooltip: item.tooltip, disabled: item.disabled, children: /* @__PURE__ */ jsx25(
|
|
7700
7772
|
DropdownMenuItem,
|
|
7701
7773
|
{
|
|
7702
7774
|
"aria-label": item.ariaLabel,
|
|
@@ -7716,7 +7788,7 @@ import { useWorkspace as useWorkspace6 } from "@timeax/digital-service-engine/wo
|
|
|
7716
7788
|
import { useEffect as useEffect10, useMemo as useMemo11, useState as useState10 } from "react";
|
|
7717
7789
|
import { MdCheck, MdOutlineFileCopy, MdOutlineRefresh } from "react-icons/md";
|
|
7718
7790
|
import { RiGitBranchLine, RiGitMergeLine, RiLoader4Line } from "react-icons/ri";
|
|
7719
|
-
import { jsx as
|
|
7791
|
+
import { jsx as jsx26, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
7720
7792
|
function normalizeKey(input) {
|
|
7721
7793
|
return input.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
7722
7794
|
}
|
|
@@ -7727,7 +7799,7 @@ function ActionIconButton({
|
|
|
7727
7799
|
disabled,
|
|
7728
7800
|
reason
|
|
7729
7801
|
}) {
|
|
7730
|
-
const button = /* @__PURE__ */
|
|
7802
|
+
const button = /* @__PURE__ */ jsx26(
|
|
7731
7803
|
"button",
|
|
7732
7804
|
{
|
|
7733
7805
|
type: "button",
|
|
@@ -7744,9 +7816,9 @@ function ActionIconButton({
|
|
|
7744
7816
|
}
|
|
7745
7817
|
);
|
|
7746
7818
|
if (!reason) return button;
|
|
7747
|
-
return /* @__PURE__ */
|
|
7748
|
-
/* @__PURE__ */
|
|
7749
|
-
/* @__PURE__ */
|
|
7819
|
+
return /* @__PURE__ */ jsxs18(Tooltip, { children: [
|
|
7820
|
+
/* @__PURE__ */ jsx26(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx26("span", { children: button }) }),
|
|
7821
|
+
/* @__PURE__ */ jsx26(TooltipContent, { children: reason })
|
|
7750
7822
|
] });
|
|
7751
7823
|
}
|
|
7752
7824
|
var Drafts = ({ trigger }) => {
|
|
@@ -7948,7 +8020,7 @@ var Drafts = ({ trigger }) => {
|
|
|
7948
8020
|
];
|
|
7949
8021
|
};
|
|
7950
8022
|
if (!workspaceRead) return null;
|
|
7951
|
-
return /* @__PURE__ */
|
|
8023
|
+
return /* @__PURE__ */ jsxs18(
|
|
7952
8024
|
Popover,
|
|
7953
8025
|
{
|
|
7954
8026
|
open,
|
|
@@ -7957,24 +8029,24 @@ var Drafts = ({ trigger }) => {
|
|
|
7957
8029
|
if (!nextOpen) setCreateOpen(false);
|
|
7958
8030
|
},
|
|
7959
8031
|
children: [
|
|
7960
|
-
/* @__PURE__ */
|
|
7961
|
-
/* @__PURE__ */
|
|
8032
|
+
/* @__PURE__ */ jsx26(PopoverTrigger, { asChild: true, children: trigger }),
|
|
8033
|
+
/* @__PURE__ */ jsxs18(
|
|
7962
8034
|
PopoverContent,
|
|
7963
8035
|
{
|
|
7964
8036
|
align: "start",
|
|
7965
8037
|
sideOffset: 10,
|
|
7966
8038
|
className: "w-[420px] rounded-[28px] border-slate-200 bg-white/98 p-0 shadow-2xl dark:border-slate-800 dark:bg-slate-950/98",
|
|
7967
8039
|
children: [
|
|
7968
|
-
/* @__PURE__ */
|
|
7969
|
-
/* @__PURE__ */
|
|
7970
|
-
/* @__PURE__ */
|
|
7971
|
-
/* @__PURE__ */
|
|
7972
|
-
/* @__PURE__ */
|
|
7973
|
-
/* @__PURE__ */
|
|
8040
|
+
/* @__PURE__ */ jsxs18("div", { className: "border-b border-slate-200 px-4 py-4 dark:border-slate-800", children: [
|
|
8041
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex items-start justify-between gap-3", children: [
|
|
8042
|
+
/* @__PURE__ */ jsxs18("div", { children: [
|
|
8043
|
+
/* @__PURE__ */ jsx26("div", { className: "text-[10px] font-semibold tracking-[0.18em] text-slate-400 uppercase dark:text-slate-500", children: "Branch manager" }),
|
|
8044
|
+
/* @__PURE__ */ jsx26("h3", { className: "mt-1 text-base font-semibold text-slate-900 dark:text-slate-100", children: "Workspace drafts" }),
|
|
8045
|
+
/* @__PURE__ */ jsx26("p", { className: "mt-1 text-sm text-slate-500 dark:text-slate-400", children: "Switch, merge, delete, and refresh branches." })
|
|
7974
8046
|
] }),
|
|
7975
|
-
/* @__PURE__ */
|
|
7976
|
-
/* @__PURE__ */
|
|
7977
|
-
/* @__PURE__ */
|
|
8047
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-2", children: [
|
|
8048
|
+
/* @__PURE__ */ jsxs18(Popover, { modal: false, open: createOpen, onOpenChange: setCreateOpen, children: [
|
|
8049
|
+
/* @__PURE__ */ jsx26(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs18(
|
|
7978
8050
|
Button,
|
|
7979
8051
|
{
|
|
7980
8052
|
type: "button",
|
|
@@ -7982,12 +8054,12 @@ var Drafts = ({ trigger }) => {
|
|
|
7982
8054
|
size: "sm",
|
|
7983
8055
|
className: "rounded-xl border-slate-200 bg-white dark:border-slate-700 dark:bg-slate-900",
|
|
7984
8056
|
children: [
|
|
7985
|
-
/* @__PURE__ */
|
|
8057
|
+
/* @__PURE__ */ jsx26(MdOutlineFileCopy, {}),
|
|
7986
8058
|
"Create branch"
|
|
7987
8059
|
]
|
|
7988
8060
|
}
|
|
7989
8061
|
) }),
|
|
7990
|
-
/* @__PURE__ */
|
|
8062
|
+
/* @__PURE__ */ jsx26(
|
|
7991
8063
|
PopoverContent,
|
|
7992
8064
|
{
|
|
7993
8065
|
align: "end",
|
|
@@ -7995,14 +8067,14 @@ var Drafts = ({ trigger }) => {
|
|
|
7995
8067
|
sideOffset: 8,
|
|
7996
8068
|
collisionPadding: 16,
|
|
7997
8069
|
className: "w-[320px] rounded-2xl border-slate-200 bg-white/98 p-4 shadow-2xl dark:border-slate-800 dark:bg-slate-950/98",
|
|
7998
|
-
children: /* @__PURE__ */
|
|
7999
|
-
/* @__PURE__ */
|
|
8000
|
-
/* @__PURE__ */
|
|
8001
|
-
/* @__PURE__ */
|
|
8070
|
+
children: /* @__PURE__ */ jsxs18("div", { className: "space-y-3", children: [
|
|
8071
|
+
/* @__PURE__ */ jsxs18("div", { children: [
|
|
8072
|
+
/* @__PURE__ */ jsx26("h4", { className: "text-sm font-semibold text-slate-900 dark:text-slate-100", children: "Create branch" }),
|
|
8073
|
+
/* @__PURE__ */ jsx26("p", { className: "mt-1 text-xs text-slate-500 dark:text-slate-400", children: "Branch names are normalized to lowercase slug format." })
|
|
8002
8074
|
] }),
|
|
8003
|
-
/* @__PURE__ */
|
|
8004
|
-
/* @__PURE__ */
|
|
8005
|
-
/* @__PURE__ */
|
|
8075
|
+
/* @__PURE__ */ jsxs18("label", { className: "space-y-2", children: [
|
|
8076
|
+
/* @__PURE__ */ jsx26("span", { className: "text-xs font-medium text-slate-500 dark:text-slate-400", children: "Branch name" }),
|
|
8077
|
+
/* @__PURE__ */ jsx26(
|
|
8006
8078
|
"input",
|
|
8007
8079
|
{
|
|
8008
8080
|
value: createName,
|
|
@@ -8012,19 +8084,19 @@ var Drafts = ({ trigger }) => {
|
|
|
8012
8084
|
}
|
|
8013
8085
|
)
|
|
8014
8086
|
] }),
|
|
8015
|
-
/* @__PURE__ */
|
|
8016
|
-
/* @__PURE__ */
|
|
8017
|
-
/* @__PURE__ */
|
|
8087
|
+
/* @__PURE__ */ jsxs18("label", { className: "space-y-2", children: [
|
|
8088
|
+
/* @__PURE__ */ jsx26("span", { className: "text-xs font-medium text-slate-500 dark:text-slate-400", children: "Create from" }),
|
|
8089
|
+
/* @__PURE__ */ jsx26(
|
|
8018
8090
|
"select",
|
|
8019
8091
|
{
|
|
8020
8092
|
value: createFromId,
|
|
8021
8093
|
onChange: (event) => setCreateFromId(event.target.value),
|
|
8022
8094
|
className: "w-full rounded-xl border border-slate-200 bg-white px-3 py-2 text-sm text-slate-900 transition outline-none focus:border-blue-300 dark:border-slate-700 dark:bg-slate-950 dark:text-slate-100 dark:focus:border-blue-500/40",
|
|
8023
|
-
children: createSourceBranches.map((item) => /* @__PURE__ */
|
|
8095
|
+
children: createSourceBranches.map((item) => /* @__PURE__ */ jsx26("option", { value: item.branch.id, children: item.branch.name }, item.branch.id))
|
|
8024
8096
|
}
|
|
8025
8097
|
)
|
|
8026
8098
|
] }),
|
|
8027
|
-
/* @__PURE__ */
|
|
8099
|
+
/* @__PURE__ */ jsxs18(
|
|
8028
8100
|
Button,
|
|
8029
8101
|
{
|
|
8030
8102
|
type: "button",
|
|
@@ -8032,69 +8104,69 @@ var Drafts = ({ trigger }) => {
|
|
|
8032
8104
|
disabled: !createPermission.allowed || !normalizeKey(createName) || !!actionKey,
|
|
8033
8105
|
className: "w-full rounded-xl",
|
|
8034
8106
|
children: [
|
|
8035
|
-
actionKey?.startsWith("create:") ? /* @__PURE__ */
|
|
8107
|
+
actionKey?.startsWith("create:") ? /* @__PURE__ */ jsx26(RiLoader4Line, { className: "animate-spin" }) : /* @__PURE__ */ jsx26(MdOutlineFileCopy, {}),
|
|
8036
8108
|
"Create branch"
|
|
8037
8109
|
]
|
|
8038
8110
|
}
|
|
8039
8111
|
),
|
|
8040
|
-
!createPermission.allowed && createPermission.reason ? /* @__PURE__ */
|
|
8112
|
+
!createPermission.allowed && createPermission.reason ? /* @__PURE__ */ jsx26("p", { className: "text-xs text-amber-600 dark:text-amber-300", children: createPermission.reason }) : null
|
|
8041
8113
|
] })
|
|
8042
8114
|
}
|
|
8043
8115
|
)
|
|
8044
8116
|
] }),
|
|
8045
|
-
/* @__PURE__ */
|
|
8117
|
+
/* @__PURE__ */ jsx26(
|
|
8046
8118
|
ActionIconButton,
|
|
8047
8119
|
{
|
|
8048
|
-
icon: actionKey === "refresh" ? /* @__PURE__ */
|
|
8120
|
+
icon: actionKey === "refresh" ? /* @__PURE__ */ jsx26(RiLoader4Line, { className: "animate-spin" }) : /* @__PURE__ */ jsx26(MdOutlineRefresh, {}),
|
|
8049
8121
|
label: "Refresh branch data",
|
|
8050
8122
|
onClick: () => void refreshEverything()
|
|
8051
8123
|
}
|
|
8052
8124
|
)
|
|
8053
8125
|
] })
|
|
8054
8126
|
] }),
|
|
8055
|
-
/* @__PURE__ */
|
|
8127
|
+
/* @__PURE__ */ jsx26("div", { className: "mt-4", children: /* @__PURE__ */ jsx26(PanelSearch, { value: query, onChange: setQuery, placeholder: "Search readable branches" }) })
|
|
8056
8128
|
] }),
|
|
8057
|
-
/* @__PURE__ */
|
|
8129
|
+
/* @__PURE__ */ jsxs18("div", { className: "max-h-[430px] space-y-3 overflow-y-auto px-4 py-4", children: [
|
|
8058
8130
|
visibleBranches.map((item) => {
|
|
8059
8131
|
const isCurrent = item.branch.id === ws.branches.currentId;
|
|
8060
8132
|
const isBusy = actionKey === `switch:${item.branch.id}` || actionKey === `main:${item.branch.id}` || actionKey === `delete:${item.branch.id}` || actionKey?.startsWith(`merge:${item.branch.id}:`);
|
|
8061
|
-
return /* @__PURE__ */
|
|
8133
|
+
return /* @__PURE__ */ jsx26(
|
|
8062
8134
|
"div",
|
|
8063
8135
|
{
|
|
8064
8136
|
className: cn(
|
|
8065
8137
|
"rounded-2xl border p-3 shadow-sm transition",
|
|
8066
8138
|
isCurrent ? "border-blue-200 bg-blue-50/70 dark:border-blue-500/30 dark:bg-blue-500/10" : "border-slate-200/80 bg-white dark:border-slate-800 dark:bg-slate-900/70"
|
|
8067
8139
|
),
|
|
8068
|
-
children: /* @__PURE__ */
|
|
8069
|
-
/* @__PURE__ */
|
|
8140
|
+
children: /* @__PURE__ */ jsxs18("div", { className: "flex items-start gap-3", children: [
|
|
8141
|
+
/* @__PURE__ */ jsx26(
|
|
8070
8142
|
"div",
|
|
8071
8143
|
{
|
|
8072
8144
|
className: cn(
|
|
8073
8145
|
"flex h-10 w-10 items-center justify-center rounded-xl",
|
|
8074
8146
|
isCurrent ? "bg-blue-600 text-white" : "bg-slate-100 text-slate-600 dark:bg-slate-800 dark:text-slate-300"
|
|
8075
8147
|
),
|
|
8076
|
-
children: isBusy ? /* @__PURE__ */
|
|
8148
|
+
children: isBusy ? /* @__PURE__ */ jsx26(RiLoader4Line, { className: "animate-spin text-lg" }) : /* @__PURE__ */ jsx26(RiGitBranchLine, { className: "text-lg" })
|
|
8077
8149
|
}
|
|
8078
8150
|
),
|
|
8079
|
-
/* @__PURE__ */
|
|
8080
|
-
/* @__PURE__ */
|
|
8081
|
-
/* @__PURE__ */
|
|
8082
|
-
isCurrent ? /* @__PURE__ */
|
|
8083
|
-
item.branch.isMain ? /* @__PURE__ */
|
|
8151
|
+
/* @__PURE__ */ jsxs18("div", { className: "min-w-0 flex-1", children: [
|
|
8152
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
8153
|
+
/* @__PURE__ */ jsx26("div", { className: "truncate text-sm font-semibold text-slate-900 dark:text-slate-100", children: item.branch.name }),
|
|
8154
|
+
isCurrent ? /* @__PURE__ */ jsx26("span", { className: "rounded-full border border-blue-200 bg-white px-2 py-0.5 text-[10px] font-semibold tracking-[0.16em] text-blue-700 uppercase dark:border-blue-500/30 dark:bg-blue-500/10 dark:text-blue-200", children: "Current" }) : null,
|
|
8155
|
+
item.branch.isMain ? /* @__PURE__ */ jsx26("span", { className: "rounded-full border border-amber-200 bg-amber-50 px-2 py-0.5 text-[10px] font-semibold tracking-[0.16em] text-amber-700 uppercase dark:border-amber-500/20 dark:bg-amber-500/10 dark:text-amber-200", children: "Main" }) : null
|
|
8084
8156
|
] }),
|
|
8085
|
-
/* @__PURE__ */
|
|
8086
|
-
/* @__PURE__ */
|
|
8087
|
-
item.canWrite ? /* @__PURE__ */
|
|
8157
|
+
/* @__PURE__ */ jsxs18("div", { className: "mt-2 flex flex-wrap items-center gap-2 text-xs text-slate-500 dark:text-slate-400", children: [
|
|
8158
|
+
/* @__PURE__ */ jsxs18("span", { className: "inline-flex items-center gap-1 rounded-full border border-slate-200 bg-slate-50 px-2 py-1 dark:border-slate-700 dark:bg-slate-950", children: [
|
|
8159
|
+
item.canWrite ? /* @__PURE__ */ jsx26(StatusDot, { tone: "success" }) : /* @__PURE__ */ jsx26(StatusDot, { tone: "warning" }),
|
|
8088
8160
|
item.canWrite ? "Can edit" : "Read only"
|
|
8089
8161
|
] }),
|
|
8090
|
-
item.branch.headVersionId ? /* @__PURE__ */
|
|
8162
|
+
item.branch.headVersionId ? /* @__PURE__ */ jsxs18("span", { className: "rounded-full border border-slate-200 bg-slate-50 px-2 py-1 dark:border-slate-700 dark:bg-slate-950", children: [
|
|
8091
8163
|
"Head ",
|
|
8092
8164
|
item.branch.headVersionId
|
|
8093
8165
|
] }) : null
|
|
8094
8166
|
] })
|
|
8095
8167
|
] }),
|
|
8096
|
-
/* @__PURE__ */
|
|
8097
|
-
!isCurrent ? /* @__PURE__ */
|
|
8168
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-2", children: [
|
|
8169
|
+
!isCurrent ? /* @__PURE__ */ jsxs18(
|
|
8098
8170
|
Button,
|
|
8099
8171
|
{
|
|
8100
8172
|
type: "button",
|
|
@@ -8104,17 +8176,17 @@ var Drafts = ({ trigger }) => {
|
|
|
8104
8176
|
onClick: () => void switchBranch(item.branch.id),
|
|
8105
8177
|
disabled: !!actionKey,
|
|
8106
8178
|
children: [
|
|
8107
|
-
actionKey === `switch:${item.branch.id}` ? /* @__PURE__ */
|
|
8179
|
+
actionKey === `switch:${item.branch.id}` ? /* @__PURE__ */ jsx26(RiLoader4Line, { className: "animate-spin" }) : /* @__PURE__ */ jsx26(MdCheck, {}),
|
|
8108
8180
|
"Switch"
|
|
8109
8181
|
]
|
|
8110
8182
|
}
|
|
8111
|
-
) : /* @__PURE__ */
|
|
8112
|
-
/* @__PURE__ */
|
|
8183
|
+
) : /* @__PURE__ */ jsx26("span", { className: "rounded-xl border border-blue-200 bg-white px-3 py-1.5 text-xs font-semibold text-blue-700 dark:border-blue-500/30 dark:bg-blue-500/10 dark:text-blue-200", children: "Active branch" }),
|
|
8184
|
+
/* @__PURE__ */ jsx26(dropdown_default, { menu: branchActionMenu(item), align: "end", children: /* @__PURE__ */ jsx26(
|
|
8113
8185
|
"button",
|
|
8114
8186
|
{
|
|
8115
8187
|
type: "button",
|
|
8116
8188
|
className: "flex h-9 w-9 items-center justify-center rounded-xl border border-slate-200 bg-white text-slate-600 transition hover:border-slate-300 hover:text-slate-900 dark:border-slate-700 dark:bg-slate-950 dark:text-slate-300 dark:hover:border-slate-600 dark:hover:text-slate-100",
|
|
8117
|
-
children: /* @__PURE__ */
|
|
8189
|
+
children: /* @__PURE__ */ jsx26(RiGitMergeLine, {})
|
|
8118
8190
|
}
|
|
8119
8191
|
) })
|
|
8120
8192
|
] })
|
|
@@ -8123,9 +8195,9 @@ var Drafts = ({ trigger }) => {
|
|
|
8123
8195
|
item.branch.id
|
|
8124
8196
|
);
|
|
8125
8197
|
}),
|
|
8126
|
-
!visibleBranches.length ? /* @__PURE__ */
|
|
8127
|
-
pendingAccessCount > 0 ? /* @__PURE__ */
|
|
8128
|
-
/* @__PURE__ */
|
|
8198
|
+
!visibleBranches.length ? /* @__PURE__ */ jsx26("div", { className: "rounded-2xl border border-dashed border-slate-300 bg-slate-50/70 px-4 py-8 text-center text-sm text-slate-500 dark:border-slate-700 dark:bg-slate-900/50 dark:text-slate-400", children: "No readable branches matched your search." }) : null,
|
|
8199
|
+
pendingAccessCount > 0 ? /* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-2 rounded-2xl border border-slate-200/80 bg-slate-50/80 px-4 py-3 text-sm text-slate-500 dark:border-slate-800 dark:bg-slate-900/60 dark:text-slate-400", children: [
|
|
8200
|
+
/* @__PURE__ */ jsx26(RiLoader4Line, { className: "animate-spin" }),
|
|
8129
8201
|
"Checking branch access for ",
|
|
8130
8202
|
pendingAccessCount,
|
|
8131
8203
|
" branch",
|
|
@@ -8147,20 +8219,20 @@ import { useWorkspace as useWorkspace7 } from "@timeax/digital-service-engine/wo
|
|
|
8147
8219
|
import { useState as useState11 } from "react";
|
|
8148
8220
|
import { BsChevronDown, BsChevronRight } from "react-icons/bs";
|
|
8149
8221
|
import { MdMenuOpen, MdOutlineSpaceDashboard } from "react-icons/md";
|
|
8150
|
-
import { jsx as
|
|
8222
|
+
import { jsx as jsx27, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
8151
8223
|
var MenuRenderer = ({ items, workspace, depth = 0 }) => {
|
|
8152
8224
|
const [openSubmenus, setOpenSubmenus] = useState11({});
|
|
8153
8225
|
const toggleSubmenu = (name) => {
|
|
8154
8226
|
setOpenSubmenus((prev) => ({ ...prev, [name]: !prev[name] }));
|
|
8155
8227
|
};
|
|
8156
|
-
return /* @__PURE__ */
|
|
8228
|
+
return /* @__PURE__ */ jsx27("ul", { className: "flex flex-col gap-1", children: items.map((item, index) => {
|
|
8157
8229
|
const hasChildren = item.children && item.children.length > 0;
|
|
8158
8230
|
const isOpen = openSubmenus[item.name];
|
|
8159
8231
|
if (item.render) {
|
|
8160
|
-
return /* @__PURE__ */
|
|
8232
|
+
return /* @__PURE__ */ jsx27("li", { children: item.render() }, index);
|
|
8161
8233
|
}
|
|
8162
|
-
return /* @__PURE__ */
|
|
8163
|
-
/* @__PURE__ */
|
|
8234
|
+
return /* @__PURE__ */ jsxs19("li", { className: "flex flex-col", children: [
|
|
8235
|
+
/* @__PURE__ */ jsxs19(
|
|
8164
8236
|
"button",
|
|
8165
8237
|
{
|
|
8166
8238
|
type: "button",
|
|
@@ -8173,13 +8245,13 @@ var MenuRenderer = ({ items, workspace, depth = 0 }) => {
|
|
|
8173
8245
|
},
|
|
8174
8246
|
className: "flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm text-slate-700 transition hover:bg-slate-100 dark:text-slate-300 dark:hover:bg-slate-800",
|
|
8175
8247
|
children: [
|
|
8176
|
-
item.icon && /* @__PURE__ */
|
|
8177
|
-
/* @__PURE__ */
|
|
8178
|
-
hasChildren && /* @__PURE__ */
|
|
8248
|
+
item.icon && /* @__PURE__ */ jsx27("span", { className: "flex h-4 w-4 items-center justify-center text-slate-500", children: item.icon }),
|
|
8249
|
+
/* @__PURE__ */ jsx27("span", { className: "flex-1 text-left", children: item.name }),
|
|
8250
|
+
hasChildren && /* @__PURE__ */ jsx27("span", { className: `transition-transform ${isOpen ? "rotate-90" : ""}`, children: /* @__PURE__ */ jsx27(BsChevronRight, { className: "h-3 w-3" }) })
|
|
8179
8251
|
]
|
|
8180
8252
|
}
|
|
8181
8253
|
),
|
|
8182
|
-
hasChildren && isOpen && /* @__PURE__ */
|
|
8254
|
+
hasChildren && isOpen && /* @__PURE__ */ jsx27("div", { className: "mt-1 ml-4 border-l border-slate-200 pl-2 dark:border-slate-800", children: /* @__PURE__ */ jsx27(MenuRenderer, { items: item.children, workspace, depth: depth + 1 }) })
|
|
8183
8255
|
] }, index);
|
|
8184
8256
|
}) });
|
|
8185
8257
|
};
|
|
@@ -8190,29 +8262,29 @@ var Header = ({ menu = [] }) => {
|
|
|
8190
8262
|
const fullMenu = [
|
|
8191
8263
|
{
|
|
8192
8264
|
name: "Status",
|
|
8193
|
-
render: () => /* @__PURE__ */
|
|
8265
|
+
render: () => /* @__PURE__ */ jsx27("div", { className: "px-2 py-1.5 text-xs font-medium tracking-wider text-slate-500 uppercase", children: workspaceStatus })
|
|
8194
8266
|
},
|
|
8195
8267
|
...menu
|
|
8196
8268
|
];
|
|
8197
|
-
return /* @__PURE__ */
|
|
8198
|
-
/* @__PURE__ */
|
|
8199
|
-
/* @__PURE__ */
|
|
8200
|
-
/* @__PURE__ */
|
|
8201
|
-
/* @__PURE__ */
|
|
8202
|
-
/* @__PURE__ */
|
|
8269
|
+
return /* @__PURE__ */ jsx27("div", { className: "border-b border-slate-200 px-4 py-3 dark:border-slate-800", children: /* @__PURE__ */ jsxs19("div", { className: "flex items-start justify-between gap-3", children: [
|
|
8270
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-3", children: [
|
|
8271
|
+
/* @__PURE__ */ jsx27("span", { className: "flex h-9 w-9 items-center justify-center rounded-xl bg-blue-600 text-white shadow-sm", children: /* @__PURE__ */ jsx27(MdOutlineSpaceDashboard, { className: "text-base" }) }),
|
|
8272
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex flex-col justify-center gap-0", children: [
|
|
8273
|
+
/* @__PURE__ */ jsx27("h1", { className: "text-base leading-tight font-semibold text-slate-900 dark:text-slate-100", children: "Service Builder" }),
|
|
8274
|
+
/* @__PURE__ */ jsx27(
|
|
8203
8275
|
drafts_default,
|
|
8204
8276
|
{
|
|
8205
|
-
trigger: /* @__PURE__ */
|
|
8277
|
+
trigger: /* @__PURE__ */ jsxs19(
|
|
8206
8278
|
"button",
|
|
8207
8279
|
{
|
|
8208
8280
|
type: "button",
|
|
8209
8281
|
className: "inline-flex cursor-pointer items-center gap-1 rounded-md text-xs text-slate-500 transition hover:text-slate-700 dark:text-slate-400 dark:hover:text-slate-200",
|
|
8210
8282
|
children: [
|
|
8211
|
-
/* @__PURE__ */
|
|
8283
|
+
/* @__PURE__ */ jsxs19("span", { children: [
|
|
8212
8284
|
"Active branch - ",
|
|
8213
|
-
/* @__PURE__ */
|
|
8285
|
+
/* @__PURE__ */ jsx27("b", { children: currentBranch?.name ?? "Main branch" })
|
|
8214
8286
|
] }),
|
|
8215
|
-
/* @__PURE__ */
|
|
8287
|
+
/* @__PURE__ */ jsx27(BsChevronDown, {})
|
|
8216
8288
|
]
|
|
8217
8289
|
}
|
|
8218
8290
|
)
|
|
@@ -8220,79 +8292,14 @@ var Header = ({ menu = [] }) => {
|
|
|
8220
8292
|
)
|
|
8221
8293
|
] })
|
|
8222
8294
|
] }),
|
|
8223
|
-
/* @__PURE__ */
|
|
8224
|
-
/* @__PURE__ */
|
|
8225
|
-
/* @__PURE__ */
|
|
8295
|
+
/* @__PURE__ */ jsxs19(Popover, { children: [
|
|
8296
|
+
/* @__PURE__ */ jsx27(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx27("span", { children: /* @__PURE__ */ jsx27(BuilderIconButton, { title: "Menu", children: /* @__PURE__ */ jsx27(MdMenuOpen, {}) }) }) }),
|
|
8297
|
+
/* @__PURE__ */ jsx27(PopoverContent, { className: "w-56 p-2", align: "end", children: /* @__PURE__ */ jsx27(MenuRenderer, { items: fullMenu, workspace: ws }) })
|
|
8226
8298
|
] })
|
|
8227
8299
|
] }) });
|
|
8228
8300
|
};
|
|
8229
8301
|
var header_default = Header;
|
|
8230
8302
|
|
|
8231
|
-
// src/components/ui/scroll-area.tsx
|
|
8232
|
-
import "react";
|
|
8233
|
-
import { ScrollArea as ScrollAreaPrimitive } from "radix-ui";
|
|
8234
|
-
import { jsx as jsx27, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
8235
|
-
function ScrollArea({
|
|
8236
|
-
className,
|
|
8237
|
-
children,
|
|
8238
|
-
...props
|
|
8239
|
-
}) {
|
|
8240
|
-
return /* @__PURE__ */ jsxs19(
|
|
8241
|
-
ScrollAreaPrimitive.Root,
|
|
8242
|
-
{
|
|
8243
|
-
"data-slot": "scroll-area",
|
|
8244
|
-
className: cn("relative", className),
|
|
8245
|
-
...props,
|
|
8246
|
-
children: [
|
|
8247
|
-
/* @__PURE__ */ jsx27(
|
|
8248
|
-
ScrollAreaPrimitive.Viewport,
|
|
8249
|
-
{
|
|
8250
|
-
"data-slot": "scroll-area-viewport",
|
|
8251
|
-
className: "size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1",
|
|
8252
|
-
children
|
|
8253
|
-
}
|
|
8254
|
-
),
|
|
8255
|
-
/* @__PURE__ */ jsx27(ScrollBar, {}),
|
|
8256
|
-
/* @__PURE__ */ jsx27(ScrollAreaPrimitive.Corner, {})
|
|
8257
|
-
]
|
|
8258
|
-
}
|
|
8259
|
-
);
|
|
8260
|
-
}
|
|
8261
|
-
function ScrollBar({
|
|
8262
|
-
className,
|
|
8263
|
-
orientation = "vertical",
|
|
8264
|
-
...props
|
|
8265
|
-
}) {
|
|
8266
|
-
return /* @__PURE__ */ jsx27(
|
|
8267
|
-
ScrollAreaPrimitive.ScrollAreaScrollbar,
|
|
8268
|
-
{
|
|
8269
|
-
"data-slot": "scroll-area-scrollbar",
|
|
8270
|
-
orientation,
|
|
8271
|
-
className: cn(
|
|
8272
|
-
"flex touch-none p-px transition-colors select-none",
|
|
8273
|
-
orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent",
|
|
8274
|
-
orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent",
|
|
8275
|
-
className
|
|
8276
|
-
),
|
|
8277
|
-
...props,
|
|
8278
|
-
children: /* @__PURE__ */ jsx27(
|
|
8279
|
-
ScrollAreaPrimitive.ScrollAreaThumb,
|
|
8280
|
-
{
|
|
8281
|
-
"data-slot": "scroll-area-thumb",
|
|
8282
|
-
className: "relative flex-1 rounded-full bg-border"
|
|
8283
|
-
}
|
|
8284
|
-
)
|
|
8285
|
-
}
|
|
8286
|
-
);
|
|
8287
|
-
}
|
|
8288
|
-
|
|
8289
|
-
// src/panels/left/assets/index.tsx
|
|
8290
|
-
import { useInputs } from "@timeax/digital-service-engine/react";
|
|
8291
|
-
import { useWorkspace as useWorkspace8 } from "@timeax/digital-service-engine/workspace";
|
|
8292
|
-
import { useMemo as useMemo12, useState as useState13 } from "react";
|
|
8293
|
-
import { CiSearch } from "react-icons/ci";
|
|
8294
|
-
import { LuBox, LuShapes } from "react-icons/lu";
|
|
8295
|
-
|
|
8296
8303
|
// src/workspace/boot-status.tsx
|
|
8297
8304
|
import { useEffect as useEffect11, useState as useState12 } from "react";
|
|
8298
8305
|
import { FiAlertCircle as FiAlertCircle3, FiCheckCircle, FiLoader, FiRefreshCw, FiX as FiX3 } from "react-icons/fi";
|
|
@@ -8489,6 +8496,13 @@ function getStatusClassName(sectionState) {
|
|
|
8489
8496
|
}
|
|
8490
8497
|
|
|
8491
8498
|
// src/panels/left/assets/index.tsx
|
|
8499
|
+
import { useInputs } from "@timeax/digital-service-engine/react";
|
|
8500
|
+
import { useWorkspace as useWorkspace8 } from "@timeax/digital-service-engine/workspace";
|
|
8501
|
+
import { InputField as InputField4 } from "@timeax/form-palette";
|
|
8502
|
+
import { useCallback as useCallback9, useEffect as useEffect12, useMemo as useMemo12, useRef as useRef6, useState as useState13 } from "react";
|
|
8503
|
+
import { AiOutlineReload } from "react-icons/ai";
|
|
8504
|
+
import { CiSearch } from "react-icons/ci";
|
|
8505
|
+
import { LuBox, LuShapes } from "react-icons/lu";
|
|
8492
8506
|
import { jsx as jsx29, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
8493
8507
|
function toTitle(value) {
|
|
8494
8508
|
return value.split(/[-_:]/g).filter(Boolean).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join(" ");
|
|
@@ -8497,6 +8511,14 @@ function AssetsPanel() {
|
|
|
8497
8511
|
const ws = useWorkspace8();
|
|
8498
8512
|
const { registry } = useInputs();
|
|
8499
8513
|
const [query, setQuery] = useState13("");
|
|
8514
|
+
const [menuTarget, setMenuTarget] = useState13(null);
|
|
8515
|
+
const [actionTarget, setActionTarget] = useState13(null);
|
|
8516
|
+
const [renameOpen, setRenameOpen] = useState13(false);
|
|
8517
|
+
const [cloneOpen, setCloneOpen] = useState13(false);
|
|
8518
|
+
const [deleteOpen, setDeleteOpen] = useState13(false);
|
|
8519
|
+
const [templateName, setTemplateName] = useState13("");
|
|
8520
|
+
const [saveToCurrentBranch, setSaveToCurrentBranch] = useState13(true);
|
|
8521
|
+
const menuRef = useRef6(null);
|
|
8500
8522
|
const normalizedBuiltins = useMemo12(() => {
|
|
8501
8523
|
const items = [];
|
|
8502
8524
|
for (const [kind, variants] of registry._store.entries()) {
|
|
@@ -8521,19 +8543,122 @@ function AssetsPanel() {
|
|
|
8521
8543
|
const filteredTemplates = lower ? templates2.filter(
|
|
8522
8544
|
(item) => item.name.toLowerCase().includes(lower) || String(item.kind ?? "").toLowerCase().includes(lower)
|
|
8523
8545
|
) : templates2;
|
|
8546
|
+
const closeTemplateContextMenu = useCallback9(() => setMenuTarget(null), []);
|
|
8547
|
+
const openTemplateContextMenu = useCallback9((item, clientX, clientY) => {
|
|
8548
|
+
setMenuTarget({
|
|
8549
|
+
id: item.id,
|
|
8550
|
+
name: item.name,
|
|
8551
|
+
clientX,
|
|
8552
|
+
clientY
|
|
8553
|
+
});
|
|
8554
|
+
}, []);
|
|
8555
|
+
useEffect12(() => {
|
|
8556
|
+
if (!menuTarget) return;
|
|
8557
|
+
const onPointerDown = (event) => {
|
|
8558
|
+
const el = menuRef.current;
|
|
8559
|
+
if (!el || el.contains(event.target)) return;
|
|
8560
|
+
setMenuTarget(null);
|
|
8561
|
+
};
|
|
8562
|
+
const onKeyDown = (event) => {
|
|
8563
|
+
if (event.key === "Escape") setMenuTarget(null);
|
|
8564
|
+
};
|
|
8565
|
+
window.addEventListener("pointerdown", onPointerDown);
|
|
8566
|
+
window.addEventListener("keydown", onKeyDown);
|
|
8567
|
+
return () => {
|
|
8568
|
+
window.removeEventListener("pointerdown", onPointerDown);
|
|
8569
|
+
window.removeEventListener("keydown", onKeyDown);
|
|
8570
|
+
};
|
|
8571
|
+
}, [menuTarget]);
|
|
8572
|
+
const templateMenuAnchorStyle = useMemo12(() => {
|
|
8573
|
+
if (!menuTarget || typeof window === "undefined") return null;
|
|
8574
|
+
const width = 220;
|
|
8575
|
+
const height = 164;
|
|
8576
|
+
const padding = 12;
|
|
8577
|
+
const left = Math.max(padding, Math.min(menuTarget.clientX, window.innerWidth - width - padding));
|
|
8578
|
+
const top = Math.max(padding, Math.min(menuTarget.clientY, window.innerHeight - height - padding));
|
|
8579
|
+
return { left, top };
|
|
8580
|
+
}, [menuTarget]);
|
|
8581
|
+
const applyBranchScope = useCallback9(() => {
|
|
8582
|
+
if (saveToCurrentBranch) return ws.branches.currentId ?? void 0;
|
|
8583
|
+
return null;
|
|
8584
|
+
}, [saveToCurrentBranch, ws.branches.currentId]);
|
|
8585
|
+
const refreshTemplates = useCallback9(async () => {
|
|
8586
|
+
await ws.refresh.templates({ branchId: ws.branches.currentId ?? void 0 });
|
|
8587
|
+
}, [ws]);
|
|
8588
|
+
const openRenameDialog = useCallback9(() => {
|
|
8589
|
+
if (!menuTarget) return;
|
|
8590
|
+
setActionTarget({ id: menuTarget.id, name: menuTarget.name });
|
|
8591
|
+
setTemplateName(menuTarget.name);
|
|
8592
|
+
setSaveToCurrentBranch(true);
|
|
8593
|
+
setRenameOpen(true);
|
|
8594
|
+
closeTemplateContextMenu();
|
|
8595
|
+
}, [closeTemplateContextMenu, menuTarget]);
|
|
8596
|
+
const openCloneDialog = useCallback9(() => {
|
|
8597
|
+
if (!menuTarget) return;
|
|
8598
|
+
setActionTarget({ id: menuTarget.id, name: menuTarget.name });
|
|
8599
|
+
setTemplateName(`Copy of ${menuTarget.name}`);
|
|
8600
|
+
setSaveToCurrentBranch(true);
|
|
8601
|
+
setCloneOpen(true);
|
|
8602
|
+
closeTemplateContextMenu();
|
|
8603
|
+
}, [closeTemplateContextMenu, menuTarget]);
|
|
8604
|
+
const openDeleteDialog = useCallback9(() => {
|
|
8605
|
+
if (!menuTarget) return;
|
|
8606
|
+
setActionTarget({ id: menuTarget.id, name: menuTarget.name });
|
|
8607
|
+
setDeleteOpen(true);
|
|
8608
|
+
closeTemplateContextMenu();
|
|
8609
|
+
}, [closeTemplateContextMenu, menuTarget]);
|
|
8610
|
+
const handleRenameTemplate = useCallback9(async () => {
|
|
8611
|
+
if (!actionTarget || !templateName.trim()) return;
|
|
8612
|
+
const result = await ws.updateTemplate(actionTarget.id, {
|
|
8613
|
+
name: templateName.trim(),
|
|
8614
|
+
branchId: applyBranchScope()
|
|
8615
|
+
});
|
|
8616
|
+
if (!result.ok) return;
|
|
8617
|
+
setRenameOpen(false);
|
|
8618
|
+
setActionTarget(null);
|
|
8619
|
+
await refreshTemplates();
|
|
8620
|
+
}, [actionTarget, applyBranchScope, refreshTemplates, templateName, ws]);
|
|
8621
|
+
const handleCloneTemplate = useCallback9(async () => {
|
|
8622
|
+
if (!actionTarget || !templateName.trim()) return;
|
|
8623
|
+
const result = await ws.cloneTemplate(
|
|
8624
|
+
{ id: actionTarget.id },
|
|
8625
|
+
{
|
|
8626
|
+
name: templateName.trim(),
|
|
8627
|
+
branchId: applyBranchScope()
|
|
8628
|
+
}
|
|
8629
|
+
);
|
|
8630
|
+
if (!result.ok) return;
|
|
8631
|
+
setCloneOpen(false);
|
|
8632
|
+
setActionTarget(null);
|
|
8633
|
+
await refreshTemplates();
|
|
8634
|
+
}, [actionTarget, applyBranchScope, refreshTemplates, templateName, ws]);
|
|
8635
|
+
const handleDeleteTemplate = useCallback9(async () => {
|
|
8636
|
+
if (!actionTarget) return;
|
|
8637
|
+
const result = await ws.deleteTemplate(actionTarget.id);
|
|
8638
|
+
if (!result.ok) return;
|
|
8639
|
+
setDeleteOpen(false);
|
|
8640
|
+
setActionTarget(null);
|
|
8641
|
+
await refreshTemplates();
|
|
8642
|
+
}, [actionTarget, refreshTemplates, ws]);
|
|
8524
8643
|
return /* @__PURE__ */ jsxs21("div", { className: "flex h-full min-h-0 flex-col rounded-2xl border border-slate-200/80 bg-white/90 p-3 shadow-sm dark:border-slate-800 dark:bg-slate-950/80", children: [
|
|
8525
|
-
/* @__PURE__ */
|
|
8526
|
-
|
|
8527
|
-
|
|
8528
|
-
|
|
8529
|
-
|
|
8530
|
-
|
|
8531
|
-
|
|
8532
|
-
|
|
8533
|
-
|
|
8534
|
-
|
|
8535
|
-
|
|
8536
|
-
|
|
8644
|
+
/* @__PURE__ */ jsx29("label", { className: "relative", children: /* @__PURE__ */ jsx29(
|
|
8645
|
+
InputField4,
|
|
8646
|
+
{
|
|
8647
|
+
value: query,
|
|
8648
|
+
onChange: (event) => setQuery(event.value),
|
|
8649
|
+
placeholder: "Search assets",
|
|
8650
|
+
variant: "text",
|
|
8651
|
+
icon: /* @__PURE__ */ jsx29(CiSearch, { className: "pointer-events-none text-slate-400" }),
|
|
8652
|
+
trailingControl: /* @__PURE__ */ jsx29(
|
|
8653
|
+
"span",
|
|
8654
|
+
{
|
|
8655
|
+
className: "px-2",
|
|
8656
|
+
onClick: () => void ws.refresh.templates({ branchId: ws.branches.currentId ?? void 0, since: 0 }),
|
|
8657
|
+
children: /* @__PURE__ */ jsx29(AiOutlineReload, {})
|
|
8658
|
+
}
|
|
8659
|
+
)
|
|
8660
|
+
}
|
|
8661
|
+
) }),
|
|
8537
8662
|
/* @__PURE__ */ jsxs21(ScrollArea, { className: "mt-3 min-h-0 flex-1 pr-1", children: [
|
|
8538
8663
|
/* @__PURE__ */ jsxs21("section", { children: [
|
|
8539
8664
|
/* @__PURE__ */ jsxs21("h4", { className: "mb-2 flex items-center gap-2 text-xs font-semibold tracking-wide text-slate-500 uppercase dark:text-slate-400", children: [
|
|
@@ -8587,7 +8712,25 @@ function AssetsPanel() {
|
|
|
8587
8712
|
);
|
|
8588
8713
|
event.dataTransfer.effectAllowed = "copy";
|
|
8589
8714
|
},
|
|
8590
|
-
|
|
8715
|
+
onPointerDownCapture: (event) => {
|
|
8716
|
+
const isSecondaryClick = event.button === 2 || event.button === 0 && event.ctrlKey;
|
|
8717
|
+
if (!isSecondaryClick) return;
|
|
8718
|
+
event.preventDefault();
|
|
8719
|
+
event.stopPropagation();
|
|
8720
|
+
openTemplateContextMenu(item, event.clientX, event.clientY);
|
|
8721
|
+
},
|
|
8722
|
+
onContextMenu: (event) => {
|
|
8723
|
+
event.preventDefault();
|
|
8724
|
+
event.stopPropagation();
|
|
8725
|
+
openTemplateContextMenu(item, event.clientX, event.clientY);
|
|
8726
|
+
},
|
|
8727
|
+
onAuxClick: (event) => {
|
|
8728
|
+
if (event.button !== 2) return;
|
|
8729
|
+
event.preventDefault();
|
|
8730
|
+
event.stopPropagation();
|
|
8731
|
+
openTemplateContextMenu(item, event.clientX, event.clientY);
|
|
8732
|
+
},
|
|
8733
|
+
className: "w-full *:pointer-events-none rounded-xl border border-slate-200 bg-white px-3 py-2 text-left transition hover:border-slate-300 hover:bg-slate-50 dark:border-slate-800 dark:bg-slate-950/50 dark:hover:border-slate-700",
|
|
8591
8734
|
children: [
|
|
8592
8735
|
/* @__PURE__ */ jsx29("p", { className: "text-sm font-medium text-slate-900 dark:text-slate-100", children: item.name }),
|
|
8593
8736
|
/* @__PURE__ */ jsx29("p", { className: "text-xs text-slate-500 dark:text-slate-400", children: item?.definition?.mode === "group" ? "Group" : String(item?.definition?.type ?? item.kind ?? "template") })
|
|
@@ -8596,7 +8739,136 @@ function AssetsPanel() {
|
|
|
8596
8739
|
item.id
|
|
8597
8740
|
)) : /* @__PURE__ */ jsx29(EmptyState, { title: "No templates", description: "No saved templates matched your search.", className: "min-h-36" }) })
|
|
8598
8741
|
] })
|
|
8599
|
-
] })
|
|
8742
|
+
] }),
|
|
8743
|
+
menuTarget && templateMenuAnchorStyle ? /* @__PURE__ */ jsxs21(
|
|
8744
|
+
"div",
|
|
8745
|
+
{
|
|
8746
|
+
ref: menuRef,
|
|
8747
|
+
className: "fixed z-40 min-w-52 rounded-xl border border-slate-200 bg-white p-1.5 shadow-2xl dark:border-slate-700 dark:bg-slate-950",
|
|
8748
|
+
style: { left: templateMenuAnchorStyle.left, top: templateMenuAnchorStyle.top },
|
|
8749
|
+
role: "menu",
|
|
8750
|
+
children: [
|
|
8751
|
+
/* @__PURE__ */ jsx29(
|
|
8752
|
+
"button",
|
|
8753
|
+
{
|
|
8754
|
+
type: "button",
|
|
8755
|
+
className: "w-full rounded-lg px-3 py-2 text-left text-sm text-slate-700 hover:bg-slate-100 dark:text-slate-200 dark:hover:bg-slate-900",
|
|
8756
|
+
onClick: openRenameDialog,
|
|
8757
|
+
children: "Rename template"
|
|
8758
|
+
}
|
|
8759
|
+
),
|
|
8760
|
+
/* @__PURE__ */ jsx29(
|
|
8761
|
+
"button",
|
|
8762
|
+
{
|
|
8763
|
+
type: "button",
|
|
8764
|
+
className: "w-full rounded-lg px-3 py-2 text-left text-sm text-slate-700 hover:bg-slate-100 dark:text-slate-200 dark:hover:bg-slate-900",
|
|
8765
|
+
onClick: openCloneDialog,
|
|
8766
|
+
children: "Clone template"
|
|
8767
|
+
}
|
|
8768
|
+
),
|
|
8769
|
+
/* @__PURE__ */ jsx29("div", { className: "my-1 h-px bg-slate-200 dark:bg-slate-800" }),
|
|
8770
|
+
/* @__PURE__ */ jsx29(
|
|
8771
|
+
"button",
|
|
8772
|
+
{
|
|
8773
|
+
type: "button",
|
|
8774
|
+
className: "w-full rounded-lg px-3 py-2 text-left text-sm text-rose-600 hover:bg-rose-50 dark:text-rose-300 dark:hover:bg-rose-500/10",
|
|
8775
|
+
onClick: openDeleteDialog,
|
|
8776
|
+
children: "Delete template"
|
|
8777
|
+
}
|
|
8778
|
+
)
|
|
8779
|
+
]
|
|
8780
|
+
}
|
|
8781
|
+
) : null,
|
|
8782
|
+
/* @__PURE__ */ jsx29(
|
|
8783
|
+
AlertDialog,
|
|
8784
|
+
{
|
|
8785
|
+
open: renameOpen,
|
|
8786
|
+
onOpenChange: (open) => {
|
|
8787
|
+
setRenameOpen(open);
|
|
8788
|
+
if (!open) setActionTarget(null);
|
|
8789
|
+
},
|
|
8790
|
+
children: /* @__PURE__ */ jsxs21(AlertDialogContent, { children: [
|
|
8791
|
+
/* @__PURE__ */ jsxs21(AlertDialogHeader, { children: [
|
|
8792
|
+
/* @__PURE__ */ jsx29(AlertDialogTitle, { children: "Rename template" }),
|
|
8793
|
+
/* @__PURE__ */ jsx29(AlertDialogDescription, { children: "Update template name and scope." })
|
|
8794
|
+
] }),
|
|
8795
|
+
/* @__PURE__ */ jsxs21("div", { className: "space-y-3", children: [
|
|
8796
|
+
/* @__PURE__ */ jsx29(
|
|
8797
|
+
InputField4,
|
|
8798
|
+
{
|
|
8799
|
+
variant: "text",
|
|
8800
|
+
value: templateName,
|
|
8801
|
+
onChange: (event) => setTemplateName(String(event.value ?? "")),
|
|
8802
|
+
placeholder: "Template name"
|
|
8803
|
+
}
|
|
8804
|
+
),
|
|
8805
|
+
/* @__PURE__ */ jsxs21("label", { className: "flex items-center gap-2 text-sm", children: [
|
|
8806
|
+
/* @__PURE__ */ jsx29("input", { type: "checkbox", checked: saveToCurrentBranch, onChange: (event) => setSaveToCurrentBranch(event.target.checked) }),
|
|
8807
|
+
/* @__PURE__ */ jsx29("span", { children: "Save to current branch" })
|
|
8808
|
+
] })
|
|
8809
|
+
] }),
|
|
8810
|
+
/* @__PURE__ */ jsxs21(AlertDialogFooter, { children: [
|
|
8811
|
+
/* @__PURE__ */ jsx29(AlertDialogCancel, { type: "button", children: "Cancel" }),
|
|
8812
|
+
/* @__PURE__ */ jsx29(AlertDialogAction, { type: "button", disabled: !templateName.trim(), onClick: () => void handleRenameTemplate(), children: "Save" })
|
|
8813
|
+
] })
|
|
8814
|
+
] })
|
|
8815
|
+
}
|
|
8816
|
+
),
|
|
8817
|
+
/* @__PURE__ */ jsx29(
|
|
8818
|
+
AlertDialog,
|
|
8819
|
+
{
|
|
8820
|
+
open: cloneOpen,
|
|
8821
|
+
onOpenChange: (open) => {
|
|
8822
|
+
setCloneOpen(open);
|
|
8823
|
+
if (!open) setActionTarget(null);
|
|
8824
|
+
},
|
|
8825
|
+
children: /* @__PURE__ */ jsxs21(AlertDialogContent, { children: [
|
|
8826
|
+
/* @__PURE__ */ jsxs21(AlertDialogHeader, { children: [
|
|
8827
|
+
/* @__PURE__ */ jsx29(AlertDialogTitle, { children: "Clone template" }),
|
|
8828
|
+
/* @__PURE__ */ jsx29(AlertDialogDescription, { children: "Create a copy with a new name and scope." })
|
|
8829
|
+
] }),
|
|
8830
|
+
/* @__PURE__ */ jsxs21("div", { className: "space-y-3", children: [
|
|
8831
|
+
/* @__PURE__ */ jsx29(
|
|
8832
|
+
InputField4,
|
|
8833
|
+
{
|
|
8834
|
+
variant: "text",
|
|
8835
|
+
value: templateName,
|
|
8836
|
+
onChange: (event) => setTemplateName(String(event.value ?? "")),
|
|
8837
|
+
placeholder: "Template name"
|
|
8838
|
+
}
|
|
8839
|
+
),
|
|
8840
|
+
/* @__PURE__ */ jsxs21("label", { className: "flex items-center gap-2 text-sm", children: [
|
|
8841
|
+
/* @__PURE__ */ jsx29("input", { type: "checkbox", checked: saveToCurrentBranch, onChange: (event) => setSaveToCurrentBranch(event.target.checked) }),
|
|
8842
|
+
/* @__PURE__ */ jsx29("span", { children: "Save to current branch" })
|
|
8843
|
+
] })
|
|
8844
|
+
] }),
|
|
8845
|
+
/* @__PURE__ */ jsxs21(AlertDialogFooter, { children: [
|
|
8846
|
+
/* @__PURE__ */ jsx29(AlertDialogCancel, { type: "button", children: "Cancel" }),
|
|
8847
|
+
/* @__PURE__ */ jsx29(AlertDialogAction, { type: "button", disabled: !templateName.trim(), onClick: () => void handleCloneTemplate(), children: "Clone" })
|
|
8848
|
+
] })
|
|
8849
|
+
] })
|
|
8850
|
+
}
|
|
8851
|
+
),
|
|
8852
|
+
/* @__PURE__ */ jsx29(
|
|
8853
|
+
AlertDialog,
|
|
8854
|
+
{
|
|
8855
|
+
open: deleteOpen,
|
|
8856
|
+
onOpenChange: (open) => {
|
|
8857
|
+
setDeleteOpen(open);
|
|
8858
|
+
if (!open) setActionTarget(null);
|
|
8859
|
+
},
|
|
8860
|
+
children: /* @__PURE__ */ jsxs21(AlertDialogContent, { children: [
|
|
8861
|
+
/* @__PURE__ */ jsxs21(AlertDialogHeader, { children: [
|
|
8862
|
+
/* @__PURE__ */ jsx29(AlertDialogTitle, { children: "Delete template" }),
|
|
8863
|
+
/* @__PURE__ */ jsx29(AlertDialogDescription, { children: "This action permanently removes the selected template." })
|
|
8864
|
+
] }),
|
|
8865
|
+
/* @__PURE__ */ jsxs21(AlertDialogFooter, { children: [
|
|
8866
|
+
/* @__PURE__ */ jsx29(AlertDialogCancel, { type: "button", children: "Cancel" }),
|
|
8867
|
+
/* @__PURE__ */ jsx29(AlertDialogAction, { type: "button", className: "bg-rose-600 hover:bg-rose-700", onClick: () => void handleDeleteTemplate(), children: "Delete" })
|
|
8868
|
+
] })
|
|
8869
|
+
] })
|
|
8870
|
+
}
|
|
8871
|
+
)
|
|
8600
8872
|
] });
|
|
8601
8873
|
}
|
|
8602
8874
|
|
|
@@ -10736,7 +11008,7 @@ Panel.displayName = "Panel";
|
|
|
10736
11008
|
|
|
10737
11009
|
// src/panels/left/layers/index.tsx
|
|
10738
11010
|
import { useCanvas as useCanvas5 } from "@timeax/digital-service-engine/workspace";
|
|
10739
|
-
import { useMemo as useMemo18, useRef as
|
|
11011
|
+
import { useMemo as useMemo18, useRef as useRef11, useState as useState21 } from "react";
|
|
10740
11012
|
import { BsXDiamondFill } from "react-icons/bs";
|
|
10741
11013
|
import { CiSearch as CiSearch2 } from "react-icons/ci";
|
|
10742
11014
|
import { LuTags as LuTags3 } from "react-icons/lu";
|
|
@@ -10824,10 +11096,10 @@ function filterTree(nodes, query) {
|
|
|
10824
11096
|
var Layers = () => {
|
|
10825
11097
|
const canvas = useCanvas5();
|
|
10826
11098
|
const { openNodeContextMenu, canAcceptDropPayload, handleNodeDrop } = useNodeContextMenu();
|
|
10827
|
-
const tagsRef =
|
|
10828
|
-
const fieldsRef =
|
|
10829
|
-
const tagSearchInputRef =
|
|
10830
|
-
const fieldSearchInputRef =
|
|
11099
|
+
const tagsRef = useRef11(null);
|
|
11100
|
+
const fieldsRef = useRef11(null);
|
|
11101
|
+
const tagSearchInputRef = useRef11(null);
|
|
11102
|
+
const fieldSearchInputRef = useRef11(null);
|
|
10831
11103
|
const [tagSearch, setTagSearch] = useState21("");
|
|
10832
11104
|
const [fieldSearch, setFieldSearch] = useState21("");
|
|
10833
11105
|
const [isTagSearchOpen, setIsTagSearchOpen] = useState21(false);
|
|
@@ -11494,7 +11766,7 @@ function CollapsibleContent2({
|
|
|
11494
11766
|
}
|
|
11495
11767
|
|
|
11496
11768
|
// src/panels/right/components/comments/comments.tsx
|
|
11497
|
-
import { InputField as
|
|
11769
|
+
import { InputField as InputField5 } from "@timeax/form-palette";
|
|
11498
11770
|
import * as React29 from "react";
|
|
11499
11771
|
import { createCache as createCache2, createIndexedDBDriver as createIndexedDBDriver2, createMemoryDriver as createMemoryDriver2 } from "@timeax/cache-store";
|
|
11500
11772
|
import { jsx as jsx45, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
@@ -11595,7 +11867,7 @@ function ReplyInputRow({
|
|
|
11595
11867
|
return /* @__PURE__ */ jsxs30("div", { className: cx("flex items-center gap-3", className), children: [
|
|
11596
11868
|
/* @__PURE__ */ jsx45(PersonAvatar, { person: { name: you.name, avatar: you.avatar }, fallback: initials(you.name) }),
|
|
11597
11869
|
/* @__PURE__ */ jsx45(
|
|
11598
|
-
|
|
11870
|
+
InputField5,
|
|
11599
11871
|
{
|
|
11600
11872
|
variant: "textarea",
|
|
11601
11873
|
placeholder: "Add a reply...",
|
|
@@ -11669,7 +11941,7 @@ function ActiveDot() {
|
|
|
11669
11941
|
|
|
11670
11942
|
// src/panels/right/tabs/comments.tsx
|
|
11671
11943
|
import { useWorkspace as useWorkspace10 } from "@timeax/digital-service-engine/workspace";
|
|
11672
|
-
import { InputField as
|
|
11944
|
+
import { InputField as InputField6 } from "@timeax/form-palette";
|
|
11673
11945
|
import { useMemo as useMemo22, useState as useState23 } from "react";
|
|
11674
11946
|
import { MdOutlineSend } from "react-icons/md";
|
|
11675
11947
|
import { jsx as jsx46, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
@@ -11719,7 +11991,7 @@ var Comments = () => {
|
|
|
11719
11991
|
thread.id
|
|
11720
11992
|
)) : /* @__PURE__ */ jsx46(EmptyState, { title: "No matching comments", description: "Try a broader search or add a new thread to the current branch.", className: "mt-4" }) }) }),
|
|
11721
11993
|
/* @__PURE__ */ jsx46("div", { className: "border-t border-slate-200 px-4 py-3 dark:border-slate-800", children: /* @__PURE__ */ jsx46(
|
|
11722
|
-
|
|
11994
|
+
InputField6,
|
|
11723
11995
|
{
|
|
11724
11996
|
variant: "textarea",
|
|
11725
11997
|
value,
|
|
@@ -12024,7 +12296,7 @@ function areServiceContextStatesEqual(left, right) {
|
|
|
12024
12296
|
}
|
|
12025
12297
|
|
|
12026
12298
|
// src/components/service-meta-popover.tsx
|
|
12027
|
-
import { useEffect as
|
|
12299
|
+
import { useEffect as useEffect19, useMemo as useMemo24, useRef as useRef12, useState as useState25 } from "react";
|
|
12028
12300
|
import { FiInfo } from "react-icons/fi";
|
|
12029
12301
|
|
|
12030
12302
|
// src/components/service-meta.ts
|
|
@@ -12064,8 +12336,8 @@ function ServiceMetaPopover({
|
|
|
12064
12336
|
}) {
|
|
12065
12337
|
const rows = useMemo24(() => flattenServiceMeta(meta), [meta]);
|
|
12066
12338
|
const [open, setOpen] = useState25(false);
|
|
12067
|
-
const openTimerRef =
|
|
12068
|
-
const closeTimerRef =
|
|
12339
|
+
const openTimerRef = useRef12(null);
|
|
12340
|
+
const closeTimerRef = useRef12(null);
|
|
12069
12341
|
const clearTimers = () => {
|
|
12070
12342
|
if (openTimerRef.current != null) {
|
|
12071
12343
|
window.clearTimeout(openTimerRef.current);
|
|
@@ -12076,7 +12348,7 @@ function ServiceMetaPopover({
|
|
|
12076
12348
|
closeTimerRef.current = null;
|
|
12077
12349
|
}
|
|
12078
12350
|
};
|
|
12079
|
-
|
|
12351
|
+
useEffect19(() => () => clearTimers(), []);
|
|
12080
12352
|
const scheduleOpen = () => {
|
|
12081
12353
|
if (open) return;
|
|
12082
12354
|
clearTimers();
|
|
@@ -12153,10 +12425,10 @@ function ServiceMetaPopover({
|
|
|
12153
12425
|
}
|
|
12154
12426
|
|
|
12155
12427
|
// src/hooks/use-service-catalog-state.ts
|
|
12156
|
-
import { useEffect as
|
|
12428
|
+
import { useEffect as useEffect20, useState as useState26 } from "react";
|
|
12157
12429
|
function useServiceCatalogState(canvasApi, editor) {
|
|
12158
12430
|
const [catalogState, setCatalogState] = useState26(null);
|
|
12159
|
-
|
|
12431
|
+
useEffect20(() => {
|
|
12160
12432
|
const resolveCatalog = (catalog) => catalog ?? editor.getCatalog?.() ?? editor.ensureCatalog?.() ?? null;
|
|
12161
12433
|
setCatalogState(resolveCatalog());
|
|
12162
12434
|
const offCatalogChange = canvasApi.on("catalog:change", (payload) => {
|
|
@@ -12200,8 +12472,8 @@ function RenderIf({ data, emptyMessage = null, children, when }) {
|
|
|
12200
12472
|
|
|
12201
12473
|
// src/panels/right/partials/global/add-service.tsx
|
|
12202
12474
|
import { useCanvas as useCanvas7, useWorkspace as useWorkspace11 } from "@timeax/digital-service-engine/workspace";
|
|
12203
|
-
import { InputField as
|
|
12204
|
-
import { useCallback as
|
|
12475
|
+
import { InputField as InputField7 } from "@timeax/form-palette";
|
|
12476
|
+
import { useCallback as useCallback19, useEffect as useEffect21, useMemo as useMemo25, useRef as useRef13, useState as useState27 } from "react";
|
|
12205
12477
|
import { BsPlus } from "react-icons/bs";
|
|
12206
12478
|
import { FaFolderOpen } from "react-icons/fa";
|
|
12207
12479
|
import { FiFilter } from "react-icons/fi";
|
|
@@ -12294,8 +12566,8 @@ function AddServicePopover({
|
|
|
12294
12566
|
const [manualPrimaryRate, setManualPrimaryRate] = useState27("");
|
|
12295
12567
|
const [primaryServiceId, setPrimaryServiceId] = useState27(null);
|
|
12296
12568
|
const [compatibleIds, setCompatibleIds] = useState27(null);
|
|
12297
|
-
const compatibleRequestRef =
|
|
12298
|
-
const compatibleCacheRef =
|
|
12569
|
+
const compatibleRequestRef = useRef13(0);
|
|
12570
|
+
const compatibleCacheRef = useRef13(/* @__PURE__ */ new Map());
|
|
12299
12571
|
const catalogState = useServiceCatalogState(canvas.api, canvas.api.editor);
|
|
12300
12572
|
const policies2 = ws.policies.policies.data ?? [];
|
|
12301
12573
|
const policiesKey = useMemo25(() => JSON.stringify(policies2 ?? []), [policies2]);
|
|
@@ -12316,7 +12588,7 @@ function AddServicePopover({
|
|
|
12316
12588
|
[preferredTagId, selectedButtons]
|
|
12317
12589
|
);
|
|
12318
12590
|
const [liveSnapshot, setLiveSnapshot] = useState27(() => createEmptyServiceContextSnapshot(liveSelectionContext, canvas.props));
|
|
12319
|
-
|
|
12591
|
+
useEffect21(() => {
|
|
12320
12592
|
let active = true;
|
|
12321
12593
|
const fallback = createEmptyServiceContextSnapshot(liveSelectionContext, canvas.props);
|
|
12322
12594
|
setLiveSnapshot(fallback);
|
|
@@ -12357,7 +12629,7 @@ function AddServicePopover({
|
|
|
12357
12629
|
if (rateContextSource === "manual") return parsedManualPrimaryRate != null;
|
|
12358
12630
|
return Boolean(primaryServiceId);
|
|
12359
12631
|
}, [parsedManualPrimaryRate, primaryServiceId, rateContextMode, rateContextSource]);
|
|
12360
|
-
|
|
12632
|
+
useEffect21(() => {
|
|
12361
12633
|
if (primaryServiceId && contextServiceOptions.some((option) => option.value === primaryServiceId)) return;
|
|
12362
12634
|
setPrimaryServiceId(contextServiceOptions[0]?.value ?? null);
|
|
12363
12635
|
}, [contextServiceOptions, primaryServiceId]);
|
|
@@ -12389,7 +12661,7 @@ function AddServicePopover({
|
|
|
12389
12661
|
}
|
|
12390
12662
|
return new Set(selectedGroup.serviceIds.map((id) => String(id)));
|
|
12391
12663
|
}, [catalogGroups, catalogMode, groupedServiceIds, selectedCatalogGroupId, services2]);
|
|
12392
|
-
|
|
12664
|
+
useEffect21(() => {
|
|
12393
12665
|
const requestId = ++compatibleRequestRef.current;
|
|
12394
12666
|
if (!contextFilterEnabled || !liveSnapshot.selectedTag) {
|
|
12395
12667
|
setCompatibleIds(null);
|
|
@@ -12456,7 +12728,7 @@ function AddServicePopover({
|
|
|
12456
12728
|
rateContextMode,
|
|
12457
12729
|
rateContextSource
|
|
12458
12730
|
]);
|
|
12459
|
-
const setCatalogMode =
|
|
12731
|
+
const setCatalogMode = useCallback19(
|
|
12460
12732
|
(mode) => {
|
|
12461
12733
|
const editor = canvas.api.editor;
|
|
12462
12734
|
editor.ensureCatalog?.();
|
|
@@ -12477,7 +12749,7 @@ function AddServicePopover({
|
|
|
12477
12749
|
service
|
|
12478
12750
|
}));
|
|
12479
12751
|
}, [allowedCatalogIds, compatibleIds, services2, query]);
|
|
12480
|
-
|
|
12752
|
+
useEffect21(() => {
|
|
12481
12753
|
if (selected && !options.some((option) => option.value === selected)) {
|
|
12482
12754
|
setSelected("");
|
|
12483
12755
|
}
|
|
@@ -12489,7 +12761,7 @@ function AddServicePopover({
|
|
|
12489
12761
|
/* @__PURE__ */ jsx52(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx52(SectionActionTriggerButton, { icon: /* @__PURE__ */ jsx52(BsPlus, {}), children: "Add" }) }),
|
|
12490
12762
|
/* @__PURE__ */ jsx52(PopoverContent, { className: "w-96", children: /* @__PURE__ */ jsxs34("div", { className: "flex flex-col gap-3", children: [
|
|
12491
12763
|
/* @__PURE__ */ jsx52(
|
|
12492
|
-
|
|
12764
|
+
InputField7,
|
|
12493
12765
|
{
|
|
12494
12766
|
variant: "text",
|
|
12495
12767
|
value: query,
|
|
@@ -12522,7 +12794,7 @@ function AddServicePopover({
|
|
|
12522
12794
|
/* @__PURE__ */ jsxs34("div", { className: "space-y-2 rounded-lg border border-slate-200 p-3 dark:border-slate-800", children: [
|
|
12523
12795
|
/* @__PURE__ */ jsx52("div", { className: "text-xs font-semibold tracking-[0.16em] text-slate-500 uppercase dark:text-slate-400", children: "Catalog scope" }),
|
|
12524
12796
|
/* @__PURE__ */ jsx52(
|
|
12525
|
-
|
|
12797
|
+
InputField7,
|
|
12526
12798
|
{
|
|
12527
12799
|
variant: "radio",
|
|
12528
12800
|
value: catalogMode,
|
|
@@ -12539,7 +12811,7 @@ function AddServicePopover({
|
|
|
12539
12811
|
}
|
|
12540
12812
|
),
|
|
12541
12813
|
/* @__PURE__ */ jsx52(
|
|
12542
|
-
|
|
12814
|
+
InputField7,
|
|
12543
12815
|
{
|
|
12544
12816
|
variant: "treeselect",
|
|
12545
12817
|
placeholder: "Select group",
|
|
@@ -12583,7 +12855,7 @@ function AddServicePopover({
|
|
|
12583
12855
|
/* @__PURE__ */ jsxs34("div", { className: "space-y-2 rounded-lg border border-slate-200 p-3 dark:border-slate-800", children: [
|
|
12584
12856
|
/* @__PURE__ */ jsx52("div", { className: "text-xs font-semibold tracking-[0.16em] text-slate-500 uppercase dark:text-slate-400", children: "Rate compatibility" }),
|
|
12585
12857
|
/* @__PURE__ */ jsx52(
|
|
12586
|
-
|
|
12858
|
+
InputField7,
|
|
12587
12859
|
{
|
|
12588
12860
|
variant: "radio",
|
|
12589
12861
|
value: rateContextMode,
|
|
@@ -12605,7 +12877,7 @@ function AddServicePopover({
|
|
|
12605
12877
|
),
|
|
12606
12878
|
rateContextMode === "custom_primary_rate" ? /* @__PURE__ */ jsxs34("div", { className: "space-y-2", children: [
|
|
12607
12879
|
/* @__PURE__ */ jsx52(
|
|
12608
|
-
|
|
12880
|
+
InputField7,
|
|
12609
12881
|
{
|
|
12610
12882
|
variant: "radio",
|
|
12611
12883
|
value: rateContextSource,
|
|
@@ -12626,7 +12898,7 @@ function AddServicePopover({
|
|
|
12626
12898
|
}
|
|
12627
12899
|
),
|
|
12628
12900
|
rateContextSource === "service" ? /* @__PURE__ */ jsx52(
|
|
12629
|
-
|
|
12901
|
+
InputField7,
|
|
12630
12902
|
{
|
|
12631
12903
|
variant: "select",
|
|
12632
12904
|
label: "Primary context service",
|
|
@@ -12636,7 +12908,7 @@ function AddServicePopover({
|
|
|
12636
12908
|
placeholder: "Select service"
|
|
12637
12909
|
}
|
|
12638
12910
|
) : /* @__PURE__ */ jsx52(
|
|
12639
|
-
|
|
12911
|
+
InputField7,
|
|
12640
12912
|
{
|
|
12641
12913
|
variant: "number",
|
|
12642
12914
|
label: "Primary rate",
|
|
@@ -12704,11 +12976,11 @@ var add_service_default = AddService;
|
|
|
12704
12976
|
// src/panels/right/partials/properties/field-properties.tsx
|
|
12705
12977
|
import { resolveInputDescriptor, useInputs as useInputs2 } from "@timeax/digital-service-engine/react";
|
|
12706
12978
|
import { useCanvas as useCanvas13 } from "@timeax/digital-service-engine/workspace";
|
|
12707
|
-
import { InputField as
|
|
12708
|
-
import { useEffect as
|
|
12979
|
+
import { InputField as InputField14 } from "@timeax/form-palette";
|
|
12980
|
+
import { useEffect as useEffect22, useMemo as useMemo31, useState as useState31 } from "react";
|
|
12709
12981
|
|
|
12710
12982
|
// src/panels/right/partials/properties/components/descriptor-settings.tsx
|
|
12711
|
-
import { InputField as
|
|
12983
|
+
import { InputField as InputField8 } from "@timeax/form-palette";
|
|
12712
12984
|
import { useMemo as useMemo26, useState as useState28 } from "react";
|
|
12713
12985
|
|
|
12714
12986
|
// src/panels/right/partials/properties/components/meta.ts
|
|
@@ -12917,7 +13189,7 @@ function DescriptorPrimitiveField({ schema, value, hasOverride, onSet, onClear,
|
|
|
12917
13189
|
return /* @__PURE__ */ jsxs35("div", { className: "space-y-2", children: [
|
|
12918
13190
|
/* @__PURE__ */ jsx53(FieldDescription, { description: schema.description, canReset: hasOverride, onReset: () => onClear(path) }),
|
|
12919
13191
|
/* @__PURE__ */ jsx53(
|
|
12920
|
-
|
|
13192
|
+
InputField8,
|
|
12921
13193
|
{
|
|
12922
13194
|
variant: options?.length ? "select" : "text",
|
|
12923
13195
|
label: schema.label,
|
|
@@ -12940,7 +13212,7 @@ function DescriptorPrimitiveField({ schema, value, hasOverride, onSet, onClear,
|
|
|
12940
13212
|
return /* @__PURE__ */ jsxs35("div", { className: "space-y-2", children: [
|
|
12941
13213
|
/* @__PURE__ */ jsx53(FieldDescription, { description: schema.description, canReset: hasOverride, onReset: () => onClear(path) }),
|
|
12942
13214
|
/* @__PURE__ */ jsx53(
|
|
12943
|
-
|
|
13215
|
+
InputField8,
|
|
12944
13216
|
{
|
|
12945
13217
|
variant: "text",
|
|
12946
13218
|
label: schema.label,
|
|
@@ -12961,7 +13233,7 @@ function DescriptorPrimitiveField({ schema, value, hasOverride, onSet, onClear,
|
|
|
12961
13233
|
return /* @__PURE__ */ jsxs35("div", { className: "space-y-2", children: [
|
|
12962
13234
|
/* @__PURE__ */ jsx53(FieldDescription, { description: schema.description, canReset: hasOverride, onReset: () => onClear(path) }),
|
|
12963
13235
|
/* @__PURE__ */ jsx53(
|
|
12964
|
-
|
|
13236
|
+
InputField8,
|
|
12965
13237
|
{
|
|
12966
13238
|
variant: "toggle",
|
|
12967
13239
|
label: schema.label,
|
|
@@ -12979,7 +13251,7 @@ function DescriptorPrimitiveField({ schema, value, hasOverride, onSet, onClear,
|
|
|
12979
13251
|
return /* @__PURE__ */ jsxs35("div", { className: "space-y-2", children: [
|
|
12980
13252
|
/* @__PURE__ */ jsx53(FieldDescription, { description: schema.description, canReset: hasOverride, onReset: () => onClear(path) }),
|
|
12981
13253
|
/* @__PURE__ */ jsx53(
|
|
12982
|
-
|
|
13254
|
+
InputField8,
|
|
12983
13255
|
{
|
|
12984
13256
|
variant: schema.multiple ? "multi-select" : "select",
|
|
12985
13257
|
label: schema.label,
|
|
@@ -13073,7 +13345,7 @@ function DescriptorObjectField({ schema, value, hasOverride, onSet, onClear, pat
|
|
|
13073
13345
|
return /* @__PURE__ */ jsxs35("div", { className: "space-y-3 rounded-lg border border-dashed border-slate-200 p-3 dark:border-slate-700", children: [
|
|
13074
13346
|
/* @__PURE__ */ jsxs35("div", { className: "grid gap-3 md:grid-cols-[minmax(0,1fr)_180px_auto]", children: [
|
|
13075
13347
|
/* @__PURE__ */ jsx53(
|
|
13076
|
-
|
|
13348
|
+
InputField8,
|
|
13077
13349
|
{
|
|
13078
13350
|
variant: "text",
|
|
13079
13351
|
label: "Key",
|
|
@@ -13086,7 +13358,7 @@ function DescriptorObjectField({ schema, value, hasOverride, onSet, onClear, pat
|
|
|
13086
13358
|
}
|
|
13087
13359
|
),
|
|
13088
13360
|
shapeEntries.length > 1 ? /* @__PURE__ */ jsx53(
|
|
13089
|
-
|
|
13361
|
+
InputField8,
|
|
13090
13362
|
{
|
|
13091
13363
|
variant: "select",
|
|
13092
13364
|
label: "Shape",
|
|
@@ -13139,7 +13411,7 @@ function DescriptorObjectField({ schema, value, hasOverride, onSet, onClear, pat
|
|
|
13139
13411
|
}),
|
|
13140
13412
|
schema.editable && shapeEntries.length ? /* @__PURE__ */ jsxs35("div", { className: "grid gap-3 rounded-lg border border-dashed border-slate-200 p-3 md:grid-cols-[minmax(0,1fr)_180px_auto] dark:border-slate-700", children: [
|
|
13141
13413
|
/* @__PURE__ */ jsx53(
|
|
13142
|
-
|
|
13414
|
+
InputField8,
|
|
13143
13415
|
{
|
|
13144
13416
|
variant: "text",
|
|
13145
13417
|
label: "New key",
|
|
@@ -13149,7 +13421,7 @@ function DescriptorObjectField({ schema, value, hasOverride, onSet, onClear, pat
|
|
|
13149
13421
|
}
|
|
13150
13422
|
),
|
|
13151
13423
|
/* @__PURE__ */ jsx53(
|
|
13152
|
-
|
|
13424
|
+
InputField8,
|
|
13153
13425
|
{
|
|
13154
13426
|
variant: "select",
|
|
13155
13427
|
label: "Shape",
|
|
@@ -13218,7 +13490,7 @@ function DescriptorArrayField({ schema, value, hasOverride, onSet, onClear, path
|
|
|
13218
13490
|
index + 1
|
|
13219
13491
|
] }),
|
|
13220
13492
|
!schema.item && shapeEntries.length > 1 ? /* @__PURE__ */ jsx53(
|
|
13221
|
-
|
|
13493
|
+
InputField8,
|
|
13222
13494
|
{
|
|
13223
13495
|
variant: "select",
|
|
13224
13496
|
label: "Shape",
|
|
@@ -13272,7 +13544,7 @@ function DescriptorArrayField({ schema, value, hasOverride, onSet, onClear, path
|
|
|
13272
13544
|
schema.label.toLowerCase()
|
|
13273
13545
|
] }),
|
|
13274
13546
|
!schema.item && shapeEntries.length > 1 ? /* @__PURE__ */ jsx53(
|
|
13275
|
-
|
|
13547
|
+
InputField8,
|
|
13276
13548
|
{
|
|
13277
13549
|
variant: "select",
|
|
13278
13550
|
label: "Shape",
|
|
@@ -13338,7 +13610,7 @@ function DescriptorSettings({ schema, defaults, onChange }) {
|
|
|
13338
13610
|
|
|
13339
13611
|
// src/panels/right/partials/properties/components/order-kind-section.tsx
|
|
13340
13612
|
import { useCanvas as useCanvas8 } from "@timeax/digital-service-engine/workspace";
|
|
13341
|
-
import { InputField as
|
|
13613
|
+
import { InputField as InputField9 } from "@timeax/form-palette";
|
|
13342
13614
|
import { useMemo as useMemo27 } from "react";
|
|
13343
13615
|
import { MdOutlineRemoveCircleOutline as MdOutlineRemoveCircleOutline2 } from "react-icons/md";
|
|
13344
13616
|
import { jsx as jsx54, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
@@ -13381,7 +13653,7 @@ function OrderKindSection({
|
|
|
13381
13653
|
] }),
|
|
13382
13654
|
/* @__PURE__ */ jsxs36("div", { className: "space-y-3", children: [
|
|
13383
13655
|
/* @__PURE__ */ jsx54(
|
|
13384
|
-
|
|
13656
|
+
InputField9,
|
|
13385
13657
|
{
|
|
13386
13658
|
variant: "select",
|
|
13387
13659
|
disabled: !canEditSelect,
|
|
@@ -13416,7 +13688,7 @@ var order_kind_section_default = OrderKindSection;
|
|
|
13416
13688
|
|
|
13417
13689
|
// src/panels/right/partials/properties/components/quantity-section.tsx
|
|
13418
13690
|
import { useCanvas as useCanvas9 } from "@timeax/digital-service-engine/workspace";
|
|
13419
|
-
import { InputField as
|
|
13691
|
+
import { InputField as InputField10 } from "@timeax/form-palette";
|
|
13420
13692
|
import { useMemo as useMemo28 } from "react";
|
|
13421
13693
|
import { BsPatchPlus, BsPlus as BsPlus2 } from "react-icons/bs";
|
|
13422
13694
|
import { MdDeleteOutline } from "react-icons/md";
|
|
@@ -13551,7 +13823,7 @@ function QuantitySection({ node }) {
|
|
|
13551
13823
|
capabilities.quantity.ruleHelp ? /* @__PURE__ */ jsx55("p", { className: "text-xs text-slate-500 dark:text-slate-400", children: capabilities.quantity.ruleHelp }) : null
|
|
13552
13824
|
] }),
|
|
13553
13825
|
fieldRule?.valueBy === "eval" ? /* @__PURE__ */ jsx55(
|
|
13554
|
-
|
|
13826
|
+
InputField10,
|
|
13555
13827
|
{
|
|
13556
13828
|
variant: "textarea",
|
|
13557
13829
|
label: "Eval code",
|
|
@@ -13562,7 +13834,7 @@ function QuantitySection({ node }) {
|
|
|
13562
13834
|
) : null,
|
|
13563
13835
|
/* @__PURE__ */ jsxs37("div", { className: "grid grid-cols-1 gap-3 sm:grid-cols-2", children: [
|
|
13564
13836
|
/* @__PURE__ */ jsx55(
|
|
13565
|
-
|
|
13837
|
+
InputField10,
|
|
13566
13838
|
{
|
|
13567
13839
|
variant: "text",
|
|
13568
13840
|
label: "Multiply",
|
|
@@ -13572,7 +13844,7 @@ function QuantitySection({ node }) {
|
|
|
13572
13844
|
}
|
|
13573
13845
|
),
|
|
13574
13846
|
/* @__PURE__ */ jsx55(
|
|
13575
|
-
|
|
13847
|
+
InputField10,
|
|
13576
13848
|
{
|
|
13577
13849
|
variant: "text",
|
|
13578
13850
|
label: "Fallback",
|
|
@@ -13582,7 +13854,7 @@ function QuantitySection({ node }) {
|
|
|
13582
13854
|
}
|
|
13583
13855
|
),
|
|
13584
13856
|
/* @__PURE__ */ jsx55(
|
|
13585
|
-
|
|
13857
|
+
InputField10,
|
|
13586
13858
|
{
|
|
13587
13859
|
variant: "text",
|
|
13588
13860
|
label: "Clamp min",
|
|
@@ -13597,7 +13869,7 @@ function QuantitySection({ node }) {
|
|
|
13597
13869
|
}
|
|
13598
13870
|
),
|
|
13599
13871
|
/* @__PURE__ */ jsx55(
|
|
13600
|
-
|
|
13872
|
+
InputField10,
|
|
13601
13873
|
{
|
|
13602
13874
|
variant: "text",
|
|
13603
13875
|
label: "Clamp max",
|
|
@@ -13615,7 +13887,7 @@ function QuantitySection({ node }) {
|
|
|
13615
13887
|
] }) : null,
|
|
13616
13888
|
capabilities.quantity.canEditDefault ? hasQuantityDefault ? /* @__PURE__ */ jsxs37("div", { className: "space-y-2 rounded-xl border border-slate-200 p-3 dark:border-slate-800", children: [
|
|
13617
13889
|
/* @__PURE__ */ jsx55(
|
|
13618
|
-
|
|
13890
|
+
InputField10,
|
|
13619
13891
|
{
|
|
13620
13892
|
variant: "text",
|
|
13621
13893
|
label: "Quantity default",
|
|
@@ -13628,7 +13900,7 @@ function QuantitySection({ node }) {
|
|
|
13628
13900
|
] }) : null : null
|
|
13629
13901
|
] }) : hasQuantityDefault ? /* @__PURE__ */ jsxs37("div", { className: "space-y-2", children: [
|
|
13630
13902
|
/* @__PURE__ */ jsx55(
|
|
13631
|
-
|
|
13903
|
+
InputField10,
|
|
13632
13904
|
{
|
|
13633
13905
|
variant: "text",
|
|
13634
13906
|
label: "Quantity default",
|
|
@@ -13645,7 +13917,7 @@ var quantity_section_default = QuantitySection;
|
|
|
13645
13917
|
|
|
13646
13918
|
// src/panels/right/partials/properties/components/utility-section.tsx
|
|
13647
13919
|
import { useCanvas as useCanvas10 } from "@timeax/digital-service-engine/workspace";
|
|
13648
|
-
import { InputField as
|
|
13920
|
+
import { InputField as InputField11 } from "@timeax/form-palette";
|
|
13649
13921
|
import { BsPencil, BsPlus as BsPlus3 } from "react-icons/bs";
|
|
13650
13922
|
import { MdDeleteOutline as MdDeleteOutline2 } from "react-icons/md";
|
|
13651
13923
|
import { Fragment as Fragment9, jsx as jsx56, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
@@ -13741,7 +14013,7 @@ function UtilitySection({ node }) {
|
|
|
13741
14013
|
hasStoredUtility && !isActiveUtility ? /* @__PURE__ */ jsx56("p", { className: "text-xs text-slate-500 dark:text-slate-400", children: "This node still has utility marker values stored, but its pricing role is base. Activate utility to apply these charges, or clear the marker." }) : null,
|
|
13742
14014
|
/* @__PURE__ */ jsxs38(Fragment9, { children: [
|
|
13743
14015
|
/* @__PURE__ */ jsx56(
|
|
13744
|
-
|
|
14016
|
+
InputField11,
|
|
13745
14017
|
{
|
|
13746
14018
|
variant: "text",
|
|
13747
14019
|
label: "Rate",
|
|
@@ -13751,7 +14023,7 @@ function UtilitySection({ node }) {
|
|
|
13751
14023
|
}
|
|
13752
14024
|
),
|
|
13753
14025
|
/* @__PURE__ */ jsx56(
|
|
13754
|
-
|
|
14026
|
+
InputField11,
|
|
13755
14027
|
{
|
|
13756
14028
|
variant: "select",
|
|
13757
14029
|
label: "Mode",
|
|
@@ -13768,7 +14040,7 @@ function UtilitySection({ node }) {
|
|
|
13768
14040
|
}
|
|
13769
14041
|
),
|
|
13770
14042
|
(resolvedUtility.mode ?? "flat") === "per_value" ? /* @__PURE__ */ jsx56(
|
|
13771
|
-
|
|
14043
|
+
InputField11,
|
|
13772
14044
|
{
|
|
13773
14045
|
variant: "select",
|
|
13774
14046
|
label: "Value source",
|
|
@@ -13781,7 +14053,7 @@ function UtilitySection({ node }) {
|
|
|
13781
14053
|
}
|
|
13782
14054
|
) : null,
|
|
13783
14055
|
(resolvedUtility.mode ?? "flat") === "percent" ? /* @__PURE__ */ jsx56(
|
|
13784
|
-
|
|
14056
|
+
InputField11,
|
|
13785
14057
|
{
|
|
13786
14058
|
variant: "select",
|
|
13787
14059
|
label: "Percent base",
|
|
@@ -13797,7 +14069,7 @@ function UtilitySection({ node }) {
|
|
|
13797
14069
|
}
|
|
13798
14070
|
) : null,
|
|
13799
14071
|
/* @__PURE__ */ jsx56(
|
|
13800
|
-
|
|
14072
|
+
InputField11,
|
|
13801
14073
|
{
|
|
13802
14074
|
variant: "text",
|
|
13803
14075
|
label: "Label",
|
|
@@ -13814,7 +14086,7 @@ var utility_section_default = UtilitySection;
|
|
|
13814
14086
|
|
|
13815
14087
|
// src/panels/right/partials/properties/components/validation-section.tsx
|
|
13816
14088
|
import { useCanvas as useCanvas11 } from "@timeax/digital-service-engine/workspace";
|
|
13817
|
-
import { InputField as
|
|
14089
|
+
import { InputField as InputField12 } from "@timeax/form-palette";
|
|
13818
14090
|
import { useMemo as useMemo29 } from "react";
|
|
13819
14091
|
import { BsPlus as BsPlus4 } from "react-icons/bs";
|
|
13820
14092
|
import { MdDeleteOutline as MdDeleteOutline3 } from "react-icons/md";
|
|
@@ -13893,7 +14165,7 @@ function TypedScalarEditor({
|
|
|
13893
14165
|
const scalarType = inferScalarType(value);
|
|
13894
14166
|
return /* @__PURE__ */ jsx57("div", { className: "space-y-3 rounded-lg border border-slate-200/80 p-3 dark:border-slate-800", children: /* @__PURE__ */ jsxs39("div", { className: "grid gap-3 md:grid-cols-[160px_minmax(0,1fr)]", children: [
|
|
13895
14167
|
/* @__PURE__ */ jsx57(
|
|
13896
|
-
|
|
14168
|
+
InputField12,
|
|
13897
14169
|
{
|
|
13898
14170
|
variant: "select",
|
|
13899
14171
|
label: `${label} type`,
|
|
@@ -13907,7 +14179,7 @@ function TypedScalarEditor({
|
|
|
13907
14179
|
}
|
|
13908
14180
|
),
|
|
13909
14181
|
scalarType === "boolean" ? /* @__PURE__ */ jsx57(
|
|
13910
|
-
|
|
14182
|
+
InputField12,
|
|
13911
14183
|
{
|
|
13912
14184
|
variant: "toggle",
|
|
13913
14185
|
label,
|
|
@@ -13915,7 +14187,7 @@ function TypedScalarEditor({
|
|
|
13915
14187
|
onChange: (event) => onChange(Boolean(event.value))
|
|
13916
14188
|
}
|
|
13917
14189
|
) : /* @__PURE__ */ jsx57(
|
|
13918
|
-
|
|
14190
|
+
InputField12,
|
|
13919
14191
|
{
|
|
13920
14192
|
variant: "text",
|
|
13921
14193
|
label,
|
|
@@ -14003,7 +14275,7 @@ function ValidationRuleCard({
|
|
|
14003
14275
|
] }),
|
|
14004
14276
|
/* @__PURE__ */ jsxs39("div", { className: "grid gap-3 md:grid-cols-2", children: [
|
|
14005
14277
|
/* @__PURE__ */ jsx57(
|
|
14006
|
-
|
|
14278
|
+
InputField12,
|
|
14007
14279
|
{
|
|
14008
14280
|
variant: "select",
|
|
14009
14281
|
label: "Operation",
|
|
@@ -14018,7 +14290,7 @@ function ValidationRuleCard({
|
|
|
14018
14290
|
}
|
|
14019
14291
|
),
|
|
14020
14292
|
/* @__PURE__ */ jsx57(
|
|
14021
|
-
|
|
14293
|
+
InputField12,
|
|
14022
14294
|
{
|
|
14023
14295
|
variant: "select",
|
|
14024
14296
|
label: "Value source",
|
|
@@ -14034,7 +14306,7 @@ function ValidationRuleCard({
|
|
|
14034
14306
|
)
|
|
14035
14307
|
] }),
|
|
14036
14308
|
/* @__PURE__ */ jsx57(
|
|
14037
|
-
|
|
14309
|
+
InputField12,
|
|
14038
14310
|
{
|
|
14039
14311
|
variant: "text",
|
|
14040
14312
|
label: "Message",
|
|
@@ -14063,7 +14335,7 @@ function ValidationRuleCard({
|
|
|
14063
14335
|
) : null,
|
|
14064
14336
|
rule.op === "between" ? /* @__PURE__ */ jsxs39("div", { className: "grid gap-3 md:grid-cols-2", children: [
|
|
14065
14337
|
/* @__PURE__ */ jsx57(
|
|
14066
|
-
|
|
14338
|
+
InputField12,
|
|
14067
14339
|
{
|
|
14068
14340
|
variant: "text",
|
|
14069
14341
|
label: "Minimum",
|
|
@@ -14078,7 +14350,7 @@ function ValidationRuleCard({
|
|
|
14078
14350
|
}
|
|
14079
14351
|
),
|
|
14080
14352
|
/* @__PURE__ */ jsx57(
|
|
14081
|
-
|
|
14353
|
+
InputField12,
|
|
14082
14354
|
{
|
|
14083
14355
|
variant: "text",
|
|
14084
14356
|
label: "Maximum",
|
|
@@ -14107,7 +14379,7 @@ function ValidationRuleCard({
|
|
|
14107
14379
|
) : null,
|
|
14108
14380
|
rule.op === "match" ? /* @__PURE__ */ jsxs39("div", { className: "grid gap-3 md:grid-cols-2", children: [
|
|
14109
14381
|
/* @__PURE__ */ jsx57(
|
|
14110
|
-
|
|
14382
|
+
InputField12,
|
|
14111
14383
|
{
|
|
14112
14384
|
variant: "text",
|
|
14113
14385
|
label: "Pattern",
|
|
@@ -14122,7 +14394,7 @@ function ValidationRuleCard({
|
|
|
14122
14394
|
}
|
|
14123
14395
|
),
|
|
14124
14396
|
/* @__PURE__ */ jsx57(
|
|
14125
|
-
|
|
14397
|
+
InputField12,
|
|
14126
14398
|
{
|
|
14127
14399
|
variant: "text",
|
|
14128
14400
|
label: "Flags",
|
|
@@ -14138,7 +14410,7 @@ function ValidationRuleCard({
|
|
|
14138
14410
|
)
|
|
14139
14411
|
] }) : null,
|
|
14140
14412
|
valueBy === "eval" ? /* @__PURE__ */ jsx57(
|
|
14141
|
-
|
|
14413
|
+
InputField12,
|
|
14142
14414
|
{
|
|
14143
14415
|
variant: "textarea",
|
|
14144
14416
|
label: "Eval code",
|
|
@@ -14223,7 +14495,7 @@ import { keyBy } from "lodash";
|
|
|
14223
14495
|
import { useMemo as useMemo30, useState as useState30 } from "react";
|
|
14224
14496
|
|
|
14225
14497
|
// src/panels/right/partials/properties/components/AddIncludesPopover.tsx
|
|
14226
|
-
import { InputField as
|
|
14498
|
+
import { InputField as InputField13 } from "@timeax/form-palette";
|
|
14227
14499
|
import { useState as useState29 } from "react";
|
|
14228
14500
|
import { BsPlus as BsPlus5 } from "react-icons/bs";
|
|
14229
14501
|
import { jsx as jsx58, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
@@ -14233,7 +14505,7 @@ function AddIncludesPopover({ open, onOpenChange, onSelect, options }) {
|
|
|
14233
14505
|
/* @__PURE__ */ jsx58(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx58(SectionActionTriggerButton, { icon: /* @__PURE__ */ jsx58(BsPlus5, {}), children: "Add" }) }),
|
|
14234
14506
|
/* @__PURE__ */ jsx58(PopoverContent, { children: /* @__PURE__ */ jsxs40("div", { className: "flex flex-col gap-2", children: [
|
|
14235
14507
|
/* @__PURE__ */ jsx58(
|
|
14236
|
-
|
|
14508
|
+
InputField13,
|
|
14237
14509
|
{
|
|
14238
14510
|
value,
|
|
14239
14511
|
onChange: (e) => {
|
|
@@ -14376,13 +14648,13 @@ function FieldProperties({ className, node, kinds, defaultKind }) {
|
|
|
14376
14648
|
const descriptor = useMemo31(() => resolveInputDescriptor(registry, currentType, currentVariant), [currentType, currentVariant, registry]);
|
|
14377
14649
|
const descriptorUi = descriptor?.ui ?? {};
|
|
14378
14650
|
const descriptorKeySet = useMemo31(() => new Set(getDescriptorUiKeys(descriptorUi)), [descriptorUi]);
|
|
14379
|
-
|
|
14651
|
+
useEffect22(() => {
|
|
14380
14652
|
setNameDraft(nameValue);
|
|
14381
14653
|
}, [node.id, nameValue]);
|
|
14382
|
-
|
|
14654
|
+
useEffect22(() => {
|
|
14383
14655
|
setPlaceholderDraft(placeholderValue);
|
|
14384
14656
|
}, [node.id, placeholderValue]);
|
|
14385
|
-
|
|
14657
|
+
useEffect22(() => {
|
|
14386
14658
|
setHelpTextDraft(helpTextValue);
|
|
14387
14659
|
}, [node.id, helpTextValue]);
|
|
14388
14660
|
const fieldTypeOptions = useMemo31(() => {
|
|
@@ -14447,7 +14719,7 @@ function FieldProperties({ className, node, kinds, defaultKind }) {
|
|
|
14447
14719
|
/* @__PURE__ */ jsx60("p", { className: "mb-3 text-xs text-slate-500 dark:text-slate-400", children: "Core field metadata used by the service engine and preview form." }),
|
|
14448
14720
|
/* @__PURE__ */ jsxs42("div", { className: "space-y-3", children: [
|
|
14449
14721
|
/* @__PURE__ */ jsx60(
|
|
14450
|
-
|
|
14722
|
+
InputField14,
|
|
14451
14723
|
{
|
|
14452
14724
|
variant: "text",
|
|
14453
14725
|
label: "Name",
|
|
@@ -14458,7 +14730,7 @@ function FieldProperties({ className, node, kinds, defaultKind }) {
|
|
|
14458
14730
|
}
|
|
14459
14731
|
),
|
|
14460
14732
|
/* @__PURE__ */ jsx60(
|
|
14461
|
-
|
|
14733
|
+
InputField14,
|
|
14462
14734
|
{
|
|
14463
14735
|
variant: "select",
|
|
14464
14736
|
label: "Type",
|
|
@@ -14468,7 +14740,7 @@ function FieldProperties({ className, node, kinds, defaultKind }) {
|
|
|
14468
14740
|
}
|
|
14469
14741
|
),
|
|
14470
14742
|
canEditVariant ? /* @__PURE__ */ jsx60(
|
|
14471
|
-
|
|
14743
|
+
InputField14,
|
|
14472
14744
|
{
|
|
14473
14745
|
variant: "select",
|
|
14474
14746
|
label: "Input variant",
|
|
@@ -14478,7 +14750,7 @@ function FieldProperties({ className, node, kinds, defaultKind }) {
|
|
|
14478
14750
|
}
|
|
14479
14751
|
) : null,
|
|
14480
14752
|
/* @__PURE__ */ jsx60(
|
|
14481
|
-
|
|
14753
|
+
InputField14,
|
|
14482
14754
|
{
|
|
14483
14755
|
variant: "toggle",
|
|
14484
14756
|
label: "Required",
|
|
@@ -14487,7 +14759,7 @@ function FieldProperties({ className, node, kinds, defaultKind }) {
|
|
|
14487
14759
|
}
|
|
14488
14760
|
),
|
|
14489
14761
|
/* @__PURE__ */ jsx60(
|
|
14490
|
-
|
|
14762
|
+
InputField14,
|
|
14491
14763
|
{
|
|
14492
14764
|
variant: "toggle",
|
|
14493
14765
|
label: "Button mode",
|
|
@@ -14497,7 +14769,7 @@ function FieldProperties({ className, node, kinds, defaultKind }) {
|
|
|
14497
14769
|
}
|
|
14498
14770
|
),
|
|
14499
14771
|
options.length ? /* @__PURE__ */ jsx60(
|
|
14500
|
-
|
|
14772
|
+
InputField14,
|
|
14501
14773
|
{
|
|
14502
14774
|
variant: "toggle",
|
|
14503
14775
|
label: "Is multiple",
|
|
@@ -14532,7 +14804,7 @@ function FieldProperties({ className, node, kinds, defaultKind }) {
|
|
|
14532
14804
|
/* @__PURE__ */ jsx60("p", { className: "mb-3 text-xs text-slate-500 dark:text-slate-400", children: "Preview-oriented defaults passed to the form palette." }),
|
|
14533
14805
|
/* @__PURE__ */ jsxs42("div", { className: "space-y-3", children: [
|
|
14534
14806
|
/* @__PURE__ */ jsx60(
|
|
14535
|
-
|
|
14807
|
+
InputField14,
|
|
14536
14808
|
{
|
|
14537
14809
|
variant: "text",
|
|
14538
14810
|
label: "Placeholder",
|
|
@@ -14542,7 +14814,7 @@ function FieldProperties({ className, node, kinds, defaultKind }) {
|
|
|
14542
14814
|
}
|
|
14543
14815
|
),
|
|
14544
14816
|
/* @__PURE__ */ jsx60(
|
|
14545
|
-
|
|
14817
|
+
InputField14,
|
|
14546
14818
|
{
|
|
14547
14819
|
variant: "textarea",
|
|
14548
14820
|
label: "Help text",
|
|
@@ -14634,7 +14906,7 @@ var field_properties_default = FieldProperties;
|
|
|
14634
14906
|
|
|
14635
14907
|
// src/panels/right/partials/properties/option-properties.tsx
|
|
14636
14908
|
import { useCanvas as useCanvas14 } from "@timeax/digital-service-engine/workspace";
|
|
14637
|
-
import { InputField as
|
|
14909
|
+
import { InputField as InputField15 } from "@timeax/form-palette";
|
|
14638
14910
|
import { jsx as jsx61, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
14639
14911
|
function OptionProperties({ className, node, kinds, defaultKind }) {
|
|
14640
14912
|
const canvas = useCanvas14();
|
|
@@ -14648,7 +14920,7 @@ function OptionProperties({ className, node, kinds, defaultKind }) {
|
|
|
14648
14920
|
/* @__PURE__ */ jsx61("p", { className: "mb-3 text-xs text-slate-500 dark:text-slate-400", children: "Edit the currently focused option node." }),
|
|
14649
14921
|
/* @__PURE__ */ jsxs43("div", { className: "space-y-3", children: [
|
|
14650
14922
|
/* @__PURE__ */ jsx61(
|
|
14651
|
-
|
|
14923
|
+
InputField15,
|
|
14652
14924
|
{
|
|
14653
14925
|
variant: "text",
|
|
14654
14926
|
label: "Label",
|
|
@@ -14660,7 +14932,7 @@ function OptionProperties({ className, node, kinds, defaultKind }) {
|
|
|
14660
14932
|
}
|
|
14661
14933
|
),
|
|
14662
14934
|
/* @__PURE__ */ jsx61(
|
|
14663
|
-
|
|
14935
|
+
InputField15,
|
|
14664
14936
|
{
|
|
14665
14937
|
variant: "text",
|
|
14666
14938
|
label: "Value",
|
|
@@ -14718,13 +14990,13 @@ import "@timeax/digital-service-engine/core";
|
|
|
14718
14990
|
// src/panels/right/partials/properties/tag/TagConstraintsSection.tsx
|
|
14719
14991
|
import "@timeax/digital-service-engine/core";
|
|
14720
14992
|
import { useCanvas as useCanvas15 } from "@timeax/digital-service-engine/workspace";
|
|
14721
|
-
import { InputField as
|
|
14993
|
+
import { InputField as InputField17 } from "@timeax/form-palette";
|
|
14722
14994
|
import { ArrowUpRight } from "lucide-react";
|
|
14723
14995
|
import { useMemo as useMemo32, useState as useState32 } from "react";
|
|
14724
14996
|
import { TiDelete } from "react-icons/ti";
|
|
14725
14997
|
|
|
14726
14998
|
// src/panels/right/partials/properties/tag/AddConstraintsPopover.tsx
|
|
14727
|
-
import { Form, InputField as
|
|
14999
|
+
import { Form, InputField as InputField16 } from "@timeax/form-palette";
|
|
14728
15000
|
import "react";
|
|
14729
15001
|
import { BsPlus as BsPlus6 } from "react-icons/bs";
|
|
14730
15002
|
import { jsx as jsx62, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
@@ -14742,7 +15014,7 @@ function AddConstraintsPopover({ open, onOpenChange, constraints, allConstraints
|
|
|
14742
15014
|
},
|
|
14743
15015
|
children: [
|
|
14744
15016
|
/* @__PURE__ */ jsx62(
|
|
14745
|
-
|
|
15017
|
+
InputField16,
|
|
14746
15018
|
{
|
|
14747
15019
|
name: "constraints",
|
|
14748
15020
|
variant: "checkbox",
|
|
@@ -14906,7 +15178,7 @@ function TagConstraintsSection({ node }) {
|
|
|
14906
15178
|
}
|
|
14907
15179
|
const value = constraints2?.[constraint];
|
|
14908
15180
|
return /* @__PURE__ */ jsx65(
|
|
14909
|
-
|
|
15181
|
+
InputField17,
|
|
14910
15182
|
{
|
|
14911
15183
|
labelPlacement: "left",
|
|
14912
15184
|
tags,
|
|
@@ -14964,7 +15236,7 @@ function TagProperties({ node, kinds, defaultKind }) {
|
|
|
14964
15236
|
|
|
14965
15237
|
// src/panels/right/tabs/properties.tsx
|
|
14966
15238
|
import { useCanvas as useCanvas16, useWorkspace as useWorkspace12 } from "@timeax/digital-service-engine/workspace";
|
|
14967
|
-
import { InputField as
|
|
15239
|
+
import { InputField as InputField18 } from "@timeax/form-palette";
|
|
14968
15240
|
import { useMemo as useMemo33, useState as useState33 } from "react";
|
|
14969
15241
|
import { AiOutlineLoading3Quarters } from "react-icons/ai";
|
|
14970
15242
|
import { MdOutlineContentCopy } from "react-icons/md";
|
|
@@ -15001,7 +15273,7 @@ var Properties = ({ kinds = [], defaultKind = "" }) => {
|
|
|
15001
15273
|
] }),
|
|
15002
15274
|
/* @__PURE__ */ jsxs49("div", { className: "mt-3 space-y-3", children: [
|
|
15003
15275
|
/* @__PURE__ */ jsx69(
|
|
15004
|
-
|
|
15276
|
+
InputField18,
|
|
15005
15277
|
{
|
|
15006
15278
|
variant: "text",
|
|
15007
15279
|
label: /* @__PURE__ */ jsx69(FieldLabel, { children: "Label" }),
|
|
@@ -15013,7 +15285,7 @@ var Properties = ({ kinds = [], defaultKind = "" }) => {
|
|
|
15013
15285
|
}
|
|
15014
15286
|
),
|
|
15015
15287
|
/* @__PURE__ */ jsx69(
|
|
15016
|
-
|
|
15288
|
+
InputField18,
|
|
15017
15289
|
{
|
|
15018
15290
|
variant: "text",
|
|
15019
15291
|
label: /* @__PURE__ */ jsx69(FieldLabel, { children: "ID" }),
|
|
@@ -15196,7 +15468,7 @@ var wireframe_tags_widget_default = WireframeTagsWidget;
|
|
|
15196
15468
|
// src/panels/right/tabs/wireframe.tsx
|
|
15197
15469
|
import { useOrderFlow, Wrapper } from "@timeax/digital-service-engine/react";
|
|
15198
15470
|
import { useCanvas as useCanvas17, useWorkspace as useWorkspace13 } from "@timeax/digital-service-engine/workspace";
|
|
15199
|
-
import { useCallback as
|
|
15471
|
+
import { useCallback as useCallback20, useMemo as useMemo34, useState as useState34 } from "react";
|
|
15200
15472
|
import { BsChevronDown as BsChevronDown2 } from "react-icons/bs";
|
|
15201
15473
|
import { jsx as jsx71, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
15202
15474
|
var CHECKBOX_SINGLE_EXTRA_PROPS = Object.freeze({ single: true });
|
|
@@ -15271,7 +15543,7 @@ function Wireframe({ kinds: _kinds = [], defaultKind: _defaultKind = "" }) {
|
|
|
15271
15543
|
};
|
|
15272
15544
|
});
|
|
15273
15545
|
}, [flow.services, ws.services.data]);
|
|
15274
|
-
const renderPillDetails =
|
|
15546
|
+
const renderPillDetails = useCallback20(
|
|
15275
15547
|
(kind) => {
|
|
15276
15548
|
if (kind === "services") {
|
|
15277
15549
|
return /* @__PURE__ */ jsxs51("div", { className: "space-y-2", children: [
|
|
@@ -15380,14 +15652,14 @@ function Wireframe({ kinds: _kinds = [], defaultKind: _defaultKind = "" }) {
|
|
|
15380
15652
|
}
|
|
15381
15653
|
return map;
|
|
15382
15654
|
}, [canvas.props, canvas.selectionInfo, canvas.activeId]);
|
|
15383
|
-
const select =
|
|
15655
|
+
const select = useCallback20(
|
|
15384
15656
|
(id) => {
|
|
15385
15657
|
canvas.setActive(id);
|
|
15386
15658
|
canvas.api.select([id]);
|
|
15387
15659
|
},
|
|
15388
15660
|
[canvas.api, canvas.setActive]
|
|
15389
15661
|
);
|
|
15390
|
-
return /* @__PURE__ */ jsxs51("div", { className: "flex h-full min-h-0 flex-col", children: [
|
|
15662
|
+
return /* @__PURE__ */ jsxs51("div", { className: "flex h-full min-h-0 flex-col flex-1 w-full", children: [
|
|
15391
15663
|
/* @__PURE__ */ jsx71("div", { className: "min-h-0 flex-1 overflow-auto p-4", children: /* @__PURE__ */ jsx71("div", { className: "mx-auto max-w-md", children: /* @__PURE__ */ jsxs51("div", { className: "flex flex-col gap-4", children: [
|
|
15392
15664
|
/* @__PURE__ */ jsx71(WorkspaceBootInlineNotice, { boot: ws.boot, sections: ["snapshotBody", "policies"] }),
|
|
15393
15665
|
/* @__PURE__ */ jsx71(
|
|
@@ -15548,7 +15820,15 @@ var RightPanel = ({ onShare, onPlay, kinds = [], defaultKind = "" }) => {
|
|
|
15548
15820
|
] }),
|
|
15549
15821
|
/* @__PURE__ */ jsx72(TabsContent, { className: "grow overflow-hidden", value: "comments", children: /* @__PURE__ */ jsx72(comments_default, {}) }),
|
|
15550
15822
|
/* @__PURE__ */ jsx72(TabsContent, { className: "min-h-0 grow overflow-hidden", value: "properties", children: /* @__PURE__ */ jsx72(Properties, { kinds, defaultKind }) }),
|
|
15551
|
-
/* @__PURE__ */ jsx72(
|
|
15823
|
+
/* @__PURE__ */ jsx72(
|
|
15824
|
+
TabsContent,
|
|
15825
|
+
{
|
|
15826
|
+
className: "[&_form]:grow-col flex min-h-0 grow flex-col overflow-hidden [&_form]:flex [&_form]:h-full [&_form]:overflow-hidden",
|
|
15827
|
+
value: "wireframe",
|
|
15828
|
+
forceMount: true,
|
|
15829
|
+
children: /* @__PURE__ */ jsx72(OrderFlowProvider, { serviceProps: props, builder: api.builder, selection: api.selection, registry, children: /* @__PURE__ */ jsx72(wireframe_default, { kinds, defaultKind }) })
|
|
15830
|
+
}
|
|
15831
|
+
)
|
|
15552
15832
|
] })
|
|
15553
15833
|
] })
|
|
15554
15834
|
}
|
|
@@ -15853,13 +16133,13 @@ function FallbackEditorHeader({
|
|
|
15853
16133
|
// src/workspace/fallback-editor/fallback-registrations-panel.tsx
|
|
15854
16134
|
import { useActiveFallbackRegistrations as useActiveFallbackRegistrations3, useEligibleServiceList as useEligibleServiceList2, useFallbackEditor as useFallbackEditor3 } from "@timeax/digital-service-engine/react";
|
|
15855
16135
|
import { Plus, Trash2, X as X2 } from "lucide-react";
|
|
15856
|
-
import { useCallback as
|
|
16136
|
+
import { useCallback as useCallback21, useState as useState36 } from "react";
|
|
15857
16137
|
|
|
15858
16138
|
// src/workspace/fallback-editor/fallback-dialogs.tsx
|
|
15859
|
-
import { InputField as
|
|
16139
|
+
import { InputField as InputField19 } from "@timeax/form-palette";
|
|
15860
16140
|
import { useActiveFallbackRegistrations as useActiveFallbackRegistrations2, useEligibleServiceList, useFallbackEditor as useFallbackEditor2 } from "@timeax/digital-service-engine/react";
|
|
15861
16141
|
import { Check, Search } from "lucide-react";
|
|
15862
|
-
import { useEffect as
|
|
16142
|
+
import { useEffect as useEffect23, useMemo as useMemo36, useState as useState35 } from "react";
|
|
15863
16143
|
import { jsx as jsx77, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
15864
16144
|
function FallbackAddRegistrationDialog({
|
|
15865
16145
|
open,
|
|
@@ -15875,7 +16155,7 @@ function FallbackAddRegistrationDialog({
|
|
|
15875
16155
|
if (serviceProps) return "props";
|
|
15876
16156
|
return "none";
|
|
15877
16157
|
}, [snapshot, serviceProps]);
|
|
15878
|
-
|
|
16158
|
+
useEffect23(() => {
|
|
15879
16159
|
if (open) {
|
|
15880
16160
|
setScope("global");
|
|
15881
16161
|
setNodeId("");
|
|
@@ -15933,12 +16213,12 @@ function FallbackAddRegistrationDialog({
|
|
|
15933
16213
|
}
|
|
15934
16214
|
return [];
|
|
15935
16215
|
}, [activeServiceId, mode, serviceProps, snapshot]);
|
|
15936
|
-
|
|
16216
|
+
useEffect23(() => {
|
|
15937
16217
|
if (hasGlobal && scope === "global") {
|
|
15938
16218
|
setScope("node");
|
|
15939
16219
|
}
|
|
15940
16220
|
}, [hasGlobal, scope]);
|
|
15941
|
-
|
|
16221
|
+
useEffect23(() => {
|
|
15942
16222
|
if (!nodeId) return;
|
|
15943
16223
|
if (nodeTargets.some((entry) => entry.id === nodeId)) return;
|
|
15944
16224
|
setNodeId("");
|
|
@@ -15981,7 +16261,7 @@ function FallbackAddRegistrationDialog({
|
|
|
15981
16261
|
/* @__PURE__ */ jsxs56("div", { className: "space-y-2", children: [
|
|
15982
16262
|
/* @__PURE__ */ jsx77("label", { className: "text-sm font-medium text-slate-900 dark:text-slate-100", children: "Scope" }),
|
|
15983
16263
|
/* @__PURE__ */ jsx77(
|
|
15984
|
-
|
|
16264
|
+
InputField19,
|
|
15985
16265
|
{
|
|
15986
16266
|
variant: "radio",
|
|
15987
16267
|
label: "Scope",
|
|
@@ -15998,7 +16278,7 @@ function FallbackAddRegistrationDialog({
|
|
|
15998
16278
|
scope === "node" ? /* @__PURE__ */ jsxs56("div", { className: "space-y-2", children: [
|
|
15999
16279
|
/* @__PURE__ */ jsx77("label", { className: "text-sm font-medium text-slate-900 dark:text-slate-100", children: "Node id" }),
|
|
16000
16280
|
/* @__PURE__ */ jsx77(
|
|
16001
|
-
|
|
16281
|
+
InputField19,
|
|
16002
16282
|
{
|
|
16003
16283
|
variant: "select",
|
|
16004
16284
|
label: "Node id",
|
|
@@ -16032,7 +16312,7 @@ function FallbackAddCandidatesDialog({
|
|
|
16032
16312
|
const [filterEligibleOnly, setFilterEligibleOnly] = useState35(true);
|
|
16033
16313
|
const [selected, setSelected] = useState35(/* @__PURE__ */ new Set());
|
|
16034
16314
|
const [submitting, setSubmitting] = useState35(false);
|
|
16035
|
-
|
|
16315
|
+
useEffect23(() => {
|
|
16036
16316
|
if (!open) {
|
|
16037
16317
|
setQuery("");
|
|
16038
16318
|
setFilterEligibleOnly(true);
|
|
@@ -16093,7 +16373,7 @@ function FallbackAddCandidatesDialog({
|
|
|
16093
16373
|
children: /* @__PURE__ */ jsxs56("div", { className: "space-y-4", children: [
|
|
16094
16374
|
/* @__PURE__ */ jsxs56("div", { className: "grid gap-3 md:grid-cols-[minmax(0,1fr)_220px]", children: [
|
|
16095
16375
|
/* @__PURE__ */ jsx77(
|
|
16096
|
-
|
|
16376
|
+
InputField19,
|
|
16097
16377
|
{
|
|
16098
16378
|
variant: "text",
|
|
16099
16379
|
label: "Search eligible services",
|
|
@@ -16107,7 +16387,7 @@ function FallbackAddCandidatesDialog({
|
|
|
16107
16387
|
}
|
|
16108
16388
|
),
|
|
16109
16389
|
/* @__PURE__ */ jsx77("div", { className: "rounded-md border border-slate-200 bg-slate-50/70 px-4 py-3 dark:border-slate-800 dark:bg-slate-900/70", children: /* @__PURE__ */ jsx77(
|
|
16110
|
-
|
|
16390
|
+
InputField19,
|
|
16111
16391
|
{
|
|
16112
16392
|
variant: "toggle",
|
|
16113
16393
|
label: "Filter eligible only",
|
|
@@ -16267,7 +16547,7 @@ function FallbackRegistrationsPanel() {
|
|
|
16267
16547
|
const [candidateContext, setCandidateContext] = useState36(null);
|
|
16268
16548
|
const [candidatePrimaryId, setCandidatePrimaryId] = useState36(void 0);
|
|
16269
16549
|
const [registrationDialogOpen, setRegistrationDialogOpen] = useState36(false);
|
|
16270
|
-
const openCandidatePicker =
|
|
16550
|
+
const openCandidatePicker = useCallback21((context, primaryId) => {
|
|
16271
16551
|
setCandidateContext(context);
|
|
16272
16552
|
setCandidatePrimaryId(primaryId);
|
|
16273
16553
|
setCandidatePickerOpen(true);
|
|
@@ -16393,7 +16673,7 @@ function FallbackRegistrationsPanel() {
|
|
|
16393
16673
|
|
|
16394
16674
|
// src/workspace/fallback-editor/fallback-service-sidebar.tsx
|
|
16395
16675
|
import { useFallbackEditor as useFallbackEditor4, usePrimaryServiceList as usePrimaryServiceList2 } from "@timeax/digital-service-engine/react";
|
|
16396
|
-
import { InputField as
|
|
16676
|
+
import { InputField as InputField20 } from "@timeax/form-palette";
|
|
16397
16677
|
import { Search as Search2 } from "lucide-react";
|
|
16398
16678
|
import { useMemo as useMemo37, useState as useState37 } from "react";
|
|
16399
16679
|
import { jsx as jsx79, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
@@ -16412,7 +16692,7 @@ function FallbackServiceSidebar() {
|
|
|
16412
16692
|
/* @__PURE__ */ jsxs58("div", { className: "border-b border-slate-200 px-4 py-4 dark:border-slate-800 space-y-2", children: [
|
|
16413
16693
|
/* @__PURE__ */ jsx79(SectionHeader2, { title: "Primary services", description: "Choose the primary service whose fallback registrations you want to edit." }),
|
|
16414
16694
|
/* @__PURE__ */ jsx79(
|
|
16415
|
-
|
|
16695
|
+
InputField20,
|
|
16416
16696
|
{
|
|
16417
16697
|
variant: "text",
|
|
16418
16698
|
value: query,
|
|
@@ -16459,15 +16739,15 @@ function FallbackServiceSidebar() {
|
|
|
16459
16739
|
|
|
16460
16740
|
// src/workspace/fallback-editor/fallback-settings-panel.tsx
|
|
16461
16741
|
import { useFallbackEditor as useFallbackEditor5 } from "@timeax/digital-service-engine/react";
|
|
16462
|
-
import { InputField as
|
|
16463
|
-
import { useEffect as
|
|
16742
|
+
import { InputField as InputField21 } from "@timeax/form-palette";
|
|
16743
|
+
import { useEffect as useEffect24, useState as useState38 } from "react";
|
|
16464
16744
|
import { jsx as jsx80, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
16465
16745
|
function FallbackSettingsPanel() {
|
|
16466
16746
|
const { settings, saveSettings, settingsSaving } = useFallbackEditor5();
|
|
16467
16747
|
const [draft, setDraft] = useState38(settings);
|
|
16468
16748
|
const [error, setError] = useState38(null);
|
|
16469
16749
|
const [saved, setSaved] = useState38(false);
|
|
16470
|
-
|
|
16750
|
+
useEffect24(() => {
|
|
16471
16751
|
setDraft(settings);
|
|
16472
16752
|
setSaved(false);
|
|
16473
16753
|
setError(null);
|
|
@@ -16501,7 +16781,7 @@ function FallbackSettingsPanel() {
|
|
|
16501
16781
|
) }),
|
|
16502
16782
|
/* @__PURE__ */ jsx80(ScrollArea, { className: "min-h-0 flex-1 p-5", "data-testid": "fallback-editor-settings-scroll", children: /* @__PURE__ */ jsxs59("div", { className: "space-y-5", children: [
|
|
16503
16783
|
/* @__PURE__ */ jsx80(SettingRow, { title: "Require constraint fit", hint: "Reject or warn when a candidate does not match effective tag constraints.", children: /* @__PURE__ */ jsx80(
|
|
16504
|
-
|
|
16784
|
+
InputField21,
|
|
16505
16785
|
{
|
|
16506
16786
|
variant: "toggle",
|
|
16507
16787
|
value: Boolean(draft.requireConstraintFit),
|
|
@@ -16514,7 +16794,7 @@ function FallbackSettingsPanel() {
|
|
|
16514
16794
|
}
|
|
16515
16795
|
) }),
|
|
16516
16796
|
/* @__PURE__ */ jsx80(SettingRow, { title: "Rate policy", hint: "Controls how fallback service rates are compared against the primary service.", children: /* @__PURE__ */ jsx80("div", { className: "flex flex-col gap-2 md:items-end", children: /* @__PURE__ */ jsx80(
|
|
16517
|
-
|
|
16797
|
+
InputField21,
|
|
16518
16798
|
{
|
|
16519
16799
|
variant: "select",
|
|
16520
16800
|
value: ratePolicy.kind,
|
|
@@ -16545,7 +16825,7 @@ function FallbackSettingsPanel() {
|
|
|
16545
16825
|
}
|
|
16546
16826
|
) }) }),
|
|
16547
16827
|
ratePolicy.kind !== "eq_primary" ? /* @__PURE__ */ jsx80(SettingRow, { title: "Rate Percentage", hint: "Rate percentage the policy is guarded by", children: /* @__PURE__ */ jsx80("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsx80("div", { className: "w-32", children: /* @__PURE__ */ jsx80(
|
|
16548
|
-
|
|
16828
|
+
InputField21,
|
|
16549
16829
|
{
|
|
16550
16830
|
variant: "number",
|
|
16551
16831
|
value: ratePolicy.pct,
|
|
@@ -16564,7 +16844,7 @@ function FallbackSettingsPanel() {
|
|
|
16564
16844
|
}
|
|
16565
16845
|
) }) }) }) : null,
|
|
16566
16846
|
/* @__PURE__ */ jsx80(SettingRow, { title: "Selection strategy", hint: "How valid fallback candidates are ordered in previews.", children: /* @__PURE__ */ jsx80(
|
|
16567
|
-
|
|
16847
|
+
InputField21,
|
|
16568
16848
|
{
|
|
16569
16849
|
variant: "select",
|
|
16570
16850
|
label: "Selection strategy",
|
|
@@ -16581,7 +16861,7 @@ function FallbackSettingsPanel() {
|
|
|
16581
16861
|
}
|
|
16582
16862
|
) }),
|
|
16583
16863
|
/* @__PURE__ */ jsx80(SettingRow, { title: "Mode", hint: "Use strict for enforced filtering, dev for advisory feedback.", children: /* @__PURE__ */ jsx80(
|
|
16584
|
-
|
|
16864
|
+
InputField21,
|
|
16585
16865
|
{
|
|
16586
16866
|
variant: "select",
|
|
16587
16867
|
label: "Mode",
|
|
@@ -16718,7 +16998,7 @@ function NativeFallbackEditorInner({ className }) {
|
|
|
16718
16998
|
// src/workspace/fallback-editor-modal.tsx
|
|
16719
16999
|
import { useCanvas as useCanvas19, useWorkspace as useWorkspace14 } from "@timeax/digital-service-engine/workspace";
|
|
16720
17000
|
import cloneDeep4 from "lodash/cloneDeep";
|
|
16721
|
-
import { createContext as createContext4, useCallback as
|
|
17001
|
+
import { createContext as createContext4, useCallback as useCallback22, useContext as useContext4, useEffect as useEffect25, useMemo as useMemo39, useState as useState39 } from "react";
|
|
16722
17002
|
import { createPortal as createPortal4 } from "react-dom";
|
|
16723
17003
|
import { FiX as FiX4 } from "react-icons/fi";
|
|
16724
17004
|
import { jsx as jsx82, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
@@ -16737,11 +17017,11 @@ function FallbackEditorModalProvider({ children }) {
|
|
|
16737
17017
|
const [launch, setLaunch] = useState39(null);
|
|
16738
17018
|
const [sessionId, setSessionId] = useState39(0);
|
|
16739
17019
|
const [surfaceError, setSurfaceError] = useState39(null);
|
|
16740
|
-
const close =
|
|
17020
|
+
const close = useCallback22(() => {
|
|
16741
17021
|
setLaunch(null);
|
|
16742
17022
|
setSurfaceError(null);
|
|
16743
17023
|
}, []);
|
|
16744
|
-
const openForNode =
|
|
17024
|
+
const openForNode = useCallback22((input) => {
|
|
16745
17025
|
setSurfaceError(null);
|
|
16746
17026
|
setSessionId((current) => current + 1);
|
|
16747
17027
|
setLaunch({
|
|
@@ -16752,7 +17032,7 @@ function FallbackEditorModalProvider({ children }) {
|
|
|
16752
17032
|
nodeLabel: input.nodeLabel ?? input.nodeId
|
|
16753
17033
|
});
|
|
16754
17034
|
}, []);
|
|
16755
|
-
const openForService =
|
|
17035
|
+
const openForService = useCallback22((input) => {
|
|
16756
17036
|
setSurfaceError(null);
|
|
16757
17037
|
setSessionId((current) => current + 1);
|
|
16758
17038
|
setLaunch({
|
|
@@ -16761,7 +17041,7 @@ function FallbackEditorModalProvider({ children }) {
|
|
|
16761
17041
|
serviceName: input.serviceName
|
|
16762
17042
|
});
|
|
16763
17043
|
}, []);
|
|
16764
|
-
const persistProps =
|
|
17044
|
+
const persistProps = useCallback22(
|
|
16765
17045
|
(label, mutate) => {
|
|
16766
17046
|
const editorAny = canvas.api.editor;
|
|
16767
17047
|
if (typeof editorAny.transact !== "function" || typeof editorAny.replaceProps !== "function") {
|
|
@@ -16775,7 +17055,7 @@ function FallbackEditorModalProvider({ children }) {
|
|
|
16775
17055
|
},
|
|
16776
17056
|
[canvas.api.builder, canvas.api.editor, canvas.props]
|
|
16777
17057
|
);
|
|
16778
|
-
const handleSave =
|
|
17058
|
+
const handleSave = useCallback22(
|
|
16779
17059
|
async (nextFallbacks) => {
|
|
16780
17060
|
setSurfaceError(null);
|
|
16781
17061
|
try {
|
|
@@ -16792,7 +17072,7 @@ function FallbackEditorModalProvider({ children }) {
|
|
|
16792
17072
|
},
|
|
16793
17073
|
[close, persistProps]
|
|
16794
17074
|
);
|
|
16795
|
-
const handleSettingsChange =
|
|
17075
|
+
const handleSettingsChange = useCallback22(
|
|
16796
17076
|
async (nextSettings) => {
|
|
16797
17077
|
setSurfaceError(null);
|
|
16798
17078
|
try {
|
|
@@ -16827,7 +17107,7 @@ function FallbackEditorModalProvider({ children }) {
|
|
|
16827
17107
|
() => canvas.props?.fallbackSettings ?? {},
|
|
16828
17108
|
[canvas.props]
|
|
16829
17109
|
);
|
|
16830
|
-
|
|
17110
|
+
useEffect25(() => {
|
|
16831
17111
|
if (!launch) return;
|
|
16832
17112
|
const onKeyDown = (event) => {
|
|
16833
17113
|
if (event.key === "Escape") close();
|
|
@@ -16899,7 +17179,7 @@ function useFallbackEditorModal() {
|
|
|
16899
17179
|
|
|
16900
17180
|
// src/workspace/bottom-panel/index.tsx
|
|
16901
17181
|
import { useCanvas as useCanvas22, useWorkspace as useWorkspace15 } from "@timeax/digital-service-engine/workspace";
|
|
16902
|
-
import { useCallback as
|
|
17182
|
+
import { useCallback as useCallback23, useEffect as useEffect28, useMemo as useMemo41, useRef as useRef15, useState as useState42 } from "react";
|
|
16903
17183
|
import { FiEye as FiEye3, FiEyeOff as FiEyeOff2, FiSearch, FiTerminal as FiTerminal2, FiX as FiX6 } from "react-icons/fi";
|
|
16904
17184
|
import { LuGripHorizontal, LuLayers3 } from "react-icons/lu";
|
|
16905
17185
|
import { MdOutlineSync } from "react-icons/md";
|
|
@@ -17353,8 +17633,8 @@ function LogCard({ row, onRemove }) {
|
|
|
17353
17633
|
}
|
|
17354
17634
|
|
|
17355
17635
|
// src/workspace/bottom-panel/service-picker-dialog.tsx
|
|
17356
|
-
import { InputField as
|
|
17357
|
-
import { useEffect as
|
|
17636
|
+
import { InputField as InputField22 } from "@timeax/form-palette";
|
|
17637
|
+
import { useEffect as useEffect26, useMemo as useMemo40, useRef as useRef14, useState as useState40 } from "react";
|
|
17358
17638
|
import { createPortal as createPortal5 } from "react-dom";
|
|
17359
17639
|
|
|
17360
17640
|
// src/workspace/bottom-panel/service-picker.ts
|
|
@@ -17485,13 +17765,13 @@ function ServicePickerDialog({
|
|
|
17485
17765
|
}) {
|
|
17486
17766
|
const [filters, setFilters] = useState40(() => createDefaultServicePickerFilters());
|
|
17487
17767
|
const [selectedIds, setSelectedIds] = useState40(/* @__PURE__ */ new Set());
|
|
17488
|
-
const selectAllRef =
|
|
17489
|
-
|
|
17768
|
+
const selectAllRef = useRef14(null);
|
|
17769
|
+
useEffect26(() => {
|
|
17490
17770
|
if (!open) return;
|
|
17491
17771
|
setFilters(createDefaultServicePickerFilters());
|
|
17492
17772
|
setSelectedIds(/* @__PURE__ */ new Set());
|
|
17493
17773
|
}, [open]);
|
|
17494
|
-
|
|
17774
|
+
useEffect26(() => {
|
|
17495
17775
|
if (!open) return;
|
|
17496
17776
|
const onKeyDown = (event) => {
|
|
17497
17777
|
if (event.key === "Escape") onOpenChange(false);
|
|
@@ -17524,7 +17804,7 @@ function ServicePickerDialog({
|
|
|
17524
17804
|
const partiallyFilteredSelected = filteredSelectedCount > 0 && filteredSelectedCount < filteredServiceIds.length;
|
|
17525
17805
|
const selectedCount = selectedIds.size;
|
|
17526
17806
|
const canConfirm = selectedCount > 0;
|
|
17527
|
-
|
|
17807
|
+
useEffect26(() => {
|
|
17528
17808
|
if (!selectAllRef.current) return;
|
|
17529
17809
|
selectAllRef.current.indeterminate = partiallyFilteredSelected;
|
|
17530
17810
|
}, [partiallyFilteredSelected]);
|
|
@@ -17548,7 +17828,7 @@ function ServicePickerDialog({
|
|
|
17548
17828
|
/* @__PURE__ */ jsxs63("div", { className: "grid h-full min-h-0 flex-1 overflow-hidden md:grid-cols-[18rem_minmax(0,1fr)]", children: [
|
|
17549
17829
|
/* @__PURE__ */ jsx85("div", { className: "min-h-0 border-r border-slate-200 dark:border-slate-800", children: /* @__PURE__ */ jsx85(ScrollArea, { className: "h-full min-h-0", children: /* @__PURE__ */ jsxs63("div", { className: "space-y-4 p-4", children: [
|
|
17550
17830
|
/* @__PURE__ */ jsx85(FilterField, { label: "Search", children: /* @__PURE__ */ jsx85(
|
|
17551
|
-
|
|
17831
|
+
InputField22,
|
|
17552
17832
|
{
|
|
17553
17833
|
variant: "text",
|
|
17554
17834
|
label: "Picker search",
|
|
@@ -17559,7 +17839,7 @@ function ServicePickerDialog({
|
|
|
17559
17839
|
}
|
|
17560
17840
|
) }),
|
|
17561
17841
|
/* @__PURE__ */ jsx85(FilterField, { label: "Category", children: /* @__PURE__ */ jsx85(
|
|
17562
|
-
|
|
17842
|
+
InputField22,
|
|
17563
17843
|
{
|
|
17564
17844
|
variant: "select",
|
|
17565
17845
|
label: "Category filter",
|
|
@@ -17570,7 +17850,7 @@ function ServicePickerDialog({
|
|
|
17570
17850
|
}
|
|
17571
17851
|
) }),
|
|
17572
17852
|
/* @__PURE__ */ jsx85(FilterField, { label: "Flag", children: /* @__PURE__ */ jsx85(
|
|
17573
|
-
|
|
17853
|
+
InputField22,
|
|
17574
17854
|
{
|
|
17575
17855
|
variant: "select",
|
|
17576
17856
|
label: "Flag filter",
|
|
@@ -17581,7 +17861,7 @@ function ServicePickerDialog({
|
|
|
17581
17861
|
}
|
|
17582
17862
|
) }),
|
|
17583
17863
|
/* @__PURE__ */ jsx85(FilterField, { label: "Activity", children: /* @__PURE__ */ jsx85(
|
|
17584
|
-
|
|
17864
|
+
InputField22,
|
|
17585
17865
|
{
|
|
17586
17866
|
variant: "select",
|
|
17587
17867
|
label: "Activity filter",
|
|
@@ -17599,7 +17879,7 @@ function ServicePickerDialog({
|
|
|
17599
17879
|
) }),
|
|
17600
17880
|
/* @__PURE__ */ jsxs63("div", { className: "grid grid-cols-2 gap-2", children: [
|
|
17601
17881
|
/* @__PURE__ */ jsx85(FilterField, { label: "Min rate", children: /* @__PURE__ */ jsx85(
|
|
17602
|
-
|
|
17882
|
+
InputField22,
|
|
17603
17883
|
{
|
|
17604
17884
|
variant: "number",
|
|
17605
17885
|
label: "Minimum rate filter",
|
|
@@ -17610,7 +17890,7 @@ function ServicePickerDialog({
|
|
|
17610
17890
|
}
|
|
17611
17891
|
) }),
|
|
17612
17892
|
/* @__PURE__ */ jsx85(FilterField, { label: "Max rate", children: /* @__PURE__ */ jsx85(
|
|
17613
|
-
|
|
17893
|
+
InputField22,
|
|
17614
17894
|
{
|
|
17615
17895
|
variant: "number",
|
|
17616
17896
|
label: "Maximum rate filter",
|
|
@@ -17623,7 +17903,7 @@ function ServicePickerDialog({
|
|
|
17623
17903
|
] }),
|
|
17624
17904
|
/* @__PURE__ */ jsx85(FilterField, { label: "Name keyword", children: /* @__PURE__ */ jsxs63("div", { className: "space-y-2", children: [
|
|
17625
17905
|
/* @__PURE__ */ jsx85(
|
|
17626
|
-
|
|
17906
|
+
InputField22,
|
|
17627
17907
|
{
|
|
17628
17908
|
variant: "select",
|
|
17629
17909
|
label: "Keyword mode",
|
|
@@ -17639,7 +17919,7 @@ function ServicePickerDialog({
|
|
|
17639
17919
|
}
|
|
17640
17920
|
),
|
|
17641
17921
|
/* @__PURE__ */ jsx85(
|
|
17642
|
-
|
|
17922
|
+
InputField22,
|
|
17643
17923
|
{
|
|
17644
17924
|
variant: "text",
|
|
17645
17925
|
label: "Keyword filter",
|
|
@@ -17651,7 +17931,7 @@ function ServicePickerDialog({
|
|
|
17651
17931
|
)
|
|
17652
17932
|
] }) }),
|
|
17653
17933
|
/* @__PURE__ */ jsx85(FilterField, { label: "Meta key", children: /* @__PURE__ */ jsx85(
|
|
17654
|
-
|
|
17934
|
+
InputField22,
|
|
17655
17935
|
{
|
|
17656
17936
|
variant: "select",
|
|
17657
17937
|
label: "Meta key filter",
|
|
@@ -17666,7 +17946,7 @@ function ServicePickerDialog({
|
|
|
17666
17946
|
}
|
|
17667
17947
|
) }),
|
|
17668
17948
|
/* @__PURE__ */ jsx85(FilterField, { label: "Meta value", children: /* @__PURE__ */ jsx85(
|
|
17669
|
-
|
|
17949
|
+
InputField22,
|
|
17670
17950
|
{
|
|
17671
17951
|
variant: "select",
|
|
17672
17952
|
label: "Meta value filter",
|
|
@@ -17837,8 +18117,8 @@ function toPickerSelectOptions(values) {
|
|
|
17837
18117
|
}
|
|
17838
18118
|
|
|
17839
18119
|
// src/workspace/bottom-panel/services-split-pane.tsx
|
|
17840
|
-
import { InputField as
|
|
17841
|
-
import { useEffect as
|
|
18120
|
+
import { InputField as InputField23 } from "@timeax/form-palette";
|
|
18121
|
+
import { useEffect as useEffect27, useState as useState41 } from "react";
|
|
17842
18122
|
import { FaFolderOpen as FaFolderOpen2 } from "react-icons/fa";
|
|
17843
18123
|
import { FiEdit2, FiFilter as FiFilter2, FiFolderPlus, FiPlus as FiPlus2, FiTrash2 as FiTrash22 } from "react-icons/fi";
|
|
17844
18124
|
|
|
@@ -18186,7 +18466,7 @@ function CatalogContextPopover({
|
|
|
18186
18466
|
/* @__PURE__ */ jsxs65("div", { className: "space-y-2 rounded-2xl border border-slate-200 bg-slate-50/70 p-3 dark:border-slate-800 dark:bg-slate-900/40", children: [
|
|
18187
18467
|
/* @__PURE__ */ jsx87("div", { className: "text-xs font-semibold tracking-[0.16em] text-slate-500 uppercase dark:text-slate-400", children: "Rate compatibility mode" }),
|
|
18188
18468
|
/* @__PURE__ */ jsx87(
|
|
18189
|
-
|
|
18469
|
+
InputField23,
|
|
18190
18470
|
{
|
|
18191
18471
|
variant: "radio",
|
|
18192
18472
|
value: rateContextMode,
|
|
@@ -18208,7 +18488,7 @@ function CatalogContextPopover({
|
|
|
18208
18488
|
),
|
|
18209
18489
|
rateContextMode === "custom_primary_rate" ? /* @__PURE__ */ jsxs65("div", { className: "space-y-2 rounded-xl border border-slate-200 bg-white p-2 dark:border-slate-700 dark:bg-slate-950/40", children: [
|
|
18210
18490
|
/* @__PURE__ */ jsx87(
|
|
18211
|
-
|
|
18491
|
+
InputField23,
|
|
18212
18492
|
{
|
|
18213
18493
|
variant: "radio",
|
|
18214
18494
|
value: rateContextSource,
|
|
@@ -18221,7 +18501,7 @@ function CatalogContextPopover({
|
|
|
18221
18501
|
}
|
|
18222
18502
|
),
|
|
18223
18503
|
rateContextSource === "service" ? /* @__PURE__ */ jsx87(
|
|
18224
|
-
|
|
18504
|
+
InputField23,
|
|
18225
18505
|
{
|
|
18226
18506
|
variant: "select",
|
|
18227
18507
|
label: "Primary context service",
|
|
@@ -18231,7 +18511,7 @@ function CatalogContextPopover({
|
|
|
18231
18511
|
placeholder: "Select service"
|
|
18232
18512
|
}
|
|
18233
18513
|
) : /* @__PURE__ */ jsx87(
|
|
18234
|
-
|
|
18514
|
+
InputField23,
|
|
18235
18515
|
{
|
|
18236
18516
|
variant: "number",
|
|
18237
18517
|
label: "Primary rate",
|
|
@@ -18422,7 +18702,7 @@ function CatalogToolbar({
|
|
|
18422
18702
|
/* @__PURE__ */ jsx87(ToolbarIconButton, { label: "Assign services to selected group", disabled: !selectedGroupId, onClick: onAssignServices, children: /* @__PURE__ */ jsx87(FiPlus2, {}) })
|
|
18423
18703
|
] }),
|
|
18424
18704
|
/* @__PURE__ */ jsx87(
|
|
18425
|
-
|
|
18705
|
+
InputField23,
|
|
18426
18706
|
{
|
|
18427
18707
|
variant: "treeselect",
|
|
18428
18708
|
mode: "button",
|
|
@@ -18453,7 +18733,7 @@ function GroupInputPopoverButton({
|
|
|
18453
18733
|
}) {
|
|
18454
18734
|
const [open, setOpen] = useState41(false);
|
|
18455
18735
|
const [value, setValue] = useState41(initialValue);
|
|
18456
|
-
|
|
18736
|
+
useEffect27(() => {
|
|
18457
18737
|
if (open) setValue(initialValue);
|
|
18458
18738
|
}, [initialValue, open]);
|
|
18459
18739
|
return /* @__PURE__ */ jsxs65(Popover, { open, onOpenChange: setOpen, children: [
|
|
@@ -18477,7 +18757,7 @@ function GroupInputPopoverButton({
|
|
|
18477
18757
|
/* @__PURE__ */ jsx87("p", { className: "mt-1 text-xs text-slate-500 dark:text-slate-400", children: "Names are editor-side catalog labels only." })
|
|
18478
18758
|
] }),
|
|
18479
18759
|
/* @__PURE__ */ jsx87(
|
|
18480
|
-
|
|
18760
|
+
InputField23,
|
|
18481
18761
|
{
|
|
18482
18762
|
variant: "text",
|
|
18483
18763
|
label: title,
|
|
@@ -18638,15 +18918,15 @@ function BottomConsolePanel({ controller, errors, activeServices, allServices, o
|
|
|
18638
18918
|
logs: { minimized: false, closed: false },
|
|
18639
18919
|
notices: { minimized: false, closed: false }
|
|
18640
18920
|
});
|
|
18641
|
-
const lastHighlightedIdsRef =
|
|
18642
|
-
const panelContainerRef =
|
|
18643
|
-
const panelRef =
|
|
18644
|
-
const searchInputRef =
|
|
18645
|
-
const dragStartRef =
|
|
18646
|
-
const appliedSnapshotRequestRef =
|
|
18647
|
-
const draftSnapshotRequestRef =
|
|
18648
|
-
const allChecksByIdRequestRef =
|
|
18649
|
-
const allChecksCacheRef =
|
|
18921
|
+
const lastHighlightedIdsRef = useRef15([]);
|
|
18922
|
+
const panelContainerRef = useRef15(null);
|
|
18923
|
+
const panelRef = useRef15(null);
|
|
18924
|
+
const searchInputRef = useRef15(null);
|
|
18925
|
+
const dragStartRef = useRef15(null);
|
|
18926
|
+
const appliedSnapshotRequestRef = useRef15(0);
|
|
18927
|
+
const draftSnapshotRequestRef = useRef15(0);
|
|
18928
|
+
const allChecksByIdRequestRef = useRef15(0);
|
|
18929
|
+
const allChecksCacheRef = useRef15(/* @__PURE__ */ new Map());
|
|
18650
18930
|
const selectedButtons = useMemo41(
|
|
18651
18931
|
() => (canvas.api.selection.selectedButtons?.() ?? []).map((value) => String(value)),
|
|
18652
18932
|
[canvas.api.selection, canvas.selectionInfo.ids, canvas.selectionInfo.optionIds]
|
|
@@ -18663,7 +18943,7 @@ function BottomConsolePanel({ controller, errors, activeServices, allServices, o
|
|
|
18663
18943
|
const effectiveCatalogContext = contextLinked ? liveSelectionContext : catalogContextDraft;
|
|
18664
18944
|
const [appliedSnapshot, setAppliedSnapshot] = useState42(() => createEmptyServiceContextSnapshot(effectiveCatalogContext, canvas.props));
|
|
18665
18945
|
const [draftSnapshot, setDraftSnapshot] = useState42(() => createEmptyServiceContextSnapshot(catalogContextDraft, canvas.props));
|
|
18666
|
-
|
|
18946
|
+
useEffect28(() => {
|
|
18667
18947
|
const requestId = ++appliedSnapshotRequestRef.current;
|
|
18668
18948
|
const fallback = createEmptyServiceContextSnapshot(effectiveCatalogContext, canvas.props);
|
|
18669
18949
|
setAppliedSnapshot(fallback);
|
|
@@ -18675,7 +18955,7 @@ function BottomConsolePanel({ controller, errors, activeServices, allServices, o
|
|
|
18675
18955
|
setAppliedSnapshot(fallback);
|
|
18676
18956
|
});
|
|
18677
18957
|
}, [canvas.props, effectiveCatalogContext, servicesMap]);
|
|
18678
|
-
|
|
18958
|
+
useEffect28(() => {
|
|
18679
18959
|
const requestId = ++draftSnapshotRequestRef.current;
|
|
18680
18960
|
const fallback = createEmptyServiceContextSnapshot(catalogContextDraft, canvas.props);
|
|
18681
18961
|
setDraftSnapshot(fallback);
|
|
@@ -18710,11 +18990,11 @@ function BottomConsolePanel({ controller, errors, activeServices, allServices, o
|
|
|
18710
18990
|
if (rateContextSource === "manual") return parsedManualPrimaryRate != null;
|
|
18711
18991
|
return Boolean(primaryServiceId);
|
|
18712
18992
|
}, [parsedManualPrimaryRate, primaryServiceId, rateContextMode, rateContextSource]);
|
|
18713
|
-
|
|
18993
|
+
useEffect28(() => {
|
|
18714
18994
|
if (primaryServiceId && contextServiceOptions.some((option) => option.value === primaryServiceId)) return;
|
|
18715
18995
|
setPrimaryServiceId(contextServiceOptions[0]?.value ?? null);
|
|
18716
18996
|
}, [contextServiceOptions, primaryServiceId]);
|
|
18717
|
-
|
|
18997
|
+
useEffect28(() => {
|
|
18718
18998
|
const requestId = ++allChecksByIdRequestRef.current;
|
|
18719
18999
|
if (!appliedSnapshot.selectedTag) {
|
|
18720
19000
|
setAllChecksById(/* @__PURE__ */ new Map());
|
|
@@ -18805,18 +19085,18 @@ function BottomConsolePanel({ controller, errors, activeServices, allServices, o
|
|
|
18805
19085
|
servicesMap
|
|
18806
19086
|
]
|
|
18807
19087
|
);
|
|
18808
|
-
|
|
19088
|
+
useEffect28(() => {
|
|
18809
19089
|
const next = createDefaultServiceContext(canvas.props, preferredTagId);
|
|
18810
19090
|
setCatalogContextDraft((current) => {
|
|
18811
19091
|
if (contextLinked) return current;
|
|
18812
19092
|
return current.selectedTagId ? current : next;
|
|
18813
19093
|
});
|
|
18814
19094
|
}, [canvas.props, contextLinked, preferredTagId]);
|
|
18815
|
-
|
|
19095
|
+
useEffect28(() => {
|
|
18816
19096
|
if (!contextLinked) return;
|
|
18817
19097
|
setCatalogContextDraft(liveSelectionContext);
|
|
18818
19098
|
}, [contextLinked, liveSelectionContext]);
|
|
18819
|
-
|
|
19099
|
+
useEffect28(() => {
|
|
18820
19100
|
if (contextLinked) return;
|
|
18821
19101
|
const next = sanitizeServiceContext(draftSnapshot, catalogContextDraft);
|
|
18822
19102
|
if (!areServiceContextStatesEqual(next, catalogContextDraft)) {
|
|
@@ -18852,24 +19132,24 @@ function BottomConsolePanel({ controller, errors, activeServices, allServices, o
|
|
|
18852
19132
|
return ids;
|
|
18853
19133
|
}, [canvas.activeId, canvas.selectionInfo.ids]);
|
|
18854
19134
|
const consoleIssueCount = errors.validation.length + errors.logs.length + notices.length;
|
|
18855
|
-
|
|
19135
|
+
useEffect28(() => {
|
|
18856
19136
|
setSelectedActiveServiceId((current) => ensureSelectedRow(current, activeRows));
|
|
18857
19137
|
}, [activeRows]);
|
|
18858
|
-
|
|
19138
|
+
useEffect28(() => {
|
|
18859
19139
|
if (catalogState?.selectedServiceId == null) return;
|
|
18860
19140
|
setSelectedAllServiceId(String(catalogState.selectedServiceId));
|
|
18861
19141
|
}, [catalogState?.selectedServiceId]);
|
|
18862
|
-
|
|
19142
|
+
useEffect28(() => {
|
|
18863
19143
|
setSelectedAllServiceId((current) => ensureSelectedRow(current, visibleAllRows));
|
|
18864
19144
|
}, [visibleAllRows]);
|
|
18865
|
-
|
|
19145
|
+
useEffect28(() => {
|
|
18866
19146
|
const desiredIds = controller.isOpen && controller.activeTab === "activeServices" && selectedActiveServiceId ? activeRows.find((row) => row.id === selectedActiveServiceId)?.summary.attachedNodeIds ?? [] : [];
|
|
18867
19147
|
if (!sameIds(lastHighlightedIdsRef.current, desiredIds)) {
|
|
18868
19148
|
canvas.api.setHighlighted(desiredIds);
|
|
18869
19149
|
lastHighlightedIdsRef.current = [...desiredIds];
|
|
18870
19150
|
}
|
|
18871
19151
|
}, [activeRows, canvas.api, controller.activeTab, controller.isOpen, selectedActiveServiceId]);
|
|
18872
|
-
|
|
19152
|
+
useEffect28(() => {
|
|
18873
19153
|
return () => {
|
|
18874
19154
|
if (lastHighlightedIdsRef.current.length) {
|
|
18875
19155
|
canvas.api.setHighlighted([]);
|
|
@@ -18877,10 +19157,10 @@ function BottomConsolePanel({ controller, errors, activeServices, allServices, o
|
|
|
18877
19157
|
}
|
|
18878
19158
|
};
|
|
18879
19159
|
}, [canvas.api]);
|
|
18880
|
-
|
|
19160
|
+
useEffect28(() => {
|
|
18881
19161
|
if (searchOpen) searchInputRef.current?.focus();
|
|
18882
19162
|
}, [searchOpen]);
|
|
18883
|
-
|
|
19163
|
+
useEffect28(() => {
|
|
18884
19164
|
setPanelPosition((current) => {
|
|
18885
19165
|
const resolved = resolvePanelPosition(current, panelRef.current, panelContainerRef.current);
|
|
18886
19166
|
persistPanelPosition(resolved);
|
|
@@ -18902,7 +19182,7 @@ function BottomConsolePanel({ controller, errors, activeServices, allServices, o
|
|
|
18902
19182
|
}
|
|
18903
19183
|
event.preventDefault();
|
|
18904
19184
|
};
|
|
18905
|
-
|
|
19185
|
+
useEffect28(() => {
|
|
18906
19186
|
if (!draggingPanel) return;
|
|
18907
19187
|
const onPointerMove = (event) => {
|
|
18908
19188
|
const start = dragStartRef.current;
|
|
@@ -18930,7 +19210,7 @@ function BottomConsolePanel({ controller, errors, activeServices, allServices, o
|
|
|
18930
19210
|
window.removeEventListener("pointercancel", onPointerUp);
|
|
18931
19211
|
};
|
|
18932
19212
|
}, [draggingPanel, panelPosition]);
|
|
18933
|
-
const setCatalogMode =
|
|
19213
|
+
const setCatalogMode = useCallback23(
|
|
18934
19214
|
(mode) => {
|
|
18935
19215
|
const editor = canvas.api.editor;
|
|
18936
19216
|
editor.ensureCatalog?.();
|
|
@@ -18938,27 +19218,27 @@ function BottomConsolePanel({ controller, errors, activeServices, allServices, o
|
|
|
18938
19218
|
},
|
|
18939
19219
|
[canvas.api.editor]
|
|
18940
19220
|
);
|
|
18941
|
-
const handleSelectCatalogService =
|
|
19221
|
+
const handleSelectCatalogService = useCallback23(
|
|
18942
19222
|
(id) => {
|
|
18943
19223
|
setSelectedAllServiceId(id);
|
|
18944
19224
|
canvas.api.editor.setSelectedCatalogService?.(id ?? void 0);
|
|
18945
19225
|
},
|
|
18946
19226
|
[canvas.api.editor]
|
|
18947
19227
|
);
|
|
18948
|
-
const handleSelectCatalogGroup =
|
|
19228
|
+
const handleSelectCatalogGroup = useCallback23(
|
|
18949
19229
|
(groupId) => {
|
|
18950
19230
|
canvas.api.editor.setActiveCatalogNode?.(groupId ?? void 0);
|
|
18951
19231
|
},
|
|
18952
19232
|
[canvas.api.editor]
|
|
18953
19233
|
);
|
|
18954
|
-
const handleCreateRootGroup =
|
|
19234
|
+
const handleCreateRootGroup = useCallback23(
|
|
18955
19235
|
(label) => {
|
|
18956
19236
|
if (!label.trim()) return;
|
|
18957
19237
|
canvas.api.editor.createCatalogGroup?.({ label: label.trim() });
|
|
18958
19238
|
},
|
|
18959
19239
|
[canvas.api.editor]
|
|
18960
19240
|
);
|
|
18961
|
-
const handleCreateChildGroup =
|
|
19241
|
+
const handleCreateChildGroup = useCallback23(
|
|
18962
19242
|
(label) => {
|
|
18963
19243
|
if (!selectedCatalogGroupId) return;
|
|
18964
19244
|
const editor = canvas.api.editor;
|
|
@@ -18967,7 +19247,7 @@ function BottomConsolePanel({ controller, errors, activeServices, allServices, o
|
|
|
18967
19247
|
},
|
|
18968
19248
|
[canvas.api.editor, selectedCatalogGroupId]
|
|
18969
19249
|
);
|
|
18970
|
-
const handleRenameGroup =
|
|
19250
|
+
const handleRenameGroup = useCallback23(
|
|
18971
19251
|
(label) => {
|
|
18972
19252
|
if (!selectedCatalogGroupId) return;
|
|
18973
19253
|
const group = catalogGroups.find((item) => item.id === selectedCatalogGroupId);
|
|
@@ -18977,15 +19257,15 @@ function BottomConsolePanel({ controller, errors, activeServices, allServices, o
|
|
|
18977
19257
|
},
|
|
18978
19258
|
[canvas.api.editor, catalogGroups, selectedCatalogGroupId]
|
|
18979
19259
|
);
|
|
18980
|
-
const handleDeleteGroup =
|
|
19260
|
+
const handleDeleteGroup = useCallback23(() => {
|
|
18981
19261
|
if (!selectedCatalogGroupId) return;
|
|
18982
19262
|
canvas.api.editor.removeCatalogNode?.(selectedCatalogGroupId, { cascade: true });
|
|
18983
19263
|
}, [canvas.api.editor, selectedCatalogGroupId]);
|
|
18984
|
-
const handleAssignServices =
|
|
19264
|
+
const handleAssignServices = useCallback23(() => {
|
|
18985
19265
|
if (!selectedCatalogGroupId) return;
|
|
18986
19266
|
setServicePickerOpen(true);
|
|
18987
19267
|
}, [selectedCatalogGroupId]);
|
|
18988
|
-
const handleConfirmAssignServices =
|
|
19268
|
+
const handleConfirmAssignServices = useCallback23(
|
|
18989
19269
|
(serviceIds) => {
|
|
18990
19270
|
if (!selectedCatalogGroupId || !serviceIds.length) return;
|
|
18991
19271
|
canvas.api.editor.assignServicesToCatalogGroup?.(selectedCatalogGroupId, serviceIds, "append");
|
|
@@ -58702,10 +58982,29 @@ var workspaceBackend = {
|
|
|
58702
58982
|
},
|
|
58703
58983
|
templates: {
|
|
58704
58984
|
...baseBackend.templates,
|
|
58985
|
+
list: async (params) => {
|
|
58986
|
+
const listResult = await baseBackend.templates.list(params);
|
|
58987
|
+
console.log(listResult, "this is the list result from the base backend");
|
|
58988
|
+
if (!listResult.ok) return listResult;
|
|
58989
|
+
const branchId = params.branchId;
|
|
58990
|
+
if (!branchId) return listResult;
|
|
58991
|
+
const merged = listResult.value.filter((template) => template.branchId == null || template.branchId === branchId);
|
|
58992
|
+
return { ok: true, value: merged };
|
|
58993
|
+
},
|
|
58994
|
+
refresh: async (params) => {
|
|
58995
|
+
console.log("this is being refreshed...", params, await baseBackend.templates.list(params));
|
|
58996
|
+
const refreshResult = await baseBackend.templates.refresh(params);
|
|
58997
|
+
if (!refreshResult.ok) return refreshResult;
|
|
58998
|
+
const branchId = params.branchId;
|
|
58999
|
+
if (!branchId) return refreshResult;
|
|
59000
|
+
const merged = refreshResult.value.filter((template) => template.branchId == null || template.branchId === branchId);
|
|
59001
|
+
return { ok: true, value: merged };
|
|
59002
|
+
},
|
|
58705
59003
|
create: async (workspaceId, input) => {
|
|
58706
|
-
const
|
|
59004
|
+
const branchId = input.branchId ?? void 0;
|
|
59005
|
+
const check = await authorize("template-write", branchId);
|
|
58707
59006
|
if (!check.ok) return check;
|
|
58708
|
-
return baseBackend.templates.create(workspaceId, input);
|
|
59007
|
+
return baseBackend.templates.create(workspaceId, { ...input, branchId });
|
|
58709
59008
|
},
|
|
58710
59009
|
update: async (id, patch) => {
|
|
58711
59010
|
const check = await authorize("template-write", patch.branchId ?? void 0);
|
|
@@ -58713,9 +59012,10 @@ var workspaceBackend = {
|
|
|
58713
59012
|
return baseBackend.templates.update(id, patch);
|
|
58714
59013
|
},
|
|
58715
59014
|
clone: async (source, options) => {
|
|
58716
|
-
const
|
|
59015
|
+
const branchId = options?.branchId ?? void 0;
|
|
59016
|
+
const check = await authorize("template-write", branchId);
|
|
58717
59017
|
if (!check.ok) return check;
|
|
58718
|
-
return baseBackend.templates.clone(source, options);
|
|
59018
|
+
return baseBackend.templates.clone(source, { ...options, branchId });
|
|
58719
59019
|
},
|
|
58720
59020
|
publish: async (id) => {
|
|
58721
59021
|
const check = await authorize("template-write", void 0);
|
|
@@ -58729,6 +59029,7 @@ var workspaceBackend = {
|
|
|
58729
59029
|
},
|
|
58730
59030
|
delete: async (id) => {
|
|
58731
59031
|
const check = await authorize("template-write", void 0);
|
|
59032
|
+
console.log("This is a delete action...");
|
|
58732
59033
|
if (!check.ok) return check;
|
|
58733
59034
|
return baseBackend.templates.delete(id);
|
|
58734
59035
|
}
|