Move closer to ry-blocks
commit74e7b2d99ace656788b31be32b936e7d69fe3017
authorMark Eibes <mark.eibes@gmail.com>
dateSat 2 Jan 2021, 00:57 (6 years ago)
parent081ef00
57 files changed+60550−23745
blog/.storybook/main.jsnew file+15
@@ -0,0 +1,15 @@
1+const path = require('path');
2+const webpack = require('webpack');
3+
4+module.exports = {
5+ stories: ['../output/Stories.*/**/index.js'],
6+ addons: [],
7+ webpackFinal: async config => {
8+ config.plugins.push(new webpack.SourceMapDevToolPlugin({
9+ append: '\n//# sourceMappingURL=./[url]',
10+ }))
11+
12+ // do mutation to the config
13+ return config;
14+ },
15+};
blog/.storybook/middleware.jsnew file+47
@@ -0,0 +1,47 @@
1+const express = require("express");
2+
3+const babel = require('@babel/core')
4+const React = require('react')
5+const { renderToStaticMarkup } = require('react-dom/server')
6+const mdx = require('@mdx-js/mdx')
7+const { MDXProvider, mdx: createElement } = require('@mdx-js/react')
8+
9+const expressMiddleWare = router => {
10+ router.use(express.text())
11+ router.use("/mdx", async (req, res) => {
12+ const rendered = await renderWithReact(req.body)
13+ res.send(rendered)
14+ });
15+};
16+
17+const transform = code =>
18+ babel.transform(code, {
19+ plugins: [
20+ '@babel/plugin-transform-react-jsx',
21+ '@babel/plugin-proposal-object-rest-spread'
22+ ]
23+ }).code
24+
25+const renderWithReact = async mdxCode => {
26+ const jsx = await mdx(mdxCode, { skipExport: true })
27+ const code = transform(jsx)
28+ const fn = new Function(
29+ 'React',
30+ 'mdx',
31+ `${code}; return React.createElement(MDXContent)`
32+ )
33+ const element = fn(React, createElement)
34+ const components = {
35+ h1: ({ children }) =>
36+ React.createElement('h1', { style: { color: 'tomato' } }, children)
37+ }
38+ const elementWithProvider = React.createElement(
39+ MDXProvider,
40+ { components },
41+ element
42+ )
43+ const result = renderToStaticMarkup(elementWithProvider)
44+ return code
45+}
46+
47+module.exports = expressMiddleWare;
blog/.storybook/preview-head.htmlnew file+2
@@ -0,0 +1,2 @@
1+<link href="https://rsms.me/inter/inter.css" rel="stylesheet">
2+<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/victormono@latest/dist/index.min.css">
blog/.storybook/preview.jsnew file+3
@@ -0,0 +1,3 @@
1+export const parameters = {
2+ layout: 'fullscreen'
3+}
blog/.vscode/settings.json+2−1
@@ -1,4 +1,5 @@
11{
22 "workbench.preferredDarkColorTheme": "Base2Tone_HeathDark",
3− "workbench.colorTheme": "Kay Dark"
3+ "workbench.colorTheme": "Horizon",
4+ "editor.formatOnSave": true
45}
blog/package-lock.json+30816−20001
This diff is too big to show here.
blog/package.json+7−2
This diff is too big to show here.
blog/packages.dhall+2−21
This diff is too big to show here.
blog/src/components/PSLayout.purs+241−169
This diff is too big to show here.
blog/src/components/layout.js+3−3
This diff is too big to show here.
blog/src/components/seo.js+7−3
This diff is too big to show here.
blog/src/purescript/MDX.jsnew file+13
This diff is too big to show here.
blog/src/purescript/MDX.pursnew file+27
This diff is too big to show here.
blog/src/stories/PSLayout.pursnew file+87
This diff is too big to show here.
components/.storybook/config.jsdeleted−17
This diff is too big to show here.
components/.storybook/main.jsnew file+15
This diff is too big to show here.
components/.storybook/preview-head.html+3−7
This diff is too big to show here.
components/.storybook/preview.jsnew file+9
This diff is too big to show here.
components/package-lock.json+28258−2671
This diff is too big to show here.
components/package.json+9−3
This diff is too big to show here.
components/packages.dhall+2−21
This diff is too big to show here.
components/spago.dhall+1−1
This diff is too big to show here.
components/src/React/SyntaxHighlighter/Component.jsdeleted−149
This diff is too big to show here.
components/src/React/SyntaxHighlighter/Component.pursdeleted−40
This diff is too big to show here.
components/src/React/SyntaxHighlighter/Component.tsdeleted−165
This diff is too big to show here.
components/src/Storybook/Decorator/FullScreen.purs+9−93
This diff is too big to show here.
components/src/Yoga/Button/Component.purs+14−18
This diff is too big to show here.
components/src/Yoga/Cluster/Styles.purs+8−8
This diff is too big to show here.
components/src/Yoga/CompileEditor/Component.purs+16−19
This diff is too big to show here.
components/src/Yoga/DOM/Hook.purs+12−14
This diff is too big to show here.
components/src/Yoga/FillInTheGaps/Component.purs+112−100
This diff is too big to show here.
components/src/Yoga/FillInTheGaps/Logic.purs+27−22
This diff is too big to show here.
components/src/Yoga/FillInTheGaps/Stories.purs+46−60
This diff is too big to show here.
components/src/Yoga/FillInTheGapsDraggable/Component.purs+30−26
This diff is too big to show here.
components/src/Yoga/FillInTheGapsDraggable/Stories.purs+19−6
This diff is too big to show here.
components/src/Yoga/Grimoire/Spell/Styles.purs+12−14
This diff is too big to show here.
components/src/Yoga/JSS.purs+58−59
This diff is too big to show here.
components/src/Yoga/Monaco/Editor.purs+34−31
This diff is too big to show here.
components/src/Yoga/MultipleChoice/Stories.purs+1−1
This diff is too big to show here.
components/src/stories/Button.stories.tsxnew file+38
This diff is too big to show here.
components/src/stories/Button.tsxnew file+48
This diff is too big to show here.
components/src/stories/Header.stories.tsxnew file+20
This diff is too big to show here.
components/src/stories/Header.tsxnew file+47
This diff is too big to show here.
components/src/stories/Introduction.stories.mdxnew file+207
This diff is too big to show here.
components/src/stories/Page.stories.tsxnew file+23
This diff is too big to show here.
components/src/stories/Page.tsxnew file+67
This diff is too big to show here.
components/src/stories/assets/code-brackets.svgnew file+1
This diff is too big to show here.
components/src/stories/assets/colors.svgnew file+1
This diff is too big to show here.
components/src/stories/assets/comments.svgnew file+1
This diff is too big to show here.
components/src/stories/assets/direction.svgnew file+1
This diff is too big to show here.
components/src/stories/assets/flow.svgnew file+1
This diff is too big to show here.
components/src/stories/assets/plugin.svgnew file+1
This diff is too big to show here.
components/src/stories/assets/repo.svgnew file+1
This diff is too big to show here.
components/src/stories/assets/stackalt.svgnew file+1
This diff is too big to show here.
components/src/stories/button.cssnew file+30
This diff is too big to show here.
components/src/stories/header.cssnew file+26
This diff is too big to show here.
components/src/stories/page.cssnew file+69
This diff is too big to show here.