@alanizcreative/formation-static 1.3.0-beta.29

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 (349) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +3 -0
  3. package/cjs/components/Navigation/Navigation.d.ts +16 -0
  4. package/cjs/components/Navigation/Navigation.js +1 -0
  5. package/cjs/components/Navigation/NavigationTypes.d.ts +85 -0
  6. package/cjs/components/Navigation/NavigationTypes.js +1 -0
  7. package/cjs/components/Pagination/Pagination.d.ts +3 -0
  8. package/cjs/components/Pagination/Pagination.js +1 -0
  9. package/cjs/components/Pagination/PaginationTypes.d.ts +44 -0
  10. package/cjs/components/Pagination/PaginationTypes.js +1 -0
  11. package/cjs/config/config.d.ts +5 -0
  12. package/cjs/config/config.js +1 -0
  13. package/cjs/config/configTypes.d.ts +64 -0
  14. package/cjs/config/configTypes.js +1 -0
  15. package/cjs/contentful/contentfulData.d.ts +5 -0
  16. package/cjs/contentful/contentfulData.js +1 -0
  17. package/cjs/contentful/contentfulDataNormal.d.ts +4 -0
  18. package/cjs/contentful/contentfulDataNormal.js +1 -0
  19. package/cjs/contentful/contentfulDataTypes.d.ts +67 -0
  20. package/cjs/contentful/contentfulDataTypes.js +1 -0
  21. package/cjs/global/globalTypes.d.ts +32 -0
  22. package/cjs/global/globalTypes.js +1 -0
  23. package/cjs/layouts/Column/Column.d.ts +3 -0
  24. package/cjs/layouts/Column/Column.js +1 -0
  25. package/cjs/layouts/Column/ColumnTypes.d.ts +16 -0
  26. package/cjs/layouts/Column/ColumnTypes.js +1 -0
  27. package/cjs/layouts/Container/Container.d.ts +3 -0
  28. package/cjs/layouts/Container/Container.js +1 -0
  29. package/cjs/layouts/Container/ContainerTypes.d.ts +15 -0
  30. package/cjs/layouts/Container/ContainerTypes.js +1 -0
  31. package/cjs/local/localData.d.ts +5 -0
  32. package/cjs/local/localData.js +1 -0
  33. package/cjs/local/localDataNormal.d.ts +3 -0
  34. package/cjs/local/localDataNormal.js +1 -0
  35. package/cjs/local/localDataTypes.d.ts +14 -0
  36. package/cjs/local/localDataTypes.js +1 -0
  37. package/cjs/objects/Form/Form.d.ts +3 -0
  38. package/cjs/objects/Form/Form.js +1 -0
  39. package/cjs/objects/Form/FormField.d.ts +3 -0
  40. package/cjs/objects/Form/FormField.js +1 -0
  41. package/cjs/objects/Form/FormOption.d.ts +3 -0
  42. package/cjs/objects/Form/FormOption.js +1 -0
  43. package/cjs/objects/Form/FormTypes.d.ts +74 -0
  44. package/cjs/objects/Form/FormTypes.js +1 -0
  45. package/cjs/package.json +1 -0
  46. package/cjs/redirects/redirects.d.ts +4 -0
  47. package/cjs/redirects/redirects.js +1 -0
  48. package/cjs/redirects/redirectsFile.d.ts +2 -0
  49. package/cjs/redirects/redirectsFile.js +1 -0
  50. package/cjs/render/render.d.ts +11 -0
  51. package/cjs/render/render.js +1 -0
  52. package/cjs/render/renderInline.d.ts +4 -0
  53. package/cjs/render/renderInline.js +1 -0
  54. package/cjs/render/renderTypes.d.ts +198 -0
  55. package/cjs/render/renderTypes.js +1 -0
  56. package/cjs/serverless/Ajax/Ajax.d.ts +3 -0
  57. package/cjs/serverless/Ajax/Ajax.js +1 -0
  58. package/cjs/serverless/Ajax/AjaxTypes.d.ts +11 -0
  59. package/cjs/serverless/Ajax/AjaxTypes.js +1 -0
  60. package/cjs/serverless/Contact/Contact.d.ts +3 -0
  61. package/cjs/serverless/Contact/Contact.js +1 -0
  62. package/cjs/serverless/Contact/ContactTypes.d.ts +13 -0
  63. package/cjs/serverless/Contact/ContactTypes.js +1 -0
  64. package/cjs/serverless/Preview/Preview.d.ts +5 -0
  65. package/cjs/serverless/Preview/Preview.js +1 -0
  66. package/cjs/serverless/Reload/Reload.d.ts +5 -0
  67. package/cjs/serverless/Reload/Reload.js +1 -0
  68. package/cjs/serverless/Reload/ReloadTypes.d.ts +5 -0
  69. package/cjs/serverless/Reload/ReloadTypes.js +1 -0
  70. package/cjs/serverless/serverless.d.ts +6 -0
  71. package/cjs/serverless/serverless.js +1 -0
  72. package/cjs/serverless/serverlessFiles.d.ts +3 -0
  73. package/cjs/serverless/serverlessFiles.js +1 -0
  74. package/cjs/serverless/serverlessTypes.d.ts +50 -0
  75. package/cjs/serverless/serverlessTypes.js +1 -0
  76. package/cjs/store/store.d.ts +9 -0
  77. package/cjs/store/store.js +1 -0
  78. package/cjs/store/storeFiles.d.ts +2 -0
  79. package/cjs/store/storeFiles.js +1 -0
  80. package/cjs/store/storeTypes.d.ts +35 -0
  81. package/cjs/store/storeTypes.js +1 -0
  82. package/cjs/text/RichText/RichText.d.ts +4 -0
  83. package/cjs/text/RichText/RichText.js +1 -0
  84. package/cjs/text/RichText/RichTextTypes.d.ts +54 -0
  85. package/cjs/text/RichText/RichTextTypes.js +1 -0
  86. package/cjs/utils/ResponseError/ResponseError.d.ts +5 -0
  87. package/cjs/utils/ResponseError/ResponseError.js +1 -0
  88. package/cjs/utils/action/action.d.ts +8 -0
  89. package/cjs/utils/action/action.js +1 -0
  90. package/cjs/utils/action/actionTypes.d.ts +10 -0
  91. package/cjs/utils/action/actionTypes.js +1 -0
  92. package/cjs/utils/archive/archive.d.ts +7 -0
  93. package/cjs/utils/archive/archive.js +1 -0
  94. package/cjs/utils/archive/archiveTypes.d.ts +18 -0
  95. package/cjs/utils/archive/archiveTypes.js +1 -0
  96. package/cjs/utils/array/array.d.ts +3 -0
  97. package/cjs/utils/array/array.js +1 -0
  98. package/cjs/utils/boolean/boolean.d.ts +2 -0
  99. package/cjs/utils/boolean/boolean.js +1 -0
  100. package/cjs/utils/contentType/contentType.d.ts +2 -0
  101. package/cjs/utils/contentType/contentType.js +1 -0
  102. package/cjs/utils/dataSource/dataSource.d.ts +3 -0
  103. package/cjs/utils/dataSource/dataSource.js +1 -0
  104. package/cjs/utils/dataSource/dataSourceTypes.d.ts +9 -0
  105. package/cjs/utils/dataSource/dataSourceTypes.js +1 -0
  106. package/cjs/utils/escape/escape.d.ts +2 -0
  107. package/cjs/utils/escape/escape.js +1 -0
  108. package/cjs/utils/excerpt/excerpt.d.ts +3 -0
  109. package/cjs/utils/excerpt/excerpt.js +1 -0
  110. package/cjs/utils/excerpt/excerptTypes.d.ts +14 -0
  111. package/cjs/utils/excerpt/excerptTypes.js +1 -0
  112. package/cjs/utils/file/filePath.d.ts +2 -0
  113. package/cjs/utils/file/filePath.js +1 -0
  114. package/cjs/utils/filter/filter.d.ts +8 -0
  115. package/cjs/utils/filter/filter.js +1 -0
  116. package/cjs/utils/filter/filterTypes.d.ts +62 -0
  117. package/cjs/utils/filter/filterTypes.js +1 -0
  118. package/cjs/utils/function/function.d.ts +3 -0
  119. package/cjs/utils/function/function.js +1 -0
  120. package/cjs/utils/heading/heading.d.ts +2 -0
  121. package/cjs/utils/heading/heading.js +1 -0
  122. package/cjs/utils/image/image.d.ts +5 -0
  123. package/cjs/utils/image/image.js +1 -0
  124. package/cjs/utils/image/imageLocal.d.ts +3 -0
  125. package/cjs/utils/image/imageLocal.js +1 -0
  126. package/cjs/utils/image/imageRemote.d.ts +3 -0
  127. package/cjs/utils/image/imageRemote.js +1 -0
  128. package/cjs/utils/image/imageTypes.d.ts +60 -0
  129. package/cjs/utils/image/imageTypes.js +1 -0
  130. package/cjs/utils/json/json.d.ts +3 -0
  131. package/cjs/utils/json/json.js +1 -0
  132. package/cjs/utils/link/link.d.ts +6 -0
  133. package/cjs/utils/link/link.js +1 -0
  134. package/cjs/utils/link/linkShare.d.ts +3 -0
  135. package/cjs/utils/link/linkShare.js +1 -0
  136. package/cjs/utils/link/linkTypes.d.ts +31 -0
  137. package/cjs/utils/link/linkTypes.js +1 -0
  138. package/cjs/utils/map/map.d.ts +2 -0
  139. package/cjs/utils/map/map.js +1 -0
  140. package/cjs/utils/minify/minify.d.ts +2 -0
  141. package/cjs/utils/minify/minify.js +1 -0
  142. package/cjs/utils/number/number.d.ts +2 -0
  143. package/cjs/utils/number/number.js +1 -0
  144. package/cjs/utils/object/object.d.ts +4 -0
  145. package/cjs/utils/object/object.js +1 -0
  146. package/cjs/utils/object/objectUtils.d.ts +2 -0
  147. package/cjs/utils/object/objectUtils.js +1 -0
  148. package/cjs/utils/path/path.d.ts +3 -0
  149. package/cjs/utils/path/path.js +1 -0
  150. package/cjs/utils/print/print.d.ts +2 -0
  151. package/cjs/utils/print/print.js +1 -0
  152. package/cjs/utils/scriptStyle/scriptStyle.d.ts +8 -0
  153. package/cjs/utils/scriptStyle/scriptStyle.js +1 -0
  154. package/cjs/utils/scriptStyle/scriptStyleTypes.d.ts +12 -0
  155. package/cjs/utils/scriptStyle/scriptStyleTypes.js +1 -0
  156. package/cjs/utils/set/set.d.ts +3 -0
  157. package/cjs/utils/set/set.js +1 -0
  158. package/cjs/utils/shortcode/shortcode.d.ts +10 -0
  159. package/cjs/utils/shortcode/shortcode.js +1 -0
  160. package/cjs/utils/shortcode/shortcodeTypes.d.ts +20 -0
  161. package/cjs/utils/shortcode/shortcodeTypes.js +1 -0
  162. package/cjs/utils/string/string.d.ts +3 -0
  163. package/cjs/utils/string/string.js +1 -0
  164. package/cjs/utils/tag/tag.d.ts +4 -0
  165. package/cjs/utils/tag/tag.js +1 -0
  166. package/cjs/utils/tag/tagTypes.d.ts +7 -0
  167. package/cjs/utils/tag/tagTypes.js +1 -0
  168. package/cjs/utils/year/year.d.ts +2 -0
  169. package/cjs/utils/year/year.js +1 -0
  170. package/cjs/wordpress/wordpressData.d.ts +6 -0
  171. package/cjs/wordpress/wordpressData.js +1 -0
  172. package/cjs/wordpress/wordpressDataNormal.d.ts +9 -0
  173. package/cjs/wordpress/wordpressDataNormal.js +1 -0
  174. package/cjs/wordpress/wordpressDataTypes.d.ts +206 -0
  175. package/cjs/wordpress/wordpressDataTypes.js +1 -0
  176. package/lib/components/Navigation/Navigation.d.ts +16 -0
  177. package/lib/components/Navigation/Navigation.js +1 -0
  178. package/lib/components/Navigation/NavigationTypes.d.ts +85 -0
  179. package/lib/components/Navigation/NavigationTypes.js +1 -0
  180. package/lib/components/Pagination/Pagination.d.ts +3 -0
  181. package/lib/components/Pagination/Pagination.js +1 -0
  182. package/lib/components/Pagination/PaginationTypes.d.ts +44 -0
  183. package/lib/components/Pagination/PaginationTypes.js +1 -0
  184. package/lib/config/config.d.ts +5 -0
  185. package/lib/config/config.js +1 -0
  186. package/lib/config/configTypes.d.ts +64 -0
  187. package/lib/config/configTypes.js +1 -0
  188. package/lib/contentful/contentfulData.d.ts +5 -0
  189. package/lib/contentful/contentfulData.js +1 -0
  190. package/lib/contentful/contentfulDataNormal.d.ts +4 -0
  191. package/lib/contentful/contentfulDataNormal.js +1 -0
  192. package/lib/contentful/contentfulDataTypes.d.ts +67 -0
  193. package/lib/contentful/contentfulDataTypes.js +1 -0
  194. package/lib/global/globalTypes.d.ts +32 -0
  195. package/lib/global/globalTypes.js +1 -0
  196. package/lib/layouts/Column/Column.d.ts +3 -0
  197. package/lib/layouts/Column/Column.js +1 -0
  198. package/lib/layouts/Column/ColumnTypes.d.ts +16 -0
  199. package/lib/layouts/Column/ColumnTypes.js +1 -0
  200. package/lib/layouts/Container/Container.d.ts +3 -0
  201. package/lib/layouts/Container/Container.js +1 -0
  202. package/lib/layouts/Container/ContainerTypes.d.ts +15 -0
  203. package/lib/layouts/Container/ContainerTypes.js +1 -0
  204. package/lib/local/localData.d.ts +5 -0
  205. package/lib/local/localData.js +1 -0
  206. package/lib/local/localDataNormal.d.ts +3 -0
  207. package/lib/local/localDataNormal.js +1 -0
  208. package/lib/local/localDataTypes.d.ts +14 -0
  209. package/lib/local/localDataTypes.js +1 -0
  210. package/lib/objects/Form/Form.d.ts +3 -0
  211. package/lib/objects/Form/Form.js +1 -0
  212. package/lib/objects/Form/FormField.d.ts +3 -0
  213. package/lib/objects/Form/FormField.js +1 -0
  214. package/lib/objects/Form/FormOption.d.ts +3 -0
  215. package/lib/objects/Form/FormOption.js +1 -0
  216. package/lib/objects/Form/FormTypes.d.ts +74 -0
  217. package/lib/objects/Form/FormTypes.js +1 -0
  218. package/lib/package.json +1 -0
  219. package/lib/redirects/redirects.d.ts +4 -0
  220. package/lib/redirects/redirects.js +1 -0
  221. package/lib/redirects/redirectsFile.d.ts +2 -0
  222. package/lib/redirects/redirectsFile.js +1 -0
  223. package/lib/render/render.d.ts +11 -0
  224. package/lib/render/render.js +1 -0
  225. package/lib/render/renderInline.d.ts +4 -0
  226. package/lib/render/renderInline.js +1 -0
  227. package/lib/render/renderTypes.d.ts +198 -0
  228. package/lib/render/renderTypes.js +1 -0
  229. package/lib/serverless/Ajax/Ajax.d.ts +3 -0
  230. package/lib/serverless/Ajax/Ajax.js +1 -0
  231. package/lib/serverless/Ajax/AjaxTypes.d.ts +11 -0
  232. package/lib/serverless/Ajax/AjaxTypes.js +1 -0
  233. package/lib/serverless/Contact/Contact.d.ts +3 -0
  234. package/lib/serverless/Contact/Contact.js +1 -0
  235. package/lib/serverless/Contact/ContactTypes.d.ts +13 -0
  236. package/lib/serverless/Contact/ContactTypes.js +1 -0
  237. package/lib/serverless/Preview/Preview.d.ts +5 -0
  238. package/lib/serverless/Preview/Preview.js +1 -0
  239. package/lib/serverless/Reload/Reload.d.ts +5 -0
  240. package/lib/serverless/Reload/Reload.js +1 -0
  241. package/lib/serverless/Reload/ReloadTypes.d.ts +5 -0
  242. package/lib/serverless/Reload/ReloadTypes.js +1 -0
  243. package/lib/serverless/serverless.d.ts +6 -0
  244. package/lib/serverless/serverless.js +1 -0
  245. package/lib/serverless/serverlessFiles.d.ts +3 -0
  246. package/lib/serverless/serverlessFiles.js +1 -0
  247. package/lib/serverless/serverlessTypes.d.ts +50 -0
  248. package/lib/serverless/serverlessTypes.js +1 -0
  249. package/lib/store/store.d.ts +9 -0
  250. package/lib/store/store.js +1 -0
  251. package/lib/store/storeFiles.d.ts +2 -0
  252. package/lib/store/storeFiles.js +1 -0
  253. package/lib/store/storeTypes.d.ts +35 -0
  254. package/lib/store/storeTypes.js +1 -0
  255. package/lib/text/RichText/RichText.d.ts +4 -0
  256. package/lib/text/RichText/RichText.js +1 -0
  257. package/lib/text/RichText/RichTextTypes.d.ts +54 -0
  258. package/lib/text/RichText/RichTextTypes.js +1 -0
  259. package/lib/utils/ResponseError/ResponseError.d.ts +5 -0
  260. package/lib/utils/ResponseError/ResponseError.js +1 -0
  261. package/lib/utils/action/action.d.ts +8 -0
  262. package/lib/utils/action/action.js +1 -0
  263. package/lib/utils/action/actionTypes.d.ts +10 -0
  264. package/lib/utils/action/actionTypes.js +1 -0
  265. package/lib/utils/archive/archive.d.ts +7 -0
  266. package/lib/utils/archive/archive.js +1 -0
  267. package/lib/utils/archive/archiveTypes.d.ts +18 -0
  268. package/lib/utils/archive/archiveTypes.js +1 -0
  269. package/lib/utils/array/array.d.ts +3 -0
  270. package/lib/utils/array/array.js +1 -0
  271. package/lib/utils/boolean/boolean.d.ts +2 -0
  272. package/lib/utils/boolean/boolean.js +1 -0
  273. package/lib/utils/contentType/contentType.d.ts +2 -0
  274. package/lib/utils/contentType/contentType.js +1 -0
  275. package/lib/utils/dataSource/dataSource.d.ts +3 -0
  276. package/lib/utils/dataSource/dataSource.js +1 -0
  277. package/lib/utils/dataSource/dataSourceTypes.d.ts +9 -0
  278. package/lib/utils/dataSource/dataSourceTypes.js +1 -0
  279. package/lib/utils/escape/escape.d.ts +2 -0
  280. package/lib/utils/escape/escape.js +1 -0
  281. package/lib/utils/excerpt/excerpt.d.ts +3 -0
  282. package/lib/utils/excerpt/excerpt.js +1 -0
  283. package/lib/utils/excerpt/excerptTypes.d.ts +14 -0
  284. package/lib/utils/excerpt/excerptTypes.js +1 -0
  285. package/lib/utils/file/filePath.d.ts +2 -0
  286. package/lib/utils/file/filePath.js +1 -0
  287. package/lib/utils/filter/filter.d.ts +8 -0
  288. package/lib/utils/filter/filter.js +1 -0
  289. package/lib/utils/filter/filterTypes.d.ts +62 -0
  290. package/lib/utils/filter/filterTypes.js +1 -0
  291. package/lib/utils/function/function.d.ts +3 -0
  292. package/lib/utils/function/function.js +1 -0
  293. package/lib/utils/heading/heading.d.ts +2 -0
  294. package/lib/utils/heading/heading.js +1 -0
  295. package/lib/utils/image/image.d.ts +5 -0
  296. package/lib/utils/image/image.js +1 -0
  297. package/lib/utils/image/imageLocal.d.ts +3 -0
  298. package/lib/utils/image/imageLocal.js +1 -0
  299. package/lib/utils/image/imageRemote.d.ts +3 -0
  300. package/lib/utils/image/imageRemote.js +1 -0
  301. package/lib/utils/image/imageTypes.d.ts +60 -0
  302. package/lib/utils/image/imageTypes.js +1 -0
  303. package/lib/utils/json/json.d.ts +3 -0
  304. package/lib/utils/json/json.js +1 -0
  305. package/lib/utils/link/link.d.ts +6 -0
  306. package/lib/utils/link/link.js +1 -0
  307. package/lib/utils/link/linkShare.d.ts +3 -0
  308. package/lib/utils/link/linkShare.js +1 -0
  309. package/lib/utils/link/linkTypes.d.ts +31 -0
  310. package/lib/utils/link/linkTypes.js +1 -0
  311. package/lib/utils/map/map.d.ts +2 -0
  312. package/lib/utils/map/map.js +1 -0
  313. package/lib/utils/minify/minify.d.ts +2 -0
  314. package/lib/utils/minify/minify.js +1 -0
  315. package/lib/utils/number/number.d.ts +2 -0
  316. package/lib/utils/number/number.js +1 -0
  317. package/lib/utils/object/object.d.ts +4 -0
  318. package/lib/utils/object/object.js +1 -0
  319. package/lib/utils/object/objectUtils.d.ts +2 -0
  320. package/lib/utils/object/objectUtils.js +1 -0
  321. package/lib/utils/path/path.d.ts +3 -0
  322. package/lib/utils/path/path.js +1 -0
  323. package/lib/utils/print/print.d.ts +2 -0
  324. package/lib/utils/print/print.js +1 -0
  325. package/lib/utils/scriptStyle/scriptStyle.d.ts +8 -0
  326. package/lib/utils/scriptStyle/scriptStyle.js +1 -0
  327. package/lib/utils/scriptStyle/scriptStyleTypes.d.ts +12 -0
  328. package/lib/utils/scriptStyle/scriptStyleTypes.js +1 -0
  329. package/lib/utils/set/set.d.ts +3 -0
  330. package/lib/utils/set/set.js +1 -0
  331. package/lib/utils/shortcode/shortcode.d.ts +10 -0
  332. package/lib/utils/shortcode/shortcode.js +1 -0
  333. package/lib/utils/shortcode/shortcodeTypes.d.ts +20 -0
  334. package/lib/utils/shortcode/shortcodeTypes.js +1 -0
  335. package/lib/utils/string/string.d.ts +3 -0
  336. package/lib/utils/string/string.js +1 -0
  337. package/lib/utils/tag/tag.d.ts +4 -0
  338. package/lib/utils/tag/tag.js +1 -0
  339. package/lib/utils/tag/tagTypes.d.ts +7 -0
  340. package/lib/utils/tag/tagTypes.js +1 -0
  341. package/lib/utils/year/year.d.ts +2 -0
  342. package/lib/utils/year/year.js +1 -0
  343. package/lib/wordpress/wordpressData.d.ts +6 -0
  344. package/lib/wordpress/wordpressData.js +1 -0
  345. package/lib/wordpress/wordpressDataNormal.d.ts +9 -0
  346. package/lib/wordpress/wordpressDataNormal.js +1 -0
  347. package/lib/wordpress/wordpressDataTypes.d.ts +206 -0
  348. package/lib/wordpress/wordpressDataTypes.js +1 -0
  349. package/package.json +87 -0
@@ -0,0 +1,198 @@
1
+ import type { Generic, GenericStrings, InternalLink, Taxonomy, ParentArgs } from '../global/globalTypes.js';
2
+ import type { NavigationList, NavigationItem, NavigationProps } from '../components/Navigation/NavigationTypes.js';
3
+ import type { Navigation } from '../components/Navigation/Navigation.js';
4
+ import type { RichTextHeading } from '../text/RichText/RichTextTypes.js';
5
+ import type { StoreParent } from '../store/storeTypes.js';
6
+ import { PaginationData } from '../components/Pagination/PaginationTypes.js';
7
+ export interface RenderMeta {
8
+ title?: string;
9
+ paginationTitle?: string;
10
+ description?: string;
11
+ url?: string;
12
+ image?: string;
13
+ canonical?: string;
14
+ canonicalParams?: string;
15
+ prev?: string;
16
+ next?: string;
17
+ noIndex?: boolean;
18
+ isIndex?: boolean;
19
+ }
20
+ export interface RenderBase {
21
+ pageData: RenderItem;
22
+ pageHeadings: RichTextHeading[][];
23
+ pageContains: string[];
24
+ serverlessData?: RenderServerlessData;
25
+ previewData?: RenderPreviewData;
26
+ }
27
+ export interface RenderServerlessData {
28
+ path: string;
29
+ query?: Generic;
30
+ }
31
+ export interface RenderPreviewData {
32
+ id: string;
33
+ contentType: string;
34
+ }
35
+ export interface RenderRedirect {
36
+ redirect: string[];
37
+ }
38
+ export interface RenderTag {
39
+ id: string;
40
+ name: string;
41
+ }
42
+ export interface RenderMetaTags {
43
+ tags?: RenderTag[];
44
+ }
45
+ export interface RenderFile {
46
+ path?: string;
47
+ url?: string;
48
+ name?: string;
49
+ alt?: string;
50
+ width?: number;
51
+ height?: number;
52
+ size?: number;
53
+ format?: string;
54
+ type?: string;
55
+ sizes?: Record<number, string>;
56
+ }
57
+ export interface RenderRichText {
58
+ tag?: string;
59
+ link?: string;
60
+ internalLink?: InternalLink;
61
+ content?: RenderItem[] | string;
62
+ attr?: string | GenericStrings;
63
+ }
64
+ export interface RenderTemplate {
65
+ content: RenderItem[];
66
+ namedContent: Record<string, RenderItem>;
67
+ templates: RenderItem[];
68
+ }
69
+ export interface RenderNavigationsArgs extends NavigationProps {
70
+ title?: string;
71
+ parents: StoreParent[];
72
+ }
73
+ export type RenderNavigations = (args: RenderNavigationsArgs) => Navigation | undefined | Promise<Navigation | undefined>;
74
+ export interface RenderHttpErrorArgs extends Generic {
75
+ code: number;
76
+ }
77
+ export type RenderHttpError = (args: RenderHttpErrorArgs) => string | Promise<string>;
78
+ export interface RenderFunctionArgs<T = any, R = RenderItem, P = ParentArgs> {
79
+ args: 0 extends (1 & T) ? any : T;
80
+ parents?: P[];
81
+ pageData?: R;
82
+ pageContains?: string[];
83
+ navigations?: Navigation;
84
+ serverlessData?: RenderServerlessData;
85
+ previewData?: RenderPreviewData;
86
+ headings?: RichTextHeading[];
87
+ children?: R[];
88
+ }
89
+ export type RenderFunction<T = any, R = RenderItem, P = ParentArgs> = (props: RenderFunctionArgs<T, R, P>) => string | string[] | Promise<string | string[]>;
90
+ export type RenderFunctions<T = any, R = RenderItem, P = ParentArgs> = Record<string, RenderFunction<T, R, P>>;
91
+ export interface RenderFunctionsArgs {
92
+ functions: RenderFunctions;
93
+ layout: RenderLayout;
94
+ navigations?: RenderNavigations;
95
+ httpError?: RenderHttpError;
96
+ }
97
+ export interface RenderContentArgs extends RenderBase {
98
+ content: RenderItem[];
99
+ parents: ParentArgs[];
100
+ navigations?: Navigation;
101
+ headingsIndex?: number;
102
+ depth?: number;
103
+ }
104
+ export interface RenderItem extends Generic, Partial<Taxonomy> {
105
+ id?: string;
106
+ contentType?: string;
107
+ renderType?: string;
108
+ tag?: string;
109
+ link?: string;
110
+ internalLink?: InternalLink;
111
+ slug?: string;
112
+ title?: string;
113
+ content?: RenderItem[] | string;
114
+ meta?: RenderMeta;
115
+ baseUrl?: string;
116
+ archive?: string;
117
+ parent?: RenderItem;
118
+ taxonomy?: Taxonomy;
119
+ metadata?: RenderMetaTags;
120
+ pagination?: PaginationData;
121
+ }
122
+ export interface RenderItemArgs {
123
+ item: RenderItem;
124
+ serverlessData?: RenderServerlessData;
125
+ previewData?: RenderPreviewData;
126
+ }
127
+ export interface RenderItemReturn {
128
+ serverlessRender?: boolean;
129
+ pageData?: RenderItem;
130
+ data?: {
131
+ slug: string;
132
+ output: string;
133
+ };
134
+ }
135
+ export interface RenderInlineItem extends Omit<RenderItem, 'id' | 'slug' | 'contentType' | 'content'> {
136
+ id: string;
137
+ slug: string;
138
+ contentType: string;
139
+ content: RenderItem[] | string;
140
+ }
141
+ export interface RenderItemStartActionArgs extends RenderBase {
142
+ id: string;
143
+ contentType: string;
144
+ }
145
+ export interface RenderItemActionArgs extends RenderBase {
146
+ id: string;
147
+ contentType: string;
148
+ slug: string;
149
+ output: string;
150
+ }
151
+ export interface RenderLayoutArgs {
152
+ id: string;
153
+ meta: RenderMeta;
154
+ navigations?: Navigation;
155
+ contentType: string;
156
+ content: string;
157
+ slug: string;
158
+ pageData: RenderItem;
159
+ pageHeadings?: RichTextHeading[][];
160
+ pageContains?: string[];
161
+ serverlessData?: RenderServerlessData;
162
+ previewData?: RenderPreviewData;
163
+ }
164
+ export type RenderLayout = (args: RenderLayoutArgs) => string | Promise<string>;
165
+ export interface RenderAllData extends Generic {
166
+ navigation?: NavigationList[];
167
+ navigationItem?: NavigationItem[];
168
+ redirect?: RenderRedirect[];
169
+ content: {
170
+ page: RenderItem[];
171
+ [key: string]: RenderItem[];
172
+ };
173
+ }
174
+ export interface RenderArgs {
175
+ allData?: RenderAllData;
176
+ serverlessData?: RenderServerlessData;
177
+ previewData?: RenderPreviewData;
178
+ }
179
+ export interface RenderReturn {
180
+ slug: string;
181
+ output: string;
182
+ }
183
+ export type RenderContentFilter = <T>(content: string[], args: ParentArgs<T>) => Promise<string[]> | string[];
184
+ export type RenderItemFilter = (output: string, args: RenderItemActionArgs) => Promise<string> | string;
185
+ export type RenderItemDataFilter = (item: RenderItem, args: {
186
+ contentType: string;
187
+ }) => Promise<RenderItem> | RenderItem;
188
+ export type RenderStartAction = (args: RenderArgs) => Promise<void> | void;
189
+ export interface RenderEndActionArgs extends RenderArgs {
190
+ data: RenderReturn[] | RenderReturn;
191
+ }
192
+ export type RenderEndAction = (args: RenderEndActionArgs) => Promise<void> | void;
193
+ export type RenderItemStartAction = (args: RenderItemStartActionArgs) => Promise<void> | void;
194
+ export type RenderItemEndAction = (args: RenderItemActionArgs) => Promise<void> | void;
195
+ export interface RenderDataMeta {
196
+ total?: number;
197
+ totalPages?: number;
198
+ }
@@ -0,0 +1 @@
1
+ export{};
@@ -0,0 +1,3 @@
1
+ import type { ServerlessContext, ServerlessSetup } from '../serverlessTypes.js';
2
+ declare const Ajax: (context: ServerlessContext, setupServerless: ServerlessSetup) => Promise<Response>;
3
+ export { Ajax };
@@ -0,0 +1 @@
1
+ import{ResponseError}from"../../utils/ResponseError/ResponseError.js";import{applyFilters}from"../../utils/filter/filter.js";import{isObjectStrict}from"../../utils/object/object.js";import{isStringStrict}from"../../utils/string/string.js";import{isNumber}from"../../utils/number/number.js";import{isFunction}from"../../utils/function/function.js";import{print}from"../../utils/print/print.js";import{config}from"../../config/config.js";import{serverlessActions}from"../serverless.js";const Ajax=async(context,setupServerless)=>{try{await setupServerless(context,"ajax");const request=context.request,data=await request.json();if(!isObjectStrict(data))throw new Error("Data not an object");const honeypotName=`${config.namespace}_asi`;if(isObjectStrict(data.inputs?.[honeypotName])){const honeypotValue=data.inputs[honeypotName].value;if(isStringStrict(honeypotValue)){const options={status:200,headers:{"Content-Type":"application/json"}};return new Response(JSON.stringify({success:"Form successully sent"}),options)}data.inputs[honeypotName].exclude=!0}const action=data.action;if(!isStringStrict(action))throw new Error("No action");let res=null;const ajaxFn=serverlessActions[action];isFunction(ajaxFn)&&(res=await ajaxFn(data,context));const ajaxResultFilterArgs={data:data,context:context};if(res=await applyFilters("ajaxResult",res,ajaxResultFilterArgs,!0),!res)throw new Error("No result");if(res.error)throw new ResponseError(res.error.message,res.error.response);const options={status:200,headers:{"Content-Type":"application/json"}};let message="";if(res.success){const{message:successMessage,headers:headers}=res.success;isStringStrict(successMessage)&&(message=successMessage),isObjectStrict(headers)&&(options.headers={...options.headers,...headers})}return new Response(JSON.stringify({success:message}),options)}catch(error){print("[FRM] Error with ajax function",error);let statusCode=500,message=error instanceof Error?error.message:"Unknown error";error instanceof ResponseError&&(isNumber(error.response?.status)&&(statusCode=error.response.status),isStringStrict(error.message)&&(message=error.message));const options={status:statusCode,headers:{"Content-Type":"application/json"}};return new Response(JSON.stringify({error:message}),options)}};export{Ajax};
@@ -0,0 +1,11 @@
1
+ import type { GenericStrings } from '../../global/globalTypes.js';
2
+ import type { ServerlessActionData, ServerlessContext, ServerlessActionReturn } from '../serverlessTypes.js';
3
+ export interface AjaxResultOptions {
4
+ status: number;
5
+ headers?: GenericStrings;
6
+ }
7
+ export interface AjaxResultFilterArgs {
8
+ data: ServerlessActionData;
9
+ context: ServerlessContext;
10
+ }
11
+ export type AjaxResultFilter = (res: ServerlessActionReturn | null, args: AjaxResultFilterArgs) => Promise<ServerlessActionReturn | null>;
@@ -0,0 +1 @@
1
+ export{};
@@ -0,0 +1,3 @@
1
+ import type { ServerlessAction } from '../serverlessTypes.js';
2
+ declare const Contact: ServerlessAction;
3
+ export { Contact };
@@ -0,0 +1 @@
1
+ import{config}from"../../config/config.js";import{escape}from"../../utils/escape/escape.js";import{isArray}from"../../utils/array/array.js";import{isString,isStringStrict}from"../../utils/string/string.js";import{isObject,isObjectStrict}from"../../utils/object/object.js";import{isBoolean}from"../../utils/boolean/boolean.js";import{getObjectKeys}from"../../utils/object/objectUtils.js";import{applyFilters}from"../../utils/filter/filter.js";import{getPermalink}from"../../utils/link/link.js";import{getStoreItem}from"../../store/store.js";import{minify}from"../../utils/minify/minify.js";const recurseEmailHtml=(data,output,depth=1)=>{if(!isObject(data))return;const isArr=isArray(data);getObjectKeys(data).forEach((label=>{const value=data[label],l=label.toString(),h=depth+1;1===depth&&(output.html+='\n <tr>\n <td style="padding: 16px 0; border-bottom: 2px solid #ccc;">\n '),label&&!isArr&&(output.html+=`\n <h${h} style="font-family: sans-serif; color: #222; margin: 16px 0; line-height: 1.3em">\n ${l}\n </h${h}>\n `,output.plain+=`${l}\n`),recurseEmailHtml(value,output,depth+1),isString(value)&&(output.html+=`\n <p style="font-family: sans-serif; color: #222; margin: 16px 0; line-height: 1.5em;">\n ${value}\n </p>\n `,output.plain+=value.replace(/<br\s*\/?>/gi,"\n").replace(/(<([^>]+)>)/gi,"")+"\n"),1===depth&&(output.html+="\n </td>\n </tr>\n ",output.plain+="\n")}))},Contact=async args=>{const{id:id,action:action,inputs:inputs}=args;if(!isStringStrict(id))return{error:{message:"No id"}};if(!isObjectStrict(inputs)||!Object.keys(inputs).length)return{error:{message:"No inputs"}};const formMetaData=getStoreItem("formMeta");if(!isObjectStrict(formMetaData))return{error:{message:"No meta"}};const meta=formMetaData[id];if(!isObjectStrict(meta))return{error:{message:"No meta object"}};const toEmail=meta.toEmail;if(!isStringStrict(toEmail))return{error:{message:"No to email"}};const toEmails=toEmail.split(","),senderEmail=meta.senderEmail;if(!isStringStrict(senderEmail))return{error:{message:"No sender email"}};let subject=isStringStrict(meta.subject)?meta.subject:"",replyToEmail="";const header=`${config.title} contact form submission`,footer=`This email was sent from a contact form on ${config.title} (${getPermalink()})`,outputData={},output={html:"",plain:""};for(const[name,input]of Object.entries(inputs)){const inputExclude=input.exclude;if(!!isBoolean(inputExclude)&&inputExclude)continue;const inputType=input.type,inputLabel=input.label.trim(),inputValue=input.value;let inputValueStr="";if(isArray(inputValue)&&(inputValueStr=inputValue.map((v=>escape(v.trim()+""))).join("<br>")),isString(inputValue)&&(inputValueStr=escape(inputValue.trim()+"")),"subject"===name){subject=inputValueStr?`${isStringStrict(subject)?`${subject} - `:""}${inputValueStr}`:subject;continue}"email"===inputType&&inputValueStr&&(replyToEmail=inputValueStr,inputValueStr=`<a href="mailto:${inputValueStr}">${inputValueStr}</a>`);const outputValue=""===inputValueStr?"--":inputValueStr;let hasLegend=!1,legend="";if(isStringStrict(input.legend)&&(hasLegend=!0,legend=input.legend),hasLegend){null==outputData[legend]&&(outputData[legend]={});null==outputData[legend][inputLabel]&&(outputData[legend][inputLabel]=[]),outputData[legend][inputLabel].push(outputValue)}if(!hasLegend){null==outputData[inputLabel]&&(outputData[inputLabel]=[]),outputData[inputLabel].push(outputValue)}}recurseEmailHtml(outputData,output);const outputHtml=`\n <table width="100%" cellpadding="0" cellspacing="0" border="0">\n <tr>\n <td align="center" width="100%" style="padding: 0 16px 16px 16px;">\n <table align="center" cellpadding="0" cellspacing="0" border="0" style="margin-right: auto; margin-left: auto; border-spacing: 0; max-width: 37.5em;">\n <tr>\n <td style="padding: 32px 0 0 0;">\n <h1 style="font-family: sans-serif; color: #222; margin: 0; line-height: 1.3em;">\n ${header}\n </h1>\n </td>\n </tr>\n <tr>\n <td>\n <table border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse;">\n ${output.html}\n <tr>\n <td style="padding: 32px 0;">\n <p style="font-family: sans-serif; color: #222; margin: 0; line-height: 1.5em;">\n ${footer}\n </p>\n </td>\n </tr>\n </table>\n </td>\n </tr>\n </table>\n </td>\n </tr>\n </table>\n `,outputPlain=`${header}\n\n${output.plain}${footer}`;subject||(subject=`${config.title} Contact Form`);const body={id:id,action:action,inputs:inputs,to:toEmails,sender:senderEmail,subject:subject,text:minify(outputPlain),html:minify(outputHtml)};return replyToEmail&&(body.replyTo=replyToEmail),await applyFilters("contactResult",{},body,!0)};export{Contact};
@@ -0,0 +1,13 @@
1
+ import type { ServerlessActionData, ServerlessActionReturn } from '../serverlessTypes.js';
2
+ export interface ContactData {
3
+ [key: string]: string[] | ContactData;
4
+ }
5
+ export interface ContactBody extends ServerlessActionData {
6
+ to: string[];
7
+ sender: string;
8
+ subject: string;
9
+ text: string;
10
+ html: string;
11
+ replyTo?: string;
12
+ }
13
+ export type ContactResultFilter = (res: ServerlessActionReturn | null, args: ContactBody) => Promise<ServerlessActionReturn | null>;
@@ -0,0 +1 @@
1
+ export{};
@@ -0,0 +1,5 @@
1
+ import type { ServerlessContext, ServerlessSetup } from '../serverlessTypes.js';
2
+ import type { getAllContentfulData } from '../../contentful/contentfulData.js';
3
+ import type { getAllWordPressData } from '../../wordpress/wordpressData.js';
4
+ declare const Preview: (context: ServerlessContext, setupServerless: ServerlessSetup, getData: typeof getAllContentfulData | typeof getAllWordPressData) => Promise<Response>;
5
+ export { Preview };
@@ -0,0 +1 @@
1
+ import{isStringStrict}from"../../utils/string/string.js";import{isObjectStrict}from"../../utils/object/object.js";import{isFunction}from"../../utils/function/function.js";import{render,renderHttpError}from"../../render/render.js";import{minify}from"../../utils/minify/minify.js";const Preview=async(context,setupServerless,getData)=>{const{request:request,next:next}=context,{searchParams:searchParams}=new URL(request.url),contentType=searchParams.get("content_type"),id=searchParams.get("preview");if(!isStringStrict(id)||!isStringStrict(contentType))return next();await setupServerless(context,"preview");const previewData={id:id,contentType:contentType},data=await render({previewData:previewData,allData:await getData({previewData:previewData})});let html="",status=200;isObjectStrict(data)&&(html=data.output);const isEmpty=""===html;return isEmpty&&(status=404),isEmpty&&isFunction(renderHttpError)&&(html=await renderHttpError({code:status})),new Response(minify(html),{status:status,headers:{"Content-Type":"text/html;charset=UTF-8"}})};export{Preview};
@@ -0,0 +1,5 @@
1
+ import type { ServerlessContext, ServerlessSetup } from '../serverlessTypes.js';
2
+ import type { getAllContentfulData } from '../../contentful/contentfulData.js';
3
+ import type { getAllWordPressData } from '../../wordpress/wordpressData.js';
4
+ declare const Reload: (context: ServerlessContext, setupServerless: ServerlessSetup, getData: typeof getAllContentfulData | typeof getAllWordPressData) => Promise<Response>;
5
+ export { Reload };
@@ -0,0 +1 @@
1
+ import{isStringStrict}from"../../utils/string/string.js";import{isObjectStrict}from"../../utils/object/object.js";import{isFunction}from"../../utils/function/function.js";import{render,renderHttpError}from"../../render/render.js";import{minify}from"../../utils/minify/minify.js";import{print}from"../../utils/print/print.js";const getErrorHtml=async(context,setupServerless,status)=>{try{if(await setupServerless(context,"error"),isFunction(renderHttpError))return await renderHttpError({code:status})}catch(error){print("[FRM] Error rendering http error",error)}return""},Reload=async(context,setupServerless,getData)=>{try{const{request:request,next:next}=context,{searchParams:searchParams,pathname:pathname}=new URL(request.url),page=searchParams.get("page"),filters=searchParams.get("filters"),path=pathname,query={};let noPage=!1,noFilters=!1;if(isStringStrict(page)?query.page=page:noPage=!0,isStringStrict(filters)?query.filters=filters:noFilters=!0,noPage&&noFilters)return next();await setupServerless(context,"reload");const serverlessData={query:query,path:path},data=await render({serverlessData:serverlessData,allData:await getData({serverlessData:serverlessData})});let html="",status=200;isObjectStrict(data)&&(html=data.output);const isEmpty=""===html;return isEmpty&&(status=404),isEmpty&&isFunction(renderHttpError)&&(html=await renderHttpError({code:status})),new Response(minify(html),{status:status,headers:{"Content-Type":"text/html;charset=UTF-8"}})}catch(error){print("[FRM] Error with reload function",error);const status=500,html=await getErrorHtml(context,setupServerless,status);return new Response(html,{status:status,headers:{"Content-Type":"text/html;charset=UTF-8"}})}};export{Reload};
@@ -0,0 +1,5 @@
1
+ import type { Generic } from '../../global/globalTypes.js';
2
+ export interface ReloadQuery extends Generic {
3
+ page?: string;
4
+ filters?: string;
5
+ }
@@ -0,0 +1 @@
1
+ export{};
@@ -0,0 +1,6 @@
1
+ import type { ServerlessRoutes, ServerlessActions, ServerlessArgs } from './serverlessTypes.js';
2
+ declare let serverlessDir: string;
3
+ declare let serverlessRoutes: ServerlessRoutes;
4
+ declare let serverlessActions: ServerlessActions;
5
+ declare const setServerless: (args: ServerlessArgs, dir?: string) => boolean;
6
+ export { serverlessDir, serverlessRoutes, serverlessActions, setServerless };
@@ -0,0 +1 @@
1
+ import{isStringStrict}from"../utils/string/string.js";import{isObjectStrict}from"../utils/object/object.js";let serverlessDir="functions",serverlessRoutes={reload:[]},serverlessActions={};const setServerless=(args,dir="functions")=>{if(!isObjectStrict(args))return!1;const{actions:actions,routes:routes}=args;return isObjectStrict(actions)&&(serverlessActions={...actions}),isObjectStrict(routes)&&(serverlessRoutes={reload:[],...routes}),isStringStrict(dir)&&(serverlessDir=dir),!0};export{serverlessDir,serverlessRoutes,serverlessActions,setServerless};
@@ -0,0 +1,3 @@
1
+ import type { ServerlessFilesArgs } from './serverlessTypes.js';
2
+ declare const createServerlessFiles: (args?: ServerlessFilesArgs) => Promise<void>;
3
+ export { createServerlessFiles };
@@ -0,0 +1 @@
1
+ import{mkdir,writeFile}from"node:fs/promises";import{resolve,dirname}from"node:path";import{getPathDepth}from"../utils/path/path.js";import{isObjectStrict}from"../utils/object/object.js";import{isArrayStrict}from"../utils/array/array.js";import{isStringStrict}from"../utils/string/string.js";import{dataSource}from"../utils/dataSource/dataSource.js";import{print}from"../utils/print/print.js";import{config}from"../config/config.js";import{serverlessDir,serverlessRoutes}from"./serverless.js";const minify=str=>str.replace(/\s+/g," ").replace(/;\s*}/g,";}").trim(),createServerlessFiles=async args=>{let defaultDataExport="getAllContentfulData",defaultDataFile="@alanizcreative/formation-static/contentful/contentfulData.js";dataSource.isWordPress()&&(defaultDataExport="getAllWordPressData",defaultDataFile="@alanizcreative/formation-static/wordpress/wordpressData.js");const defaults={dataExport:defaultDataExport,dataExportFile:defaultDataFile,setupExport:"setupServerless",setupExportFile:"lib/setup/setupServerless.js",previewExportFile:"@alanizcreative/formation-static/serverless/Preview/Preview.js",reloadExportFile:"@alanizcreative/formation-static/serverless/Reload/Reload.js",ajaxExportFile:"@alanizcreative/formation-static/serverless/Ajax/Ajax.js",ajaxFile:"ajax/index.js",previewFile:"_middleware.js",reloadFile:"_middleware.js"},{dataExport:dataExport,dataExportFile:dataExportFile,setupExport:setupExport,setupExportFile:setupExportFile,previewExportFile:previewExportFile,reloadExportFile:reloadExportFile,ajaxExportFile:ajaxExportFile,ajaxFile:ajaxFile,previewFile:previewFile,reloadFile:reloadFile}=Object.assign(defaults,isObjectStrict(args)?args:{});if(await mkdir(resolve(serverlessDir),{recursive:!0}),isStringStrict(ajaxFile)){const pathDepth=getPathDepth(`${serverlessDir}/${ajaxFile}`),content=`import { Ajax } from '${ajaxExportFile.startsWith("@")?"":pathDepth}${ajaxExportFile}';\nimport { ${setupExport} } from '${pathDepth}${setupExportFile}';\nconst render = async (context) => {\n return await Ajax(context, ${setupExport});\n};\nexport const onRequestPost = [render];`,path=resolve(serverlessDir,ajaxFile),dir=dirname(path);await mkdir(resolve(serverlessDir,dir),{recursive:!0}),await writeFile(path,minify(content)),print("[FRM] Successfully wrote",path,"success")}if(config.env.dev&&isStringStrict(previewFile)){const pathDepth=getPathDepth(`${serverlessDir}/${previewFile}`),content=`import { Preview } from '${previewExportFile.startsWith("@")?"":pathDepth}${previewExportFile}';\nimport { ${dataExport} } from '${dataExportFile.startsWith("@")?"":pathDepth}${dataExportFile}';\nimport { ${setupExport} } from '${pathDepth}${setupExportFile}';\nconst render = async (context) => {\n return await Preview(context, ${setupExport}, ${dataExport});\n};\nexport const onRequestGet = [render];`,path=resolve(serverlessDir,previewFile),dir=dirname(path);await mkdir(resolve(serverlessDir,dir),{recursive:!0}),await writeFile(path,minify(content)),print("[FRM] Successfully wrote",path,"success")}const newRoutes=[],hasReloadFile=isStringStrict(reloadFile);for(const[type,routes]of Object.entries(serverlessRoutes))if(isArrayStrict(routes))for(const route of routes){let{path:path,content:content}=route;if(isStringStrict(path)){if("reload"===type&&hasReloadFile){path=`${path}/${reloadFile}`;const pathDepth=getPathDepth(`${serverlessDir}/${path}`);content=`import { Reload } from '${reloadExportFile.startsWith("@")?"":pathDepth}${reloadExportFile}';\nimport { ${dataExport} } from '${dataExportFile.startsWith("@")?"":pathDepth}${dataExportFile}';\nimport { ${setupExport} } from '${pathDepth}${setupExportFile}';\nconst render = async (context) => {\n return await Reload(context, ${setupExport}, ${dataExport});\n};\nexport const onRequestGet = [render];`}isStringStrict(content)&&newRoutes.push({path:path,content:content})}}for(const route of newRoutes){const{path:path,content:content}=route,newPath=resolve(serverlessDir,path),dir=dirname(newPath);await mkdir(resolve(serverlessDir,dir),{recursive:!0}),await writeFile(newPath,content),print("[FRM] Successfully wrote",newPath,"success")}};export{createServerlessFiles};
@@ -0,0 +1,50 @@
1
+ import type { EventContext } from '@cloudflare/workers-types';
2
+ import type { Generic, GenericStrings } from '../global/globalTypes.js';
3
+ export interface ServerlessRoute {
4
+ path: string;
5
+ content?: string;
6
+ }
7
+ export type ServerlessRoutes = Record<string, ServerlessRoute[]>;
8
+ export type ServerlessContext = EventContext<GenericStrings, string, unknown>;
9
+ export type ServerlessSetup = (context: ServerlessContext, type?: string) => Promise<void> | void;
10
+ export interface ServerlessActionInput extends Generic {
11
+ type: string;
12
+ label: string;
13
+ value: string | string[];
14
+ legend?: string;
15
+ exclude?: boolean;
16
+ }
17
+ export interface ServerlessActionData {
18
+ id: string;
19
+ action: string;
20
+ inputs: Record<string, ServerlessActionInput>;
21
+ }
22
+ export interface ServerlessActionReturn {
23
+ error?: {
24
+ message: string;
25
+ response?: Response;
26
+ };
27
+ success?: {
28
+ message: string;
29
+ headers?: GenericStrings;
30
+ };
31
+ }
32
+ export type ServerlessAction = (args: ServerlessActionData, context: ServerlessContext) => Promise<ServerlessActionReturn>;
33
+ export type ServerlessActions = Record<string, ServerlessAction>;
34
+ export interface ServerlessFilesArgs {
35
+ dataExport?: string;
36
+ dataExportFile?: string;
37
+ setupExport?: string;
38
+ setupExportFile?: string;
39
+ previewExportFile?: string;
40
+ reloadExportFile?: string;
41
+ ajaxExportFile?: string;
42
+ ajaxFile?: string;
43
+ previewFile?: string;
44
+ reloadFile?: string;
45
+ setupFile?: string;
46
+ }
47
+ export interface ServerlessArgs {
48
+ actions?: ServerlessActions;
49
+ routes?: ServerlessRoutes;
50
+ }
@@ -0,0 +1 @@
1
+ export{};
@@ -0,0 +1,9 @@
1
+ import type { Store } from './storeTypes.js';
2
+ import type { RenderAllData } from '../render/renderTypes.js';
3
+ declare let storeDir: string;
4
+ declare let store: Store;
5
+ declare const setStore: <T extends object>(args: T, dir?: string) => Store & T;
6
+ declare const setStoreItem: <T extends Store, K extends keyof T, V extends keyof T[K] | undefined = undefined>(prop: K, value: V extends keyof T[K] ? T[K][V] : T[K], subProp?: V) => boolean;
7
+ declare const setStoreData: (allData: RenderAllData) => boolean;
8
+ declare const getStoreItem: <T extends Store, K extends keyof T>(prop: K) => T[K];
9
+ export { store, storeDir, setStore, setStoreData, setStoreItem, getStoreItem };
@@ -0,0 +1 @@
1
+ import{normalizeContentType}from"../utils/contentType/contentType.js";import{isObject,isObjectStrict}from"../utils/object/object.js";import{isStringStrict}from"../utils/string/string.js";import{isArrayStrict}from"../utils/array/array.js";import{config}from"../config/config.js";let storeDir="lib/store";const defaultStore={slugs:{},parents:{},navigations:[],navigationItems:[],formMeta:{},archiveMeta:{},imageMeta:{},taxonomies:{}};let store={...defaultStore};const setStore=(args,dir="lib/store")=>isObjectStrict(args)?(store={...defaultStore,...args},isStringStrict(dir)&&(storeDir=dir),store):store,setStoreItem=(prop,value,subProp)=>!(!isStringStrict(prop)||!isObject(value)||null==store[prop])&&(isStringStrict(subProp)?store[prop][subProp]=value:store[prop]=value,!0),setStoreData=allData=>{if(!isObjectStrict(allData))return!1;const{navigation:navigation,navigationItem:navigationItem,content:content}=allData;store.navigations=isArrayStrict(navigation)?navigation:[],store.navigationItems=isArrayStrict(navigationItem)?navigationItem:[];const data={...allData,...content};return config.hierarchicalTypes.forEach((type=>{const items=data[type];isArrayStrict(items)&&items.forEach((item=>{if(!isObjectStrict(item))return;const{id:id,parent:parent,archive:archive,slug:slug,title:title}=item;if(!isStringStrict(id))return;const archiveType=normalizeContentType(archive);if(isStringStrict(archiveType)){const archiveObj=isObjectStrict(store.archiveMeta[archiveType])?store.archiveMeta[archiveType]:{};store.archiveMeta[archiveType]={id:id,slug:slug,title:title,contentType:type,...archiveObj}}if(isObjectStrict(parent)){const parentSlug=parent.slug,parentTitle=parent.title,parentId=parent.id;isStringStrict(parentSlug)&&isStringStrict(parentTitle)&&isStringStrict(parentId)&&(null==store.parents[type]&&(store.parents[type]={}),store.parents[type][id]={id:parentId,slug:parentSlug,title:parentTitle})}}))})),!0},getStoreItem=prop=>store[prop];export{store,storeDir,setStore,setStoreData,setStoreItem,getStoreItem};
@@ -0,0 +1,2 @@
1
+ declare const createStoreFiles: () => Promise<void>;
2
+ export { createStoreFiles };
@@ -0,0 +1 @@
1
+ import{mkdir,writeFile}from"node:fs/promises";import{resolve}from"node:path";import{print}from"../utils/print/print.js";import{storeDir,store}from"./store.js";const createStoreFiles=async()=>{await mkdir(resolve(storeDir),{recursive:!0});for(const[key,data]of Object.entries(store)){const path=resolve(storeDir,`${key}.json`);await writeFile(path,JSON.stringify(data)),print("[FRM] Successfully wrote",path,"success")}};export{createStoreFiles};
@@ -0,0 +1,35 @@
1
+ import type { NavigationList, NavigationItem } from '../components/Navigation/NavigationTypes.js';
2
+ import type { ImageProps } from '../utils/image/imageTypes.js';
3
+ import type { FormMeta } from '../objects/Form/FormTypes.js';
4
+ import type { Generic, Taxonomy } from '../global/globalTypes.js';
5
+ export interface StoreSlug {
6
+ contentType: string;
7
+ id: string;
8
+ }
9
+ export interface StoreParent {
10
+ id: string;
11
+ slug: string;
12
+ title: string;
13
+ }
14
+ export interface StoreArchiveMeta {
15
+ id?: string;
16
+ slug?: string;
17
+ title?: string;
18
+ contentType?: string;
19
+ singular?: string;
20
+ plural?: string;
21
+ layout?: string;
22
+ order?: string;
23
+ display?: number;
24
+ }
25
+ export type StoreImageMeta = Record<string, ImageProps>;
26
+ export interface Store extends Generic {
27
+ slugs: Record<string, StoreSlug>;
28
+ parents: Record<string, Record<string, StoreParent>>;
29
+ archiveMeta: Record<string, StoreArchiveMeta>;
30
+ formMeta: Record<string, FormMeta>;
31
+ imageMeta: StoreImageMeta;
32
+ navigations: NavigationList[];
33
+ navigationItems: NavigationItem[];
34
+ taxonomies: Record<string, Taxonomy>;
35
+ }
@@ -0,0 +1 @@
1
+ export{};
@@ -0,0 +1,4 @@
1
+ import type { RichTextProps, RichTextContent } from './RichTextTypes.js';
2
+ declare const getPlainText: (args: RichTextContent | RichTextContent[] | string | undefined, _output?: string) => string;
3
+ declare const RichText: (props: RichTextProps) => string;
4
+ export { RichText, getPlainText };
@@ -0,0 +1 @@
1
+ import{getLink}from"../../utils/link/link.js";import{getExcerpt}from"../../utils/excerpt/excerpt.js";import{applyFilters}from"../../utils/filter/filter.js";import{isString,isStringStrict}from"../../utils/string/string.js";import{isArray,isArrayStrict}from"../../utils/array/array.js";import{isObjectStrict}from"../../utils/object/object.js";import{isHeading}from"../../utils/heading/heading.js";const containsShortcode=(tag,content)=>"p"===tag&&"["===content.charAt(0)&&"]"===content.charAt(content.length-1),addDataAttr=(dataAttr=!0,tag="")=>isArrayStrict(dataAttr)?dataAttr.includes(tag):dataAttr,getContent=args=>{const{content:content=[],props:props,dataAttr:dataAttr=!1}=args;let{_output:_output=""}=args;for(const item of content){const newItem=applyFilters("richTextContentItem",item,props),itemObj=isObjectStrict(newItem)?newItem:{},{link:link,attr:attr,internalLink:internalLink,content:itemContent}=itemObj;let{tag:tag=""}=itemObj,newContent=itemContent;const isSingleTag="br"===tag||"hr"===tag;isArrayStrict(itemContent)&&(newContent=getContent({content:itemContent,props:props,dataAttr:dataAttr}));const attrs=[];if(addDataAttr(dataAttr,tag)&&attrs.push(`data-rich="${tag}"`),isStringStrict(attr)&&attrs.push(attr),isObjectStrict(attr)&&Object.entries(attr).forEach((([key,value])=>{attrs.push(`${key}="${value}"`)})),"a"===tag){let anchorLink=link;internalLink&&(anchorLink=getLink(internalLink)),isStringStrict(anchorLink)&&attrs.push(`href="${anchorLink}"`)}let outputStr="";if(isString(newContent)){const filteredContent=applyFilters("richTextContent",newContent,{args:newItem,props:props});isString(filteredContent)&&(newContent=filteredContent),outputStr+=newContent}containsShortcode(tag,outputStr)&&(tag="");let opening="",closing="",inner="";isStringStrict(tag)&&outputStr.trim()&&!isSingleTag&&(opening=`<${tag}${attrs.length>0?` ${attrs.join(" ")}`:""}>`,closing=`</${tag}>`,inner=outputStr,outputStr=`${opening}${outputStr}${closing}`),isSingleTag&&(outputStr=`<${tag}>`);outputStr=applyFilters("richTextContentOutput",outputStr,{args:newItem,props:props,element:{opening:opening,closing:closing,content:inner}}),_output+=outputStr}return _output},getPlainText=(args,_output="")=>{if(isString(args))return args;const content=isObjectStrict(args)?args.content:args;if(!isArrayStrict(content))return _output;for(const item of content){const{content:itemContent}=isObjectStrict(item)?item:{};isString(itemContent)&&(_output+=itemContent),isArrayStrict(itemContent)&&(_output=getPlainText({content:itemContent},_output))}return _output},RichText=props=>{if(!isObjectStrict(props))return"";if(props=applyFilters("richTextProps",props),!isObjectStrict(props))return"";const{args:args}=props;if(!isObjectStrict(args))return"";const{content:content=[],classes:classes,link:link,internalLink:internalLink,textStyle:textStyle,headingStyle:headingStyle,align:align,style:style,attr:attr,dataAttr:dataAttr=!0}=args;let{tag:tag=""}=args;if("hr"===tag||"br"===tag)return`<${tag}>`;const isSectionHeading=isHeading(tag),classesArr=[];isStringStrict(classes)&&classesArr.push(classes),isStringStrict(textStyle)&&classesArr.push(textStyle),isStringStrict(headingStyle)&&isSectionHeading&&classesArr.push(headingStyle),isStringStrict(align)&&classesArr.push(align);const filterProps={...props};filterProps.args.content=void 0;let headingObj,output="",headingStr="";isStringStrict(content)&&(output=content,headingStr=content),isArrayStrict(content)&&(headingObj=content,output=getContent({content:content,props:filterProps,dataAttr:dataAttr}));const attrs=[];if(addDataAttr(dataAttr,tag)&&attrs.push(`data-rich="${tag}"`),isSectionHeading){const headingContents=getExcerpt({limit:10,limitExcerpt:!0,excerpt:headingStr,content:headingObj}),id=headingContents.trim().replace(/&hellip;/g,"").replace(/[^\w\s]|_/g,"").replace(/\s+/g,"-").toLowerCase();headingContents&&id&&(attrs.push(`id="${id}"`),isArray(props.headings)&&props.headings.push({id:id,title:headingContents,type:tag}))}if("a"===tag){let anchorLink=link;const inLink=getLink(internalLink);isStringStrict(inLink)&&(anchorLink=inLink),isStringStrict(anchorLink)&&attrs.push(`href="${anchorLink}"`)}classesArr.length>0&&attrs.push(`class="${classesArr.join(" ")}"`),isStringStrict(style)&&attrs.push(`style="${style}"`),isStringStrict(attr)&&attrs.push(attr),isObjectStrict(attr)&&Object.entries(attr).forEach((([key,value])=>{attrs.push(`${key}="${value}"`)})),containsShortcode(tag,output)&&(tag="");let opening="",closing="",inner="";isStringStrict(tag)&&output.trim()&&(opening=`<${tag}${attrs.length>0?` ${attrs.join(" ")}`:""}>`,closing=`</${tag}>`,inner=output,output=`${opening}${output}${closing}`);return output=applyFilters("richTextOutput",output,{props:filterProps,element:{opening:opening,closing:closing,content:inner}}),output};export{RichText,getPlainText};
@@ -0,0 +1,54 @@
1
+ import type { InternalLink, Generic, GenericStrings } from '../../global/globalTypes.js';
2
+ import type { RenderRichText, RenderFunctionArgs, RenderItem } from '../../render/renderTypes.js';
3
+ export interface RichTextHeading {
4
+ title: string;
5
+ id: string;
6
+ type: string;
7
+ }
8
+ export interface RichTextElement {
9
+ opening: string;
10
+ content: string;
11
+ closing: string;
12
+ }
13
+ export interface RichTextArgs extends Generic {
14
+ tag?: string;
15
+ content?: RenderRichText[] | string;
16
+ classes?: string;
17
+ textStyle?: string;
18
+ headingStyle?: string;
19
+ caption?: RenderRichText[] | string;
20
+ align?: string;
21
+ link?: string;
22
+ internalLink?: InternalLink;
23
+ style?: string;
24
+ attr?: string | GenericStrings;
25
+ dataAttr?: boolean | string[];
26
+ }
27
+ export interface RichTextContent extends Generic {
28
+ content?: RenderRichText[] | string;
29
+ }
30
+ export interface RichTextProps<T = RichTextArgs, R = RenderItem> extends RenderFunctionArgs<T, R> {
31
+ args: RichTextArgs & T;
32
+ }
33
+ export interface RichTextContentProps {
34
+ content: RenderRichText[];
35
+ props: RichTextProps;
36
+ dataAttr: boolean | string[];
37
+ _output?: string;
38
+ }
39
+ export interface RichTextContentFilterArgs {
40
+ args: RenderRichText;
41
+ props: RichTextProps;
42
+ }
43
+ export interface RichTextContentOutputFilterArgs extends RichTextContentFilterArgs {
44
+ element: RichTextElement;
45
+ }
46
+ export interface RichTextOutputFilterArgs {
47
+ props: RichTextProps;
48
+ element: RichTextElement;
49
+ }
50
+ export type RichTextPropsFilter = (props: RichTextProps) => RichTextProps;
51
+ export type RichTextOutputFilter = (output: string, args: RichTextContentOutputFilterArgs) => string;
52
+ export type RichTextContentItemFilter = (item: RenderRichText, args: RichTextProps) => RenderRichText;
53
+ export type RichTextContentFilter = (content: string, args: RichTextContentFilterArgs) => string;
54
+ export type RichTextContentOutputFilter = (content: string, args: RichTextContentOutputFilterArgs) => string;
@@ -0,0 +1 @@
1
+ export{};
@@ -0,0 +1,5 @@
1
+ declare class ResponseError extends Error {
2
+ response: Response | undefined;
3
+ constructor(message: string, res?: Response);
4
+ }
5
+ export { ResponseError };
@@ -0,0 +1 @@
1
+ class ResponseError extends Error{response;constructor(message,res){super(message),this.message=message,res instanceof Response&&(this.response=res)}}export{ResponseError};
@@ -0,0 +1,8 @@
1
+ import type { Actions, ActionMap, ActionReturnType } from './actionTypes.js';
2
+ declare let actions: ActionMap;
3
+ declare const addAction: <T extends keyof Actions>(name: T, action: Actions[T]) => boolean;
4
+ declare const removeAction: <T extends keyof Actions>(name: T, action: Actions[T]) => boolean;
5
+ declare const doActions: <V extends boolean = false>(name: string, args?: unknown, isAsync?: V) => ActionReturnType<V>;
6
+ declare const resetActions: () => void;
7
+ declare const setActions: (args: Partial<Actions>) => boolean;
8
+ export { actions, addAction, removeAction, doActions, resetActions, setActions };
@@ -0,0 +1 @@
1
+ import{isSet,isSetStrict}from"../set/set.js";import{isStringStrict}from"../string/string.js";import{isObjectStrict}from"../object/object.js";import{isFunction}from"../function/function.js";let actions=new Map([["renderStart",new Set],["renderEnd",new Set],["renderItemStart",new Set],["renderItemEnd",new Set]]);const addAction=(name,action)=>!(!isStringStrict(name)||!isFunction(action))&&(isSet(actions.get(name))||actions.set(name,new Set),actions.get(name)?.add(action),!0),removeAction=(name,action)=>{if(!isStringStrict(name)||!isFunction(action))return!1;const actionSet=actions.get(name);return!!isSet(actionSet)&&actionSet.delete(action)},doSequentially=async(callbacks,args)=>{for(const callback of callbacks)await callback(args)},doActions=(name,args,isAsync=!1)=>{const actionSet=actions.get(name);if(!isSetStrict(actionSet))return;const callbacks=[];for(const callback of actionSet.values())isAsync?callbacks.push(callback):callback(args);isAsync&&doSequentially(callbacks,args).then((result=>result)).catch((()=>!1))},resetActions=()=>{actions=new Map([["renderStart",new Set],["renderEnd",new Set],["renderItemStart",new Set],["renderItemEnd",new Set]])},setActions=args=>{if(!isObjectStrict(args))return!1;const newActions=Object.entries(args);return!!newActions.length&&(resetActions(),newActions.forEach((([name,action])=>{action&&addAction(name,action)})),!0)};export{actions,addAction,removeAction,doActions,resetActions,setActions};
@@ -0,0 +1,10 @@
1
+ import type { GenericFunction } from '../../global/globalTypes.js';
2
+ import type { RenderStartAction, RenderEndAction, RenderItemStartAction, RenderItemEndAction } from '../../render/renderTypes.js';
3
+ export interface Actions extends Record<string, GenericFunction> {
4
+ renderStart: RenderStartAction;
5
+ renderEnd: RenderEndAction;
6
+ renderItemStart: RenderItemStartAction;
7
+ renderItemEnd: RenderItemEndAction;
8
+ }
9
+ export type ActionMap = Map<string, Set<GenericFunction>> & Map<'renderStart' | 'renderEnd' | 'renderItemStart' | 'renderItemEnd', Set<RenderStartAction | RenderEndAction | RenderItemStartAction | RenderItemEndAction>>;
10
+ export type ActionReturnType<V extends false | true> = V extends true ? Promise<void> : undefined;
@@ -0,0 +1 @@
1
+ export{};
@@ -0,0 +1,7 @@
1
+ import type { ArchiveInfo, ArchiveTaxonomy, ArchiveLink, ArchiveLabels } from './archiveTypes.js';
2
+ import type { RenderItem } from '../../render/renderTypes.js';
3
+ declare const getArchiveInfo: (contentType: string) => ArchiveInfo;
4
+ declare const getTaxonomyInfo: (contentType: string, pageData?: RenderItem) => ArchiveTaxonomy;
5
+ declare const getArchiveLink: (contentType: string, pageData?: RenderItem) => ArchiveLink;
6
+ declare const getArchiveLabels: (contentType: string, pageData?: RenderItem) => ArchiveLabels;
7
+ export { getArchiveInfo, getTaxonomyInfo, getArchiveLink, getArchiveLabels };
@@ -0,0 +1 @@
1
+ import{getStoreItem}from"../../store/store.js";import{isObjectStrict}from"../object/object.js";import{isArrayStrict}from"../array/array.js";import{isStringStrict}from"../string/string.js";import{isBoolean}from"../boolean/boolean.js";import{normalizeContentType}from"../contentType/contentType.js";import{getSlug,getPermalink}from"../link/link.js";const getArchiveInfo=contentType=>{const value={id:"",slug:"",title:"",contentType:""};if("page"===(contentType=normalizeContentType(contentType)))return value;const info=getStoreItem("archiveMeta")[contentType];if(!isObjectStrict(info))return value;const{id:id,slug:slug,title:title,contentType:type}=info;return value.id=isStringStrict(id)?id:"",value.slug=isStringStrict(slug)?slug:"",value.title=isStringStrict(title)?title:"",value.contentType=isStringStrict(type)?type:"",value},getTaxonomyInfo=(contentType,pageData)=>{const value={id:"",slug:"",title:"",contentTypes:[],primaryContentType:"",usePrimaryContentTypeSlug:!0,isPage:!1},taxObj="taxonomy"===contentType?pageData:pageData?.taxonomy;if(!isObjectStrict(taxObj))return value;const{id:id,slug:slug,link:link,title:title,contentTypes:contentTypes,usePrimaryContentTypeSlug:usePrimaryContentTypeSlug,isPage:isPage}=taxObj,taxonomyTypes=isArrayStrict(contentTypes)?contentTypes.map((type=>normalizeContentType(type))):[],primaryTaxonomyType=taxonomyTypes[0];return value.id=isStringStrict(id)?id:"",value.slug=isStringStrict(slug)?slug:"",value.title=isStringStrict(title)?title:"",value.contentTypes=taxonomyTypes,value.primaryContentType=isStringStrict(primaryTaxonomyType)?primaryTaxonomyType:"",value.usePrimaryContentTypeSlug=!isBoolean(usePrimaryContentTypeSlug)||usePrimaryContentTypeSlug,value.isPage=!!isBoolean(isPage)&&isPage,isStringStrict(link)&&(value.link=link),value},getArchiveLink=(contentType,pageData)=>{let slug,title="";const taxonomyInfo=getTaxonomyInfo(contentType,pageData),{title:taxonomyTitle,isPage:taxonomyIsPage,contentTypes:taxonomyTypes,usePrimaryContentTypeSlug:taxonomyUseTypeSlug}=taxonomyInfo;"term"===contentType&&taxonomyIsPage&&(slug=getSlug({slug:"",contentType:contentType,pageData:pageData}),title=taxonomyTitle);const taxonomyType=taxonomyTypes[0],useArchiveType=taxonomyUseTypeSlug&&isStringStrict(taxonomyType);"taxonomy"===contentType&&useArchiveType&&(contentType=taxonomyType),"term"===contentType&&!taxonomyIsPage&&useArchiveType&&(contentType=taxonomyType);const archiveInfo=getArchiveInfo(contentType),{id:archiveId,slug:archiveSlug,title:archiveTitle,contentType:archiveType}=archiveInfo;if(archiveSlug&&archiveId){slug=getSlug({id:archiveId,slug:archiveSlug,contentType:archiveType});const plural=getStoreItem("archiveMeta")[contentType]?.plural;title=isStringStrict(plural)?plural:archiveTitle}return{title:title,link:isStringStrict(slug)?getPermalink(slug):""}},getArchiveLabels=(contentType,pageData)=>{let singular="Post",plural="Posts";const taxonomyInfo=getTaxonomyInfo(contentType,pageData),{title:taxonomyTitle,isPage:taxonomyIsPage,primaryContentType:taxonomyType,usePrimaryContentTypeSlug:taxonomyUseTypeSlug}=taxonomyInfo;if("term"===contentType&&taxonomyIsPage&&isStringStrict(taxonomyTitle))return{singular:taxonomyTitle,plural:taxonomyTitle};const useArchiveType=taxonomyUseTypeSlug&&isStringStrict(taxonomyType);if("taxonomy"===contentType&&useArchiveType&&(contentType=taxonomyType),"term"===contentType&&!taxonomyIsPage&&useArchiveType&&(contentType=taxonomyType),isStringStrict(contentType)){contentType=normalizeContentType(contentType);const archiveType=getStoreItem("archiveMeta")[contentType],s=archiveType?.singular,p=archiveType?.plural;singular=isStringStrict(s)?s:"Post",plural=isStringStrict(p)?p:"Posts"}return{singular:singular,plural:plural}};export{getArchiveInfo,getTaxonomyInfo,getArchiveLink,getArchiveLabels};
@@ -0,0 +1,18 @@
1
+ import type { Taxonomy } from '../../global/globalTypes.js';
2
+ export interface ArchiveInfo {
3
+ id: string;
4
+ slug: string;
5
+ title: string;
6
+ contentType: string;
7
+ }
8
+ export interface ArchiveTaxonomy extends Omit<Required<Taxonomy>, 'link'>, Pick<Taxonomy, 'link'> {
9
+ primaryContentType: string;
10
+ }
11
+ export interface ArchiveLink {
12
+ title: string;
13
+ link: string;
14
+ }
15
+ export interface ArchiveLabels {
16
+ singular: string;
17
+ plural: string;
18
+ }
@@ -0,0 +1 @@
1
+ export{};
@@ -0,0 +1,3 @@
1
+ declare const isArray: (value: unknown) => value is unknown[];
2
+ declare const isArrayStrict: (value: unknown) => value is unknown[];
3
+ export { isArray, isArrayStrict };
@@ -0,0 +1 @@
1
+ const isArray=value=>Array.isArray(value),isArrayStrict=value=>isArray(value)&&value.length>0;export{isArray,isArrayStrict};
@@ -0,0 +1,2 @@
1
+ declare const isBoolean: (value: unknown) => value is boolean;
2
+ export { isBoolean };