Browse Source

chore: 部署storybook

pull/194/head
cp3hnu 9 months ago
parent
commit
63e73ab772
12 changed files with 14 additions and 12 deletions
  1. +2
    -0
      .gitignore
  2. +0
    -1
      react-ui/.storybook/babel-plugin-auto-css-modules.js
  3. +5
    -1
      react-ui/.storybook/main.ts
  4. +1
    -0
      react-ui/package.json
  5. BIN
      react-ui/public/fonts/TaoBaoMaiCaiTi-Regular.otf
  6. BIN
      react-ui/public/fonts/TaoBaoMaiCaiTi-Regular.ttf
  7. BIN
      react-ui/public/fonts/TaoBaoMaiCaiTi-Regular.woff
  8. BIN
      react-ui/public/fonts/TaoBaoMaiCaiTi-Regular.woff2
  9. +1
    -1
      react-ui/src/components/IFramePage/index.tsx
  10. +1
    -1
      react-ui/src/stories/FullScreenFrame.stories.tsx
  11. +1
    -1
      react-ui/src/stories/IFramePage.stories.tsx
  12. +3
    -7
      react-ui/src/utils/functional.ts

+ 2
- 0
.gitignore View File

@@ -63,3 +63,5 @@ mvnw

/react-ui/docs
/react-ui/types/tsconfig.tsbuildinfo
/react-ui/storybook-static
/react-ui/.storybook/deploy.sh

+ 0
- 1
react-ui/.storybook/babel-plugin-auto-css-modules.js View File

@@ -4,7 +4,6 @@ export default function(babel) {
visitor: {
ImportDeclaration(path) {
const source = path.node.source.value;
// console.log("zzzz", source);
if (source.endsWith('.less')) {
if (path.node.specifiers.length > 0) {
path.node.source.value += "?modules";


+ 5
- 1
react-ui/.storybook/main.ts View File

@@ -16,7 +16,11 @@ const config: StorybookConfig = {
name: '@storybook/react-webpack5',
options: {},
},
staticDirs: ['../public', { from: '../docs', to: '/docs' }],
staticDirs: [
'../public',
{ from: '../docs', to: '/docs' },
{ from: '../docs/index.html', to: '/docs/index.html' },
],
docs: {
defaultName: 'Documentation',
},


+ 1
- 0
react-ui/package.json View File

@@ -40,6 +40,7 @@
"start:test": "cross-env REACT_APP_ENV=test MOCK=none UMI_ENV=dev max dev",
"storybook": "storybook dev -p 6006",
"storybook-build": "storybook build",
"storybook-deploy": "./.storybook/deploy.sh",
"storybook-docs": "storybook dev --docs",
"storybook-docs-build": "storybook build --docs",
"test": "jest",


BIN
react-ui/public/fonts/TaoBaoMaiCaiTi-Regular.otf View File


BIN
react-ui/public/fonts/TaoBaoMaiCaiTi-Regular.ttf View File


BIN
react-ui/public/fonts/TaoBaoMaiCaiTi-Regular.woff View File


BIN
react-ui/public/fonts/TaoBaoMaiCaiTi-Regular.woff2 View File


+ 1
- 1
react-ui/src/components/IFramePage/index.tsx View File

@@ -44,7 +44,7 @@ type IframePageProps = {
/** 子系统 */
type: IframePageType;
/** 是否可以在页签上打开 */
openInTab: boolean;
openInTab?: boolean;
/** 自定义样式类名 */
className?: string;
/** 自定义样式 */


+ 1
- 1
react-ui/src/stories/FullScreenFrame.stories.tsx View File

@@ -4,7 +4,7 @@ import { fn } from '@storybook/test';

// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
const meta = {
title: 'Components/FullScreenFrame 全屏iframe',
title: 'Components/FullScreenFrame 全屏 iframe',
component: FullScreenFrame,
parameters: {
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout


+ 1
- 1
react-ui/src/stories/IFramePage.stories.tsx View File

@@ -3,7 +3,7 @@ import type { Meta, StoryObj } from '@storybook/react';

// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
const meta = {
title: 'Components/IFramePage iframe页面',
title: 'Components/IFramePage iframe 页面',
component: IFramePage,
parameters: {
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout


+ 3
- 7
react-ui/src/utils/functional.ts View File

@@ -5,14 +5,10 @@
*/

/**
* Safely invokes a function with a given value, returning the result of the
* function or the provided value if it is `undefined` or `null`.
* 安全调用函数,如果参数是 `undefined` 或 `null`,直接返回 `undefined` 或 `null`,而不会导致异常
*
* @template T - The type of the input value.
* @template M - The type of the output value.
* @param {function} fn - The function to be invoked with the input value.
* @returns {function} A function that takes a value, invokes `fn` with it if
* it's not `undefined` or `null`, and returns the result or the original value.
* @param fn - 要调用的函数
* @returns 封装后的函数,该函数的参数如果是 `undefined` 或 `null`,结果直接返回 `undefined` 或 `null`,而不会导致异常
*/
export function safeInvoke<T, M>(
fn: (value: T) => M | undefined | null,


Loading…
Cancel
Save