@povio/ui 5.0.0-rc.7 → 5.0.0-rc.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.
- package/README.md +48 -0
- package/dist/AppCanvasPage--RG31Yyv.js +2421 -0
- package/dist/AppCanvasPage-BIFYeEeS.d.ts +80 -0
- package/dist/{ComponentGallery-Dp0kZVZM.js → ComponentGallery-C6exitZN.js} +1 -1
- package/dist/{Form-BJ12MjE-.d.ts → Form-DbEWnCKc.d.ts} +1 -1
- package/dist/{Inputs-DA73LmLc.d.ts → Inputs-O84btFJL.d.ts} +1 -1
- package/dist/UIConfigurator-BwLRfe-a.js +6704 -0
- package/dist/config/app-canvas-tanstack.d.ts +23 -0
- package/dist/config/app-canvas-tanstack.js +62 -0
- package/dist/config/app-canvas.d.ts +12 -0
- package/dist/config/app-canvas.js +2 -0
- package/dist/config/ui-config.d.ts +1 -1
- package/dist/config/ui-configurator.d.ts +1 -920
- package/dist/config/ui-configurator.js +2 -6430
- package/dist/configuration.context-f_FSPWhQ.d.ts +926 -0
- package/dist/{dynamicInputs-iP39lVKf.d.ts → dynamicInputs-ByVMnx4Z.d.ts} +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/rhf/inputs.d.ts +1 -1
- package/dist/rhf.d.ts +2 -2
- package/dist/styles/app-canvas.css +740 -0
- package/dist/styles/configurator.css +19 -5
- package/dist/tanstack/form.d.ts +1 -1
- package/dist/tanstack/inputs.d.ts +2 -2
- package/dist/tanstack.d.ts +4 -4
- package/package.json +16 -1
- package/dist/token-classes-Bfcx0get.js +0 -163
package/README.md
CHANGED
|
@@ -268,3 +268,51 @@ We're using a helper class for flex, so make sure to add this into your base css
|
|
|
268
268
|
flex: 1 0 0;
|
|
269
269
|
}
|
|
270
270
|
```
|
|
271
|
+
|
|
272
|
+
## App canvas page (`/_canvas`)
|
|
273
|
+
|
|
274
|
+
From RC.9, Povio UI includes a ready-made page for inspecting all your TanStack Router pages. Install `@povio/ui@5.0.0-rc.9` and retain your application's existing `@tanstack/react-router` dependency (an optional peer for this integration).
|
|
275
|
+
|
|
276
|
+
For file-based routing, create `src/routes/[_]canvas.tsx` (or use your configured routes directory). The brackets escape TanStack's pathless-layout underscore convention:
|
|
277
|
+
|
|
278
|
+
```tsx
|
|
279
|
+
import "@povio/ui/app-canvas/styles";
|
|
280
|
+
import { appCanvasRouteOptions } from "@povio/ui/app-canvas/tanstack";
|
|
281
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
282
|
+
|
|
283
|
+
export const Route = createFileRoute("/_canvas")(appCanvasRouteOptions({ enabled: import.meta.env.DEV }));
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
Mount `AppCanvasBridge` once beneath the existing router and `UIConfigurationProvider`, alongside the root `Outlet`. The provider must be shared by the canvas route and the normal application pages; keep its existing theme defaults and persistence. If the app does not yet have this provider, add one using `parseThemeCss` on its theme source.
|
|
287
|
+
|
|
288
|
+
```tsx
|
|
289
|
+
import { isAppCanvasFrame } from "@povio/ui/app-canvas";
|
|
290
|
+
import { AppCanvasBridge, useIsAppCanvasPage } from "@povio/ui/app-canvas/tanstack";
|
|
291
|
+
|
|
292
|
+
// Inside the app's root component, under its UIConfigurationProvider:
|
|
293
|
+
const canvasPage = useIsAppCanvasPage();
|
|
294
|
+
return (
|
|
295
|
+
<>
|
|
296
|
+
<AppCanvasBridge />
|
|
297
|
+
<Outlet />
|
|
298
|
+
{!canvasPage && !isAppCanvasFrame() && <ExistingConfigurationLauncher />}
|
|
299
|
+
</>
|
|
300
|
+
);
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
`ExistingConfigurationLauncher` represents your existing launcher/editor, if any. Do not render a second `UIConfigurationModal` on `/_canvas`: the supplied page includes its own draggable editor. Keep app-specific debug overlays out of canvas frames too.
|
|
304
|
+
|
|
305
|
+
For code-based routing, add the package route to the existing root's children **before** creating the router:
|
|
306
|
+
|
|
307
|
+
```tsx
|
|
308
|
+
import "@povio/ui/app-canvas/styles";
|
|
309
|
+
import { createAppCanvasRoute } from "@povio/ui/app-canvas/tanstack";
|
|
310
|
+
const canvasRoute = createAppCanvasRoute({
|
|
311
|
+
getParentRoute: () => rootRoute,
|
|
312
|
+
enabled: import.meta.env.DEV,
|
|
313
|
+
canvas: { examples: { "/projects/$projectId": { params: { projectId: "example-id" } } } },
|
|
314
|
+
});
|
|
315
|
+
const routeTree = rootRoute.addChildren([homeRoute, projectsRoute, canvasRoute]);
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
Then open `/_canvas` directly. `enabled` accepts a boolean or a synchronous predicate; false produces a not-found route. Apply your existing access policy if enabling it outside development. Normal page authentication and loaders still run inside the frames. The canvas excludes its own pathname, and dynamic pages without example parameters remain explicitly unresolved. The lower-level `AppCanvasPage` and `AppCanvas` components remain available from `@povio/ui/app-canvas` for custom integrations.
|