From c8dc3d4f387a1000b006c93e1f42aa0f46da00b0 Mon Sep 17 00:00:00 2001 From: Daniel Lautzenheiser Date: Tue, 7 Nov 2023 12:20:11 -0500 Subject: [PATCH 1/2] fix: make hint markdown link clickable (#971) --- packages/core/dev-test/config.yml | 2 +- packages/core/src/components/common/field/Hint.tsx | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/core/dev-test/config.yml b/packages/core/dev-test/config.yml index 6b5c93a98..8b7023a91 100644 --- a/packages/core/dev-test/config.yml +++ b/packages/core/dev-test/config.yml @@ -75,7 +75,7 @@ collections: - label: Body name: body widget: markdown - hint: "*Main* __content__ __*goes*__ [here](example.com)." + hint: "*Main* __content__ __*goes*__ [here](https://example.com/)." - name: faq label: FAQ folder: _faqs diff --git a/packages/core/src/components/common/field/Hint.tsx b/packages/core/src/components/common/field/Hint.tsx index f1cbfb405..b6b512edc 100644 --- a/packages/core/src/components/common/field/Hint.tsx +++ b/packages/core/src/components/common/field/Hint.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { useCallback } from 'react'; import ReactMarkdown from 'react-markdown'; import gfm from 'remark-gfm'; @@ -6,7 +6,7 @@ import useCursor from '@staticcms/core/lib/hooks/useCursor'; import classNames from '@staticcms/core/lib/util/classNames.util'; import { generateClassNames } from '@staticcms/core/lib/util/theming.util'; -import type { FC } from 'react'; +import type { FC, MouseEvent } from 'react'; import './Hint.css'; @@ -40,6 +40,10 @@ const Hint: FC = ({ }) => { const finalCursor = useCursor(cursor, disabled); + const handleOnClick = useCallback((event: MouseEvent) => { + event.stopPropagation(); + }, []); + return (
= ({ variant === 'inline' && classes.inline, className, )} + onClick={handleOnClick} > Date: Tue, 7 Nov 2023 12:22:51 -0500 Subject: [PATCH 2/2] v3.4.5 --- lerna.json | 2 +- packages/app/package.json | 4 ++-- packages/core/package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lerna.json b/lerna.json index 1188cd4d1..c9a99f2a9 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { "$schema": "node_modules/lerna/schemas/lerna-schema.json", "useWorkspaces": true, - "version": "3.4.4" + "version": "3.4.5" } diff --git a/packages/app/package.json b/packages/app/package.json index 2e3f8a60d..429abe76b 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,6 +1,6 @@ { "name": "@staticcms/app", - "version": "3.4.4", + "version": "3.4.5", "license": "MIT", "description": "Static CMS application.", "repository": "https://github.com/StaticJsCMS/static-cms", @@ -40,7 +40,7 @@ "@babel/eslint-parser": "7.21.3", "@babel/runtime": "7.21.0", "@emotion/babel-preset-css-prop": "11.10.0", - "@staticcms/core": "^3.4.4", + "@staticcms/core": "^3.4.5", "buffer": "6.0.3", "react": "18.2.0", "react-dom": "18.2.0", diff --git a/packages/core/package.json b/packages/core/package.json index 733314e74..fe98e8699 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@staticcms/core", - "version": "3.4.4", + "version": "3.4.5", "license": "MIT", "description": "Static CMS core application.", "repository": "https://github.com/StaticJsCMS/static-cms",