@luxonis/depthai-pipeline-lib 3.3.0 → 3.4.0-rc.1

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.css CHANGED
@@ -1,3 +1,4 @@
1
1
  @import url("@xyflow/react/dist/style.css");
2
2
  @import url("@luxonis/common-fe-components/styles");
3
+ @import url("@luxonis/ui-components/styles.css");
3
4
  @import url("./panda.css");
package/dist/panda.css CHANGED
@@ -1268,22 +1268,6 @@
1268
1268
  pointer-events: none;
1269
1269
  }
1270
1270
 
1271
- .min-w_container\.smaller\.xxs {
1272
- min-width: var(--sizes-container-smaller-xxs);
1273
- }
1274
-
1275
- .bd_base {
1276
- border: var(--borders-base);
1277
- }
1278
-
1279
- .bdr_common {
1280
- border-radius: var(--radii-common);
1281
- }
1282
-
1283
- .p_0 {
1284
- padding: var(--spacing-0);
1285
- }
1286
-
1287
1271
  .bdr_0\%\! {
1288
1272
  border-radius: 0% !important;
1289
1273
  }
@@ -1304,15 +1288,6 @@
1304
1288
  border: var(--borders-none) !important;
1305
1289
  }
1306
1290
 
1307
- .w_full {
1308
- width: var(--sizes-full);
1309
- }
1310
-
1311
- .bdr-t_common {
1312
- border-top-left-radius: var(--radii-common);
1313
- border-top-right-radius: var(--radii-common);
1314
- }
1315
-
1316
1291
  .w_20px {
1317
1292
  width: 20px;
1318
1293
  }
@@ -1337,14 +1312,6 @@
1337
1312
  justify-content: center;
1338
1313
  }
1339
1314
 
1340
- .border-style_dashed {
1341
- border-style: dashed;
1342
- }
1343
-
1344
- .bg-c_rgba\(0\,0\,0\,0\.125\) {
1345
- background-color: rgba(0,0,0,0.125);
1346
- }
1347
-
1348
1315
  .bg-c_dark\.warning\! {
1349
1316
  background-color: var(--colors-dark-warning) !important;
1350
1317
  }
@@ -1369,19 +1336,7 @@
1369
1336
  margin-right: var(--spacing-xs);
1370
1337
  }
1371
1338
 
1372
- .bg-c_white {
1373
- background-color: var(--colors-white);
1374
- }
1375
-
1376
- .bg-c_light\.gray {
1377
- background-color: var(--colors-light-gray);
1378
- }
1379
-
1380
1339
  .right_xs {
1381
1340
  right: var(--spacing-xs);
1382
1341
  }
1383
-
1384
- .\[\&\:hover_\.node-help-icon\]\:c_text\.normal:hover .node-help-icon {
1385
- color: var(--colors-text-normal);
1386
- }
1387
1342
  }
@@ -1,13 +1,14 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Badge, Button, Flex, HelpIcon, Label, SubLabel } from '@luxonis/common-fe-components';
2
+ import { Badge, Button, HelpIcon, Label, SubLabel } from '@luxonis/common-fe-components';
3
3
  import { clsx } from '@luxonis/common-fe-components/helpers';
4
+ import { Flex } from '@luxonis/ui-components';
4
5
  import { Handle, Position } from '@xyflow/react';
5
6
  import { formatTiming } from '../services/pipeline-state.js';
6
7
  import { DOCS_BASE_URL, MIN_NODE_WIDTH, NodesWithLinks } from '../services/utils.js';
7
8
  import { css } from '../styled-system/css/css.mjs';
8
9
  const NodeHandles = (props) => {
9
10
  const { handles, type } = props;
10
- return (_jsx(Flex, { full: true, direction: "column", align: type === 'input' ? 'start' : 'end', minWidth: "120px", children: handles.map(({ type: handleType, id, blocking, queueSize, name, maxQueueSize, fps, connected, dotColor, }) => {
11
+ return (_jsx(Flex, { full: true, direction: "column", align: type === 'input' ? 'start' : 'end', className: 'min-w-[120px]', children: handles.map(({ type: handleType, id, blocking, queueSize, name, maxQueueSize, fps, connected, dotColor, }) => {
11
12
  if (!connected) {
12
13
  return null;
13
14
  }
@@ -49,7 +50,7 @@ const NodeHandlesSubLabel = (props) => {
49
50
  : `${fps ? `[${fps.toFixed(1)}]` : ''} ${name}`, break: "none" }));
50
51
  };
51
52
  const GPSTTimings = (props) => {
52
- return (_jsx(Flex, { flexDirection: "column", alignItems: "center", minWidth: "120px", children: Object.entries(props).map(([key, item]) => (_jsxs(Flex, { gap: "xxs", children: [_jsx(Label, { text: `${key}:`, size: "small" }), _jsx(Label, { text: `${formatTiming(item)}ms`, size: "small" })] }, `${key}-${item}-label`))) }));
53
+ return (_jsx(Flex, { direction: "column", align: "center", className: 'min-w-[120px]', children: Object.entries(props).map(([key, item]) => (_jsxs(Flex, { gap: "xs", children: [_jsx(Label, { text: `${key}:`, size: "small" }), _jsx(Label, { text: `${formatTiming(item)}ms`, size: "small" })] }, `${key}-${item}-label`))) }));
53
54
  };
54
55
  export const PipelineNode = (props) => {
55
56
  const { data: node } = props;
@@ -57,19 +58,7 @@ export const PipelineNode = (props) => {
57
58
  const link = NodesWithLinks.hasOwnProperty(node.name)
58
59
  ? `${DOCS_BASE_URL}/${NodesWithLinks[node.name]}`
59
60
  : DOCS_BASE_URL;
60
- return (_jsxs(Flex, { direction: "column", className: css({
61
- minWidth: 'container.smaller.xxs',
62
- border: 'base',
63
- rounded: 'common',
64
- backgroundColor: 'white',
65
- '&:hover .node-help-icon': {
66
- color: 'text.normal',
67
- },
68
- }), children: [_jsxs(Flex, { align: "center", justify: "space-between", gap: "xs", className: css({
69
- width: 'full',
70
- backgroundColor: 'light.gray',
71
- roundedTop: 'common',
72
- }), children: [_jsx("span", { className: css({
61
+ return (_jsxs(Flex, { direction: "column", className: "min-w-[120px] border border-border rounded-sm bg-background hover:[&_.node-help-icon]:text-foreground", children: [_jsxs(Flex, { align: "center", justify: "between", gap: "xs", className: "w-full bg-muted rounded-t-sm", children: [_jsx("span", { className: css({
73
62
  width: '20px',
74
63
  height: '20px',
75
64
  display: 'flex',
@@ -95,7 +84,7 @@ export const PipelineNode = (props) => {
95
84
  }), style: {
96
85
  border: 'none',
97
86
  background: 'transparent',
98
- } }), _jsxs(Flex, { gap: "sm", paddingY: "xs", minWidth: `${MIN_NODE_WIDTH}px`, children: [_jsx(NodeHandles, { type: "input", handles: node.handles.input }), node.extras?.gpstTimings && _jsx(GPSTTimings, { ...node.extras.gpstTimings }), _jsx(NodeHandles, { type: "output", handles: node.handles.output })] }), _jsx(Handle, { type: "source", position: Position.Bottom, id: "bottom", isConnectable: false, className: css({
87
+ } }), _jsxs(Flex, { gap: "sm", className: `min-w-[${MIN_NODE_WIDTH}px] py-2`, children: [_jsx(NodeHandles, { type: "input", handles: node.handles.input }), node.extras?.gpstTimings && _jsx(GPSTTimings, { ...node.extras.gpstTimings }), _jsx(NodeHandles, { type: "output", handles: node.handles.output })] }), _jsx(Handle, { type: "source", position: Position.Bottom, id: "bottom", isConnectable: false, className: css({
99
88
  width: 'custom.handle.dot!',
100
89
  height: 'custom.handle.dot!',
101
90
  }), style: {
@@ -1,8 +1,7 @@
1
- import type { FlexProps } from '@luxonis/common-fe-components';
2
1
  import React from 'react';
3
2
  import type { Pipeline } from '../services/pipeline.js';
4
3
  import type { PipelineState } from '../services/pipeline-state.js';
5
- export type PipelineCanvasProps = FlexProps & {
4
+ export type PipelineCanvasProps = {
6
5
  pipeline: Pipeline | null;
7
6
  pipelineState: PipelineState[] | null;
8
7
  header?: React.ReactNode;
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Button, Flex, Header } from '@luxonis/common-fe-components';
2
+ import { Button, Header } from '@luxonis/common-fe-components';
3
+ import { Flex } from '@luxonis/ui-components';
3
4
  import { BezierEdge, Panel, ReactFlow, ReactFlowProvider, useEdgesState, useNodesState, useReactFlow, useStore, } from '@xyflow/react';
4
5
  import React from 'react';
5
6
  import { adjustNodes, getLayoutedElements, updateNodesOnPipelineStateChange, } from '../services/utils.js';
@@ -8,7 +9,7 @@ import { PipelineNode } from './Node.js';
8
9
  import { PipelineLegend } from './PipelineLegend.js';
9
10
  const nodeTypes = { generic: PipelineNode };
10
11
  const edgeTypes = { generic: BezierEdge, bridge: BridgeEdge };
11
- const PipelineCanvasBody = ({ pipeline, pipelineState: pipelineStateParsed, header, isDebugging = false, ...flexProps }) => {
12
+ const PipelineCanvasBody = ({ pipeline, pipelineState: pipelineStateParsed, header, isDebugging = false, }) => {
12
13
  const { fitView, setViewport, getViewport } = useReactFlow();
13
14
  const autoArrangeRef = React.useRef(true);
14
15
  const reactFlowWidth = useStore((state) => state.width);
@@ -66,6 +67,6 @@ const PipelineCanvasBody = ({ pipeline, pipelineState: pipelineStateParsed, head
66
67
  setShouldFitAndResize(false);
67
68
  }
68
69
  }, [shouldFitAndResize]);
69
- return (_jsxs(Flex, { align: "center", justify: "center", full: true, height: "container.xs", rounded: "common", border: "base", ...flexProps, children: [!pipeline && _jsx(Header, { text: "Loading pipeline..." }), pipeline && (_jsxs(ReactFlow, { nodes: nodes, edges: edges, onNodeDragStart: () => (autoArrangeRef.current = false), onNodesChange: onNodesChange, fitView: true, nodeTypes: nodeTypes, edgeTypes: edgeTypes, minZoom: 0.4, children: [header && _jsx(Panel, { position: "top-center", children: header }), _jsx(Panel, { position: "top-right", children: _jsxs(Flex, { gap: "xs", flexDirection: "column", children: [_jsx(Button, { onClick: () => setOpenLegend(!openLegend), label: openLegend ? 'Collapse' : 'Legend' }), openLegend && _jsx(PipelineLegend, { isDebugging: isDebugging })] }) })] }))] }));
70
+ return (_jsxs(Flex, { align: "center", justify: "center", full: true, className: "border border-border rounded-sm", children: [!pipeline && _jsx(Header, { text: "Loading pipeline..." }), pipeline && (_jsxs(ReactFlow, { nodes: nodes, edges: edges, onNodeDragStart: () => (autoArrangeRef.current = false), onNodesChange: onNodesChange, fitView: true, nodeTypes: nodeTypes, edgeTypes: edgeTypes, minZoom: 0.4, children: [header && _jsx(Panel, { position: "top-center", children: header }), _jsx(Panel, { position: "top-right", children: _jsxs(Flex, { gap: "xs", direction: "column", children: [_jsx(Button, { onClick: () => setOpenLegend(!openLegend), label: openLegend ? 'Collapse' : 'Legend' }), openLegend && _jsx(PipelineLegend, { isDebugging: isDebugging })] }) })] }))] }));
70
71
  };
71
72
  export const PipelineCanvas = (props) => (_jsx(ReactFlowProvider, { children: _jsx(PipelineCanvasBody, { ...props }) }));
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Badge, Flex, Label, SubLabel } from '@luxonis/common-fe-components';
2
+ import { Badge, Label, SubLabel } from '@luxonis/common-fe-components';
3
+ import { Flex } from '@luxonis/ui-components';
3
4
  import React from 'react';
4
5
  import { PACKAGE_VERSION } from '../version.js';
5
6
  const debugSections = [
@@ -197,10 +198,10 @@ function LegendDot({ tone, square = false }) {
197
198
  } }));
198
199
  }
199
200
  function LegendCell({ left, right }) {
200
- return (_jsxs(Flex, { gap: "xxs", width: "full", alignItems: "center", children: [_jsxs(Flex, { alignItems: "center", gap: "xxs", width: "full", children: [left.marker, _jsx(SubLabel, { text: `${left.label}` })] }), right ? (_jsxs(Flex, { alignItems: "center", gap: "xxs", width: "full", children: [right.marker, _jsx(SubLabel, { text: `${right.label}` })] })) : null] }));
201
+ return (_jsxs(Flex, { gap: "xs", align: "center", className: "w-full", children: [_jsxs(Flex, { align: "center", gap: "xs", className: "w-full", children: [left.marker, _jsx(SubLabel, { text: `${left.label}` })] }), right ? (_jsxs(Flex, { align: "center", gap: "xs", className: "w-full", children: [right.marker, _jsx(SubLabel, { text: `${right.label}` })] })) : null] }));
201
202
  }
202
203
  function LegendSection({ title, items }) {
203
- return (_jsxs(Flex, { direction: "column", gap: "xs", width: "full", children: [_jsx(Label, { text: title, weight: "medium" }), items.map((item) => (_jsx(LegendCell, { left: item[0], right: item[1] }, `${item[0].id}-${item[1]?.id}`)))] }));
204
+ return (_jsxs(Flex, { direction: "column", gap: "xs", className: "w-full", children: [_jsx(Label, { text: title, weight: "medium" }), items.map((item) => (_jsx(LegendCell, { left: item[0], right: item[1] }, `${item[0].id}-${item[1]?.id}`)))] }));
204
205
  }
205
206
  export const PipelineLegend = ({ isDebugging }) => {
206
207
  const sections = isDebugging
@@ -212,5 +213,5 @@ export const PipelineLegend = ({ isDebugging }) => {
212
213
  bridgeSection,
213
214
  ]
214
215
  : sharedSections;
215
- return (_jsxs(Flex, { direction: "column", gap: "xs", width: "full", padding: "sm", rounded: "common", border: "base", backgroundColor: "white", maxWidth: "390px", children: [_jsx(Label, { text: "Legend", color: "black", weight: "medium", align: "center" }), _jsx(Flex, { direction: "column", gap: "xs", width: "full", children: sections.map((section) => (_jsx(LegendSection, { title: section.title, items: section.items }, section.title))) }), _jsx(SubLabel, { text: `v${PACKAGE_VERSION}`, color: "lightGray", align: "right" })] }));
216
+ return (_jsxs(Flex, { direction: "column", gap: "xs", className: "w-full max-w-[390px] bg-white border border-border rounded-sm p-4", children: [_jsx(Label, { text: "Legend", color: "black", weight: "medium", align: "center" }), _jsx(Flex, { direction: "column", gap: "xs", className: "w-full", children: sections.map((section) => (_jsx(LegendSection, { title: section.title, items: section.items }, section.title))) }), _jsx(SubLabel, { text: `v${PACKAGE_VERSION}`, color: "lightGray", align: "right" })] }));
216
217
  };
@@ -1 +1 @@
1
- export declare const PACKAGE_VERSION = "3.3.0";
1
+ export declare const PACKAGE_VERSION = "3.4.0-rc.1";
@@ -1,2 +1,2 @@
1
1
  // Do not edit it manually.
2
- export const PACKAGE_VERSION = '3.3.0';
2
+ export const PACKAGE_VERSION = '3.4.0-rc.1';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luxonis/depthai-pipeline-lib",
3
- "version": "3.3.0",
3
+ "version": "3.4.0-rc.1",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "main": "./dist/src/index.js",
@@ -16,6 +16,7 @@
16
16
  "dependencies": {
17
17
  "@dagrejs/dagre": "^1.1.3",
18
18
  "@luxonis/common-fe-components": "1.25.9",
19
+ "@luxonis/ui-components": "1.0.3",
19
20
  "@xyflow/react": "^12.0.4",
20
21
  "postcss-import": "^16.1.0",
21
22
  "postcss-nested": "^6.2.0",
@@ -1,5 +0,0 @@
1
- import type { NodeProps } from '@xyflow/react';
2
- import type { ParsedNode } from '../services/pipeline';
3
- type GroupNodeProps = NodeProps<ParsedNode>;
4
- export declare const GroupNode: React.FC<GroupNodeProps>;
5
- export {};
@@ -1,18 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Flex } from '@luxonis/common-fe-components';
3
- import { css } from '../styled-system/css/index.mjs';
4
- // TODO: Add group node
5
- export const GroupNode = (props) => {
6
- const { data: _node } = props;
7
- return (_jsx(Flex, { direction: "column", className: css({
8
- minWidth: 'container.smaller.xxs',
9
- border: 'base',
10
- rounded: 'common',
11
- '&:hover .node-help-icon': {
12
- color: 'text.normal',
13
- },
14
- padding: 0,
15
- borderStyle: 'dashed',
16
- backgroundColor: 'rgba(0,0,0,0.125)',
17
- }) }));
18
- };