makersclaw 0.2.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/THIRD-PARTY-NOTICES.md +180 -0
- package/package.json +3 -2
- 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 +10 -6
- 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 +205 -8
- 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 +12 -7
- 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 +3411 -29
- 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 +55 -5
- package/registry/blocks/board/block.json +2 -2
- package/registry/blocks/board/board.jsx +230 -86
- 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 +80 -0
- 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 +8 -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/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/template.json +264 -8
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// surface. Not installed into apps: `makersclaw add board` lays index.js
|
|
5
5
|
// and board.jsx only.
|
|
6
6
|
import { useState } from "react";
|
|
7
|
-
import { Badge } from "../components/ui";
|
|
7
|
+
import { Badge, Card } from "../components/ui";
|
|
8
8
|
import { Board } from "../components/blocks/board";
|
|
9
9
|
|
|
10
10
|
const STAGES = [
|
|
@@ -21,30 +21,109 @@ const START = [
|
|
|
21
21
|
{ id: 5, name: "Umbrella", stage: "paused", owner: "Leon", value: 3000 },
|
|
22
22
|
];
|
|
23
23
|
|
|
24
|
+
// A sprint: an icon per column, points summed beside each count, the
|
|
25
|
+
// story's type as the card's top edge.
|
|
26
|
+
const SPRINT_STAGES = [
|
|
27
|
+
{ key: "todo", label: "To do", icon: "inbox" },
|
|
28
|
+
{ key: "doing", label: "In progress", icon: "zap" },
|
|
29
|
+
{ key: "review", label: "Review", icon: "eye" },
|
|
30
|
+
{ key: "done", label: "Done", icon: "circle-check" },
|
|
31
|
+
];
|
|
32
|
+
const TYPES = { feature: 1, bug: 4, task: 2 };
|
|
33
|
+
const SPRINT = [
|
|
34
|
+
{ id: "s1", title: "Invite teammates by email", status: "todo", type: "feature", points: 5 },
|
|
35
|
+
{ id: "s2", title: "Export fails on empty rows", status: "todo", type: "bug", points: 2 },
|
|
36
|
+
{ id: "s3", title: "Billing page copy", status: "doing", type: "task", points: 1 },
|
|
37
|
+
{ id: "s4", title: "Saved filters", status: "doing", type: "feature", points: 8 },
|
|
38
|
+
{ id: "s5", title: "Timezone drift in reports", status: "review", type: "bug", points: 3 },
|
|
39
|
+
{ id: "s6", title: "Onboarding checklist", status: "done", type: "feature", points: 5 },
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
// Chores, stacked: the stages fold, each record is a row.
|
|
43
|
+
const CHORE_STAGES = [
|
|
44
|
+
{ key: "todo", label: "To do", icon: "inbox" },
|
|
45
|
+
{ key: "doing", label: "Doing", icon: "clock" },
|
|
46
|
+
{ key: "done", label: "Done", icon: "circle-check" },
|
|
47
|
+
];
|
|
48
|
+
const ROOMS = { Kitchen: 2, Bathroom: 3, Garden: 5 };
|
|
49
|
+
const CHORES = [
|
|
50
|
+
{ id: "c1", title: "Clean the fridge", state: "todo", room: "Kitchen", every: "Weekly" },
|
|
51
|
+
{ id: "c2", title: "Scrub the shower", state: "todo", room: "Bathroom", every: "Weekly" },
|
|
52
|
+
{ id: "c3", title: "Water the plants", state: "doing", room: "Garden", every: "Daily" },
|
|
53
|
+
{ id: "c4", title: "Empty the dishwasher", state: "done", room: "Kitchen", every: "Daily" },
|
|
54
|
+
];
|
|
55
|
+
|
|
56
|
+
function useMoves(start, key) {
|
|
57
|
+
const [rows, setRows] = useState(start);
|
|
58
|
+
const onMove = async (row, to) => {
|
|
59
|
+
setRows((all) => all.map((r) => (r.id === row.id ? { ...r, [key]: to } : r)));
|
|
60
|
+
return { ok: true };
|
|
61
|
+
};
|
|
62
|
+
return [rows, setRows, onMove];
|
|
63
|
+
}
|
|
64
|
+
|
|
24
65
|
export default function BoardDemo() {
|
|
25
|
-
const [rows, setRows] =
|
|
66
|
+
const [rows, setRows, onMove] = useMoves(START, "stage");
|
|
67
|
+
const [sprint, , moveStory] = useMoves(SPRINT, "status");
|
|
68
|
+
const [chores, setChores, moveChore] = useMoves(CHORES, "state");
|
|
26
69
|
return (
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
70
|
+
<div className="grid gap-6">
|
|
71
|
+
<Board
|
|
72
|
+
rows={rows}
|
|
73
|
+
groupBy="stage"
|
|
74
|
+
columns={STAGES}
|
|
75
|
+
titleOf={(d) => d.name}
|
|
76
|
+
onMove={onMove}
|
|
77
|
+
onCreate={async (name, stage) => {
|
|
78
|
+
setRows((all) => [...all, { id: Date.now(), name, stage, owner: null, value: 0 }]);
|
|
79
|
+
return { ok: true };
|
|
80
|
+
}}
|
|
81
|
+
renderDetails={(d) => (
|
|
82
|
+
<div className="flex items-center justify-between text-xs text-muted-foreground">
|
|
83
|
+
<span>{d.owner ?? "Unowned"}</span>
|
|
84
|
+
<Badge>{Number(d.value ?? 0).toLocaleString()}</Badge>
|
|
85
|
+
</div>
|
|
86
|
+
)}
|
|
87
|
+
limits={{ call: 1 }}
|
|
88
|
+
label="Demo deals by stage"
|
|
89
|
+
/>
|
|
90
|
+
|
|
91
|
+
<Card title="Sprint 18" description="Icons, points per column, a top edge by type">
|
|
92
|
+
<Board
|
|
93
|
+
rows={sprint}
|
|
94
|
+
groupBy="status"
|
|
95
|
+
columns={SPRINT_STAGES}
|
|
96
|
+
onMove={moveStory}
|
|
97
|
+
aggregate={(list) => `${list.reduce((s, r) => s + r.points, 0)}pt`}
|
|
98
|
+
accentOf={(r) => TYPES[r.type] ?? null}
|
|
99
|
+
renderDetails={(r) => (
|
|
100
|
+
<div className="flex items-center justify-between text-xs text-muted-foreground">
|
|
101
|
+
<span className="capitalize">{r.type}</span>
|
|
102
|
+
<Badge>{r.points}pt</Badge>
|
|
103
|
+
</div>
|
|
104
|
+
)}
|
|
105
|
+
label="Sprint 18 stories by status"
|
|
106
|
+
/>
|
|
107
|
+
</Card>
|
|
108
|
+
|
|
109
|
+
<Card title="Chores" description="Stacked: stages fold, rows move from their menu">
|
|
110
|
+
<Board
|
|
111
|
+
layout="stacked"
|
|
112
|
+
rows={chores}
|
|
113
|
+
groupBy="state"
|
|
114
|
+
columns={CHORE_STAGES}
|
|
115
|
+
onMove={moveChore}
|
|
116
|
+
defaultOpen={["todo", "doing"]}
|
|
117
|
+
accentOf={(r) => ROOMS[r.room] ?? null}
|
|
118
|
+
metaOf={(r) => r.room}
|
|
119
|
+
renderDetails={(r) => <Badge tone={r.every === "Daily" ? "warning" : "info"}>{r.every}</Badge>}
|
|
120
|
+
onCreate={async (title, state) => {
|
|
121
|
+
setChores((all) => [...all, { id: `c${Date.now()}`, title, state, room: "Kitchen", every: "Weekly" }]);
|
|
122
|
+
return { ok: true };
|
|
123
|
+
}}
|
|
124
|
+
label="Chores by state"
|
|
125
|
+
/>
|
|
126
|
+
</Card>
|
|
127
|
+
</div>
|
|
49
128
|
);
|
|
50
129
|
}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# Calendar
|
|
2
|
+
|
|
3
|
+
Tasks on a calendar, the way Google Calendar, Cron and Notion Calendar
|
|
4
|
+
draw them. **Month** shows all-day tasks and multi-day spans as tinted bars
|
|
5
|
+
across their days (stacked, never on top of each other; past three a day
|
|
6
|
+
says "2 more") and timed tasks as a dot, a time and a title. **Week** and
|
|
7
|
+
**Day** show an all-day strip over an hour grid: timed tasks are blocks
|
|
8
|
+
placed by their times, overlapping ones side by side, and a line marks
|
|
9
|
+
now. **Agenda** lists the days ahead with a round check to complete each
|
|
10
|
+
item.
|
|
11
|
+
|
|
12
|
+
Drag an item to another day or hour — a block snaps to the quarter hour
|
|
13
|
+
and to the day columns as it moves. Drag a block's bottom edge (or a
|
|
14
|
+
bar's end) to change how long it runs. Click an empty day or hour, or drag
|
|
15
|
+
across a few hours, and type the new task in place. Tasks with no date
|
|
16
|
+
wait in the **unscheduled tray** beside the calendar: drag one onto a day
|
|
17
|
+
or an hour to schedule it, or drop a scheduled one there to take its date
|
|
18
|
+
off. Search and filters come from task-model's toolbar, so the calendar
|
|
19
|
+
filters exactly like the list.
|
|
20
|
+
|
|
21
|
+
The **available-time layer** — closed hours muted, open slots as boxes
|
|
22
|
+
you can pick — is what a booking page is built on (`availability`,
|
|
23
|
+
`slots` / `getSlots`, `onSlotClick`, and the pure `freeSlots`).
|
|
24
|
+
|
|
25
|
+
Every change saves through one async `onChange(change)` and shows at
|
|
26
|
+
once; when the save fails the calendar puts it back and says why.
|
|
27
|
+
|
|
28
|
+
```jsx
|
|
29
|
+
import { CalendarView } from "../components/blocks/calendar-view"; // a Makersclaw app ("./blocks/calendar-view" from components/)
|
|
30
|
+
import { CalendarView } from "@/components/makersclaw/blocks/calendar-view"; // a shadcn project
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
It is a client component: render it from a `"use client"` component, and
|
|
34
|
+
load the tasks in the server surface (README §4). It is built on
|
|
35
|
+
`task-model` (added with it): the task shape, the change shapes and the
|
|
36
|
+
helpers are documented there.
|
|
37
|
+
|
|
38
|
+
## The data
|
|
39
|
+
|
|
40
|
+
Tasks in task-model's shape. Where a task lands is read from `start` and
|
|
41
|
+
`due` (wall-calendar strings, no time zone):
|
|
42
|
+
|
|
43
|
+
| The task has | It shows as |
|
|
44
|
+
| --- | --- |
|
|
45
|
+
| `due: "2026-09-24"` | an all-day item on the 24th |
|
|
46
|
+
| `start: "2026-09-22", due: "2026-09-24"` | a bar across the 22nd–24th |
|
|
47
|
+
| `start: "…T09:30", due: "…T11:00"` (same day) | a 9:30–11:00 block |
|
|
48
|
+
| `start: "…T09:30"` only | a block running its `estimate` (hours), else `defaultDuration` |
|
|
49
|
+
| `due: "…T17:00"` only | a deadline: a half-hour block at 5 PM, "Due 5:00 PM" |
|
|
50
|
+
| neither | the unscheduled tray (open tasks only) |
|
|
51
|
+
|
|
52
|
+
A drag saves only `start` and `due` (a move keeps the length and the
|
|
53
|
+
times; dropping a timed block on the all-day strip saves `start: null`;
|
|
54
|
+
dropping on the tray saves both as `null`). A new task from a click is
|
|
55
|
+
`draftTask(title, ctx, { due })` or `{ start, due }`.
|
|
56
|
+
|
|
57
|
+
## Props
|
|
58
|
+
|
|
59
|
+
- `tasks` — the tasks. Pass `useFixture(rows, SAMPLE).rows` and the
|
|
60
|
+
examples change on screen and save nothing.
|
|
61
|
+
- `statuses` · `people` · `projects` · `fields` — as task-list and
|
|
62
|
+
task-model take them. A project's `hue` (1–5) colours its items.
|
|
63
|
+
- `onChange(change)` — save a change; return `{ ok: true }` or
|
|
64
|
+
`{ ok: false, error }` (a throw counts as failed). In a Makersclaw app,
|
|
65
|
+
loop over `changeWrites(change)` (task-model README, "A change").
|
|
66
|
+
Without it the calendar only shows: no drag, no quick-add, no checks.
|
|
67
|
+
- `onOpen(task)` — clicking an item (or Enter on it) opens your `Sheet`.
|
|
68
|
+
- `mode` · `defaultMode` (`"month"`) · `onModeChange(mode)` — month ·
|
|
69
|
+
week · day · agenda. `modes` — which ones the switcher offers (default
|
|
70
|
+
all four; one hides the switcher).
|
|
71
|
+
- `date` · `defaultDate` (today) · `onDateChange(day)` — the day the
|
|
72
|
+
view is around.
|
|
73
|
+
- `view` · `defaultView` · `onViewChange(view)` — task-model's view
|
|
74
|
+
(search, filters, hideDone); grouping and sort do not apply here.
|
|
75
|
+
- `today` — "YYYY-MM-DD"; fix it in a demo. `now` — "YYYY-MM-DDTHH:mm"
|
|
76
|
+
for the now line; default the browser's clock (after mount).
|
|
77
|
+
- `weekStartsOn` (1, Monday) · `weekend` (`[0, 6]`, muted) · `holidays`
|
|
78
|
+
· `locale` (the browser's) — dates, hours and headings follow it.
|
|
79
|
+
- `colorBy` — `"project"` (default) · `"status"` (the status's tone).
|
|
80
|
+
- `tray` (true) — the unscheduled tray: a column beside the calendar
|
|
81
|
+
when it is 960px wide or more (the toolbar's "Unscheduled" button
|
|
82
|
+
folds it), a sheet with a date picker per task below that.
|
|
83
|
+
- `header` (true) — the title, Today, arrows and the view switcher.
|
|
84
|
+
`toolbar` (true) — search, filter, "Unscheduled", "Add task";
|
|
85
|
+
`toolbarExtra` — your buttons at its end. `addLabel` ("Add task").
|
|
86
|
+
- `hourHeight` (48) — pixels per hour. `height` ("40rem") — the hour
|
|
87
|
+
grid's scrolling height. `snap` (15) — minutes a drag snaps to.
|
|
88
|
+
`defaultDuration` (60) — minutes of a new block. `agendaDays` (14).
|
|
89
|
+
- `loading` — a skeleton month. `error` — a read error, as a Notice.
|
|
90
|
+
- `label` ("Calendar") — the region's name.
|
|
91
|
+
|
|
92
|
+
### The available-time layer (week and day)
|
|
93
|
+
|
|
94
|
+
- `availability` — the open hours; everything else is drawn muted:
|
|
95
|
+
`{ days: [1,2,3,4,5], from: "09:00", to: "17:00" }`, or per weekday
|
|
96
|
+
`{ weekly: { 1: [["09:00","12:00"], ["13:00","17:00"]], … } }`, either
|
|
97
|
+
with `dates: { "2026-12-24": [["09:00","12:00"]], "2026-12-25": [] }`,
|
|
98
|
+
or a function `(day) → [["09:00","17:00"]]`.
|
|
99
|
+
- `slots` — open times to show: `[{ start: "2026-09-24T10:00", end:
|
|
100
|
+
"2026-09-24T10:30", id?, …yours }]`.
|
|
101
|
+
- `getSlots({ from, to })` — the same, fetched for the days on screen
|
|
102
|
+
(may be async; called again when the range changes). Pass a stable
|
|
103
|
+
function (`useCallback`); a new one fetches again.
|
|
104
|
+
- `onSlotClick(slot)` — slots become buttons; `selectedSlot` (a slot's
|
|
105
|
+
`id` or `start`) fills the picked one. `slotLabel` ("Open") is what a
|
|
106
|
+
screen reader says before the time. `renderSlot(slot, { selected })`
|
|
107
|
+
draws a slot's inside.
|
|
108
|
+
|
|
109
|
+
A booking page is the calendar with `modes={["week", "day"]}`,
|
|
110
|
+
`toolbar={false}`, `tray={false}`, the host's meetings as `tasks`, and:
|
|
111
|
+
|
|
112
|
+
```js
|
|
113
|
+
const getSlots = useCallback(({ from, to }) =>
|
|
114
|
+
freeSlots({ from, to, availability: HOURS, busy: meetings, minutes: 30, buffer: 10, notice: 120, now }), [meetings, now]);
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Helpers (pure, from the same import)
|
|
118
|
+
|
|
119
|
+
- `freeSlots({ from, to, availability, busy, minutes = 30, step, buffer, notice, now })`
|
|
120
|
+
→ `[{ id, day, start, end, from, to }]` — `busy` mixes tasks (their
|
|
121
|
+
timed blocks; all-day items do not take time) and `{ start, end }`
|
|
122
|
+
intervals; `buffer` minutes kept free around each; nothing before
|
|
123
|
+
`now` + `notice` minutes. `availabilityOn(day, availability)` /
|
|
124
|
+
`closedOn(day, availability)` → `[[from, to], …]` minutes.
|
|
125
|
+
- `eventOf(task)` → `{ id, task, timed, start, end, from, to, deadline, startOnly }`
|
|
126
|
+
or null; `eventsOf(tasks)` · `unscheduledOf(tasks)`.
|
|
127
|
+
- `layoutTimed(events)` → Map id → `{ col, cols, span }` (side by side);
|
|
128
|
+
`layoutLanes(events, days)` → `{ items: [{ event, lane, col, span, clippedStart, clippedEnd }], lanes }`.
|
|
129
|
+
- The patches a gesture saves: `moveEventPatch(event, day, from)` ·
|
|
130
|
+
`resizeEventPatch(event, to)` · `placeEventPatch(event, day, from, to)` ·
|
|
131
|
+
`timedPatch(day, from, minutes)` · `dayPatch(task, day, { grabbed })` ·
|
|
132
|
+
`allDayPatch(day)` · `extendPatch(event, endDay)` · `UNSCHEDULE`.
|
|
133
|
+
- `rangeFor(mode, anchor, { weekStartsOn, count, agendaDays })` ·
|
|
134
|
+
`stepAnchor` · `titleFor` · `rangeLabel` · `hourLabel` ·
|
|
135
|
+
`minutesLabel` · `eventTimeLabel` · `snapMinutes` · `durationOf` ·
|
|
136
|
+
`CALENDAR_MODES` · `MODE_LABELS` · `DAY_MINUTES`.
|
|
137
|
+
|
|
138
|
+
### Keyboard
|
|
139
|
+
|
|
140
|
+
- A focused block: ↑/↓ moves it 15 minutes, ←/→ a day, Shift+↑/↓
|
|
141
|
+
changes its length (saved once the keys rest); Enter opens it;
|
|
142
|
+
Delete removes it, with Undo in the toast.
|
|
143
|
+
- A focused bar or month item: Space picks it up, the arrows move it
|
|
144
|
+
between days, Space drops it, Escape puts it back; Shift+←/→ changes
|
|
145
|
+
a bar's last day.
|
|
146
|
+
- Anywhere in the calendar: T today · J / K next / previous · M W D A
|
|
147
|
+
the views · C a new task.
|
|
148
|
+
|
|
149
|
+
## Example
|
|
150
|
+
|
|
151
|
+
```jsx
|
|
152
|
+
"use client";
|
|
153
|
+
import { useState } from "react";
|
|
154
|
+
import { Sheet } from "./ui";
|
|
155
|
+
import { CalendarView } from "./blocks/calendar-view";
|
|
156
|
+
|
|
157
|
+
export default function Schedule({ tasks, people, projects, onChange }) {
|
|
158
|
+
const [open, setOpen] = useState(null);
|
|
159
|
+
return (
|
|
160
|
+
<>
|
|
161
|
+
<CalendarView tasks={tasks} people={people} projects={projects} onChange={onChange} onOpen={setOpen} defaultMode="week" />
|
|
162
|
+
<Sheet open={Boolean(open)} onClose={() => setOpen(null)} title={open?.title}>…</Sheet>
|
|
163
|
+
</>
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
## What it will not do
|
|
169
|
+
|
|
170
|
+
- Recurring events, time zones, or events that are not tasks: a repeat
|
|
171
|
+
is the page's to create; a time is wall time.
|
|
172
|
+
- Timed blocks that cross midnight: a task over several days is an
|
|
173
|
+
all-day bar.
|
|
174
|
+
- Fetch or save: tasks come in as props, changes go out through
|
|
175
|
+
`onChange`; slots come from `slots` or your `getSlots`.
|
|
176
|
+
- Take a booking: `onSlotClick` hands you the slot; the form and the
|
|
177
|
+
write are the page's (booking-page).
|
|
178
|
+
|
|
179
|
+
Its files are fixed: `npm run check` refuses a change, and `makersclaw
|
|
180
|
+
add calendar-view` restores them.
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { Button, Empty, cx } from "../../ui";
|
|
4
|
+
import { AssigneeStack, CompleteToggle, diffDays, formatDate, isDone, toggleDoneChange } from "../task-model";
|
|
5
|
+
import { eventTimeLabel } from "./calendar-model";
|
|
6
|
+
import { DraftInput } from "./draft";
|
|
7
|
+
import { paintOf } from "./paint";
|
|
8
|
+
|
|
9
|
+
// The agenda: the days ahead as a list, each day's items in time order
|
|
10
|
+
// (all-day first), with a round check to complete each. Days with nothing
|
|
11
|
+
// on them are left out — except today, which always shows. On a phone
|
|
12
|
+
// the month's tapped day is drawn by the same AgendaDay.
|
|
13
|
+
|
|
14
|
+
const WORDS = "flex min-w-0 flex-1 flex-col items-start py-1.5 text-left outline-none";
|
|
15
|
+
|
|
16
|
+
const order = (a, b) => Number(a.timed) - Number(b.timed) || (a.from ?? 0) - (b.from ?? 0) || String(a.task.title).localeCompare(String(b.task.title));
|
|
17
|
+
|
|
18
|
+
export function AgendaView({ days, events, api }) {
|
|
19
|
+
const { ctx } = api;
|
|
20
|
+
const sections = days
|
|
21
|
+
.map((day) => ({ day, items: events.filter((e) => e.start <= day && day <= e.end).sort(order) }))
|
|
22
|
+
.filter((s) => s.items.length || s.day === ctx.today || (api.draft?.allDay && api.draft.day === s.day));
|
|
23
|
+
const any = sections.some((s) => s.items.length);
|
|
24
|
+
if (!any && !(api.draft && days.includes(api.draft.day))) {
|
|
25
|
+
return (
|
|
26
|
+
<Empty
|
|
27
|
+
icon="calendar"
|
|
28
|
+
title="Nothing scheduled in these days"
|
|
29
|
+
body="Tasks with a date show up here, day by day. Give one a date, or add a new one."
|
|
30
|
+
action={
|
|
31
|
+
api.editable ? (
|
|
32
|
+
<Button variant="primary" size="sm" icon="plus" onClick={() => api.startDraft({ day: days[0], allDay: true })}>
|
|
33
|
+
{api.addLabel}
|
|
34
|
+
</Button>
|
|
35
|
+
) : null
|
|
36
|
+
}
|
|
37
|
+
/>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
return (
|
|
41
|
+
<div className="overflow-hidden rounded-lg border border-border bg-card">
|
|
42
|
+
{sections.map((s) => (
|
|
43
|
+
<AgendaDay key={s.day} day={s.day} events={s.items} api={api} />
|
|
44
|
+
))}
|
|
45
|
+
</div>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** One day of the agenda: its date on the left, its items on the right. */
|
|
50
|
+
export function AgendaDay({ day, events, api, standalone = false }) {
|
|
51
|
+
const { ctx, locale } = api;
|
|
52
|
+
const today = day === ctx.today;
|
|
53
|
+
const items = [...events].sort(order);
|
|
54
|
+
const drafting = api.draft?.allDay && api.draft.day === day;
|
|
55
|
+
const label = formatDate(day, { weekday: "long", month: "long", day: "numeric" }, { locale });
|
|
56
|
+
return (
|
|
57
|
+
<section
|
|
58
|
+
aria-label={label}
|
|
59
|
+
className={cx(
|
|
60
|
+
"grid grid-cols-[3.25rem_minmax(0,1fr)] gap-x-3 px-3 py-3 sm:grid-cols-[6.5rem_minmax(0,1fr)] sm:px-4",
|
|
61
|
+
standalone ? "rounded-lg border border-border bg-card" : "border-b border-border last:border-b-0",
|
|
62
|
+
)}
|
|
63
|
+
>
|
|
64
|
+
<h3 className="flex flex-col items-start pt-1 sm:flex-row sm:items-baseline sm:gap-2">
|
|
65
|
+
<span data-nums className={cx("text-xl font-semibold leading-none", today ? "text-primary" : "text-foreground")}>
|
|
66
|
+
{Number(day.slice(8, 10))}
|
|
67
|
+
</span>
|
|
68
|
+
<span className={cx("mt-1 text-xs sm:mt-0", today ? "font-medium text-primary" : "text-muted-foreground")}>
|
|
69
|
+
{today ? "Today" : diffDays(ctx.today, day) === 1 ? "Tomorrow" : formatDate(day, { weekday: "short" }, { locale })}
|
|
70
|
+
</span>
|
|
71
|
+
</h3>
|
|
72
|
+
<ul className="grid min-w-0 gap-0.5">
|
|
73
|
+
{drafting ? (
|
|
74
|
+
<li className="flex min-h-11 items-center gap-2 rounded-md bg-primary/10 px-2 ring-1 ring-primary">
|
|
75
|
+
<DraftInput className="text-sm" label={`New task on ${label}`} placeholder="New task, then Enter" onSubmit={api.saveDraft} onCancel={api.cancelDraft} />
|
|
76
|
+
</li>
|
|
77
|
+
) : null}
|
|
78
|
+
{items.map((e) => (
|
|
79
|
+
<AgendaRow key={e.id} event={e} day={day} api={api} />
|
|
80
|
+
))}
|
|
81
|
+
{!items.length && !drafting ? (
|
|
82
|
+
<li className="flex min-h-11 items-center justify-between gap-2 px-2 text-sm text-muted-foreground">
|
|
83
|
+
<span>{today ? "Nothing scheduled today" : "Nothing scheduled"}</span>
|
|
84
|
+
{api.editable ? (
|
|
85
|
+
<Button size="sm" variant="quiet" icon="plus" onClick={() => api.startDraft({ day, allDay: true })}>
|
|
86
|
+
{api.addLabel}
|
|
87
|
+
</Button>
|
|
88
|
+
) : null}
|
|
89
|
+
</li>
|
|
90
|
+
) : null}
|
|
91
|
+
{items.length > 0 && standalone && api.editable && !drafting ? (
|
|
92
|
+
<li className="pt-1">
|
|
93
|
+
<Button size="sm" variant="quiet" icon="plus" align="start" onClick={() => api.startDraft({ day, allDay: true })}>
|
|
94
|
+
{api.addLabel}
|
|
95
|
+
</Button>
|
|
96
|
+
</li>
|
|
97
|
+
) : null}
|
|
98
|
+
</ul>
|
|
99
|
+
</section>
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function AgendaRow({ event, day, api }) {
|
|
104
|
+
const { ctx, locale, editable } = api;
|
|
105
|
+
const task = event.task;
|
|
106
|
+
const done = isDone(task, ctx);
|
|
107
|
+
const title = task.title || "Untitled";
|
|
108
|
+
const paint = paintOf(task, ctx, api.colorBy);
|
|
109
|
+
const project = ctx.projectById.get(String(task.project));
|
|
110
|
+
const multi = event.start !== event.end;
|
|
111
|
+
const time = multi ? `Day ${diffDays(event.start, day) + 1} of ${diffDays(event.start, event.end) + 1}` : eventTimeLabel(event, { locale });
|
|
112
|
+
const words = (
|
|
113
|
+
<>
|
|
114
|
+
<span className={cx("w-full truncate text-sm font-medium", done && "text-muted-foreground line-through")} title={title}>
|
|
115
|
+
{title}
|
|
116
|
+
</span>
|
|
117
|
+
<span className="flex w-full min-w-0 items-center gap-1.5 text-xs text-muted-foreground">
|
|
118
|
+
{editable ? <span aria-hidden="true" className={cx("size-1.5 shrink-0 rounded-full", paint.dot)} /> : null}
|
|
119
|
+
<span data-nums className="shrink-0">
|
|
120
|
+
{time}
|
|
121
|
+
</span>
|
|
122
|
+
{project ? <span className="truncate">· {project.name}</span> : null}
|
|
123
|
+
</span>
|
|
124
|
+
</>
|
|
125
|
+
);
|
|
126
|
+
return (
|
|
127
|
+
<li className="group/row flex min-h-11 min-w-0 items-center gap-1 rounded-md pe-2 transition-colors duration-150 hover:bg-accent/60">
|
|
128
|
+
{editable ? (
|
|
129
|
+
<CompleteToggle size="sm" done={done} label={`“${title}”`} onToggle={() => api.commit(toggleDoneChange(task, ctx), { label: `“${title}”` })} />
|
|
130
|
+
) : (
|
|
131
|
+
<span aria-hidden="true" className="inline-flex size-9 shrink-0 items-center justify-center">
|
|
132
|
+
<span className={cx("size-2 rounded-full", paint.dot)} />
|
|
133
|
+
</span>
|
|
134
|
+
)}
|
|
135
|
+
{api.open ? (
|
|
136
|
+
// raw: the row's words open the task; a kit Button centres and pads
|
|
137
|
+
// an action, this is two lines of text.
|
|
138
|
+
<button type="button" onClick={() => api.open(task)} className={cx(WORDS, "rounded-sm focus-visible:ring-2 focus-visible:ring-ring")}>
|
|
139
|
+
{words}
|
|
140
|
+
</button>
|
|
141
|
+
) : (
|
|
142
|
+
<span className={WORDS}>{words}</span>
|
|
143
|
+
)}
|
|
144
|
+
{task.assignees?.length ? <AssigneeStack ids={task.assignees} ctx={ctx} max={2} /> : null}
|
|
145
|
+
</li>
|
|
146
|
+
);
|
|
147
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "calendar-view",
|
|
3
|
+
"title": "Calendar",
|
|
4
|
+
"description": "Tasks on a calendar, like Google Calendar, Cron or Notion Calendar: month, week, day and agenda views over task-model's work items. Month shows all-day tasks and spans as tinted bars across their days (stacked in lanes, \"2 more\" past three) and timed ones as a dot and a time; week and day show an all-day strip over an hour grid where timed tasks are blocks placed by their times, overlapping ones side by side, with a line at now. Drag an item to another day or hour (it snaps to the quarter hour and the day columns as it moves), drag its bottom or end to change how long it runs, click an empty day or hour (or drag across hours) to type a new task in place, drag tasks without a date in from an unscheduled tray (or drop one there to take its date off). Arrow keys move a focused block, Shift+arrows resize it, Delete removes with Undo; T, J/K, M/W/D/A and C for today, next/previous, the views and a new task. Search and filters from the shared ViewToolbar, a colour per project or status, a real phone layout (a dotted month with the tapped day listed, a three-day week, a sheet for the tray). An available-time layer (closed hours muted, open slots as boxes you pick, from `availability`, `slots` or an async `getSlots`, with pure `freeSlots` / `availabilityOn` helpers) is what a booking page builds on. One async onChange saves every change; failures roll back with a notice.",
|
|
5
|
+
"useWhen": "A screen where dated work or events are seen by day and moved around: a team's deadlines, a content calendar, a launch plan, shifts, a personal schedule, meetings on tasks, or the slot picker of a booking page (modes week/day, slots from getSlots). Not for dependencies over a long timeline (gantt), for undated work (task-list, board), or for a single date field (the kit's DatePicker).",
|
|
6
|
+
"tags": [
|
|
7
|
+
"calendar",
|
|
8
|
+
"schedule",
|
|
9
|
+
"month",
|
|
10
|
+
"week",
|
|
11
|
+
"day",
|
|
12
|
+
"agenda",
|
|
13
|
+
"time grid",
|
|
14
|
+
"events",
|
|
15
|
+
"tasks",
|
|
16
|
+
"deadlines",
|
|
17
|
+
"content calendar",
|
|
18
|
+
"drag",
|
|
19
|
+
"resize",
|
|
20
|
+
"unscheduled",
|
|
21
|
+
"availability",
|
|
22
|
+
"slots",
|
|
23
|
+
"booking",
|
|
24
|
+
"google calendar",
|
|
25
|
+
"cron",
|
|
26
|
+
"notion calendar",
|
|
27
|
+
"clickup",
|
|
28
|
+
"planner"
|
|
29
|
+
],
|
|
30
|
+
"exports": [
|
|
31
|
+
"CalendarView",
|
|
32
|
+
"CALENDAR_MODES",
|
|
33
|
+
"MODE_LABELS",
|
|
34
|
+
"DAY_MINUTES",
|
|
35
|
+
"UNSCHEDULE",
|
|
36
|
+
"snapMinutes",
|
|
37
|
+
"durationOf",
|
|
38
|
+
"eventOf",
|
|
39
|
+
"eventsOf",
|
|
40
|
+
"unscheduledOf",
|
|
41
|
+
"layoutTimed",
|
|
42
|
+
"layoutLanes",
|
|
43
|
+
"moveEventPatch",
|
|
44
|
+
"resizeEventPatch",
|
|
45
|
+
"placeEventPatch",
|
|
46
|
+
"timedPatch",
|
|
47
|
+
"dayPatch",
|
|
48
|
+
"allDayPatch",
|
|
49
|
+
"extendPatch",
|
|
50
|
+
"rangeFor",
|
|
51
|
+
"stepAnchor",
|
|
52
|
+
"rangeLabel",
|
|
53
|
+
"titleFor",
|
|
54
|
+
"hourLabel",
|
|
55
|
+
"minutesLabel",
|
|
56
|
+
"eventTimeLabel",
|
|
57
|
+
"availabilityOn",
|
|
58
|
+
"closedOn",
|
|
59
|
+
"freeSlots",
|
|
60
|
+
"normalizeSlots"
|
|
61
|
+
],
|
|
62
|
+
"files": [
|
|
63
|
+
"index.js",
|
|
64
|
+
"calendar.jsx",
|
|
65
|
+
"calendar-model.js",
|
|
66
|
+
"month.jsx",
|
|
67
|
+
"time-grid.jsx",
|
|
68
|
+
"agenda.jsx",
|
|
69
|
+
"tray.jsx",
|
|
70
|
+
"draft.jsx",
|
|
71
|
+
"paint.js"
|
|
72
|
+
],
|
|
73
|
+
"requires": [
|
|
74
|
+
"task-model"
|
|
75
|
+
]
|
|
76
|
+
}
|