datastake-daf 0.6.368 → 0.6.370

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,4 @@
1
+ // components/Nodes/NameNode.jsx
1
2
  import React from "react";
2
3
  import styled from "styled-components";
3
4
  import { Handle, Position } from "@xyflow/react";
@@ -13,6 +14,8 @@ const { useToken } = theme;
13
14
  export default function NameNode({ data }) {
14
15
  const { token } = useToken();
15
16
  const translateFN = typeof data?.t === "function" ? data.t : (key) => key;
17
+ const isPdf = data?.isPdf;
18
+
16
19
  return (
17
20
  <>
18
21
  <Handle
@@ -34,6 +37,7 @@ export default function NameNode({ data }) {
34
37
  }}
35
38
  />
36
39
  <Style
40
+ $isPdf={isPdf}
37
41
  style={{
38
42
  opacity: data.isEmpty ? 0.5 : 1,
39
43
  }}
@@ -95,19 +99,21 @@ export default function NameNode({ data }) {
95
99
  ) : null}
96
100
  </div>
97
101
 
98
- <div
99
- style={{
100
- marginLeft: "auto",
101
- }}
102
- className="go-to"
103
- onClick={() => {
104
- if (typeof data.onClick === "function") {
105
- data.onClick();
106
- }
107
- }}
108
- >
109
- <CustomIcon height={14} width={14} name="LinkNewTab" />
110
- </div>
102
+ {!isPdf && (
103
+ <div
104
+ style={{
105
+ marginLeft: "auto",
106
+ }}
107
+ className="go-to"
108
+ onClick={() => {
109
+ if (typeof data.onClick === "function") {
110
+ data.onClick();
111
+ }
112
+ }}
113
+ >
114
+ <CustomIcon height={14} width={14} name="LinkNewTab" />
115
+ </div>
116
+ )}
111
117
  </div>
112
118
  </Style>
113
119
  <Handle
@@ -129,25 +135,36 @@ export default function NameNode({ data }) {
129
135
  }
130
136
 
131
137
  const Style = styled.div`
132
- width: ${NAME_CARD_WIDTH}px;
133
- display: flex;
134
- background: white;
135
- border-radius: 8px;
136
- box-shadow: 0px 3.76px 10.03px 0px #00000014;
137
- box-shadow: 0px 1.88px 3.76px -2.51px #0000001f;
138
- overflow: hidden;
139
- box-shadow: 0px 5.64px 17.56px 5.02px #0000000d;
138
+ width: ${NAME_CARD_WIDTH}px;
139
+ height: ${NAME_CARD_HEIGHT}px;
140
+ display: flex;
141
+ background: white;
142
+ border-radius: 8px;
143
+ overflow: hidden;
144
+ ${(props) =>
145
+ props.$isPdf
146
+ ? `
147
+ border: 1px solid var(--base-gray-30);
148
+ box-shadow: none;
149
+ `
150
+ : `
151
+ box-shadow: 0px 3.76px 10.03px 0px #00000014, 0px 1.88px 3.76px -2.51px #0000001f, 0px 5.64px 17.56px 5.02px #0000000d;
152
+ `}
153
+ -webkit-print-color-adjust: exact;
154
+ print-color-adjust: exact;
140
155
 
141
- .left {
142
- width: 32px;
143
- background: red;
144
- border-top-left-radius: 12px;
145
- border-bottom-left-radius: 12px;
146
- }
156
+ .left {
157
+ width: 32px;
158
+ background: red;
159
+ border-top-left-radius: 12px;
160
+ border-bottom-left-radius: 12px;
161
+ }
147
162
 
148
- .right {
149
- padding: 16px 12px;
150
- width: 100%
151
- border-bottom: 1px solid var(--base-gray-30);
152
- }
153
- `;
163
+ .right {
164
+ padding: 0px 12px;
165
+ width: 100%;
166
+ display: flex;
167
+ align-items: center;
168
+ border-bottom: none;
169
+ }
170
+ `;
@@ -1,6 +1,7 @@
1
+ // components/Nodes/PrimaryNode.jsx
1
2
  import React from "react";
2
3
  import styled from "styled-components";
3
- import { Handle, Position } from "@xyflow/react"; //
4
+ import { Handle, Position } from "@xyflow/react";
4
5
  import CustomIcon from "../../../Icon/CustomIcon.jsx";
5
6
  import { Tooltip } from "antd";
6
7
  import PropTypes from "prop-types";
@@ -10,6 +11,7 @@ export const MAIN_NODE_WIDTH = 300;
10
11
  export const MAIN_NODE_HEIGHT = 150;
11
12
 
12
13
  export default function PrimaryNode({ id, data }) {
14
+ const isPdf = data?.isPdf; // Get isPdf from data prop
13
15
  return (
14
16
  <>
15
17
  <Handle
@@ -30,7 +32,7 @@ export default function PrimaryNode({ id, data }) {
30
32
  opacity: 0,
31
33
  }}
32
34
  />
33
- <Style className="flex">
35
+ <Style $isPdf={isPdf} className="flex"> {/* Pass isPdf to styled component */}
34
36
  <div
35
37
  className="left flex flex-column justify-center"
36
38
  style={{
@@ -133,13 +135,23 @@ export default function PrimaryNode({ id, data }) {
133
135
 
134
136
  const Style = styled.div`
135
137
  width: ${MAIN_NODE_WIDTH}px;
138
+ height: ${MAIN_NODE_HEIGHT}px; /* Explicitly set height */
136
139
  display: flex;
137
140
  background: white;
138
141
  border-radius: 8px;
139
- box-shadow: 0px 3.76px 10.03px 0px #00000014;
140
- box-shadow: 0px 1.88px 3.76px -2.51px #0000001f;
141
142
  overflow: hidden;
142
- box-shadow: 0px 5.64px 17.56px 5.02px #0000000d;
143
+ /* Conditional styles for PDF vs screen */
144
+ ${(props) =>
145
+ props.$isPdf
146
+ ? `
147
+ border: 1px solid var(--base-gray-30); /* Ensure a visible border in PDF */
148
+ box-shadow: none; /* Remove shadow for PDF */
149
+ `
150
+ : `
151
+ box-shadow: 0px 3.76px 10.03px 0px #00000014, 0px 1.88px 3.76px -2.51px #0000001f, 0px 5.64px 17.56px 5.02px #0000000d;
152
+ `}
153
+ -webkit-print-color-adjust: exact;
154
+ print-color-adjust: exact;
143
155
 
144
156
  .left {
145
157
  width: 32px;
@@ -233,5 +245,6 @@ PrimaryNode.propTypes = {
233
245
  backgroundColor: PropTypes.string,
234
246
  totalSources: PropTypes.number,
235
247
  onClick: PropTypes.func,
248
+ isPdf: PropTypes.bool,
236
249
  }),
237
- };
250
+ };