Skip to content

Commit 295a877

Browse files
committed
Refactor documentation and code for field schemas and plugins
- Updated field schema examples in documentation to use `plaintext` instead of `typescript` for better clarity. - Enhanced various field components (Grid, Image, Location, Lookup, Number, Object, Password, Percent, Phone, Rich Text, Select, Summary, Text, TextArea, Time, URL, User, Vector) to reflect the schema changes. - Improved documentation for layout components (AppShell, PageHeader, SidebarNav) to ensure consistent usage of `plaintext` formatting. - Adjusted plugin documentation (AG Grid, Calendar, Charts, Chatbot, Dashboard, Editor, Form, Gantt, Grid, Kanban, Map, Markdown, Timeline, View) to align with the new schema format. - Fixed potential null reference issues in TextField component by adding optional chaining.
1 parent d474717 commit 295a877

127 files changed

Lines changed: 323 additions & 381 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/console/plugin.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
1-
import path from 'path';
2-
import { fileURLToPath } from 'url';
31

4-
const __filename = fileURLToPath(import.meta.url);
5-
const __dirname = path.dirname(__filename);
6-
7-
export const staticPath = path.join(__dirname, 'dist');
2+
export const staticPath = 'dist';
83

94
export default {
105
staticPath,

content/docs/blocks/block-schema.mdx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ BlockSchema enables:
1919

2020
## Basic Usage
2121

22-
```typescript
22+
```plaintext
2323
import type { BlockSchema } from '@object-ui/types';
2424
2525
const heroBlock: BlockSchema = {
@@ -65,7 +65,7 @@ const heroBlock: BlockSchema = {
6565

6666
### Block Metadata
6767

68-
```typescript
68+
```plaintext
6969
interface BlockMetadata {
7070
name: string; // Block identifier
7171
label?: string; // Display name
@@ -86,7 +86,7 @@ interface BlockMetadata {
8686

8787
Variables define configurable properties:
8888

89-
```typescript
89+
```plaintext
9090
interface BlockVariable {
9191
name: string; // Variable name
9292
label?: string; // Display label
@@ -103,7 +103,7 @@ interface BlockVariable {
103103

104104
Slots define content injection points:
105105

106-
```typescript
106+
```plaintext
107107
interface BlockSlot {
108108
name: string; // Slot name
109109
label?: string; // Display label
@@ -117,7 +117,7 @@ interface BlockSlot {
117117

118118
## Complete Example
119119

120-
```typescript
120+
```plaintext
121121
const cardBlock: BlockSchema = {
122122
type: 'block',
123123
@@ -258,7 +258,7 @@ const cardBlock: BlockSchema = {
258258

259259
Use `BlockInstanceSchema` to instantiate a block:
260260

261-
```typescript
261+
```plaintext
262262
import type { BlockInstanceSchema } from '@object-ui/types';
263263
264264
const instance: BlockInstanceSchema = {
@@ -295,7 +295,7 @@ const instance: BlockInstanceSchema = {
295295

296296
Use `BlockLibrarySchema` to browse available blocks:
297297

298-
```typescript
298+
```plaintext
299299
import type { BlockLibrarySchema } from '@object-ui/types';
300300
301301
const library: BlockLibrarySchema = {
@@ -331,7 +331,7 @@ const library: BlockLibrarySchema = {
331331

332332
Use `BlockEditorSchema` to create/edit blocks:
333333

334-
```typescript
334+
```plaintext
335335
import type { BlockEditorSchema } from '@object-ui/types';
336336
337337
const editor: BlockEditorSchema = {
@@ -351,7 +351,7 @@ const editor: BlockEditorSchema = {
351351

352352
## Marketplace Example
353353

354-
```typescript
354+
```plaintext
355355
const marketplace: BlockLibrarySchema = {
356356
type: 'block-library',
357357
apiEndpoint: 'https://blocks.objectui.com/api',
@@ -402,7 +402,7 @@ const marketplace: BlockLibrarySchema = {
402402

403403
## Runtime Validation
404404

405-
```typescript
405+
```plaintext
406406
import { BlockSchema } from '@object-ui/types/zod';
407407
408408
const result = BlockSchema.safeParse(myBlock);

content/docs/components/basic/button-group.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ The Button Group component groups multiple buttons together with consistent styl
8282

8383
## Schema
8484

85-
```typescript
85+
```plaintext
8686
interface ButtonGroupButton {
8787
label?: string;
8888
value: string;

content/docs/components/basic/div.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Below are the old `div` examples. Please migrate to the alternatives shown above
7373

7474
## Schema
7575

76-
```typescript
76+
```plaintext
7777
// ⚠️ DEPRECATED - Use Card, Flex, Grid, or other layout components instead
7878
interface DivSchema {
7979
type: 'div';

content/docs/components/basic/html.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { ComponentDemo, DemoGrid } from '@/app/components/ComponentDemo';
1717

1818
## Schema
1919

20-
```typescript
20+
```plaintext
2121
interface HtmlSchema {
2222
type: 'html';
2323
html: string;

content/docs/components/basic/icon.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ import { ComponentDemo, DemoGrid } from '@/app/components/ComponentDemo';
7373

7474
## Schema
7575

76-
```typescript
76+
```plaintext
7777
interface IconSchema {
7878
type: 'icon';
7979
name: string; // Lucide icon name (kebab-case)

content/docs/components/basic/image.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import { ComponentDemo, DemoGrid } from '@/app/components/ComponentDemo';
2929

3030
## Schema
3131

32-
```typescript
32+
```plaintext
3333
interface ImageSchema {
3434
type: 'image';
3535
src: string;

content/docs/components/basic/navigation-menu.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ The Navigation Menu component provides an accessible menu for site navigation.
7171

7272
## Schema
7373

74-
```typescript
74+
```plaintext
7575
interface NavigationMenuItem {
7676
label: string;
7777
href?: string;

content/docs/components/basic/pagination.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ The Pagination component allows users to navigate through pages of data.
3333

3434
## Schema
3535

36-
```typescript
36+
```plaintext
3737
interface PaginationSchema {
3838
type: 'pagination';
3939
currentPage: number; // Current page (1-based)

content/docs/components/basic/separator.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ import { ComponentDemo, DemoGrid } from '@/app/components/ComponentDemo';
5252

5353
## Schema
5454

55-
```typescript
55+
```plaintext
5656
interface SeparatorSchema {
5757
type: 'separator';
5858
orientation?: 'horizontal' | 'vertical';

0 commit comments

Comments
 (0)