create-nextblock 0.15.5 → 0.15.9

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.
Files changed (79) hide show
  1. package/package.json +50 -26
  2. package/templates/nextblock-template/app/ToasterProvider.tsx +26 -17
  3. package/templates/nextblock-template/app/actions/contactSellerActions.test.ts +280 -0
  4. package/templates/nextblock-template/app/actions/contactSellerActions.ts +222 -0
  5. package/templates/nextblock-template/app/actions/email-retry.test.ts +62 -0
  6. package/templates/nextblock-template/app/actions/email.ts +241 -110
  7. package/templates/nextblock-template/app/actions/formActions.ts +245 -116
  8. package/templates/nextblock-template/app/actions/interactions.ts +489 -396
  9. package/templates/nextblock-template/app/actions/threadActions.ts +166 -0
  10. package/templates/nextblock-template/app/api/checkout/route.ts +162 -146
  11. package/templates/nextblock-template/app/api/cron/reset-sandbox/route.ts +14 -0
  12. package/templates/nextblock-template/app/api/cron/reset-sandbox/sandboxResetSql.ts +664 -1
  13. package/templates/nextblock-template/app/checkout/page.tsx +57 -52
  14. package/templates/nextblock-template/app/cms/CmsClientLayout.tsx +552 -529
  15. package/templates/nextblock-template/app/cms/blocks/editors/FormBlockEditor.tsx +304 -181
  16. package/templates/nextblock-template/app/cms/components/ContactReminderBanner.tsx +75 -0
  17. package/templates/nextblock-template/app/cms/components/PaymentsReminderBanner.tsx +58 -0
  18. package/templates/nextblock-template/app/cms/components/VisibilityControl.tsx +542 -528
  19. package/templates/nextblock-template/app/cms/inquiries/actions.ts +66 -0
  20. package/templates/nextblock-template/app/cms/inquiries/page.tsx +12 -0
  21. package/templates/nextblock-template/app/cms/interactions/page.tsx +12 -51
  22. package/templates/nextblock-template/app/cms/layout.tsx +101 -73
  23. package/templates/nextblock-template/app/cms/messages/MessagesClient.tsx +661 -0
  24. package/templates/nextblock-template/app/cms/messages/actions.ts +404 -0
  25. package/templates/nextblock-template/app/cms/messages/loadInbox.ts +333 -0
  26. package/templates/nextblock-template/app/cms/messages/page.tsx +87 -0
  27. package/templates/nextblock-template/app/cms/messages/require-admin.ts +37 -0
  28. package/templates/nextblock-template/app/cms/products/[id]/edit/page.tsx +370 -362
  29. package/templates/nextblock-template/app/cms/revisions/service.ts +20 -0
  30. package/templates/nextblock-template/app/cms/settings/email/components/EmailForm.tsx +227 -185
  31. package/templates/nextblock-template/app/layout.tsx +671 -667
  32. package/templates/nextblock-template/app/lib/seo.ts +319 -311
  33. package/templates/nextblock-template/app/product/[slug]/page.tsx +502 -482
  34. package/templates/nextblock-template/app/providers.tsx +96 -96
  35. package/templates/nextblock-template/app/thread/ThreadView.tsx +164 -0
  36. package/templates/nextblock-template/app/thread/[token]/route.ts +57 -0
  37. package/templates/nextblock-template/app/thread/layout.tsx +15 -0
  38. package/templates/nextblock-template/app/thread/page.tsx +98 -0
  39. package/templates/nextblock-template/components/BlockRenderer.tsx +312 -296
  40. package/templates/nextblock-template/components/ContactSellerSection.tsx +188 -0
  41. package/templates/nextblock-template/components/PostCommentsSection.tsx +378 -369
  42. package/templates/nextblock-template/components/ProductReviewsSection.tsx +426 -419
  43. package/templates/nextblock-template/components/StaffReplies.tsx +102 -0
  44. package/templates/nextblock-template/components/blocks/renderers/CartBlockRenderer.tsx +18 -17
  45. package/templates/nextblock-template/components/blocks/renderers/CheckoutBlockRenderer.tsx +20 -19
  46. package/templates/nextblock-template/components/blocks/renderers/FeaturedProductBlockRenderer.tsx +25 -22
  47. package/templates/nextblock-template/components/blocks/renderers/FormBlockRenderer.tsx +385 -381
  48. package/templates/nextblock-template/components/blocks/renderers/ProductDetailsBlockRenderer.tsx +157 -92
  49. package/templates/nextblock-template/components/blocks/renderers/ProductGridBlockRenderer.tsx +34 -31
  50. package/templates/nextblock-template/components/blocks/renderers/SectionBlockRenderer.tsx +612 -600
  51. package/templates/nextblock-template/components/commerce/PaymentReadinessBoundary.tsx +32 -0
  52. package/templates/nextblock-template/docs/05-DEVELOPER-GUIDE.md +25 -19
  53. package/templates/nextblock-template/docs/06-CLI-AND-SCAFFOLDING.md +1 -1
  54. package/templates/nextblock-template/docs/08-NEXTBLOCK-CORTEX-AI-ARCHITECTURE.md +2 -2
  55. package/templates/nextblock-template/docs/12-VERCEL-DEPLOYMENT.md +32 -9
  56. package/templates/nextblock-template/docs/14-MESSAGES-INBOX.md +309 -0
  57. package/templates/nextblock-template/docs/README.md +42 -41
  58. package/templates/nextblock-template/docs/TECHNICAL_SPECIFICATION.md +540 -542
  59. package/templates/nextblock-template/docs/assets/lighthouse-scores.png +0 -0
  60. package/templates/nextblock-template/lib/blocks/blockColors.test.ts +22 -2
  61. package/templates/nextblock-template/lib/blocks/blockColors.ts +44 -1
  62. package/templates/nextblock-template/lib/blocks/blockRegistry.ts +761 -753
  63. package/templates/nextblock-template/lib/cms/contact-reminder.ts +64 -0
  64. package/templates/nextblock-template/lib/cms/payments-reminder.ts +98 -0
  65. package/templates/nextblock-template/lib/cms/unread-messages.ts +42 -0
  66. package/templates/nextblock-template/lib/commerce/seller-contact.ts +162 -0
  67. package/templates/nextblock-template/lib/config/email-settings.ts +323 -254
  68. package/templates/nextblock-template/lib/config/email-tls.test.ts +57 -0
  69. package/templates/nextblock-template/lib/email/placeholder-address.test.ts +59 -0
  70. package/templates/nextblock-template/lib/email/placeholder-address.ts +39 -0
  71. package/templates/nextblock-template/lib/messages/thread-reference.test.ts +70 -0
  72. package/templates/nextblock-template/lib/messages/thread-token.test.ts +93 -0
  73. package/templates/nextblock-template/lib/messages/thread-token.ts +157 -0
  74. package/templates/nextblock-template/lib/messages/threads.ts +579 -0
  75. package/templates/nextblock-template/lib/setup/migrations-bundle.ts +20 -0
  76. package/templates/nextblock-template/lib/site-url.test.ts +89 -0
  77. package/templates/nextblock-template/lib/site-url.ts +102 -48
  78. package/templates/nextblock-template/package.json +14 -1
  79. package/templates/nextblock-template/public/assets/nextblock-banner.jpg +0 -0
@@ -1,52 +1,57 @@
1
- import { Checkout } from '@nextblock-cms/ecommerce';
2
- import { createClient } from '@nextblock-cms/db/server';
3
- import { getDefaultUserAddresses } from '@nextblock-cms/ecommerce/server';
4
- import { getUcpCartCheckoutItems } from '../lib/ucp/server';
5
- import { UcpCartHydrator } from './UcpCartHydrator';
6
-
7
- interface CheckoutPageProps {
8
- searchParams?: Promise<{
9
- ucp_cart?: string;
10
- cart?: string;
11
- }>;
12
- }
13
-
14
- export default async function CheckoutPage({ searchParams }: CheckoutPageProps) {
15
- const resolvedSearchParams = await searchParams;
16
- const ucpCartId = resolvedSearchParams?.ucp_cart || resolvedSearchParams?.cart || null;
17
- const ucpCartItems = await getUcpCartCheckoutItems(ucpCartId);
18
- const supabase = createClient();
19
- const {
20
- data: { user },
21
- } = await supabase.auth.getUser();
22
-
23
- if (!user) {
24
- return (
25
- <>
26
- <UcpCartHydrator items={ucpCartItems} />
27
- <Checkout initialCustomer={{ isAuthenticated: false }} />
28
- </>
29
- );
30
- }
31
-
32
- const [{ data: profile }, { billingAddress, shippingAddress }] = await Promise.all([
33
- supabase.from('profiles').select('full_name, phone').eq('id', user.id).single(),
34
- getDefaultUserAddresses(user.id, supabase),
35
- ]);
36
-
37
- return (
38
- <>
39
- <UcpCartHydrator items={ucpCartItems} />
40
- <Checkout
41
- initialCustomer={{
42
- isAuthenticated: true,
43
- email: user.email,
44
- fullName: profile?.full_name || null,
45
- phone: profile?.phone || null,
46
- billingAddress,
47
- shippingAddress,
48
- }}
49
- />
50
- </>
51
- );
52
- }
1
+ import { Checkout } from '@nextblock-cms/ecommerce';
2
+ import PaymentReadinessBoundary from '../../components/commerce/PaymentReadinessBoundary';
3
+ import { createClient } from '@nextblock-cms/db/server';
4
+ import { getDefaultUserAddresses } from '@nextblock-cms/ecommerce/server';
5
+ import { getUcpCartCheckoutItems } from '../lib/ucp/server';
6
+ import { UcpCartHydrator } from './UcpCartHydrator';
7
+
8
+ interface CheckoutPageProps {
9
+ searchParams?: Promise<{
10
+ ucp_cart?: string;
11
+ cart?: string;
12
+ }>;
13
+ }
14
+
15
+ export default async function CheckoutPage({ searchParams }: CheckoutPageProps) {
16
+ const resolvedSearchParams = await searchParams;
17
+ const ucpCartId = resolvedSearchParams?.ucp_cart || resolvedSearchParams?.cart || null;
18
+ const ucpCartItems = await getUcpCartCheckoutItems(ucpCartId);
19
+ const supabase = createClient();
20
+ const {
21
+ data: { user },
22
+ } = await supabase.auth.getUser();
23
+
24
+ if (!user) {
25
+ return (
26
+ <>
27
+ <UcpCartHydrator items={ucpCartItems} />
28
+ <PaymentReadinessBoundary>
29
+ <Checkout initialCustomer={{ isAuthenticated: false }} />
30
+ </PaymentReadinessBoundary>
31
+ </>
32
+ );
33
+ }
34
+
35
+ const [{ data: profile }, { billingAddress, shippingAddress }] = await Promise.all([
36
+ supabase.from('profiles').select('full_name, phone').eq('id', user.id).single(),
37
+ getDefaultUserAddresses(user.id, supabase),
38
+ ]);
39
+
40
+ return (
41
+ <>
42
+ <UcpCartHydrator items={ucpCartItems} />
43
+ <PaymentReadinessBoundary>
44
+ <Checkout
45
+ initialCustomer={{
46
+ isAuthenticated: true,
47
+ email: user.email,
48
+ fullName: profile?.full_name || null,
49
+ phone: profile?.phone || null,
50
+ billingAddress,
51
+ shippingAddress,
52
+ }}
53
+ />
54
+ </PaymentReadinessBoundary>
55
+ </>
56
+ );
57
+ }