@arronqzy/react-view 1.0.12 → 1.0.14

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.
Files changed (31) hide show
  1. package/dist/styles.css +96 -4
  2. package/package.json +8 -7
  3. package/src/panel/ReactViewOnlinePreview.tsx +72 -20
  4. package/src/panel/ReactViewPanel.tsx +238 -126
  5. package/src/panel/ai/applyAssistantAction.ts +1 -0
  6. package/src/panel/components/BusyOverlay.tsx +25 -0
  7. package/src/panel/components/ElementsLayer.tsx +110 -68
  8. package/src/panel/components/MaterialSidebar.tsx +15 -0
  9. package/src/panel/components/MoveableLayer.tsx +8 -0
  10. package/src/panel/components/PanelCanvas.tsx +3 -0
  11. package/src/panel/components/PanelConfigSidebar.tsx +582 -443
  12. package/src/panel/components/SelectLayer.tsx +5 -0
  13. package/src/panel/components/WorkspaceConfigSidebar.tsx +9 -0
  14. package/src/panel/components/WorkspaceProjectNav.tsx +27 -4
  15. package/src/panel/components/config/PanelConfigScene3dSection.tsx +874 -0
  16. package/src/panel/components/scope-config/ScopeTemplateAutocompleteHost.tsx +1 -2
  17. package/src/panel/components/table/PanelConfigTableSection.tsx +82 -50
  18. package/src/panel/components/table/TableNodeContent.tsx +40 -15
  19. package/src/panel/hooks/usePanelElements.ts +13 -1
  20. package/src/panel/hooks/useWorkspaceProjects.ts +133 -66
  21. package/src/panel/library/workspace-project-cache.ts +8 -2
  22. package/src/panel/library/workspace-project-db.ts +29 -11
  23. package/src/panel/library/workspace-snapshot.ts +21 -4
  24. package/src/panel/scope/view-scope-store.ts +8 -0
  25. package/src/panel/types.ts +4 -3
  26. package/src/panel/utils/async-work.ts +178 -0
  27. package/src/panel/utils/chartOptionBuilder.ts +7 -1
  28. package/src/panel/utils/gridPlacement.ts +29 -0
  29. package/src/panel/utils/outputScale.ts +69 -0
  30. package/src/panel/utils/panelElementDefaults.ts +37 -2
  31. package/src/panel/utils/scope-autocomplete.ts +0 -114
@@ -67,6 +67,7 @@ export function SelectLayer({
67
67
  // 只允许左键触发框选,右键不参与选区变更
68
68
  if (input && input.button !== 0) return false;
69
69
  const target = (input?.target as HTMLElement | null) ?? null;
70
+ if (target?.closest("[data-scene3d-orbit-active='true']")) return false;
70
71
  const isShift = !!input?.shiftKey;
71
72
  if (isShift) return true;
72
73
 
@@ -95,6 +96,10 @@ export function SelectLayer({
95
96
  }
96
97
  // 已有多选时,默认应该是拖动移动;只有按住 shift 才继续框选/追加
97
98
  const target = e.inputEvent.target as HTMLElement | null;
99
+ if (target?.closest("[data-scene3d-orbit-active='true']")) {
100
+ e.stop();
101
+ return;
102
+ }
98
103
  const selectable = target?.closest(".rv-selectable") as HTMLElement | null;
99
104
  const id = selectable?.dataset.elementId;
100
105
  const isShift = (e.inputEvent as MouseEvent | undefined)?.shiftKey ?? false;
@@ -4,6 +4,7 @@ import { useI18n } from "@arronqzy/i18n/react";
4
4
  import {
5
5
  BlueprintExecutionLogPanel,
6
6
  BlueprintNodeConfigSidebar,
7
+ type BlueprintGraphEdge,
7
8
  type BlueprintGraphNode,
8
9
  type ExecutionLogSettings,
9
10
  type ExecutionTraceEntry,
@@ -41,6 +42,8 @@ export type WorkspaceConfigSidebarProps = Omit<
41
42
  configFocus: WorkspaceConfigFocus;
42
43
  executionLog?: BlueprintExecutionLogViewProps;
43
44
  selectedBlueprintNode: BlueprintGraphNode | null;
45
+ blueprintGraphNodes?: BlueprintGraphNode[];
46
+ blueprintGraphEdges?: BlueprintGraphEdge[];
44
47
  allowFalseSignalPropagation?: boolean;
45
48
  onUpdateAllowFalseSignalPropagation?: (value: boolean) => void;
46
49
  onUpdateBlueprintNode: (
@@ -61,6 +64,7 @@ export type WorkspaceConfigSidebarProps = Omit<
61
64
  | "jsonConfig"
62
65
  | "logicConfig"
63
66
  | "clockConfig"
67
+ | "eventConfig"
64
68
  >
65
69
  >
66
70
  ) => void;
@@ -74,6 +78,8 @@ export function WorkspaceConfigSidebar({
74
78
  configFocus,
75
79
  executionLog,
76
80
  selectedBlueprintNode,
81
+ blueprintGraphNodes = [],
82
+ blueprintGraphEdges = [],
77
83
  allowFalseSignalPropagation = false,
78
84
  onUpdateAllowFalseSignalPropagation,
79
85
  onUpdateBlueprintNode,
@@ -151,6 +157,9 @@ export function WorkspaceConfigSidebar({
151
157
  return (
152
158
  <BlueprintNodeConfigSidebar
153
159
  node={selectedBlueprintNode}
160
+ graphNodes={blueprintGraphNodes}
161
+ graphEdges={blueprintGraphEdges}
162
+ traceEntries={executionLog?.entries}
154
163
  allowFalseSignalPropagation={allowFalseSignalPropagation}
155
164
  onUpdateAllowFalseSignalPropagation={onUpdateAllowFalseSignalPropagation}
156
165
  viewElementOptions={viewElementOptions}
@@ -35,6 +35,7 @@ export type WorkspaceProjectNavProps = {
35
35
  activeProjectId: string | null;
36
36
  activeProjectName: string | null;
37
37
  dirty: boolean;
38
+ previewingProjectIds?: string[];
38
39
  onCreateProject: () => Promise<{ name: string; id: string } | void>;
39
40
  onOpenProject: (id: string) => Promise<void>;
40
41
  onSyncProject: () => Promise<string | void>;
@@ -47,6 +48,7 @@ export function WorkspaceProjectNav({
47
48
  activeProjectId,
48
49
  activeProjectName,
49
50
  dirty,
51
+ previewingProjectIds = [],
50
52
  onCreateProject,
51
53
  onOpenProject,
52
54
  onSyncProject,
@@ -136,14 +138,22 @@ export function WorkspaceProjectNav({
136
138
  {projects.length === 0 ? (
137
139
  <DropdownMenuItem disabled>{t("panel.workspace.noSavedWorkspaces")}</DropdownMenuItem>
138
140
  ) : (
139
- projects.map((project) => (
141
+ projects.map((project) => {
142
+ const isCurrent = activeProjectId === project.id;
143
+ const isPreviewing = previewingProjectIds.includes(project.id);
144
+ return (
140
145
  <div key={project.id} className="px-1 py-0.5">
141
146
  <div className="flex items-center gap-1">
142
147
  <button
143
148
  type="button"
144
149
  className={[
145
150
  "min-w-0 flex-1 rounded px-2 py-1.5 text-left text-xs hover:bg-accent",
146
- activeProjectId === project.id ? "bg-accent/60 font-medium" : "",
151
+ isCurrent
152
+ ? "bg-primary/15 font-medium text-primary ring-1 ring-inset ring-primary/40"
153
+ : "",
154
+ !isCurrent && isPreviewing
155
+ ? "bg-sky-500/10 ring-1 ring-inset ring-sky-400/50"
156
+ : "",
147
157
  ].join(" ")}
148
158
  onClick={() =>
149
159
  void runAction(async () => {
@@ -151,7 +161,19 @@ export function WorkspaceProjectNav({
151
161
  })
152
162
  }
153
163
  >
154
- <div className="truncate">{project.name}</div>
164
+ <div className="flex items-center gap-1">
165
+ <div className="min-w-0 flex-1 truncate">{project.name}</div>
166
+ {isCurrent ? (
167
+ <span className="shrink-0 rounded bg-primary px-1 py-px text-[9px] leading-none text-primary-foreground">
168
+ {t("panel.workspace.currentBadge")}
169
+ </span>
170
+ ) : null}
171
+ {isPreviewing ? (
172
+ <span className="shrink-0 rounded bg-sky-600 px-1 py-px text-[9px] leading-none text-white">
173
+ {t("panel.workspace.previewingBadge")}
174
+ </span>
175
+ ) : null}
176
+ </div>
155
177
  <div className="truncate text-[10px] text-muted-foreground">
156
178
  {formatUpdatedAt(project.updatedAt)}
157
179
  </div>
@@ -182,7 +204,8 @@ export function WorkspaceProjectNav({
182
204
  </Button>
183
205
  </div>
184
206
  </div>
185
- ))
207
+ );
208
+ })
186
209
  )}
187
210
  {/* <DropdownMenuSeparator />
188
211
  <DropdownMenuItem onClick={() => void runAction(onCreateProject)}>