@elytracms/core 0.0.6

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 (521) hide show
  1. package/LICENSE +21 -0
  2. package/dist/clipboard/build.d.ts +77 -0
  3. package/dist/clipboard/build.js +128 -0
  4. package/dist/clipboard/build.js.map +1 -0
  5. package/dist/clipboard/clipboard.d.ts +33 -0
  6. package/dist/clipboard/clipboard.js +45 -0
  7. package/dist/clipboard/clipboard.js.map +1 -0
  8. package/dist/clipboard/fragment.d.ts +112 -0
  9. package/dist/clipboard/fragment.js +79 -0
  10. package/dist/clipboard/fragment.js.map +1 -0
  11. package/dist/clipboard/html.d.ts +26 -0
  12. package/dist/clipboard/html.js +82 -0
  13. package/dist/clipboard/html.js.map +1 -0
  14. package/dist/clipboard/index.d.ts +15 -0
  15. package/dist/clipboard/index.js +16 -0
  16. package/dist/clipboard/index.js.map +1 -0
  17. package/dist/clipboard/references.d.ts +50 -0
  18. package/dist/clipboard/references.js +0 -0
  19. package/dist/clipboard/references.js.map +1 -0
  20. package/dist/clipboard/serialize.d.ts +69 -0
  21. package/dist/clipboard/serialize.js +130 -0
  22. package/dist/clipboard/serialize.js.map +1 -0
  23. package/dist/cms-core/collections.d.ts +82 -0
  24. package/dist/cms-core/collections.js +187 -0
  25. package/dist/cms-core/collections.js.map +1 -0
  26. package/dist/cms-core/documents.d.ts +71 -0
  27. package/dist/cms-core/documents.js +67 -0
  28. package/dist/cms-core/documents.js.map +1 -0
  29. package/dist/cms-core/envelopes.d.ts +80 -0
  30. package/dist/cms-core/envelopes.js +124 -0
  31. package/dist/cms-core/envelopes.js.map +1 -0
  32. package/dist/cms-core/fields.d.ts +220 -0
  33. package/dist/cms-core/fields.js +250 -0
  34. package/dist/cms-core/fields.js.map +1 -0
  35. package/dist/cms-core/fixtures.d.ts +92 -0
  36. package/dist/cms-core/fixtures.js +357 -0
  37. package/dist/cms-core/fixtures.js.map +1 -0
  38. package/dist/cms-core/hierarchy.d.ts +113 -0
  39. package/dist/cms-core/hierarchy.js +223 -0
  40. package/dist/cms-core/hierarchy.js.map +1 -0
  41. package/dist/cms-core/index.d.ts +25 -0
  42. package/dist/cms-core/index.js +26 -0
  43. package/dist/cms-core/index.js.map +1 -0
  44. package/dist/cms-core/infer.d.ts +103 -0
  45. package/dist/cms-core/infer.js +57 -0
  46. package/dist/cms-core/infer.js.map +1 -0
  47. package/dist/cms-core/issues.d.ts +92 -0
  48. package/dist/cms-core/issues.js +74 -0
  49. package/dist/cms-core/issues.js.map +1 -0
  50. package/dist/cms-core/json-schema.d.ts +25 -0
  51. package/dist/cms-core/json-schema.js +110 -0
  52. package/dist/cms-core/json-schema.js.map +1 -0
  53. package/dist/cms-core/localization.d.ts +51 -0
  54. package/dist/cms-core/localization.js +89 -0
  55. package/dist/cms-core/localization.js.map +1 -0
  56. package/dist/cms-core/routes.d.ts +76 -0
  57. package/dist/cms-core/routes.js +220 -0
  58. package/dist/cms-core/routes.js.map +1 -0
  59. package/dist/cms-core/self-type.d.ts +41 -0
  60. package/dist/cms-core/self-type.js +191 -0
  61. package/dist/cms-core/self-type.js.map +1 -0
  62. package/dist/cms-core/url-for-document.d.ts +39 -0
  63. package/dist/cms-core/url-for-document.js +138 -0
  64. package/dist/cms-core/url-for-document.js.map +1 -0
  65. package/dist/cms-core/validate-document.d.ts +121 -0
  66. package/dist/cms-core/validate-document.js +871 -0
  67. package/dist/cms-core/validate-document.js.map +1 -0
  68. package/dist/cms-core/versions.d.ts +75 -0
  69. package/dist/cms-core/versions.js +97 -0
  70. package/dist/cms-core/versions.js.map +1 -0
  71. package/dist/collaboration/approval.d.ts +68 -0
  72. package/dist/collaboration/approval.js +104 -0
  73. package/dist/collaboration/approval.js.map +1 -0
  74. package/dist/collaboration/collaboration.d.ts +49 -0
  75. package/dist/collaboration/collaboration.js +56 -0
  76. package/dist/collaboration/collaboration.js.map +1 -0
  77. package/dist/collaboration/comments.d.ts +72 -0
  78. package/dist/collaboration/comments.js +118 -0
  79. package/dist/collaboration/comments.js.map +1 -0
  80. package/dist/collaboration/core.d.ts +25 -0
  81. package/dist/collaboration/core.js +26 -0
  82. package/dist/collaboration/core.js.map +1 -0
  83. package/dist/collaboration/index.d.ts +14 -0
  84. package/dist/collaboration/index.js +15 -0
  85. package/dist/collaboration/index.js.map +1 -0
  86. package/dist/collaboration/presence.d.ts +62 -0
  87. package/dist/collaboration/presence.js +85 -0
  88. package/dist/collaboration/presence.js.map +1 -0
  89. package/dist/collaboration/publishing.d.ts +60 -0
  90. package/dist/collaboration/publishing.js +93 -0
  91. package/dist/collaboration/publishing.js.map +1 -0
  92. package/dist/collaboration/versions.d.ts +52 -0
  93. package/dist/collaboration/versions.js +81 -0
  94. package/dist/collaboration/versions.js.map +1 -0
  95. package/dist/component-registry/index.d.ts +3 -0
  96. package/dist/component-registry/index.js +4 -0
  97. package/dist/component-registry/index.js.map +1 -0
  98. package/dist/component-registry/issues.d.ts +6 -0
  99. package/dist/component-registry/issues.js +2 -0
  100. package/dist/component-registry/issues.js.map +1 -0
  101. package/dist/component-registry/manifest.d.ts +164 -0
  102. package/dist/component-registry/manifest.js +129 -0
  103. package/dist/component-registry/manifest.js.map +1 -0
  104. package/dist/component-registry/registry.d.ts +33 -0
  105. package/dist/component-registry/registry.js +90 -0
  106. package/dist/component-registry/registry.js.map +1 -0
  107. package/dist/content/__fixtures__/filterable-collections.d.ts +14 -0
  108. package/dist/content/__fixtures__/filterable-collections.js +15 -0
  109. package/dist/content/__fixtures__/filterable-collections.js.map +1 -0
  110. package/dist/content/__fixtures__/sample-accessor-types.d.ts +56 -0
  111. package/dist/content/__fixtures__/sample-accessor-types.js +5 -0
  112. package/dist/content/__fixtures__/sample-accessor-types.js.map +1 -0
  113. package/dist/content/__fixtures__/sample-delivery-types.d.ts +122 -0
  114. package/dist/content/__fixtures__/sample-delivery-types.js +5 -0
  115. package/dist/content/__fixtures__/sample-delivery-types.js.map +1 -0
  116. package/dist/content/assets.d.ts +53 -0
  117. package/dist/content/assets.js +38 -0
  118. package/dist/content/assets.js.map +1 -0
  119. package/dist/content/binding-sources.d.ts +53 -0
  120. package/dist/content/binding-sources.js +73 -0
  121. package/dist/content/binding-sources.js.map +1 -0
  122. package/dist/content/client.d.ts +90 -0
  123. package/dist/content/client.js +383 -0
  124. package/dist/content/client.js.map +1 -0
  125. package/dist/content/codegen.d.ts +54 -0
  126. package/dist/content/codegen.js +305 -0
  127. package/dist/content/codegen.js.map +1 -0
  128. package/dist/content/context.d.ts +38 -0
  129. package/dist/content/context.js +21 -0
  130. package/dist/content/context.js.map +1 -0
  131. package/dist/content/cursor.d.ts +33 -0
  132. package/dist/content/cursor.js +104 -0
  133. package/dist/content/cursor.js.map +1 -0
  134. package/dist/content/index.d.ts +28 -0
  135. package/dist/content/index.js +29 -0
  136. package/dist/content/index.js.map +1 -0
  137. package/dist/content/locale.d.ts +30 -0
  138. package/dist/content/locale.js +26 -0
  139. package/dist/content/locale.js.map +1 -0
  140. package/dist/content/perspective.d.ts +29 -0
  141. package/dist/content/perspective.js +31 -0
  142. package/dist/content/perspective.js.map +1 -0
  143. package/dist/content/populate.d.ts +25 -0
  144. package/dist/content/populate.js +22 -0
  145. package/dist/content/populate.js.map +1 -0
  146. package/dist/content/query.d.ts +122 -0
  147. package/dist/content/query.js +257 -0
  148. package/dist/content/query.js.map +1 -0
  149. package/dist/content/raw.d.ts +13 -0
  150. package/dist/content/raw.js +14 -0
  151. package/dist/content/raw.js.map +1 -0
  152. package/dist/content/resolve.d.ts +97 -0
  153. package/dist/content/resolve.js +261 -0
  154. package/dist/content/resolve.js.map +1 -0
  155. package/dist/content/serialize.d.ts +30 -0
  156. package/dist/content/serialize.js +57 -0
  157. package/dist/content/serialize.js.map +1 -0
  158. package/dist/content/tags.d.ts +54 -0
  159. package/dist/content/tags.js +40 -0
  160. package/dist/content/tags.js.map +1 -0
  161. package/dist/data-binding/fixtures.d.ts +20 -0
  162. package/dist/data-binding/fixtures.js +47 -0
  163. package/dist/data-binding/fixtures.js.map +1 -0
  164. package/dist/data-binding/index.d.ts +14 -0
  165. package/dist/data-binding/index.js +15 -0
  166. package/dist/data-binding/index.js.map +1 -0
  167. package/dist/data-binding/issues.d.ts +45 -0
  168. package/dist/data-binding/issues.js +46 -0
  169. package/dist/data-binding/issues.js.map +1 -0
  170. package/dist/data-binding/resolve.d.ts +87 -0
  171. package/dist/data-binding/resolve.js +204 -0
  172. package/dist/data-binding/resolve.js.map +1 -0
  173. package/dist/data-binding/sample.d.ts +21 -0
  174. package/dist/data-binding/sample.js +23 -0
  175. package/dist/data-binding/sample.js.map +1 -0
  176. package/dist/data-binding/sources.d.ts +225 -0
  177. package/dist/data-binding/sources.js +154 -0
  178. package/dist/data-binding/sources.js.map +1 -0
  179. package/dist/data-binding/tokens.d.ts +62 -0
  180. package/dist/data-binding/tokens.js +150 -0
  181. package/dist/data-binding/tokens.js.map +1 -0
  182. package/dist/design-tokens/css.d.ts +34 -0
  183. package/dist/design-tokens/css.js +51 -0
  184. package/dist/design-tokens/css.js.map +1 -0
  185. package/dist/design-tokens/index.d.ts +10 -0
  186. package/dist/design-tokens/index.js +11 -0
  187. package/dist/design-tokens/index.js.map +1 -0
  188. package/dist/design-tokens/style-guide.d.ts +30 -0
  189. package/dist/design-tokens/style-guide.js +31 -0
  190. package/dist/design-tokens/style-guide.js.map +1 -0
  191. package/dist/design-tokens/tokens.d.ts +89 -0
  192. package/dist/design-tokens/tokens.js +112 -0
  193. package/dist/design-tokens/tokens.js.map +1 -0
  194. package/dist/export-sync/builder-source.d.ts +85 -0
  195. package/dist/export-sync/builder-source.js +124 -0
  196. package/dist/export-sync/builder-source.js.map +1 -0
  197. package/dist/export-sync/check.d.ts +61 -0
  198. package/dist/export-sync/check.js +126 -0
  199. package/dist/export-sync/check.js.map +1 -0
  200. package/dist/export-sync/cli.d.ts +89 -0
  201. package/dist/export-sync/cli.js +323 -0
  202. package/dist/export-sync/cli.js.map +1 -0
  203. package/dist/export-sync/core.d.ts +58 -0
  204. package/dist/export-sync/core.js +41 -0
  205. package/dist/export-sync/core.js.map +1 -0
  206. package/dist/export-sync/eject.d.ts +28 -0
  207. package/dist/export-sync/eject.js +21 -0
  208. package/dist/export-sync/eject.js.map +1 -0
  209. package/dist/export-sync/fixtures.d.ts +25 -0
  210. package/dist/export-sync/fixtures.js +87 -0
  211. package/dist/export-sync/fixtures.js.map +1 -0
  212. package/dist/export-sync/generate.d.ts +7 -0
  213. package/dist/export-sync/generate.js +505 -0
  214. package/dist/export-sync/generate.js.map +1 -0
  215. package/dist/export-sync/index.d.ts +37 -0
  216. package/dist/export-sync/index.js +39 -0
  217. package/dist/export-sync/index.js.map +1 -0
  218. package/dist/export-sync/init.d.ts +123 -0
  219. package/dist/export-sync/init.js +234 -0
  220. package/dist/export-sync/init.js.map +1 -0
  221. package/dist/export-sync/manifest-host.d.ts +48 -0
  222. package/dist/export-sync/manifest-host.js +73 -0
  223. package/dist/export-sync/manifest-host.js.map +1 -0
  224. package/dist/export-sync/node.d.ts +20 -0
  225. package/dist/export-sync/node.js +101 -0
  226. package/dist/export-sync/node.js.map +1 -0
  227. package/dist/export-sync/push.d.ts +76 -0
  228. package/dist/export-sync/push.js +197 -0
  229. package/dist/export-sync/push.js.map +1 -0
  230. package/dist/export-sync/registry-sync-client.d.ts +59 -0
  231. package/dist/export-sync/registry-sync-client.js +97 -0
  232. package/dist/export-sync/registry-sync-client.js.map +1 -0
  233. package/dist/export-sync/sync.d.ts +47 -0
  234. package/dist/export-sync/sync.js +47 -0
  235. package/dist/export-sync/sync.js.map +1 -0
  236. package/dist/export-sync/typegen.d.ts +40 -0
  237. package/dist/export-sync/typegen.js +45 -0
  238. package/dist/export-sync/typegen.js.map +1 -0
  239. package/dist/export-sync/validate.d.ts +19 -0
  240. package/dist/export-sync/validate.js +102 -0
  241. package/dist/export-sync/validate.js.map +1 -0
  242. package/dist/export-sync/watch.d.ts +66 -0
  243. package/dist/export-sync/watch.js +70 -0
  244. package/dist/export-sync/watch.js.map +1 -0
  245. package/dist/operations/assets.d.ts +198 -0
  246. package/dist/operations/assets.js +75 -0
  247. package/dist/operations/assets.js.map +1 -0
  248. package/dist/operations/authorization.d.ts +49 -0
  249. package/dist/operations/authorization.js +128 -0
  250. package/dist/operations/authorization.js.map +1 -0
  251. package/dist/operations/changesets.d.ts +160 -0
  252. package/dist/operations/changesets.js +442 -0
  253. package/dist/operations/changesets.js.map +1 -0
  254. package/dist/operations/client.d.ts +49 -0
  255. package/dist/operations/client.js +57 -0
  256. package/dist/operations/client.js.map +1 -0
  257. package/dist/operations/core.d.ts +238 -0
  258. package/dist/operations/core.js +269 -0
  259. package/dist/operations/core.js.map +1 -0
  260. package/dist/operations/documents.d.ts +432 -0
  261. package/dist/operations/documents.js +344 -0
  262. package/dist/operations/documents.js.map +1 -0
  263. package/dist/operations/graph.d.ts +138 -0
  264. package/dist/operations/graph.js +78 -0
  265. package/dist/operations/graph.js.map +1 -0
  266. package/dist/operations/index.d.ts +19 -0
  267. package/dist/operations/index.js +20 -0
  268. package/dist/operations/index.js.map +1 -0
  269. package/dist/operations/members.d.ts +87 -0
  270. package/dist/operations/members.js +56 -0
  271. package/dist/operations/members.js.map +1 -0
  272. package/dist/operations/publishing.d.ts +89 -0
  273. package/dist/operations/publishing.js +57 -0
  274. package/dist/operations/publishing.js.map +1 -0
  275. package/dist/operations/references.d.ts +222 -0
  276. package/dist/operations/references.js +177 -0
  277. package/dist/operations/references.js.map +1 -0
  278. package/dist/operations/schema.d.ts +413 -0
  279. package/dist/operations/schema.js +138 -0
  280. package/dist/operations/schema.js.map +1 -0
  281. package/dist/operations/tokens.d.ts +79 -0
  282. package/dist/operations/tokens.js +102 -0
  283. package/dist/operations/tokens.js.map +1 -0
  284. package/dist/persistence/adapter.d.ts +79 -0
  285. package/dist/persistence/adapter.js +55 -0
  286. package/dist/persistence/adapter.js.map +1 -0
  287. package/dist/persistence/assets.d.ts +120 -0
  288. package/dist/persistence/assets.js +141 -0
  289. package/dist/persistence/assets.js.map +1 -0
  290. package/dist/persistence/backend-validation.d.ts +43 -0
  291. package/dist/persistence/backend-validation.js +57 -0
  292. package/dist/persistence/backend-validation.js.map +1 -0
  293. package/dist/persistence/cli-tokens.d.ts +50 -0
  294. package/dist/persistence/cli-tokens.js +66 -0
  295. package/dist/persistence/cli-tokens.js.map +1 -0
  296. package/dist/persistence/cms.d.ts +148 -0
  297. package/dist/persistence/cms.js +232 -0
  298. package/dist/persistence/cms.js.map +1 -0
  299. package/dist/persistence/contract-scenarios.d.ts +73 -0
  300. package/dist/persistence/contract-scenarios.js +496 -0
  301. package/dist/persistence/contract-scenarios.js.map +1 -0
  302. package/dist/persistence/core.d.ts +96 -0
  303. package/dist/persistence/core.js +110 -0
  304. package/dist/persistence/core.js.map +1 -0
  305. package/dist/persistence/graph.d.ts +61 -0
  306. package/dist/persistence/graph.js +98 -0
  307. package/dist/persistence/graph.js.map +1 -0
  308. package/dist/persistence/index.d.ts +22 -0
  309. package/dist/persistence/index.js +23 -0
  310. package/dist/persistence/index.js.map +1 -0
  311. package/dist/persistence/members.d.ts +70 -0
  312. package/dist/persistence/members.js +0 -0
  313. package/dist/persistence/members.js.map +1 -0
  314. package/dist/persistence/publishing.d.ts +59 -0
  315. package/dist/persistence/publishing.js +95 -0
  316. package/dist/persistence/publishing.js.map +1 -0
  317. package/dist/persistence/reference-extraction.d.ts +44 -0
  318. package/dist/persistence/reference-extraction.js +204 -0
  319. package/dist/persistence/reference-extraction.js.map +1 -0
  320. package/dist/persistence/reference-indexing.d.ts +68 -0
  321. package/dist/persistence/reference-indexing.js +112 -0
  322. package/dist/persistence/reference-indexing.js.map +1 -0
  323. package/dist/persistence/references.d.ts +257 -0
  324. package/dist/persistence/references.js +0 -0
  325. package/dist/persistence/references.js.map +1 -0
  326. package/dist/persistence/seed.d.ts +55 -0
  327. package/dist/persistence/seed.js +102 -0
  328. package/dist/persistence/seed.js.map +1 -0
  329. package/dist/persistence/self-maintaining-adapter.d.ts +41 -0
  330. package/dist/persistence/self-maintaining-adapter.js +79 -0
  331. package/dist/persistence/self-maintaining-adapter.js.map +1 -0
  332. package/dist/plugins/asset-storage.d.ts +76 -0
  333. package/dist/plugins/asset-storage.js +104 -0
  334. package/dist/plugins/asset-storage.js.map +1 -0
  335. package/dist/plugins/component-package.d.ts +54 -0
  336. package/dist/plugins/component-package.js +92 -0
  337. package/dist/plugins/component-package.js.map +1 -0
  338. package/dist/plugins/data-sources.d.ts +78 -0
  339. package/dist/plugins/data-sources.js +99 -0
  340. package/dist/plugins/data-sources.js.map +1 -0
  341. package/dist/plugins/examples.d.ts +47 -0
  342. package/dist/plugins/examples.js +205 -0
  343. package/dist/plugins/examples.js.map +1 -0
  344. package/dist/plugins/export-targets.d.ts +47 -0
  345. package/dist/plugins/export-targets.js +78 -0
  346. package/dist/plugins/export-targets.js.map +1 -0
  347. package/dist/plugins/field-types.d.ts +86 -0
  348. package/dist/plugins/field-types.js +93 -0
  349. package/dist/plugins/field-types.js.map +1 -0
  350. package/dist/plugins/hooks.d.ts +60 -0
  351. package/dist/plugins/hooks.js +94 -0
  352. package/dist/plugins/hooks.js.map +1 -0
  353. package/dist/plugins/index.d.ts +27 -0
  354. package/dist/plugins/index.js +28 -0
  355. package/dist/plugins/index.js.map +1 -0
  356. package/dist/plugins/marketplace.d.ts +90 -0
  357. package/dist/plugins/marketplace.js +110 -0
  358. package/dist/plugins/marketplace.js.map +1 -0
  359. package/dist/plugins/plugin.d.ts +107 -0
  360. package/dist/plugins/plugin.js +122 -0
  361. package/dist/plugins/plugin.js.map +1 -0
  362. package/dist/plugins/templates.d.ts +66 -0
  363. package/dist/plugins/templates.js +74 -0
  364. package/dist/plugins/templates.js.map +1 -0
  365. package/dist/project-graph/binding.d.ts +68 -0
  366. package/dist/project-graph/binding.js +39 -0
  367. package/dist/project-graph/binding.js.map +1 -0
  368. package/dist/project-graph/container.d.ts +126 -0
  369. package/dist/project-graph/container.js +221 -0
  370. package/dist/project-graph/container.js.map +1 -0
  371. package/dist/project-graph/edit.d.ts +66 -0
  372. package/dist/project-graph/edit.js +201 -0
  373. package/dist/project-graph/edit.js.map +1 -0
  374. package/dist/project-graph/fixtures.d.ts +51 -0
  375. package/dist/project-graph/fixtures.js +224 -0
  376. package/dist/project-graph/fixtures.js.map +1 -0
  377. package/dist/project-graph/ids.d.ts +17 -0
  378. package/dist/project-graph/ids.js +19 -0
  379. package/dist/project-graph/ids.js.map +1 -0
  380. package/dist/project-graph/index.d.ts +12 -0
  381. package/dist/project-graph/index.js +13 -0
  382. package/dist/project-graph/index.js.map +1 -0
  383. package/dist/project-graph/issues.d.ts +61 -0
  384. package/dist/project-graph/issues.js +44 -0
  385. package/dist/project-graph/issues.js.map +1 -0
  386. package/dist/project-graph/json.d.ts +6 -0
  387. package/dist/project-graph/json.js +10 -0
  388. package/dist/project-graph/json.js.map +1 -0
  389. package/dist/project-graph/node.d.ts +48 -0
  390. package/dist/project-graph/node.js +42 -0
  391. package/dist/project-graph/node.js.map +1 -0
  392. package/dist/project-graph/normalize.d.ts +17 -0
  393. package/dist/project-graph/normalize.js +110 -0
  394. package/dist/project-graph/normalize.js.map +1 -0
  395. package/dist/project-graph/serialize.d.ts +36 -0
  396. package/dist/project-graph/serialize.js +51 -0
  397. package/dist/project-graph/serialize.js.map +1 -0
  398. package/dist/project-graph/structure.d.ts +40 -0
  399. package/dist/project-graph/structure.js +36 -0
  400. package/dist/project-graph/structure.js.map +1 -0
  401. package/dist/project-graph/validate.d.ts +84 -0
  402. package/dist/project-graph/validate.js +158 -0
  403. package/dist/project-graph/validate.js.map +1 -0
  404. package/dist/rich-text/adapter.d.ts +43 -0
  405. package/dist/rich-text/adapter.js +24 -0
  406. package/dist/rich-text/adapter.js.map +1 -0
  407. package/dist/rich-text/dom-editor.d.ts +101 -0
  408. package/dist/rich-text/dom-editor.js +482 -0
  409. package/dist/rich-text/dom-editor.js.map +1 -0
  410. package/dist/rich-text/embed.d.ts +70 -0
  411. package/dist/rich-text/embed.js +70 -0
  412. package/dist/rich-text/embed.js.map +1 -0
  413. package/dist/rich-text/fixtures.d.ts +25 -0
  414. package/dist/rich-text/fixtures.js +115 -0
  415. package/dist/rich-text/fixtures.js.map +1 -0
  416. package/dist/rich-text/html.d.ts +5 -0
  417. package/dist/rich-text/html.js +309 -0
  418. package/dist/rich-text/html.js.map +1 -0
  419. package/dist/rich-text/index.d.ts +19 -0
  420. package/dist/rich-text/index.js +20 -0
  421. package/dist/rich-text/index.js.map +1 -0
  422. package/dist/rich-text/markdown.d.ts +7 -0
  423. package/dist/rich-text/markdown.js +235 -0
  424. package/dist/rich-text/markdown.js.map +1 -0
  425. package/dist/rich-text/portable-text.d.ts +50 -0
  426. package/dist/rich-text/portable-text.js +223 -0
  427. package/dist/rich-text/portable-text.js.map +1 -0
  428. package/dist/rich-text/registry.d.ts +48 -0
  429. package/dist/rich-text/registry.js +16 -0
  430. package/dist/rich-text/registry.js.map +1 -0
  431. package/dist/rich-text/render.d.ts +69 -0
  432. package/dist/rich-text/render.js +205 -0
  433. package/dist/rich-text/render.js.map +1 -0
  434. package/dist/rich-text/schema.d.ts +86 -0
  435. package/dist/rich-text/schema.js +80 -0
  436. package/dist/rich-text/schema.js.map +1 -0
  437. package/dist/rich-text/test-support.d.ts +7 -0
  438. package/dist/rich-text/test-support.js +8 -0
  439. package/dist/rich-text/test-support.js.map +1 -0
  440. package/dist/runtime-renderer/client.d.ts +14 -0
  441. package/dist/runtime-renderer/client.js +15 -0
  442. package/dist/runtime-renderer/client.js.map +1 -0
  443. package/dist/runtime-renderer/condition.d.ts +8 -0
  444. package/dist/runtime-renderer/condition.js +48 -0
  445. package/dist/runtime-renderer/condition.js.map +1 -0
  446. package/dist/runtime-renderer/content-client.d.ts +62 -0
  447. package/dist/runtime-renderer/content-client.js +37 -0
  448. package/dist/runtime-renderer/content-client.js.map +1 -0
  449. package/dist/runtime-renderer/context.d.ts +185 -0
  450. package/dist/runtime-renderer/context.js +7 -0
  451. package/dist/runtime-renderer/context.js.map +1 -0
  452. package/dist/runtime-renderer/fallback.d.ts +39 -0
  453. package/dist/runtime-renderer/fallback.js +45 -0
  454. package/dist/runtime-renderer/fallback.js.map +1 -0
  455. package/dist/runtime-renderer/index.d.ts +13 -0
  456. package/dist/runtime-renderer/index.js +13 -0
  457. package/dist/runtime-renderer/index.js.map +1 -0
  458. package/dist/runtime-renderer/primitives.d.ts +85 -0
  459. package/dist/runtime-renderer/primitives.js +442 -0
  460. package/dist/runtime-renderer/primitives.js.map +1 -0
  461. package/dist/runtime-renderer/render.d.ts +138 -0
  462. package/dist/runtime-renderer/render.js +825 -0
  463. package/dist/runtime-renderer/render.js.map +1 -0
  464. package/dist/runtime-renderer/rich-text.d.ts +26 -0
  465. package/dist/runtime-renderer/rich-text.js +113 -0
  466. package/dist/runtime-renderer/rich-text.js.map +1 -0
  467. package/dist/starter-kits/index.d.ts +13 -0
  468. package/dist/starter-kits/index.js +14 -0
  469. package/dist/starter-kits/index.js.map +1 -0
  470. package/dist/starter-kits/instantiate.d.ts +29 -0
  471. package/dist/starter-kits/instantiate.js +24 -0
  472. package/dist/starter-kits/instantiate.js.map +1 -0
  473. package/dist/starter-kits/kit.d.ts +61 -0
  474. package/dist/starter-kits/kit.js +37 -0
  475. package/dist/starter-kits/kit.js.map +1 -0
  476. package/dist/starter-kits/kits.d.ts +7 -0
  477. package/dist/starter-kits/kits.js +201 -0
  478. package/dist/starter-kits/kits.js.map +1 -0
  479. package/dist/starter-kits/manifests.d.ts +7 -0
  480. package/dist/starter-kits/manifests.js +111 -0
  481. package/dist/starter-kits/manifests.js.map +1 -0
  482. package/dist/starter-kits/upgrade.d.ts +39 -0
  483. package/dist/starter-kits/upgrade.js +54 -0
  484. package/dist/starter-kits/upgrade.js.map +1 -0
  485. package/dist/starter-kits/validate.d.ts +16 -0
  486. package/dist/starter-kits/validate.js +77 -0
  487. package/dist/starter-kits/validate.js.map +1 -0
  488. package/dist/studio-core/context.d.ts +27 -0
  489. package/dist/studio-core/context.js +44 -0
  490. package/dist/studio-core/context.js.map +1 -0
  491. package/dist/studio-core/errors.d.ts +58 -0
  492. package/dist/studio-core/errors.js +74 -0
  493. package/dist/studio-core/errors.js.map +1 -0
  494. package/dist/studio-core/fixtures.d.ts +18 -0
  495. package/dist/studio-core/fixtures.js +83 -0
  496. package/dist/studio-core/fixtures.js.map +1 -0
  497. package/dist/studio-core/ids.d.ts +22 -0
  498. package/dist/studio-core/ids.js +33 -0
  499. package/dist/studio-core/ids.js.map +1 -0
  500. package/dist/studio-core/index.d.ts +11 -0
  501. package/dist/studio-core/index.js +12 -0
  502. package/dist/studio-core/index.js.map +1 -0
  503. package/dist/studio-core/issues.d.ts +50 -0
  504. package/dist/studio-core/issues.js +33 -0
  505. package/dist/studio-core/issues.js.map +1 -0
  506. package/dist/studio-core/metadata.d.ts +109 -0
  507. package/dist/studio-core/metadata.js +74 -0
  508. package/dist/studio-core/metadata.js.map +1 -0
  509. package/dist/studio-core/repository.d.ts +73 -0
  510. package/dist/studio-core/repository.js +202 -0
  511. package/dist/studio-core/repository.js.map +1 -0
  512. package/dist/studio-core/sections.d.ts +73 -0
  513. package/dist/studio-core/sections.js +68 -0
  514. package/dist/studio-core/sections.js.map +1 -0
  515. package/dist/studio-core/validate.d.ts +15 -0
  516. package/dist/studio-core/validate.js +119 -0
  517. package/dist/studio-core/validate.js.map +1 -0
  518. package/dist/studio-core/workspace-config.d.ts +587 -0
  519. package/dist/studio-core/workspace-config.js +434 -0
  520. package/dist/studio-core/workspace-config.js.map +1 -0
  521. package/package.json +104 -0
@@ -0,0 +1,205 @@
1
+ import { z } from 'zod';
2
+ import { defineComponent } from '@elytracms/core/component-registry';
3
+ import { jsonValueSchema } from '@elytracms/core/project-graph';
4
+ import { auroraMarketingKit, northwindDocsKit } from '@elytracms/core/starter-kits';
5
+ import { defineFieldType } from './field-types';
6
+ import { defineDataSourceAdapter } from './data-sources';
7
+ import { MemoryAssetStorage } from './asset-storage';
8
+ import { jsonBundleTarget } from './export-targets';
9
+ import { ExtensionRegistry } from './marketplace';
10
+ /**
11
+ * Reference example extensions (the "example plugin/adapter" deliverable across EC-130–137). Every
12
+ * one is deterministic — no clocks, no randomness, no network in the defaults — so the studio and
13
+ * tests can reproduce identical state from these fixtures.
14
+ */
15
+ // --- Field-type plugins (EC-131) --------------------------------------------
16
+ const HEX = /^#[0-9a-fA-F]{6}$/;
17
+ const SLUG = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
18
+ /** A hex color field type. */
19
+ export const colorFieldType = defineFieldType({
20
+ kind: 'plugin.color',
21
+ title: 'Color',
22
+ description: 'A hex color value (#rrggbb).',
23
+ schema: z.string().regex(HEX),
24
+ defaultValue: '#5b8cff',
25
+ control: { kind: 'color' },
26
+ format: (value) => value.toUpperCase(),
27
+ });
28
+ /** An integer star-rating (0–5) field type. */
29
+ export const ratingFieldType = defineFieldType({
30
+ kind: 'plugin.rating',
31
+ title: 'Rating',
32
+ description: 'An integer star rating from 0 to 5.',
33
+ schema: z.number().int().min(0).max(5),
34
+ defaultValue: 0,
35
+ control: { kind: 'number', placeholder: '0–5' },
36
+ format: (value) => '★'.repeat(value) + '☆'.repeat(5 - value),
37
+ });
38
+ /** A URL-safe slug field type, with extra format validation. */
39
+ export const slugFieldType = defineFieldType({
40
+ kind: 'plugin.slug',
41
+ title: 'Slug',
42
+ description: 'A URL-safe lowercase slug.',
43
+ schema: z.string().regex(SLUG),
44
+ defaultValue: 'untitled',
45
+ control: { kind: 'text', placeholder: 'my-post-slug' },
46
+ validate: (value, ctx) => {
47
+ if (typeof value !== 'string')
48
+ return [{ code: 'type', message: 'Expected a string.' }];
49
+ if (value.length === 0)
50
+ return ctx.required ? [{ code: 'required', message: 'Slug is required.' }] : [];
51
+ return SLUG.test(value) ? [] : [{ code: 'format', message: 'Use lowercase letters, numbers, and dashes only.' }];
52
+ },
53
+ });
54
+ // --- Data-source adapters (EC-132) ------------------------------------------
55
+ /** A static inline-JSON source — the simplest possible adapter, fully deterministic. */
56
+ export const staticDataSourceAdapter = defineDataSourceAdapter({
57
+ kind: 'plugin.static',
58
+ title: 'Static JSON',
59
+ description: 'Returns an inline JSON payload — handy for prototypes and fixtures.',
60
+ configSchema: z.object({ data: jsonValueSchema }),
61
+ fetch: async (config) => config.data,
62
+ describe: () => 'inline JSON',
63
+ });
64
+ /**
65
+ * Build a GraphQL data-source adapter (example, EC-132). The network transport is injected, so the
66
+ * adapter is deterministic in tests and provider-neutral in production. Its payload resolves
67
+ * through the shared binding model like any built-in source.
68
+ */
69
+ export function createGraphqlAdapter(transport) {
70
+ return defineDataSourceAdapter({
71
+ kind: 'plugin.graphql',
72
+ title: 'GraphQL',
73
+ description: 'Queries a GraphQL endpoint; the response is the source payload.',
74
+ configSchema: z.object({
75
+ endpoint: z.string().url(),
76
+ query: z.string().min(1),
77
+ variables: z.record(z.string(), jsonValueSchema).optional(),
78
+ }),
79
+ fetch: async (config) => transport({ endpoint: config.endpoint, query: config.query, variables: config.variables ?? {} }),
80
+ describe: (config) => config.endpoint,
81
+ });
82
+ }
83
+ // --- Component package (EC-130) ---------------------------------------------
84
+ const acmeHero = defineComponent({
85
+ id: 'project.acme.Hero',
86
+ namespace: 'project',
87
+ title: 'Acme Hero',
88
+ category: 'marketing',
89
+ props: {
90
+ headline: { type: 'text', context: 'prop', default: 'Build faster with Acme', form: { label: 'Headline' } },
91
+ subhead: { type: 'text', context: 'prop', default: 'Drop-in marketing blocks.', form: { label: 'Subhead', control: 'textarea' } },
92
+ },
93
+ slots: [{ name: 'children', label: 'Actions' }],
94
+ });
95
+ const acmePricing = defineComponent({
96
+ id: 'project.acme.PricingTable',
97
+ namespace: 'project',
98
+ title: 'Acme Pricing Table',
99
+ category: 'marketing',
100
+ props: {
101
+ highlighted: { type: 'boolean', context: 'prop', default: false, form: { label: 'Highlighted' } },
102
+ },
103
+ slots: [{ name: 'children', label: 'Tiers' }],
104
+ });
105
+ /** A conforming component package under the `acme` vendor namespace (EC-130). */
106
+ export const acmeBlocksPackage = {
107
+ name: '@acme/marketing-blocks',
108
+ version: '1.2.0',
109
+ vendor: 'acme',
110
+ description: 'Marketing blocks (hero, pricing) by Acme.',
111
+ author: 'Acme Inc.',
112
+ manifests: [acmeHero, acmePricing],
113
+ };
114
+ const labsSecret = defineComponent({
115
+ id: 'project.labs.ExperimentBanner',
116
+ namespace: 'project',
117
+ title: 'Experiment Banner',
118
+ category: 'internal',
119
+ props: { flag: { type: 'text', context: 'prop', default: 'beta', form: { label: 'Flag' } } },
120
+ slots: [],
121
+ });
122
+ /** A private component package (used by the private-registry example). */
123
+ export const labsInternalPackage = {
124
+ name: '@labs/internal-blocks',
125
+ version: '0.3.0',
126
+ vendor: 'labs',
127
+ description: 'Internal experiment blocks.',
128
+ author: 'Acme Labs',
129
+ manifests: [labsSecret],
130
+ };
131
+ // --- Project templates (EC-136) ---------------------------------------------
132
+ /** A community marketing template wrapping the Aurora starter kit. */
133
+ export const auroraTemplate = {
134
+ id: 'tmpl.acme.aurora',
135
+ name: 'Aurora Marketing (community)',
136
+ version: '1.0.0',
137
+ author: 'Acme Inc.',
138
+ source: 'community',
139
+ tags: ['marketing', 'landing'],
140
+ kit: auroraMarketingKit,
141
+ };
142
+ /** A community docs template wrapping the Northwind starter kit. */
143
+ export const northwindTemplate = {
144
+ id: 'tmpl.acme.northwind',
145
+ name: 'Northwind Docs (community)',
146
+ version: '1.0.0',
147
+ author: 'Acme Inc.',
148
+ source: 'community',
149
+ tags: ['docs', 'content'],
150
+ kit: northwindDocsKit,
151
+ };
152
+ // --- Hooks (EC-135) ---------------------------------------------------------
153
+ /** A hook that stamps a notice file onto an export's file set (demonstrates a transform hook). */
154
+ function stampExportNotice(payload) {
155
+ if (!Array.isArray(payload))
156
+ return payload;
157
+ const files = payload;
158
+ return [...files, { path: 'ACME_NOTICE.txt', contents: 'Bundled with the Acme Extension Suite.' }];
159
+ }
160
+ // --- Composite plugin + marketplace (EC-137) --------------------------------
161
+ /** A sampler plugin touching every extensibility surface. */
162
+ export const acmeSuitePlugin = {
163
+ id: 'plugin.acme.suite',
164
+ name: 'Acme Extension Suite',
165
+ version: '1.0.0',
166
+ description: 'Marketing blocks, custom field types, a static data source, in-memory storage, a headless export target, templates, and an export hook.',
167
+ author: 'Acme Inc.',
168
+ components: acmeBlocksPackage,
169
+ fieldTypes: [colorFieldType, ratingFieldType, slugFieldType],
170
+ dataSources: [staticDataSourceAdapter],
171
+ assetStorage: [new MemoryAssetStorage()],
172
+ exportTargets: [jsonBundleTarget],
173
+ templates: [auroraTemplate, northwindTemplate],
174
+ hooks: [{ point: 'export:afterGenerate', id: 'acme.stamp', order: 10, handler: stampExportNotice }],
175
+ };
176
+ /** A single-surface plugin: just the color field type. */
177
+ export const colorFieldPlugin = {
178
+ id: 'plugin.color-field',
179
+ name: 'Color Field',
180
+ version: '1.0.0',
181
+ description: 'Adds a hex color field type to the CMS.',
182
+ author: 'Community',
183
+ fieldTypes: [colorFieldType],
184
+ };
185
+ /** A private plugin available only behind the private registry token. */
186
+ export const labsInternalPlugin = {
187
+ id: 'plugin.labs.internal',
188
+ name: 'Acme Labs Internal Blocks',
189
+ version: '0.3.0',
190
+ description: 'Experimental internal components — private.',
191
+ author: 'Acme Labs',
192
+ components: labsInternalPackage,
193
+ };
194
+ /** The public marketplace catalogue. */
195
+ export const publicMarketplace = new ExtensionRegistry({ id: 'elytra-public', label: 'Elytra Public Marketplace', mode: 'public' }, [
196
+ { id: 'plugin.acme.suite', kind: 'plugin', name: 'Acme Extension Suite', version: '1.0.0', description: acmeSuitePlugin.description, author: 'Acme Inc.', tags: ['marketing', 'fields', 'export'], plugin: acmeSuitePlugin },
197
+ { id: 'plugin.color-field', kind: 'field-type', name: 'Color Field', version: '1.0.0', description: 'A hex color field type.', author: 'Community', tags: ['cms', 'field'], plugin: colorFieldPlugin },
198
+ ]);
199
+ /** The token granting access to the private registry. */
200
+ export const PRIVATE_REGISTRY_TOKEN = 'acme-internal-token';
201
+ /** A private registry, gated behind {@link PRIVATE_REGISTRY_TOKEN}. */
202
+ export const privateMarketplace = new ExtensionRegistry({ id: 'acme-private', label: 'Acme Private Registry', mode: 'private', accessTokens: [PRIVATE_REGISTRY_TOKEN] }, [
203
+ { id: 'plugin.labs.internal', kind: 'component-package', name: 'Acme Labs Internal Blocks', version: '0.3.0', description: 'Internal experiment blocks.', author: 'Acme Labs', tags: ['internal'], plugin: labsInternalPlugin },
204
+ ]);
205
+ //# sourceMappingURL=examples.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"examples.js","sourceRoot":"","sources":["../../src/plugins/examples.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAA;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAG/D,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AACnF,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAE/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAA;AAExD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAInD,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAEjD;;;;GAIG;AAEH,+EAA+E;AAE/E,MAAM,GAAG,GAAG,mBAAmB,CAAA;AAC/B,MAAM,IAAI,GAAG,4BAA4B,CAAA;AAEzC,8BAA8B;AAC9B,MAAM,CAAC,MAAM,cAAc,GAAoB,eAAe,CAAS;IACrE,IAAI,EAAE,cAAc;IACpB,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,8BAA8B;IAC3C,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC;IAC7B,YAAY,EAAE,SAAS;IACvB,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;IAC1B,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AE,6BAA6B,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,kBAAkB,EAAE;CAChO,CACF,CAAA"}
@@ -0,0 +1,47 @@
1
+ import type { ExportInput, GeneratedFile } from '@elytracms/core/export-sync';
2
+ /**
3
+ * Export-target adapters (EC-134). Export is a pure function from the canonical model to a file set
4
+ * (`@elytracms/core/export-sync`). A target adapter wraps one such function so the export pipeline can
5
+ * target more than Next.js. Next.js App Router is the reference adapter; a headless JSON content
6
+ * bundle is provided as a second target to prove the boundary is real.
7
+ */
8
+ /** An export-target adapter: a named, pure model → files generator (EC-134). */
9
+ export interface ExportTargetAdapter {
10
+ /** Stable target id, e.g. `next-app-router`, `json-bundle`. */
11
+ id: string;
12
+ title: string;
13
+ description?: string;
14
+ /** Pure: the same input always yields the same sorted file set. */
15
+ generate: (input: ExportInput) => GeneratedFile[];
16
+ }
17
+ /**
18
+ * The reference export target (EC-134): a native Next.js App Router app. Delegates to
19
+ * `@elytracms/core/export-sync`'s deterministic generator — readable, diffable, ejectable output with no
20
+ * builder-only runtime dependencies.
21
+ */
22
+ export declare const nextAppRouterTarget: ExportTargetAdapter;
23
+ /**
24
+ * A headless JSON content bundle target (example, EC-134). Emits just the canonical model as
25
+ * stable JSON plus a manifest — for consumers that render the graph themselves (mobile, edge, a
26
+ * custom runtime). Demonstrates a non-Next target on the same interface.
27
+ */
28
+ export declare const jsonBundleTarget: ExportTargetAdapter;
29
+ /** A structured registration issue for the export-target registry. */
30
+ export interface ExportTargetRegistryIssue {
31
+ code: 'duplicate';
32
+ message: string;
33
+ ref: string;
34
+ }
35
+ /** Registry of export-target adapters keyed by id. */
36
+ export declare class ExportTargetRegistry {
37
+ private readonly byId;
38
+ readonly issues: ExportTargetRegistryIssue[];
39
+ constructor(targets?: Iterable<ExportTargetAdapter>);
40
+ register(target: ExportTargetAdapter): void;
41
+ has(id: string): boolean;
42
+ get(id: string): ExportTargetAdapter | undefined;
43
+ list(): ExportTargetAdapter[];
44
+ get size(): number;
45
+ }
46
+ /** A registry pre-seeded with the built-in targets (Next.js reference + JSON bundle). */
47
+ export declare function createExportTargetRegistry(): ExportTargetRegistry;
@@ -0,0 +1,78 @@
1
+ import { generateExport, generatedBanner, sortFiles, stableJson } from '@elytracms/core/export-sync';
2
+ /**
3
+ * The reference export target (EC-134): a native Next.js App Router app. Delegates to
4
+ * `@elytracms/core/export-sync`'s deterministic generator — readable, diffable, ejectable output with no
5
+ * builder-only runtime dependencies.
6
+ */
7
+ export const nextAppRouterTarget = {
8
+ id: 'next-app-router',
9
+ title: 'Next.js App Router',
10
+ description: 'The reference target: a self-contained Next.js App Router app rendering the canonical graph.',
11
+ generate: (input) => generateExport(input),
12
+ };
13
+ /**
14
+ * A headless JSON content bundle target (example, EC-134). Emits just the canonical model as
15
+ * stable JSON plus a manifest — for consumers that render the graph themselves (mobile, edge, a
16
+ * custom runtime). Demonstrates a non-Next target on the same interface.
17
+ */
18
+ export const jsonBundleTarget = {
19
+ id: 'json-bundle',
20
+ title: 'Headless JSON bundle',
21
+ description: 'Canonical model as stable JSON (graph, routes, collections, sources, locales) + a manifest.',
22
+ generate: (input) => sortFiles([
23
+ { path: 'bundle/graph.json', contents: stableJson(input.graph) },
24
+ { path: 'bundle/routes.json', contents: stableJson(input.routes) },
25
+ { path: 'bundle/redirects.json', contents: stableJson(input.redirects) },
26
+ { path: 'bundle/collections.json', contents: stableJson(input.collections) },
27
+ { path: 'bundle/sources.json', contents: stableJson(input.sources) },
28
+ { path: 'bundle/locales.json', contents: stableJson(input.localeConfig) },
29
+ {
30
+ path: 'bundle/manifest.json',
31
+ contents: stableJson({
32
+ name: input.projectName,
33
+ slug: input.slug,
34
+ target: 'json-bundle',
35
+ layouts: input.graph.layouts.length,
36
+ collections: input.collections.length,
37
+ sources: input.sources.length,
38
+ }),
39
+ },
40
+ {
41
+ path: 'bundle/README.md',
42
+ contents: `${generatedBanner('bundle/README.md')}\n\n# ${input.projectName} — headless content bundle\n\nThe canonical project model as stable JSON. Render it with the \`@elytracms/runtime-renderer\`, or any client that understands the graph format.\n`,
43
+ },
44
+ ]),
45
+ };
46
+ /** Registry of export-target adapters keyed by id. */
47
+ export class ExportTargetRegistry {
48
+ byId = new Map();
49
+ issues = [];
50
+ constructor(targets = []) {
51
+ for (const target of targets)
52
+ this.register(target);
53
+ }
54
+ register(target) {
55
+ if (this.byId.has(target.id)) {
56
+ this.issues.push({ code: 'duplicate', ref: target.id, message: `Duplicate export target "${target.id}" — keeping the first registration.` });
57
+ return;
58
+ }
59
+ this.byId.set(target.id, target);
60
+ }
61
+ has(id) {
62
+ return this.byId.has(id);
63
+ }
64
+ get(id) {
65
+ return this.byId.get(id);
66
+ }
67
+ list() {
68
+ return [...this.byId.values()];
69
+ }
70
+ get size() {
71
+ return this.byId.size;
72
+ }
73
+ }
74
+ /** A registry pre-seeded with the built-in targets (Next.js reference + JSON bundle). */
75
+ export function createExportTargetRegistry() {
76
+ return new ExportTargetRegistry([nextAppRouterTarget, jsonBundleTarget]);
77
+ }
78
+ //# sourceMappingURL=export-targets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export-targets.js","sourceRoot":"","sources":["../../src/plugins/export-targets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAoBpG;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAwB;IACtD,EAAE,EAAE,iBAAiB;IACrB,KAAK,EAAE,oBAAoB;IAC3B,WAAW,EAAE,8FAA8F;IAC3G,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC;CAC3C,CAAA;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAwB;IACnD,EAAE,EAAE,aAAa;IACjB,KAAK,EAAE,sBAAsB;IAC7B,WAAW,EAAE,6FAA6F;IAC1G,Q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yC,EAAE;QACrD,KAAK,MAAM,MAAM,IAAI,OAAO;YAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;IACrD,CAAC;IAED,QAAQ,CAAC,MAA2B;QAClC,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC;YAC7B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,EAAE,OAAO,EAAE,4BAA4B,MAAM,CAAC,EAAE,qCAAqC,EAAE,CAAC,CAAA;YAC5I,OAAM;QACR,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAAA;IAClC,CAAC;IAED,GAAG,CAAC,EAAU;QACZ,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;IAC1B,CAAC;IAED,GAAG,CAAC,EAAU;QACZ,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;IAC1B,CAAC;IAED,IAAI;QACF,OAAO,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAA;IAChC,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAA;IACvB,CAAC;CACF;AAED,yFAAyF;AACzF,MAAM,UAAU,0BAA0B;IACxC,OAAO,IAAI,oBAAoB,CAAC,CAAC,mBAAmB,EAAE,gBAAgB,CAAC,CAAC,CAAA;AAC1E,CAAC"}
@@ -0,0 +1,86 @@
1
+ import { z } from 'zod';
2
+ import type { JsonValue } from '@elytracms/core/project-graph';
3
+ /**
4
+ * Field-type plugins (EC-131). The CMS ships a provider-neutral catalogue of built-in field types
5
+ * (text/number/boolean/date/select/richText/relation/asset). A field-type plugin adds a *new*
6
+ * type: a value schema, a default, an editor control descriptor, and optional extra validation and
7
+ * display formatting. Registration is namespaced (a plugin kind must contain a dot and must not
8
+ * shadow a built-in), validation is first-class (issues, never throws), and rendering is driven by
9
+ * a control descriptor the Builder/CMS editor maps to a named control.
10
+ */
11
+ /** The provider-neutral built-in field types a plugin must not shadow. */
12
+ export declare const BUILTIN_FIELD_TYPES: readonly ["text", "number", "boolean", "date", "select", "richText", "relation", "asset"];
13
+ /** A structured validation issue from a field-type plugin. Never thrown. */
14
+ export interface FieldTypeIssue {
15
+ code: string;
16
+ message: string;
17
+ path?: string;
18
+ }
19
+ /** Context passed to a field-type plugin's `validate`. */
20
+ export interface FieldTypeContext {
21
+ /** Whether the field is required (a missing value is an error). */
22
+ required: boolean;
23
+ /** The field's declarative constraints (min/max/pattern…) when relevant. */
24
+ constraints?: Record<string, JsonValue>;
25
+ }
26
+ /** How the Builder/CMS editor renders an input for a field-type plugin. */
27
+ export interface FieldControlSpec {
28
+ /** A known control, or `custom` to defer to a registered component. */
29
+ kind: 'text' | 'textarea' | 'number' | 'boolean' | 'select' | 'color' | 'json' | 'custom';
30
+ /** For `custom`: the id of the control component to render. */
31
+ component?: string;
32
+ placeholder?: string;
33
+ /** Static options for `select`-style controls. */
34
+ options?: {
35
+ label: string;
36
+ value: JsonValue;
37
+ }[];
38
+ }
39
+ /** A field-type plugin (EC-131). */
40
+ export interface FieldTypePlugin<T extends JsonValue = JsonValue> {
41
+ /** Namespaced field-type key, e.g. `plugin.color`. Must contain a dot; must not shadow a built-in. */
42
+ kind: string;
43
+ title: string;
44
+ description?: string;
45
+ /** Validates a stored value of this type. */
46
+ schema: z.ZodType<T>;
47
+ /** Default value for a new field of this type. */
48
+ defaultValue: T;
49
+ /** Editor control descriptor. */
50
+ control: FieldControlSpec;
51
+ /** Extra validation beyond the schema (range, format…). Returns issues; never throws. */
52
+ validate?: (value: unknown, ctx: FieldTypeContext) => FieldTypeIssue[];
53
+ /** Render a stored value to a short display string (table cells, previews). */
54
+ format?: (value: T) => string;
55
+ }
56
+ /**
57
+ * Define a field-type plugin with full type-checking of its `defaultValue`/`validate`/`format`
58
+ * against the value type `T`, then widen it to the registry's element type. The widening is the
59
+ * standard heterogeneous-registry erasure: the registry holds plugins of many value types, which
60
+ * the invariant generic would otherwise reject.
61
+ */
62
+ export declare function defineFieldType<T extends JsonValue>(plugin: FieldTypePlugin<T>): FieldTypePlugin;
63
+ /** A structured registration/validation issue for the field-type registry. */
64
+ export interface FieldTypeRegistryIssue {
65
+ code: 'reserved' | 'namespace' | 'duplicate';
66
+ message: string;
67
+ ref: string;
68
+ }
69
+ /** True when a field-type kind follows the namespace rules (dotted, not a built-in). */
70
+ export declare function isValidFieldTypeKind(kind: string): boolean;
71
+ /** Registry of field-type plugins. Construction de-duplicates and validates; lookups are O(1). */
72
+ export declare class FieldTypeRegistry {
73
+ private readonly byKind;
74
+ readonly issues: FieldTypeRegistryIssue[];
75
+ constructor(plugins?: Iterable<FieldTypePlugin>);
76
+ register(plugin: FieldTypePlugin): void;
77
+ has(kind: string): boolean;
78
+ get(kind: string): FieldTypePlugin | undefined;
79
+ list(): FieldTypePlugin[];
80
+ get size(): number;
81
+ /**
82
+ * Validate a value against a registered field type (EC-131): the value schema first, then the
83
+ * plugin's extra `validate`. An unknown kind is itself an issue. Never throws.
84
+ */
85
+ validateValue(kind: string, value: unknown, ctx?: FieldTypeContext): FieldTypeIssue[];
86
+ }
@@ -0,0 +1,93 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Field-type plugins (EC-131). The CMS ships a provider-neutral catalogue of built-in field types
4
+ * (text/number/boolean/date/select/richText/relation/asset). A field-type plugin adds a *new*
5
+ * type: a value schema, a default, an editor control descriptor, and optional extra validation and
6
+ * display formatting. Registration is namespaced (a plugin kind must contain a dot and must not
7
+ * shadow a built-in), validation is first-class (issues, never throws), and rendering is driven by
8
+ * a control descriptor the Builder/CMS editor maps to a named control.
9
+ */
10
+ /** The provider-neutral built-in field types a plugin must not shadow. */
11
+ export const BUILTIN_FIELD_TYPES = [
12
+ 'text',
13
+ 'number',
14
+ 'boolean',
15
+ 'date',
16
+ 'select',
17
+ 'richText',
18
+ 'relation',
19
+ 'asset',
20
+ ];
21
+ /**
22
+ * Define a field-type plugin with full type-checking of its `defaultValue`/`validate`/`format`
23
+ * against the value type `T`, then widen it to the registry's element type. The widening is the
24
+ * standard heterogeneous-registry erasure: the registry holds plugins of many value types, which
25
+ * the invariant generic would otherwise reject.
26
+ */
27
+ export function defineFieldType(plugin) {
28
+ return plugin;
29
+ }
30
+ /** True when a field-type kind follows the namespace rules (dotted, not a built-in). */
31
+ export function isValidFieldTypeKind(kind) {
32
+ if (BUILTIN_FIELD_TYPES.includes(kind))
33
+ return false;
34
+ return /^[a-z][a-z0-9]*\.[a-z][a-z0-9]*$/i.test(kind);
35
+ }
36
+ /** Registry of field-type plugins. Construction de-duplicates and validates; lookups are O(1). */
37
+ export class FieldTypeRegistry {
38
+ byKind = new Map();
39
+ issues = [];
40
+ constructor(plugins = []) {
41
+ for (const plugin of plugins)
42
+ this.register(plugin);
43
+ }
44
+ register(plugin) {
45
+ if (BUILTIN_FIELD_TYPES.includes(plugin.kind)) {
46
+ this.issues.push({ code: 'reserved', ref: plugin.kind, message: `Field type "${plugin.kind}" shadows a built-in type.` });
47
+ return;
48
+ }
49
+ if (!isValidFieldTypeKind(plugin.kind)) {
50
+ this.issues.push({ code: 'namespace', ref: plugin.kind, message: `Field type "${plugin.kind}" must be namespaced (e.g. "plugin.color").` });
51
+ return;
52
+ }
53
+ if (this.byKind.has(plugin.kind)) {
54
+ this.issues.push({ code: 'duplicate', ref: plugin.kind, message: `Duplicate field type "${plugin.kind}" — keeping the first registration.` });
55
+ return;
56
+ }
57
+ this.byKind.set(plugin.kind, plugin);
58
+ }
59
+ has(kind) {
60
+ return this.byKind.has(kind);
61
+ }
62
+ get(kind) {
63
+ return this.byKind.get(kind);
64
+ }
65
+ list() {
66
+ return [...this.byKind.values()];
67
+ }
68
+ get size() {
69
+ return this.byKind.size;
70
+ }
71
+ /**
72
+ * Validate a value against a registered field type (EC-131): the value schema first, then the
73
+ * plugin's extra `validate`. An unknown kind is itself an issue. Never throws.
74
+ */
75
+ validateValue(kind, value, ctx = { required: false }) {
76
+ const plugin = this.byKind.get(kind);
77
+ if (!plugin)
78
+ return [{ code: 'unknown-field-type', message: `No field type registered for "${kind}".` }];
79
+ if (value === undefined || value === null) {
80
+ return ctx.required ? [{ code: 'required', message: `${plugin.title} is required.` }] : [];
81
+ }
82
+ const parsed = plugin.schema.safeParse(value);
83
+ if (!parsed.success) {
84
+ return parsed.error.issues.map((i) => ({
85
+ code: 'invalid-value',
86
+ message: i.message,
87
+ ...(i.path.length ? { path: i.path.join('.') } : {}),
88
+ }));
89
+ }
90
+ return plugin.validate?.(value, ctx) ?? [];
91
+ }
92
+ }
93
+ //# sourceMappingURL=field-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"field-types.js","sourceRoot":"","sources":["../../src/plugins/field-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB;;;;;;;GAOG;AAEH,0EAA0E;AAC1E,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,MAAM;IACN,QAAQ;IACR,SAAS;IACT,MAAM;IACN,QAAQ;IACR,UAAU;IACV,UAAU;IACV,OAAO;CACC,CAAA;AA8CV;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAsB,MAA0B;IAC7E,OAAO,MAAoC,CAAA;AAC7C,CAAC;AASD,wFAAwF;AACxF,MAAM,UAAU,oBAAoB,CAAC,IAAY;IAC/C,IAAK,mBAAyC,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAA;IAC3E,OAAO,mCAAmC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACvD,CAAC;AAED,kGAAkG;AAClG,MAAM,OAAO,iBAAiB;IACX,MAAM,GAAG,IAAI,GAAG,EAA2B,CAAA;IACnD,MAAM,GAA6B,EA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;QACL,CAAC;QACD,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC,IAAI,EAAE,CAAA;IAC5C,CAAC;CACF"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Hook system (EC-135). A deterministic, extensible lifecycle bus: plugins register handlers at
3
+ * named points, and the host runs each point as a transform chain — every handler receives the
4
+ * current payload and may return a replacement, threading the result to the next handler. Ordering
5
+ * is fully deterministic: handlers run by ascending `order`, ties broken by registration sequence
6
+ * (never insertion-hash or wall-clock), so a given set of plugins always produces the same result.
7
+ */
8
+ /**
9
+ * A hook handler observes or transforms a payload. Returning a value replaces the threaded
10
+ * payload for downstream handlers; returning `undefined`/`void` leaves it unchanged. Handlers may
11
+ * be async — use {@link HookBus.runAsync} to await them.
12
+ */
13
+ export type HookHandler<T> = (payload: T) => T | void | Promise<T | void>;
14
+ /** Well-known lifecycle points the studio and packages fire. Plugins may also define their own. */
15
+ export declare const HOOK_POINTS: readonly ["graph:beforeValidate", "graph:afterValidate", "document:beforeSave", "document:afterSave", "export:beforeGenerate", "export:afterGenerate", "plugin:installed"];
16
+ export type HookPoint = (typeof HOOK_POINTS)[number];
17
+ /** Options when registering a handler. */
18
+ export interface HookOptions {
19
+ /** Lower runs first. Defaults to `0`. */
20
+ order?: number;
21
+ /** Optional stable id, for traceability and targeted removal. */
22
+ id?: string;
23
+ /** The plugin that registered the handler (set by the host). */
24
+ plugin?: string;
25
+ }
26
+ /** A registered tap, as surfaced for inspection (e.g. the Extensions UI). */
27
+ export interface HookTapInfo {
28
+ point: string;
29
+ order: number;
30
+ id?: string;
31
+ plugin?: string;
32
+ }
33
+ /**
34
+ * A deterministic hook bus. Synchronous (`run`) and async (`runAsync`) execution both thread the
35
+ * payload through handlers ordered by `(order, registration-sequence)`. Never throws on an empty
36
+ * point — running an unregistered point returns the payload unchanged.
37
+ */
38
+ export declare class HookBus {
39
+ private readonly taps;
40
+ private seq;
41
+ /** Register a handler at a point. Returns an unsubscribe function. */
42
+ on<T>(point: string, handler: HookHandler<T>, opts?: HookOptions): () => void;
43
+ /** Handlers at a point in deterministic run order. */
44
+ private ordered;
45
+ /**
46
+ * Run a point synchronously, threading `payload` through each handler. A handler that returns a
47
+ * Promise is skipped for threading (use {@link runAsync} for async handlers) but still fires.
48
+ */
49
+ run<T>(point: string, payload: T): T;
50
+ /** Run a point asynchronously, awaiting each handler in deterministic order. */
51
+ runAsync<T>(point: string, payload: T): Promise<T>;
52
+ /** All points that have at least one handler, sorted. */
53
+ points(): string[];
54
+ /** Number of handlers registered at a point. */
55
+ count(point: string): number;
56
+ /** Inspect registered taps at a point (deterministic order). */
57
+ list(point: string): HookTapInfo[];
58
+ /** Inspect every registered tap across all points (deterministic order). */
59
+ all(): HookTapInfo[];
60
+ }