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 ADDED
@@ -0,0 +1,6 @@
1
+ .eslintrc.js
2
+ commitlint.config.js
3
+ lib
4
+ lint-staged.config.js
5
+ node_modules
6
+ *.iml
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
+ }
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+ . "$(dirname "$0")/_/husky.sh"
3
+
4
+ npx --no -- commitlint --edit ""
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+ . "$(dirname "$0")/_/husky.sh"
3
+
4
+ npx lint-staged
@@ -0,0 +1,4 @@
1
+ {
2
+ "extends": "@sanity/semantic-release-preset",
3
+ "branches": ["main", {"name": "studio-v2", "channel": "studio-v2", "range": "2.1.x"}]
4
+ }
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
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2021 Rune Botten
3
+ Copyright (c) 2022 Sanity.io
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
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
- sanity install markdown
13
+
14
+ Next, add `"markdown"` to `sanity.json` plugins array:
15
+ ```json
16
+ "plugins": [
17
+ "markdown"
18
+ ]
8
19
  ```
9
20
 
10
21
  ## Usage
@@ -0,0 +1,3 @@
1
+ module.exports = {
2
+ extends: ['@commitlint/config-conventional'],
3
+ }
@@ -5,11 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = useDebounce;
7
7
 
8
- var _react = _interopRequireWildcard(require("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;;;;;;;;;;;;;;;;;;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,CANH;AAQA,SAAOE,cAAP;AACD","sourcesContent":["import React, {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])\n\n return debouncedValue\n}\n"],"file":"useDebounce.js"}
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"}
@@ -0,0 +1,4 @@
1
+ module.exports = {
2
+ '**/*.{js,jsx}': ['eslint'],
3
+ '**/*.{ts,tsx}': ['eslint', () => 'tsc --noEmit'],
4
+ }
package/package.json CHANGED
@@ -1,12 +1,7 @@
1
1
  {
2
2
  "name": "sanity-plugin-markdown",
3
- "version": "2.1.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
- "author": "Sanity.io <hello@sanity.io>",
18
- "license": "MIT",
19
- "dependencies": {
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
- "devDependencies": {
26
- "eslint": "^7.26.0",
27
- "eslint-config-prettier": "^8.3.0",
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
- "peerDependencies": {
34
- "@sanity/base": "^2.21.5",
35
- "react": "^17.0.0"
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
- "repository": {
53
- "type": "git",
54
- "url": "git+https://github.com/sanity-io/sanity-plugin-markdown.git"
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
- "bugs": {
57
- "url": "https://github.com/sanity-io/sanity-plugin-markdown/issues"
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
- "homepage": "https://sanity.io"
65
+ "peerDependencies": {
66
+ "@sanity/base": "^2.21.5",
67
+ "react": "^17.0.0"
68
+ }
60
69
  }
package/renovate.json ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "$schema": "https://docs.renovatebot.com/renovate-schema.json",
3
+ "baseBranches": ["v3"],
4
+ "extends": [
5
+ "github>sanity-io/renovate-presets//ecosystem/auto",
6
+ "github>sanity-io/renovate-presets//ecosystem/studio-v3"
7
+ ]
8
+ }
@@ -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
- }