diff --git a/web/app/components/base/file-uploader/file-list-in-log.tsx b/web/app/components/base/file-uploader/file-list-in-log.tsx index c28b41e416..186e8fcc2c 100644 --- a/web/app/components/base/file-uploader/file-list-in-log.tsx +++ b/web/app/components/base/file-uploader/file-list-in-log.tsx @@ -66,7 +66,7 @@ const FileListInLog = ({ fileList, isExpanded = false, noBorder = false, noPaddi
diff --git a/web/app/components/base/file-uploader/file-type-icon.tsx b/web/app/components/base/file-uploader/file-type-icon.tsx index 08d0131520..850b08c71f 100644 --- a/web/app/components/base/file-uploader/file-type-icon.tsx +++ b/web/app/components/base/file-uploader/file-type-icon.tsx @@ -69,13 +69,14 @@ const FILE_TYPE_ICON_MAP = { } type FileTypeIconProps = { type: FileAppearanceType - size?: 'sm' | 'lg' | 'md' + size?: 'sm' | 'md' | 'lg' | 'xl' className?: string } const SizeMap = { - sm: 'w-4 h-4', - md: 'w-5 h-5', - lg: 'w-6 h-6', + sm: 'size-4', + md: 'size-[18px]', + lg: 'size-5', + xl: 'size-6', } const FileTypeIcon = ({ type, diff --git a/web/app/components/base/file-uploader/file-uploader-in-attachment/file-item.tsx b/web/app/components/base/file-uploader/file-uploader-in-attachment/file-item.tsx index fab1c3648e..8e3e47c42c 100644 --- a/web/app/components/base/file-uploader/file-uploader-in-attachment/file-item.tsx +++ b/web/app/components/base/file-uploader/file-uploader-in-attachment/file-item.tsx @@ -63,7 +63,7 @@ const FileInAttachmentItem = ({ !isImageFile && ( ) } diff --git a/web/app/components/base/icons/assets/public/knowledge/online-drive/buckets-blue.svg b/web/app/components/base/icons/assets/public/knowledge/online-drive/buckets-blue.svg new file mode 100644 index 0000000000..6e5591b7a8 --- /dev/null +++ b/web/app/components/base/icons/assets/public/knowledge/online-drive/buckets-blue.svg @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/web/app/components/base/icons/assets/public/knowledge/online-drive/buckets-gray.svg b/web/app/components/base/icons/assets/public/knowledge/online-drive/buckets-gray.svg new file mode 100644 index 0000000000..acea8b0500 --- /dev/null +++ b/web/app/components/base/icons/assets/public/knowledge/online-drive/buckets-gray.svg @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/web/app/components/base/icons/assets/public/knowledge/online-drive/folder.svg b/web/app/components/base/icons/assets/public/knowledge/online-drive/folder.svg new file mode 100644 index 0000000000..01ea0117ef --- /dev/null +++ b/web/app/components/base/icons/assets/public/knowledge/online-drive/folder.svg @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/web/app/components/base/icons/src/public/knowledge/online-drive/BucketsBlue.json b/web/app/components/base/icons/src/public/knowledge/online-drive/BucketsBlue.json new file mode 100644 index 0000000000..dd9e0dd2ba --- /dev/null +++ b/web/app/components/base/icons/src/public/knowledge/online-drive/BucketsBlue.json @@ -0,0 +1,591 @@ +{ + "icon": { + "type": "element", + "isRootNode": true, + "name": "svg", + "attributes": { + "width": "20", + "height": "21", + "viewBox": "0 0 20 21", + "fill": "none", + "xmlns": "http://www.w3.org/2000/svg" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "filter": "url(#filter0_dg_9100_35711)" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "fill-rule": "evenodd", + "clip-rule": "evenodd", + "d": "M2.93353 4.92661C2.89594 4.7923 2.875 4.65006 2.875 4.49999C2.875 3.87927 3.23334 3.39224 3.64546 3.04834C4.06181 2.70093 4.61943 2.4217 5.24258 2.20177C6.49565 1.75951 8.1777 1.5 10 1.5C11.8223 1.5 13.5044 1.75951 14.7574 2.20177C15.3806 2.4217 15.9382 2.70093 16.3545 3.04834C16.7667 3.39224 17.125 3.87927 17.125 4.49999C17.125 4.65011 17.104 4.79242 17.0664 4.92676L15.5233 14.6092C15.4517 15.1277 15.1621 15.5477 14.8098 15.867C14.456 16.1877 14.0028 16.4419 13.5123 16.6392C12.5299 17.0342 11.2752 17.2499 10 17.2499C8.72762 17.2499 7.48138 17.0419 6.50197 16.6499C5.58181 16.2816 4.63932 15.6399 4.47799 14.6173L4.47785 14.6165L2.93353 4.92661ZM15.3935 4.79995C15.1646 4.99091 14.7887 5.19651 14.2582 5.38375C13.2039 5.75583 11.6985 6 10 6C8.30148 6 6.79603 5.75583 5.7418 5.38375C5.2113 5.19651 4.83532 4.99091 4.60649 4.79995C4.35379 4.58909 4.34365 4.41936 4.60649 4.20004C4.83532 4.00908 5.2113 3.80347 5.7418 3.61624C6.79603 3.24416 8.30148 2.99998 10 2.99998C11.6985 2.99998 13.2039 3.24416 14.2582 3.61624C14.7887 3.80347 15.1646 4.00908 15.3935 4.20004C15.6535 4.41698 15.6591 4.57832 15.3935 4.79995Z", + "fill": "url(#paint0_linear_9100_35711)" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "d": "M10 1.75C11.8015 1.75 13.454 2.00701 14.6738 2.4375C15.2815 2.65197 15.8093 2.91891 16.1943 3.24023C16.5772 3.55975 16.875 3.98319 16.875 4.5C16.875 4.6265 16.8569 4.74611 16.8252 4.85938L16.8223 4.87305L16.8193 4.8877L15.2764 14.5693L15.2754 14.5752C15.2141 15.0182 14.9653 15.3882 14.6416 15.6816C14.3164 15.9764 13.8919 16.2171 13.4189 16.4072C12.4721 16.788 11.2501 17 10 17C8.75169 17 7.53815 16.7956 6.59473 16.418C5.68992 16.0559 4.86386 15.4608 4.72461 14.5781V14.5762L3.18066 4.8877L3.17773 4.87305L3.17383 4.85938L3.1377 4.68457C3.12934 4.62474 3.125 4.56323 3.125 4.5C3.125 3.98318 3.42277 3.55974 3.80566 3.24023C4.19077 2.91891 4.71851 2.65197 5.32617 2.4375C6.54607 2.00701 8.1985 1.75 10 1.75ZM10 2.75C8.28084 2.75 6.74557 2.99708 5.6582 3.38086C5.11261 3.57347 4.70632 3.79086 4.44629 4.00781C4.30195 4.12826 4.16025 4.29177 4.16309 4.50684C4.16605 4.71916 4.30918 4.87778 4.44629 4.99219C4.70632 5.20914 5.11262 5.42654 5.6582 5.61914C6.74557 6.00292 8.28084 6.25 10 6.25C11.7192 6.25 13.2544 6.00292 14.3418 5.61914C14.8874 5.42653 15.2937 5.20915 15.5537 4.99219C15.6953 4.87406 15.8424 4.71212 15.8408 4.49609C15.8391 4.2817 15.6913 4.12258 15.5537 4.00781C15.2937 3.79085 14.8874 3.57347 14.3418 3.38086C13.2544 2.99708 11.7192 2.75 10 2.75Z", + "stroke": "white", + "stroke-opacity": "0.01", + "stroke-width": "0.5" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "path", + "attributes": { + "opacity": "0.8", + "d": "M10 9.375C9.28547 9.375 8.67149 9.8031 8.39956 10.4162C7.7401 10.5741 7.25 11.1672 7.25 11.875C7.25 12.7034 7.92157 13.375 8.75 13.375H11.5C12.1904 13.375 12.75 12.8154 12.75 12.125C12.75 11.5151 12.3132 11.0072 11.7353 10.8971C11.6236 10.0383 10.8893 9.375 10 9.375Z", + "fill": "white" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "fill-rule": "evenodd", + "clip-rule": "evenodd", + "d": "M2.93353 4.92665C2.89594 4.79234 2.875 4.6501 2.875 4.50003C2.875 4.36905 2.89096 4.24402 2.92001 4.12503C2.92424 4.14236 2.92875 4.15957 2.93353 4.17665L4.47799 13.8674C4.63931 14.8899 5.58181 15.5316 6.50197 15.8999C7.48138 16.2919 8.72762 16.5 10 16.5C11.2752 16.5 12.5299 16.2843 13.5123 15.8892C14.0028 15.692 14.456 15.4377 14.8098 15.117C15.1621 14.7977 15.4517 14.3777 15.5233 13.8592L17.0664 4.1768C17.0712 4.15967 17.0757 4.1424 17.08 4.125C17.109 4.244 17.125 4.36904 17.125 4.50003C17.125 4.65015 17.104 4.79246 17.0664 4.9268L15.5233 14.6092C15.4517 15.1277 15.1621 15.5477 14.8098 15.867C14.456 16.1877 14.0028 16.442 13.5123 16.6392C12.5299 17.0343 11.2752 17.25 10 17.25C8.72762 17.25 7.48138 17.0419 6.50197 16.6499C5.58181 16.2816 4.63931 15.6399 4.47799 14.6174L2.93353 4.92665Z", + "fill": "#101828", + "fill-opacity": "0.14" + }, + "children": [] + }, + { + "type": "element", + "name": "defs", + "attributes": {}, + "children": [ + { + "type": "element", + "name": "filter", + "attributes": { + "id": "filter0_dg_9100_35711", + "x": "0.875", + "y": "0.3", + "width": "18.25", + "height": "19.95", + "filterUnits": "userSpaceOnUse", + "color-interpolation-filters": "sRGB" + }, + "children": [ + { + "type": "element", + "name": "feFlood", + "attributes": { + "flood-opacity": "0", + "result": "BackgroundImageFix" + }, + "children": [] + }, + { + "type": "element", + "name": "feColorMatrix", + "attributes": { + "in": "SourceAlpha", + "type": "matrix", + "values": "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0", + "result": "hardAlpha" + }, + "children": [] + }, + { + "type": "element", + "name": "feOffset", + "attributes": { + "dy": "1" + }, + "children": [] + }, + { + "type": "element", + "name": "feGaussianBlur", + "attributes": { + "stdDeviation": "1" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in2": "hardAlpha", + "operator": "out" + }, + "children": [] + }, + { + "type": "element", + "name": "feColorMatrix", + "attributes": { + "type": "matrix", + "values": "0 0 0 0 0.0352941 0 0 0 0 0.0352941 0 0 0 0 0.0431373 0 0 0 0.05 0" + }, + "children": [] + }, + { + "type": "element", + "name": "feBlend", + "attributes": { + "mode": "normal", + "in2": "BackgroundImageFix", + "result": "effect1_dropShadow_9100_35711" + }, + "children": [] + }, + { + "type": "element", + "name": "feBlend", + "attributes": { + "mode": "normal", + "in": "BackgroundImageFix", + "in2": "effect1_dropShadow_9100_35711", + "result": "BackgroundImageFix" + }, + "children": [] + }, + { + "type": "element", + "name": "feBlend", + "attributes": { + "mode": "normal", + "in": "SourceGraphic", + "in2": "BackgroundImageFix", + "result": "shape" + }, + "children": [] + }, + { + "type": "element", + "name": "feTurbulence", + "attributes": { + "type": "fractalNoise", + "baseFrequency": "9.0909090042114258 9.0909090042114258", + "numOctaves": "3", + "seed": "5297", + "result": "displacementX" + }, + "children": [] + }, + { + "type": "element", + "name": "feTurbulence", + "attributes": { + "type": "fractalNoise", + "baseFrequency": "9.0909090042114258 9.0909090042114258", + "numOctaves": "3", + "seed": "5298", + "result": "displacementY" + }, + "children": [] + }, + { + "type": "element", + "name": "feColorMatrix", + "attributes": { + "in": "displacementX", + "type": "matrix", + "values": "0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1", + "result": "displacementXRed" + }, + "children": [] + }, + { + "type": "element", + "name": "feColorMatrix", + "attributes": { + "in": "displacementY", + "type": "matrix", + "values": "0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in": "displacementXRed", + "operator": "arithmetic", + "k1": "0", + "k2": "1", + "k3": "1", + "k4": "0" + }, + "children": [] + }, + { + "type": "element", + "name": "feDisplacementMap", + "attributes": { + "in": "shape", + "scale": "2.4000000953674316", + "xChannelSelector": "R", + "yChannelSelector": "G", + "width": "100%", + "height": "100%" + }, + "children": [] + }, + { + "type": "element", + "name": "feColorMatrix", + "attributes": { + "type": "matrix", + "values": "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0" + }, + "children": [] + }, + { + "type": "element", + "name": "feComponentTransfer", + "attributes": { + "result": "sourceDisplacedAlpha" + }, + "children": [ + { + "type": "element", + "name": "feFuncA", + "attributes": { + "type": "gamma", + "exponent": "0.2" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "feColorMatrix", + "attributes": { + "in": "shape", + "type": "matrix", + "values": "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0" + }, + "children": [] + }, + { + "type": "element", + "name": "feComponentTransfer", + "attributes": { + "result": "inputSourceAlpha" + }, + "children": [ + { + "type": "element", + "name": "feFuncA", + "attributes": { + "type": "gamma", + "exponent": "0.2" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in": "sourceDisplacedAlpha", + "operator": "arithmetic", + "k1": "1", + "k2": "0", + "k3": "0", + "k4": "0", + "result": "displacementAlphasMultiplied" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in": "displacementAlphasMultiplied", + "operator": "arithmetic", + "k1": "0", + "k2": "0", + "k3": "-0.5", + "k4": "0.5", + "result": "centeringAdjustment" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in": "displacementX", + "in2": "displacementAlphasMultiplied", + "operator": "arithmetic", + "k1": "1", + "k2": "0", + "k3": "0", + "k4": "0" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in": "centeringAdjustment", + "operator": "arithmetic", + "k1": "0", + "k2": "1", + "k3": "1", + "k4": "0" + }, + "children": [] + }, + { + "type": "element", + "name": "feColorMatrix", + "attributes": { + "type": "matrix", + "values": "0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1", + "result": "displacementXFinal" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in": "displacementY", + "in2": "displacementAlphasMultiplied", + "operator": "arithmetic", + "k1": "1", + "k2": "0", + "k3": "0", + "k4": "0" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in": "centeringAdjustment", + "operator": "arithmetic", + "k1": "0", + "k2": "1", + "k3": "1", + "k4": "0" + }, + "children": [] + }, + { + "type": "element", + "name": "feColorMatrix", + "attributes": { + "type": "matrix", + "values": "0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1", + "result": "displacementYFinal" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in": "displacementXFinal", + "in2": "displacementYFinal", + "operator": "arithmetic", + "k1": "0", + "k2": "1", + "k3": "1", + "k4": "0" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in2": "displacementAlphasMultiplied", + "operator": "in", + "result": "displacementMap" + }, + "children": [] + }, + { + "type": "element", + "name": "feFlood", + "attributes": { + "flood-color": "rgb(127, 127, 127)", + "flood-opacity": "1" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in2": "displacementAlphasMultiplied", + "operator": "out" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in2": "displacementMap", + "operator": "over", + "result": "displacementMapWithBg" + }, + "children": [] + }, + { + "type": "element", + "name": "feDisplacementMap", + "attributes": { + "in": "shape", + "scale": "2.4000000953674316", + "xChannelSelector": "R", + "yChannelSelector": "G", + "width": "100%", + "height": "100%", + "result": "displacedImage" + }, + "children": [] + }, + { + "type": "element", + "name": "feColorMatrix", + "attributes": { + "in": "shape", + "type": "matrix", + "values": "1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 127 0", + "result": "imageOpaque" + }, + "children": [] + }, + { + "type": "element", + "name": "feDisplacementMap", + "attributes": { + "in": "imageOpaque", + "in2": "displacementMapWithBg", + "scale": "2.4000000953674316", + "xChannelSelector": "R", + "yChannelSelector": "G", + "width": "100%", + "height": "100%", + "result": "displacedImageOpaque" + }, + "children": [] + }, + { + "type": "element", + "name": "feColorMatrix", + "attributes": { + "in": "displacedImage", + "type": "matrix", + "values": "0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0", + "result": "displacedImageRed" + }, + "children": [] + }, + { + "type": "element", + "name": "feColorMatrix", + "attributes": { + "in": "shape", + "type": "matrix", + "values": "0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in": "displacedImageRed", + "operator": "atop", + "result": "transparencyRedMap" + }, + "children": [] + }, + { + "type": "element", + "name": "feColorMatrix", + "attributes": { + "in": "transparencyRedMap", + "type": "matrix", + "values": "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0", + "result": "transparencyAlphaMap" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in": "displacedImageOpaque", + "in2": "imageOpaque", + "operator": "over" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in2": "transparencyAlphaMap", + "operator": "in", + "result": "effect2_texture_9100_35711" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "linearGradient", + "attributes": { + "id": "paint0_linear_9100_35711", + "x1": "10", + "y1": "1.5", + "x2": "10", + "y2": "17.2499", + "gradientUnits": "userSpaceOnUse" + }, + "children": [ + { + "type": "element", + "name": "stop", + "attributes": { + "stop-color": "#296DFF" + }, + "children": [] + }, + { + "type": "element", + "name": "stop", + "attributes": { + "offset": "1", + "stop-color": "#155AEF" + }, + "children": [] + } + ] + } + ] + } + ] + }, + "name": "BucketsBlue" +} \ No newline at end of file diff --git a/web/app/components/base/icons/src/public/knowledge/online-drive/BucketsBlue.tsx b/web/app/components/base/icons/src/public/knowledge/online-drive/BucketsBlue.tsx new file mode 100644 index 0000000000..9fd923458e --- /dev/null +++ b/web/app/components/base/icons/src/public/knowledge/online-drive/BucketsBlue.tsx @@ -0,0 +1,20 @@ +// GENERATE BY script +// DON NOT EDIT IT MANUALLY + +import * as React from 'react' +import data from './BucketsBlue.json' +import IconBase from '@/app/components/base/icons/IconBase' +import type { IconData } from '@/app/components/base/icons/IconBase' + +const Icon = ( + { + ref, + ...props + }: React.SVGProps & { + ref?: React.RefObject>; + }, +) => + +Icon.displayName = 'BucketsBlue' + +export default Icon diff --git a/web/app/components/base/icons/src/public/knowledge/online-drive/BucketsGray.json b/web/app/components/base/icons/src/public/knowledge/online-drive/BucketsGray.json new file mode 100644 index 0000000000..d46055f7dd --- /dev/null +++ b/web/app/components/base/icons/src/public/knowledge/online-drive/BucketsGray.json @@ -0,0 +1,591 @@ +{ + "icon": { + "type": "element", + "isRootNode": true, + "name": "svg", + "attributes": { + "width": "18", + "height": "19", + "viewBox": "0 0 18 19", + "fill": "none", + "xmlns": "http://www.w3.org/2000/svg" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "filter": "url(#filter0_dg_9155_106569)" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "fill-rule": "evenodd", + "clip-rule": "evenodd", + "d": "M2.71865 4.37937C2.68524 4.25999 2.66663 4.13355 2.66663 4.00016C2.66663 3.4484 2.98515 3.01549 3.35148 2.7098C3.72157 2.40099 4.21723 2.15279 4.77114 1.95729C5.88498 1.56417 7.38013 1.3335 8.99996 1.3335C10.6198 1.3335 12.115 1.56417 13.2288 1.95729C13.7827 2.15279 14.2784 2.40099 14.6484 2.7098C15.0148 3.01549 15.3333 3.4484 15.3333 4.00016C15.3333 4.1336 15.3146 4.26009 15.2812 4.37951L13.9096 12.9861C13.8459 13.447 13.5885 13.8203 13.2754 14.1042C12.9608 14.3892 12.558 14.6152 12.122 14.7906C11.2488 15.1417 10.1334 15.3334 8.99996 15.3334C7.86896 15.3334 6.76119 15.1485 5.8906 14.8C5.07268 14.4727 4.23491 13.9023 4.09151 12.9934L4.09139 12.9926L2.71865 4.37937ZM13.7942 4.26678C13.5908 4.43652 13.2566 4.61928 12.785 4.78572C11.8479 5.11646 10.5098 5.3335 8.99996 5.3335C7.49016 5.3335 6.15199 5.11646 5.21489 4.78572C4.74334 4.61928 4.40913 4.43652 4.20573 4.26678C3.98111 4.07936 3.97209 3.92848 4.20573 3.73353C4.40913 3.56379 4.74334 3.38103 5.21489 3.2146C6.15199 2.88386 7.49016 2.66682 8.99996 2.66682C10.5098 2.66682 11.8479 2.88386 12.785 3.2146C13.2566 3.38103 13.5908 3.56379 13.7942 3.73353C14.0253 3.92637 14.0303 4.06978 13.7942 4.26678Z", + "fill": "url(#paint0_linear_9155_106569)" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "d": "M8.99963 1.5835C10.5986 1.5835 12.0645 1.81154 13.1451 2.19287C13.6835 2.38289 14.1491 2.61917 14.4879 2.90186C14.825 3.18316 15.0836 3.55264 15.0836 4.00049C15.0836 4.11011 15.0681 4.21383 15.0406 4.31201L15.0367 4.32568L15.0348 4.34033L13.6627 12.9468L13.6617 12.9517C13.6085 13.3371 13.3916 13.6605 13.1071 13.9185C12.8211 14.1776 12.4474 14.3908 12.0289 14.5591C11.1912 14.8959 10.1081 15.0835 8.99963 15.0835C7.89281 15.0835 6.81755 14.9019 5.98303 14.5679C5.18068 14.2467 4.4599 13.7234 4.3385 12.9546V12.9526L2.96545 4.34033L2.9635 4.32568L2.95959 4.31201L2.92737 4.16064C2.92011 4.10875 2.91664 4.05535 2.91663 4.00049C2.91663 3.55274 3.17436 3.18313 3.51135 2.90186C3.85017 2.61914 4.31573 2.38291 4.85413 2.19287C5.93475 1.81147 7.40056 1.58353 8.99963 1.5835ZM8.99963 2.4165C7.46933 2.41654 6.10163 2.63659 5.13147 2.979C4.64464 3.15085 4.28017 3.34571 4.04553 3.5415C3.91579 3.64976 3.78112 3.80197 3.78381 4.00635C3.7865 4.20806 3.92243 4.35576 4.04553 4.4585C4.28015 4.65428 4.64467 4.84915 5.13147 5.021C6.10163 5.36341 7.46933 5.58346 8.99963 5.5835C10.5299 5.5835 11.8975 5.36338 12.8678 5.021C13.3547 4.84912 13.72 4.65433 13.9547 4.4585C14.0815 4.35269 14.2209 4.20184 14.2194 3.99658C14.2178 3.79281 14.0778 3.64424 13.9547 3.5415C13.72 3.34567 13.3547 3.15088 12.8678 2.979C11.8975 2.63664 10.5299 2.4165 8.99963 2.4165Z", + "stroke": "white", + "stroke-opacity": "0.01", + "stroke-width": "0.5" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "path", + "attributes": { + "opacity": "0.8", + "d": "M8.99999 8.3335C8.36485 8.3335 7.81909 8.71403 7.57737 9.25902C6.99119 9.39939 6.55554 9.92652 6.55554 10.5557C6.55554 11.2921 7.1525 11.8891 7.88888 11.8891H10.3333C10.947 11.8891 11.4444 11.3916 11.4444 10.7779C11.4444 10.2358 11.0561 9.78432 10.5425 9.68647C10.4432 8.92308 9.79045 8.3335 8.99999 8.3335Z", + "fill": "white" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "fill-rule": "evenodd", + "clip-rule": "evenodd", + "d": "M2.71865 4.37908C2.68524 4.2597 2.66663 4.13326 2.66663 3.99986C2.66663 3.88343 2.68081 3.7723 2.70663 3.66653C2.71039 3.68194 2.7144 3.69723 2.71865 3.71241L4.09151 12.3264C4.23491 13.2353 5.07268 13.8057 5.8906 14.1331C6.76119 14.4815 7.86896 14.6665 8.99996 14.6665C10.1334 14.6665 11.2488 14.4747 12.122 14.1236C12.558 13.9483 12.9608 13.7223 13.2754 13.4372C13.5885 13.1533 13.8459 12.78 13.9096 12.3191L15.2812 3.71255C15.2855 3.69732 15.2895 3.68197 15.2933 3.6665C15.3191 3.77228 15.3333 3.88343 15.3333 3.99986C15.3333 4.1333 15.3146 4.2598 15.2812 4.37922L13.9096 12.9858C13.8459 13.4467 13.5885 13.82 13.2754 14.1039C12.9608 14.3889 12.558 14.6149 12.122 14.7903C11.2488 15.1414 10.1334 15.3331 8.99996 15.3331C7.86896 15.3331 6.76119 15.1482 5.8906 14.7997C5.07268 14.4724 4.23491 13.902 4.09151 12.9931L2.71865 4.37908Z", + "fill": "#101828", + "fill-opacity": "0.14" + }, + "children": [] + }, + { + "type": "element", + "name": "defs", + "attributes": {}, + "children": [ + { + "type": "element", + "name": "filter", + "attributes": { + "id": "filter0_dg_9155_106569", + "x": "0.666626", + "y": "0.133496", + "width": "16.6666", + "height": "18.2", + "filterUnits": "userSpaceOnUse", + "color-interpolation-filters": "sRGB" + }, + "children": [ + { + "type": "element", + "name": "feFlood", + "attributes": { + "flood-opacity": "0", + "result": "BackgroundImageFix" + }, + "children": [] + }, + { + "type": "element", + "name": "feColorMatrix", + "attributes": { + "in": "SourceAlpha", + "type": "matrix", + "values": "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0", + "result": "hardAlpha" + }, + "children": [] + }, + { + "type": "element", + "name": "feOffset", + "attributes": { + "dy": "1" + }, + "children": [] + }, + { + "type": "element", + "name": "feGaussianBlur", + "attributes": { + "stdDeviation": "1" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in2": "hardAlpha", + "operator": "out" + }, + "children": [] + }, + { + "type": "element", + "name": "feColorMatrix", + "attributes": { + "type": "matrix", + "values": "0 0 0 0 0.0352941 0 0 0 0 0.0352941 0 0 0 0 0.0431373 0 0 0 0.05 0" + }, + "children": [] + }, + { + "type": "element", + "name": "feBlend", + "attributes": { + "mode": "normal", + "in2": "BackgroundImageFix", + "result": "effect1_dropShadow_9155_106569" + }, + "children": [] + }, + { + "type": "element", + "name": "feBlend", + "attributes": { + "mode": "normal", + "in": "BackgroundImageFix", + "in2": "effect1_dropShadow_9155_106569", + "result": "BackgroundImageFix" + }, + "children": [] + }, + { + "type": "element", + "name": "feBlend", + "attributes": { + "mode": "normal", + "in": "SourceGraphic", + "in2": "BackgroundImageFix", + "result": "shape" + }, + "children": [] + }, + { + "type": "element", + "name": "feTurbulence", + "attributes": { + "type": "fractalNoise", + "baseFrequency": "9.0909090042114258 9.0909090042114258", + "numOctaves": "3", + "seed": "5297", + "result": "displacementX" + }, + "children": [] + }, + { + "type": "element", + "name": "feTurbulence", + "attributes": { + "type": "fractalNoise", + "baseFrequency": "9.0909090042114258 9.0909090042114258", + "numOctaves": "3", + "seed": "5298", + "result": "displacementY" + }, + "children": [] + }, + { + "type": "element", + "name": "feColorMatrix", + "attributes": { + "in": "displacementX", + "type": "matrix", + "values": "0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1", + "result": "displacementXRed" + }, + "children": [] + }, + { + "type": "element", + "name": "feColorMatrix", + "attributes": { + "in": "displacementY", + "type": "matrix", + "values": "0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in": "displacementXRed", + "operator": "arithmetic", + "k1": "0", + "k2": "1", + "k3": "1", + "k4": "0" + }, + "children": [] + }, + { + "type": "element", + "name": "feDisplacementMap", + "attributes": { + "in": "shape", + "scale": "2.4000000953674316", + "xChannelSelector": "R", + "yChannelSelector": "G", + "width": "100%", + "height": "100%" + }, + "children": [] + }, + { + "type": "element", + "name": "feColorMatrix", + "attributes": { + "type": "matrix", + "values": "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0" + }, + "children": [] + }, + { + "type": "element", + "name": "feComponentTransfer", + "attributes": { + "result": "sourceDisplacedAlpha" + }, + "children": [ + { + "type": "element", + "name": "feFuncA", + "attributes": { + "type": "gamma", + "exponent": "0.2" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "feColorMatrix", + "attributes": { + "in": "shape", + "type": "matrix", + "values": "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0" + }, + "children": [] + }, + { + "type": "element", + "name": "feComponentTransfer", + "attributes": { + "result": "inputSourceAlpha" + }, + "children": [ + { + "type": "element", + "name": "feFuncA", + "attributes": { + "type": "gamma", + "exponent": "0.2" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in": "sourceDisplacedAlpha", + "operator": "arithmetic", + "k1": "1", + "k2": "0", + "k3": "0", + "k4": "0", + "result": "displacementAlphasMultiplied" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in": "displacementAlphasMultiplied", + "operator": "arithmetic", + "k1": "0", + "k2": "0", + "k3": "-0.5", + "k4": "0.5", + "result": "centeringAdjustment" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in": "displacementX", + "in2": "displacementAlphasMultiplied", + "operator": "arithmetic", + "k1": "1", + "k2": "0", + "k3": "0", + "k4": "0" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in": "centeringAdjustment", + "operator": "arithmetic", + "k1": "0", + "k2": "1", + "k3": "1", + "k4": "0" + }, + "children": [] + }, + { + "type": "element", + "name": "feColorMatrix", + "attributes": { + "type": "matrix", + "values": "0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1", + "result": "displacementXFinal" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in": "displacementY", + "in2": "displacementAlphasMultiplied", + "operator": "arithmetic", + "k1": "1", + "k2": "0", + "k3": "0", + "k4": "0" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in": "centeringAdjustment", + "operator": "arithmetic", + "k1": "0", + "k2": "1", + "k3": "1", + "k4": "0" + }, + "children": [] + }, + { + "type": "element", + "name": "feColorMatrix", + "attributes": { + "type": "matrix", + "values": "0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1", + "result": "displacementYFinal" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in": "displacementXFinal", + "in2": "displacementYFinal", + "operator": "arithmetic", + "k1": "0", + "k2": "1", + "k3": "1", + "k4": "0" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in2": "displacementAlphasMultiplied", + "operator": "in", + "result": "displacementMap" + }, + "children": [] + }, + { + "type": "element", + "name": "feFlood", + "attributes": { + "flood-color": "rgb(127, 127, 127)", + "flood-opacity": "1" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in2": "displacementAlphasMultiplied", + "operator": "out" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in2": "displacementMap", + "operator": "over", + "result": "displacementMapWithBg" + }, + "children": [] + }, + { + "type": "element", + "name": "feDisplacementMap", + "attributes": { + "in": "shape", + "scale": "2.4000000953674316", + "xChannelSelector": "R", + "yChannelSelector": "G", + "width": "100%", + "height": "100%", + "result": "displacedImage" + }, + "children": [] + }, + { + "type": "element", + "name": "feColorMatrix", + "attributes": { + "in": "shape", + "type": "matrix", + "values": "1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 127 0", + "result": "imageOpaque" + }, + "children": [] + }, + { + "type": "element", + "name": "feDisplacementMap", + "attributes": { + "in": "imageOpaque", + "in2": "displacementMapWithBg", + "scale": "2.4000000953674316", + "xChannelSelector": "R", + "yChannelSelector": "G", + "width": "100%", + "height": "100%", + "result": "displacedImageOpaque" + }, + "children": [] + }, + { + "type": "element", + "name": "feColorMatrix", + "attributes": { + "in": "displacedImage", + "type": "matrix", + "values": "0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0", + "result": "displacedImageRed" + }, + "children": [] + }, + { + "type": "element", + "name": "feColorMatrix", + "attributes": { + "in": "shape", + "type": "matrix", + "values": "0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in": "displacedImageRed", + "operator": "atop", + "result": "transparencyRedMap" + }, + "children": [] + }, + { + "type": "element", + "name": "feColorMatrix", + "attributes": { + "in": "transparencyRedMap", + "type": "matrix", + "values": "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0", + "result": "transparencyAlphaMap" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in": "displacedImageOpaque", + "in2": "imageOpaque", + "operator": "over" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in2": "transparencyAlphaMap", + "operator": "in", + "result": "effect2_texture_9155_106569" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "linearGradient", + "attributes": { + "id": "paint0_linear_9155_106569", + "x1": "8.99996", + "y1": "1.3335", + "x2": "8.99996", + "y2": "15.3334", + "gradientUnits": "userSpaceOnUse" + }, + "children": [ + { + "type": "element", + "name": "stop", + "attributes": { + "stop-color": "#98A2B2" + }, + "children": [] + }, + { + "type": "element", + "name": "stop", + "attributes": { + "offset": "1", + "stop-color": "#676F83" + }, + "children": [] + } + ] + } + ] + } + ] + }, + "name": "BucketsGray" +} \ No newline at end of file diff --git a/web/app/components/base/icons/src/public/knowledge/online-drive/BucketsGray.tsx b/web/app/components/base/icons/src/public/knowledge/online-drive/BucketsGray.tsx new file mode 100644 index 0000000000..a646251629 --- /dev/null +++ b/web/app/components/base/icons/src/public/knowledge/online-drive/BucketsGray.tsx @@ -0,0 +1,20 @@ +// GENERATE BY script +// DON NOT EDIT IT MANUALLY + +import * as React from 'react' +import data from './BucketsGray.json' +import IconBase from '@/app/components/base/icons/IconBase' +import type { IconData } from '@/app/components/base/icons/IconBase' + +const Icon = ( + { + ref, + ...props + }: React.SVGProps & { + ref?: React.RefObject>; + }, +) => + +Icon.displayName = 'BucketsGray' + +export default Icon diff --git a/web/app/components/base/icons/src/public/knowledge/online-drive/Folder.json b/web/app/components/base/icons/src/public/knowledge/online-drive/Folder.json new file mode 100644 index 0000000000..53b4b4964e --- /dev/null +++ b/web/app/components/base/icons/src/public/knowledge/online-drive/Folder.json @@ -0,0 +1,1090 @@ +{ + "icon": { + "type": "element", + "isRootNode": true, + "name": "svg", + "attributes": { + "width": "20", + "height": "19", + "viewBox": "0 0 20 19", + "fill": "none", + "xmlns": "http://www.w3.org/2000/svg" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "filter": "url(#filter0_dg_9155_106307)" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "d": "M11.8106 3.75L8.81065 6.75H2.5V15C2.5 15.4142 2.83579 15.75 3.25 15.75H16.75C17.1642 15.75 17.5 15.4142 17.5 15V4.5C17.5 4.08579 17.1642 3.75 16.75 3.75H11.8106Z", + "fill": "url(#paint0_linear_9155_106307)" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "d": "M16.75 4C17.0262 4 17.25 4.22386 17.25 4.5V15C17.25 15.2762 17.0262 15.5 16.75 15.5H3.25C2.97386 15.5 2.75 15.2762 2.75 15V7H8.91406L11.9141 4H16.75Z", + "stroke": "white", + "stroke-opacity": "0.01", + "stroke-width": "0.5" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "g", + "attributes": { + "opacity": "0.6", + "filter": "url(#filter1_dg_9155_106307)" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "d": "M3.25 2.25C2.83579 2.25 2.5 2.58579 2.5 3V5.25H8.18934L10 3.43934L8.81065 2.25H3.25Z", + "fill": "#296DFF" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "d": "M3.25 2.5H8.70703L9.64648 3.43945L8.08594 5H2.75V3C2.75 2.72386 2.97386 2.5 3.25 2.5Z", + "stroke": "white", + "stroke-opacity": "0.01", + "stroke-width": "0.5" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "path", + "attributes": { + "d": "M17.5 15C17.5 15.4142 17.1642 15.75 16.75 15.75H3.25C2.83579 15.75 2.5 15.4142 2.5 15V14.25H17.5V15Z", + "fill": "#101828", + "fill-opacity": "0.14" + }, + "children": [] + }, + { + "type": "element", + "name": "defs", + "attributes": {}, + "children": [ + { + "type": "element", + "name": "filter", + "attributes": { + "id": "filter0_dg_9155_106307", + "x": "0.5", + "y": "2.55", + "width": "19", + "height": "16.2", + "filterUnits": "userSpaceOnUse", + "color-interpolation-filters": "sRGB" + }, + "children": [ + { + "type": "element", + "name": "feFlood", + "attributes": { + "flood-opacity": "0", + "result": "BackgroundImageFix" + }, + "children": [] + }, + { + "type": "element", + "name": "feColorMatrix", + "attributes": { + "in": "SourceAlpha", + "type": "matrix", + "values": "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0", + "result": "hardAlpha" + }, + "children": [] + }, + { + "type": "element", + "name": "feOffset", + "attributes": { + "dy": "1" + }, + "children": [] + }, + { + "type": "element", + "name": "feGaussianBlur", + "attributes": { + "stdDeviation": "1" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in2": "hardAlpha", + "operator": "out" + }, + "children": [] + }, + { + "type": "element", + "name": "feColorMatrix", + "attributes": { + "type": "matrix", + "values": "0 0 0 0 0.0352941 0 0 0 0 0.0352941 0 0 0 0 0.0431373 0 0 0 0.05 0" + }, + "children": [] + }, + { + "type": "element", + "name": "feBlend", + "attributes": { + "mode": "normal", + "in2": "BackgroundImageFix", + "result": "effect1_dropShadow_9155_106307" + }, + "children": [] + }, + { + "type": "element", + "name": "feBlend", + "attributes": { + "mode": "normal", + "in": "BackgroundImageFix", + "in2": "effect1_dropShadow_9155_106307", + "result": "BackgroundImageFix" + }, + "children": [] + }, + { + "type": "element", + "name": "feBlend", + "attributes": { + "mode": "normal", + "in": "SourceGraphic", + "in2": "BackgroundImageFix", + "result": "shape" + }, + "children": [] + }, + { + "type": "element", + "name": "feTurbulence", + "attributes": { + "type": "fractalNoise", + "baseFrequency": "9.0909090042114258 9.0909090042114258", + "numOctaves": "3", + "seed": "8029", + "result": "displacementX" + }, + "children": [] + }, + { + "type": "element", + "name": "feTurbulence", + "attributes": { + "type": "fractalNoise", + "baseFrequency": "9.0909090042114258 9.0909090042114258", + "numOctaves": "3", + "seed": "8030", + "result": "displacementY" + }, + "children": [] + }, + { + "type": "element", + "name": "feColorMatrix", + "attributes": { + "in": "displacementX", + "type": "matrix", + "values": "0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1", + "result": "displacementXRed" + }, + "children": [] + }, + { + "type": "element", + "name": "feColorMatrix", + "attributes": { + "in": "displacementY", + "type": "matrix", + "values": "0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in": "displacementXRed", + "operator": "arithmetic", + "k1": "0", + "k2": "1", + "k3": "1", + "k4": "0" + }, + "children": [] + }, + { + "type": "element", + "name": "feDisplacementMap", + "attributes": { + "in": "shape", + "scale": "2.4000000953674316", + "xChannelSelector": "R", + "yChannelSelector": "G", + "width": "100%", + "height": "100%" + }, + "children": [] + }, + { + "type": "element", + "name": "feColorMatrix", + "attributes": { + "type": "matrix", + "values": "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0" + }, + "children": [] + }, + { + "type": "element", + "name": "feComponentTransfer", + "attributes": { + "result": "sourceDisplacedAlpha" + }, + "children": [ + { + "type": "element", + "name": "feFuncA", + "attributes": { + "type": "gamma", + "exponent": "0.2" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "feColorMatrix", + "attributes": { + "in": "shape", + "type": "matrix", + "values": "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0" + }, + "children": [] + }, + { + "type": "element", + "name": "feComponentTransfer", + "attributes": { + "result": "inputSourceAlpha" + }, + "children": [ + { + "type": "element", + "name": "feFuncA", + "attributes": { + "type": "gamma", + "exponent": "0.2" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in": "sourceDisplacedAlpha", + "operator": "arithmetic", + "k1": "1", + "k2": "0", + "k3": "0", + "k4": "0", + "result": "displacementAlphasMultiplied" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in": "displacementAlphasMultiplied", + "operator": "arithmetic", + "k1": "0", + "k2": "0", + "k3": "-0.5", + "k4": "0.5", + "result": "centeringAdjustment" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in": "displacementX", + "in2": "displacementAlphasMultiplied", + "operator": "arithmetic", + "k1": "1", + "k2": "0", + "k3": "0", + "k4": "0" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in": "centeringAdjustment", + "operator": "arithmetic", + "k1": "0", + "k2": "1", + "k3": "1", + "k4": "0" + }, + "children": [] + }, + { + "type": "element", + "name": "feColorMatrix", + "attributes": { + "type": "matrix", + "values": "0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1", + "result": "displacementXFinal" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in": "displacementY", + "in2": "displacementAlphasMultiplied", + "operator": "arithmetic", + "k1": "1", + "k2": "0", + "k3": "0", + "k4": "0" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in": "centeringAdjustment", + "operator": "arithmetic", + "k1": "0", + "k2": "1", + "k3": "1", + "k4": "0" + }, + "children": [] + }, + { + "type": "element", + "name": "feColorMatrix", + "attributes": { + "type": "matrix", + "values": "0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1", + "result": "displacementYFinal" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in": "displacementXFinal", + "in2": "displacementYFinal", + "operator": "arithmetic", + "k1": "0", + "k2": "1", + "k3": "1", + "k4": "0" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in2": "displacementAlphasMultiplied", + "operator": "in", + "result": "displacementMap" + }, + "children": [] + }, + { + "type": "element", + "name": "feFlood", + "attributes": { + "flood-color": "rgb(127, 127, 127)", + "flood-opacity": "1" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in2": "displacementAlphasMultiplied", + "operator": "out" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in2": "displacementMap", + "operator": "over", + "result": "displacementMapWithBg" + }, + "children": [] + }, + { + "type": "element", + "name": "feDisplacementMap", + "attributes": { + "in": "shape", + "scale": "2.4000000953674316", + "xChannelSelector": "R", + "yChannelSelector": "G", + "width": "100%", + "height": "100%", + "result": "displacedImage" + }, + "children": [] + }, + { + "type": "element", + "name": "feColorMatrix", + "attributes": { + "in": "shape", + "type": "matrix", + "values": "1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 127 0", + "result": "imageOpaque" + }, + "children": [] + }, + { + "type": "element", + "name": "feDisplacementMap", + "attributes": { + "in": "imageOpaque", + "in2": "displacementMapWithBg", + "scale": "2.4000000953674316", + "xChannelSelector": "R", + "yChannelSelector": "G", + "width": "100%", + "height": "100%", + "result": "displacedImageOpaque" + }, + "children": [] + }, + { + "type": "element", + "name": "feColorMatrix", + "attributes": { + "in": "displacedImage", + "type": "matrix", + "values": "0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0", + "result": "displacedImageRed" + }, + "children": [] + }, + { + "type": "element", + "name": "feColorMatrix", + "attributes": { + "in": "shape", + "type": "matrix", + "values": "0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in": "displacedImageRed", + "operator": "atop", + "result": "transparencyRedMap" + }, + "children": [] + }, + { + "type": "element", + "name": "feColorMatrix", + "attributes": { + "in": "transparencyRedMap", + "type": "matrix", + "values": "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0", + "result": "transparencyAlphaMap" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in": "displacedImageOpaque", + "in2": "imageOpaque", + "operator": "over" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in2": "transparencyAlphaMap", + "operator": "in", + "result": "effect2_texture_9155_106307" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "filter", + "attributes": { + "id": "filter1_dg_9155_106307", + "x": "0.5", + "y": "1.05", + "width": "11.5", + "height": "7.2", + "filterUnits": "userSpaceOnUse", + "color-interpolation-filters": "sRGB" + }, + "children": [ + { + "type": "element", + "name": "feFlood", + "attributes": { + "flood-opacity": "0", + "result": "BackgroundImageFix" + }, + "children": [] + }, + { + "type": "element", + "name": "feColorMatrix", + "attributes": { + "in": "SourceAlpha", + "type": "matrix", + "values": "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0", + "result": "hardAlpha" + }, + "children": [] + }, + { + "type": "element", + "name": "feOffset", + "attributes": { + "dy": "1" + }, + "children": [] + }, + { + "type": "element", + "name": "feGaussianBlur", + "attributes": { + "stdDeviation": "1" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in2": "hardAlpha", + "operator": "out" + }, + "children": [] + }, + { + "type": "element", + "name": "feColorMatrix", + "attributes": { + "type": "matrix", + "values": "0 0 0 0 0.0352941 0 0 0 0 0.0352941 0 0 0 0 0.0431373 0 0 0 0.05 0" + }, + "children": [] + }, + { + "type": "element", + "name": "feBlend", + "attributes": { + "mode": "normal", + "in2": "BackgroundImageFix", + "result": "effect1_dropShadow_9155_106307" + }, + "children": [] + }, + { + "type": "element", + "name": "feBlend", + "attributes": { + "mode": "normal", + "in": "BackgroundImageFix", + "in2": "effect1_dropShadow_9155_106307", + "result": "BackgroundImageFix" + }, + "children": [] + }, + { + "type": "element", + "name": "feBlend", + "attributes": { + "mode": "normal", + "in": "SourceGraphic", + "in2": "BackgroundImageFix", + "result": "shape" + }, + "children": [] + }, + { + "type": "element", + "name": "feTurbulence", + "attributes": { + "type": "fractalNoise", + "baseFrequency": "9.0909090042114258 9.0909090042114258", + "numOctaves": "3", + "seed": "8754", + "result": "displacementX" + }, + "children": [] + }, + { + "type": "element", + "name": "feTurbulence", + "attributes": { + "type": "fractalNoise", + "baseFrequency": "9.0909090042114258 9.0909090042114258", + "numOctaves": "3", + "seed": "8755", + "result": "displacementY" + }, + "children": [] + }, + { + "type": "element", + "name": "feColorMatrix", + "attributes": { + "in": "displacementX", + "type": "matrix", + "values": "0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1", + "result": "displacementXRed" + }, + "children": [] + }, + { + "type": "element", + "name": "feColorMatrix", + "attributes": { + "in": "displacementY", + "type": "matrix", + "values": "0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in": "displacementXRed", + "operator": "arithmetic", + "k1": "0", + "k2": "1", + "k3": "1", + "k4": "0" + }, + "children": [] + }, + { + "type": "element", + "name": "feDisplacementMap", + "attributes": { + "in": "shape", + "scale": "2.4000000953674316", + "xChannelSelector": "R", + "yChannelSelector": "G", + "width": "100%", + "height": "100%" + }, + "children": [] + }, + { + "type": "element", + "name": "feColorMatrix", + "attributes": { + "type": "matrix", + "values": "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0" + }, + "children": [] + }, + { + "type": "element", + "name": "feComponentTransfer", + "attributes": { + "result": "sourceDisplacedAlpha" + }, + "children": [ + { + "type": "element", + "name": "feFuncA", + "attributes": { + "type": "gamma", + "exponent": "0.2" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "feColorMatrix", + "attributes": { + "in": "shape", + "type": "matrix", + "values": "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0" + }, + "children": [] + }, + { + "type": "element", + "name": "feComponentTransfer", + "attributes": { + "result": "inputSourceAlpha" + }, + "children": [ + { + "type": "element", + "name": "feFuncA", + "attributes": { + "type": "gamma", + "exponent": "0.2" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in": "sourceDisplacedAlpha", + "operator": "arithmetic", + "k1": "1", + "k2": "0", + "k3": "0", + "k4": "0", + "result": "displacementAlphasMultiplied" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in": "displacementAlphasMultiplied", + "operator": "arithmetic", + "k1": "0", + "k2": "0", + "k3": "-0.5", + "k4": "0.5", + "result": "centeringAdjustment" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in": "displacementX", + "in2": "displacementAlphasMultiplied", + "operator": "arithmetic", + "k1": "1", + "k2": "0", + "k3": "0", + "k4": "0" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in": "centeringAdjustment", + "operator": "arithmetic", + "k1": "0", + "k2": "1", + "k3": "1", + "k4": "0" + }, + "children": [] + }, + { + "type": "element", + "name": "feColorMatrix", + "attributes": { + "type": "matrix", + "values": "0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1", + "result": "displacementXFinal" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in": "displacementY", + "in2": "displacementAlphasMultiplied", + "operator": "arithmetic", + "k1": "1", + "k2": "0", + "k3": "0", + "k4": "0" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in": "centeringAdjustment", + "operator": "arithmetic", + "k1": "0", + "k2": "1", + "k3": "1", + "k4": "0" + }, + "children": [] + }, + { + "type": "element", + "name": "feColorMatrix", + "attributes": { + "type": "matrix", + "values": "0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1", + "result": "displacementYFinal" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in": "displacementXFinal", + "in2": "displacementYFinal", + "operator": "arithmetic", + "k1": "0", + "k2": "1", + "k3": "1", + "k4": "0" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in2": "displacementAlphasMultiplied", + "operator": "in", + "result": "displacementMap" + }, + "children": [] + }, + { + "type": "element", + "name": "feFlood", + "attributes": { + "flood-color": "rgb(127, 127, 127)", + "flood-opacity": "1" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in2": "displacementAlphasMultiplied", + "operator": "out" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in2": "displacementMap", + "operator": "over", + "result": "displacementMapWithBg" + }, + "children": [] + }, + { + "type": "element", + "name": "feDisplacementMap", + "attributes": { + "in": "shape", + "scale": "2.4000000953674316", + "xChannelSelector": "R", + "yChannelSelector": "G", + "width": "100%", + "height": "100%", + "result": "displacedImage" + }, + "children": [] + }, + { + "type": "element", + "name": "feColorMatrix", + "attributes": { + "in": "shape", + "type": "matrix", + "values": "1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 127 0", + "result": "imageOpaque" + }, + "children": [] + }, + { + "type": "element", + "name": "feDisplacementMap", + "attributes": { + "in": "imageOpaque", + "in2": "displacementMapWithBg", + "scale": "2.4000000953674316", + "xChannelSelector": "R", + "yChannelSelector": "G", + "width": "100%", + "height": "100%", + "result": "displacedImageOpaque" + }, + "children": [] + }, + { + "type": "element", + "name": "feColorMatrix", + "attributes": { + "in": "displacedImage", + "type": "matrix", + "values": "0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0", + "result": "displacedImageRed" + }, + "children": [] + }, + { + "type": "element", + "name": "feColorMatrix", + "attributes": { + "in": "shape", + "type": "matrix", + "values": "0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in": "displacedImageRed", + "operator": "atop", + "result": "transparencyRedMap" + }, + "children": [] + }, + { + "type": "element", + "name": "feColorMatrix", + "attributes": { + "in": "transparencyRedMap", + "type": "matrix", + "values": "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0", + "result": "transparencyAlphaMap" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in": "displacedImageOpaque", + "in2": "imageOpaque", + "operator": "over" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in2": "transparencyAlphaMap", + "operator": "in", + "result": "effect2_texture_9155_106307" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "linearGradient", + "attributes": { + "id": "paint0_linear_9155_106307", + "x1": "10", + "y1": "3.75", + "x2": "10", + "y2": "15.75", + "gradientUnits": "userSpaceOnUse" + }, + "children": [ + { + "type": "element", + "name": "stop", + "attributes": { + "stop-color": "#296DFF" + }, + "children": [] + }, + { + "type": "element", + "name": "stop", + "attributes": { + "offset": "1", + "stop-color": "#155AEF" + }, + "children": [] + } + ] + } + ] + } + ] + }, + "name": "Folder" +} \ No newline at end of file diff --git a/web/app/components/base/icons/src/public/knowledge/online-drive/Folder.tsx b/web/app/components/base/icons/src/public/knowledge/online-drive/Folder.tsx new file mode 100644 index 0000000000..e7a3fdf167 --- /dev/null +++ b/web/app/components/base/icons/src/public/knowledge/online-drive/Folder.tsx @@ -0,0 +1,20 @@ +// GENERATE BY script +// DON NOT EDIT IT MANUALLY + +import * as React from 'react' +import data from './Folder.json' +import IconBase from '@/app/components/base/icons/IconBase' +import type { IconData } from '@/app/components/base/icons/IconBase' + +const Icon = ( + { + ref, + ...props + }: React.SVGProps & { + ref?: React.RefObject>; + }, +) => + +Icon.displayName = 'Folder' + +export default Icon diff --git a/web/app/components/base/icons/src/public/knowledge/online-drive/index.ts b/web/app/components/base/icons/src/public/knowledge/online-drive/index.ts new file mode 100644 index 0000000000..44e4a9d640 --- /dev/null +++ b/web/app/components/base/icons/src/public/knowledge/online-drive/index.ts @@ -0,0 +1,3 @@ +export { default as BucketsBlue } from './BucketsBlue' +export { default as BucketsGray } from './BucketsGray' +export { default as Folder } from './Folder' diff --git a/web/app/components/base/radio/ui.tsx b/web/app/components/base/radio/ui.tsx index 19778c7cc3..c576578e06 100644 --- a/web/app/components/base/radio/ui.tsx +++ b/web/app/components/base/radio/ui.tsx @@ -7,12 +7,14 @@ type Props = { isChecked: boolean disabled?: boolean onCheck?: () => void + className?: string } const RadioUI: FC = ({ isChecked, disabled = false, onCheck, + className, }) => { return (
= ({ isChecked && disabled && 'border-[5px] border-components-radio-border-checked-disabled', !isChecked && disabled && 'border border-components-radio-border-disabled bg-components-radio-bg-disabled', !disabled && 'bg-components-radio-bg shadow-xs shadow-shadow-shadow-3 hover:bg-components-radio-bg-hover', + className, )} onClick={() => { + if (disabled) return onCheck?.() }} /> diff --git a/web/app/components/datasets/common/document-file-icon.tsx b/web/app/components/datasets/common/document-file-icon.tsx index 5842cbbc7c..dfe28f6624 100644 --- a/web/app/components/datasets/common/document-file-icon.tsx +++ b/web/app/components/datasets/common/document-file-icon.tsx @@ -22,7 +22,7 @@ const extendToFileTypeMap: { [key: string]: FileAppearanceType } = { type Props = { extension?: string name?: string - size?: 'sm' | 'lg' | 'md' + size?: 'sm' | 'md' | 'lg' | 'xl' className?: string } diff --git a/web/app/components/datasets/common/document-picker/document-list.tsx b/web/app/components/datasets/common/document-picker/document-list.tsx index 6b51973ccc..20ec949bbd 100644 --- a/web/app/components/datasets/common/document-picker/document-list.tsx +++ b/web/app/components/datasets/common/document-picker/document-list.tsx @@ -30,7 +30,7 @@ const DocumentList: FC = ({ className='flex h-8 cursor-pointer items-center space-x-2 rounded-lg px-2 hover:bg-state-base-hover' onClick={handleChange(item)} > - +
{name}
) diff --git a/web/app/components/datasets/common/document-picker/index.tsx b/web/app/components/datasets/common/document-picker/index.tsx index 7c03082b10..62c877376c 100644 --- a/web/app/components/datasets/common/document-picker/index.tsx +++ b/web/app/components/datasets/common/document-picker/index.tsx @@ -75,7 +75,7 @@ const DocumentPicker: FC = ({ >
- +
{name || '--'} diff --git a/web/app/components/datasets/common/document-picker/preview-document-picker.tsx b/web/app/components/datasets/common/document-picker/preview-document-picker.tsx index a6de0c398d..b6ffa520a8 100644 --- a/web/app/components/datasets/common/document-picker/preview-document-picker.tsx +++ b/web/app/components/datasets/common/document-picker/preview-document-picker.tsx @@ -51,7 +51,7 @@ const PreviewDocumentPicker: FC = ({ >
- +
{name || '--'} diff --git a/web/app/components/datasets/create/embedding-process/index.tsx b/web/app/components/datasets/create/embedding-process/index.tsx index 3858057207..5e1a73618a 100644 --- a/web/app/components/datasets/create/embedding-process/index.tsx +++ b/web/app/components/datasets/create/embedding-process/index.tsx @@ -294,7 +294,8 @@ const EmbeddingProcess: FC = ({ datasetId, batchId, documents = [], index
{getSourceType(indexingStatusDetail.id) === DataSourceType.FILE && ( diff --git a/web/app/components/datasets/create/file-uploader/index.tsx b/web/app/components/datasets/create/file-uploader/index.tsx index 92dfc0f9c0..cd44231d24 100644 --- a/web/app/components/datasets/create/file-uploader/index.tsx +++ b/web/app/components/datasets/create/file-uploader/index.tsx @@ -340,7 +340,8 @@ const FileUploader = ({ >
diff --git a/web/app/components/datasets/documents/create-from-pipeline/processing/embedding-process/index.tsx b/web/app/components/datasets/documents/create-from-pipeline/processing/embedding-process/index.tsx index 8a6720ec0d..3e34227a10 100644 --- a/web/app/components/datasets/documents/create-from-pipeline/processing/embedding-process/index.tsx +++ b/web/app/components/datasets/documents/create-from-pipeline/processing/embedding-process/index.tsx @@ -164,7 +164,8 @@ const EmbeddingProcess = ({
{getSourceType(indexingStatusDetail.id) === DatasourceType.localFile && ( diff --git a/web/app/components/datasets/hit-testing/utils/extension-to-file-type.ts b/web/app/components/datasets/hit-testing/utils/extension-to-file-type.ts index 68db742199..d4e5f3a980 100644 --- a/web/app/components/datasets/hit-testing/utils/extension-to-file-type.ts +++ b/web/app/components/datasets/hit-testing/utils/extension-to-file-type.ts @@ -7,9 +7,6 @@ export const extensionToFileType = (extension: string): FileAppearanceTypeEnum = case 'doc': case 'docx': return FileAppearanceTypeEnum.word - case 'txt': - case 'epub': - return FileAppearanceTypeEnum.document case 'md': case 'mdx': case 'markdown': @@ -18,6 +15,8 @@ export const extensionToFileType = (extension: string): FileAppearanceTypeEnum = case 'xls': case 'xlsx': return FileAppearanceTypeEnum.excel + case 'txt': + case 'epub': case 'html': case 'htm': case 'xml': diff --git a/web/app/components/rag-pipeline/components/panel/test-run/data-source/local-file/index.tsx b/web/app/components/rag-pipeline/components/panel/test-run/data-source/local-file/index.tsx index cfe1883f99..794913eb14 100644 --- a/web/app/components/rag-pipeline/components/panel/test-run/data-source/local-file/index.tsx +++ b/web/app/components/rag-pipeline/components/panel/test-run/data-source/local-file/index.tsx @@ -295,7 +295,8 @@ const LocalFile = ({ >
diff --git a/web/app/components/rag-pipeline/components/panel/test-run/data-source/online-drive/file-list/header/breadcrumbs.tsx b/web/app/components/rag-pipeline/components/panel/test-run/data-source/online-drive/file-list/header/breadcrumbs.tsx new file mode 100644 index 0000000000..56a595f8fb --- /dev/null +++ b/web/app/components/rag-pipeline/components/panel/test-run/data-source/online-drive/file-list/header/breadcrumbs.tsx @@ -0,0 +1,35 @@ +import React from 'react' +import { useTranslation } from 'react-i18next' + +type BreadcrumbsProps = { + prefix: string[] + keywords: string + resetKeywords: () => void + searchResultsLength: number +} + +const Breadcrumbs = ({ + prefix, + keywords, + resetKeywords, + searchResultsLength, +}: BreadcrumbsProps) => { + const { t } = useTranslation() + const isRoot = prefix.length === 0 + const isSearching = !!keywords + + return ( +
+ {isRoot && ( +
+ {t('datasetPipeline.onlineDrive.breadcrumbs.allBuckets')} +
+ )} + {!isRoot && ( +
+ )} +
+ ) +} + +export default React.memo(Breadcrumbs) diff --git a/web/app/components/rag-pipeline/components/panel/test-run/data-source/online-drive/file-list/header/index.tsx b/web/app/components/rag-pipeline/components/panel/test-run/data-source/online-drive/file-list/header/index.tsx new file mode 100644 index 0000000000..82feaa1c75 --- /dev/null +++ b/web/app/components/rag-pipeline/components/panel/test-run/data-source/online-drive/file-list/header/index.tsx @@ -0,0 +1,64 @@ +import React, { useState } from 'react' +import Breadcrumbs from './breadcrumbs' +import Input from '@/app/components/base/input' +import { useDebounceFn } from 'ahooks' +import { useTranslation } from 'react-i18next' + +type HeaderProps = { + prefix: string[] + keywords: string + resetKeywords: () => void + updateKeywords: (keywords: string) => void + searchResultsLength: number +} + +const Header = ({ + prefix, + keywords, + resetKeywords, + updateKeywords, + searchResultsLength, +}: HeaderProps) => { + const { t } = useTranslation() + const [inputValue, setInputValue] = useState(keywords) + + const { run: updateKeywordsWithDebounce } = useDebounceFn( + (keywords: string) => { + updateKeywords(keywords) + }, + { wait: 500 }, + ) + + const handleInputChange = (e: React.ChangeEvent) => { + const keywords = e.target.value + setInputValue(keywords) + updateKeywordsWithDebounce(keywords) + } + + const handleResetKeywords = () => { + setInputValue('') + resetKeywords() + } + + return ( +
+ + +
+ ) +} + +export default React.memo(Header) diff --git a/web/app/components/rag-pipeline/components/panel/test-run/data-source/online-drive/file-list/index.tsx b/web/app/components/rag-pipeline/components/panel/test-run/data-source/online-drive/file-list/index.tsx new file mode 100644 index 0000000000..3f7350de97 --- /dev/null +++ b/web/app/components/rag-pipeline/components/panel/test-run/data-source/online-drive/file-list/index.tsx @@ -0,0 +1,41 @@ +import type { OnlineDriveFile } from '@/models/pipeline' +import Header from './header' +import List from './list' + +type FileListProps = { + fileList: OnlineDriveFile[] + selectedFileList: string[] + prefix: string[] + keywords: string + resetKeywords: () => void + updateKeywords: (keywords: string) => void + searchResultsLength: number +} + +const FileList = ({ + fileList, + selectedFileList, + prefix, + keywords, + resetKeywords, + updateKeywords, + searchResultsLength, +}: FileListProps) => { + return ( +
+
+ +
+ ) +} + +export default FileList diff --git a/web/app/components/rag-pipeline/components/panel/test-run/data-source/online-drive/file-list/list/file-icon.tsx b/web/app/components/rag-pipeline/components/panel/test-run/data-source/online-drive/file-list/list/file-icon.tsx new file mode 100644 index 0000000000..bbc928f161 --- /dev/null +++ b/web/app/components/rag-pipeline/components/panel/test-run/data-source/online-drive/file-list/list/file-icon.tsx @@ -0,0 +1,42 @@ +import React from 'react' +import { OnlineDriveFileType } from '@/models/pipeline' +import { BucketsBlue, Folder } from '@/app/components/base/icons/src/public/knowledge/online-drive' +import FileTypeIcon from '@/app/components/base/file-uploader/file-type-icon' +import { getFileType } from './utils' +import cn from '@/utils/classnames' + +type FileIconProps = { + type: OnlineDriveFileType + fileName: string + size?: 'sm' | 'md' | 'lg' | 'xl' + className?: string +} + +const FileIcon = ({ + type, + fileName, + size = 'md', + className, +}: FileIconProps) => { + if (type === OnlineDriveFileType.bucket) { + return ( + + ) + } + + if (type === OnlineDriveFileType.folder) { + return ( + + ) + } + + return ( + + ) +} + +export default React.memo(FileIcon) diff --git a/web/app/components/rag-pipeline/components/panel/test-run/data-source/online-drive/file-list/list/index.tsx b/web/app/components/rag-pipeline/components/panel/test-run/data-source/online-drive/file-list/list/index.tsx new file mode 100644 index 0000000000..f6eaafcc80 --- /dev/null +++ b/web/app/components/rag-pipeline/components/panel/test-run/data-source/online-drive/file-list/list/index.tsx @@ -0,0 +1,35 @@ +import type { OnlineDriveFile } from '@/models/pipeline' +import Item from './item' + +type FileListProps = { + fileList: OnlineDriveFile[] + selectedFileList: string[] +} + +const List = ({ + fileList, + selectedFileList, +}: FileListProps) => { + return ( +
+
+ { + fileList.map((file) => { + const isSelected = selectedFileList.includes(file.key) + return ( + { console.log(file) }} + onOpen={(file) => { console.log(file) }} + /> + ) + }) + } +
+
+ ) +} + +export default List diff --git a/web/app/components/rag-pipeline/components/panel/test-run/data-source/online-drive/file-list/list/item.tsx b/web/app/components/rag-pipeline/components/panel/test-run/data-source/online-drive/file-list/list/item.tsx new file mode 100644 index 0000000000..bf7892bf0f --- /dev/null +++ b/web/app/components/rag-pipeline/components/panel/test-run/data-source/online-drive/file-list/list/item.tsx @@ -0,0 +1,78 @@ +import Checkbox from '@/app/components/base/checkbox' +import Radio from '@/app/components/base/radio/ui' +import type { OnlineDriveFile } from '@/models/pipeline' +import React, { useCallback } from 'react' +import FileIcon from './file-icon' +import { formatFileSize } from '@/utils/format' +import Tooltip from '@/app/components/base/tooltip' +import { useTranslation } from 'react-i18next' +import cn from '@/utils/classnames' + +type ItemProps = { + file: OnlineDriveFile + isSelected: boolean + disabled?: boolean + isMultipleChoice?: boolean + onSelect: (file: OnlineDriveFile) => void + onOpen: (file: OnlineDriveFile) => void +} + +const Item = ({ + file, + isSelected, + disabled = false, + isMultipleChoice = true, + onSelect, + onOpen, +}: ItemProps) => { + const { t } = useTranslation() + const isBucket = file.type === 'bucket' + const isFolder = file.type === 'folder' + + const Wrapper = disabled ? Tooltip : React.Fragment + + const handleSelect = useCallback(() => { + onSelect(file) + }, [file, onSelect]) + + const handleClickItem = useCallback((e: React.MouseEvent) => { + e.stopPropagation() + if (disabled) return + if (isBucket || isFolder) + onOpen(file) + onSelect(file) + }, [disabled, file, isBucket, isFolder, onOpen, onSelect]) + + return ( +
+ {!isBucket && isMultipleChoice && ( + + )} + {!isBucket && !isMultipleChoice && ( + + )} + +
+ + {file.key} + {!isFolder && file.size && ( + {formatFileSize(file.size)} + )} +
+
+
+ ) +} + +export default React.memo(Item) diff --git a/web/app/components/rag-pipeline/components/panel/test-run/data-source/online-drive/file-list/list/utils.ts b/web/app/components/rag-pipeline/components/panel/test-run/data-source/online-drive/file-list/list/utils.ts new file mode 100644 index 0000000000..6b367ebe3c --- /dev/null +++ b/web/app/components/rag-pipeline/components/panel/test-run/data-source/online-drive/file-list/list/utils.ts @@ -0,0 +1,51 @@ +import { FileAppearanceTypeEnum } from '@/app/components/base/file-uploader/types' +import { FILE_EXTS } from '@/app/components/base/prompt-editor/constants' + +export const getFileExtension = (fileName: string): string => { + if (!fileName) + return '' + const parts = fileName.split('.') + if (parts.length <= 1 || (parts[0] === '' && parts.length === 2)) + return '' + + return parts[parts.length - 1].toLowerCase() +} + +export const getFileType = (fileName: string) => { + const extension = getFileExtension(fileName) + + if (extension === 'gif') + return FileAppearanceTypeEnum.gif + + if (FILE_EXTS.image.includes(extension.toUpperCase())) + return FileAppearanceTypeEnum.image + + if (FILE_EXTS.video.includes(extension.toUpperCase())) + return FileAppearanceTypeEnum.video + + if (FILE_EXTS.audio.includes(extension.toUpperCase())) + return FileAppearanceTypeEnum.audio + + if (extension === 'html' || extension === 'htm' || extension === 'xml' || extension === 'json') + return FileAppearanceTypeEnum.code + + if (extension === 'pdf') + return FileAppearanceTypeEnum.pdf + + if (extension === 'md' || extension === 'markdown' || extension === 'mdx') + return FileAppearanceTypeEnum.markdown + + if (extension === 'xlsx' || extension === 'xls' || extension === 'csv') + return FileAppearanceTypeEnum.excel + + if (extension === 'docx' || extension === 'doc') + return FileAppearanceTypeEnum.word + + if (extension === 'pptx' || extension === 'ppt') + return FileAppearanceTypeEnum.ppt + + if (FILE_EXTS.document.includes(extension.toUpperCase())) + return FileAppearanceTypeEnum.document + + return FileAppearanceTypeEnum.custom +} diff --git a/web/app/components/rag-pipeline/components/panel/test-run/data-source/online-drive/index.tsx b/web/app/components/rag-pipeline/components/panel/test-run/data-source/online-drive/index.tsx index 875d276825..f0301430ec 100644 --- a/web/app/components/rag-pipeline/components/panel/test-run/data-source/online-drive/index.tsx +++ b/web/app/components/rag-pipeline/components/panel/test-run/data-source/online-drive/index.tsx @@ -1,5 +1,8 @@ import type { DataSourceNodeType } from '@/app/components/workflow/nodes/data-source/types' import Header from './header' +import { useCallback, useMemo, useState } from 'react' +import FileList from './file-list' +import { OnlineDriveFileType } from '@/models/pipeline' type OnlineDriveProps = { nodeData: DataSourceNodeType @@ -8,12 +11,44 @@ type OnlineDriveProps = { const OnlineDrive = ({ nodeData, }: OnlineDriveProps) => { + const [prefix, setPrefix] = useState([]) + const [keywords, setKeywords] = useState('') + const [startAfter, setStartAfter] = useState('') + const [selectedFileList, setSelectedFileList] = useState([]) + + const updateKeywords = useCallback((keywords: string) => { + setKeywords(keywords) + }, []) + + const resetPrefix = useCallback(() => { + setKeywords('') + }, []) + + const fileList = useMemo(() => { + return [ + { + key: 'Bucket_1', + size: 1024, // unit bytes + type: OnlineDriveFileType.bucket, + }, + ] + }, []) + return (
+
) } diff --git a/web/app/components/rag-pipeline/components/panel/test-run/data-source/website-crawl/base/crawled-result-item.tsx b/web/app/components/rag-pipeline/components/panel/test-run/data-source/website-crawl/base/crawled-result-item.tsx index 2e80085cfe..753b32c396 100644 --- a/web/app/components/rag-pipeline/components/panel/test-run/data-source/website-crawl/base/crawled-result-item.tsx +++ b/web/app/components/rag-pipeline/components/panel/test-run/data-source/website-crawl/base/crawled-result-item.tsx @@ -14,7 +14,7 @@ type CrawledResultItemProps = { isPreview: boolean showPreview: boolean onPreview: () => void - supportMultipleChoice?: boolean + isMultipleChoice?: boolean } const CrawledResultItem = ({ @@ -24,7 +24,7 @@ const CrawledResultItem = ({ isPreview, onPreview, showPreview, - supportMultipleChoice = true, + isMultipleChoice = true, }: CrawledResultItemProps) => { const { t } = useTranslation() @@ -38,7 +38,7 @@ const CrawledResultItem = ({ isPreview ? 'bg-state-base-active' : 'group hover:bg-state-base-hover', )}> { - supportMultipleChoice ? ( + isMultipleChoice ? ( void onPreview?: (payload: CrawlResultItem, index: number) => void usedTime: number - supportMultipleChoice?: boolean + isMultipleChoice?: boolean } const CrawledResult = ({ @@ -27,7 +27,7 @@ const CrawledResult = ({ onSelectedChange, usedTime, onPreview, - supportMultipleChoice = true, + isMultipleChoice = true, }: CrawledResultProps) => { const { t } = useTranslation() @@ -44,11 +44,11 @@ const CrawledResult = ({ const handleItemCheckChange = useCallback((item: CrawlResultItem) => { return (checked: boolean) => { if (checked) - supportMultipleChoice ? onSelectedChange([...checkedList, item]) : onSelectedChange([item]) + isMultipleChoice ? onSelectedChange([...checkedList, item]) : onSelectedChange([item]) else onSelectedChange(checkedList.filter(checkedItem => checkedItem.source_url !== item.source_url)) } - }, [checkedList, onSelectedChange, supportMultipleChoice]) + }, [checkedList, onSelectedChange, isMultipleChoice]) const handlePreview = useCallback((index: number) => { if (!onPreview) return @@ -64,7 +64,7 @@ const CrawledResult = ({ })}
- {supportMultipleChoice && ( + {isMultipleChoice && (
))}
diff --git a/web/app/components/rag-pipeline/components/panel/test-run/data-source/website-crawl/index.tsx b/web/app/components/rag-pipeline/components/panel/test-run/data-source/website-crawl/index.tsx index 4c4582d8ee..8287ba891f 100644 --- a/web/app/components/rag-pipeline/components/panel/test-run/data-source/website-crawl/index.tsx +++ b/web/app/components/rag-pipeline/components/panel/test-run/data-source/website-crawl/index.tsx @@ -169,7 +169,7 @@ const WebsiteCrawl = ({ usedTime={Number.parseFloat(crawlResult?.time_consuming as string) || 0} previewIndex={previewIndex} onPreview={onPreview} - supportMultipleChoice={false} // only support single choice in test run + isMultipleChoice={false} // only support single choice in test run /> )}
diff --git a/web/app/components/workflow/nodes/_base/components/file-type-item.tsx b/web/app/components/workflow/nodes/_base/components/file-type-item.tsx index 6791dbbec5..b6004fd3b7 100644 --- a/web/app/components/workflow/nodes/_base/components/file-type-item.tsx +++ b/web/app/components/workflow/nodes/_base/components/file-type-item.tsx @@ -47,7 +47,7 @@ const FileTypeItem: FC = ({ ? (
- +
{t(`appDebug.variableConfig.file.${type}.name`)}
@@ -62,7 +62,7 @@ const FileTypeItem: FC = ({ ) : (
- +
{t(`appDebug.variableConfig.file.${type}.name`)}
{type !== SupportUploadFileTypes.custom ? FILE_EXTS[type].join(', ') : t('appDebug.variableConfig.file.custom.description')}
diff --git a/web/i18n/en-US/dataset-pipeline.ts b/web/i18n/en-US/dataset-pipeline.ts index 0e83490e65..84e4ae845a 100644 --- a/web/i18n/en-US/dataset-pipeline.ts +++ b/web/i18n/en-US/dataset-pipeline.ts @@ -109,6 +109,14 @@ const translation = { onlineDrive: { notConnected: '{{name}} is not connected', notConnectedTip: 'To sync with {{name}}, connection to {{name}} must be established first.', + breadcrumbs: { + allBuckets: 'All Cloud Storage Buckets', + searchResult: 'Find {{searchResultsLength}} items in "{{folderName}}" folder', + noSearchResult: 'No items were found', + resetKeywords: 'Reset keywords', + searchPlaceholder: 'Search files...', + }, + notSupportedFileType: 'This file type is not supported', }, } diff --git a/web/i18n/zh-Hans/dataset-pipeline.ts b/web/i18n/zh-Hans/dataset-pipeline.ts index 66076a1081..9639958e0a 100644 --- a/web/i18n/zh-Hans/dataset-pipeline.ts +++ b/web/i18n/zh-Hans/dataset-pipeline.ts @@ -109,6 +109,14 @@ const translation = { onlineDrive: { notConnected: '{{name}} 未绑定', notConnectedTip: '同步 {{name}} 内容前, 须先绑定 {{name}}。', + breadcrumbs: { + allBuckets: '所有云存储桶', + searchResult: '在 "{{folderName}}" 文件夹中找到 {{searchResultsLength}} 个项目', + noSearchResult: '未找到项目', + resetKeywords: '重置关键词', + searchPlaceholder: '搜索文件...', + }, + notSupportedFileType: '不支持此文件类型', }, } diff --git a/web/models/pipeline.ts b/web/models/pipeline.ts index 1bc063a212..eb0b7b36fe 100644 --- a/web/models/pipeline.ts +++ b/web/models/pipeline.ts @@ -267,3 +267,15 @@ export type OnlineDocumentPreviewRequest = { export type OnlineDocumentPreviewResponse = { content: string } + +export enum OnlineDriveFileType { + file = 'file', + folder = 'folder', + bucket = 'bucket', +} + +export type OnlineDriveFile = { + key: string + size?: number + type: OnlineDriveFileType +} diff --git a/web/utils/format.spec.ts b/web/utils/format.spec.ts index ab1c5c1610..c94495d597 100644 --- a/web/utils/format.spec.ts +++ b/web/utils/format.spec.ts @@ -25,22 +25,22 @@ describe('formatFileSize', () => { expect(formatFileSize(0)).toBe(0) }) test('should format bytes correctly', () => { - expect(formatFileSize(500)).toBe('500.00B') + expect(formatFileSize(500)).toBe('500.00 bytes') }) test('should format kilobytes correctly', () => { - expect(formatFileSize(1500)).toBe('1.46KB') + expect(formatFileSize(1500)).toBe('1.46 KB') }) test('should format megabytes correctly', () => { - expect(formatFileSize(1500000)).toBe('1.43MB') + expect(formatFileSize(1500000)).toBe('1.43 MB') }) test('should format gigabytes correctly', () => { - expect(formatFileSize(1500000000)).toBe('1.40GB') + expect(formatFileSize(1500000000)).toBe('1.40 GB') }) test('should format terabytes correctly', () => { - expect(formatFileSize(1500000000000)).toBe('1.36TB') + expect(formatFileSize(1500000000000)).toBe('1.36 TB') }) test('should format petabytes correctly', () => { - expect(formatFileSize(1500000000000000)).toBe('1.33PB') + expect(formatFileSize(1500000000000000)).toBe('1.33 PB') }) }) describe('formatTime', () => { diff --git a/web/utils/format.ts b/web/utils/format.ts index 572398405b..70238456c5 100644 --- a/web/utils/format.ts +++ b/web/utils/format.ts @@ -14,8 +14,8 @@ export const formatNumber = (num: number | string) => { /** * Format file size into standard string format. * @param fileSize file size (Byte) - * @example formatFileSize(1024) will return '1.00KB' - * @example formatFileSize(1024 * 1024) will return '1.00MB' + * @example formatFileSize(1024) will return '1.00 KB' + * @example formatFileSize(1024 * 1024) will return '1.00 MB' */ export const formatFileSize = (fileSize: number) => { if (!fileSize) @@ -26,7 +26,9 @@ export const formatFileSize = (fileSize: number) => { fileSize = fileSize / 1024 index++ } - return `${fileSize.toFixed(2)}${units[index]}B` + if (index === 0) + return `${fileSize.toFixed(2)} bytes` + return `${fileSize.toFixed(2)} ${units[index]}B` } /**