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,309 @@
|
|
|
1
|
+
// The document, outside the editor. A doc is BlockNote JSON: an array of
|
|
2
|
+
// blocks, each { id, type, props, content, children }. These are plain
|
|
3
|
+
// functions over that JSON — no editor, no browser — so a server surface,
|
|
4
|
+
// an action or a test can read a doc the same way the screen does.
|
|
5
|
+
//
|
|
6
|
+
// Why not BlockNote's own blocksToMarkdownLossy: it needs a mounted editor
|
|
7
|
+
// and a DOM, and it drops our inline content (a mention, a merge field).
|
|
8
|
+
// Walking the JSON keeps both, and gives the same text on the server.
|
|
9
|
+
|
|
10
|
+
/** A doc with nothing in it: one empty paragraph (BlockNote refuses []). */
|
|
11
|
+
export function emptyDoc() {
|
|
12
|
+
return [{ type: "paragraph", content: [] }];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const blocksOf = (doc) => (Array.isArray(doc) ? doc : []);
|
|
16
|
+
|
|
17
|
+
/** Walk every block, depth first, with its depth. */
|
|
18
|
+
function eachBlock(doc, fn, depth = 0) {
|
|
19
|
+
for (const b of blocksOf(doc)) {
|
|
20
|
+
if (!b || typeof b !== "object") continue;
|
|
21
|
+
fn(b, depth);
|
|
22
|
+
eachBlock(b.children, fn, depth + 1);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** The inline pieces of a block's content, whatever shape it came in. */
|
|
27
|
+
function inlineOf(content) {
|
|
28
|
+
if (typeof content === "string") return [{ type: "text", text: content, styles: {} }];
|
|
29
|
+
return Array.isArray(content) ? content : [];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** How a merge field reads: its value when `fields` gives one, else `{key}`. */
|
|
33
|
+
function fieldValue(props, fields) {
|
|
34
|
+
const key = props?.key ?? "";
|
|
35
|
+
const v = typeof fields === "function" ? fields(key, props) : fields && typeof fields === "object" ? fields[key] : undefined;
|
|
36
|
+
return v === undefined || v === null || v === "" ? `{${key}}` : String(v);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function inlineText(content, opts) {
|
|
40
|
+
let out = "";
|
|
41
|
+
for (const c of inlineOf(content)) {
|
|
42
|
+
if (!c) continue;
|
|
43
|
+
if (c.type === "text") out += c.text ?? "";
|
|
44
|
+
else if (c.type === "link") out += inlineText(c.content, opts);
|
|
45
|
+
else if (c.type === "mention") out += `@${c.props?.label ?? c.props?.id ?? ""}`;
|
|
46
|
+
else if (c.type === "field") out += fieldValue(c.props, opts?.fields);
|
|
47
|
+
else if (Array.isArray(c.content)) out += inlineText(c.content, opts);
|
|
48
|
+
}
|
|
49
|
+
return out;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** The text of one block's own content (not its children). */
|
|
53
|
+
function blockText(block, opts) {
|
|
54
|
+
const c = block.content;
|
|
55
|
+
if (c && typeof c === "object" && !Array.isArray(c) && c.type === "tableContent") {
|
|
56
|
+
return (c.rows ?? []).map((r) => (r.cells ?? []).map((cell) => inlineText(cell?.content ?? cell, opts)).join("\t")).join("\n");
|
|
57
|
+
}
|
|
58
|
+
if (block.type === "image" || block.type === "file" || block.type === "video" || block.type === "audio") {
|
|
59
|
+
return block.props?.caption || block.props?.name || "";
|
|
60
|
+
}
|
|
61
|
+
return inlineText(c, opts);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const PREFIX_TEXT = {
|
|
65
|
+
bulletListItem: () => "- ",
|
|
66
|
+
toggleListItem: () => "- ",
|
|
67
|
+
checkListItem: (b) => (b.props?.checked ? "[x] " : "[ ] "),
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Plain text: one line per block (an empty paragraph is an empty line),
|
|
72
|
+
* children indented by two spaces, list markers kept ("- ", "1. ",
|
|
73
|
+
* "[ ] "), a mention as @Label, a merge field as its value or {key}.
|
|
74
|
+
*
|
|
75
|
+
* docToText(doc) → "Hi {first_name},\n…"
|
|
76
|
+
* docToText(doc, { fields: { first_name: "Ana" } }) → "Hi Ana,\n…"
|
|
77
|
+
*
|
|
78
|
+
* `fields` is { key: value } or (key, props) => value; an empty value
|
|
79
|
+
* leaves {key} in place.
|
|
80
|
+
*/
|
|
81
|
+
export function docToText(doc, opts = {}) {
|
|
82
|
+
const lines = [];
|
|
83
|
+
const walk = (blocks, depth) => {
|
|
84
|
+
let n = 0;
|
|
85
|
+
for (const b of blocksOf(blocks)) {
|
|
86
|
+
if (!b || typeof b !== "object") continue;
|
|
87
|
+
n = b.type === "numberedListItem" ? n + 1 : 0;
|
|
88
|
+
if (b.type !== "divider") {
|
|
89
|
+
const marker = b.type === "numberedListItem" ? `${n}. ` : PREFIX_TEXT[b.type]?.(b) ?? "";
|
|
90
|
+
const text = blockText(b, opts);
|
|
91
|
+
const pad = " ".repeat(depth);
|
|
92
|
+
lines.push(...`${marker}${text}`.split("\n").map((l, i) => (i === 0 ? pad + l : pad + " ".repeat(marker.length) + l)));
|
|
93
|
+
}
|
|
94
|
+
walk(b.children, depth + 1);
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
walk(doc, 0);
|
|
98
|
+
return lines.join("\n").replace(/\s+$/, "");
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// ---- markdown --------------------------------------------------------------
|
|
102
|
+
|
|
103
|
+
// Escape what would turn into markup. An underscore inside a word
|
|
104
|
+
// (first_name) is not emphasis in GFM, so it stays bare.
|
|
105
|
+
const escapeMd = (s) => s.replace(/([\\`*[\]])/g, "\\$1").replace(/(^|[^\w])_|_(?![\w])/g, (m) => m.replace("_", "\\_"));
|
|
106
|
+
|
|
107
|
+
/** Wrap a run in markers, keeping its edge spaces outside ("** bold**" is not bold). */
|
|
108
|
+
function wrap(text, marker) {
|
|
109
|
+
const m = /^(\s*)([\s\S]*?)(\s*)$/.exec(text);
|
|
110
|
+
return m[2] ? `${m[1]}${marker}${m[2]}${marker}${m[3]}` : text;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function inlineMd(content, opts) {
|
|
114
|
+
let out = "";
|
|
115
|
+
for (const c of inlineOf(content)) {
|
|
116
|
+
if (!c) continue;
|
|
117
|
+
if (c.type === "text") {
|
|
118
|
+
const s = c.styles ?? {};
|
|
119
|
+
let t = s.code ? `\`${(c.text ?? "").replace(/`/g, "ˋ")}\`` : escapeMd(c.text ?? "");
|
|
120
|
+
if (s.strike) t = wrap(t, "~~");
|
|
121
|
+
if (s.italic) t = wrap(t, "*");
|
|
122
|
+
if (s.bold) t = wrap(t, "**");
|
|
123
|
+
out += t;
|
|
124
|
+
} else if (c.type === "link") out += `[${inlineMd(c.content, opts)}](${c.href ?? ""})`;
|
|
125
|
+
else if (c.type === "mention") out += `@${escapeMd(c.props?.label ?? c.props?.id ?? "")}`;
|
|
126
|
+
else if (c.type === "field") out += escapeMd(fieldValue(c.props, opts?.fields));
|
|
127
|
+
else if (Array.isArray(c.content)) out += inlineMd(c.content, opts);
|
|
128
|
+
}
|
|
129
|
+
return out;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function tableMd(content, opts) {
|
|
133
|
+
const rows = (content.rows ?? []).map((r) => (r.cells ?? []).map((cell) => inlineMd(cell?.content ?? cell, opts).replace(/\|/g, "\\|").replace(/\n/g, " ")));
|
|
134
|
+
if (!rows.length) return "";
|
|
135
|
+
const width = Math.max(...rows.map((r) => r.length));
|
|
136
|
+
const line = (r) => `| ${Array.from({ length: width }, (_, i) => r[i] ?? "").join(" | ")} |`;
|
|
137
|
+
return [line(rows[0]), `| ${Array(width).fill("---").join(" | ")} |`, ...rows.slice(1).map(line)].join("\n");
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const LIST = new Set(["bulletListItem", "numberedListItem", "checkListItem", "toggleListItem"]);
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Markdown (GitHub-flavoured): headings, lists with nesting, checklists
|
|
144
|
+
* (- [ ] / - [x]), quotes, fenced code, tables, images, dividers; bold,
|
|
145
|
+
* italic, strike, inline code and links. A mention is @Label, a merge
|
|
146
|
+
* field its value or {key} (same `fields` as docToText). Lossy where
|
|
147
|
+
* markdown has no word for it: underline, colours, alignment, a toggle's
|
|
148
|
+
* folding. Empty paragraphs are dropped.
|
|
149
|
+
*/
|
|
150
|
+
export function docToMarkdown(doc, opts = {}) {
|
|
151
|
+
const out = [];
|
|
152
|
+
const walk = (blocks, indent) => {
|
|
153
|
+
let n = 0;
|
|
154
|
+
let prevList = false;
|
|
155
|
+
for (const b of blocksOf(blocks)) {
|
|
156
|
+
if (!b || typeof b !== "object") continue;
|
|
157
|
+
n = b.type === "numberedListItem" ? n + 1 : 0;
|
|
158
|
+
// Which list it belongs to: a numbered list after a bulleted one is a
|
|
159
|
+
// new list, and gets a blank line between.
|
|
160
|
+
const isList = LIST.has(b.type) ? (b.type === "numberedListItem" ? "ol" : "ul") : false;
|
|
161
|
+
let text;
|
|
162
|
+
let marker = "";
|
|
163
|
+
const c = b.content;
|
|
164
|
+
switch (b.type) {
|
|
165
|
+
case "heading":
|
|
166
|
+
text = `${"#".repeat(Math.min(6, Math.max(1, Number(b.props?.level) || 1)))} ${inlineMd(c, opts)}`;
|
|
167
|
+
break;
|
|
168
|
+
case "bulletListItem":
|
|
169
|
+
case "toggleListItem":
|
|
170
|
+
marker = "- ";
|
|
171
|
+
text = inlineMd(c, opts);
|
|
172
|
+
break;
|
|
173
|
+
case "numberedListItem":
|
|
174
|
+
marker = `${n}. `;
|
|
175
|
+
text = inlineMd(c, opts);
|
|
176
|
+
break;
|
|
177
|
+
case "checkListItem":
|
|
178
|
+
marker = `- [${b.props?.checked ? "x" : " "}] `;
|
|
179
|
+
text = inlineMd(c, opts);
|
|
180
|
+
break;
|
|
181
|
+
case "quote":
|
|
182
|
+
text = inlineMd(c, opts)
|
|
183
|
+
.split("\n")
|
|
184
|
+
.map((l) => `> ${l}`)
|
|
185
|
+
.join("\n");
|
|
186
|
+
break;
|
|
187
|
+
case "codeBlock":
|
|
188
|
+
text = `\`\`\`${b.props?.language && b.props.language !== "text" ? b.props.language : ""}\n${inlineText(c)}\n\`\`\``;
|
|
189
|
+
break;
|
|
190
|
+
case "divider":
|
|
191
|
+
text = "---";
|
|
192
|
+
break;
|
|
193
|
+
case "table":
|
|
194
|
+
text = c && typeof c === "object" && !Array.isArray(c) ? tableMd(c, opts) : "";
|
|
195
|
+
break;
|
|
196
|
+
case "image":
|
|
197
|
+
text = b.props?.url ? `` : "";
|
|
198
|
+
break;
|
|
199
|
+
case "file":
|
|
200
|
+
case "video":
|
|
201
|
+
case "audio":
|
|
202
|
+
text = b.props?.url ? `[${escapeMd(b.props?.name || b.props?.caption || b.props.url)}](${b.props.url})` : "";
|
|
203
|
+
break;
|
|
204
|
+
default:
|
|
205
|
+
text = inlineMd(c, opts);
|
|
206
|
+
}
|
|
207
|
+
const pad = " ".repeat(indent);
|
|
208
|
+
if (text.trim() || marker) {
|
|
209
|
+
const body = `${marker}${text}`.split("\n").map((l, i) => (i === 0 ? pad + l : l ? pad + " ".repeat(marker.length) + l : l));
|
|
210
|
+
// Blank line between blocks; list items in a row stay together.
|
|
211
|
+
if (out.length && !(isList && isList === prevList)) out.push("");
|
|
212
|
+
out.push(body.join("\n"));
|
|
213
|
+
}
|
|
214
|
+
prevList = isList;
|
|
215
|
+
if (b.children?.length) {
|
|
216
|
+
const before = out.length;
|
|
217
|
+
walk(b.children, indent + (marker ? marker.length : 2));
|
|
218
|
+
// A nested list follows its item directly.
|
|
219
|
+
if (isList && out.length > before && out[before] === "") out.splice(before, 1);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
walk(doc, 0);
|
|
224
|
+
return out.join("\n").replace(/\n{3,}/g, "\n\n").trim();
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// ---- reading a doc ---------------------------------------------------------
|
|
228
|
+
|
|
229
|
+
/** True when there is no text, no mention, no field and no block but empty paragraphs. */
|
|
230
|
+
export function isDocEmpty(doc) {
|
|
231
|
+
let empty = true;
|
|
232
|
+
eachBlock(doc, (b) => {
|
|
233
|
+
if (!empty) return;
|
|
234
|
+
if (b.type !== "paragraph") empty = false;
|
|
235
|
+
else if (inlineOf(b.content).some((c) => c && (c.type !== "text" || (c.text ?? "").trim()))) empty = false;
|
|
236
|
+
});
|
|
237
|
+
return empty;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
function inlineOfType(content, type, out) {
|
|
241
|
+
for (const c of inlineOf(content)) {
|
|
242
|
+
if (!c) continue;
|
|
243
|
+
if (c.type === type) out.push(c.props ?? {});
|
|
244
|
+
else if (Array.isArray(c.content)) inlineOfType(c.content, type, out);
|
|
245
|
+
}
|
|
246
|
+
return out;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* The checklist items, in order, nested ones too:
|
|
251
|
+
* [{ id, text, checked, depth, mentions: [{ id, label }] }]. `text` is the
|
|
252
|
+
* item's words (a mention as @Label); `mentions` lets a meeting-notes block
|
|
253
|
+
* read an owner off "@Priya send the deck".
|
|
254
|
+
*/
|
|
255
|
+
export function docChecklist(doc, opts = {}) {
|
|
256
|
+
const items = [];
|
|
257
|
+
eachBlock(doc, (b, depth) => {
|
|
258
|
+
if (b.type !== "checkListItem") return;
|
|
259
|
+
items.push({
|
|
260
|
+
id: b.id ?? null,
|
|
261
|
+
text: inlineText(b.content, opts),
|
|
262
|
+
checked: Boolean(b.props?.checked),
|
|
263
|
+
depth,
|
|
264
|
+
mentions: inlineOfType(b.content, "mention", []).map((p) => ({ id: p.id ?? "", label: p.label ?? "" })),
|
|
265
|
+
});
|
|
266
|
+
});
|
|
267
|
+
return items;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/** The doc with one checklist item ticked or unticked (by block id). A new array; the old doc is untouched. */
|
|
271
|
+
export function setChecklistItem(doc, id, checked) {
|
|
272
|
+
const walk = (blocks) =>
|
|
273
|
+
blocksOf(blocks).map((b) =>
|
|
274
|
+
b?.id === id && b.type === "checkListItem"
|
|
275
|
+
? { ...b, props: { ...b.props, checked: Boolean(checked) } }
|
|
276
|
+
: b?.children?.length
|
|
277
|
+
? { ...b, children: walk(b.children) }
|
|
278
|
+
: b,
|
|
279
|
+
);
|
|
280
|
+
return walk(doc);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
function tally(doc, type, keyOf) {
|
|
284
|
+
const seen = new Map();
|
|
285
|
+
eachBlock(doc, (b) => {
|
|
286
|
+
const content = b.content && typeof b.content === "object" && b.content.type === "tableContent" ? (b.content.rows ?? []).flatMap((r) => (r.cells ?? []).flatMap((cell) => inlineOf(cell?.content ?? cell))) : b.content;
|
|
287
|
+
for (const p of inlineOfType(content, type, [])) {
|
|
288
|
+
const k = keyOf(p);
|
|
289
|
+
const had = seen.get(k);
|
|
290
|
+
if (had) had.count++;
|
|
291
|
+
else seen.set(k, { ...p, count: 1 });
|
|
292
|
+
}
|
|
293
|
+
});
|
|
294
|
+
return [...seen.values()];
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* The merge fields a doc uses, in order of first use:
|
|
299
|
+
* [{ key, label, count }]. Compare with the recipient's values to warn
|
|
300
|
+
* "missing field" before a send.
|
|
301
|
+
*/
|
|
302
|
+
export function docFields(doc) {
|
|
303
|
+
return tally(doc, "field", (p) => p.key ?? "").map((p) => ({ key: p.key ?? "", label: p.label ?? p.key ?? "", count: p.count }));
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/** The people a doc mentions, in order of first mention: [{ id, label, count }]. */
|
|
307
|
+
export function docMentions(doc) {
|
|
308
|
+
return tally(doc, "mention", (p) => p.id ?? "").map((p) => ({ id: p.id ?? "", label: p.label ?? "", count: p.count }));
|
|
309
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// The DocEditor block — `makersclaw add doc-editor`. Fixed: compose it
|
|
2
|
+
// through its props (README.md beside this file). The helpers read a doc
|
|
3
|
+
// anywhere, the server included; the other text blocks (doc-page,
|
|
4
|
+
// comment-box, record-notes…) are built on this one and import it, never
|
|
5
|
+
// @blocknote/* directly.
|
|
6
|
+
export { DocEditor, useDocEditor } from "./doc-editor";
|
|
7
|
+
export { docToMarkdown, docToText, emptyDoc, isDocEmpty, docChecklist, setChecklistItem, docFields, docMentions } from "./doc";
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// What a doc may hold: BlockNote's own blocks (less audio, video and file,
|
|
4
|
+
// which need an upload store this block does not have), its text styles,
|
|
5
|
+
// and two inline chips of ours:
|
|
6
|
+
//
|
|
7
|
+
// { type: "mention", props: { id, label } } @Priya — a person
|
|
8
|
+
// { type: "field", props: { key, label } } {first_name} — a merge field
|
|
9
|
+
//
|
|
10
|
+
// Both are atoms (no text inside): the caret steps over them and Backspace
|
|
11
|
+
// takes the whole chip. doc.js turns them into @Label and {key} / a value.
|
|
12
|
+
import { BlockNoteSchema, defaultBlockSpecs, defaultInlineContentSpecs } from "@blocknote/core";
|
|
13
|
+
import { createReactInlineContentSpec } from "@blocknote/react";
|
|
14
|
+
|
|
15
|
+
const CHIP = "inline-flex items-baseline rounded-sm px-1 font-medium whitespace-nowrap";
|
|
16
|
+
|
|
17
|
+
const Mention = createReactInlineContentSpec(
|
|
18
|
+
{
|
|
19
|
+
type: "mention",
|
|
20
|
+
propSchema: { id: { default: "" }, label: { default: "" } },
|
|
21
|
+
content: "none",
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
render: ({ inlineContent }) => (
|
|
25
|
+
<span className={`${CHIP} bg-primary/10 text-primary`} data-mention={inlineContent.props.id}>
|
|
26
|
+
@{inlineContent.props.label || inlineContent.props.id}
|
|
27
|
+
</span>
|
|
28
|
+
),
|
|
29
|
+
},
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
const Field = createReactInlineContentSpec(
|
|
33
|
+
{
|
|
34
|
+
type: "field",
|
|
35
|
+
propSchema: { key: { default: "" }, label: { default: "" } },
|
|
36
|
+
content: "none",
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
render: ({ inlineContent }) => (
|
|
40
|
+
<span
|
|
41
|
+
className={`${CHIP} border border-dashed border-border bg-muted text-muted-foreground`}
|
|
42
|
+
data-field={inlineContent.props.key}
|
|
43
|
+
title={`{${inlineContent.props.key}}`}
|
|
44
|
+
>
|
|
45
|
+
{inlineContent.props.label || inlineContent.props.key}
|
|
46
|
+
</span>
|
|
47
|
+
),
|
|
48
|
+
},
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
const { audio, video, file, ...blockSpecs } = defaultBlockSpecs;
|
|
52
|
+
|
|
53
|
+
export const SCHEMA = BlockNoteSchema.create({
|
|
54
|
+
blockSpecs,
|
|
55
|
+
inlineContentSpecs: { ...defaultInlineContentSpecs, mention: Mention, field: Field },
|
|
56
|
+
});
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
// Written by scripts/blocknote-classes.mjs from @blocknote/shadcn 0.55.0 — do not edit.
|
|
2
|
+
//
|
|
3
|
+
// The Tailwind classes BlockNote's shadcn menus, toolbar and popovers use.
|
|
4
|
+
// Nothing imports this file: it is here so the app's Tailwind, which reads
|
|
5
|
+
// components/**, makes these classes (globals.css does not read
|
|
6
|
+
// node_modules). Only token classes: dark:, colour functions and raw hues
|
|
7
|
+
// were dropped on the way in.
|
|
8
|
+
export const SHADCN_CLASSES = [
|
|
9
|
+
"**:data-[slot=kbd]:isolate **:data-[slot=kbd]:relative **:data-[slot=kbd]:rounded-sm",
|
|
10
|
+
"**:data-[slot=kbd]:z-50 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",
|
|
11
|
+
"*:[span]:last:flex *:[span]:last:gap-2 *:[span]:last:items-center *:data-[slot=select-value]:flex",
|
|
12
|
+
"*:data-[slot=select-value]:gap-1.5 *:data-[slot=select-value]:items-center",
|
|
13
|
+
"*:data-[slot=select-value]:line-clamp-1 -mx-1 [&>svg]:pointer-events-none [&>svg]:size-3!",
|
|
14
|
+
"[&_svg:not([class*='size-'])]:size-3 [&_svg:not([class*='size-'])]:size-4",
|
|
15
|
+
"[&_svg:not([class*=size-])]:size-4 [&_svg:not([class*=text-])]:text-muted-foreground",
|
|
16
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [--card-spacing:--spacing(6)]",
|
|
17
|
+
"[a]:hover:bg-destructive/20 [a]:hover:bg-muted [a]:hover:bg-primary/80 [a]:hover:bg-secondary/80",
|
|
18
|
+
"[a]:hover:text-muted-foreground active:not-aria-[haspopup]:translate-y-px after:absolute",
|
|
19
|
+
"after:bg-foreground after:border after:border-border after:inset-0 after:mix-blend-darken",
|
|
20
|
+
"after:opacity-0 after:rounded-full after:transition-opacity animate-pulse aria-activedescendant",
|
|
21
|
+
"aria-disabled:opacity-50 aria-disabled:pointer-events-none aria-expanded:bg-muted",
|
|
22
|
+
"aria-expanded:bg-secondary aria-expanded:text-foreground aria-expanded:text-secondary-foreground",
|
|
23
|
+
"aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-label",
|
|
24
|
+
"aria-pressed:bg-muted aria-selected aria-selected:bg-accent aria-selected:text-accent-foreground",
|
|
25
|
+
"aspect-square avatar-fallback avatar-image bg-background bg-border bg-card bg-clip-padding",
|
|
26
|
+
"bg-destructive/10 bg-foreground bg-muted bg-popover bg-primary bg-secondary bg-transparent",
|
|
27
|
+
"bn-form bn-shadcn bn-snapshot-menu border-border border-input border-none border-transparent",
|
|
28
|
+
"bottom-0 card-content cursor-default data-[align-trigger=true]:animate-none",
|
|
29
|
+
"data-[disabled]:opacity-50 data-[disabled]:pointer-events-none data-[inset]:pl-8",
|
|
30
|
+
"data-[orientation=horizontal]:flex-col data-[side=bottom]:slide-in-from-top-2",
|
|
31
|
+
"data-[side=bottom]:top-1 data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2",
|
|
32
|
+
"data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-end]:top-1/2!",
|
|
33
|
+
"data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2",
|
|
34
|
+
"data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-start]:top-1/2!",
|
|
35
|
+
"data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2",
|
|
36
|
+
"data-[side=left]:slide-in-from-right-2 data-[side=left]:top-1/2! data-[side=right]:-left-1",
|
|
37
|
+
"data-[side=right]:-translate-y-1/2 data-[side=right]:slide-in-from-left-2",
|
|
38
|
+
"data-[side=right]:top-1/2! data-[side=top]:-bottom-2.5 data-[side=top]:slide-in-from-bottom-2",
|
|
39
|
+
"data-[size=default]:h-9 data-[size=lg]:size-10 data-[size=sm]:[--card-spacing:--spacing(4)]",
|
|
40
|
+
"data-[size=sm]:h-8 data-[size=sm]:size-6 data-[state=delayed-open]:animate-in",
|
|
41
|
+
"data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95",
|
|
42
|
+
"data-[variant=destructive]:*:[svg]:!text-destructive",
|
|
43
|
+
"data-[variant=destructive]:*:[svg]:text-destructive",
|
|
44
|
+
"data-[variant=destructive]:aria-selected:bg-destructive/10",
|
|
45
|
+
"data-[variant=destructive]:aria-selected:text-destructive",
|
|
46
|
+
"data-[variant=destructive]:focus:bg-destructive/10",
|
|
47
|
+
"data-[variant=destructive]:focus:text-destructive",
|
|
48
|
+
"data-[variant=destructive]:hover:bg-destructive/10",
|
|
49
|
+
"data-[variant=destructive]:hover:text-destructive data-[variant=destructive]:text-destructive",
|
|
50
|
+
"data-[variant=line]:rounded-none data-active:bg-background data-active:text-foreground",
|
|
51
|
+
"data-align-trigger data-closed:animate-out data-closed:fade-out-0 data-closed:overflow-hidden",
|
|
52
|
+
"data-closed:zoom-out-95 data-disabled:opacity-50 data-disabled:pointer-events-none data-inset",
|
|
53
|
+
"data-inset:pl-8 data-open:animate-in data-open:bg-accent data-open:fade-in-0",
|
|
54
|
+
"data-open:text-accent-foreground data-open:zoom-in-95 data-orientation",
|
|
55
|
+
"data-placeholder:text-muted-foreground data-popup-open:bg-accent",
|
|
56
|
+
"data-popup-open:text-accent-foreground data-size data-slot data-test data-variant",
|
|
57
|
+
"disabled:cursor-not-allowed disabled:opacity-50 disabled:pointer-events-none dropdown-menu",
|
|
58
|
+
"dropdown-menu-checkbox-item dropdown-menu-checkbox-item-indicator dropdown-menu-content",
|
|
59
|
+
"dropdown-menu-group dropdown-menu-item dropdown-menu-label dropdown-menu-separator",
|
|
60
|
+
"dropdown-menu-sub dropdown-menu-sub-content dropdown-menu-sub-trigger dropdown-menu-trigger",
|
|
61
|
+
"duration-100 embed-input file:bg-transparent file:border-0 file:font-medium file:h-7",
|
|
62
|
+
"file:inline-flex file:text-foreground file:text-sm fill-foreground flex-1 flex-col flex-nowrap",
|
|
63
|
+
"flex-row flex-wrap focus-visible:border-destructive/40 focus-visible:border-ring",
|
|
64
|
+
"focus-visible:outline-1 focus-visible:outline-none focus-visible:outline-ring",
|
|
65
|
+
"focus-visible:ring-2 focus-visible:ring-3 focus-visible:ring-[3px]",
|
|
66
|
+
"focus-visible:ring-destructive/20 focus-visible:ring-offset-2 focus-visible:ring-ring",
|
|
67
|
+
"focus-visible:ring-ring/50 focus:**:text-accent-foreground focus:bg-accent",
|
|
68
|
+
"focus:text-accent-foreground font-medium gap-(--card-spacing) gap-0 gap-1 gap-1.5 gap-2 gap-4",
|
|
69
|
+
"gap-6 group-data-[disabled=true]:opacity-50 group-data-[disabled=true]:pointer-events-none",
|
|
70
|
+
"group-data-[orientation=horizontal]/tabs:after:bottom-[-5px]",
|
|
71
|
+
"group-data-[orientation=horizontal]/tabs:after:h-0.5",
|
|
72
|
+
"group-data-[orientation=horizontal]/tabs:after:inset-x-0",
|
|
73
|
+
"group-data-[orientation=horizontal]/tabs:h-9",
|
|
74
|
+
"group-data-[orientation=vertical]/tabs:after:-right-1",
|
|
75
|
+
"group-data-[orientation=vertical]/tabs:after:inset-y-0",
|
|
76
|
+
"group-data-[orientation=vertical]/tabs:after:w-0.5",
|
|
77
|
+
"group-data-[orientation=vertical]/tabs:flex-col group-data-[orientation=vertical]/tabs:h-fit",
|
|
78
|
+
"group-data-[orientation=vertical]/tabs:justify-start",
|
|
79
|
+
"group-data-[orientation=vertical]/tabs:w-full group-data-[size=sm]/avatar:text-xs",
|
|
80
|
+
"group-data-[variant=default]/tabs-list:data-active:shadow-sm",
|
|
81
|
+
"group-data-[variant=line]/tabs-list:bg-transparent",
|
|
82
|
+
"group-data-[variant=line]/tabs-list:data-active:after:opacity-100",
|
|
83
|
+
"group-data-[variant=line]/tabs-list:data-active:bg-transparent",
|
|
84
|
+
"group-data-[variant=line]/tabs-list:data-active:shadow-none group/dropdown-menu-item",
|
|
85
|
+
"group/tabs-list h-10 h-4 h-5 h-6 h-7 h-8 h-9 h-[calc(100%-1px)] h-auto h-fit h-px",
|
|
86
|
+
"has-[>img:first-child]:pt-0 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-end]:pr-2",
|
|
87
|
+
"has-data-[icon=inline-start]:pl-1.5 has-data-[icon=inline-start]:pl-2 has-data-[slot=kbd]:pr-1.5",
|
|
88
|
+
"hover:bg-accent hover:bg-destructive/20 hover:bg-muted hover:bg-primary/80",
|
|
89
|
+
"hover:text-accent-foreground hover:text-foreground hover:text-muted-foreground hover:underline",
|
|
90
|
+
"icon-lg icon-sm icon-xs in-data-[slot=button-group]:rounded-md inline-flex items-center",
|
|
91
|
+
"items-start justify-between justify-center leading-none max-h-(--available-height) max-w-full",
|
|
92
|
+
"max-w-none max-w-screen max-w-xs md:text-sm min-w-0 min-w-10 min-w-32 min-w-36 min-w-6 min-w-8",
|
|
93
|
+
"min-w-9 min-w-[96px] ml-auto my-1 not-data-[variant=destructive]:focus:**:text-accent-foreground",
|
|
94
|
+
"object-cover origin-(--transform-origin) outline-hidden outline-none overflow-hidden",
|
|
95
|
+
"overflow-x-hidden overflow-y-auto p-0 p-1 p-2 p-4 p-[3px] panel-popover",
|
|
96
|
+
"peer-disabled:cursor-not-allowed peer-disabled:opacity-50 pl-2 pl-2.5",
|
|
97
|
+
"placeholder:text-muted-foreground pointer-events-none popover-content popover-trigger pr-2 pr-8",
|
|
98
|
+
"pt-4 px-(--card-spacing) px-2 px-2.5 px-3 py-(--card-spacing) py-0 py-0.5 py-1 py-1.5 py-2",
|
|
99
|
+
"right-0 right-2 ring-1 ring-foreground/10 ring-offset-background rotate-45 rounded-4xl",
|
|
100
|
+
"rounded-[2px] rounded-[min(var(--radius-md),10px)] rounded-[min(var(--radius-md),8px)]",
|
|
101
|
+
"rounded-full rounded-lg rounded-md rounded-sm rounded-xl select-content select-item select-none",
|
|
102
|
+
"select-scroll-down-button select-scroll-up-button select-trigger select-value shadow-lg shadow-md",
|
|
103
|
+
"shadow-none shadow-xs shrink-0 size-10 size-2.5 size-4 size-6 size-8 size-9 size-full",
|
|
104
|
+
"tabs-content tabs-list tabs-trigger text-background text-base text-base! text-card-foreground",
|
|
105
|
+
"text-destructive text-foreground text-foreground/60 text-left text-muted-foreground",
|
|
106
|
+
"text-popover-foreground text-primary text-primary-foreground text-secondary-foreground text-sm",
|
|
107
|
+
"text-xs tooltip-content tooltip-provider tooltip-trigger top-0 transition-[color,box-shadow]",
|
|
108
|
+
"transition-all translate-y-[calc(-50%-2px)] underline-offset-4 w-(--anchor-width) w-32 w-4 w-72",
|
|
109
|
+
"w-80 w-auto w-fit w-full whitespace-nowrap whitespace-pre-wrap z-10 z-50",
|
|
110
|
+
].join(" ");
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// BlockNote in the workspace theme — the one place its look is mapped.
|
|
2
|
+
//
|
|
3
|
+
// BlockNote paints itself from CSS variables (--bn-colors-editor-text,
|
|
4
|
+
// --bn-colors-menu-background…) that its stylesheet sets on every
|
|
5
|
+
// `.bn-root` with its own hex values. Here each one is pointed at a token
|
|
6
|
+
// instead, as Tailwind arbitrary properties on the editor's root. The
|
|
7
|
+
// root's className is also what BlockNote copies onto the roots of the
|
|
8
|
+
// menus it portals out of the editor, so the menus wear the same tokens.
|
|
9
|
+
//
|
|
10
|
+
// Every class ends in `!`: BlockNote's stylesheet is unlayered, and an
|
|
11
|
+
// unlayered rule beats any Tailwind utility (those live in @layer
|
|
12
|
+
// utilities) whatever its specificity. `!important` inside a layer is the
|
|
13
|
+
// one thing that outranks it.
|
|
14
|
+
//
|
|
15
|
+
// The highlight colours (BlockNote's red/blue/… text and backgrounds) map
|
|
16
|
+
// to the status and chart tokens; every background to muted, because the
|
|
17
|
+
// theme has one tint, not nine. The toolbar and the block menu do not offer
|
|
18
|
+
// colours (doc-editor.jsx), so these only paint pasted or stored content.
|
|
19
|
+
export const THEME = [
|
|
20
|
+
// surface, text, menus
|
|
21
|
+
"[--bn-colors-editor-text:var(--color-foreground)]!",
|
|
22
|
+
"[--bn-colors-editor-background:transparent]!",
|
|
23
|
+
"[--bn-colors-menu-text:var(--color-popover-foreground)]!",
|
|
24
|
+
"[--bn-colors-menu-background:var(--color-popover)]!",
|
|
25
|
+
"[--bn-colors-tooltip-text:var(--color-popover-foreground)]!",
|
|
26
|
+
"[--bn-colors-tooltip-background:var(--color-popover)]!",
|
|
27
|
+
"[--bn-colors-hovered-text:var(--color-accent-foreground)]!",
|
|
28
|
+
"[--bn-colors-hovered-background:var(--color-accent)]!",
|
|
29
|
+
"[--bn-colors-selected-text:var(--color-primary-foreground)]!",
|
|
30
|
+
"[--bn-colors-selected-background:var(--color-primary)]!",
|
|
31
|
+
"[--bn-colors-disabled-text:var(--color-muted-foreground)]!",
|
|
32
|
+
"[--bn-colors-disabled-background:var(--color-muted)]!",
|
|
33
|
+
"[--bn-colors-shadow:var(--color-border)]!",
|
|
34
|
+
"[--bn-colors-border:var(--color-border)]!",
|
|
35
|
+
"[--bn-colors-side-menu:var(--color-muted-foreground)]!",
|
|
36
|
+
// highlights: text → status / chart tokens, backgrounds → muted
|
|
37
|
+
"[--bn-colors-highlights-gray-text:var(--color-muted-foreground)]!",
|
|
38
|
+
"[--bn-colors-highlights-brown-text:var(--color-muted-foreground)]!",
|
|
39
|
+
"[--bn-colors-highlights-red-text:var(--color-destructive)]!",
|
|
40
|
+
"[--bn-colors-highlights-orange-text:var(--color-warning)]!",
|
|
41
|
+
"[--bn-colors-highlights-yellow-text:var(--color-warning)]!",
|
|
42
|
+
"[--bn-colors-highlights-green-text:var(--color-success)]!",
|
|
43
|
+
"[--bn-colors-highlights-blue-text:var(--color-info)]!",
|
|
44
|
+
"[--bn-colors-highlights-purple-text:var(--color-chart-3)]!",
|
|
45
|
+
"[--bn-colors-highlights-pink-text:var(--color-chart-4)]!",
|
|
46
|
+
"[--bn-colors-highlights-gray-background:var(--color-muted)]!",
|
|
47
|
+
"[--bn-colors-highlights-brown-background:var(--color-muted)]!",
|
|
48
|
+
"[--bn-colors-highlights-red-background:var(--color-muted)]!",
|
|
49
|
+
"[--bn-colors-highlights-orange-background:var(--color-muted)]!",
|
|
50
|
+
"[--bn-colors-highlights-yellow-background:var(--color-muted)]!",
|
|
51
|
+
"[--bn-colors-highlights-green-background:var(--color-muted)]!",
|
|
52
|
+
"[--bn-colors-highlights-blue-background:var(--color-muted)]!",
|
|
53
|
+
"[--bn-colors-highlights-purple-background:var(--color-muted)]!",
|
|
54
|
+
"[--bn-colors-highlights-pink-background:var(--color-muted)]!",
|
|
55
|
+
// face and radius: the workspace's, not Inter at 16px
|
|
56
|
+
"[--bn-font-family:var(--theme-font-sans)]!",
|
|
57
|
+
"[--bn-border-radius:var(--theme-radius)]!",
|
|
58
|
+
"[&_.bn-default-styles]:font-sans!",
|
|
59
|
+
"[&_.bn-default-styles]:[font-size:inherit]!",
|
|
60
|
+
"[&_.bn-default-styles]:[letter-spacing:inherit]!",
|
|
61
|
+
// what BlockNote paints with fixed values rather than its variables
|
|
62
|
+
"[&_.bn-editor_a]:text-primary!",
|
|
63
|
+
"[&_.bn-editor_a]:underline!",
|
|
64
|
+
"[&_.bn-inline-content_code]:font-mono!",
|
|
65
|
+
"[&_.bn-inline-content_code]:rounded-sm!",
|
|
66
|
+
"[&_.bn-inline-content_code]:bg-muted!",
|
|
67
|
+
"[&_.bn-inline-content_code]:px-1!",
|
|
68
|
+
"[&_[data-content-type=codeBlock]]:bg-muted!",
|
|
69
|
+
"[&_[data-content-type=codeBlock]]:text-foreground!",
|
|
70
|
+
"[&_[data-content-type=codeBlock]]:font-mono!",
|
|
71
|
+
"[&_[data-content-type=codeBlock]]:rounded-md!",
|
|
72
|
+
"[&_[data-content-type=codeBlock]_select]:text-muted-foreground!",
|
|
73
|
+
"[&_[data-content-type=quote]_blockquote]:text-muted-foreground!",
|
|
74
|
+
"[&_[data-content-type=quote]_blockquote]:border-border!",
|
|
75
|
+
"[&_[data-content-type=checkListItem]_input]:accent-primary!",
|
|
76
|
+
"[&_[data-checked=true]_.bn-inline-content]:text-muted-foreground!",
|
|
77
|
+
"[&_.bn-block-content]:after:text-muted-foreground!",
|
|
78
|
+
"[&_.bn-block-content]:after:not-italic!",
|
|
79
|
+
"[&_table]:border-border!",
|
|
80
|
+
"[&_td]:border-border!",
|
|
81
|
+
"[&_th]:border-border!",
|
|
82
|
+
].join(" ");
|