sanity-plugin-markdown 2.1.1 → 2.1.2
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.
- package/.eslintignore +6 -0
- package/.eslintrc.js +18 -0
- package/.husky/commit-msg +4 -0
- package/.husky/pre-commit +4 -0
- package/.releaserc.json +4 -0
- package/CHANGELOG.md +12 -0
- package/LICENSE +1 -1
- package/README.md +12 -1
- package/commitlint.config.js +3 -0
- package/lib/hooks/useDebounce.js +2 -6
- package/lib/hooks/useDebounce.js.map +1 -1
- package/lint-staged.config.js +4 -0
- package/package.json +40 -31
- package/renovate.json +8 -0
- package/.vscode/settings.json +0 -22
package/.eslintignore
ADDED
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
env: {
|
|
3
|
+
browser: true,
|
|
4
|
+
node: false,
|
|
5
|
+
},
|
|
6
|
+
extends: [
|
|
7
|
+
'sanity/react', // must come before sanity/typescript
|
|
8
|
+
'plugin:prettier/recommended',
|
|
9
|
+
'plugin:react-hooks/recommended',
|
|
10
|
+
],
|
|
11
|
+
parserOptions: {
|
|
12
|
+
ecmaFeatures: {
|
|
13
|
+
jsx: true,
|
|
14
|
+
},
|
|
15
|
+
project: './tsconfig.json',
|
|
16
|
+
},
|
|
17
|
+
plugins: ['prettier'],
|
|
18
|
+
}
|
package/.releaserc.json
ADDED
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<!-- markdownlint-disable --><!-- textlint-disable -->
|
|
2
|
+
|
|
3
|
+
# 📓 Changelog
|
|
4
|
+
|
|
5
|
+
All notable changes to this project will be documented in this file. See
|
|
6
|
+
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
7
|
+
|
|
8
|
+
## [2.1.2](https://github.com/sanity-io/sanity-plugin-markdown/compare/v2.1.1...v2.1.2) (2022-11-22)
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
- **ci:** publish using semantic-release ([a597664](https://github.com/sanity-io/sanity-plugin-markdown/commit/a5976646d7712a59d1e68f80b798d4a9ddf80c8b))
|
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,10 +1,21 @@
|
|
|
1
1
|
# sanity-plugin-markdown
|
|
2
|
+
|
|
3
|
+
> This is a **Sanity Studio v2** plugin.
|
|
4
|
+
> For the v3 version, please refer to the [v3-branch](https://github.com/sanity-io/sanity-plugin-markdown).
|
|
5
|
+
|
|
2
6
|
A Markdown editor with preview for Sanity Studio. Supports Github flavored markdown and image uploads. You can either drag image(s) into the editor or click the bottom bar to bring up a file selector. The inserted image(s) has a default width crop in the url which you can change to your liking with the [Sanity image pipeline parameters](https://www.sanity.io/docs/image-urls).
|
|
3
7
|
|
|
4
8
|
## Installation
|
|
5
9
|
|
|
10
|
+
```sh
|
|
11
|
+
yarn add sanity-plugin-markdown@studio-v2
|
|
6
12
|
```
|
|
7
|
-
|
|
13
|
+
|
|
14
|
+
Next, add `"markdown"` to `sanity.json` plugins array:
|
|
15
|
+
```json
|
|
16
|
+
"plugins": [
|
|
17
|
+
"markdown"
|
|
18
|
+
]
|
|
8
19
|
```
|
|
9
20
|
|
|
10
21
|
## Usage
|
package/lib/hooks/useDebounce.js
CHANGED
|
@@ -5,11 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = useDebounce;
|
|
7
7
|
|
|
8
|
-
var _react =
|
|
9
|
-
|
|
10
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
|
-
|
|
12
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
8
|
+
var _react = require("react");
|
|
13
9
|
|
|
14
10
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
15
11
|
|
|
@@ -34,7 +30,7 @@ function useDebounce(value, delay) {
|
|
|
34
30
|
setDebouncedValue(value);
|
|
35
31
|
}, delay);
|
|
36
32
|
return () => clearTimeout(handler);
|
|
37
|
-
}, [value]);
|
|
33
|
+
}, [value, delay]);
|
|
38
34
|
return debouncedValue;
|
|
39
35
|
}
|
|
40
36
|
//# sourceMappingURL=useDebounce.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/hooks/useDebounce.js"],"names":["useDebounce","value","delay","debouncedValue","setDebouncedValue","handler","setTimeout","clearTimeout"],"mappings":";;;;;;;AAAA
|
|
1
|
+
{"version":3,"sources":["../../src/hooks/useDebounce.js"],"names":["useDebounce","value","delay","debouncedValue","setDebouncedValue","handler","setTimeout","clearTimeout"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;;AACe,SAASA,WAAT,CAAqBC,KAArB,EAA4BC,KAA5B,EAAmC;AAChD,kBAA4C,qBAASD,KAAT,CAA5C;AAAA;AAAA,MAAOE,cAAP;AAAA,MAAuBC,iBAAvB;;AACA,wBAAU,MAAM;AACd,QAAMC,OAAO,GAAGC,UAAU,CAAC,MAAM;AAC/BF,MAAAA,iBAAiB,CAACH,KAAD,CAAjB;AACD,KAFyB,EAEvBC,KAFuB,CAA1B;AAIA,WAAO,MAAMK,YAAY,CAACF,OAAD,CAAzB;AACD,GAND,EAMG,CAACJ,KAAD,EAAQC,KAAR,CANH;AAQA,SAAOC,cAAP;AACD","sourcesContent":["import {useState, useEffect} from 'react'\nexport default function useDebounce(value, delay) {\n const [debouncedValue, setDebouncedValue] = useState(value)\n useEffect(() => {\n const handler = setTimeout(() => {\n setDebouncedValue(value)\n }, delay)\n\n return () => clearTimeout(handler)\n }, [value, delay])\n\n return debouncedValue\n}\n"],"file":"useDebounce.js"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sanity-plugin-markdown",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"description": "Markdown fields in Sanity Studio. Supports Github flavored Markdown and image uploads.",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"build": "sanipack build",
|
|
7
|
-
"watch": "sanipack build --watch",
|
|
8
|
-
"prepublishOnly": "sanipack build"
|
|
9
|
-
},
|
|
10
5
|
"keywords": [
|
|
11
6
|
"sanity",
|
|
12
7
|
"sanity-plugin",
|
|
@@ -14,30 +9,27 @@
|
|
|
14
9
|
"markdown",
|
|
15
10
|
"github flavored markdown"
|
|
16
11
|
],
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
"@reach/auto-id": "^0.13.2",
|
|
21
|
-
"react-markdown": "^5.0.3",
|
|
22
|
-
"react-mde": "^11.5.0",
|
|
23
|
-
"remark-gfm": "^1.0.0"
|
|
12
|
+
"homepage": "https://sanity.io",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/sanity-io/sanity-plugin-markdown/issues"
|
|
24
15
|
},
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"eslint-config-sanity": "5.1.0",
|
|
29
|
-
"eslint-plugin-react": "^7.23.2",
|
|
30
|
-
"prettier": "^2.3.0",
|
|
31
|
-
"sanipack": "^2.0.1"
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git@github.com:sanity-io/sanity-plugin-markdown.git"
|
|
32
19
|
},
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"author": "Sanity.io <hello@sanity.io>",
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "sanipack build",
|
|
24
|
+
"lint": "eslint .",
|
|
25
|
+
"prepare": "husky install",
|
|
26
|
+
"prepublishOnly": "sanipack build",
|
|
27
|
+
"watch": "sanipack build --watch"
|
|
36
28
|
},
|
|
37
29
|
"prettier": {
|
|
38
|
-
"semi": false,
|
|
39
|
-
"printWidth": 100,
|
|
40
30
|
"bracketSpacing": false,
|
|
31
|
+
"printWidth": 100,
|
|
32
|
+
"semi": false,
|
|
41
33
|
"singleQuote": true
|
|
42
34
|
},
|
|
43
35
|
"eslintConfig": {
|
|
@@ -49,12 +41,29 @@
|
|
|
49
41
|
"prettier/react"
|
|
50
42
|
]
|
|
51
43
|
},
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"@reach/auto-id": "^0.13.2",
|
|
46
|
+
"react-markdown": "^5.0.3",
|
|
47
|
+
"react-mde": "^11.5.0",
|
|
48
|
+
"remark-gfm": "^1.0.0"
|
|
55
49
|
},
|
|
56
|
-
"
|
|
57
|
-
"
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@commitlint/cli": "^17.0.3",
|
|
52
|
+
"@commitlint/config-conventional": "^17.0.3",
|
|
53
|
+
"@sanity/semantic-release-preset": "^2.0.0",
|
|
54
|
+
"eslint": "^8.7.0",
|
|
55
|
+
"eslint-config-prettier": "^8.3.0",
|
|
56
|
+
"eslint-config-sanity": "^5.1.0",
|
|
57
|
+
"eslint-plugin-prettier": "4.0.0",
|
|
58
|
+
"eslint-plugin-react": "^7.28.0",
|
|
59
|
+
"eslint-plugin-react-hooks": "^4.5.0",
|
|
60
|
+
"husky": "^8.0.1",
|
|
61
|
+
"lint-staged": "^12.4.1",
|
|
62
|
+
"prettier": "^2.7.1",
|
|
63
|
+
"sanipack": "^2.0.1"
|
|
58
64
|
},
|
|
59
|
-
"
|
|
65
|
+
"peerDependencies": {
|
|
66
|
+
"@sanity/base": "^2.21.5",
|
|
67
|
+
"react": "^17.0.0"
|
|
68
|
+
}
|
|
60
69
|
}
|
package/renovate.json
ADDED
package/.vscode/settings.json
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"workbench.colorCustomizations": {
|
|
3
|
-
"activityBar.activeBackground": "#ab307e",
|
|
4
|
-
"activityBar.activeBorder": "#25320e",
|
|
5
|
-
"activityBar.background": "#ab307e",
|
|
6
|
-
"activityBar.foreground": "#e7e7e7",
|
|
7
|
-
"activityBar.inactiveForeground": "#e7e7e799",
|
|
8
|
-
"activityBarBadge.background": "#25320e",
|
|
9
|
-
"activityBarBadge.foreground": "#e7e7e7",
|
|
10
|
-
"sash.hoverBorder": "#ab307e",
|
|
11
|
-
"statusBar.background": "#832561",
|
|
12
|
-
"statusBar.foreground": "#e7e7e7",
|
|
13
|
-
"statusBarItem.hoverBackground": "#ab307e",
|
|
14
|
-
"statusBarItem.remoteBackground": "#832561",
|
|
15
|
-
"statusBarItem.remoteForeground": "#e7e7e7",
|
|
16
|
-
"titleBar.activeBackground": "#832561",
|
|
17
|
-
"titleBar.activeForeground": "#e7e7e7",
|
|
18
|
-
"titleBar.inactiveBackground": "#83256199",
|
|
19
|
-
"titleBar.inactiveForeground": "#e7e7e799"
|
|
20
|
-
},
|
|
21
|
-
"peacock.color": "#832561"
|
|
22
|
-
}
|