@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.
Files changed (406) hide show
  1. package/LICENSE.txt +93 -0
  2. package/NOTICE.txt +17329 -0
  3. package/README.md +64 -0
  4. package/THIRD_PARTY_LICENSES.md +404 -0
  5. package/bin/isomer-studio.js +10 -0
  6. package/dist/app/assets/codicon-5T574S7B.ttf +0 -0
  7. package/dist/app/assets/editor.worker.js +11 -0
  8. package/dist/app/assets/esbuild.wasm +0 -0
  9. package/dist/app/assets/json.worker.js +47 -0
  10. package/dist/app/assets/slack.css +1 -0
  11. package/dist/app/assets/studio.css +11 -0
  12. package/dist/app/assets/ts.worker.js +37029 -0
  13. package/dist/app/index.html +16 -0
  14. package/dist/apps/app_host.d.ts +8 -0
  15. package/dist/apps/app_host.d.ts.map +1 -0
  16. package/dist/apps/app_host.js +73 -0
  17. package/dist/apps/app_host.js.map +1 -0
  18. package/dist/browser/dev_host.d.ts +5 -0
  19. package/dist/browser/dev_host.d.ts.map +1 -0
  20. package/dist/browser/dev_host.js +46 -0
  21. package/dist/browser/dev_host.js.map +1 -0
  22. package/dist/browser/mount.d.ts +16 -0
  23. package/dist/browser/mount.d.ts.map +1 -0
  24. package/dist/browser/mount.js +37 -0
  25. package/dist/browser/mount.js.map +1 -0
  26. package/dist/browser/static_host.d.ts +5 -0
  27. package/dist/browser/static_host.d.ts.map +1 -0
  28. package/dist/browser/static_host.js +55 -0
  29. package/dist/browser/static_host.js.map +1 -0
  30. package/dist/chrome/accent.d.ts +14 -0
  31. package/dist/chrome/accent.d.ts.map +1 -0
  32. package/dist/chrome/accent.js +31 -0
  33. package/dist/chrome/accent.js.map +1 -0
  34. package/dist/chrome/app_pages.d.ts +13 -0
  35. package/dist/chrome/app_pages.d.ts.map +1 -0
  36. package/dist/chrome/app_pages.js +33 -0
  37. package/dist/chrome/app_pages.js.map +1 -0
  38. package/dist/chrome/color_mode.d.ts +10 -0
  39. package/dist/chrome/color_mode.d.ts.map +1 -0
  40. package/dist/chrome/color_mode.js +45 -0
  41. package/dist/chrome/color_mode.js.map +1 -0
  42. package/dist/chrome/dev_tint.d.ts +7 -0
  43. package/dist/chrome/dev_tint.d.ts.map +1 -0
  44. package/dist/chrome/dev_tint.js +31 -0
  45. package/dist/chrome/dev_tint.js.map +1 -0
  46. package/dist/chrome/header.d.ts +20 -0
  47. package/dist/chrome/header.d.ts.map +1 -0
  48. package/dist/chrome/header.js +124 -0
  49. package/dist/chrome/header.js.map +1 -0
  50. package/dist/chrome/icon_data_uri.d.ts +12 -0
  51. package/dist/chrome/icon_data_uri.d.ts.map +1 -0
  52. package/dist/chrome/icon_data_uri.js +21 -0
  53. package/dist/chrome/icon_data_uri.js.map +1 -0
  54. package/dist/chrome/isomer_mark.d.ts +17 -0
  55. package/dist/chrome/isomer_mark.d.ts.map +1 -0
  56. package/dist/chrome/isomer_mark.js +46 -0
  57. package/dist/chrome/isomer_mark.js.map +1 -0
  58. package/dist/chrome/nav.d.ts +22 -0
  59. package/dist/chrome/nav.d.ts.map +1 -0
  60. package/dist/chrome/nav.js +306 -0
  61. package/dist/chrome/nav.js.map +1 -0
  62. package/dist/chrome/nav_groups.d.ts +6 -0
  63. package/dist/chrome/nav_groups.d.ts.map +1 -0
  64. package/dist/chrome/nav_groups.js +48 -0
  65. package/dist/chrome/nav_groups.js.map +1 -0
  66. package/dist/chrome/nav_sections.d.ts +29 -0
  67. package/dist/chrome/nav_sections.d.ts.map +1 -0
  68. package/dist/chrome/nav_sections.js +55 -0
  69. package/dist/chrome/nav_sections.js.map +1 -0
  70. package/dist/chrome/oklch.d.ts +10 -0
  71. package/dist/chrome/oklch.d.ts.map +1 -0
  72. package/dist/chrome/oklch.js +61 -0
  73. package/dist/chrome/oklch.js.map +1 -0
  74. package/dist/chrome/primitive_glyph.d.ts +14 -0
  75. package/dist/chrome/primitive_glyph.d.ts.map +1 -0
  76. package/dist/chrome/primitive_glyph.js +48 -0
  77. package/dist/chrome/primitive_glyph.js.map +1 -0
  78. package/dist/chrome/primitive_heading.d.ts +14 -0
  79. package/dist/chrome/primitive_heading.d.ts.map +1 -0
  80. package/dist/chrome/primitive_heading.js +32 -0
  81. package/dist/chrome/primitive_heading.js.map +1 -0
  82. package/dist/chrome/primitive_peek.d.ts +8 -0
  83. package/dist/chrome/primitive_peek.d.ts.map +1 -0
  84. package/dist/chrome/primitive_peek.js +51 -0
  85. package/dist/chrome/primitive_peek.js.map +1 -0
  86. package/dist/chrome/primitive_search.d.ts +9 -0
  87. package/dist/chrome/primitive_search.d.ts.map +1 -0
  88. package/dist/chrome/primitive_search.js +93 -0
  89. package/dist/chrome/primitive_search.js.map +1 -0
  90. package/dist/chrome/route.d.ts +48 -0
  91. package/dist/chrome/route.d.ts.map +1 -0
  92. package/dist/chrome/route.js +136 -0
  93. package/dist/chrome/route.js.map +1 -0
  94. package/dist/cli/args.d.ts +39 -0
  95. package/dist/cli/args.d.ts.map +1 -0
  96. package/dist/cli/args.js +171 -0
  97. package/dist/cli/args.js.map +1 -0
  98. package/dist/cli/run.d.ts +15 -0
  99. package/dist/cli/run.d.ts.map +1 -0
  100. package/dist/cli/run.js +113 -0
  101. package/dist/cli/run.js.map +1 -0
  102. package/dist/cli.d.ts +2 -0
  103. package/dist/cli.d.ts.map +1 -0
  104. package/dist/cli.js +22 -0
  105. package/dist/cli.js.map +1 -0
  106. package/dist/config.d.ts +118 -0
  107. package/dist/config.d.ts.map +1 -0
  108. package/dist/config.js +11 -0
  109. package/dist/config.js.map +1 -0
  110. package/dist/dev/code_editor.d.ts +10 -0
  111. package/dist/dev/code_editor.d.ts.map +1 -0
  112. package/dist/dev/code_editor.js +22 -0
  113. package/dist/dev/code_editor.js.map +1 -0
  114. package/dist/dev/dev_view.d.ts +9 -0
  115. package/dist/dev/dev_view.d.ts.map +1 -0
  116. package/dist/dev/dev_view.js +65 -0
  117. package/dist/dev/dev_view.js.map +1 -0
  118. package/dist/dev/editor_panel.d.ts +17 -0
  119. package/dist/dev/editor_panel.d.ts.map +1 -0
  120. package/dist/dev/editor_panel.js +51 -0
  121. package/dist/dev/editor_panel.js.map +1 -0
  122. package/dist/dev/monaco_editor.d.ts +15 -0
  123. package/dist/dev/monaco_editor.d.ts.map +1 -0
  124. package/dist/dev/monaco_editor.js +159 -0
  125. package/dist/dev/monaco_editor.js.map +1 -0
  126. package/dist/dev/preview_panel.d.ts +10 -0
  127. package/dist/dev/preview_panel.d.ts.map +1 -0
  128. package/dist/dev/preview_panel.js +45 -0
  129. package/dist/dev/preview_panel.js.map +1 -0
  130. package/dist/dev/prop_reference.d.ts +9 -0
  131. package/dist/dev/prop_reference.d.ts.map +1 -0
  132. package/dist/dev/prop_reference.js +134 -0
  133. package/dist/dev/prop_reference.js.map +1 -0
  134. package/dist/dev/tsx_language.d.ts +10 -0
  135. package/dist/dev/tsx_language.d.ts.map +1 -0
  136. package/dist/dev/tsx_language.js +283 -0
  137. package/dist/dev/tsx_language.js.map +1 -0
  138. package/dist/dev/use_editor.d.ts +23 -0
  139. package/dist/dev/use_editor.d.ts.map +1 -0
  140. package/dist/dev/use_editor.js +124 -0
  141. package/dist/dev/use_editor.js.map +1 -0
  142. package/dist/docs/docs_view.d.ts +10 -0
  143. package/dist/docs/docs_view.d.ts.map +1 -0
  144. package/dist/docs/docs_view.js +80 -0
  145. package/dist/docs/docs_view.js.map +1 -0
  146. package/dist/docs/example_source.d.ts +7 -0
  147. package/dist/docs/example_source.d.ts.map +1 -0
  148. package/dist/docs/example_source.js +56 -0
  149. package/dist/docs/example_source.js.map +1 -0
  150. package/dist/docs/examples_panel.d.ts +10 -0
  151. package/dist/docs/examples_panel.d.ts.map +1 -0
  152. package/dist/docs/examples_panel.js +51 -0
  153. package/dist/docs/examples_panel.js.map +1 -0
  154. package/dist/docs/gallery_view.d.ts +9 -0
  155. package/dist/docs/gallery_view.d.ts.map +1 -0
  156. package/dist/docs/gallery_view.js +98 -0
  157. package/dist/docs/gallery_view.js.map +1 -0
  158. package/dist/docs/inline_code.d.ts +11 -0
  159. package/dist/docs/inline_code.d.ts.map +1 -0
  160. package/dist/docs/inline_code.js +24 -0
  161. package/dist/docs/inline_code.js.map +1 -0
  162. package/dist/docs/on_this_page.d.ts +17 -0
  163. package/dist/docs/on_this_page.d.ts.map +1 -0
  164. package/dist/docs/on_this_page.js +77 -0
  165. package/dist/docs/on_this_page.js.map +1 -0
  166. package/dist/docs/props_table.d.ts +14 -0
  167. package/dist/docs/props_table.d.ts.map +1 -0
  168. package/dist/docs/props_table.js +34 -0
  169. package/dist/docs/props_table.js.map +1 -0
  170. package/dist/home/apps_section.d.ts +6 -0
  171. package/dist/home/apps_section.d.ts.map +1 -0
  172. package/dist/home/apps_section.js +44 -0
  173. package/dist/home/apps_section.js.map +1 -0
  174. package/dist/home/featured_strip.d.ts +12 -0
  175. package/dist/home/featured_strip.d.ts.map +1 -0
  176. package/dist/home/featured_strip.js +176 -0
  177. package/dist/home/featured_strip.js.map +1 -0
  178. package/dist/home/home_view.d.ts +11 -0
  179. package/dist/home/home_view.d.ts.map +1 -0
  180. package/dist/home/home_view.js +261 -0
  181. package/dist/home/home_view.js.map +1 -0
  182. package/dist/home/links.d.ts +8 -0
  183. package/dist/home/links.d.ts.map +1 -0
  184. package/dist/home/links.js +14 -0
  185. package/dist/home/links.js.map +1 -0
  186. package/dist/home/loaded_panel.d.ts +6 -0
  187. package/dist/home/loaded_panel.d.ts.map +1 -0
  188. package/dist/home/loaded_panel.js +116 -0
  189. package/dist/home/loaded_panel.js.map +1 -0
  190. package/dist/home/surface_chart.d.ts +6 -0
  191. package/dist/home/surface_chart.d.ts.map +1 -0
  192. package/dist/home/surface_chart.js +263 -0
  193. package/dist/home/surface_chart.js.map +1 -0
  194. package/dist/home/tokens.d.ts +49 -0
  195. package/dist/home/tokens.d.ts.map +1 -0
  196. package/dist/home/tokens.js +171 -0
  197. package/dist/home/tokens.js.map +1 -0
  198. package/dist/index.d.ts +6 -0
  199. package/dist/index.d.ts.map +1 -0
  200. package/dist/index.js +9 -0
  201. package/dist/index.js.map +1 -0
  202. package/dist/model/app_problems.d.ts +4 -0
  203. package/dist/model/app_problems.d.ts.map +1 -0
  204. package/dist/model/app_problems.js +90 -0
  205. package/dist/model/app_problems.js.map +1 -0
  206. package/dist/model/authoring_types.d.ts +23 -0
  207. package/dist/model/authoring_types.d.ts.map +1 -0
  208. package/dist/model/authoring_types.js +35 -0
  209. package/dist/model/authoring_types.js.map +1 -0
  210. package/dist/model/compile_jsx.d.ts +19 -0
  211. package/dist/model/compile_jsx.d.ts.map +1 -0
  212. package/dist/model/compile_jsx.js +55 -0
  213. package/dist/model/compile_jsx.js.map +1 -0
  214. package/dist/model/compose_example.d.ts +9 -0
  215. package/dist/model/compose_example.d.ts.map +1 -0
  216. package/dist/model/compose_example.js +24 -0
  217. package/dist/model/compose_example.js.map +1 -0
  218. package/dist/model/composition_key.d.ts +6 -0
  219. package/dist/model/composition_key.d.ts.map +1 -0
  220. package/dist/model/composition_key.js +26 -0
  221. package/dist/model/composition_key.js.map +1 -0
  222. package/dist/model/describe_runtime.d.ts +33 -0
  223. package/dist/model/describe_runtime.d.ts.map +1 -0
  224. package/dist/model/describe_runtime.js +77 -0
  225. package/dist/model/describe_runtime.js.map +1 -0
  226. package/dist/model/featured.d.ts +11 -0
  227. package/dist/model/featured.d.ts.map +1 -0
  228. package/dist/model/featured.js +70 -0
  229. package/dist/model/featured.js.map +1 -0
  230. package/dist/model/jsx_transform.d.ts +10 -0
  231. package/dist/model/jsx_transform.d.ts.map +1 -0
  232. package/dist/model/jsx_transform.js +31 -0
  233. package/dist/model/jsx_transform.js.map +1 -0
  234. package/dist/model/png_manifest.d.ts +23 -0
  235. package/dist/model/png_manifest.d.ts.map +1 -0
  236. package/dist/model/png_manifest.js +26 -0
  237. package/dist/model/png_manifest.js.map +1 -0
  238. package/dist/model/read_examples.d.ts +12 -0
  239. package/dist/model/read_examples.d.ts.map +1 -0
  240. package/dist/model/read_examples.js +43 -0
  241. package/dist/model/read_examples.js.map +1 -0
  242. package/dist/model/search.d.ts +4 -0
  243. package/dist/model/search.d.ts.map +1 -0
  244. package/dist/model/search.js +29 -0
  245. package/dist/model/search.js.map +1 -0
  246. package/dist/model/sha256.d.ts +3 -0
  247. package/dist/model/sha256.d.ts.map +1 -0
  248. package/dist/model/sha256.js +72 -0
  249. package/dist/model/sha256.js.map +1 -0
  250. package/dist/model/slack_limits.d.ts +9 -0
  251. package/dist/model/slack_limits.d.ts.map +1 -0
  252. package/dist/model/slack_limits.js +213 -0
  253. package/dist/model/slack_limits.js.map +1 -0
  254. package/dist/node/app_bundle.d.ts +45 -0
  255. package/dist/node/app_bundle.d.ts.map +1 -0
  256. package/dist/node/app_bundle.js +212 -0
  257. package/dist/node/app_bundle.js.map +1 -0
  258. package/dist/node/build_site.d.ts +28 -0
  259. package/dist/node/build_site.d.ts.map +1 -0
  260. package/dist/node/build_site.js +90 -0
  261. package/dist/node/build_site.js.map +1 -0
  262. package/dist/node/check.d.ts +40 -0
  263. package/dist/node/check.d.ts.map +1 -0
  264. package/dist/node/check.js +162 -0
  265. package/dist/node/check.js.map +1 -0
  266. package/dist/node/dev_bundle.d.ts +21 -0
  267. package/dist/node/dev_bundle.d.ts.map +1 -0
  268. package/dist/node/dev_bundle.js +121 -0
  269. package/dist/node/dev_bundle.js.map +1 -0
  270. package/dist/node/dev_server.d.ts +16 -0
  271. package/dist/node/dev_server.d.ts.map +1 -0
  272. package/dist/node/dev_server.js +291 -0
  273. package/dist/node/dev_server.js.map +1 -0
  274. package/dist/node/init_config.d.ts +30 -0
  275. package/dist/node/init_config.d.ts.map +1 -0
  276. package/dist/node/init_config.js +158 -0
  277. package/dist/node/init_config.js.map +1 -0
  278. package/dist/node/load_config.d.ts +34 -0
  279. package/dist/node/load_config.d.ts.map +1 -0
  280. package/dist/node/load_config.js +246 -0
  281. package/dist/node/load_config.js.map +1 -0
  282. package/dist/node/project_resolution.d.ts +17 -0
  283. package/dist/node/project_resolution.d.ts.map +1 -0
  284. package/dist/node/project_resolution.js +66 -0
  285. package/dist/node/project_resolution.js.map +1 -0
  286. package/dist/node/rasterize.d.ts +23 -0
  287. package/dist/node/rasterize.d.ts.map +1 -0
  288. package/dist/node/rasterize.js +79 -0
  289. package/dist/node/rasterize.js.map +1 -0
  290. package/dist/node/report.d.ts +8 -0
  291. package/dist/node/report.d.ts.map +1 -0
  292. package/dist/node/report.js +57 -0
  293. package/dist/node/report.js.map +1 -0
  294. package/dist/node/resolve_hooks.d.ts +16 -0
  295. package/dist/node/resolve_hooks.d.ts.map +1 -0
  296. package/dist/node/resolve_hooks.js +104 -0
  297. package/dist/node/resolve_hooks.js.map +1 -0
  298. package/dist/studio.d.ts +4 -0
  299. package/dist/studio.d.ts.map +1 -0
  300. package/dist/studio.js +188 -0
  301. package/dist/studio.js.map +1 -0
  302. package/dist/studio_context.d.ts +27 -0
  303. package/dist/studio_context.d.ts.map +1 -0
  304. package/dist/studio_context.js +17 -0
  305. package/dist/studio_context.js.map +1 -0
  306. package/dist/surfaces/adopt_stylesheet.d.ts +7 -0
  307. package/dist/surfaces/adopt_stylesheet.d.ts.map +1 -0
  308. package/dist/surfaces/adopt_stylesheet.js +64 -0
  309. package/dist/surfaces/adopt_stylesheet.js.map +1 -0
  310. package/dist/surfaces/app_preview.d.ts +4 -0
  311. package/dist/surfaces/app_preview.d.ts.map +1 -0
  312. package/dist/surfaces/app_preview.js +28 -0
  313. package/dist/surfaces/app_preview.js.map +1 -0
  314. package/dist/surfaces/app_surface.d.ts +9 -0
  315. package/dist/surfaces/app_surface.d.ts.map +1 -0
  316. package/dist/surfaces/app_surface.js +27 -0
  317. package/dist/surfaces/app_surface.js.map +1 -0
  318. package/dist/surfaces/applicable_enhancements.d.ts +4 -0
  319. package/dist/surfaces/applicable_enhancements.d.ts.map +1 -0
  320. package/dist/surfaces/applicable_enhancements.js +16 -0
  321. package/dist/surfaces/applicable_enhancements.js.map +1 -0
  322. package/dist/surfaces/enhancement_select.d.ts +10 -0
  323. package/dist/surfaces/enhancement_select.d.ts.map +1 -0
  324. package/dist/surfaces/enhancement_select.js +28 -0
  325. package/dist/surfaces/enhancement_select.js.map +1 -0
  326. package/dist/surfaces/example_picker.d.ts +11 -0
  327. package/dist/surfaces/example_picker.d.ts.map +1 -0
  328. package/dist/surfaces/example_picker.js +44 -0
  329. package/dist/surfaces/example_picker.js.map +1 -0
  330. package/dist/surfaces/format_source.d.ts +4 -0
  331. package/dist/surfaces/format_source.d.ts.map +1 -0
  332. package/dist/surfaces/format_source.js +30 -0
  333. package/dist/surfaces/format_source.js.map +1 -0
  334. package/dist/surfaces/html_surface.d.ts +14 -0
  335. package/dist/surfaces/html_surface.d.ts.map +1 -0
  336. package/dist/surfaces/html_surface.js +122 -0
  337. package/dist/surfaces/html_surface.js.map +1 -0
  338. package/dist/surfaces/png_surface.d.ts +13 -0
  339. package/dist/surfaces/png_surface.d.ts.map +1 -0
  340. package/dist/surfaces/png_surface.js +68 -0
  341. package/dist/surfaces/png_surface.js.map +1 -0
  342. package/dist/surfaces/react_surface.d.ts +11 -0
  343. package/dist/surfaces/react_surface.d.ts.map +1 -0
  344. package/dist/surfaces/react_surface.js +55 -0
  345. package/dist/surfaces/react_surface.js.map +1 -0
  346. package/dist/surfaces/render_output.d.ts +31 -0
  347. package/dist/surfaces/render_output.d.ts.map +1 -0
  348. package/dist/surfaces/render_output.js +119 -0
  349. package/dist/surfaces/render_output.js.map +1 -0
  350. package/dist/surfaces/scaled_preview.d.ts +17 -0
  351. package/dist/surfaces/scaled_preview.d.ts.map +1 -0
  352. package/dist/surfaces/scaled_preview.js +74 -0
  353. package/dist/surfaces/scaled_preview.js.map +1 -0
  354. package/dist/surfaces/shadow_root.d.ts +8 -0
  355. package/dist/surfaces/shadow_root.d.ts.map +1 -0
  356. package/dist/surfaces/shadow_root.js +41 -0
  357. package/dist/surfaces/shadow_root.js.map +1 -0
  358. package/dist/surfaces/slack_surface.d.ts +12 -0
  359. package/dist/surfaces/slack_surface.d.ts.map +1 -0
  360. package/dist/surfaces/slack_surface.js +27 -0
  361. package/dist/surfaces/slack_surface.js.map +1 -0
  362. package/dist/surfaces/snapshot_surface.d.ts +6 -0
  363. package/dist/surfaces/snapshot_surface.d.ts.map +1 -0
  364. package/dist/surfaces/snapshot_surface.js +5 -0
  365. package/dist/surfaces/snapshot_surface.js.map +1 -0
  366. package/dist/surfaces/surface_board.d.ts +19 -0
  367. package/dist/surfaces/surface_board.d.ts.map +1 -0
  368. package/dist/surfaces/surface_board.js +128 -0
  369. package/dist/surfaces/surface_board.js.map +1 -0
  370. package/dist/surfaces/surface_frame.d.ts +8 -0
  371. package/dist/surfaces/surface_frame.d.ts.map +1 -0
  372. package/dist/surfaces/surface_frame.js +4 -0
  373. package/dist/surfaces/surface_frame.js.map +1 -0
  374. package/dist/surfaces/surface_logos.d.ts +9 -0
  375. package/dist/surfaces/surface_logos.d.ts.map +1 -0
  376. package/dist/surfaces/surface_logos.js +21 -0
  377. package/dist/surfaces/surface_logos.js.map +1 -0
  378. package/dist/surfaces/surface_preview.d.ts +32 -0
  379. package/dist/surfaces/surface_preview.d.ts.map +1 -0
  380. package/dist/surfaces/surface_preview.js +66 -0
  381. package/dist/surfaces/surface_preview.js.map +1 -0
  382. package/dist/surfaces/surface_select.d.ts +34 -0
  383. package/dist/surfaces/surface_select.d.ts.map +1 -0
  384. package/dist/surfaces/surface_select.js +119 -0
  385. package/dist/surfaces/surface_select.js.map +1 -0
  386. package/dist/surfaces/text_surfaces.d.ts +14 -0
  387. package/dist/surfaces/text_surfaces.d.ts.map +1 -0
  388. package/dist/surfaces/text_surfaces.js +31 -0
  389. package/dist/surfaces/text_surfaces.js.map +1 -0
  390. package/dist/surfaces/zoom_select.d.ts +9 -0
  391. package/dist/surfaces/zoom_select.d.ts.map +1 -0
  392. package/dist/surfaces/zoom_select.js +32 -0
  393. package/dist/surfaces/zoom_select.js.map +1 -0
  394. package/dist/types.d.ts +32 -0
  395. package/dist/types.d.ts.map +1 -0
  396. package/dist/types.js +9 -0
  397. package/dist/types.js.map +1 -0
  398. package/docs/ci.md +55 -0
  399. package/docs/commands.md +167 -0
  400. package/docs/config.md +192 -0
  401. package/docs/images/home.png +0 -0
  402. package/docs/images/reference.png +0 -0
  403. package/docs/images/workbench.png +0 -0
  404. package/docs/index.md +96 -0
  405. package/docs/toc.yml +10 -0
  406. package/package.json +89 -5
@@ -0,0 +1,56 @@
1
+ import { jsx as _jsx, 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 { useMemo, useState } from 'react';
9
+ import { EuiButtonIcon, EuiCodeBlock, EuiCopy, EuiTab, EuiTabs, EuiThemeProvider, useEuiTheme, useGeneratedHtmlId, } from '@elastic/eui';
10
+ import { printNodeJsx } from '@elastic/isomer-sdk/author';
11
+ import { css } from '@emotion/react';
12
+ import { useStudio } from '../studio_context.js';
13
+ const FORMATS = ['jsx', 'json'];
14
+ const SOURCE_MAX_HEIGHT = 280;
15
+ const themeWrapper = {
16
+ css: css `
17
+ display: contents;
18
+ `,
19
+ };
20
+ const useExampleSource = (node) => {
21
+ const { schemaFor, shim } = useStudio();
22
+ return useMemo(() => ({
23
+ jsx: printNodeJsx(node, { schemaFor, shim }),
24
+ json: JSON.stringify(node, null, 2),
25
+ }), [node, schemaFor, shim]);
26
+ };
27
+ const SourcePanel = ({ format, source, onFormat, }) => {
28
+ const { euiTheme } = useEuiTheme();
29
+ const idPrefix = useGeneratedHtmlId({ prefix: 'exampleSource' });
30
+ const panelId = `${idPrefix}-panel`;
31
+ const tabId = (id) => `${idPrefix}-${id}`;
32
+ const text = source[format];
33
+ return (_jsxs("div", { css: css `
34
+ background: ${euiTheme.colors.backgroundBasePlain};
35
+ color: ${euiTheme.colors.text};
36
+ border-top: ${euiTheme.border.thin};
37
+ `, children: [_jsxs("div", { css: css `
38
+ display: flex;
39
+ align-items: center;
40
+ gap: ${euiTheme.size.s};
41
+ padding-inline: ${euiTheme.size.m};
42
+ border-bottom: ${euiTheme.border.thin};
43
+ `, children: [_jsx(EuiTabs, { size: "s", bottomBorder: false, "aria-label": "Example code format", css: css `
44
+ flex: 1;
45
+ `, children: FORMATS.map((id) => (_jsx(EuiTab, { id: tabId(id), isSelected: id === format, "aria-controls": panelId, onClick: () => onFormat(id), children: id.toUpperCase() }, id))) }), _jsx(EuiCopy, { textToCopy: text, children: (copy) => (_jsx(EuiButtonIcon, { iconType: "copy", "aria-label": format === 'jsx' ? 'Copy JSX' : 'Copy JSON', color: "text", onClick: copy })) })] }), _jsx("div", { role: "tabpanel", id: panelId, "aria-labelledby": tabId(format), css: css `
46
+ max-height: ${SOURCE_MAX_HEIGHT}px;
47
+ overflow: auto;
48
+ `, children: _jsx(EuiCodeBlock, { language: format, fontSize: "s", paddingSize: "m", transparentBackground: true, whiteSpace: "pre-wrap", children: text }) })] }));
49
+ };
50
+ /** The example node as JSX or JSON. */
51
+ export const ExampleSource = ({ node, isOpen, }) => {
52
+ const source = useExampleSource(node);
53
+ const [format, setFormat] = useState('jsx');
54
+ return (_jsx("div", { hidden: !isOpen, children: _jsx(EuiThemeProvider, { colorMode: "dark", wrapperProps: themeWrapper, children: _jsx(SourcePanel, { format, source, onFormat: setFormat }) }) }));
55
+ };
56
+ //# sourceMappingURL=example_source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"example_source.js","sourceRoot":"","sources":["../../src/docs/example_source.tsx"],"names":[],"mappings":";AAAA;;;;;GAKG;AAEH,OAAc,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EACL,aAAa,EACb,YAAY,EACZ,OAAO,EACP,MAAM,EACN,OAAO,EACP,gBAAgB,EAChB,WAAW,EACX,kBAAkB,GACnB,MAAM,cAAc,CAA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C,CAAC;AAEF,uCAAuC;AACvC,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAC5B,IAAI,EACJ,MAAM,GAIP,EAAE,EAAE;IACH,MAAM,MAAM,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACtC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAe,KAAK,CAAC,CAAC;IAE1D,OAAO,CACL,cAAK,MAAM,EAAE,CAAC,MAAM,YAClB,KAAC,gBAAgB,IAAC,SAAS,EAAC,MAAM,EAAC,YAAY,EAAE,YAAY,YAC3D,KAAC,WAAW,IAAO,MAAM,EAAE,MAAM,EAAI,QAAQ,EAAE,SAAS,GAAI,GAC3C,GACf,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, { useMemo, useState } from 'react';\nimport {\n EuiButtonIcon,\n EuiCodeBlock,\n EuiCopy,\n EuiTab,\n EuiTabs,\n EuiThemeProvider,\n useEuiTheme,\n useGeneratedHtmlId,\n} from '@elastic/eui';\nimport type { PrimitiveNode } from '@elastic/isomer-sdk';\nimport { printNodeJsx } from '@elastic/isomer-sdk/author';\nimport { css } from '@emotion/react';\n\nimport { useStudio } from '../studio_context';\n\nconst FORMATS = ['jsx', 'json'] as const;\n\ntype SourceFormat = (typeof FORMATS)[number];\n\nconst SOURCE_MAX_HEIGHT = 280;\n\nconst themeWrapper = {\n css: css`\n display: contents;\n `,\n};\n\nconst useExampleSource = (node: PrimitiveNode) => {\n const { schemaFor, shim } = useStudio();\n return useMemo(\n () => ({\n jsx: printNodeJsx(node, { schemaFor, shim }),\n json: JSON.stringify(node, null, 2),\n }),\n [node, schemaFor, shim]\n );\n};\n\nconst SourcePanel = ({\n format,\n source,\n onFormat,\n}: {\n format: SourceFormat;\n source: Record<SourceFormat, string>;\n onFormat: (format: SourceFormat) => void;\n}) => {\n const { euiTheme } = useEuiTheme();\n const idPrefix = useGeneratedHtmlId({ prefix: 'exampleSource' });\n const panelId = `${idPrefix}-panel`;\n const tabId = (id: SourceFormat) => `${idPrefix}-${id}`;\n const text = source[format];\n\n return (\n <div\n css={css`\n background: ${euiTheme.colors.backgroundBasePlain};\n color: ${euiTheme.colors.text};\n border-top: ${euiTheme.border.thin};\n `}>\n <div\n css={css`\n display: flex;\n align-items: center;\n gap: ${euiTheme.size.s};\n padding-inline: ${euiTheme.size.m};\n border-bottom: ${euiTheme.border.thin};\n `}>\n <EuiTabs\n size=\"s\"\n bottomBorder={false}\n aria-label=\"Example code format\"\n css={css`\n flex: 1;\n `}>\n {FORMATS.map((id) => (\n <EuiTab\n key={id}\n id={tabId(id)}\n isSelected={id === format}\n aria-controls={panelId}\n onClick={() => onFormat(id)}>\n {id.toUpperCase()}\n </EuiTab>\n ))}\n </EuiTabs>\n <EuiCopy textToCopy={text}>\n {(copy) => (\n <EuiButtonIcon\n iconType=\"copy\"\n aria-label={format === 'jsx' ? 'Copy JSX' : 'Copy JSON'}\n color=\"text\"\n onClick={copy}\n />\n )}\n </EuiCopy>\n </div>\n <div\n role=\"tabpanel\"\n id={panelId}\n aria-labelledby={tabId(format)}\n css={css`\n max-height: ${SOURCE_MAX_HEIGHT}px;\n overflow: auto;\n `}>\n <EuiCodeBlock\n language={format}\n fontSize=\"s\"\n paddingSize=\"m\"\n transparentBackground\n whiteSpace=\"pre-wrap\">\n {text}\n </EuiCodeBlock>\n </div>\n </div>\n );\n};\n\n/** The example node as JSX or JSON. */\nexport const ExampleSource = ({\n node,\n isOpen,\n}: {\n node: PrimitiveNode;\n isOpen: boolean;\n}) => {\n const source = useExampleSource(node);\n const [format, setFormat] = useState<SourceFormat>('jsx');\n\n return (\n <div hidden={!isOpen}>\n <EuiThemeProvider colorMode=\"dark\" wrapperProps={themeWrapper}>\n <SourcePanel {...{ format, source }} onFormat={setFormat} />\n </EuiThemeProvider>\n </div>\n );\n};\n"]}
@@ -0,0 +1,10 @@
1
+ import type { PrimitiveDoc } from '../model/describe_runtime.js';
2
+ export interface ExamplesPanelProps {
3
+ doc: PrimitiveDoc;
4
+ example: number;
5
+ onExampleChange: (example: number) => void;
6
+ devHref: string;
7
+ }
8
+ /** One example at a time, on one surface or all of them. */
9
+ export declare const ExamplesPanel: ({ doc, example, onExampleChange, devHref, }: ExamplesPanelProps) => import("@emotion/react/jsx-runtime").JSX.Element;
10
+ //# sourceMappingURL=examples_panel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"examples_panel.d.ts","sourceRoot":"","sources":["../../src/docs/examples_panel.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAwB9D,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,YAAY,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,4DAA4D;AAC5D,eAAO,MAAM,aAAa,GAAI,6CAK3B,kBAAkB,qDAiHpB,CAAC"}
@@ -0,0 +1,51 @@
1
+ import { jsx as _jsx, 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 { useMemo, useState } from 'react';
9
+ import { EuiButton, EuiButtonEmpty, EuiButtonGroup, EuiFlexGroup, EuiFlexItem, EuiPanel, EuiText, useEuiTheme, } from '@elastic/eui';
10
+ import { css } from '@emotion/react';
11
+ import { useStudio } from '../studio_context.js';
12
+ import { ExamplePicker } from '../surfaces/example_picker.js';
13
+ import { SurfaceBoard } from '../surfaces/surface_board.js';
14
+ import { previewSurfaces, SurfaceSelect, useSurfaceSelection, } from '../surfaces/surface_select.js';
15
+ import { ExampleSource } from './example_source.js';
16
+ const EXAMPLE_VIEW_OPTIONS = [
17
+ { id: 'example', label: 'Example source' },
18
+ { id: 'render', label: 'Rendered' },
19
+ { id: 'source', label: 'Output source' },
20
+ ];
21
+ const isExamplesView = (id) => id === 'render' || id === 'source' || id === 'example';
22
+ /** One example at a time, on one surface or all of them. */
23
+ export const ExamplesPanel = ({ doc, example, onExampleChange, devHref, }) => {
24
+ const { euiTheme } = useEuiTheme();
25
+ const { runtime, compose, rasterizePng } = useStudio();
26
+ const { examples } = doc;
27
+ const surfaces = previewSurfaces(doc.surfaces, Boolean(rasterizePng), true);
28
+ const { showing, select } = useSurfaceSelection(surfaces, surfaces[0] ? [surfaces[0]] : 'all');
29
+ const [view, setView] = useState('render');
30
+ const selected = examples[example];
31
+ const composition = useMemo(() => compose(selected ? [selected.node] : []), [compose, selected]);
32
+ const validation = useMemo(() => runtime.validate(composition), [runtime, composition]);
33
+ const bar = css `
34
+ padding: ${euiTheme.size.s} ${euiTheme.size.base};
35
+ `;
36
+ return (_jsxs(EuiPanel, { paddingSize: "none", hasShadow: true, children: [_jsxs(EuiFlexGroup, { gutterSize: "s", alignItems: "center", responsive: false, wrap: true, css: css `
37
+ ${bar};
38
+ border-bottom: ${euiTheme.border.thin};
39
+ `, children: [_jsx(EuiFlexItem, { grow: false, children: _jsx(ExamplePicker, { examples, example, onChange: onExampleChange }) }), _jsx(EuiFlexItem, {}), _jsx(EuiFlexItem, { grow: false, children: _jsx(SurfaceSelect, { surfaces, selected: showing, anchorPosition: "downRight", onChange: select }) })] }), _jsx("div", { hidden: view === 'example', css: css `
40
+ padding: ${euiTheme.size.l};
41
+ background: ${euiTheme.colors.backgroundBaseSubdued};
42
+ `, children: _jsx(SurfaceBoard, { surfaces: showing, view: view === 'example' ? 'render' : view, composition, validation, errorHref: devHref, zoom: "fit" }) }), selected ? (_jsx(ExampleSource, { node: selected.node, isOpen: view === 'example' })) : null, selected?.description ? (_jsx(EuiText, { size: "s", color: "subdued", css: css `
43
+ padding: ${euiTheme.size.s} ${euiTheme.size.base} 0;
44
+ `, children: _jsx("p", { children: selected.description }) })) : null, _jsxs(EuiFlexGroup, { gutterSize: "s", alignItems: "center", responsive: false, wrap: true, css: css `
45
+ ${bar};
46
+ border-top: ${euiTheme.border.thin};
47
+ `, children: [_jsx(EuiFlexItem, { grow: false, children: _jsx(EuiButtonGroup, { legend: "Example view", buttonSize: "s", variant: "selection", idSelected: view, display: "highlighted", onChange: (id) => isExamplesView(id) && setView(id), children: EXAMPLE_VIEW_OPTIONS.map(({ id, label }) => (_jsx(EuiButton, { id: id, children: label }, id))) }) }), _jsx(EuiFlexItem, { css: css `
48
+ align-items: flex-end;
49
+ `, children: _jsx(EuiButtonEmpty, { size: "s", href: devHref, iconType: "code", children: "Open in Workbench" }) })] })] }));
50
+ };
51
+ //# sourceMappingURL=examples_panel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"examples_panel.js","sourceRoot":"","sources":["../../src/docs/examples_panel.tsx"],"names":[],"mappings":";AAAA;;;;;GAKG;AAEH,OAAc,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EACL,SAAS,EACT,cAAc,EACd,cAAc,EACd,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,OAAO,EACP,WAAW,GACZ,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAGrC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,OAAO,EACL,eAAe,EACf,aAAa,EACb,mBAAmB,GACpB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,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AO,EAAE,QAAQ,EAAC,MAAM,kCAEtC,GACL,IACD,IACN,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, { useMemo, useState } from 'react';\nimport {\n EuiButton,\n EuiButtonEmpty,\n EuiButtonGroup,\n EuiFlexGroup,\n EuiFlexItem,\n EuiPanel,\n EuiText,\n useEuiTheme,\n} from '@elastic/eui';\nimport { css } from '@emotion/react';\n\nimport type { PrimitiveDoc } from '../model/describe_runtime';\nimport { useStudio } from '../studio_context';\nimport { ExamplePicker } from '../surfaces/example_picker';\nimport { SurfaceBoard } from '../surfaces/surface_board';\nimport type { SurfaceView } from '../surfaces/surface_preview';\nimport {\n previewSurfaces,\n SurfaceSelect,\n useSurfaceSelection,\n} from '../surfaces/surface_select';\n\nimport { ExampleSource } from './example_source';\n\ntype ExamplesView = SurfaceView | 'example';\n\nconst EXAMPLE_VIEW_OPTIONS: { id: ExamplesView; label: string }[] = [\n { id: 'example', label: 'Example source' },\n { id: 'render', label: 'Rendered' },\n { id: 'source', label: 'Output source' },\n];\n\nconst isExamplesView = (id: string): id is ExamplesView =>\n id === 'render' || id === 'source' || id === 'example';\n\nexport interface ExamplesPanelProps {\n doc: PrimitiveDoc;\n example: number;\n onExampleChange: (example: number) => void;\n devHref: string;\n}\n\n/** One example at a time, on one surface or all of them. */\nexport const ExamplesPanel = ({\n doc,\n example,\n onExampleChange,\n devHref,\n}: ExamplesPanelProps) => {\n const { euiTheme } = useEuiTheme();\n const { runtime, compose, rasterizePng } = useStudio();\n const { examples } = doc;\n const surfaces = previewSurfaces(doc.surfaces, Boolean(rasterizePng), true);\n const { showing, select } = useSurfaceSelection(\n surfaces,\n surfaces[0] ? [surfaces[0]] : 'all'\n );\n const [view, setView] = useState<ExamplesView>('render');\n const selected = examples[example];\n\n const composition = useMemo(\n () => compose(selected ? [selected.node] : []),\n [compose, selected]\n );\n const validation = useMemo(\n () => runtime.validate(composition),\n [runtime, composition]\n );\n const bar = css`\n padding: ${euiTheme.size.s} ${euiTheme.size.base};\n `;\n\n return (\n <EuiPanel paddingSize=\"none\" hasShadow>\n <EuiFlexGroup\n gutterSize=\"s\"\n alignItems=\"center\"\n responsive={false}\n wrap\n css={css`\n ${bar};\n border-bottom: ${euiTheme.border.thin};\n `}>\n <EuiFlexItem grow={false}>\n <ExamplePicker\n {...{ examples, example }}\n onChange={onExampleChange}\n />\n </EuiFlexItem>\n <EuiFlexItem />\n <EuiFlexItem grow={false}>\n <SurfaceSelect\n {...{ surfaces }}\n selected={showing}\n anchorPosition=\"downRight\"\n onChange={select}\n />\n </EuiFlexItem>\n </EuiFlexGroup>\n <div\n hidden={view === 'example'}\n css={css`\n padding: ${euiTheme.size.l};\n background: ${euiTheme.colors.backgroundBaseSubdued};\n `}>\n <SurfaceBoard\n surfaces={showing}\n view={view === 'example' ? 'render' : view}\n {...{ composition, validation }}\n errorHref={devHref}\n zoom=\"fit\"\n />\n </div>\n {selected ? (\n <ExampleSource node={selected.node} isOpen={view === 'example'} />\n ) : null}\n {selected?.description ? (\n <EuiText\n size=\"s\"\n color=\"subdued\"\n css={css`\n padding: ${euiTheme.size.s} ${euiTheme.size.base} 0;\n `}>\n <p>{selected.description}</p>\n </EuiText>\n ) : null}\n <EuiFlexGroup\n gutterSize=\"s\"\n alignItems=\"center\"\n responsive={false}\n wrap\n css={css`\n ${bar};\n border-top: ${euiTheme.border.thin};\n `}>\n <EuiFlexItem grow={false}>\n <EuiButtonGroup\n legend=\"Example view\"\n buttonSize=\"s\"\n variant=\"selection\"\n idSelected={view}\n display=\"highlighted\"\n onChange={(id) => isExamplesView(id) && setView(id)}>\n {EXAMPLE_VIEW_OPTIONS.map(({ id, label }) => (\n <EuiButton key={id} id={id}>\n {label}\n </EuiButton>\n ))}\n </EuiButtonGroup>\n </EuiFlexItem>\n <EuiFlexItem\n css={css`\n align-items: flex-end;\n `}>\n <EuiButtonEmpty size=\"s\" href={devHref} iconType=\"code\">\n Open in Workbench\n </EuiButtonEmpty>\n </EuiFlexItem>\n </EuiFlexGroup>\n </EuiPanel>\n );\n};\n"]}
@@ -0,0 +1,9 @@
1
+ /** Columns in the gallery grid. That many previews mount immediately. */
2
+ export declare const GALLERY_COLUMNS = 3;
3
+ /** A heading id the Home page's category chips can scroll to. */
4
+ export declare const galleryGroupId: (title: string) => string;
5
+ /** Every example of every primitive on the React surface, by group, beside an "On this page" gutter; `group` scrolls to that group. */
6
+ export declare const GalleryView: ({ group }: {
7
+ group?: string | undefined;
8
+ }) => import("@emotion/react/jsx-runtime").JSX.Element;
9
+ //# sourceMappingURL=gallery_view.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gallery_view.d.ts","sourceRoot":"","sources":["../../src/docs/gallery_view.tsx"],"names":[],"mappings":"AAqCA,yEAAyE;AACzE,eAAO,MAAM,eAAe,IAAI,CAAC;AAoFjC,iEAAiE;AACjE,eAAO,MAAM,cAAc,GAAI,OAAO,MAAM,KAAG,MACO,CAAC;AAEvD,uIAAuI;AACvI,eAAO,MAAM,WAAW,GAAI,WAAW;IAAE,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,qDAyGpE,CAAC"}
@@ -0,0 +1,98 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
+ import { useEffect, useMemo, useRef, useState } from 'react';
3
+ import { EuiFlexGrid, EuiFlexGroup, EuiFlexItem, EuiLink, EuiPanel, EuiSpacer, EuiText, EuiTitle, useEuiTheme, } from '@elastic/eui';
4
+ import { css } from '@emotion/react';
5
+ import { formatRoute } from '../chrome/route.js';
6
+ import { useStudio } from '../studio_context.js';
7
+ import { ReactSurface } from '../surfaces/react_surface.js';
8
+ import { ScaledPreview } from '../surfaces/scaled_preview.js';
9
+ import { CONTENT_BASIS, OnThisPage, PAGE_WIDTH, TOC_GAP, useActiveEntry, } from './on_this_page.js';
10
+ /** Columns in the gallery grid. That many previews mount immediately. */
11
+ export const GALLERY_COLUMNS = 3;
12
+ /** How far ahead of the viewport a preview mounts. */
13
+ const PREVIEW_ROOT_MARGIN = '240px';
14
+ /** 16:9 matches a 1920×1080 slide, so later rows stay outside the first paint. */
15
+ const previewWell = css `
16
+ aspect-ratio: 16 / 9;
17
+ `;
18
+ const DeferredPreview = ({ eager, children, }) => {
19
+ const host = useRef(null);
20
+ const [visible, setVisible] = useState(eager);
21
+ useEffect(() => {
22
+ if (visible) {
23
+ return;
24
+ }
25
+ const element = host.current;
26
+ if (!element || typeof IntersectionObserver === 'undefined') {
27
+ setVisible(true);
28
+ return;
29
+ }
30
+ const observer = new IntersectionObserver((entries) => {
31
+ if (entries.some(({ isIntersecting }) => isIntersecting)) {
32
+ observer.disconnect();
33
+ setVisible(true);
34
+ }
35
+ }, { rootMargin: PREVIEW_ROOT_MARGIN });
36
+ observer.observe(element);
37
+ return () => observer.disconnect();
38
+ }, [visible]);
39
+ return _jsx("div", { ref: host, children: visible ? children : _jsx("div", { css: previewWell }) });
40
+ };
41
+ const ExampleTile = ({ doc: { label }, name, composition, devHref, eager, }) => (_jsxs(EuiPanel, { hasBorder: true, hasShadow: false, paddingSize: "m", children: [_jsxs(EuiFlexGroup, { gutterSize: "s", alignItems: "center", responsive: false, children: [_jsx(EuiFlexItem, { children: _jsxs(EuiText, { size: "xs", children: [_jsx("strong", { children: label }), " \u00B7 ", name] }) }), _jsx(EuiFlexItem, { grow: false, children: _jsx(EuiText, { size: "xs", children: _jsx(EuiLink, { href: devHref, "aria-label": `Open ${label} ${name} in Workbench`, children: "Open in Workbench" }) }) })] }), _jsx(EuiSpacer, { size: "s" }), _jsx(DeferredPreview, { eager, children: _jsx(ScaledPreview, { children: _jsx(ReactSurface, { composition }) }) })] }));
42
+ /** A heading id the Home page's category chips can scroll to. */
43
+ export const galleryGroupId = (title) => `isomer-studio-gallery-${encodeURIComponent(title)}`;
44
+ /** Every example of every primitive on the React surface, by group, beside an "On this page" gutter; `group` scrolls to that group. */
45
+ export const GalleryView = ({ group }) => {
46
+ const { euiTheme } = useEuiTheme();
47
+ const { docs: { primitives, groups }, compose, } = useStudio();
48
+ const compositions = useMemo(() => new Map(primitives.map(({ type, examples }) => [
49
+ type,
50
+ examples.map(({ node }) => compose([node])),
51
+ ])), [primitives, compose]);
52
+ useEffect(() => {
53
+ if (group === undefined) {
54
+ return;
55
+ }
56
+ document
57
+ .getElementById(galleryGroupId(group))
58
+ ?.scrollIntoView({ block: 'start' });
59
+ }, [group]);
60
+ const entries = useMemo(() => groups.map(({ title }) => ({ id: galleryGroupId(title), title })), [groups]);
61
+ const ids = useMemo(() => entries.map(({ id }) => id), [entries]);
62
+ const [active, setActive] = useActiveEntry(ids, '');
63
+ let rendered = 0;
64
+ return (_jsxs("div", { css: css `
65
+ display: flex;
66
+ flex-wrap: wrap;
67
+ align-items: flex-start;
68
+ gap: ${TOC_GAP}px;
69
+ max-width: ${PAGE_WIDTH}px;
70
+ margin-inline: auto;
71
+ padding: ${euiTheme.size.xl} ${euiTheme.size.xxl} ${euiTheme.size.xxxxl};
72
+ `, children: [_jsx(OnThisPage, { entries, active, onSelect: setActive }), _jsxs("div", { css: css `
73
+ flex: 1 1 ${CONTENT_BASIS}px;
74
+ display: flex;
75
+ flex-direction: column;
76
+ gap: ${euiTheme.size.l};
77
+ min-width: 0;
78
+ `, children: [_jsx(EuiTitle, { size: "l", children: _jsx("h1", { children: "Gallery" }) }), groups.map(({ title, types }) => (_jsxs("section", { id: galleryGroupId(title), "aria-label": title, css: css `
79
+ display: flex;
80
+ flex-direction: column;
81
+ gap: ${euiTheme.size.m};
82
+ scroll-margin-top: ${euiTheme.size.l};
83
+ `, children: [_jsx(EuiTitle, { size: "s", children: _jsx("h2", { children: title }) }), _jsx(EuiFlexGrid, { columns: GALLERY_COLUMNS, gutterSize: "m", children: types.flatMap((type) => {
84
+ const doc = primitives.find((candidate) => candidate.type === type);
85
+ return doc
86
+ ? doc.examples.map(({ name }, index) => {
87
+ const eager = rendered < GALLERY_COLUMNS;
88
+ rendered += 1;
89
+ return (_jsx(ExampleTile, { doc, name, eager, composition: compositions.get(type)?.[index] ?? compose([]), devHref: formatRoute({
90
+ mode: 'dev',
91
+ page: type,
92
+ example: index,
93
+ }) }, `${type}/${index}`));
94
+ })
95
+ : [];
96
+ }) })] }, title)))] })] }));
97
+ };
98
+ //# sourceMappingURL=gallery_view.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gallery_view.js","sourceRoot":"","sources":["../../src/docs/gallery_view.tsx"],"names":[],"mappings":";AAQA,OAAc,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACpE,OAAO,EACL,WAAW,EACX,YAAY,EACZ,WAAW,EACX,OAAO,EACP,QAAQ,EACR,SAAS,EACT,OAAO,EACP,QAAQ,EACR,WAAW,GACZ,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAErC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,EACL,aAAa,EACb,UAAU,EACV,UAAU,EACV,OAAO,EACP,cAAc,GACf,MAAM,gBAAgB,CAAC;AAExB,yEAAyE;AACzE,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC;AAEjC,sDAAsD;AACtD,MAAM,mBAAmB,GAAG,OAAO,CAAC;AAEpC,kFAAkF;AAClF,MAAM,WAAW,GAAG,GAAG,CAAA;;CAEtB,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,EACvB,KAAK,EACL,QAAQ,GAIT,EAAE,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AAK,CAuCF,CACX,CAAC,IACE,IACF,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 type { ReactNode } from 'react';\nimport React, { useEffect, useMemo, useRef, useState } from 'react';\nimport {\n EuiFlexGrid,\n EuiFlexGroup,\n EuiFlexItem,\n EuiLink,\n EuiPanel,\n EuiSpacer,\n EuiText,\n EuiTitle,\n useEuiTheme,\n} from '@elastic/eui';\nimport type { Composition } from '@elastic/isomer-sdk';\nimport { css } from '@emotion/react';\n\nimport { formatRoute } from '../chrome/route';\nimport type { PrimitiveDoc } from '../model/describe_runtime';\nimport { useStudio } from '../studio_context';\nimport { ReactSurface } from '../surfaces/react_surface';\nimport { ScaledPreview } from '../surfaces/scaled_preview';\n\nimport {\n CONTENT_BASIS,\n OnThisPage,\n PAGE_WIDTH,\n TOC_GAP,\n useActiveEntry,\n} from './on_this_page';\n\n/** Columns in the gallery grid. That many previews mount immediately. */\nexport const GALLERY_COLUMNS = 3;\n\n/** How far ahead of the viewport a preview mounts. */\nconst PREVIEW_ROOT_MARGIN = '240px';\n\n/** 16:9 matches a 1920×1080 slide, so later rows stay outside the first paint. */\nconst previewWell = css`\n aspect-ratio: 16 / 9;\n`;\n\nconst DeferredPreview = ({\n eager,\n children,\n}: {\n eager: boolean;\n children: ReactNode;\n}) => {\n const host = useRef<HTMLDivElement>(null);\n const [visible, setVisible] = useState(eager);\n\n useEffect(() => {\n if (visible) {\n return;\n }\n const element = host.current;\n if (!element || typeof IntersectionObserver === 'undefined') {\n setVisible(true);\n return;\n }\n const observer = new IntersectionObserver(\n (entries) => {\n if (entries.some(({ isIntersecting }) => isIntersecting)) {\n observer.disconnect();\n setVisible(true);\n }\n },\n { rootMargin: PREVIEW_ROOT_MARGIN }\n );\n observer.observe(element);\n return () => observer.disconnect();\n }, [visible]);\n\n return <div ref={host}>{visible ? children : <div css={previewWell} />}</div>;\n};\n\nconst ExampleTile = ({\n doc: { label },\n name,\n composition,\n devHref,\n eager,\n}: {\n doc: PrimitiveDoc;\n name: string;\n composition: Composition;\n devHref: string;\n eager: boolean;\n}) => (\n <EuiPanel hasBorder hasShadow={false} paddingSize=\"m\">\n <EuiFlexGroup gutterSize=\"s\" alignItems=\"center\" responsive={false}>\n <EuiFlexItem>\n <EuiText size=\"xs\">\n <strong>{label}</strong> · {name}\n </EuiText>\n </EuiFlexItem>\n <EuiFlexItem grow={false}>\n <EuiText size=\"xs\">\n <EuiLink\n href={devHref}\n aria-label={`Open ${label} ${name} in Workbench`}>\n Open in Workbench\n </EuiLink>\n </EuiText>\n </EuiFlexItem>\n </EuiFlexGroup>\n <EuiSpacer size=\"s\" />\n <DeferredPreview {...{ eager }}>\n <ScaledPreview>\n <ReactSurface {...{ composition }} />\n </ScaledPreview>\n </DeferredPreview>\n </EuiPanel>\n);\n\n/** A heading id the Home page's category chips can scroll to. */\nexport const galleryGroupId = (title: string): string =>\n `isomer-studio-gallery-${encodeURIComponent(title)}`;\n\n/** Every example of every primitive on the React surface, by group, beside an \"On this page\" gutter; `group` scrolls to that group. */\nexport const GalleryView = ({ group }: { group?: string | undefined }) => {\n const { euiTheme } = useEuiTheme();\n const {\n docs: { primitives, groups },\n compose,\n } = useStudio();\n\n const compositions = useMemo(\n () =>\n new Map(\n primitives.map(({ type, examples }) => [\n type,\n examples.map(({ node }) => compose([node])),\n ])\n ),\n [primitives, compose]\n );\n\n useEffect(() => {\n if (group === undefined) {\n return;\n }\n document\n .getElementById(galleryGroupId(group))\n ?.scrollIntoView({ block: 'start' });\n }, [group]);\n\n const entries = useMemo(\n () => groups.map(({ title }) => ({ id: galleryGroupId(title), title })),\n [groups]\n );\n const ids = useMemo(() => entries.map(({ id }) => id), [entries]);\n const [active, setActive] = useActiveEntry(ids, '');\n\n let rendered = 0;\n\n return (\n <div\n css={css`\n display: flex;\n flex-wrap: wrap;\n align-items: flex-start;\n gap: ${TOC_GAP}px;\n max-width: ${PAGE_WIDTH}px;\n margin-inline: auto;\n padding: ${euiTheme.size.xl} ${euiTheme.size.xxl} ${euiTheme.size.xxxxl};\n `}>\n <OnThisPage {...{ entries, active }} onSelect={setActive} />\n <div\n css={css`\n flex: 1 1 ${CONTENT_BASIS}px;\n display: flex;\n flex-direction: column;\n gap: ${euiTheme.size.l};\n min-width: 0;\n `}>\n <EuiTitle size=\"l\">\n <h1>Gallery</h1>\n </EuiTitle>\n {groups.map(({ title, types }) => (\n <section\n key={title}\n id={galleryGroupId(title)}\n aria-label={title}\n css={css`\n display: flex;\n flex-direction: column;\n gap: ${euiTheme.size.m};\n scroll-margin-top: ${euiTheme.size.l};\n `}>\n <EuiTitle size=\"s\">\n <h2>{title}</h2>\n </EuiTitle>\n <EuiFlexGrid columns={GALLERY_COLUMNS} gutterSize=\"m\">\n {types.flatMap((type) => {\n const doc = primitives.find(\n (candidate) => candidate.type === type\n );\n return doc\n ? doc.examples.map(({ name }, index) => {\n const eager = rendered < GALLERY_COLUMNS;\n rendered += 1;\n return (\n <ExampleTile\n key={`${type}/${index}`}\n {...{ doc, name, eager }}\n composition={\n compositions.get(type)?.[index] ?? compose([])\n }\n devHref={formatRoute({\n mode: 'dev',\n page: type,\n example: index,\n })}\n />\n );\n })\n : [];\n })}\n </EuiFlexGrid>\n </section>\n ))}\n </div>\n </div>\n );\n};\n"]}
@@ -0,0 +1,11 @@
1
+ /** `text` split into prose and code: backtick spans, and any of `names` standing as a whole word. */
2
+ export declare const splitCode: (text: string, names?: readonly string[]) => Array<{
3
+ text: string;
4
+ isCode: boolean;
5
+ }>;
6
+ /** Prose with its backtick spans and primitive names set as inline code. */
7
+ export declare const InlineCode: ({ text, names, }: {
8
+ text: string;
9
+ names?: readonly string[];
10
+ }) => import("@emotion/react/jsx-runtime").JSX.Element;
11
+ //# sourceMappingURL=inline_code.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inline_code.d.ts","sourceRoot":"","sources":["../../src/docs/inline_code.tsx"],"names":[],"mappings":"AAYA,qGAAqG;AACrG,eAAO,MAAM,SAAS,GACpB,MAAM,MAAM,EACZ,QAAO,SAAS,MAAM,EAAO,KAC5B,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,CAazC,CAAC;AAEF,4EAA4E;AAC5E,eAAO,MAAM,UAAU,GAAI,kBAGxB;IACD,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC3B,qDAUA,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { jsx as _jsx, Fragment as _Fragment } 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 React from 'react';
9
+ import { EuiCode } from '@elastic/eui';
10
+ const escape = (name) => name.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
11
+ /** `text` split into prose and code: backtick spans, and any of `names` standing as a whole word. */
12
+ export const splitCode = (text, names = []) => {
13
+ const words = names.length
14
+ ? new RegExp(`\\b(${names.map(escape).join('|')})\\b`, 'g')
15
+ : undefined;
16
+ return text
17
+ .split(/`([^`]+)`/)
18
+ .flatMap((part, index) => index % 2 === 1
19
+ ? [{ text: part, isCode: true }]
20
+ : (words ? part.split(words) : [part]).flatMap((piece, pieceIndex) => piece ? [{ text: piece, isCode: pieceIndex % 2 === 1 }] : []));
21
+ };
22
+ /** Prose with its backtick spans and primitive names set as inline code. */
23
+ export const InlineCode = ({ text, names, }) => (_jsx(_Fragment, { children: splitCode(text, names).map(({ text: part, isCode }, index) => isCode ? (_jsx(EuiCode, { children: part }, index)) : (_jsx(React.Fragment, { children: part }, index))) }));
24
+ //# sourceMapping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,MAAM,UAAU,GAAG,CAAC,EACzB,IAAI,EACJ,KAAK,GAIN,EAAE,EAAE,CAAC,CACJ,4BACG,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,EAAE,CAC5D,MAAM,CAAC,CAAC,CAAC,CACP,KAAC,OAAO,cAAc,IAAI,IAAZ,KAAK,CAAkB,CACtC,CAAC,CAAC,CAAC,CACF,KAAC,KAAK,CAAC,QAAQ,cAAc,IAAI,IAAZ,KAAK,CAAyB,CACpD,CACF,GACA,CACJ,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 { EuiCode } from '@elastic/eui';\n\nconst escape = (name: string) => name.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n\n/** `text` split into prose and code: backtick spans, and any of `names` standing as a whole word. */\nexport const splitCode = (\n text: string,\n names: readonly string[] = []\n): Array<{ text: string; isCode: boolean }> => {\n const words = names.length\n ? new RegExp(`\\\\b(${names.map(escape).join('|')})\\\\b`, 'g')\n : undefined;\n return text\n .split(/`([^`]+)`/)\n .flatMap((part, index) =>\n index % 2 === 1\n ? [{ text: part, isCode: true }]\n : (words ? part.split(words) : [part]).flatMap((piece, pieceIndex) =>\n piece ? [{ text: piece, isCode: pieceIndex % 2 === 1 }] : []\n )\n );\n};\n\n/** Prose with its backtick spans and primitive names set as inline code. */\nexport const InlineCode = ({\n text,\n names,\n}: {\n text: string;\n names?: readonly string[];\n}) => (\n <>\n {splitCode(text, names).map(({ text: part, isCode }, index) =>\n isCode ? (\n <EuiCode key={index}>{part}</EuiCode>\n ) : (\n <React.Fragment key={index}>{part}</React.Fragment>\n )\n )}\n </>\n);\n"]}
@@ -0,0 +1,17 @@
1
+ export declare const PAGE_WIDTH = 1320;
2
+ export declare const CONTENT_BASIS = 560;
3
+ export declare const TOC_GAP = 48;
4
+ export interface TocEntry {
5
+ /** The `id` of the element the entry scrolls to. */
6
+ id: string;
7
+ title: string;
8
+ }
9
+ /** The id of the topmost element in view, or the first when the browser can't observe intersections. */
10
+ export declare const useActiveEntry: (ids: readonly string[], resetKey: string) => [string, (id: string) => void];
11
+ /** A sticky "On this page" gutter when wide, a row above the content when narrow. Render it before the content. */
12
+ export declare const OnThisPage: ({ entries, active, onSelect, }: {
13
+ entries: readonly TocEntry[];
14
+ active: string;
15
+ onSelect: (id: string) => void;
16
+ }) => import("@emotion/react/jsx-runtime").JSX.Element;
17
+ //# sourceMappingURL=on_this_page.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"on_this_page.d.ts","sourceRoot":"","sources":["../../src/docs/on_this_page.tsx"],"names":[],"mappings":"AAWA,eAAO,MAAM,UAAU,OAAO,CAAC;AAC/B,eAAO,MAAM,aAAa,MAAM,CAAC;AAEjC,eAAO,MAAM,OAAO,KAAK,CAAC;AAE1B,MAAM,WAAW,QAAQ;IACvB,oDAAoD;IACpD,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wGAAwG;AACxG,eAAO,MAAM,cAAc,GACzB,KAAK,SAAS,MAAM,EAAE,EACtB,UAAU,MAAM,KACf,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CA+B/B,CAAC;AAEF,mHAAmH;AACnH,eAAO,MAAM,UAAU,GAAI,gCAIxB;IACD,OAAO,EAAE,SAAS,QAAQ,EAAE,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC,qDAyDA,CAAC"}
@@ -0,0 +1,77 @@
1
+ import { jsx as _jsx, 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 { useEffect, useState } from 'react';
9
+ import { EuiButtonEmpty, EuiText, useEuiTheme } from '@elastic/eui';
10
+ import { css } from '@emotion/react';
11
+ export const PAGE_WIDTH = 1320;
12
+ export const CONTENT_BASIS = 560;
13
+ const TOC_WIDTH = 180;
14
+ export const TOC_GAP = 48;
15
+ /** The id of the topmost element in view, or the first when the browser can't observe intersections. */
16
+ export const useActiveEntry = (ids, resetKey) => {
17
+ const [active, setActive] = useState(ids[0] ?? '');
18
+ useEffect(() => {
19
+ setActive(ids[0] ?? '');
20
+ if (typeof IntersectionObserver === 'undefined') {
21
+ return;
22
+ }
23
+ const visible = new Set();
24
+ const observer = new IntersectionObserver((entries) => {
25
+ entries.forEach(({ target: { id }, isIntersecting }) => isIntersecting ? visible.add(id) : visible.delete(id));
26
+ const first = ids.find((id) => visible.has(id));
27
+ if (first) {
28
+ setActive(first);
29
+ }
30
+ }, { rootMargin: '0px 0px -60% 0px' });
31
+ ids.forEach((id) => {
32
+ const element = document.getElementById(id);
33
+ if (element) {
34
+ observer.observe(element);
35
+ }
36
+ });
37
+ return () => observer.disconnect();
38
+ }, [ids, resetKey]);
39
+ return [active, setActive];
40
+ };
41
+ /** A sticky "On this page" gutter when wide, a row above the content when narrow. Render it before the content. */
42
+ export const OnThisPage = ({ entries, active, onSelect, }) => {
43
+ const { euiTheme } = useEuiTheme();
44
+ return (_jsxs("nav", { "aria-label": "On this page", css: css `
45
+ flex: 0 0 ${TOC_WIDTH}px;
46
+ order: 1;
47
+ position: sticky;
48
+ top: ${euiTheme.size.xl};
49
+ height: fit-content;
50
+ display: flex;
51
+ flex-direction: column;
52
+ gap: ${euiTheme.size.xxs};
53
+
54
+ @media (max-width: 1200px) {
55
+ flex: 1 1 100%;
56
+ order: 0;
57
+ position: static;
58
+ flex-direction: row;
59
+ flex-wrap: wrap;
60
+ align-items: center;
61
+ gap: ${euiTheme.size.xxs} ${euiTheme.size.s};
62
+ }
63
+ `, children: [_jsx(EuiText, { size: "xs", color: "subdued", css: css `
64
+ text-transform: uppercase;
65
+ font-weight: ${euiTheme.font.weight.semiBold};
66
+
67
+ @media (max-width: 1200px) {
68
+ flex: 0 0 100%;
69
+ }
70
+ `, children: "On this page" }), entries.map(({ id, title }) => (_jsx(EuiButtonEmpty, { size: "xs", flush: "left", color: id === active ? 'primary' : 'text', "aria-current": id === active ? 'location' : undefined, css: css `
71
+ align-self: flex-start;
72
+ `, onClick: () => {
73
+ onSelect(id);
74
+ document.getElementById(id)?.scrollIntoView({ behavior: 'smooth' });
75
+ }, children: title }, id)))] }));
76
+ };
77
+ //# sourceMappingURL=on_this_page.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"on_this_page.js","sourceRoot":"","sources":["../../src/docs/on_this_page.tsx"],"names":[],"mappings":";AAAA;;;;;GAKG;AAEH,OAAc,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAErC,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,CAAC;AAC/B,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,CAAC;AACjC,MAAM,SAAS,GAAG,GAAG,CAAC;AACtB,MAAM,CAAC,MAAM,OAAO,GAAG,EAAE,CAAC;AAQ1B,wGAAwG;AACxG,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,GAAsB,EACtB,QAAgB,EACgB,EAAE;IAClC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IAEnD,SAAS,CAAC,GAAG,EAAE;QACb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,EACzB,OAAO,EACP,MAAM,EACN,QAAQ,GAKT,EAAE,EAAE;IACH,MAAM,EAAE,QAAQ,EAAE,GAAG,WAAW,EAAE,CAAC;IACnC,OAAO,CACL,6BACa,cAAc,EACzB,GAAG,EAAE,GAAG,CAAA;oBACM,SAAS;;;eAGd,QAAQ,CAAC,IAAI,CAAC,EAAE;;;;eAIhB,QAAQ,CAAC,IAAI,CAAC,GAAG;;;;;;;;;iBASf,QAAQ,CAAC,IAAI,CAAC,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC;;OAE9C,aACD,KAAC,OAAO,IACN,IAAI,EAAC,IAAI,EACT,KAAK,EAAC,SAAS,EACf,GAAG,EAAE,GAAG,CAAA;;yBAES,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ;;;;;SAK7C,6BAEO,EACT,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAC9B,KAAC,cAAc,IAEb,IAAI,EAAC,IAAI,EACT,KAAK,EAAC,MAAM,EACZ,KAAK,EAAE,EAAE,KAAK,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,kBAC3B,EAAE,KAAK,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,EACpD,GAAG,EAAE,GAAG,CAAA;;WAEP,EACD,OAAO,EAAE,GAAG,EAAE;oBACZ,QAAQ,CAAC,EAAE,CAAC,CAAC;oBACb,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,cAAc,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;gBACtE,CAAC,YACA,KAAK,IAZD,EAAE,CAaQ,CAClB,CAAC,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, { useEffect, useState } from 'react';\nimport { EuiButtonEmpty, EuiText, useEuiTheme } from '@elastic/eui';\nimport { css } from '@emotion/react';\n\nexport const PAGE_WIDTH = 1320;\nexport const CONTENT_BASIS = 560;\nconst TOC_WIDTH = 180;\nexport const TOC_GAP = 48;\n\nexport interface TocEntry {\n /** The `id` of the element the entry scrolls to. */\n id: string;\n title: string;\n}\n\n/** The id of the topmost element in view, or the first when the browser can't observe intersections. */\nexport const useActiveEntry = (\n ids: readonly string[],\n resetKey: string\n): [string, (id: string) => void] => {\n const [active, setActive] = useState(ids[0] ?? '');\n\n useEffect(() => {\n setActive(ids[0] ?? '');\n if (typeof IntersectionObserver === 'undefined') {\n return;\n }\n const visible = new Set<string>();\n const observer = new IntersectionObserver(\n (entries) => {\n entries.forEach(({ target: { id }, isIntersecting }) =>\n isIntersecting ? visible.add(id) : visible.delete(id)\n );\n const first = ids.find((id) => visible.has(id));\n if (first) {\n setActive(first);\n }\n },\n { rootMargin: '0px 0px -60% 0px' }\n );\n ids.forEach((id) => {\n const element = document.getElementById(id);\n if (element) {\n observer.observe(element);\n }\n });\n return () => observer.disconnect();\n }, [ids, resetKey]);\n\n return [active, setActive];\n};\n\n/** A sticky \"On this page\" gutter when wide, a row above the content when narrow. Render it before the content. */\nexport const OnThisPage = ({\n entries,\n active,\n onSelect,\n}: {\n entries: readonly TocEntry[];\n active: string;\n onSelect: (id: string) => void;\n}) => {\n const { euiTheme } = useEuiTheme();\n return (\n <nav\n aria-label=\"On this page\"\n css={css`\n flex: 0 0 ${TOC_WIDTH}px;\n order: 1;\n position: sticky;\n top: ${euiTheme.size.xl};\n height: fit-content;\n display: flex;\n flex-direction: column;\n gap: ${euiTheme.size.xxs};\n\n @media (max-width: 1200px) {\n flex: 1 1 100%;\n order: 0;\n position: static;\n flex-direction: row;\n flex-wrap: wrap;\n align-items: center;\n gap: ${euiTheme.size.xxs} ${euiTheme.size.s};\n }\n `}>\n <EuiText\n size=\"xs\"\n color=\"subdued\"\n css={css`\n text-transform: uppercase;\n font-weight: ${euiTheme.font.weight.semiBold};\n\n @media (max-width: 1200px) {\n flex: 0 0 100%;\n }\n `}>\n On this page\n </EuiText>\n {entries.map(({ id, title }) => (\n <EuiButtonEmpty\n key={id}\n size=\"xs\"\n flush=\"left\"\n color={id === active ? 'primary' : 'text'}\n aria-current={id === active ? 'location' : undefined}\n css={css`\n align-self: flex-start;\n `}\n onClick={() => {\n onSelect(id);\n document.getElementById(id)?.scrollIntoView({ behavior: 'smooth' });\n }}>\n {title}\n </EuiButtonEmpty>\n ))}\n </nav>\n );\n};\n"]}
@@ -0,0 +1,14 @@
1
+ import type { PropDescriptor } from '@elastic/isomer-runtime';
2
+ import type { Accent } from '../chrome/accent.js';
3
+ /** An enum's values as a TypeScript union literal, such as `"l" | "m" | "s"`. */
4
+ export declare const enumLiteral: (values: readonly string[]) => string;
5
+ /** A primitive's props, read from its authoring JSON Schema. */
6
+ export declare const PropsTable: ({ props, accent, names, compact, }: {
7
+ props: PropDescriptor[];
8
+ accent: Accent;
9
+ /** Primitive types to set as code where a description names them. */
10
+ names: readonly string[];
11
+ /** Uses proportional column widths for the shared Dev drawer. */
12
+ compact?: boolean;
13
+ }) => import("@emotion/react/jsx-runtime").JSX.Element;
14
+ //# sourceMappingURL=props_table.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"props_table.d.ts","sourceRoot":"","sources":["../../src/docs/props_table.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAG9D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAI/C,iFAAiF;AACjF,eAAO,MAAM,WAAW,GAAI,QAAQ,SAAS,MAAM,EAAE,KAAG,MACE,CAAC;AAyE3D,gEAAgE;AAChE,eAAO,MAAM,UAAU,GAAI,oCAKxB;IACD,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,qEAAqE;IACrE,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,iEAAiE;IACjE,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,qDAQA,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
+ import { EuiBadge, EuiBasicTable, EuiCode, EuiFlexGroup, EuiFlexItem, EuiText, } from '@elastic/eui';
3
+ import { css } from '@emotion/react';
4
+ import { InlineCode } from './inline_code.js';
5
+ /** An enum's values as a TypeScript union literal, such as `"l" | "m" | "s"`. */
6
+ export const enumLiteral = (values) => values.map((value) => JSON.stringify(value)).join(' | ');
7
+ const columnsFor = ({ text, light }, names, compact = false) => [
8
+ {
9
+ name: 'Name',
10
+ width: compact ? '24%' : '14em',
11
+ valign: 'top',
12
+ render: ({ name, required }) => (_jsx("div", { children: _jsxs(EuiFlexGroup, { gutterSize: "xs", alignItems: "center", responsive: false, wrap: true, children: [_jsx(EuiFlexItem, { grow: false, children: _jsx(EuiCode, { css: css `
13
+ color: ${text};
14
+ background: ${light};
15
+ `, children: name }) }), required ? (_jsx(EuiFlexItem, { grow: false, children: _jsx(EuiBadge, { color: "hollow", children: "required" }) })) : null] }) })),
16
+ },
17
+ {
18
+ name: 'Type',
19
+ width: compact ? '24%' : '12em',
20
+ valign: 'top',
21
+ render: ({ type, values }) => values ? (_jsx(EuiCode, { children: enumLiteral(values) })) : (_jsx(EuiText, { size: "s", color: "subdued", children: type })),
22
+ },
23
+ {
24
+ name: 'Description',
25
+ valign: 'top',
26
+ render: ({ description }) => description ? (_jsx(EuiText, { size: "s", children: _jsx("p", { children: _jsx("span", { css: css `
27
+ display: inline-block;
28
+ max-inline-size: 72ch;
29
+ `, children: _jsx(InlineCode, { text: description, names }) }) }) })) : (_jsx(EuiText, { size: "s", color: "subdued", children: "\u2014" })),
30
+ },
31
+ ];
32
+ /** A primitive's props, read from its authoring JSON Schema. */
33
+ export const PropsTable = ({ props, accent, names, compact = false, }) => (_jsx(EuiBasicTable, { tableCaption: "Props", items: props, columns: columnsFor(accent, names, compact), itemId: "name", noItemsMessage: "This primitive has no props besides its type." }));
34
+ //# sourceMappingURL=props_table.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"props_table.js","sourceRoot":"","sources":["../../src/docs/props_table.tsx"],"names":[],"mappings":";AASA,OAAO,EACL,QAAQ,EACR,aAAa,EACb,OAAO,EACP,YAAY,EACZ,WAAW,EACX,OAAO,GACR,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAIrC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,iFAAiF;AACjF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,MAAyB,EAAU,EAAE,CAC/D,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAE3D,MAAM,UAAU,GAAG,CACjB,EAAE,IAAI,EAAE,KAAK,EAAU,EACvB,KAAwB,EACxB,OAAO,GAAG,KAAK,EAC6B,EAAE,CAAC;IAC/C;QACE,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM;QAC/B,MAAM,EAAE,KAAK;QACb,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAkB,EAAE,EAAE,CAAC,CAC9C,wBACE,MAAC,YAAY,IACX,UAAU,EAAC,IAAI,EACf,UAAU,EAAC,QAAQ,EACnB,UAAU,EAAE,KAAK,EACjB,IAAI,mBACJ,KAAC,WAAW,IAAC,IAAI,EAAE,KAAK,YACtB,KAAC,OAAO,IACN,GAAG,EAAE,GAAG,CAAA;yBACG,IAAI;8BACC,KAAK;eACpB,YACA,IAAI,GACG,GACE,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M,EAAE,KAAK,EAAE,OAAO,CAAC,EAC3C,MAAM,EAAC,MAAM,EACb,cAAc,EAAC,+CAA+C,GAC9D,CACH,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 type { EuiBasicTableColumn } from '@elastic/eui';\nimport {\n EuiBadge,\n EuiBasicTable,\n EuiCode,\n EuiFlexGroup,\n EuiFlexItem,\n EuiText,\n} from '@elastic/eui';\nimport type { PropDescriptor } from '@elastic/isomer-runtime';\nimport { css } from '@emotion/react';\n\nimport type { Accent } from '../chrome/accent';\n\nimport { InlineCode } from './inline_code';\n\n/** An enum's values as a TypeScript union literal, such as `\"l\" | \"m\" | \"s\"`. */\nexport const enumLiteral = (values: readonly string[]): string =>\n values.map((value) => JSON.stringify(value)).join(' | ');\n\nconst columnsFor = (\n { text, light }: Accent,\n names: readonly string[],\n compact = false\n): Array<EuiBasicTableColumn<PropDescriptor>> => [\n {\n name: 'Name',\n width: compact ? '24%' : '14em',\n valign: 'top',\n render: ({ name, required }: PropDescriptor) => (\n <div>\n <EuiFlexGroup\n gutterSize=\"xs\"\n alignItems=\"center\"\n responsive={false}\n wrap>\n <EuiFlexItem grow={false}>\n <EuiCode\n css={css`\n color: ${text};\n background: ${light};\n `}>\n {name}\n </EuiCode>\n </EuiFlexItem>\n {required ? (\n <EuiFlexItem grow={false}>\n <EuiBadge color=\"hollow\">required</EuiBadge>\n </EuiFlexItem>\n ) : null}\n </EuiFlexGroup>\n </div>\n ),\n },\n {\n name: 'Type',\n width: compact ? '24%' : '12em',\n valign: 'top',\n render: ({ type, values }: PropDescriptor) =>\n values ? (\n <EuiCode>{enumLiteral(values)}</EuiCode>\n ) : (\n <EuiText size=\"s\" color=\"subdued\">\n {type}\n </EuiText>\n ),\n },\n {\n name: 'Description',\n valign: 'top',\n render: ({ description }: PropDescriptor) =>\n description ? (\n <EuiText size=\"s\">\n <p>\n <span\n css={css`\n display: inline-block;\n max-inline-size: 72ch;\n `}>\n <InlineCode text={description} {...{ names }} />\n </span>\n </p>\n </EuiText>\n ) : (\n <EuiText size=\"s\" color=\"subdued\">\n —\n </EuiText>\n ),\n },\n];\n\n/** A primitive's props, read from its authoring JSON Schema. */\nexport const PropsTable = ({\n props,\n accent,\n names,\n compact = false,\n}: {\n props: PropDescriptor[];\n accent: Accent;\n /** Primitive types to set as code where a description names them. */\n names: readonly string[];\n /** Uses proportional column widths for the shared Dev drawer. */\n compact?: boolean;\n}) => (\n <EuiBasicTable<PropDescriptor>\n tableCaption=\"Props\"\n items={props}\n columns={columnsFor(accent, names, compact)}\n itemId=\"name\"\n noItemsMessage=\"This primitive has no props besides its type.\"\n />\n);\n"]}
@@ -0,0 +1,6 @@
1
+ import type { StudioApp } from '../config.js';
2
+ /** One tile per configured app, then how to add one; with none, only the latter, as the empty state. */
3
+ export declare const AppsSection: ({ apps }: {
4
+ apps: readonly StudioApp[];
5
+ }) => import("@emotion/react/jsx-runtime").JSX.Element;
6
+ //# sourceMappingURL=apps_section.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apps_section.d.ts","sourceRoot":"","sources":["../../src/home/apps_section.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AA+F3C,wGAAwG;AACxG,eAAO,MAAM,WAAW,GAAI,UAAU;IAAE,IAAI,EAAE,SAAS,SAAS,EAAE,CAAA;CAAE,qDAoBnE,CAAC"}
@@ -0,0 +1,44 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
+ import { css } from '@emotion/react';
3
+ import { Glyph } from '../chrome/primitive_glyph.js';
4
+ import { formatLocation } from '../chrome/route.js';
5
+ import { APPS_DOCS_URL } from './links.js';
6
+ import { helpTile, HOME, sectionHeading, sectionLabel, tile, tileActions, tileDescription, tileName, tilesGrid, tileTop, } from './tokens.js';
7
+ const AppTile = ({ app: { id, title, description, icon }, }) => (_jsxs("a", { href: formatLocation({ app: id, path: '' }), css: [
8
+ tile(3),
9
+ css `
10
+ &:hover,
11
+ &:focus-within {
12
+ border-color: ${HOME.app};
13
+ }
14
+ `,
15
+ ], "data-testid": "home-app", children: [_jsxs("span", { css: tileTop, children: [_jsx("span", { css: [
16
+ tileName,
17
+ css `
18
+ color: ${HOME.app};
19
+ `,
20
+ ], children: title }), _jsx("span", { css: css `
21
+ color: ${HOME.app};
22
+ margin-top: 1px;
23
+ `, children: _jsx(Glyph, { svg: icon?.svg, label: title, size: 18 }) })] }), _jsx("span", { css: tileDescription, children: description ?? `Opens ${title}.` }), _jsx("span", { css: tileActions, children: _jsx("span", { css: css `
24
+ color: ${HOME.app};
25
+ `, children: "Open \u2192" }) })] }));
26
+ const AddAppTile = ({ empty }) => (_jsxs("a", { href: APPS_DOCS_URL, target: "_blank", rel: "noopener", css: helpTile(3, HOME.app), "data-testid": "home-add-app", children: [_jsx("span", { css: [
27
+ tileName,
28
+ css `
29
+ color: ${HOME.fg};
30
+ `,
31
+ ], children: empty ? 'No applications yet' : 'How do I add an application?' }), _jsx("span", { css: tileDescription, children: empty
32
+ ? 'An app is a page of the Studio that demonstrates the pack. Add one to the config’s apps, with an id, a title and a load that imports its page.'
33
+ : 'A page of the Studio that demonstrates the pack, declared in the config’s apps.' }), _jsx("span", { css: css `
34
+ font-size: 12px;
35
+ font-weight: 600;
36
+ color: ${HOME.app};
37
+ `, children: "Read the config docs \u2197" })] }));
38
+ /** One tile per configured app, then how to add one; with none, only the latter, as the empty state. */
39
+ export const AppsSection = ({ apps }) => (_jsxs("section", { "aria-labelledby": "isomer-studio-applications", css: css `
40
+ display: flex;
41
+ flex-direction: column;
42
+ gap: 10px;
43
+ `, children: [_jsx("div", { css: sectionLabel, children: _jsx("h2", { id: "isomer-studio-applications", css: sectionHeading, children: "Applications" }) }), _jsxs("div", { css: tilesGrid, children: [apps.map((app) => (_jsx(AppTile, { app }, app.id))), _jsx(AddAppTile, { empty: apps.length === 0 })] })] }));
44
+ //# sourceMappingURL=apps_section.js.map