Skip to content

v2.0.0

Compare
Choose a tag to compare
@github-actions github-actions released this 09 Jun 01:05
· 61 commits to main since this release

npm version

Documentation v2.0.0: https://raw.githack.com/uiwjs/react-code-preview-layout/51f7ca8/index.html
Comparing Changes: v1.0.0...v2.0.0

- export interface CodeProps {
-   /** 原始 代码块 渲染**/
-   code?: React.ReactNode;
-   /** 代码块字符串 **/
-   copyNodes?: string;
-   /* 自定义操作按钮 **/
-   customButton?: React.ReactNode;
-   /** 展示代码块内边距 **/
-   codePadding?: number;
-   /** codeSandbox参数 **/
-   codeSandboxOptions?: CodeSandboxProps;
-   /** codePen参数 **/
-   codePenOptions?: CodePenOption & {
-     /** 不需要注释的包 **/
-     includeModule?: string[];
-   };
-   /** 标题部分 **/
-   title?: React.ReactNode;
- }

- export interface CodeLayoutProps extends CodeProps {
+ interface CodeLayoutProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
  className?: string;
  children?: React.ReactNode;
  prefixCls?: string;
-  /** 只显示效果 **/
-  noButton?: boolean;
  /** 是否需要边框 */
  bordered?: boolean;
+  /** 原始 代码块 渲染**/
+  code?: React.ReactNode;
+  text?: string;
+  /** 标题部分,也可以放置按钮 **/
+  toolbar?: React.ReactNode;
+  /** 额外内容,展示 toolbar 右侧内容 */
+  toolbarExtra?: React.ReactNode;
+  disableToolbar?: boolean;
+  disableCode?: boolean;
+  disablePreview?: boolean;
+  /** 禁用方格背景 */
+  disableCheckered?: boolean;
+  /**
+   * 是否显示复制按钮
+   * @default true
+   */
+  copied?: boolean;
}