All files / src/.umi/core routes.ts

0% Statements 0/17
0% Branches 0/3
0% Functions 0/4
0% Lines 0/17

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115                                                                                                                                                                                                                                     
// @ts-nocheck
import React from 'react';
import { ApplyPluginsType } from '/Users/daboku/project/new-graphlib/node_modules/umi/node_modules/@umijs/runtime';
import * as umiExports from './umiExports';
import { plugin } from './plugin';
 
export function getRoutes() {
  const routes = [
  {
    "path": "/~demos/:uuid",
    "layout": false,
    "wrappers": [require('../dumi/layout').default],
    "component": ((props) => {
        const React = require('react');
        const { default: getDemoRenderArgs } = require('/Users/daboku/project/new-graphlib/node_modules/@umijs/preset-dumi/lib/plugins/features/demo/getDemoRenderArgs');
        const { default: Previewer } = require('dumi-theme-default/es/builtins/Previewer.js');
        const { usePrefersColor, context } = require('dumi/theme');
 
        
      const { demos } = React.useContext(context);
      const [renderArgs, setRenderArgs] = React.useState([]);
 
      // update render args when props changed
      React.useLayoutEffect(() => {
        setRenderArgs(getDemoRenderArgs(props, demos));
      }, [props.match.params.uuid, props.location.query.wrapper, props.location.query.capture]);
 
      // for listen prefers-color-schema media change in demo single route
      usePrefersColor();
 
      switch (renderArgs.length) {
        case 1:
          // render demo directly
          return renderArgs[0];
 
        case 2:
          // render demo with previewer
          return React.createElement(
            Previewer,
            renderArgs[0],
            renderArgs[1],
          );
 
        default:
          return `Demo ${props.match.params.uuid} not found :(`;
      }
    
        })
  },
  {
    "path": "/_demos/:uuid",
    "redirect": "/~demos/:uuid"
  },
  {
    "__dumiRoot": true,
    "layout": false,
    "path": "/",
    "wrappers": [require('../dumi/layout').default, require('/Users/daboku/project/new-graphlib/node_modules/dumi-theme-default/es/layout.js').default],
    "routes": [
      {
        "path": "/graph",
        "component": require('/Users/daboku/project/new-graphlib/src/Graph/index.md').default,
        "exact": true,
        "meta": {
          "filePath": "src/Graph/index.md",
          "updatedTime": 1646209669262,
          "slugs": [
            {
              "depth": 3,
              "value": "Graph",
              "heading": "graph"
            }
          ],
          "title": "Graph",
          "group": {
            "path": "/graph",
            "title": "Graph"
          }
        },
        "title": "Graph - new-graphlib"
      },
      {
        "path": "/",
        "component": require('/Users/daboku/project/new-graphlib/docs/index.md').default,
        "exact": true,
        "meta": {
          "filePath": "docs/index.md",
          "updatedTime": 1645688371766,
          "slugs": [
            {
              "depth": 2,
              "value": "dice-graphlib",
              "heading": "dice-graphlib"
            }
          ],
          "title": "dice-graphlib"
        },
        "title": "dice-graphlib - new-graphlib"
      }
    ],
    "title": "new-graphlib",
    "component": (props) => props.children
  }
];
 
  // allow user to extend routes
  plugin.applyPlugins({
    key: 'patchRoutes',
    type: ApplyPluginsType.event,
    args: { routes },
  });
 
  return routes;
}