@shophost/react 2.0.28 → 2.0.30
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/admin/contexts/admin-auth-context.d.ts +7 -0
- package/admin/contexts/admin-config-context.d.ts +7 -0
- package/admin/contexts/admin-routes-context.d.ts +7 -0
- package/{views/DashboardView.d.ts → admin/dashboard/views/dashboard-view.d.ts} +1 -1
- package/{providers → admin/providers}/admin-provider.d.ts +1 -1
- package/{components/admin/forms → admin/settings/access/components}/access-form.d.ts +1 -1
- package/{components/admin/forms → admin/settings/opening-times/components}/organization-schedule-form.d.ts +1 -1
- package/{components/admin/forms → admin/settings/shipping-method/components}/shipping-method-form.d.ts +1 -1
- package/{components/admin/partials → admin/settings/shipping-method/components}/shipping-methods-list/columns.d.ts +1 -1
- package/admin-client.cjs +1 -1
- package/admin-client.js +2867 -2973
- package/config.d.ts +6 -0
- package/contexts/route-params-context.d.ts +16 -0
- package/index.d.ts +5 -5
- package/index.mjs +2 -2
- package/index.react-server.cjs +1 -1
- package/index.react-server.d.ts +2 -2
- package/index.react-server.mjs +12 -9
- package/next/server.cjs +1 -1
- package/next/server.d.ts +1 -1
- package/next/server.mjs +95 -14
- package/next/views.d.ts +1 -1
- package/package.json +7 -12
- package/react.css +1 -1
- package/storefront.mjs +42 -42
- package/types.d.ts +16 -0
- package/{components/ui/data-table/DataTablePagination.d.ts → ui/data-table/data-table-pagination.d.ts} +1 -1
- package/{components/ui/data-table/DataTable.d.ts → ui/data-table/data-table.d.ts} +1 -1
- package/{components/ui → ui}/input/image-upload-input.d.ts +1 -1
- package/{components/ui → ui}/input-group.d.ts +1 -1
- package/{components/ui → ui}/line-chart.d.ts +1 -1
- package/components/admin/partials/members-list/columns.d.ts +0 -3
- /package/{views/auth → admin/auth/components}/auth-layout.d.ts +0 -0
- /package/{components/admin/forms → admin/auth/components}/sign-in-form.d.ts +0 -0
- /package/{components/admin/forms → admin/auth/components}/sign-up-form.d.ts +0 -0
- /package/{views/auth/SignInView.d.ts → admin/auth/views/sign-in-view.d.ts} +0 -0
- /package/{views/auth/SignUpView.d.ts → admin/auth/views/sign-up-view.d.ts} +0 -0
- /package/{components/ui/navigation/DropdownUserProfile.d.ts → admin/components/navigation/dropdown-user-profile.d.ts} +0 -0
- /package/{components/ui/navigation/MobileSidebar.d.ts → admin/components/navigation/mobile-sidebar.d.ts} +0 -0
- /package/{components/ui/navigation/SidebarWorkspacesDropdown.d.ts → admin/components/navigation/sidebar-workspaces-dropdown.d.ts} +0 -0
- /package/{components/ui/navigation/Sidebar.d.ts → admin/components/navigation/sidebar.d.ts} +0 -0
- /package/{components/ui/navigation/UserProfile.d.ts → admin/components/navigation/user-profile.d.ts} +0 -0
- /package/{components/ui/overview/DashboardCategoryBarCard.d.ts → admin/dashboard/components/overview/dashboard-category-bar-card.d.ts} +0 -0
- /package/{components/ui/overview/DashboardChartCard.d.ts → admin/dashboard/components/overview/dashboard-chart-card.d.ts} +0 -0
- /package/{components/ui/overview/DashboardFilterbar.d.ts → admin/dashboard/components/overview/dashboard-filterbar.d.ts} +0 -0
- /package/{components/ui/overview/DashboardProgressBarCard.d.ts → admin/dashboard/components/overview/dashboard-progress-bar-card.d.ts} +0 -0
- /package/{components/ui → admin/dashboard/components}/overview/dashboard-types.d.ts +0 -0
- /package/{data → admin/data}/data.d.ts +0 -0
- /package/{data → admin/data}/overview-data.d.ts +0 -0
- /package/{data → admin/data}/schema.d.ts +0 -0
- /package/{lib → admin/lib}/auth-redirect.d.ts +0 -0
- /package/{lib → admin/lib}/auth.d.ts +0 -0
- /package/{components/admin/forms → admin/manufacturer/components}/manufacturer-form.d.ts +0 -0
- /package/{components/admin/partials → admin/manufacturer/components}/manufacturers-list/columns.d.ts +0 -0
- /package/{components/admin/partials → admin/manufacturer/components}/manufacturers-list/index.d.ts +0 -0
- /package/{views/manufacturers/ManufacturerCreateView.d.ts → admin/manufacturer/views/manufacturer-create-view.d.ts} +0 -0
- /package/{views/manufacturers/ManufacturerEditView.d.ts → admin/manufacturer/views/manufacturer-edit-view.d.ts} +0 -0
- /package/{views/manufacturers/ManufacturersListView.d.ts → admin/manufacturer/views/manufacturers-list-view.d.ts} +0 -0
- /package/{components/admin/partials → admin/order/components}/orders-list/actions-cell.d.ts +0 -0
- /package/{components/admin/partials → admin/order/components}/orders-list/columns.d.ts +0 -0
- /package/{components/admin/partials → admin/order/components}/orders-list/index.d.ts +0 -0
- /package/{components/admin/partials → admin/order/components}/orders-list/order-details-modal.d.ts +0 -0
- /package/{views/OrdersView.d.ts → admin/order/views/orders-view.d.ts} +0 -0
- /package/{components/admin/forms → admin/organization/components}/organization-form.d.ts +0 -0
- /package/{components/admin/partials → admin/organization/components}/organization-list/index.d.ts +0 -0
- /package/{views/OrganizationsView.d.ts → admin/organization/views/organizations-view.d.ts} +0 -0
- /package/{components/admin/forms → admin/product/components}/product-form/basic-info-section.d.ts +0 -0
- /package/{components/admin/forms → admin/product/components}/product-form/index.d.ts +0 -0
- /package/{components/admin/forms → admin/product/components}/product-form/metadata-section.d.ts +0 -0
- /package/{components/admin/forms → admin/product/components}/product-form/modifier-group-dialog.d.ts +0 -0
- /package/{components/admin/forms → admin/product/components}/product-form/modifiers-list.d.ts +0 -0
- /package/{components/admin/forms → admin/product/components}/product-form/modifiers-section.d.ts +0 -0
- /package/{components/admin/forms → admin/product/components}/product-form/price-section.d.ts +0 -0
- /package/{components/admin/partials → admin/product/components}/products-list/columns.d.ts +0 -0
- /package/{components/admin/partials → admin/product/components}/products-list/index.d.ts +0 -0
- /package/{views/products/ProductCreateView.d.ts → admin/product/views/product-create-view.d.ts} +0 -0
- /package/{views/products/ProductEditView.d.ts → admin/product/views/product-edit-view.d.ts} +0 -0
- /package/{views/products/ProductsListView.d.ts → admin/product/views/products-list-view.d.ts} +0 -0
- /package/{components/admin/partials → admin/product-category/components}/product-categories-list/columns.d.ts +0 -0
- /package/{components/admin/partials → admin/product-category/components}/product-categories-list/index.d.ts +0 -0
- /package/{components/admin/forms/product-category.form.d.ts → admin/product-category/components/product-category-form.d.ts} +0 -0
- /package/{views/product-categories/ProductCategoriesListView.d.ts → admin/product-category/views/product-categories-list-view.d.ts} +0 -0
- /package/{views/product-categories/ProductCategoryCreateView.d.ts → admin/product-category/views/product-category-create-view.d.ts} +0 -0
- /package/{views/product-categories/ProductCategoryEditView.d.ts → admin/product-category/views/product-category-edit-view.d.ts} +0 -0
- /package/{components/admin/partials → admin/reservation/components}/reservations-list/actions-cell.d.ts +0 -0
- /package/{components/admin/partials → admin/reservation/components}/reservations-list/columns.d.ts +0 -0
- /package/{components/admin/partials → admin/reservation/components}/reservations-list/index.d.ts +0 -0
- /package/{components/admin/partials → admin/reservation/components}/reservations-list/reservation-details-modal.d.ts +0 -0
- /package/{views/ReservationsView.d.ts → admin/reservation/views/reservations-view.d.ts} +0 -0
- /package/{router/AdminRouter.d.ts → admin/router/admin-router.d.ts} +0 -0
- /package/{router → admin/router}/resolve.d.ts +0 -0
- /package/{router → admin/router}/routes.d.ts +0 -0
- /package/{components/admin/partials → admin/settings/access/components}/members-list/index.d.ts +0 -0
- /package/{components/admin/partials/members-list/PendingInvitations.d.ts → admin/settings/access/components/members-list/pending-invitations.d.ts} +0 -0
- /package/{views/settings/access/AccessInviteView.d.ts → admin/settings/access/views/access-invite-view.d.ts} +0 -0
- /package/{views/settings/access/AccessListView.d.ts → admin/settings/access/views/access-list-view.d.ts} +0 -0
- /package/{views/settings/access/AccessMemberEditView.d.ts → admin/settings/access/views/access-member-edit-view.d.ts} +0 -0
- /package/{components/ui/settings/ModalAddUser.d.ts → admin/settings/components/modal-add-user.d.ts} +0 -0
- /package/{components/admin/forms → admin/settings/components}/organization-configuration-form.d.ts +0 -0
- /package/{views/settings/OpeningTimesView.d.ts → admin/settings/opening-times/views/opening-times-view.d.ts} +0 -0
- /package/{components/admin/partials → admin/settings/shipping-method/components}/shipping-methods-list/index.d.ts +0 -0
- /package/{views/settings/shipping-methods/ShippingMethodCreateView.d.ts → admin/settings/shipping-method/views/shipping-method-create-view.d.ts} +0 -0
- /package/{views/settings/shipping-methods/ShippingMethodEditView.d.ts → admin/settings/shipping-method/views/shipping-method-edit-view.d.ts} +0 -0
- /package/{views/settings/shipping-methods/ShippingMethodsListView.d.ts → admin/settings/shipping-method/views/shipping-methods-list-view.d.ts} +0 -0
- /package/{views/settings/SettingsLayout.d.ts → admin/settings/views/settings-layout.d.ts} +0 -0
- /package/{views/settings/SettingsView.d.ts → admin/settings/views/settings-view.d.ts} +0 -0
- /package/{views/AdminShell.d.ts → admin/shell/views/admin-shell.d.ts} +0 -0
- /package/{views/ErrorView.d.ts → admin/shell/views/error-view.d.ts} +0 -0
- /package/{components/ui → ui}/badge.d.ts +0 -0
- /package/{components/ui → ui}/button.d.ts +0 -0
- /package/{components/ui → ui}/calendar.d.ts +0 -0
- /package/{components/ui → ui}/card.d.ts +0 -0
- /package/{components/ui → ui}/checkbox.d.ts +0 -0
- /package/{components/ui → ui}/command-bar.d.ts +0 -0
- /package/{components/ui → ui}/command.d.ts +0 -0
- /package/{components/ui/data-table/DataTableBulkEditor.d.ts → ui/data-table/data-table-bulk-editor.d.ts} +0 -0
- /package/{components/ui/data-table/DataTableColumnHeader.d.ts → ui/data-table/data-table-column-header.d.ts} +0 -0
- /package/{components/ui/data-table/DataTableFilter.d.ts → ui/data-table/data-table-filter.d.ts} +0 -0
- /package/{components/ui/data-table/DataTableViewOptions.d.ts → ui/data-table/data-table-view-options.d.ts} +0 -0
- /package/{components/ui → ui}/data-table/tanstack-table.d.ts +0 -0
- /package/{components/ui → ui}/date-picker.d.ts +0 -0
- /package/{components/ui → ui}/dialog.d.ts +0 -0
- /package/{components/ui → ui}/divider.d.ts +0 -0
- /package/{components/ui → ui}/drawer.d.ts +0 -0
- /package/{components/ui → ui}/dropdown.d.ts +0 -0
- /package/{components/ui → ui}/form-generator.d.ts +0 -0
- /package/{components/ui → ui}/header.d.ts +0 -0
- /package/{components/ui/icons/ArrowAnimated.d.ts → ui/icons/arrow-animated.d.ts} +0 -0
- /package/{components/ui → ui}/icons/spinner-icon.d.ts +0 -0
- /package/{components/ui → ui}/input/country-input.d.ts +0 -0
- /package/{components/ui → ui}/input/email-input.d.ts +0 -0
- /package/{components/ui → ui}/input/phone-number-input.d.ts +0 -0
- /package/{components/ui → ui}/input/select-input.d.ts +0 -0
- /package/{components/ui → ui}/input/text-input.d.ts +0 -0
- /package/{components/ui → ui}/input-array-group.d.ts +0 -0
- /package/{components/ui → ui}/input-object-group.d.ts +0 -0
- /package/{components/ui → ui}/input.d.ts +0 -0
- /package/{components/ui → ui}/label.d.ts +0 -0
- /package/{components/ui → ui}/logo.d.ts +0 -0
- /package/{components/ui → ui}/multiple-select.d.ts +0 -0
- /package/{components/ui → ui}/popover.d.ts +0 -0
- /package/{components/ui → ui}/progress-bar.d.ts +0 -0
- /package/{components/ui → ui}/progress-circle.d.ts +0 -0
- /package/{components/ui → ui}/radio-card.d.ts +0 -0
- /package/{components/ui → ui}/search-bar.d.ts +0 -0
- /package/{components/ui → ui}/select.d.ts +0 -0
- /package/{components/ui → ui}/switch.d.ts +0 -0
- /package/{components/ui → ui}/tab-navigation.d.ts +0 -0
- /package/{components/ui → ui}/table.d.ts +0 -0
- /package/{components/ui → ui}/tooltip.d.ts +0 -0
package/config.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type { AdminConfig, ResolvedAdminConfig } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Define and validate an AdminConfig object. Applies default basePath of "/admin".
|
|
4
|
+
* Use this in your host app's config file.
|
|
5
|
+
*/
|
|
6
|
+
export declare function defineConfig(config: import('./types').AdminConfig): import('./types').ResolvedAdminConfig;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface RouteParams {
|
|
3
|
+
organizationId?: string;
|
|
4
|
+
id?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function RouteParamsProvider({ children, organizationId, id, }: {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
organizationId?: string;
|
|
9
|
+
id?: string;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function useRouteParams(): RouteParams;
|
|
12
|
+
/** Returns the current organizationId. Only call this from org-scoped routes. */
|
|
13
|
+
export declare function useOrgId(): string;
|
|
14
|
+
/** Returns the current route entity id. Only call this from edit/detail routes. */
|
|
15
|
+
export declare function useRouteId(): string;
|
|
16
|
+
export {};
|
package/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { defineConfig } from './config';
|
|
2
2
|
export type { AdminConfig, ResolvedAdminConfig } from './types';
|
|
3
|
-
export { AdminProvider } from './providers/admin-provider';
|
|
4
|
-
export { createAdminAuthClient, getAdminAuthClient } from './lib/auth';
|
|
5
|
-
export type { AdminAuthClient } from './lib/auth';
|
|
6
|
-
export { createRoutes } from './router/routes';
|
|
7
|
-
export type { AdminRoutes } from './router/routes';
|
|
3
|
+
export { AdminProvider } from './admin/providers/admin-provider';
|
|
4
|
+
export { createAdminAuthClient, getAdminAuthClient } from './admin/lib/auth';
|
|
5
|
+
export type { AdminAuthClient } from './admin/lib/auth';
|
|
6
|
+
export { createRoutes } from './admin/router/routes';
|
|
7
|
+
export type { AdminRoutes } from './admin/router/routes';
|
package/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as i, c as r, a as o, g as d } from "./admin-client.js";
|
|
2
2
|
function t(e) {
|
|
3
3
|
return {
|
|
4
4
|
basePath: "/admin",
|
|
@@ -6,7 +6,7 @@ function t(e) {
|
|
|
6
6
|
};
|
|
7
7
|
}
|
|
8
8
|
export {
|
|
9
|
-
|
|
9
|
+
i as AdminProvider,
|
|
10
10
|
r as createAdminAuthClient,
|
|
11
11
|
o as createRoutes,
|
|
12
12
|
t as defineConfig,
|
package/index.react-server.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function i
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function r(i){return{basePath:"/admin",...i}}function n(i){const t=i.replace(/\/$/,"");return{home:t,signIn:`${t}/auth/sign-in`,signUp:`${t}/auth/sign-up`,organizations:`${t}/organizations`,dashboard:e=>`${t}/${e}/dashboard`,liveOrders:e=>`${t}/${e}/live-orders`,orders:e=>`${t}/${e}/orders`,reservations:e=>`${t}/${e}/reservations`,products:e=>`${t}/${e}/products`,productCreate:e=>`${t}/${e}/products/create`,productEdit:(e,s)=>`${t}/${e}/products/${s}`,productCategories:e=>`${t}/${e}/product-categories`,productCategoryCreate:e=>`${t}/${e}/product-categories/create`,productCategoryEdit:(e,s)=>`${t}/${e}/product-categories/${s}`,manufacturers:e=>`${t}/${e}/manufacturers`,manufacturerCreate:e=>`${t}/${e}/manufacturers/create`,manufacturerEdit:(e,s)=>`${t}/${e}/manufacturers/${s}`,settings:e=>`${t}/${e}/settings`,settingsOpeningTimes:e=>`${t}/${e}/settings/opening-times`,settingsShippingMethods:e=>`${t}/${e}/settings/shipping-methods`,settingsShippingMethodCreate:e=>`${t}/${e}/settings/shipping-methods/create`,settingsShippingMethodEdit:(e,s)=>`${t}/${e}/settings/shipping-methods/${s}`,settingsAccess:e=>`${t}/${e}/settings/access`,settingsAccessInvite:e=>`${t}/${e}/settings/access/invite`,settingsAccessMemberEdit:(e,s)=>`${t}/${e}/settings/access/${s}`}}exports.createRoutes=n;exports.defineConfig=r;
|
package/index.react-server.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export type { AdminConfig, ResolvedAdminConfig } from './types';
|
|
2
|
-
export type { AdminRoutes } from './router/routes';
|
|
2
|
+
export type { AdminRoutes } from './admin/router/routes';
|
|
3
3
|
/**
|
|
4
4
|
* Define and validate an AdminConfig object. Applies default basePath of "/admin".
|
|
5
5
|
* Use this in your host app's config file.
|
|
6
6
|
*/
|
|
7
7
|
export declare function defineConfig(config: import('./types').AdminConfig): import('./types').ResolvedAdminConfig;
|
|
8
|
-
export declare function createRoutes(basePath: string): import('./router/routes').AdminRoutes;
|
|
8
|
+
export declare function createRoutes(basePath: string): import('./admin/router/routes').AdminRoutes;
|
package/index.react-server.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
function i
|
|
1
|
+
function r(i) {
|
|
2
2
|
return {
|
|
3
3
|
basePath: "/admin",
|
|
4
|
-
...
|
|
4
|
+
...i
|
|
5
5
|
};
|
|
6
6
|
}
|
|
7
|
-
function n(
|
|
8
|
-
const e =
|
|
7
|
+
function n(i) {
|
|
8
|
+
const e = i.replace(/\/$/, "");
|
|
9
9
|
return {
|
|
10
10
|
home: e,
|
|
11
11
|
signIn: `${e}/auth/sign-in`,
|
|
@@ -17,21 +17,24 @@ function n(s) {
|
|
|
17
17
|
reservations: (t) => `${e}/${t}/reservations`,
|
|
18
18
|
products: (t) => `${e}/${t}/products`,
|
|
19
19
|
productCreate: (t) => `${e}/${t}/products/create`,
|
|
20
|
-
productEdit: (t,
|
|
20
|
+
productEdit: (t, s) => `${e}/${t}/products/${s}`,
|
|
21
21
|
productCategories: (t) => `${e}/${t}/product-categories`,
|
|
22
22
|
productCategoryCreate: (t) => `${e}/${t}/product-categories/create`,
|
|
23
|
-
productCategoryEdit: (t,
|
|
23
|
+
productCategoryEdit: (t, s) => `${e}/${t}/product-categories/${s}`,
|
|
24
24
|
manufacturers: (t) => `${e}/${t}/manufacturers`,
|
|
25
25
|
manufacturerCreate: (t) => `${e}/${t}/manufacturers/create`,
|
|
26
|
-
manufacturerEdit: (t,
|
|
26
|
+
manufacturerEdit: (t, s) => `${e}/${t}/manufacturers/${s}`,
|
|
27
27
|
settings: (t) => `${e}/${t}/settings`,
|
|
28
28
|
settingsOpeningTimes: (t) => `${e}/${t}/settings/opening-times`,
|
|
29
29
|
settingsShippingMethods: (t) => `${e}/${t}/settings/shipping-methods`,
|
|
30
30
|
settingsShippingMethodCreate: (t) => `${e}/${t}/settings/shipping-methods/create`,
|
|
31
|
-
settingsShippingMethodEdit: (t,
|
|
31
|
+
settingsShippingMethodEdit: (t, s) => `${e}/${t}/settings/shipping-methods/${s}`,
|
|
32
|
+
settingsAccess: (t) => `${e}/${t}/settings/access`,
|
|
33
|
+
settingsAccessInvite: (t) => `${e}/${t}/settings/access/invite`,
|
|
34
|
+
settingsAccessMemberEdit: (t, s) => `${e}/${t}/settings/access/${s}`
|
|
32
35
|
};
|
|
33
36
|
}
|
|
34
37
|
export {
|
|
35
38
|
n as createRoutes,
|
|
36
|
-
|
|
39
|
+
r as defineConfig
|
|
37
40
|
};
|
package/next/server.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),e=require("../admin-client.cjs"),f=require("next/navigation.js"),w=require("react");function V(s){if(s.length===0)return{type:"home"};const[a,n,i,o,c]=s;if(a==="auth")return n==="sign-in"?{type:"sign-in"}:n==="sign-up"?{type:"sign-up"}:{type:"not-found"};if(a==="organizations")return{type:"organizations"};const r=a;return n?n==="dashboard"?{type:"dashboard",orgId:r}:n==="orders"?{type:"orders",orgId:r}:n==="reservations"?{type:"reservations",orgId:r}:n==="products"?i?i==="create"?{type:"product-create",orgId:r}:{type:"product-edit",orgId:r,id:i}:{type:"products-list",orgId:r}:n==="product-categories"?i?i==="create"?{type:"product-category-create",orgId:r}:{type:"product-category-edit",orgId:r,id:i}:{type:"product-categories-list",orgId:r}:n==="manufacturers"?i?i==="create"?{type:"manufacturer-create",orgId:r}:{type:"manufacturer-edit",orgId:r,id:i}:{type:"manufacturers-list",orgId:r}:n==="settings"?i?i==="opening-times"?{type:"settings-opening-times",orgId:r}:i==="shipping-methods"?o?o==="create"?{type:"shipping-method-create",orgId:r}:{type:"shipping-method-edit",orgId:r,id:o}:{type:"shipping-methods-list",orgId:r}:i==="access"?o?o==="invite"?{type:"access-invite",orgId:r}:{type:"access-member-edit",orgId:r,id:o}:{type:"access-list",orgId:r}:{type:"settings",orgId:r}:{type:"settings",orgId:r}:{type:"not-found"}:{type:"not-found"}}function v({segments:s}){const a=e.useAdminAuth(),n=e.useAdminRoutes(),i=f.useRouter(),o=f.usePathname(),c=f.useSearchParams(),{data:r,isPending:p}=a.useSession(),u=V(s),d=u.type==="sign-in"||u.type==="sign-up",l=u.type==="home"||u.type==="organizations",y=c==null?void 0:c.get("redirect"),h=c==null?void 0:c.toString(),m=o?`${o}${h?`?${h}`:""}`:n.home,g=d?e.resolveAdminRedirectPath(y,n):m;if(w.useEffect(()=>{if(!p){if(!r&&!d){i.replace(e.buildAdminAuthHref(n.signIn,g));return}r&&d&&i.replace(g)}},[r,p,d,i,n.signIn,g]),p)return t.jsx("div",{className:"flex justify-center items-center h-screen",children:t.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600"})});if(d){if(u.type==="sign-in")return t.jsx(e.SignInView,{});if(u.type==="sign-up")return t.jsx(e.SignUpView,{})}if(!r)return null;if(l)return t.jsx(e.OrganizationProvider,{children:t.jsx(e.OrganizationsView,{})});if(u.type==="not-found")return t.jsx(e.ErrorView,{});const j="orgId"in u?u.orgId:void 0,x="id"in u?u.id:void 0;return t.jsx(e.RouteParamsProvider,{organizationId:j,id:x,children:t.jsx(e.OrganizationProvider,{children:t.jsx(e.FlyoutProvider,{children:t.jsx(e.AdminShell,{children:P(u)})})})})}function P(s){switch(s.type){case"dashboard":return t.jsx(e.DashboardView,{});case"orders":return t.jsx(e.OrdersView,{});case"reservations":return t.jsx(e.ReservationsView,{});case"products-list":return t.jsx(e.ProductsListView,{});case"product-create":return t.jsx(e.ProductCreateView,{});case"product-edit":return t.jsx(e.ProductEditView,{});case"product-categories-list":return t.jsx(e.ProductCategoriesListView,{});case"product-category-create":return t.jsx(e.ProductCategoryCreateView,{});case"product-category-edit":return t.jsx(e.ProductCategoryEditView,{});case"manufacturers-list":return t.jsx(e.ManufacturersListView,{});case"manufacturer-create":return t.jsx(e.ManufacturerCreateView,{});case"manufacturer-edit":return t.jsx(e.ManufacturerEditView,{});case"settings":return t.jsx(e.SettingsLayout,{children:t.jsx(e.SettingsView,{})});case"settings-opening-times":return t.jsx(e.SettingsLayout,{children:t.jsx(e.OpeningTimesView,{})});case"shipping-methods-list":return t.jsx(e.SettingsLayout,{children:t.jsx(e.ShippingMethodsListView,{})});case"shipping-method-create":return t.jsx(e.SettingsLayout,{children:t.jsx(e.ShippingMethodCreateView,{})});case"shipping-method-edit":return t.jsx(e.SettingsLayout,{children:t.jsx(e.ShippingMethodEditView,{})});case"access-list":return t.jsx(e.SettingsLayout,{children:t.jsx(e.AccessListView,{})});case"access-invite":return t.jsx(e.SettingsLayout,{children:t.jsx(e.AccessInviteView,{})});case"access-member-edit":return t.jsx(e.SettingsLayout,{children:t.jsx(e.AccessMemberEditView,{})});default:return t.jsx(e.ErrorView,{})}}async function S({config:s,params:a}){const{segments:n=[]}=await a;return t.jsx(e.AdminProvider,{config:s,children:t.jsx(v,{segments:n})})}function b(s,a){var i;return{title:(i=s.branding)!=null&&i.name?`${s.branding.name} Admin`:"Admin",robots:{index:!1,follow:!1},...s.metadata,...a}}exports.NotFoundPage=e.ErrorView;exports.RootPage=S;exports.generatePageMetadata=b;
|
package/next/server.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ export declare function RootPage({ config, params }: RootPageProps): Promise<imp
|
|
|
25
25
|
* import { NotFoundPage } from "@shophost/react/next/server";
|
|
26
26
|
* export default NotFoundPage;
|
|
27
27
|
*/
|
|
28
|
-
export { ErrorView as NotFoundPage } from '../views/
|
|
28
|
+
export { ErrorView as NotFoundPage } from '../admin/shell/views/error-view';
|
|
29
29
|
/**
|
|
30
30
|
* Generate page metadata from AdminConfig.
|
|
31
31
|
*
|
package/next/server.mjs
CHANGED
|
@@ -1,21 +1,102 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { u as P, b, r as A, d as S, S as R, e as C, O as h, f as I, E as l, R as M, F as z, h as E, i as o, j as O, k as L, l as x, m as $, n as j, o as F, p as N, q as T, M as q, s as D, t as H, P as k, v as B, w as U, x as G, y as J, z as K, B as Q, C as W, D as X, A as Y } from "../admin-client.js";
|
|
3
|
+
import { useRouter as Z, usePathname as _, useSearchParams as ee } from "next/navigation.js";
|
|
4
|
+
import { useEffect as te } from "react";
|
|
5
|
+
function re(n) {
|
|
6
|
+
if (n.length === 0) return { type: "home" };
|
|
7
|
+
const [a, i, r, u, c] = n;
|
|
8
|
+
if (a === "auth")
|
|
9
|
+
return i === "sign-in" ? { type: "sign-in" } : i === "sign-up" ? { type: "sign-up" } : { type: "not-found" };
|
|
10
|
+
if (a === "organizations") return { type: "organizations" };
|
|
11
|
+
const t = a;
|
|
12
|
+
return i ? i === "dashboard" ? { type: "dashboard", orgId: t } : i === "orders" ? { type: "orders", orgId: t } : i === "reservations" ? { type: "reservations", orgId: t } : i === "products" ? r ? r === "create" ? { type: "product-create", orgId: t } : { type: "product-edit", orgId: t, id: r } : { type: "products-list", orgId: t } : i === "product-categories" ? r ? r === "create" ? { type: "product-category-create", orgId: t } : { type: "product-category-edit", orgId: t, id: r } : { type: "product-categories-list", orgId: t } : i === "manufacturers" ? r ? r === "create" ? { type: "manufacturer-create", orgId: t } : { type: "manufacturer-edit", orgId: t, id: r } : { type: "manufacturers-list", orgId: t } : i === "settings" ? r ? r === "opening-times" ? { type: "settings-opening-times", orgId: t } : r === "shipping-methods" ? u ? u === "create" ? { type: "shipping-method-create", orgId: t } : { type: "shipping-method-edit", orgId: t, id: u } : { type: "shipping-methods-list", orgId: t } : r === "access" ? u ? u === "invite" ? { type: "access-invite", orgId: t } : { type: "access-member-edit", orgId: t, id: u } : { type: "access-list", orgId: t } : { type: "settings", orgId: t } : { type: "settings", orgId: t } : { type: "not-found" } : { type: "not-found" };
|
|
7
13
|
}
|
|
8
|
-
function
|
|
9
|
-
|
|
14
|
+
function ie({ segments: n }) {
|
|
15
|
+
const a = P(), i = b(), r = Z(), u = _(), c = ee(), { data: t, isPending: p } = a.useSession(), s = re(n), d = s.type === "sign-in" || s.type === "sign-up", m = s.type === "home" || s.type === "organizations", y = c == null ? void 0 : c.get("redirect"), g = c == null ? void 0 : c.toString(), w = u ? `${u}${g ? `?${g}` : ""}` : i.home, f = d ? A(y, i) : w;
|
|
16
|
+
if (te(() => {
|
|
17
|
+
if (!p) {
|
|
18
|
+
if (!t && !d) {
|
|
19
|
+
r.replace(S(i.signIn, f));
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
t && d && r.replace(f);
|
|
23
|
+
}
|
|
24
|
+
}, [t, p, d, r, i.signIn, f]), p)
|
|
25
|
+
return /* @__PURE__ */ e("div", { className: "flex justify-center items-center h-screen", children: /* @__PURE__ */ e("div", { className: "animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600" }) });
|
|
26
|
+
if (d) {
|
|
27
|
+
if (s.type === "sign-in") return /* @__PURE__ */ e(R, {});
|
|
28
|
+
if (s.type === "sign-up") return /* @__PURE__ */ e(C, {});
|
|
29
|
+
}
|
|
30
|
+
if (!t)
|
|
31
|
+
return null;
|
|
32
|
+
if (m)
|
|
33
|
+
return /* @__PURE__ */ e(h, { children: /* @__PURE__ */ e(I, {}) });
|
|
34
|
+
if (s.type === "not-found")
|
|
35
|
+
return /* @__PURE__ */ e(l, {});
|
|
36
|
+
const V = "orgId" in s ? s.orgId : void 0, v = "id" in s ? s.id : void 0;
|
|
37
|
+
return /* @__PURE__ */ e(M, { organizationId: V, id: v, children: /* @__PURE__ */ e(h, { children: /* @__PURE__ */ e(z, { children: /* @__PURE__ */ e(E, { children: ne(s) }) }) }) });
|
|
38
|
+
}
|
|
39
|
+
function ne(n) {
|
|
40
|
+
switch (n.type) {
|
|
41
|
+
case "dashboard":
|
|
42
|
+
return /* @__PURE__ */ e(X, {});
|
|
43
|
+
case "orders":
|
|
44
|
+
return /* @__PURE__ */ e(W, {});
|
|
45
|
+
case "reservations":
|
|
46
|
+
return /* @__PURE__ */ e(Q, {});
|
|
47
|
+
case "products-list":
|
|
48
|
+
return /* @__PURE__ */ e(K, {});
|
|
49
|
+
case "product-create":
|
|
50
|
+
return /* @__PURE__ */ e(J, {});
|
|
51
|
+
case "product-edit":
|
|
52
|
+
return /* @__PURE__ */ e(G, {});
|
|
53
|
+
case "product-categories-list":
|
|
54
|
+
return /* @__PURE__ */ e(U, {});
|
|
55
|
+
case "product-category-create":
|
|
56
|
+
return /* @__PURE__ */ e(B, {});
|
|
57
|
+
case "product-category-edit":
|
|
58
|
+
return /* @__PURE__ */ e(k, {});
|
|
59
|
+
case "manufacturers-list":
|
|
60
|
+
return /* @__PURE__ */ e(H, {});
|
|
61
|
+
case "manufacturer-create":
|
|
62
|
+
return /* @__PURE__ */ e(D, {});
|
|
63
|
+
case "manufacturer-edit":
|
|
64
|
+
return /* @__PURE__ */ e(q, {});
|
|
65
|
+
case "settings":
|
|
66
|
+
return /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(T, {}) });
|
|
67
|
+
case "settings-opening-times":
|
|
68
|
+
return /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(N, {}) });
|
|
69
|
+
case "shipping-methods-list":
|
|
70
|
+
return /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(F, {}) });
|
|
71
|
+
case "shipping-method-create":
|
|
72
|
+
return /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(j, {}) });
|
|
73
|
+
case "shipping-method-edit":
|
|
74
|
+
return /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e($, {}) });
|
|
75
|
+
case "access-list":
|
|
76
|
+
return /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(x, {}) });
|
|
77
|
+
case "access-invite":
|
|
78
|
+
return /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(L, {}) });
|
|
79
|
+
case "access-member-edit":
|
|
80
|
+
return /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(O, {}) });
|
|
81
|
+
default:
|
|
82
|
+
return /* @__PURE__ */ e(l, {});
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
async function ce({ config: n, params: a }) {
|
|
86
|
+
const { segments: i = [] } = await a;
|
|
87
|
+
return /* @__PURE__ */ e(Y, { config: n, children: /* @__PURE__ */ e(ie, { segments: i }) });
|
|
88
|
+
}
|
|
89
|
+
function de(n, a) {
|
|
90
|
+
var r;
|
|
10
91
|
return {
|
|
11
|
-
title: (
|
|
92
|
+
title: (r = n.branding) != null && r.name ? `${n.branding.name} Admin` : "Admin",
|
|
12
93
|
robots: { index: !1, follow: !1 },
|
|
13
|
-
...
|
|
14
|
-
...
|
|
94
|
+
...n.metadata,
|
|
95
|
+
...a
|
|
15
96
|
};
|
|
16
97
|
}
|
|
17
98
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
99
|
+
l as NotFoundPage,
|
|
100
|
+
ce as RootPage,
|
|
101
|
+
de as generatePageMetadata
|
|
21
102
|
};
|
package/next/views.d.ts
CHANGED
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* This entry is kept for backward compatibility. The server-safe exports
|
|
5
5
|
* (RootPage, generatePageMetadata) have moved to "@shophost/react/next/server".
|
|
6
6
|
*/
|
|
7
|
-
export { ErrorView as NotFoundPage } from '../views/
|
|
7
|
+
export { ErrorView as NotFoundPage } from '../admin/shell/views/error-view';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shophost/react",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.30",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.cjs",
|
|
6
6
|
"module": "./index.mjs",
|
|
@@ -31,21 +31,16 @@
|
|
|
31
31
|
},
|
|
32
32
|
"license": "UNLICENSED",
|
|
33
33
|
"files": [
|
|
34
|
-
"
|
|
34
|
+
"admin",
|
|
35
35
|
"config",
|
|
36
|
-
"
|
|
36
|
+
"contexts",
|
|
37
37
|
"lib",
|
|
38
38
|
"next",
|
|
39
39
|
"providers",
|
|
40
|
-
"router",
|
|
41
40
|
"storefront",
|
|
41
|
+
"ui",
|
|
42
42
|
"utils",
|
|
43
|
-
"
|
|
44
|
-
"index.d.ts",
|
|
45
|
-
"index.react-server.d.ts",
|
|
46
|
-
"index.mjs",
|
|
47
|
-
"index.react-server.mjs",
|
|
48
|
-
"index.cjs",
|
|
43
|
+
"*.d.ts",
|
|
49
44
|
"*.mjs",
|
|
50
45
|
"*.js",
|
|
51
46
|
"*.cjs",
|
|
@@ -71,8 +66,8 @@
|
|
|
71
66
|
"@hookform/resolvers": "^3.9.0",
|
|
72
67
|
"@react-aria/datepicker": "^3.16.1",
|
|
73
68
|
"@react-stately/datepicker": "^3.16.1",
|
|
74
|
-
"@shophost/client": "^2.0.
|
|
75
|
-
"@shophost/rest-api": "^2.0.
|
|
69
|
+
"@shophost/client": "^2.0.30",
|
|
70
|
+
"@shophost/rest-api": "^2.0.30",
|
|
76
71
|
"@internationalized/date": "^3.12.0",
|
|
77
72
|
"@radix-ui/react-checkbox": "^1.3.3",
|
|
78
73
|
"@radix-ui/react-dialog": "^1.1.6",
|