@mgamadeus/ddd-design-studio 0.4.1 → 0.5.0

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/README.md CHANGED
@@ -116,7 +116,7 @@ Pass one stable object (a module constant) to `DesignStudioProvider`. Entries na
116
116
  | `router.useSearchParamsWriter` | `() => (updates) => void` | replaces search parameters of the current page: no history entry, no scroll jump, other parameters kept, same-tick writes merged; `null` removes one |
117
117
  | `router.useUrlState` | `(keys, { stateId, debounceMs, uncounted }) => { values, debounced, setValue }` | the canvas state (`q`, `section`, `status`, `theme`, `mode`, `vp`) in the URL, restored from what the application remembered under `stateId` when the URL has none of the keys |
118
118
  | `router.useNavigate` (optional) | `() => (href) => void` | client navigation to an in-app path (query allowed, with a history entry); the overview uses it to open a board code; without it the overview shows a link to click |
119
- | `paths` | `overview()`, `project(projectKey)`, `canvas(projectKey, canvasKey)` | in-app paths of the studio's pages |
119
+ | `paths` | `overview()`, `project(projectKey)`, `canvas(projectKey, canvasKey)`, optional `site(projectKey, canvasKey, route)` | in-app paths of the studio's pages |
120
120
  | `components` | `DesignStudioComponents` | UI slots: `Button`, `Badge`, `Card`, `CardHeader`, `CardTitle`, `CardContent`, `Skeleton`, `Checkbox`, `Label`, `Textarea`, `Dialog`, `DialogContent`, `DialogTitle`, `DialogDescription`, `Popover`, `PopoverTrigger`, `PopoverContent`, `Tooltip`, `TooltipTrigger`, `TooltipContent`, `DropdownMenu`, `DropdownMenuTrigger`, `DropdownMenuContent`, `DropdownMenuItem`, `DropdownMenuSeparator`, `Combobox`, `SearchField`, `QuickFilterPills`, `StatusBadge`, `PageHeader`, `StatusCallout`, `CardGrid`, `PageSections` — each typed with only the props the studio passes ([`src/provider/types.ts`](src/provider/types.ts), interface `DesignStudioComponents`) |
121
121
  | `notify` | `success(message)`, `error(message)`, `info(message, { id, action })` | toasts |
122
122
  | `formatDateTime` | `(value) => string` | a backend date-time for the viewer |
@@ -153,6 +153,9 @@ Inside the package, components read it with `useDesignStudio()` or the narrower
153
153
  | `themeWithoutDarkMode` | `This theme has no dark mode` |
154
154
  | `thumbnailMissing` | `No thumbnail yet` |
155
155
  | `thumbnailLoading` | `Loading…` |
156
+ | `sitePageMissing(path)` | `No page for <path>` |
157
+ | `siteExternalLink(href)` | `External link, not followed: <href>` |
158
+ | `openAsWebsite` | `Open as website` |
156
159
  | `referenceNotePlaceholder` | `What should change? (optional, goes into the reference)` |
157
160
  | `boardCodeNotFound(code)` | `No board has the code <code>` |
158
161
  | `boardLinkCopied(code)` | `Link to <code> copied` |
@@ -177,6 +180,7 @@ The package has no router. The application creates one page per screen and tells
177
180
  | overview of the projects | `DesignStudioOverviewScreen` | `overview()` |
178
181
  | one project and its canvases | `DesignStudioProjectScreen` (`projectKey`) | `project(projectKey)` |
179
182
  | one canvas | `DesignStudioCanvasScreen` (`projectKey`, `canvasKey`) from `/canvas` | `canvas(projectKey, canvasKey)` |
183
+ | a canvas as a website (optional) | `DesignStudioSiteScreen` (`projectKey`, `canvasKey`, `route`: the rest of the path, e.g. `/pricing`) | `site(projectKey, canvasKey, route)`; without it the canvas offers no "Open as website" |
180
184
  | reviews (optional; an empty state in this version) | `DesignStudioReviewsScreen` | none: linked by the application's own navigation |
181
185
 
182
186
  The canvas page keeps its state in search parameters: `board` (the focus view), `q`, `section`, `status`, `theme`,
@@ -301,6 +305,7 @@ The package has no router. The application creates one page per screen and tells
301
305
  | overview of the projects | `DesignStudioOverviewScreen` | `overview()` |
302
306
  | one project and its canvases | `DesignStudioProjectScreen` (`projectKey`) | `project(projectKey)` |
303
307
  | one canvas | `DesignStudioCanvasScreen` (`projectKey`, `canvasKey`) from `/canvas` | `canvas(projectKey, canvasKey)` |
308
+ | a canvas as a website (optional) | `DesignStudioSiteScreen` (`projectKey`, `canvasKey`, `route`: the rest of the path, e.g. `/pricing`) | `site(projectKey, canvasKey, route)`; without it the canvas offers no "Open as website" |
304
309
  | reviews (optional; an empty state in this version) | `DesignStudioReviewsScreen` | none: linked by the application's own navigation |
305
310
 
306
311
  The canvas page keeps its state in search parameters: `board` (the focus view), `q`, `section`, `status`, `theme`,
@@ -359,6 +364,9 @@ const ENVIRONMENT: DesignStudioEnvironment = {
359
364
  overview: () => '/design',
360
365
  project: projectKey => `/design/${projectKey}`,
361
366
  canvas: (projectKey, canvasKey) => `/design/${projectKey}/canvases/${canvasKey}`,
367
+ // optional: the site view; the page `/design/[projectKey]/canvases/[canvasKey]/site/[[...route]]` passes
368
+ // `'/' + (route ?? []).join('/')` to DesignStudioSiteScreen
369
+ site: (projectKey, canvasKey, route) => `/design/${projectKey}/canvases/${canvasKey}/site${route === '/' ? '' : route}`,
362
370
  },
363
371
  components: { Button, Badge, Card /* … every slot of DesignStudioComponents */ },
364
372
  notify: { success: toast.success, error: toast.error, info: toast.info },