New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

pb-sxp-ui

Package Overview
Dependencies
Maintainers
0
Versions
229
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pb-sxp-ui

React enterprise-class UI components

1.15.11
latest
npm
Version published
Weekly downloads
50
-55.36%
Maintainers
0
Weekly downloads
 
Created
Source

Page Builder SXP UI

React enterprise-class UI components

📦 安装

npm install pb-sxp-ui
# or
yarn add pb-sxp-ui

🔨 使用

以 Next.js 框架为例子:

import { GetServerSideProps } from 'next';
import React, { FC } from 'react'
import Pagebuilder, { PageView } from 'pb-sxp-ui';

// 初始化 PageBuilder 配置
Pagebuilder.init({
  tenantId: 'xxxxxxxxxx',
  appId: 'xxxxxxxxx',
  env: 'live' // 可选参数,默认是 live 环境
});


interface IProps {
  path: string;
  data: any
}

const ContentPage: FC<IProps> = ({ data ,path}) => {
  return (
    <PageView data={data?.data} isSsr path={path}/>
  )
}

export const getServerSideProps: GetServerSideProps<IProps> = async (
  context
) => {
  // 接收传来的路径
  const path = context.query.path as string;
  // 获取页面数据
  const result = await Pagebuilder.getDetail(path)
  return {
    props: {
      path,
      data: result.data
    },
  };
};

export default ContentPage;

⌨️ 本地调试

运行开发环境

$ npm install
$ npm run start

生成本地开发全局链接

npm link
# or
yarn link

在使用该包的项目中安装调试

npm link pb-sxp-ui
# or
yarn link pb-sxp-ui

👾 发布

打包线上安装包

npm run package
# or
yarn package

发布 npm

$ npm version patch|minor|major
$ npm publish

# 自动化发布包
$ npm run pub patch|minor|major|xx.xx.xx

Keywords

react

FAQs

Package last updated on 28 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts