@povio/ui 5.0.0-rc.10 → 5.0.0-rc.11

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.
@@ -64,9 +64,11 @@ interface AppCanvasProps {
64
64
  breakpoints?: CanvasBreakpoint[];
65
65
  storageKey?: string;
66
66
  frameUrl?: (page: CanvasPage) => string;
67
+ /** URL of a frame that renders one component gallery section; enables the Components artboards. */
68
+ componentsHref?: (group: string) => string;
67
69
  }
68
70
  /** Live route artboards. The camera transforms only the canvas, never the iframe viewport width. */
69
- declare function AppCanvas({ router, examples, exclude, excludePaths, breakpoints, storageKey, frameUrl }: AppCanvasProps): import("react").JSX.Element;
71
+ declare function AppCanvas({ router, examples, exclude, excludePaths, breakpoints, storageKey, frameUrl, componentsHref }: AppCanvasProps): import("react").JSX.Element;
70
72
  //#endregion
71
73
  //#region src/app-canvas/AppCanvasPage.d.ts
72
74
  declare const APP_CANVAS_PATH = "/_canvas";
@@ -1,11 +1,13 @@
1
1
  import { t as createLucideIcon } from "./createLucideIcon-LcezOE4z.js";
2
- import { a as getBoxHighlights, d as Pin, f as Moon, l as useUIConfiguration, o as HighlightOverlay, r as inspectElement, s as InspectorDetails, t as UIConfigurationModal, u as Sun } from "./UIConfigurator-CTlq-hrG.js";
2
+ import { a as getBoxHighlights, d as Pin, f as Moon, l as useUIConfiguration, o as HighlightOverlay, r as inspectElement, s as InspectorDetails, t as UIConfigurationModal, u as Sun } from "./UIConfigurator-C_2kgJtm.js";
3
3
  import { t as ChevronDown } from "./chevron-down-B4Pr8bD3.js";
4
4
  import { t as ChevronRight } from "./chevron-right-3nKJR5Bb.js";
5
5
  import { i as Search } from "./selectDesktop.cva-CHAMxhfO.js";
6
6
  import { t as Upload } from "./upload-CXU83BJ4.js";
7
7
  import { t as X } from "./x-B6vfz8Ps.js";
8
- import { memo, useCallback, useEffect, useMemo, useReducer, useRef, useState } from "react";
8
+ import { c as isEditableToken } from "./theme-model-DtTsIxou.js";
9
+ import { t as componentArtboards } from "./groups-oQmSeqXn.js";
10
+ import { Suspense, lazy, memo, useCallback, useEffect, useMemo, useReducer, useRef, useState } from "react";
9
11
  import { c } from "react/compiler-runtime";
10
12
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
11
13
  //#region ../../node_modules/.bun/lucide-react@1.43.0+83d5fd7b249dbeef/node_modules/lucide-react/dist/esm/icons/code-xml.mjs
@@ -542,10 +544,8 @@ function PageLayers({ frame, title, selected, onSelect }) {
542
544
  }
543
545
  //#endregion
544
546
  //#region src/app-canvas/CanvasInspector.tsx
545
- const unknownToken = () => false;
546
- const readOnly = () => {};
547
547
  /** Inspect the live iframe DOM using its own, unscaled viewport coordinates. */
548
- function useCanvasInspector(enabled, generation) {
548
+ function useCanvasInspector(enabled, generation, isKnown) {
549
549
  const [selection, setSelection] = useState(null);
550
550
  const [measurement, setMeasurement] = useState(null);
551
551
  const [pinned, setPinned] = useState(false);
@@ -632,7 +632,7 @@ function useCanvasInspector(enabled, generation) {
632
632
  return;
633
633
  }
634
634
  const rect = element_0.getBoundingClientRect();
635
- const snapshot = inspectElement(element_0, unknownToken);
635
+ const snapshot = inspectElement(element_0, isKnown);
636
636
  const details = highlightKey ? getBoxHighlights(element_0, highlightKey) : null;
637
637
  const spacing = highlightKey ? [] : [
638
638
  "padding.top",
@@ -726,7 +726,8 @@ function useCanvasInspector(enabled, generation) {
726
726
  enabled,
727
727
  selection,
728
728
  highlightKey,
729
- clear
729
+ clear,
730
+ isKnown
730
731
  ]);
731
732
  return {
732
733
  selection,
@@ -748,8 +749,8 @@ function useCanvasInspector(enabled, generation) {
748
749
  };
749
750
  }
750
751
  function CanvasInspectorPanel(t0) {
751
- const $ = c(21);
752
- const { inspector, onClose } = t0;
752
+ const $ = c(22);
753
+ const { inspector, onClose, onSelectToken } = t0;
753
754
  let t1;
754
755
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
755
756
  t1 = /* @__PURE__ */ jsx("strong", { children: "Inspector view" });
@@ -812,10 +813,10 @@ function CanvasInspectorPanel(t0) {
812
813
  $[13] = t9;
813
814
  } else t9 = $[13];
814
815
  let t10;
815
- if ($[14] !== inspector.highlight || $[15] !== inspector.measurement) {
816
+ if ($[14] !== inspector.highlight || $[15] !== inspector.measurement || $[16] !== onSelectToken) {
816
817
  t10 = inspector.measurement ? /* @__PURE__ */ jsx(InspectorDetails, {
817
818
  snapshot: inspector.measurement.snapshot,
818
- onSelect: readOnly,
819
+ onSelect: onSelectToken,
819
820
  onHighlight: inspector.highlight
820
821
  }) : /* @__PURE__ */ jsx("p", {
821
822
  className: "povio-canvas-inspect-hint",
@@ -823,10 +824,11 @@ function CanvasInspectorPanel(t0) {
823
824
  });
824
825
  $[14] = inspector.highlight;
825
826
  $[15] = inspector.measurement;
826
- $[16] = t10;
827
- } else t10 = $[16];
827
+ $[16] = onSelectToken;
828
+ $[17] = t10;
829
+ } else t10 = $[17];
828
830
  let t11;
829
- if ($[17] !== t10 || $[18] !== t7 || $[19] !== t9) {
831
+ if ($[18] !== t10 || $[19] !== t7 || $[20] !== t9) {
830
832
  t11 = /* @__PURE__ */ jsxs("aside", {
831
833
  className: "studio-inspector-panel povio-canvas-inspector",
832
834
  "aria-label": "Inspector view",
@@ -836,11 +838,11 @@ function CanvasInspectorPanel(t0) {
836
838
  t10
837
839
  ]
838
840
  });
839
- $[17] = t10;
840
- $[18] = t7;
841
- $[19] = t9;
842
- $[20] = t11;
843
- } else t11 = $[20];
841
+ $[18] = t10;
842
+ $[19] = t7;
843
+ $[20] = t9;
844
+ $[21] = t11;
845
+ } else t11 = $[21];
844
846
  return t11;
845
847
  }
846
848
  function CanvasInspectionOverlay(t0) {
@@ -1155,6 +1157,9 @@ const defaultCanvasBreakpoints = [
1155
1157
  ];
1156
1158
  const emptyExamples = {};
1157
1159
  const emptyExclude = [];
1160
+ /** Zoom per wheel pixel, and the largest delta one wheel event may contribute. */
1161
+ const ZOOM_SENSITIVITY = .006;
1162
+ const ZOOM_DELTA_LIMIT = 40;
1158
1163
  function readManifest(key) {
1159
1164
  if (typeof window === "undefined") return createCanvasManifest();
1160
1165
  try {
@@ -1211,7 +1216,7 @@ const PageFrame = memo(function PageFrame(t0) {
1211
1216
  return t6;
1212
1217
  });
1213
1218
  /** Live route artboards. The camera transforms only the canvas, never the iframe viewport width. */
1214
- function AppCanvas({ router, examples = emptyExamples, exclude = emptyExclude, excludePaths = emptyExclude, breakpoints = defaultCanvasBreakpoints, storageKey = "povio-app-canvas", frameUrl }) {
1219
+ function AppCanvas({ router, examples = emptyExamples, exclude = emptyExclude, excludePaths = emptyExclude, breakpoints = defaultCanvasBreakpoints, storageKey = "povio-app-canvas", frameUrl, componentsHref }) {
1215
1220
  const configuration = useUIConfiguration();
1216
1221
  const [manifest, setManifest] = useState(() => readManifest(storageKey));
1217
1222
  const [runtime, setRuntime] = useState({});
@@ -1219,6 +1224,8 @@ function AppCanvas({ router, examples = emptyExamples, exclude = emptyExclude, e
1219
1224
  const [interact, setInteract] = useState(false);
1220
1225
  const [inspectMode, setInspectMode] = useState(false);
1221
1226
  const [dark, setDark] = useState(false);
1227
+ /** The canvas shows either the app's pages or the component gallery's sections, as artboards either way. */
1228
+ const [content, setContent] = useState("pages");
1222
1229
  const [mobilePanel, setMobilePanel] = useState(null);
1223
1230
  const [query, setQuery] = useState("");
1224
1231
  const [notice, setNotice] = useState("");
@@ -1237,8 +1244,11 @@ function AppCanvas({ router, examples = emptyExamples, exclude = emptyExclude, e
1237
1244
  const pointer = useRef(null);
1238
1245
  const cameraRevision = useRef(0);
1239
1246
  const bp = breakpoints.find((item) => item.id === manifest.breakpoint) ?? breakpoints[breakpoints.length - 1] ?? defaultCanvasBreakpoints[2];
1240
- const inspector = useCanvasInspector(inspectMode, `${bp.id}:${documentGeneration}:${JSON.stringify(reload)}`);
1241
- const catalog = useMemo(() => discoverCanvasPages(router, {
1247
+ const isKnownToken = useCallback((name) => isEditableToken(name, configuration.defaults), [configuration.defaults]);
1248
+ const { hostComponents } = configuration;
1249
+ useEffect(() => hostComponents(), [hostComponents]);
1250
+ const inspector = useCanvasInspector(inspectMode, `${content}:${bp.id}:${documentGeneration}:${JSON.stringify(reload)}`, isKnownToken);
1251
+ const pageCatalog = useMemo(() => discoverCanvasPages(router, {
1242
1252
  examples: {
1243
1253
  ...examples,
1244
1254
  ...manifest.examples
@@ -1252,6 +1262,15 @@ function AppCanvas({ router, examples = emptyExamples, exclude = emptyExclude, e
1252
1262
  exclude,
1253
1263
  excludePaths
1254
1264
  ]);
1265
+ const componentCatalog = useMemo(() => componentsHref ? componentArtboards.map((group) => ({
1266
+ id: `components:${group.toLowerCase()}`,
1267
+ title: group,
1268
+ path: group,
1269
+ href: componentsHref(group),
1270
+ missingParams: [],
1271
+ kind: "page"
1272
+ })) : [], [componentsHref]);
1273
+ const catalog = content === "components" && componentCatalog.length ? componentCatalog : pageCatalog;
1255
1274
  const startupKeys = useMemo(() => new Map(catalog.filter((page) => page.href).map((page_0) => [page_0.id, `${documentGeneration}:${bp.id}:${page_0.id}:${page_0.href}:${reload[page_0.id] ?? 0}`])), [
1256
1275
  catalog,
1257
1276
  documentGeneration,
@@ -1300,7 +1319,11 @@ function AppCanvas({ router, examples = emptyExamples, exclude = emptyExclude, e
1300
1319
  else frames.current.delete(id);
1301
1320
  }, []);
1302
1321
  const paint = useCallback(() => {
1303
- if (world.current) world.current.style.transform = `translate3d(${camera.current.x}px,${camera.current.y}px,0) scale(${camera.current.zoom})`;
1322
+ if (world.current) {
1323
+ world.current.style.transform = `translate3d(${camera.current.x}px,${camera.current.y}px,0) scale(${camera.current.zoom})`;
1324
+ const zoom = String(camera.current.zoom);
1325
+ if (world.current.style.getPropertyValue("--canvas-zoom") !== zoom) world.current.style.setProperty("--canvas-zoom", zoom);
1326
+ }
1304
1327
  if (zoomOutput.current) zoomOutput.current.textContent = `${Math.round(camera.current.zoom * 1e3) / 10}%`;
1305
1328
  const canvas = viewport.current?.closest(".povio-app-canvas");
1306
1329
  if (canvas) canvas.setAttribute("data-camera-revision", String(++cameraRevision.current));
@@ -1447,7 +1470,8 @@ function AppCanvas({ router, examples = emptyExamples, exclude = emptyExclude, e
1447
1470
  const x = event_0.clientX - box.left, y = event_0.clientY - box.top;
1448
1471
  const previous_0 = camera.current.zoom;
1449
1472
  const unit = event_0.deltaMode === 1 ? 16 : event_0.deltaMode === 2 ? element.clientHeight : 1;
1450
- const next_0 = Math.max(.005, Math.min(2, previous_0 * Math.exp(-event_0.deltaY * unit * .01)));
1473
+ const delta = Math.max(-40, Math.min(ZOOM_DELTA_LIMIT, event_0.deltaY * unit));
1474
+ const next_0 = Math.max(.005, Math.min(2, previous_0 * Math.exp(-delta * ZOOM_SENSITIVITY)));
1451
1475
  camera.current.x = x - (x - camera.current.x) * next_0 / previous_0;
1452
1476
  camera.current.y = y - (y - camera.current.y) * next_0 / previous_0;
1453
1477
  camera.current.zoom = next_0;
@@ -1457,9 +1481,14 @@ function AppCanvas({ router, examples = emptyExamples, exclude = emptyExclude, e
1457
1481
  }
1458
1482
  schedulePaint();
1459
1483
  };
1484
+ const unscroll = () => {
1485
+ if (element.scrollTop || element.scrollLeft) element.scrollTo(0, 0);
1486
+ };
1460
1487
  element.addEventListener("wheel", wheel, { passive: false });
1488
+ element.addEventListener("scroll", unscroll);
1461
1489
  return () => {
1462
1490
  element.removeEventListener("wheel", wheel);
1491
+ element.removeEventListener("scroll", unscroll);
1463
1492
  if (pendingCamera.current !== null) cancelAnimationFrame(pendingCamera.current);
1464
1493
  pendingCamera.current = null;
1465
1494
  };
@@ -1473,13 +1502,22 @@ function AppCanvas({ router, examples = emptyExamples, exclude = emptyExclude, e
1473
1502
  camera.current.y = 40 - top * camera.current.zoom;
1474
1503
  paint();
1475
1504
  };
1505
+ const fitRef = useRef(fit);
1506
+ fitRef.current = fit;
1507
+ const switchContent = (next_1) => {
1508
+ if (next_1 === content) return;
1509
+ setContent(next_1);
1510
+ setSelected(null);
1511
+ setQuery("");
1512
+ requestAnimationFrame(() => fitRef.current());
1513
+ };
1476
1514
  const zoomTo = (value) => {
1477
1515
  const view_0 = viewport.current;
1478
1516
  if (!view_0) return;
1479
- const previous_1 = camera.current.zoom, next_1 = Math.max(.005, Math.min(2, value));
1480
- camera.current.x = view_0.clientWidth / 2 - (view_0.clientWidth / 2 - camera.current.x) * next_1 / previous_1;
1481
- camera.current.y = view_0.clientHeight / 2 - (view_0.clientHeight / 2 - camera.current.y) * next_1 / previous_1;
1482
- camera.current.zoom = next_1;
1517
+ const previous_1 = camera.current.zoom, next_2 = Math.max(.005, Math.min(2, value));
1518
+ camera.current.x = view_0.clientWidth / 2 - (view_0.clientWidth / 2 - camera.current.x) * next_2 / previous_1;
1519
+ camera.current.y = view_0.clientHeight / 2 - (view_0.clientHeight / 2 - camera.current.y) * next_2 / previous_1;
1520
+ camera.current.zoom = next_2;
1483
1521
  paint();
1484
1522
  };
1485
1523
  const stepZoom = (direction) => {
@@ -1497,8 +1535,8 @@ function AppCanvas({ router, examples = emptyExamples, exclude = emptyExclude, e
1497
1535
  2
1498
1536
  ];
1499
1537
  const current_1 = camera.current.zoom;
1500
- const next_2 = direction === 1 ? stops.find((value_0) => value_0 > current_1 + 1e-4) : [...stops].reverse().find((value_1) => value_1 < current_1 - 1e-4);
1501
- if (next_2 !== void 0) zoomTo(next_2);
1538
+ const next_3 = direction === 1 ? stops.find((value_0) => value_0 > current_1 + 1e-4) : [...stops].reverse().find((value_1) => value_1 < current_1 - 1e-4);
1539
+ if (next_3 !== void 0) zoomTo(next_3);
1502
1540
  };
1503
1541
  const startPan = (event_1) => {
1504
1542
  if (inspectMode && event_1.target.closest(".povio-canvas-frame-cover")) return;
@@ -1558,15 +1596,15 @@ function AppCanvas({ router, examples = emptyExamples, exclude = emptyExclude, e
1558
1596
  }, [send]);
1559
1597
  useEffect(() => {
1560
1598
  const timer = setTimeout(() => setRuntime((current_4) => {
1561
- const next_3 = { ...current_4 };
1599
+ const next_4 = { ...current_4 };
1562
1600
  for (const page_3 of latest.current.catalog) {
1563
1601
  const key_1 = `${latest.current.bp.id}:${page_3.id}:${page_3.href ?? ""}`;
1564
- if (page_3.href && frames.current.has(page_3.id) && !next_3[key_1]?.ready) next_3[key_1] = {
1565
- ...next_3[key_1],
1602
+ if (page_3.href && frames.current.has(page_3.id) && !next_4[key_1]?.ready) next_4[key_1] = {
1603
+ ...next_4[key_1],
1566
1604
  timedOut: true
1567
1605
  };
1568
1606
  }
1569
- return next_3;
1607
+ return next_4;
1570
1608
  }), 15e3);
1571
1609
  return () => clearTimeout(timer);
1572
1610
  }, [
@@ -1624,10 +1662,23 @@ function AppCanvas({ router, examples = emptyExamples, exclude = emptyExclude, e
1624
1662
  "aria-label": "Page catalog",
1625
1663
  children: [
1626
1664
  /* @__PURE__ */ jsxs("div", {
1627
- className: "povio-canvas-brand",
1628
- children: [/* @__PURE__ */ jsx("strong", { children: "Pages" }), /* @__PURE__ */ jsx("span", {
1629
- className: "povio-canvas-page-count",
1630
- children: nodes.length
1665
+ className: "povio-canvas-brand povio-canvas-content-switch",
1666
+ role: "group",
1667
+ "aria-label": "Canvas content",
1668
+ children: [/* @__PURE__ */ jsxs("button", {
1669
+ "aria-pressed": content === "pages",
1670
+ onClick: () => switchContent("pages"),
1671
+ children: ["Pages", /* @__PURE__ */ jsx("span", {
1672
+ className: "povio-canvas-page-count",
1673
+ children: pageCatalog.length
1674
+ })]
1675
+ }), !!componentCatalog.length && /* @__PURE__ */ jsxs("button", {
1676
+ "aria-pressed": content === "components",
1677
+ onClick: () => switchContent("components"),
1678
+ children: ["Components", /* @__PURE__ */ jsx("span", {
1679
+ className: "povio-canvas-page-count",
1680
+ children: componentCatalog.length
1681
+ })]
1631
1682
  })]
1632
1683
  }),
1633
1684
  /* @__PURE__ */ jsxs("div", {
@@ -1635,8 +1686,8 @@ function AppCanvas({ router, examples = emptyExamples, exclude = emptyExclude, e
1635
1686
  children: [
1636
1687
  /* @__PURE__ */ jsx(Search, { size: 14 }),
1637
1688
  /* @__PURE__ */ jsx("input", {
1638
- "aria-label": "Find page",
1639
- placeholder: "Find page…",
1689
+ "aria-label": content === "components" ? "Find component section" : "Find page",
1690
+ placeholder: content === "components" ? "Find section…" : "Find page…",
1640
1691
  value: query,
1641
1692
  onChange: (event_5) => setQuery(event_5.target.value)
1642
1693
  }),
@@ -1705,7 +1756,9 @@ function AppCanvas({ router, examples = emptyExamples, exclude = emptyExclude, e
1705
1756
  ready,
1706
1757
  "/",
1707
1758
  nodes.length,
1708
- " pages ready"
1759
+ " ",
1760
+ content === "components" ? "sections" : "pages",
1761
+ " ready"
1709
1762
  ]
1710
1763
  })
1711
1764
  ]
@@ -2050,7 +2103,8 @@ function AppCanvas({ router, examples = emptyExamples, exclude = emptyExclude, e
2050
2103
  }),
2051
2104
  inspectMode && /* @__PURE__ */ jsx(CanvasInspectorPanel, {
2052
2105
  inspector,
2053
- onClose: () => setInspectMode(false)
2106
+ onClose: () => setInspectMode(false),
2107
+ onSelectToken: configuration.revealToken
2054
2108
  })
2055
2109
  ]
2056
2110
  }),
@@ -2351,9 +2405,12 @@ function AppCanvasFrameBridge({ href }) {
2351
2405
  //#endregion
2352
2406
  //#region src/app-canvas/AppCanvasPage.tsx
2353
2407
  const APP_CANVAS_PATH = "/_canvas";
2408
+ /** Must match `componentsFrameParam`; kept inline so the canvas page does not load the gallery eagerly. */
2409
+ const componentsParam = "povio-components";
2410
+ const CanvasComponentsFrame = lazy(() => import("./CanvasComponentsFrame-C0Sf9RcC.js"));
2354
2411
  /** Ready-made route page. Mount beneath the app's UIConfigurationProvider. */
2355
2412
  function AppCanvasPage(t0) {
2356
- const $ = c(17);
2413
+ const $ = c(21);
2357
2414
  let excludePaths;
2358
2415
  let props;
2359
2416
  let t1;
@@ -2389,33 +2446,52 @@ function AppCanvasPage(t0) {
2389
2446
  $[10] = t4;
2390
2447
  } else t4 = $[10];
2391
2448
  const exclusions = t4;
2392
- if (isAppCanvasFrame()) return null;
2449
+ if (isAppCanvasFrame()) {
2450
+ let t5;
2451
+ if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
2452
+ const group = new URLSearchParams(window.location.search).get(componentsParam);
2453
+ t5 = group ? /* @__PURE__ */ jsx(Suspense, {
2454
+ fallback: null,
2455
+ children: /* @__PURE__ */ jsx(CanvasComponentsFrame, { group })
2456
+ }) : null;
2457
+ $[11] = t5;
2458
+ } else t5 = $[11];
2459
+ return t5;
2460
+ }
2393
2461
  let t5;
2394
- if ($[11] !== exclusions || $[12] !== props) {
2395
- t5 = /* @__PURE__ */ jsx(AppCanvas, {
2396
- ...props,
2397
- excludePaths: exclusions
2398
- });
2399
- $[11] = exclusions;
2400
- $[12] = props;
2462
+ if ($[12] !== canvasPath) {
2463
+ t5 = (group_0) => `${canvasPath}?${componentsParam}=${encodeURIComponent(group_0)}`;
2464
+ $[12] = canvasPath;
2401
2465
  $[13] = t5;
2402
2466
  } else t5 = $[13];
2403
2467
  let t6;
2404
- if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
2405
- t6 = /* @__PURE__ */ jsx(UIConfigurationModal, {});
2406
- $[14] = t6;
2407
- } else t6 = $[14];
2468
+ if ($[14] !== exclusions || $[15] !== props || $[16] !== t5) {
2469
+ t6 = /* @__PURE__ */ jsx(AppCanvas, {
2470
+ ...props,
2471
+ excludePaths: exclusions,
2472
+ componentsHref: t5
2473
+ });
2474
+ $[14] = exclusions;
2475
+ $[15] = props;
2476
+ $[16] = t5;
2477
+ $[17] = t6;
2478
+ } else t6 = $[17];
2408
2479
  let t7;
2409
- if ($[15] !== t5) {
2410
- t7 = /* @__PURE__ */ jsxs("div", {
2480
+ if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
2481
+ t7 = /* @__PURE__ */ jsx(UIConfigurationModal, {});
2482
+ $[18] = t7;
2483
+ } else t7 = $[18];
2484
+ let t8;
2485
+ if ($[19] !== t6) {
2486
+ t8 = /* @__PURE__ */ jsxs("div", {
2411
2487
  className: "povio-app-canvas-page",
2412
2488
  "aria-label": "App canvas page",
2413
- children: [t5, t6]
2489
+ children: [t6, t7]
2414
2490
  });
2415
- $[15] = t5;
2416
- $[16] = t7;
2417
- } else t7 = $[16];
2418
- return t7;
2491
+ $[19] = t6;
2492
+ $[20] = t8;
2493
+ } else t8 = $[20];
2494
+ return t8;
2419
2495
  }
2420
2496
  //#endregion
2421
2497
  export { defaultCanvasBreakpoints as a, layoutCanvasPages as c, AppCanvas as i, AppCanvasPage as n, isAppCanvasFrame as o, AppCanvasFrameBridge as r, discoverCanvasPages as s, APP_CANVAS_PATH as t };
@@ -0,0 +1,21 @@
1
+ import { ComponentArtboard } from "./ComponentGallery-DDSqnm9f.js";
2
+ import { c } from "react/compiler-runtime";
3
+ import { jsx } from "react/jsx-runtime";
4
+ //#region src/app-canvas/CanvasComponentsFrame.tsx
5
+ /** The document of a Components artboard: one gallery section, themed by the configuration the canvas sends. */
6
+ function CanvasComponentsFrame(t0) {
7
+ const $ = c(2);
8
+ const { group } = t0;
9
+ let t1;
10
+ if ($[0] !== group) {
11
+ t1 = /* @__PURE__ */ jsx("main", {
12
+ className: "studio-sample povio-canvas-components-frame",
13
+ children: /* @__PURE__ */ jsx(ComponentArtboard, { group })
14
+ });
15
+ $[0] = group;
16
+ $[1] = t1;
17
+ } else t1 = $[1];
18
+ return t1;
19
+ }
20
+ //#endregion
21
+ export { CanvasComponentsFrame as default };
@@ -1,5 +1,5 @@
1
1
  import { t as createLucideIcon } from "./createLucideIcon-LcezOE4z.js";
2
- import { i as inspectTokens } from "./UIConfigurator-CTlq-hrG.js";
2
+ import { i as inspectTokens } from "./UIConfigurator-C_2kgJtm.js";
3
3
  import { n as ArrowLeft } from "./DropdownMenu-5jmtgLXd.js";
4
4
  import { i as ArrowRight } from "./DropdownMenuDesktop-Cl9gZVq0.js";
5
5
  import { n as Italic, r as Bold, t as Underline } from "./underline-66hmELxa.js";
@@ -49,6 +49,7 @@ import { t as Toast } from "./Toast-DtG3pA61.js";
49
49
  import { t as Table } from "./Table-BN2_J_Ne.js";
50
50
  import { Link } from "./components/link.js";
51
51
  import { Badge } from "./components/badge.js";
52
+ import { n as galleryGroups } from "./groups-oQmSeqXn.js";
52
53
  import { useCallback, useEffect, useLayoutEffect, useRef, useState } from "react";
53
54
  import { c } from "react/compiler-runtime";
54
55
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -526,17 +527,6 @@ function InspectLabel(t0) {
526
527
  }
527
528
  //#endregion
528
529
  //#region src/configurator/gallery/demos.tsx
529
- const galleryGroups = [
530
- "Buttons",
531
- "Inputs",
532
- "Selection",
533
- "Files",
534
- "Feedback",
535
- "Text",
536
- "Navigation",
537
- "Overlays",
538
- "Data"
539
- ];
540
530
  const noop = () => {};
541
531
  const menuItems = [
542
532
  {
@@ -2249,7 +2239,7 @@ function DashboardScreen() {
2249
2239
  if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
2250
2240
  t3 = /* @__PURE__ */ jsx("div", {
2251
2241
  className: "studio-layout-stats",
2252
- children: stats.map(_temp)
2242
+ children: stats.map(_temp$1)
2253
2243
  });
2254
2244
  t4 = /* @__PURE__ */ jsx(Table, {
2255
2245
  items: projects,
@@ -2295,7 +2285,7 @@ function DashboardScreen() {
2295
2285
  return t6;
2296
2286
  }
2297
2287
  /** A sign-in screen: centered form with email, password, remember me, a primary and a secondary action. */
2298
- function _temp(t0) {
2288
+ function _temp$1(t0) {
2299
2289
  const { label, value, trend } = t0;
2300
2290
  return /* @__PURE__ */ jsxs("div", {
2301
2291
  className: "studio-layout-stat",
@@ -3400,6 +3390,77 @@ function ZoomedDemo(t0) {
3400
3390
  } else t10 = $[21];
3401
3391
  return t10;
3402
3392
  }
3393
+ /** One gallery section on its own, live and uninspected, for an App Canvas artboard. */
3394
+ function ComponentArtboard(t0) {
3395
+ const $ = c(13);
3396
+ const { group } = t0;
3397
+ if (group === "Layouts") {
3398
+ let t1;
3399
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
3400
+ t1 = /* @__PURE__ */ jsx(LayoutPreview, {});
3401
+ $[0] = t1;
3402
+ } else t1 = $[0];
3403
+ return t1;
3404
+ }
3405
+ let t1;
3406
+ let t2;
3407
+ let t3;
3408
+ let t4;
3409
+ if ($[1] !== group) {
3410
+ const items = demos.filter((demo) => demo.group === group);
3411
+ t3 = "studio-gallery-group";
3412
+ t4 = group;
3413
+ t1 = "studio-gallery-grid";
3414
+ t2 = items.map(_temp);
3415
+ $[1] = group;
3416
+ $[2] = t1;
3417
+ $[3] = t2;
3418
+ $[4] = t3;
3419
+ $[5] = t4;
3420
+ } else {
3421
+ t1 = $[2];
3422
+ t2 = $[3];
3423
+ t3 = $[4];
3424
+ t4 = $[5];
3425
+ }
3426
+ let t5;
3427
+ if ($[6] !== t1 || $[7] !== t2) {
3428
+ t5 = /* @__PURE__ */ jsx("div", {
3429
+ className: t1,
3430
+ children: t2
3431
+ });
3432
+ $[6] = t1;
3433
+ $[7] = t2;
3434
+ $[8] = t5;
3435
+ } else t5 = $[8];
3436
+ let t6;
3437
+ if ($[9] !== t3 || $[10] !== t4 || $[11] !== t5) {
3438
+ t6 = /* @__PURE__ */ jsx("section", {
3439
+ className: t3,
3440
+ "aria-label": t4,
3441
+ children: t5
3442
+ });
3443
+ $[9] = t3;
3444
+ $[10] = t4;
3445
+ $[11] = t5;
3446
+ $[12] = t6;
3447
+ } else t6 = $[12];
3448
+ return t6;
3449
+ }
3450
+ function _temp(demo_0) {
3451
+ return /* @__PURE__ */ jsxs("div", {
3452
+ className: `studio-gallery-card ${demo_0.wide ? "is-wide" : ""}`,
3453
+ children: [/* @__PURE__ */ jsx("span", {
3454
+ className: "studio-gallery-card-title",
3455
+ children: demo_0.title
3456
+ }), /* @__PURE__ */ jsx(PortalHere, { children: (portalRef) => /* @__PURE__ */ jsx("div", {
3457
+ ref: portalRef,
3458
+ className: "studio-gallery-demo",
3459
+ "data-inspector-name": demo_0.title,
3460
+ children: demo_0.render()
3461
+ }) })]
3462
+ }, demo_0.id);
3463
+ }
3403
3464
  /** Every Povio UI component in one scrollable list; clicking a card zooms it into the token inspector. */
3404
3465
  function ComponentGallery(t0) {
3405
3466
  const $ = c(14);
@@ -3510,4 +3571,4 @@ function ComponentGallery(t0) {
3510
3571
  return t7;
3511
3572
  }
3512
3573
  //#endregion
3513
- export { ComponentGallery as default };
3574
+ export { ComponentArtboard, ComponentGallery as default };