Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

refactor: replace line-clamp package with native CSS (#31877)

niveshdandyan45daec7541dc
diff --git a/web/app/components/datasets/formatted-text/flavours/edit-slice.tsx b/web/app/components/datasets/formatted-text/flavours/edit-slice.tsx
index 3ae95ec531d..04ebd16f6c5 100644
--- a/web/app/components/datasets/formatted-text/flavours/edit-slice.tsx
+++ b/web/app/components/datasets/formatted-text/flavours/edit-slice.tsx
@@ -3,8 +3,6 @@ import type { FC, ReactNode } from 'react'
import type { SliceProps } from './type'
import { autoUpdate, flip, FloatingFocusManager, offset, shift, useDismiss, useFloating, useHover, useInteractions, useRole } from '@floating-ui/react'
import { RiDeleteBinLine } from '@remixicon/react'
-// @ts-expect-error no types available
-import lineClamp from 'line-clamp'
import { useState } from 'react'
import ActionButton, { ActionButtonState } from '@/app/components/base/action-button'
import { cn } from '@/utils/classnames'
@@ -58,12 +56,8 @@ export const EditSlice: FC<EditSliceProps> = (props) => {
<>
<SliceContainer
{...rest}
- className={cn('mr-0 block', className)}
- ref={(ref) => {
- refs.setReference(ref)
- if (ref)
- lineClamp(ref, 4)
- }}
+ className={cn('mr-0 line-clamp-4 block', className)}
+ ref={refs.setReference}
{...getReferenceProps()}
>
<SliceLabel
diff --git a/web/package.json b/web/package.json
index 954366fc89e..7b2e5705544 100644
--- a/web/package.json
+++ b/web/package.json
@@ -117,7 +117,6 @@
"ky": "1.12.0",
"lamejs": "1.2.1",
"lexical": "0.38.2",
- "line-clamp": "1.0.0",
"mermaid": "11.11.0",
"mime": "4.1.0",
"mitt": "3.0.1",
diff --git a/web/pnpm-lock.yaml b/web/pnpm-lock.yaml
index e018c0268b2..abf3a444a27 100644
--- a/web/pnpm-lock.yaml
+++ b/web/pnpm-lock.yaml
@@ -233,9 +233,6 @@ importers:
lexical:
specifier: 0.38.2
version: 0.38.2
- line-clamp:
- specifier: 1.0.0
- version: 1.0.0
mermaid:
specifier: 11.11.0
version: 11.11.0
@@ -5403,9 +5400,6 @@ packages:
resolution: {integrity: sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==}
engines: {node: '>=14'}
- resolution: {integrity: sha512-dCDlvMj572RIRBQ3x9aIX0DTdt2St1bMdpi64jVTAi5vqBck7wf+J97//+J7+pS80rFJaYa8HiyXCTp0flpnBA==}
-
resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==}
@@ -12913,8 +12907,6 @@ snapshots:
-