Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Clean up block config #70

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
153 changes: 55 additions & 98 deletions blocks.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,59 +2,53 @@
{
"type": "file",
"id": "code-block",
"title": "Code block",
"description": "A basic code block",
"sandbox": false,
"title": "Code",
"description": "Read & edit code",
"entry": "blocks/file-blocks/code/index.tsx",
"matches": ["*"],
"example_path": "https://github.com/githubnext/blocks-tutorial/blob/main/Aside.jsx"
},
{
"type": "file",
"id": "excalidraw-block",
"title": "Drawing block",
"description": "A whiteboard tool",
"sandbox": false,
"id": "excalidraw",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should leave the ids alone? they don't matter much in the UI, and there is metadata that references them that would need updating.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we're okay for these really specific use cases - Blocks will default to the next most specific block if it can't find the one specified, so things like https://blocks.githubnext.com/githubnext/blocks/blob/main/examples/drawing.excalidraw?blockKey=githubnext__blocks-examples__excalidraw2&fileRef= will still work. More than gappy to revert if you feel strongly, though!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

er, happy, not gappy

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not feel strongly, garry on

"title": "Excalidraw diagram",
"description": "View and edit Excalidraw diagrams",
"entry": "blocks/file-blocks/excalidraw/index.tsx",
"matches": ["*.excalidraw"],
"example_path": "https://github.com/githubnext/blocks-tutorial/blob/main/drawing.excalidraw"
},
{
"type": "file",
"id": "html-block",
"title": "HTML block",
"description": "View HTML content",
"sandbox": false,
"id": "html",
"title": "HTML",
"description": "View basic HTML content",
"entry": "blocks/file-blocks/html.tsx",
"matches": ["*.html", "*.svelte"],
"example_path": "https://github.com/githubnext/blocks-tutorial/blob/main/photos.html"
},
{
"type": "file",
"id": "css-block",
"title": "Styleguide block",
"description": "View selectors in a css file",
"sandbox": false,
"id": "css",
"title": "CSS Styleguide",
"description": "View CSS styles in an example styleguide",
"entry": "blocks/file-blocks/css.tsx",
"matches": ["*.css"],
"example_path": "https://github.com/githubnext/blocks-tutorial/blob/main/global.css"
},
{
"type": "file",
"id": "image-block",
"title": "Image block",
"description": "View images",
"sandbox": false,
"id": "image",
"title": "Image",
"description": "View PNG, JPG, GIF, and SVG images",
"entry": "blocks/file-blocks/image.tsx",
"matches": ["*.png", "*.jpg", "*.jpeg", "*.gif", "*.svg"],
"example_path": "https://github.com/pmndrs/react-spring/blob/HEAD/assets/projects/aragon.png?raw=true"
},
{
"type": "file",
"id": "json-block",
"title": "Object explorer",
"description": "An interactive view of JSON objects",
"sandbox": false,
"id": "json",
"title": "JSON explorer",
"description": "An interactive view of JSON data",
"entry": "blocks/file-blocks/json.tsx",
"matches": [
"*.json",
Expand All @@ -69,196 +63,159 @@
},
{
"type": "file",
"id": "geojson-block",
"id": "geojson",
"title": "GeoJSON explorer",
"description": "View & edit GeoJSON data",
"sandbox": false,
"entry": "blocks/file-blocks/geojson.tsx",
"matches": ["*.geo.json", "*.geojson"],
"example_path": "https://github.com/d3/d3-geo/blob/main/package.json"
},
{
"type": "file",
"id": "3d-model-block",
"title": "3D block",
"description": "A block for 3d files",
"sandbox": false,
"id": "3d-model",
"title": "3D model",
"description": "View 3D models",
"entry": "blocks/file-blocks/3d-files.tsx",
"matches": ["*.gltf", "*.glb"],
"example_path": "https://github.com/githubnext/blocks-tutorial/blob/main/avocado.glb"
},
{
"type": "file",
"id": "flat-block",
"title": "Flat data block",
"description": "A block for flat data files",
"sandbox": false,
"id": "flat",
"title": "Spreadsheet",
"description": "View & edit CSV and YAML files in a spreadsheet",
"entry": "blocks/file-blocks/flat.tsx",
"matches": ["*.csv", "*.yml", "*.yaml"],
"example_path": "https://github.com/githubnext/blocks-tutorial/blob/main/data.csv"
},
{
"type": "file",
"id": "simple-poll-block",
"title": "Poll block",
"description": "View simple polls beautifully",
"sandbox": false,
"entry": "blocks/file-blocks/poll.tsx",
"matches": ["*.json"],
"example_path": "https://github.com/githubnext/blocks-tutorial/blob/main/poll.json"
},
{
"type": "file",
"id": "chart-block",
"title": "Chart block",
"description": "An interactive chart block",
"sandbox": false,
"id": "chart",
"title": "Chart",
"description": "Visualize CSV data in a few different chart types",
"entry": "blocks/file-blocks/charts/index.tsx",
"matches": ["*.csv"],
"example_path": "https://github.com/the-pudding/data/blob/master/pockets/measurements.csv"
},
{
"type": "file",
"id": "markdown-block",
"title": "Markdown block",
"description": "View and edit Markdown content",
"sandbox": false,
"title": "Markdown",
"description": "View and edit Markdown content, with the ability to embed other blocks",
"entry": "blocks/file-blocks/markdown-edit/index.tsx",
"matches": ["*.md", "*.markdown", "*.mdx", "*"],
"example_path": "https://github.com/githubnext/blocks-tutorial/blob/main/README.md"
},
{
"type": "file",
"id": "sandbox-block",
"title": "JS Sandbox block",
"description": "Execute Javascript code",
"sandbox": false,
"id": "sandbox",
"title": "JS Sandbox",
"description": "Run JavaScript code in a sandbox",
"entry": "blocks/file-blocks/sandbox/index.tsx",
"matches": ["*.js", "*.ts", "*.tsx", "*.jsx"],
"example_path": "https://github.com/githubnext/blocks-tutorial/blob/main/README.md"
},
{
"type": "file",
"id": "use-case-block",
"title": "Blocks use case",
"description": "View Blocks use case writeups",
"sandbox": false,
"entry": "blocks/file-blocks/use-case/index.tsx",
"matches": ["*.md", "*.mdx"],
"example_path": "https://github.com/githubnext/blocks-tutorial/blob/main/README.md"
},
{
"type": "file",
"id": "react-feedback-block",
"id": "react-feedback",
"title": "React component feedback",
"description": "Give feedback on a React component",
"sandbox": false,
"description": "View & give feedback on a React component",
"entry": "blocks/file-blocks/annotate-react/index.tsx",
"matches": ["*.jsx", "*.tsx"],
"example_path": "https://github.com/githubnext/blocks-tutorial/blob/main/Aside.jsx"
},
{
"type": "file",
"id": "sentence-encoder-block",
"title": "Sentence encoder block",
"description": "Experiment with your sentence-encoder",
"sandbox": false,
"id": "sentence-encoder",
"title": "Sentence encoder",
"description": "Experiment with a sentence-encoder",
"entry": "blocks/file-blocks/sentence-encoder.tsx",
"matches": ["*.json"],
"example_path": "https://github.com/githubnext/blocks-tutorial/blob/main/queries.json"
},
{
"type": "file",
"id": "processing-block",
"title": "Processing block",
"description": "Run your p5.js sketches",
"id": "processing",
"title": "p5.js",
"description": "Run a p5.js sketch",
"sandbox": true,
"entry": "blocks/file-blocks/processing.tsx",
"matches": ["*.js"],
"example_path": "https://github.com/githubnext/blocks-tutorial/blob/main/processing-sketch.js"
},
{
"type": "file",
"id": "summarize-block",
"title": "Summarize block",
"id": "summarize",
"title": "Summarize",
"description": "Summarize parts of a file using ML",
"sandbox": false,
"entry": "blocks/file-blocks/summarize/index.tsx",
"matches": ["*.js", "*.ts", "*.tsx", "*.jsx"],
"example_path": "https://github.com/mattdesl/canvas-sketch/blob/master/lib/save.js"
},
{
"type": "file",
"id": "explain-block",
"title": "Explain block",
"id": "explain",
"title": "Explain",
"description": "Explain parts of a file using ML",
"sandbox": false,
"entry": "blocks/file-blocks/explain/index.tsx",
"matches": ["*.js", "*.ts", "*.tsx", "*.jsx", "*.rb", "*.py"],
"example_path": "https://github.com/mattdesl/canvas-sketch/blob/master/lib/save.js"
},
{
"type": "file",
"id": "edit-block",
"title": "Edit code",
"id": "edit",
"title": "Edit code with ML",
"description": "Edit code by prompting a Machine Learning model",
"sandbox": false,
"entry": "blocks/file-blocks/edit/index.tsx",
"matches": ["*"],
"example_path": "https://github.com/githubnext/blocks-tutorial/blob/main/processing-sketch.js"
},
{
"type": "file",
"id": "edit-and-preview-block",
"id": "edit-and-preview",
"title": "Edit with Preview",
"description": "Edit code side-by-side with a preview",
"sandbox": false,
"entry": "blocks/file-blocks/edit-and-preview/index.tsx",
"matches": ["*"],
"example_path": "https://github.com/githubnext/blocks-tutorial/blob/main/README.md"
},
{
"type": "folder",
"id": "minimap-block",
"id": "minimap",
"title": "Minimap",
"description": "A visualization of your folders and files",
"sandbox": false,
"description": "Visualize your folders and files in a minimap",
"entry": "blocks/folder-blocks/minimap/index.tsx",
"example_path": "https://github.com/githubnext/blocks-tutorial"
},
{
"type": "folder",
"id": "overview-block",
"id": "overview",
"title": "Overview",
"description": "An overview of a folder: including README, license, and recent activity",
"sandbox": false,
"description": "View an overview of a folder: including README, license, and recent activity",
"entry": "blocks/folder-blocks/overview/index.tsx",
"example_path": "https://github.com/githubnext/blocks-tutorial"
},
{
"type": "folder",
"id": "dashboard-block",
"id": "dashboard",
"title": "Dashboard",
"description": "A dashboard of Blocks",
"sandbox": false,
"description": "View other blocks in a dashboard view",
"entry": "blocks/folder-blocks/dashboard/index.tsx",
"example_path": "https://github.com/githubnext/blocks-tutorial"
},
{
"type": "folder",
"id": "code-tour-block",
"id": "code-tour",
"title": "Code Tour",
"description": "Create documented tours of your code",
"sandbox": false,
"entry": "blocks/folder-blocks/code-tour/index.tsx",
"example_path": "https://github.com/githubnext/blocks-tutorial"
},
{
"type": "folder",
"id": "infinite-canvas-block",
"id": "infinite-canvas",
"title": "Infinite Canvas",
"description": "View and annotate your files in an infinite canvas",
"sandbox": false,
"entry": "blocks/folder-blocks/infinite-canvas/index.tsx",
"example_path": "https://github.com/githubnext/blocks-tutorial"
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@excalidraw/excalidraw": "^0.10.0",
"@fullstackio/cq": "^6.0.9",
"@fullstackio/remark-cq": "^6.1.2",
"@githubnext/blocks": "^2.1.1",
"@githubnext/blocks": "^2.2.0",
"@githubocto/flat-ui": "^0.14.1",
"@lezer/highlight": "^1.0.0",
"@lezer/markdown": "^1.0.1",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -910,10 +910,10 @@
unist-util-visit "^1.0.0"
uuid "^3.3.2"

"@githubnext/blocks@^2.1.1":
version "2.1.1"
resolved "https://registry.yarnpkg.com/@githubnext/blocks/-/blocks-2.1.1.tgz#73c65f2ff3d75b2fb8203fdf8cc1e3083e7c1a4e"
integrity sha512-53YsSBZRagNRjbaRRlUe9E47Vz20YPx+ZxsB9TuUjdzmnI4h4WzewJprk/L2sjNh9WcVMVCtKNB6lQGA9A6Hbw==
"@githubnext/blocks@^2.2.0":
version "2.2.0"
resolved "https://registry.yarnpkg.com/@githubnext/blocks/-/blocks-2.2.0.tgz#e060b8718621fd7917f4dca4c68d178d9e7b93b8"
integrity sha512-as89UwPi3tQPYDjaAmRKYa/lndUH6ZW9gcZIuXiUnGWSpzn6qZyQTMA2NNpm7sjy9nOy6mtw3RYGt/EfJeIqdw==
dependencies:
"@loadable/component" "^5.15.0"
"@octokit/openapi-types" "^11.2.0"
Expand Down