From 456d716193e41cc5aac55e3cf8b6a2a3d12a4337 Mon Sep 17 00:00:00 2001 From: anish-work Date: Mon, 15 Jul 2024 15:20:48 +0530 Subject: [PATCH 1/2] read lineClampExpand prop --- app/renderedHTML.tsx | 36 +++++++++++++++++++++--------------- app/renderedMarkdown.tsx | 4 +++- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/app/renderedHTML.tsx b/app/renderedHTML.tsx index 92c7919..313c197 100644 --- a/app/renderedHTML.tsx +++ b/app/renderedHTML.tsx @@ -8,13 +8,15 @@ import parse, { } from "html-react-parser"; import { useHydratedMemo } from "~/useHydrated"; import { Link } from "@remix-run/react"; -import { GooeyHelpIcon, TooltipPlacement } from "./components/GooeyTooltip"; +import type { TooltipPlacement } from "./components/GooeyTooltip"; +import { GooeyHelpIcon } from "./components/GooeyTooltip"; export function RenderedHTML({ body, lineClamp, help, tooltipPlacement, + lineClampExpand, ...attrs }: { body: string; @@ -42,7 +44,7 @@ export function RenderedHTML({ ); } return ( - + {parsedElements} @@ -141,9 +143,11 @@ const reactParserOptions: HTMLReactParserOptions = { function LineClamp({ lines, children, + expandable = true, }: { lines?: number; children: React.ReactNode; + expandable: boolean; }) { const contentRef = useRef(null); @@ -201,19 +205,21 @@ function LineClamp({ lineHeight: "130%", }} > - + {expandable && ( + + )} )} diff --git a/app/renderedMarkdown.tsx b/app/renderedMarkdown.tsx index bf7b74b..d6b8303 100644 --- a/app/renderedMarkdown.tsx +++ b/app/renderedMarkdown.tsx @@ -1,12 +1,13 @@ import { marked } from "marked"; import { RenderedHTML } from "~/renderedHTML"; -import { TooltipPlacement } from "./components/GooeyTooltip"; +import type { TooltipPlacement } from "./components/GooeyTooltip"; export function RenderedMarkdown({ body, lineClamp, help, tooltipPlacement, + lineClampExpand, ...attrs }: // allowUnsafeHTML, { @@ -30,6 +31,7 @@ export function RenderedMarkdown({ key={body} body={html} lineClamp={lineClamp} + lineClampExpand={lineClampExpand} className="gui-html-container gui-md-container" help={help} tooltipPlacement={tooltipPlacement} From 79376f50fd6ba5a9ec8f1826742526713ec5e27a Mon Sep 17 00:00:00 2001 From: anish-work Date: Wed, 2 Apr 2025 18:39:12 +0530 Subject: [PATCH 2/2] bump version number --- package-lock.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8afab90..198a126 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "gooey-gui", - "version": "0.5.3", + "version": "0.5.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "gooey-gui", - "version": "0.5.3", + "version": "0.5.4", "dependencies": { "@codemirror/lang-javascript": "^6.2.2", "@codemirror/lint": "^6.8.1",