@pylonsync/create-pylon 0.22.75 → 0.22.77
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/bin/create-pylon.js +24 -74
- package/package.json +1 -1
- package/skill/SKILL.md +7 -11
- package/templates/_root/README.md +2 -8
- package/templates/agency/AGENTS.md +17 -0
- package/templates/agency/app/globals.css +5 -1
- package/templates/agency/app/internal/components/page.tsx +248 -0
- package/templates/agency/app/internal/design/page.tsx +169 -0
- package/templates/agency/app/internal/layout.tsx +89 -0
- package/templates/agency/app/internal/sections.ts +26 -0
- package/templates/agency/app/internal/showcase.tsx +43 -0
- package/templates/agency/app/robots.ts +1 -1
- package/templates/agency/components/ui/button.tsx +22 -20
- package/templates/agency/components/ui/dialog.tsx +77 -64
- package/templates/agency/components/ui/input.tsx +5 -5
- package/templates/agency/components/ui/label.tsx +5 -3
- package/templates/agency/components/ui/select.tsx +81 -19
- package/templates/agency/components/ui/textarea.tsx +5 -3
- package/templates/agency/lib/utils.ts +4 -4
- package/templates/agency/package.json +3 -3
- package/templates/ai-chat/AGENTS.md +17 -0
- package/templates/ai-chat/app/globals.css +5 -1
- package/templates/ai-chat/app/internal/components/page.tsx +248 -0
- package/templates/ai-chat/app/internal/design/page.tsx +173 -0
- package/templates/ai-chat/app/internal/layout.tsx +89 -0
- package/templates/ai-chat/app/internal/sections.ts +26 -0
- package/templates/ai-chat/app/internal/showcase.tsx +43 -0
- package/templates/ai-chat/app/robots.ts +1 -1
- package/templates/ai-chat/components/ui/button.tsx +22 -20
- package/templates/ai-chat/components/ui/dialog.tsx +77 -64
- package/templates/ai-chat/components/ui/input.tsx +5 -5
- package/templates/ai-chat/components/ui/label.tsx +5 -3
- package/templates/ai-chat/components/ui/select.tsx +81 -19
- package/templates/ai-chat/components/ui/textarea.tsx +5 -3
- package/templates/ai-chat/lib/utils.ts +4 -4
- package/templates/ai-chat/package.json +4 -4
- package/templates/ai-studio/AGENTS.md +17 -0
- package/templates/ai-studio/app/globals.css +5 -1
- package/templates/ai-studio/app/internal/components/page.tsx +248 -0
- package/templates/ai-studio/app/internal/design/page.tsx +168 -0
- package/templates/ai-studio/app/internal/layout.tsx +89 -0
- package/templates/ai-studio/app/internal/sections.ts +26 -0
- package/templates/ai-studio/app/internal/showcase.tsx +43 -0
- package/templates/ai-studio/app/robots.ts +1 -1
- package/templates/ai-studio/components/ui/button.tsx +22 -20
- package/templates/ai-studio/components/ui/dialog.tsx +77 -64
- package/templates/ai-studio/components/ui/input.tsx +5 -5
- package/templates/ai-studio/components/ui/label.tsx +5 -3
- package/templates/ai-studio/components/ui/select.tsx +81 -19
- package/templates/ai-studio/components/ui/textarea.tsx +5 -3
- package/templates/ai-studio/lib/utils.ts +4 -4
- package/templates/ai-studio/package.json +4 -4
- package/templates/barebones/AGENTS.md +17 -0
- package/templates/barebones/README.md +6 -3
- package/templates/barebones/app/(app)/layout.tsx +16 -0
- package/templates/barebones/app/{page.tsx → (app)/page.tsx} +2 -2
- package/templates/barebones/app/error.tsx +1 -1
- package/templates/barebones/app/globals.css +9 -7
- package/templates/barebones/app/internal/components/page.tsx +248 -0
- package/templates/barebones/app/internal/design/page.tsx +165 -0
- package/templates/barebones/app/internal/layout.tsx +89 -0
- package/templates/barebones/app/internal/sections.ts +26 -0
- package/templates/barebones/app/internal/showcase.tsx +43 -0
- package/templates/barebones/app/layout.tsx +4 -6
- package/templates/barebones/app/not-found.tsx +2 -4
- package/templates/barebones/app/robots.ts +1 -1
- package/templates/barebones/components/ui/button.tsx +22 -20
- package/templates/barebones/components/ui/dialog.tsx +77 -64
- package/templates/barebones/components/ui/input.tsx +5 -5
- package/templates/barebones/components/ui/label.tsx +5 -3
- package/templates/barebones/components/ui/select.tsx +81 -19
- package/templates/barebones/components/ui/textarea.tsx +5 -3
- package/templates/barebones/lib/utils.ts +4 -4
- package/templates/barebones/package.json +3 -3
- package/templates/chat/AGENTS.md +17 -0
- package/templates/chat/app/globals.css +7 -5
- package/templates/chat/app/internal/components/page.tsx +248 -0
- package/templates/chat/app/internal/design/page.tsx +170 -0
- package/templates/chat/app/internal/layout.tsx +89 -0
- package/templates/chat/app/internal/sections.ts +26 -0
- package/templates/chat/app/internal/showcase.tsx +43 -0
- package/templates/chat/app/not-found.tsx +1 -3
- package/templates/chat/app/robots.ts +1 -1
- package/templates/chat/components/ui/button.tsx +22 -20
- package/templates/chat/components/ui/dialog.tsx +77 -64
- package/templates/chat/components/ui/input.tsx +5 -5
- package/templates/chat/components/ui/label.tsx +5 -3
- package/templates/chat/components/ui/select.tsx +81 -19
- package/templates/chat/components/ui/textarea.tsx +5 -3
- package/templates/chat/lib/utils.ts +4 -4
- package/templates/chat/package.json +4 -4
- package/templates/consumer/AGENTS.md +17 -0
- package/templates/consumer/app/globals.css +9 -7
- package/templates/consumer/app/internal/components/page.tsx +248 -0
- package/templates/consumer/app/internal/design/page.tsx +167 -0
- package/templates/consumer/app/internal/layout.tsx +89 -0
- package/templates/consumer/app/internal/sections.ts +26 -0
- package/templates/consumer/app/internal/showcase.tsx +43 -0
- package/templates/consumer/app/robots.ts +1 -1
- package/templates/consumer/components/ui/button.tsx +22 -20
- package/templates/consumer/components/ui/dialog.tsx +77 -64
- package/templates/consumer/components/ui/input.tsx +5 -5
- package/templates/consumer/components/ui/label.tsx +5 -3
- package/templates/consumer/components/ui/select.tsx +81 -19
- package/templates/consumer/components/ui/textarea.tsx +5 -3
- package/templates/consumer/lib/utils.ts +4 -4
- package/templates/consumer/package.json +4 -4
- package/templates/creator/AGENTS.md +17 -0
- package/templates/creator/app/globals.css +5 -1
- package/templates/creator/app/internal/components/page.tsx +248 -0
- package/templates/creator/app/internal/design/page.tsx +171 -0
- package/templates/creator/app/internal/layout.tsx +89 -0
- package/templates/creator/app/internal/sections.ts +26 -0
- package/templates/creator/app/internal/showcase.tsx +43 -0
- package/templates/creator/app/robots.ts +1 -1
- package/templates/creator/components/ui/button.tsx +22 -20
- package/templates/creator/components/ui/dialog.tsx +77 -64
- package/templates/creator/components/ui/input.tsx +5 -5
- package/templates/creator/components/ui/label.tsx +5 -3
- package/templates/creator/components/ui/select.tsx +81 -19
- package/templates/creator/components/ui/textarea.tsx +5 -3
- package/templates/creator/lib/utils.ts +4 -4
- package/templates/creator/package.json +4 -4
- package/templates/crm/AGENTS.md +17 -0
- package/templates/crm/README.md +3 -4
- package/templates/crm/app/deals/[id]/deal-view.tsx +9 -14
- package/templates/crm/app/globals.css +5 -2
- package/templates/crm/app/internal/components/page.tsx +282 -0
- package/templates/crm/app/internal/design/page.tsx +163 -0
- package/templates/crm/app/internal/layout.tsx +89 -0
- package/templates/crm/app/internal/sections.ts +27 -0
- package/templates/crm/app/internal/showcase.tsx +43 -0
- package/templates/crm/app/not-found.tsx +1 -3
- package/templates/crm/app/robots.ts +1 -1
- package/templates/crm/components/activity-timeline.tsx +6 -8
- package/templates/crm/components/app-shell.tsx +25 -26
- package/templates/crm/components/deal-dialog.tsx +15 -17
- package/templates/crm/components/record-dialog.tsx +10 -11
- package/templates/crm/components/ui/button.tsx +22 -20
- package/templates/crm/components/ui/dialog.tsx +77 -64
- package/templates/crm/components/ui/input.tsx +5 -5
- package/templates/crm/components/ui/label.tsx +5 -3
- package/templates/crm/components/ui/select.tsx +81 -19
- package/templates/crm/components/ui/sheet.tsx +64 -0
- package/templates/crm/components/ui/textarea.tsx +5 -3
- package/templates/crm/lib/utils.ts +4 -4
- package/templates/crm/package.json +4 -4
- package/templates/directory/AGENTS.md +17 -0
- package/templates/directory/app/globals.css +5 -1
- package/templates/directory/app/internal/components/page.tsx +248 -0
- package/templates/directory/app/internal/design/page.tsx +168 -0
- package/templates/directory/app/internal/layout.tsx +89 -0
- package/templates/directory/app/internal/sections.ts +26 -0
- package/templates/directory/app/internal/showcase.tsx +43 -0
- package/templates/directory/app/robots.ts +1 -1
- package/templates/directory/components/ui/button.tsx +22 -20
- package/templates/directory/components/ui/dialog.tsx +77 -64
- package/templates/directory/components/ui/input.tsx +5 -5
- package/templates/directory/components/ui/label.tsx +5 -3
- package/templates/directory/components/ui/select.tsx +81 -19
- package/templates/directory/components/ui/textarea.tsx +5 -3
- package/templates/directory/lib/utils.ts +4 -4
- package/templates/directory/package.json +4 -4
- package/templates/helpdesk/AGENTS.md +17 -0
- package/templates/helpdesk/README.md +1 -1
- package/templates/helpdesk/app/globals.css +5 -2
- package/templates/helpdesk/app/internal/components/page.tsx +282 -0
- package/templates/helpdesk/app/internal/design/page.tsx +163 -0
- package/templates/helpdesk/app/internal/layout.tsx +89 -0
- package/templates/helpdesk/app/internal/sections.ts +27 -0
- package/templates/helpdesk/app/internal/showcase.tsx +43 -0
- package/templates/helpdesk/app/not-found.tsx +1 -3
- package/templates/helpdesk/app/robots.ts +1 -1
- package/templates/helpdesk/app/tickets/[id]/ticket-view.tsx +22 -29
- package/templates/helpdesk/components/app-shell.tsx +25 -26
- package/templates/helpdesk/components/new-ticket-dialog.tsx +15 -17
- package/templates/helpdesk/components/record-dialog.tsx +10 -11
- package/templates/helpdesk/components/ui/button.tsx +22 -20
- package/templates/helpdesk/components/ui/dialog.tsx +77 -64
- package/templates/helpdesk/components/ui/input.tsx +5 -5
- package/templates/helpdesk/components/ui/label.tsx +5 -3
- package/templates/helpdesk/components/ui/select.tsx +81 -19
- package/templates/helpdesk/components/ui/sheet.tsx +64 -0
- package/templates/helpdesk/components/ui/textarea.tsx +5 -3
- package/templates/helpdesk/lib/utils.ts +4 -4
- package/templates/helpdesk/package.json +4 -4
- package/templates/imessage/AGENTS.md +17 -0
- package/templates/imessage/app/globals.css +4 -0
- package/templates/imessage/app/internal/components/page.tsx +248 -0
- package/templates/imessage/app/internal/design/page.tsx +163 -0
- package/templates/imessage/app/internal/layout.tsx +89 -0
- package/templates/imessage/app/internal/sections.ts +26 -0
- package/templates/imessage/app/internal/showcase.tsx +43 -0
- package/templates/imessage/components/ui/button.tsx +22 -20
- package/templates/imessage/components/ui/dialog.tsx +77 -64
- package/templates/imessage/components/ui/input.tsx +5 -5
- package/templates/imessage/components/ui/label.tsx +5 -3
- package/templates/imessage/components/ui/select.tsx +81 -19
- package/templates/imessage/components/ui/textarea.tsx +5 -3
- package/templates/imessage/lib/utils.ts +4 -4
- package/templates/imessage/package.json +4 -4
- package/templates/inventory/AGENTS.md +17 -0
- package/templates/inventory/README.md +1 -1
- package/templates/inventory/app/globals.css +5 -2
- package/templates/inventory/app/internal/components/page.tsx +282 -0
- package/templates/inventory/app/internal/design/page.tsx +163 -0
- package/templates/inventory/app/internal/layout.tsx +89 -0
- package/templates/inventory/app/internal/sections.ts +27 -0
- package/templates/inventory/app/internal/showcase.tsx +43 -0
- package/templates/inventory/app/not-found.tsx +1 -3
- package/templates/inventory/app/products/[id]/product-view.tsx +1 -3
- package/templates/inventory/app/robots.ts +1 -1
- package/templates/inventory/components/app-shell.tsx +25 -26
- package/templates/inventory/components/movement-dialog.tsx +15 -17
- package/templates/inventory/components/record-dialog.tsx +10 -11
- package/templates/inventory/components/ui/button.tsx +22 -20
- package/templates/inventory/components/ui/dialog.tsx +77 -64
- package/templates/inventory/components/ui/input.tsx +5 -5
- package/templates/inventory/components/ui/label.tsx +5 -3
- package/templates/inventory/components/ui/select.tsx +81 -19
- package/templates/inventory/components/ui/sheet.tsx +64 -0
- package/templates/inventory/components/ui/textarea.tsx +5 -3
- package/templates/inventory/lib/utils.ts +4 -4
- package/templates/inventory/package.json +4 -4
- package/templates/inventory/tests/components.test.tsx +27 -14
- package/templates/invoices/AGENTS.md +17 -0
- package/templates/invoices/README.md +1 -1
- package/templates/invoices/app/globals.css +5 -2
- package/templates/invoices/app/internal/components/page.tsx +282 -0
- package/templates/invoices/app/internal/design/page.tsx +163 -0
- package/templates/invoices/app/internal/layout.tsx +89 -0
- package/templates/invoices/app/internal/sections.ts +27 -0
- package/templates/invoices/app/internal/showcase.tsx +43 -0
- package/templates/invoices/app/invoices/[id]/invoice-view.tsx +20 -26
- package/templates/invoices/app/not-found.tsx +1 -3
- package/templates/invoices/app/robots.ts +1 -1
- package/templates/invoices/components/app-shell.tsx +25 -26
- package/templates/invoices/components/payment-dialog.tsx +6 -8
- package/templates/invoices/components/record-dialog.tsx +10 -11
- package/templates/invoices/components/ui/button.tsx +22 -20
- package/templates/invoices/components/ui/dialog.tsx +77 -64
- package/templates/invoices/components/ui/input.tsx +5 -5
- package/templates/invoices/components/ui/label.tsx +5 -3
- package/templates/invoices/components/ui/select.tsx +81 -19
- package/templates/invoices/components/ui/sheet.tsx +64 -0
- package/templates/invoices/components/ui/textarea.tsx +5 -3
- package/templates/invoices/lib/utils.ts +4 -4
- package/templates/invoices/package.json +4 -4
- package/templates/local-service/AGENTS.md +17 -0
- package/templates/local-service/app/globals.css +5 -1
- package/templates/local-service/app/internal/components/page.tsx +248 -0
- package/templates/local-service/app/internal/design/page.tsx +170 -0
- package/templates/local-service/app/internal/layout.tsx +89 -0
- package/templates/local-service/app/internal/sections.ts +26 -0
- package/templates/local-service/app/internal/showcase.tsx +43 -0
- package/templates/local-service/app/robots.ts +1 -1
- package/templates/local-service/components/ui/button.tsx +22 -20
- package/templates/local-service/components/ui/dialog.tsx +77 -64
- package/templates/local-service/components/ui/input.tsx +5 -5
- package/templates/local-service/components/ui/label.tsx +5 -3
- package/templates/local-service/components/ui/select.tsx +81 -19
- package/templates/local-service/components/ui/textarea.tsx +5 -3
- package/templates/local-service/lib/utils.ts +4 -4
- package/templates/local-service/package.json +4 -4
- package/templates/marketplace/AGENTS.md +17 -0
- package/templates/marketplace/README.md +8 -5
- package/templates/marketplace/app/(market)/layout.tsx +113 -0
- package/templates/marketplace/app/{listing → (market)/listing}/[id]/page.tsx +7 -7
- package/templates/marketplace/app/{me → (market)/me}/page.tsx +1 -1
- package/templates/marketplace/app/{not-found.tsx → (market)/not-found.tsx} +1 -3
- package/templates/marketplace/app/{page.tsx → (market)/page.tsx} +5 -5
- package/templates/marketplace/app/{sell → (market)/sell}/page.tsx +1 -1
- package/templates/marketplace/app/error.tsx +1 -3
- package/templates/marketplace/app/globals.css +4 -0
- package/templates/marketplace/app/internal/components/page.tsx +335 -0
- package/templates/marketplace/app/internal/design/page.tsx +158 -0
- package/templates/marketplace/app/internal/layout.tsx +89 -0
- package/templates/marketplace/app/internal/sections.ts +30 -0
- package/templates/marketplace/app/internal/showcase.tsx +43 -0
- package/templates/marketplace/app/layout.tsx +4 -100
- package/templates/marketplace/app/robots.ts +1 -1
- package/templates/marketplace/client/ListingCard.tsx +1 -1
- package/templates/marketplace/components/ui/button.tsx +22 -21
- package/templates/marketplace/components/ui/dialog.tsx +77 -64
- package/templates/marketplace/components/ui/input.tsx +5 -5
- package/templates/marketplace/components/ui/label.tsx +5 -4
- package/templates/marketplace/components/ui/select.tsx +101 -0
- package/templates/marketplace/components/ui/separator.tsx +5 -8
- package/templates/marketplace/components/ui/textarea.tsx +5 -3
- package/templates/marketplace/lib/utils.ts +4 -4
- package/templates/marketplace/package.json +3 -5
- package/templates/projects/AGENTS.md +17 -0
- package/templates/projects/README.md +1 -1
- package/templates/projects/app/globals.css +5 -2
- package/templates/projects/app/internal/components/page.tsx +282 -0
- package/templates/projects/app/internal/design/page.tsx +163 -0
- package/templates/projects/app/internal/layout.tsx +89 -0
- package/templates/projects/app/internal/sections.ts +27 -0
- package/templates/projects/app/internal/showcase.tsx +43 -0
- package/templates/projects/app/not-found.tsx +1 -3
- package/templates/projects/app/projects/[id]/project-view.tsx +9 -14
- package/templates/projects/app/robots.ts +1 -1
- package/templates/projects/components/app-shell.tsx +25 -26
- package/templates/projects/components/record-dialog.tsx +10 -11
- package/templates/projects/components/time-dialog.tsx +6 -8
- package/templates/projects/components/ui/button.tsx +22 -20
- package/templates/projects/components/ui/dialog.tsx +77 -64
- package/templates/projects/components/ui/input.tsx +5 -5
- package/templates/projects/components/ui/label.tsx +5 -3
- package/templates/projects/components/ui/select.tsx +81 -19
- package/templates/projects/components/ui/sheet.tsx +64 -0
- package/templates/projects/components/ui/textarea.tsx +5 -3
- package/templates/projects/lib/utils.ts +4 -4
- package/templates/projects/package.json +4 -4
- package/templates/restaurant/AGENTS.md +17 -0
- package/templates/restaurant/app/globals.css +5 -1
- package/templates/restaurant/app/internal/components/page.tsx +248 -0
- package/templates/restaurant/app/internal/design/page.tsx +168 -0
- package/templates/restaurant/app/internal/layout.tsx +89 -0
- package/templates/restaurant/app/internal/sections.ts +26 -0
- package/templates/restaurant/app/internal/showcase.tsx +43 -0
- package/templates/restaurant/app/robots.ts +1 -1
- package/templates/restaurant/components/ui/button.tsx +22 -20
- package/templates/restaurant/components/ui/dialog.tsx +77 -64
- package/templates/restaurant/components/ui/input.tsx +5 -5
- package/templates/restaurant/components/ui/label.tsx +5 -3
- package/templates/restaurant/components/ui/select.tsx +81 -19
- package/templates/restaurant/components/ui/textarea.tsx +5 -3
- package/templates/restaurant/lib/utils.ts +4 -4
- package/templates/restaurant/package.json +4 -4
- package/templates/saas/AGENTS.md +17 -0
- package/templates/saas/README.md +1 -1
- package/templates/saas/app/(marketing)/not-found.tsx +1 -3
- package/templates/saas/app/dashboard/board-client.tsx +32 -42
- package/templates/saas/app/globals.css +9 -7
- package/templates/saas/app/internal/components/page.tsx +282 -0
- package/templates/saas/app/internal/design/page.tsx +168 -0
- package/templates/saas/app/internal/layout.tsx +89 -0
- package/templates/saas/app/internal/sections.ts +27 -0
- package/templates/saas/app/internal/showcase.tsx +43 -0
- package/templates/saas/app/robots.ts +1 -1
- package/templates/saas/components/dashboard-shell.tsx +28 -21
- package/templates/saas/components/ui/button.tsx +22 -20
- package/templates/saas/components/ui/dialog.tsx +77 -64
- package/templates/saas/components/ui/input.tsx +5 -5
- package/templates/saas/components/ui/label.tsx +5 -3
- package/templates/saas/components/ui/select.tsx +81 -19
- package/templates/saas/components/ui/sheet.tsx +64 -0
- package/templates/saas/components/ui/textarea.tsx +5 -3
- package/templates/saas/lib/utils.ts +4 -4
- package/templates/saas/package.json +4 -4
- package/templates/shop/AGENTS.md +17 -0
- package/templates/shop/app/globals.css +5 -1
- package/templates/shop/app/internal/components/page.tsx +248 -0
- package/templates/shop/app/internal/design/page.tsx +173 -0
- package/templates/shop/app/internal/layout.tsx +89 -0
- package/templates/shop/app/internal/sections.ts +26 -0
- package/templates/shop/app/internal/showcase.tsx +43 -0
- package/templates/shop/app/robots.ts +1 -1
- package/templates/shop/components/ui/button.tsx +22 -20
- package/templates/shop/components/ui/dialog.tsx +77 -64
- package/templates/shop/components/ui/input.tsx +5 -5
- package/templates/shop/components/ui/label.tsx +5 -3
- package/templates/shop/components/ui/select.tsx +81 -19
- package/templates/shop/components/ui/textarea.tsx +5 -3
- package/templates/shop/lib/utils.ts +4 -4
- package/templates/shop/package.json +4 -4
- package/templates/todo/AGENTS.md +17 -0
- package/templates/todo/README.md +7 -4
- package/templates/todo/app/(app)/layout.tsx +16 -0
- package/templates/todo/app/{page.tsx → (app)/page.tsx} +2 -2
- package/templates/todo/app/error.tsx +1 -1
- package/templates/todo/app/globals.css +9 -7
- package/templates/todo/app/internal/components/page.tsx +248 -0
- package/templates/todo/app/internal/design/page.tsx +165 -0
- package/templates/todo/app/internal/layout.tsx +89 -0
- package/templates/todo/app/internal/sections.ts +26 -0
- package/templates/todo/app/internal/showcase.tsx +43 -0
- package/templates/todo/app/layout.tsx +5 -7
- package/templates/todo/app/not-found.tsx +2 -4
- package/templates/todo/app/robots.ts +1 -1
- package/templates/todo/components/ui/button.tsx +22 -20
- package/templates/todo/components/ui/dialog.tsx +77 -64
- package/templates/todo/components/ui/input.tsx +5 -5
- package/templates/todo/components/ui/label.tsx +5 -3
- package/templates/todo/components/ui/select.tsx +81 -19
- package/templates/todo/components/ui/textarea.tsx +5 -3
- package/templates/todo/lib/utils.ts +4 -4
- package/templates/todo/package.json +4 -4
- package/templates/waitlist/AGENTS.md +17 -0
- package/templates/waitlist/app/globals.css +5 -1
- package/templates/waitlist/app/internal/components/page.tsx +248 -0
- package/templates/waitlist/app/internal/design/page.tsx +173 -0
- package/templates/waitlist/app/internal/layout.tsx +89 -0
- package/templates/waitlist/app/internal/sections.ts +26 -0
- package/templates/waitlist/app/internal/showcase.tsx +43 -0
- package/templates/waitlist/app/robots.ts +1 -1
- package/templates/waitlist/components/ui/button.tsx +22 -20
- package/templates/waitlist/components/ui/dialog.tsx +77 -64
- package/templates/waitlist/components/ui/input.tsx +5 -5
- package/templates/waitlist/components/ui/label.tsx +5 -3
- package/templates/waitlist/components/ui/select.tsx +81 -19
- package/templates/waitlist/components/ui/textarea.tsx +5 -3
- package/templates/waitlist/lib/utils.ts +4 -4
- package/templates/waitlist/package.json +4 -4
- package/templates/agency/components.json +0 -20
- package/templates/ai-chat/components.json +0 -20
- package/templates/ai-studio/components.json +0 -20
- package/templates/backend/b2b/apps/api/functions/archiveProject.ts +0 -13
- package/templates/backend/b2b/apps/api/functions/createOrg.ts +0 -44
- package/templates/backend/b2b/apps/api/functions/createProject.ts +0 -22
- package/templates/backend/b2b/apps/api/functions/inviteMember.ts +0 -41
- package/templates/backend/b2b/apps/api/functions/myOrgs.ts +0 -37
- package/templates/backend/b2b/apps/api/functions/orgMembers.ts +0 -13
- package/templates/backend/b2b/apps/api/functions/orgProjects.ts +0 -15
- package/templates/backend/b2b/apps/api/functions/removeMember.ts +0 -25
- package/templates/backend/b2b/apps/api/functions/setMemberRole.ts +0 -33
- package/templates/backend/b2b/apps/api/package.json +0 -20
- package/templates/backend/b2b/apps/api/schema.ts +0 -182
- package/templates/backend/b2b/apps/api/tsconfig.json +0 -13
- package/templates/backend/barebones/apps/api/functions/createWidget.ts +0 -26
- package/templates/backend/barebones/apps/api/functions/listWidgets.ts +0 -19
- package/templates/backend/barebones/apps/api/package.json +0 -20
- package/templates/backend/barebones/apps/api/schema.ts +0 -64
- package/templates/backend/barebones/apps/api/tsconfig.json +0 -13
- package/templates/backend/chat/apps/api/functions/createRoom.ts +0 -32
- package/templates/backend/chat/apps/api/functions/listRooms.ts +0 -15
- package/templates/backend/chat/apps/api/functions/roomMessages.ts +0 -20
- package/templates/backend/chat/apps/api/functions/sendMessage.ts +0 -37
- package/templates/backend/chat/apps/api/package.json +0 -20
- package/templates/backend/chat/apps/api/schema.ts +0 -99
- package/templates/backend/chat/apps/api/tsconfig.json +0 -13
- package/templates/backend/todo/apps/api/functions/addTodo.ts +0 -31
- package/templates/backend/todo/apps/api/functions/deleteTodo.ts +0 -15
- package/templates/backend/todo/apps/api/functions/editTodo.ts +0 -17
- package/templates/backend/todo/apps/api/functions/listTodos.ts +0 -25
- package/templates/backend/todo/apps/api/functions/reorderTodo.ts +0 -15
- package/templates/backend/todo/apps/api/functions/toggleTodo.ts +0 -14
- package/templates/backend/todo/apps/api/package.json +0 -20
- package/templates/backend/todo/apps/api/schema.ts +0 -88
- package/templates/backend/todo/apps/api/tsconfig.json +0 -13
- package/templates/barebones/components.json +0 -20
- package/templates/chat/components.json +0 -20
- package/templates/consumer/components.json +0 -20
- package/templates/creator/components.json +0 -20
- package/templates/crm/components.json +0 -20
- package/templates/directory/components.json +0 -20
- package/templates/expo/barebones/apps/expo/App.tsx +0 -166
- package/templates/expo/barebones/apps/expo/app.json +0 -31
- package/templates/expo/barebones/apps/expo/babel.config.js +0 -6
- package/templates/expo/barebones/apps/expo/package.json +0 -31
- package/templates/expo/barebones/apps/expo/tsconfig.json +0 -16
- package/templates/expo/chat/apps/expo/App.tsx +0 -391
- package/templates/expo/chat/apps/expo/app.json +0 -25
- package/templates/expo/chat/apps/expo/babel.config.js +0 -6
- package/templates/expo/chat/apps/expo/package.json +0 -32
- package/templates/expo/chat/apps/expo/tsconfig.json +0 -16
- package/templates/expo/todo/apps/expo/App.tsx +0 -287
- package/templates/expo/todo/apps/expo/app.json +0 -25
- package/templates/expo/todo/apps/expo/babel.config.js +0 -6
- package/templates/expo/todo/apps/expo/package.json +0 -31
- package/templates/expo/todo/apps/expo/tsconfig.json +0 -16
- package/templates/helpdesk/components.json +0 -20
- package/templates/imessage/components.json +0 -20
- package/templates/inventory/components.json +0 -20
- package/templates/invoices/components.json +0 -20
- package/templates/ios/barebones/apps/ios/Package.swift +0 -34
- package/templates/ios/barebones/apps/ios/Sources/__APP_NAME_PASCAL__/ContentView.swift +0 -98
- package/templates/ios/barebones/apps/ios/Sources/__APP_NAME_PASCAL__/Models.swift +0 -17
- package/templates/ios/barebones/apps/ios/Sources/__APP_NAME_PASCAL__/__APP_NAME_PASCAL__App.swift +0 -34
- package/templates/ios/barebones/apps/ios/project.yml +0 -42
- package/templates/ios/chat/apps/ios/Package.swift +0 -24
- package/templates/ios/chat/apps/ios/Sources/__APP_NAME_PASCAL__/ChatRootView.swift +0 -116
- package/templates/ios/chat/apps/ios/Sources/__APP_NAME_PASCAL__/Models.swift +0 -26
- package/templates/ios/chat/apps/ios/Sources/__APP_NAME_PASCAL__/RoomView.swift +0 -136
- package/templates/ios/chat/apps/ios/Sources/__APP_NAME_PASCAL__/__APP_NAME_PASCAL__App.swift +0 -58
- package/templates/ios/chat/apps/ios/project.yml +0 -44
- package/templates/ios/todo/apps/ios/Package.swift +0 -23
- package/templates/ios/todo/apps/ios/Sources/__APP_NAME_PASCAL__/Models.swift +0 -18
- package/templates/ios/todo/apps/ios/Sources/__APP_NAME_PASCAL__/TodoListView.swift +0 -230
- package/templates/ios/todo/apps/ios/Sources/__APP_NAME_PASCAL__/__APP_NAME_PASCAL__App.swift +0 -28
- package/templates/ios/todo/apps/ios/project.yml +0 -32
- package/templates/local-service/components.json +0 -20
- package/templates/mac/b2b/apps/mac/Package.swift +0 -22
- package/templates/mac/b2b/apps/mac/Sources/__APP_NAME_PASCAL__/Models.swift +0 -15
- package/templates/mac/b2b/apps/mac/Sources/__APP_NAME_PASCAL__/OrgPickerView.swift +0 -178
- package/templates/mac/b2b/apps/mac/Sources/__APP_NAME_PASCAL__/__APP_NAME_PASCAL__App.swift +0 -30
- package/templates/mac/b2b/apps/mac/__APP_NAME_PASCAL__.entitlements +0 -13
- package/templates/mac/b2b/apps/mac/project.yml +0 -34
- package/templates/mac/barebones/apps/mac/Package.swift +0 -33
- package/templates/mac/barebones/apps/mac/Sources/__APP_NAME_PASCAL__/ContentView.swift +0 -104
- package/templates/mac/barebones/apps/mac/Sources/__APP_NAME_PASCAL__/Models.swift +0 -17
- package/templates/mac/barebones/apps/mac/Sources/__APP_NAME_PASCAL__/__APP_NAME_PASCAL__App.swift +0 -30
- package/templates/mac/barebones/apps/mac/__APP_NAME_PASCAL__.entitlements +0 -13
- package/templates/mac/barebones/apps/mac/project.yml +0 -34
- package/templates/mac/chat/apps/mac/Package.swift +0 -34
- package/templates/mac/chat/apps/mac/Sources/__APP_NAME_PASCAL__/ChatRootView.swift +0 -143
- package/templates/mac/chat/apps/mac/Sources/__APP_NAME_PASCAL__/Models.swift +0 -26
- package/templates/mac/chat/apps/mac/Sources/__APP_NAME_PASCAL__/RoomView.swift +0 -136
- package/templates/mac/chat/apps/mac/Sources/__APP_NAME_PASCAL__/__APP_NAME_PASCAL__App.swift +0 -58
- package/templates/mac/chat/apps/mac/__APP_NAME_PASCAL__.entitlements +0 -13
- package/templates/mac/chat/apps/mac/project.yml +0 -36
- package/templates/mac/consumer/apps/mac/Package.swift +0 -34
- package/templates/mac/consumer/apps/mac/Sources/__APP_NAME_PASCAL__/FeedView.swift +0 -199
- package/templates/mac/consumer/apps/mac/Sources/__APP_NAME_PASCAL__/Models.swift +0 -34
- package/templates/mac/consumer/apps/mac/Sources/__APP_NAME_PASCAL__/ProfileSetupView.swift +0 -68
- package/templates/mac/consumer/apps/mac/Sources/__APP_NAME_PASCAL__/RootView.swift +0 -40
- package/templates/mac/consumer/apps/mac/Sources/__APP_NAME_PASCAL__/__APP_NAME_PASCAL__App.swift +0 -59
- package/templates/mac/consumer/apps/mac/__APP_NAME_PASCAL__.entitlements +0 -13
- package/templates/mac/consumer/apps/mac/project.yml +0 -36
- package/templates/mac/todo/apps/mac/Package.swift +0 -33
- package/templates/mac/todo/apps/mac/Sources/__APP_NAME_PASCAL__/Models.swift +0 -19
- package/templates/mac/todo/apps/mac/Sources/__APP_NAME_PASCAL__/TodoListView.swift +0 -244
- package/templates/mac/todo/apps/mac/Sources/__APP_NAME_PASCAL__/__APP_NAME_PASCAL__App.swift +0 -30
- package/templates/mac/todo/apps/mac/__APP_NAME_PASCAL__.entitlements +0 -13
- package/templates/mac/todo/apps/mac/project.yml +0 -34
- package/templates/marketplace/components/ui/native-select.tsx +0 -62
- package/templates/marketplace/components.json +0 -20
- package/templates/projects/components.json +0 -20
- package/templates/restaurant/components.json +0 -20
- package/templates/saas/components.json +0 -20
- package/templates/shop/components.json +0 -20
- package/templates/todo/components.json +0 -20
- package/templates/ui/packages/ui/package.json +0 -26
- package/templates/ui/packages/ui/src/button.tsx +0 -44
- package/templates/ui/packages/ui/src/card.tsx +0 -39
- package/templates/ui/packages/ui/src/cn.ts +0 -12
- package/templates/ui/packages/ui/src/index.ts +0 -4
- package/templates/ui/packages/ui/src/input.tsx +0 -19
- package/templates/ui/packages/ui/tsconfig.json +0 -15
- package/templates/vite/todo/apps/web/index.html +0 -12
- package/templates/vite/todo/apps/web/package.json +0 -31
- package/templates/vite/todo/apps/web/src/App.tsx +0 -16
- package/templates/vite/todo/apps/web/src/components/TodoList.tsx +0 -281
- package/templates/vite/todo/apps/web/src/index.css +0 -14
- package/templates/vite/todo/apps/web/src/main.tsx +0 -20
- package/templates/vite/todo/apps/web/tsconfig.json +0 -24
- package/templates/vite/todo/apps/web/vite.config.ts +0 -41
- package/templates/waitlist/components.json +0 -20
- package/templates/web/b2b/apps/web/next-env.d.ts +0 -2
- package/templates/web/b2b/apps/web/next.config.ts +0 -24
- package/templates/web/b2b/apps/web/package.json +0 -27
- package/templates/web/b2b/apps/web/postcss.config.mjs +0 -3
- package/templates/web/b2b/apps/web/src/app/components/OrgPicker.tsx +0 -171
- package/templates/web/b2b/apps/web/src/app/globals.css +0 -6
- package/templates/web/b2b/apps/web/src/app/layout.tsx +0 -21
- package/templates/web/b2b/apps/web/src/app/page.tsx +0 -39
- package/templates/web/b2b/apps/web/src/lib/pylon.ts +0 -5
- package/templates/web/b2b/apps/web/tsconfig.json +0 -26
- package/templates/web/barebones/apps/web/next-env.d.ts +0 -2
- package/templates/web/barebones/apps/web/next.config.ts +0 -40
- package/templates/web/barebones/apps/web/package.json +0 -27
- package/templates/web/barebones/apps/web/postcss.config.mjs +0 -3
- package/templates/web/barebones/apps/web/src/app/components/WidgetList.tsx +0 -81
- package/templates/web/barebones/apps/web/src/app/globals.css +0 -6
- package/templates/web/barebones/apps/web/src/app/layout.tsx +0 -21
- package/templates/web/barebones/apps/web/src/app/page.tsx +0 -43
- package/templates/web/barebones/apps/web/src/lib/pylon.ts +0 -14
- package/templates/web/barebones/apps/web/tsconfig.json +0 -26
- package/templates/web/chat/apps/web/next-env.d.ts +0 -2
- package/templates/web/chat/apps/web/next.config.ts +0 -24
- package/templates/web/chat/apps/web/package.json +0 -27
- package/templates/web/chat/apps/web/postcss.config.mjs +0 -3
- package/templates/web/chat/apps/web/src/app/components/ChatRoom.tsx +0 -231
- package/templates/web/chat/apps/web/src/app/globals.css +0 -6
- package/templates/web/chat/apps/web/src/app/layout.tsx +0 -22
- package/templates/web/chat/apps/web/src/app/page.tsx +0 -12
- package/templates/web/chat/apps/web/src/app/providers.tsx +0 -25
- package/templates/web/chat/apps/web/src/lib/pylon.ts +0 -5
- package/templates/web/chat/apps/web/tsconfig.json +0 -26
- package/templates/web/consumer/apps/web/next-env.d.ts +0 -2
- package/templates/web/consumer/apps/web/next.config.ts +0 -24
- package/templates/web/consumer/apps/web/package.json +0 -27
- package/templates/web/consumer/apps/web/postcss.config.mjs +0 -3
- package/templates/web/consumer/apps/web/src/app/components/Feed.tsx +0 -315
- package/templates/web/consumer/apps/web/src/app/globals.css +0 -6
- package/templates/web/consumer/apps/web/src/app/layout.tsx +0 -22
- package/templates/web/consumer/apps/web/src/app/page.tsx +0 -21
- package/templates/web/consumer/apps/web/src/app/providers.tsx +0 -25
- package/templates/web/consumer/apps/web/src/lib/pylon.ts +0 -5
- package/templates/web/consumer/apps/web/tsconfig.json +0 -26
- package/templates/web/todo/apps/web/next-env.d.ts +0 -2
- package/templates/web/todo/apps/web/next.config.ts +0 -26
- package/templates/web/todo/apps/web/package.json +0 -30
- package/templates/web/todo/apps/web/postcss.config.mjs +0 -3
- package/templates/web/todo/apps/web/src/app/components/TodoList.tsx +0 -310
- package/templates/web/todo/apps/web/src/app/globals.css +0 -6
- package/templates/web/todo/apps/web/src/app/layout.tsx +0 -21
- package/templates/web/todo/apps/web/src/app/page.tsx +0 -36
- package/templates/web/todo/apps/web/src/lib/pylon.ts +0 -5
- package/templates/web/todo/apps/web/tsconfig.json +0 -26
- /package/templates/barebones/app/{items-client.tsx → (app)/items-client.tsx} +0 -0
- /package/templates/marketplace/{app/_components → components}/CategoryIcon.tsx +0 -0
- /package/templates/todo/app/{todo-app.tsx → (app)/todo-app.tsx} +0 -0
|
@@ -1,310 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { useState, useTransition, useRef, useEffect } from "react";
|
|
4
|
-
import { Button, Input } from "@__APP_NAME_KEBAB__/ui";
|
|
5
|
-
import {
|
|
6
|
-
DndContext,
|
|
7
|
-
closestCenter,
|
|
8
|
-
KeyboardSensor,
|
|
9
|
-
PointerSensor,
|
|
10
|
-
useSensor,
|
|
11
|
-
useSensors,
|
|
12
|
-
type DragEndEvent,
|
|
13
|
-
} from "@dnd-kit/core";
|
|
14
|
-
import {
|
|
15
|
-
arrayMove,
|
|
16
|
-
SortableContext,
|
|
17
|
-
sortableKeyboardCoordinates,
|
|
18
|
-
useSortable,
|
|
19
|
-
verticalListSortingStrategy,
|
|
20
|
-
} from "@dnd-kit/sortable";
|
|
21
|
-
import { CSS } from "@dnd-kit/utilities";
|
|
22
|
-
|
|
23
|
-
type Todo = {
|
|
24
|
-
id: string;
|
|
25
|
-
title: string;
|
|
26
|
-
done: boolean;
|
|
27
|
-
createdAt: string;
|
|
28
|
-
position?: number;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export function TodoList({ initialTodos }: { initialTodos: Todo[] }) {
|
|
32
|
-
const [todos, setTodos] = useState(initialTodos);
|
|
33
|
-
const [title, setTitle] = useState("");
|
|
34
|
-
const [pending, startTransition] = useTransition();
|
|
35
|
-
const sensors = useSensors(
|
|
36
|
-
useSensor(PointerSensor, { activationConstraint: { distance: 5 } }),
|
|
37
|
-
useSensor(KeyboardSensor, { coordinateGetter: sortableKeyboardCoordinates }),
|
|
38
|
-
);
|
|
39
|
-
|
|
40
|
-
async function add() {
|
|
41
|
-
if (!title.trim()) return;
|
|
42
|
-
const newTitle = title;
|
|
43
|
-
setTitle("");
|
|
44
|
-
startTransition(async () => {
|
|
45
|
-
const res = await fetch("/api/fn/addTodo", {
|
|
46
|
-
method: "POST",
|
|
47
|
-
headers: { "Content-Type": "application/json" },
|
|
48
|
-
body: JSON.stringify({ title: newTitle }),
|
|
49
|
-
});
|
|
50
|
-
if (res.ok) {
|
|
51
|
-
const todo = (await res.json()) as Todo;
|
|
52
|
-
setTodos((prev) => [...prev, todo]);
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
async function toggle(t: Todo) {
|
|
58
|
-
const next = !t.done;
|
|
59
|
-
setTodos((prev) =>
|
|
60
|
-
prev.map((row) => (row.id === t.id ? { ...row, done: next } : row)),
|
|
61
|
-
);
|
|
62
|
-
startTransition(async () => {
|
|
63
|
-
const res = await fetch("/api/fn/toggleTodo", {
|
|
64
|
-
method: "POST",
|
|
65
|
-
headers: { "Content-Type": "application/json" },
|
|
66
|
-
body: JSON.stringify({ id: t.id, done: next }),
|
|
67
|
-
});
|
|
68
|
-
if (!res.ok) {
|
|
69
|
-
setTodos((prev) =>
|
|
70
|
-
prev.map((row) => (row.id === t.id ? { ...row, done: t.done } : row)),
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
async function remove(t: Todo) {
|
|
77
|
-
const snapshot = todos;
|
|
78
|
-
setTodos((prev) => prev.filter((row) => row.id !== t.id));
|
|
79
|
-
startTransition(async () => {
|
|
80
|
-
const res = await fetch("/api/fn/deleteTodo", {
|
|
81
|
-
method: "POST",
|
|
82
|
-
headers: { "Content-Type": "application/json" },
|
|
83
|
-
body: JSON.stringify({ id: t.id }),
|
|
84
|
-
});
|
|
85
|
-
if (!res.ok) setTodos(snapshot);
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
async function rename(t: Todo, newTitle: string) {
|
|
90
|
-
const trimmed = newTitle.trim();
|
|
91
|
-
if (!trimmed || trimmed === t.title) return;
|
|
92
|
-
setTodos((prev) =>
|
|
93
|
-
prev.map((row) => (row.id === t.id ? { ...row, title: trimmed } : row)),
|
|
94
|
-
);
|
|
95
|
-
startTransition(async () => {
|
|
96
|
-
const res = await fetch("/api/fn/editTodo", {
|
|
97
|
-
method: "POST",
|
|
98
|
-
headers: { "Content-Type": "application/json" },
|
|
99
|
-
body: JSON.stringify({ id: t.id, title: trimmed }),
|
|
100
|
-
});
|
|
101
|
-
if (!res.ok) {
|
|
102
|
-
setTodos((prev) =>
|
|
103
|
-
prev.map((row) => (row.id === t.id ? { ...row, title: t.title } : row)),
|
|
104
|
-
);
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
function onDragEnd(e: DragEndEvent) {
|
|
110
|
-
const { active, over } = e;
|
|
111
|
-
if (!over || active.id === over.id) return;
|
|
112
|
-
const oldIndex = todos.findIndex((t) => t.id === active.id);
|
|
113
|
-
const newIndex = todos.findIndex((t) => t.id === over.id);
|
|
114
|
-
if (oldIndex < 0 || newIndex < 0) return;
|
|
115
|
-
const reordered = arrayMove(todos, oldIndex, newIndex);
|
|
116
|
-
setTodos(reordered);
|
|
117
|
-
const prev = reordered[newIndex - 1];
|
|
118
|
-
const next = reordered[newIndex + 1];
|
|
119
|
-
const prevPos = prev?.position ?? Date.parse(prev?.createdAt ?? "") ?? 0;
|
|
120
|
-
const nextPos = next?.position ?? Date.parse(next?.createdAt ?? "") ?? 0;
|
|
121
|
-
let position: number;
|
|
122
|
-
if (prev && next) position = (prevPos + nextPos) / 2;
|
|
123
|
-
else if (prev) position = prevPos + 1024;
|
|
124
|
-
else if (next) position = nextPos - 1024;
|
|
125
|
-
else position = 1024;
|
|
126
|
-
const movedId = String(active.id);
|
|
127
|
-
const snapshot = todos;
|
|
128
|
-
startTransition(async () => {
|
|
129
|
-
const res = await fetch("/api/fn/reorderTodo", {
|
|
130
|
-
method: "POST",
|
|
131
|
-
headers: { "Content-Type": "application/json" },
|
|
132
|
-
body: JSON.stringify({ id: movedId, position }),
|
|
133
|
-
});
|
|
134
|
-
if (!res.ok) setTodos(snapshot);
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
return (
|
|
139
|
-
<div className="space-y-4">
|
|
140
|
-
<form
|
|
141
|
-
onSubmit={(e) => {
|
|
142
|
-
e.preventDefault();
|
|
143
|
-
add();
|
|
144
|
-
}}
|
|
145
|
-
className="flex gap-2"
|
|
146
|
-
>
|
|
147
|
-
<Input
|
|
148
|
-
value={title}
|
|
149
|
-
onChange={(e) => setTitle(e.target.value)}
|
|
150
|
-
placeholder="What needs doing?"
|
|
151
|
-
disabled={pending}
|
|
152
|
-
className="flex-1"
|
|
153
|
-
/>
|
|
154
|
-
<Button
|
|
155
|
-
type="submit"
|
|
156
|
-
variant="primary"
|
|
157
|
-
disabled={pending || !title.trim()}
|
|
158
|
-
>
|
|
159
|
-
Add
|
|
160
|
-
</Button>
|
|
161
|
-
</form>
|
|
162
|
-
|
|
163
|
-
{todos.length === 0 ? (
|
|
164
|
-
<p className="text-sm text-neutral-500 dark:text-neutral-400 text-center py-8">
|
|
165
|
-
No todos yet. Add one above.
|
|
166
|
-
</p>
|
|
167
|
-
) : (
|
|
168
|
-
<DndContext
|
|
169
|
-
sensors={sensors}
|
|
170
|
-
collisionDetection={closestCenter}
|
|
171
|
-
onDragEnd={onDragEnd}
|
|
172
|
-
>
|
|
173
|
-
<SortableContext
|
|
174
|
-
items={todos.map((t) => t.id)}
|
|
175
|
-
strategy={verticalListSortingStrategy}
|
|
176
|
-
>
|
|
177
|
-
<ul className="divide-y divide-neutral-200 dark:divide-neutral-800 rounded-md border border-neutral-200 dark:border-neutral-800">
|
|
178
|
-
{todos.map((t) => (
|
|
179
|
-
<SortableRow
|
|
180
|
-
key={t.id}
|
|
181
|
-
todo={t}
|
|
182
|
-
pending={pending}
|
|
183
|
-
onToggle={() => toggle(t)}
|
|
184
|
-
onRemove={() => remove(t)}
|
|
185
|
-
onRename={(next) => rename(t, next)}
|
|
186
|
-
/>
|
|
187
|
-
))}
|
|
188
|
-
</ul>
|
|
189
|
-
</SortableContext>
|
|
190
|
-
</DndContext>
|
|
191
|
-
)}
|
|
192
|
-
</div>
|
|
193
|
-
);
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
function SortableRow({
|
|
197
|
-
todo,
|
|
198
|
-
pending,
|
|
199
|
-
onToggle,
|
|
200
|
-
onRemove,
|
|
201
|
-
onRename,
|
|
202
|
-
}: {
|
|
203
|
-
todo: Todo;
|
|
204
|
-
pending: boolean;
|
|
205
|
-
onToggle: () => void;
|
|
206
|
-
onRemove: () => void;
|
|
207
|
-
onRename: (next: string) => void;
|
|
208
|
-
}) {
|
|
209
|
-
const {
|
|
210
|
-
attributes,
|
|
211
|
-
listeners,
|
|
212
|
-
setNodeRef,
|
|
213
|
-
transform,
|
|
214
|
-
transition,
|
|
215
|
-
isDragging,
|
|
216
|
-
} = useSortable({ id: todo.id });
|
|
217
|
-
const style = {
|
|
218
|
-
transform: CSS.Transform.toString(transform),
|
|
219
|
-
transition,
|
|
220
|
-
opacity: isDragging ? 0.4 : 1,
|
|
221
|
-
};
|
|
222
|
-
const [editing, setEditing] = useState(false);
|
|
223
|
-
const [draft, setDraft] = useState(todo.title);
|
|
224
|
-
const inputRef = useRef<HTMLInputElement>(null);
|
|
225
|
-
|
|
226
|
-
useEffect(() => {
|
|
227
|
-
if (editing) {
|
|
228
|
-
setDraft(todo.title);
|
|
229
|
-
requestAnimationFrame(() => {
|
|
230
|
-
inputRef.current?.focus();
|
|
231
|
-
inputRef.current?.select();
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
|
-
}, [editing, todo.title]);
|
|
235
|
-
|
|
236
|
-
function commit() {
|
|
237
|
-
setEditing(false);
|
|
238
|
-
onRename(draft);
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
return (
|
|
242
|
-
<li
|
|
243
|
-
ref={setNodeRef}
|
|
244
|
-
style={style}
|
|
245
|
-
className="flex items-center gap-3 px-4 py-3 text-sm group bg-white dark:bg-neutral-950"
|
|
246
|
-
>
|
|
247
|
-
<button
|
|
248
|
-
type="button"
|
|
249
|
-
{...attributes}
|
|
250
|
-
{...listeners}
|
|
251
|
-
className="cursor-grab active:cursor-grabbing text-neutral-300 hover:text-neutral-500 select-none touch-none"
|
|
252
|
-
aria-label="Drag to reorder"
|
|
253
|
-
tabIndex={-1}
|
|
254
|
-
>
|
|
255
|
-
⋮⋮
|
|
256
|
-
</button>
|
|
257
|
-
<input
|
|
258
|
-
type="checkbox"
|
|
259
|
-
checked={todo.done}
|
|
260
|
-
onChange={onToggle}
|
|
261
|
-
disabled={pending}
|
|
262
|
-
className="size-4 cursor-pointer"
|
|
263
|
-
aria-label={`Mark "${todo.title}" as ${todo.done ? "not done" : "done"}`}
|
|
264
|
-
/>
|
|
265
|
-
{editing ? (
|
|
266
|
-
<input
|
|
267
|
-
ref={inputRef}
|
|
268
|
-
value={draft}
|
|
269
|
-
onChange={(e) => setDraft(e.target.value)}
|
|
270
|
-
onBlur={commit}
|
|
271
|
-
onKeyDown={(e) => {
|
|
272
|
-
if (e.key === "Enter") commit();
|
|
273
|
-
else if (e.key === "Escape") {
|
|
274
|
-
setEditing(false);
|
|
275
|
-
setDraft(todo.title);
|
|
276
|
-
}
|
|
277
|
-
}}
|
|
278
|
-
className="flex-1 bg-transparent border-b border-neutral-300 dark:border-neutral-700 outline-none text-sm"
|
|
279
|
-
aria-label="Edit title"
|
|
280
|
-
/>
|
|
281
|
-
) : (
|
|
282
|
-
<button
|
|
283
|
-
type="button"
|
|
284
|
-
onDoubleClick={() => setEditing(true)}
|
|
285
|
-
className={`flex-1 text-left ${todo.done ? "line-through text-neutral-400" : ""}`}
|
|
286
|
-
title="Double-click to edit"
|
|
287
|
-
>
|
|
288
|
-
{todo.title}
|
|
289
|
-
</button>
|
|
290
|
-
)}
|
|
291
|
-
<button
|
|
292
|
-
type="button"
|
|
293
|
-
onClick={() => setEditing(true)}
|
|
294
|
-
className="opacity-0 group-hover:opacity-100 transition-opacity text-xs text-neutral-500 hover:text-neutral-800 dark:hover:text-neutral-200"
|
|
295
|
-
aria-label={`Edit "${todo.title}"`}
|
|
296
|
-
>
|
|
297
|
-
Edit
|
|
298
|
-
</button>
|
|
299
|
-
<button
|
|
300
|
-
type="button"
|
|
301
|
-
onClick={onRemove}
|
|
302
|
-
disabled={pending}
|
|
303
|
-
className="opacity-0 group-hover:opacity-100 transition-opacity text-xs text-neutral-500 hover:text-red-500"
|
|
304
|
-
aria-label={`Delete "${todo.title}"`}
|
|
305
|
-
>
|
|
306
|
-
Delete
|
|
307
|
-
</button>
|
|
308
|
-
</li>
|
|
309
|
-
);
|
|
310
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { Metadata } from "next";
|
|
2
|
-
import "./globals.css";
|
|
3
|
-
|
|
4
|
-
export const metadata: Metadata = {
|
|
5
|
-
title: "__APP_NAME__",
|
|
6
|
-
description: "Realtime app powered by Pylon",
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export default function RootLayout({
|
|
10
|
-
children,
|
|
11
|
-
}: {
|
|
12
|
-
children: React.ReactNode;
|
|
13
|
-
}) {
|
|
14
|
-
return (
|
|
15
|
-
<html lang="en">
|
|
16
|
-
<body className="antialiased min-h-screen bg-white dark:bg-neutral-950 text-neutral-900 dark:text-neutral-100">
|
|
17
|
-
{children}
|
|
18
|
-
</body>
|
|
19
|
-
</html>
|
|
20
|
-
);
|
|
21
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { pylon } from "@/lib/pylon";
|
|
2
|
-
import { TodoList } from "./components/TodoList";
|
|
3
|
-
|
|
4
|
-
export const dynamic = "force-dynamic";
|
|
5
|
-
|
|
6
|
-
type Todo = {
|
|
7
|
-
id: string;
|
|
8
|
-
title: string;
|
|
9
|
-
done: boolean;
|
|
10
|
-
createdAt: string;
|
|
11
|
-
position?: number;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export default async function HomePage() {
|
|
15
|
-
const todos = await pylon
|
|
16
|
-
.json<Todo[]>("/api/fn/listTodos", {
|
|
17
|
-
method: "POST",
|
|
18
|
-
body: "{}",
|
|
19
|
-
headers: { "Content-Type": "application/json" },
|
|
20
|
-
})
|
|
21
|
-
.catch(() => [] as Todo[]);
|
|
22
|
-
|
|
23
|
-
return (
|
|
24
|
-
<main className="mx-auto max-w-2xl px-6 py-12 space-y-8">
|
|
25
|
-
<header className="space-y-2">
|
|
26
|
-
<h1 className="text-3xl font-semibold tracking-tight">__APP_NAME__</h1>
|
|
27
|
-
<p className="text-sm text-neutral-500 dark:text-neutral-400">
|
|
28
|
-
Drag rows to reorder, double-click a title to edit, hover for
|
|
29
|
-
delete. All mutations are optimistic with revert-on-failure.
|
|
30
|
-
</p>
|
|
31
|
-
</header>
|
|
32
|
-
|
|
33
|
-
<TodoList initialTodos={todos} />
|
|
34
|
-
</main>
|
|
35
|
-
);
|
|
36
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2022",
|
|
4
|
-
"lib": ["dom", "dom.iterable", "esnext"],
|
|
5
|
-
"allowJs": true,
|
|
6
|
-
"skipLibCheck": true,
|
|
7
|
-
"strict": true,
|
|
8
|
-
"noEmit": true,
|
|
9
|
-
"esModuleInterop": true,
|
|
10
|
-
"module": "esnext",
|
|
11
|
-
"moduleResolution": "bundler",
|
|
12
|
-
"resolveJsonModule": true,
|
|
13
|
-
"isolatedModules": true,
|
|
14
|
-
"jsx": "preserve",
|
|
15
|
-
"incremental": true,
|
|
16
|
-
"plugins": [{ "name": "next" }],
|
|
17
|
-
"paths": { "@/*": ["./src/*"] }
|
|
18
|
-
},
|
|
19
|
-
"include": [
|
|
20
|
-
"next-env.d.ts",
|
|
21
|
-
"src/**/*.ts",
|
|
22
|
-
"src/**/*.tsx",
|
|
23
|
-
".next/types/**/*.ts"
|
|
24
|
-
],
|
|
25
|
-
"exclude": ["node_modules"]
|
|
26
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|