scoobie 12.1.1 → 13.0.3
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/README.md +12 -1
- package/package.json +19 -11
- package/styles/code.css.ts +2 -2
- package/typography.ts +12 -2
package/README.md
CHANGED
|
@@ -96,6 +96,15 @@ const skuRender: Render<RenderContext> = {
|
|
|
96
96
|
};
|
|
97
97
|
```
|
|
98
98
|
|
|
99
|
+
If you manually manage the [Content Security Policy] of your site,
|
|
100
|
+
you can specify the following sources along with the script hashes from [typography.ts](typography.ts):
|
|
101
|
+
|
|
102
|
+
```http
|
|
103
|
+
Content-Security-Policy: font-src https://fonts.gstatic.com; script-src 'sha256-...' 'sha256-...'; style-src https://fonts.googleapis.com
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
[content security policy]: https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP
|
|
107
|
+
|
|
99
108
|
### `src/scoobie.d.ts`
|
|
100
109
|
|
|
101
110
|
Import TypeScript definitions for `MDX`, `*.md` and `*.mdx`:
|
|
@@ -168,7 +177,8 @@ export const App = () => (
|
|
|
168
177
|
|
|
169
178
|
Scoobie optionally supports simple, source-controlled diagrams via [mermaid].
|
|
170
179
|
|
|
171
|
-
This requires the `mermaid` configuration option to be set on [ScoobieWebpackPlugin](#scoobiewebpackplugin)
|
|
180
|
+
This requires the `mermaid` configuration option to be set on [ScoobieWebpackPlugin](#scoobiewebpackplugin),
|
|
181
|
+
and `@mermaid-js/mermaid-cli` to be installed as a peer dependency.
|
|
172
182
|
From there, the easiest way to get started is to check out the [mermaid live editor].
|
|
173
183
|
|
|
174
184
|
You can use a named code block in Markdown files:
|
|
@@ -607,6 +617,7 @@ module.exports = {
|
|
|
607
617
|
plugins: [
|
|
608
618
|
new ScoobieWebpackPlugin({
|
|
609
619
|
// Optional configuration option to enable mermaid support.
|
|
620
|
+
// `@mermaid-js/mermaid-cli` must be installed as a peer dependency.
|
|
610
621
|
// Temporary files are written to `${rootDir}/mermaid`.
|
|
611
622
|
mermaid: {
|
|
612
623
|
rootDir: __dirname,
|
package/package.json
CHANGED
|
@@ -4,22 +4,22 @@
|
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"version": "
|
|
7
|
+
"version": "13.0.3",
|
|
8
8
|
"dependencies": {
|
|
9
|
+
"@capsizecss/core": "^3.0.0",
|
|
9
10
|
"@mdx-js/loader": "^1.6.22",
|
|
10
11
|
"@mdx-js/react": "^1.6.22",
|
|
11
|
-
"@mermaid-js/mermaid-cli": "^8.11.4",
|
|
12
12
|
"@types/mdx-js__react": "^1.5.4",
|
|
13
13
|
"@types/react-router-hash-link": "^2.4.1",
|
|
14
14
|
"@vanilla-extract/css": "^1.2.3",
|
|
15
15
|
"@vanilla-extract/css-utils": "^0.1.1",
|
|
16
|
-
"
|
|
16
|
+
"babel-loader": "^8.2.3",
|
|
17
17
|
"clsx": "^1.1.1",
|
|
18
18
|
"find-up": "^5.0.0",
|
|
19
19
|
"fs-extra": "^10.0.0",
|
|
20
20
|
"jsonc-parser": "^3.0.0",
|
|
21
21
|
"polished": "^4.1.3",
|
|
22
|
-
"prism-react-renderer": "1.
|
|
22
|
+
"prism-react-renderer": "1.3.1",
|
|
23
23
|
"react-keyed-flatten-children": "^1.3.0",
|
|
24
24
|
"react-router-hash-link": "^2.4.3",
|
|
25
25
|
"refractor": "^3.4.0",
|
|
@@ -31,19 +31,21 @@
|
|
|
31
31
|
"which": "^2.0.2"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@
|
|
34
|
+
"@mermaid-js/mermaid-cli": "8.14.0",
|
|
35
|
+
"@storybook/addon-essentials": "6.4.19",
|
|
35
36
|
"@storybook/storybook-deployer": "2.8.10",
|
|
36
|
-
"@types/react": "17.0.
|
|
37
|
+
"@types/react": "17.0.39",
|
|
37
38
|
"@types/react-dom": "17.0.11",
|
|
38
|
-
"@types/react-helmet": "6.1.
|
|
39
|
-
"braid-design-system": "31.
|
|
39
|
+
"@types/react-helmet": "6.1.5",
|
|
40
|
+
"braid-design-system": "31.5.0",
|
|
40
41
|
"loki": "0.28.1",
|
|
41
42
|
"react": "17.0.2",
|
|
42
43
|
"react-dom": "17.0.2",
|
|
43
44
|
"react-helmet": "6.1.0",
|
|
44
|
-
"react-router-dom": "6.
|
|
45
|
-
"semantic-release": "
|
|
46
|
-
"sku": "11.2.
|
|
45
|
+
"react-router-dom": "6.2.1",
|
|
46
|
+
"semantic-release": "19.0.2",
|
|
47
|
+
"sku": "11.2.6",
|
|
48
|
+
"webpack": "5.69.0"
|
|
47
49
|
},
|
|
48
50
|
"files": [
|
|
49
51
|
"src",
|
|
@@ -54,11 +56,17 @@
|
|
|
54
56
|
"typography.ts"
|
|
55
57
|
],
|
|
56
58
|
"peerDependencies": {
|
|
59
|
+
"@mermaid-js/mermaid-cli": ">= 8.13.7 < 9",
|
|
57
60
|
"braid-design-system": ">= 31.0.0",
|
|
58
61
|
"react": ">= 17 < 18",
|
|
59
62
|
"react-router-dom": ">= 5.3.0",
|
|
60
63
|
"sku": ">= 10.13.4 < 12"
|
|
61
64
|
},
|
|
65
|
+
"peerDependenciesMeta": {
|
|
66
|
+
"@mermaid-js/mermaid-cli": {
|
|
67
|
+
"optional": true
|
|
68
|
+
}
|
|
69
|
+
},
|
|
62
70
|
"repository": {
|
|
63
71
|
"type": "git",
|
|
64
72
|
"url": "https://github.com/seek-oss/scoobie.git"
|
package/styles/code.css.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { createStyleObject, getCapHeight } from '@capsizecss/core';
|
|
1
2
|
import { styleVariants } from '@vanilla-extract/css';
|
|
2
3
|
import { responsiveStyle } from 'braid-design-system/css';
|
|
3
|
-
import capsize, { getCapHeight } from 'capsize';
|
|
4
4
|
|
|
5
5
|
import { Size } from '../src/private/size';
|
|
6
6
|
|
|
@@ -56,7 +56,7 @@ const monospaceFontStylesForTarget = (
|
|
|
56
56
|
size: Size,
|
|
57
57
|
target: 'mobile' | 'tablet',
|
|
58
58
|
) =>
|
|
59
|
-
|
|
59
|
+
createStyleObject({
|
|
60
60
|
capHeight: getCapHeight({
|
|
61
61
|
fontSize: tokens.typography.code[size][target].fontSize,
|
|
62
62
|
fontMetrics: monospaceFontMetrics,
|
package/typography.ts
CHANGED
|
@@ -4,12 +4,22 @@ export const robotoHref =
|
|
|
4
4
|
export const robotoMonoHref =
|
|
5
5
|
'https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&display=swap';
|
|
6
6
|
|
|
7
|
+
// Content Security Policy script hashes
|
|
8
|
+
// 'sha256-8fG3vVy4SKf2xd79rQ5AKI0uBpwM9Wc8SMYCcGNyuPw='
|
|
9
|
+
// 'sha384-moCT7/5f3Yr4vo0n3BZCjn7j0gT8qzKn7rpQqBnle0R2oLW/RqGTJ4jldVCTbOjx'
|
|
10
|
+
// 'sha512-4v+nFnUdafQ6pPIO42k6ziIvnqW4c8l+hYir10XE6SuIm3jfcQTK7tmqQttfYbFXZdk1X7QzPEMtshyX53o6Ug=='
|
|
7
11
|
export const robotoHtml = `
|
|
8
|
-
<link rel="preload" href="${robotoHref}"
|
|
12
|
+
<link rel="preload" href="${robotoHref}" id="robotoStyle" as="style">
|
|
9
13
|
<noscript><link rel="stylesheet" href="${robotoHref}"></noscript>
|
|
14
|
+
<script>robotoStyle.addEventListener('load',function(){this.rel='stylesheet'})</script>
|
|
10
15
|
`.trim();
|
|
11
16
|
|
|
17
|
+
// Content Security Policy script hashes
|
|
18
|
+
// 'sha256-bMQhmqqj8Sjmn6rk/siu6CPHm54TL349InovHDPXATw='
|
|
19
|
+
// 'sha384-03NpwxMolxf0FN4adYZfdpBY0sEYXM5vOh+mE++L9pSIoEiVLSYQfaZo1pTNuiRN'
|
|
20
|
+
// 'sha512-lbwBboh2OwaD10JAkMLuD8OHBlmBpOgeyMssLlb2nZUBpWqrjJKBMtAkt9rlAS/tXxpmCeBz71oTkYBoLRZBsA=='
|
|
12
21
|
export const robotoMonoHtml = `
|
|
13
|
-
<link rel="preload" href="${robotoMonoHref}"
|
|
22
|
+
<link rel="preload" href="${robotoMonoHref}" id="robotoMonoStyle" as="style">
|
|
14
23
|
<noscript><link rel="stylesheet" href="${robotoMonoHref}"></noscript>
|
|
24
|
+
<script>robotoMonoStyle.addEventListener('load',function(){this.rel='stylesheet'})</script>
|
|
15
25
|
`.trim();
|