@spree/docs 0.1.261 → 0.1.263
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.
|
@@ -68,7 +68,7 @@ import { usePermissions } from '@spree/dashboard'
|
|
|
68
68
|
|
|
69
69
|
function AdminOnlyMenuItem() {
|
|
70
70
|
const { permissions } = usePermissions()
|
|
71
|
-
if (!permissions.can('manage', 'Spree::
|
|
71
|
+
if (!permissions.can('manage', 'Spree::Customer')) return null
|
|
72
72
|
return <DropdownMenuItem>…</DropdownMenuItem>
|
|
73
73
|
}
|
|
74
74
|
```
|
|
@@ -229,6 +229,17 @@ import { spreeDashboardPlugin } from '@spree/dashboard/vite' // Vite plugin: Ta
|
|
|
229
229
|
import '@spree/dashboard/styles.css' // the app's CSS entry
|
|
230
230
|
```
|
|
231
231
|
|
|
232
|
+
A host app that builds its own sign-in or onboarding screens, rather than mounting `<Dashboard />`, can reuse the dashboard's building blocks one module at a time without pulling in the app shell:
|
|
233
|
+
|
|
234
|
+
```ts
|
|
235
|
+
import { AuthShell } from '@spree/dashboard/components/spree/auth-shell' // two-column sign-in layout
|
|
236
|
+
import { StoreSetupFields } from '@spree/dashboard/components/spree/store-setup-fields' // store name, country, language, currency
|
|
237
|
+
import { useAuthProviders, authCallbackErrorKey } from '@spree/dashboard/hooks/use-auth-providers' // password + SSO options, SSO error copy
|
|
238
|
+
import { loginFormSchema, resetPasswordFormSchema } from '@spree/dashboard/schemas/auth' // Zod schemas for the auth forms
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
Their translations ship with `@spree/dashboard-core`, so they render translated as soon as its i18n instance is loaded.
|
|
242
|
+
|
|
232
243
|
A few names exist in both re-exported packages — the design system ships a presentational component and the framework wraps it with data (`ResourceCombobox`, `StatusCard`, `Slot`, `DateRange`, `ResourceMultiAutocomplete`). The facade gives you the framework's version, which is the one an application wants. Reach past it when you want the presentational half:
|
|
233
244
|
|
|
234
245
|
```ts
|