From a7f9259e27d4d5fb3315bc53ee4266a36422fe0d Mon Sep 17 00:00:00 2001 From: twwu Date: Wed, 30 Apr 2025 14:16:13 +0800 Subject: [PATCH] feat: new Dataset list --- web/app/(commonLayout)/datasets/page.tsx | 2 +- web/app/(commonLayout)/datasets/store.ts | 11 - .../icons/assets/public/knowledge/general.svg | 54 + .../icons/assets/public/knowledge/graph.svg | 124 ++ .../assets/public/knowledge/parent-child.svg | 44 + .../base/icons/assets/public/knowledge/qa.svg | 29 + .../icons/src/public/knowledge/General.json | 457 +++++++ .../icons/src/public/knowledge/General.tsx | 20 + .../icons/src/public/knowledge/Graph.json | 1058 +++++++++++++++++ .../base/icons/src/public/knowledge/Graph.tsx | 20 + .../src/public/knowledge/ParentChild.json | 348 ++++++ .../src/public/knowledge/ParentChild.tsx | 20 + .../base/icons/src/public/knowledge/Qa.json | 237 ++++ .../base/icons/src/public/knowledge/Qa.tsx | 20 + .../base/icons/src/public/knowledge/index.ts | 4 + .../base/segmented-control/index.tsx | 2 +- .../components/base/tag-management/panel.tsx | 209 ++++ .../base/tag-management/selector.tsx | 223 +--- .../base/tag-management/trigger.tsx | 46 + .../datasets/list/container.tsx} | 10 +- .../list/dataset-card/dataset-card-old.tsx} | 0 .../datasets/list/dataset-card/index.tsx | 244 ++++ .../datasets/list/dataset-card/operations.tsx | 94 ++ .../datasets/list/dataset-footer/index.tsx} | 3 +- .../datasets/list/datasets.tsx} | 4 +- .../datasets/list/doc.tsx} | 0 .../datasets/list}/new-dataset-card/index.tsx | 2 +- .../datasets/list}/new-dataset-card/link.tsx | 4 +- .../datasets/list}/template/template.en.mdx | 0 .../datasets/list}/template/template.ja.mdx | 0 .../datasets/list}/template/template.zh.mdx | 0 web/i18n/en-US/dataset.ts | 7 + web/i18n/zh-Hans/dataset.ts | 7 + web/models/datasets.ts | 2 + web/tailwind-common-config.ts | 2 + web/themes/manual-dark.css | 4 +- web/themes/manual-light.css | 2 + 37 files changed, 3076 insertions(+), 237 deletions(-) delete mode 100644 web/app/(commonLayout)/datasets/store.ts create mode 100644 web/app/components/base/icons/assets/public/knowledge/general.svg create mode 100644 web/app/components/base/icons/assets/public/knowledge/graph.svg create mode 100644 web/app/components/base/icons/assets/public/knowledge/parent-child.svg create mode 100644 web/app/components/base/icons/assets/public/knowledge/qa.svg create mode 100644 web/app/components/base/icons/src/public/knowledge/General.json create mode 100644 web/app/components/base/icons/src/public/knowledge/General.tsx create mode 100644 web/app/components/base/icons/src/public/knowledge/Graph.json create mode 100644 web/app/components/base/icons/src/public/knowledge/Graph.tsx create mode 100644 web/app/components/base/icons/src/public/knowledge/ParentChild.json create mode 100644 web/app/components/base/icons/src/public/knowledge/ParentChild.tsx create mode 100644 web/app/components/base/icons/src/public/knowledge/Qa.json create mode 100644 web/app/components/base/icons/src/public/knowledge/Qa.tsx create mode 100644 web/app/components/base/tag-management/panel.tsx create mode 100644 web/app/components/base/tag-management/trigger.tsx rename web/app/{(commonLayout)/datasets/Container.tsx => components/datasets/list/container.tsx} (95%) rename web/app/{(commonLayout)/datasets/DatasetCard.tsx => components/datasets/list/dataset-card/dataset-card-old.tsx} (100%) create mode 100644 web/app/components/datasets/list/dataset-card/index.tsx create mode 100644 web/app/components/datasets/list/dataset-card/operations.tsx rename web/app/{(commonLayout)/datasets/DatasetFooter.tsx => components/datasets/list/dataset-footer/index.tsx} (91%) rename web/app/{(commonLayout)/datasets/Datasets.tsx => components/datasets/list/datasets.tsx} (96%) rename web/app/{(commonLayout)/datasets/Doc.tsx => components/datasets/list/doc.tsx} (100%) rename web/app/{(commonLayout)/datasets => components/datasets/list}/new-dataset-card/index.tsx (91%) rename web/app/{(commonLayout)/datasets => components/datasets/list}/new-dataset-card/link.tsx (84%) rename web/app/{(commonLayout)/datasets => components/datasets/list}/template/template.en.mdx (100%) rename web/app/{(commonLayout)/datasets => components/datasets/list}/template/template.ja.mdx (100%) rename web/app/{(commonLayout)/datasets => components/datasets/list}/template/template.zh.mdx (100%) diff --git a/web/app/(commonLayout)/datasets/page.tsx b/web/app/(commonLayout)/datasets/page.tsx index 678de47c94..95c2d6fc5c 100644 --- a/web/app/(commonLayout)/datasets/page.tsx +++ b/web/app/(commonLayout)/datasets/page.tsx @@ -1,4 +1,4 @@ -import Container from './Container' +import Container from '../../components/datasets/list/container' const AppList = async () => { return diff --git a/web/app/(commonLayout)/datasets/store.ts b/web/app/(commonLayout)/datasets/store.ts deleted file mode 100644 index 40b7b15594..0000000000 --- a/web/app/(commonLayout)/datasets/store.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { create } from 'zustand' - -type DatasetStore = { - showExternalApiPanel: boolean - setShowExternalApiPanel: (show: boolean) => void -} - -export const useDatasetStore = create(set => ({ - showExternalApiPanel: false, - setShowExternalApiPanel: show => set({ showExternalApiPanel: show }), -})) diff --git a/web/app/components/base/icons/assets/public/knowledge/general.svg b/web/app/components/base/icons/assets/public/knowledge/general.svg new file mode 100644 index 0000000000..f213c8f994 --- /dev/null +++ b/web/app/components/base/icons/assets/public/knowledge/general.svg @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/web/app/components/base/icons/assets/public/knowledge/graph.svg b/web/app/components/base/icons/assets/public/knowledge/graph.svg new file mode 100644 index 0000000000..21d423c1ea --- /dev/null +++ b/web/app/components/base/icons/assets/public/knowledge/graph.svg @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/web/app/components/base/icons/assets/public/knowledge/parent-child.svg b/web/app/components/base/icons/assets/public/knowledge/parent-child.svg new file mode 100644 index 0000000000..fcb6a161d9 --- /dev/null +++ b/web/app/components/base/icons/assets/public/knowledge/parent-child.svg @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/web/app/components/base/icons/assets/public/knowledge/qa.svg b/web/app/components/base/icons/assets/public/knowledge/qa.svg new file mode 100644 index 0000000000..c1f351a650 --- /dev/null +++ b/web/app/components/base/icons/assets/public/knowledge/qa.svg @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/web/app/components/base/icons/src/public/knowledge/General.json b/web/app/components/base/icons/src/public/knowledge/General.json new file mode 100644 index 0000000000..d36698124f --- /dev/null +++ b/web/app/components/base/icons/src/public/knowledge/General.json @@ -0,0 +1,457 @@ +{ + "icon": { + "type": "element", + "isRootNode": true, + "name": "svg", + "attributes": { + "width": "18", + "height": "18", + "viewBox": "0 0 18 18", + "fill": "none", + "xmlns": "http://www.w3.org/2000/svg" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "d": "M10.5996 0.5C11.7113 0.5 12.5755 0.500118 13.2676 0.556641C13.9655 0.61366 14.5329 0.730378 15.043 0.990234L15.3525 1.16406C16.0576 1.59644 16.6322 2.21605 17.0098 2.95703L17.1006 3.15137C17.2979 3.61108 17.3935 4.12184 17.4434 4.73242C17.4999 5.42447 17.5 6.28869 17.5 7.40039V10.5996C17.5 11.7113 17.4999 12.5755 17.4434 13.2676C17.3935 13.8782 17.2979 14.3889 17.1006 14.8486L17.0098 15.043C16.6322 15.7839 16.0576 16.4036 15.3525 16.8359L15.043 17.0098C14.5329 17.2696 13.9655 17.3863 13.2676 17.4434C12.5755 17.4999 11.7113 17.5 10.5996 17.5H7.40039C6.28869 17.5 5.42447 17.4999 4.73242 17.4434C4.12184 17.3935 3.61108 17.2979 3.15137 17.1006L2.95703 17.0098C2.21605 16.6322 1.59644 16.0576 1.16406 15.3525L0.990234 15.043C0.730378 14.5329 0.61366 13.9655 0.556641 13.2676C0.500118 12.5755 0.5 11.7113 0.5 10.5996V7.40039C0.5 6.28869 0.500118 5.42447 0.556641 4.73242C0.61366 4.03453 0.730378 3.46707 0.990234 2.95703L1.16406 2.64746C1.59644 1.94243 2.21605 1.36778 2.95703 0.990234L3.15137 0.899414C3.61108 0.702129 4.12184 0.606527 4.73242 0.556641C5.42447 0.500118 6.28869 0.5 7.40039 0.5H10.5996Z", + "stroke": "white" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "d": "M1 7.4C1 5.15979 1 4.03969 1.43597 3.18404C1.81947 2.43139 2.43139 1.81947 3.18404 1.43597C4.03969 1 5.15979 1 7.4 1H10.6C12.8402 1 13.9603 1 14.816 1.43597C15.5686 1.81947 16.1805 2.43139 16.564 3.18404C17 4.03969 17 5.15979 17 7.4V10.6C17 12.8402 17 13.9603 16.564 14.816C16.1805 15.5686 15.5686 16.1805 14.816 16.564C13.9603 17 12.8402 17 10.6 17H7.4C5.15979 17 4.03969 17 3.18404 16.564C2.43139 16.1805 1.81947 15.5686 1.43597 14.816C1 13.9603 1 12.8402 1 10.6V7.4Z", + "fill": "#444CE7" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "d": "M1 7.4C1 5.15979 1 4.03969 1.43597 3.18404C1.81947 2.43139 2.43139 1.81947 3.18404 1.43597C4.03969 1 5.15979 1 7.4 1H10.6C12.8402 1 13.9603 1 14.816 1.43597C15.5686 1.81947 16.1805 2.43139 16.564 3.18404C17 4.03969 17 5.15979 17 7.4V10.6C17 12.8402 17 13.9603 16.564 14.816C16.1805 15.5686 15.5686 16.1805 14.816 16.564C13.9603 17 12.8402 17 10.6 17H7.4C5.15979 17 4.03969 17 3.18404 16.564C2.43139 16.1805 1.81947 15.5686 1.43597 14.816C1 13.9603 1 12.8402 1 10.6V7.4Z", + "fill": "url(#paint0_linear_5617_78288)" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "d": "M7.40039 1.5H10.5996C11.728 1.5 12.5446 1.50029 13.1865 1.55273C13.7434 1.59824 14.1352 1.68127 14.4561 1.81934L14.5889 1.88184C15.1651 2.17543 15.6471 2.62172 15.9834 3.16992L16.1182 3.41113C16.2942 3.75672 16.3953 4.17741 16.4473 4.81348C16.4997 5.4554 16.5 6.27204 16.5 7.40039V10.5996C16.5 11.728 16.4997 12.5446 16.4473 13.1865C16.4018 13.7434 16.3187 14.1352 16.1807 14.4561L16.1182 14.5889C15.8246 15.1651 15.3783 15.6471 14.8301 15.9834L14.5889 16.1182C14.2433 16.2942 13.8226 16.3953 13.1865 16.4473C12.5446 16.4997 11.728 16.5 10.5996 16.5H7.40039C6.27204 16.5 5.4554 16.4997 4.81348 16.4473C4.2566 16.4018 3.8648 16.3187 3.54395 16.1807L3.41113 16.1182C2.83494 15.8246 2.35287 15.3783 2.0166 14.8301L1.88184 14.5889C1.70575 14.2433 1.60471 13.8226 1.55273 13.1865C1.50029 12.5446 1.5 11.728 1.5 10.5996V7.40039C1.5 6.27204 1.50029 5.4554 1.55273 4.81348C1.59824 4.2566 1.68127 3.8648 1.81934 3.54395L1.88184 3.41113C2.17543 2.83494 2.62172 2.35287 3.16992 2.0166L3.41113 1.88184C3.75672 1.70575 4.17741 1.60471 4.81348 1.55273C5.4554 1.50029 6.27204 1.5 7.40039 1.5Z", + "stroke": "#101828", + "stroke-opacity": "0.08" + }, + "children": [] + }, + { + "type": "element", + "name": "g", + "attributes": { + "filter": "url(#filter0_d_5617_78288)" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "fill-rule": "evenodd", + "clip-rule": "evenodd", + "d": "M11.25 5.5C11.25 5.08579 11.5858 4.75 12 4.75H13.5C13.9142 4.75 14.25 5.08579 14.25 5.5C14.25 5.91421 13.9142 6.25 13.5 6.25H12C11.5858 6.25 11.25 5.91421 11.25 5.5Z", + "fill": "url(#paint1_linear_5617_78288)", + "shape-rendering": "crispEdges" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "fill-rule": "evenodd", + "clip-rule": "evenodd", + "d": "M3.75 5.5C3.75 5.08579 4.08579 4.75 4.5 4.75H9.5C9.91421 4.75 10.25 5.08579 10.25 5.5C10.25 5.91421 9.91421 6.25 9.5 6.25H4.5C4.08579 6.25 3.75 5.91421 3.75 5.5Z", + "fill": "url(#paint2_linear_5617_78288)", + "shape-rendering": "crispEdges" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "fill-rule": "evenodd", + "clip-rule": "evenodd", + "d": "M3.75 9C3.75 8.58579 4.08579 8.25 4.5 8.25H6C6.41421 8.25 6.75 8.58579 6.75 9C6.75 9.41421 6.41421 9.75 6 9.75H4.5C4.08579 9.75 3.75 9.41421 3.75 9Z", + "fill": "url(#paint3_linear_5617_78288)", + "shape-rendering": "crispEdges" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "fill-rule": "evenodd", + "clip-rule": "evenodd", + "d": "M7.75 9C7.75 8.58579 8.08579 8.25 8.5 8.25H13.5C13.9142 8.25 14.25 8.58579 14.25 9C14.25 9.41421 13.9142 9.75 13.5 9.75H8.5C8.08579 9.75 7.75 9.41421 7.75 9Z", + "fill": "url(#paint4_linear_5617_78288)", + "shape-rendering": "crispEdges" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "fill-rule": "evenodd", + "clip-rule": "evenodd", + "d": "M11.25 12.5C11.25 12.0858 11.5858 11.75 12 11.75H13.5C13.9142 11.75 14.25 12.0858 14.25 12.5C14.25 12.9142 13.9142 13.25 13.5 13.25H12C11.5858 13.25 11.25 12.9142 11.25 12.5Z", + "fill": "url(#paint5_linear_5617_78288)", + "shape-rendering": "crispEdges" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "fill-rule": "evenodd", + "clip-rule": "evenodd", + "d": "M3.75 12.5C3.75 12.0858 4.08579 11.75 4.5 11.75H9.5C9.91421 11.75 10.25 12.0858 10.25 12.5C10.25 12.9142 9.91421 13.25 9.5 13.25H4.5C4.08579 13.25 3.75 12.9142 3.75 12.5Z", + "fill": "url(#paint6_linear_5617_78288)", + "shape-rendering": "crispEdges" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "defs", + "attributes": {}, + "children": [ + { + "type": "element", + "name": "filter", + "attributes": { + "id": "filter0_d_5617_78288", + "x": "3.25", + "y": "4.5", + "width": "11.5", + "height": "9.5", + "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": "0.25" + }, + "children": [] + }, + { + "type": "element", + "name": "feGaussianBlur", + "attributes": { + "stdDeviation": "0.25" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in2": "hardAlpha", + "operator": "out" + }, + "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 0.2 0" + }, + "children": [] + }, + { + "type": "element", + "name": "feBlend", + "attributes": { + "mode": "normal", + "in2": "BackgroundImageFix", + "result": "effect1_dropShadow_5617_78288" + }, + "children": [] + }, + { + "type": "element", + "name": "feBlend", + "attributes": { + "mode": "normal", + "in": "SourceGraphic", + "in2": "effect1_dropShadow_5617_78288", + "result": "shape" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "linearGradient", + "attributes": { + "id": "paint0_linear_5617_78288", + "x1": "1", + "y1": "1", + "x2": "17", + "y2": "17", + "gradientUnits": "userSpaceOnUse" + }, + "children": [ + { + "type": "element", + "name": "stop", + "attributes": { + "stop-color": "white", + "stop-opacity": "0.12" + }, + "children": [] + }, + { + "type": "element", + "name": "stop", + "attributes": { + "offset": "1", + "stop-color": "white", + "stop-opacity": "0.08" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "linearGradient", + "attributes": { + "id": "paint1_linear_5617_78288", + "x1": "9", + "y1": "4.75", + "x2": "9", + "y2": "13.25", + "gradientUnits": "userSpaceOnUse" + }, + "children": [ + { + "type": "element", + "name": "stop", + "attributes": { + "stop-color": "white" + }, + "children": [] + }, + { + "type": "element", + "name": "stop", + "attributes": { + "offset": "1", + "stop-color": "white", + "stop-opacity": "0.9" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "linearGradient", + "attributes": { + "id": "paint2_linear_5617_78288", + "x1": "9", + "y1": "4.75", + "x2": "9", + "y2": "13.25", + "gradientUnits": "userSpaceOnUse" + }, + "children": [ + { + "type": "element", + "name": "stop", + "attributes": { + "stop-color": "white" + }, + "children": [] + }, + { + "type": "element", + "name": "stop", + "attributes": { + "offset": "1", + "stop-color": "white", + "stop-opacity": "0.9" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "linearGradient", + "attributes": { + "id": "paint3_linear_5617_78288", + "x1": "9", + "y1": "4.75", + "x2": "9", + "y2": "13.25", + "gradientUnits": "userSpaceOnUse" + }, + "children": [ + { + "type": "element", + "name": "stop", + "attributes": { + "stop-color": "white" + }, + "children": [] + }, + { + "type": "element", + "name": "stop", + "attributes": { + "offset": "1", + "stop-color": "white", + "stop-opacity": "0.9" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "linearGradient", + "attributes": { + "id": "paint4_linear_5617_78288", + "x1": "9", + "y1": "4.75", + "x2": "9", + "y2": "13.25", + "gradientUnits": "userSpaceOnUse" + }, + "children": [ + { + "type": "element", + "name": "stop", + "attributes": { + "stop-color": "white" + }, + "children": [] + }, + { + "type": "element", + "name": "stop", + "attributes": { + "offset": "1", + "stop-color": "white", + "stop-opacity": "0.9" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "linearGradient", + "attributes": { + "id": "paint5_linear_5617_78288", + "x1": "9", + "y1": "4.75", + "x2": "9", + "y2": "13.25", + "gradientUnits": "userSpaceOnUse" + }, + "children": [ + { + "type": "element", + "name": "stop", + "attributes": { + "stop-color": "white" + }, + "children": [] + }, + { + "type": "element", + "name": "stop", + "attributes": { + "offset": "1", + "stop-color": "white", + "stop-opacity": "0.9" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "linearGradient", + "attributes": { + "id": "paint6_linear_5617_78288", + "x1": "9", + "y1": "4.75", + "x2": "9", + "y2": "13.25", + "gradientUnits": "userSpaceOnUse" + }, + "children": [ + { + "type": "element", + "name": "stop", + "attributes": { + "stop-color": "white" + }, + "children": [] + }, + { + "type": "element", + "name": "stop", + "attributes": { + "offset": "1", + "stop-color": "white", + "stop-opacity": "0.9" + }, + "children": [] + } + ] + } + ] + } + ] + }, + "name": "General" +} \ No newline at end of file diff --git a/web/app/components/base/icons/src/public/knowledge/General.tsx b/web/app/components/base/icons/src/public/knowledge/General.tsx new file mode 100644 index 0000000000..6508ed57c6 --- /dev/null +++ b/web/app/components/base/icons/src/public/knowledge/General.tsx @@ -0,0 +1,20 @@ +// GENERATE BY script +// DON NOT EDIT IT MANUALLY + +import * as React from 'react' +import data from './General.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 = 'General' + +export default Icon diff --git a/web/app/components/base/icons/src/public/knowledge/Graph.json b/web/app/components/base/icons/src/public/knowledge/Graph.json new file mode 100644 index 0000000000..2516388617 --- /dev/null +++ b/web/app/components/base/icons/src/public/knowledge/Graph.json @@ -0,0 +1,1058 @@ +{ + "icon": { + "type": "element", + "isRootNode": true, + "name": "svg", + "attributes": { + "width": "18", + "height": "18", + "viewBox": "0 0 18 18", + "fill": "none", + "xmlns": "http://www.w3.org/2000/svg" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "d": "M10.5996 0.5C11.7113 0.5 12.5755 0.500118 13.2676 0.556641C13.9655 0.61366 14.5329 0.730378 15.043 0.990234L15.3525 1.16406C16.0576 1.59644 16.6322 2.21605 17.0098 2.95703L17.1006 3.15137C17.2979 3.61108 17.3935 4.12184 17.4434 4.73242C17.4999 5.42447 17.5 6.28869 17.5 7.40039V10.5996C17.5 11.7113 17.4999 12.5755 17.4434 13.2676C17.3935 13.8782 17.2979 14.3889 17.1006 14.8486L17.0098 15.043C16.6322 15.7839 16.0576 16.4036 15.3525 16.8359L15.043 17.0098C14.5329 17.2696 13.9655 17.3863 13.2676 17.4434C12.5755 17.4999 11.7113 17.5 10.5996 17.5H7.40039C6.28869 17.5 5.42447 17.4999 4.73242 17.4434C4.12184 17.3935 3.61108 17.2979 3.15137 17.1006L2.95703 17.0098C2.21605 16.6322 1.59644 16.0576 1.16406 15.3525L0.990234 15.043C0.730378 14.5329 0.61366 13.9655 0.556641 13.2676C0.500118 12.5755 0.5 11.7113 0.5 10.5996V7.40039C0.5 6.28869 0.500118 5.42447 0.556641 4.73242C0.61366 4.03453 0.730378 3.46707 0.990234 2.95703L1.16406 2.64746C1.59644 1.94243 2.21605 1.36778 2.95703 0.990234L3.15137 0.899414C3.61108 0.702129 4.12184 0.606527 4.73242 0.556641C5.42447 0.500118 6.28869 0.5 7.40039 0.5H10.5996Z", + "stroke": "white" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "d": "M1 7.4C1 5.15979 1 4.03969 1.43597 3.18404C1.81947 2.43139 2.43139 1.81947 3.18404 1.43597C4.03969 1 5.15979 1 7.4 1H10.6C12.8402 1 13.9603 1 14.816 1.43597C15.5686 1.81947 16.1805 2.43139 16.564 3.18404C17 4.03969 17 5.15979 17 7.4V10.6C17 12.8402 17 13.9603 16.564 14.816C16.1805 15.5686 15.5686 16.1805 14.816 16.564C13.9603 17 12.8402 17 10.6 17H7.4C5.15979 17 4.03969 17 3.18404 16.564C2.43139 16.1805 1.81947 15.5686 1.43597 14.816C1 13.9603 1 12.8402 1 10.6V7.4Z", + "fill": "#7839EE" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "d": "M1 7.4C1 5.15979 1 4.03969 1.43597 3.18404C1.81947 2.43139 2.43139 1.81947 3.18404 1.43597C4.03969 1 5.15979 1 7.4 1H10.6C12.8402 1 13.9603 1 14.816 1.43597C15.5686 1.81947 16.1805 2.43139 16.564 3.18404C17 4.03969 17 5.15979 17 7.4V10.6C17 12.8402 17 13.9603 16.564 14.816C16.1805 15.5686 15.5686 16.1805 14.816 16.564C13.9603 17 12.8402 17 10.6 17H7.4C5.15979 17 4.03969 17 3.18404 16.564C2.43139 16.1805 1.81947 15.5686 1.43597 14.816C1 13.9603 1 12.8402 1 10.6V7.4Z", + "fill": "url(#paint0_linear_5617_78246)" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "d": "M7.40039 1.5H10.5996C11.728 1.5 12.5446 1.50029 13.1865 1.55273C13.7434 1.59824 14.1352 1.68127 14.4561 1.81934L14.5889 1.88184C15.1651 2.17543 15.6471 2.62172 15.9834 3.16992L16.1182 3.41113C16.2942 3.75672 16.3953 4.17741 16.4473 4.81348C16.4997 5.4554 16.5 6.27204 16.5 7.40039V10.5996C16.5 11.728 16.4997 12.5446 16.4473 13.1865C16.4018 13.7434 16.3187 14.1352 16.1807 14.4561L16.1182 14.5889C15.8246 15.1651 15.3783 15.6471 14.8301 15.9834L14.5889 16.1182C14.2433 16.2942 13.8226 16.3953 13.1865 16.4473C12.5446 16.4997 11.728 16.5 10.5996 16.5H7.40039C6.27204 16.5 5.4554 16.4997 4.81348 16.4473C4.2566 16.4018 3.8648 16.3187 3.54395 16.1807L3.41113 16.1182C2.83494 15.8246 2.35287 15.3783 2.0166 14.8301L1.88184 14.5889C1.70575 14.2433 1.60471 13.8226 1.55273 13.1865C1.50029 12.5446 1.5 11.728 1.5 10.5996V7.40039C1.5 6.27204 1.50029 5.4554 1.55273 4.81348C1.59824 4.2566 1.68127 3.8648 1.81934 3.54395L1.88184 3.41113C2.17543 2.83494 2.62172 2.35287 3.16992 2.0166L3.41113 1.88184C3.75672 1.70575 4.17741 1.60471 4.81348 1.55273C5.4554 1.50029 6.27204 1.5 7.40039 1.5Z", + "stroke": "#101828", + "stroke-opacity": "0.08" + }, + "children": [] + }, + { + "type": "element", + "name": "g", + "attributes": { + "clip-path": "url(#clip0_5617_78246)" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "filter": "url(#filter0_d_5617_78246)" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "fill-rule": "evenodd", + "clip-rule": "evenodd", + "d": "M9.00004 5.31818C9.27619 5.31818 9.50004 5.54204 9.50004 5.81818V8.09091C9.50004 8.36705 9.27619 8.59091 9.00004 8.59091C8.7239 8.59091 8.50004 8.36705 8.50004 8.09091V5.81818C8.50004 5.54204 8.7239 5.31818 9.00004 5.31818Z", + "fill": "url(#paint1_linear_5617_78246)", + "shape-rendering": "crispEdges" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "fill-rule": "evenodd", + "clip-rule": "evenodd", + "d": "M9.00004 9.40909C9.27619 9.40909 9.50004 9.63295 9.50004 9.90909V12.1818C9.50004 12.458 9.27619 12.6818 9.00004 12.6818C8.7239 12.6818 8.50004 12.458 8.50004 12.1818V9.90909C8.50004 9.63295 8.7239 9.40909 9.00004 9.40909Z", + "fill": "url(#paint2_linear_5617_78246)", + "shape-rendering": "crispEdges" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "fill-rule": "evenodd", + "clip-rule": "evenodd", + "d": "M8.64355 5.1094C8.77894 5.35007 8.6936 5.65493 8.45293 5.79033L6.40065 6.94487C6.15998 7.08027 5.85512 6.99492 5.71973 6.75425C5.58433 6.51358 5.66968 6.20872 5.91035 6.07332L7.96262 4.91878C8.20329 4.78338 8.50815 4.86873 8.64355 5.1094Z", + "fill": "url(#paint3_linear_5617_78246)", + "shape-rendering": "crispEdges" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "fill-rule": "evenodd", + "clip-rule": "evenodd", + "d": "M9.35653 5.1094C9.49193 4.86873 9.79679 4.78338 10.0375 4.91878L12.0897 6.07332C12.3304 6.20872 12.4158 6.51358 12.2804 6.75425C12.145 6.99492 11.8401 7.08027 11.5994 6.94487L9.54715 5.79033C9.30648 5.65493 9.22114 5.35007 9.35653 5.1094Z", + "fill": "url(#paint4_linear_5617_78246)", + "shape-rendering": "crispEdges" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "fill-rule": "evenodd", + "clip-rule": "evenodd", + "d": "M5.71973 11.2458C5.85512 11.0051 6.15998 10.9197 6.40065 11.0551L8.45293 12.2097C8.6936 12.3451 8.77894 12.6499 8.64355 12.8906C8.50815 13.1313 8.20329 13.2166 7.96262 13.0812L5.91035 11.9267C5.66968 11.7913 5.58433 11.4864 5.71973 11.2458Z", + "fill": "url(#paint5_linear_5617_78246)", + "shape-rendering": "crispEdges" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "fill-rule": "evenodd", + "clip-rule": "evenodd", + "d": "M12.2804 11.2458C12.4158 11.4864 12.3304 11.7913 12.0897 11.9267L10.0375 13.0812C9.79679 13.2166 9.49193 13.1313 9.35653 12.8906C9.22114 12.6499 9.30648 12.3451 9.54715 12.2097L11.5994 11.0551C11.8401 10.9197 12.145 11.0051 12.2804 11.2458Z", + "fill": "url(#paint6_linear_5617_78246)", + "shape-rendering": "crispEdges" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "fill-rule": "evenodd", + "clip-rule": "evenodd", + "d": "M5.36368 7.36364C5.63982 7.36364 5.86368 7.58749 5.86368 7.86364V10.1364C5.86368 10.4125 5.63982 10.6364 5.36368 10.6364C5.08754 10.6364 4.86368 10.4125 4.86368 10.1364V7.86364C4.86368 7.58749 5.08754 7.36364 5.36368 7.36364Z", + "fill": "url(#paint7_linear_5617_78246)", + "shape-rendering": "crispEdges" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "fill-rule": "evenodd", + "clip-rule": "evenodd", + "d": "M12.6364 7.36364C12.9126 7.36364 13.1364 7.58749 13.1364 7.86364V10.1364C13.1364 10.4125 12.9126 10.6364 12.6364 10.6364C12.3603 10.6364 12.1364 10.4125 12.1364 10.1364V7.86364C12.1364 7.58749 12.3603 7.36364 12.6364 7.36364Z", + "fill": "url(#paint8_linear_5617_78246)", + "shape-rendering": "crispEdges" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "fill-rule": "evenodd", + "clip-rule": "evenodd", + "d": "M5.71928 7.1544C5.85467 6.91373 6.15953 6.82838 6.4002 6.96377L8.45338 8.11877C8.69406 8.25416 8.77941 8.55902 8.64402 8.79969C8.50863 9.04037 8.20377 9.12572 7.96309 8.99033L5.90991 7.83533C5.66924 7.69994 5.58389 7.39508 5.71928 7.1544Z", + "fill": "url(#paint9_linear_5617_78246)", + "shape-rendering": "crispEdges" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "fill-rule": "evenodd", + "clip-rule": "evenodd", + "d": "M12.2799 7.15488C12.4153 7.39557 12.3299 7.70042 12.0892 7.8358L10.0374 8.98989C9.79675 9.12527 9.49189 9.0399 9.35652 8.79922C9.22114 8.55854 9.30651 8.25368 9.54719 8.1183L11.599 6.96421C11.8397 6.82884 12.1445 6.9142 12.2799 7.15488Z", + "fill": "url(#paint10_linear_5617_78246)", + "shape-rendering": "crispEdges" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "fill-rule": "evenodd", + "clip-rule": "evenodd", + "d": "M8.64402 9.20031C8.77941 9.44099 8.69406 9.74585 8.45338 9.88124L6.4002 11.0362C6.15953 11.1716 5.85467 11.0863 5.71928 10.8456C5.58389 10.6049 5.66924 10.3001 5.90991 10.1647L7.96309 9.00968C8.20377 8.87429 8.50863 8.95964 8.64402 9.20031Z", + "fill": "url(#paint11_linear_5617_78246)", + "shape-rendering": "crispEdges" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "fill-rule": "evenodd", + "clip-rule": "evenodd", + "d": "M9.35652 9.20078C9.49189 8.9601 9.79675 8.87473 10.0374 9.01011L12.0892 10.1642C12.3299 10.2996 12.4153 10.6044 12.2799 10.8451C12.1445 11.0858 11.8397 11.1712 11.599 11.0358L9.54719 9.8817C9.30651 9.74632 9.22114 9.44146 9.35652 9.20078Z", + "fill": "url(#paint12_linear_5617_78246)", + "shape-rendering": "crispEdges" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "fill-rule": "evenodd", + "clip-rule": "evenodd", + "d": "M5.36368 10.6364C5.13775 10.6364 4.95459 10.8195 4.95459 11.0455C4.95459 11.2714 5.13775 11.4545 5.36368 11.4545C5.58962 11.4545 5.77277 11.2714 5.77277 11.0455C5.77277 10.8195 5.58962 10.6364 5.36368 10.6364ZM3.95459 11.0455C3.95459 10.2672 4.58546 9.63636 5.36368 9.63636C6.1419 9.63636 6.77277 10.2672 6.77277 11.0455C6.77277 11.8237 6.1419 12.4545 5.36368 12.4545C4.58546 12.4545 3.95459 11.8237 3.95459 11.0455Z", + "fill": "url(#paint13_linear_5617_78246)", + "shape-rendering": "crispEdges" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "fill-rule": "evenodd", + "clip-rule": "evenodd", + "d": "M5.36368 6.54545C5.13775 6.54545 4.95459 6.72861 4.95459 6.95455C4.95459 7.18048 5.13775 7.36364 5.36368 7.36364C5.58962 7.36364 5.77277 7.18048 5.77277 6.95455C5.77277 6.72861 5.58962 6.54545 5.36368 6.54545ZM3.95459 6.95455C3.95459 6.17633 4.58546 5.54545 5.36368 5.54545C6.1419 5.54545 6.77277 6.17633 6.77277 6.95455C6.77277 7.73276 6.1419 8.36364 5.36368 8.36364C4.58546 8.36364 3.95459 7.73276 3.95459 6.95455Z", + "fill": "url(#paint14_linear_5617_78246)", + "shape-rendering": "crispEdges" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "fill-rule": "evenodd", + "clip-rule": "evenodd", + "d": "M12.6364 10.6364C12.4105 10.6364 12.2273 10.8195 12.2273 11.0455C12.2273 11.2714 12.4105 11.4545 12.6364 11.4545C12.8623 11.4545 13.0455 11.2714 13.0455 11.0455C13.0455 10.8195 12.8623 10.6364 12.6364 10.6364ZM11.2273 11.0455C11.2273 10.2672 11.8582 9.63636 12.6364 9.63636C13.4146 9.63636 14.0455 10.2672 14.0455 11.0455C14.0455 11.8237 13.4146 12.4545 12.6364 12.4545C11.8582 12.4545 11.2273 11.8237 11.2273 11.0455Z", + "fill": "url(#paint15_linear_5617_78246)", + "shape-rendering": "crispEdges" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "fill-rule": "evenodd", + "clip-rule": "evenodd", + "d": "M12.6364 6.54545C12.4105 6.54545 12.2273 6.72861 12.2273 6.95455C12.2273 7.18048 12.4105 7.36364 12.6364 7.36364C12.8623 7.36364 13.0455 7.18048 13.0455 6.95455C13.0455 6.72861 12.8623 6.54545 12.6364 6.54545ZM11.2273 6.95455C11.2273 6.17633 11.8582 5.54545 12.6364 5.54545C13.4146 5.54545 14.0455 6.17633 14.0455 6.95455C14.0455 7.73276 13.4146 8.36364 12.6364 8.36364C11.8582 8.36364 11.2273 7.73276 11.2273 6.95455Z", + "fill": "url(#paint16_linear_5617_78246)", + "shape-rendering": "crispEdges" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "fill-rule": "evenodd", + "clip-rule": "evenodd", + "d": "M9.00004 8.59091C8.77411 8.59091 8.59095 8.77407 8.59095 9C8.59095 9.22593 8.77411 9.40909 9.00004 9.40909C9.22598 9.40909 9.40914 9.22593 9.40914 9C9.40914 8.77407 9.22598 8.59091 9.00004 8.59091ZM7.59095 9C7.59095 8.22178 8.22182 7.59091 9.00004 7.59091C9.77826 7.59091 10.4091 8.22178 10.4091 9C10.4091 9.77822 9.77826 10.4091 9.00004 10.4091C8.22182 10.4091 7.59095 9.77822 7.59095 9Z", + "fill": "url(#paint17_linear_5617_78246)", + "shape-rendering": "crispEdges" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "fill-rule": "evenodd", + "clip-rule": "evenodd", + "d": "M9.00004 4.5C8.77411 4.5 8.59095 4.68316 8.59095 4.90909C8.59095 5.13503 8.77411 5.31818 9.00004 5.31818C9.22598 5.31818 9.40914 5.13503 9.40914 4.90909C9.40914 4.68316 9.22598 4.5 9.00004 4.5ZM7.59095 4.90909C7.59095 4.13087 8.22182 3.5 9.00004 3.5C9.77826 3.5 10.4091 4.13087 10.4091 4.90909C10.4091 5.68731 9.77826 6.31818 9.00004 6.31818C8.22182 6.31818 7.59095 5.68731 7.59095 4.90909Z", + "fill": "url(#paint18_linear_5617_78246)", + "shape-rendering": "crispEdges" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "fill-rule": "evenodd", + "clip-rule": "evenodd", + "d": "M9.00004 12.6818C8.77411 12.6818 8.59095 12.865 8.59095 13.0909C8.59095 13.3168 8.77411 13.5 9.00004 13.5C9.22598 13.5 9.40914 13.3168 9.40914 13.0909C9.40914 12.865 9.22598 12.6818 9.00004 12.6818ZM7.59095 13.0909C7.59095 12.3127 8.22182 11.6818 9.00004 11.6818C9.77826 11.6818 10.4091 12.3127 10.4091 13.0909C10.4091 13.8691 9.77826 14.5 9.00004 14.5C8.22182 14.5 7.59095 13.8691 7.59095 13.0909Z", + "fill": "url(#paint19_linear_5617_78246)", + "shape-rendering": "crispEdges" + }, + "children": [] + } + ] + } + ] + }, + { + "type": "element", + "name": "defs", + "attributes": {}, + "children": [ + { + "type": "element", + "name": "filter", + "attributes": { + "id": "filter0_d_5617_78246", + "x": "3.45459", + "y": "3.25", + "width": "11.0908", + "height": "12", + "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": "0.25" + }, + "children": [] + }, + { + "type": "element", + "name": "feGaussianBlur", + "attributes": { + "stdDeviation": "0.25" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in2": "hardAlpha", + "operator": "out" + }, + "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 0.2 0" + }, + "children": [] + }, + { + "type": "element", + "name": "feBlend", + "attributes": { + "mode": "normal", + "in2": "BackgroundImageFix", + "result": "effect1_dropShadow_5617_78246" + }, + "children": [] + }, + { + "type": "element", + "name": "feBlend", + "attributes": { + "mode": "normal", + "in": "SourceGraphic", + "in2": "effect1_dropShadow_5617_78246", + "result": "shape" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "linearGradient", + "attributes": { + "id": "paint0_linear_5617_78246", + "x1": "1", + "y1": "1", + "x2": "17", + "y2": "17", + "gradientUnits": "userSpaceOnUse" + }, + "children": [ + { + "type": "element", + "name": "stop", + "attributes": { + "stop-color": "white", + "stop-opacity": "0.12" + }, + "children": [] + }, + { + "type": "element", + "name": "stop", + "attributes": { + "offset": "1", + "stop-color": "white", + "stop-opacity": "0.08" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "linearGradient", + "attributes": { + "id": "paint1_linear_5617_78246", + "x1": "9.00004", + "y1": "3.5", + "x2": "9.00004", + "y2": "14.5", + "gradientUnits": "userSpaceOnUse" + }, + "children": [ + { + "type": "element", + "name": "stop", + "attributes": { + "stop-color": "white" + }, + "children": [] + }, + { + "type": "element", + "name": "stop", + "attributes": { + "offset": "1", + "stop-color": "white", + "stop-opacity": "0.9" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "linearGradient", + "attributes": { + "id": "paint2_linear_5617_78246", + "x1": "9.00004", + "y1": "3.5", + "x2": "9.00004", + "y2": "14.5", + "gradientUnits": "userSpaceOnUse" + }, + "children": [ + { + "type": "element", + "name": "stop", + "attributes": { + "stop-color": "white" + }, + "children": [] + }, + { + "type": "element", + "name": "stop", + "attributes": { + "offset": "1", + "stop-color": "white", + "stop-opacity": "0.9" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "linearGradient", + "attributes": { + "id": "paint3_linear_5617_78246", + "x1": "9.00004", + "y1": "3.5", + "x2": "9.00004", + "y2": "14.5", + "gradientUnits": "userSpaceOnUse" + }, + "children": [ + { + "type": "element", + "name": "stop", + "attributes": { + "stop-color": "white" + }, + "children": [] + }, + { + "type": "element", + "name": "stop", + "attributes": { + "offset": "1", + "stop-color": "white", + "stop-opacity": "0.9" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "linearGradient", + "attributes": { + "id": "paint4_linear_5617_78246", + "x1": "9.00004", + "y1": "3.5", + "x2": "9.00004", + "y2": "14.5", + "gradientUnits": "userSpaceOnUse" + }, + "children": [ + { + "type": "element", + "name": "stop", + "attributes": { + "stop-color": "white" + }, + "children": [] + }, + { + "type": "element", + "name": "stop", + "attributes": { + "offset": "1", + "stop-color": "white", + "stop-opacity": "0.9" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "linearGradient", + "attributes": { + "id": "paint5_linear_5617_78246", + "x1": "9.00004", + "y1": "3.5", + "x2": "9.00004", + "y2": "14.5", + "gradientUnits": "userSpaceOnUse" + }, + "children": [ + { + "type": "element", + "name": "stop", + "attributes": { + "stop-color": "white" + }, + "children": [] + }, + { + "type": "element", + "name": "stop", + "attributes": { + "offset": "1", + "stop-color": "white", + "stop-opacity": "0.9" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "linearGradient", + "attributes": { + "id": "paint6_linear_5617_78246", + "x1": "9.00004", + "y1": "3.5", + "x2": "9.00004", + "y2": "14.5", + "gradientUnits": "userSpaceOnUse" + }, + "children": [ + { + "type": "element", + "name": "stop", + "attributes": { + "stop-color": "white" + }, + "children": [] + }, + { + "type": "element", + "name": "stop", + "attributes": { + "offset": "1", + "stop-color": "white", + "stop-opacity": "0.9" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "linearGradient", + "attributes": { + "id": "paint7_linear_5617_78246", + "x1": "9.00004", + "y1": "3.5", + "x2": "9.00004", + "y2": "14.5", + "gradientUnits": "userSpaceOnUse" + }, + "children": [ + { + "type": "element", + "name": "stop", + "attributes": { + "stop-color": "white" + }, + "children": [] + }, + { + "type": "element", + "name": "stop", + "attributes": { + "offset": "1", + "stop-color": "white", + "stop-opacity": "0.9" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "linearGradient", + "attributes": { + "id": "paint8_linear_5617_78246", + "x1": "9.00004", + "y1": "3.5", + "x2": "9.00004", + "y2": "14.5", + "gradientUnits": "userSpaceOnUse" + }, + "children": [ + { + "type": "element", + "name": "stop", + "attributes": { + "stop-color": "white" + }, + "children": [] + }, + { + "type": "element", + "name": "stop", + "attributes": { + "offset": "1", + "stop-color": "white", + "stop-opacity": "0.9" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "linearGradient", + "attributes": { + "id": "paint9_linear_5617_78246", + "x1": "9.00004", + "y1": "3.5", + "x2": "9.00004", + "y2": "14.5", + "gradientUnits": "userSpaceOnUse" + }, + "children": [ + { + "type": "element", + "name": "stop", + "attributes": { + "stop-color": "white" + }, + "children": [] + }, + { + "type": "element", + "name": "stop", + "attributes": { + "offset": "1", + "stop-color": "white", + "stop-opacity": "0.9" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "linearGradient", + "attributes": { + "id": "paint10_linear_5617_78246", + "x1": "9.00004", + "y1": "3.5", + "x2": "9.00004", + "y2": "14.5", + "gradientUnits": "userSpaceOnUse" + }, + "children": [ + { + "type": "element", + "name": "stop", + "attributes": { + "stop-color": "white" + }, + "children": [] + }, + { + "type": "element", + "name": "stop", + "attributes": { + "offset": "1", + "stop-color": "white", + "stop-opacity": "0.9" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "linearGradient", + "attributes": { + "id": "paint11_linear_5617_78246", + "x1": "9.00004", + "y1": "3.5", + "x2": "9.00004", + "y2": "14.5", + "gradientUnits": "userSpaceOnUse" + }, + "children": [ + { + "type": "element", + "name": "stop", + "attributes": { + "stop-color": "white" + }, + "children": [] + }, + { + "type": "element", + "name": "stop", + "attributes": { + "offset": "1", + "stop-color": "white", + "stop-opacity": "0.9" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "linearGradient", + "attributes": { + "id": "paint12_linear_5617_78246", + "x1": "9.00004", + "y1": "3.5", + "x2": "9.00004", + "y2": "14.5", + "gradientUnits": "userSpaceOnUse" + }, + "children": [ + { + "type": "element", + "name": "stop", + "attributes": { + "stop-color": "white" + }, + "children": [] + }, + { + "type": "element", + "name": "stop", + "attributes": { + "offset": "1", + "stop-color": "white", + "stop-opacity": "0.9" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "linearGradient", + "attributes": { + "id": "paint13_linear_5617_78246", + "x1": "9.00004", + "y1": "3.5", + "x2": "9.00004", + "y2": "14.5", + "gradientUnits": "userSpaceOnUse" + }, + "children": [ + { + "type": "element", + "name": "stop", + "attributes": { + "stop-color": "white" + }, + "children": [] + }, + { + "type": "element", + "name": "stop", + "attributes": { + "offset": "1", + "stop-color": "white", + "stop-opacity": "0.9" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "linearGradient", + "attributes": { + "id": "paint14_linear_5617_78246", + "x1": "9.00004", + "y1": "3.5", + "x2": "9.00004", + "y2": "14.5", + "gradientUnits": "userSpaceOnUse" + }, + "children": [ + { + "type": "element", + "name": "stop", + "attributes": { + "stop-color": "white" + }, + "children": [] + }, + { + "type": "element", + "name": "stop", + "attributes": { + "offset": "1", + "stop-color": "white", + "stop-opacity": "0.9" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "linearGradient", + "attributes": { + "id": "paint15_linear_5617_78246", + "x1": "9.00004", + "y1": "3.5", + "x2": "9.00004", + "y2": "14.5", + "gradientUnits": "userSpaceOnUse" + }, + "children": [ + { + "type": "element", + "name": "stop", + "attributes": { + "stop-color": "white" + }, + "children": [] + }, + { + "type": "element", + "name": "stop", + "attributes": { + "offset": "1", + "stop-color": "white", + "stop-opacity": "0.9" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "linearGradient", + "attributes": { + "id": "paint16_linear_5617_78246", + "x1": "9.00004", + "y1": "3.5", + "x2": "9.00004", + "y2": "14.5", + "gradientUnits": "userSpaceOnUse" + }, + "children": [ + { + "type": "element", + "name": "stop", + "attributes": { + "stop-color": "white" + }, + "children": [] + }, + { + "type": "element", + "name": "stop", + "attributes": { + "offset": "1", + "stop-color": "white", + "stop-opacity": "0.9" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "linearGradient", + "attributes": { + "id": "paint17_linear_5617_78246", + "x1": "9.00004", + "y1": "3.5", + "x2": "9.00004", + "y2": "14.5", + "gradientUnits": "userSpaceOnUse" + }, + "children": [ + { + "type": "element", + "name": "stop", + "attributes": { + "stop-color": "white" + }, + "children": [] + }, + { + "type": "element", + "name": "stop", + "attributes": { + "offset": "1", + "stop-color": "white", + "stop-opacity": "0.9" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "linearGradient", + "attributes": { + "id": "paint18_linear_5617_78246", + "x1": "9.00004", + "y1": "3.5", + "x2": "9.00004", + "y2": "14.5", + "gradientUnits": "userSpaceOnUse" + }, + "children": [ + { + "type": "element", + "name": "stop", + "attributes": { + "stop-color": "white" + }, + "children": [] + }, + { + "type": "element", + "name": "stop", + "attributes": { + "offset": "1", + "stop-color": "white", + "stop-opacity": "0.9" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "linearGradient", + "attributes": { + "id": "paint19_linear_5617_78246", + "x1": "9.00004", + "y1": "3.5", + "x2": "9.00004", + "y2": "14.5", + "gradientUnits": "userSpaceOnUse" + }, + "children": [ + { + "type": "element", + "name": "stop", + "attributes": { + "stop-color": "white" + }, + "children": [] + }, + { + "type": "element", + "name": "stop", + "attributes": { + "offset": "1", + "stop-color": "white", + "stop-opacity": "0.9" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "clipPath", + "attributes": { + "id": "clip0_5617_78246" + }, + "children": [ + { + "type": "element", + "name": "rect", + "attributes": { + "width": "12", + "height": "12", + "fill": "white", + "transform": "translate(3 3)" + }, + "children": [] + } + ] + } + ] + } + ] + }, + "name": "Graph" +} \ No newline at end of file diff --git a/web/app/components/base/icons/src/public/knowledge/Graph.tsx b/web/app/components/base/icons/src/public/knowledge/Graph.tsx new file mode 100644 index 0000000000..c1360c52ca --- /dev/null +++ b/web/app/components/base/icons/src/public/knowledge/Graph.tsx @@ -0,0 +1,20 @@ +// GENERATE BY script +// DON NOT EDIT IT MANUALLY + +import * as React from 'react' +import data from './Graph.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 = 'Graph' + +export default Icon diff --git a/web/app/components/base/icons/src/public/knowledge/ParentChild.json b/web/app/components/base/icons/src/public/knowledge/ParentChild.json new file mode 100644 index 0000000000..89c7c3f237 --- /dev/null +++ b/web/app/components/base/icons/src/public/knowledge/ParentChild.json @@ -0,0 +1,348 @@ +{ + "icon": { + "type": "element", + "isRootNode": true, + "name": "svg", + "attributes": { + "width": "18", + "height": "18", + "viewBox": "0 0 18 18", + "fill": "none", + "xmlns": "http://www.w3.org/2000/svg" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "d": "M10.5996 0.5C11.7113 0.5 12.5755 0.500118 13.2676 0.556641C13.9655 0.61366 14.5329 0.730378 15.043 0.990234L15.3525 1.16406C16.0576 1.59644 16.6322 2.21605 17.0098 2.95703L17.1006 3.15137C17.2979 3.61108 17.3935 4.12184 17.4434 4.73242C17.4999 5.42447 17.5 6.28869 17.5 7.40039V10.5996C17.5 11.7113 17.4999 12.5755 17.4434 13.2676C17.3935 13.8782 17.2979 14.3889 17.1006 14.8486L17.0098 15.043C16.6322 15.7839 16.0576 16.4036 15.3525 16.8359L15.043 17.0098C14.5329 17.2696 13.9655 17.3863 13.2676 17.4434C12.5755 17.4999 11.7113 17.5 10.5996 17.5H7.40039C6.28869 17.5 5.42447 17.4999 4.73242 17.4434C4.12184 17.3935 3.61108 17.2979 3.15137 17.1006L2.95703 17.0098C2.21605 16.6322 1.59644 16.0576 1.16406 15.3525L0.990234 15.043C0.730378 14.5329 0.61366 13.9655 0.556641 13.2676C0.500118 12.5755 0.5 11.7113 0.5 10.5996V7.40039C0.5 6.28869 0.500118 5.42447 0.556641 4.73242C0.61366 4.03453 0.730378 3.46707 0.990234 2.95703L1.16406 2.64746C1.59644 1.94243 2.21605 1.36778 2.95703 0.990234L3.15137 0.899414C3.61108 0.702129 4.12184 0.606527 4.73242 0.556641C5.42447 0.500118 6.28869 0.5 7.40039 0.5H10.5996Z", + "stroke": "white" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "d": "M1 7.4C1 5.15979 1 4.03969 1.43597 3.18404C1.81947 2.43139 2.43139 1.81947 3.18404 1.43597C4.03969 1 5.15979 1 7.4 1H10.6C12.8402 1 13.9603 1 14.816 1.43597C15.5686 1.81947 16.1805 2.43139 16.564 3.18404C17 4.03969 17 5.15979 17 7.4V10.6C17 12.8402 17 13.9603 16.564 14.816C16.1805 15.5686 15.5686 16.1805 14.816 16.564C13.9603 17 12.8402 17 10.6 17H7.4C5.15979 17 4.03969 17 3.18404 16.564C2.43139 16.1805 1.81947 15.5686 1.43597 14.816C1 13.9603 1 12.8402 1 10.6V7.4Z", + "fill": "#0BA5EC" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "d": "M1 7.4C1 5.15979 1 4.03969 1.43597 3.18404C1.81947 2.43139 2.43139 1.81947 3.18404 1.43597C4.03969 1 5.15979 1 7.4 1H10.6C12.8402 1 13.9603 1 14.816 1.43597C15.5686 1.81947 16.1805 2.43139 16.564 3.18404C17 4.03969 17 5.15979 17 7.4V10.6C17 12.8402 17 13.9603 16.564 14.816C16.1805 15.5686 15.5686 16.1805 14.816 16.564C13.9603 17 12.8402 17 10.6 17H7.4C5.15979 17 4.03969 17 3.18404 16.564C2.43139 16.1805 1.81947 15.5686 1.43597 14.816C1 13.9603 1 12.8402 1 10.6V7.4Z", + "fill": "url(#paint0_linear_5617_78274)" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "d": "M7.40039 1.5H10.5996C11.728 1.5 12.5446 1.50029 13.1865 1.55273C13.7434 1.59824 14.1352 1.68127 14.4561 1.81934L14.5889 1.88184C15.1651 2.17543 15.6471 2.62172 15.9834 3.16992L16.1182 3.41113C16.2942 3.75672 16.3953 4.17741 16.4473 4.81348C16.4997 5.4554 16.5 6.27204 16.5 7.40039V10.5996C16.5 11.728 16.4997 12.5446 16.4473 13.1865C16.4018 13.7434 16.3187 14.1352 16.1807 14.4561L16.1182 14.5889C15.8246 15.1651 15.3783 15.6471 14.8301 15.9834L14.5889 16.1182C14.2433 16.2942 13.8226 16.3953 13.1865 16.4473C12.5446 16.4997 11.728 16.5 10.5996 16.5H7.40039C6.27204 16.5 5.4554 16.4997 4.81348 16.4473C4.2566 16.4018 3.8648 16.3187 3.54395 16.1807L3.41113 16.1182C2.83494 15.8246 2.35287 15.3783 2.0166 14.8301L1.88184 14.5889C1.70575 14.2433 1.60471 13.8226 1.55273 13.1865C1.50029 12.5446 1.5 11.728 1.5 10.5996V7.40039C1.5 6.27204 1.50029 5.4554 1.55273 4.81348C1.59824 4.2566 1.68127 3.8648 1.81934 3.54395L1.88184 3.41113C2.17543 2.83494 2.62172 2.35287 3.16992 2.0166L3.41113 1.88184C3.75672 1.70575 4.17741 1.60471 4.81348 1.55273C5.4554 1.50029 6.27204 1.5 7.40039 1.5Z", + "stroke": "#101828", + "stroke-opacity": "0.08" + }, + "children": [] + }, + { + "type": "element", + "name": "g", + "attributes": { + "clip-path": "url(#clip0_5617_78274)" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "filter": "url(#filter0_d_5617_78274)" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "d": "M6.70834 6.87516C7.51375 6.87516 8.16667 6.22224 8.16667 5.41683C8.16667 4.61141 7.51375 3.9585 6.70834 3.9585C5.90292 3.9585 5.25001 4.61141 5.25001 5.41683C5.25001 6.22224 5.90292 6.87516 6.70834 6.87516Z", + "fill": "url(#paint1_linear_5617_78274)", + "shape-rendering": "crispEdges" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "d": "M11.2917 6.87516C12.0971 6.87516 12.75 6.22224 12.75 5.41683C12.75 4.61141 12.0971 3.9585 11.2917 3.9585C10.4863 3.9585 9.83334 4.61141 9.83334 5.41683C9.83334 6.22224 10.4863 6.87516 11.2917 6.87516Z", + "fill": "url(#paint2_linear_5617_78274)", + "shape-rendering": "crispEdges" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "d": "M11.2917 7.70849C10.8377 7.709 10.3912 7.82377 9.99324 8.04222C9.59529 8.26067 9.25874 8.57578 9.01459 8.95849C9.34482 8.96235 9.66011 9.09673 9.89159 9.33229C10.1231 9.56785 10.2519 9.88545 10.25 10.2157C10.2481 10.5459 10.1155 10.862 9.8813 11.0949C9.6471 11.3277 9.33026 11.4584 9 11.4584C8.66975 11.4584 8.35291 11.3277 8.1187 11.0949C7.8845 10.862 7.75195 10.5459 7.75003 10.2157C7.7481 9.88545 7.87695 9.56785 8.10842 9.33229C8.3399 9.09673 8.65519 8.96235 8.98542 8.95849C8.67086 8.46429 8.20432 8.08561 7.656 7.87941C7.10767 7.67321 6.50721 7.65065 5.94496 7.81512C5.3827 7.97959 4.88906 8.32219 4.53831 8.79139C4.18755 9.26059 3.99864 9.83101 4.00001 10.4168V13.1252C4.00001 13.2357 4.04391 13.3416 4.12205 13.4198C4.20019 13.4979 4.30617 13.5418 4.41667 13.5418H7.33334V12.5002L5.83334 11.3752C5.78957 11.3423 5.75269 11.3012 5.72481 11.2541C5.69693 11.207 5.6786 11.1549 5.67086 11.1008C5.65523 10.9914 5.6837 10.8802 5.75001 10.7918C5.81631 10.7034 5.91502 10.645 6.02441 10.6293C6.13381 10.6137 6.24493 10.6422 6.33334 10.7085L7.88875 11.8752H10.1113L11.6667 10.7085C11.7551 10.6422 11.8662 10.6137 11.9756 10.6293C12.085 10.645 12.1837 10.7034 12.25 10.7918C12.3163 10.8802 12.3448 10.9914 12.3291 11.1008C12.3135 11.2101 12.2551 11.3089 12.1667 11.3752L10.6667 12.5002V13.5418H13.5833C13.6938 13.5418 13.7998 13.4979 13.878 13.4198C13.9561 13.3416 14 13.2357 14 13.1252V10.4168C13.9991 9.6988 13.7135 9.01044 13.2058 8.50272C12.6981 7.995 12.0097 7.70938 11.2917 7.70849Z", + "fill": "url(#paint3_linear_5617_78274)", + "shape-rendering": "crispEdges" + }, + "children": [] + } + ] + } + ] + }, + { + "type": "element", + "name": "defs", + "attributes": {}, + "children": [ + { + "type": "element", + "name": "filter", + "attributes": { + "id": "filter0_d_5617_78274", + "x": "3.5", + "y": "3.7085", + "width": "11", + "height": "10.5835", + "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": "0.25" + }, + "children": [] + }, + { + "type": "element", + "name": "feGaussianBlur", + "attributes": { + "stdDeviation": "0.25" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in2": "hardAlpha", + "operator": "out" + }, + "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 0.2 0" + }, + "children": [] + }, + { + "type": "element", + "name": "feBlend", + "attributes": { + "mode": "normal", + "in2": "BackgroundImageFix", + "result": "effect1_dropShadow_5617_78274" + }, + "children": [] + }, + { + "type": "element", + "name": "feBlend", + "attributes": { + "mode": "normal", + "in": "SourceGraphic", + "in2": "effect1_dropShadow_5617_78274", + "result": "shape" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "linearGradient", + "attributes": { + "id": "paint0_linear_5617_78274", + "x1": "1", + "y1": "1", + "x2": "17", + "y2": "17", + "gradientUnits": "userSpaceOnUse" + }, + "children": [ + { + "type": "element", + "name": "stop", + "attributes": { + "stop-color": "white", + "stop-opacity": "0.12" + }, + "children": [] + }, + { + "type": "element", + "name": "stop", + "attributes": { + "offset": "1", + "stop-color": "white", + "stop-opacity": "0.08" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "linearGradient", + "attributes": { + "id": "paint1_linear_5617_78274", + "x1": "9", + "y1": "3.9585", + "x2": "9", + "y2": "13.5418", + "gradientUnits": "userSpaceOnUse" + }, + "children": [ + { + "type": "element", + "name": "stop", + "attributes": { + "stop-color": "white" + }, + "children": [] + }, + { + "type": "element", + "name": "stop", + "attributes": { + "offset": "1", + "stop-color": "white", + "stop-opacity": "0.9" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "linearGradient", + "attributes": { + "id": "paint2_linear_5617_78274", + "x1": "9", + "y1": "3.9585", + "x2": "9", + "y2": "13.5418", + "gradientUnits": "userSpaceOnUse" + }, + "children": [ + { + "type": "element", + "name": "stop", + "attributes": { + "stop-color": "white" + }, + "children": [] + }, + { + "type": "element", + "name": "stop", + "attributes": { + "offset": "1", + "stop-color": "white", + "stop-opacity": "0.9" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "linearGradient", + "attributes": { + "id": "paint3_linear_5617_78274", + "x1": "9", + "y1": "3.9585", + "x2": "9", + "y2": "13.5418", + "gradientUnits": "userSpaceOnUse" + }, + "children": [ + { + "type": "element", + "name": "stop", + "attributes": { + "stop-color": "white" + }, + "children": [] + }, + { + "type": "element", + "name": "stop", + "attributes": { + "offset": "1", + "stop-color": "white", + "stop-opacity": "0.9" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "clipPath", + "attributes": { + "id": "clip0_5617_78274" + }, + "children": [ + { + "type": "element", + "name": "rect", + "attributes": { + "width": "12", + "height": "12", + "fill": "white", + "transform": "translate(3 3)" + }, + "children": [] + } + ] + } + ] + } + ] + }, + "name": "ParentChild" +} \ No newline at end of file diff --git a/web/app/components/base/icons/src/public/knowledge/ParentChild.tsx b/web/app/components/base/icons/src/public/knowledge/ParentChild.tsx new file mode 100644 index 0000000000..7c6c3baa7b --- /dev/null +++ b/web/app/components/base/icons/src/public/knowledge/ParentChild.tsx @@ -0,0 +1,20 @@ +// GENERATE BY script +// DON NOT EDIT IT MANUALLY + +import * as React from 'react' +import data from './ParentChild.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 = 'ParentChild' + +export default Icon diff --git a/web/app/components/base/icons/src/public/knowledge/Qa.json b/web/app/components/base/icons/src/public/knowledge/Qa.json new file mode 100644 index 0000000000..6435a0960c --- /dev/null +++ b/web/app/components/base/icons/src/public/knowledge/Qa.json @@ -0,0 +1,237 @@ +{ + "icon": { + "type": "element", + "isRootNode": true, + "name": "svg", + "attributes": { + "width": "18", + "height": "18", + "viewBox": "0 0 18 18", + "fill": "none", + "xmlns": "http://www.w3.org/2000/svg" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "d": "M10.5996 0.5C11.7113 0.5 12.5755 0.500118 13.2676 0.556641C13.9655 0.61366 14.5329 0.730378 15.043 0.990234L15.3525 1.16406C16.0576 1.59644 16.6322 2.21605 17.0098 2.95703L17.1006 3.15137C17.2979 3.61108 17.3935 4.12184 17.4434 4.73242C17.4999 5.42447 17.5 6.28869 17.5 7.40039V10.5996C17.5 11.7113 17.4999 12.5755 17.4434 13.2676C17.3935 13.8782 17.2979 14.3889 17.1006 14.8486L17.0098 15.043C16.6322 15.7839 16.0576 16.4036 15.3525 16.8359L15.043 17.0098C14.5329 17.2696 13.9655 17.3863 13.2676 17.4434C12.5755 17.4999 11.7113 17.5 10.5996 17.5H7.40039C6.28869 17.5 5.42447 17.4999 4.73242 17.4434C4.12184 17.3935 3.61108 17.2979 3.15137 17.1006L2.95703 17.0098C2.21605 16.6322 1.59644 16.0576 1.16406 15.3525L0.990234 15.043C0.730378 14.5329 0.61366 13.9655 0.556641 13.2676C0.500118 12.5755 0.5 11.7113 0.5 10.5996V7.40039C0.5 6.28869 0.500118 5.42447 0.556641 4.73242C0.61366 4.03453 0.730378 3.46707 0.990234 2.95703L1.16406 2.64746C1.59644 1.94243 2.21605 1.36778 2.95703 0.990234L3.15137 0.899414C3.61108 0.702129 4.12184 0.606527 4.73242 0.556641C5.42447 0.500118 6.28869 0.5 7.40039 0.5H10.5996Z", + "stroke": "white" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "d": "M1 7.4C1 5.15979 1 4.03969 1.43597 3.18404C1.81947 2.43139 2.43139 1.81947 3.18404 1.43597C4.03969 1 5.15979 1 7.4 1H10.6C12.8402 1 13.9603 1 14.816 1.43597C15.5686 1.81947 16.1805 2.43139 16.564 3.18404C17 4.03969 17 5.15979 17 7.4V10.6C17 12.8402 17 13.9603 16.564 14.816C16.1805 15.5686 15.5686 16.1805 14.816 16.564C13.9603 17 12.8402 17 10.6 17H7.4C5.15979 17 4.03969 17 3.18404 16.564C2.43139 16.1805 1.81947 15.5686 1.43597 14.816C1 13.9603 1 12.8402 1 10.6V7.4Z", + "fill": "#0E9384" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "d": "M1 7.4C1 5.15979 1 4.03969 1.43597 3.18404C1.81947 2.43139 2.43139 1.81947 3.18404 1.43597C4.03969 1 5.15979 1 7.4 1H10.6C12.8402 1 13.9603 1 14.816 1.43597C15.5686 1.81947 16.1805 2.43139 16.564 3.18404C17 4.03969 17 5.15979 17 7.4V10.6C17 12.8402 17 13.9603 16.564 14.816C16.1805 15.5686 15.5686 16.1805 14.816 16.564C13.9603 17 12.8402 17 10.6 17H7.4C5.15979 17 4.03969 17 3.18404 16.564C2.43139 16.1805 1.81947 15.5686 1.43597 14.816C1 13.9603 1 12.8402 1 10.6V7.4Z", + "fill": "url(#paint0_linear_5617_78260)" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "d": "M7.40039 1.5H10.5996C11.728 1.5 12.5446 1.50029 13.1865 1.55273C13.7434 1.59824 14.1352 1.68127 14.4561 1.81934L14.5889 1.88184C15.1651 2.17543 15.6471 2.62172 15.9834 3.16992L16.1182 3.41113C16.2942 3.75672 16.3953 4.17741 16.4473 4.81348C16.4997 5.4554 16.5 6.27204 16.5 7.40039V10.5996C16.5 11.728 16.4997 12.5446 16.4473 13.1865C16.4018 13.7434 16.3187 14.1352 16.1807 14.4561L16.1182 14.5889C15.8246 15.1651 15.3783 15.6471 14.8301 15.9834L14.5889 16.1182C14.2433 16.2942 13.8226 16.3953 13.1865 16.4473C12.5446 16.4997 11.728 16.5 10.5996 16.5H7.40039C6.27204 16.5 5.4554 16.4997 4.81348 16.4473C4.2566 16.4018 3.8648 16.3187 3.54395 16.1807L3.41113 16.1182C2.83494 15.8246 2.35287 15.3783 2.0166 14.8301L1.88184 14.5889C1.70575 14.2433 1.60471 13.8226 1.55273 13.1865C1.50029 12.5446 1.5 11.728 1.5 10.5996V7.40039C1.5 6.27204 1.50029 5.4554 1.55273 4.81348C1.59824 4.2566 1.68127 3.8648 1.81934 3.54395L1.88184 3.41113C2.17543 2.83494 2.62172 2.35287 3.16992 2.0166L3.41113 1.88184C3.75672 1.70575 4.17741 1.60471 4.81348 1.55273C5.4554 1.50029 6.27204 1.5 7.40039 1.5Z", + "stroke": "#101828", + "stroke-opacity": "0.08" + }, + "children": [] + }, + { + "type": "element", + "name": "g", + "attributes": { + "filter": "url(#filter0_d_5617_78260)" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "fill-rule": "evenodd", + "clip-rule": "evenodd", + "d": "M14.001 5.5C14.001 4.94772 13.5533 4.5 13.001 4.5H7.00098C6.44869 4.5 6.00098 4.94772 6.00098 5.5V6.5H5.00098C4.44869 6.5 4.00098 6.94772 4.00098 7.5V11.5C4.00098 12.0523 4.44869 12.5 5.00098 12.5H5.50098V13.25C5.50098 13.4271 5.59473 13.5911 5.74742 13.681C5.9001 13.7708 6.08894 13.7731 6.2438 13.6871L8.38055 12.5H11.001C11.5533 12.5 12.001 12.0523 12.001 11.5V10.5H13.001C13.5533 10.5 14.001 10.0523 14.001 9.5V5.5ZM11.001 6.5H7.00098V5.5H13.001V9.5H12.001V7.5C12.001 6.94772 11.5533 6.5 11.001 6.5ZM6.5 8C6.22386 8 6 8.22386 6 8.5C6 8.77614 6.22386 9 6.5 9H9.5C9.77614 9 10 8.77614 10 8.5C10 8.22386 9.77614 8 9.5 8H6.5ZM6.5 10C6.22386 10 6 10.2239 6 10.5C6 10.7761 6.22386 11 6.5 11H8C8.27614 11 8.5 10.7761 8.5 10.5C8.5 10.2239 8.27614 10 8 10H6.5Z", + "fill": "url(#paint1_linear_5617_78260)", + "shape-rendering": "crispEdges" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "defs", + "attributes": {}, + "children": [ + { + "type": "element", + "name": "filter", + "attributes": { + "id": "filter0_d_5617_78260", + "x": "3.50098", + "y": "4.25", + "width": "11", + "height": "10.25", + "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": "0.25" + }, + "children": [] + }, + { + "type": "element", + "name": "feGaussianBlur", + "attributes": { + "stdDeviation": "0.25" + }, + "children": [] + }, + { + "type": "element", + "name": "feComposite", + "attributes": { + "in2": "hardAlpha", + "operator": "out" + }, + "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 0.2 0" + }, + "children": [] + }, + { + "type": "element", + "name": "feBlend", + "attributes": { + "mode": "normal", + "in2": "BackgroundImageFix", + "result": "effect1_dropShadow_5617_78260" + }, + "children": [] + }, + { + "type": "element", + "name": "feBlend", + "attributes": { + "mode": "normal", + "in": "SourceGraphic", + "in2": "effect1_dropShadow_5617_78260", + "result": "shape" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "linearGradient", + "attributes": { + "id": "paint0_linear_5617_78260", + "x1": "1", + "y1": "1", + "x2": "17", + "y2": "17", + "gradientUnits": "userSpaceOnUse" + }, + "children": [ + { + "type": "element", + "name": "stop", + "attributes": { + "stop-color": "white", + "stop-opacity": "0.12" + }, + "children": [] + }, + { + "type": "element", + "name": "stop", + "attributes": { + "offset": "1", + "stop-color": "white", + "stop-opacity": "0.08" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "linearGradient", + "attributes": { + "id": "paint1_linear_5617_78260", + "x1": "9.00099", + "y1": "4.5", + "x2": "9.00099", + "y2": "13.75", + "gradientUnits": "userSpaceOnUse" + }, + "children": [ + { + "type": "element", + "name": "stop", + "attributes": { + "stop-color": "white" + }, + "children": [] + }, + { + "type": "element", + "name": "stop", + "attributes": { + "offset": "1", + "stop-color": "white", + "stop-opacity": "0.9" + }, + "children": [] + } + ] + } + ] + } + ] + }, + "name": "Qa" +} \ No newline at end of file diff --git a/web/app/components/base/icons/src/public/knowledge/Qa.tsx b/web/app/components/base/icons/src/public/knowledge/Qa.tsx new file mode 100644 index 0000000000..34ef88141e --- /dev/null +++ b/web/app/components/base/icons/src/public/knowledge/Qa.tsx @@ -0,0 +1,20 @@ +// GENERATE BY script +// DON NOT EDIT IT MANUALLY + +import * as React from 'react' +import data from './Qa.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 = 'Qa' + +export default Icon diff --git a/web/app/components/base/icons/src/public/knowledge/index.ts b/web/app/components/base/icons/src/public/knowledge/index.ts index 51619b16b7..2b21df83b7 100644 --- a/web/app/components/base/icons/src/public/knowledge/index.ts +++ b/web/app/components/base/icons/src/public/knowledge/index.ts @@ -2,11 +2,15 @@ export { default as Chunk } from './Chunk' export { default as Collapse } from './Collapse' export { default as File } from './File' export { default as GeneralType } from './GeneralType' +export { default as General } from './General' +export { default as Graph } from './Graph' export { default as LayoutRight2LineMod } from './LayoutRight2LineMod' export { default as OptionCardEffectBlueLight } from './OptionCardEffectBlueLight' export { default as OptionCardEffectBlue } from './OptionCardEffectBlue' export { default as OptionCardEffectOrange } from './OptionCardEffectOrange' export { default as OptionCardEffectPurple } from './OptionCardEffectPurple' export { default as ParentChildType } from './ParentChildType' +export { default as ParentChild } from './ParentChild' +export { default as Qa } from './Qa' export { default as SelectionMod } from './SelectionMod' export { default as Watercrawl } from './Watercrawl' diff --git a/web/app/components/base/segmented-control/index.tsx b/web/app/components/base/segmented-control/index.tsx index 7bb3aa78a3..46d27c2e53 100644 --- a/web/app/components/base/segmented-control/index.tsx +++ b/web/app/components/base/segmented-control/index.tsx @@ -116,7 +116,7 @@ export const SegmentedControl = ({ )} onClick={() => onChange(option.value)} > - + {text && (
{text} diff --git a/web/app/components/base/tag-management/panel.tsx b/web/app/components/base/tag-management/panel.tsx new file mode 100644 index 0000000000..79031e9f8a --- /dev/null +++ b/web/app/components/base/tag-management/panel.tsx @@ -0,0 +1,209 @@ +import React, { useMemo, useState } from 'react' +import { useContext } from 'use-context-selector' +import { useTranslation } from 'react-i18next' +import { useUnmount } from 'ahooks' +import { RiAddLine, RiPriceTag3Line } from '@remixicon/react' +import { useStore as useTagStore } from './store' +import type { HtmlContentProps } from '@/app/components/base/popover' +import Divider from '@/app/components/base/divider' +import Input from '@/app/components/base/input' +import type { Tag } from '@/app/components/base/tag-management/constant' +import Checkbox from '@/app/components/base/checkbox' +import { bindTag, createTag, unBindTag } from '@/service/tag' +import { ToastContext } from '@/app/components/base/toast' +import { noop } from 'lodash-es' +import type { TagSelectorProps } from './selector' + +type PanelProps = { + onCreate: () => void +} & HtmlContentProps & TagSelectorProps + +const Panel = (props: PanelProps) => { + const { t } = useTranslation() + const { notify } = useContext(ToastContext) + const { targetID, type, value, selectedTags, onCacheUpdate, onChange, onCreate } = props + const tagList = useTagStore(s => s.tagList) + const setTagList = useTagStore(s => s.setTagList) + const setShowTagManagementModal = useTagStore(s => s.setShowTagManagementModal) + const [selectedTagIDs, setSelectedTagIDs] = useState(value) + const [keywords, setKeywords] = useState('') + const handleKeywordsChange = (value: string) => { + setKeywords(value) + } + + const notExisted = useMemo(() => { + return tagList.every(tag => tag.type === type && tag.name !== keywords) + }, [type, tagList, keywords]) + const filteredSelectedTagList = useMemo(() => { + return selectedTags.filter(tag => tag.name.includes(keywords)) + }, [keywords, selectedTags]) + const filteredTagList = useMemo(() => { + return tagList.filter(tag => tag.type === type && !value.includes(tag.id) && tag.name.includes(keywords)) + }, [type, tagList, value, keywords]) + + const [creating, setCreating] = useState(false) + const createNewTag = async () => { + if (!keywords) + return + if (creating) + return + try { + setCreating(true) + const newTag = await createTag(keywords, type) + notify({ type: 'success', message: t('common.tag.created') }) + setTagList([ + ...tagList, + newTag, + ]) + setKeywords('') + setCreating(false) + onCreate() + } + catch { + notify({ type: 'error', message: t('common.tag.failed') }) + setCreating(false) + } + } + const bind = async (tagIDs: string[]) => { + try { + await bindTag(tagIDs, targetID, type) + notify({ type: 'success', message: t('common.actionMsg.modifiedSuccessfully') }) + } + catch { + notify({ type: 'error', message: t('common.actionMsg.modifiedUnsuccessfully') }) + } + } + const unbind = async (tagID: string) => { + try { + await unBindTag(tagID, targetID, type) + notify({ type: 'success', message: t('common.actionMsg.modifiedSuccessfully') }) + } + catch { + notify({ type: 'error', message: t('common.actionMsg.modifiedUnsuccessfully') }) + } + } + const selectTag = (tag: Tag) => { + if (selectedTagIDs.includes(tag.id)) + setSelectedTagIDs(selectedTagIDs.filter(v => v !== tag.id)) + else + setSelectedTagIDs([...selectedTagIDs, tag.id]) + } + + const valueNotChanged = useMemo(() => { + return value.length === selectedTagIDs.length && value.every(v => selectedTagIDs.includes(v)) && selectedTagIDs.every(v => value.includes(v)) + }, [value, selectedTagIDs]) + const handleValueChange = () => { + const addTagIDs = selectedTagIDs.filter(v => !value.includes(v)) + const removeTagIDs = value.filter(v => !selectedTagIDs.includes(v)) + const selectedTags = tagList.filter(tag => selectedTagIDs.includes(tag.id)) + onCacheUpdate(selectedTags) + Promise.all([ + ...(addTagIDs.length ? [bind(addTagIDs)] : []), + ...[removeTagIDs.length ? removeTagIDs.map(tagID => unbind(tagID)) : []], + ]).finally(() => { + if (onChange) + onChange() + }) + } + useUnmount(() => { + if (valueNotChanged) + return + handleValueChange() + }) + + return ( +
+
+ handleKeywordsChange(e.target.value)} + onClear={() => handleKeywordsChange('')} + /> +
+ {keywords && notExisted && ( +
+
+ +
+ {`${t('common.tag.create')} `} + {`'${keywords}'`} +
+
+
+ )} + {keywords && notExisted && filteredTagList.length > 0 && ( + + )} + {(filteredTagList.length > 0 || filteredSelectedTagList.length > 0) && ( +
+ {filteredSelectedTagList.map(tag => ( +
selectTag(tag)} + > + +
+ {tag.name} +
+
+ ))} + {filteredTagList.map(tag => ( +
selectTag(tag)} + > + +
+ {tag.name} +
+
+ ))} +
+ )} + {!keywords && !filteredTagList.length && !filteredSelectedTagList.length && ( +
+
+ +
{t('common.tag.noTag')}
+
+
+ )} + +
+
setShowTagManagementModal(true)} + > + +
+ {t('common.tag.manageTags')} +
+
+
+
+ ) +} + +export default React.memo(Panel) diff --git a/web/app/components/base/tag-management/selector.tsx b/web/app/components/base/tag-management/selector.tsx index 2678be2f17..cc5ffdeee6 100644 --- a/web/app/components/base/tag-management/selector.tsx +++ b/web/app/components/base/tag-management/selector.tsx @@ -1,23 +1,14 @@ import type { FC } from 'react' -import { useMemo, useState } from 'react' -import { useContext } from 'use-context-selector' -import { useTranslation } from 'react-i18next' -import { useUnmount } from 'ahooks' -import { RiAddLine } from '@remixicon/react' +import { useCallback, useMemo } from 'react' import { useStore as useTagStore } from './store' import cn from '@/utils/classnames' -import type { HtmlContentProps } from '@/app/components/base/popover' import CustomPopover from '@/app/components/base/popover' -import Divider from '@/app/components/base/divider' -import Input from '@/app/components/base/input' -import { Tag01, Tag03 } from '@/app/components/base/icons/src/vender/line/financeAndECommerce' import type { Tag } from '@/app/components/base/tag-management/constant' -import Checkbox from '@/app/components/base/checkbox' -import { bindTag, createTag, fetchTagList, unBindTag } from '@/service/tag' -import { ToastContext } from '@/app/components/base/toast' -import { noop } from 'lodash-es' +import { fetchTagList } from '@/service/tag' +import Trigger from './trigger' +import Panel from './panel' -type TagSelectorProps = { +export type TagSelectorProps = { targetID: string isPopover?: boolean position?: 'bl' | 'br' @@ -28,182 +19,6 @@ type TagSelectorProps = { onChange?: () => void } -type PanelProps = { - onCreate: () => void -} & HtmlContentProps & TagSelectorProps - -const Panel = (props: PanelProps) => { - const { t } = useTranslation() - const { notify } = useContext(ToastContext) - const { targetID, type, value, selectedTags, onCacheUpdate, onChange, onCreate } = props - const tagList = useTagStore(s => s.tagList) - const setTagList = useTagStore(s => s.setTagList) - const setShowTagManagementModal = useTagStore(s => s.setShowTagManagementModal) - const [selectedTagIDs, setSelectedTagIDs] = useState(value) - const [keywords, setKeywords] = useState('') - const handleKeywordsChange = (value: string) => { - setKeywords(value) - } - - const notExisted = useMemo(() => { - return tagList.every(tag => tag.type === type && tag.name !== keywords) - }, [type, tagList, keywords]) - const filteredSelectedTagList = useMemo(() => { - return selectedTags.filter(tag => tag.name.includes(keywords)) - }, [keywords, selectedTags]) - const filteredTagList = useMemo(() => { - return tagList.filter(tag => tag.type === type && !value.includes(tag.id) && tag.name.includes(keywords)) - }, [type, tagList, value, keywords]) - - const [creating, setCreating] = useState(false) - const createNewTag = async () => { - if (!keywords) - return - if (creating) - return - try { - setCreating(true) - const newTag = await createTag(keywords, type) - notify({ type: 'success', message: t('common.tag.created') }) - setTagList([ - ...tagList, - newTag, - ]) - setKeywords('') - setCreating(false) - onCreate() - } - catch { - notify({ type: 'error', message: t('common.tag.failed') }) - setCreating(false) - } - } - const bind = async (tagIDs: string[]) => { - try { - await bindTag(tagIDs, targetID, type) - notify({ type: 'success', message: t('common.actionMsg.modifiedSuccessfully') }) - } - catch { - notify({ type: 'error', message: t('common.actionMsg.modifiedUnsuccessfully') }) - } - } - const unbind = async (tagID: string) => { - try { - await unBindTag(tagID, targetID, type) - notify({ type: 'success', message: t('common.actionMsg.modifiedSuccessfully') }) - } - catch { - notify({ type: 'error', message: t('common.actionMsg.modifiedUnsuccessfully') }) - } - } - const selectTag = (tag: Tag) => { - if (selectedTagIDs.includes(tag.id)) - setSelectedTagIDs(selectedTagIDs.filter(v => v !== tag.id)) - else - setSelectedTagIDs([...selectedTagIDs, tag.id]) - } - - const valueNotChanged = useMemo(() => { - return value.length === selectedTagIDs.length && value.every(v => selectedTagIDs.includes(v)) && selectedTagIDs.every(v => value.includes(v)) - }, [value, selectedTagIDs]) - const handleValueChange = () => { - const addTagIDs = selectedTagIDs.filter(v => !value.includes(v)) - const removeTagIDs = value.filter(v => !selectedTagIDs.includes(v)) - const selectedTags = tagList.filter(tag => selectedTagIDs.includes(tag.id)) - onCacheUpdate(selectedTags) - Promise.all([ - ...(addTagIDs.length ? [bind(addTagIDs)] : []), - ...[removeTagIDs.length ? removeTagIDs.map(tagID => unbind(tagID)) : []], - ]).finally(() => { - if (onChange) - onChange() - }) - } - useUnmount(() => { - if (valueNotChanged) - return - handleValueChange() - }) - - return ( -
-
- handleKeywordsChange(e.target.value)} - onClear={() => handleKeywordsChange('')} - /> -
- {keywords && notExisted && ( -
-
- -
- {`${t('common.tag.create')} `} - {`"${keywords}"`} -
-
-
- )} - {keywords && notExisted && filteredTagList.length > 0 && ( - - )} - {(filteredTagList.length > 0 || filteredSelectedTagList.length > 0) && ( -
- {filteredSelectedTagList.map(tag => ( -
selectTag(tag)} - > - -
{tag.name}
-
- ))} - {filteredTagList.map(tag => ( -
selectTag(tag)} - > - -
{tag.name}
-
- ))} -
- )} - {!keywords && !filteredTagList.length && !filteredSelectedTagList.length && ( -
-
- -
{t('common.tag.noTag')}
-
-
- )} - -
-
setShowTagManagementModal(true)}> - -
- {t('common.tag.manageTags')} -
-
-
-
- ) -} - const TagSelector: FC = ({ targetID, isPopover = true, @@ -214,34 +29,20 @@ const TagSelector: FC = ({ onCacheUpdate, onChange, }) => { - const { t } = useTranslation() - const tagList = useTagStore(s => s.tagList) const setTagList = useTagStore(s => s.setTagList) - const getTagList = async () => { + const getTagList = useCallback(async () => { const res = await fetchTagList(type) setTagList(res) - } + }, [setTagList, type]) - const triggerContent = useMemo(() => { + const tags = useMemo(() => { if (selectedTags?.length) - return selectedTags.filter(selectedTag => tagList.find(tag => tag.id === selectedTag.id)).map(tag => tag.name).join(', ') - return '' + return selectedTags.filter(selectedTag => tagList.find(tag => tag.id === selectedTag.id)).map(tag => tag.name) + return [] }, [selectedTags, tagList]) - const Trigger = () => { - return ( -
- -
- {!triggerContent ? t('common.tag.addTag') : triggerContent} -
-
- ) - } return ( <> {isPopover && ( @@ -258,8 +59,8 @@ const TagSelector: FC = ({ /> } position={position} - trigger="click" - btnElement={} + trigger='click' + btnElement={} btnClassName={open => cn( open ? '!bg-state-base-hover !text-text-secondary' : '!bg-transparent', diff --git a/web/app/components/base/tag-management/trigger.tsx b/web/app/components/base/tag-management/trigger.tsx new file mode 100644 index 0000000000..e7c3ab110a --- /dev/null +++ b/web/app/components/base/tag-management/trigger.tsx @@ -0,0 +1,46 @@ +import { RiPriceTag3Line } from '@remixicon/react' +import React from 'react' +import { useTranslation } from 'react-i18next' + +type TriggerProps = { + tags: string[] +} + +const Trigger = ({ + tags, +}: TriggerProps) => { + const { t } = useTranslation() + + return ( +
+ {!tags.length ? ( +
+ +
+ {t('common.tag.addTag')} +
+
+ ) : ( + <> + { + tags.map((content, index) => { + return ( +
+ +
+ {content} +
+
+ ) + }) + } + + )} +
+ ) +} + +export default React.memo(Trigger) diff --git a/web/app/(commonLayout)/datasets/Container.tsx b/web/app/components/datasets/list/container.tsx similarity index 95% rename from web/app/(commonLayout)/datasets/Container.tsx rename to web/app/components/datasets/list/container.tsx index 9d9c048403..8e7d122c86 100644 --- a/web/app/(commonLayout)/datasets/Container.tsx +++ b/web/app/components/datasets/list/container.tsx @@ -8,11 +8,11 @@ import { useBoolean, useDebounceFn } from 'ahooks' import { useQuery } from '@tanstack/react-query' // Components -import ExternalAPIPanel from '../../components/datasets/external-api/external-api-panel' -import Datasets from './Datasets' -import DatasetFooter from './DatasetFooter' -import ApiServer from '../../components/develop/ApiServer' -import Doc from './Doc' +import ExternalAPIPanel from '../external-api/external-api-panel' +import Datasets from './datasets' +import DatasetFooter from './dataset-footer' +import ApiServer from '../../develop/ApiServer' +import Doc from './doc' import SegmentedControl from '@/app/components/base/segmented-control' import { RiBook2Line, RiTerminalBoxLine } from '@remixicon/react' import TagManagementModal from '@/app/components/base/tag-management' diff --git a/web/app/(commonLayout)/datasets/DatasetCard.tsx b/web/app/components/datasets/list/dataset-card/dataset-card-old.tsx similarity index 100% rename from web/app/(commonLayout)/datasets/DatasetCard.tsx rename to web/app/components/datasets/list/dataset-card/dataset-card-old.tsx diff --git a/web/app/components/datasets/list/dataset-card/index.tsx b/web/app/components/datasets/list/dataset-card/index.tsx new file mode 100644 index 0000000000..2a83a43dd6 --- /dev/null +++ b/web/app/components/datasets/list/dataset-card/index.tsx @@ -0,0 +1,244 @@ +'use client' +import { useRouter } from 'next/navigation' +import { useTranslation } from 'react-i18next' +import type { DataSet } from '@/models/datasets' +import { ChunkingMode } from '@/models/datasets' +import { useAppContext } from '@/context/app-context' +import { General, Graph, ParentChild, Qa } from '@/app/components/base/icons/src/public/knowledge' +import { useKnowledge } from '@/hooks/use-knowledge' +import { useCallback, useEffect, useMemo, useRef, useState } from 'react' +import type { Tag } from '@/app/components/base/tag-management/constant' +import TagSelector from '@/app/components/base/tag-management/selector' +import cn from '@/utils/classnames' +import { useHover } from 'ahooks' +import { RiFileTextFill, RiMoreFill, RiRobot2Fill } from '@remixicon/react' +import Tooltip from '@/app/components/base/tooltip' +import { useGetLanguage } from '@/context/i18n' +import dayjs from 'dayjs' +import { checkIsUsedInApp, deleteDataset } from '@/service/datasets' +import RenameDatasetModal from '../../rename-modal' +import Confirm from '@/app/components/base/confirm' +import Toast from '@/app/components/base/toast' +import CustomPopover from '@/app/components/base/popover' +import Operations from './operations' + +const EXTERNAL_PROVIDER = 'external' + +const DOC_FORM_ICON: Record> = { + [ChunkingMode.text]: General, + [ChunkingMode.qa]: Qa, + [ChunkingMode.parentChild]: ParentChild, + [ChunkingMode.graph]: Graph, +} + +const DOC_FORM_TEXT: Record = { + [ChunkingMode.text]: 'general', + [ChunkingMode.qa]: 'qa', + [ChunkingMode.parentChild]: 'parentChild', + [ChunkingMode.graph]: 'graph', +} + +export type DatasetCardProps = { + dataset: DataSet + onSuccess?: () => void +} + +const DatasetCard = ({ + dataset, + onSuccess, +}: DatasetCardProps) => { + const { t } = useTranslation() + const { push } = useRouter() + + const { isCurrentWorkspaceDatasetOperator } = useAppContext() + const [tags, setTags] = useState(dataset.tags) + const tagSelectorRef = useRef(null) + const isHoveringTagSelector = useHover(tagSelectorRef) + + const [showRenameModal, setShowRenameModal] = useState(false) + const [showConfirmDelete, setShowConfirmDelete] = useState(false) + const [confirmMessage, setConfirmMessage] = useState('') + + const isExternalProvider = useMemo(() => { + return dataset.provider === EXTERNAL_PROVIDER + }, [dataset.provider]) + const Icon = DOC_FORM_ICON[dataset.doc_form] || General + const { formatIndexingTechniqueAndMethod } = useKnowledge() + const documentCount = useMemo(() => { + const availableDocCount = dataset.available_document_count || dataset.document_count + if (availableDocCount === dataset.document_count) + return `${dataset.document_count}` + if (availableDocCount < dataset.document_count) + return `${availableDocCount} / ${dataset.document_count}` + }, [dataset.document_count, dataset.available_document_count]) + const documentCountTooltip = useMemo(() => { + const availableDocCount = dataset.available_document_count || dataset.document_count + if (availableDocCount === dataset.document_count) + return t('dataset.docAllEnabled', { count: availableDocCount }) + if (availableDocCount < dataset.document_count) + return t('dataset.docAllEnabled', { count: dataset.document_count, num: availableDocCount }) + }, [t, dataset.document_count, dataset.available_document_count]) + + const language = useGetLanguage() + const formatTimeFromNow = useCallback((time: number) => { + return dayjs(time * 1_000).locale(language === 'zh_Hans' ? 'zh-cn' : language.replace('_', '-')).fromNow() + }, [language]) + + const detectIsUsedByApp = useCallback(async () => { + try { + const { is_using: isUsedByApp } = await checkIsUsedInApp(dataset.id) + setConfirmMessage(isUsedByApp ? t('dataset.datasetUsedByApp')! : t('dataset.deleteDatasetConfirmContent')!) + } + catch (e: any) { + const res = await e.json() + Toast.notify({ type: 'error', message: res?.message || 'Unknown error' }) + } + + setShowConfirmDelete(true) + }, [dataset.id, t]) + + const onConfirmDelete = useCallback(async () => { + try { + await deleteDataset(dataset.id) + Toast.notify({ type: 'success', message: t('dataset.datasetDeleted') }) + if (onSuccess) + onSuccess() + } + catch { + } + setShowConfirmDelete(false) + }, [dataset.id, onSuccess, t]) + + useEffect(() => { + setTags(dataset.tags) + }, [dataset]) + + return ( + <> +
{ + e.preventDefault() + isExternalProvider + ? push(`/datasets/${dataset.id}/hitTesting`) + : push(`/datasets/${dataset.id}/documents`) + }} + > +
+
+ 📙 +
+ +
+
+
+
{dataset.name}
+
+ {t(`dataset.chunkingMode.${DOC_FORM_TEXT[dataset.doc_form]}`)} + {formatIndexingTechniqueAndMethod(dataset.indexing_technique, dataset.retrieval_model_dict?.search_method)} +
+
+
+
+ {dataset.description} +
+
{ + e.stopPropagation() + e.preventDefault() + }} + > +
+ tag.id)} + selectedTags={tags} + onCacheUpdate={setTags} + onChange={onSuccess} + /> +
+ {/* Tag Mask */} +
+
+
+ +
+ + {documentCount} +
+
+ {!isExternalProvider && ( + +
+ + {dataset.app_count} +
+
+ )} + / + {`${t('dataset.updated')} ${formatTimeFromNow(dataset.updated_at)}`} +
+
+ { + setShowRenameModal(true) + }} + detectIsUsedByApp={detectIsUsedByApp} + /> + } + className={'z-20 min-w-[186px]'} + popupClassName={'rounded-xl bg-none shadow-none ring-0 min-w-[186px]'} + position='br' + trigger='click' + btnElement={ + + } + btnClassName={open => + cn( + 'size-9 cursor-pointer justify-center rounded-[10px] border-[0.5px] border-components-actionbar-border bg-components-actionbar-bg p-0 p-0.5 shadow-lg shadow-shadow-shadow-5 ring-[2px] ring-inset ring-components-actionbar-bg hover:border-components-actionbar-border hover:bg-state-base-hover', + open ? 'border-components-actionbar-border bg-state-base-hover' : '', + ) + } + /> +
+
+ {showRenameModal && ( + setShowRenameModal(false)} + onSuccess={onSuccess} + /> + )} + {showConfirmDelete && ( + setShowConfirmDelete(false)} + /> + )} + + ) +} + +export default DatasetCard diff --git a/web/app/components/datasets/list/dataset-card/operations.tsx b/web/app/components/datasets/list/dataset-card/operations.tsx new file mode 100644 index 0000000000..c4fc78ba8f --- /dev/null +++ b/web/app/components/datasets/list/dataset-card/operations.tsx @@ -0,0 +1,94 @@ +import Divider from '@/app/components/base/divider' +import React from 'react' +import { useTranslation } from 'react-i18next' +import { RiDeleteBinLine, RiEditLine, RiFileCopyLine } from '@remixicon/react' + +type OperationsProps = { + showDelete: boolean + openRenameModal: () => void + detectIsUsedByApp: () => void +} + +const Operations = ({ + showDelete, + openRenameModal, + detectIsUsedByApp, +}: OperationsProps) => { + const { t } = useTranslation() + + const onClickRename = async (e: React.MouseEvent) => { + e.stopPropagation() + e.preventDefault() + openRenameModal() + } + + const onClickDelete = async (e: React.MouseEvent) => { + e.stopPropagation() + e.preventDefault() + detectIsUsedByApp() + } + + return ( +
+
+
+ + + {t('common.operation.edit')} + +
+
{ console.log('duplicate') }} + > + + + {t('common.operation.duplicate')} + +
+
+ +
+
{ console.log('Export') }} + > + + + Export Solution + +
+
{ console.log('Import') }} + > + + + Import Solution + +
+
+ {showDelete && ( + <> + +
+
+ + + {t('common.operation.delete')} + +
+
+ + )} +
+ ) +} + +export default React.memo(Operations) diff --git a/web/app/(commonLayout)/datasets/DatasetFooter.tsx b/web/app/components/datasets/list/dataset-footer/index.tsx similarity index 91% rename from web/app/(commonLayout)/datasets/DatasetFooter.tsx rename to web/app/components/datasets/list/dataset-footer/index.tsx index 1f297001e7..ecc47efc89 100644 --- a/web/app/(commonLayout)/datasets/DatasetFooter.tsx +++ b/web/app/components/datasets/list/dataset-footer/index.tsx @@ -1,5 +1,6 @@ 'use client' +import React from 'react' import { useTranslation } from 'react-i18next' const DatasetFooter = () => { @@ -16,4 +17,4 @@ const DatasetFooter = () => { ) } -export default DatasetFooter +export default React.memo(DatasetFooter) diff --git a/web/app/(commonLayout)/datasets/Datasets.tsx b/web/app/components/datasets/list/datasets.tsx similarity index 96% rename from web/app/(commonLayout)/datasets/Datasets.tsx rename to web/app/components/datasets/list/datasets.tsx index dcc368bb85..0091b5da9d 100644 --- a/web/app/(commonLayout)/datasets/Datasets.tsx +++ b/web/app/components/datasets/list/datasets.tsx @@ -5,7 +5,7 @@ import useSWRInfinite from 'swr/infinite' import { debounce } from 'lodash-es' import { useTranslation } from 'react-i18next' import NewDatasetCard from './new-dataset-card' -import DatasetCard from './DatasetCard' +import DatasetCard from './dataset-card' import type { DataSetListResponse, FetchDatasetsParams } from '@/models/datasets' import { fetchDatasets } from '@/service/datasets' import { useAppContext } from '@/context/app-context' @@ -84,7 +84,7 @@ const Datasets = ({ }, [onScroll, containerRef]) return ( -