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

Commit 0da49f1

Browse files
committed
Merge branch 'main' into next
2 parents c6b5cf0 + ad3633d commit 0da49f1

File tree

9 files changed

+582
-55
lines changed

9 files changed

+582
-55
lines changed

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
3-
"version": "3.4.1"
3+
"version": "3.4.2"
44
}

packages/app/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@staticcms/app",
3-
"version": "3.4.1",
3+
"version": "3.4.2",
44
"license": "MIT",
55
"description": "Static CMS application.",
66
"repository": "https://github.com/StaticJsCMS/static-cms",
@@ -39,7 +39,7 @@
3939
"dependencies": {
4040
"@babel/eslint-parser": "7.22.15",
4141
"@babel/runtime": "7.23.1",
42-
"@staticcms/core": "^3.4.1",
42+
"@staticcms/core": "^3.4.2",
4343
"buffer": "6.0.3",
4444
"react": "18.2.0",
4545
"react-dom": "18.2.0",

packages/core/dev-test/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ collections:
7171
- label: Body
7272
name: body
7373
widget: markdown
74-
hint: Main content goes here.
74+
hint: "*Main* __content__ __*goes*__ [here](example.com)."
7575
- name: faq
7676
label: FAQ
7777
folder: _faqs

packages/core/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@staticcms/core",
3-
"version": "3.4.1",
3+
"version": "3.4.2",
44
"license": "MIT",
55
"description": "Static CMS core application.",
66
"repository": "https://github.com/StaticJsCMS/static-cms",
@@ -139,6 +139,7 @@
139139
"react-dom": "18.2.0",
140140
"react-frame-component": "5.2.6",
141141
"react-is": "18.2.0",
142+
"react-markdown": "8.0.7",
142143
"react-polyglot": "0.7.2",
143144
"react-redux": "8.1.3",
144145
"react-resizable-panels": "0.0.55",
@@ -148,6 +149,7 @@
148149
"react-virtualized-auto-sizer": "1.0.20",
149150
"react-waypoint": "10.3.0",
150151
"react-window": "1.8.9",
152+
"remark-gfm": "4.0.0",
151153
"remark-html": "15.0.2",
152154
"remark-mdx": "2.3.0",
153155
"remark-parse": "10.0.1",
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React from 'react';
2+
3+
import type { FC, PropsWithChildren } from 'react';
4+
5+
const ReactMarkdown: FC<PropsWithChildren> = ({ children }) => {
6+
return React.createElement('div', {}, [children]);
7+
};
8+
9+
export default ReactMarkdown;

packages/core/src/components/common/field/Hint.css

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
.CMS_Hint_root {
22
@apply w-full
3-
flex
4-
text-xs
5-
italic;
3+
text-xs;
64

75
&:not(.CMS_Hint_inline) {
86
@apply px-3
97
pt-1;
108
}
119
}
1210

11+
.CMS_Hint_link {
12+
color: inherit;
13+
14+
&:hover {
15+
@apply underline;
16+
}
17+
}
18+
1319
.CMS_Hint_cursor-pointer {
1420
@apply cursor-pointer;
1521
}

packages/core/src/components/common/field/Hint.tsx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import React from 'react';
2+
import ReactMarkdown from 'react-markdown';
3+
import gfm from 'remark-gfm';
24

35
import useCursor from '@staticcms/core/lib/hooks/useCursor';
46
import classNames from '@staticcms/core/lib/util/classNames.util';
@@ -14,6 +16,7 @@ export const classes = generateClassNames('Hint', [
1416
'cursor-pointer',
1517
'cursor-text',
1618
'cursor-default',
19+
'link',
1720
]);
1821

1922
export interface HintProps {
@@ -46,7 +49,18 @@ const Hint: FC<HintProps> = ({
4649
className,
4750
)}
4851
>
49-
{children}
52+
<ReactMarkdown
53+
remarkPlugins={[gfm]}
54+
allowedElements={['a', 'strong', 'em', 'del']}
55+
unwrapDisallowed={true}
56+
components={{
57+
a: ({ node: _node, ...props }) => (
58+
<a {...props} target="_blank" rel="noopener noreferrer" className={classes.link} />
59+
),
60+
}}
61+
>
62+
{children}
63+
</ReactMarkdown>
5064
</div>
5165
);
5266
};

packages/docs/content/releases.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
22
"releases": [
3+
{
4+
"date": "2023-10-27T10:00:00.000Z",
5+
"version": "v3.4.2",
6+
"type": "patch"
7+
},
38
{
49
"date": "2023-10-26T10:00:00.000Z",
510
"version": "v3.4.1",

0 commit comments

Comments
 (0)