nextjs-studio 0.3.0 → 1.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 (238) hide show
  1. package/README.md +3 -1
  2. package/dist/bin/nextjs-studio.js +315 -54
  3. package/dist/bin/nextjs-studio.js.map +1 -1
  4. package/dist/cli/ui/.next/BUILD_ID +1 -0
  5. package/dist/cli/ui/.next/app-path-routes-manifest.json +12 -0
  6. package/dist/cli/ui/.next/build-manifest.json +20 -0
  7. package/dist/cli/ui/.next/export-marker.json +6 -0
  8. package/dist/cli/ui/.next/images-manifest.json +67 -0
  9. package/dist/cli/ui/.next/next-minimal-server.js.nft.json +1 -0
  10. package/dist/cli/ui/.next/next-server.js.nft.json +1 -0
  11. package/dist/cli/ui/.next/package.json +1 -0
  12. package/dist/cli/ui/.next/prerender-manifest.json +61 -0
  13. package/dist/cli/ui/.next/react-loadable-manifest.json +286 -0
  14. package/dist/cli/ui/.next/required-server-files.js +338 -0
  15. package/dist/cli/ui/.next/required-server-files.json +338 -0
  16. package/dist/cli/ui/.next/routes-manifest.json +125 -0
  17. package/dist/cli/ui/.next/server/app/_global-error/page.js +3 -0
  18. package/dist/cli/ui/.next/server/app/_global-error/page.js.nft.json +1 -0
  19. package/dist/cli/ui/.next/server/app/_global-error/page_client-reference-manifest.js +1 -0
  20. package/dist/cli/ui/.next/server/app/_global-error.html +2 -0
  21. package/dist/cli/ui/.next/server/app/_global-error.meta +16 -0
  22. package/dist/cli/ui/.next/server/app/_global-error.rsc +12 -0
  23. package/dist/cli/ui/.next/server/app/_global-error.segments/_full.segment.rsc +12 -0
  24. package/dist/cli/ui/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +5 -0
  25. package/dist/cli/ui/.next/server/app/_global-error.segments/_global-error.segment.rsc +4 -0
  26. package/dist/cli/ui/.next/server/app/_global-error.segments/_head.segment.rsc +5 -0
  27. package/dist/cli/ui/.next/server/app/_global-error.segments/_index.segment.rsc +4 -0
  28. package/dist/cli/ui/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -0
  29. package/dist/cli/ui/.next/server/app/_not-found/page.js +2 -0
  30. package/dist/cli/ui/.next/server/app/_not-found/page.js.nft.json +1 -0
  31. package/dist/cli/ui/.next/server/app/_not-found/page_client-reference-manifest.js +1 -0
  32. package/dist/cli/ui/.next/server/app/_not-found.html +1 -0
  33. package/dist/cli/ui/.next/server/app/_not-found.meta +16 -0
  34. package/dist/cli/ui/.next/server/app/_not-found.rsc +15 -0
  35. package/dist/cli/ui/.next/server/app/_not-found.segments/_full.segment.rsc +15 -0
  36. package/dist/cli/ui/.next/server/app/_not-found.segments/_head.segment.rsc +5 -0
  37. package/dist/cli/ui/.next/server/app/_not-found.segments/_index.segment.rsc +7 -0
  38. package/dist/cli/ui/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +5 -0
  39. package/dist/cli/ui/.next/server/app/_not-found.segments/_not-found.segment.rsc +4 -0
  40. package/dist/cli/ui/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -0
  41. package/dist/cli/ui/.next/server/app/api/media/[collection]/[filename]/route.js +1 -0
  42. package/dist/cli/ui/.next/server/app/api/media/[collection]/[filename]/route.js.nft.json +1 -0
  43. package/dist/cli/ui/.next/server/app/api/media/[collection]/[filename]/route_client-reference-manifest.js +1 -0
  44. package/dist/cli/ui/.next/server/app/api/media/[collection]/route.js +1 -0
  45. package/dist/cli/ui/.next/server/app/api/media/[collection]/route.js.nft.json +1 -0
  46. package/dist/cli/ui/.next/server/app/api/media/[collection]/route_client-reference-manifest.js +1 -0
  47. package/dist/cli/ui/.next/server/app/api/public/[...path]/route.js +1 -0
  48. package/dist/cli/ui/.next/server/app/api/public/[...path]/route.js.nft.json +1 -0
  49. package/dist/cli/ui/.next/server/app/api/public/[...path]/route_client-reference-manifest.js +1 -0
  50. package/dist/cli/ui/.next/server/app/api/sync/[collection]/route.js +1 -0
  51. package/dist/cli/ui/.next/server/app/api/sync/[collection]/route.js.nft.json +1 -0
  52. package/dist/cli/ui/.next/server/app/api/sync/[collection]/route_client-reference-manifest.js +1 -0
  53. package/dist/cli/ui/.next/server/app/api/watch/route.js +3 -0
  54. package/dist/cli/ui/.next/server/app/api/watch/route.js.nft.json +1 -0
  55. package/dist/cli/ui/.next/server/app/api/watch/route_client-reference-manifest.js +1 -0
  56. package/dist/cli/ui/.next/server/app/collection/[name]/[slug]/page.js +99 -0
  57. package/dist/cli/ui/.next/server/app/collection/[name]/[slug]/page.js.nft.json +1 -0
  58. package/dist/cli/ui/.next/server/app/collection/[name]/[slug]/page_client-reference-manifest.js +1 -0
  59. package/dist/cli/ui/.next/server/app/collection/[name]/page.js +5 -0
  60. package/dist/cli/ui/.next/server/app/collection/[name]/page.js.nft.json +1 -0
  61. package/dist/cli/ui/.next/server/app/collection/[name]/page_client-reference-manifest.js +1 -0
  62. package/dist/cli/ui/.next/server/app/page.js +2 -0
  63. package/dist/cli/ui/.next/server/app/page.js.nft.json +1 -0
  64. package/dist/cli/ui/.next/server/app/page_client-reference-manifest.js +1 -0
  65. package/dist/cli/ui/.next/server/app-paths-manifest.json +12 -0
  66. package/dist/cli/ui/.next/server/chunks/1875.js +1 -0
  67. package/dist/cli/ui/.next/server/chunks/2198.js +1 -0
  68. package/dist/cli/ui/.next/server/chunks/2446.js +36 -0
  69. package/dist/cli/ui/.next/server/chunks/2474.js +148 -0
  70. package/dist/cli/ui/.next/server/chunks/2490.js +55 -0
  71. package/dist/cli/ui/.next/server/chunks/2717.js +56 -0
  72. package/dist/cli/ui/.next/server/chunks/2729.js +166 -0
  73. package/dist/cli/ui/.next/server/chunks/2774.js +1 -0
  74. package/dist/cli/ui/.next/server/chunks/2796.js +1 -0
  75. package/dist/cli/ui/.next/server/chunks/3145.js +1 -0
  76. package/dist/cli/ui/.next/server/chunks/3186.js +1 -0
  77. package/dist/cli/ui/.next/server/chunks/3494.js +24 -0
  78. package/dist/cli/ui/.next/server/chunks/3610.js +1 -0
  79. package/dist/cli/ui/.next/server/chunks/3659.js +93 -0
  80. package/dist/cli/ui/.next/server/chunks/3744.js +1 -0
  81. package/dist/cli/ui/.next/server/chunks/3806.js +136 -0
  82. package/dist/cli/ui/.next/server/chunks/408.js +1 -0
  83. package/dist/cli/ui/.next/server/chunks/4189.js +62 -0
  84. package/dist/cli/ui/.next/server/chunks/4293.js +1 -0
  85. package/dist/cli/ui/.next/server/chunks/4469.js +4 -0
  86. package/dist/cli/ui/.next/server/chunks/4484.js +1 -0
  87. package/dist/cli/ui/.next/server/chunks/449.js +82 -0
  88. package/dist/cli/ui/.next/server/chunks/4607.js +22 -0
  89. package/dist/cli/ui/.next/server/chunks/479.js +5 -0
  90. package/dist/cli/ui/.next/server/chunks/4931.js +63 -0
  91. package/dist/cli/ui/.next/server/chunks/528.js +1 -0
  92. package/dist/cli/ui/.next/server/chunks/5341.js +1 -0
  93. package/dist/cli/ui/.next/server/chunks/5585.js +29 -0
  94. package/dist/cli/ui/.next/server/chunks/5677.js +1 -0
  95. package/dist/cli/ui/.next/server/chunks/5724.js +1 -0
  96. package/dist/cli/ui/.next/server/chunks/5760.js +174 -0
  97. package/dist/cli/ui/.next/server/chunks/5784.js +24 -0
  98. package/dist/cli/ui/.next/server/chunks/6.js +262 -0
  99. package/dist/cli/ui/.next/server/chunks/6040.js +1 -0
  100. package/dist/cli/ui/.next/server/chunks/6067.js +13 -0
  101. package/dist/cli/ui/.next/server/chunks/6553.js +1 -0
  102. package/dist/cli/ui/.next/server/chunks/6656.js +201 -0
  103. package/dist/cli/ui/.next/server/chunks/6672.js +1 -0
  104. package/dist/cli/ui/.next/server/chunks/6872.js +1 -0
  105. package/dist/cli/ui/.next/server/chunks/7146.js +59 -0
  106. package/dist/cli/ui/.next/server/chunks/7354.js +1 -0
  107. package/dist/cli/ui/.next/server/chunks/7677.js +1 -0
  108. package/dist/cli/ui/.next/server/chunks/7781.js +1 -0
  109. package/dist/cli/ui/.next/server/chunks/8194.js +215 -0
  110. package/dist/cli/ui/.next/server/chunks/8231.js +1 -0
  111. package/dist/cli/ui/.next/server/chunks/8319.js +2 -0
  112. package/dist/cli/ui/.next/server/chunks/8339.js +1 -0
  113. package/dist/cli/ui/.next/server/chunks/8775.js +1 -0
  114. package/dist/cli/ui/.next/server/chunks/9503.js +43 -0
  115. package/dist/cli/ui/.next/server/chunks/958.js +131 -0
  116. package/dist/cli/ui/.next/server/chunks/9739.js +1 -0
  117. package/dist/cli/ui/.next/server/functions-config-manifest.json +4 -0
  118. package/dist/cli/ui/.next/server/interception-route-rewrite-manifest.js +1 -0
  119. package/dist/cli/ui/.next/server/middleware-build-manifest.js +1 -0
  120. package/dist/cli/ui/.next/server/middleware-manifest.json +6 -0
  121. package/dist/cli/ui/.next/server/middleware-react-loadable-manifest.js +1 -0
  122. package/dist/cli/ui/.next/server/next-font-manifest.js +1 -0
  123. package/dist/cli/ui/.next/server/next-font-manifest.json +1 -0
  124. package/dist/cli/ui/.next/server/pages/404.html +1 -0
  125. package/dist/cli/ui/.next/server/pages/500.html +2 -0
  126. package/dist/cli/ui/.next/server/pages-manifest.json +4 -0
  127. package/dist/cli/ui/.next/server/server-reference-manifest.js +1 -0
  128. package/dist/cli/ui/.next/server/server-reference-manifest.json +1 -0
  129. package/dist/cli/ui/.next/server/webpack-runtime.js +1 -0
  130. package/dist/cli/ui/.next/static/chunks/0937d497-2b220e2d0368e918.js +1 -0
  131. package/dist/cli/ui/.next/static/chunks/1013.5541c1c75688ef6e.js +1 -0
  132. package/dist/cli/ui/.next/static/chunks/1039.d26ef6a818f26d70.js +4 -0
  133. package/dist/cli/ui/.next/static/chunks/1325.cb67348b484ce7a0.js +24 -0
  134. package/dist/cli/ui/.next/static/chunks/1858-d10f8bead2218ad2.js +2 -0
  135. package/dist/cli/ui/.next/static/chunks/1882.05c68ab6bdcd8c31.js +1 -0
  136. package/dist/cli/ui/.next/static/chunks/2011.7e73842f1e8e2cde.js +1 -0
  137. package/dist/cli/ui/.next/static/chunks/2046.73486ea936c9afd2.js +1 -0
  138. package/dist/cli/ui/.next/static/chunks/2389.b73d3a1286a228d0.js +1 -0
  139. package/dist/cli/ui/.next/static/chunks/2430.08df5899978ebf26.js +43 -0
  140. package/dist/cli/ui/.next/static/chunks/2462-4255d8f51dc56f12.js +1 -0
  141. package/dist/cli/ui/.next/static/chunks/3098-4269da0468edc350.js +1 -0
  142. package/dist/cli/ui/.next/static/chunks/317.b4fcc40f219152b1.js +1 -0
  143. package/dist/cli/ui/.next/static/chunks/3197.d2f3398e552228e4.js +1 -0
  144. package/dist/cli/ui/.next/static/chunks/3212-1a9c9d110d15abab.js +4 -0
  145. package/dist/cli/ui/.next/static/chunks/3809.8df186de2ff997f8.js +1 -0
  146. package/dist/cli/ui/.next/static/chunks/3918.caaf4eb4f6450524.js +1 -0
  147. package/dist/cli/ui/.next/static/chunks/3987-6d3217e36ae5b4dc.js +1 -0
  148. package/dist/cli/ui/.next/static/chunks/3c774391-ec08594272867fd5.js +79 -0
  149. package/dist/cli/ui/.next/static/chunks/4075052f.9006147a6182ed95.js +1 -0
  150. package/dist/cli/ui/.next/static/chunks/4389.e7a3c58aa62118e3.js +82 -0
  151. package/dist/cli/ui/.next/static/chunks/46bdbe0e-f5103600b23143b8.js +1 -0
  152. package/dist/cli/ui/.next/static/chunks/4860.2ba51d1d81857c81.js +1 -0
  153. package/dist/cli/ui/.next/static/chunks/4882.794e2a9231f129e5.js +55 -0
  154. package/dist/cli/ui/.next/static/chunks/5149.8de9918b9ace58f5.js +166 -0
  155. package/dist/cli/ui/.next/static/chunks/5230.b7c87400f0d8516f.js +215 -0
  156. package/dist/cli/ui/.next/static/chunks/5263.7adc3ade53cd4ed3.js +24 -0
  157. package/dist/cli/ui/.next/static/chunks/5313.1dfcc2126f85a8f8.js +1 -0
  158. package/dist/cli/ui/.next/static/chunks/5350-17c792e27bf38c77.js +1 -0
  159. package/dist/cli/ui/.next/static/chunks/5638.e3a2119354708654.js +1 -0
  160. package/dist/cli/ui/.next/static/chunks/5758.33b45c6c407ecd94.js +1 -0
  161. package/dist/cli/ui/.next/static/chunks/589.019158de5d02c262.js +1 -0
  162. package/dist/cli/ui/.next/static/chunks/6013.e33e73569339afee.js +62 -0
  163. package/dist/cli/ui/.next/static/chunks/6084.7511ad4ebb4f9df5.js +1 -0
  164. package/dist/cli/ui/.next/static/chunks/612.d3aeebcaaaf06fb2.js +1 -0
  165. package/dist/cli/ui/.next/static/chunks/6239.6c0cd99ea36222b6.js +5 -0
  166. package/dist/cli/ui/.next/static/chunks/6299-79a74877b87acf9f.js +1 -0
  167. package/dist/cli/ui/.next/static/chunks/6484.d38aa531768c3452.js +148 -0
  168. package/dist/cli/ui/.next/static/chunks/6505.731f74c28b8980b3.js +1 -0
  169. package/dist/cli/ui/.next/static/chunks/6584.be94a55391bcdcce.js +262 -0
  170. package/dist/cli/ui/.next/static/chunks/6800.1066ad1f5add7c75.js +1 -0
  171. package/dist/cli/ui/.next/static/chunks/7052.89e2de773d10ac20.js +131 -0
  172. package/dist/cli/ui/.next/static/chunks/7127.360abfa43dc4427e.js +36 -0
  173. package/dist/cli/ui/.next/static/chunks/7430.2b247d9ac6ef694c.js +149 -0
  174. package/dist/cli/ui/.next/static/chunks/7444.66c4d6bbc19309b3.js +59 -0
  175. package/dist/cli/ui/.next/static/chunks/7546.4cb4db4685212384.js +63 -0
  176. package/dist/cli/ui/.next/static/chunks/7564.7b9271fcf06df80c.js +29 -0
  177. package/dist/cli/ui/.next/static/chunks/7664.8268c156d8988844.js +174 -0
  178. package/dist/cli/ui/.next/static/chunks/7722-04e64cc1b26cfa65.js +1 -0
  179. package/dist/cli/ui/.next/static/chunks/8701.3995b58a75e43147.js +56 -0
  180. package/dist/cli/ui/.next/static/chunks/8800.548c3da26cfebf06.js +1 -0
  181. package/dist/cli/ui/.next/static/chunks/8814-7b64110c79ce7209.js +15 -0
  182. package/dist/cli/ui/.next/static/chunks/9058.a195d15265251194.js +1 -0
  183. package/dist/cli/ui/.next/static/chunks/9211.91144a0d23e4cf6d.js +1 -0
  184. package/dist/cli/ui/.next/static/chunks/9690.c1f08c02a675b9ce.js +1 -0
  185. package/dist/cli/ui/.next/static/chunks/9919.1ccc9ca4a749d9b7.js +93 -0
  186. package/dist/cli/ui/.next/static/chunks/app/_global-error/page-ad53913b77389472.js +1 -0
  187. package/dist/cli/ui/.next/static/chunks/app/_not-found/page-202c1e16a4b86ac8.js +1 -0
  188. package/dist/cli/ui/.next/static/chunks/app/api/media/[collection]/[filename]/route-ad53913b77389472.js +1 -0
  189. package/dist/cli/ui/.next/static/chunks/app/api/media/[collection]/route-ad53913b77389472.js +1 -0
  190. package/dist/cli/ui/.next/static/chunks/app/api/public/[...path]/route-ad53913b77389472.js +1 -0
  191. package/dist/cli/ui/.next/static/chunks/app/api/sync/[collection]/route-ad53913b77389472.js +1 -0
  192. package/dist/cli/ui/.next/static/chunks/app/api/watch/route-ad53913b77389472.js +1 -0
  193. package/dist/cli/ui/.next/static/chunks/app/collection/[name]/[slug]/page-7ea9eff252374845.js +6 -0
  194. package/dist/cli/ui/.next/static/chunks/app/collection/[name]/loading-03fc0b653e7060ae.js +1 -0
  195. package/dist/cli/ui/.next/static/chunks/app/collection/[name]/page-ad5976bebc9820cf.js +1 -0
  196. package/dist/cli/ui/.next/static/chunks/app/layout-74cd2ebe3fac00e7.js +1 -0
  197. package/dist/cli/ui/.next/static/chunks/app/page-ed5acadf20146966.js +1 -0
  198. package/dist/cli/ui/.next/static/chunks/b1767599.6a816b06e55b02a1.js +1 -0
  199. package/dist/cli/ui/.next/static/chunks/c6164070.3b9741bce302db0f.js +136 -0
  200. package/dist/cli/ui/.next/static/chunks/fb2ceba8.7fc23e46ca00cfd1.js +53 -0
  201. package/dist/cli/ui/.next/static/chunks/framework-ada624c9bf38edc6.js +1 -0
  202. package/dist/cli/ui/.next/static/chunks/main-0513ff42a7f2e1a0.js +5 -0
  203. package/dist/cli/ui/.next/static/chunks/main-app-b8d23dfb755744e8.js +1 -0
  204. package/dist/cli/ui/.next/static/chunks/next/dist/client/components/builtin/app-error-ad53913b77389472.js +1 -0
  205. package/dist/cli/ui/.next/static/chunks/next/dist/client/components/builtin/forbidden-ad53913b77389472.js +1 -0
  206. package/dist/cli/ui/.next/static/chunks/next/dist/client/components/builtin/global-error-558ee1074f45044b.js +1 -0
  207. package/dist/cli/ui/.next/static/chunks/next/dist/client/components/builtin/not-found-ad53913b77389472.js +1 -0
  208. package/dist/cli/ui/.next/static/chunks/next/dist/client/components/builtin/unauthorized-ad53913b77389472.js +1 -0
  209. package/dist/cli/ui/.next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
  210. package/dist/cli/ui/.next/static/chunks/webpack-acb903cd88aafa6f.js +1 -0
  211. package/dist/cli/ui/.next/static/css/e143949aa3f17880.css +3 -0
  212. package/dist/cli/ui/.next/static/media/034d78ad42e9620c-s.woff2 +0 -0
  213. package/dist/cli/ui/.next/static/media/0484562807a97172-s.p.woff2 +0 -0
  214. package/dist/cli/ui/.next/static/media/29a4aea02fdee119-s.woff2 +0 -0
  215. package/dist/cli/ui/.next/static/media/29e7bbdce9332268-s.woff2 +0 -0
  216. package/dist/cli/ui/.next/static/media/4c285fdca692ea22-s.p.woff2 +0 -0
  217. package/dist/cli/ui/.next/static/media/6c177e25b87fd9cd-s.woff2 +0 -0
  218. package/dist/cli/ui/.next/static/media/6c9a125e97d835e1-s.woff2 +0 -0
  219. package/dist/cli/ui/.next/static/media/8888a3826f4a3af4-s.p.woff2 +0 -0
  220. package/dist/cli/ui/.next/static/media/a1386beebedccca4-s.woff2 +0 -0
  221. package/dist/cli/ui/.next/static/media/b957ea75a84b6ea7-s.p.woff2 +0 -0
  222. package/dist/cli/ui/.next/static/media/c3bc380753a8436c-s.woff2 +0 -0
  223. package/dist/cli/ui/.next/static/media/db911767852bc875-s.woff2 +0 -0
  224. package/dist/cli/ui/.next/static/media/eafabf029ad39a43-s.p.woff2 +0 -0
  225. package/dist/cli/ui/.next/static/media/f10b8e9d91f3edcb-s.woff2 +0 -0
  226. package/dist/cli/ui/.next/static/media/fe0777f1195381cb-s.woff2 +0 -0
  227. package/dist/cli/ui/.next/static/zkOuvkSWApTVHCrj7neNk/_buildManifest.js +1 -0
  228. package/dist/cli/ui/.next/static/zkOuvkSWApTVHCrj7neNk/_ssgManifest.js +1 -0
  229. package/dist/cli/ui/next.config.js +1 -0
  230. package/dist/cli/ui/package.json +4 -0
  231. package/dist/core/index.d.ts +34 -356
  232. package/dist/core/index.js +112 -332
  233. package/dist/core/index.js.map +1 -1
  234. package/dist/core/server.d.ts +135 -0
  235. package/dist/core/server.js +707 -0
  236. package/dist/core/server.js.map +1 -0
  237. package/dist/query-builder-KXz9cPzF.d.ts +330 -0
  238. package/package.json +32 -11
@@ -1,376 +1,54 @@
1
- /**
2
- * @context Shared layer field type system at src/shared/fields.ts
3
- * @does Defines every field interface, the FieldDefinition union, and CollectionSchema
4
- * @depends none
5
- * @do Add new field types here; the UI and type-generator derive behavior from this shape
6
- * @dont Import from CLI or UI; contain runtime logic beyond fieldLabel utilities
7
- */
8
- declare const __brand: unique symbol;
9
- type Brand<T, B extends string> = T & {
10
- readonly [__brand]: B;
11
- };
12
- type Email = Brand<string, "Email">;
13
- type HttpUrl = Brand<string, "HttpUrl">;
14
- type ISODate = Brand<string, "ISODate">;
15
- type MediaPath = Brand<string, "MediaPath">;
16
- type ID = Brand<string, "ID">;
17
- type Slug = Brand<string, "Slug">;
18
- interface SelectOption {
19
- label: string;
20
- value: string;
21
- color?: string;
22
- }
23
- interface StatusOption {
24
- label: string;
25
- value: string;
26
- /** Semantic color bucket — maps to a badge color in the editor. */
27
- color?: "gray" | "red" | "yellow" | "green" | "blue" | "purple";
28
- }
29
- interface BaseField {
30
- /** Machine-readable key used in the data object / JSON key. */
31
- name: string;
32
- /** Human-readable label shown in the editor. Defaults to `name`. */
33
- label?: string;
34
- /** Whether the field must have a non-empty value. */
35
- required?: boolean;
36
- /** Helper text shown below the input in the editor. */
37
- description?: string;
38
- /** Default value used when creating a new entry. */
39
- defaultValue?: unknown;
40
- }
41
- interface TextField extends BaseField {
42
- type: "text";
43
- placeholder?: string;
44
- maxLength?: number;
45
- }
46
- interface LongTextField extends BaseField {
47
- type: "long-text";
48
- placeholder?: string;
49
- /** Minimum visible rows in the textarea. */
50
- rows?: number;
51
- }
52
- interface NumberField extends BaseField {
53
- type: "number";
54
- format?: "integer" | "decimal";
55
- min?: number;
56
- max?: number;
57
- step?: number;
58
- }
59
- interface BooleanField extends BaseField {
60
- type: "boolean";
61
- defaultValue?: boolean;
62
- }
63
- interface DateField extends BaseField {
64
- type: "date";
65
- /**
66
- * When `true` the editor renders a datetime-picker (date + time).
67
- * When `false` or omitted it renders a date-only picker.
68
- */
69
- includeTime?: boolean;
70
- }
71
- interface SelectField extends BaseField {
72
- type: "select";
73
- options: SelectOption[];
74
- defaultValue?: string;
75
- }
76
- interface MultiSelectField extends BaseField {
77
- type: "multi-select";
78
- options: SelectOption[];
79
- defaultValue?: string[];
80
- }
81
- interface UrlField extends BaseField {
82
- type: "url";
83
- placeholder?: string;
84
- }
85
- interface EmailField extends BaseField {
86
- type: "email";
87
- placeholder?: string;
88
- }
89
- interface MediaField extends BaseField {
90
- type: "media";
91
- /** Accepted MIME types or extensions, e.g. `["image/*"]`. */
92
- accept?: string[];
93
- }
94
- interface ObjectField extends BaseField {
95
- type: "object";
96
- /** Nested field definitions rendered as a form. */
97
- fields: FieldDefinition[];
98
- }
99
- interface ArrayField extends BaseField {
100
- type: "array";
101
- /** Shape of each item in the array — rendered as a sheet (table). */
102
- itemFields: FieldDefinition[];
103
- }
104
- interface IdField extends BaseField {
105
- type: "id";
106
- /** Strategy for auto-generating IDs. Defaults to `"nanoid"`. */
107
- generate?: "uuid" | "nanoid" | "cuid";
108
- }
109
- interface SlugField extends BaseField {
110
- type: "slug";
111
- /** Name of the field whose value is used as the slug source. */
112
- from: string;
113
- }
114
- interface RelationField extends BaseField {
115
- type: "relation";
116
- /** Target collection name. */
117
- collection: string;
118
- /** Allow selecting multiple entries. */
119
- multiple?: boolean;
120
- }
121
- interface FormulaField extends BaseField {
122
- type: "formula";
123
- /**
124
- * Expression string evaluated at read time.
125
- * Syntax TBD — placeholder for v2.
126
- */
127
- expression: string;
128
- /** TypeScript type that the expression produces. Used by the type generator. */
129
- resultType?: "string" | "number" | "boolean";
130
- }
131
- interface StatusField extends BaseField {
132
- type: "status";
133
- options: StatusOption[];
134
- defaultValue?: string;
135
- }
136
- interface CreatedTimeField extends BaseField {
137
- type: "created-time";
138
- }
139
- interface UpdatedTimeField extends BaseField {
140
- type: "updated-time";
141
- }
142
- type FieldDefinition = TextField | LongTextField | NumberField | BooleanField | DateField | SelectField | MultiSelectField | UrlField | EmailField | MediaField | ObjectField | ArrayField | IdField | SlugField | RelationField | FormulaField | StatusField | CreatedTimeField | UpdatedTimeField;
143
- type FieldType = FieldDefinition["type"];
144
- interface CollectionSchema {
145
- /** Collection name — must match the folder name under /contents. */
146
- collection: string;
147
- /**
148
- * Human-readable label for the collection.
149
- * Defaults to the collection name with title case.
150
- */
151
- label?: string;
152
- /** Field definitions that describe the shape of each entry. */
153
- fields: FieldDefinition[];
154
- }
1
+ import { C as ContentEntry, F as FieldDefinition, T as TextField, L as LongTextField, N as NumberField, B as BooleanField, D as DateField, I as ISODate, S as SelectField, M as MultiSelectField, U as UrlField, H as HttpUrl, E as EmailField, a as Email, b as MediaField, c as MediaPath, O as ObjectField, A as ArrayField, d as IdField, e as ID, f as SlugField, g as Slug, R as RelationField, h as FormulaField, i as StatusField, j as CreatedTimeField, k as UpdatedTimeField, l as CollectionSchema, m as BaseField } from '../query-builder-KXz9cPzF.js';
2
+ export { n as Collection, o as CollectionConfig, p as CollectionTypeMap, q as EntryResult, r as FieldType, Q as QueryOptions, s as QueryResult, t as StudioConfig, u as queryCollection } from '../query-builder-KXz9cPzF.js';
155
3
 
156
4
  /**
157
- * @context Shared layer — domain types at src/shared/types.ts
158
- * @does Defines core domain interfaces shared across core, CLI, and UI layers
159
- * @depends src/shared/fields.ts
160
- * @do Add new shared domain types here
161
- * @dont Import from CLI or UI; contain runtime logic; import framework-specific code
162
- */
163
-
164
- /**
165
- * Core content entry representing a single piece of content.
166
- */
167
- interface ContentEntry {
168
- /** Collection name derived from the parent folder */
169
- collection: string;
170
- /** URL-friendly identifier derived from the filename */
171
- slug: string;
172
- /** Full path relative to the contents directory */
173
- path: string;
174
- /** Raw body content (MDX string or undefined for JSON) */
175
- body?: string;
176
- /** Parsed frontmatter or JSON data */
177
- data: Record<string, unknown>;
178
- }
179
- /**
180
- * Collection metadata describing a content collection.
181
- */
182
- interface Collection {
183
- /** Collection name (folder name) */
184
- name: string;
185
- /** Type of content in the collection */
186
- type: "mdx" | "json-array" | "json-object";
187
- /** Number of entries in the collection */
188
- count: number;
189
- /** Filesystem path to the collection folder */
190
- basePath: string;
191
- /** Optional schema that describes the fields in this collection. */
192
- schema?: CollectionSchema;
193
- }
194
- /**
195
- * Studio configuration from studio.config.ts
196
- */
197
- interface StudioConfig {
198
- /** Per-collection configuration */
199
- collections?: Record<string, CollectionConfig>;
200
- }
201
- /**
202
- * Per-collection configuration options.
203
- */
204
- interface CollectionConfig {
205
- /** Field schema that describes the shape of each entry. */
206
- schema?: CollectionSchema;
207
- /** Import/sync scripts for the collection */
208
- scripts?: {
209
- import?: string;
210
- sync?: string;
211
- };
212
- }
213
- /**
214
- * Query options for the content query builder.
215
- */
216
- interface QueryOptions {
217
- where?: Record<string, unknown>;
218
- sort?: {
219
- field: string;
220
- order: "asc" | "desc";
221
- };
222
- limit?: number;
223
- offset?: number;
224
- }
225
- /**
226
- * File metadata returned by the FS adapter.
227
- */
228
- interface FileInfo {
229
- path: string;
230
- size: number;
231
- modifiedAt: Date;
232
- }
233
- /**
234
- * A file entry returned by a flat directory listing (non-recursive).
5
+ * @context Core layer — draft filter at src/core/draft-filter.ts
6
+ * @does Provides utilities to detect and filter draft content entries
7
+ * @depends src/shared/types.ts
8
+ * @do Add new draft detection heuristics here
9
+ * @dont Import from CLI or UI; access filesystem
235
10
  */
236
- interface DirectoryFileEntry {
237
- name: string;
238
- relativePath: string;
239
- size: number;
240
- modifiedAt: Date;
241
- }
242
11
 
243
- /**
244
- * @context Core layer — query builder at src/core/query-builder.ts
245
- * @does Provides a fluent API to filter, sort, and paginate content entries from a collection
246
- * @depends src/shared/types.ts, src/core/content-store.ts
247
- * @do Add new query capabilities here (e.g. search, groupBy)
248
- * @dont Import from CLI or UI; access the filesystem; perform I/O
249
- */
12
+ declare function isDraft(entry: ContentEntry): boolean;
13
+ declare function filterDrafts(entries: ContentEntry[]): ContentEntry[];
250
14
 
251
15
  /**
252
- * Fluent query builder for content collections.
253
- *
254
- * ```ts
255
- * const posts = queryCollection("blog")
256
- * .where({ published: true })
257
- * .sort("date", "desc")
258
- * .limit(10)
259
- * .all();
260
- * ```
261
- *
262
- * Supports dot notation for nested properties:
263
- * ```ts
264
- * queryCollection("pages").where({ "hero.title": "Welcome" }).all();
265
- * ```
266
- */
267
- declare class QueryBuilder {
268
- private readonly collectionName;
269
- private options;
270
- constructor(collection: string);
271
- where(conditions: Record<string, unknown>): this;
272
- sort(field: string, order?: "asc" | "desc"): this;
273
- limit(count: number): this;
274
- offset(count: number): this;
275
- all(): ContentEntry[];
276
- first(): ContentEntry | undefined;
277
- count(): number;
278
- }
279
- /**
280
- * Entry point for querying a content collection.
281
- */
282
- declare function queryCollection(collection: string): QueryBuilder;
283
-
284
- /**
285
- * @context Core layer — studio initializer at src/core/init.ts
286
- * @does Convenience function to initialize the content store for Node.js environments
287
- * @depends src/core/content-store.ts, src/cli/adapters/fs-adapter.ts
288
- * @do Use this as the entry point for Next.js and other Node.js consumers
289
- * @dont Import from UI; use in browser environments
16
+ * @context Core layer frontmatter binder at src/core/frontmatter-binder.ts
17
+ * @does Replaces {frontmatter.X} tokens in MDX body with actual frontmatter values
18
+ * @depends none
19
+ * @do Add new token patterns or transformation rules here
20
+ * @dont Import from CLI or UI; access filesystem
290
21
  */
291
-
292
22
  /**
293
- * Initialize the content store from the filesystem.
294
- * Call this once before using `queryCollection()`.
295
- *
296
- * @param contentsDir - Path to the contents directory. Defaults to `./contents` relative to cwd.
297
- * @param config - Optional studio config for schemas and scripts.
298
- *
299
- * @example
300
- * ```ts
301
- * import { initStudio, queryCollection } from "nextjs-studio";
302
- *
303
- * await initStudio();
304
- * const posts = queryCollection("posts").all();
305
- * ```
23
+ * Replaces `{frontmatter.X}` tokens in the body with values from the data object.
24
+ * Supports dot-notation for nested values (e.g. `{frontmatter.author.name}`).
306
25
  */
307
- declare function initStudio(contentsDir?: string, config?: StudioConfig): Promise<void>;
26
+ declare function bindFrontmatter(body: string, data: Record<string, unknown>): string;
308
27
  /**
309
- * Returns true if the content store has been initialized.
28
+ * Extracts all frontmatter token paths from the body.
310
29
  */
311
- declare function isStudioInitialized(): boolean;
30
+ declare function extractFrontmatterTokens(body: string): string[];
312
31
 
313
32
  /**
314
- * @context Shared layer — FS adapter interface at src/shared/fs-adapter.interface.ts
315
- * @does Defines the IFsAdapter contract so Core can perform I/O without depending on CLI
316
- * @depends src/shared/types.ts
317
- * @do Add new I/O methods here when Core needs them; keep the interface minimal
318
- * @dont Import from CLI or UI; contain implementation logic
33
+ * @context Core layer — locale parser at src/core/locale-parser.ts
34
+ * @does Extracts locale codes from filenames using the convention `slug.locale.mdx`
35
+ * @depends none
36
+ * @do Add new locale detection strategies here
37
+ * @dont Import from CLI or UI; access filesystem
319
38
  */
320
-
321
- interface IFsAdapter {
322
- readFile(filePath: string): Promise<string>;
323
- writeFile(filePath: string, content: string): Promise<void>;
324
- deleteFile(filePath: string): Promise<void>;
325
- exists(filePath: string): Promise<boolean>;
326
- getStats(filePath: string): Promise<FileInfo>;
327
- listFiles(dirPath: string, extensions?: readonly string[]): Promise<string[]>;
328
- listDirectories(dirPath: string): Promise<string[]>;
329
- readBuffer(filePath: string): Promise<Buffer>;
330
- writeBuffer(filePath: string, data: Buffer): Promise<void>;
331
- listAllFiles(dirPath: string): Promise<DirectoryFileEntry[]>;
332
- join(...segments: string[]): string;
333
- basename(filePath: string): string;
334
- extname(filePath: string): string;
335
- relative(from: string, to: string): string;
336
- normalizeSlug(relativePath: string, ext: string): string;
337
- }
338
-
339
39
  /**
340
- * @context Core layer content indexer at src/core/indexer.ts
341
- * @does Scans the contents directory, parses MDX/JSON files, and builds an in-memory index
342
- * @depends src/shared/types.ts, src/shared/constants.ts, src/shared/fs-adapter.interface.ts, src/core/parsers/, src/core/schema-inferrer.ts
343
- * @do Add new file type handling here; extend indexCollection for new collection behaviors
344
- * @dont Import from CLI or UI; instantiate FsAdapter; access the filesystem directly
40
+ * Parses locale from a filename.
41
+ * Supports `post.pt.mdx`, `post.en-US.mdx` patterns.
42
+ * Returns undefined for files without a locale suffix.
345
43
  */
346
-
347
- declare class ContentIndex {
348
- private readonly entries;
349
- private readonly collections;
350
- private readonly fs;
351
- constructor(fsAdapter: IFsAdapter);
352
- build(config?: StudioConfig): Promise<void>;
353
- getCollection(name: string): ContentEntry[];
354
- getCollections(): Collection[];
355
- clear(): void;
356
- private indexCollection;
357
- private scanDir;
358
- private buildMdxEntry;
359
- private buildJsonEntries;
360
- private readOrdering;
361
- private applyOrdering;
362
- private detectCollectionType;
363
- }
364
-
44
+ declare function parseLocaleFromFilename(filename: string): string | undefined;
365
45
  /**
366
- * @context Core layer content store at src/core/content-store.ts
367
- * @does Manages a singleton ContentIndex; exposes loadContent() and getStore() for consumers
368
- * @depends src/core/indexer.ts, src/shared/fs-adapter.interface.ts, src/shared/types.ts
369
- * @do Use this as the single access point for in-memory indexed content
370
- * @dont Import from CLI or UI; instantiate FsAdapter here; contain parsing or I/O logic
46
+ * Removes the locale suffix from a slug.
47
+ * Handles both pre-slugify (`.pt`) and post-slugify (`-pt`) formats,
48
+ * since `@sindresorhus/slugify` converts dots to dashes.
49
+ * `post.pt` `post`, `post-pt` `post`, `post` `post`
371
50
  */
372
-
373
- declare function loadContent(fsAdapter: IFsAdapter, config?: StudioConfig): Promise<ContentIndex>;
51
+ declare function stripLocaleFromSlug(slug: string, locale?: string): string;
374
52
 
375
53
  /**
376
54
  * @context Shared layer — schema inference types at src/shared/schema-types.ts
@@ -436,4 +114,4 @@ declare function fieldLabel(field: Pick<BaseField, "name" | "label">): string;
436
114
  */
437
115
  declare function keyLabel(name: string): string;
438
116
 
439
- export { type Collection, type CollectionConfig, type CollectionSchema, type ContentEntry, ContentIndex, type FieldDefinition, type FieldType, type InferFieldValue, type InferSchemaData, type QueryOptions, type StudioConfig, fieldLabel, initStudio, isStudioInitialized, keyLabel, loadContent, queryCollection };
117
+ export { CollectionSchema, ContentEntry, FieldDefinition, type InferFieldValue, type InferSchemaData, bindFrontmatter, extractFrontmatterTokens, fieldLabel, filterDrafts, isDraft, keyLabel, parseLocaleFromFilename, stripLocaleFromSlug };