@arronqzy/react-blueprint 1.0.18 → 1.0.19

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arronqzy/react-blueprint",
3
- "version": "1.0.18",
3
+ "version": "1.0.19",
4
4
  "description": "",
5
5
  "files": [
6
6
  "index.ts",
@@ -18,10 +18,10 @@
18
18
  "dayjs": "^1.11.13",
19
19
  "react-dom": "^19",
20
20
  "@xyflow/react": "^12.9.3",
21
- "@arronqzy/i18n": "0.1.13",
22
- "@arronqzy/ui": "1.0.9",
23
21
  "@arronqzy/blueprint-dsl": "1.0.15",
24
- "@arronqzy/react-rx-store": "1.1.8"
22
+ "@arronqzy/react-rx-store": "1.1.8",
23
+ "@arronqzy/ui": "1.0.9",
24
+ "@arronqzy/i18n": "0.1.15"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@types/react": "^19.0.1",
@@ -34,8 +34,8 @@
34
34
  "eslint": "^8.57.0",
35
35
  "typescript": "^5.5.4",
36
36
  "vite": "^5.1.4",
37
- "@arronqzy/eslint-config": "0.0.0",
38
37
  "@arronqzy/tailwind": "1.0.2",
38
+ "@arronqzy/eslint-config": "0.0.0",
39
39
  "@arronqzy/typescript-config": "1.0.0"
40
40
  },
41
41
  "keywords": [],
@@ -1,5 +1,5 @@
1
1
  import { useEffect, useRef } from "react";
2
- import { useI18n } from "@arronqzy/i18n/react";
2
+ import { useI18nOptional as useI18n } from "@arronqzy/i18n/react";
3
3
 
4
4
  export type BlueprintContextMenuState =
5
5
  | {
@@ -16,7 +16,7 @@ import {
16
16
  type PageLifecyclePhase,
17
17
  type ViewEventType,
18
18
  } from "@arronqzy/blueprint-dsl";
19
- import { useI18n } from "@arronqzy/i18n/react";
19
+ import { EnsureI18nProvider, useI18nOptional as useI18n } from "@arronqzy/i18n/react";
20
20
 
21
21
  import { FetchNodeConfigPanel } from "./components/FetchNodeConfigPanel";
22
22
  import { ClockNodeConfigPanel } from "./components/ClockNodeConfigPanel";
@@ -96,7 +96,15 @@ const ROLE_LABEL_KEYS: Record<BlueprintNodeRole, string> = {
96
96
  event: "blueprint.config.roleEvent",
97
97
  };
98
98
 
99
- export function BlueprintNodeConfigSidebar({
99
+ export function BlueprintNodeConfigSidebar(props: BlueprintNodeConfigSidebarProps) {
100
+ return (
101
+ <EnsureI18nProvider>
102
+ <BlueprintNodeConfigSidebarInner {...props} />
103
+ </EnsureI18nProvider>
104
+ );
105
+ }
106
+
107
+ function BlueprintNodeConfigSidebarInner({
100
108
  node,
101
109
  graphNodes = [],
102
110
  graphEdges = [],
@@ -20,7 +20,7 @@ import {
20
20
  type ExecutionTraceEntry,
21
21
  type PageLifecyclePhase,
22
22
  } from "@arronqzy/blueprint-dsl";
23
- import { useI18n } from "@arronqzy/i18n/react";
23
+ import { EnsureI18nProvider, useI18nOptional as useI18n } from "@arronqzy/i18n/react";
24
24
  import { getLifecyclePhaseLabel } from "../graph/document";
25
25
 
26
26
  import type { ExecutionLogSettings } from "../library/execution-log-settings";
@@ -140,7 +140,15 @@ export type BlueprintExecutionLogPanelProps = {
140
140
  lifecyclePhase?: string;
141
141
  };
142
142
 
143
- export function BlueprintExecutionLogPanel({
143
+ export function BlueprintExecutionLogPanel(props: BlueprintExecutionLogPanelProps) {
144
+ return (
145
+ <EnsureI18nProvider>
146
+ <BlueprintExecutionLogPanelInner {...props} />
147
+ </EnsureI18nProvider>
148
+ );
149
+ }
150
+
151
+ function BlueprintExecutionLogPanelInner({
144
152
  entries,
145
153
  settings,
146
154
  onUpdateSettings,
@@ -7,7 +7,7 @@ import {
7
7
  SelectTrigger,
8
8
  SelectValue,
9
9
  } from "@arronqzy/ui";
10
- import { useI18n } from "@arronqzy/i18n/react";
10
+ import { useI18nOptional as useI18n } from "@arronqzy/i18n/react";
11
11
 
12
12
  import type { BlueprintLibraryListItem } from "../library/types";
13
13
 
@@ -11,7 +11,7 @@ import {
11
11
  Label,
12
12
  Textarea,
13
13
  } from "@arronqzy/ui";
14
- import { useI18n } from "@arronqzy/i18n/react";
14
+ import { useI18nOptional as useI18n } from "@arronqzy/i18n/react";
15
15
 
16
16
  import type { BlueprintMetaDraft } from "../library/types";
17
17
 
@@ -7,7 +7,7 @@ import {
7
7
  DialogHeader,
8
8
  DialogTitle,
9
9
  } from "@arronqzy/ui";
10
- import { useI18n } from "@arronqzy/i18n/react";
10
+ import { useI18nOptional as useI18n } from "@arronqzy/i18n/react";
11
11
 
12
12
  export type BlueprintNodeSwitchTaskDialogProps = {
13
13
  open: boolean;
@@ -18,7 +18,7 @@ import {
18
18
  import type { BlueprintLibraryListItem } from "../library/types";
19
19
  import type { LifecycleNodeOption } from "../hooks/useBlueprintDebugSession";
20
20
  import { type PageLifecyclePhase } from "@arronqzy/blueprint-dsl";
21
- import { useI18n } from "@arronqzy/i18n/react";
21
+ import { EnsureI18nProvider, useI18nOptional as useI18n } from "@arronqzy/i18n/react";
22
22
  import { getLifecyclePhaseLabel } from "../graph/document";
23
23
 
24
24
  export type BlueprintRenameDialogProps = {
@@ -393,7 +393,15 @@ function LibraryRow({
393
393
  );
394
394
  }
395
395
 
396
- export function BlueprintPanelToolbar({
396
+ export function BlueprintPanelToolbar(props: BlueprintPanelToolbarProps) {
397
+ return (
398
+ <EnsureI18nProvider>
399
+ <BlueprintPanelToolbarInner {...props} />
400
+ </EnsureI18nProvider>
401
+ );
402
+ }
403
+
404
+ function BlueprintPanelToolbarInner({
397
405
  items,
398
406
  activeId,
399
407
  currentBlueprintLabel,
@@ -1,7 +1,7 @@
1
1
  import { useCallback, type ChangeEvent } from "react";
2
2
  import { Input } from "@arronqzy/ui";
3
3
  import type { ClockNodeConfig } from "@arronqzy/blueprint-dsl";
4
- import { useI18n } from "@arronqzy/i18n/react";
4
+ import { useI18nOptional as useI18n } from "@arronqzy/i18n/react";
5
5
 
6
6
  import type { BlueprintGraphNode } from "../graph/document";
7
7
  import { resolveNodeClockConfig } from "../graph/document";
@@ -1,5 +1,5 @@
1
1
  import type { ReactNode } from "react";
2
- import { useI18n } from "@arronqzy/i18n/react";
2
+ import { useI18nOptional as useI18n } from "@arronqzy/i18n/react";
3
3
  import {
4
4
  Tooltip,
5
5
  TooltipContent,
@@ -45,7 +45,7 @@ import {
45
45
  useFetchDebugTask,
46
46
  useSwaggerLoadTask,
47
47
  } from "../fetch-config-task-store";
48
- import { useI18n } from "@arronqzy/i18n/react";
48
+ import { useI18nOptional as useI18n } from "@arronqzy/i18n/react";
49
49
 
50
50
  import { ConfigFieldLabel, ConfigHintIcon, ConfigSectionTitle } from "./ConfigHintIcon";
51
51
  import { FetchUrlAutocomplete } from "./FetchUrlAutocomplete";
@@ -1,6 +1,6 @@
1
1
  import { useEffect, useMemo, useRef, useState } from "react";
2
2
  import { cn } from "@arronqzy/ui";
3
- import { useI18n } from "@arronqzy/i18n/react";
3
+ import { useI18nOptional as useI18n } from "@arronqzy/i18n/react";
4
4
  import {
5
5
  buildEndpointSuggestions,
6
6
  filterEndpointSuggestions,
@@ -9,7 +9,7 @@ import {
9
9
  resolveFetchScopeAutocompleteRoot,
10
10
  validateJsonStringAllowingScope,
11
11
  } from "@arronqzy/blueprint-dsl";
12
- import { useI18n } from "@arronqzy/i18n/react";
12
+ import { useI18nOptional as useI18n } from "@arronqzy/i18n/react";
13
13
 
14
14
  import type { BlueprintGraphEdge, BlueprintGraphNode } from "../graph/document";
15
15
  import { resolveNodeJsonConfig } from "../graph/document";
@@ -1,7 +1,7 @@
1
1
  import { useCallback, useMemo, useState, type ChangeEvent } from "react";
2
2
  import { validateLogicSourceCode } from "@arronqzy/blueprint-dsl";
3
3
  import type { LogicNodeConfig } from "@arronqzy/blueprint-dsl";
4
- import { useI18n } from "@arronqzy/i18n/react";
4
+ import { useI18nOptional as useI18n } from "@arronqzy/i18n/react";
5
5
 
6
6
  import type { BlueprintGraphNode } from "../graph/document";
7
7
  import { resolveNodeLogicConfig } from "../graph/document";
@@ -1,6 +1,6 @@
1
1
  import { useCallback, useEffect, useMemo, useRef, useState } from "react";
2
2
  import { cn } from "@arronqzy/ui";
3
- import { useI18n } from "@arronqzy/i18n/react";
3
+ import { useI18nOptional as useI18n } from "@arronqzy/i18n/react";
4
4
  import {
5
5
  filterStorageKeySuggestions,
6
6
  listBrowserStorageKeys,
@@ -20,7 +20,7 @@ import {
20
20
  resolveFetchScopeAutocompleteRoot,
21
21
  uniqueStorageKinds,
22
22
  } from "@arronqzy/blueprint-dsl";
23
- import { useI18n } from "@arronqzy/i18n/react";
23
+ import { useI18nOptional as useI18n } from "@arronqzy/i18n/react";
24
24
 
25
25
  import type { BlueprintGraphEdge, BlueprintGraphNode } from "../graph/document";
26
26
  import { resolveNodeStorageConfig } from "../graph/document";
@@ -12,7 +12,7 @@ import {
12
12
  PopoverContent,
13
13
  PopoverTrigger,
14
14
  } from "@arronqzy/ui";
15
- import { useI18n } from "@arronqzy/i18n/react";
15
+ import { useI18nOptional as useI18n } from "@arronqzy/i18n/react";
16
16
 
17
17
  export type ViewElementMultiSelectOption = {
18
18
  id: string;
@@ -1,5 +1,5 @@
1
1
  import { useCallback, useEffect, useMemo, useRef } from "react";
2
- import { useI18n } from "@arronqzy/i18n/react";
2
+ import { useI18nOptional as useI18n } from "@arronqzy/i18n/react";
3
3
  import { toast } from "@arronqzy/ui";
4
4
  import {
5
5
  addEdge,
package/src/index.tsx CHANGED
@@ -14,6 +14,7 @@ import {
14
14
  type Node,
15
15
  type Edge,
16
16
  } from "@xyflow/react";
17
+ import { EnsureI18nProvider } from "@arronqzy/i18n/react";
17
18
  import "@xyflow/react/dist/style.css";
18
19
  import "./blueprint.css";
19
20
 
@@ -241,33 +242,35 @@ export const BluePrintReactRoot: FC<BluePrintReactRootProps> = ({
241
242
  const containerRef = useRef<HTMLDivElement>(null);
242
243
 
243
244
  return (
244
- <div
245
- ref={containerRef}
246
- data-workspace-region="blueprint"
247
- className="bp-canvas h-full w-full bg-background text-foreground"
248
- style={{
249
- width: "100%",
250
- height: "100%",
251
- minHeight: 0,
252
- ...style,
253
- }}
254
- >
255
- <BlueprintCanvasProvider
256
- onSelectNode={onSelectNode}
257
- onAbortClock={onAbortClock}
245
+ <EnsureI18nProvider>
246
+ <div
247
+ ref={containerRef}
248
+ data-workspace-region="blueprint"
249
+ className="bp-canvas h-full w-full bg-background text-foreground"
250
+ style={{
251
+ width: "100%",
252
+ height: "100%",
253
+ minHeight: 0,
254
+ ...style,
255
+ }}
258
256
  >
259
- <ReactFlowProvider>
260
- <BlueprintCanvas
261
- containerRef={containerRef}
262
- graph={graph}
263
- onGraphChange={onGraphChange}
264
- selectedNodeId={selectedNodeId}
265
- executionOverlay={executionOverlay}
266
- onSelectNode={onSelectNode}
267
- libraryNameById={libraryNameById}
268
- />
269
- </ReactFlowProvider>
270
- </BlueprintCanvasProvider>
271
- </div>
257
+ <BlueprintCanvasProvider
258
+ onSelectNode={onSelectNode}
259
+ onAbortClock={onAbortClock}
260
+ >
261
+ <ReactFlowProvider>
262
+ <BlueprintCanvas
263
+ containerRef={containerRef}
264
+ graph={graph}
265
+ onGraphChange={onGraphChange}
266
+ selectedNodeId={selectedNodeId}
267
+ executionOverlay={executionOverlay}
268
+ onSelectNode={onSelectNode}
269
+ libraryNameById={libraryNameById}
270
+ />
271
+ </ReactFlowProvider>
272
+ </BlueprintCanvasProvider>
273
+ </div>
274
+ </EnsureI18nProvider>
272
275
  );
273
276
  };
@@ -1,4 +1,4 @@
1
- import { useI18n } from "@arronqzy/i18n/react";
1
+ import { useI18nOptional as useI18n } from "@arronqzy/i18n/react";
2
2
  import { Handle, Position, type NodeProps } from "@xyflow/react";
3
3
  import { cn } from "@arronqzy/ui";
4
4
 
@@ -1,4 +1,4 @@
1
- import { useI18n } from "@arronqzy/i18n/react";
1
+ import { useI18nOptional as useI18n } from "@arronqzy/i18n/react";
2
2
  import type { NodeProps } from "@xyflow/react";
3
3
 
4
4
  import { resolveBlueprintNodeTypeLabel } from "../graph/document";
@@ -1,4 +1,4 @@
1
- import { useI18n } from "@arronqzy/i18n/react";
1
+ import { useI18nOptional as useI18n } from "@arronqzy/i18n/react";
2
2
  import { cn } from "@arronqzy/ui";
3
3
 
4
4
  export type BlueprintNodeCardProps = {
@@ -1,4 +1,4 @@
1
- import { useI18n } from "@arronqzy/i18n/react";
1
+ import { useI18nOptional as useI18n } from "@arronqzy/i18n/react";
2
2
  import { Handle, Position } from "@xyflow/react";
3
3
  import { cn } from "@arronqzy/ui";
4
4
 
@@ -1,4 +1,4 @@
1
- import { useI18n } from "@arronqzy/i18n/react";
1
+ import { useI18nOptional as useI18n } from "@arronqzy/i18n/react";
2
2
  import type { NodeProps } from "@xyflow/react";
3
3
  import { cn } from "@arronqzy/ui";
4
4
 
@@ -1,4 +1,4 @@
1
- import { useI18n } from "@arronqzy/i18n/react";
1
+ import { useI18nOptional as useI18n } from "@arronqzy/i18n/react";
2
2
  import type { NodeProps } from "@xyflow/react";
3
3
 
4
4
  import { resolveBlueprintNodeTypeLabel } from "../graph/document";
@@ -1,4 +1,4 @@
1
- import { useI18n } from "@arronqzy/i18n/react";
1
+ import { useI18nOptional as useI18n } from "@arronqzy/i18n/react";
2
2
  import type { NodeProps } from "@xyflow/react";
3
3
 
4
4
  import { resolveBlueprintNodeTypeLabel } from "../graph/document";
@@ -1,4 +1,4 @@
1
- import { useI18n } from "@arronqzy/i18n/react";
1
+ import { useI18nOptional as useI18n } from "@arronqzy/i18n/react";
2
2
  import type { NodeProps } from "@xyflow/react";
3
3
 
4
4
  import { resolveBlueprintNodeTypeLabel } from "../graph/document";
@@ -1,4 +1,4 @@
1
- import { useI18n } from "@arronqzy/i18n/react";
1
+ import { useI18nOptional as useI18n } from "@arronqzy/i18n/react";
2
2
  import { Handle, Position, type NodeProps } from "@xyflow/react";
3
3
  import { cn } from "@arronqzy/ui";
4
4
 
@@ -1,4 +1,4 @@
1
- import { useI18n } from "@arronqzy/i18n/react";
1
+ import { useI18nOptional as useI18n } from "@arronqzy/i18n/react";
2
2
  import type { NodeProps } from "@xyflow/react";
3
3
 
4
4
  import { resolveBlueprintNodeTypeLabel } from "../graph/document";
@@ -1,4 +1,4 @@
1
- import { useI18n } from "@arronqzy/i18n/react";
1
+ import { useI18nOptional as useI18n } from "@arronqzy/i18n/react";
2
2
  import type { NodeProps } from "@xyflow/react";
3
3
 
4
4
  import { resolveBlueprintNodeTypeLabel } from "../graph/document";