diff --git a/packages/plugin-designer/README.md b/packages/plugin-designer/README.md index 7d55f22058..1595190328 100644 --- a/packages/plugin-designer/README.md +++ b/packages/plugin-designer/README.md @@ -30,15 +30,28 @@ npm install @object-ui/plugin-designer ## Quick Start ```tsx -import { - PageDesigner, - DataModelDesigner, - CollaborationProvider, -} from '@object-ui/plugin-designer'; +import { CollaborationProvider, PageDesigner } from '@object-ui/plugin-designer'; +import type { CollaborationConfig, DesignerComponent } from '@object-ui/types'; + +const collaboration: CollaborationConfig = { + enabled: true, + roomId: 'landing-page', + showCursors: true, +}; + +const componentList: DesignerComponent[] = [ + { + id: 'headline', + type: 'text', + label: 'Headline', + position: { x: 0, y: 0, width: 480, height: 48 }, + props: { value: 'Welcome' }, + }, +]; function DesignerApp() { return ( - + +/>; ``` ### DataModelDesigner @@ -70,7 +89,13 @@ Drag-and-drop page layout builder: Entity-relationship diagram editor: ```tsx - +import { DataModelDesigner } from '@object-ui/plugin-designer'; +import type { DataModelEntity, DataModelRelationship } from '@object-ui/types'; + +declare const entities: DataModelEntity[]; +declare const relationships: DataModelRelationship[]; + +; ``` ### ProcessDesigner @@ -78,13 +103,19 @@ Entity-relationship diagram editor: BPMN-style process flow editor: ```tsx +import { ProcessDesigner } from '@object-ui/plugin-designer'; +import type { BPMNEdge, BPMNNode } from '@object-ui/types'; + +declare const nodes: BPMNNode[]; +declare const edges: BPMNEdge[]; + +/>; ``` ### ReportDesigner @@ -92,7 +123,12 @@ BPMN-style process flow editor: Visual report layout builder: ```tsx - +import { ReportDesigner } from '@object-ui/plugin-designer'; +import type { ReportDesignerSection } from '@object-ui/types'; + +declare const sections: ReportDesignerSection[]; + +; ``` ### CollaborationProvider / ConnectionStatusIndicator @@ -100,10 +136,19 @@ Visual report layout builder: Multi-user real-time editing support: ```tsx - +import { + CollaborationProvider, + ConnectionStatusIndicator, + PageDesigner, +} from '@object-ui/plugin-designer'; +import type { CollaborationConfig } from '@object-ui/types'; + +declare const collaboration: CollaborationConfig; + + - - + +; ``` ### Shared Hooks @@ -117,10 +162,13 @@ import { useConfirmDialog, } from '@object-ui/plugin-designer'; -const { undo, redo, canUndo, canRedo } = useUndoRedo(); -const { copy, paste, cut } = useClipboard(); -const { selected, select, selectAll, clearSelection } = useMultiSelect(); -const { zoom, pan, resetView } = useCanvasPanZoom(); +import type { DesignerComponent } from '@object-ui/types'; + +const { undo, redo, canUndo, canRedo } = useUndoRedo([]); +const { clipboard, copy, paste, hasContent } = useClipboard(); +const { selectedIds, selectOne, selectMany, clearSelection } = useMultiSelect(); +const { zoom, panOffset, zoomIn, zoomOut, resetZoom } = useCanvasPanZoom(); +const { confirm, isOpen } = useConfirmDialog(); ``` ### Shared Components diff --git a/scripts/check-doc-snippet-types.mjs b/scripts/check-doc-snippet-types.mjs index 5024e6bf9a..41b5649dcc 100644 --- a/scripts/check-doc-snippet-types.mjs +++ b/scripts/check-doc-snippet-types.mjs @@ -733,8 +733,6 @@ const UNGATED_DOCS = { '6 parse diagnostic(s) — blocks fenced `ts` that are bare object literals or elided bodies', 'packages/plugin-chatbot/README.md': '5 undefined-name diagnostic(s) — blocks continue an earlier block, or use ambient names the page never defines; 1 unresolved-module diagnostic(s); plus TS17000x1 TS2322x1 — candidate real defects, un-triaged', - 'packages/plugin-designer/README.md': - '2 parse diagnostic(s) — blocks fenced `ts` that are bare object literals or elided bodies; 12 undefined-name diagnostic(s) — blocks continue an earlier block, or use ambient names the page never defines; plus TS2339x6 TS2554x1 TS2741x1 — candidate real defects, un-triaged', 'packages/plugin-detail/README.md': '5 parse diagnostic(s) — blocks fenced `ts` that are bare object literals or elided bodies; 15 undefined-name diagnostic(s) — blocks continue an earlier block, or use ambient names the page never defines', 'packages/plugin-editor/README.md':