Skip to content

Commit 60baf03

Browse files
committed
docs: update import paths from @chaibuilder/runtime to @chaibuilder/sdk/runtime
1 parent df4e611 commit 60baf03

File tree

8 files changed

+233
-4
lines changed

8 files changed

+233
-4
lines changed

.github/workflows/docs.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Deploy Docs to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- "docs/**"
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: read
13+
pages: write
14+
id-token: write
15+
16+
concurrency:
17+
group: "pages"
18+
cancel-in-progress: false
19+
20+
jobs:
21+
deploy:
22+
environment:
23+
name: github-pages
24+
url: ${{ steps.deployment.outputs.page_url }}
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
30+
- name: Setup Pages
31+
uses: actions/configure-pages@v4
32+
33+
- name: Upload artifact
34+
uses: actions/upload-pages-artifact@v3
35+
with:
36+
path: "./docs"
37+
38+
- name: Deploy to GitHub Pages
39+
id: deployment
40+
uses: actions/deploy-pages@v4

docs/.nojekyll

Whitespace-only changes.

docs/404.html

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<title>ChaiBuilder SDK Documentation</title>
6+
<script>
7+
// Single Page Apps for GitHub Pages
8+
// https://github.com/rafgraph/spa-github-pages
9+
var pathSegmentsToKeep = 0;
10+
var l = window.location;
11+
l.replace(
12+
l.protocol +
13+
"//" +
14+
l.hostname +
15+
(l.port ? ":" + l.port : "") +
16+
l.pathname
17+
.split("/")
18+
.slice(0, 1 + pathSegmentsToKeep)
19+
.join("/") +
20+
"/?/" +
21+
l.pathname.slice(1).split("/").slice(pathSegmentsToKeep).join("/").replace(/&/g, "~and~") +
22+
(l.search ? "&" + l.search.slice(1).replace(/&/g, "~and~") : "") +
23+
l.hash,
24+
);
25+
</script>
26+
</head>
27+
<body>
28+
Redirecting...
29+
</body>
30+
</html>

docs/README.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# ChaiBuilder SDK Documentation
2+
3+
Welcome to the ChaiBuilder SDK documentation. ChaiBuilder is a powerful visual page builder SDK for React applications.
4+
5+
[![npm version](https://img.shields.io/npm/v/@chaibuilder/sdk.svg)](https://www.npmjs.com/package/@chaibuilder/sdk)
6+
[![GitHub release](https://img.shields.io/github/v/release/chaibuilder/sdk)](https://github.com/chaibuilder/sdk/releases)
7+
8+
> **Latest Version: v3.1.31**[View Release Notes](https://github.com/chaibuilder/sdk/releases)
9+
10+
## Quick Links
11+
12+
- [Getting Started](./getting-started.md)
13+
- [Editor Props Reference](./editor-props-reference.md)
14+
- [Registering Custom Blocks](./registering-custom-blocks.md)
15+
- [Theme Presets](./theme-presets.md)
16+
- [Extensions API](./extensions-api.md)
17+
- [Hooks Reference](./hooks-reference.md)
18+
- [Permissions](./permissions.md)
19+
- [Feature Flags](./feature-flags.md)
20+
- [Types Reference](./types-reference.md)
21+
22+
## Installation
23+
24+
```bash
25+
npm install @chaibuilder/sdk
26+
# or
27+
yarn add @chaibuilder/sdk
28+
# or
29+
pnpm add @chaibuilder/sdk
30+
```
31+
32+
## Basic Usage
33+
34+
```tsx
35+
import { ChaiBuilderEditor } from "@chaibuilder/sdk";
36+
37+
function App() {
38+
return (
39+
<ChaiBuilderEditor
40+
blocks={[]}
41+
onSave={async ({ blocks, theme }) => {
42+
console.log("Saving:", blocks, theme);
43+
return true;
44+
}}
45+
/>
46+
);
47+
}
48+
```
49+
50+
## Key Features
51+
52+
- **Visual Page Builder** - Drag-and-drop interface for building pages
53+
- **Custom Blocks** - Register your own block types
54+
- **Theme System** - Configurable theme with presets and dark mode support
55+
- **Extensible** - Add custom panels, media managers, libraries, and more
56+
- **Permissions** - Fine-grained permission control
57+
- **i18n Support** - Built-in internationalization
58+
- **Undo/Redo** - Full history management

docs/_sidebar.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
- **Getting Started**
2+
- [Home](/)
3+
- [Getting Started](getting-started.md)
4+
5+
- **Configuration**
6+
- [Editor Props Reference](editor-props-reference.md)
7+
- [Theme Presets](theme-presets.md)
8+
- [Permissions](permissions.md)
9+
- [Feature Flags](feature-flags.md)
10+
11+
- **Customization**
12+
- [Registering Custom Blocks](registering-custom-blocks.md)
13+
- [Extensions API](extensions-api.md)
14+
15+
- **Reference**
16+
- [Hooks Reference](hooks-reference.md)
17+
- [Types Reference](types-reference.md)

docs/extensions-api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ type AddBlockTab = {
279279
Register custom fonts for use in the theme.
280280

281281
```typescript
282-
import { registerChaiFont } from "@chaibuilder/runtime";
282+
import { registerChaiFont } from "@chaibuilder/sdk/runtime";
283283

284284
// Via URL (Google Fonts, etc.)
285285
registerChaiFont("Ubuntu", {

docs/index.html

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<title>ChaiBuilder SDK Documentation</title>
6+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
7+
<meta name="description" content="ChaiBuilder SDK - A powerful visual page builder SDK for React applications" />
8+
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0" />
9+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsify@4/lib/themes/vue.css" />
10+
<style>
11+
:root {
12+
--theme-color: #3b82f6;
13+
--theme-color-light: #60a5fa;
14+
}
15+
.sidebar-nav > ul > li > a {
16+
font-weight: 600;
17+
}
18+
.markdown-section code {
19+
border-radius: 4px;
20+
}
21+
.markdown-section pre {
22+
border-radius: 8px;
23+
}
24+
.app-name-link img {
25+
max-width: 120px;
26+
}
27+
</style>
28+
<!-- Single Page Apps for GitHub Pages redirect handler -->
29+
<script>
30+
(function (l) {
31+
if (l.search[1] === "/") {
32+
var decoded = l.search
33+
.slice(1)
34+
.split("&")
35+
.map(function (s) {
36+
return s.replace(/~and~/g, "&");
37+
})
38+
.join("?");
39+
window.history.replaceState(null, null, l.pathname.slice(0, -1) + decoded + l.hash);
40+
}
41+
})(window.location);
42+
</script>
43+
</head>
44+
<body>
45+
<div id="app"></div>
46+
<script>
47+
window.$docsify = {
48+
name: "ChaiBuilder SDK",
49+
repo: "chaibuilder/sdk",
50+
loadSidebar: true,
51+
subMaxLevel: 3,
52+
auto2top: true,
53+
routerMode: "history",
54+
search: {
55+
placeholder: "Search docs...",
56+
noData: "No results found",
57+
depth: 3,
58+
},
59+
copyCode: {
60+
buttonText: "Copy",
61+
successText: "Copied!",
62+
},
63+
pagination: {
64+
previousText: "Previous",
65+
nextText: "Next",
66+
crossChapter: true,
67+
},
68+
themeColor: "#3b82f6",
69+
};
70+
</script>
71+
<!-- Docsify -->
72+
<script src="https://cdn.jsdelivr.net/npm/docsify@4"></script>
73+
<!-- Search plugin -->
74+
<script src="https://cdn.jsdelivr.net/npm/docsify@4/lib/plugins/search.min.js"></script>
75+
<!-- Copy code plugin -->
76+
<script src="https://cdn.jsdelivr.net/npm/docsify-copy-code@2"></script>
77+
<!-- Pagination plugin -->
78+
<script src="https://cdn.jsdelivr.net/npm/docsify-pagination@2/dist/docsify-pagination.min.js"></script>
79+
<!-- Syntax highlighting -->
80+
<script src="https://cdn.jsdelivr.net/npm/prismjs@1/components/prism-typescript.min.js"></script>
81+
<script src="https://cdn.jsdelivr.net/npm/prismjs@1/components/prism-tsx.min.js"></script>
82+
<script src="https://cdn.jsdelivr.net/npm/prismjs@1/components/prism-bash.min.js"></script>
83+
</body>
84+
</html>

docs/registering-custom-blocks.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The `registerChaiBlock` function enables you to register custom React components
99
## Basic Syntax
1010

1111
```typescript
12-
import { registerChaiBlock } from "@chaibuilder/runtime";
12+
import { registerChaiBlock } from "@chaibuilder/sdk/runtime";
1313

1414
registerChaiBlock<PropsType>(Component, Config);
1515
```
@@ -23,7 +23,7 @@ import {
2323
ChaiBlockComponentProps,
2424
ChaiStyles,
2525
StylesProp,
26-
} from "@chaibuilder/runtime";
26+
} from "@chaibuilder/sdk/runtime";
2727

2828
// 1. Define component props
2929
type ButtonProps = {
@@ -159,7 +159,7 @@ registerChaiBlockSchema({
159159
Always include styles for visual customization:
160160

161161
```typescript
162-
import { StylesProp } from "@chaibuilder/runtime";
162+
import { StylesProp } from "@chaibuilder/sdk/runtime";
163163

164164
registerChaiBlockSchema({
165165
properties: {

0 commit comments

Comments
 (0)