Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
KaneFreeman committed Oct 27, 2023
2 parents c6b5cf0 + ad3633d commit 0da49f1
Show file tree
Hide file tree
Showing 9 changed files with 582 additions and 55 deletions.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "3.4.1"
"version": "3.4.2"
}
4 changes: 2 additions & 2 deletions packages/app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@staticcms/app",
"version": "3.4.1",
"version": "3.4.2",
"license": "MIT",
"description": "Static CMS application.",
"repository": "https://github.com/StaticJsCMS/static-cms",
Expand Down Expand Up @@ -39,7 +39,7 @@
"dependencies": {
"@babel/eslint-parser": "7.22.15",
"@babel/runtime": "7.23.1",
"@staticcms/core": "^3.4.1",
"@staticcms/core": "^3.4.2",
"buffer": "6.0.3",
"react": "18.2.0",
"react-dom": "18.2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/dev-test/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ collections:
- label: Body
name: body
widget: markdown
hint: Main content goes here.
hint: "*Main* __content__ __*goes*__ [here](example.com)."
- name: faq
label: FAQ
folder: _faqs
Expand Down
4 changes: 3 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@staticcms/core",
"version": "3.4.1",
"version": "3.4.2",
"license": "MIT",
"description": "Static CMS core application.",
"repository": "https://github.com/StaticJsCMS/static-cms",
Expand Down Expand Up @@ -139,6 +139,7 @@
"react-dom": "18.2.0",
"react-frame-component": "5.2.6",
"react-is": "18.2.0",
"react-markdown": "8.0.7",
"react-polyglot": "0.7.2",
"react-redux": "8.1.3",
"react-resizable-panels": "0.0.55",
Expand All @@ -148,6 +149,7 @@
"react-virtualized-auto-sizer": "1.0.20",
"react-waypoint": "10.3.0",
"react-window": "1.8.9",
"remark-gfm": "4.0.0",
"remark-html": "15.0.2",
"remark-mdx": "2.3.0",
"remark-parse": "10.0.1",
Expand Down
9 changes: 9 additions & 0 deletions packages/core/src/__mocks__/react-markdown.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react';

import type { FC, PropsWithChildren } from 'react';

const ReactMarkdown: FC<PropsWithChildren> = ({ children }) => {
return React.createElement('div', {}, [children]);
};

export default ReactMarkdown;
12 changes: 9 additions & 3 deletions packages/core/src/components/common/field/Hint.css
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
.CMS_Hint_root {
@apply w-full
flex
text-xs
italic;
text-xs;

&:not(.CMS_Hint_inline) {
@apply px-3
pt-1;
}
}

.CMS_Hint_link {
color: inherit;

&:hover {
@apply underline;
}
}

.CMS_Hint_cursor-pointer {
@apply cursor-pointer;
}
Expand Down
16 changes: 15 additions & 1 deletion packages/core/src/components/common/field/Hint.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import React from 'react';
import ReactMarkdown from 'react-markdown';
import gfm from 'remark-gfm';

import useCursor from '@staticcms/core/lib/hooks/useCursor';
import classNames from '@staticcms/core/lib/util/classNames.util';
Expand All @@ -14,6 +16,7 @@ export const classes = generateClassNames('Hint', [
'cursor-pointer',
'cursor-text',
'cursor-default',
'link',
]);

export interface HintProps {
Expand Down Expand Up @@ -46,7 +49,18 @@ const Hint: FC<HintProps> = ({
className,
)}
>
{children}
<ReactMarkdown
remarkPlugins={[gfm]}
allowedElements={['a', 'strong', 'em', 'del']}
unwrapDisallowed={true}
components={{
a: ({ node: _node, ...props }) => (
<a {...props} target="_blank" rel="noopener noreferrer" className={classes.link} />
),
}}
>
{children}
</ReactMarkdown>
</div>
);
};
Expand Down
5 changes: 5 additions & 0 deletions packages/docs/content/releases.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"releases": [
{
"date": "2023-10-27T10:00:00.000Z",
"version": "v3.4.2",
"type": "patch"
},
{
"date": "2023-10-26T10:00:00.000Z",
"version": "v3.4.1",
Expand Down
Loading

0 comments on commit 0da49f1

Please sign in to comment.