@povio/ui 5.0.0-rc.8 → 5.0.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.
Files changed (641) hide show
  1. package/README.md +312 -50
  2. package/dist/{Accordion-BzwO4_ml.js → Accordion-ORBin0EZ.js} +13 -119
  3. package/dist/{Alert-DfiJbKH0.d.ts → Alert-24ruR0iF.d.ts} +3 -3
  4. package/dist/{AlertDialog-OWTbR4km.d.ts → AlertDialog-Co3gNMwE.d.ts} +3 -3
  5. package/dist/Autocomplete-BQ9ZQoJt.d.ts +23 -0
  6. package/dist/Autocomplete-DbALLWP0.js +145 -0
  7. package/dist/Autocomplete.bound-DCPZBYKR.js +28 -0
  8. package/dist/Autocomplete.bound-DCbFBXjJ.d.ts +9 -0
  9. package/dist/{Badge-CBNpj823.d.ts → Badge-DZLVacMd.d.ts} +2 -2
  10. package/dist/{BadgeButton-Ccgt3oGO.d.ts → BadgeButton-coK9Fzoc.d.ts} +2 -2
  11. package/dist/{BottomSheet-DbQuzfAB.d.ts → BottomSheet-BlcmdfAT.d.ts} +1 -1
  12. package/dist/{BottomSheet-BXLE3161.js → BottomSheet-CGipksM_.js} +12 -86
  13. package/dist/{BottomSheet.lazy-D9LCEo7s.d.ts → BottomSheet.lazy-CGjuurej.d.ts} +1 -1
  14. package/dist/{Breadcrumbs-CUV6CU8Q.d.ts → Breadcrumbs-DfREVuAC.d.ts} +1 -1
  15. package/dist/{Breadcrumbs-FF8hMfXd.js → Breadcrumbs-a1-q_he0.js} +20 -17
  16. package/dist/{Button-D6KlWSFL.js → Button-C1YB5dOw.js} +3 -3
  17. package/dist/Button-Cphxmj43.d.ts +13 -0
  18. package/dist/Button-dRFJundh.js +16 -0
  19. package/dist/{Button-BPTvffuk.js → ButtonBase-BCYFCbSV.js} +14 -13
  20. package/dist/ButtonBase-CfSqmiom.d.ts +32 -0
  21. package/dist/{ButtonContent-c7lJayVQ.js → ButtonContent-Dztbuz3q.js} +5 -14
  22. package/dist/{Calendar-BxtOuqIM.js → Calendar-B9jqOJB6.js} +29 -181
  23. package/dist/Calendar.lazy-4d7pbB4k.js +131 -0
  24. package/dist/{CheckContent-D7sZPmzx.js → CheckContent-BKLnTPZr.js} +2 -2
  25. package/dist/{Checkbox-DVTWaMKa.d.ts → Checkbox-D2VVq5Bi.d.ts} +9 -8
  26. package/dist/{Checkbox-DYxXYfKL.js → Checkbox-DYeofZzs.js} +21 -39
  27. package/dist/Checkbox.bound-DyQFIVCw.js +33 -0
  28. package/dist/Checkbox.bound-Hdvnrnwb.d.ts +9 -0
  29. package/dist/{CheckboxCheckmark-D_uc9pon.js → CheckboxCheckmark-DYhxLfZN.js} +4 -23
  30. package/dist/CheckboxGroup-CK_tTvvI.js +141 -0
  31. package/dist/CheckboxGroup-CTkBMnBN.d.ts +30 -0
  32. package/dist/CheckboxGroup.bound-C6e91DCT.d.ts +9 -0
  33. package/dist/CheckboxGroup.bound-DyCp83EI.js +32 -0
  34. package/dist/ComboBox-ChsdI0lt.js +212 -0
  35. package/dist/{DatePicker-8xSs_jNd.d.ts → DatePicker-1VbVBI4l.d.ts} +21 -10
  36. package/dist/{DatePicker-wulRNGyL.js → DatePicker-CJj3Gp_S.js} +47 -54
  37. package/dist/DatePicker.bound-BWPOirPV.js +36 -0
  38. package/dist/DatePicker.bound-ZvJi_V8D.d.ts +9 -0
  39. package/dist/{DatePickerInput-D81ZJ3fT.d.ts → DatePickerInput-B8UhMVP6.d.ts} +3 -3
  40. package/dist/{DatePickerInput-BB_vPlKu.js → DatePickerInput-C5-kkdpq.js} +66 -301
  41. package/dist/{DateRangePicker-Bfq-yDm7.d.ts → DateRangePicker-B8O8nA1M.d.ts} +30 -10
  42. package/dist/{DateRangePicker-B0tMVREG.js → DateRangePicker-BO92JO3A.js} +166 -353
  43. package/dist/DateRangePicker.bound-B_Lg8Tna.d.ts +9 -0
  44. package/dist/DateRangePicker.bound-cDWQPCUj.js +35 -0
  45. package/dist/{DateTimePicker-D4lHyf6P.d.ts → DateTimePicker-BRy_VN63.d.ts} +21 -11
  46. package/dist/{DateTimePicker-WGMr0bEH.js → DateTimePicker-DSzd33fp.js} +47 -48
  47. package/dist/DateTimePicker.bound-BQUJXvBQ.js +32 -0
  48. package/dist/DateTimePicker.bound-Bt9wdYeR.d.ts +9 -0
  49. package/dist/{Dialog-CKLkS00H.js → Dialog-C9H9_BmK.js} +53 -29
  50. package/dist/Dialog-CDiUZFcf.d.ts +21 -0
  51. package/dist/{Dialog-9manOgMA.js → Dialog-DN5703sy.js} +13 -10
  52. package/dist/Disclosure-BRSkMbZQ.js +109 -0
  53. package/dist/{DropdownMenu-5jmtgLXd.js → DropdownMenu-DS0RaEfH.js} +13 -31
  54. package/dist/DropdownMenu-oJzwpMXL.d.ts +25 -0
  55. package/dist/{DropdownMenuDesktop-Cl9gZVq0.js → DropdownMenuDesktop-DGPIfex-.js} +7 -28
  56. package/dist/{FileInput-C4CE5kuP.d.ts → FileInput-Bm3_nNb4.d.ts} +26 -22
  57. package/dist/{FileInput-DP105Iy9.js → FileInput-dTcR3V93.js} +37 -50
  58. package/dist/FileInput.bound-B5b7BLGg.js +30 -0
  59. package/dist/FileInput.bound-puNboLYc.d.ts +8 -0
  60. package/dist/{FileTrigger-Cthk5_Wp.js → FileTrigger-DlryDp2T.js} +6 -6
  61. package/dist/{FileUpload-CgNDIvzg.js → FileUpload-JogkVfav.js} +279 -249
  62. package/dist/FileUpload-ksjKICmv.d.ts +11 -0
  63. package/dist/FileUpload.bound-D4sr1tsH.d.ts +16 -0
  64. package/dist/FileUpload.bound-TTr9FNMS.js +30 -0
  65. package/dist/{FileUploadContainer-042ztsaL.d.ts → FileUploadContainer-DRIxUmp2.d.ts} +1 -1
  66. package/dist/{Form-DlQcyN1f.js → Form-CqF1SaVw.js} +2 -2
  67. package/dist/{FormField-Byiehm9y.d.ts → FormField-DHCcfchm.d.ts} +7 -2
  68. package/dist/{FormField-AY25LzbW.js → FormField-dduTMkNH.js} +63 -40
  69. package/dist/{FormFieldError-BVAO5p7H.js → FormFieldError-DTT5TUQ1.js} +2 -2
  70. package/dist/{FormFieldHeaderTooltip-BV2Ju4oB.js → FormFieldHeaderTooltip-Dt-g40Tc.js} +4 -4
  71. package/dist/FormLayout-CBYgWvwW.d.ts +47 -0
  72. package/dist/{Heading-nI1_VOaE.js → Heading-D4XFYv__.js} +2 -2
  73. package/dist/IconButton-BqmX_sMz.d.ts +25 -0
  74. package/dist/{IconSlot-DSK7qNxc.js → IconSlot-CqNuZl0E.js} +4 -4
  75. package/dist/{iconSlot.cva-CnpFzAOR.d.ts → IconSlot-DcEDPaNb.d.ts} +3 -10
  76. package/dist/{InlineTooltipWrapper-BpApaGXV.js → InlineTooltipWrapper-CKTiFpZn.js} +3 -3
  77. package/dist/{Input-BsbLZDtC.js → Input-BG0Xjw5X.js} +2 -2
  78. package/dist/{Input-DOanwj3l.d.ts → Input-DKNzGXy-.d.ts} +16 -9
  79. package/dist/Input-Dq2Raco6.js +247 -0
  80. package/dist/Input.bound-BxngTsaq.d.ts +9 -0
  81. package/dist/Input.bound-CB0WNCLI.js +31 -0
  82. package/dist/InputContent-5WKp0yNK.js +102 -0
  83. package/dist/{InputContent-CXuP1ghQ.d.ts → InputContent-C5wdgK9u.d.ts} +5 -5
  84. package/dist/{Label-B2-B-uFY.js → Label-BGvF9vWx.js} +2 -2
  85. package/dist/{Link-FupWOW1f.js → Link-Chux-Clm.js} +2 -2
  86. package/dist/{Link-Ow9H7kNv.d.ts → Link-n1MxiBY_.d.ts} +5 -3
  87. package/dist/{ListBox-CL8Ar4Q_.js → ListBox-DhR5kojP.js} +10 -11
  88. package/dist/{MenuItem-DHyqOqln.d.ts → MenuItem-Cj7ytjH0.d.ts} +1 -1
  89. package/dist/{Modal-w60dVQcb.js → Modal-DcLWF9cB.js} +58 -20
  90. package/dist/NumberField-BQwc6a7u.js +249 -0
  91. package/dist/{NumberField-Cb9Gf6QJ.d.ts → NumberField-BUTmx-kv.d.ts} +13 -9
  92. package/dist/NumberField.bound-DhGXXd4v.d.ts +9 -0
  93. package/dist/NumberField.bound-Ha6jrlsv.js +32 -0
  94. package/dist/{NumberFormatter-CLDS_LRZ.js → NumberFormatter-DYarfm5F.js} +2 -36
  95. package/dist/{NumberRangeInput-BfbJQqzn.d.ts → NumberRangeInput-BwUPbB0M.d.ts} +13 -8
  96. package/dist/{NumberRangeInput-B_sMIpP1.js → NumberRangeInput-KngK-OvN.js} +28 -55
  97. package/dist/NumberRangeInput.bound-VafOPEAu.js +32 -0
  98. package/dist/NumberRangeInput.bound-j_WC6iJC.d.ts +9 -0
  99. package/dist/{OverlayArrow-D8z7cCsw.js → OverlayArrow-DF0jMwul.js} +2 -2
  100. package/dist/PageHeader-DtV-4JEh.d.ts +61 -0
  101. package/dist/PasswordInput-DNt_CfI8.d.ts +11 -0
  102. package/dist/PasswordInput.bound-D4tGX20e.js +23 -0
  103. package/dist/{PasswordInput-CLwFUgl0.d.ts → PasswordInput.bound-EOqjNEVC.d.ts} +5 -6
  104. package/dist/{Popover-BTHPteIh.d.ts → Popover-DRqROtxR.d.ts} +2 -2
  105. package/dist/{Progress-Du30L4_s.js → Progress-RiEGGxNG.js} +3 -3
  106. package/dist/{Progress-CjWOR38H.d.ts → Progress-uzAAtLNk.d.ts} +4 -4
  107. package/dist/{RadioGroup-CUGNSJql.js → RadioGroup-Dvq0TiEB.js} +18 -41
  108. package/dist/RadioGroup-skcBf54J.d.ts +26 -0
  109. package/dist/RadioGroup.bound-B-xm1dwo.js +32 -0
  110. package/dist/RadioGroup.bound-CpxN2p6t.d.ts +9 -0
  111. package/dist/RangeCalendar-p7ajg_wH.js +315 -0
  112. package/dist/RichTextEditor-B9zaBMWl.d.ts +28 -0
  113. package/dist/{RichTextEditor-VDOpj7sk.js → RichTextEditor-DLBfexN_.js} +57 -365
  114. package/dist/Select-DNF-GpuC.d.ts +137 -0
  115. package/dist/{staticSelect.utils-CzlnLPPd.js → Select-hIRIXRz1.js} +342 -634
  116. package/dist/Select.bound-BrAIDjfv.js +34 -0
  117. package/dist/Select.bound-CpN6KalY.d.ts +17 -0
  118. package/dist/SelectListBox-ysubv-kl.js +390 -0
  119. package/dist/SelectionIndicator-C3hniBa2.js +18 -0
  120. package/dist/SharedElementTransition-CZ2bE7yo.js +96 -0
  121. package/dist/SidebarWorkspaces-DJknAfS9.js +1298 -0
  122. package/dist/SidebarWorkspaces-Drgog0IO.d.ts +132 -0
  123. package/dist/{Slider-Clc1szFY.js → Slider-DCsCCPFx.js} +18 -42
  124. package/dist/{Slider-EYlGCLWe.d.ts → Slider-JlRCD72s.d.ts} +9 -8
  125. package/dist/Slider.bound-BChOUGvm.d.ts +9 -0
  126. package/dist/Slider.bound-CByTXPTr.js +31 -0
  127. package/dist/{Spinner-DbXeDOa2.d.ts → Spinner-DNguPtBP.d.ts} +5 -5
  128. package/dist/{Spinner-BeVTUzzx.js → Spinner-DqjP06T1.js} +29 -41
  129. package/dist/{SplitButton-D9ngY1rJ.d.ts → SplitButton-BTuc5oYU.d.ts} +3 -3
  130. package/dist/{Stepper-TATlHZhQ.d.ts → Stepper-DNu5YlbG.d.ts} +18 -18
  131. package/dist/{Stepper-Cp5vbL5g.js → Stepper-Dyhxp0Tl.js} +14 -13
  132. package/dist/{Switch-CimmMqEk.js → Switch-BfpSMMpv.js} +10 -35
  133. package/dist/Switch-CVt-dT9Z.d.ts +24 -0
  134. package/dist/Switch.bound-56C86rOe.d.ts +9 -0
  135. package/dist/Switch.bound-Dv0cHsMM.js +33 -0
  136. package/dist/TableRowDetails-A_FdBE_d.d.ts +109 -0
  137. package/dist/TabsFilters-BDoCGfRA.d.ts +30 -0
  138. package/dist/TabsFilters-ka2sUZPi.js +223 -0
  139. package/dist/Tag-BxYYX-i7.d.ts +44 -0
  140. package/dist/{Text-D2MPZ3sY.js → Text-D72yc4S6.js} +1 -1
  141. package/dist/{TextArea-B3teIhsJ.js → TextArea-CqT0_Bn-.js} +33 -33
  142. package/dist/{TextArea-l_keyLK7.d.ts → TextArea-DxAHDgz4.d.ts} +11 -9
  143. package/dist/TextArea.bound-kHkY_d9o.js +28 -0
  144. package/dist/TextArea.bound-oSnqk1Un.d.ts +9 -0
  145. package/dist/{TextArea.cva-Bb73hriz.js → TextArea.cva-ENXI55ec.js} +1 -1
  146. package/dist/{TimePicker-CU_yL2sY.js → TimePicker-Duw94UIt.js} +65 -55
  147. package/dist/TimePicker-Yg84ntZH.d.ts +45 -0
  148. package/dist/TimePicker.bound-5b_qcmeo.d.ts +9 -0
  149. package/dist/TimePicker.bound-DX5pXlgZ.js +32 -0
  150. package/dist/{datePickerValue.utils-CIFHjKwv.js → TimePickerForm-BiWPFcsD.js} +23 -19
  151. package/dist/{Toast-ruXqONDA.d.ts → Toast-DbIZorlS.d.ts} +1 -1
  152. package/dist/{ToastContainer-qgpzMFD4.js → ToastContainer-DtpZaefx.js} +5 -5
  153. package/dist/ToggleButton-CdcLn-PW.d.ts +17 -0
  154. package/dist/{ToggleButton-BW1ensey.js → ToggleButton-P1z1pxzT.js} +5 -5
  155. package/dist/ToggleGroup-Cbx9Keza.d.ts +42 -0
  156. package/dist/ToggleGroup-Co1-A0Ti.js +333 -0
  157. package/dist/ToggleGroup.bound-DphkH_jH.js +67 -0
  158. package/dist/ToggleGroup.bound-dDLGgcJm.d.ts +9 -0
  159. package/dist/Tooltip-Bg9AFtGw.d.ts +16 -0
  160. package/dist/{Tooltip-CpG1nz7Y.js → Tooltip-DRB6lo0U.js} +10 -11
  161. package/dist/{TooltipWrapper-3jyN0Wss.js → TooltipWrapper-DcrEabVw.js} +21 -10
  162. package/dist/{Typography-LU4z2pR1.js → Typography-DCLnPa3P.js} +2 -2
  163. package/dist/{Typography-XljT9s02.d.ts → Typography-MkA6LnHW.d.ts} +2 -2
  164. package/dist/{accordion.cva-CL1bVscW.js → accordion.cva-DwxY-k1e.js} +17 -25
  165. package/dist/{badgeButton.cva-B2bgCQP6.d.ts → badgeButton.cva-Bjhs4ops.d.ts} +8 -8
  166. package/dist/badgeButton.cva-CqaR8KBt.js +138 -0
  167. package/dist/{breadcrumbs.cva-7zzdDhVR.js → breadcrumbs.cva-CnBIZUB3.js} +9 -9
  168. package/dist/button.cva-CMkwxrFU.js +263 -0
  169. package/dist/{button.cva-C7kEhgoA.d.ts → button.cva-DoDFPTm5.d.ts} +18 -17
  170. package/dist/{buttonContent.cva-DPIlROA9.d.ts → buttonContent.cva-Dj7Eve71.d.ts} +2 -2
  171. package/dist/checkbox.cva-Bj7bLZNf.js +128 -0
  172. package/dist/{checkbox.cva-t1Ox50hy.d.ts → checkbox.cva-DUvQJdT-.d.ts} +7 -7
  173. package/dist/components/accordion.js +1 -1
  174. package/dist/components/alert-dialog.d.ts +1 -1
  175. package/dist/components/alert-dialog.js +102 -100
  176. package/dist/components/alert.d.ts +1 -1
  177. package/dist/components/alert.js +11 -11
  178. package/dist/components/autocomplete.d.ts +2 -2
  179. package/dist/components/autocomplete.js +1 -134
  180. package/dist/components/badge-button.d.ts +1 -1
  181. package/dist/components/badge-button.js +6 -6
  182. package/dist/components/badge.d.ts +1 -1
  183. package/dist/components/badge.js +10 -10
  184. package/dist/components/bottom-sheet-header.d.ts +16 -0
  185. package/dist/components/bottom-sheet-header.js +80 -0
  186. package/dist/components/bottom-sheet.d.ts +2 -2
  187. package/dist/components/bottom-sheet.js +3 -3
  188. package/dist/components/breadcrumb/react-aria.js +1 -1
  189. package/dist/components/breadcrumbs.d.ts +1 -1
  190. package/dist/components/breadcrumbs.js +1 -1
  191. package/dist/components/button-group.d.ts +12 -0
  192. package/dist/components/button-group.js +46 -0
  193. package/dist/components/button.d.ts +2 -2
  194. package/dist/components/button.js +1 -1
  195. package/dist/components/checkbox-group.d.ts +2 -2
  196. package/dist/components/checkbox-group.js +1 -163
  197. package/dist/components/checkbox.d.ts +2 -2
  198. package/dist/components/checkbox.js +2 -2
  199. package/dist/components/combo-box/react-aria.js +1 -1
  200. package/dist/components/date-picker/react-aria.js +1 -1
  201. package/dist/components/date-picker.d.ts +2 -2
  202. package/dist/components/date-picker.js +1 -1
  203. package/dist/components/date-range-picker/react-aria.js +1 -1
  204. package/dist/components/date-range-picker.d.ts +16 -2
  205. package/dist/components/date-range-picker.js +2 -2
  206. package/dist/components/date-time-picker.d.ts +2 -2
  207. package/dist/components/date-time-picker.js +1 -1
  208. package/dist/components/dialog-trigger/react-aria.js +1 -1
  209. package/dist/components/dialog.d.ts +1 -1
  210. package/dist/components/dialog.js +1 -1
  211. package/dist/components/drawer.js +4 -4
  212. package/dist/components/dropdown-menu.d.ts +2 -2
  213. package/dist/components/dropdown-menu.js +2 -2
  214. package/dist/components/file-input.d.ts +2 -2
  215. package/dist/components/file-input.js +1 -1
  216. package/dist/components/file-upload-container.d.ts +2 -2
  217. package/dist/components/file-upload-container.js +1 -1
  218. package/dist/components/file-upload.d.ts +3 -3
  219. package/dist/components/file-upload.js +1 -1
  220. package/dist/components/form-field.d.ts +1 -1
  221. package/dist/components/form-field.js +1 -1
  222. package/dist/components/form-layout.d.ts +2 -0
  223. package/dist/components/form-layout.js +80 -0
  224. package/dist/components/icon-button.d.ts +1 -1
  225. package/dist/components/icon-button.js +17 -15
  226. package/dist/components/icon-slot.d.ts +2 -1
  227. package/dist/components/icon-slot.js +1 -1
  228. package/dist/components/input-frame.d.ts +94 -0
  229. package/dist/{useStaticInputHandoff-kkQrc6DA.js → components/input-frame.js} +82 -116
  230. package/dist/components/input.d.ts +2 -2
  231. package/dist/components/input.js +1 -241
  232. package/dist/components/link.d.ts +1 -1
  233. package/dist/components/link.js +4 -4
  234. package/dist/components/menu-trigger/react-aria.js +1 -1
  235. package/dist/components/modal/react-aria.js +1 -1
  236. package/dist/components/modal-overlay/react-aria.js +1 -1
  237. package/dist/components/number-field.d.ts +2 -2
  238. package/dist/components/number-field.js +1 -245
  239. package/dist/components/number-range-input.d.ts +2 -2
  240. package/dist/components/number-range-input.js +1 -1
  241. package/dist/components/page-header.d.ts +2 -0
  242. package/dist/components/page-header.js +210 -0
  243. package/dist/components/password-input.d.ts +2 -2
  244. package/dist/components/password-input.js +22 -1
  245. package/dist/components/popover/react-aria.js +1 -1
  246. package/dist/components/popover.d.ts +1 -1
  247. package/dist/components/popover.js +40 -32
  248. package/dist/components/progress.d.ts +1 -1
  249. package/dist/components/progress.js +1 -1
  250. package/dist/components/radio-group.d.ts +2 -2
  251. package/dist/components/radio-group.js +1 -1
  252. package/dist/components/select/react-aria.js +1 -1
  253. package/dist/components/select.d.ts +2 -3
  254. package/dist/components/select.js +1 -1
  255. package/dist/components/sidebar.d.ts +2 -0
  256. package/dist/components/sidebar.js +2 -0
  257. package/dist/components/slider.d.ts +2 -2
  258. package/dist/components/slider.js +1 -1
  259. package/dist/components/spinner.d.ts +1 -1
  260. package/dist/components/spinner.js +1 -1
  261. package/dist/components/split-button.d.ts +1 -1
  262. package/dist/components/split-button.js +3 -3
  263. package/dist/components/stepper.d.ts +1 -1
  264. package/dist/components/stepper.js +1 -1
  265. package/dist/components/style-definitions.d.ts +3 -0
  266. package/dist/components/style-definitions.js +122 -0
  267. package/dist/components/submenu-trigger/react-aria.js +1 -1
  268. package/dist/components/switch.d.ts +2 -2
  269. package/dist/components/switch.js +1 -1
  270. package/dist/components/tabs-filters.d.ts +2 -0
  271. package/dist/components/tabs-filters.js +2 -0
  272. package/dist/components/tag.d.ts +1 -1
  273. package/dist/components/tag.js +9 -9
  274. package/dist/components/text-area.d.ts +2 -2
  275. package/dist/components/text-area.js +1 -1
  276. package/dist/components/time-picker.d.ts +2 -2
  277. package/dist/components/time-picker.js +1 -1
  278. package/dist/components/toast.d.ts +2 -2
  279. package/dist/components/toast.js +2 -2
  280. package/dist/components/toggle-button.d.ts +1 -1
  281. package/dist/components/toggle-button.js +17 -30
  282. package/dist/components/toggle-group.d.ts +2 -3
  283. package/dist/components/toggle-group.js +1 -1
  284. package/dist/components/tooltip-ellipsis.js +2 -2
  285. package/dist/components/tooltip.d.ts +1 -1
  286. package/dist/components/tooltip.js +1 -1
  287. package/dist/components/typography.d.ts +2 -2
  288. package/dist/components/typography.js +1 -1
  289. package/dist/components/use-toast.d.ts +1 -1
  290. package/dist/components/use-toast.js +2 -2
  291. package/dist/config/component-configuration.d.ts +30 -0
  292. package/dist/config/component-configuration.js +69 -0
  293. package/dist/config/confirmation.d.ts +1 -1
  294. package/dist/config/confirmation.js +1 -1
  295. package/dist/config/link-context.d.ts +2 -2
  296. package/dist/config/link-context.js +1 -1
  297. package/dist/config/resources.d.ts +1 -1
  298. package/dist/config/resources.js +1 -1
  299. package/dist/config/theme-context.js +1 -1
  300. package/dist/config/ui-config.d.ts +2 -2
  301. package/dist/config/ui-config.js +1 -1
  302. package/dist/config/ui-overrides.d.ts +1 -1
  303. package/dist/config/ui-overrides.js +1 -1
  304. package/dist/config/ui-router.js +1 -1
  305. package/dist/{confirmation.context-BuzgCfYl.js → confirmation.context-Bc2yEVp_.js} +2 -2
  306. package/dist/{confirmation.context-BOeEVczb.d.ts → confirmation.context-CAt_T5qZ.d.ts} +1 -1
  307. package/dist/{datePickerInput.cva-Cd7UUN61.js → datePickerInput.cva-CWkV2fut.js} +3 -3
  308. package/dist/datePickerValue.utils-CkmPaD6I.js +4 -0
  309. package/dist/{dialog.cva-COhDZaVl.js → dialog.cva-BIpz6HcA.js} +7 -7
  310. package/dist/{dist-CAdwxJbe.js → dist-fFtzh872.js} +54 -1
  311. package/dist/{dom.utils-D1AopHx9.js → dom.utils-BPooTXtC.js} +2 -2
  312. package/dist/dropdownMenu.cva-DwSOcbmR.js +31 -0
  313. package/dist/{fileUpload.cva-ujmStxB1.js → fileUpload.cva-BYzXGc9C.js} +11 -11
  314. package/dist/{fileUpload.types-n5FxK_F-.d.ts → fileUpload.types-CfUkihds.d.ts} +22 -17
  315. package/dist/form.binding-DOR5gIQf.js +49 -0
  316. package/dist/form.types-C8P4sznq.d.ts +22 -0
  317. package/dist/{formFieldError.cva-CsXaQRHX.js → formFieldError.cva-BB6Ghqwq.js} +3 -3
  318. package/dist/formFieldHelper.cva-DRmSyRZN.js +14 -0
  319. package/dist/formLayout.context--CN08Mtb.js +14 -0
  320. package/dist/hooks/use-async-list.d.ts +2 -0
  321. package/dist/hooks/use-async-list.js +2 -0
  322. package/dist/hooks/use-filters.js +1 -1
  323. package/dist/hooks/use-local-storage.js +1 -1
  324. package/dist/{i18n-CX2EjhJI.js → i18n-D8vXIoiq.js} +24 -18
  325. package/dist/{i18n-CX1vFM9r.d.ts → i18n-DM-PUcxQ.d.ts} +24 -14
  326. package/dist/iconSlot.cva-I0pFwkGy.d.ts +9 -0
  327. package/dist/icons.d.ts +2 -1
  328. package/dist/icons.js +3 -3
  329. package/dist/import-C7W0Wv2r.js +255 -0
  330. package/dist/index.d.ts +98 -91
  331. package/dist/index.js +98 -99
  332. package/dist/input.cva-2C6_W5jD.js +185 -0
  333. package/dist/input.cva-cNv7yhcp.d.ts +80 -0
  334. package/dist/inputLayout-KdAtunGk.js +5 -0
  335. package/dist/{intlStrings-chfsan9H.js → intlStrings-Cu1YN1tA.js} +35 -35
  336. package/dist/isEqual-LFw0W5rU.js +97 -0
  337. package/dist/label.cva-DTfT6FrX.js +85 -0
  338. package/dist/{link.context-D5qyz9Rf.d.ts → link.context-LSbvpZCL.d.ts} +1 -1
  339. package/dist/link.cva-C24YVAsJ.js +16 -0
  340. package/dist/{numberStatic.utils-BX50PSee.js → numberStatic.utils-BIyZuILs.js} +5 -5
  341. package/dist/outline.clsx-DGGQQRkM.js +6 -0
  342. package/dist/popover.cva-DAbfSma6.js +5 -0
  343. package/dist/{progress.cva-WQB8BGbk.js → progress.cva-CsGaGVJ-.js} +7 -7
  344. package/dist/{radio.cva-DN9VQ3Kb.d.ts → radio.cva-CtBwM88n.d.ts} +9 -5
  345. package/dist/{radio.cva-DGbvTymp.js → radio.cva-DistaZtZ.js} +33 -19
  346. package/dist/rich-text-editor.d.ts +2 -2
  347. package/dist/rich-text-editor.js +1 -1
  348. package/dist/{routing.utils-UTQonIhB.js → routing.utils-DfxEt0_Y.js} +5 -0
  349. package/dist/selectDesktop.cva-DStkOdwm.js +14 -0
  350. package/dist/selectItem.cva-B6vxey2R.js +27 -0
  351. package/dist/{staticDateTimeSegments-sf_ND7zL.js → staticDateTimeSegments-BVvFHWOs.js} +61 -57
  352. package/dist/{status.cva-6HxNR4EP.js → status.cva-CYgi3Htz.js} +21 -21
  353. package/dist/stepper.cva-Cecphqeo.js +104 -0
  354. package/dist/style-definitions-DJOlAxCG.d.ts +1034 -0
  355. package/dist/styles/editor.css +9 -9
  356. package/dist/styles/input.d.ts +1 -1
  357. package/dist/styles/outline.js +1 -1
  358. package/dist/switch.cva-BT0kGRIk.js +24 -0
  359. package/dist/switch.cva-DmuYW9tg.d.ts +16 -0
  360. package/dist/table.cva-DkcsOmZG.js +147 -0
  361. package/dist/tag.cva-ExMNsTN-.js +24 -0
  362. package/dist/tanstack/autocomplete.d.ts +3 -2
  363. package/dist/tanstack/autocomplete.js +1 -1
  364. package/dist/tanstack/checkbox-group.d.ts +3 -2
  365. package/dist/tanstack/checkbox-group.js +1 -1
  366. package/dist/tanstack/checkbox.d.ts +3 -2
  367. package/dist/tanstack/checkbox.js +2 -2
  368. package/dist/tanstack/date-picker.d.ts +3 -2
  369. package/dist/tanstack/date-picker.js +1 -1
  370. package/dist/tanstack/date-range-picker.d.ts +3 -2
  371. package/dist/tanstack/date-range-picker.js +1 -1
  372. package/dist/tanstack/date-time-picker.d.ts +3 -2
  373. package/dist/tanstack/date-time-picker.js +1 -1
  374. package/dist/tanstack/file-input.d.ts +3 -2
  375. package/dist/tanstack/file-input.js +1 -1
  376. package/dist/tanstack/file-upload.d.ts +4 -3
  377. package/dist/tanstack/file-upload.js +1 -1
  378. package/dist/tanstack/form.d.ts +3 -3
  379. package/dist/tanstack/form.js +3 -3
  380. package/dist/tanstack/input.d.ts +3 -2
  381. package/dist/tanstack/input.js +1 -1
  382. package/dist/tanstack/number-field.d.ts +3 -2
  383. package/dist/tanstack/number-field.js +1 -1
  384. package/dist/tanstack/number-range-input.d.ts +3 -2
  385. package/dist/tanstack/number-range-input.js +1 -1
  386. package/dist/tanstack/password-input.d.ts +1 -1
  387. package/dist/tanstack/password-input.js +1 -1
  388. package/dist/tanstack/radio-group.d.ts +3 -2
  389. package/dist/tanstack/radio-group.js +1 -1
  390. package/dist/tanstack/rich-text-editor.d.ts +9 -2
  391. package/dist/tanstack/rich-text-editor.js +27 -1
  392. package/dist/tanstack/select.d.ts +3 -2
  393. package/dist/tanstack/select.js +1 -1
  394. package/dist/tanstack/slider.d.ts +3 -2
  395. package/dist/tanstack/slider.js +1 -1
  396. package/dist/tanstack/switch.d.ts +3 -2
  397. package/dist/tanstack/switch.js +1 -1
  398. package/dist/tanstack/table.d.ts +3 -2
  399. package/dist/tanstack/table.js +2 -3
  400. package/dist/tanstack/text-area.d.ts +3 -2
  401. package/dist/tanstack/text-area.js +1 -1
  402. package/dist/tanstack/time-picker.d.ts +3 -2
  403. package/dist/tanstack/time-picker.js +1 -1
  404. package/dist/tanstack/toggle-group.d.ts +3 -3
  405. package/dist/tanstack/toggle-group.js +1 -1
  406. package/dist/{queries.utils-CmbhAoHU.js → tanstack-Bgdv0qU1.js} +2 -1
  407. package/dist/tanstack-CJKor9l-.d.ts +566 -0
  408. package/dist/tanstack.d.ts +82 -78
  409. package/dist/tanstack.js +98 -100
  410. package/dist/{theme.context-B3wQDJ-i.js → theme.context--VEyStJB.js} +2 -2
  411. package/dist/{toast.cva-C_L_RffH.js → toast.cva-B6NXTwbZ.js} +22 -38
  412. package/dist/{toast.cva-By5lvAfr.d.ts → toast.cva-BnXRIWVy.d.ts} +10 -10
  413. package/dist/{toast.runtime-Zf-XyAC3.js → toast.runtime-BWQLlbZW.js} +1 -2
  414. package/dist/toggleGroup.cva-BZcOUjIS.d.ts +26 -0
  415. package/dist/toggleGroup.cva-CINSHakM.js +35 -0
  416. package/dist/{tooltip.cva-BIzlOXHH.js → tooltip.cva-BEyxvcG2.js} +11 -11
  417. package/dist/{tooltipWrapper.cva-BBQ4ic3D.js → tooltipWrapper.cva-t4NQ9zz9.js} +1 -1
  418. package/dist/tw-ui-plugin.js +5 -1
  419. package/dist/typography.cva-CHsHX_Wp.js +31 -0
  420. package/dist/typography.cva-DcBCiskp.d.ts +36 -0
  421. package/dist/uiConfig.context-3DN9w6oU.js +180 -0
  422. package/dist/{uiConfig.context-DeBX2beU.d.ts → uiConfig.context-CoE2HBL4.d.ts} +26 -20
  423. package/dist/{uiOverrides.context-DEp139He.d.ts → uiOverrides.context-DHHzLSnq.d.ts} +67 -6
  424. package/dist/useAsyncList-Ct74ve3i.js +445 -0
  425. package/dist/useAsyncList-Cu-Y8If2.d.ts +9 -0
  426. package/dist/{useBreakpoint-DQoMN-BG.js → useBreakpoint-CJ3mx7UF.js} +6 -6
  427. package/dist/{useControlledState-CzXkZCX8.js → useControlledState-CuU1VIh1.js} +2 -2
  428. package/dist/useFieldAccessibility-eZIMECmG.js +19 -0
  429. package/dist/{useFilters-XNH27Md2.js → useFilters-DMi94RZK.js} +3 -3
  430. package/dist/{form.binding-CG1RPv6o.js → useForm-Cb7KWLds.js} +80 -43
  431. package/dist/{form.binding-DVJ5F0JE.d.ts → useForm-I6z23FXf.d.ts} +15 -15
  432. package/dist/useFormAutosave-BBLm3Ujo.d.ts +34 -0
  433. package/dist/useFormAutosave-BPGlChiY.js +216 -0
  434. package/dist/useScrollableListBox-oYKqU3Hp.js +47 -0
  435. package/dist/useStaticInputHandoff-BN0fOerH.js +76 -0
  436. package/dist/useTableColumnConfig-D4BGhlBT.js +1906 -0
  437. package/dist/useTableNav-hQCt_TbI.d.ts +197 -0
  438. package/dist/{useToast-yreVCUer.d.ts → useToast-CjyrMHdh.d.ts} +1 -1
  439. package/dist/{utils-Czcqspm7.js → utils-BkLF-JA3.js} +1 -1
  440. package/package.json +90 -242
  441. package/.rulesync/rules/ui-buttons-and-content.md +0 -56
  442. package/.rulesync/rules/ui-inputs-and-forms.md +0 -62
  443. package/.rulesync/rules/ui-overlays-navigation-and-styling.md +0 -49
  444. package/.rulesync/rules/ui-overview.md +0 -33
  445. package/dist/Autocomplete-BwNHp8fy.d.ts +0 -15
  446. package/dist/Button-D-4qb0IR.d.ts +0 -42
  447. package/dist/CheckboxGroup-DGF12cmB.d.ts +0 -28
  448. package/dist/ComponentGallery-Da70Y4_Q.js +0 -3513
  449. package/dist/Dialog-CW93T9X1.d.ts +0 -56
  450. package/dist/DropdownMenu-JNpYT4-3.d.ts +0 -62
  451. package/dist/FileUpload-CR7bZxV1.d.ts +0 -7
  452. package/dist/Form-DbEWnCKc.d.ts +0 -49
  453. package/dist/IconButton-D4thBurp.d.ts +0 -16
  454. package/dist/InlineIconButton-BeJCjl-q.d.ts +0 -15
  455. package/dist/InputItem-ZeN-aIz8.js +0 -63
  456. package/dist/Inputs-BC5q5Cvj.js +0 -17
  457. package/dist/Inputs-O84btFJL.d.ts +0 -13
  458. package/dist/Pagination-CwQu5Py8.d.ts +0 -12
  459. package/dist/PaginationList-DMRUGtf8.d.ts +0 -18
  460. package/dist/PaginationList-DptMNpNs.js +0 -220
  461. package/dist/PasswordInput-DYwUZ4-k.js +0 -78
  462. package/dist/QuerySelect-BGxb6Y0K.d.ts +0 -24
  463. package/dist/RadioGroup-CZg2kIMk.d.ts +0 -24
  464. package/dist/RichTextEditor-YxuRUlI7.d.ts +0 -26
  465. package/dist/Select-B2pAfwRk.js +0 -154
  466. package/dist/Select-pHbyJdZJ.d.ts +0 -15
  467. package/dist/SelectBase-Omiq2D3M.d.ts +0 -96
  468. package/dist/SelectionIndicator-JblvLKCu.js +0 -5
  469. package/dist/SharedElementTransition-Da1c_cOO.js +0 -12
  470. package/dist/Switch-s_EPn0Jz.d.ts +0 -22
  471. package/dist/Table-CqepqSfe.js +0 -637
  472. package/dist/Tag-AHfV_XSf.d.ts +0 -44
  473. package/dist/TextButton-XUhV_1s0.d.ts +0 -15
  474. package/dist/TimePicker-B1POvGWs.d.ts +0 -33
  475. package/dist/Toast-DPbnLlBi.js +0 -53
  476. package/dist/ToggleButton-7aP8Jb11.d.ts +0 -11
  477. package/dist/ToggleGroup-BULVwErp.js +0 -346
  478. package/dist/ToggleGroup-CRFDIPGZ.d.ts +0 -7
  479. package/dist/Tooltip-DHv6vAqW.d.ts +0 -57
  480. package/dist/autocomplete-DeERHN8W.d.ts +0 -16
  481. package/dist/badgeButton.cva-CvN4CTx5.js +0 -300
  482. package/dist/button.cva-rv5Uq4aW.js +0 -423
  483. package/dist/check-DYMBkp_Z.js +0 -20
  484. package/dist/checkbox-DxIPDTK5.d.ts +0 -9
  485. package/dist/checkbox-group-B3BOVshI.d.ts +0 -9
  486. package/dist/checkbox.cva-IfOByVLA.js +0 -137
  487. package/dist/chevron-down-B4Pr8bD3.js +0 -20
  488. package/dist/chevron-left-Dgo_b9wJ.js +0 -20
  489. package/dist/chevron-right-3nKJR5Bb.js +0 -20
  490. package/dist/chevron-up-D_Gqpb5M.js +0 -20
  491. package/dist/chevrons-right-DJPPn2fD.js +0 -44
  492. package/dist/components/inline-icon-button.d.ts +0 -2
  493. package/dist/components/inline-icon-button.js +0 -40
  494. package/dist/components/pagination-list.d.ts +0 -2
  495. package/dist/components/pagination-list.js +0 -2
  496. package/dist/components/pagination.d.ts +0 -2
  497. package/dist/components/pagination.js +0 -134
  498. package/dist/components/query-autocomplete.d.ts +0 -8
  499. package/dist/components/query-autocomplete.js +0 -134
  500. package/dist/components/query-select.d.ts +0 -2
  501. package/dist/components/query-select.js +0 -147
  502. package/dist/components/text-button.d.ts +0 -2
  503. package/dist/components/text-button.js +0 -35
  504. package/dist/config/app-canvas.d.ts +0 -79
  505. package/dist/config/app-canvas.js +0 -2253
  506. package/dist/config/ui-configurator-theme.d.ts +0 -2
  507. package/dist/config/ui-configurator-theme.js +0 -2
  508. package/dist/config/ui-configurator-vite.d.ts +0 -10
  509. package/dist/config/ui-configurator-vite.js +0 -174
  510. package/dist/config/ui-configurator.d.ts +0 -15
  511. package/dist/config/ui-configurator.js +0 -5384
  512. package/dist/configuration.context-f_FSPWhQ.d.ts +0 -926
  513. package/dist/createLucideIcon-LcezOE4z.js +0 -240
  514. package/dist/date-picker-DnxDmlOW.d.ts +0 -9
  515. package/dist/date-range-picker-DHDOSvHN.d.ts +0 -9
  516. package/dist/date-time-picker-UkTa0OJ8.d.ts +0 -9
  517. package/dist/date.transforms-DLg-eFcE.js +0 -15
  518. package/dist/dropdownMenu.cva-DvEmX0bs.js +0 -34
  519. package/dist/dynamicInputs-ByVMnx4Z.d.ts +0 -772
  520. package/dist/dynamicInputs-CRMWIpHA.js +0 -194
  521. package/dist/dynamicInputs-m_DQu5q0.js +0 -214
  522. package/dist/fieldAdapter-C4sDFC8f.d.ts +0 -9
  523. package/dist/fieldAdapter-DjYls12j.js +0 -63
  524. package/dist/file-input-DkbkdI7l.d.ts +0 -9
  525. package/dist/file-upload-CTsPhxJk.d.ts +0 -10
  526. package/dist/form.types-CecYaerF.d.ts +0 -13
  527. package/dist/form.types-ZNGbcqJS.d.ts +0 -13
  528. package/dist/formFieldHelper.cva-B8F9LmsE.js +0 -96
  529. package/dist/grip-vertical-BVxcjdfr.js +0 -54
  530. package/dist/info-iUmX3uDk.js +0 -32
  531. package/dist/input-CdQNCPgH.d.ts +0 -8
  532. package/dist/input.cva-BsHgYa-L.d.ts +0 -80
  533. package/dist/input.cva-DJA8ovm_.js +0 -208
  534. package/dist/inspection-model-LuI36xTg.js +0 -1339
  535. package/dist/link.cva-DMTHZiJG.js +0 -12
  536. package/dist/number-field-CUDbenNV.d.ts +0 -8
  537. package/dist/number-range-input-DZGrcvjL.d.ts +0 -8
  538. package/dist/outline.clsx-50W_vNDl.js +0 -6
  539. package/dist/password-input-fYN20cQO.d.ts +0 -8
  540. package/dist/popover.cva-Bhud1wnp.js +0 -5
  541. package/dist/query-autocomplete-CfuQeiYG.d.ts +0 -14
  542. package/dist/query-select-CuT_sE6a.d.ts +0 -15
  543. package/dist/queryAutocomplete.types-tl3r6iaY.d.ts +0 -27
  544. package/dist/radio-group-B3ccPf0p.d.ts +0 -9
  545. package/dist/rhf/autocomplete.d.ts +0 -3
  546. package/dist/rhf/autocomplete.js +0 -8
  547. package/dist/rhf/checkbox-group.d.ts +0 -3
  548. package/dist/rhf/checkbox-group.js +0 -8
  549. package/dist/rhf/checkbox.d.ts +0 -3
  550. package/dist/rhf/checkbox.js +0 -8
  551. package/dist/rhf/date-picker.d.ts +0 -3
  552. package/dist/rhf/date-picker.js +0 -9
  553. package/dist/rhf/date-range-picker.d.ts +0 -3
  554. package/dist/rhf/date-range-picker.js +0 -9
  555. package/dist/rhf/date-time-picker.d.ts +0 -3
  556. package/dist/rhf/date-time-picker.js +0 -9
  557. package/dist/rhf/file-input.d.ts +0 -3
  558. package/dist/rhf/file-input.js +0 -6
  559. package/dist/rhf/file-upload.d.ts +0 -3
  560. package/dist/rhf/file-upload.js +0 -6
  561. package/dist/rhf/input.d.ts +0 -3
  562. package/dist/rhf/input.js +0 -6
  563. package/dist/rhf/inputs.d.ts +0 -4
  564. package/dist/rhf/inputs.js +0 -2
  565. package/dist/rhf/number-field.d.ts +0 -3
  566. package/dist/rhf/number-field.js +0 -6
  567. package/dist/rhf/number-range-input.d.ts +0 -3
  568. package/dist/rhf/number-range-input.js +0 -6
  569. package/dist/rhf/password-input.d.ts +0 -3
  570. package/dist/rhf/password-input.js +0 -6
  571. package/dist/rhf/query-autocomplete.d.ts +0 -2
  572. package/dist/rhf/query-autocomplete.js +0 -8
  573. package/dist/rhf/query-select.d.ts +0 -2
  574. package/dist/rhf/query-select.js +0 -8
  575. package/dist/rhf/radio-group.d.ts +0 -3
  576. package/dist/rhf/radio-group.js +0 -8
  577. package/dist/rhf/rich-text-editor.d.ts +0 -3
  578. package/dist/rhf/rich-text-editor.js +0 -6
  579. package/dist/rhf/select.d.ts +0 -3
  580. package/dist/rhf/select.js +0 -8
  581. package/dist/rhf/slider.d.ts +0 -3
  582. package/dist/rhf/slider.js +0 -6
  583. package/dist/rhf/switch.d.ts +0 -3
  584. package/dist/rhf/switch.js +0 -8
  585. package/dist/rhf/text-area.d.ts +0 -3
  586. package/dist/rhf/text-area.js +0 -6
  587. package/dist/rhf/time-picker.d.ts +0 -3
  588. package/dist/rhf/time-picker.js +0 -9
  589. package/dist/rhf/toggle-group.d.ts +0 -3
  590. package/dist/rhf/toggle-group.js +0 -6
  591. package/dist/rhf-t348TCCL.js +0 -256
  592. package/dist/rhf.d.ts +0 -106
  593. package/dist/rhf.js +0 -117
  594. package/dist/rich-text-editor-B-Onl7T8.d.ts +0 -8
  595. package/dist/select-B4a52eWW.d.ts +0 -16
  596. package/dist/selectDesktop.cva-CHAMxhfO.js +0 -69
  597. package/dist/slider-dNj9jruO.d.ts +0 -8
  598. package/dist/stepper.cva-CZ0Kj-s7.js +0 -116
  599. package/dist/style-merge.util-zLimKwt6.d.ts +0 -40
  600. package/dist/styles/app-canvas.css +0 -733
  601. package/dist/styles/color-utilities.css +0 -20
  602. package/dist/styles/configurator.css +0 -3280
  603. package/dist/switch-C--iWnY8.d.ts +0 -9
  604. package/dist/switch.cva-BX3HOxbL.js +0 -27
  605. package/dist/switch.cva-CWNzmdRc.d.ts +0 -16
  606. package/dist/table.cva-DlMT-zLD.js +0 -48
  607. package/dist/tag.cva-B3MudLeC.js +0 -55
  608. package/dist/tanstack/inputs.d.ts +0 -5
  609. package/dist/tanstack/inputs.js +0 -3
  610. package/dist/tanstack/query-autocomplete.d.ts +0 -2
  611. package/dist/tanstack/query-autocomplete.js +0 -2
  612. package/dist/tanstack/query-select.d.ts +0 -2
  613. package/dist/tanstack/query-select.js +0 -2
  614. package/dist/text-area-DQAtpOQp.d.ts +0 -8
  615. package/dist/theme-model-DtYPxNvH.js +0 -406
  616. package/dist/theme-model-T1zIdBg8.d.ts +0 -12
  617. package/dist/time-picker-DoGfbil6.d.ts +0 -9
  618. package/dist/toggle-group-C1nMDOwz.d.ts +0 -9
  619. package/dist/toggleGroup.cva-MbpaEBg1.js +0 -35
  620. package/dist/toggleGroup.types-Bp43zbSQ.d.ts +0 -59
  621. package/dist/typography.cva-D1JOEYl-.d.ts +0 -36
  622. package/dist/typography.cva-iD15k56p.js +0 -51
  623. package/dist/uiConfig.context-BS3r_kTS.js +0 -381
  624. package/dist/underline-66hmELxa.js +0 -81
  625. package/dist/upload-CXU83BJ4.js +0 -30
  626. package/dist/useFieldAccessibility-CcBTgGfm.js +0 -102
  627. package/dist/useFormAutosave-BD_TFqDF.js +0 -198
  628. package/dist/useQueryAutocomplete-CraXvRm_.js +0 -152
  629. package/dist/useTableColumnConfig-aVUWC2Mp.js +0 -892
  630. package/dist/useTableNav-Ckj5PBRk.d.ts +0 -292
  631. package/dist/x-B6vfz8Ps.js +0 -23
  632. package/dist/zod.utils-DrrPDT9v.js +0 -24
  633. package/rulesync.jsonc +0 -11
  634. package/scripts/generate-rules.mjs +0 -34
  635. package/src/configurator/README.md +0 -77
  636. package/dist/{import-BE0r63d8.js → import-D_3dPATF.js} +2 -2
  637. package/dist/{link.context-J7aQtMOr.js → link.context-TPjDtjw3.js} +1 -1
  638. package/dist/{router.context-B4FvsTim.js → router.context-MckTbHw9.js} +1 -1
  639. package/dist/{uiOverrides.context-BTCH9y5a.js → uiOverrides.context-DNEQlTx0.js} +1 -1
  640. package/dist/{useIntersectionObserver-DYfHnGGU.js → useIntersectionObserver-DFAhTsV0.js} +1 -1
  641. package/dist/{useLocalStorage-PlcaJ1tP.js → useLocalStorage-CctQvyqD.js} +1 -1
@@ -1,2253 +0,0 @@
1
- import { t as createLucideIcon } from "../createLucideIcon-LcezOE4z.js";
2
- import { t as ChevronDown } from "../chevron-down-B4Pr8bD3.js";
3
- import { t as ChevronRight } from "../chevron-right-3nKJR5Bb.js";
4
- import { a as InspectorDetails, c as useUIConfiguration, f as Sun, i as HighlightOverlay, m as Moon, p as Pin, r as getBoxHighlights, t as inspectElement } from "../inspection-model-LuI36xTg.js";
5
- import { i as Search } from "../selectDesktop.cva-CHAMxhfO.js";
6
- import { t as Upload } from "../upload-CXU83BJ4.js";
7
- import { t as X } from "../x-B6vfz8Ps.js";
8
- import { memo, useCallback, useEffect, useMemo, useReducer, useRef, useState } from "react";
9
- import { c } from "react/compiler-runtime";
10
- import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
11
- //#region ../../node_modules/.bun/lucide-react@1.43.0+83d5fd7b249dbeef/node_modules/lucide-react/dist/esm/icons/code-xml.mjs
12
- /**
13
- * @license lucide-react v1.43.0 - ISC
14
- *
15
- * This source code is licensed under the ISC license.
16
- * See the LICENSE file in the root directory of this source tree.
17
- */
18
- const __iconData$9 = {
19
- name: "code-xml",
20
- size: 24,
21
- node: [
22
- ["path", {
23
- d: "m18 16 4-4-4-4",
24
- key: "1inbqp"
25
- }],
26
- ["path", {
27
- d: "m6 8-4 4 4 4",
28
- key: "15zrgr"
29
- }],
30
- ["path", {
31
- d: "m14.5 4-5 16",
32
- key: "e7oirm"
33
- }]
34
- ],
35
- aliases: ["code-2"]
36
- };
37
- __iconData$9.node;
38
- const CodeXml = createLucideIcon(__iconData$9);
39
- //#endregion
40
- //#region ../../node_modules/.bun/lucide-react@1.43.0+83d5fd7b249dbeef/node_modules/lucide-react/dist/esm/icons/download.mjs
41
- /**
42
- * @license lucide-react v1.43.0 - ISC
43
- *
44
- * This source code is licensed under the ISC license.
45
- * See the LICENSE file in the root directory of this source tree.
46
- */
47
- const __iconData$8 = {
48
- name: "download",
49
- size: 24,
50
- node: [
51
- ["path", {
52
- d: "M12 15V3",
53
- key: "m9g1x1"
54
- }],
55
- ["path", {
56
- d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",
57
- key: "ih7n3h"
58
- }],
59
- ["path", {
60
- d: "m7 10 5 5 5-5",
61
- key: "brsn70"
62
- }]
63
- ]
64
- };
65
- __iconData$8.node;
66
- const Download = createLucideIcon(__iconData$8);
67
- //#endregion
68
- //#region ../../node_modules/.bun/lucide-react@1.43.0+83d5fd7b249dbeef/node_modules/lucide-react/dist/esm/icons/frame.mjs
69
- /**
70
- * @license lucide-react v1.43.0 - ISC
71
- *
72
- * This source code is licensed under the ISC license.
73
- * See the LICENSE file in the root directory of this source tree.
74
- */
75
- const __iconData$7 = {
76
- name: "frame",
77
- size: 24,
78
- node: [
79
- ["line", {
80
- x1: "22",
81
- x2: "2",
82
- y1: "6",
83
- y2: "6",
84
- key: "15w7dq"
85
- }],
86
- ["line", {
87
- x1: "22",
88
- x2: "2",
89
- y1: "18",
90
- y2: "18",
91
- key: "1ip48p"
92
- }],
93
- ["line", {
94
- x1: "6",
95
- x2: "6",
96
- y1: "2",
97
- y2: "22",
98
- key: "a2lnyx"
99
- }],
100
- ["line", {
101
- x1: "18",
102
- x2: "18",
103
- y1: "2",
104
- y2: "22",
105
- key: "8vb6jd"
106
- }]
107
- ]
108
- };
109
- __iconData$7.node;
110
- const Frame = createLucideIcon(__iconData$7);
111
- //#endregion
112
- //#region ../../node_modules/.bun/lucide-react@1.43.0+83d5fd7b249dbeef/node_modules/lucide-react/dist/esm/icons/hand.mjs
113
- /**
114
- * @license lucide-react v1.43.0 - ISC
115
- *
116
- * This source code is licensed under the ISC license.
117
- * See the LICENSE file in the root directory of this source tree.
118
- */
119
- const __iconData$6 = {
120
- name: "hand",
121
- size: 24,
122
- node: [
123
- ["path", {
124
- d: "M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",
125
- key: "1fvzgz"
126
- }],
127
- ["path", {
128
- d: "M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",
129
- key: "1kc0my"
130
- }],
131
- ["path", {
132
- d: "M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",
133
- key: "10h0bg"
134
- }],
135
- ["path", {
136
- d: "M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",
137
- key: "1s1gnw"
138
- }]
139
- ]
140
- };
141
- __iconData$6.node;
142
- const Hand = createLucideIcon(__iconData$6);
143
- //#endregion
144
- //#region ../../node_modules/.bun/lucide-react@1.43.0+83d5fd7b249dbeef/node_modules/lucide-react/dist/esm/icons/monitor.mjs
145
- /**
146
- * @license lucide-react v1.43.0 - ISC
147
- *
148
- * This source code is licensed under the ISC license.
149
- * See the LICENSE file in the root directory of this source tree.
150
- */
151
- const __iconData$5 = {
152
- name: "monitor",
153
- size: 24,
154
- node: [
155
- ["rect", {
156
- width: "20",
157
- height: "14",
158
- x: "2",
159
- y: "3",
160
- rx: "2",
161
- key: "48i651"
162
- }],
163
- ["line", {
164
- x1: "8",
165
- x2: "16",
166
- y1: "21",
167
- y2: "21",
168
- key: "1svkeh"
169
- }],
170
- ["line", {
171
- x1: "12",
172
- x2: "12",
173
- y1: "17",
174
- y2: "21",
175
- key: "vw1qmm"
176
- }]
177
- ]
178
- };
179
- __iconData$5.node;
180
- const Monitor = createLucideIcon(__iconData$5);
181
- //#endregion
182
- //#region ../../node_modules/.bun/lucide-react@1.43.0+83d5fd7b249dbeef/node_modules/lucide-react/dist/esm/icons/mouse-pointer-2.mjs
183
- /**
184
- * @license lucide-react v1.43.0 - ISC
185
- *
186
- * This source code is licensed under the ISC license.
187
- * See the LICENSE file in the root directory of this source tree.
188
- */
189
- const __iconData$4 = {
190
- name: "mouse-pointer-2",
191
- size: 24,
192
- node: [["path", {
193
- d: "M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z",
194
- key: "edeuup"
195
- }]]
196
- };
197
- __iconData$4.node;
198
- const MousePointer2 = createLucideIcon(__iconData$4);
199
- //#endregion
200
- //#region ../../node_modules/.bun/lucide-react@1.43.0+83d5fd7b249dbeef/node_modules/lucide-react/dist/esm/icons/panel-left.mjs
201
- /**
202
- * @license lucide-react v1.43.0 - ISC
203
- *
204
- * This source code is licensed under the ISC license.
205
- * See the LICENSE file in the root directory of this source tree.
206
- */
207
- const __iconData$3 = {
208
- name: "panel-left",
209
- size: 24,
210
- node: [["rect", {
211
- width: "18",
212
- height: "18",
213
- x: "3",
214
- y: "3",
215
- rx: "2",
216
- key: "afitv7"
217
- }], ["path", {
218
- d: "M9 3v18",
219
- key: "fh3hqa"
220
- }]],
221
- aliases: ["sidebar"]
222
- };
223
- __iconData$3.node;
224
- const PanelLeft = createLucideIcon(__iconData$3);
225
- //#endregion
226
- //#region ../../node_modules/.bun/lucide-react@1.43.0+83d5fd7b249dbeef/node_modules/lucide-react/dist/esm/icons/panels-top-left.mjs
227
- /**
228
- * @license lucide-react v1.43.0 - ISC
229
- *
230
- * This source code is licensed under the ISC license.
231
- * See the LICENSE file in the root directory of this source tree.
232
- */
233
- const __iconData$2 = {
234
- name: "panels-top-left",
235
- size: 24,
236
- node: [
237
- ["rect", {
238
- width: "18",
239
- height: "18",
240
- x: "3",
241
- y: "3",
242
- rx: "2",
243
- key: "afitv7"
244
- }],
245
- ["path", {
246
- d: "M3 9h18",
247
- key: "1pudct"
248
- }],
249
- ["path", {
250
- d: "M9 21V9",
251
- key: "1oto5p"
252
- }]
253
- ],
254
- aliases: ["layout"]
255
- };
256
- __iconData$2.node;
257
- const PanelsTopLeft = createLucideIcon(__iconData$2);
258
- //#endregion
259
- //#region ../../node_modules/.bun/lucide-react@1.43.0+83d5fd7b249dbeef/node_modules/lucide-react/dist/esm/icons/scan-line.mjs
260
- /**
261
- * @license lucide-react v1.43.0 - ISC
262
- *
263
- * This source code is licensed under the ISC license.
264
- * See the LICENSE file in the root directory of this source tree.
265
- */
266
- const __iconData$1 = {
267
- name: "scan-line",
268
- size: 24,
269
- node: [
270
- ["path", {
271
- d: "M3 7V5a2 2 0 0 1 2-2h2",
272
- key: "aa7l1z"
273
- }],
274
- ["path", {
275
- d: "M17 3h2a2 2 0 0 1 2 2v2",
276
- key: "4qcy5o"
277
- }],
278
- ["path", {
279
- d: "M21 17v2a2 2 0 0 1-2 2h-2",
280
- key: "6vwrx8"
281
- }],
282
- ["path", {
283
- d: "M7 21H5a2 2 0 0 1-2-2v-2",
284
- key: "ioqczr"
285
- }],
286
- ["path", {
287
- d: "M7 12h10",
288
- key: "b7w52i"
289
- }]
290
- ]
291
- };
292
- __iconData$1.node;
293
- const ScanLine = createLucideIcon(__iconData$1);
294
- //#endregion
295
- //#region ../../node_modules/.bun/lucide-react@1.43.0+83d5fd7b249dbeef/node_modules/lucide-react/dist/esm/icons/settings-2.mjs
296
- /**
297
- * @license lucide-react v1.43.0 - ISC
298
- *
299
- * This source code is licensed under the ISC license.
300
- * See the LICENSE file in the root directory of this source tree.
301
- */
302
- const __iconData = {
303
- name: "settings-2",
304
- size: 24,
305
- node: [
306
- ["path", {
307
- d: "M14 17H5",
308
- key: "gfn3mx"
309
- }],
310
- ["path", {
311
- d: "M19 7h-9",
312
- key: "6i9tg"
313
- }],
314
- ["circle", {
315
- cx: "17",
316
- cy: "17",
317
- r: "3",
318
- key: "18b49y"
319
- }],
320
- ["circle", {
321
- cx: "7",
322
- cy: "7",
323
- r: "3",
324
- key: "dfmy0x"
325
- }]
326
- ]
327
- };
328
- __iconData.node;
329
- const Settings2 = createLucideIcon(__iconData);
330
- //#endregion
331
- //#region src/app-canvas/PageLayers.tsx
332
- const excluded = /* @__PURE__ */ new Set([
333
- "SCRIPT",
334
- "STYLE",
335
- "LINK",
336
- "META",
337
- "NOSCRIPT",
338
- "TEMPLATE"
339
- ]);
340
- function childrenOf(element) {
341
- return Array.from(element.children).filter((child) => child.namespaceURI === "http://www.w3.org/1999/xhtml" && !excluded.has(child.tagName) && !child.hidden && child.getClientRects().length > 0);
342
- }
343
- function labelOf(element) {
344
- return (element.getAttribute("aria-label") || element.getAttribute("alt") || (!element.children.length ? element.textContent?.trim().replace(/\s+/g, " ") : ""))?.slice(0, 48) || (element.id ? `#${element.id}` : "");
345
- }
346
- /** Only expanded branches are read and rendered; large pages do not create a second full DOM tree. */
347
- function PageLayers({ frame, title, selected, onSelect }) {
348
- const [root, setRoot] = useState(null);
349
- const [, refresh] = useReducer((value) => value + 1, 0);
350
- const expanded = useRef(/* @__PURE__ */ new WeakSet());
351
- const collapsed = useRef(/* @__PURE__ */ new WeakSet());
352
- const ids = useRef(/* @__PURE__ */ new WeakMap());
353
- const nextId = useRef(0);
354
- const [limit, setLimit] = useState(300);
355
- useEffect(() => {
356
- if (!frame) return;
357
- let observer;
358
- let scheduled = null;
359
- const update = () => {
360
- scheduled = null;
361
- refresh();
362
- };
363
- const attach = () => {
364
- observer?.disconnect();
365
- try {
366
- const doc = frame.contentDocument;
367
- const element = doc?.querySelector("#storybook-root, #app, #root") ?? doc?.body ?? null;
368
- setRoot(element);
369
- if (element) {
370
- observer = new MutationObserver(() => {
371
- if (scheduled === null) scheduled = requestAnimationFrame(update);
372
- });
373
- observer.observe(element, {
374
- childList: true,
375
- subtree: true,
376
- attributes: true,
377
- characterData: true
378
- });
379
- }
380
- } catch {
381
- setRoot(null);
382
- }
383
- };
384
- attach();
385
- frame.addEventListener("load", attach);
386
- return () => {
387
- observer?.disconnect();
388
- frame.removeEventListener("load", attach);
389
- if (scheduled !== null) cancelAnimationFrame(scheduled);
390
- };
391
- }, [frame]);
392
- useEffect(() => {
393
- if (!root || !selected || !root.contains(selected)) return;
394
- for (let parent = selected.parentElement; parent && parent !== root; parent = parent.parentElement) {
395
- expanded.current.add(parent);
396
- collapsed.current.delete(parent);
397
- }
398
- refresh();
399
- }, [root, selected]);
400
- const toggle = (element_0, open) => {
401
- if (open) {
402
- expanded.current.delete(element_0);
403
- collapsed.current.add(element_0);
404
- } else {
405
- expanded.current.add(element_0);
406
- collapsed.current.delete(element_0);
407
- }
408
- refresh();
409
- };
410
- let count = 0;
411
- let truncated = false;
412
- const render = (element_1, depth) => {
413
- if (++count > limit || depth > 60) {
414
- truncated = true;
415
- return null;
416
- }
417
- if (!ids.current.has(element_1)) ids.current.set(element_1, ++nextId.current);
418
- const children = childrenOf(element_1);
419
- const open_0 = !collapsed.current.has(element_1) && (depth < 2 || expanded.current.has(element_1));
420
- const label = labelOf(element_1);
421
- return /* @__PURE__ */ jsxs("div", {
422
- role: "treeitem",
423
- "aria-label": `${element_1.localName}${label ? ` ${label}` : ""}`,
424
- "aria-level": depth + 1,
425
- "aria-selected": element_1 === selected,
426
- "aria-expanded": children.length ? open_0 : void 0,
427
- children: [/* @__PURE__ */ jsxs("div", {
428
- className: "povio-canvas-layer-row",
429
- style: { paddingLeft: 8 + depth * 12 },
430
- children: [children.length ? /* @__PURE__ */ jsx("button", {
431
- className: "povio-canvas-layer-toggle",
432
- "aria-label": `${open_0 ? "Collapse" : "Expand"} ${element_1.localName}${label ? ` ${label}` : ""}`,
433
- onClick: () => toggle(element_1, open_0),
434
- children: open_0 ? /* @__PURE__ */ jsx(ChevronDown, { size: 12 }) : /* @__PURE__ */ jsx(ChevronRight, { size: 12 })
435
- }) : /* @__PURE__ */ jsx("span", { className: "povio-canvas-layer-spacer" }), /* @__PURE__ */ jsxs("button", {
436
- className: "povio-canvas-layer-select",
437
- title: `${element_1.localName}${label ? ` · ${label}` : ""}`,
438
- onClick: () => onSelect(element_1),
439
- onKeyDown: (event) => {
440
- if (event.key === "ArrowRight" && children.length && !open_0) {
441
- event.preventDefault();
442
- toggle(element_1, false);
443
- }
444
- if (event.key === "ArrowLeft" && open_0) {
445
- event.preventDefault();
446
- toggle(element_1, true);
447
- }
448
- },
449
- children: [/* @__PURE__ */ jsx("code", { children: element_1.localName }), label && /* @__PURE__ */ jsx("span", { children: label })]
450
- })]
451
- }), open_0 && !!children.length && /* @__PURE__ */ jsx("div", {
452
- role: "group",
453
- children: children.map((child) => render(child, depth + 1))
454
- })]
455
- }, ids.current.get(element_1));
456
- };
457
- const content = root ? childrenOf(root).map((element_2) => render(element_2, 0)) : null;
458
- return /* @__PURE__ */ jsxs("section", {
459
- className: "povio-canvas-layers",
460
- "aria-label": `Layers for ${title}`,
461
- children: [
462
- /* @__PURE__ */ jsxs("header", { children: [
463
- /* @__PURE__ */ jsx(CodeXml, { size: 14 }),
464
- /* @__PURE__ */ jsx("strong", { children: "Layers" }),
465
- /* @__PURE__ */ jsx("span", { children: title })
466
- ] }),
467
- /* @__PURE__ */ jsx("div", {
468
- role: "tree",
469
- "aria-label": "HTML layers",
470
- children: content
471
- }),
472
- !root && /* @__PURE__ */ jsx("p", { children: "Waiting for the page…" }),
473
- truncated && /* @__PURE__ */ jsx("button", {
474
- className: "povio-canvas-more-layers",
475
- onClick: () => setLimit((value_0) => value_0 + 300),
476
- children: "Show more layers"
477
- })
478
- ]
479
- });
480
- }
481
- //#endregion
482
- //#region src/app-canvas/CanvasInspector.tsx
483
- const unknownToken = () => false;
484
- const readOnly = () => {};
485
- /** Inspect the live iframe DOM using its own, unscaled viewport coordinates. */
486
- function useCanvasInspector(enabled, generation) {
487
- const [selection, setSelection] = useState(null);
488
- const [measurement, setMeasurement] = useState(null);
489
- const [pinned, setPinned] = useState(false);
490
- const [highlightKey, setHighlightKey] = useState(null);
491
- const hoverFrame = useRef(null);
492
- const pending = useRef(null);
493
- const clear = useCallback(() => {
494
- if (hoverFrame.current !== null) cancelAnimationFrame(hoverFrame.current);
495
- hoverFrame.current = null;
496
- pending.current = null;
497
- setSelection(null);
498
- setMeasurement(null);
499
- setPinned(false);
500
- setHighlightKey(null);
501
- }, []);
502
- useEffect(() => {
503
- if (!enabled) clear();
504
- }, [enabled, clear]);
505
- useEffect(() => {
506
- clear();
507
- }, [generation, clear]);
508
- useEffect(() => () => {
509
- if (hoverFrame.current !== null) cancelAnimationFrame(hoverFrame.current);
510
- }, []);
511
- const pick = useCallback((pageId, frame, clientX, clientY, pin) => {
512
- if (!enabled || pinned && !pin) return;
513
- const bounds = frame.getBoundingClientRect();
514
- if (!bounds.width || !bounds.height) return;
515
- try {
516
- const doc = frame.contentDocument;
517
- if (!doc) return;
518
- const x = (clientX - bounds.left) * frame.clientWidth / bounds.width;
519
- const y = (clientY - bounds.top) * frame.clientHeight / bounds.height;
520
- const hit = doc.elementFromPoint(x, y);
521
- const element = hit?.closest("button,input,textarea,select,a,label,[role],h1,h2,h3,h4,h5,h6,p") ?? hit;
522
- if (!element || element === doc.documentElement || element === doc.body || element.namespaceURI !== "http://www.w3.org/1999/xhtml") return;
523
- const target = element;
524
- setSelection((current) => current?.element === target ? current : {
525
- pageId,
526
- element: target
527
- });
528
- setHighlightKey(null);
529
- if (pin) setPinned((current_0) => !(current_0 && selection?.element === target));
530
- } catch {
531
- clear();
532
- }
533
- }, [
534
- enabled,
535
- pinned,
536
- selection,
537
- clear
538
- ]);
539
- const hover = useCallback((pageId_0, frame_0, x_0, y_0) => {
540
- if (!enabled || pinned) return;
541
- pending.current = () => pick(pageId_0, frame_0, x_0, y_0, false);
542
- if (hoverFrame.current !== null) return;
543
- hoverFrame.current = requestAnimationFrame(() => {
544
- hoverFrame.current = null;
545
- pending.current?.();
546
- pending.current = null;
547
- });
548
- }, [
549
- enabled,
550
- pinned,
551
- pick
552
- ]);
553
- const select = useCallback((pageId_1, frame_1, x_1, y_1) => {
554
- if (hoverFrame.current !== null) cancelAnimationFrame(hoverFrame.current);
555
- hoverFrame.current = null;
556
- pending.current = null;
557
- pick(pageId_1, frame_1, x_1, y_1, true);
558
- }, [pick]);
559
- useEffect(() => {
560
- if (!enabled || !selection) return;
561
- const { element: element_0 } = selection;
562
- const doc_0 = element_0.ownerDocument;
563
- const owner = doc_0.defaultView;
564
- if (!owner) return;
565
- let scheduled = null;
566
- const measure = () => {
567
- scheduled = null;
568
- if (!element_0.isConnected) {
569
- clear();
570
- return;
571
- }
572
- const rect = element_0.getBoundingClientRect();
573
- const snapshot = inspectElement(element_0, unknownToken);
574
- const details = highlightKey ? getBoxHighlights(element_0, highlightKey) : null;
575
- const spacing = highlightKey ? [] : [
576
- "padding.top",
577
- "padding.right",
578
- "padding.bottom",
579
- "padding.left",
580
- "margin.top",
581
- "margin.right",
582
- "margin.bottom",
583
- "margin.left",
584
- "gap.row",
585
- "gap.column"
586
- ].flatMap((key) => {
587
- const [kind, side] = key.split(".");
588
- const raw = kind === "padding" ? snapshot.box.padding[side] : kind === "margin" ? snapshot.box.margin[side] : snapshot.box.gap[side];
589
- if (!(Math.abs(Number.parseFloat(raw)) > 0)) return [];
590
- const details_0 = getBoxHighlights(element_0, key);
591
- const regions = details_0.regions.filter((region) => region.width > 0 && region.height > 0);
592
- return regions.length ? [{
593
- key,
594
- label: details_0.label,
595
- regions
596
- }] : [];
597
- });
598
- if (!highlightKey) {
599
- const seen = new Set(spacing.flatMap((item) => item.regions.map((region_0) => `${item.key}:${region_0.left}:${region_0.top}:${region_0.width}:${region_0.height}`)));
600
- for (const child of Array.from(element_0.children).slice(0, 80)) {
601
- if (child.namespaceURI !== "http://www.w3.org/1999/xhtml" || !child.getClientRects().length) continue;
602
- const style = owner.getComputedStyle(child);
603
- if (style.display === "none" || style.visibility === "hidden" || /^(absolute|fixed)$/.test(style.position)) continue;
604
- for (const side_0 of [
605
- "top",
606
- "right",
607
- "bottom",
608
- "left"
609
- ]) {
610
- if (!(Math.abs(Number.parseFloat(style.getPropertyValue(`margin-${side_0}`))) > 0)) continue;
611
- const key_0 = `margin.${side_0}`;
612
- const details_1 = getBoxHighlights(child, key_0);
613
- const regions_0 = details_1.regions.filter((region_1) => {
614
- const id = `${key_0}:${region_1.left}:${region_1.top}:${region_1.width}:${region_1.height}`;
615
- if (seen.has(id)) return false;
616
- seen.add(id);
617
- return region_1.width > 0 && region_1.height > 0;
618
- });
619
- if (regions_0.length) spacing.push({
620
- key: key_0,
621
- label: details_1.label,
622
- regions: regions_0
623
- });
624
- }
625
- }
626
- }
627
- const next = {
628
- snapshot,
629
- spacing,
630
- outline: {
631
- left: rect.left,
632
- top: rect.top,
633
- width: rect.width,
634
- height: rect.height
635
- },
636
- highlight: details && highlightKey ? {
637
- key: highlightKey,
638
- ...details
639
- } : null
640
- };
641
- setMeasurement((current_1) => JSON.stringify(current_1) === JSON.stringify(next) ? current_1 : next);
642
- };
643
- const schedule = () => {
644
- if (scheduled === null) scheduled = requestAnimationFrame(measure);
645
- };
646
- const mutations = new MutationObserver(schedule);
647
- mutations.observe(doc_0.documentElement, {
648
- subtree: true,
649
- childList: true,
650
- attributes: true,
651
- characterData: true
652
- });
653
- const resize = new ResizeObserver(schedule);
654
- resize.observe(element_0);
655
- owner.addEventListener("scroll", schedule, true);
656
- measure();
657
- return () => {
658
- mutations.disconnect();
659
- resize.disconnect();
660
- owner.removeEventListener("scroll", schedule, true);
661
- if (scheduled !== null) cancelAnimationFrame(scheduled);
662
- };
663
- }, [
664
- enabled,
665
- selection,
666
- highlightKey,
667
- clear
668
- ]);
669
- return {
670
- selection,
671
- selectElement: (pageId_2, element_1) => {
672
- setSelection({
673
- pageId: pageId_2,
674
- element: element_1
675
- });
676
- setPinned(true);
677
- setHighlightKey(null);
678
- },
679
- measurement,
680
- pinned,
681
- hover,
682
- select,
683
- clear,
684
- highlight: setHighlightKey,
685
- togglePin: () => setPinned((value) => !value)
686
- };
687
- }
688
- function CanvasInspectorPanel(t0) {
689
- const $ = c(21);
690
- const { inspector, onClose } = t0;
691
- let t1;
692
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
693
- t1 = /* @__PURE__ */ jsx("strong", { children: "Inspector view" });
694
- $[0] = t1;
695
- } else t1 = $[0];
696
- const t2 = !inspector.selection;
697
- let t3;
698
- if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
699
- t3 = /* @__PURE__ */ jsx(Pin, { size: 14 });
700
- $[1] = t3;
701
- } else t3 = $[1];
702
- let t4;
703
- if ($[2] !== inspector.pinned || $[3] !== inspector.togglePin || $[4] !== t2) {
704
- t4 = /* @__PURE__ */ jsx("button", {
705
- "aria-label": "Pin inspected element",
706
- "aria-pressed": inspector.pinned,
707
- disabled: t2,
708
- onClick: inspector.togglePin,
709
- children: t3
710
- });
711
- $[2] = inspector.pinned;
712
- $[3] = inspector.togglePin;
713
- $[4] = t2;
714
- $[5] = t4;
715
- } else t4 = $[5];
716
- let t5;
717
- if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
718
- t5 = /* @__PURE__ */ jsx(X, { size: 15 });
719
- $[6] = t5;
720
- } else t5 = $[6];
721
- let t6;
722
- if ($[7] !== onClose) {
723
- t6 = /* @__PURE__ */ jsx("button", {
724
- "aria-label": "Close inspector view",
725
- onClick: onClose,
726
- children: t5
727
- });
728
- $[7] = onClose;
729
- $[8] = t6;
730
- } else t6 = $[8];
731
- let t7;
732
- if ($[9] !== t4 || $[10] !== t6) {
733
- t7 = /* @__PURE__ */ jsxs("header", { children: [
734
- t1,
735
- t4,
736
- t6
737
- ] });
738
- $[9] = t4;
739
- $[10] = t6;
740
- $[11] = t7;
741
- } else t7 = $[11];
742
- const t8 = inspector.pinned ? "Selection pinned · click it again to unpin" : "Hover a component · click to pin";
743
- let t9;
744
- if ($[12] !== t8) {
745
- t9 = /* @__PURE__ */ jsx("p", {
746
- className: "povio-canvas-inspect-hint",
747
- children: t8
748
- });
749
- $[12] = t8;
750
- $[13] = t9;
751
- } else t9 = $[13];
752
- let t10;
753
- if ($[14] !== inspector.highlight || $[15] !== inspector.measurement) {
754
- t10 = inspector.measurement ? /* @__PURE__ */ jsx(InspectorDetails, {
755
- snapshot: inspector.measurement.snapshot,
756
- onSelect: readOnly,
757
- onHighlight: inspector.highlight
758
- }) : /* @__PURE__ */ jsx("p", {
759
- className: "povio-canvas-inspect-hint",
760
- children: "Inspect a live page to see its padding, margins, borders, radii and gaps."
761
- });
762
- $[14] = inspector.highlight;
763
- $[15] = inspector.measurement;
764
- $[16] = t10;
765
- } else t10 = $[16];
766
- let t11;
767
- if ($[17] !== t10 || $[18] !== t7 || $[19] !== t9) {
768
- t11 = /* @__PURE__ */ jsxs("aside", {
769
- className: "studio-inspector-panel povio-canvas-inspector",
770
- "aria-label": "Inspector view",
771
- children: [
772
- t7,
773
- t9,
774
- t10
775
- ]
776
- });
777
- $[17] = t10;
778
- $[18] = t7;
779
- $[19] = t9;
780
- $[20] = t11;
781
- } else t11 = $[20];
782
- return t11;
783
- }
784
- function CanvasInspectionOverlay(t0) {
785
- const $ = c(9);
786
- const { measurement, width } = t0;
787
- let t1;
788
- if ($[0] !== measurement.outline) {
789
- t1 = /* @__PURE__ */ jsx("div", {
790
- className: "studio-hover-outline",
791
- style: measurement.outline
792
- });
793
- $[0] = measurement.outline;
794
- $[1] = t1;
795
- } else t1 = $[1];
796
- let t2;
797
- if ($[2] !== measurement.highlight || $[3] !== measurement.spacing || $[4] !== width) {
798
- t2 = measurement.highlight ? /* @__PURE__ */ jsx(HighlightOverlay, {
799
- highlight: measurement.highlight,
800
- width
801
- }) : measurement.spacing.map((highlight) => /* @__PURE__ */ jsxs("div", {
802
- className: "povio-canvas-auto-spacing",
803
- children: [/* @__PURE__ */ jsx(HighlightOverlay, {
804
- highlight,
805
- width
806
- }), highlight.regions.map((region) => /* @__PURE__ */ jsx("span", {
807
- className: "povio-canvas-spacing-value",
808
- style: {
809
- left: region.left + region.width / 2,
810
- top: region.top + region.height / 2
811
- },
812
- children: highlight.label.split(": ")[1]
813
- }, `${region.left}:${region.top}:${region.width}:${region.height}`))]
814
- }, `${highlight.key}:${highlight.label}:${highlight.regions[0]?.left}:${highlight.regions[0]?.top}`));
815
- $[2] = measurement.highlight;
816
- $[3] = measurement.spacing;
817
- $[4] = width;
818
- $[5] = t2;
819
- } else t2 = $[5];
820
- let t3;
821
- if ($[6] !== t1 || $[7] !== t2) {
822
- t3 = /* @__PURE__ */ jsxs("div", {
823
- className: "povio-canvas-inspection-overlay",
824
- "aria-hidden": "true",
825
- children: [t1, t2]
826
- });
827
- $[6] = t1;
828
- $[7] = t2;
829
- $[8] = t3;
830
- } else t3 = $[8];
831
- return t3;
832
- }
833
- //#endregion
834
- //#region src/app-canvas/route-model.ts
835
- function joinPath(parent, path) {
836
- return `${parent.replace(/\/$/, "")}/${path.replace(/^\//, "")}`.replace(/\/{2,}/g, "/") || "/";
837
- }
838
- function resolvePath(path, params) {
839
- const missingParams = /* @__PURE__ */ new Set();
840
- const value = (key, optional = false) => {
841
- const actualKey = key || "_splat";
842
- const raw = params[actualKey];
843
- if (raw === void 0 || !optional && raw === "") {
844
- if (!optional) missingParams.add(actualKey);
845
- return "";
846
- }
847
- return actualKey === "_splat" ? raw.split("/").map(encodeURIComponent).join("/") : encodeURIComponent(raw);
848
- };
849
- return {
850
- href: `/${path.split("/").map((segment) => {
851
- if (segment.includes("{")) return segment.replace(/\{(-?)\$([^}]*)\}/g, (_, optional, key) => value(key, optional === "-"));
852
- return segment.startsWith("$") ? value(segment.slice(1)) : segment;
853
- }).filter(Boolean).join("/")}`,
854
- missingParams: [...missingParams]
855
- };
856
- }
857
- /** Catalog route destinations without executing loaders or needing every dynamic parameter. */
858
- function discoverCanvasPages(router, options = {}) {
859
- const records = [];
860
- const visited = /* @__PURE__ */ new Set();
861
- function visit(route, parentPath, ancestors, root = false) {
862
- if (visited.has(route)) return;
863
- visited.add(route);
864
- const localPath = route.path ?? route.options?.path;
865
- const path = route.fullPath ?? (localPath ? joinPath(parentPath, localPath) : parentPath);
866
- const id = route.id ?? route.options?.id ?? path;
867
- const children = Object.values(route.children ?? {});
868
- if (!root && localPath !== void 0 && !options.exclude?.includes(id)) records.push({
869
- route,
870
- id,
871
- path,
872
- ancestors,
873
- index: localPath === "/"
874
- });
875
- for (const child of children) visit(child, path, [...ancestors, id]);
876
- }
877
- visit(router.routeTree, "/", [], true);
878
- for (const route of Object.values(router.routesById ?? {})) if (!visited.has(route)) visit(route, "/", []);
879
- const byPath = /* @__PURE__ */ new Map();
880
- for (const record of records) {
881
- const key = record.path.replace(/\/$/, "") || "/";
882
- const existing = byPath.get(key);
883
- if (!existing || record.index || record.ancestors.length > existing.ancestors.length) byPath.set(key, record);
884
- }
885
- const selectedIds = new Set([...byPath.values()].map(({ id }) => id));
886
- const destinationIds = new Map(records.map((record) => [record.id, byPath.get(record.path.replace(/\/$/, "") || "/")?.id]));
887
- return [...byPath.values()].map(({ id, path, ancestors }) => {
888
- const example = options.examples?.[id];
889
- const resolved = resolvePath(path, example?.params ?? {});
890
- const query = new URLSearchParams();
891
- for (const [key, value] of Object.entries(example?.search ?? {})) if (value !== void 0) query.set(key, typeof value === "string" ? value : JSON.stringify(value));
892
- const queryString = query.toString();
893
- return {
894
- id,
895
- path,
896
- title: example?.title ?? (path === "/" ? "Home" : path),
897
- href: resolved.missingParams.length ? void 0 : `${resolved.href}${queryString ? `?${queryString}` : ""}`,
898
- parentId: [...ancestors].reverse().map((ancestor) => destinationIds.get(ancestor) ?? ancestor).find((ancestor) => ancestor !== id && selectedIds.has(ancestor)),
899
- missingParams: resolved.missingParams,
900
- kind: resolved.missingParams.length ? "unresolved" : "page"
901
- };
902
- });
903
- }
904
- /** Deterministic masonry placement. Full measured heights (including 20,000px pages) are never capped. */
905
- function layoutCanvasPages(pages, width, heights, positions = {}) {
906
- const pageWidth = Number.isFinite(width) && width > 0 ? width : 1440;
907
- const columns = Math.min(3, Math.max(1, pages.length));
908
- const bottoms = Array.from({ length: columns }, () => 0);
909
- for (const page of pages) {
910
- const saved = positions[page.id];
911
- if (!saved || !Number.isFinite(saved.x) || !Number.isFinite(saved.y)) continue;
912
- const measured = heights[page.id];
913
- const height = Number.isFinite(measured) && measured > 0 ? measured : 900;
914
- for (let i = 0; i < columns; i++) {
915
- const x = i * (pageWidth + 80);
916
- if (saved.x < x + pageWidth && saved.x + pageWidth > x) bottoms[i] = Math.max(bottoms[i], saved.y + height + 128);
917
- }
918
- }
919
- const result = [];
920
- for (const page of pages) {
921
- const measured = heights[page.id];
922
- const height = Number.isFinite(measured) && measured > 0 ? measured : 900;
923
- const column = bottoms.indexOf(Math.min(...bottoms));
924
- const saved = positions[page.id];
925
- const position = saved && Number.isFinite(saved.x) && Number.isFinite(saved.y) ? saved : {
926
- x: column * (pageWidth + 80),
927
- y: bottoms[column]
928
- };
929
- result.push({
930
- ...page,
931
- ...position,
932
- width: pageWidth,
933
- height
934
- });
935
- for (let i = 0; i < columns; i++) {
936
- const x = i * (pageWidth + 80);
937
- if (position.x < x + pageWidth && position.x + pageWidth > x) bottoms[i] = Math.max(bottoms[i], position.y + height + 128);
938
- }
939
- }
940
- return result;
941
- }
942
- /** Match observed navigation back to a catalog destination, including optional and splat routes. */
943
- function matchCanvasPageHref(pages, href, base = "http://canvas.local/") {
944
- let pathname;
945
- try {
946
- pathname = new URL(href, base).pathname.replace(/\/$/, "") || "/";
947
- } catch {
948
- return;
949
- }
950
- const exact = pages.find((page) => {
951
- if (!page.href) return false;
952
- try {
953
- return (new URL(page.href, base).pathname.replace(/\/$/, "") || "/") === pathname;
954
- } catch {
955
- return false;
956
- }
957
- });
958
- if (exact) return exact;
959
- const escape = (part) => part.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
960
- for (const page of pages) {
961
- const pattern = page.path.split("/").filter(Boolean).map((part) => {
962
- if (part === "$") return "/.+";
963
- if (part.startsWith("$")) return "/[^/]+";
964
- let text = "", cursor = 0;
965
- let optional = false;
966
- for (const match of part.matchAll(/\{(-?)\$([^}]*)\}/g)) {
967
- text += escape(part.slice(cursor, match.index)) + (match[2] ? "[^/]+" : ".+");
968
- cursor = match.index + match[0].length;
969
- optional ||= match[1] === "-";
970
- }
971
- text += escape(part.slice(cursor));
972
- return optional ? `(?:/${text})?` : `/${text}`;
973
- }).join("");
974
- if (new RegExp(`^${pattern || "/"}$`).test(pathname)) return page;
975
- }
976
- }
977
- //#endregion
978
- //#region src/app-canvas/protocol.ts
979
- const canvasProtocol = "povio-app-canvas-v1";
980
- function canvasFrameIdentity() {
981
- if (typeof window === "undefined" || window.parent === window) return null;
982
- try {
983
- const query = new URLSearchParams(window.location.search);
984
- const name = window.name.startsWith(`povio-app-canvas-v1:`) ? JSON.parse(window.name.slice(20)) : null;
985
- const id = query.get("__povio_canvas_frame") ?? name?.id;
986
- const token = query.get("__povio_canvas_token") ?? name?.token;
987
- const height = Number(query.get("__povio_canvas_height") ?? name?.viewportHeight ?? 900);
988
- return typeof id === "string" && typeof token === "string" && token.length > 10 ? {
989
- id,
990
- token,
991
- viewportHeight: Math.max(240, Math.min(4e3, height || 900))
992
- } : null;
993
- } catch {
994
- return null;
995
- }
996
- }
997
- const isAppCanvasFrame = () => !!canvasFrameIdentity();
998
- function validConfiguration(value) {
999
- if (!value || typeof value !== "object") return false;
1000
- const config = value;
1001
- return !!config.theme && [
1002
- "light",
1003
- "dark",
1004
- "theme"
1005
- ].every((key) => {
1006
- const tokens = config.theme[key];
1007
- return tokens && typeof tokens === "object" && Object.values(tokens).every((v) => typeof v === "string");
1008
- }) && !!config.config && typeof config.config === "object";
1009
- }
1010
- //#endregion
1011
- //#region src/app-canvas/manifest.ts
1012
- function createCanvasManifest() {
1013
- return {
1014
- version: 1,
1015
- positions: {},
1016
- examples: {},
1017
- manualEdges: [],
1018
- hiddenEdges: [],
1019
- breakpoint: "desktop"
1020
- };
1021
- }
1022
- function isRecord(value) {
1023
- return value !== null && typeof value === "object" && !Array.isArray(value);
1024
- }
1025
- function isJSON(value, ancestors = /* @__PURE__ */ new Set(), depth = 0) {
1026
- if (value === null || typeof value === "string" || typeof value === "boolean") return true;
1027
- if (typeof value === "number") return Number.isFinite(value);
1028
- if (typeof value !== "object" || depth > 30 || ancestors.has(value)) return false;
1029
- ancestors.add(value);
1030
- const valid = Object.values(value).every((child) => isJSON(child, ancestors, depth + 1));
1031
- ancestors.delete(value);
1032
- return valid;
1033
- }
1034
- /** Sanitize either stored JSON text or an imported value, retaining valid v1 entries. */
1035
- function parseCanvasManifest(input) {
1036
- const fallback = createCanvasManifest();
1037
- let value = input;
1038
- if (typeof value === "string") try {
1039
- value = JSON.parse(value);
1040
- } catch {
1041
- return fallback;
1042
- }
1043
- if (!isRecord(value) || value.version !== 1) return fallback;
1044
- const positions = Object.fromEntries(Object.entries(isRecord(value.positions) ? value.positions : {}).flatMap(([breakpoint, entries]) => {
1045
- if (!isRecord(entries)) return [];
1046
- return [[breakpoint, Object.fromEntries(Object.entries(entries).flatMap(([id, point]) => isRecord(point) && typeof point.x === "number" && Number.isFinite(point.x) && typeof point.y === "number" && Number.isFinite(point.y) ? [[id, {
1047
- x: point.x,
1048
- y: point.y
1049
- }]] : []))]];
1050
- }));
1051
- const examples = Object.fromEntries(Object.entries(isRecord(value.examples) ? value.examples : {}).flatMap(([id, example]) => {
1052
- if (!isRecord(example)) return [];
1053
- const clean = {};
1054
- if (typeof example.title === "string") clean.title = example.title;
1055
- if (isRecord(example.params)) clean.params = Object.fromEntries(Object.entries(example.params).filter((entry) => typeof entry[1] === "string"));
1056
- if (isRecord(example.search)) clean.search = Object.fromEntries(Object.entries(example.search).filter(([, item]) => isJSON(item)));
1057
- return [[id, clean]];
1058
- }));
1059
- const manualEdges = (Array.isArray(value.manualEdges) ? value.manualEdges : []).flatMap((edge) => isRecord(edge) && typeof edge.from === "string" && edge.from.length > 0 && typeof edge.to === "string" && edge.to.length > 0 ? [{
1060
- from: edge.from,
1061
- to: edge.to
1062
- }] : []);
1063
- return {
1064
- version: 1,
1065
- positions,
1066
- examples,
1067
- manualEdges: [...new Map(manualEdges.map((edge) => [JSON.stringify(edge), edge])).values()],
1068
- hiddenEdges: [...new Set((Array.isArray(value.hiddenEdges) ? value.hiddenEdges : []).filter((edge) => typeof edge === "string"))],
1069
- breakpoint: typeof value.breakpoint === "string" && value.breakpoint.length > 0 ? value.breakpoint : fallback.breakpoint
1070
- };
1071
- }
1072
- //#endregion
1073
- //#region src/app-canvas/AppCanvas.tsx
1074
- const defaultCanvasBreakpoints = [
1075
- {
1076
- id: "mobile",
1077
- label: "Mobile",
1078
- width: 390,
1079
- height: 844
1080
- },
1081
- {
1082
- id: "tablet",
1083
- label: "Tablet",
1084
- width: 768,
1085
- height: 1024
1086
- },
1087
- {
1088
- id: "desktop",
1089
- label: "Desktop",
1090
- width: 1440,
1091
- height: 900
1092
- }
1093
- ];
1094
- const emptyExamples = {};
1095
- const emptyExclude = [];
1096
- function readManifest(key) {
1097
- if (typeof window === "undefined") return createCanvasManifest();
1098
- try {
1099
- return parseCanvasManifest(localStorage.getItem(key));
1100
- } catch {
1101
- return createCanvasManifest();
1102
- }
1103
- }
1104
- const PageFrame = memo(function PageFrame(t0) {
1105
- const $ = c(16);
1106
- const { id, src, width, height, name, interact, inspect, onLoad, register } = t0;
1107
- let t1;
1108
- if ($[0] !== id || $[1] !== register) {
1109
- t1 = (element) => register(id, element);
1110
- $[0] = id;
1111
- $[1] = register;
1112
- $[2] = t1;
1113
- } else t1 = $[2];
1114
- const t2 = !interact && !inspect;
1115
- const t3 = interact ? 0 : -1;
1116
- const t4 = `Page ${id}`;
1117
- let t5;
1118
- if ($[3] !== id || $[4] !== onLoad) {
1119
- t5 = () => onLoad(id);
1120
- $[3] = id;
1121
- $[4] = onLoad;
1122
- $[5] = t5;
1123
- } else t5 = $[5];
1124
- let t6;
1125
- if ($[6] !== height || $[7] !== name || $[8] !== src || $[9] !== t1 || $[10] !== t2 || $[11] !== t3 || $[12] !== t4 || $[13] !== t5 || $[14] !== width) {
1126
- t6 = /* @__PURE__ */ jsx("iframe", {
1127
- ref: t1,
1128
- inert: t2,
1129
- tabIndex: t3,
1130
- title: t4,
1131
- name,
1132
- src,
1133
- width,
1134
- height,
1135
- className: "povio-canvas-frame",
1136
- onLoad: t5
1137
- });
1138
- $[6] = height;
1139
- $[7] = name;
1140
- $[8] = src;
1141
- $[9] = t1;
1142
- $[10] = t2;
1143
- $[11] = t3;
1144
- $[12] = t4;
1145
- $[13] = t5;
1146
- $[14] = width;
1147
- $[15] = t6;
1148
- } else t6 = $[15];
1149
- return t6;
1150
- });
1151
- /** Live route artboards. The camera transforms only the canvas, never the iframe viewport width. */
1152
- function AppCanvas({ router, examples = emptyExamples, exclude = emptyExclude, breakpoints = defaultCanvasBreakpoints, storageKey = "povio-app-canvas", frameUrl }) {
1153
- const configuration = useUIConfiguration();
1154
- const [manifest, setManifest] = useState(() => readManifest(storageKey));
1155
- const [runtime, setRuntime] = useState({});
1156
- const [selected, setSelected] = useState(null);
1157
- const [interact, setInteract] = useState(false);
1158
- const [inspectMode, setInspectMode] = useState(false);
1159
- const [dark, setDark] = useState(false);
1160
- const [mobilePanel, setMobilePanel] = useState(null);
1161
- const [query, setQuery] = useState("");
1162
- const [notice, setNotice] = useState("");
1163
- const [documentGeneration, setDocumentGeneration] = useState(0);
1164
- const [reload, setReload] = useState({});
1165
- const zoomOutput = useRef(null);
1166
- const importInput = useRef(null);
1167
- const viewport = useRef(null), world = useRef(null);
1168
- const frames = useRef(/* @__PURE__ */ new Map());
1169
- const [token] = useState(() => crypto.randomUUID());
1170
- const revision = useRef(0), camera = useRef({
1171
- x: 40,
1172
- y: 40,
1173
- zoom: .25
1174
- }), pendingCamera = useRef(null);
1175
- const pointer = useRef(null);
1176
- const cameraRevision = useRef(0);
1177
- const bp = breakpoints.find((item) => item.id === manifest.breakpoint) ?? breakpoints[breakpoints.length - 1] ?? defaultCanvasBreakpoints[2];
1178
- const inspector = useCanvasInspector(inspectMode, `${bp.id}:${documentGeneration}:${JSON.stringify(reload)}`);
1179
- const catalog = useMemo(() => discoverCanvasPages(router, {
1180
- examples: {
1181
- ...examples,
1182
- ...manifest.examples
1183
- },
1184
- exclude
1185
- }), [
1186
- router,
1187
- examples,
1188
- manifest.examples,
1189
- exclude
1190
- ]);
1191
- const heights = useMemo(() => Object.fromEntries(catalog.map((page) => [page.id, runtime[`${bp.id}:${page.id}:${page.href ?? ""}`]?.height ?? bp.height])), [
1192
- catalog,
1193
- runtime,
1194
- bp
1195
- ]);
1196
- const nodes = useMemo(() => layoutCanvasPages(catalog, bp.width, heights, manifest.positions[bp.id] ?? {}), [
1197
- catalog,
1198
- bp,
1199
- heights,
1200
- manifest.positions
1201
- ]);
1202
- const nodeMap = useMemo(() => new Map(nodes.map((node) => [node.id, node])), [nodes]);
1203
- const latest = useRef({
1204
- configuration: configuration.active,
1205
- dark,
1206
- interact,
1207
- bp,
1208
- catalog,
1209
- frameUrl
1210
- });
1211
- latest.current = {
1212
- configuration: configuration.active,
1213
- dark,
1214
- interact,
1215
- bp,
1216
- catalog,
1217
- frameUrl
1218
- };
1219
- const register = useCallback((id, frame) => {
1220
- if (frame) frames.current.set(id, frame);
1221
- else frames.current.delete(id);
1222
- }, []);
1223
- const paint = useCallback(() => {
1224
- if (world.current) world.current.style.transform = `translate3d(${camera.current.x}px,${camera.current.y}px,0) scale(${camera.current.zoom})`;
1225
- if (zoomOutput.current) zoomOutput.current.textContent = `${Math.round(camera.current.zoom * 1e3) / 10}%`;
1226
- const canvas = viewport.current?.closest(".povio-app-canvas");
1227
- if (canvas) canvas.setAttribute("data-camera-revision", String(++cameraRevision.current));
1228
- }, []);
1229
- const schedulePaint = useCallback(() => {
1230
- if (pendingCamera.current !== null) return;
1231
- pendingCamera.current = requestAnimationFrame(() => {
1232
- pendingCamera.current = null;
1233
- paint();
1234
- });
1235
- }, [paint]);
1236
- const send = useCallback((id_0, type = "configuration") => {
1237
- const frame_0 = frames.current.get(id_0);
1238
- if (!frame_0?.contentWindow) return;
1239
- const current = latest.current;
1240
- try {
1241
- frame_0.contentWindow.postMessage({
1242
- protocol: canvasProtocol,
1243
- id: id_0,
1244
- token,
1245
- viewportHeight: current.bp.height,
1246
- type,
1247
- configuration: current.configuration,
1248
- revision: revision.current,
1249
- dark: current.dark,
1250
- interact: current.interact
1251
- }, new URL(frame_0.src).origin);
1252
- } catch {
1253
- setNotice("This configuration could not be sent to the page. Check for non-serializable values.");
1254
- }
1255
- }, [token]);
1256
- const focusPage = useCallback((id_1) => {
1257
- const node_0 = nodeMap.get(id_1), view = viewport.current;
1258
- if (!node_0 || !view) return;
1259
- setSelected(id_1);
1260
- camera.current.zoom = Math.min(1, Math.max(.08, (view.clientWidth - 100) / node_0.width));
1261
- camera.current.x = 40 - node_0.x * camera.current.zoom;
1262
- camera.current.y = 40 - node_0.y * camera.current.zoom;
1263
- paint();
1264
- }, [nodeMap, paint]);
1265
- const focusRef = useRef(focusPage);
1266
- focusRef.current = focusPage;
1267
- const matchHref = useCallback((href) => matchCanvasPageHref(latest.current.catalog, href, window.location.href), []);
1268
- useEffect(() => {
1269
- const queue = /* @__PURE__ */ new Map();
1270
- let batch = 0;
1271
- const flush = () => {
1272
- batch = 0;
1273
- const changes = Array.from(queue);
1274
- queue.clear();
1275
- setRuntime((current_0) => {
1276
- const next = { ...current_0 };
1277
- for (const [key, change] of changes) next[key] = {
1278
- ...next[key],
1279
- ...change
1280
- };
1281
- return next;
1282
- });
1283
- };
1284
- const receive = (event) => {
1285
- const packet = event.data;
1286
- if (packet?.protocol !== "povio-app-canvas-v1" || packet.token !== token || typeof packet.id !== "string") return;
1287
- const frame_1 = frames.current.get(packet.id);
1288
- if (!frame_1 || event.source !== frame_1.contentWindow || event.origin !== new URL(frame_1.src).origin) return;
1289
- const key_0 = `${latest.current.bp.id}:${packet.id}:${latest.current.catalog.find((page_0) => page_0.id === packet.id)?.href ?? ""}`;
1290
- let change_0 = {};
1291
- if (packet.type === "ready") {
1292
- change_0 = {
1293
- ready: true,
1294
- href: packet.href,
1295
- timedOut: false
1296
- };
1297
- send(packet.id);
1298
- send(packet.id, "mode");
1299
- }
1300
- if (packet.type === "height" && typeof packet.height === "number" && Number.isFinite(packet.height) && packet.height > 0) change_0.height = packet.height;
1301
- if (packet.type === "warning" && typeof packet.warning === "string") change_0.warning = packet.warning;
1302
- if (packet.type === "ack" && typeof packet.revision === "number") change_0.revision = packet.revision;
1303
- if (packet.type === "navigate" && typeof packet.href === "string") {
1304
- const target = matchHref(packet.href);
1305
- if (target) focusRef.current(target.id);
1306
- else setNotice(`Navigation target is not in this canvas: ${packet.href}`);
1307
- return;
1308
- }
1309
- if (!Object.keys(change_0).length) return;
1310
- queue.set(key_0, {
1311
- ...queue.get(key_0),
1312
- ...change_0
1313
- });
1314
- if (!batch) batch = requestAnimationFrame(flush);
1315
- };
1316
- window.addEventListener("message", receive);
1317
- return () => {
1318
- window.removeEventListener("message", receive);
1319
- cancelAnimationFrame(batch);
1320
- };
1321
- }, [
1322
- token,
1323
- send,
1324
- matchHref
1325
- ]);
1326
- useEffect(() => {
1327
- const frame_2 = requestAnimationFrame(() => {
1328
- revision.current++;
1329
- for (const id_2 of frames.current.keys()) send(id_2);
1330
- });
1331
- return () => cancelAnimationFrame(frame_2);
1332
- }, [
1333
- configuration.active,
1334
- dark,
1335
- send
1336
- ]);
1337
- useEffect(() => {
1338
- for (const id_3 of frames.current.keys()) send(id_3, "mode");
1339
- }, [interact, send]);
1340
- useEffect(() => {
1341
- try {
1342
- localStorage.setItem(storageKey, JSON.stringify(manifest));
1343
- } catch {
1344
- setNotice("Browser storage is unavailable; use Export layout to save this canvas.");
1345
- }
1346
- }, [manifest, storageKey]);
1347
- useEffect(() => {
1348
- paint();
1349
- const element = viewport.current;
1350
- if (!element) return;
1351
- const wheel = (event_0) => {
1352
- event_0.preventDefault();
1353
- if (event_0.ctrlKey || event_0.metaKey) {
1354
- const box = element.getBoundingClientRect();
1355
- const x = event_0.clientX - box.left, y = event_0.clientY - box.top;
1356
- const previous = camera.current.zoom;
1357
- const unit = event_0.deltaMode === 1 ? 16 : event_0.deltaMode === 2 ? element.clientHeight : 1;
1358
- const next_0 = Math.max(.005, Math.min(2, previous * Math.exp(-event_0.deltaY * unit * .01)));
1359
- camera.current.x = x - (x - camera.current.x) * next_0 / previous;
1360
- camera.current.y = y - (y - camera.current.y) * next_0 / previous;
1361
- camera.current.zoom = next_0;
1362
- } else {
1363
- camera.current.x -= event_0.deltaX;
1364
- camera.current.y -= event_0.deltaY;
1365
- }
1366
- schedulePaint();
1367
- };
1368
- element.addEventListener("wheel", wheel, { passive: false });
1369
- return () => {
1370
- element.removeEventListener("wheel", wheel);
1371
- if (pendingCamera.current !== null) cancelAnimationFrame(pendingCamera.current);
1372
- pendingCamera.current = null;
1373
- };
1374
- }, [paint, schedulePaint]);
1375
- const fit = () => {
1376
- if (!nodes.length || !viewport.current) return;
1377
- const left = Math.min(...nodes.map((n) => n.x)), top = Math.min(...nodes.map((n_0) => n_0.y));
1378
- const width = Math.max(...nodes.map((n_1) => n_1.x + n_1.width)) - left, height = Math.max(...nodes.map((n_2) => n_2.y + n_2.height + 48)) - top;
1379
- camera.current.zoom = Math.max(.005, Math.min(1, (viewport.current.clientWidth - 80) / width, (viewport.current.clientHeight - 80) / height));
1380
- camera.current.x = 40 - left * camera.current.zoom;
1381
- camera.current.y = 40 - top * camera.current.zoom;
1382
- paint();
1383
- };
1384
- const zoomTo = (value) => {
1385
- const view_0 = viewport.current;
1386
- if (!view_0) return;
1387
- const previous_0 = camera.current.zoom, next_1 = Math.max(.005, Math.min(2, value));
1388
- camera.current.x = view_0.clientWidth / 2 - (view_0.clientWidth / 2 - camera.current.x) * next_1 / previous_0;
1389
- camera.current.y = view_0.clientHeight / 2 - (view_0.clientHeight / 2 - camera.current.y) * next_1 / previous_0;
1390
- camera.current.zoom = next_1;
1391
- paint();
1392
- };
1393
- const stepZoom = (direction) => {
1394
- const stops = [
1395
- .005,
1396
- .01,
1397
- .02,
1398
- .05,
1399
- .1,
1400
- .25,
1401
- .5,
1402
- .75,
1403
- 1,
1404
- 1.5,
1405
- 2
1406
- ];
1407
- const current_1 = camera.current.zoom;
1408
- 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);
1409
- if (next_2 !== void 0) zoomTo(next_2);
1410
- };
1411
- const startPan = (event_1) => {
1412
- if (inspectMode && event_1.target.closest(".povio-canvas-frame-cover")) return;
1413
- if (event_1.button !== 0 || event_1.target.closest("button:not(.povio-canvas-frame-cover),input,select,.povio-canvas-node-header")) return;
1414
- event_1.currentTarget.setPointerCapture(event_1.pointerId);
1415
- pointer.current = {
1416
- id: event_1.pointerId,
1417
- x: event_1.clientX,
1418
- y: event_1.clientY,
1419
- startX: camera.current.x,
1420
- startY: camera.current.y
1421
- };
1422
- };
1423
- const move = (event_2) => {
1424
- const current_2 = pointer.current;
1425
- if (!current_2 || current_2.id !== event_2.pointerId) return;
1426
- const dx = event_2.clientX - current_2.x, dy = event_2.clientY - current_2.y;
1427
- if (current_2.node) {
1428
- const element_0 = world.current?.querySelector(`[data-node-index="${nodes.findIndex((n_3) => n_3.id === current_2.node)}"]`);
1429
- if (element_0) {
1430
- element_0.style.left = `${current_2.nodeX + dx / camera.current.zoom}px`;
1431
- element_0.style.top = `${current_2.nodeY + dy / camera.current.zoom}px`;
1432
- }
1433
- } else {
1434
- camera.current.x = current_2.startX + dx;
1435
- camera.current.y = current_2.startY + dy;
1436
- schedulePaint();
1437
- }
1438
- };
1439
- const end = (event_3) => {
1440
- const current_3 = pointer.current;
1441
- if (!current_3 || current_3.id !== event_3.pointerId) return;
1442
- if (current_3.node) {
1443
- const position = {
1444
- x: current_3.nodeX + (event_3.clientX - current_3.x) / camera.current.zoom,
1445
- y: current_3.nodeY + (event_3.clientY - current_3.y) / camera.current.zoom
1446
- };
1447
- setManifest((m) => ({
1448
- ...m,
1449
- positions: {
1450
- ...m.positions,
1451
- [bp.id]: {
1452
- ...m.positions[bp.id],
1453
- [current_3.node]: position
1454
- }
1455
- }
1456
- }));
1457
- }
1458
- pointer.current = null;
1459
- if (event_3.currentTarget.hasPointerCapture(event_3.pointerId)) event_3.currentTarget.releasePointerCapture(event_3.pointerId);
1460
- };
1461
- const onLoad = useCallback((id_4) => {
1462
- send(id_4);
1463
- send(id_4, "mode");
1464
- }, [send]);
1465
- useEffect(() => {
1466
- const timer = setTimeout(() => setRuntime((current_4) => {
1467
- const next_3 = { ...current_4 };
1468
- for (const page_1 of latest.current.catalog) {
1469
- const key_1 = `${latest.current.bp.id}:${page_1.id}:${page_1.href ?? ""}`;
1470
- if (page_1.href && !next_3[key_1]?.ready) next_3[key_1] = {
1471
- ...next_3[key_1],
1472
- timedOut: true
1473
- };
1474
- }
1475
- return next_3;
1476
- }), 15e3);
1477
- return () => clearTimeout(timer);
1478
- }, [
1479
- bp.id,
1480
- catalog,
1481
- reload
1482
- ]);
1483
- const exportLayout = () => {
1484
- const url = URL.createObjectURL(new Blob([JSON.stringify(manifest, null, 2)], { type: "application/json" }));
1485
- const a = document.createElement("a");
1486
- a.href = url;
1487
- a.download = "povio-app-canvas.json";
1488
- a.click();
1489
- setTimeout(() => URL.revokeObjectURL(url), 1e3);
1490
- };
1491
- const width_0 = Math.max(1, ...nodes.map((n_4) => n_4.x + n_4.width + 80)), height_0 = Math.max(1, ...nodes.map((n_5) => n_5.y + n_5.height + 128));
1492
- const ready = nodes.filter((n_6) => runtime[`${bp.id}:${n_6.id}:${n_6.href ?? ""}`]?.ready).length;
1493
- return /* @__PURE__ */ jsxs("section", {
1494
- className: "povio-app-canvas",
1495
- "data-mobile-panel": mobilePanel ?? "none",
1496
- "data-inspecting": inspectMode,
1497
- "aria-label": "App canvas",
1498
- "data-ready-count": ready,
1499
- "data-page-count": nodes.length,
1500
- "data-camera-revision": "0",
1501
- children: [
1502
- /* @__PURE__ */ jsx("input", {
1503
- ref: importInput,
1504
- type: "file",
1505
- accept: "application/json,.json",
1506
- hidden: true,
1507
- "aria-label": "Import canvas layout",
1508
- onChange: async (event_4) => {
1509
- const file = event_4.currentTarget.files?.[0];
1510
- event_4.currentTarget.value = "";
1511
- if (!file) return;
1512
- try {
1513
- const raw = JSON.parse(await file.text());
1514
- if (raw?.version !== 1) throw new Error("version");
1515
- setManifest(parseCanvasManifest(raw));
1516
- setRuntime({});
1517
- setDocumentGeneration((value_2) => value_2 + 1);
1518
- setNotice("Layout imported.");
1519
- } catch {
1520
- setNotice("Choose a valid version 1 canvas layout JSON file.");
1521
- }
1522
- }
1523
- }),
1524
- /* @__PURE__ */ jsxs("div", {
1525
- className: "povio-canvas-body",
1526
- children: [
1527
- /* @__PURE__ */ jsxs("aside", {
1528
- className: "povio-canvas-catalog",
1529
- "aria-label": "Page catalog",
1530
- children: [
1531
- /* @__PURE__ */ jsxs("div", {
1532
- className: "povio-canvas-brand",
1533
- children: [/* @__PURE__ */ jsx("strong", { children: "Pages" }), /* @__PURE__ */ jsx("span", {
1534
- className: "povio-canvas-page-count",
1535
- children: nodes.length
1536
- })]
1537
- }),
1538
- /* @__PURE__ */ jsxs("div", {
1539
- className: "povio-canvas-search",
1540
- children: [
1541
- /* @__PURE__ */ jsx(Search, { size: 14 }),
1542
- /* @__PURE__ */ jsx("input", {
1543
- "aria-label": "Find page",
1544
- placeholder: "Find page…",
1545
- value: query,
1546
- onChange: (event_5) => setQuery(event_5.target.value)
1547
- }),
1548
- /* @__PURE__ */ jsx("button", {
1549
- className: "povio-canvas-panel-close",
1550
- "aria-label": "Close pages panel",
1551
- onClick: () => setMobilePanel(null),
1552
- children: /* @__PURE__ */ jsx(X, { size: 16 })
1553
- })
1554
- ]
1555
- }),
1556
- /* @__PURE__ */ jsxs("div", {
1557
- className: "povio-canvas-page-list",
1558
- children: [nodes.filter((node_1) => `${node_1.title} ${node_1.path}`.toLowerCase().includes(query.toLowerCase())).map((node_2) => /* @__PURE__ */ jsxs("button", {
1559
- "aria-pressed": selected === node_2.id,
1560
- onClick: () => {
1561
- focusPage(node_2.id);
1562
- setMobilePanel(null);
1563
- },
1564
- children: [/* @__PURE__ */ jsx(Frame, { size: 15 }), /* @__PURE__ */ jsxs("span", {
1565
- className: "povio-canvas-page-label",
1566
- children: [/* @__PURE__ */ jsx("strong", { children: node_2.title }), node_2.kind === "unresolved" && /* @__PURE__ */ jsx("small", { children: "Needs parameters" })]
1567
- })]
1568
- }, node_2.id)), selected && nodeMap.get(selected)?.href && /* @__PURE__ */ jsx(PageLayers, {
1569
- frame: frames.current.get(selected) ?? null,
1570
- title: nodeMap.get(selected).title,
1571
- selected: inspector.selection?.pageId === selected ? inspector.selection.element : void 0,
1572
- onSelect: (element_1) => {
1573
- setInteract(false);
1574
- setInspectMode(true);
1575
- inspector.selectElement(selected, element_1);
1576
- setMobilePanel(null);
1577
- requestAnimationFrame(() => {
1578
- const node_3 = nodeMap.get(selected), view_1 = viewport.current;
1579
- if (!node_3 || !view_1 || !element_1.isConnected) return;
1580
- const rect = element_1.getBoundingClientRect();
1581
- camera.current.x = view_1.clientWidth / 2 - (node_3.x + rect.left + rect.width / 2) * camera.current.zoom;
1582
- camera.current.y = view_1.clientHeight / 2 - (node_3.y + 48 + rect.top + rect.height / 2) * camera.current.zoom;
1583
- paint();
1584
- });
1585
- }
1586
- }, `${bp.id}:${documentGeneration}:${reload[selected] ?? 0}:${selected}:${nodeMap.get(selected)?.href}`)]
1587
- }),
1588
- /* @__PURE__ */ jsxs("div", {
1589
- className: "povio-canvas-sidebar-actions",
1590
- children: [
1591
- /* @__PURE__ */ jsx("button", {
1592
- className: "povio-canvas-file-action",
1593
- onClick: exportLayout,
1594
- "aria-label": "Export layout",
1595
- title: "Export layout",
1596
- children: /* @__PURE__ */ jsx(Download, { size: 16 })
1597
- }),
1598
- /* @__PURE__ */ jsx("button", {
1599
- className: "povio-canvas-file-action",
1600
- onClick: () => importInput.current?.click(),
1601
- "aria-label": "Import layout",
1602
- title: "Import layout",
1603
- children: /* @__PURE__ */ jsx(Upload, { size: 16 })
1604
- }),
1605
- /* @__PURE__ */ jsxs("span", {
1606
- className: "povio-canvas-ready",
1607
- role: "status",
1608
- children: [
1609
- /* @__PURE__ */ jsx("i", {}),
1610
- ready,
1611
- "/",
1612
- nodes.length,
1613
- " pages ready"
1614
- ]
1615
- })
1616
- ]
1617
- })
1618
- ]
1619
- }),
1620
- /* @__PURE__ */ jsxs("div", {
1621
- ref: viewport,
1622
- className: "povio-canvas-viewport",
1623
- onKeyDownCapture: (event_6) => {
1624
- if (inspectMode && event_6.key === "Escape") {
1625
- event_6.preventDefault();
1626
- inspector.clear();
1627
- }
1628
- },
1629
- onPointerDown: startPan,
1630
- onPointerMove: move,
1631
- onPointerUp: end,
1632
- onPointerCancel: (event_7) => {
1633
- const current_5 = pointer.current;
1634
- if (current_5?.node) {
1635
- const element_2 = world.current?.querySelector(`[data-node-index="${nodes.findIndex((node_4) => node_4.id === current_5.node)}"]`);
1636
- if (element_2) {
1637
- element_2.style.left = `${current_5.nodeX}px`;
1638
- element_2.style.top = `${current_5.nodeY}px`;
1639
- }
1640
- }
1641
- pointer.current = null;
1642
- if (event_7.currentTarget.hasPointerCapture(event_7.pointerId)) event_7.currentTarget.releasePointerCapture(event_7.pointerId);
1643
- },
1644
- children: [
1645
- /* @__PURE__ */ jsx("div", {
1646
- className: "povio-canvas-mobile-tools",
1647
- children: /* @__PURE__ */ jsx("button", {
1648
- "aria-label": "Toggle pages panel",
1649
- "aria-pressed": mobilePanel === "pages",
1650
- onClick: () => setMobilePanel(mobilePanel === "pages" ? null : "pages"),
1651
- children: /* @__PURE__ */ jsx(PanelLeft, { size: 18 })
1652
- })
1653
- }),
1654
- /* @__PURE__ */ jsx("div", {
1655
- ref: world,
1656
- className: "povio-canvas-world",
1657
- style: {
1658
- width: width_0,
1659
- height: height_0
1660
- },
1661
- children: nodes.map((node_5, index) => {
1662
- const state = runtime[`${bp.id}:${node_5.id}:${node_5.href ?? ""}`] ?? {};
1663
- let source = "";
1664
- let originError = false;
1665
- if (node_5.href) try {
1666
- const url_0 = new URL(frameUrl?.(node_5) ?? node_5.href, window.location.href);
1667
- if (url_0.origin !== window.location.origin) throw new Error("same origin required");
1668
- url_0.searchParams.delete("povioCanvas");
1669
- url_0.searchParams.set("__povio_canvas_frame", node_5.id);
1670
- url_0.searchParams.set("__povio_canvas_token", token);
1671
- url_0.searchParams.set("__povio_canvas_height", String(bp.height));
1672
- source = url_0.href;
1673
- } catch {
1674
- originError = true;
1675
- }
1676
- const redirected = state.href && node_5.href && new URL(state.href, window.location.href).pathname !== new URL(node_5.href, window.location.href).pathname;
1677
- return /* @__PURE__ */ jsxs("article", {
1678
- "data-node-index": index,
1679
- "data-page-id": node_5.id,
1680
- className: `povio-canvas-node${selected === node_5.id ? " is-selected" : ""}`,
1681
- style: {
1682
- left: node_5.x,
1683
- top: node_5.y,
1684
- width: node_5.width
1685
- },
1686
- children: [
1687
- /* @__PURE__ */ jsxs("header", {
1688
- className: "povio-canvas-node-header",
1689
- onPointerDown: (event_8) => {
1690
- if (event_8.button !== 0 || event_8.target.closest("button")) return;
1691
- event_8.stopPropagation();
1692
- viewport.current?.setPointerCapture(event_8.pointerId);
1693
- pointer.current = {
1694
- id: event_8.pointerId,
1695
- x: event_8.clientX,
1696
- y: event_8.clientY,
1697
- startX: 0,
1698
- startY: 0,
1699
- node: node_5.id,
1700
- nodeX: node_5.x,
1701
- nodeY: node_5.y
1702
- };
1703
- setSelected(node_5.id);
1704
- },
1705
- children: [
1706
- /* @__PURE__ */ jsx("strong", { children: node_5.title }),
1707
- /* @__PURE__ */ jsxs("span", { children: [
1708
- bp.width,
1709
- " × ",
1710
- Math.round(node_5.height).toLocaleString()
1711
- ] }),
1712
- /* @__PURE__ */ jsx("button", {
1713
- "aria-label": `Focus ${node_5.title}`,
1714
- onClick: () => focusPage(node_5.id),
1715
- children: "↗"
1716
- }),
1717
- /* @__PURE__ */ jsx("button", {
1718
- "aria-label": `Reload ${node_5.title}`,
1719
- onClick: () => {
1720
- setRuntime((r) => ({
1721
- ...r,
1722
- [`${bp.id}:${node_5.id}:${node_5.href ?? ""}`]: {}
1723
- }));
1724
- setReload((r_0) => ({
1725
- ...r_0,
1726
- [node_5.id]: (r_0[node_5.id] ?? 0) + 1
1727
- }));
1728
- },
1729
- children: "↻"
1730
- })
1731
- ]
1732
- }),
1733
- !node_5.href ? /* @__PURE__ */ jsxs("form", {
1734
- className: "povio-canvas-unresolved",
1735
- onSubmit: (event_9) => {
1736
- event_9.preventDefault();
1737
- const form = new FormData(event_9.currentTarget);
1738
- const enteredParams = Object.fromEntries(node_5.missingParams.map((key_2) => {
1739
- const value_3 = form.get(key_2);
1740
- return [key_2, typeof value_3 === "string" ? value_3 : ""];
1741
- }));
1742
- setManifest((m_0) => ({
1743
- ...m_0,
1744
- examples: {
1745
- ...m_0.examples,
1746
- [node_5.id]: {
1747
- ...examples[node_5.id],
1748
- ...m_0.examples[node_5.id],
1749
- params: {
1750
- ...examples[node_5.id]?.params,
1751
- ...m_0.examples[node_5.id]?.params,
1752
- ...enteredParams
1753
- }
1754
- }
1755
- }
1756
- }));
1757
- },
1758
- children: [
1759
- /* @__PURE__ */ jsx("strong", { children: "Route needs parameters" }),
1760
- /* @__PURE__ */ jsx("code", { children: node_5.path }),
1761
- node_5.missingParams.map((key_3) => /* @__PURE__ */ jsxs("label", { children: [key_3, /* @__PURE__ */ jsx("input", {
1762
- name: key_3,
1763
- required: true
1764
- })] }, key_3)),
1765
- /* @__PURE__ */ jsx("button", { children: "Render page" })
1766
- ]
1767
- }) : originError ? /* @__PURE__ */ jsx("p", {
1768
- className: "povio-canvas-unresolved",
1769
- children: "Canvas pages must use the same origin."
1770
- }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [
1771
- /* @__PURE__ */ jsx(PageFrame, {
1772
- id: node_5.id,
1773
- interact,
1774
- inspect: inspectMode,
1775
- src: source,
1776
- width: bp.width,
1777
- height: node_5.height,
1778
- name: `${canvasProtocol}:${JSON.stringify({
1779
- id: node_5.id,
1780
- token,
1781
- viewportHeight: bp.height
1782
- })}`,
1783
- onLoad,
1784
- register
1785
- }, `${documentGeneration}:${bp.id}:${source}:${reload[node_5.id] ?? 0}`),
1786
- !interact && /* @__PURE__ */ jsx("button", {
1787
- type: "button",
1788
- className: "povio-canvas-frame-cover",
1789
- tabIndex: 0,
1790
- "aria-label": `Select ${node_5.title}`,
1791
- onKeyDown: (event_10) => {
1792
- if (event_10.key === "Enter" || event_10.key === " ") {
1793
- event_10.preventDefault();
1794
- setSelected(node_5.id);
1795
- }
1796
- },
1797
- onPointerMove: (event_11) => {
1798
- const frame_3 = frames.current.get(node_5.id);
1799
- if (frame_3) inspector.hover(node_5.id, frame_3, event_11.clientX, event_11.clientY);
1800
- },
1801
- onPointerDown: (event_12) => {
1802
- setSelected(node_5.id);
1803
- if (inspectMode) {
1804
- const frame_4 = frames.current.get(node_5.id);
1805
- if (frame_4) inspector.select(node_5.id, frame_4, event_12.clientX, event_12.clientY);
1806
- }
1807
- },
1808
- onClick: () => setSelected(node_5.id)
1809
- }),
1810
- inspectMode && inspector.selection?.pageId === node_5.id && inspector.measurement && /* @__PURE__ */ jsx(CanvasInspectionOverlay, {
1811
- measurement: inspector.measurement,
1812
- width: node_5.width
1813
- })
1814
- ] }),
1815
- (redirected || state.warning || state.timedOut) && /* @__PURE__ */ jsxs("div", {
1816
- className: "povio-canvas-page-note",
1817
- children: [
1818
- redirected ? `Rendered ${state.href} (route redirected). ` : "",
1819
- state.warning,
1820
- state.timedOut && !state.ready ? " Frame bridge has not connected. Check access or page errors." : ""
1821
- ]
1822
- })
1823
- ]
1824
- }, node_5.id);
1825
- })
1826
- }),
1827
- /* @__PURE__ */ jsxs("div", {
1828
- className: "povio-canvas-tool-dock",
1829
- children: [
1830
- /* @__PURE__ */ jsxs("div", {
1831
- className: "povio-canvas-mode-switch",
1832
- role: "group",
1833
- "aria-label": "Canvas mode",
1834
- children: [
1835
- /* @__PURE__ */ jsxs("button", {
1836
- "aria-label": "Inspect layouts",
1837
- title: "Inspect layouts",
1838
- "aria-pressed": inspectMode,
1839
- onClick: () => {
1840
- setInteract(false);
1841
- setInspectMode(true);
1842
- },
1843
- children: [/* @__PURE__ */ jsx(ScanLine, { size: 18 }), /* @__PURE__ */ jsx("span", { children: "Inspect" })]
1844
- }),
1845
- /* @__PURE__ */ jsxs("button", {
1846
- "aria-label": "Pan",
1847
- title: "Pan",
1848
- "aria-pressed": !inspectMode && !interact,
1849
- onClick: () => {
1850
- setInspectMode(false);
1851
- setInteract(false);
1852
- },
1853
- children: [/* @__PURE__ */ jsx(Hand, { size: 18 }), /* @__PURE__ */ jsx("span", { children: "Pan" })]
1854
- }),
1855
- /* @__PURE__ */ jsxs("button", {
1856
- "aria-label": "Interact",
1857
- title: "Interact with pages",
1858
- "aria-pressed": interact,
1859
- onClick: () => {
1860
- setInspectMode(false);
1861
- setInteract(true);
1862
- },
1863
- children: [/* @__PURE__ */ jsx(MousePointer2, { size: 18 }), /* @__PURE__ */ jsx("span", { children: "Interact" })]
1864
- })
1865
- ]
1866
- }),
1867
- /* @__PURE__ */ jsx("span", { className: "povio-canvas-dock-divider" }),
1868
- /* @__PURE__ */ jsxs("button", {
1869
- "aria-label": "Auto layout",
1870
- onClick: () => setManifest((m_1) => ({
1871
- ...m_1,
1872
- positions: {
1873
- ...m_1.positions,
1874
- [bp.id]: {}
1875
- }
1876
- })),
1877
- children: [/* @__PURE__ */ jsx(PanelsTopLeft, { size: 17 }), /* @__PURE__ */ jsx("span", { children: "Auto layout" })]
1878
- })
1879
- ]
1880
- }),
1881
- /* @__PURE__ */ jsxs("div", {
1882
- className: "povio-canvas-camera",
1883
- children: [
1884
- /* @__PURE__ */ jsx("button", {
1885
- className: "povio-canvas-configure",
1886
- "aria-label": "Configure UI",
1887
- title: "Configure UI",
1888
- onClick: configuration.openFloating,
1889
- children: /* @__PURE__ */ jsx(Settings2, { size: 16 })
1890
- }),
1891
- /* @__PURE__ */ jsx("button", {
1892
- className: "povio-canvas-theme-toggle",
1893
- onClick: () => setDark(!dark),
1894
- "aria-pressed": dark,
1895
- "aria-label": dark ? "Dark" : "Light",
1896
- title: "Toggle page theme",
1897
- children: dark ? /* @__PURE__ */ jsx(Moon, { size: 16 }) : /* @__PURE__ */ jsx(Sun, { size: 16 })
1898
- }),
1899
- /* @__PURE__ */ jsxs("div", {
1900
- className: "povio-canvas-breakpoint",
1901
- children: [/* @__PURE__ */ jsx(Monitor, { size: 15 }), /* @__PURE__ */ jsx("select", {
1902
- "aria-label": "Canvas breakpoint",
1903
- value: bp.id,
1904
- onChange: (e) => {
1905
- if (e.target.value === bp.id) return;
1906
- setRuntime({});
1907
- setManifest((m_2) => ({
1908
- ...m_2,
1909
- breakpoint: e.target.value
1910
- }));
1911
- },
1912
- children: breakpoints.map((item_0) => /* @__PURE__ */ jsxs("option", {
1913
- value: item_0.id,
1914
- children: [
1915
- item_0.label,
1916
- " · ",
1917
- item_0.width,
1918
- "px"
1919
- ]
1920
- }, item_0.id))
1921
- })]
1922
- }),
1923
- /* @__PURE__ */ jsx("span", { className: "povio-canvas-dock-divider" }),
1924
- /* @__PURE__ */ jsx("button", {
1925
- onClick: () => stepZoom(-1),
1926
- "aria-label": "Zoom out",
1927
- children: "−"
1928
- }),
1929
- /* @__PURE__ */ jsx("button", {
1930
- className: "povio-canvas-zoom-reset",
1931
- "aria-label": "Zoom to 100%",
1932
- title: "Zoom to 100%",
1933
- onClick: () => zoomTo(1),
1934
- children: /* @__PURE__ */ jsx("output", {
1935
- ref: zoomOutput,
1936
- children: "25%"
1937
- })
1938
- }),
1939
- /* @__PURE__ */ jsx("button", {
1940
- onClick: () => stepZoom(1),
1941
- "aria-label": "Zoom in",
1942
- children: "+"
1943
- }),
1944
- /* @__PURE__ */ jsx("button", {
1945
- onClick: fit,
1946
- children: "Fit all"
1947
- })
1948
- ]
1949
- })
1950
- ]
1951
- }),
1952
- inspectMode && /* @__PURE__ */ jsx(CanvasInspectorPanel, {
1953
- inspector,
1954
- onClose: () => setInspectMode(false)
1955
- })
1956
- ]
1957
- }),
1958
- notice && /* @__PURE__ */ jsxs("div", {
1959
- className: "povio-canvas-notice",
1960
- role: "status",
1961
- children: [notice, /* @__PURE__ */ jsx("button", {
1962
- onClick: () => setNotice(""),
1963
- children: "Dismiss"
1964
- })]
1965
- })
1966
- ]
1967
- });
1968
- }
1969
- //#endregion
1970
- //#region src/app-canvas/document-frame.ts
1971
- /** Adapt a same-origin document to an uncropped, full-page canvas artboard. */
1972
- function startCanvasDocument(doc, options) {
1973
- const win = doc.defaultView;
1974
- if (!win) throw new Error("Canvas document must belong to a window.");
1975
- const viewportHeight = Math.max(1, options.viewportHeight);
1976
- let interact = options.interact ?? false;
1977
- let destroyed = false;
1978
- let frame = 0;
1979
- let lastHeight = 0;
1980
- let lastLinks = "";
1981
- const originals = /* @__PURE__ */ new Map();
1982
- const mediaOriginals = /* @__PURE__ */ new Map();
1983
- const liveStyles = /* @__PURE__ */ new Set();
1984
- const liveMedia = /* @__PURE__ */ new Set();
1985
- const warnedSheets = /* @__PURE__ */ new WeakSet();
1986
- const positioned = /* @__PURE__ */ new WeakSet();
1987
- const set = (style, property, value, priority = "important") => {
1988
- liveStyles.add(style);
1989
- if (style.getPropertyValue(property) === value && style.getPropertyPriority(property) === priority) return;
1990
- let saved = originals.get(style);
1991
- if (!saved) {
1992
- saved = /* @__PURE__ */ new Map();
1993
- originals.set(style, saved);
1994
- }
1995
- if (!saved.has(property)) saved.set(property, [style.getPropertyValue(property), style.getPropertyPriority(property)]);
1996
- style.setProperty(property, value, priority);
1997
- };
1998
- const freezeUnits = (style) => {
1999
- liveStyles.add(style);
2000
- for (const property of Array.from(style)) {
2001
- const value = style.getPropertyValue(property);
2002
- const frozen = value.replace(/(-?(?:\d*\.)?\d+)(?:dvh|svh|lvh|vh)\b/gi, (_, amount) => `${Number(amount) * viewportHeight / 100}px`);
2003
- if (value !== frozen) set(style, property, frozen, style.getPropertyPriority(property));
2004
- }
2005
- };
2006
- const freezeMedia = (media) => {
2007
- liveMedia.add(media);
2008
- if (mediaOriginals.has(media)) return;
2009
- const original = media.mediaText;
2010
- const frozen = original.replace(/\([^()]*\b(?:height|orientation|aspect-ratio)\b[^()]*\)/gi, (predicate) => win.matchMedia(predicate).matches ? "(min-width: 0px)" : "(max-width: -1px)");
2011
- if (frozen !== original) {
2012
- mediaOriginals.set(media, original);
2013
- media.mediaText = frozen;
2014
- }
2015
- };
2016
- const visitRules = (rules) => {
2017
- for (const rule of Array.from(rules)) {
2018
- if ("style" in rule) freezeUnits(rule.style);
2019
- if ("media" in rule) freezeMedia(rule.media);
2020
- if ("cssRules" in rule) visitRules(rule.cssRules);
2021
- if ("styleSheet" in rule && rule.styleSheet) visitSheet(rule.styleSheet);
2022
- }
2023
- };
2024
- const visitSheet = (sheet) => {
2025
- try {
2026
- freezeMedia(sheet.media);
2027
- visitRules(sheet.cssRules);
2028
- } catch {
2029
- if (!warnedSheets.has(sheet)) {
2030
- warnedSheets.add(sheet);
2031
- const message = `App canvas cannot normalize inaccessible stylesheet ${sheet.href ?? "(inline)"}. Serve its CSS from the app origin for accurate full-page dimensions.`;
2032
- if (options.onWarning) options.onWarning(message);
2033
- else win.console.warn(message);
2034
- }
2035
- }
2036
- };
2037
- const anchorURL = (anchor) => {
2038
- try {
2039
- const url = new URL(anchor.getAttribute("href") ?? "", doc.baseURI);
2040
- return /^https?:$/.test(url.protocol) && url.origin === new URL(doc.baseURI).origin ? url.href : null;
2041
- } catch {
2042
- return null;
2043
- }
2044
- };
2045
- const refresh = () => {
2046
- if (destroyed) return;
2047
- if (frame) {
2048
- win.cancelAnimationFrame(frame);
2049
- frame = 0;
2050
- }
2051
- observer.disconnect();
2052
- liveStyles.clear();
2053
- liveMedia.clear();
2054
- for (const sheet of [...Array.from(doc.styleSheets), ...Array.from(doc.adoptedStyleSheets ?? [])]) visitSheet(sheet);
2055
- const elements = Array.from(doc.querySelectorAll("*")).filter((el) => "style" in el);
2056
- for (const el of elements) freezeUnits(el.style);
2057
- const snapshots = elements.map((el) => ({
2058
- el,
2059
- css: win.getComputedStyle(el),
2060
- rect: el.getBoundingClientRect()
2061
- }));
2062
- for (const { el, css, rect } of snapshots) {
2063
- if (!positioned.has(el) && (css.position === "fixed" || css.position === "sticky")) {
2064
- positioned.add(el);
2065
- if (css.position === "sticky") set(el.style, "position", "static");
2066
- else {
2067
- set(el.style, "position", "absolute");
2068
- const containingBlock = el.offsetParent;
2069
- const parentRect = containingBlock?.getBoundingClientRect();
2070
- const parentTop = containingBlock && containingBlock !== doc.body && containingBlock !== doc.documentElement ? (parentRect?.top ?? 0) + containingBlock.clientTop - containingBlock.scrollTop : -win.scrollY;
2071
- const parentLeft = containingBlock && containingBlock !== doc.body && containingBlock !== doc.documentElement ? (parentRect?.left ?? 0) + containingBlock.clientLeft - containingBlock.scrollLeft : -win.scrollX;
2072
- set(el.style, "top", `${rect.top - parentTop}px`);
2073
- set(el.style, "left", `${rect.left - parentLeft}px`);
2074
- set(el.style, "right", "auto");
2075
- set(el.style, "bottom", "auto");
2076
- set(el.style, "width", `${rect.width}px`);
2077
- set(el.style, "height", `${rect.height}px`);
2078
- }
2079
- }
2080
- if (/^(auto|scroll)$/.test(css.overflowY) && el.scrollHeight > el.clientHeight) {
2081
- let ancestor = el;
2082
- while (ancestor && ancestor !== doc.documentElement) {
2083
- set(ancestor.style, "height", "auto");
2084
- set(ancestor.style, "max-height", "none");
2085
- set(ancestor.style, "overflow-y", "visible");
2086
- set(ancestor.style, "flex-shrink", "0");
2087
- ancestor = ancestor.parentElement;
2088
- }
2089
- }
2090
- }
2091
- set(doc.documentElement.style, "height", "auto");
2092
- set(doc.documentElement.style, "min-height", "0px");
2093
- set(doc.documentElement.style, "overflow-y", "hidden");
2094
- if (doc.body) {
2095
- set(doc.body.style, "height", "auto");
2096
- set(doc.body.style, "min-height", "0px");
2097
- }
2098
- let bottom = 0;
2099
- for (const el of elements) {
2100
- if (el === doc.documentElement || el === doc.body || !el.getClientRects().length) continue;
2101
- bottom = Math.max(bottom, el.getBoundingClientRect().bottom + win.scrollY);
2102
- }
2103
- if (doc.body) bottom = Math.max(bottom, doc.body.getBoundingClientRect().bottom + win.scrollY);
2104
- const height = Math.max(viewportHeight, Math.ceil(bottom));
2105
- if (height !== lastHeight) {
2106
- lastHeight = height;
2107
- options.onHeight(height);
2108
- }
2109
- if (options.onLinks) {
2110
- const links = Array.from(doc.querySelectorAll("a[href]")).flatMap((anchor) => {
2111
- const href = anchorURL(anchor);
2112
- return href ? [{
2113
- href,
2114
- label: anchor.textContent?.trim() || anchor.getAttribute("aria-label") || href
2115
- }] : [];
2116
- });
2117
- const signature = JSON.stringify(links);
2118
- if (signature !== lastLinks) {
2119
- lastLinks = signature;
2120
- options.onLinks(links);
2121
- }
2122
- }
2123
- for (const style of originals.keys()) if (!liveStyles.has(style)) originals.delete(style);
2124
- for (const media of mediaOriginals.keys()) if (!liveMedia.has(media)) mediaOriginals.delete(media);
2125
- liveStyles.clear();
2126
- liveMedia.clear();
2127
- observer.observe(doc.documentElement, {
2128
- subtree: true,
2129
- childList: true,
2130
- attributes: true,
2131
- characterData: true
2132
- });
2133
- };
2134
- const schedule = () => {
2135
- if (!destroyed && !frame) frame = win.requestAnimationFrame(refresh);
2136
- };
2137
- const observer = new win.MutationObserver(schedule);
2138
- const resize = new win.ResizeObserver(schedule);
2139
- resize.observe(doc.documentElement);
2140
- if (doc.body) resize.observe(doc.body);
2141
- const click = (event) => {
2142
- const anchor = event.target?.closest?.("a[href]");
2143
- if (interact && !anchor) return;
2144
- event.preventDefault();
2145
- event.stopImmediatePropagation();
2146
- if (anchor) {
2147
- const href = anchorURL(anchor);
2148
- if (href) options.onNavigate(href);
2149
- }
2150
- };
2151
- const submit = (event) => {
2152
- if (!interact) {
2153
- event.preventDefault();
2154
- event.stopImmediatePropagation();
2155
- }
2156
- };
2157
- win.addEventListener("click", click, true);
2158
- win.addEventListener("submit", submit, true);
2159
- win.addEventListener("resize", schedule);
2160
- doc.addEventListener("load", schedule, true);
2161
- doc.fonts?.ready.then(schedule);
2162
- refresh();
2163
- return {
2164
- refresh,
2165
- setInteract(value) {
2166
- interact = value;
2167
- },
2168
- destroy() {
2169
- destroyed = true;
2170
- if (frame) win.cancelAnimationFrame(frame);
2171
- observer.disconnect();
2172
- resize.disconnect();
2173
- win.removeEventListener("click", click, true);
2174
- win.removeEventListener("submit", submit, true);
2175
- win.removeEventListener("resize", schedule);
2176
- doc.removeEventListener("load", schedule, true);
2177
- for (const [media, value] of mediaOriginals) media.mediaText = value;
2178
- for (const [style, values] of originals) for (const [property, [value, priority]] of values) if (value) style.setProperty(property, value, priority);
2179
- else style.removeProperty(property);
2180
- }
2181
- };
2182
- }
2183
- //#endregion
2184
- //#region src/app-canvas/AppCanvasFrameBridge.tsx
2185
- /** Mount once inside the application's existing UIConfigurationProvider. No separate app copy or theme fork. */
2186
- function AppCanvasFrameBridge({ href }) {
2187
- const { setPreviewConfiguration } = useUIConfiguration();
2188
- const [identity] = useState(canvasFrameIdentity);
2189
- const currentHref = useRef(href);
2190
- currentHref.current = href;
2191
- useEffect(() => {
2192
- if (!identity) return;
2193
- const send = (data) => window.parent.postMessage({
2194
- protocol: canvasProtocol,
2195
- ...identity,
2196
- ...data
2197
- }, window.location.origin);
2198
- const renderer = startCanvasDocument(document, {
2199
- viewportHeight: identity.viewportHeight,
2200
- onHeight: (height) => send({
2201
- type: "height",
2202
- height
2203
- }),
2204
- onNavigate: (url) => send({
2205
- type: "navigate",
2206
- href: url
2207
- }),
2208
- onWarning: (warning) => send({
2209
- type: "warning",
2210
- warning
2211
- })
2212
- });
2213
- let ackFrame = 0;
2214
- const receive = (event) => {
2215
- const packet = event.data;
2216
- if (event.source !== window.parent || event.origin !== window.location.origin || packet?.protocol !== "povio-app-canvas-v1" || packet.token !== identity.token || packet.id !== identity.id) return;
2217
- if (packet.type === "mode") renderer.setInteract(!!packet.interact);
2218
- if (packet.type === "configuration" && validConfiguration(packet.configuration)) {
2219
- setPreviewConfiguration(packet.configuration);
2220
- document.documentElement.classList.toggle("dark", !!packet.dark);
2221
- cancelAnimationFrame(ackFrame);
2222
- ackFrame = requestAnimationFrame(() => {
2223
- send({
2224
- type: "ack",
2225
- revision: packet.revision
2226
- });
2227
- });
2228
- }
2229
- };
2230
- window.addEventListener("message", receive);
2231
- send({
2232
- type: "ready",
2233
- href: currentHref.current ?? window.location.href
2234
- });
2235
- return () => {
2236
- cancelAnimationFrame(ackFrame);
2237
- window.removeEventListener("message", receive);
2238
- renderer.destroy();
2239
- setPreviewConfiguration(null);
2240
- };
2241
- }, [identity, setPreviewConfiguration]);
2242
- useEffect(() => {
2243
- if (identity && href) window.parent.postMessage({
2244
- protocol: canvasProtocol,
2245
- ...identity,
2246
- type: "ready",
2247
- href
2248
- }, window.location.origin);
2249
- }, [href, identity]);
2250
- return null;
2251
- }
2252
- //#endregion
2253
- export { AppCanvas, AppCanvasFrameBridge, defaultCanvasBreakpoints, discoverCanvasPages, isAppCanvasFrame, layoutCanvasPages };