@elastic/isomer-studio 0.0.0 → 0.4.0
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/LICENSE.txt +93 -0
- package/NOTICE.txt +17329 -0
- package/README.md +64 -0
- package/THIRD_PARTY_LICENSES.md +404 -0
- package/bin/isomer-studio.js +10 -0
- package/dist/app/assets/codicon-5T574S7B.ttf +0 -0
- package/dist/app/assets/editor.worker.js +11 -0
- package/dist/app/assets/esbuild.wasm +0 -0
- package/dist/app/assets/json.worker.js +47 -0
- package/dist/app/assets/slack.css +1 -0
- package/dist/app/assets/studio.css +11 -0
- package/dist/app/assets/ts.worker.js +37029 -0
- package/dist/app/index.html +16 -0
- package/dist/apps/app_host.d.ts +8 -0
- package/dist/apps/app_host.d.ts.map +1 -0
- package/dist/apps/app_host.js +73 -0
- package/dist/apps/app_host.js.map +1 -0
- package/dist/browser/dev_host.d.ts +5 -0
- package/dist/browser/dev_host.d.ts.map +1 -0
- package/dist/browser/dev_host.js +46 -0
- package/dist/browser/dev_host.js.map +1 -0
- package/dist/browser/mount.d.ts +16 -0
- package/dist/browser/mount.d.ts.map +1 -0
- package/dist/browser/mount.js +37 -0
- package/dist/browser/mount.js.map +1 -0
- package/dist/browser/static_host.d.ts +5 -0
- package/dist/browser/static_host.d.ts.map +1 -0
- package/dist/browser/static_host.js +55 -0
- package/dist/browser/static_host.js.map +1 -0
- package/dist/chrome/accent.d.ts +14 -0
- package/dist/chrome/accent.d.ts.map +1 -0
- package/dist/chrome/accent.js +31 -0
- package/dist/chrome/accent.js.map +1 -0
- package/dist/chrome/app_pages.d.ts +13 -0
- package/dist/chrome/app_pages.d.ts.map +1 -0
- package/dist/chrome/app_pages.js +33 -0
- package/dist/chrome/app_pages.js.map +1 -0
- package/dist/chrome/color_mode.d.ts +10 -0
- package/dist/chrome/color_mode.d.ts.map +1 -0
- package/dist/chrome/color_mode.js +45 -0
- package/dist/chrome/color_mode.js.map +1 -0
- package/dist/chrome/dev_tint.d.ts +7 -0
- package/dist/chrome/dev_tint.d.ts.map +1 -0
- package/dist/chrome/dev_tint.js +31 -0
- package/dist/chrome/dev_tint.js.map +1 -0
- package/dist/chrome/header.d.ts +20 -0
- package/dist/chrome/header.d.ts.map +1 -0
- package/dist/chrome/header.js +124 -0
- package/dist/chrome/header.js.map +1 -0
- package/dist/chrome/icon_data_uri.d.ts +12 -0
- package/dist/chrome/icon_data_uri.d.ts.map +1 -0
- package/dist/chrome/icon_data_uri.js +21 -0
- package/dist/chrome/icon_data_uri.js.map +1 -0
- package/dist/chrome/isomer_mark.d.ts +17 -0
- package/dist/chrome/isomer_mark.d.ts.map +1 -0
- package/dist/chrome/isomer_mark.js +46 -0
- package/dist/chrome/isomer_mark.js.map +1 -0
- package/dist/chrome/nav.d.ts +22 -0
- package/dist/chrome/nav.d.ts.map +1 -0
- package/dist/chrome/nav.js +306 -0
- package/dist/chrome/nav.js.map +1 -0
- package/dist/chrome/nav_groups.d.ts +6 -0
- package/dist/chrome/nav_groups.d.ts.map +1 -0
- package/dist/chrome/nav_groups.js +48 -0
- package/dist/chrome/nav_groups.js.map +1 -0
- package/dist/chrome/nav_sections.d.ts +29 -0
- package/dist/chrome/nav_sections.d.ts.map +1 -0
- package/dist/chrome/nav_sections.js +55 -0
- package/dist/chrome/nav_sections.js.map +1 -0
- package/dist/chrome/oklch.d.ts +10 -0
- package/dist/chrome/oklch.d.ts.map +1 -0
- package/dist/chrome/oklch.js +61 -0
- package/dist/chrome/oklch.js.map +1 -0
- package/dist/chrome/primitive_glyph.d.ts +14 -0
- package/dist/chrome/primitive_glyph.d.ts.map +1 -0
- package/dist/chrome/primitive_glyph.js +48 -0
- package/dist/chrome/primitive_glyph.js.map +1 -0
- package/dist/chrome/primitive_heading.d.ts +14 -0
- package/dist/chrome/primitive_heading.d.ts.map +1 -0
- package/dist/chrome/primitive_heading.js +32 -0
- package/dist/chrome/primitive_heading.js.map +1 -0
- package/dist/chrome/primitive_peek.d.ts +8 -0
- package/dist/chrome/primitive_peek.d.ts.map +1 -0
- package/dist/chrome/primitive_peek.js +51 -0
- package/dist/chrome/primitive_peek.js.map +1 -0
- package/dist/chrome/primitive_search.d.ts +9 -0
- package/dist/chrome/primitive_search.d.ts.map +1 -0
- package/dist/chrome/primitive_search.js +93 -0
- package/dist/chrome/primitive_search.js.map +1 -0
- package/dist/chrome/route.d.ts +48 -0
- package/dist/chrome/route.d.ts.map +1 -0
- package/dist/chrome/route.js +136 -0
- package/dist/chrome/route.js.map +1 -0
- package/dist/cli/args.d.ts +39 -0
- package/dist/cli/args.d.ts.map +1 -0
- package/dist/cli/args.js +171 -0
- package/dist/cli/args.js.map +1 -0
- package/dist/cli/run.d.ts +15 -0
- package/dist/cli/run.d.ts.map +1 -0
- package/dist/cli/run.js +113 -0
- package/dist/cli/run.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +22 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +118 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +11 -0
- package/dist/config.js.map +1 -0
- package/dist/dev/code_editor.d.ts +10 -0
- package/dist/dev/code_editor.d.ts.map +1 -0
- package/dist/dev/code_editor.js +22 -0
- package/dist/dev/code_editor.js.map +1 -0
- package/dist/dev/dev_view.d.ts +9 -0
- package/dist/dev/dev_view.d.ts.map +1 -0
- package/dist/dev/dev_view.js +65 -0
- package/dist/dev/dev_view.js.map +1 -0
- package/dist/dev/editor_panel.d.ts +17 -0
- package/dist/dev/editor_panel.d.ts.map +1 -0
- package/dist/dev/editor_panel.js +51 -0
- package/dist/dev/editor_panel.js.map +1 -0
- package/dist/dev/monaco_editor.d.ts +15 -0
- package/dist/dev/monaco_editor.d.ts.map +1 -0
- package/dist/dev/monaco_editor.js +159 -0
- package/dist/dev/monaco_editor.js.map +1 -0
- package/dist/dev/preview_panel.d.ts +10 -0
- package/dist/dev/preview_panel.d.ts.map +1 -0
- package/dist/dev/preview_panel.js +45 -0
- package/dist/dev/preview_panel.js.map +1 -0
- package/dist/dev/prop_reference.d.ts +9 -0
- package/dist/dev/prop_reference.d.ts.map +1 -0
- package/dist/dev/prop_reference.js +134 -0
- package/dist/dev/prop_reference.js.map +1 -0
- package/dist/dev/tsx_language.d.ts +10 -0
- package/dist/dev/tsx_language.d.ts.map +1 -0
- package/dist/dev/tsx_language.js +283 -0
- package/dist/dev/tsx_language.js.map +1 -0
- package/dist/dev/use_editor.d.ts +23 -0
- package/dist/dev/use_editor.d.ts.map +1 -0
- package/dist/dev/use_editor.js +124 -0
- package/dist/dev/use_editor.js.map +1 -0
- package/dist/docs/docs_view.d.ts +10 -0
- package/dist/docs/docs_view.d.ts.map +1 -0
- package/dist/docs/docs_view.js +80 -0
- package/dist/docs/docs_view.js.map +1 -0
- package/dist/docs/example_source.d.ts +7 -0
- package/dist/docs/example_source.d.ts.map +1 -0
- package/dist/docs/example_source.js +56 -0
- package/dist/docs/example_source.js.map +1 -0
- package/dist/docs/examples_panel.d.ts +10 -0
- package/dist/docs/examples_panel.d.ts.map +1 -0
- package/dist/docs/examples_panel.js +51 -0
- package/dist/docs/examples_panel.js.map +1 -0
- package/dist/docs/gallery_view.d.ts +9 -0
- package/dist/docs/gallery_view.d.ts.map +1 -0
- package/dist/docs/gallery_view.js +98 -0
- package/dist/docs/gallery_view.js.map +1 -0
- package/dist/docs/inline_code.d.ts +11 -0
- package/dist/docs/inline_code.d.ts.map +1 -0
- package/dist/docs/inline_code.js +24 -0
- package/dist/docs/inline_code.js.map +1 -0
- package/dist/docs/on_this_page.d.ts +17 -0
- package/dist/docs/on_this_page.d.ts.map +1 -0
- package/dist/docs/on_this_page.js +77 -0
- package/dist/docs/on_this_page.js.map +1 -0
- package/dist/docs/props_table.d.ts +14 -0
- package/dist/docs/props_table.d.ts.map +1 -0
- package/dist/docs/props_table.js +34 -0
- package/dist/docs/props_table.js.map +1 -0
- package/dist/home/apps_section.d.ts +6 -0
- package/dist/home/apps_section.d.ts.map +1 -0
- package/dist/home/apps_section.js +44 -0
- package/dist/home/apps_section.js.map +1 -0
- package/dist/home/featured_strip.d.ts +12 -0
- package/dist/home/featured_strip.d.ts.map +1 -0
- package/dist/home/featured_strip.js +176 -0
- package/dist/home/featured_strip.js.map +1 -0
- package/dist/home/home_view.d.ts +11 -0
- package/dist/home/home_view.d.ts.map +1 -0
- package/dist/home/home_view.js +261 -0
- package/dist/home/home_view.js.map +1 -0
- package/dist/home/links.d.ts +8 -0
- package/dist/home/links.d.ts.map +1 -0
- package/dist/home/links.js +14 -0
- package/dist/home/links.js.map +1 -0
- package/dist/home/loaded_panel.d.ts +6 -0
- package/dist/home/loaded_panel.d.ts.map +1 -0
- package/dist/home/loaded_panel.js +116 -0
- package/dist/home/loaded_panel.js.map +1 -0
- package/dist/home/surface_chart.d.ts +6 -0
- package/dist/home/surface_chart.d.ts.map +1 -0
- package/dist/home/surface_chart.js +263 -0
- package/dist/home/surface_chart.js.map +1 -0
- package/dist/home/tokens.d.ts +49 -0
- package/dist/home/tokens.d.ts.map +1 -0
- package/dist/home/tokens.js +171 -0
- package/dist/home/tokens.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/model/app_problems.d.ts +4 -0
- package/dist/model/app_problems.d.ts.map +1 -0
- package/dist/model/app_problems.js +90 -0
- package/dist/model/app_problems.js.map +1 -0
- package/dist/model/authoring_types.d.ts +23 -0
- package/dist/model/authoring_types.d.ts.map +1 -0
- package/dist/model/authoring_types.js +35 -0
- package/dist/model/authoring_types.js.map +1 -0
- package/dist/model/compile_jsx.d.ts +19 -0
- package/dist/model/compile_jsx.d.ts.map +1 -0
- package/dist/model/compile_jsx.js +55 -0
- package/dist/model/compile_jsx.js.map +1 -0
- package/dist/model/compose_example.d.ts +9 -0
- package/dist/model/compose_example.d.ts.map +1 -0
- package/dist/model/compose_example.js +24 -0
- package/dist/model/compose_example.js.map +1 -0
- package/dist/model/composition_key.d.ts +6 -0
- package/dist/model/composition_key.d.ts.map +1 -0
- package/dist/model/composition_key.js +26 -0
- package/dist/model/composition_key.js.map +1 -0
- package/dist/model/describe_runtime.d.ts +33 -0
- package/dist/model/describe_runtime.d.ts.map +1 -0
- package/dist/model/describe_runtime.js +77 -0
- package/dist/model/describe_runtime.js.map +1 -0
- package/dist/model/featured.d.ts +11 -0
- package/dist/model/featured.d.ts.map +1 -0
- package/dist/model/featured.js +70 -0
- package/dist/model/featured.js.map +1 -0
- package/dist/model/jsx_transform.d.ts +10 -0
- package/dist/model/jsx_transform.d.ts.map +1 -0
- package/dist/model/jsx_transform.js +31 -0
- package/dist/model/jsx_transform.js.map +1 -0
- package/dist/model/png_manifest.d.ts +23 -0
- package/dist/model/png_manifest.d.ts.map +1 -0
- package/dist/model/png_manifest.js +26 -0
- package/dist/model/png_manifest.js.map +1 -0
- package/dist/model/read_examples.d.ts +12 -0
- package/dist/model/read_examples.d.ts.map +1 -0
- package/dist/model/read_examples.js +43 -0
- package/dist/model/read_examples.js.map +1 -0
- package/dist/model/search.d.ts +4 -0
- package/dist/model/search.d.ts.map +1 -0
- package/dist/model/search.js +29 -0
- package/dist/model/search.js.map +1 -0
- package/dist/model/sha256.d.ts +3 -0
- package/dist/model/sha256.d.ts.map +1 -0
- package/dist/model/sha256.js +72 -0
- package/dist/model/sha256.js.map +1 -0
- package/dist/model/slack_limits.d.ts +9 -0
- package/dist/model/slack_limits.d.ts.map +1 -0
- package/dist/model/slack_limits.js +213 -0
- package/dist/model/slack_limits.js.map +1 -0
- package/dist/node/app_bundle.d.ts +45 -0
- package/dist/node/app_bundle.d.ts.map +1 -0
- package/dist/node/app_bundle.js +212 -0
- package/dist/node/app_bundle.js.map +1 -0
- package/dist/node/build_site.d.ts +28 -0
- package/dist/node/build_site.d.ts.map +1 -0
- package/dist/node/build_site.js +90 -0
- package/dist/node/build_site.js.map +1 -0
- package/dist/node/check.d.ts +40 -0
- package/dist/node/check.d.ts.map +1 -0
- package/dist/node/check.js +162 -0
- package/dist/node/check.js.map +1 -0
- package/dist/node/dev_bundle.d.ts +21 -0
- package/dist/node/dev_bundle.d.ts.map +1 -0
- package/dist/node/dev_bundle.js +121 -0
- package/dist/node/dev_bundle.js.map +1 -0
- package/dist/node/dev_server.d.ts +16 -0
- package/dist/node/dev_server.d.ts.map +1 -0
- package/dist/node/dev_server.js +291 -0
- package/dist/node/dev_server.js.map +1 -0
- package/dist/node/init_config.d.ts +30 -0
- package/dist/node/init_config.d.ts.map +1 -0
- package/dist/node/init_config.js +158 -0
- package/dist/node/init_config.js.map +1 -0
- package/dist/node/load_config.d.ts +34 -0
- package/dist/node/load_config.d.ts.map +1 -0
- package/dist/node/load_config.js +246 -0
- package/dist/node/load_config.js.map +1 -0
- package/dist/node/project_resolution.d.ts +17 -0
- package/dist/node/project_resolution.d.ts.map +1 -0
- package/dist/node/project_resolution.js +66 -0
- package/dist/node/project_resolution.js.map +1 -0
- package/dist/node/rasterize.d.ts +23 -0
- package/dist/node/rasterize.d.ts.map +1 -0
- package/dist/node/rasterize.js +79 -0
- package/dist/node/rasterize.js.map +1 -0
- package/dist/node/report.d.ts +8 -0
- package/dist/node/report.d.ts.map +1 -0
- package/dist/node/report.js +57 -0
- package/dist/node/report.js.map +1 -0
- package/dist/node/resolve_hooks.d.ts +16 -0
- package/dist/node/resolve_hooks.d.ts.map +1 -0
- package/dist/node/resolve_hooks.js +104 -0
- package/dist/node/resolve_hooks.js.map +1 -0
- package/dist/studio.d.ts +4 -0
- package/dist/studio.d.ts.map +1 -0
- package/dist/studio.js +188 -0
- package/dist/studio.js.map +1 -0
- package/dist/studio_context.d.ts +27 -0
- package/dist/studio_context.d.ts.map +1 -0
- package/dist/studio_context.js +17 -0
- package/dist/studio_context.js.map +1 -0
- package/dist/surfaces/adopt_stylesheet.d.ts +7 -0
- package/dist/surfaces/adopt_stylesheet.d.ts.map +1 -0
- package/dist/surfaces/adopt_stylesheet.js +64 -0
- package/dist/surfaces/adopt_stylesheet.js.map +1 -0
- package/dist/surfaces/app_preview.d.ts +4 -0
- package/dist/surfaces/app_preview.d.ts.map +1 -0
- package/dist/surfaces/app_preview.js +28 -0
- package/dist/surfaces/app_preview.js.map +1 -0
- package/dist/surfaces/app_surface.d.ts +9 -0
- package/dist/surfaces/app_surface.d.ts.map +1 -0
- package/dist/surfaces/app_surface.js +27 -0
- package/dist/surfaces/app_surface.js.map +1 -0
- package/dist/surfaces/applicable_enhancements.d.ts +4 -0
- package/dist/surfaces/applicable_enhancements.d.ts.map +1 -0
- package/dist/surfaces/applicable_enhancements.js +16 -0
- package/dist/surfaces/applicable_enhancements.js.map +1 -0
- package/dist/surfaces/enhancement_select.d.ts +10 -0
- package/dist/surfaces/enhancement_select.d.ts.map +1 -0
- package/dist/surfaces/enhancement_select.js +28 -0
- package/dist/surfaces/enhancement_select.js.map +1 -0
- package/dist/surfaces/example_picker.d.ts +11 -0
- package/dist/surfaces/example_picker.d.ts.map +1 -0
- package/dist/surfaces/example_picker.js +44 -0
- package/dist/surfaces/example_picker.js.map +1 -0
- package/dist/surfaces/format_source.d.ts +4 -0
- package/dist/surfaces/format_source.d.ts.map +1 -0
- package/dist/surfaces/format_source.js +30 -0
- package/dist/surfaces/format_source.js.map +1 -0
- package/dist/surfaces/html_surface.d.ts +14 -0
- package/dist/surfaces/html_surface.d.ts.map +1 -0
- package/dist/surfaces/html_surface.js +122 -0
- package/dist/surfaces/html_surface.js.map +1 -0
- package/dist/surfaces/png_surface.d.ts +13 -0
- package/dist/surfaces/png_surface.d.ts.map +1 -0
- package/dist/surfaces/png_surface.js +68 -0
- package/dist/surfaces/png_surface.js.map +1 -0
- package/dist/surfaces/react_surface.d.ts +11 -0
- package/dist/surfaces/react_surface.d.ts.map +1 -0
- package/dist/surfaces/react_surface.js +55 -0
- package/dist/surfaces/react_surface.js.map +1 -0
- package/dist/surfaces/render_output.d.ts +31 -0
- package/dist/surfaces/render_output.d.ts.map +1 -0
- package/dist/surfaces/render_output.js +119 -0
- package/dist/surfaces/render_output.js.map +1 -0
- package/dist/surfaces/scaled_preview.d.ts +17 -0
- package/dist/surfaces/scaled_preview.d.ts.map +1 -0
- package/dist/surfaces/scaled_preview.js +74 -0
- package/dist/surfaces/scaled_preview.js.map +1 -0
- package/dist/surfaces/shadow_root.d.ts +8 -0
- package/dist/surfaces/shadow_root.d.ts.map +1 -0
- package/dist/surfaces/shadow_root.js +41 -0
- package/dist/surfaces/shadow_root.js.map +1 -0
- package/dist/surfaces/slack_surface.d.ts +12 -0
- package/dist/surfaces/slack_surface.d.ts.map +1 -0
- package/dist/surfaces/slack_surface.js +27 -0
- package/dist/surfaces/slack_surface.js.map +1 -0
- package/dist/surfaces/snapshot_surface.d.ts +6 -0
- package/dist/surfaces/snapshot_surface.d.ts.map +1 -0
- package/dist/surfaces/snapshot_surface.js +5 -0
- package/dist/surfaces/snapshot_surface.js.map +1 -0
- package/dist/surfaces/surface_board.d.ts +19 -0
- package/dist/surfaces/surface_board.d.ts.map +1 -0
- package/dist/surfaces/surface_board.js +128 -0
- package/dist/surfaces/surface_board.js.map +1 -0
- package/dist/surfaces/surface_frame.d.ts +8 -0
- package/dist/surfaces/surface_frame.d.ts.map +1 -0
- package/dist/surfaces/surface_frame.js +4 -0
- package/dist/surfaces/surface_frame.js.map +1 -0
- package/dist/surfaces/surface_logos.d.ts +9 -0
- package/dist/surfaces/surface_logos.d.ts.map +1 -0
- package/dist/surfaces/surface_logos.js +21 -0
- package/dist/surfaces/surface_logos.js.map +1 -0
- package/dist/surfaces/surface_preview.d.ts +32 -0
- package/dist/surfaces/surface_preview.d.ts.map +1 -0
- package/dist/surfaces/surface_preview.js +66 -0
- package/dist/surfaces/surface_preview.js.map +1 -0
- package/dist/surfaces/surface_select.d.ts +34 -0
- package/dist/surfaces/surface_select.d.ts.map +1 -0
- package/dist/surfaces/surface_select.js +119 -0
- package/dist/surfaces/surface_select.js.map +1 -0
- package/dist/surfaces/text_surfaces.d.ts +14 -0
- package/dist/surfaces/text_surfaces.d.ts.map +1 -0
- package/dist/surfaces/text_surfaces.js +31 -0
- package/dist/surfaces/text_surfaces.js.map +1 -0
- package/dist/surfaces/zoom_select.d.ts +9 -0
- package/dist/surfaces/zoom_select.d.ts.map +1 -0
- package/dist/surfaces/zoom_select.js +32 -0
- package/dist/surfaces/zoom_select.js.map +1 -0
- package/dist/types.d.ts +32 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +9 -0
- package/dist/types.js.map +1 -0
- package/docs/ci.md +55 -0
- package/docs/commands.md +167 -0
- package/docs/config.md +192 -0
- package/docs/images/home.png +0 -0
- package/docs/images/reference.png +0 -0
- package/docs/images/workbench.png +0 -0
- package/docs/index.md +96 -0
- package/docs/toc.yml +10 -0
- package/package.json +89 -5
package/dist/cli/run.js
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
4
|
+
* 2.0; you may not use this file except in compliance with the Elastic License
|
|
5
|
+
* 2.0.
|
|
6
|
+
*/
|
|
7
|
+
import { spawn } from 'node:child_process';
|
|
8
|
+
import { mkdirSync, writeFileSync } from 'node:fs';
|
|
9
|
+
import { dirname, isAbsolute, relative } from 'node:path';
|
|
10
|
+
import { buildSite } from '../node/build_site.js';
|
|
11
|
+
import { checkStudio } from '../node/check.js';
|
|
12
|
+
import { startDevServer } from '../node/dev_server.js';
|
|
13
|
+
import { writeInitConfig } from '../node/init_config.js';
|
|
14
|
+
import { createStudioImporter, loadRenderToString, loadStudioConfig, resolveConfigPath, } from '../node/load_config.js';
|
|
15
|
+
import { createRasterizer, imageFontsOf } from '../node/rasterize.js';
|
|
16
|
+
import { formatReport, summarizeReport } from '../node/report.js';
|
|
17
|
+
import { parseCliArgs, USAGE } from './args.js';
|
|
18
|
+
const OPENERS = {
|
|
19
|
+
darwin: 'open',
|
|
20
|
+
win32: 'explorer',
|
|
21
|
+
};
|
|
22
|
+
/** Opens `url` in the default browser, reporting a missing or failing opener to `onError`. */
|
|
23
|
+
export const openBrowser = (url, onError, command = OPENERS[process.platform] ?? 'xdg-open') => {
|
|
24
|
+
const opener = spawn(command, [url], { detached: true, stdio: 'ignore' });
|
|
25
|
+
opener.on('error', onError);
|
|
26
|
+
opener.unref();
|
|
27
|
+
};
|
|
28
|
+
const runCommand = async (args, io) => {
|
|
29
|
+
const { cwd, stdout, stderr } = io;
|
|
30
|
+
const { loader } = args;
|
|
31
|
+
if (args.command === 'init') {
|
|
32
|
+
const written = await writeInitConfig(args.cwd, { loader });
|
|
33
|
+
stdout(`Wrote ${displayPath(cwd, written)}. Run \`npx @elastic/isomer-studio\` to open the Studio.\n`);
|
|
34
|
+
return 0;
|
|
35
|
+
}
|
|
36
|
+
const configPath = resolveConfigPath(args.cwd, args.config);
|
|
37
|
+
io.onConfig?.(configPath);
|
|
38
|
+
switch (args.command) {
|
|
39
|
+
case 'dev': {
|
|
40
|
+
const server = await startDevServer({
|
|
41
|
+
configPath,
|
|
42
|
+
port: args.port,
|
|
43
|
+
loader,
|
|
44
|
+
log: (line) => stdout(`${line}\n`),
|
|
45
|
+
});
|
|
46
|
+
stdout(`Isomer Studio: ${server.url}\n`);
|
|
47
|
+
if (args.open) {
|
|
48
|
+
openBrowser(server.url, ({ message }) => stderr(`Could not open a browser: ${message}\n`));
|
|
49
|
+
}
|
|
50
|
+
io.onDevServer?.(server);
|
|
51
|
+
return 0;
|
|
52
|
+
}
|
|
53
|
+
case 'build': {
|
|
54
|
+
const { out, base } = args;
|
|
55
|
+
const { pngs, failures } = await buildSite({
|
|
56
|
+
configPath,
|
|
57
|
+
out,
|
|
58
|
+
base,
|
|
59
|
+
loader,
|
|
60
|
+
});
|
|
61
|
+
failures.forEach((failure) => stderr(`PNG skipped: ${failure}\n`));
|
|
62
|
+
stdout(`Wrote the Studio to ${displayPath(cwd, out)} for ${base} with ${pngs} PNGs.\n`);
|
|
63
|
+
return 0;
|
|
64
|
+
}
|
|
65
|
+
case 'check': {
|
|
66
|
+
const importModule = createStudioImporter(configPath, { loader });
|
|
67
|
+
const config = await loadStudioConfig(configPath, { importModule });
|
|
68
|
+
const rasterizePng = args.png
|
|
69
|
+
? createRasterizer(config.runtime, imageFontsOf(config, configPath, importModule))
|
|
70
|
+
: undefined;
|
|
71
|
+
if (args.png && !rasterizePng) {
|
|
72
|
+
stderr('--png: the runtime has no snapshot surface, so no PNGs.\n');
|
|
73
|
+
}
|
|
74
|
+
const report = await checkStudio(config, {
|
|
75
|
+
renderToString: loadRenderToString(configPath),
|
|
76
|
+
surfaces: args.surfaces,
|
|
77
|
+
rasterizePng,
|
|
78
|
+
});
|
|
79
|
+
if (args.report !== undefined) {
|
|
80
|
+
mkdirSync(dirname(args.report), { recursive: true });
|
|
81
|
+
writeFileSync(args.report, formatReport(report, args.format));
|
|
82
|
+
}
|
|
83
|
+
(report.failed ? stderr : stdout)(summarizeReport(report));
|
|
84
|
+
return report.failed ? 1 : 0;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
/** `path` relative to `cwd` when it is inside it, otherwise absolute. */
|
|
89
|
+
const displayPath = (cwd, path) => {
|
|
90
|
+
const inside = relative(cwd, path);
|
|
91
|
+
return inside.startsWith('..') || isAbsolute(inside) ? path : inside || '.';
|
|
92
|
+
};
|
|
93
|
+
const isUsageError = (error) => error instanceof Error && error.name === 'UsageError';
|
|
94
|
+
/** Runs one CLI invocation and resolves its exit code: 0, 1 on a failure, 2 on bad usage. */
|
|
95
|
+
export const runCli = async (argv, io) => {
|
|
96
|
+
try {
|
|
97
|
+
const args = parseCliArgs(argv, io.cwd);
|
|
98
|
+
if (args.command === 'help') {
|
|
99
|
+
io.stdout(USAGE);
|
|
100
|
+
return 0;
|
|
101
|
+
}
|
|
102
|
+
return await runCommand(args, io);
|
|
103
|
+
}
|
|
104
|
+
catch (error) {
|
|
105
|
+
if (isUsageError(error)) {
|
|
106
|
+
io.stderr(`${error instanceof Error ? error.message : String(error)}\n\n${USAGE}`);
|
|
107
|
+
return 2;
|
|
108
|
+
}
|
|
109
|
+
io.stderr(`${error instanceof Error ? error.message : String(error)}\n`);
|
|
110
|
+
return 1;
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
//# sourceMappingURL=run.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../src/cli/run.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE1D,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAG/D,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAY7C,MAAM,OAAO,GAAuD;IAClE,MAAM,EAAE,MAAM;IACd,KAAK,EAAE,UAAU;CAClB,CAAC;AAEF,8FAA8F;AAC9F,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,GAAW,EACX,OAA+B,EAC/B,OAAO,GAAG,OAAO,CAAC,OAAO,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B,EAAS,EACQ,EAAE;IACnB,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,YAAY,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC;QACxC,IAAI,IAAI,CAAC,OAAO,KAAK,MAAM,EAAE,CAAC;YAC5B,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACjB,OAAO,CAAC,CAAC;QACX,CAAC;QACD,OAAO,MAAM,UAAU,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACpC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC;YACxB,EAAE,CAAC,MAAM,CACP,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,KAAK,EAAE,CACxE,CAAC;YACF,OAAO,CAAC,CAAC;QACX,CAAC;QACD,EAAE,CAAC,MAAM,CAAC,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACzE,OAAO,CAAC,CAAC;IACX,CAAC;AACH,CAAC,CAAC","sourcesContent":["/*\n * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one\n * or more contributor license agreements. Licensed under the Elastic License\n * 2.0; you may not use this file except in compliance with the Elastic License\n * 2.0.\n */\n\nimport { spawn } from 'node:child_process';\nimport { mkdirSync, writeFileSync } from 'node:fs';\nimport { dirname, isAbsolute, relative } from 'node:path';\n\nimport { buildSite } from '../node/build_site';\nimport { checkStudio } from '../node/check';\nimport type { DevServer } from '../node/dev_server';\nimport { startDevServer } from '../node/dev_server';\nimport { writeInitConfig } from '../node/init_config';\nimport {\n createStudioImporter,\n loadRenderToString,\n loadStudioConfig,\n resolveConfigPath,\n} from '../node/load_config';\nimport { createRasterizer, imageFontsOf } from '../node/rasterize';\nimport { formatReport, summarizeReport } from '../node/report';\n\nimport type { CliArgs } from './args';\nimport { parseCliArgs, USAGE } from './args';\n\nexport interface CliIo {\n cwd: string;\n stdout: (text: string) => void;\n stderr: (text: string) => void;\n /** Called with the running dev server, which keeps the process alive until it closes. */\n onDevServer?: ((server: DevServer) => void) | undefined;\n /** Called with the config before it loads; the binary passes `registerProjectResolution`. */\n onConfig?: ((configPath: string) => void) | undefined;\n}\n\nconst OPENERS: Readonly<Partial<Record<NodeJS.Platform, string>>> = {\n darwin: 'open',\n win32: 'explorer',\n};\n\n/** Opens `url` in the default browser, reporting a missing or failing opener to `onError`. */\nexport const openBrowser = (\n url: string,\n onError: (error: Error) => void,\n command = OPENERS[process.platform] ?? 'xdg-open'\n): void => {\n const opener = spawn(command, [url], { detached: true, stdio: 'ignore' });\n opener.on('error', onError);\n opener.unref();\n};\n\nconst runCommand = async (\n args: Exclude<CliArgs, { command: 'help' }>,\n io: CliIo\n): Promise<number> => {\n const { cwd, stdout, stderr } = io;\n const { loader } = args;\n if (args.command === 'init') {\n const written = await writeInitConfig(args.cwd, { loader });\n stdout(\n `Wrote ${displayPath(cwd, written)}. Run \\`npx @elastic/isomer-studio\\` to open the Studio.\\n`\n );\n return 0;\n }\n const configPath = resolveConfigPath(args.cwd, args.config);\n io.onConfig?.(configPath);\n\n switch (args.command) {\n case 'dev': {\n const server = await startDevServer({\n configPath,\n port: args.port,\n loader,\n log: (line) => stdout(`${line}\\n`),\n });\n stdout(`Isomer Studio: ${server.url}\\n`);\n if (args.open) {\n openBrowser(server.url, ({ message }) =>\n stderr(`Could not open a browser: ${message}\\n`)\n );\n }\n io.onDevServer?.(server);\n return 0;\n }\n case 'build': {\n const { out, base } = args;\n const { pngs, failures } = await buildSite({\n configPath,\n out,\n base,\n loader,\n });\n failures.forEach((failure) => stderr(`PNG skipped: ${failure}\\n`));\n stdout(\n `Wrote the Studio to ${displayPath(cwd, out)} for ${base} with ${pngs} PNGs.\\n`\n );\n return 0;\n }\n case 'check': {\n const importModule = createStudioImporter(configPath, { loader });\n const config = await loadStudioConfig(configPath, { importModule });\n const rasterizePng = args.png\n ? createRasterizer(\n config.runtime,\n imageFontsOf(config, configPath, importModule)\n )\n : undefined;\n if (args.png && !rasterizePng) {\n stderr('--png: the runtime has no snapshot surface, so no PNGs.\\n');\n }\n const report = await checkStudio(config, {\n renderToString: loadRenderToString(configPath),\n surfaces: args.surfaces,\n rasterizePng,\n });\n if (args.report !== undefined) {\n mkdirSync(dirname(args.report), { recursive: true });\n writeFileSync(args.report, formatReport(report, args.format));\n }\n (report.failed ? stderr : stdout)(summarizeReport(report));\n return report.failed ? 1 : 0;\n }\n }\n};\n\n/** `path` relative to `cwd` when it is inside it, otherwise absolute. */\nconst displayPath = (cwd: string, path: string): string => {\n const inside = relative(cwd, path);\n return inside.startsWith('..') || isAbsolute(inside) ? path : inside || '.';\n};\n\nconst isUsageError = (error: unknown): boolean =>\n error instanceof Error && error.name === 'UsageError';\n\n/** Runs one CLI invocation and resolves its exit code: 0, 1 on a failure, 2 on bad usage. */\nexport const runCli = async (\n argv: readonly string[],\n io: CliIo\n): Promise<number> => {\n try {\n const args = parseCliArgs(argv, io.cwd);\n if (args.command === 'help') {\n io.stdout(USAGE);\n return 0;\n }\n return await runCommand(args, io);\n } catch (error) {\n if (isUsageError(error)) {\n io.stderr(\n `${error instanceof Error ? error.message : String(error)}\\n\\n${USAGE}`\n );\n return 2;\n }\n io.stderr(`${error instanceof Error ? error.message : String(error)}\\n`);\n return 1;\n }\n};\n"]}
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
4
|
+
* 2.0; you may not use this file except in compliance with the Elastic License
|
|
5
|
+
* 2.0.
|
|
6
|
+
*/
|
|
7
|
+
import { runCli } from './cli/run.js';
|
|
8
|
+
import { registerProjectResolution } from './node/load_config.js';
|
|
9
|
+
const shutdown = [];
|
|
10
|
+
process.exitCode = await runCli(process.argv.slice(2), {
|
|
11
|
+
cwd: process.cwd(),
|
|
12
|
+
stdout: (text) => process.stdout.write(text),
|
|
13
|
+
stderr: (text) => process.stderr.write(text),
|
|
14
|
+
onDevServer: (server) => shutdown.push(server.close),
|
|
15
|
+
onConfig: registerProjectResolution,
|
|
16
|
+
});
|
|
17
|
+
const stop = () => {
|
|
18
|
+
void Promise.all(shutdown.map((close) => close())).then(() => process.exit());
|
|
19
|
+
};
|
|
20
|
+
process.once('SIGINT', stop);
|
|
21
|
+
process.once('SIGTERM', stop);
|
|
22
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,MAAM,QAAQ,GAA+B,EAAE,CAAC;AAEhD,OAAO,CAAC,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;IACrD,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;IAClB,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC;IAC5C,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC;IAC5C,WAAW,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;IACpD,QAAQ,EAAE,yBAAyB;CACpC,CAAC,CAAC;AAEH,MAAM,IAAI,GAAG,GAAG,EAAE;IAChB,KAAK,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;AAChF,CAAC,CAAC;AACF,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AAC7B,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC","sourcesContent":["/*\n * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one\n * or more contributor license agreements. Licensed under the Elastic License\n * 2.0; you may not use this file except in compliance with the Elastic License\n * 2.0.\n */\n\nimport { runCli } from './cli/run';\nimport { registerProjectResolution } from './node/load_config';\n\nconst shutdown: Array<() => Promise<void>> = [];\n\nprocess.exitCode = await runCli(process.argv.slice(2), {\n cwd: process.cwd(),\n stdout: (text) => process.stdout.write(text),\n stderr: (text) => process.stderr.write(text),\n onDevServer: (server) => shutdown.push(server.close),\n onConfig: registerProjectResolution,\n});\n\nconst stop = () => {\n void Promise.all(shutdown.map((close) => close())).then(() => process.exit());\n};\nprocess.once('SIGINT', stop);\nprocess.once('SIGTERM', stop);\n"]}
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import type { ComponentType } from 'react';
|
|
2
|
+
import type { IsomerRuntime } from '@elastic/isomer-runtime';
|
|
3
|
+
import type { Composition, PrimitiveIcon, PrimitiveNode, StyledRenderContext } from '@elastic/isomer-sdk';
|
|
4
|
+
import type { StudioSurface } from './model/describe_runtime.js';
|
|
5
|
+
import type { PreviewZoom } from './surfaces/scaled_preview.js';
|
|
6
|
+
import type { RenderPdf } from './types.js';
|
|
7
|
+
/** A runtime whose React renderers resolve style handles through `resolveClassName`. */
|
|
8
|
+
export type StudioRuntime = IsomerRuntime<unknown, StyledRenderContext>;
|
|
9
|
+
export type StudioTheme = 'light' | 'dark';
|
|
10
|
+
/** Wraps example nodes in a composition the runtime's frame accepts. */
|
|
11
|
+
export type StudioCompose = (nodes: readonly PrimitiveNode[], options: {
|
|
12
|
+
theme: StudioTheme;
|
|
13
|
+
}) => Composition;
|
|
14
|
+
export type StudioPreviewProps = ({
|
|
15
|
+
nodes: readonly PrimitiveNode[];
|
|
16
|
+
composition?: never;
|
|
17
|
+
} | {
|
|
18
|
+
composition: Composition;
|
|
19
|
+
nodes?: never;
|
|
20
|
+
}) & {
|
|
21
|
+
/** Defaults to `fit`. */
|
|
22
|
+
zoom?: PreviewZoom | undefined;
|
|
23
|
+
/** With `fit`, also scales down to this height. */
|
|
24
|
+
maxHeight?: number | undefined;
|
|
25
|
+
/** `false` leaves out the composition's leading title, as a slide on its own wants. Defaults to `true`. */
|
|
26
|
+
heading?: boolean | undefined;
|
|
27
|
+
/** Enhancement ids passed to the React surface, such as the slides pack's `SLIDE_BUILDS`. */
|
|
28
|
+
enhancements?: readonly string[] | undefined;
|
|
29
|
+
/** Called with the shadow root after each render commits, for a host step such as `showSlideBuild`. Never called on the `html` fallback. */
|
|
30
|
+
onCommit?: ((root: ShadowRoot) => void) | undefined;
|
|
31
|
+
};
|
|
32
|
+
/** A surface an app can show: one of the runtime's, or `png`, the host's rasterized snapshot. */
|
|
33
|
+
export type StudioAppSurface = StudioSurface | 'png';
|
|
34
|
+
export interface StudioSurfaceProps {
|
|
35
|
+
composition: Composition;
|
|
36
|
+
surface: StudioAppSurface;
|
|
37
|
+
/** `source` shows what the surface produced, as text. Defaults to `render`. */
|
|
38
|
+
view?: 'render' | 'source' | undefined;
|
|
39
|
+
/** Scales the `react`, `html`, `snapshot` and `png` renders. Defaults to `fit`. */
|
|
40
|
+
zoom?: PreviewZoom | undefined;
|
|
41
|
+
/** `false` leaves out the composition's leading title. Defaults to `true`. */
|
|
42
|
+
heading?: boolean | undefined;
|
|
43
|
+
}
|
|
44
|
+
/** What the Studio hands an app's page. */
|
|
45
|
+
export interface StudioAppProps {
|
|
46
|
+
/** Renders pack output in a shadow root, isolated from the app's and the Studio's styles. `nodes` go through the config's `compose`. */
|
|
47
|
+
Preview: ComponentType<StudioPreviewProps>;
|
|
48
|
+
runtime: StudioRuntime;
|
|
49
|
+
theme: StudioTheme;
|
|
50
|
+
/** The part of the hash after `#/app/<id>/`, which may contain slashes. */
|
|
51
|
+
path: string;
|
|
52
|
+
navigate: (path: string) => void;
|
|
53
|
+
/** Renders a finished composition on one surface, with what it reported, as the Studio's own previews do. */
|
|
54
|
+
Surface: ComponentType<StudioSurfaceProps>;
|
|
55
|
+
/** The surfaces `Surface` can show, in display order, with their labels; `png` only when the host rasterizes. */
|
|
56
|
+
surfaces: readonly {
|
|
57
|
+
id: StudioAppSurface;
|
|
58
|
+
label: string;
|
|
59
|
+
}[];
|
|
60
|
+
/** Present when the host can write PDFs, as `dev` does. */
|
|
61
|
+
renderPdf?: RenderPdf | undefined;
|
|
62
|
+
}
|
|
63
|
+
/** A nav row under an app, listed without loading it. */
|
|
64
|
+
export interface StudioAppPage {
|
|
65
|
+
/** The page's `path` under `#/app/<id>/`, one or more segments; the page is active for it and every path below it. */
|
|
66
|
+
path: string;
|
|
67
|
+
title: string;
|
|
68
|
+
/** Pages with the same `section` are listed under it, in order of first appearance. */
|
|
69
|
+
section?: string | undefined;
|
|
70
|
+
}
|
|
71
|
+
/** A page of the Studio that demonstrates the pack, under `#/app/<id>/`. */
|
|
72
|
+
export interface StudioApp {
|
|
73
|
+
/** A URL-safe hash segment, unique within the config: `/^[a-z][a-z0-9-]*$/`. */
|
|
74
|
+
id: string;
|
|
75
|
+
title: string;
|
|
76
|
+
/** One line on what the app shows, on the Home page's tile and its Loaded panel. */
|
|
77
|
+
description?: string | undefined;
|
|
78
|
+
icon?: PrimitiveIcon | undefined;
|
|
79
|
+
/** A module whose default export is the app's page. Node never calls it, so server-only code stays out of it. */
|
|
80
|
+
load: () => Promise<{
|
|
81
|
+
default: ComponentType<StudioAppProps>;
|
|
82
|
+
}>;
|
|
83
|
+
pages?: readonly StudioAppPage[] | undefined;
|
|
84
|
+
}
|
|
85
|
+
/** What a pack hands `isomer-studio`, as the default export of its config file. */
|
|
86
|
+
export interface StudioConfig {
|
|
87
|
+
/**
|
|
88
|
+
* Replaces the header, the page title, and the `check` report name, which are `Isomer Studio`.
|
|
89
|
+
* A pack's name belongs in the nav.
|
|
90
|
+
*/
|
|
91
|
+
title?: string | undefined;
|
|
92
|
+
runtime: StudioRuntime;
|
|
93
|
+
/** Host styling for the React surface inside a shadow root; without it, or `stylesheet`, the React preview falls back to the `html` surface. */
|
|
94
|
+
createReactContext?: ((root: ShadowRoot) => StyledRenderContext) | undefined;
|
|
95
|
+
/** The CSS the React surface needs, adopted into its shadow root before `createReactContext` runs. Called once per config. */
|
|
96
|
+
stylesheet?: (() => string) | undefined;
|
|
97
|
+
/** Defaults to `{ type: 'view', body: nodes, theme }`. Return a node that is already a valid root as is. Wins over `previewExample`. */
|
|
98
|
+
compose?: StudioCompose | undefined;
|
|
99
|
+
/** The composition one node is shown in on its own; the Studio adds the theme, and puts several nodes in a `view`. */
|
|
100
|
+
previewExample?: ((node: PrimitiveNode) => Composition) | undefined;
|
|
101
|
+
/** Pages listed under the app in the nav. */
|
|
102
|
+
apps?: readonly StudioApp[] | undefined;
|
|
103
|
+
/**
|
|
104
|
+
* A module path, relative to the config, whose default export lists the takumi `FontLoader`s PNGs and PDFs are drawn with.
|
|
105
|
+
* Node imports it and the browser never does, so it may read files. Without it, PNGs use takumi's built-in face and PDFs can't draw text.
|
|
106
|
+
*/
|
|
107
|
+
imageFonts?: string | undefined;
|
|
108
|
+
/**
|
|
109
|
+
* Primitive `type`s the Home page features, in this order. Without it, Home picks {@link FEATURED_COUNT}
|
|
110
|
+
* at random on each load.
|
|
111
|
+
*/
|
|
112
|
+
featured?: readonly string[] | undefined;
|
|
113
|
+
}
|
|
114
|
+
/** How many primitives Home features when the config names none. */
|
|
115
|
+
export declare const FEATURED_COUNT = 6;
|
|
116
|
+
/** Types a config file's default export. */
|
|
117
|
+
export declare const defineStudioConfig: (config: StudioConfig) => StudioConfig;
|
|
118
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EACV,WAAW,EACX,aAAa,EACb,aAAa,EACb,mBAAmB,EACpB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,wFAAwF;AACxF,MAAM,MAAM,aAAa,GAAG,aAAa,CAAC,OAAO,EAAE,mBAAmB,CAAC,CAAC;AAExE,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,MAAM,CAAC;AAE3C,wEAAwE;AACxE,MAAM,MAAM,aAAa,GAAG,CAC1B,KAAK,EAAE,SAAS,aAAa,EAAE,EAC/B,OAAO,EAAE;IAAE,KAAK,EAAE,WAAW,CAAA;CAAE,KAC5B,WAAW,CAAC;AAEjB,MAAM,MAAM,kBAAkB,GAAG,CAC7B;IAAE,KAAK,EAAE,SAAS,aAAa,EAAE,CAAC;IAAC,WAAW,CAAC,EAAE,KAAK,CAAA;CAAE,GACxD;IAAE,WAAW,EAAE,WAAW,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,CAC9C,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GG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;CAC1C;AAED,oEAAoE;AACpE,eAAO,MAAM,cAAc,IAAI,CAAC;AAEhC,4CAA4C;AAC5C,eAAO,MAAM,kBAAkB,GAAI,QAAQ,YAAY,KAAG,YAClD,CAAC"}
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
4
|
+
* 2.0; you may not use this file except in compliance with the Elastic License
|
|
5
|
+
* 2.0.
|
|
6
|
+
*/
|
|
7
|
+
/** How many primitives Home features when the config names none. */
|
|
8
|
+
export const FEATURED_COUNT = 6;
|
|
9
|
+
/** Types a config file's default export. */
|
|
10
|
+
export const defineStudioConfig = (config) => config;
|
|
11
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA6HH,oEAAoE;AACpE,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC;AAEhC,4CAA4C;AAC5C,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,MAAoB,EAAgB,EAAE,CACvE,MAAM,CAAC","sourcesContent":["/*\n * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one\n * or more contributor license agreements. Licensed under the Elastic License\n * 2.0; you may not use this file except in compliance with the Elastic License\n * 2.0.\n */\n\nimport type { ComponentType } from 'react';\nimport type { IsomerRuntime } from '@elastic/isomer-runtime';\nimport type {\n Composition,\n PrimitiveIcon,\n PrimitiveNode,\n StyledRenderContext,\n} from '@elastic/isomer-sdk';\n\nimport type { StudioSurface } from './model/describe_runtime';\nimport type { PreviewZoom } from './surfaces/scaled_preview';\nimport type { RenderPdf } from './types';\n\n/** A runtime whose React renderers resolve style handles through `resolveClassName`. */\nexport type StudioRuntime = IsomerRuntime<unknown, StyledRenderContext>;\n\nexport type StudioTheme = 'light' | 'dark';\n\n/** Wraps example nodes in a composition the runtime's frame accepts. */\nexport type StudioCompose = (\n nodes: readonly PrimitiveNode[],\n options: { theme: StudioTheme }\n) => Composition;\n\nexport type StudioPreviewProps = (\n | { nodes: readonly PrimitiveNode[]; composition?: never }\n | { composition: Composition; nodes?: never }\n) & {\n /** Defaults to `fit`. */\n zoom?: PreviewZoom | undefined;\n /** With `fit`, also scales down to this height. */\n maxHeight?: number | undefined;\n /** `false` leaves out the composition's leading title, as a slide on its own wants. Defaults to `true`. */\n heading?: boolean | undefined;\n /** Enhancement ids passed to the React surface, such as the slides pack's `SLIDE_BUILDS`. */\n enhancements?: readonly string[] | undefined;\n /** Called with the shadow root after each render commits, for a host step such as `showSlideBuild`. Never called on the `html` fallback. */\n onCommit?: ((root: ShadowRoot) => void) | undefined;\n};\n\n/** A surface an app can show: one of the runtime's, or `png`, the host's rasterized snapshot. */\nexport type StudioAppSurface = StudioSurface | 'png';\n\nexport interface StudioSurfaceProps {\n composition: Composition;\n surface: StudioAppSurface;\n /** `source` shows what the surface produced, as text. Defaults to `render`. */\n view?: 'render' | 'source' | undefined;\n /** Scales the `react`, `html`, `snapshot` and `png` renders. Defaults to `fit`. */\n zoom?: PreviewZoom | undefined;\n /** `false` leaves out the composition's leading title. Defaults to `true`. */\n heading?: boolean | undefined;\n}\n\n/** What the Studio hands an app's page. */\nexport interface StudioAppProps {\n /** Renders pack output in a shadow root, isolated from the app's and the Studio's styles. `nodes` go through the config's `compose`. */\n Preview: ComponentType<StudioPreviewProps>;\n runtime: StudioRuntime;\n theme: StudioTheme;\n /** The part of the hash after `#/app/<id>/`, which may contain slashes. */\n path: string;\n navigate: (path: string) => void;\n /** Renders a finished composition on one surface, with what it reported, as the Studio's own previews do. */\n Surface: ComponentType<StudioSurfaceProps>;\n /** The surfaces `Surface` can show, in display order, with their labels; `png` only when the host rasterizes. */\n surfaces: readonly { id: StudioAppSurface; label: string }[];\n /** Present when the host can write PDFs, as `dev` does. */\n renderPdf?: RenderPdf | undefined;\n}\n\n/** A nav row under an app, listed without loading it. */\nexport interface StudioAppPage {\n /** The page's `path` under `#/app/<id>/`, one or more segments; the page is active for it and every path below it. */\n path: string;\n title: string;\n /** Pages with the same `section` are listed under it, in order of first appearance. */\n section?: string | undefined;\n}\n\n/** A page of the Studio that demonstrates the pack, under `#/app/<id>/`. */\nexport interface StudioApp {\n /** A URL-safe hash segment, unique within the config: `/^[a-z][a-z0-9-]*$/`. */\n id: string;\n title: string;\n /** One line on what the app shows, on the Home page's tile and its Loaded panel. */\n description?: string | undefined;\n icon?: PrimitiveIcon | undefined;\n /** A module whose default export is the app's page. Node never calls it, so server-only code stays out of it. */\n load: () => Promise<{ default: ComponentType<StudioAppProps> }>;\n pages?: readonly StudioAppPage[] | undefined;\n}\n\n/** What a pack hands `isomer-studio`, as the default export of its config file. */\nexport interface StudioConfig {\n /**\n * Replaces the header, the page title, and the `check` report name, which are `Isomer Studio`.\n * A pack's name belongs in the nav.\n */\n title?: string | undefined;\n runtime: StudioRuntime;\n /** Host styling for the React surface inside a shadow root; without it, or `stylesheet`, the React preview falls back to the `html` surface. */\n createReactContext?: ((root: ShadowRoot) => StyledRenderContext) | undefined;\n /** The CSS the React surface needs, adopted into its shadow root before `createReactContext` runs. Called once per config. */\n stylesheet?: (() => string) | undefined;\n /** Defaults to `{ type: 'view', body: nodes, theme }`. Return a node that is already a valid root as is. Wins over `previewExample`. */\n compose?: StudioCompose | undefined;\n /** The composition one node is shown in on its own; the Studio adds the theme, and puts several nodes in a `view`. */\n previewExample?: ((node: PrimitiveNode) => Composition) | undefined;\n /** Pages listed under the app in the nav. */\n apps?: readonly StudioApp[] | undefined;\n /**\n * A module path, relative to the config, whose default export lists the takumi `FontLoader`s PNGs and PDFs are drawn with.\n * Node imports it and the browser never does, so it may read files. Without it, PNGs use takumi's built-in face and PDFs can't draw text.\n */\n imageFonts?: string | undefined;\n /**\n * Primitive `type`s the Home page features, in this order. Without it, Home picks {@link FEATURED_COUNT}\n * at random on each load.\n */\n featured?: readonly string[] | undefined;\n}\n\n/** How many primitives Home features when the config names none. */\nexport const FEATURED_COUNT = 6;\n\n/** Types a config file's default export. */\nexport const defineStudioConfig = (config: StudioConfig): StudioConfig =>\n config;\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { EditorFormat } from './use_editor.js';
|
|
2
|
+
export interface CodeEditorProps {
|
|
3
|
+
format: EditorFormat;
|
|
4
|
+
value: string;
|
|
5
|
+
onChange: (value: string) => void;
|
|
6
|
+
ariaLabel: string;
|
|
7
|
+
}
|
|
8
|
+
/** The source editor, type-checked against the runtime's authoring types. */
|
|
9
|
+
export declare const CodeEditor: ({ format, value, onChange, ariaLabel, }: CodeEditorProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=code_editor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code_editor.d.ts","sourceRoot":"","sources":["../../src/dev/code_editor.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAQjD,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,YAAY,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,6EAA6E;AAC7E,eAAO,MAAM,UAAU,GAAI,yCAKxB,eAAe,qDAoBjB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
4
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
5
|
+
* 2.0; you may not use this file except in compliance with the Elastic License
|
|
6
|
+
* 2.0.
|
|
7
|
+
*/
|
|
8
|
+
import { lazy, Suspense } from 'react';
|
|
9
|
+
import { EuiFlexGroup, EuiLoadingSpinner } from '@elastic/eui';
|
|
10
|
+
import { css } from '@emotion/react';
|
|
11
|
+
import { useStudio } from '../studio_context.js';
|
|
12
|
+
const MonacoEditor = lazy(() => import('./monaco_editor.js').then(({ MonacoEditor: component }) => ({
|
|
13
|
+
default: component,
|
|
14
|
+
})));
|
|
15
|
+
/** The source editor, type-checked against the runtime's authoring types. */
|
|
16
|
+
export const CodeEditor = ({ format, value, onChange, ariaLabel, }) => {
|
|
17
|
+
const { docs: { authoring }, } = useStudio();
|
|
18
|
+
return (_jsx(Suspense, { fallback: _jsx(EuiFlexGroup, { justifyContent: "center", alignItems: "center", css: css `
|
|
19
|
+
flex: 1;
|
|
20
|
+
`, children: _jsx(EuiLoadingSpinner, { size: "l" }) }), children: _jsx(MonacoEditor, { format, value, onChange, ariaLabel, authoring }) }));
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=code_editor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code_editor.js","sourceRoot":"","sources":["../../src/dev/code_editor.tsx"],"names":[],"mappings":";AAAA;;;;;GAKG;AAEH,OAAc,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAErC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAI9C,MAAM,YAAY,GAAG,IAAI,CAAC,GAAG,EAAE,CAC7B,MAAM,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,CAAC;IAC/D,OAAO,EAAE,SAAS;CACnB,CAAC,CAAC,CACJ,CAAC;AASF,6EAA6E;AAC7E,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EACzB,MAAM,EACN,KAAK,EACL,QAAQ,EACR,SAAS,GACO,EAAE,EAAE;IACpB,MAAM,EACJ,IAAI,EAAE,EAAE,SAAS,EAAE,GACpB,GAAG,SAAS,EAAE,CAAC;IAEhB,OAAO,CACL,KAAC,QAAQ,IACP,QAAQ,EACN,KAAC,YAAY,IACX,cAAc,EAAC,QAAQ,EACvB,UAAU,EAAC,QAAQ,EACnB,GAAG,EAAE,GAAG,CAAA;;WAEP,YACD,KAAC,iBAAiB,IAAC,IAAI,EAAC,GAAG,GAAG,GACjB,YAEjB,KAAC,YAAY,IAAO,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,GAAM,GAC9D,CACZ,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*\n * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one\n * or more contributor license agreements. Licensed under the Elastic License\n * 2.0; you may not use this file except in compliance with the Elastic License\n * 2.0.\n */\n\nimport React, { lazy, Suspense } from 'react';\nimport { EuiFlexGroup, EuiLoadingSpinner } from '@elastic/eui';\nimport { css } from '@emotion/react';\n\nimport { useStudio } from '../studio_context';\n\nimport type { EditorFormat } from './use_editor';\n\nconst MonacoEditor = lazy(() =>\n import('./monaco_editor').then(({ MonacoEditor: component }) => ({\n default: component,\n }))\n);\n\nexport interface CodeEditorProps {\n format: EditorFormat;\n value: string;\n onChange: (value: string) => void;\n ariaLabel: string;\n}\n\n/** The source editor, type-checked against the runtime's authoring types. */\nexport const CodeEditor = ({\n format,\n value,\n onChange,\n ariaLabel,\n}: CodeEditorProps) => {\n const {\n docs: { authoring },\n } = useStudio();\n\n return (\n <Suspense\n fallback={\n <EuiFlexGroup\n justifyContent=\"center\"\n alignItems=\"center\"\n css={css`\n flex: 1;\n `}>\n <EuiLoadingSpinner size=\"l\" />\n </EuiFlexGroup>\n }>\n <MonacoEditor {...{ format, value, onChange, ariaLabel, authoring }} />\n </Suspense>\n );\n};\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { StudioRoute } from '../chrome/route.js';
|
|
2
|
+
export interface DevViewProps {
|
|
3
|
+
route: StudioRoute;
|
|
4
|
+
stacked: boolean;
|
|
5
|
+
navigate: (next: Partial<StudioRoute>) => void;
|
|
6
|
+
}
|
|
7
|
+
/** The workbench: edit one example beside the previews, or above them when space is tight. */
|
|
8
|
+
export declare const DevView: ({ route: { page, example }, stacked, navigate, }: DevViewProps) => import("@emotion/react/jsx-runtime").JSX.Element | null;
|
|
9
|
+
//# sourceMappingURL=dev_view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev_view.d.ts","sourceRoot":"","sources":["../../src/dev/dev_view.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAiHnD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,WAAW,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;CAChD;AAED,8FAA8F;AAC9F,eAAO,MAAM,OAAO,GAAI,kDAIrB,YAAY,4DAgBd,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
4
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
5
|
+
* 2.0; you may not use this file except in compliance with the Elastic License
|
|
6
|
+
* 2.0.
|
|
7
|
+
*/
|
|
8
|
+
import { useId, useState } from 'react';
|
|
9
|
+
import { EuiPanel, EuiResizableContainer, useEuiTheme } from '@elastic/eui';
|
|
10
|
+
import { css } from '@emotion/react';
|
|
11
|
+
import { PrimitiveHeading } from '../chrome/primitive_heading.js';
|
|
12
|
+
import { useStudio } from '../studio_context.js';
|
|
13
|
+
import { EditorPanel, WorkbenchStatus } from './editor_panel.js';
|
|
14
|
+
import { PreviewPanel } from './preview_panel.js';
|
|
15
|
+
import { PropReference } from './prop_reference.js';
|
|
16
|
+
import { useEditor } from './use_editor.js';
|
|
17
|
+
const Workbench = ({ doc, example, stacked, onExampleChange, }) => {
|
|
18
|
+
const { euiTheme } = useEuiTheme();
|
|
19
|
+
const editor = useEditor(doc.examples[example]?.node ?? { type: doc.type });
|
|
20
|
+
const { composition, validation } = editor;
|
|
21
|
+
const [referenceOpen, setReferenceOpen] = useState(false);
|
|
22
|
+
const referenceId = useId();
|
|
23
|
+
return (_jsxs("div", { css: css `
|
|
24
|
+
height: 100%;
|
|
25
|
+
box-sizing: border-box;
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-direction: column;
|
|
28
|
+
padding: ${euiTheme.size.l};
|
|
29
|
+
`, children: [_jsx("div", { css: css `
|
|
30
|
+
margin-bottom: ${euiTheme.size.base};
|
|
31
|
+
`, children: _jsx(PrimitiveHeading, { doc, layout: "inline" }) }), _jsxs(EuiPanel, { role: "region", "aria-label": "Composition workbench", paddingSize: "none", css: css `
|
|
32
|
+
flex: 1;
|
|
33
|
+
min-height: 0;
|
|
34
|
+
display: flex;
|
|
35
|
+
flex-direction: column;
|
|
36
|
+
overflow: hidden;
|
|
37
|
+
`, children: [_jsx(EuiResizableContainer, { direction: stacked ? 'vertical' : 'horizontal', css: css `
|
|
38
|
+
flex: 1;
|
|
39
|
+
min-height: 0;
|
|
40
|
+
`, children: (Panel, Resizer) => (_jsxs(_Fragment, { children: [_jsx(Panel, { initialSize: 40, minSize: "360px", paddingSize: "none", color: "transparent", children: _jsx(EditorPanel, { doc, example, editor, onExampleChange }) }), _jsx(Resizer, { indicator: "border" }), _jsx(Panel, { initialSize: 60, minSize: "0px", paddingSize: "none", color: "transparent", children: _jsx(PreviewPanel, { composition, validation, supported: doc.surfaces }) })] })) }), _jsxs("div", { css: css `
|
|
41
|
+
flex: 0 1 auto;
|
|
42
|
+
min-height: 0;
|
|
43
|
+
max-height: 40%;
|
|
44
|
+
display: flex;
|
|
45
|
+
flex-direction: column;
|
|
46
|
+
overflow: hidden;
|
|
47
|
+
border-top: ${euiTheme.border.thin};
|
|
48
|
+
`, children: [_jsx("div", { css: css `
|
|
49
|
+
flex: 0 1 auto;
|
|
50
|
+
min-height: 0;
|
|
51
|
+
display: flex;
|
|
52
|
+
flex-direction: column;
|
|
53
|
+
padding: ${euiTheme.size.s} ${euiTheme.size.base};
|
|
54
|
+
`, children: _jsx(WorkbenchStatus, { editor, referenceOpen, referenceId, onToggleReference: () => setReferenceOpen((open) => !open) }) }), referenceOpen ? (_jsx(PropReference, { doc, nodes: editor.nodes, id: referenceId })) : null] })] })] }));
|
|
55
|
+
};
|
|
56
|
+
/** The workbench: edit one example beside the previews, or above them when space is tight. */
|
|
57
|
+
export const DevView = ({ route: { page, example }, stacked, navigate, }) => {
|
|
58
|
+
const { docs: { primitives }, } = useStudio();
|
|
59
|
+
const doc = primitives.find(({ type }) => type === page);
|
|
60
|
+
if (!doc) {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
return (_jsx(Workbench, { doc, example, stacked, onExampleChange: (next) => navigate({ example: next }) }, `${page}/${example}`));
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=dev_view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev_view.js","sourceRoot":"","sources":["../../src/dev/dev_view.tsx"],"names":[],"mappings":";AAAA;;;;;GAKG;AAEH,OAAc,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,qBAAqB,EAAE,WAAW,E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8FAA8F;AAC9F,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,EACtB,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EACxB,OAAO,EACP,QAAQ,GACK,EAAE,EAAE;IACjB,MAAM,EACJ,IAAI,EAAE,EAAE,UAAU,EAAE,GACrB,GAAG,SAAS,EAAE,CAAC;IAChB,MAAM,GAAG,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;IACzD,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CACL,KAAC,SAAS,IAEF,GAAG,EAAE,OAAO,EAAE,OAAO,EAC3B,eAAe,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,IAFjD,GAAG,IAAI,IAAI,OAAO,EAAE,CAGzB,CACH,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*\n * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one\n * or more contributor license agreements. Licensed under the Elastic License\n * 2.0; you may not use this file except in compliance with the Elastic License\n * 2.0.\n */\n\nimport React, { useId, useState } from 'react';\nimport { EuiPanel, EuiResizableContainer, useEuiTheme } from '@elastic/eui';\nimport { css } from '@emotion/react';\n\nimport { PrimitiveHeading } from '../chrome/primitive_heading';\nimport type { StudioRoute } from '../chrome/route';\nimport type { PrimitiveDoc } from '../model/describe_runtime';\nimport { useStudio } from '../studio_context';\n\nimport { EditorPanel, WorkbenchStatus } from './editor_panel';\nimport { PreviewPanel } from './preview_panel';\nimport { PropReference } from './prop_reference';\nimport { useEditor } from './use_editor';\n\nconst Workbench = ({\n doc,\n example,\n stacked,\n onExampleChange,\n}: {\n doc: PrimitiveDoc;\n example: number;\n stacked: boolean;\n onExampleChange: (example: number) => void;\n}) => {\n const { euiTheme } = useEuiTheme();\n const editor = useEditor(doc.examples[example]?.node ?? { type: doc.type });\n const { composition, validation } = editor;\n const [referenceOpen, setReferenceOpen] = useState(false);\n const referenceId = useId();\n\n return (\n <div\n css={css`\n height: 100%;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n padding: ${euiTheme.size.l};\n `}>\n <div\n css={css`\n margin-bottom: ${euiTheme.size.base};\n `}>\n <PrimitiveHeading {...{ doc }} layout=\"inline\" />\n </div>\n <EuiPanel\n role=\"region\"\n aria-label=\"Composition workbench\"\n paddingSize=\"none\"\n css={css`\n flex: 1;\n min-height: 0;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n `}>\n <EuiResizableContainer\n direction={stacked ? 'vertical' : 'horizontal'}\n css={css`\n flex: 1;\n min-height: 0;\n `}>\n {(Panel, Resizer) => (\n <>\n <Panel\n initialSize={40}\n minSize=\"360px\"\n paddingSize=\"none\"\n color=\"transparent\">\n <EditorPanel {...{ doc, example, editor, onExampleChange }} />\n </Panel>\n <Resizer indicator=\"border\" />\n <Panel\n initialSize={60}\n minSize=\"0px\"\n paddingSize=\"none\"\n color=\"transparent\">\n <PreviewPanel\n {...{ composition, validation }}\n supported={doc.surfaces}\n />\n </Panel>\n </>\n )}\n </EuiResizableContainer>\n <div\n css={css`\n flex: 0 1 auto;\n min-height: 0;\n max-height: 40%;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n border-top: ${euiTheme.border.thin};\n `}>\n <div\n css={css`\n flex: 0 1 auto;\n min-height: 0;\n display: flex;\n flex-direction: column;\n padding: ${euiTheme.size.s} ${euiTheme.size.base};\n `}>\n <WorkbenchStatus\n {...{ editor, referenceOpen, referenceId }}\n onToggleReference={() => setReferenceOpen((open) => !open)}\n />\n </div>\n {referenceOpen ? (\n <PropReference {...{ doc }} nodes={editor.nodes} id={referenceId} />\n ) : null}\n </div>\n </EuiPanel>\n </div>\n );\n};\n\nexport interface DevViewProps {\n route: StudioRoute;\n stacked: boolean;\n navigate: (next: Partial<StudioRoute>) => void;\n}\n\n/** The workbench: edit one example beside the previews, or above them when space is tight. */\nexport const DevView = ({\n route: { page, example },\n stacked,\n navigate,\n}: DevViewProps) => {\n const {\n docs: { primitives },\n } = useStudio();\n const doc = primitives.find(({ type }) => type === page);\n if (!doc) {\n return null;\n }\n\n return (\n <Workbench\n key={`${page}/${example}`}\n {...{ doc, example, stacked }}\n onExampleChange={(next) => navigate({ example: next })}\n />\n );\n};\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { PrimitiveDoc } from '../model/describe_runtime.js';
|
|
2
|
+
import type { EditorState } from './use_editor.js';
|
|
3
|
+
export declare const WorkbenchStatus: ({ editor: { parseError, isParsing, validation, format }, referenceOpen, referenceId, onToggleReference, }: {
|
|
4
|
+
editor: EditorState;
|
|
5
|
+
referenceOpen: boolean;
|
|
6
|
+
referenceId: string;
|
|
7
|
+
onToggleReference: () => void;
|
|
8
|
+
}) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
9
|
+
export interface EditorPanelProps {
|
|
10
|
+
doc: PrimitiveDoc;
|
|
11
|
+
example: number;
|
|
12
|
+
editor: EditorState;
|
|
13
|
+
onExampleChange: (example: number) => void;
|
|
14
|
+
}
|
|
15
|
+
/** The example picker and source editor above the shared workbench status. */
|
|
16
|
+
export declare const EditorPanel: ({ doc, example, editor, onExampleChange, }: EditorPanelProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
17
|
+
//# sourceMappingURL=editor_panel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor_panel.d.ts","sourceRoot":"","sources":["../../src/dev/editor_panel.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAK9D,OAAO,KAAK,EAAgB,WAAW,EAAE,MAAM,cAAc,CAAC;AAK9D,eAAO,MAAM,eAAe,GAAI,2GAK7B;IACD,MAAM,EAAE,WAAW,CAAC;IACpB,aAAa,EAAE,OAAO,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,IAAI,CAAC;CAC/B,qDAqEA,CAAC;AAEF,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,YAAY,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,WAAW,CAAC;IACpB,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAC5C;AAED,8EAA8E;AAC9E,eAAO,MAAM,WAAW,GAAI,4CAKzB,gBAAgB,qDAoFlB,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { EuiButton, EuiButtonEmpty, EuiButtonGroup, EuiButtonIcon, EuiCopy, EuiFlexGroup, EuiFlexItem, EuiHealth, EuiText, EuiToolTip, useEuiTheme, } from '@elastic/eui';
|
|
3
|
+
import { formatValidationError } from '@elastic/isomer-sdk';
|
|
4
|
+
import { css } from '@emotion/react';
|
|
5
|
+
import { useStudio } from '../studio_context.js';
|
|
6
|
+
import { ExamplePicker } from '../surfaces/example_picker.js';
|
|
7
|
+
import { CodeEditor } from './code_editor.js';
|
|
8
|
+
const isFormat = (id) => id === 'jsx' || id === 'json';
|
|
9
|
+
export const WorkbenchStatus = ({ editor: { parseError, isParsing, validation, format }, referenceOpen, referenceId, onToggleReference, }) => {
|
|
10
|
+
const { errors } = validation;
|
|
11
|
+
const health = parseError
|
|
12
|
+
? { color: 'danger', label: format === 'jsx' ? 'JSX error' : 'JSON error' }
|
|
13
|
+
: isParsing
|
|
14
|
+
? { color: 'subdued', label: 'Checking…' }
|
|
15
|
+
: errors.length
|
|
16
|
+
? {
|
|
17
|
+
color: 'danger',
|
|
18
|
+
label: `Invalid · ${errors.length} ${errors.length === 1 ? 'error' : 'errors'}`,
|
|
19
|
+
}
|
|
20
|
+
: { color: 'success', label: 'Valid' };
|
|
21
|
+
return (_jsxs(_Fragment, { children: [_jsxs(EuiFlexGroup, { gutterSize: "s", alignItems: "center", responsive: false, css: css `
|
|
22
|
+
flex: none;
|
|
23
|
+
`, children: [_jsx(EuiFlexItem, { grow: false, children: _jsx(EuiButtonEmpty, { size: "xs", color: "text", iconType: referenceOpen ? 'chevronSingleDown' : 'chevronSingleRight', "aria-expanded": referenceOpen, "aria-controls": referenceId, onClick: onToggleReference, children: "Props" }) }), _jsx(EuiFlexItem, {}), _jsx(EuiFlexItem, { grow: false, children: _jsx(EuiHealth, { color: health.color, textSize: "xs", children: health.label }) })] }), parseError || errors.length ? (_jsx(EuiText, { size: "xs", color: "danger", role: "region", tabIndex: 0, "aria-label": "Validation errors", css: css `
|
|
24
|
+
flex: 0 1 auto;
|
|
25
|
+
min-height: 0;
|
|
26
|
+
overflow-y: auto;
|
|
27
|
+
`, children: _jsx("ul", { children: parseError ? (_jsx("li", { children: parseError })) : (errors.map((error) => (_jsx("li", { children: formatValidationError(error) }, formatValidationError(error))))) }) })) : null] }));
|
|
28
|
+
};
|
|
29
|
+
/** The example picker and source editor above the shared workbench status. */
|
|
30
|
+
export const EditorPanel = ({ doc, example, editor, onExampleChange, }) => {
|
|
31
|
+
const { euiTheme } = useEuiTheme();
|
|
32
|
+
const { transformJsx } = useStudio();
|
|
33
|
+
const { label, examples } = doc;
|
|
34
|
+
const { format, setFormat, source, setSource } = editor;
|
|
35
|
+
const jsxButton = (_jsx(EuiButton, { id: "jsx", isDisabled: !transformJsx, hasAriaDisabled: true, children: "JSX" }));
|
|
36
|
+
return (_jsxs("div", { role: "region", "aria-label": "Source editor", css: css `
|
|
37
|
+
height: 100%;
|
|
38
|
+
display: flex;
|
|
39
|
+
flex-direction: column;
|
|
40
|
+
min-height: 0;
|
|
41
|
+
overflow: hidden;
|
|
42
|
+
|
|
43
|
+
@media (max-width: 1120px) {
|
|
44
|
+
width: 100%;
|
|
45
|
+
}
|
|
46
|
+
`, children: [_jsxs(EuiFlexGroup, { gutterSize: "s", alignItems: "center", responsive: false, css: css `
|
|
47
|
+
flex-grow: 0;
|
|
48
|
+
padding: ${euiTheme.size.s} ${euiTheme.size.base};
|
|
49
|
+
`, children: [_jsx(EuiFlexItem, { grow: false, children: _jsx(ExamplePicker, { examples, example, onChange: onExampleChange }) }), _jsx(EuiFlexItem, {}), _jsx(EuiFlexItem, { grow: false, children: _jsxs(EuiButtonGroup, { legend: "Source format", buttonSize: "s", variant: "selection", idSelected: format, display: "highlighted", onChange: (id) => isFormat(id) && setFormat(id), children: [transformJsx ? (jsxButton) : (_jsx(EuiToolTip, { content: "The host supplied no JSX transform.", children: jsxButton })), _jsx(EuiButton, { id: "json", children: "JSON" })] }) }), _jsx(EuiFlexItem, { grow: false, children: _jsx(EuiCopy, { textToCopy: source, children: (copy) => (_jsx(EuiToolTip, { content: format === 'jsx' ? 'Copy JSX' : 'Copy JSON', children: _jsx(EuiButtonIcon, { size: "s", color: "text", iconType: "copy", "aria-label": format === 'jsx' ? 'Copy JSX' : 'Copy JSON', onClick: copy }) })) }) })] }), _jsx(CodeEditor, { format, value: source, onChange: setSource, ariaLabel: `${label} source` })] }));
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=editor_panel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor_panel.js","sourceRoot":"","sources":["../../src/dev/editor_panel.tsx"],"names":[],"mappings":";AAQA,OAAO,EACL,SAAS,EACT,cAAc,EACd,cAAc,EACd,aAAa,EACb,OAAO,EACP,YAAY,EACZ,WAAW,EACX,SAAS,EACT,OAAO,EACP,UAAU,EACV,WAAW,GACZ,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAGrC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,C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,aAAa,IACZ,IAAI,EAAC,GAAG,EACR,KAAK,EAAC,MAAM,EACZ,QAAQ,EAAC,MAAM,gBACH,MAAM,KAAK,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,EACvD,OAAO,EAAE,IAAI,GACb,GACS,CACd,GACO,GACE,IACD,EACf,KAAC,UAAU,IACH,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,SAAS,EACnB,SAAS,EAAE,GAAG,KAAK,SAAS,GAC5B,IACE,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*\n * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one\n * or more contributor license agreements. Licensed under the Elastic License\n * 2.0; you may not use this file except in compliance with the Elastic License\n * 2.0.\n */\n\nimport React from 'react';\nimport {\n EuiButton,\n EuiButtonEmpty,\n EuiButtonGroup,\n EuiButtonIcon,\n EuiCopy,\n EuiFlexGroup,\n EuiFlexItem,\n EuiHealth,\n EuiText,\n EuiToolTip,\n useEuiTheme,\n} from '@elastic/eui';\nimport { formatValidationError } from '@elastic/isomer-sdk';\nimport { css } from '@emotion/react';\n\nimport type { PrimitiveDoc } from '../model/describe_runtime';\nimport { useStudio } from '../studio_context';\nimport { ExamplePicker } from '../surfaces/example_picker';\n\nimport { CodeEditor } from './code_editor';\nimport type { EditorFormat, EditorState } from './use_editor';\n\nconst isFormat = (id: string): id is EditorFormat =>\n id === 'jsx' || id === 'json';\n\nexport const WorkbenchStatus = ({\n editor: { parseError, isParsing, validation, format },\n referenceOpen,\n referenceId,\n onToggleReference,\n}: {\n editor: EditorState;\n referenceOpen: boolean;\n referenceId: string;\n onToggleReference: () => void;\n}) => {\n const { errors } = validation;\n const health = parseError\n ? { color: 'danger', label: format === 'jsx' ? 'JSX error' : 'JSON error' }\n : isParsing\n ? { color: 'subdued', label: 'Checking…' }\n : errors.length\n ? {\n color: 'danger',\n label: `Invalid · ${errors.length} ${errors.length === 1 ? 'error' : 'errors'}`,\n }\n : { color: 'success', label: 'Valid' };\n\n return (\n <>\n <EuiFlexGroup\n gutterSize=\"s\"\n alignItems=\"center\"\n responsive={false}\n css={css`\n flex: none;\n `}>\n <EuiFlexItem grow={false}>\n <EuiButtonEmpty\n size=\"xs\"\n color=\"text\"\n iconType={\n referenceOpen ? 'chevronSingleDown' : 'chevronSingleRight'\n }\n aria-expanded={referenceOpen}\n aria-controls={referenceId}\n onClick={onToggleReference}>\n Props\n </EuiButtonEmpty>\n </EuiFlexItem>\n <EuiFlexItem />\n <EuiFlexItem grow={false}>\n <EuiHealth color={health.color} textSize=\"xs\">\n {health.label}\n </EuiHealth>\n </EuiFlexItem>\n </EuiFlexGroup>\n {parseError || errors.length ? (\n <EuiText\n size=\"xs\"\n color=\"danger\"\n role=\"region\"\n tabIndex={0}\n aria-label=\"Validation errors\"\n css={css`\n flex: 0 1 auto;\n min-height: 0;\n overflow-y: auto;\n `}>\n <ul>\n {parseError ? (\n <li>{parseError}</li>\n ) : (\n errors.map((error) => (\n <li key={formatValidationError(error)}>\n {formatValidationError(error)}\n </li>\n ))\n )}\n </ul>\n </EuiText>\n ) : null}\n </>\n );\n};\n\nexport interface EditorPanelProps {\n doc: PrimitiveDoc;\n example: number;\n editor: EditorState;\n onExampleChange: (example: number) => void;\n}\n\n/** The example picker and source editor above the shared workbench status. */\nexport const EditorPanel = ({\n doc,\n example,\n editor,\n onExampleChange,\n}: EditorPanelProps) => {\n const { euiTheme } = useEuiTheme();\n const { transformJsx } = useStudio();\n const { label, examples } = doc;\n const { format, setFormat, source, setSource } = editor;\n\n const jsxButton = (\n <EuiButton id=\"jsx\" isDisabled={!transformJsx} hasAriaDisabled>\n JSX\n </EuiButton>\n );\n\n return (\n <div\n role=\"region\"\n aria-label=\"Source editor\"\n css={css`\n height: 100%;\n display: flex;\n flex-direction: column;\n min-height: 0;\n overflow: hidden;\n\n @media (max-width: 1120px) {\n width: 100%;\n }\n `}>\n <EuiFlexGroup\n gutterSize=\"s\"\n alignItems=\"center\"\n responsive={false}\n css={css`\n flex-grow: 0;\n padding: ${euiTheme.size.s} ${euiTheme.size.base};\n `}>\n <EuiFlexItem grow={false}>\n <ExamplePicker\n {...{ examples, example }}\n onChange={onExampleChange}\n />\n </EuiFlexItem>\n <EuiFlexItem />\n <EuiFlexItem grow={false}>\n <EuiButtonGroup\n legend=\"Source format\"\n buttonSize=\"s\"\n variant=\"selection\"\n idSelected={format}\n display=\"highlighted\"\n onChange={(id) => isFormat(id) && setFormat(id)}>\n {transformJsx ? (\n jsxButton\n ) : (\n <EuiToolTip content=\"The host supplied no JSX transform.\">\n {jsxButton}\n </EuiToolTip>\n )}\n <EuiButton id=\"json\">JSON</EuiButton>\n </EuiButtonGroup>\n </EuiFlexItem>\n <EuiFlexItem grow={false}>\n <EuiCopy textToCopy={source}>\n {(copy) => (\n <EuiToolTip content={format === 'jsx' ? 'Copy JSX' : 'Copy JSON'}>\n <EuiButtonIcon\n size=\"s\"\n color=\"text\"\n iconType=\"copy\"\n aria-label={format === 'jsx' ? 'Copy JSX' : 'Copy JSON'}\n onClick={copy}\n />\n </EuiToolTip>\n )}\n </EuiCopy>\n </EuiFlexItem>\n </EuiFlexGroup>\n <CodeEditor\n {...{ format }}\n value={source}\n onChange={setSource}\n ariaLabel={`${label} source`}\n />\n </div>\n );\n};\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import 'monaco-editor/esm/vs/editor/edcore.main';
|
|
2
|
+
import 'monaco-editor/esm/vs/language/json/monaco.contribution';
|
|
3
|
+
import 'monaco-editor/esm/vs/language/typescript/monaco.contribution';
|
|
4
|
+
import type { AuthoringTypes } from '../model/authoring_types.js';
|
|
5
|
+
import type { EditorFormat } from './use_editor.js';
|
|
6
|
+
export interface MonacoEditorProps {
|
|
7
|
+
format: EditorFormat;
|
|
8
|
+
value: string;
|
|
9
|
+
onChange: (value: string) => void;
|
|
10
|
+
ariaLabel: string;
|
|
11
|
+
authoring: AuthoringTypes;
|
|
12
|
+
}
|
|
13
|
+
/** Monaco on this runtime's types: TypeScript checks JSX, the Composition schema checks JSON. */
|
|
14
|
+
export declare const MonacoEditor: ({ format, value, onChange, ariaLabel, authoring, }: MonacoEditorProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
15
|
+
//# sourceMappingURL=monaco_editor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"monaco_editor.d.ts","sourceRoot":"","sources":["../../src/dev/monaco_editor.tsx"],"names":[],"mappings":"AAOA,OAAO,yCAAyC,CAAC;AACjD,OAAO,wDAAwD,CAAC;AAChE,OAAO,8DAA8D,CAAC;AAOtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAI/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAIjD,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,YAAY,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,cAAc,CAAC;CAC3B;AAuDD,iGAAiG;AACjG,eAAO,MAAM,YAAY,GAAI,oDAM1B,iBAAiB,qDAwHnB,CAAC"}
|