@onexapis/cli 1.1.37 → 1.1.39
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/dist/cli.js +639 -401
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +633 -396
- package/dist/cli.mjs.map +1 -1
- package/dist/index.js +255 -203
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +252 -200
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -4
- package/templates/default/CLAUDE.md +334 -1
- package/templates/default/esbuild.config.js +20 -0
- package/templates/default/pages/about.ts +2 -2
- package/templates/default/pages/forgot-password.ts +1 -3
- package/templates/default/pages/home.ts +4 -4
- package/templates/default/pages/login.ts +1 -3
- package/templates/default/pages/profile.ts +2 -2
- package/templates/default/pages/register.ts +1 -3
- package/templates/default/pages/showcase.ts +7 -7
- package/templates/default/pages/verify-code.ts +1 -3
- package/templates/default/sections/about/about.schema.ts +1 -1
- package/templates/default/sections/auth-forgot-password/auth-forgot-password.schema.ts +1 -1
- package/templates/default/sections/auth-login/auth-login.schema.ts +1 -1
- package/templates/default/sections/auth-register/auth-register.schema.ts +1 -1
- package/templates/default/sections/auth-verify-code/auth-verify-code.schema.ts +1 -1
- package/templates/default/sections/cta/cta.schema.ts +1 -1
- package/templates/default/sections/features/features.schema.ts +1 -1
- package/templates/default/sections/footer/footer.schema.ts +1 -1
- package/templates/default/sections/gallery/gallery.schema.ts +1 -1
- package/templates/default/sections/header/header.schema.ts +1 -1
- package/templates/default/sections/hero/hero.schema.ts +1 -1
- package/templates/default/sections/profile/profile.schema.ts +1 -1
- package/templates/default/sections/stats/stats.schema.ts +1 -1
- package/templates/default/sections/testimonials/testimonials.schema.ts +1 -1
- package/templates/default/theme.layout.ts +18 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onexapis/cli",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.39",
|
|
4
4
|
"description": "CLI tool for OneX theme development - scaffolds themes using @onexapis/core",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@aws-sdk/client-s3": "^3.470.0",
|
|
53
|
-
"@onexapis/core": "^1.0.
|
|
53
|
+
"@onexapis/core": "^1.0.7",
|
|
54
54
|
"@tanstack/react-query": "^5.90.16",
|
|
55
55
|
"adm-zip": "^0.5.16",
|
|
56
56
|
"archiver": "^7.0.1",
|
|
@@ -69,9 +69,10 @@
|
|
|
69
69
|
"node-fetch": "^3.3.2",
|
|
70
70
|
"open": "^10.1.0",
|
|
71
71
|
"ora": "^8.0.1",
|
|
72
|
-
"
|
|
72
|
+
"postcss": "^8.4.0",
|
|
73
|
+
"semver": "^7.7.4",
|
|
73
74
|
"tailwindcss": "^3.4.0",
|
|
74
|
-
"
|
|
75
|
+
"ws": "^8.18.0"
|
|
75
76
|
},
|
|
76
77
|
"devDependencies": {
|
|
77
78
|
"@types/adm-zip": "^0.5.7",
|
|
@@ -80,6 +81,7 @@
|
|
|
80
81
|
"@types/fs-extra": "^11.0.4",
|
|
81
82
|
"@types/inquirer": "^9.0.7",
|
|
82
83
|
"@types/node-fetch": "^2.6.13",
|
|
84
|
+
"@types/semver": "^7.7.1",
|
|
83
85
|
"@types/ws": "^8.5.0",
|
|
84
86
|
"tsup": "^8.5.1",
|
|
85
87
|
"typescript": "^5.9.3"
|
|
@@ -369,7 +369,7 @@ import {
|
|
|
369
369
|
| **State** (3) | `useCart`, `useAuth`, `useOrders` |
|
|
370
370
|
| **Checkout** (8) | `useCheckout`, `usePayment`, `useOrderLookup`, `useOrderStatus`, `useOrderSuccess`, `useOrderSummary`, `useFinance`, `saveBuyNowItem` |
|
|
371
371
|
| **Products** (3) | `useSearchProducts`, `useAddToCart`, `useProductDetail` |
|
|
372
|
-
| **Theme** (
|
|
372
|
+
| **Theme** (9) | `useDesignSystem`, `usePageBackground`, `useCommerceData`, `useThemeMode`, `useLocale`, `useViewport`, `usePageData`, `useWebsiteSettings`, `useMotion` |
|
|
373
373
|
| **Utilities** (7) | `useDebounce`, `useMediaQuery`, `useIsMobile`, `useIsTablet`, `useIsDesktop`, `useContactForm`, `useCopyToClipboard`, `useFormatPrice`, `formatVndPrice` |
|
|
374
374
|
| **Animation** (1) | `useFlyToCart` |
|
|
375
375
|
| **Server** (4) | `fetchProducts`, `fetchBlogs`, `fetchSettings`, `prefetchSectionData` |
|
|
@@ -408,6 +408,198 @@ const { formatPrice } = useFormatPrice();
|
|
|
408
408
|
formatPrice(1250000); // "1.250.000đ"
|
|
409
409
|
```
|
|
410
410
|
|
|
411
|
+
### Orders & Payment Hooks
|
|
412
|
+
|
|
413
|
+
These hooks cover the full order lifecycle: creating orders, looking up orders, processing payments, and displaying order history.
|
|
414
|
+
|
|
415
|
+
#### `useOrders` — Order state management (Zustand)
|
|
416
|
+
|
|
417
|
+
```tsx
|
|
418
|
+
import { useOrders } from "@onexapis/core/hooks";
|
|
419
|
+
|
|
420
|
+
const {
|
|
421
|
+
orders, // Order[] — list of orders
|
|
422
|
+
currentOrder, // Order | null — single order detail
|
|
423
|
+
isLoading,
|
|
424
|
+
error,
|
|
425
|
+
total,
|
|
426
|
+
totalPages,
|
|
427
|
+
currentPage,
|
|
428
|
+
|
|
429
|
+
// Actions
|
|
430
|
+
createOrder, // (data: CreateOrderData) => Promise<Order>
|
|
431
|
+
createPrivateOrder, // (data: CreateOrderData) => Promise<Order> — requires auth
|
|
432
|
+
fetchOrders, // (params?) => Promise<void> — public order list
|
|
433
|
+
fetchOrderHistory, // (params?) => Promise<void> — authenticated user's orders
|
|
434
|
+
fetchOrderById, // (orderId: string) => Promise<void>
|
|
435
|
+
fetchOrderByNumber, // (orderNumber: string) => Promise<void>
|
|
436
|
+
updateOrderStatus, // (orderId, status) => Promise<void>
|
|
437
|
+
cancelOrder, // (orderId) => Promise<void>
|
|
438
|
+
payOrder, // (orderId, paymentData?) => Promise<Order> — returns updated order
|
|
439
|
+
clearError,
|
|
440
|
+
clearCurrentOrder,
|
|
441
|
+
} = useOrders();
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
**`payOrder` returns the updated `Order`** — always check `order.status` and `order.payment_status` before navigating to success. Do NOT blindly redirect after calling `payOrder`.
|
|
445
|
+
|
|
446
|
+
#### `useOrderLookup` — Search/track order by number or ID
|
|
447
|
+
|
|
448
|
+
```tsx
|
|
449
|
+
import { useOrderLookup } from "@onexapis/core/hooks";
|
|
450
|
+
|
|
451
|
+
// Basic — manual search via input
|
|
452
|
+
const lookup = useOrderLookup();
|
|
453
|
+
|
|
454
|
+
// With auto-fetch from URL route param (for dynamic pages like /order-lookup/[orderId])
|
|
455
|
+
const routeParams = (data?.routeParams || {}) as Record<string, string>;
|
|
456
|
+
const lookup = useOrderLookup({
|
|
457
|
+
initialOrderId: routeParams.orderId, // auto-fetches on mount
|
|
458
|
+
});
|
|
459
|
+
|
|
460
|
+
// lookup.orderNumber — input value (string)
|
|
461
|
+
// lookup.setOrderNumber — update input
|
|
462
|
+
// lookup.handleTrackOrder — search (auto-detects UUID vs order number)
|
|
463
|
+
// lookup.handleClear — reset search
|
|
464
|
+
// lookup.order — Order | null (result)
|
|
465
|
+
// lookup.isSearching — boolean
|
|
466
|
+
// lookup.errorMessage — string | null
|
|
467
|
+
// lookup.getStatusLabel — (status: string) => Vietnamese label
|
|
468
|
+
// lookup.formatCurrency — (amount: number) => "1.250.000đ"
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
**Dynamic page setup** for `/order-lookup/[orderId]`:
|
|
472
|
+
|
|
473
|
+
```typescript
|
|
474
|
+
// pages/order-lookup.ts
|
|
475
|
+
export const orderLookupPageConfig = {
|
|
476
|
+
handle: "order-lookup",
|
|
477
|
+
path: "/order-lookup/[orderId]",
|
|
478
|
+
isDynamic: true,
|
|
479
|
+
dynamicSegments: ["orderId"],
|
|
480
|
+
type: "custom",
|
|
481
|
+
// ...sections
|
|
482
|
+
};
|
|
483
|
+
```
|
|
484
|
+
|
|
485
|
+
#### `usePayment` — QR code payment with bank transfer
|
|
486
|
+
|
|
487
|
+
```tsx
|
|
488
|
+
import { usePayment } from "@onexapis/core/hooks";
|
|
489
|
+
|
|
490
|
+
const payment = usePayment({
|
|
491
|
+
successRedirectUrl: "/order-success", // default
|
|
492
|
+
checkoutRedirectUrl: "/checkout", // default — redirect if no order info
|
|
493
|
+
isEditing: false,
|
|
494
|
+
});
|
|
495
|
+
|
|
496
|
+
// payment.orderId, payment.orderNumber, payment.total
|
|
497
|
+
// payment.qrCodeImage — data URI for QR code
|
|
498
|
+
// payment.qrNote — transfer note (e.g. "DH4X7K2M")
|
|
499
|
+
// payment.bankTransferData — { accountNumber, accountName, bankName }
|
|
500
|
+
// payment.isLoading, payment.isProcessing, payment.error
|
|
501
|
+
// payment.handleConfirmPayment — calls payOrder API, checks response, then redirects
|
|
502
|
+
// payment.handleCancel — clears order info, redirects to checkout
|
|
503
|
+
```
|
|
504
|
+
|
|
505
|
+
**`handleConfirmPayment` validates the API response:**
|
|
506
|
+
|
|
507
|
+
- Checks `order.status` — blocks redirect if `failed`, `cancelled`, or `refunded`
|
|
508
|
+
- Checks `order.payment_status` — blocks redirect if `failed`
|
|
509
|
+
- Only navigates to success page when payment is valid
|
|
510
|
+
- Shows error message from API on failure
|
|
511
|
+
|
|
512
|
+
#### `useOrderSuccess` — Post-purchase success page
|
|
513
|
+
|
|
514
|
+
```tsx
|
|
515
|
+
import { useOrderSuccess } from "@onexapis/core/hooks";
|
|
516
|
+
|
|
517
|
+
const success = useOrderSuccess();
|
|
518
|
+
// success.orderId, success.orderNumber, success.displayOrderNumber
|
|
519
|
+
// success.trackOrderUrl — link to order lookup page
|
|
520
|
+
// success.hasOrder — boolean (false if no order in URL params)
|
|
521
|
+
```
|
|
522
|
+
|
|
523
|
+
#### `useOrderSummary` — Calculate order totals
|
|
524
|
+
|
|
525
|
+
```tsx
|
|
526
|
+
import { useOrderSummary, calculateOrderTotal } from "@onexapis/core/hooks";
|
|
527
|
+
|
|
528
|
+
const summary = useOrderSummary({
|
|
529
|
+
vatRate: 0.1,
|
|
530
|
+
shippingFee: 30000,
|
|
531
|
+
discount: 0,
|
|
532
|
+
freeShippingThreshold: 500000,
|
|
533
|
+
});
|
|
534
|
+
// summary.subtotal, summary.discount, summary.shipping, summary.vat, summary.total
|
|
535
|
+
// summary.formatPrice(amount)
|
|
536
|
+
|
|
537
|
+
// Standalone helper (no hook needed)
|
|
538
|
+
const total = calculateOrderTotal(items, { vatRate: 0.1, shippingFee: 30000 });
|
|
539
|
+
```
|
|
540
|
+
|
|
541
|
+
#### `useOrderStatus` — Status label translation
|
|
542
|
+
|
|
543
|
+
```tsx
|
|
544
|
+
import { useOrderStatus, getOrderStatusLabel } from "@onexapis/core/hooks";
|
|
545
|
+
|
|
546
|
+
const { getLabel, getPaymentLabel } = useOrderStatus();
|
|
547
|
+
getLabel("shipping"); // "Đang giao hàng"
|
|
548
|
+
getLabel("completed"); // "Hoàn thành"
|
|
549
|
+
getPaymentLabel("paid"); // "Đã thanh toán"
|
|
550
|
+
|
|
551
|
+
// Or use the standalone function
|
|
552
|
+
getOrderStatusLabel("pending"); // "Chờ xử lý"
|
|
553
|
+
```
|
|
554
|
+
|
|
555
|
+
#### `useOrderListPage` — Order history page
|
|
556
|
+
|
|
557
|
+
```tsx
|
|
558
|
+
import { useOrderListPage } from "@onexapis/core/hooks";
|
|
559
|
+
|
|
560
|
+
const orderList = useOrderListPage({ autoFetch: true, collapsedItemCount: 2 });
|
|
561
|
+
// orderList.orders — Order[]
|
|
562
|
+
// orderList.isLoading, orderList.error
|
|
563
|
+
// orderList.toggleOrder — expand/collapse order items
|
|
564
|
+
// orderList.refresh — re-fetch orders
|
|
565
|
+
// orderList.getDisplayItems — get visible items (respects collapsed state)
|
|
566
|
+
// orderList.hasMoreItems — check if order has hidden items
|
|
567
|
+
// orderList.formatCurrency, orderList.formatDate
|
|
568
|
+
```
|
|
569
|
+
|
|
570
|
+
#### Order Type Reference
|
|
571
|
+
|
|
572
|
+
```typescript
|
|
573
|
+
interface Order {
|
|
574
|
+
id: string;
|
|
575
|
+
order_number: string;
|
|
576
|
+
status: string; // pending | confirmed | processing | packing | shipping | completed | cancelled | failed | refunded
|
|
577
|
+
payment_status?: string; // paid | unpaid | failed
|
|
578
|
+
payment_method?: string;
|
|
579
|
+
total: number;
|
|
580
|
+
sub_total?: number;
|
|
581
|
+
tax?: number;
|
|
582
|
+
shipping_fee?: number;
|
|
583
|
+
discount?: number;
|
|
584
|
+
order_line_items?: OrderLineItem[];
|
|
585
|
+
shipping_address?: OrderAddress;
|
|
586
|
+
note?: string;
|
|
587
|
+
created_at: string;
|
|
588
|
+
updated_at?: string;
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
interface OrderLineItem {
|
|
592
|
+
name: string;
|
|
593
|
+
unit_price: number;
|
|
594
|
+
quantity: number;
|
|
595
|
+
product_id: string;
|
|
596
|
+
variant_name?: string;
|
|
597
|
+
image_url?: string;
|
|
598
|
+
sku?: string;
|
|
599
|
+
location?: { id: string; name: string };
|
|
600
|
+
}
|
|
601
|
+
```
|
|
602
|
+
|
|
411
603
|
## Color System
|
|
412
604
|
|
|
413
605
|
Colors in OneX themes work with **two approaches** (both are valid):
|
|
@@ -836,6 +1028,147 @@ export function MySection({ section, isEditing }: SectionComponentProps) {
|
|
|
836
1028
|
}
|
|
837
1029
|
```
|
|
838
1030
|
|
|
1031
|
+
## Page Background System
|
|
1032
|
+
|
|
1033
|
+
Every page has a background that comes from the theme by default, overridable per-page. This is a **page-level** feature (not section-level) — it wraps all sections on the page.
|
|
1034
|
+
|
|
1035
|
+
### How it works
|
|
1036
|
+
|
|
1037
|
+
Background is resolved with priority:
|
|
1038
|
+
|
|
1039
|
+
1. **Per-page override** (`PageConfig.background`) — set via editor or page config
|
|
1040
|
+
2. **Theme default** (`ThemeDesignSystem.pageBackground`) — set in `theme.layout.ts`
|
|
1041
|
+
3. **Fallback** — solid white `#FFFFFF`
|
|
1042
|
+
|
|
1043
|
+
### Setting the theme default
|
|
1044
|
+
|
|
1045
|
+
In `theme.layout.ts`, add `pageBackground` inside `designSystem`:
|
|
1046
|
+
|
|
1047
|
+
```typescript
|
|
1048
|
+
export const layoutConfig: ThemeLayoutConfig = {
|
|
1049
|
+
// ...headerSections, footerSections...
|
|
1050
|
+
designSystem: {
|
|
1051
|
+
colors: {
|
|
1052
|
+
primaryColor: "#3B82F6",
|
|
1053
|
+
secondaryColor: "#8B5CF6",
|
|
1054
|
+
colorMode: "light",
|
|
1055
|
+
},
|
|
1056
|
+
typography: { headingFont: "system-ui", bodyFont: "system-ui" },
|
|
1057
|
+
layout: { spacing: "comfortable" },
|
|
1058
|
+
pageBackground: {
|
|
1059
|
+
type: "solid", // "solid" | "gradient" | "image" | "pattern" | "none"
|
|
1060
|
+
color: "#FFFFFF", // Base background color
|
|
1061
|
+
},
|
|
1062
|
+
},
|
|
1063
|
+
};
|
|
1064
|
+
```
|
|
1065
|
+
|
|
1066
|
+
### Background types
|
|
1067
|
+
|
|
1068
|
+
| Type | Fields | Example |
|
|
1069
|
+
| ---------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
|
|
1070
|
+
| `solid` | `color` | `{ type: "solid", color: "#FFF8F0" }` |
|
|
1071
|
+
| `gradient` | `gradient`, `color` (fallback) | `{ type: "gradient", gradient: "linear-gradient(135deg, #667eea, #764ba2)" }` |
|
|
1072
|
+
| `image` | `image`, `imageSize`, `imagePosition`, `imageFixed`, `color` (fallback) | `{ type: "image", image: "/bg.jpg", imageSize: "cover", imageFixed: true }` |
|
|
1073
|
+
| `pattern` | `pattern`, `color`, `opacity`, `overlayColor` | `{ type: "pattern", pattern: "dots", color: "#FAFAFA", opacity: 0.05 }` |
|
|
1074
|
+
| `none` | — | `{ type: "none" }` (transparent, no wrapper) |
|
|
1075
|
+
|
|
1076
|
+
### Built-in CSS patterns
|
|
1077
|
+
|
|
1078
|
+
These work out of the box with `type: "pattern"`:
|
|
1079
|
+
|
|
1080
|
+
- `dots` — dot grid
|
|
1081
|
+
- `grid` — line grid
|
|
1082
|
+
- `diagonal-lines` — 45-degree stripes
|
|
1083
|
+
- `cross-dots` — offset dot grid
|
|
1084
|
+
- `noise` — fractal noise texture
|
|
1085
|
+
|
|
1086
|
+
### Custom animated patterns
|
|
1087
|
+
|
|
1088
|
+
Themes can provide custom pattern renderers (e.g., SVG-based animated backgrounds). Export the component from `bundle-entry.ts`:
|
|
1089
|
+
|
|
1090
|
+
```typescript
|
|
1091
|
+
// In bundle-entry.ts
|
|
1092
|
+
export { SenBackground } from "./assets/sen-background";
|
|
1093
|
+
```
|
|
1094
|
+
|
|
1095
|
+
The storefront will pick up exported `*Background` components and match them to pattern names. For example, `SenBackground` maps to `pattern: "sen"`.
|
|
1096
|
+
|
|
1097
|
+
Custom pattern components receive these props:
|
|
1098
|
+
|
|
1099
|
+
```typescript
|
|
1100
|
+
interface PatternProps {
|
|
1101
|
+
opacity?: number; // Pattern opacity (default: 0.05)
|
|
1102
|
+
color?: string; // Overlay color
|
|
1103
|
+
className?: string; // Additional CSS classes
|
|
1104
|
+
}
|
|
1105
|
+
```
|
|
1106
|
+
|
|
1107
|
+
### Per-page override
|
|
1108
|
+
|
|
1109
|
+
In a page config (e.g., `pages/about.ts`), set `background`:
|
|
1110
|
+
|
|
1111
|
+
```typescript
|
|
1112
|
+
export const aboutPageConfig = {
|
|
1113
|
+
title: "About",
|
|
1114
|
+
handle: "about",
|
|
1115
|
+
// ...other config...
|
|
1116
|
+
background: {
|
|
1117
|
+
type: "gradient",
|
|
1118
|
+
gradient: "linear-gradient(180deg, #EEF2FF 0%, #FFFFFF 50%)",
|
|
1119
|
+
},
|
|
1120
|
+
};
|
|
1121
|
+
```
|
|
1122
|
+
|
|
1123
|
+
### Accessing in sections via hook
|
|
1124
|
+
|
|
1125
|
+
Use `usePageBackground()` to read the resolved background in section components:
|
|
1126
|
+
|
|
1127
|
+
```tsx
|
|
1128
|
+
import { usePageBackground } from "@onexapis/core/hooks";
|
|
1129
|
+
|
|
1130
|
+
export function MySection({ section }: SectionComponentProps) {
|
|
1131
|
+
const { config, styles, hasPattern, pattern, patternOpacity } =
|
|
1132
|
+
usePageBackground();
|
|
1133
|
+
// config.type — "solid" | "gradient" | "image" | "pattern" | "none"
|
|
1134
|
+
// config.color — base color
|
|
1135
|
+
// styles — React.CSSProperties derived from config
|
|
1136
|
+
// hasPattern — boolean, true if type === "pattern" && pattern is set
|
|
1137
|
+
// pattern — pattern name (e.g., "sen", "dots")
|
|
1138
|
+
// patternOpacity — number (0-1)
|
|
1139
|
+
}
|
|
1140
|
+
```
|
|
1141
|
+
|
|
1142
|
+
### PageBackgroundConfig type reference
|
|
1143
|
+
|
|
1144
|
+
```typescript
|
|
1145
|
+
interface PageBackgroundConfig {
|
|
1146
|
+
type: "solid" | "gradient" | "image" | "pattern" | "none";
|
|
1147
|
+
color?: string; // Base background color (hex/CSS)
|
|
1148
|
+
gradient?: string; // CSS gradient value
|
|
1149
|
+
image?: string; // Background image URL
|
|
1150
|
+
imageSize?: "cover" | "contain" | "auto";
|
|
1151
|
+
imagePosition?: string; // CSS background-position (default: "center")
|
|
1152
|
+
imageFixed?: boolean; // Fixed background attachment
|
|
1153
|
+
pattern?: string; // Pattern identifier
|
|
1154
|
+
opacity?: number; // Pattern/overlay opacity (0-1, default: 0.05)
|
|
1155
|
+
overlayColor?: string; // Pattern overlay color
|
|
1156
|
+
className?: string; // Additional CSS classes
|
|
1157
|
+
}
|
|
1158
|
+
```
|
|
1159
|
+
|
|
1160
|
+
### CSS variables
|
|
1161
|
+
|
|
1162
|
+
The storefront injects these CSS variables when a page background is configured:
|
|
1163
|
+
|
|
1164
|
+
- `--page-bg-color` — base color
|
|
1165
|
+
- `--page-bg-gradient` — gradient value
|
|
1166
|
+
- `--page-bg-pattern` — pattern name
|
|
1167
|
+
- `--page-bg-pattern-opacity` — opacity value
|
|
1168
|
+
- `--page-bg-overlay-color` — overlay color
|
|
1169
|
+
|
|
1170
|
+
Use these in custom CSS if needed: `background-color: var(--page-bg-color);`
|
|
1171
|
+
|
|
839
1172
|
## Dark/Light Mode
|
|
840
1173
|
|
|
841
1174
|
Themes support light, dark, and system color modes via `useThemeMode()`:
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const { build } = require("esbuild");
|
|
2
|
+
const path = require("path");
|
|
3
|
+
|
|
4
|
+
build({
|
|
5
|
+
entryPoints: [path.resolve(__dirname, "bundle-entry.ts")],
|
|
6
|
+
bundle: true,
|
|
7
|
+
outfile: path.resolve(__dirname, "dist/bundle.mjs"),
|
|
8
|
+
format: "esm",
|
|
9
|
+
target: "es2020",
|
|
10
|
+
platform: "browser",
|
|
11
|
+
jsx: "automatic",
|
|
12
|
+
external: ["react", "react-dom", "@onexapis/core", "@onexapis/core/*"],
|
|
13
|
+
sourcemap: true,
|
|
14
|
+
minify: process.env.NODE_ENV === "production",
|
|
15
|
+
define: {
|
|
16
|
+
"process.env.NODE_ENV": JSON.stringify(
|
|
17
|
+
process.env.NODE_ENV || "development"
|
|
18
|
+
),
|
|
19
|
+
},
|
|
20
|
+
}).catch(() => process.exit(1));
|
|
@@ -27,7 +27,7 @@ export const aboutPageConfig: Omit<
|
|
|
27
27
|
sections: [
|
|
28
28
|
{
|
|
29
29
|
id: "about-1",
|
|
30
|
-
type: "
|
|
30
|
+
type: "about",
|
|
31
31
|
template: "default",
|
|
32
32
|
order: 0,
|
|
33
33
|
enabled: true,
|
|
@@ -47,7 +47,7 @@ export const aboutPageConfig: Omit<
|
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
49
|
id: "testimonials-1",
|
|
50
|
-
type: "
|
|
50
|
+
type: "testimonials",
|
|
51
51
|
template: "default",
|
|
52
52
|
order: 1,
|
|
53
53
|
enabled: true,
|
|
@@ -16,8 +16,6 @@ export const forgotPasswordPageConfig: Omit<
|
|
|
16
16
|
themeId: "my-simple",
|
|
17
17
|
editable: true,
|
|
18
18
|
published: true,
|
|
19
|
-
hideHeader: true,
|
|
20
|
-
hideFooter: true,
|
|
21
19
|
|
|
22
20
|
seo: {
|
|
23
21
|
title: "Forgot Password",
|
|
@@ -27,7 +25,7 @@ export const forgotPasswordPageConfig: Omit<
|
|
|
27
25
|
sections: [
|
|
28
26
|
{
|
|
29
27
|
id: "auth-forgot-password-1",
|
|
30
|
-
type: "
|
|
28
|
+
type: "auth-forgot-password",
|
|
31
29
|
template: "default",
|
|
32
30
|
order: 0,
|
|
33
31
|
enabled: true,
|
|
@@ -27,7 +27,7 @@ export const homePageConfig: Omit<
|
|
|
27
27
|
sections: [
|
|
28
28
|
{
|
|
29
29
|
id: "hero-1",
|
|
30
|
-
type: "
|
|
30
|
+
type: "hero",
|
|
31
31
|
template: "default",
|
|
32
32
|
order: 0,
|
|
33
33
|
enabled: true,
|
|
@@ -47,7 +47,7 @@ export const homePageConfig: Omit<
|
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
49
|
id: "features-1",
|
|
50
|
-
type: "
|
|
50
|
+
type: "features",
|
|
51
51
|
template: "default",
|
|
52
52
|
order: 1,
|
|
53
53
|
enabled: true,
|
|
@@ -62,7 +62,7 @@ export const homePageConfig: Omit<
|
|
|
62
62
|
},
|
|
63
63
|
{
|
|
64
64
|
id: "stats-1",
|
|
65
|
-
type: "
|
|
65
|
+
type: "stats",
|
|
66
66
|
template: "default",
|
|
67
67
|
order: 2,
|
|
68
68
|
enabled: true,
|
|
@@ -76,7 +76,7 @@ export const homePageConfig: Omit<
|
|
|
76
76
|
},
|
|
77
77
|
{
|
|
78
78
|
id: "cta-1",
|
|
79
|
-
type: "
|
|
79
|
+
type: "cta",
|
|
80
80
|
template: "default",
|
|
81
81
|
order: 3,
|
|
82
82
|
enabled: true,
|
|
@@ -16,8 +16,6 @@ export const loginPageConfig: Omit<
|
|
|
16
16
|
themeId: "my-simple",
|
|
17
17
|
editable: true,
|
|
18
18
|
published: true,
|
|
19
|
-
hideHeader: true,
|
|
20
|
-
hideFooter: true,
|
|
21
19
|
|
|
22
20
|
seo: {
|
|
23
21
|
title: "Sign In",
|
|
@@ -27,7 +25,7 @@ export const loginPageConfig: Omit<
|
|
|
27
25
|
sections: [
|
|
28
26
|
{
|
|
29
27
|
id: "auth-login-1",
|
|
30
|
-
type: "
|
|
28
|
+
type: "auth-login",
|
|
31
29
|
template: "default",
|
|
32
30
|
order: 0,
|
|
33
31
|
enabled: true,
|
|
@@ -11,7 +11,7 @@ export const profilePageConfig: Omit<
|
|
|
11
11
|
title: "Profile",
|
|
12
12
|
handle: "profile",
|
|
13
13
|
path: "/profile",
|
|
14
|
-
type: "
|
|
14
|
+
type: "profile",
|
|
15
15
|
renderMode: "sections",
|
|
16
16
|
themeId: "my-simple",
|
|
17
17
|
editable: true,
|
|
@@ -25,7 +25,7 @@ export const profilePageConfig: Omit<
|
|
|
25
25
|
sections: [
|
|
26
26
|
{
|
|
27
27
|
id: "profile-1",
|
|
28
|
-
type: "
|
|
28
|
+
type: "profile",
|
|
29
29
|
template: "default",
|
|
30
30
|
order: 0,
|
|
31
31
|
enabled: true,
|
|
@@ -16,8 +16,6 @@ export const registerPageConfig: Omit<
|
|
|
16
16
|
themeId: "my-simple",
|
|
17
17
|
editable: true,
|
|
18
18
|
published: true,
|
|
19
|
-
hideHeader: true,
|
|
20
|
-
hideFooter: true,
|
|
21
19
|
|
|
22
20
|
seo: {
|
|
23
21
|
title: "Create Account",
|
|
@@ -27,7 +25,7 @@ export const registerPageConfig: Omit<
|
|
|
27
25
|
sections: [
|
|
28
26
|
{
|
|
29
27
|
id: "auth-register-1",
|
|
30
|
-
type: "
|
|
28
|
+
type: "auth-register",
|
|
31
29
|
template: "default",
|
|
32
30
|
order: 0,
|
|
33
31
|
enabled: true,
|
|
@@ -27,7 +27,7 @@ export const showcasePageConfig: Omit<
|
|
|
27
27
|
sections: [
|
|
28
28
|
{
|
|
29
29
|
id: "showcase-hero",
|
|
30
|
-
type: "
|
|
30
|
+
type: "hero",
|
|
31
31
|
template: "default",
|
|
32
32
|
order: 0,
|
|
33
33
|
enabled: true,
|
|
@@ -48,7 +48,7 @@ export const showcasePageConfig: Omit<
|
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
50
|
id: "showcase-features",
|
|
51
|
-
type: "
|
|
51
|
+
type: "features",
|
|
52
52
|
template: "default",
|
|
53
53
|
order: 1,
|
|
54
54
|
enabled: true,
|
|
@@ -63,7 +63,7 @@ export const showcasePageConfig: Omit<
|
|
|
63
63
|
},
|
|
64
64
|
{
|
|
65
65
|
id: "showcase-stats",
|
|
66
|
-
type: "
|
|
66
|
+
type: "stats",
|
|
67
67
|
template: "default",
|
|
68
68
|
order: 2,
|
|
69
69
|
enabled: true,
|
|
@@ -77,7 +77,7 @@ export const showcasePageConfig: Omit<
|
|
|
77
77
|
},
|
|
78
78
|
{
|
|
79
79
|
id: "showcase-about",
|
|
80
|
-
type: "
|
|
80
|
+
type: "about",
|
|
81
81
|
template: "default",
|
|
82
82
|
order: 3,
|
|
83
83
|
enabled: true,
|
|
@@ -97,7 +97,7 @@ export const showcasePageConfig: Omit<
|
|
|
97
97
|
},
|
|
98
98
|
{
|
|
99
99
|
id: "showcase-testimonials",
|
|
100
|
-
type: "
|
|
100
|
+
type: "testimonials",
|
|
101
101
|
template: "default",
|
|
102
102
|
order: 4,
|
|
103
103
|
enabled: true,
|
|
@@ -113,7 +113,7 @@ export const showcasePageConfig: Omit<
|
|
|
113
113
|
},
|
|
114
114
|
{
|
|
115
115
|
id: "showcase-gallery",
|
|
116
|
-
type: "
|
|
116
|
+
type: "gallery",
|
|
117
117
|
template: "default",
|
|
118
118
|
order: 5,
|
|
119
119
|
enabled: true,
|
|
@@ -129,7 +129,7 @@ export const showcasePageConfig: Omit<
|
|
|
129
129
|
},
|
|
130
130
|
{
|
|
131
131
|
id: "showcase-cta",
|
|
132
|
-
type: "
|
|
132
|
+
type: "cta",
|
|
133
133
|
template: "default",
|
|
134
134
|
order: 6,
|
|
135
135
|
enabled: true,
|
|
@@ -16,8 +16,6 @@ export const verifyCodePageConfig: Omit<
|
|
|
16
16
|
themeId: "my-simple",
|
|
17
17
|
editable: true,
|
|
18
18
|
published: true,
|
|
19
|
-
hideHeader: true,
|
|
20
|
-
hideFooter: true,
|
|
21
19
|
|
|
22
20
|
seo: {
|
|
23
21
|
title: "Verify Your Account",
|
|
@@ -27,7 +25,7 @@ export const verifyCodePageConfig: Omit<
|
|
|
27
25
|
sections: [
|
|
28
26
|
{
|
|
29
27
|
id: "auth-verify-code-1",
|
|
30
|
-
type: "
|
|
28
|
+
type: "auth-verify-code",
|
|
31
29
|
template: "default",
|
|
32
30
|
order: 0,
|
|
33
31
|
enabled: true,
|
|
@@ -56,7 +56,7 @@ const commonSettings: FieldDefinition[] = [
|
|
|
56
56
|
];
|
|
57
57
|
|
|
58
58
|
export const aboutSchema: SectionSchema = {
|
|
59
|
-
type: "
|
|
59
|
+
type: "about",
|
|
60
60
|
name: "Simple About",
|
|
61
61
|
description:
|
|
62
62
|
"About section with badge, heading, subheading, descriptions, divider, and image",
|
|
@@ -112,7 +112,7 @@ const commonSettings: FieldDefinition[] = [
|
|
|
112
112
|
];
|
|
113
113
|
|
|
114
114
|
export const authForgotPasswordSchema: SectionSchema = {
|
|
115
|
-
type: "
|
|
115
|
+
type: "auth-forgot-password",
|
|
116
116
|
name: "Auth Forgot Password",
|
|
117
117
|
description: "Forgot password form with email/username input",
|
|
118
118
|
category: "auth",
|
|
@@ -130,7 +130,7 @@ const commonSettings: FieldDefinition[] = [
|
|
|
130
130
|
];
|
|
131
131
|
|
|
132
132
|
export const authLoginSchema: SectionSchema = {
|
|
133
|
-
type: "
|
|
133
|
+
type: "auth-login",
|
|
134
134
|
name: "Auth Login",
|
|
135
135
|
description: "Login form with username and password",
|
|
136
136
|
category: "auth",
|
|
@@ -143,7 +143,7 @@ const commonSettings: FieldDefinition[] = [
|
|
|
143
143
|
];
|
|
144
144
|
|
|
145
145
|
export const authRegisterSchema: SectionSchema = {
|
|
146
|
-
type: "
|
|
146
|
+
type: "auth-register",
|
|
147
147
|
name: "Auth Register",
|
|
148
148
|
description: "Registration form with email, username, and password",
|
|
149
149
|
category: "auth",
|
|
@@ -112,7 +112,7 @@ const commonSettings: FieldDefinition[] = [
|
|
|
112
112
|
];
|
|
113
113
|
|
|
114
114
|
export const authVerifyCodeSchema: SectionSchema = {
|
|
115
|
-
type: "
|
|
115
|
+
type: "auth-verify-code",
|
|
116
116
|
name: "Auth Verify Code",
|
|
117
117
|
description: "OTP verification form with 6-digit code input",
|
|
118
118
|
category: "auth",
|
|
@@ -20,7 +20,7 @@ const commonSettings: FieldDefinition[] = [
|
|
|
20
20
|
];
|
|
21
21
|
|
|
22
22
|
export const ctaSchema: SectionSchema = {
|
|
23
|
-
type: "
|
|
23
|
+
type: "cta",
|
|
24
24
|
name: "Simple CTA",
|
|
25
25
|
description:
|
|
26
26
|
"Call-to-action section with badge, heading, text, buttons, and optional image",
|