import { defineConfig } from "dumi";
import { join } from "path";

export default defineConfig({
  history: {
    type: "hash",
  },
  title: "@dage/tools",
  favicon: "https://4dkk.4dage.com/FDKKIMG/icon/kankan_icon.ico",
  outputPath: "docs-dist",
  mode: "site",
  resolve: {
    includes: ["./docs"],
  },
  headScripts: [
    { src: "https://houseoss.4dkankan.com/project/leifeng-transfer/tour.js" },
  ],
  alias: {
    "@dage/utils": join(__dirname, "../utils/dist/"),
    "@dage/service": join(__dirname, "../service/dist/"),
    "@dage/pc-components": join(__dirname, "../pc-components/dist/"),
    "@dage/krpano": join(__dirname, "../krpano/build/"),
  },
  navs: [
    {
      title: "组件",
      path: "/components",
    },
    {
      title: "工具",
      path: "/utils",
    },
    {
      title: "service",
      path: "/service",
    },
    {
      title: "krpano",
      path: "/krpano",
    },
    {
      title: "更新日志",
      path: "/log",
    },
    {
      title: "Gogs",
      path: "http://face3d.4dage.com:7005/chenlei/dage-web-tools",
    },
  ],
  menus: {
    "/components": [
      {
        title: "获取用户信息",
        path: "/components/login",
      },
      {
        title: "布局",
        children: ["/components/TableActions"],
      },
      {
        title: "表单组件",
        children: [
          "/components/Upload",
          "/components/FileCheckbox",
          "/components/Map",
        ],
      },
      {
        title: "工具",
        children: [
          /**
           * @deprecated 将控制权交给应用，使用 @dage/service
           */
          // "/components/utils/services",
          "/components/utils/storage",
        ],
      },
    ],
    "/utils": [
      {
        title: "EventBus 事件",
        path: "/utils/eventbus",
      },
      {
        title: "日期格式化",
        path: "/utils/date",
      },
      {
        title: "string 方法",
        path: "/utils/string",
      },
    ],
    "/log": [
      {
        title: "pc-components 更新日志",
        path: "/log/PC-COMPONENTS_CHANGELOG",
      },
      {
        title: "backend-cli 更新日志",
        path: "/log/BACKEND-CLI_CHANGELOG",
      },
      {
        title: "utils 更新日志",
        path: "/log/UTILS_CHANGELOG",
      },
      {
        title: "service 更新日志",
        path: "/log/SERVICE_CHANGELOG",
      },
    ],
    "/krpano": [
      {
        title: "基本使用",
        path: "/krpano",
      },
      {
        title: "Scene 场景",
        path: "/krpano/scene",
      },
      {
        title: "HotSpot 热点",
        path: "/krpano/hotspot",
      },
      {
        title: "Autorotate 自动旋转",
        path: "/krpano/autorotate",
      },
      {
        title: "View 视角",
        path: "/krpano/view",
      },
      {
        title: "Events 事件",
        path: "/krpano/events",
      },
    ],
  },
  // more config: https://d.umijs.org/config
});
