@lowdefy/blocks-markdown 4.0.0-rc.8 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -20,7 +20,7 @@ import gfm from 'remark-gfm';
|
|
|
20
20
|
import rehypeRaw from 'rehype-raw';
|
|
21
21
|
let DangerousMarkdown = class DangerousMarkdown extends React.Component {
|
|
22
22
|
render() {
|
|
23
|
-
const { blockId
|
|
23
|
+
const { blockId, properties, methods } = this.props;
|
|
24
24
|
return /*#__PURE__*/ React.createElement("div", {
|
|
25
25
|
id: blockId,
|
|
26
26
|
className: methods.makeCssClass(properties.style)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
17
17
|
import ReactMarkdown from 'react-markdown';
|
|
18
18
|
import gfm from 'remark-gfm';
|
|
19
|
-
const Markdown = ({ blockId
|
|
19
|
+
const Markdown = ({ blockId, properties, methods })=>/*#__PURE__*/ React.createElement("div", {
|
|
20
20
|
id: blockId,
|
|
21
21
|
className: methods.makeCssClass(properties.style)
|
|
22
22
|
}, /*#__PURE__*/ React.createElement(ReactMarkdown, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -12,21 +12,7 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
_extends = Object.assign || function(target) {
|
|
17
|
-
for(var i = 1; i < arguments.length; i++){
|
|
18
|
-
var source = arguments[i];
|
|
19
|
-
for(var key in source){
|
|
20
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
21
|
-
target[key] = source[key];
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
return target;
|
|
26
|
-
};
|
|
27
|
-
return _extends.apply(this, arguments);
|
|
28
|
-
}
|
|
29
|
-
import React from 'react';
|
|
15
|
+
*/ import React from 'react';
|
|
30
16
|
import { Light as SyntaxHighlighter } from 'react-syntax-highlighter';
|
|
31
17
|
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
32
18
|
import ReactMarkdown from 'react-markdown';
|
|
@@ -58,16 +44,18 @@ SyntaxHighlighter.registerLanguage('ts', typescript.default);
|
|
|
58
44
|
SyntaxHighlighter.registerLanguage('xml', xml.default);
|
|
59
45
|
SyntaxHighlighter.registerLanguage('yaml', yaml.default);
|
|
60
46
|
const components = {
|
|
61
|
-
code ({ inline
|
|
62
|
-
return !inline ? /*#__PURE__*/ React.createElement(SyntaxHighlighter,
|
|
47
|
+
code ({ inline, className, children, ...props }) {
|
|
48
|
+
return !inline ? /*#__PURE__*/ React.createElement(SyntaxHighlighter, {
|
|
63
49
|
style: github,
|
|
64
|
-
language: String(className).replace('language-', '')
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
50
|
+
language: String(className).replace('language-', ''),
|
|
51
|
+
...props
|
|
52
|
+
}, children) : /*#__PURE__*/ React.createElement("code", {
|
|
53
|
+
className: className,
|
|
54
|
+
...props
|
|
55
|
+
}, children);
|
|
68
56
|
}
|
|
69
57
|
};
|
|
70
|
-
const MarkdownWithCode = ({ blockId
|
|
58
|
+
const MarkdownWithCode = ({ blockId, properties, methods })=>/*#__PURE__*/ React.createElement("div", {
|
|
71
59
|
id: blockId,
|
|
72
60
|
className: methods.makeCssClass(properties.style)
|
|
73
61
|
}, /*#__PURE__*/ React.createElement(ReactMarkdown, {
|
package/dist/blocks.js
CHANGED
package/dist/types.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable import/namespace */ /*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
const icons = {};
|
|
17
17
|
const styles = {};
|
|
18
18
|
Object.keys(blocks).forEach((block)=>{
|
|
19
|
-
icons[block] = blocks[block].meta.icons
|
|
20
|
-
styles[block] = blocks[block].meta.styles
|
|
19
|
+
icons[block] = blocks[block].meta.icons ?? [];
|
|
20
|
+
styles[block] = blocks[block].meta.styles ?? [];
|
|
21
21
|
});
|
|
22
22
|
export default {
|
|
23
23
|
blocks: Object.keys(blocks),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/blocks-markdown",
|
|
3
|
-
"version": "4.0.0
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Lowdefy markdown blocks.",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -37,41 +37,39 @@
|
|
|
37
37
|
"files": [
|
|
38
38
|
"dist/*"
|
|
39
39
|
],
|
|
40
|
-
"scripts": {
|
|
41
|
-
"build": "swc src --out-dir dist --config-file ../../../../.swcrc --delete-dir-on-start && pnpm copyfiles",
|
|
42
|
-
"clean": "rm -rf dist",
|
|
43
|
-
"copyfiles": "copyfiles -u 1 \"./src/**/*\" dist -e \"./src/**/*.js\" -e \"./src/**/*.yaml\" -e \"./src/**/*.snap\"",
|
|
44
|
-
"prepublishOnly": "pnpm build",
|
|
45
|
-
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js"
|
|
46
|
-
},
|
|
47
40
|
"dependencies": {
|
|
48
|
-
"@lowdefy/block-utils": "4.0.0
|
|
49
|
-
"dompurify": "
|
|
41
|
+
"@lowdefy/block-utils": "4.0.0",
|
|
42
|
+
"dompurify": "3.0.6",
|
|
50
43
|
"react": "18.2.0",
|
|
51
44
|
"react-dom": "18.2.0",
|
|
52
|
-
"react-markdown": "8.0.
|
|
45
|
+
"react-markdown": "8.0.7",
|
|
53
46
|
"react-syntax-highlighter": "15.5.0",
|
|
54
47
|
"rehype-raw": "6.1.1",
|
|
55
|
-
"remark-gfm": "3.0.
|
|
48
|
+
"remark-gfm": "3.0.0"
|
|
56
49
|
},
|
|
57
50
|
"devDependencies": {
|
|
58
51
|
"@emotion/jest": "11.10.5",
|
|
59
|
-
"@lowdefy/block-dev": "4.0.0
|
|
60
|
-
"@lowdefy/jest-yaml-transform": "4.0.0
|
|
61
|
-
"@swc/cli": "0.1.
|
|
62
|
-
"@swc/core": "1.3.
|
|
63
|
-
"@swc/jest": "0.2.
|
|
52
|
+
"@lowdefy/block-dev": "4.0.0",
|
|
53
|
+
"@lowdefy/jest-yaml-transform": "4.0.0",
|
|
54
|
+
"@swc/cli": "0.1.63",
|
|
55
|
+
"@swc/core": "1.3.99",
|
|
56
|
+
"@swc/jest": "0.2.29",
|
|
64
57
|
"@testing-library/dom": "8.19.1",
|
|
65
58
|
"@testing-library/react": "13.4.0",
|
|
66
59
|
"@testing-library/user-event": "14.4.3",
|
|
67
|
-
"@types/react": "18.
|
|
60
|
+
"@types/react": "18.2.38",
|
|
68
61
|
"copyfiles": "2.4.1",
|
|
69
|
-
"jest": "28.1.
|
|
70
|
-
"jest-environment-jsdom": "28.1.
|
|
62
|
+
"jest": "28.1.3",
|
|
63
|
+
"jest-environment-jsdom": "28.1.3",
|
|
71
64
|
"jest-serializer-html": "7.1.0"
|
|
72
65
|
},
|
|
73
66
|
"publishConfig": {
|
|
74
67
|
"access": "public"
|
|
75
68
|
},
|
|
76
|
-
"
|
|
77
|
-
|
|
69
|
+
"scripts": {
|
|
70
|
+
"build": "swc src --out-dir dist --config-file ../../../../.swcrc --delete-dir-on-start && pnpm copyfiles",
|
|
71
|
+
"clean": "rm -rf dist",
|
|
72
|
+
"copyfiles": "copyfiles -u 1 \"./src/**/*\" dist -e \"./src/**/*.js\" -e \"./src/**/*.yaml\" -e \"./src/**/*.snap\"",
|
|
73
|
+
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js"
|
|
74
|
+
}
|
|
75
|
+
}
|