@questpie/admin 1.1.0 → 2.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 (965) hide show
  1. package/README.md +245 -474
  2. package/dist/_virtual/rolldown_runtime.mjs +18 -0
  3. package/dist/augmentation.d.mts +315 -0
  4. package/dist/augmentation.d.mts.map +1 -0
  5. package/dist/client/blocks/block-registry.d.mts +199 -0
  6. package/dist/client/blocks/block-registry.d.mts.map +1 -0
  7. package/dist/client/blocks/block-registry.mjs +88 -0
  8. package/dist/client/blocks/block-registry.mjs.map +1 -0
  9. package/dist/client/blocks/block-renderer.d.mts +52 -0
  10. package/dist/client/blocks/block-renderer.d.mts.map +1 -0
  11. package/dist/client/blocks/block-renderer.mjs +71 -0
  12. package/dist/client/blocks/block-renderer.mjs.map +1 -0
  13. package/dist/client/blocks/index.d.mts +4 -0
  14. package/dist/client/blocks/prefetch.d.mts +45 -0
  15. package/dist/client/blocks/prefetch.d.mts.map +1 -0
  16. package/dist/client/blocks/prefetch.mjs +26 -0
  17. package/dist/client/blocks/prefetch.mjs.map +1 -0
  18. package/dist/client/blocks/types.d.mts +69 -0
  19. package/dist/client/blocks/types.d.mts.map +1 -0
  20. package/dist/client/blocks/types.mjs +20 -0
  21. package/dist/client/blocks/types.mjs.map +1 -0
  22. package/dist/client/builder/admin-builder.d.mts +112 -0
  23. package/dist/client/builder/admin-builder.d.mts.map +1 -0
  24. package/dist/client/builder/admin-builder.mjs +185 -0
  25. package/dist/client/builder/admin-builder.mjs.map +1 -0
  26. package/dist/client/builder/admin-types.d.mts +73 -0
  27. package/dist/client/builder/admin-types.d.mts.map +1 -0
  28. package/dist/client/builder/admin.d.mts +121 -0
  29. package/dist/client/builder/admin.d.mts.map +1 -0
  30. package/dist/client/builder/admin.mjs +160 -0
  31. package/dist/client/builder/admin.mjs.map +1 -0
  32. package/dist/client/builder/defaults/components.mjs +20 -0
  33. package/dist/client/builder/defaults/components.mjs.map +1 -0
  34. package/dist/client/builder/defaults/core.d.mts +354 -0
  35. package/dist/client/builder/defaults/core.d.mts.map +1 -0
  36. package/dist/client/builder/defaults/core.mjs +49 -0
  37. package/dist/client/builder/defaults/core.mjs.map +1 -0
  38. package/dist/client/builder/defaults/fields.mjs +328 -0
  39. package/dist/client/builder/defaults/fields.mjs.map +1 -0
  40. package/dist/client/builder/defaults/pages.mjs +58 -0
  41. package/dist/client/builder/defaults/pages.mjs.map +1 -0
  42. package/dist/client/builder/defaults/starter.d.mts +351 -0
  43. package/dist/client/builder/defaults/starter.d.mts.map +1 -0
  44. package/dist/client/builder/defaults/starter.mjs +28 -0
  45. package/dist/client/builder/defaults/starter.mjs.map +1 -0
  46. package/dist/client/builder/defaults/views.mjs +27 -0
  47. package/dist/client/builder/defaults/views.mjs.map +1 -0
  48. package/dist/client/builder/defaults/widgets.mjs +31 -0
  49. package/dist/client/builder/defaults/widgets.mjs.map +1 -0
  50. package/dist/client/builder/field/field.d.mts +229 -0
  51. package/dist/client/builder/field/field.d.mts.map +1 -0
  52. package/dist/client/builder/field/field.mjs +83 -0
  53. package/dist/client/builder/field/field.mjs.map +1 -0
  54. package/dist/client/builder/index.d.mts +36 -0
  55. package/dist/client/builder/index.d.mts.map +1 -0
  56. package/dist/client/builder/page/page.d.mts +36 -0
  57. package/dist/client/builder/page/page.d.mts.map +1 -0
  58. package/dist/client/builder/page/page.mjs +27 -0
  59. package/dist/client/builder/page/page.mjs.map +1 -0
  60. package/dist/client/builder/proxies.d.mts +2 -0
  61. package/dist/client/builder/proxies.mjs +24 -0
  62. package/dist/client/builder/proxies.mjs.map +1 -0
  63. package/dist/client/builder/qa.d.mts +50 -0
  64. package/dist/client/builder/qa.d.mts.map +1 -0
  65. package/dist/client/builder/qa.mjs +42 -0
  66. package/dist/client/builder/qa.mjs.map +1 -0
  67. package/dist/client/builder/registry.d.mts +70 -0
  68. package/dist/client/builder/registry.d.mts.map +1 -0
  69. package/dist/client/builder/types/action-registry.d.mts +2 -0
  70. package/dist/client/builder/types/action-registry.mjs +142 -0
  71. package/dist/client/builder/types/action-registry.mjs.map +1 -0
  72. package/dist/client/builder/types/action-types.d.mts +253 -0
  73. package/dist/client/builder/types/action-types.d.mts.map +1 -0
  74. package/dist/client/builder/types/collection-types.d.mts +199 -0
  75. package/dist/client/builder/types/collection-types.d.mts.map +1 -0
  76. package/dist/client/builder/types/collection-types.mjs +11 -0
  77. package/dist/client/builder/types/collection-types.mjs.map +1 -0
  78. package/dist/client/builder/types/common.d.mts +60 -0
  79. package/dist/client/builder/types/common.d.mts.map +1 -0
  80. package/dist/client/builder/types/field-types.d.mts +593 -0
  81. package/dist/client/builder/types/field-types.d.mts.map +1 -0
  82. package/dist/client/builder/types/field-types.mjs +19 -0
  83. package/dist/client/builder/types/field-types.mjs.map +1 -0
  84. package/dist/client/builder/types/global-types.d.mts +22 -0
  85. package/dist/client/builder/types/global-types.d.mts.map +1 -0
  86. package/dist/client/builder/types/ui-config.d.mts +160 -0
  87. package/dist/client/builder/types/ui-config.d.mts.map +1 -0
  88. package/dist/client/builder/types/views.d.mts +89 -0
  89. package/dist/client/builder/types/views.d.mts.map +1 -0
  90. package/dist/client/builder/types/widget-types.d.mts +563 -0
  91. package/dist/client/builder/types/widget-types.d.mts.map +1 -0
  92. package/dist/client/builder/validation.d.mts +3 -0
  93. package/dist/client/builder/validation.mjs +208 -0
  94. package/dist/client/builder/validation.mjs.map +1 -0
  95. package/dist/client/builder/view/view.d.mts +129 -0
  96. package/dist/client/builder/view/view.d.mts.map +1 -0
  97. package/dist/client/builder/view/view.mjs +109 -0
  98. package/dist/client/builder/view/view.mjs.map +1 -0
  99. package/dist/client/builder/widget/widget.d.mts +33 -0
  100. package/dist/client/builder/widget/widget.d.mts.map +1 -0
  101. package/dist/client/builder/widget/widget.mjs +26 -0
  102. package/dist/client/builder/widget/widget.mjs.map +1 -0
  103. package/dist/client/components/actions/action-button.d.mts +2 -0
  104. package/dist/client/components/actions/action-button.mjs +135 -0
  105. package/dist/client/components/actions/action-button.mjs.map +1 -0
  106. package/dist/client/components/actions/action-dialog.d.mts +2 -0
  107. package/dist/client/components/actions/action-dialog.mjs +264 -0
  108. package/dist/client/components/actions/action-dialog.mjs.map +1 -0
  109. package/dist/client/components/actions/confirmation-dialog.d.mts +2 -0
  110. package/dist/client/components/actions/confirmation-dialog.mjs +82 -0
  111. package/dist/client/components/actions/confirmation-dialog.mjs.map +1 -0
  112. package/dist/client/components/actions/header-actions.d.mts +2 -0
  113. package/dist/client/components/actions/header-actions.mjs +117 -0
  114. package/dist/client/components/actions/header-actions.mjs.map +1 -0
  115. package/dist/client/components/actions/index.d.mts +4 -0
  116. package/dist/client/components/admin-link.d.mts +67 -0
  117. package/dist/client/components/admin-link.d.mts.map +1 -0
  118. package/dist/client/components/admin-link.mjs +92 -0
  119. package/dist/client/components/admin-link.mjs.map +1 -0
  120. package/dist/client/components/auth/auth-guard.d.mts +51 -0
  121. package/dist/client/components/auth/auth-guard.d.mts.map +1 -0
  122. package/dist/client/components/auth/auth-guard.mjs +60 -0
  123. package/dist/client/components/auth/auth-guard.mjs.map +1 -0
  124. package/dist/client/components/auth/auth-loading.d.mts +36 -0
  125. package/dist/client/components/auth/auth-loading.d.mts.map +1 -0
  126. package/dist/client/components/auth/auth-loading.mjs +27 -0
  127. package/dist/client/components/auth/auth-loading.mjs.map +1 -0
  128. package/dist/client/components/auth/index.d.mts +2 -0
  129. package/dist/client/components/blocks/block-canvas.mjs +90 -0
  130. package/dist/client/components/blocks/block-canvas.mjs.map +1 -0
  131. package/dist/client/components/blocks/block-editor-context.mjs +58 -0
  132. package/dist/client/components/blocks/block-editor-context.mjs.map +1 -0
  133. package/dist/client/components/blocks/block-editor-layout.mjs +82 -0
  134. package/dist/client/components/blocks/block-editor-layout.mjs.map +1 -0
  135. package/dist/client/components/blocks/block-editor-provider.mjs +155 -0
  136. package/dist/client/components/blocks/block-editor-provider.mjs.map +1 -0
  137. package/dist/client/components/blocks/block-fields-renderer.mjs +70 -0
  138. package/dist/client/components/blocks/block-fields-renderer.mjs.map +1 -0
  139. package/dist/client/components/blocks/block-insert-button.mjs +72 -0
  140. package/dist/client/components/blocks/block-insert-button.mjs.map +1 -0
  141. package/dist/client/components/blocks/block-item-menu.mjs +161 -0
  142. package/dist/client/components/blocks/block-item-menu.mjs.map +1 -0
  143. package/dist/client/components/blocks/block-item.mjs +187 -0
  144. package/dist/client/components/blocks/block-item.mjs.map +1 -0
  145. package/dist/client/components/blocks/block-library-sidebar.mjs +190 -0
  146. package/dist/client/components/blocks/block-library-sidebar.mjs.map +1 -0
  147. package/dist/client/components/blocks/block-tree.mjs +45 -0
  148. package/dist/client/components/blocks/block-tree.mjs.map +1 -0
  149. package/dist/client/components/blocks/block-type-icon.mjs +50 -0
  150. package/dist/client/components/blocks/block-type-icon.mjs.map +1 -0
  151. package/dist/client/components/blocks/utils/tree-utils.mjs +186 -0
  152. package/dist/client/components/blocks/utils/tree-utils.mjs.map +1 -0
  153. package/dist/client/components/component-renderer.d.mts +125 -0
  154. package/dist/client/components/component-renderer.d.mts.map +1 -0
  155. package/dist/client/components/component-renderer.mjs +145 -0
  156. package/dist/client/components/component-renderer.mjs.map +1 -0
  157. package/dist/client/components/error-boundary.mjs +92 -0
  158. package/dist/client/components/error-boundary.mjs.map +1 -0
  159. package/dist/client/components/fields/array-field.d.mts +44 -0
  160. package/dist/client/components/fields/array-field.d.mts.map +1 -0
  161. package/dist/client/components/fields/array-field.mjs +231 -0
  162. package/dist/client/components/fields/array-field.mjs.map +1 -0
  163. package/dist/client/components/fields/asset-preview-field.d.mts +52 -0
  164. package/dist/client/components/fields/asset-preview-field.d.mts.map +1 -0
  165. package/dist/client/components/fields/asset-preview-field.mjs +60 -0
  166. package/dist/client/components/fields/asset-preview-field.mjs.map +1 -0
  167. package/dist/client/components/fields/blocks-field/blocks-field.d.mts +41 -0
  168. package/dist/client/components/fields/blocks-field/blocks-field.d.mts.map +1 -0
  169. package/dist/client/components/fields/blocks-field/blocks-field.mjs +101 -0
  170. package/dist/client/components/fields/blocks-field/blocks-field.mjs.map +1 -0
  171. package/dist/client/components/fields/blocks-field/index.d.mts +1 -0
  172. package/dist/client/components/fields/boolean-field.d.mts +30 -0
  173. package/dist/client/components/fields/boolean-field.d.mts.map +1 -0
  174. package/dist/client/components/fields/boolean-field.mjs +47 -0
  175. package/dist/client/components/fields/boolean-field.mjs.map +1 -0
  176. package/dist/client/components/fields/custom-field.d.mts +3 -0
  177. package/dist/client/components/fields/date-field.d.mts +22 -0
  178. package/dist/client/components/fields/date-field.d.mts.map +1 -0
  179. package/dist/client/components/fields/date-field.mjs +42 -0
  180. package/dist/client/components/fields/date-field.mjs.map +1 -0
  181. package/dist/client/components/fields/datetime-field.d.mts +23 -0
  182. package/dist/client/components/fields/datetime-field.d.mts.map +1 -0
  183. package/dist/client/components/fields/datetime-field.mjs +43 -0
  184. package/dist/client/components/fields/datetime-field.mjs.map +1 -0
  185. package/dist/client/components/fields/email-field.d.mts +19 -0
  186. package/dist/client/components/fields/email-field.d.mts.map +1 -0
  187. package/dist/client/components/fields/email-field.mjs +38 -0
  188. package/dist/client/components/fields/email-field.mjs.map +1 -0
  189. package/dist/client/components/fields/embedded-collection.d.mts +3 -0
  190. package/dist/client/components/fields/field-types.d.mts +571 -0
  191. package/dist/client/components/fields/field-types.d.mts.map +1 -0
  192. package/dist/client/components/fields/field-utils.d.mts +1 -0
  193. package/dist/client/components/fields/field-utils.mjs +65 -0
  194. package/dist/client/components/fields/field-utils.mjs.map +1 -0
  195. package/dist/client/components/fields/field-wrapper.d.mts +3 -0
  196. package/dist/client/components/fields/field-wrapper.mjs +49 -0
  197. package/dist/client/components/fields/field-wrapper.mjs.map +1 -0
  198. package/dist/client/components/fields/index.d.mts +33 -0
  199. package/dist/client/components/fields/json-field.d.mts +84 -0
  200. package/dist/client/components/fields/json-field.d.mts.map +1 -0
  201. package/dist/client/components/fields/json-field.mjs +248 -0
  202. package/dist/client/components/fields/json-field.mjs.map +1 -0
  203. package/dist/client/components/fields/locale-badge.d.mts +1 -0
  204. package/dist/client/components/fields/locale-badge.mjs +17 -0
  205. package/dist/client/components/fields/locale-badge.mjs.map +1 -0
  206. package/dist/client/components/fields/number-field.d.mts +23 -0
  207. package/dist/client/components/fields/number-field.d.mts.map +1 -0
  208. package/dist/client/components/fields/number-field.mjs +40 -0
  209. package/dist/client/components/fields/number-field.mjs.map +1 -0
  210. package/dist/client/components/fields/object-array-field.d.mts +2 -0
  211. package/dist/client/components/fields/object-array-field.mjs +313 -0
  212. package/dist/client/components/fields/object-array-field.mjs.map +1 -0
  213. package/dist/client/components/fields/object-field.d.mts +32 -0
  214. package/dist/client/components/fields/object-field.d.mts.map +1 -0
  215. package/dist/client/components/fields/object-field.mjs +128 -0
  216. package/dist/client/components/fields/object-field.mjs.map +1 -0
  217. package/dist/client/components/fields/relation/displays/cards-display.d.mts +2 -0
  218. package/dist/client/components/fields/relation/displays/cards-display.mjs +140 -0
  219. package/dist/client/components/fields/relation/displays/cards-display.mjs.map +1 -0
  220. package/dist/client/components/fields/relation/displays/chips-display.d.mts +2 -0
  221. package/dist/client/components/fields/relation/displays/chips-display.mjs +100 -0
  222. package/dist/client/components/fields/relation/displays/chips-display.mjs.map +1 -0
  223. package/dist/client/components/fields/relation/displays/grid-display.d.mts +2 -0
  224. package/dist/client/components/fields/relation/displays/grid-display.mjs +114 -0
  225. package/dist/client/components/fields/relation/displays/grid-display.mjs.map +1 -0
  226. package/dist/client/components/fields/relation/displays/index.d.mts +6 -0
  227. package/dist/client/components/fields/relation/displays/list-display.d.mts +2 -0
  228. package/dist/client/components/fields/relation/displays/list-display.mjs +128 -0
  229. package/dist/client/components/fields/relation/displays/list-display.mjs.map +1 -0
  230. package/dist/client/components/fields/relation/displays/table-display.d.mts +2 -0
  231. package/dist/client/components/fields/relation/displays/table-display.mjs +134 -0
  232. package/dist/client/components/fields/relation/displays/table-display.mjs.map +1 -0
  233. package/dist/client/components/fields/relation/displays/types.d.mts +22 -0
  234. package/dist/client/components/fields/relation/displays/types.d.mts.map +1 -0
  235. package/dist/client/components/fields/relation/displays/types.mjs +73 -0
  236. package/dist/client/components/fields/relation/displays/types.mjs.map +1 -0
  237. package/dist/client/components/fields/relation/index.d.mts +3 -0
  238. package/dist/client/components/fields/relation/relation-items-display.d.mts +5 -0
  239. package/dist/client/components/fields/relation/relation-items-display.mjs +47 -0
  240. package/dist/client/components/fields/relation/relation-items-display.mjs.map +1 -0
  241. package/dist/client/components/fields/relation-field.d.mts +134 -0
  242. package/dist/client/components/fields/relation-field.d.mts.map +1 -0
  243. package/dist/client/components/fields/relation-field.mjs +106 -0
  244. package/dist/client/components/fields/relation-field.mjs.map +1 -0
  245. package/dist/client/components/fields/relation-picker.d.mts +4 -0
  246. package/dist/client/components/fields/relation-picker.mjs +301 -0
  247. package/dist/client/components/fields/relation-picker.mjs.map +1 -0
  248. package/dist/client/components/fields/relation-select.d.mts +3 -0
  249. package/dist/client/components/fields/relation-select.mjs +219 -0
  250. package/dist/client/components/fields/relation-select.mjs.map +1 -0
  251. package/dist/client/components/fields/reverse-relation-field.d.mts +2 -0
  252. package/dist/client/components/fields/rich-text-editor/bubble-menu.mjs +56 -0
  253. package/dist/client/components/fields/rich-text-editor/bubble-menu.mjs.map +1 -0
  254. package/dist/client/components/fields/rich-text-editor/extensions.mjs +118 -0
  255. package/dist/client/components/fields/rich-text-editor/extensions.mjs.map +1 -0
  256. package/dist/client/components/fields/rich-text-editor/image-popover.mjs +196 -0
  257. package/dist/client/components/fields/rich-text-editor/image-popover.mjs.map +1 -0
  258. package/dist/client/components/fields/rich-text-editor/index.d.mts +4 -0
  259. package/dist/client/components/fields/rich-text-editor/index.mjs +187 -0
  260. package/dist/client/components/fields/rich-text-editor/index.mjs.map +1 -0
  261. package/dist/client/components/fields/rich-text-editor/link-popover.mjs +86 -0
  262. package/dist/client/components/fields/rich-text-editor/link-popover.mjs.map +1 -0
  263. package/dist/client/components/fields/rich-text-editor/presets.d.mts +11 -0
  264. package/dist/client/components/fields/rich-text-editor/presets.d.mts.map +1 -0
  265. package/dist/client/components/fields/rich-text-editor/presets.mjs +124 -0
  266. package/dist/client/components/fields/rich-text-editor/presets.mjs.map +1 -0
  267. package/dist/client/components/fields/rich-text-editor/slash-commands.mjs +145 -0
  268. package/dist/client/components/fields/rich-text-editor/slash-commands.mjs.map +1 -0
  269. package/dist/client/components/fields/rich-text-editor/table-controls.mjs +124 -0
  270. package/dist/client/components/fields/rich-text-editor/table-controls.mjs.map +1 -0
  271. package/dist/client/components/fields/rich-text-editor/toolbar.mjs +280 -0
  272. package/dist/client/components/fields/rich-text-editor/toolbar.mjs.map +1 -0
  273. package/dist/client/components/fields/rich-text-editor/types.d.mts +78 -0
  274. package/dist/client/components/fields/rich-text-editor/types.d.mts.map +1 -0
  275. package/dist/client/components/fields/rich-text-editor/types.mjs +31 -0
  276. package/dist/client/components/fields/rich-text-editor/types.mjs.map +1 -0
  277. package/dist/client/components/fields/rich-text-editor/utils.mjs +51 -0
  278. package/dist/client/components/fields/rich-text-editor/utils.mjs.map +1 -0
  279. package/dist/client/components/fields/rich-text-editor/variants.d.mts +2 -0
  280. package/dist/client/components/fields/rich-text-field.d.mts +14 -0
  281. package/dist/client/components/fields/rich-text-field.d.mts.map +1 -0
  282. package/dist/client/components/fields/rich-text-field.mjs +26 -0
  283. package/dist/client/components/fields/rich-text-field.mjs.map +1 -0
  284. package/dist/client/components/fields/select-field.d.mts +25 -0
  285. package/dist/client/components/fields/select-field.d.mts.map +1 -0
  286. package/dist/client/components/fields/select-field.mjs +53 -0
  287. package/dist/client/components/fields/select-field.mjs.map +1 -0
  288. package/dist/client/components/fields/status-field.d.mts +2 -0
  289. package/dist/client/components/fields/text-field.d.mts +22 -0
  290. package/dist/client/components/fields/text-field.d.mts.map +1 -0
  291. package/dist/client/components/fields/text-field.mjs +39 -0
  292. package/dist/client/components/fields/text-field.mjs.map +1 -0
  293. package/dist/client/components/fields/textarea-field.d.mts +22 -0
  294. package/dist/client/components/fields/textarea-field.d.mts.map +1 -0
  295. package/dist/client/components/fields/textarea-field.mjs +39 -0
  296. package/dist/client/components/fields/textarea-field.mjs.map +1 -0
  297. package/dist/client/components/fields/time-field.d.mts +20 -0
  298. package/dist/client/components/fields/time-field.d.mts.map +1 -0
  299. package/dist/client/components/fields/time-field.mjs +39 -0
  300. package/dist/client/components/fields/time-field.mjs.map +1 -0
  301. package/dist/client/components/fields/upload-field.d.mts +97 -0
  302. package/dist/client/components/fields/upload-field.d.mts.map +1 -0
  303. package/dist/client/components/fields/upload-field.mjs +497 -0
  304. package/dist/client/components/fields/upload-field.mjs.map +1 -0
  305. package/dist/client/components/filter-builder/columns-tab.d.mts +1 -0
  306. package/dist/client/components/filter-builder/columns-tab.mjs +131 -0
  307. package/dist/client/components/filter-builder/columns-tab.mjs.map +1 -0
  308. package/dist/client/components/filter-builder/filter-builder-sheet.d.mts +1 -0
  309. package/dist/client/components/filter-builder/filter-builder-sheet.mjs +157 -0
  310. package/dist/client/components/filter-builder/filter-builder-sheet.mjs.map +1 -0
  311. package/dist/client/components/filter-builder/filters-tab.d.mts +1 -0
  312. package/dist/client/components/filter-builder/filters-tab.mjs +380 -0
  313. package/dist/client/components/filter-builder/filters-tab.mjs.map +1 -0
  314. package/dist/client/components/filter-builder/index.d.mts +5 -0
  315. package/dist/client/components/filter-builder/saved-views-tab.d.mts +1 -0
  316. package/dist/client/components/filter-builder/saved-views-tab.mjs +125 -0
  317. package/dist/client/components/filter-builder/saved-views-tab.mjs.map +1 -0
  318. package/dist/client/components/index.d.mts +80 -0
  319. package/dist/client/components/locale-switcher.d.mts +2 -0
  320. package/dist/client/components/locale-switcher.mjs +128 -0
  321. package/dist/client/components/locale-switcher.mjs.map +1 -0
  322. package/dist/client/components/media/media-grid.mjs +139 -0
  323. package/dist/client/components/media/media-grid.mjs.map +1 -0
  324. package/dist/client/components/media/media-picker-dialog.mjs +255 -0
  325. package/dist/client/components/media/media-picker-dialog.mjs.map +1 -0
  326. package/dist/client/components/preview/live-preview-mode.mjs +211 -0
  327. package/dist/client/components/preview/live-preview-mode.mjs.map +1 -0
  328. package/dist/client/components/preview/preview-pane.mjs +179 -0
  329. package/dist/client/components/preview/preview-pane.mjs.map +1 -0
  330. package/dist/client/components/primitives/asset-preview.mjs +363 -0
  331. package/dist/client/components/primitives/asset-preview.mjs.map +1 -0
  332. package/dist/client/components/primitives/checkbox-input.mjs +33 -0
  333. package/dist/client/components/primitives/checkbox-input.mjs.map +1 -0
  334. package/dist/client/components/primitives/date-input.mjs +218 -0
  335. package/dist/client/components/primitives/date-input.mjs.map +1 -0
  336. package/dist/client/components/primitives/dropzone.mjs +239 -0
  337. package/dist/client/components/primitives/dropzone.mjs.map +1 -0
  338. package/dist/client/components/primitives/number-input.mjs +113 -0
  339. package/dist/client/components/primitives/number-input.mjs.map +1 -0
  340. package/dist/client/components/primitives/select-multi.mjs +256 -0
  341. package/dist/client/components/primitives/select-multi.mjs.map +1 -0
  342. package/dist/client/components/primitives/select-single.mjs +183 -0
  343. package/dist/client/components/primitives/select-single.mjs.map +1 -0
  344. package/dist/client/components/primitives/text-input.mjs +40 -0
  345. package/dist/client/components/primitives/text-input.mjs.map +1 -0
  346. package/dist/client/components/primitives/textarea-input.mjs +38 -0
  347. package/dist/client/components/primitives/textarea-input.mjs.map +1 -0
  348. package/dist/client/components/primitives/time-input.mjs +72 -0
  349. package/dist/client/components/primitives/time-input.mjs.map +1 -0
  350. package/dist/client/components/primitives/toggle-input.mjs +31 -0
  351. package/dist/client/components/primitives/toggle-input.mjs.map +1 -0
  352. package/dist/client/components/primitives/types.d.mts +14 -0
  353. package/dist/client/components/primitives/types.d.mts.map +1 -0
  354. package/dist/client/components/primitives/types.mjs +13 -0
  355. package/dist/client/components/primitives/types.mjs.map +1 -0
  356. package/dist/client/components/sheets/index.d.mts +1 -0
  357. package/dist/client/components/sheets/resource-sheet.d.mts +1 -0
  358. package/dist/client/components/sheets/resource-sheet.mjs +78 -0
  359. package/dist/client/components/sheets/resource-sheet.mjs.map +1 -0
  360. package/dist/client/components/ui/accordion.d.mts +2 -0
  361. package/dist/client/components/ui/accordion.mjs +50 -0
  362. package/dist/client/components/ui/accordion.mjs.map +1 -0
  363. package/dist/client/components/ui/alert.mjs +32 -0
  364. package/dist/client/components/ui/alert.mjs.map +1 -0
  365. package/dist/client/components/ui/avatar.d.mts +3 -0
  366. package/dist/client/components/ui/badge.d.mts +3 -0
  367. package/dist/client/components/ui/badge.mjs +35 -0
  368. package/dist/client/components/ui/badge.mjs.map +1 -0
  369. package/dist/client/components/ui/button.d.mts +3 -0
  370. package/dist/client/components/ui/button.mjs +49 -0
  371. package/dist/client/components/ui/button.mjs.map +1 -0
  372. package/dist/client/components/ui/card.d.mts +2 -0
  373. package/dist/{card-BKHjBQfw.mjs → client/components/ui/card.mjs} +3 -10
  374. package/dist/{card-BKHjBQfw.mjs.map → client/components/ui/card.mjs.map} +1 -1
  375. package/dist/client/components/ui/checkbox.d.mts +2 -0
  376. package/dist/client/components/ui/checkbox.mjs +27 -0
  377. package/dist/client/components/ui/checkbox.mjs.map +1 -0
  378. package/dist/client/components/ui/combobox.d.mts +3 -0
  379. package/dist/client/components/ui/command.mjs +69 -0
  380. package/dist/client/components/ui/command.mjs.map +1 -0
  381. package/dist/client/components/ui/dialog.d.mts +3 -0
  382. package/dist/client/components/ui/dialog.mjs +83 -0
  383. package/dist/client/components/ui/dialog.mjs.map +1 -0
  384. package/dist/client/components/ui/drawer.mjs +75 -0
  385. package/dist/client/components/ui/drawer.mjs.map +1 -0
  386. package/dist/client/components/ui/dropdown-menu.d.mts +3 -0
  387. package/dist/client/components/ui/dropdown-menu.mjs +89 -0
  388. package/dist/client/components/ui/dropdown-menu.mjs.map +1 -0
  389. package/dist/client/components/ui/empty-state.mjs +53 -0
  390. package/dist/client/components/ui/empty-state.mjs.map +1 -0
  391. package/dist/client/components/ui/field.d.mts +3 -0
  392. package/dist/client/components/ui/field.mjs +78 -0
  393. package/dist/client/components/ui/field.mjs.map +1 -0
  394. package/dist/client/components/ui/input-group.d.mts +4 -0
  395. package/dist/client/components/ui/input-group.mjs +68 -0
  396. package/dist/client/components/ui/input-group.mjs.map +1 -0
  397. package/dist/client/components/ui/input.d.mts +2 -0
  398. package/dist/client/components/ui/input.mjs +17 -0
  399. package/dist/client/components/ui/input.mjs.map +1 -0
  400. package/dist/client/components/ui/kbd.mjs +24 -0
  401. package/dist/client/components/ui/kbd.mjs.map +1 -0
  402. package/dist/client/components/ui/label.d.mts +2 -0
  403. package/dist/client/components/ui/label.mjs +15 -0
  404. package/dist/client/components/ui/label.mjs.map +1 -0
  405. package/dist/client/components/ui/popover.d.mts +3 -0
  406. package/dist/client/components/ui/popover.mjs +49 -0
  407. package/dist/client/components/ui/popover.mjs.map +1 -0
  408. package/dist/client/components/ui/responsive-dialog.mjs +102 -0
  409. package/dist/client/components/ui/responsive-dialog.mjs.map +1 -0
  410. package/dist/client/components/ui/scroll-area.d.mts +2 -0
  411. package/dist/client/components/ui/search-input.mjs +74 -0
  412. package/dist/client/components/ui/search-input.mjs.map +1 -0
  413. package/dist/client/components/ui/select.d.mts +3 -0
  414. package/dist/client/components/ui/select.mjs +85 -0
  415. package/dist/client/components/ui/select.mjs.map +1 -0
  416. package/dist/client/components/ui/separator.d.mts +2 -0
  417. package/dist/client/components/ui/separator.mjs +17 -0
  418. package/dist/client/components/ui/separator.mjs.map +1 -0
  419. package/dist/client/components/ui/sheet.d.mts +3 -0
  420. package/dist/client/components/ui/sheet.mjs +78 -0
  421. package/dist/client/components/ui/sheet.mjs.map +1 -0
  422. package/dist/client/components/ui/sidebar.d.mts +8 -0
  423. package/dist/client/components/ui/sidebar.mjs +256 -0
  424. package/dist/client/components/ui/sidebar.mjs.map +1 -0
  425. package/dist/client/components/ui/skeleton.d.mts +1 -0
  426. package/dist/client/components/ui/skeleton.mjs +15 -0
  427. package/dist/client/components/ui/skeleton.mjs.map +1 -0
  428. package/dist/client/components/ui/sonner.d.mts +14 -0
  429. package/dist/client/components/ui/sonner.d.mts.map +1 -0
  430. package/dist/client/components/ui/sonner.mjs +55 -0
  431. package/dist/client/components/ui/sonner.mjs.map +1 -0
  432. package/dist/client/components/ui/spinner.d.mts +1 -0
  433. package/dist/client/components/ui/spinner.mjs +18 -0
  434. package/dist/client/components/ui/spinner.mjs.map +1 -0
  435. package/dist/client/components/ui/switch.d.mts +2 -0
  436. package/dist/client/components/ui/switch.mjs +23 -0
  437. package/dist/client/components/ui/switch.mjs.map +1 -0
  438. package/dist/client/components/ui/table.d.mts +2 -0
  439. package/dist/client/components/ui/table.mjs +66 -0
  440. package/dist/client/components/ui/table.mjs.map +1 -0
  441. package/dist/client/components/ui/tabs.d.mts +3 -0
  442. package/dist/client/components/ui/tabs.mjs +49 -0
  443. package/dist/client/components/ui/tabs.mjs.map +1 -0
  444. package/dist/client/components/ui/textarea.d.mts +2 -0
  445. package/dist/client/components/ui/textarea.mjs +15 -0
  446. package/dist/client/components/ui/textarea.mjs.map +1 -0
  447. package/dist/client/components/ui/toolbar.mjs +54 -0
  448. package/dist/client/components/ui/toolbar.mjs.map +1 -0
  449. package/dist/client/components/ui/tooltip.d.mts +2 -0
  450. package/dist/client/components/ui/tooltip.mjs +45 -0
  451. package/dist/client/components/ui/tooltip.mjs.map +1 -0
  452. package/dist/client/components/widgets/chart-widget.d.mts +57 -0
  453. package/dist/client/components/widgets/chart-widget.d.mts.map +1 -0
  454. package/dist/client/components/widgets/chart-widget.mjs +282 -0
  455. package/dist/client/components/widgets/chart-widget.mjs.map +1 -0
  456. package/dist/client/components/widgets/progress-widget.d.mts +41 -0
  457. package/dist/client/components/widgets/progress-widget.d.mts.map +1 -0
  458. package/dist/client/components/widgets/progress-widget.mjs +110 -0
  459. package/dist/client/components/widgets/progress-widget.mjs.map +1 -0
  460. package/dist/client/components/widgets/quick-actions-widget.d.mts +29 -0
  461. package/dist/client/components/widgets/quick-actions-widget.d.mts.map +1 -0
  462. package/dist/client/components/widgets/quick-actions-widget.mjs +121 -0
  463. package/dist/client/components/widgets/quick-actions-widget.mjs.map +1 -0
  464. package/dist/client/components/widgets/recent-items-widget.d.mts +51 -0
  465. package/dist/client/components/widgets/recent-items-widget.d.mts.map +1 -0
  466. package/dist/client/components/widgets/recent-items-widget.mjs +101 -0
  467. package/dist/client/components/widgets/recent-items-widget.mjs.map +1 -0
  468. package/dist/client/components/widgets/stats-widget.d.mts +55 -0
  469. package/dist/client/components/widgets/stats-widget.d.mts.map +1 -0
  470. package/dist/client/components/widgets/stats-widget.mjs +150 -0
  471. package/dist/client/components/widgets/stats-widget.mjs.map +1 -0
  472. package/dist/client/components/widgets/table-widget.d.mts +31 -0
  473. package/dist/client/components/widgets/table-widget.d.mts.map +1 -0
  474. package/dist/client/components/widgets/table-widget.mjs +139 -0
  475. package/dist/client/components/widgets/table-widget.mjs.map +1 -0
  476. package/dist/client/components/widgets/timeline-widget.d.mts +51 -0
  477. package/dist/client/components/widgets/timeline-widget.d.mts.map +1 -0
  478. package/dist/client/components/widgets/timeline-widget.mjs +168 -0
  479. package/dist/client/components/widgets/timeline-widget.mjs.map +1 -0
  480. package/dist/client/components/widgets/value-widget.d.mts +39 -0
  481. package/dist/client/components/widgets/value-widget.d.mts.map +1 -0
  482. package/dist/client/components/widgets/value-widget.mjs +111 -0
  483. package/dist/client/components/widgets/value-widget.mjs.map +1 -0
  484. package/dist/client/components/widgets/widget-skeletons.mjs +145 -0
  485. package/dist/client/components/widgets/widget-skeletons.mjs.map +1 -0
  486. package/dist/client/context/focus-context.d.mts +88 -0
  487. package/dist/client/context/focus-context.d.mts.map +1 -0
  488. package/dist/client/context/focus-context.mjs +178 -0
  489. package/dist/client/context/focus-context.mjs.map +1 -0
  490. package/dist/client/contexts/breadcrumb-context.mjs +32 -0
  491. package/dist/client/contexts/breadcrumb-context.mjs.map +1 -0
  492. package/dist/client/hooks/typed-hooks.d.mts +84 -0
  493. package/dist/client/hooks/typed-hooks.d.mts.map +1 -0
  494. package/dist/client/hooks/typed-hooks.mjs +272 -0
  495. package/dist/client/hooks/typed-hooks.mjs.map +1 -0
  496. package/dist/client/hooks/use-action.mjs +201 -0
  497. package/dist/client/hooks/use-action.mjs.map +1 -0
  498. package/dist/client/hooks/use-admin-config.mjs +40 -0
  499. package/dist/client/hooks/use-admin-config.mjs.map +1 -0
  500. package/dist/client/hooks/use-admin-preferences.mjs +68 -0
  501. package/dist/client/hooks/use-admin-preferences.mjs.map +1 -0
  502. package/dist/client/hooks/use-admin-routes.mjs +97 -0
  503. package/dist/client/hooks/use-admin-routes.mjs.map +1 -0
  504. package/dist/client/hooks/use-auth.d.mts +98 -0
  505. package/dist/client/hooks/use-auth.d.mts.map +1 -0
  506. package/dist/{use-auth-BoLmWtmU.mjs → client/hooks/use-auth.mjs} +3 -3
  507. package/dist/client/hooks/use-auth.mjs.map +1 -0
  508. package/dist/client/hooks/use-collection-fields.mjs +32 -0
  509. package/dist/client/hooks/use-collection-fields.mjs.map +1 -0
  510. package/dist/client/hooks/use-collection-meta.mjs +121 -0
  511. package/dist/client/hooks/use-collection-meta.mjs.map +1 -0
  512. package/dist/client/hooks/use-collection-schema.mjs +67 -0
  513. package/dist/client/hooks/use-collection-schema.mjs.map +1 -0
  514. package/dist/client/hooks/use-collection-validation.mjs +74 -0
  515. package/dist/client/hooks/use-collection-validation.mjs.map +1 -0
  516. package/dist/client/hooks/use-collection.d.mts +86 -0
  517. package/dist/client/hooks/use-collection.d.mts.map +1 -0
  518. package/dist/client/hooks/use-collection.mjs +214 -0
  519. package/dist/client/hooks/use-collection.mjs.map +1 -0
  520. package/dist/client/hooks/use-current-user.d.mts +57 -0
  521. package/dist/client/hooks/use-current-user.d.mts.map +1 -0
  522. package/dist/client/hooks/use-current-user.mjs +79 -0
  523. package/dist/client/hooks/use-current-user.mjs.map +1 -0
  524. package/dist/client/hooks/use-field-hooks.mjs +191 -0
  525. package/dist/client/hooks/use-field-hooks.mjs.map +1 -0
  526. package/dist/client/hooks/use-field-options.d.mts +90 -0
  527. package/dist/client/hooks/use-field-options.d.mts.map +1 -0
  528. package/dist/client/hooks/use-field-options.mjs +184 -0
  529. package/dist/client/hooks/use-field-options.mjs.map +1 -0
  530. package/dist/client/hooks/use-global-fields.mjs +27 -0
  531. package/dist/client/hooks/use-global-fields.mjs.map +1 -0
  532. package/dist/client/hooks/use-global-meta.mjs +59 -0
  533. package/dist/client/hooks/use-global-meta.mjs.map +1 -0
  534. package/dist/client/hooks/use-global-schema.mjs +33 -0
  535. package/dist/client/hooks/use-global-schema.mjs.map +1 -0
  536. package/dist/client/hooks/use-global.d.mts +40 -0
  537. package/dist/client/hooks/use-global.d.mts.map +1 -0
  538. package/dist/client/hooks/use-global.mjs +74 -0
  539. package/dist/client/hooks/use-global.mjs.map +1 -0
  540. package/dist/client/hooks/use-locks.mjs +245 -0
  541. package/dist/client/hooks/use-locks.mjs.map +1 -0
  542. package/dist/client/hooks/use-media-query.d.mts +23 -0
  543. package/dist/client/hooks/use-media-query.d.mts.map +1 -0
  544. package/dist/client/hooks/use-media-query.mjs +62 -0
  545. package/dist/client/hooks/use-media-query.mjs.map +1 -0
  546. package/dist/client/hooks/use-prefill-params.mjs +47 -0
  547. package/dist/client/hooks/use-prefill-params.mjs.map +1 -0
  548. package/dist/client/hooks/use-questpie-query-options.mjs +28 -0
  549. package/dist/client/hooks/use-questpie-query-options.mjs.map +1 -0
  550. package/dist/client/hooks/use-reactive-fields.d.mts +75 -0
  551. package/dist/client/hooks/use-reactive-fields.d.mts.map +1 -0
  552. package/dist/client/hooks/use-reactive-fields.mjs +164 -0
  553. package/dist/client/hooks/use-reactive-fields.mjs.map +1 -0
  554. package/dist/client/hooks/use-realtime-highlight.mjs +96 -0
  555. package/dist/client/hooks/use-realtime-highlight.mjs.map +1 -0
  556. package/dist/client/hooks/use-saved-views.mjs +65 -0
  557. package/dist/client/hooks/use-saved-views.mjs.map +1 -0
  558. package/dist/client/hooks/use-search.mjs +147 -0
  559. package/dist/client/hooks/use-search.mjs.map +1 -0
  560. package/dist/client/hooks/use-server-validation.mjs +199 -0
  561. package/dist/client/hooks/use-server-validation.mjs.map +1 -0
  562. package/dist/client/hooks/use-server-widget-data.d.mts +26 -0
  563. package/dist/client/hooks/use-server-widget-data.d.mts.map +1 -0
  564. package/dist/client/hooks/use-server-widget-data.mjs +40 -0
  565. package/dist/client/hooks/use-server-widget-data.mjs.map +1 -0
  566. package/dist/client/hooks/use-setup-status.d.mts +39 -0
  567. package/dist/client/hooks/use-setup-status.d.mts.map +1 -0
  568. package/dist/client/hooks/use-setup-status.mjs +50 -0
  569. package/dist/client/hooks/use-setup-status.mjs.map +1 -0
  570. package/dist/client/hooks/use-upload-collection.mjs +32 -0
  571. package/dist/client/hooks/use-upload-collection.mjs.map +1 -0
  572. package/dist/client/hooks/use-upload.d.mts +23 -0
  573. package/dist/client/hooks/use-upload.d.mts.map +1 -0
  574. package/dist/client/hooks/use-upload.mjs +145 -0
  575. package/dist/client/hooks/use-upload.mjs.map +1 -0
  576. package/dist/client/hooks/use-validation-error-map.mjs +53 -0
  577. package/dist/client/hooks/use-validation-error-map.mjs.map +1 -0
  578. package/dist/client/hooks/use-view-state.mjs +261 -0
  579. package/dist/client/hooks/use-view-state.mjs.map +1 -0
  580. package/dist/client/i18n/hooks.mjs +160 -0
  581. package/dist/client/i18n/hooks.mjs.map +1 -0
  582. package/dist/client/i18n/intl-cache.mjs +65 -0
  583. package/dist/client/i18n/intl-cache.mjs.map +1 -0
  584. package/dist/client/i18n/messages.mjs +7 -0
  585. package/dist/client/i18n/messages.mjs.map +1 -0
  586. package/dist/client/i18n/simple.d.mts +22 -0
  587. package/dist/client/i18n/simple.d.mts.map +1 -0
  588. package/dist/client/i18n/simple.mjs +157 -0
  589. package/dist/client/i18n/simple.mjs.map +1 -0
  590. package/dist/client/i18n/types.d.mts +110 -0
  591. package/dist/client/i18n/types.d.mts.map +1 -0
  592. package/dist/client/lib/utils.d.mts +1 -0
  593. package/dist/client/lib/utils.mjs +28 -0
  594. package/dist/client/lib/utils.mjs.map +1 -0
  595. package/dist/client/preview/block-scope-context.d.mts +74 -0
  596. package/dist/client/preview/block-scope-context.d.mts.map +1 -0
  597. package/dist/client/preview/block-scope-context.mjs +93 -0
  598. package/dist/client/preview/block-scope-context.mjs.map +1 -0
  599. package/dist/client/preview/index.d.mts +5 -0
  600. package/dist/client/preview/preview-banner.d.mts +46 -0
  601. package/dist/client/preview/preview-banner.d.mts.map +1 -0
  602. package/dist/client/preview/preview-banner.mjs +95 -0
  603. package/dist/client/preview/preview-banner.mjs.map +1 -0
  604. package/dist/client/preview/preview-field.d.mts +108 -0
  605. package/dist/client/preview/preview-field.d.mts.map +1 -0
  606. package/dist/client/preview/preview-field.mjs +125 -0
  607. package/dist/client/preview/preview-field.mjs.map +1 -0
  608. package/dist/client/preview/types.d.mts +115 -0
  609. package/dist/client/preview/types.d.mts.map +1 -0
  610. package/dist/client/preview/types.mjs +21 -0
  611. package/dist/client/preview/types.mjs.map +1 -0
  612. package/dist/client/preview/use-collection-preview.d.mts +71 -0
  613. package/dist/client/preview/use-collection-preview.d.mts.map +1 -0
  614. package/dist/client/preview/use-collection-preview.mjs +114 -0
  615. package/dist/client/preview/use-collection-preview.mjs.map +1 -0
  616. package/dist/client/runtime/content-locales-provider.d.mts +1 -0
  617. package/dist/client/runtime/content-locales-provider.mjs +85 -0
  618. package/dist/client/runtime/content-locales-provider.mjs.map +1 -0
  619. package/dist/client/runtime/index.d.mts +7 -0
  620. package/dist/client/runtime/index.mjs +8 -0
  621. package/dist/client/runtime/locale-scope.d.mts +2 -0
  622. package/dist/{runtime-6VZM878K.mjs → client/runtime/locale-scope.mjs} +3 -4
  623. package/dist/client/runtime/locale-scope.mjs.map +1 -0
  624. package/dist/client/runtime/provider.d.mts +10107 -0
  625. package/dist/client/runtime/provider.d.mts.map +1 -0
  626. package/dist/client/runtime/provider.mjs +229 -0
  627. package/dist/client/runtime/provider.mjs.map +1 -0
  628. package/dist/client/runtime/routes.d.mts +49 -0
  629. package/dist/client/runtime/routes.d.mts.map +1 -0
  630. package/dist/client/runtime/routes.mjs +107 -0
  631. package/dist/client/runtime/routes.mjs.map +1 -0
  632. package/dist/client/runtime/translations-provider.d.mts +2 -0
  633. package/dist/client/runtime/translations-provider.mjs +181 -0
  634. package/dist/client/runtime/translations-provider.mjs.map +1 -0
  635. package/dist/client/scope/index.d.mts +3 -0
  636. package/dist/client/scope/picker.d.mts +54 -0
  637. package/dist/client/scope/picker.d.mts.map +1 -0
  638. package/dist/client/scope/picker.mjs +161 -0
  639. package/dist/client/scope/picker.mjs.map +1 -0
  640. package/dist/client/scope/provider.d.mts +104 -0
  641. package/dist/client/scope/provider.d.mts.map +1 -0
  642. package/dist/client/scope/provider.mjs +159 -0
  643. package/dist/client/scope/provider.mjs.map +1 -0
  644. package/dist/client/scope/types.d.mts +112 -0
  645. package/dist/client/scope/types.d.mts.map +1 -0
  646. package/dist/client/styles/index.css +80 -0
  647. package/dist/client/utils/auto-expand-fields.mjs +65 -0
  648. package/dist/client/utils/auto-expand-fields.mjs.map +1 -0
  649. package/dist/client/utils/build-field-definitions-from-schema.mjs +256 -0
  650. package/dist/client/utils/build-field-definitions-from-schema.mjs.map +1 -0
  651. package/dist/client/utils/detect-relations.mjs +46 -0
  652. package/dist/client/utils/detect-relations.mjs.map +1 -0
  653. package/dist/client/utils/locale-to-flag.d.mts +118 -0
  654. package/dist/client/utils/locale-to-flag.d.mts.map +1 -0
  655. package/dist/client/utils/locale-to-flag.mjs +130 -0
  656. package/dist/client/utils/locale-to-flag.mjs.map +1 -0
  657. package/dist/client/utils/routes.mjs +196 -0
  658. package/dist/client/utils/routes.mjs.map +1 -0
  659. package/dist/client/views/auth/accept-invite-form.d.mts +73 -0
  660. package/dist/client/views/auth/accept-invite-form.d.mts.map +1 -0
  661. package/dist/client/views/auth/accept-invite-form.mjs +180 -0
  662. package/dist/client/views/auth/accept-invite-form.mjs.map +1 -0
  663. package/dist/client/views/auth/auth-layout.d.mts +44 -0
  664. package/dist/client/views/auth/auth-layout.d.mts.map +1 -0
  665. package/dist/client/views/auth/auth-layout.mjs +53 -0
  666. package/dist/client/views/auth/auth-layout.mjs.map +1 -0
  667. package/dist/client/views/auth/forgot-password-form.d.mts +59 -0
  668. package/dist/client/views/auth/forgot-password-form.d.mts.map +1 -0
  669. package/dist/{forgot-password-page-Bcp-An4Y.mjs → client/views/auth/forgot-password-form.mjs} +22 -89
  670. package/dist/client/views/auth/forgot-password-form.mjs.map +1 -0
  671. package/dist/client/views/auth/index.d.mts +7 -0
  672. package/dist/client/views/auth/invite-form.d.mts +1 -0
  673. package/dist/client/views/auth/invite-form.mjs +155 -0
  674. package/dist/client/views/auth/invite-form.mjs.map +1 -0
  675. package/dist/client/views/auth/login-form.d.mts +76 -0
  676. package/dist/client/views/auth/login-form.d.mts.map +1 -0
  677. package/dist/client/views/auth/login-form.mjs +167 -0
  678. package/dist/client/views/auth/login-form.mjs.map +1 -0
  679. package/dist/client/views/auth/reset-password-form.d.mts +66 -0
  680. package/dist/client/views/auth/reset-password-form.d.mts.map +1 -0
  681. package/dist/client/views/auth/reset-password-form.mjs +188 -0
  682. package/dist/client/views/auth/reset-password-form.mjs.map +1 -0
  683. package/dist/client/views/auth/setup-form.d.mts +61 -0
  684. package/dist/client/views/auth/setup-form.d.mts.map +1 -0
  685. package/dist/{setup-page-YAP_fzqh.mjs → client/views/auth/setup-form.mjs} +46 -124
  686. package/dist/client/views/auth/setup-form.mjs.map +1 -0
  687. package/dist/client/views/collection/auto-form-fields.d.mts +4 -0
  688. package/dist/client/views/collection/auto-form-fields.mjs +453 -0
  689. package/dist/client/views/collection/auto-form-fields.mjs.map +1 -0
  690. package/dist/client/views/collection/bulk-action-toolbar.mjs +291 -0
  691. package/dist/client/views/collection/bulk-action-toolbar.mjs.map +1 -0
  692. package/dist/client/views/collection/cells/complex-cells.d.mts +46 -0
  693. package/dist/client/views/collection/cells/complex-cells.d.mts.map +1 -0
  694. package/dist/client/views/collection/cells/complex-cells.mjs +327 -0
  695. package/dist/client/views/collection/cells/complex-cells.mjs.map +1 -0
  696. package/dist/client/views/collection/cells/index.d.mts +7 -0
  697. package/dist/client/views/collection/cells/primitive-cells.d.mts +76 -0
  698. package/dist/client/views/collection/cells/primitive-cells.d.mts.map +1 -0
  699. package/dist/client/views/collection/cells/primitive-cells.mjs +165 -0
  700. package/dist/client/views/collection/cells/primitive-cells.mjs.map +1 -0
  701. package/dist/client/views/collection/cells/relation-cells.d.mts +21 -0
  702. package/dist/client/views/collection/cells/relation-cells.d.mts.map +1 -0
  703. package/dist/client/views/collection/cells/relation-cells.mjs +105 -0
  704. package/dist/client/views/collection/cells/relation-cells.mjs.map +1 -0
  705. package/dist/client/views/collection/cells/shared/asset-thumbnail.d.mts +1 -0
  706. package/dist/client/views/collection/cells/shared/asset-thumbnail.mjs +189 -0
  707. package/dist/client/views/collection/cells/shared/asset-thumbnail.mjs.map +1 -0
  708. package/dist/client/views/collection/cells/shared/cell-helpers.d.mts +2 -0
  709. package/dist/client/views/collection/cells/shared/cell-helpers.mjs +78 -0
  710. package/dist/client/views/collection/cells/shared/cell-helpers.mjs.map +1 -0
  711. package/dist/client/views/collection/cells/shared/relation-chip.d.mts +1 -0
  712. package/dist/client/views/collection/cells/shared/relation-chip.mjs +37 -0
  713. package/dist/client/views/collection/cells/shared/relation-chip.mjs.map +1 -0
  714. package/dist/client/views/collection/cells/upload-cells.d.mts +25 -0
  715. package/dist/client/views/collection/cells/upload-cells.d.mts.map +1 -0
  716. package/dist/client/views/collection/cells/upload-cells.mjs +20 -0
  717. package/dist/client/views/collection/cells/upload-cells.mjs.map +1 -0
  718. package/dist/client/views/collection/columns/build-columns.d.mts +2 -0
  719. package/dist/client/views/collection/columns/build-columns.mjs +156 -0
  720. package/dist/client/views/collection/columns/build-columns.mjs.map +1 -0
  721. package/dist/client/views/collection/columns/column-defaults.d.mts +2 -0
  722. package/dist/client/views/collection/columns/column-defaults.mjs +108 -0
  723. package/dist/client/views/collection/columns/column-defaults.mjs.map +1 -0
  724. package/dist/client/views/collection/columns/index.d.mts +3 -0
  725. package/dist/client/views/collection/columns/types.d.mts +2 -0
  726. package/dist/client/views/collection/field-context.mjs +127 -0
  727. package/dist/client/views/collection/field-context.mjs.map +1 -0
  728. package/dist/client/views/collection/field-renderer.mjs +171 -0
  729. package/dist/client/views/collection/field-renderer.mjs.map +1 -0
  730. package/dist/client/views/collection/form-view.d.mts +112 -0
  731. package/dist/client/views/collection/form-view.d.mts.map +1 -0
  732. package/dist/client/views/collection/form-view.mjs +903 -0
  733. package/dist/client/views/collection/form-view.mjs.map +1 -0
  734. package/dist/client/views/collection/index.d.mts +9 -0
  735. package/dist/client/views/collection/table-view.d.mts +102 -0
  736. package/dist/client/views/collection/table-view.d.mts.map +1 -0
  737. package/dist/client/views/collection/table-view.mjs +695 -0
  738. package/dist/client/views/collection/table-view.mjs.map +1 -0
  739. package/dist/client/views/collection/view-skeletons.mjs +121 -0
  740. package/dist/client/views/collection/view-skeletons.mjs.map +1 -0
  741. package/dist/client/views/common/global-search.d.mts +1 -0
  742. package/dist/client/views/common/global-search.mjs +376 -0
  743. package/dist/client/views/common/global-search.mjs.map +1 -0
  744. package/dist/client/views/common/index.d.mts +1 -0
  745. package/dist/client/views/dashboard/dashboard-grid.mjs +385 -0
  746. package/dist/client/views/dashboard/dashboard-grid.mjs.map +1 -0
  747. package/dist/client/views/dashboard/dashboard-widget.mjs +178 -0
  748. package/dist/client/views/dashboard/dashboard-widget.mjs.map +1 -0
  749. package/dist/client/views/dashboard/widget-card.mjs +159 -0
  750. package/dist/client/views/dashboard/widget-card.mjs.map +1 -0
  751. package/dist/client/views/globals/global-form-view.d.mts +74 -0
  752. package/dist/client/views/globals/global-form-view.d.mts.map +1 -0
  753. package/dist/client/views/globals/global-form-view.mjs +181 -0
  754. package/dist/client/views/globals/global-form-view.mjs.map +1 -0
  755. package/dist/client/views/index.d.mts +28 -0
  756. package/dist/client/views/layout/admin-layout-provider.d.mts +140 -0
  757. package/dist/client/views/layout/admin-layout-provider.d.mts.map +1 -0
  758. package/dist/client/views/layout/admin-layout-provider.mjs +90 -0
  759. package/dist/client/views/layout/admin-layout-provider.mjs.map +1 -0
  760. package/dist/client/views/layout/admin-layout.d.mts +151 -0
  761. package/dist/client/views/layout/admin-layout.d.mts.map +1 -0
  762. package/dist/client/views/layout/admin-layout.mjs +144 -0
  763. package/dist/client/views/layout/admin-layout.mjs.map +1 -0
  764. package/dist/client/views/layout/admin-root.d.mts +7 -0
  765. package/dist/client/views/layout/admin-router.d.mts +125 -0
  766. package/dist/client/views/layout/admin-router.d.mts.map +1 -0
  767. package/dist/client/views/layout/admin-router.mjs +594 -0
  768. package/dist/client/views/layout/admin-router.mjs.map +1 -0
  769. package/dist/client/views/layout/admin-sidebar.d.mts +105 -0
  770. package/dist/client/views/layout/admin-sidebar.d.mts.map +1 -0
  771. package/dist/client/views/layout/admin-sidebar.mjs +550 -0
  772. package/dist/client/views/layout/admin-sidebar.mjs.map +1 -0
  773. package/dist/client/views/layout/admin-topbar.mjs +128 -0
  774. package/dist/client/views/layout/admin-topbar.mjs.map +1 -0
  775. package/dist/client/views/layout/index.d.mts +5 -0
  776. package/dist/client/views/pages/accept-invite-page.d.mts +67 -0
  777. package/dist/client/views/pages/accept-invite-page.d.mts.map +1 -0
  778. package/dist/client/views/pages/accept-invite-page.mjs +143 -0
  779. package/dist/client/views/pages/accept-invite-page.mjs.map +1 -0
  780. package/dist/client/views/pages/dashboard-page.d.mts +52 -0
  781. package/dist/client/views/pages/dashboard-page.d.mts.map +1 -0
  782. package/dist/client/views/pages/dashboard-page.mjs +45 -0
  783. package/dist/client/views/pages/dashboard-page.mjs.map +1 -0
  784. package/dist/client/views/pages/forgot-password-page.d.mts +59 -0
  785. package/dist/client/views/pages/forgot-password-page.d.mts.map +1 -0
  786. package/dist/client/views/pages/forgot-password-page.mjs +80 -0
  787. package/dist/client/views/pages/forgot-password-page.mjs.map +1 -0
  788. package/dist/client/views/pages/index.d.mts +7 -0
  789. package/dist/client/views/pages/invite-page.d.mts +71 -0
  790. package/dist/client/views/pages/invite-page.d.mts.map +1 -0
  791. package/dist/client/views/pages/invite-page.mjs +86 -0
  792. package/dist/client/views/pages/invite-page.mjs.map +1 -0
  793. package/dist/client/views/pages/login-page.d.mts +76 -0
  794. package/dist/client/views/pages/login-page.d.mts.map +1 -0
  795. package/dist/client/views/pages/login-page.mjs +98 -0
  796. package/dist/client/views/pages/login-page.mjs.map +1 -0
  797. package/dist/client/views/pages/reset-password-page.d.mts +66 -0
  798. package/dist/client/views/pages/reset-password-page.d.mts.map +1 -0
  799. package/dist/client/views/pages/reset-password-page.mjs +105 -0
  800. package/dist/client/views/pages/reset-password-page.mjs.map +1 -0
  801. package/dist/client/views/pages/setup-page.d.mts +64 -0
  802. package/dist/client/views/pages/setup-page.d.mts.map +1 -0
  803. package/dist/client/views/pages/setup-page.mjs +91 -0
  804. package/dist/client/views/pages/setup-page.mjs.map +1 -0
  805. package/dist/client.d.mts +92 -3
  806. package/dist/client.d.mts.map +1 -0
  807. package/dist/client.mjs +54 -12
  808. package/dist/components/rich-text/index.d.mts +1 -0
  809. package/dist/components/rich-text/rich-text-renderer.d.mts +104 -0
  810. package/dist/components/rich-text/rich-text-renderer.d.mts.map +1 -0
  811. package/dist/components/rich-text/rich-text-renderer.mjs +210 -0
  812. package/dist/components/rich-text/rich-text-renderer.mjs.map +1 -0
  813. package/dist/index.d.mts +62 -3
  814. package/dist/index.mjs +54 -12
  815. package/dist/server/adapters/nextjs.d.mts +121 -0
  816. package/dist/server/adapters/nextjs.d.mts.map +1 -0
  817. package/dist/server/adapters/nextjs.mjs +111 -0
  818. package/dist/server/adapters/nextjs.mjs.map +1 -0
  819. package/dist/server/adapters/tanstack.d.mts +133 -0
  820. package/dist/server/adapters/tanstack.d.mts.map +1 -0
  821. package/dist/server/adapters/tanstack.mjs +90 -0
  822. package/dist/server/adapters/tanstack.mjs.map +1 -0
  823. package/dist/server/augmentation.d.mts +1523 -0
  824. package/dist/server/augmentation.d.mts.map +1 -0
  825. package/dist/server/auth-helpers.d.mts +143 -0
  826. package/dist/server/auth-helpers.d.mts.map +1 -0
  827. package/dist/server/auth-helpers.mjs +108 -0
  828. package/dist/server/auth-helpers.mjs.map +1 -0
  829. package/dist/server/block/block-builder.d.mts +319 -0
  830. package/dist/server/block/block-builder.d.mts.map +1 -0
  831. package/dist/server/block/block-builder.mjs +217 -0
  832. package/dist/server/block/block-builder.mjs.map +1 -0
  833. package/dist/server/block/index.d.mts +3 -0
  834. package/dist/server/block/introspection.d.mts +84 -0
  835. package/dist/server/block/introspection.d.mts.map +1 -0
  836. package/dist/server/block/introspection.mjs +89 -0
  837. package/dist/server/block/introspection.mjs.map +1 -0
  838. package/dist/server/block/prefetch.d.mts +78 -0
  839. package/dist/server/block/prefetch.d.mts.map +1 -0
  840. package/dist/server/block/prefetch.mjs +240 -0
  841. package/dist/server/block/prefetch.mjs.map +1 -0
  842. package/dist/server/fields/blocks.d.mts +139 -0
  843. package/dist/server/fields/blocks.d.mts.map +1 -0
  844. package/dist/server/fields/blocks.mjs +192 -0
  845. package/dist/server/fields/blocks.mjs.map +1 -0
  846. package/dist/server/fields/index.d.mts +48 -0
  847. package/dist/server/fields/index.d.mts.map +1 -0
  848. package/dist/server/fields/index.mjs +16 -0
  849. package/dist/server/fields/index.mjs.map +1 -0
  850. package/dist/server/fields/rich-text.d.mts +135 -0
  851. package/dist/server/fields/rich-text.d.mts.map +1 -0
  852. package/dist/server/fields/rich-text.mjs +188 -0
  853. package/dist/server/fields/rich-text.mjs.map +1 -0
  854. package/dist/server/i18n/index.d.mts +16 -0
  855. package/dist/server/i18n/index.d.mts.map +1 -0
  856. package/dist/server/i18n/index.mjs +44 -0
  857. package/dist/server/i18n/index.mjs.map +1 -0
  858. package/dist/server/i18n/messages/cs.mjs +461 -0
  859. package/dist/server/i18n/messages/cs.mjs.map +1 -0
  860. package/dist/server/i18n/messages/de.mjs +461 -0
  861. package/dist/server/i18n/messages/de.mjs.map +1 -0
  862. package/dist/server/i18n/messages/en.mjs +493 -0
  863. package/dist/server/i18n/messages/en.mjs.map +1 -0
  864. package/dist/server/i18n/messages/es.mjs +461 -0
  865. package/dist/server/i18n/messages/es.mjs.map +1 -0
  866. package/dist/server/i18n/messages/fr.mjs +461 -0
  867. package/dist/server/i18n/messages/fr.mjs.map +1 -0
  868. package/dist/server/i18n/messages/index.mjs +24 -0
  869. package/dist/server/i18n/messages/index.mjs.map +1 -0
  870. package/dist/server/i18n/messages/pl.mjs +461 -0
  871. package/dist/server/i18n/messages/pl.mjs.map +1 -0
  872. package/dist/server/i18n/messages/pt.mjs +464 -0
  873. package/dist/server/i18n/messages/pt.mjs.map +1 -0
  874. package/dist/server/i18n/messages/sk.mjs +490 -0
  875. package/dist/server/i18n/messages/sk.mjs.map +1 -0
  876. package/dist/server/index.d.mts +20 -0
  877. package/dist/server/modules/admin/functions/admin-config.mjs +348 -0
  878. package/dist/server/modules/admin/functions/admin-config.mjs.map +1 -0
  879. package/dist/server/modules/admin/functions/execute-action.d.mts +107 -0
  880. package/dist/server/modules/admin/functions/execute-action.d.mts.map +1 -0
  881. package/dist/server/modules/admin/functions/execute-action.mjs +331 -0
  882. package/dist/server/modules/admin/functions/execute-action.mjs.map +1 -0
  883. package/dist/server/modules/admin/functions/locales.mjs +80 -0
  884. package/dist/server/modules/admin/functions/locales.mjs.map +1 -0
  885. package/dist/server/modules/admin/functions/preview.d.mts +70 -0
  886. package/dist/server/modules/admin/functions/preview.d.mts.map +1 -0
  887. package/dist/server/modules/admin/functions/preview.mjs +243 -0
  888. package/dist/server/modules/admin/functions/preview.mjs.map +1 -0
  889. package/dist/server/modules/admin/functions/reactive.d.mts +99 -0
  890. package/dist/server/modules/admin/functions/reactive.d.mts.map +1 -0
  891. package/dist/server/modules/admin/functions/reactive.mjs +378 -0
  892. package/dist/server/modules/admin/functions/reactive.mjs.map +1 -0
  893. package/dist/server/modules/admin/functions/setup.d.mts +84 -0
  894. package/dist/server/modules/admin/functions/setup.d.mts.map +1 -0
  895. package/dist/server/modules/admin/functions/setup.mjs +131 -0
  896. package/dist/server/modules/admin/functions/setup.mjs.map +1 -0
  897. package/dist/server/modules/admin/functions/translations.mjs +125 -0
  898. package/dist/server/modules/admin/functions/translations.mjs.map +1 -0
  899. package/dist/server/modules/admin/functions/widget-data.d.mts +33 -0
  900. package/dist/server/modules/admin/functions/widget-data.d.mts.map +1 -0
  901. package/dist/server/modules/admin/functions/widget-data.mjs +70 -0
  902. package/dist/server/modules/admin/functions/widget-data.mjs.map +1 -0
  903. package/dist/server/modules/admin/index.d.mts +16879 -0
  904. package/dist/server/modules/admin/index.d.mts.map +1 -0
  905. package/dist/server/modules/admin/index.mjs +249 -0
  906. package/dist/server/modules/admin/index.mjs.map +1 -0
  907. package/dist/server/modules/admin-preferences/collections/admin-preferences.collection.d.mts +3 -0
  908. package/dist/server/modules/admin-preferences/collections/admin-preferences.collection.mjs +48 -0
  909. package/dist/server/modules/admin-preferences/collections/admin-preferences.collection.mjs.map +1 -0
  910. package/dist/server/modules/admin-preferences/collections/locks.collection.d.mts +3 -0
  911. package/dist/server/modules/admin-preferences/collections/locks.collection.mjs +79 -0
  912. package/dist/server/modules/admin-preferences/collections/locks.collection.mjs.map +1 -0
  913. package/dist/server/modules/admin-preferences/collections/saved-views.collection.d.mts +1490 -0
  914. package/dist/server/modules/admin-preferences/collections/saved-views.collection.d.mts.map +1 -0
  915. package/dist/server/modules/admin-preferences/collections/saved-views.collection.mjs +57 -0
  916. package/dist/server/modules/admin-preferences/collections/saved-views.collection.mjs.map +1 -0
  917. package/dist/server/patch.d.mts +100 -0
  918. package/dist/server/patch.d.mts.map +1 -0
  919. package/dist/server/patch.mjs +1062 -0
  920. package/dist/server/patch.mjs.map +1 -0
  921. package/dist/server.d.mts +21 -250
  922. package/dist/server.mjs +19 -832
  923. package/dist/shared/preview-utils.d.mts +54 -0
  924. package/dist/shared/preview-utils.d.mts.map +1 -0
  925. package/dist/{preview-utils-BKQ9-TMa.mjs → shared/preview-utils.mjs} +2 -2
  926. package/dist/shared/preview-utils.mjs.map +1 -0
  927. package/dist/{saved-views.types-BMsz5mCy.d.mts → shared/types/saved-views.types.d.mts} +7 -2
  928. package/dist/shared/types/saved-views.types.d.mts.map +1 -0
  929. package/dist/shared.d.mts +3 -57
  930. package/dist/shared.mjs +1 -1
  931. package/package.json +12 -17
  932. package/dist/auth-layout-M8K8_q5R.mjs +0 -181
  933. package/dist/auth-layout-M8K8_q5R.mjs.map +0 -1
  934. package/dist/bulk-upload-dialog-D7w7W1Hl.mjs +0 -273
  935. package/dist/bulk-upload-dialog-D7w7W1Hl.mjs.map +0 -1
  936. package/dist/client-B7r47hEd.d.mts +0 -13403
  937. package/dist/client-B7r47hEd.d.mts.map +0 -1
  938. package/dist/client-njX1rZmi.mjs +0 -22612
  939. package/dist/client-njX1rZmi.mjs.map +0 -1
  940. package/dist/content-locales-provider-BXvuIgfg.mjs +0 -1650
  941. package/dist/content-locales-provider-BXvuIgfg.mjs.map +0 -1
  942. package/dist/dashboard-page-B4PGEdc2.mjs +0 -2500
  943. package/dist/dashboard-page-B4PGEdc2.mjs.map +0 -1
  944. package/dist/dashboard-page-mCY0pgZv.mjs +0 -3
  945. package/dist/dropzone-Do3awXKd.mjs +0 -634
  946. package/dist/dropzone-Do3awXKd.mjs.map +0 -1
  947. package/dist/forgot-password-page-Bcp-An4Y.mjs.map +0 -1
  948. package/dist/forgot-password-page-CEwsdLwn.mjs +0 -3
  949. package/dist/index-BYyqkWtn.d.mts +0 -2753
  950. package/dist/index-BYyqkWtn.d.mts.map +0 -1
  951. package/dist/login-page-BUnpCbCa.mjs +0 -3
  952. package/dist/login-page-CP4gA-dl.mjs +0 -298
  953. package/dist/login-page-CP4gA-dl.mjs.map +0 -1
  954. package/dist/preview-utils-BKQ9-TMa.mjs.map +0 -1
  955. package/dist/reset-password-page-BqfDmLxA.mjs +0 -281
  956. package/dist/reset-password-page-BqfDmLxA.mjs.map +0 -1
  957. package/dist/reset-password-page-CufHz3h3.mjs +0 -3
  958. package/dist/runtime-6VZM878K.mjs.map +0 -1
  959. package/dist/saved-views.types-BMsz5mCy.d.mts.map +0 -1
  960. package/dist/server.d.mts.map +0 -1
  961. package/dist/server.mjs.map +0 -1
  962. package/dist/setup-page-BNNzt_Z6.mjs +0 -3
  963. package/dist/setup-page-YAP_fzqh.mjs.map +0 -1
  964. package/dist/shared.d.mts.map +0 -1
  965. package/dist/use-auth-BoLmWtmU.mjs.map +0 -1
@@ -0,0 +1,1062 @@
1
+ import { BlockBuilder } from "./block/block-builder.mjs";
2
+ import { createBlocksPrefetchHook } from "./block/prefetch.mjs";
3
+ import { CollectionBuilder, GlobalBuilder, QuestpieBuilder, createFieldBuilder, createFieldDefinition } from "questpie";
4
+
5
+ //#region src/server/patch.ts
6
+ /**
7
+ * Runtime Monkey Patching for Admin Builder Methods
8
+ *
9
+ * This module patches QuestpieBuilder, CollectionBuilder, and GlobalBuilder
10
+ * with admin-specific methods when adminModule is used.
11
+ *
12
+ * The patches add these methods:
13
+ * - QuestpieBuilder: listView(), editView(), component(), listViews(), editViews(), components()
14
+ * - CollectionBuilder: admin(), list(), form(), preview()
15
+ * - GlobalBuilder: admin(), form()
16
+ *
17
+ * Type augmentation is handled by ./augmentation.ts which extends the builder types.
18
+ *
19
+ * @internal This module is automatically imported by adminModule.
20
+ */
21
+ let patchesApplied = false;
22
+ /**
23
+ * Resolve registry source state.
24
+ *
25
+ * - Collection/Global builders: registry lives on `state["~questpieApp"].state`
26
+ * - QuestpieBuilder: registry lives on `state`
27
+ */
28
+ function getRegistrySourceState(builderState) {
29
+ const questpieApp = builderState["~questpieApp"];
30
+ if (questpieApp?.state && typeof questpieApp.state === "object") return questpieApp.state;
31
+ return builderState;
32
+ }
33
+ /**
34
+ * Resolve registered component names from builder state.
35
+ */
36
+ function getRegisteredComponentNames(builderState) {
37
+ const components = getRegistrySourceState(builderState).components;
38
+ if (!components || typeof components !== "object") return [];
39
+ return Object.keys(components);
40
+ }
41
+ /**
42
+ * Normalize component props into a serializable object.
43
+ *
44
+ * Backward compatibility:
45
+ * - `c.icon("ph:users")` => `{ name: "ph:users" }`
46
+ */
47
+ function normalizeComponentProps(componentType, props) {
48
+ if (componentType === "icon" && typeof props === "string") return { name: props };
49
+ if (props === null || props === void 0) return {};
50
+ if (typeof props === "object") return props;
51
+ return { value: props };
52
+ }
53
+ /**
54
+ * Create a component proxy for registered component references.
55
+ * Used in admin config functions (`.admin()`, `.actions()`, `.dashboard()`, `.sidebar()`).
56
+ *
57
+ * @example
58
+ * ```ts
59
+ * .admin(({ c }) => ({
60
+ * icon: c.icon("ph:users"),
61
+ * badge: c.badge({ text: "New", color: "green" }),
62
+ * }))
63
+ * ```
64
+ */
65
+ function createComponentProxy(builderState) {
66
+ const componentNames = getRegisteredComponentNames(builderState);
67
+ const registeredComponentSet = new Set(componentNames);
68
+ return new Proxy({}, {
69
+ get: (_target, prop) => {
70
+ if (typeof prop !== "string") return;
71
+ if (prop === "then") return;
72
+ if (registeredComponentSet.size === 0) throw new Error("No components registered. Register components via .components() or use q.use(adminModule) defaults.");
73
+ if (!registeredComponentSet.has(prop)) throw new Error(`Unknown component "${prop}". Register it via .components(). Available components: ${[...registeredComponentSet].sort().join(", ")}`);
74
+ return (props) => ({
75
+ type: prop,
76
+ props: normalizeComponentProps(prop, props)
77
+ });
78
+ },
79
+ has: (_target, prop) => {
80
+ if (typeof prop !== "string") return false;
81
+ return registeredComponentSet.has(prop);
82
+ },
83
+ ownKeys: () => [...registeredComponentSet],
84
+ getOwnPropertyDescriptor: (_target, prop) => {
85
+ if (typeof prop !== "string") return;
86
+ if (!registeredComponentSet.has(prop)) return;
87
+ return {
88
+ configurable: true,
89
+ enumerable: true,
90
+ writable: false,
91
+ value: (props) => ({
92
+ type: prop,
93
+ props: normalizeComponentProps(prop, props)
94
+ })
95
+ };
96
+ }
97
+ });
98
+ }
99
+ /**
100
+ * Create a field proxy for referencing collection fields.
101
+ * Returns field names as strings for config objects.
102
+ *
103
+ * @example
104
+ * ```ts
105
+ * .list(({ f }) => ({
106
+ * columns: [f.title, f.author, f.createdAt],
107
+ * }))
108
+ * ```
109
+ */
110
+ function createFieldProxy(fieldNames) {
111
+ return new Proxy({}, {
112
+ get: (_target, prop) => prop,
113
+ has: (_target, prop) => fieldNames.includes(prop),
114
+ ownKeys: () => fieldNames,
115
+ getOwnPropertyDescriptor: (_target, prop) => {
116
+ if (fieldNames.includes(prop)) return {
117
+ configurable: true,
118
+ enumerable: true,
119
+ value: prop
120
+ };
121
+ }
122
+ });
123
+ }
124
+ /**
125
+ * Create a view proxy for defining view configurations.
126
+ *
127
+ * If the builder is bound to a Questpie app with registered views
128
+ * (`.listViews()` / `.editViews()`), the proxy only allows those names.
129
+ * If no registry is available (standalone builders), any view name is allowed.
130
+ *
131
+ * @example
132
+ * ```ts
133
+ * .list(({ v }) => v.table({
134
+ * columns: [...],
135
+ * defaultSort: { field: "createdAt", direction: "desc" },
136
+ * }))
137
+ * ```
138
+ */
139
+ function createViewProxy(kind, registeredViews = []) {
140
+ const registeredViewSet = new Set(registeredViews);
141
+ const hasRegistry = registeredViewSet.size > 0;
142
+ return new Proxy({}, {
143
+ get: (_target, prop) => {
144
+ if (typeof prop !== "string") return;
145
+ if (prop === "then") return;
146
+ const registerMethod = kind === "list" ? "listViews" : "editViews";
147
+ if (!hasRegistry) throw new Error(`No ${kind} views registered. Register them via .${registerMethod}() or use q.use(adminModule) defaults.`);
148
+ if (!registeredViewSet.has(prop)) {
149
+ const available = [...registeredViewSet].sort().join(", ");
150
+ throw new Error(`Unknown ${kind} view "${prop}". Register it via .${registerMethod}(). Available ${kind} views: ${available || "(none)"}`);
151
+ }
152
+ return (config = {}) => ({
153
+ view: prop,
154
+ ...config
155
+ });
156
+ },
157
+ has: (_target, prop) => {
158
+ if (typeof prop !== "string") return false;
159
+ return hasRegistry && registeredViewSet.has(prop);
160
+ },
161
+ ownKeys: () => hasRegistry ? [...registeredViewSet] : [],
162
+ getOwnPropertyDescriptor: (_target, prop) => {
163
+ if (typeof prop !== "string") return;
164
+ if (hasRegistry && !registeredViewSet.has(prop)) return;
165
+ return {
166
+ configurable: true,
167
+ enumerable: hasRegistry,
168
+ writable: false,
169
+ value: (config = {}) => ({
170
+ view: prop,
171
+ ...config
172
+ })
173
+ };
174
+ }
175
+ });
176
+ }
177
+ /**
178
+ * Resolve registered view names from a builder's parent Questpie app state.
179
+ */
180
+ function getRegisteredViewNames(builderState, kind) {
181
+ const views = getRegistrySourceState(builderState)[kind === "list" ? "listViews" : "editViews"];
182
+ if (!views || typeof views !== "object") return [];
183
+ return Object.keys(views);
184
+ }
185
+ /**
186
+ * Validate a selected view name against registered view names.
187
+ */
188
+ function ensureRegisteredView(kind, viewName, registeredViews) {
189
+ if (registeredViews.length === 0 || typeof viewName !== "string") return;
190
+ if (registeredViews.includes(viewName)) return;
191
+ const registerMethod = kind === "list" ? "listViews" : "editViews";
192
+ throw new Error(`Unknown ${kind} view "${viewName}". Register it via .${registerMethod}(). Available ${kind} views: ${registeredViews.sort().join(", ")}`);
193
+ }
194
+ /**
195
+ * Create an action proxy for referencing built-in and custom actions.
196
+ *
197
+ * @example
198
+ * ```ts
199
+ * .list(({ a }) => ({
200
+ * actions: {
201
+ * header: { primary: [a.create] },
202
+ * bulk: [a.delete, a.export],
203
+ * },
204
+ * }))
205
+ * ```
206
+ */
207
+ function createActionProxy() {
208
+ return {
209
+ create: "create",
210
+ save: "save",
211
+ delete: "delete",
212
+ deleteMany: "deleteMany",
213
+ duplicate: "duplicate",
214
+ export: "export",
215
+ custom: (name, config) => ({
216
+ type: name,
217
+ config
218
+ })
219
+ };
220
+ }
221
+ /**
222
+ * Create action helpers for dashboard header actions.
223
+ */
224
+ function createDashboardActionProxy() {
225
+ const toCollectionCreatePath = (collection) => `/admin/collections/${collection}/create`;
226
+ const toGlobalPath = (global) => `/admin/globals/${global}`;
227
+ return {
228
+ action: (config) => config,
229
+ link: (config) => config,
230
+ create: ({ collection, ...config }) => ({
231
+ ...config,
232
+ href: toCollectionCreatePath(collection)
233
+ }),
234
+ global: ({ global, ...config }) => ({
235
+ ...config,
236
+ href: toGlobalPath(global)
237
+ })
238
+ };
239
+ }
240
+ /**
241
+ * Create an actions config context for the .actions() method.
242
+ * Provides builders for both built-in and custom actions.
243
+ *
244
+ * @example
245
+ * ```ts
246
+ * .actions(({ a, c, f }) => ({
247
+ * builtin: [a.create(), a.delete(), a.deleteMany()],
248
+ * custom: [
249
+ * a.action({
250
+ * id: "send-email",
251
+ * label: { en: "Send Email" },
252
+ * icon: c.icon("ph:envelope"),
253
+ * form: {
254
+ * title: { en: "Send Email" },
255
+ * fields: {
256
+ * subject: f.text({ label: { en: "Subject" }, required: true }),
257
+ * message: f.textarea({ label: { en: "Message" } }),
258
+ * },
259
+ * },
260
+ * handler: async ({ data }) => {
261
+ * return { type: "success", toast: { message: "Email sent!" } };
262
+ * },
263
+ * }),
264
+ * ],
265
+ * }))
266
+ * ```
267
+ */
268
+ function createActionsConfigContext(builderState, fieldRegistry) {
269
+ const fieldProxy = new Proxy({}, { get: (_target, prop) => {
270
+ const factory = fieldRegistry[prop];
271
+ if (!factory) {
272
+ const available = Object.keys(fieldRegistry).sort();
273
+ if (available.length === 0) throw new Error("No field types registered for action form fields. Register fields on the Questpie builder before using .actions().");
274
+ throw new Error(`Unknown field type: "${prop}". Available types: ${available.join(", ")}`);
275
+ }
276
+ return (config) => factory(config);
277
+ } });
278
+ return {
279
+ a: {
280
+ create: () => "create",
281
+ save: () => "save",
282
+ delete: () => "delete",
283
+ deleteMany: () => "deleteMany",
284
+ duplicate: () => "duplicate",
285
+ action: (def) => ({
286
+ ...def,
287
+ scope: def.scope ?? "single"
288
+ }),
289
+ bulkAction: (def) => ({
290
+ ...def,
291
+ scope: "bulk"
292
+ }),
293
+ headerAction: (def) => ({
294
+ ...def,
295
+ scope: "header"
296
+ })
297
+ },
298
+ c: createComponentProxy(builderState),
299
+ f: fieldProxy
300
+ };
301
+ }
302
+ /**
303
+ * Patch QuestpieBuilder with admin methods
304
+ */
305
+ function patchQuestpieBuilder() {
306
+ const proto = QuestpieBuilder.prototype;
307
+ /**
308
+ * Create a list view definition.
309
+ * Returns a definition object for use in .listViews()
310
+ */
311
+ proto.listView = (name, config = {}) => ({
312
+ type: "listView",
313
+ name,
314
+ ...config
315
+ });
316
+ /**
317
+ * Create an edit view definition.
318
+ * Returns a definition object for use in .editViews()
319
+ */
320
+ proto.editView = (name, config = {}) => ({
321
+ type: "editView",
322
+ name,
323
+ ...config
324
+ });
325
+ /**
326
+ * Create a component definition.
327
+ * Returns a definition object for use in .components()
328
+ */
329
+ proto.component = (name, config = {}) => ({
330
+ type: "component",
331
+ name,
332
+ ...config
333
+ });
334
+ /**
335
+ * Register list views on the builder.
336
+ * Merges with existing list views.
337
+ */
338
+ proto.listViews = function(views) {
339
+ return new QuestpieBuilder({
340
+ ...this.state,
341
+ listViews: {
342
+ ...this.state.listViews || {},
343
+ ...views
344
+ }
345
+ });
346
+ };
347
+ /**
348
+ * Register edit views on the builder.
349
+ * Merges with existing edit views.
350
+ */
351
+ proto.editViews = function(views) {
352
+ return new QuestpieBuilder({
353
+ ...this.state,
354
+ editViews: {
355
+ ...this.state.editViews || {},
356
+ ...views
357
+ }
358
+ });
359
+ };
360
+ /**
361
+ * Register components on the builder.
362
+ * Merges with existing components.
363
+ */
364
+ proto.components = function(components) {
365
+ return new QuestpieBuilder({
366
+ ...this.state,
367
+ components: {
368
+ ...this.state.components || {},
369
+ ...components
370
+ }
371
+ });
372
+ };
373
+ /**
374
+ * Register block types for the visual block editor.
375
+ * Blocks are built and stored on the state for use by blocks fields.
376
+ *
377
+ * Accepts three input shapes per block:
378
+ * - **Server BlockBuilder** (legacy): `block("hero").fields(...).prefetch(...)`
379
+ * - **Client BlockDefinition**: `heroBlock` (auto-expansion handles relations)
380
+ * - **With manual prefetch**: `{ block: heroBlock, prefetch: async ({ values, ctx }) => ({...}) }`
381
+ *
382
+ * Relation and upload fields are auto-expanded in the afterRead hook.
383
+ * Use the `{ block, prefetch }` shape for custom data that can't be auto-expanded.
384
+ *
385
+ * @example
386
+ * ```ts
387
+ * import { heroBlock, textBlock } from "./blocks";
388
+ *
389
+ * const cms = q({ name: "my-app" })
390
+ * .use(adminModule)
391
+ * .blocks({
392
+ * // Simple block - relations auto-expanded
393
+ * hero: heroBlock,
394
+ * text: textBlock,
395
+ * // Block with manual prefetch for custom data
396
+ * featuredPosts: {
397
+ * block: featuredPostsBlock,
398
+ * prefetch: async ({ values, ctx }) => {
399
+ * const posts = await ctx.app.api.collections.posts.find({ limit: values.count });
400
+ * return { posts: posts.docs };
401
+ * },
402
+ * },
403
+ * })
404
+ * .build({ ... });
405
+ * ```
406
+ */
407
+ proto.blocks = function(blocks) {
408
+ const builtBlocks = {};
409
+ for (const [name, blockInput] of Object.entries(blocks)) {
410
+ if (typeof blockInput.build === "function" && typeof blockInput.state?.name === "string") {
411
+ const blockBuilder = blockInput;
412
+ const state = blockBuilder.state;
413
+ if (state._fieldsFactory && this.state.fields) {
414
+ const fieldProxy = createFieldBuilder(this.state.fields);
415
+ state.fields = state._fieldsFactory(fieldProxy);
416
+ delete state._fieldsFactory;
417
+ }
418
+ builtBlocks[name] = blockBuilder.build();
419
+ continue;
420
+ }
421
+ let blockDef;
422
+ let prefetchFn;
423
+ if ("block" in blockInput && typeof blockInput.block === "object" && blockInput.block !== null && "name" in blockInput.block) {
424
+ const wrapper = blockInput;
425
+ blockDef = wrapper.block;
426
+ prefetchFn = wrapper.prefetch;
427
+ } else blockDef = blockInput;
428
+ builtBlocks[name] = {
429
+ name: blockDef.name || name,
430
+ state: {
431
+ ...blockDef.state,
432
+ prefetch: prefetchFn || blockDef.state.prefetch
433
+ },
434
+ getFieldMetadata: blockDef.getFieldMetadata.bind(blockDef),
435
+ executePrefetch: async (values, ctx) => {
436
+ if (prefetchFn) return prefetchFn({
437
+ values,
438
+ ctx
439
+ });
440
+ return blockDef.executePrefetch(values, ctx);
441
+ }
442
+ };
443
+ }
444
+ return new QuestpieBuilder({
445
+ ...this.state,
446
+ blocks: {
447
+ ...this.state.blocks || {},
448
+ ...builtBlocks
449
+ }
450
+ });
451
+ };
452
+ /**
453
+ * Create a block builder bound to this Questpie builder.
454
+ * The block has access to all registered field types from `.fields()`.
455
+ *
456
+ * @example
457
+ * ```ts
458
+ * const qb = q.use(adminModule);
459
+ *
460
+ * const heroBlock = qb.block("hero")
461
+ * .label({ en: "Hero Section" })
462
+ * .icon("ph:image")
463
+ * .fields((f) => ({
464
+ * title: f.text({ required: true }), // ✅ typed from builder's field registry
465
+ * subtitle: f.text(),
466
+ * }));
467
+ *
468
+ * const cms = qb
469
+ * .blocks({ hero: heroBlock })
470
+ * .build({ ... });
471
+ * ```
472
+ */
473
+ proto.block = function(name) {
474
+ const registeredComponents = getRegisteredComponentNames(this.state);
475
+ return new BlockBuilder({
476
+ name,
477
+ "~components": registeredComponents
478
+ });
479
+ };
480
+ /**
481
+ * Configure the admin dashboard.
482
+ * Widgets that need data (stats, chart, recentItems) are executed on server.
483
+ *
484
+ * @example
485
+ * ```ts
486
+ * .dashboard(({ d, c, a }) => d.dashboard({
487
+ * title: { en: "Dashboard" },
488
+ * actions: [
489
+ * a.create({
490
+ * id: "new-user",
491
+ * collection: "users",
492
+ * label: { en: "New User" },
493
+ * icon: c.icon("ph:user-plus"),
494
+ * }),
495
+ * ],
496
+ * items: [
497
+ * d.section({
498
+ * label: { en: "Overview" },
499
+ * items: [
500
+ * d.stats({ collection: "users", label: { en: "Total Users" } }),
501
+ * ],
502
+ * }),
503
+ * ],
504
+ * }))
505
+ * ```
506
+ */
507
+ proto.dashboard = function(configFn) {
508
+ const dashboard = configFn({
509
+ a: createDashboardActionProxy(),
510
+ d: {
511
+ dashboard: (config) => config,
512
+ section: (config) => ({
513
+ type: "section",
514
+ ...config
515
+ }),
516
+ tabs: (config) => ({
517
+ type: "tabs",
518
+ ...config
519
+ }),
520
+ stats: (config) => ({
521
+ type: "stats",
522
+ ...config
523
+ }),
524
+ chart: (config) => ({
525
+ type: "chart",
526
+ ...config
527
+ }),
528
+ recentItems: (config) => ({
529
+ type: "recentItems",
530
+ ...config
531
+ }),
532
+ quickActions: (config) => ({
533
+ type: "quickActions",
534
+ ...config
535
+ }),
536
+ custom: (config) => ({
537
+ type: "custom",
538
+ ...config
539
+ }),
540
+ value: (config) => ({
541
+ type: "value",
542
+ ...config
543
+ }),
544
+ table: (config) => ({
545
+ type: "table",
546
+ ...config
547
+ }),
548
+ timeline: (config) => ({
549
+ type: "timeline",
550
+ ...config
551
+ }),
552
+ progress: (config) => ({
553
+ type: "progress",
554
+ ...config
555
+ })
556
+ },
557
+ c: createComponentProxy(this.state)
558
+ });
559
+ return new QuestpieBuilder({
560
+ ...this.state,
561
+ dashboard
562
+ });
563
+ };
564
+ /**
565
+ * Configure the admin sidebar.
566
+ * Sections can contain collections, globals, pages, links, and dividers.
567
+ *
568
+ * @example
569
+ * ```ts
570
+ * .sidebar(({ s, c }) => s.sidebar({
571
+ * sections: [
572
+ * s.section({
573
+ * id: "content",
574
+ * title: { en: "Content" },
575
+ * icon: c.icon("ph:files"),
576
+ * items: [
577
+ * { type: "collection", collection: "posts" },
578
+ * { type: "collection", collection: "pages" },
579
+ * ],
580
+ * }),
581
+ * ],
582
+ * }))
583
+ * ```
584
+ */
585
+ proto.sidebar = function(configFn) {
586
+ const sidebar = configFn({
587
+ s: {
588
+ sidebar: (config) => config,
589
+ section: (config) => ({
590
+ items: [],
591
+ ...config
592
+ })
593
+ },
594
+ c: createComponentProxy(this.state)
595
+ });
596
+ return new QuestpieBuilder({
597
+ ...this.state,
598
+ sidebar
599
+ });
600
+ };
601
+ proto.branding = function(config) {
602
+ return new QuestpieBuilder({
603
+ ...this.state,
604
+ branding: config
605
+ });
606
+ };
607
+ /**
608
+ * Configure admin UI locales (separate from content locales).
609
+ *
610
+ * UI locales control the admin interface language.
611
+ * Content locales (set via .locale()) control which languages content can be edited in.
612
+ * These don't need to match - you can have 10 content languages but only 2 UI languages.
613
+ *
614
+ * @example
615
+ * ```ts
616
+ * const cms = q({ name: "my-app" })
617
+ * .use(adminModule)
618
+ * // Content can be in many languages
619
+ * .locale({
620
+ * locales: [{ code: "en" }, { code: "sk" }, { code: "de" }, ...],
621
+ * defaultLocale: "en",
622
+ * })
623
+ * // But admin UI only in 2 languages
624
+ * .adminLocale({
625
+ * locales: ["en", "sk"],
626
+ * defaultLocale: "en",
627
+ * })
628
+ * .build({ ... });
629
+ * ```
630
+ */
631
+ proto.adminLocale = function(config) {
632
+ return new QuestpieBuilder({
633
+ ...this.state,
634
+ adminLocale: config
635
+ });
636
+ };
637
+ /**
638
+ * Patch .use() to propagate admin extension properties.
639
+ *
640
+ * The core .use() only merges hardcoded properties (collections, globals,
641
+ * jobs, emailTemplates, fields, auth, locale, migrations, translations).
642
+ * Admin extensions (sidebar, dashboard, branding, listViews, editViews,
643
+ * components, blocks, adminLocale) would be lost without this patch.
644
+ */
645
+ const originalUse = proto.use;
646
+ proto.use = function(other) {
647
+ const result = originalUse.call(this, other);
648
+ const otherState = other.state;
649
+ const coreKeys = new Set([
650
+ "name",
651
+ "collections",
652
+ "globals",
653
+ "jobs",
654
+ "emailTemplates",
655
+ "fields",
656
+ "auth",
657
+ "locale",
658
+ "migrations",
659
+ "translations",
660
+ "~messageKeys"
661
+ ]);
662
+ const extensionState = {};
663
+ for (const key of Object.keys(this.state)) if (!coreKeys.has(key) && this.state[key] !== void 0) extensionState[key] = this.state[key];
664
+ for (const key of Object.keys(otherState)) if (!coreKeys.has(key) && otherState[key] !== void 0) extensionState[key] = otherState[key];
665
+ if (Object.keys(extensionState).length > 0) return new QuestpieBuilder({
666
+ ...result.state,
667
+ ...extensionState
668
+ });
669
+ return result;
670
+ };
671
+ /**
672
+ * Patch .build() to inject block definitions into blocks-type field configs
673
+ * before the real build, and to store admin extension state on the built
674
+ * Questpie instance so getAdminConfig can read sidebar/dashboard/etc.
675
+ */
676
+ const originalBuild = proto.build;
677
+ proto.build = function(...args) {
678
+ const blockDefs = this.state.blocks;
679
+ if (blockDefs && Object.keys(blockDefs).length > 0) {
680
+ injectBlockDefinitions(this.state, blockDefs);
681
+ injectBlocksPrefetchHooks(this.state);
682
+ validateAllowedBlocks(this.state, blockDefs);
683
+ }
684
+ const instance = originalBuild.apply(this, args);
685
+ const extensionKeys = [
686
+ "sidebar",
687
+ "dashboard",
688
+ "branding",
689
+ "blocks",
690
+ "listViews",
691
+ "editViews",
692
+ "components",
693
+ "adminLocale"
694
+ ];
695
+ const adminState = {};
696
+ for (const key of extensionKeys) if (this.state[key] !== void 0) adminState[key] = this.state[key];
697
+ instance.state = adminState;
698
+ return instance;
699
+ };
700
+ }
701
+ /**
702
+ * Inject block definitions into all blocks-type field configs
703
+ * in collections and globals. Enables per-block field validation.
704
+ * @internal
705
+ */
706
+ function injectBlockDefinitions(state, blockDefs) {
707
+ if (state.collections) for (const collection of Object.values(state.collections)) {
708
+ const fields = collection?.state?.fields;
709
+ if (!fields) continue;
710
+ for (const fieldDef of Object.values(fields)) if (fieldDef?.state?.config?.type === "blocks") fieldDef.state.config._blockDefinitions = blockDefs;
711
+ }
712
+ if (state.globals) for (const global of Object.values(state.globals)) {
713
+ const fields = global?.state?.fields;
714
+ if (!fields) continue;
715
+ for (const fieldDef of Object.values(fields)) if (fieldDef?.state?.config?.type === "blocks") fieldDef.state.config._blockDefinitions = blockDefs;
716
+ }
717
+ }
718
+ /**
719
+ * Auto-inject afterRead hook for blocks prefetch on collections/globals
720
+ * that have at least one blocks-type field.
721
+ *
722
+ * This eliminates the need for manually adding:
723
+ * ```ts
724
+ * .hooks({ afterRead: createBlocksPrefetchHook() })
725
+ * ```
726
+ * @internal
727
+ */
728
+ function injectBlocksPrefetchHooks(state) {
729
+ const prefetchHook = createBlocksPrefetchHook();
730
+ const injectIfHasBlocksField = (entity, name) => {
731
+ const fieldDefinitions = entity?.state?.fieldDefinitions;
732
+ if (!fieldDefinitions) return;
733
+ if (!Object.values(fieldDefinitions).some((fieldDef) => fieldDef?.state?.type === "blocks")) return;
734
+ if (!entity.state.hooks) entity.state.hooks = {};
735
+ const existing = entity.state.hooks.afterRead;
736
+ if (!existing) entity.state.hooks.afterRead = prefetchHook;
737
+ else {
738
+ const existingArray = Array.isArray(existing) ? existing : [existing];
739
+ entity.state.hooks.afterRead = [...existingArray, prefetchHook];
740
+ }
741
+ };
742
+ if (state.collections) for (const [name, collection] of Object.entries(state.collections)) injectIfHasBlocksField(collection, name);
743
+ if (state.globals) for (const [name, global] of Object.entries(state.globals)) injectIfHasBlocksField(global, name);
744
+ }
745
+ /**
746
+ * Validate that all `allowedBlocks` entries reference registered block types.
747
+ * Logs warnings in development for unknown block types.
748
+ * @internal
749
+ */
750
+ function validateAllowedBlocks(state, blockDefs) {
751
+ const registeredNames = new Set(Object.keys(blockDefs));
752
+ const checkFields = (fields, context) => {
753
+ if (!fields) return;
754
+ for (const [fieldName, fieldDef] of Object.entries(fields)) {
755
+ const config = fieldDef?.state?.config;
756
+ if (config?.type === "blocks" && Array.isArray(config.allowedBlocks)) {
757
+ for (const blockType of config.allowedBlocks) if (!registeredNames.has(blockType)) console.warn(`[admin] Unknown block type "${blockType}" in allowedBlocks for field "${fieldName}" in ${context}. Registered block types: ${[...registeredNames].join(", ")}`);
758
+ }
759
+ }
760
+ };
761
+ if (state.collections) for (const [name, collection] of Object.entries(state.collections)) checkFields(collection?.state?.fields, `collection "${name}"`);
762
+ if (state.globals) for (const [name, global] of Object.entries(state.globals)) checkFields(global?.state?.fields, `global "${name}"`);
763
+ }
764
+ /**
765
+ * Patch CollectionBuilder with admin methods
766
+ */
767
+ function patchCollectionBuilder() {
768
+ const proto = CollectionBuilder.prototype;
769
+ /**
770
+ * Set admin metadata for the collection.
771
+ * Defines how the collection appears in the admin sidebar and UI.
772
+ *
773
+ * @example
774
+ * ```ts
775
+ * .admin(({ c }) => ({
776
+ * label: { en: "Posts", sk: "Príspevky" },
777
+ * icon: c.icon("ph:article"),
778
+ * description: { en: "Blog posts and articles" },
779
+ * }))
780
+ * ```
781
+ */
782
+ proto.admin = function(configOrFn) {
783
+ const config = typeof configOrFn === "function" ? configOrFn({ c: createComponentProxy(this.state) }) : configOrFn;
784
+ const newBuilder = new CollectionBuilder({
785
+ ...this.state,
786
+ admin: config
787
+ });
788
+ if (this._indexesFn) newBuilder._indexesFn = this._indexesFn;
789
+ return newBuilder;
790
+ };
791
+ /**
792
+ * Configure list view for the collection.
793
+ * Defines columns, sorting, filtering, and actions for the list page.
794
+ *
795
+ * @example
796
+ * ```ts
797
+ * .list(({ v, f, a }) => v.table({
798
+ * columns: [f.title, f.author, f.status, f.createdAt],
799
+ * defaultSort: { field: "createdAt", direction: "desc" },
800
+ * searchable: ["title", "content"],
801
+ * filterable: ["status", "author"],
802
+ * actions: {
803
+ * header: { primary: [a.create] },
804
+ * row: [a.duplicate, a.delete],
805
+ * bulk: [a.delete],
806
+ * },
807
+ * }))
808
+ * ```
809
+ */
810
+ proto.list = function(configFn) {
811
+ const fieldNames = Object.keys(this.state.fields || {});
812
+ const registeredListViews = getRegisteredViewNames(this.state, "list");
813
+ const config = configFn({
814
+ v: createViewProxy("list", registeredListViews),
815
+ f: createFieldProxy(fieldNames),
816
+ a: createActionProxy()
817
+ });
818
+ ensureRegisteredView("list", config.view, registeredListViews);
819
+ const newBuilder = new CollectionBuilder({
820
+ ...this.state,
821
+ adminList: config
822
+ });
823
+ if (this._indexesFn) newBuilder._indexesFn = this._indexesFn;
824
+ return newBuilder;
825
+ };
826
+ /**
827
+ * Configure form view for the collection.
828
+ * Defines field layout, sections, and tabs for create/edit pages.
829
+ *
830
+ * @example
831
+ * ```ts
832
+ * .form(({ v, f }) => v.form({
833
+ * sections: [
834
+ * {
835
+ * label: { en: "Basic Info" },
836
+ * fields: [f.title, f.slug, f.content],
837
+ * },
838
+ * {
839
+ * label: { en: "Publishing" },
840
+ * fields: [f.status, f.publishedAt, f.author],
841
+ * collapsible: true,
842
+ * },
843
+ * ],
844
+ * }))
845
+ * ```
846
+ */
847
+ proto.form = function(configFn) {
848
+ const fieldNames = Object.keys(this.state.fields || {});
849
+ const registeredEditViews = getRegisteredViewNames(this.state, "edit");
850
+ const config = configFn({
851
+ v: createViewProxy("edit", registeredEditViews),
852
+ f: createFieldProxy(fieldNames)
853
+ });
854
+ ensureRegisteredView("edit", config.view, registeredEditViews);
855
+ const newBuilder = new CollectionBuilder({
856
+ ...this.state,
857
+ adminForm: config
858
+ });
859
+ if (this._indexesFn) newBuilder._indexesFn = this._indexesFn;
860
+ return newBuilder;
861
+ };
862
+ /**
863
+ * Configure preview for the collection.
864
+ * Enables live preview panel in the edit page.
865
+ *
866
+ * @example
867
+ * ```ts
868
+ * .preview({
869
+ * enabled: true,
870
+ * url: ({ record, locale }) => `/preview/posts/${record.slug}?locale=${locale}`,
871
+ * position: "right",
872
+ * defaultWidth: 50,
873
+ * })
874
+ * ```
875
+ */
876
+ proto.preview = function(config) {
877
+ const newBuilder = new CollectionBuilder({
878
+ ...this.state,
879
+ adminPreview: config
880
+ });
881
+ if (this._indexesFn) newBuilder._indexesFn = this._indexesFn;
882
+ return newBuilder;
883
+ };
884
+ /**
885
+ * Configure actions for the collection.
886
+ * Enables built-in actions (create, delete, etc.) and custom actions with forms.
887
+ *
888
+ * Form fields use the same field registry as collections. The field proxy `f`
889
+ * is resolved at build time when the full field registry is available.
890
+ *
891
+ * @example
892
+ * ```ts
893
+ * .actions(({ a, c, f }) => ({
894
+ * builtin: [a.create(), a.delete(), a.deleteMany(), a.duplicate()],
895
+ * custom: [
896
+ * a.action({
897
+ * id: "publish",
898
+ * label: { en: "Publish" },
899
+ * icon: c.icon("ph:check-circle"),
900
+ * confirmation: {
901
+ * title: { en: "Publish this item?" },
902
+ * description: { en: "This will make the item visible to the public." },
903
+ * },
904
+ * handler: async ({ itemId, app, db }) => {
905
+ * // publish logic
906
+ * return { type: "success", toast: { message: "Published!" } };
907
+ * },
908
+ * }),
909
+ * a.action({
910
+ * id: "send-email",
911
+ * label: { en: "Send Email" },
912
+ * icon: c.icon("ph:envelope"),
913
+ * form: {
914
+ * title: { en: "Send Email" },
915
+ * fields: {
916
+ * subject: f.text({ label: { en: "Subject" }, required: true }),
917
+ * message: f.textarea({ label: { en: "Message" } }),
918
+ * },
919
+ * },
920
+ * handler: async ({ data }) => {
921
+ * // send email logic - data.subject, data.message are typed
922
+ * return { type: "success", toast: { message: "Email sent!" } };
923
+ * },
924
+ * }),
925
+ * a.bulkAction({
926
+ * id: "bulk-publish",
927
+ * label: { en: "Publish Selected" },
928
+ * handler: async ({ itemIds }) => {
929
+ * // bulk publish logic
930
+ * return { type: "success", toast: { message: `${itemIds?.length} items published!` } };
931
+ * },
932
+ * }),
933
+ * ],
934
+ * }))
935
+ * ```
936
+ */
937
+ proto.actions = function(configFn) {
938
+ const builderFields = this.state["~questpieApp"]?.state?.fields;
939
+ const fieldRegistry = {};
940
+ if (builderFields && Object.keys(builderFields).length > 0) for (const [name, fieldDef] of Object.entries(builderFields)) fieldRegistry[name] = (config$1) => createFieldDefinition(fieldDef, config$1);
941
+ const config = configFn(createActionsConfigContext(this.state, fieldRegistry));
942
+ const newBuilder = new CollectionBuilder({
943
+ ...this.state,
944
+ adminActions: config
945
+ });
946
+ if (this._indexesFn) newBuilder._indexesFn = this._indexesFn;
947
+ return newBuilder;
948
+ };
949
+ /**
950
+ * Patch .merge() to propagate admin extension properties.
951
+ *
952
+ * The core .merge() only merges hardcoded collection properties (fields,
953
+ * indexes, hooks, access, etc.). Admin extensions (admin, adminList,
954
+ * adminForm, adminPreview, adminActions) would be lost without this patch.
955
+ */
956
+ const originalMerge = proto.merge;
957
+ proto.merge = function(other) {
958
+ const result = originalMerge.call(this, other);
959
+ for (const key of [
960
+ "admin",
961
+ "adminList",
962
+ "adminForm",
963
+ "adminPreview",
964
+ "adminActions"
965
+ ]) {
966
+ const thisVal = this.state[key];
967
+ const otherVal = other.state[key];
968
+ if (otherVal !== void 0) result.state[key] = otherVal;
969
+ else if (thisVal !== void 0) result.state[key] = thisVal;
970
+ }
971
+ return result;
972
+ };
973
+ }
974
+ /**
975
+ * Patch GlobalBuilder with admin methods
976
+ */
977
+ function patchGlobalBuilder() {
978
+ const proto = GlobalBuilder.prototype;
979
+ /**
980
+ * Set admin metadata for the global.
981
+ * Defines how the global appears in the admin sidebar and UI.
982
+ *
983
+ * @example
984
+ * ```ts
985
+ * .admin(({ c }) => ({
986
+ * label: { en: "Site Settings", sk: "Nastavenia stránky" },
987
+ * icon: c.icon("ph:gear"),
988
+ * }))
989
+ * ```
990
+ */
991
+ proto.admin = function(configOrFn) {
992
+ const config = typeof configOrFn === "function" ? configOrFn({ c: createComponentProxy(this.state) }) : configOrFn;
993
+ return new GlobalBuilder({
994
+ ...this.state,
995
+ admin: config
996
+ });
997
+ };
998
+ /**
999
+ * Configure form view for the global.
1000
+ * Defines field layout, sections, and tabs for the settings page.
1001
+ *
1002
+ * @example
1003
+ * ```ts
1004
+ * .form(({ v, f }) => v.form({
1005
+ * tabs: [
1006
+ * {
1007
+ * label: { en: "General" },
1008
+ * icon: c.icon("ph:gear"),
1009
+ * sections: [
1010
+ * { fields: [f.siteName, f.siteDescription, f.logo] },
1011
+ * ],
1012
+ * },
1013
+ * {
1014
+ * label: { en: "Social Media" },
1015
+ * icon: c.icon("ph:share-network"),
1016
+ * sections: [
1017
+ * { fields: [f.socialLinks] },
1018
+ * ],
1019
+ * },
1020
+ * ],
1021
+ * }))
1022
+ * ```
1023
+ */
1024
+ proto.form = function(configFn) {
1025
+ const fieldNames = Object.keys(this.state.fields || {});
1026
+ const registeredEditViews = getRegisteredViewNames(this.state, "edit");
1027
+ const config = configFn({
1028
+ v: createViewProxy("edit", registeredEditViews),
1029
+ f: createFieldProxy(fieldNames)
1030
+ });
1031
+ ensureRegisteredView("edit", config.view, registeredEditViews);
1032
+ return new GlobalBuilder({
1033
+ ...this.state,
1034
+ adminForm: config
1035
+ });
1036
+ };
1037
+ }
1038
+ /**
1039
+ * Apply all admin patches to builder prototypes.
1040
+ * This function is idempotent - calling it multiple times has no effect.
1041
+ *
1042
+ * Called automatically when adminModule is used via .use()
1043
+ */
1044
+ function applyAdminPatches() {
1045
+ if (patchesApplied) return;
1046
+ patchQuestpieBuilder();
1047
+ patchCollectionBuilder();
1048
+ patchGlobalBuilder();
1049
+ patchesApplied = true;
1050
+ }
1051
+ /**
1052
+ * Check if admin patches have been applied.
1053
+ * Useful for debugging and testing.
1054
+ */
1055
+ function arePatchesApplied() {
1056
+ return patchesApplied;
1057
+ }
1058
+ applyAdminPatches();
1059
+
1060
+ //#endregion
1061
+ export { applyAdminPatches, arePatchesApplied, createActionProxy, createComponentProxy, createFieldProxy, createViewProxy };
1062
+ //# sourceMappingURL=patch.mjs.map