makersclaw 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +41 -1
- package/THIRD-PARTY-NOTICES.md +180 -0
- package/package.json +15 -8
- package/r/annotate.json +62 -0
- package/r/approval-request.json +52 -0
- package/r/audio-player.json +74 -0
- package/r/auth-form.json +55 -0
- package/r/board.json +55 -0
- package/r/calendar-view.json +105 -0
- package/r/cart.json +62 -0
- package/r/chart.json +83 -0
- package/r/chat.json +95 -0
- package/r/code-editor.json +94 -0
- package/r/comment-box.json +64 -0
- package/r/contact-section.json +53 -0
- package/r/core.json +341 -0
- package/r/csv-import.json +63 -0
- package/r/data-table.json +69 -0
- package/r/diagram.json +74 -0
- package/r/doc-editor.json +82 -0
- package/r/doc-page.json +61 -0
- package/r/email-render.json +73 -0
- package/r/faq.json +50 -0
- package/r/file-upload.json +54 -0
- package/r/flow-canvas.json +93 -0
- package/r/footer.json +52 -0
- package/r/gantt.json +70 -0
- package/r/job-panel.json +56 -0
- package/r/json-editor.json +66 -0
- package/r/map.json +89 -0
- package/r/menubar.json +52 -0
- package/r/mind-map.json +67 -0
- package/r/navigation-menu.json +52 -0
- package/r/order-detail.json +54 -0
- package/r/org-chart.json +66 -0
- package/r/page-builder.json +105 -0
- package/r/payment-methods.json +51 -0
- package/r/pdf-document.json +79 -0
- package/r/pdf-viewer.json +88 -0
- package/r/product-detail.json +76 -0
- package/r/product-grid.json +65 -0
- package/r/record-form.json +67 -0
- package/r/record-notes.json +55 -0
- package/r/registry.json +3612 -0
- package/r/search-dialog.json +51 -0
- package/r/settings-list.json +66 -0
- package/r/setup-checklist.json +51 -0
- package/r/share-dialog.json +52 -0
- package/r/sidebar.json +69 -0
- package/r/signature-pad.json +72 -0
- package/r/sketch-canvas.json +99 -0
- package/r/spreadsheet.json +90 -0
- package/r/stat-cards.json +66 -0
- package/r/task-list.json +63 -0
- package/r/task-model.json +98 -0
- package/r/testimonials.json +52 -0
- package/r/transaction-list.json +53 -0
- package/r/whiteboard.json +66 -0
- package/registry/blocks/annotate/README.md +179 -0
- package/registry/blocks/annotate/annotate-data.js +250 -0
- package/registry/blocks/annotate/annotate.jsx +646 -0
- package/registry/blocks/annotate/block.json +10 -0
- package/registry/blocks/annotate/demo.jsx +135 -0
- package/registry/blocks/annotate/index.js +15 -0
- package/registry/blocks/approval-request/README.md +116 -0
- package/registry/blocks/approval-request/approval-request.jsx +386 -0
- package/registry/blocks/approval-request/block.json +10 -0
- package/registry/blocks/approval-request/demo.jsx +127 -0
- package/registry/blocks/approval-request/index.js +4 -0
- package/registry/blocks/audio-player/README.md +167 -0
- package/registry/blocks/audio-player/audio-player.jsx +623 -0
- package/registry/blocks/audio-player/block.json +14 -0
- package/registry/blocks/audio-player/colors.js +109 -0
- package/registry/blocks/audio-player/demo.jsx +209 -0
- package/registry/blocks/audio-player/index.js +6 -0
- package/registry/blocks/audio-player/time.js +67 -0
- package/registry/blocks/audio-player/wavesurfer.js +9 -0
- package/registry/blocks/auth-form/README.md +126 -0
- package/registry/blocks/auth-form/auth-form.jsx +568 -0
- package/registry/blocks/auth-form/block.json +10 -0
- package/registry/blocks/auth-form/demo.jsx +131 -0
- package/registry/blocks/auth-form/index.js +3 -0
- package/registry/blocks/board/README.md +64 -13
- package/registry/blocks/board/block.json +2 -2
- package/registry/blocks/board/board.jsx +237 -94
- package/registry/blocks/board/demo.jsx +103 -24
- package/registry/blocks/calendar-view/README.md +180 -0
- package/registry/blocks/calendar-view/agenda.jsx +147 -0
- package/registry/blocks/calendar-view/block.json +76 -0
- package/registry/blocks/calendar-view/calendar-model.js +442 -0
- package/registry/blocks/calendar-view/calendar.jsx +627 -0
- package/registry/blocks/calendar-view/demo.jsx +195 -0
- package/registry/blocks/calendar-view/draft.jsx +49 -0
- package/registry/blocks/calendar-view/index.js +39 -0
- package/registry/blocks/calendar-view/month.jsx +346 -0
- package/registry/blocks/calendar-view/paint.js +69 -0
- package/registry/blocks/calendar-view/time-grid.jsx +527 -0
- package/registry/blocks/calendar-view/tray.jsx +87 -0
- package/registry/blocks/cart/README.md +146 -0
- package/registry/blocks/cart/block.json +10 -0
- package/registry/blocks/cart/cart.jsx +597 -0
- package/registry/blocks/cart/demo.jsx +98 -0
- package/registry/blocks/cart/index.js +4 -0
- package/registry/blocks/cart/money.js +28 -0
- package/registry/blocks/chart/README.md +316 -0
- package/registry/blocks/chart/block.json +10 -0
- package/registry/blocks/chart/cartesian.jsx +642 -0
- package/registry/blocks/chart/core.jsx +262 -0
- package/registry/blocks/chart/demo.jsx +357 -0
- package/registry/blocks/chart/heatmap.jsx +336 -0
- package/registry/blocks/chart/index.js +8 -0
- package/registry/blocks/chart/pie.jsx +245 -0
- package/registry/blocks/chart/sparkline.jsx +88 -0
- package/registry/blocks/chat/README.md +273 -0
- package/registry/blocks/chat/attachment.jsx +95 -0
- package/registry/blocks/chat/block.json +10 -0
- package/registry/blocks/chat/chat.jsx +132 -0
- package/registry/blocks/chat/composer.jsx +364 -0
- package/registry/blocks/chat/demo.jsx +578 -0
- package/registry/blocks/chat/header.jsx +34 -0
- package/registry/blocks/chat/index.js +9 -0
- package/registry/blocks/chat/message.jsx +450 -0
- package/registry/blocks/chat/scroller.jsx +247 -0
- package/registry/blocks/chat/text.jsx +104 -0
- package/registry/blocks/code-editor/README.md +210 -0
- package/registry/blocks/code-editor/block.json +22 -0
- package/registry/blocks/code-editor/code-editor.jsx +534 -0
- package/registry/blocks/code-editor/codemirror.js +38 -0
- package/registry/blocks/code-editor/demo.jsx +205 -0
- package/registry/blocks/code-editor/index.js +8 -0
- package/registry/blocks/code-editor/json.js +317 -0
- package/registry/blocks/code-editor/sql.js +136 -0
- package/registry/blocks/code-editor/text.js +101 -0
- package/registry/blocks/code-editor/theme.js +186 -0
- package/registry/blocks/comment-box/README.md +123 -0
- package/registry/blocks/comment-box/block.json +10 -0
- package/registry/blocks/comment-box/comment-body.jsx +217 -0
- package/registry/blocks/comment-box/comment-box.jsx +198 -0
- package/registry/blocks/comment-box/comment-time.jsx +77 -0
- package/registry/blocks/comment-box/demo.jsx +141 -0
- package/registry/blocks/comment-box/index.js +8 -0
- package/registry/blocks/contact-section/README.md +152 -0
- package/registry/blocks/contact-section/block.json +11 -0
- package/registry/blocks/contact-section/contact-section.jsx +509 -0
- package/registry/blocks/contact-section/demo.jsx +93 -0
- package/registry/blocks/contact-section/index.js +4 -0
- package/registry/blocks/csv-import/README.md +133 -0
- package/registry/blocks/csv-import/block.json +13 -0
- package/registry/blocks/csv-import/csv-import.jsx +479 -0
- package/registry/blocks/csv-import/demo.jsx +106 -0
- package/registry/blocks/csv-import/import.js +200 -0
- package/registry/blocks/csv-import/index.js +7 -0
- package/registry/blocks/data-table/README.md +386 -0
- package/registry/blocks/data-table/block.json +10 -0
- package/registry/blocks/data-table/data-table.jsx +1164 -0
- package/registry/blocks/data-table/demo.jsx +588 -0
- package/registry/blocks/data-table/index.js +5 -0
- package/registry/blocks/data-table/model.js +169 -0
- package/registry/blocks/diagram/README.md +108 -0
- package/registry/blocks/diagram/block.json +13 -0
- package/registry/blocks/diagram/demo.jsx +113 -0
- package/registry/blocks/diagram/diagram.jsx +481 -0
- package/registry/blocks/diagram/index.js +7 -0
- package/registry/blocks/diagram/mermaid.js +52 -0
- package/registry/blocks/diagram/palette.js +313 -0
- package/registry/blocks/diagram/source.js +98 -0
- package/registry/blocks/doc-editor/README.md +215 -0
- package/registry/blocks/doc-editor/block.json +15 -0
- package/registry/blocks/doc-editor/demo.jsx +225 -0
- package/registry/blocks/doc-editor/doc-editor.jsx +291 -0
- package/registry/blocks/doc-editor/doc.js +309 -0
- package/registry/blocks/doc-editor/index.js +7 -0
- package/registry/blocks/doc-editor/schema.jsx +56 -0
- package/registry/blocks/doc-editor/shadcn-classes.js +110 -0
- package/registry/blocks/doc-editor/theme.js +82 -0
- package/registry/blocks/doc-page/README.md +119 -0
- package/registry/blocks/doc-page/autosave.js +104 -0
- package/registry/blocks/doc-page/block.json +10 -0
- package/registry/blocks/doc-page/demo.jsx +137 -0
- package/registry/blocks/doc-page/doc-page.jsx +276 -0
- package/registry/blocks/doc-page/index.js +4 -0
- package/registry/blocks/email-render/README.md +151 -0
- package/registry/blocks/email-render/block.json +14 -0
- package/registry/blocks/email-render/demo.jsx +153 -0
- package/registry/blocks/email-render/doc-email.jsx +210 -0
- package/registry/blocks/email-render/email.jsx +221 -0
- package/registry/blocks/email-render/index.js +10 -0
- package/registry/blocks/email-render/render.js +50 -0
- package/registry/blocks/email-render/theme.js +215 -0
- package/registry/blocks/faq/README.md +101 -0
- package/registry/blocks/faq/block.json +11 -0
- package/registry/blocks/faq/demo.jsx +89 -0
- package/registry/blocks/faq/faq.jsx +220 -0
- package/registry/blocks/faq/index.js +4 -0
- package/registry/blocks/file-upload/README.md +138 -0
- package/registry/blocks/file-upload/block.json +10 -0
- package/registry/blocks/file-upload/demo.jsx +204 -0
- package/registry/blocks/file-upload/file-upload.jsx +635 -0
- package/registry/blocks/file-upload/index.js +4 -0
- package/registry/blocks/flow-canvas/README.md +420 -0
- package/registry/blocks/flow-canvas/block.json +13 -0
- package/registry/blocks/flow-canvas/board.js +819 -0
- package/registry/blocks/flow-canvas/chrome.jsx +649 -0
- package/registry/blocks/flow-canvas/context.jsx +35 -0
- package/registry/blocks/flow-canvas/demo.jsx +249 -0
- package/registry/blocks/flow-canvas/edges.jsx +107 -0
- package/registry/blocks/flow-canvas/flow-canvas.jsx +1329 -0
- package/registry/blocks/flow-canvas/index.js +41 -0
- package/registry/blocks/flow-canvas/nodes.jsx +392 -0
- package/registry/blocks/flow-canvas/theme.js +174 -0
- package/registry/blocks/footer/README.md +133 -0
- package/registry/blocks/footer/block.json +11 -0
- package/registry/blocks/footer/demo.jsx +119 -0
- package/registry/blocks/footer/footer.jsx +406 -0
- package/registry/blocks/footer/index.js +4 -0
- package/registry/blocks/gantt/README.md +220 -0
- package/registry/blocks/gantt/block.json +10 -0
- package/registry/blocks/gantt/demo.jsx +148 -0
- package/registry/blocks/gantt/gantt.jsx +923 -0
- package/registry/blocks/gantt/index.js +7 -0
- package/registry/blocks/gantt/rows.jsx +468 -0
- package/registry/blocks/gantt/schedule.js +278 -0
- package/registry/blocks/job-panel/README.md +86 -2
- package/registry/blocks/job-panel/block.json +3 -3
- package/registry/blocks/job-panel/demo.jsx +230 -3
- package/registry/blocks/job-panel/job-panel.jsx +169 -3
- package/registry/blocks/json-editor/README.md +133 -0
- package/registry/blocks/json-editor/block.json +10 -0
- package/registry/blocks/json-editor/demo.jsx +92 -0
- package/registry/blocks/json-editor/index.js +7 -0
- package/registry/blocks/json-editor/json-editor.jsx +305 -0
- package/registry/blocks/json-editor/json-tree.jsx +393 -0
- package/registry/blocks/json-editor/tree.js +225 -0
- package/registry/blocks/map/README.md +221 -0
- package/registry/blocks/map/block.json +14 -0
- package/registry/blocks/map/demo.jsx +201 -0
- package/registry/blocks/map/geo.js +198 -0
- package/registry/blocks/map/index.js +8 -0
- package/registry/blocks/map/list.jsx +128 -0
- package/registry/blocks/map/map-view.jsx +715 -0
- package/registry/blocks/map/maplibre.js +30 -0
- package/registry/blocks/map/marks.jsx +146 -0
- package/registry/blocks/map/theme.js +142 -0
- package/registry/blocks/menubar/README.md +109 -0
- package/registry/blocks/menubar/block.json +10 -0
- package/registry/blocks/menubar/demo.jsx +128 -0
- package/registry/blocks/menubar/index.js +4 -0
- package/registry/blocks/menubar/menubar.jsx +199 -0
- package/registry/blocks/mind-map/README.md +206 -0
- package/registry/blocks/mind-map/block.json +10 -0
- package/registry/blocks/mind-map/demo.jsx +103 -0
- package/registry/blocks/mind-map/index.js +31 -0
- package/registry/blocks/mind-map/mind-map.jsx +1125 -0
- package/registry/blocks/mind-map/topic.jsx +143 -0
- package/registry/blocks/mind-map/tree.js +645 -0
- package/registry/blocks/navigation-menu/README.md +124 -0
- package/registry/blocks/navigation-menu/block.json +10 -0
- package/registry/blocks/navigation-menu/demo.jsx +84 -0
- package/registry/blocks/navigation-menu/index.js +4 -0
- package/registry/blocks/navigation-menu/navigation-menu.jsx +448 -0
- package/registry/blocks/order-detail/README.md +109 -0
- package/registry/blocks/order-detail/block.json +10 -0
- package/registry/blocks/order-detail/demo.jsx +88 -0
- package/registry/blocks/order-detail/index.js +4 -0
- package/registry/blocks/order-detail/order-detail.jsx +354 -0
- package/registry/blocks/org-chart/README.md +145 -0
- package/registry/blocks/org-chart/block.json +10 -0
- package/registry/blocks/org-chart/demo.jsx +94 -0
- package/registry/blocks/org-chart/index.js +7 -0
- package/registry/blocks/org-chart/org-chart.jsx +631 -0
- package/registry/blocks/org-chart/org.js +245 -0
- package/registry/blocks/org-chart/person.jsx +96 -0
- package/registry/blocks/page-builder/README.md +257 -0
- package/registry/blocks/page-builder/block.json +14 -0
- package/registry/blocks/page-builder/demo.jsx +145 -0
- package/registry/blocks/page-builder/grapes.js +18 -0
- package/registry/blocks/page-builder/index.js +11 -0
- package/registry/blocks/page-builder/page-builder.jsx +704 -0
- package/registry/blocks/page-builder/page-view.jsx +33 -0
- package/registry/blocks/page-builder/page.js +118 -0
- package/registry/blocks/page-builder/panels.jsx +588 -0
- package/registry/blocks/page-builder/sections.js +209 -0
- package/registry/blocks/page-builder/theme.js +87 -0
- package/registry/blocks/page-builder/thumbs.jsx +189 -0
- package/registry/blocks/page-builder/tokens.js +329 -0
- package/registry/blocks/payment-methods/README.md +104 -0
- package/registry/blocks/payment-methods/block.json +10 -0
- package/registry/blocks/payment-methods/demo.jsx +71 -0
- package/registry/blocks/payment-methods/index.js +4 -0
- package/registry/blocks/payment-methods/payment-methods.jsx +302 -0
- package/registry/blocks/pdf-document/README.md +213 -0
- package/registry/blocks/pdf-document/block.json +13 -0
- package/registry/blocks/pdf-document/demo.jsx +136 -0
- package/registry/blocks/pdf-document/index.js +33 -0
- package/registry/blocks/pdf-document/money.js +83 -0
- package/registry/blocks/pdf-document/pdf-document.jsx +144 -0
- package/registry/blocks/pdf-document/primitives.jsx +271 -0
- package/registry/blocks/pdf-document/quote.jsx +179 -0
- package/registry/blocks/pdf-document/theme.js +193 -0
- package/registry/blocks/pdf-viewer/README.md +191 -0
- package/registry/blocks/pdf-viewer/block.json +14 -0
- package/registry/blocks/pdf-viewer/demo.jsx +252 -0
- package/registry/blocks/pdf-viewer/helpers.js +270 -0
- package/registry/blocks/pdf-viewer/index.js +8 -0
- package/registry/blocks/pdf-viewer/notes.jsx +195 -0
- package/registry/blocks/pdf-viewer/pdf-viewer.jsx +1368 -0
- package/registry/blocks/pdf-viewer/pdfjs.js +37 -0
- package/registry/blocks/pdf-viewer/ssr-shim-end.js +6 -0
- package/registry/blocks/pdf-viewer/ssr-shim.js +44 -0
- package/registry/blocks/product-detail/README.md +217 -0
- package/registry/blocks/product-detail/block.json +10 -0
- package/registry/blocks/product-detail/demo.jsx +233 -0
- package/registry/blocks/product-detail/index.js +7 -0
- package/registry/blocks/product-detail/price.jsx +115 -0
- package/registry/blocks/product-detail/product-detail.jsx +348 -0
- package/registry/blocks/product-detail/product-media.jsx +102 -0
- package/registry/blocks/product-detail/product-options.jsx +144 -0
- package/registry/blocks/product-grid/README.md +162 -0
- package/registry/blocks/product-grid/block.json +10 -0
- package/registry/blocks/product-grid/demo.jsx +255 -0
- package/registry/blocks/product-grid/index.js +5 -0
- package/registry/blocks/product-grid/product-card.jsx +232 -0
- package/registry/blocks/product-grid/product-grid.jsx +235 -0
- package/registry/blocks/record-form/README.md +196 -0
- package/registry/blocks/record-form/block.json +10 -0
- package/registry/blocks/record-form/demo.jsx +525 -0
- package/registry/blocks/record-form/index.js +4 -0
- package/registry/blocks/record-form/record-fields.jsx +457 -0
- package/registry/blocks/record-form/record-form.jsx +415 -0
- package/registry/blocks/record-form/rules.js +81 -0
- package/registry/blocks/record-notes/README.md +139 -0
- package/registry/blocks/record-notes/block.json +10 -0
- package/registry/blocks/record-notes/demo.jsx +179 -0
- package/registry/blocks/record-notes/index.js +4 -0
- package/registry/blocks/record-notes/record-notes.jsx +266 -0
- package/registry/blocks/search-dialog/README.md +108 -0
- package/registry/blocks/search-dialog/block.json +10 -0
- package/registry/blocks/search-dialog/demo.jsx +116 -0
- package/registry/blocks/search-dialog/index.js +3 -0
- package/registry/blocks/search-dialog/search-dialog.jsx +235 -0
- package/registry/blocks/settings-list/README.md +171 -0
- package/registry/blocks/settings-list/block.json +10 -0
- package/registry/blocks/settings-list/demo.jsx +333 -0
- package/registry/blocks/settings-list/index.js +4 -0
- package/registry/blocks/settings-list/row-state.jsx +93 -0
- package/registry/blocks/settings-list/settings-list.jsx +349 -0
- package/registry/blocks/settings-list/settings-matrix.jsx +118 -0
- package/registry/blocks/setup-checklist/README.md +142 -0
- package/registry/blocks/setup-checklist/block.json +10 -0
- package/registry/blocks/setup-checklist/demo.jsx +159 -0
- package/registry/blocks/setup-checklist/index.js +4 -0
- package/registry/blocks/setup-checklist/setup-checklist.jsx +446 -0
- package/registry/blocks/share-dialog/README.md +113 -0
- package/registry/blocks/share-dialog/block.json +10 -0
- package/registry/blocks/share-dialog/demo.jsx +140 -0
- package/registry/blocks/share-dialog/index.js +3 -0
- package/registry/blocks/share-dialog/share-dialog.jsx +384 -0
- package/registry/blocks/sidebar/README.md +190 -0
- package/registry/blocks/sidebar/block.json +43 -0
- package/registry/blocks/sidebar/demo.jsx +577 -0
- package/registry/blocks/sidebar/index.js +4 -0
- package/registry/blocks/sidebar/sidebar-panel.jsx +149 -0
- package/registry/blocks/sidebar/sidebar.jsx +864 -0
- package/registry/blocks/signature-pad/README.md +137 -0
- package/registry/blocks/signature-pad/block.json +13 -0
- package/registry/blocks/signature-pad/colors.js +115 -0
- package/registry/blocks/signature-pad/demo.jsx +94 -0
- package/registry/blocks/signature-pad/index.js +6 -0
- package/registry/blocks/signature-pad/pad.js +7 -0
- package/registry/blocks/signature-pad/signature-pad.jsx +434 -0
- package/registry/blocks/signature-pad/signature.js +68 -0
- package/registry/blocks/sketch-canvas/README.md +280 -0
- package/registry/blocks/sketch-canvas/block.json +13 -0
- package/registry/blocks/sketch-canvas/demo.jsx +159 -0
- package/registry/blocks/sketch-canvas/excalidraw.js +40 -0
- package/registry/blocks/sketch-canvas/index.js +9 -0
- package/registry/blocks/sketch-canvas/palette.js +226 -0
- package/registry/blocks/sketch-canvas/sketch-canvas.jsx +1188 -0
- package/registry/blocks/sketch-canvas/sketch.js +179 -0
- package/registry/blocks/sketch-canvas/ssr-shim-end.js +6 -0
- package/registry/blocks/sketch-canvas/ssr-shim.js +45 -0
- package/registry/blocks/sketch-canvas/stamps.js +104 -0
- package/registry/blocks/sketch-canvas/theme.js +131 -0
- package/registry/blocks/spreadsheet/README.md +307 -0
- package/registry/blocks/spreadsheet/block.json +13 -0
- package/registry/blocks/spreadsheet/cells.jsx +455 -0
- package/registry/blocks/spreadsheet/chrome.jsx +325 -0
- package/registry/blocks/spreadsheet/demo.jsx +177 -0
- package/registry/blocks/spreadsheet/grid.js +387 -0
- package/registry/blocks/spreadsheet/index.js +34 -0
- package/registry/blocks/spreadsheet/spreadsheet.jsx +1732 -0
- package/registry/blocks/spreadsheet/types.js +473 -0
- package/registry/blocks/stat-cards/README.md +173 -0
- package/registry/blocks/stat-cards/block.json +10 -0
- package/registry/blocks/stat-cards/demo.jsx +257 -0
- package/registry/blocks/stat-cards/index.js +4 -0
- package/registry/blocks/stat-cards/stat-cards.jsx +307 -0
- package/registry/blocks/stat-cards/usage.jsx +243 -0
- package/registry/blocks/task-list/README.md +176 -0
- package/registry/blocks/task-list/block.json +10 -0
- package/registry/blocks/task-list/demo.jsx +134 -0
- package/registry/blocks/task-list/index.js +5 -0
- package/registry/blocks/task-list/task-list.jsx +907 -0
- package/registry/blocks/task-model/README.md +455 -0
- package/registry/blocks/task-model/block.json +167 -0
- package/registry/blocks/task-model/changes.js +89 -0
- package/registry/blocks/task-model/dates.js +371 -0
- package/registry/blocks/task-model/demo.jsx +215 -0
- package/registry/blocks/task-model/dnd.jsx +240 -0
- package/registry/blocks/task-model/index.js +97 -0
- package/registry/blocks/task-model/model.js +919 -0
- package/registry/blocks/task-model/parts.jsx +449 -0
- package/registry/blocks/task-model/toolbar.jsx +271 -0
- package/registry/blocks/testimonials/README.md +139 -0
- package/registry/blocks/testimonials/block.json +11 -0
- package/registry/blocks/testimonials/demo.jsx +137 -0
- package/registry/blocks/testimonials/index.js +4 -0
- package/registry/blocks/testimonials/testimonials.jsx +430 -0
- package/registry/blocks/transaction-list/README.md +126 -0
- package/registry/blocks/transaction-list/block.json +10 -0
- package/registry/blocks/transaction-list/demo.jsx +79 -0
- package/registry/blocks/transaction-list/index.js +4 -0
- package/registry/blocks/transaction-list/transaction-list.jsx +383 -0
- package/registry/blocks/whiteboard/README.md +179 -0
- package/registry/blocks/whiteboard/block.json +10 -0
- package/registry/blocks/whiteboard/demo.jsx +169 -0
- package/registry/blocks/whiteboard/index.js +6 -0
- package/registry/blocks/whiteboard/templates.js +150 -0
- package/registry/blocks/whiteboard/whiteboard.jsx +721 -0
- package/src/install.mjs +18 -0
- package/src/shadcn.mjs +171 -0
- package/templates/next/files/README.md +145 -11
- package/templates/next/files/app/globals.css +55 -4
- package/templates/next/files/check/run.mjs +3 -3
- package/templates/next/files/components/parts/fixture.jsx +1 -1
- package/templates/next/files/components/parts/sample.js +15 -0
- package/templates/next/files/components/ui/avatar.jsx +141 -0
- package/templates/next/files/components/ui/breadcrumb.jsx +149 -0
- package/templates/next/files/components/ui/button-group.jsx +70 -0
- package/templates/next/files/components/ui/button.jsx +132 -12
- package/templates/next/files/components/ui/calendar.jsx +609 -0
- package/templates/next/files/components/ui/carousel.jsx +281 -0
- package/templates/next/files/components/ui/collapsible.jsx +208 -0
- package/templates/next/files/components/ui/combobox.jsx +608 -0
- package/templates/next/files/components/ui/command.jsx +577 -0
- package/templates/next/files/components/ui/context-menu.jsx +191 -0
- package/templates/next/files/components/ui/date-picker.jsx +360 -0
- package/templates/next/files/components/ui/distribution.jsx +117 -0
- package/templates/next/files/components/ui/feedback.jsx +143 -0
- package/templates/next/files/components/ui/field.jsx +115 -3
- package/templates/next/files/components/ui/file-input.jsx +234 -0
- package/templates/next/files/components/ui/icon.jsx +130 -8
- package/templates/next/files/components/ui/image.jsx +143 -0
- package/templates/next/files/components/ui/index.js +47 -2
- package/templates/next/files/components/ui/input-group.jsx +213 -0
- package/templates/next/files/components/ui/input-otp.jsx +170 -0
- package/templates/next/files/components/ui/item.jsx +206 -0
- package/templates/next/files/components/ui/menu.jsx +454 -82
- package/templates/next/files/components/ui/notice.jsx +126 -14
- package/templates/next/files/components/ui/pagination.jsx +156 -0
- package/templates/next/files/components/ui/popover.jsx +284 -0
- package/templates/next/files/components/ui/radio.jsx +193 -0
- package/templates/next/files/components/ui/rating.jsx +131 -0
- package/templates/next/files/components/ui/resizable.jsx +338 -0
- package/templates/next/files/components/ui/scroll-area.jsx +123 -0
- package/templates/next/files/components/ui/separator.jsx +119 -0
- package/templates/next/files/components/ui/sheet.jsx +96 -11
- package/templates/next/files/components/ui/slider.jsx +174 -0
- package/templates/next/files/components/ui/stat.jsx +574 -0
- package/templates/next/files/components/ui/steps.jsx +338 -0
- package/templates/next/files/components/ui/swatch.jsx +33 -0
- package/templates/next/files/components/ui/table.jsx +130 -0
- package/templates/next/files/components/ui/toast.jsx +440 -0
- package/templates/next/files/components/ui/toggle.jsx +195 -0
- package/templates/next/files/components/ui/tooltip.jsx +270 -0
- package/templates/next/files/lib/sample.js +4 -12
- package/templates/next/template.json +264 -8
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useId, useRef, useState } from "react";
|
|
4
|
+
import { Icon, Menu, MenuPanel, cx, panelClass, usePopoverPosition } from "../../ui";
|
|
5
|
+
|
|
6
|
+
// Menubar — a desktop app's File · Edit · View · Help. Each top-level
|
|
7
|
+
// menu is a trigger and the kit's MenuPanel (the same panel, keys and
|
|
8
|
+
// `items` as Menu), opened as an auto popover: the browser closes the
|
|
9
|
+
// others when one opens, and does the light dismiss and Escape.
|
|
10
|
+
//
|
|
11
|
+
// The WAI-ARIA menubar pattern: the bar is one Tab stop (roving
|
|
12
|
+
// tabindex); ArrowLeft/Right move along it, and when a menu is open they
|
|
13
|
+
// open the neighbour instead; ArrowDown, Enter or Space open a menu at its
|
|
14
|
+
// first item, ArrowUp at its last. Once a menu is open, hovering another
|
|
15
|
+
// trigger switches to it. Escape closes and puts focus back on the
|
|
16
|
+
// trigger. Below `md` the bar is one menu button whose menus unfold as
|
|
17
|
+
// submenus in place — Menu already does that on a phone.
|
|
18
|
+
|
|
19
|
+
const ITEMS = '[role^="menuitem"]:not([disabled])';
|
|
20
|
+
|
|
21
|
+
// Only this panel's items, not a submenu's inside it.
|
|
22
|
+
function own(panel) {
|
|
23
|
+
return panel ? [...panel.querySelectorAll(ITEMS)].filter((n) => n.closest('[role="menu"]') === panel) : [];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const focus = (n) => n?.focus({ preventScroll: true });
|
|
27
|
+
|
|
28
|
+
export function Menubar({ menus, label = "Menu bar", menuLabel = "Menu", className }) {
|
|
29
|
+
const id = useId();
|
|
30
|
+
const live = (menus ?? []).filter((m) => m && (m.items ?? []).some(Boolean));
|
|
31
|
+
const [active, setActive] = useState(0);
|
|
32
|
+
const [open, setOpen] = useState(-1);
|
|
33
|
+
const triggers = useRef([]);
|
|
34
|
+
const panels = useRef([]);
|
|
35
|
+
const start = useRef("first");
|
|
36
|
+
|
|
37
|
+
if (live.length === 0) return null;
|
|
38
|
+
const n = live.length;
|
|
39
|
+
const tabStop = Math.min(active, n - 1);
|
|
40
|
+
const isOpen = (i) => Boolean(panels.current[i]?.matches(":popover-open"));
|
|
41
|
+
const openNow = () => live.findIndex((_, i) => isOpen(i));
|
|
42
|
+
|
|
43
|
+
function focusStart(i) {
|
|
44
|
+
const nodes = own(panels.current[i]);
|
|
45
|
+
if (start.current === "first") focus(nodes[0]);
|
|
46
|
+
else if (start.current === "last") focus(nodes[nodes.length - 1]);
|
|
47
|
+
start.current = "first";
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Open menu i; an open sibling closes (auto popovers). `from` is where
|
|
51
|
+
// focus goes: its first item, its last, or "none" — stay on the trigger.
|
|
52
|
+
function show(i, from = "first") {
|
|
53
|
+
const p = panels.current[i];
|
|
54
|
+
if (!p) return;
|
|
55
|
+
setActive(i);
|
|
56
|
+
start.current = from;
|
|
57
|
+
if (from === "none") focus(triggers.current[i]);
|
|
58
|
+
if (isOpen(i)) focusStart(i);
|
|
59
|
+
else p.showPopover();
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function hide(i) {
|
|
63
|
+
focus(triggers.current[i]);
|
|
64
|
+
if (isOpen(i)) panels.current[i].hidePopover();
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function onToggle(i, e) {
|
|
68
|
+
// A submenu's toggle bubbles here; it is not this menu's.
|
|
69
|
+
if (e.target !== e.currentTarget) return;
|
|
70
|
+
if (e.newState === "open") {
|
|
71
|
+
setOpen(i);
|
|
72
|
+
setActive(i);
|
|
73
|
+
focusStart(i);
|
|
74
|
+
} else {
|
|
75
|
+
setOpen((o) => (o === i ? -1 : o));
|
|
76
|
+
const a = document.activeElement;
|
|
77
|
+
if (!a || a === document.body || panels.current[i]?.contains(a)) focus(triggers.current[i]);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function onTriggerKey(i, e) {
|
|
82
|
+
const k = e.key;
|
|
83
|
+
if (k === "ArrowRight" || k === "ArrowLeft") {
|
|
84
|
+
const j = (i + (k === "ArrowRight" ? 1 : -1) + n) % n;
|
|
85
|
+
if (openNow() >= 0) show(j, "first");
|
|
86
|
+
else focus(triggers.current[j]);
|
|
87
|
+
} else if (k === "Home") focus(triggers.current[0]);
|
|
88
|
+
else if (k === "End") focus(triggers.current[n - 1]);
|
|
89
|
+
else if (k === "ArrowDown") show(i, "first");
|
|
90
|
+
else if (k === "ArrowUp") show(i, "last");
|
|
91
|
+
else return; // Enter and Space click the trigger, which toggles its menu
|
|
92
|
+
e.preventDefault();
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// Keys the open panel does not use itself: ArrowRight on an item with
|
|
96
|
+
// no submenu, ArrowLeft outside a submenu — the neighbours.
|
|
97
|
+
function onPanelKey(i, e) {
|
|
98
|
+
if (e.key !== "ArrowRight" && e.key !== "ArrowLeft") return;
|
|
99
|
+
e.preventDefault();
|
|
100
|
+
show((i + (e.key === "ArrowRight" ? 1 : -1) + n) % n, "first");
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return (
|
|
104
|
+
<div className={className}>
|
|
105
|
+
<div role="menubar" aria-label={label} aria-orientation="horizontal" className="hidden h-10 w-fit max-w-full items-center gap-1 rounded-md border border-border bg-background p-1 shadow-xs md:flex">
|
|
106
|
+
{live.map((m, i) => (
|
|
107
|
+
<Top
|
|
108
|
+
key={m.key ?? `${i}-${m.label}`}
|
|
109
|
+
menu={m}
|
|
110
|
+
triggerId={`${id}t${i}`}
|
|
111
|
+
panelId={`${id}m${i}`}
|
|
112
|
+
tabIndex={i === tabStop ? 0 : -1}
|
|
113
|
+
expanded={open === i}
|
|
114
|
+
triggerRef={(el) => (triggers.current[i] = el)}
|
|
115
|
+
panelRef={(el) => (panels.current[i] = el)}
|
|
116
|
+
onFocus={() => setActive(i)}
|
|
117
|
+
onPointerEnter={(e) => {
|
|
118
|
+
if (e.pointerType !== "mouse") return;
|
|
119
|
+
const o = openNow();
|
|
120
|
+
if (o >= 0 && o !== i) show(i, "none");
|
|
121
|
+
}}
|
|
122
|
+
onPointerDown={() => (start.current = "first")}
|
|
123
|
+
onTriggerKey={(e) => onTriggerKey(i, e)}
|
|
124
|
+
onPanelKey={(e) => onPanelKey(i, e)}
|
|
125
|
+
onToggle={(e) => onToggle(i, e)}
|
|
126
|
+
onExit={() => hide(i)}
|
|
127
|
+
/>
|
|
128
|
+
))}
|
|
129
|
+
</div>
|
|
130
|
+
<div className="md:hidden">
|
|
131
|
+
<Menu
|
|
132
|
+
items={live.map((m) => ({ label: m.label, icon: m.icon, items: m.items }))}
|
|
133
|
+
label={menuLabel}
|
|
134
|
+
align="start"
|
|
135
|
+
trigger={
|
|
136
|
+
<>
|
|
137
|
+
<Icon name="menu" />
|
|
138
|
+
<span>{menuLabel}</span>
|
|
139
|
+
</>
|
|
140
|
+
}
|
|
141
|
+
className="h-11 border border-border bg-background px-3 font-medium shadow-xs"
|
|
142
|
+
/>
|
|
143
|
+
</div>
|
|
144
|
+
</div>
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// One top-level menu: its trigger and its panel. A component of its own
|
|
149
|
+
// because each panel keeps itself beside its trigger with a hook.
|
|
150
|
+
function Top({ menu, triggerId, panelId, tabIndex, expanded, triggerRef, panelRef, onFocus, onPointerEnter, onPointerDown, onTriggerKey, onPanelKey, onToggle, onExit }) {
|
|
151
|
+
const btn = useRef(null);
|
|
152
|
+
const pop = useRef(null);
|
|
153
|
+
usePopoverPosition(btn, pop, { side: "bottom", align: "start", offset: 6 });
|
|
154
|
+
|
|
155
|
+
return (
|
|
156
|
+
<div role="none" onKeyDown={(e) => (e.target === btn.current ? onTriggerKey(e) : onPanelKey(e))}>
|
|
157
|
+
{/* raw: a menubar item — role=menuitem, a roving tabindex and its
|
|
158
|
+
panel's popoverTarget, drawn flat like Menu's own trigger; Button
|
|
159
|
+
is a form control's look. */}
|
|
160
|
+
<button
|
|
161
|
+
ref={(el) => {
|
|
162
|
+
btn.current = el;
|
|
163
|
+
triggerRef(el);
|
|
164
|
+
}}
|
|
165
|
+
id={triggerId}
|
|
166
|
+
type="button"
|
|
167
|
+
role="menuitem"
|
|
168
|
+
popoverTarget={panelId}
|
|
169
|
+
aria-haspopup="menu"
|
|
170
|
+
aria-expanded={expanded}
|
|
171
|
+
aria-controls={panelId}
|
|
172
|
+
tabIndex={tabIndex}
|
|
173
|
+
onFocus={onFocus}
|
|
174
|
+
onPointerEnter={onPointerEnter}
|
|
175
|
+
onPointerDown={onPointerDown}
|
|
176
|
+
className={cx(
|
|
177
|
+
"inline-flex h-8 select-none items-center rounded-sm px-3 text-sm font-medium outline-none",
|
|
178
|
+
"hover:bg-accent focus-visible:bg-accent focus-visible:ring-2 focus-visible:ring-ring aria-expanded:bg-accent aria-expanded:text-accent-foreground",
|
|
179
|
+
)}
|
|
180
|
+
>
|
|
181
|
+
{menu.label}
|
|
182
|
+
</button>
|
|
183
|
+
<MenuPanel
|
|
184
|
+
id={panelId}
|
|
185
|
+
items={menu.items}
|
|
186
|
+
labelledBy={triggerId}
|
|
187
|
+
panelRef={(el) => {
|
|
188
|
+
pop.current = el;
|
|
189
|
+
panelRef(el);
|
|
190
|
+
}}
|
|
191
|
+
popover="auto"
|
|
192
|
+
onToggle={onToggle}
|
|
193
|
+
onExit={onExit}
|
|
194
|
+
onClose={onExit}
|
|
195
|
+
className={panelClass("auto", "min-w-52 max-h-[calc(100vh-1rem)] overflow-y-auto p-1")}
|
|
196
|
+
/>
|
|
197
|
+
</div>
|
|
198
|
+
);
|
|
199
|
+
}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
# MindMap
|
|
2
|
+
|
|
3
|
+
A mind map you can build without touching the mouse. One centre topic,
|
|
4
|
+
main branches balanced on both sides of it, each branch a tidy tree in its
|
|
5
|
+
own colour. **Tab** adds a subtopic, **Enter** the next topic, typing
|
|
6
|
+
renames, the arrows walk the map. The layout is automatic: topics never
|
|
7
|
+
need dragging into place, and the map re-balances as it grows.
|
|
8
|
+
|
|
9
|
+
A bar on top holds undo and redo, the save state, the selected topic's
|
|
10
|
+
actions (add, colour, fold, delete) and a Map / Outline switch. The
|
|
11
|
+
Outline view is the map as a nested list — the reading of it for a screen
|
|
12
|
+
reader, and a quick way to jump to a topic.
|
|
13
|
+
|
|
14
|
+
It is built on `flow-canvas` (which draws it, pans and zooms): this block
|
|
15
|
+
owns the tree, the layout and the keys.
|
|
16
|
+
|
|
17
|
+
```jsx
|
|
18
|
+
import { MindMap } from "../components/blocks/mind-map"; // a Makersclaw app ("./blocks/mind-map" from components/)
|
|
19
|
+
import { MindMap } from "@/components/makersclaw/blocks/mind-map"; // a shadcn project
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
`MindMap` is a client component: render it from a `"use client"`
|
|
23
|
+
component. `makersclaw add mind-map` adds `flow-canvas` with it (and its
|
|
24
|
+
npm package, `@xyflow/react`: run `npm install` after). The tree helpers
|
|
25
|
+
(`mindMapToText`, `outlineToMindMap`, `layoutMindMap`…) are plain
|
|
26
|
+
functions and work on the server too.
|
|
27
|
+
|
|
28
|
+
## The data
|
|
29
|
+
|
|
30
|
+
A map is one tree of topics. Store it as it comes out of `onChange` (one
|
|
31
|
+
`jsonb` column), and keep `mindMapToText(map)` beside it for search and
|
|
32
|
+
agents.
|
|
33
|
+
|
|
34
|
+
```js
|
|
35
|
+
{
|
|
36
|
+
id: "root", text: "Relay 2.0 launch",
|
|
37
|
+
children: [
|
|
38
|
+
{ id: "why", text: "Why now", side: "right", children: [
|
|
39
|
+
{ id: "why-1", text: "Churn up 3 pts" },
|
|
40
|
+
] },
|
|
41
|
+
{ id: "risks", text: "Risks", side: "left", color: "chart-4", collapsed: true, children: [ … ] },
|
|
42
|
+
],
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
- `id` — any string, unique in the map. `text` — the words (a newline is
|
|
47
|
+
allowed). `children` — the subtopics, in order.
|
|
48
|
+
- `collapsed: true` — the branch is folded; the map shows how many topics
|
|
49
|
+
it hides.
|
|
50
|
+
- `color` — a colour **token**, never a colour value: `"chart-2"` …
|
|
51
|
+
`"chart-5"`, `"chart-1"` (the theme's own), `"warning"`, `"success"`,
|
|
52
|
+
`"info"`, `"destructive"`. Subtopics inherit their branch's. A main
|
|
53
|
+
branch with none takes the next of `colors`.
|
|
54
|
+
- `side` — `"left"` or `"right"`, main branches only. Missing, the map
|
|
55
|
+
splits the branches to balance the two sides; the first change pins
|
|
56
|
+
them, so adding a branch never flips the others across the centre.
|
|
57
|
+
- Anything else on a topic (`note`, your own keys) is kept as it is.
|
|
58
|
+
|
|
59
|
+
`normalizeMap(anything)` cleans what it is given: missing or repeated ids,
|
|
60
|
+
`title`/`label` for `text`, `topics`/`items` for `children`, an outline
|
|
61
|
+
string, or nothing (a fresh map). The component runs it on `value`.
|
|
62
|
+
|
|
63
|
+
## Props
|
|
64
|
+
|
|
65
|
+
- `value` — the map, controlled. A new `value` that is not what the map
|
|
66
|
+
last sent through `onChange` replaces it (loading another record); that
|
|
67
|
+
replacement can be undone. Pass back exactly what `onChange` gave you.
|
|
68
|
+
- `defaultValue` — the starting map, uncontrolled. With neither, a centre
|
|
69
|
+
topic called "Central topic" and the first-run card.
|
|
70
|
+
- `onChange(map)` — the whole tree after a change settles (debounced by
|
|
71
|
+
`changeDelay`; typing is saved as it goes). Selection, folding in
|
|
72
|
+
read-only mode, panning and zooming never call it.
|
|
73
|
+
- `onSave(map)` — `async`, returns `{ ok: true }` or `{ ok: false,
|
|
74
|
+
error? }` (a throw counts as failed). Called right after `onChange`. The
|
|
75
|
+
bar shows "Saving…", "Saved", or the error with Retry. A failure keeps
|
|
76
|
+
the map as it is on screen (nothing typed is thrown away); Retry sends
|
|
77
|
+
it again.
|
|
78
|
+
- `changeDelay` — ms of quiet before `onChange` / `onSave` (default 400).
|
|
79
|
+
- `readOnly` — `false` (default). `true`: no editing; the arrows still
|
|
80
|
+
walk the map, Space folds and unfolds (not saved), the Outline view and
|
|
81
|
+
copying work.
|
|
82
|
+
- `colors` — the branch palette, token names (default `BRANCH_COLORS`:
|
|
83
|
+
chart-2, 3, 4, 5, 1). The colour picker offers these plus warning,
|
|
84
|
+
success, info and destructive.
|
|
85
|
+
- `templates` — what the first-run card offers: `[{ id, label, icon?,
|
|
86
|
+
description?, map }]`, `map` a tree or a function returning one (default
|
|
87
|
+
`mindMapTemplates()`: Project plan, Brainstorm, Meeting notes). `[]` for
|
|
88
|
+
none.
|
|
89
|
+
- `placeholder` — what an empty topic shows while it is typed (default
|
|
90
|
+
"New topic").
|
|
91
|
+
- `height` — px or any CSS length, default `600`. A height class in
|
|
92
|
+
`className` (`h-dvh`, `h-full`, `flex-1`) replaces it.
|
|
93
|
+
- `label` — the map's accessible name (default "Mind map").
|
|
94
|
+
- `onSelectionChange(topic | null)` — the selected topic changed (a side
|
|
95
|
+
panel with its notes).
|
|
96
|
+
- `className` — layout around it (margin, width, height). Never colour.
|
|
97
|
+
|
|
98
|
+
## Keyboard
|
|
99
|
+
|
|
100
|
+
With a topic selected (click one, or press an arrow):
|
|
101
|
+
|
|
102
|
+
| Key | Does |
|
|
103
|
+
| --- | --- |
|
|
104
|
+
| Tab | add a subtopic and type it |
|
|
105
|
+
| Enter / Shift+Enter | add the next topic below / above |
|
|
106
|
+
| Space, F2, or just type | rename |
|
|
107
|
+
| Delete / Backspace | delete the topic and its branch (a toast offers Undo) |
|
|
108
|
+
| ← → ↑ ↓ | walk the map: outwards to a child, inwards to the parent, up and down the column |
|
|
109
|
+
| ⌥↑ / ⌥↓ | move the topic up or down among its siblings |
|
|
110
|
+
| Shift+Tab | move the topic up a level |
|
|
111
|
+
| ⌘↑ / ⌘↓ | fold / unfold the branch |
|
|
112
|
+
| ⌘D | duplicate the branch |
|
|
113
|
+
| ⌘C / ⌘X / ⌘V | copy or cut a branch as an outline; paste an outline (from notes, a doc, an agent) as subtopics |
|
|
114
|
+
| ⌘Z / ⇧⌘Z | undo / redo |
|
|
115
|
+
| Home | the centre |
|
|
116
|
+
| Esc | clear the selection |
|
|
117
|
+
| ⇧1 | fit the map to the screen |
|
|
118
|
+
| ? | the shortcuts sheet |
|
|
119
|
+
|
|
120
|
+
While typing a topic: **Enter** finishes it and starts the next one (on
|
|
121
|
+
an empty one it steps out a level, so a run of topics never needs the
|
|
122
|
+
mouse), **Tab** finishes it and starts a subtopic (on an empty one it
|
|
123
|
+
moves in a level), **Backspace** on an empty topic removes it and goes
|
|
124
|
+
back to the one before, **Esc** finishes. Shift+Enter is a new line.
|
|
125
|
+
|
|
126
|
+
With the mouse: click selects, double-click renames, the **+** at a
|
|
127
|
+
topic's end adds a subtopic, the chip at a branch's end folds it (folded,
|
|
128
|
+
it shows the count it hides), and dragging a topic onto another moves its
|
|
129
|
+
branch there. A plain drag on the empty canvas pans; pinch or ⌘-scroll
|
|
130
|
+
zooms. On a touch screen a drag always pans; tap selects, double-tap
|
|
131
|
+
renames, and the bar's buttons add.
|
|
132
|
+
|
|
133
|
+
## The helpers
|
|
134
|
+
|
|
135
|
+
Plain functions over a tree; each returns a new tree and leaves the old
|
|
136
|
+
one as it was.
|
|
137
|
+
|
|
138
|
+
- Read: `findTopic(map, id)`, `pathTo(map, id)` → `[root, …, topic]`,
|
|
139
|
+
`parentOf(map, id)`, `countTopics(topic)` (everything under it).
|
|
140
|
+
- Change: `updateTopic(map, id, patch)`, `insertTopic(map, parentId,
|
|
141
|
+
topic, index?)`, `insertSibling(map, id, topic, { before })`,
|
|
142
|
+
`removeTopic(map, id)`, `moveTopic(map, id, parentId, index?)` (refused
|
|
143
|
+
into its own branch), `shiftTopic(map, id, ±1)`, `indentTopic`,
|
|
144
|
+
`outdentTopic`, `duplicateTopic(map, id)` → `{ root, id }`,
|
|
145
|
+
`setAllCollapsed(map, on)`, `createTopic(text)`.
|
|
146
|
+
- Text: `mindMapToText(map)` (an indented outline, for an agent or search),
|
|
147
|
+
`mindMapToMarkdown(map)` (a heading and a nested list),
|
|
148
|
+
`outlineToMindMap(text)` and `outlineToTopics(text)` (bullets, numbers,
|
|
149
|
+
headings, tabs or spaces — what an agent writes).
|
|
150
|
+
- Layout: `layoutMindMap(map, { measure?, colors? })` → `{ items, bounds }`
|
|
151
|
+
(every visible topic's box, side, depth, colour and the line to its
|
|
152
|
+
parent), `mindMapToBoard(map)` (the same as a flow-canvas board).
|
|
153
|
+
- `mindMapTemplates()`, `BRANCH_COLORS`.
|
|
154
|
+
|
|
155
|
+
## Example
|
|
156
|
+
|
|
157
|
+
```jsx
|
|
158
|
+
// components/PlanMap.jsx — client
|
|
159
|
+
"use client";
|
|
160
|
+
import { useState } from "react";
|
|
161
|
+
import { updateRow } from "../lib/actions";
|
|
162
|
+
import { MindMap, mindMapToText } from "./blocks/mind-map";
|
|
163
|
+
|
|
164
|
+
export default function PlanMap({ plan }) {
|
|
165
|
+
const [map, setMap] = useState(plan.map); // jsonb, may be null
|
|
166
|
+
return (
|
|
167
|
+
<MindMap
|
|
168
|
+
value={map ?? undefined}
|
|
169
|
+
defaultValue={{ text: plan.name }}
|
|
170
|
+
onChange={setMap}
|
|
171
|
+
onSave={(m) => updateRow({ source: "public.plans", id: plan.id, patch: { map: m, map_text: mindMapToText(m) } })}
|
|
172
|
+
label={`${plan.name} map`}
|
|
173
|
+
className="h-[calc(100dvh-8rem)]"
|
|
174
|
+
/>
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
An agent's outline, straight onto a map:
|
|
180
|
+
|
|
181
|
+
```jsx
|
|
182
|
+
const map = outlineToMindMap(`# Hiring plan
|
|
183
|
+
- Roles
|
|
184
|
+
- Founding engineer
|
|
185
|
+
- Designer
|
|
186
|
+
- Sourcing
|
|
187
|
+
- Referrals
|
|
188
|
+
- Communities`);
|
|
189
|
+
<MindMap defaultValue={map} onSave={save} />
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
## What it will not do
|
|
193
|
+
|
|
194
|
+
- Free placement: topics sit where the layout puts them (drag moves a
|
|
195
|
+
branch to another topic, not to a spot). For free boards use
|
|
196
|
+
`flow-canvas` or `whiteboard`.
|
|
197
|
+
- Cross-links between branches, images or icons on topics.
|
|
198
|
+
- Collaborate live: saves are last-write-wins.
|
|
199
|
+
- Export an image.
|
|
200
|
+
- Render the map on the server: the server shows it as text until the
|
|
201
|
+
canvas mounts. For a read-only page that must be rich in the HTML,
|
|
202
|
+
render `mindMapToMarkdown` yourself.
|
|
203
|
+
|
|
204
|
+
A map it cannot be is your own component in `components/` — not an edit
|
|
205
|
+
to this block. Its files are fixed: `npm run check` refuses a change, and
|
|
206
|
+
`makersclaw add mind-map` restores them.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "mind-map",
|
|
3
|
+
"title": "MindMap",
|
|
4
|
+
"description": "A mind map you can build without the mouse, on flow-canvas: a centre topic with main branches balanced on both sides, each branch a tidy auto-laid-out tree in its own chart hue. Tab adds a subtopic, Enter the next topic, typing renames, arrows walk the map, ⌘↑/⌘↓ fold a branch (a folded one shows how many it hides), ⌥↑/⌥↓ reorder, Shift+Tab moves up a level; drag a topic onto another to move its branch. Undo/redo, a colour per branch, an Outline view, copy a branch as an outline and paste an outline as topics, starter templates. The map is plain JSON (a tree of topics); saves are async callbacks answering { ok }.",
|
|
5
|
+
"useWhen": "A screen for thinking in a tree: brainstorming around one idea, planning a project, breaking a goal down, notes from a meeting, a topic outline an agent drafted. Not for free-form boards with stickies and arrows (flow-canvas, whiteboard), a people hierarchy (org-chart), or a process with steps (process-map).",
|
|
6
|
+
"tags": ["mind map", "mindmap", "brainstorm", "tree", "outline", "ideas", "topics", "branches", "planning", "xmind", "mindnode", "keyboard", "canvas", "map"],
|
|
7
|
+
"exports": ["MindMap", "BRANCH_COLORS", "normalizeMap", "createTopic", "findTopic", "updateTopic", "insertTopic", "removeTopic", "moveTopic", "layoutMindMap", "mindMapToBoard", "mindMapToText", "mindMapToMarkdown", "outlineToMindMap", "outlineToTopics", "mindMapTemplates"],
|
|
8
|
+
"files": ["index.js", "mind-map.jsx", "topic.jsx", "tree.js"],
|
|
9
|
+
"requires": ["flow-canvas"]
|
|
10
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// MindMap two ways — the gallery's and the smoke test's surface. Not
|
|
4
|
+
// installed into apps.
|
|
5
|
+
// Launch plan a product launch, broken down: five branches on both
|
|
6
|
+
// sides, one folded. Read-only and a failing save behind
|
|
7
|
+
// switches; what an agent reads (the outline) beside it.
|
|
8
|
+
// Blank a new map: the first-run card and the templates.
|
|
9
|
+
import { useState } from "react";
|
|
10
|
+
import { Card, Switch, TabPanel, Tabs } from "../components/ui";
|
|
11
|
+
import { MindMap, mindMapToText } from "../components/blocks/mind-map";
|
|
12
|
+
|
|
13
|
+
const LAUNCH = {
|
|
14
|
+
id: "root",
|
|
15
|
+
text: "Relay 2.0 launch",
|
|
16
|
+
children: [
|
|
17
|
+
{
|
|
18
|
+
id: "why",
|
|
19
|
+
text: "Why now",
|
|
20
|
+
children: [
|
|
21
|
+
{ id: "why-1", text: "Churn up 3 pts after the price change" },
|
|
22
|
+
{ id: "why-2", text: "Two rivals ship sync this quarter" },
|
|
23
|
+
],
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
id: "audience",
|
|
27
|
+
text: "Who it's for",
|
|
28
|
+
children: [
|
|
29
|
+
{ id: "aud-1", text: "Ops leads at 50–200 person teams", children: [{ id: "aud-1a", text: "Interview 8 by May 20" }] },
|
|
30
|
+
{ id: "aud-2", text: "Agencies running client workspaces" },
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: "scope",
|
|
35
|
+
text: "Scope",
|
|
36
|
+
children: [
|
|
37
|
+
{ id: "scope-1", text: "Offline sync" },
|
|
38
|
+
{ id: "scope-2", text: "Shared inbox v2" },
|
|
39
|
+
{ id: "scope-3", text: "Audit log export" },
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
id: "gtm",
|
|
44
|
+
text: "Go to market",
|
|
45
|
+
children: [
|
|
46
|
+
{ id: "gtm-1", text: "Launch post + changelog", children: [{ id: "gtm-1a", text: "Draft by Priya" }, { id: "gtm-1b", text: "Review with Tomás" }] },
|
|
47
|
+
{ id: "gtm-2", text: "Webinar, June 4" },
|
|
48
|
+
{ id: "gtm-3", text: "Email the 1,240 trial users" },
|
|
49
|
+
],
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
id: "risks",
|
|
53
|
+
text: "Risks",
|
|
54
|
+
collapsed: true,
|
|
55
|
+
children: [
|
|
56
|
+
{ id: "risk-1", text: "Sync conflicts on flaky networks" },
|
|
57
|
+
{ id: "risk-2", text: "Support load in week one" },
|
|
58
|
+
{ id: "risk-3", text: "Pricing page not ready" },
|
|
59
|
+
],
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export default function MindMapDemo() {
|
|
65
|
+
const [map, setMap] = useState(LAUNCH);
|
|
66
|
+
const [readOnly, setReadOnly] = useState(false);
|
|
67
|
+
const [failing, setFailing] = useState(false);
|
|
68
|
+
const [tab, setTab] = useState("launch");
|
|
69
|
+
|
|
70
|
+
const save = async () => {
|
|
71
|
+
await new Promise((r) => setTimeout(r, 500));
|
|
72
|
+
return failing ? { ok: false, error: "Couldn't reach the server" } : { ok: true };
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
return (
|
|
76
|
+
<div className="grid gap-4">
|
|
77
|
+
<Tabs
|
|
78
|
+
aria-label="Examples"
|
|
79
|
+
value={tab}
|
|
80
|
+
onChange={setTab}
|
|
81
|
+
tabs={[
|
|
82
|
+
{ key: "launch", label: "Launch plan" },
|
|
83
|
+
{ key: "blank", label: "Blank" },
|
|
84
|
+
]}
|
|
85
|
+
/>
|
|
86
|
+
<TabPanel tab="launch" value={tab} className="grid gap-4">
|
|
87
|
+
<div className="flex flex-wrap items-center gap-x-6 gap-y-2">
|
|
88
|
+
<Switch label="Read-only" checked={readOnly} onChange={(e) => setReadOnly(e.target.checked)} />
|
|
89
|
+
<Switch label="Saves fail" checked={failing} onChange={(e) => setFailing(e.target.checked)} />
|
|
90
|
+
</div>
|
|
91
|
+
<div className="grid gap-4 xl:grid-cols-[minmax(0,1fr)_18rem]">
|
|
92
|
+
<MindMap value={map} onChange={setMap} onSave={save} readOnly={readOnly} label="Relay 2.0 launch" height={620} />
|
|
93
|
+
<Card title="What an agent reads" padding="sm" className="max-xl:hidden">
|
|
94
|
+
<pre className="max-h-[34rem] overflow-auto text-xs leading-5 whitespace-pre-wrap text-muted-foreground">{mindMapToText(map)}</pre>
|
|
95
|
+
</Card>
|
|
96
|
+
</div>
|
|
97
|
+
</TabPanel>
|
|
98
|
+
<TabPanel tab="blank" value={tab}>
|
|
99
|
+
<MindMap defaultValue={{ text: "Q3 planning" }} onSave={save} label="Q3 planning" height={560} />
|
|
100
|
+
</TabPanel>
|
|
101
|
+
</div>
|
|
102
|
+
);
|
|
103
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// The MindMap block — `makersclaw add mind-map`. Fixed: compose it through
|
|
2
|
+
// its props (README.md beside this file). Built on flow-canvas (it draws,
|
|
3
|
+
// pans and zooms; this block owns the tree, the layout and the keys). The
|
|
4
|
+
// tree helpers are plain functions and run anywhere, the server included.
|
|
5
|
+
export { MindMap } from "./mind-map";
|
|
6
|
+
export {
|
|
7
|
+
BRANCH_COLORS,
|
|
8
|
+
normalizeMap,
|
|
9
|
+
createTopic,
|
|
10
|
+
findTopic,
|
|
11
|
+
pathTo,
|
|
12
|
+
parentOf,
|
|
13
|
+
countTopics,
|
|
14
|
+
updateTopic,
|
|
15
|
+
insertTopic,
|
|
16
|
+
insertSibling,
|
|
17
|
+
removeTopic,
|
|
18
|
+
moveTopic,
|
|
19
|
+
shiftTopic,
|
|
20
|
+
indentTopic,
|
|
21
|
+
outdentTopic,
|
|
22
|
+
duplicateTopic,
|
|
23
|
+
setAllCollapsed,
|
|
24
|
+
layoutMindMap,
|
|
25
|
+
mindMapToBoard,
|
|
26
|
+
mindMapToText,
|
|
27
|
+
mindMapToMarkdown,
|
|
28
|
+
outlineToMindMap,
|
|
29
|
+
outlineToTopics,
|
|
30
|
+
mindMapTemplates,
|
|
31
|
+
} from "./tree";
|