@enonic/nextjs-adapter 3.2.2 → 3.3.0-B2

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 (410) hide show
  1. package/{baseMappings.js → dist/baseMappings.js} +9 -9
  2. package/dist/baseMappings.js.map +1 -0
  3. package/dist/client/getClientHydratedHtml.jsx.map +1 -0
  4. package/dist/client.js.map +1 -0
  5. package/{common → dist/common}/ComponentRegistry.js +1 -1
  6. package/dist/common/ComponentRegistry.js.map +1 -0
  7. package/dist/common/UrlProcessor.js.map +1 -0
  8. package/dist/common/constants.js.map +1 -0
  9. package/{common → dist/common}/env.js +1 -1
  10. package/dist/common/env.js.map +1 -0
  11. package/dist/guillotine/applyProcessors.js.map +1 -0
  12. package/dist/guillotine/buildComponentTree.js.map +1 -0
  13. package/{guillotine → dist/guillotine}/buildErrorResponse.js +3 -3
  14. package/dist/guillotine/buildErrorResponse.js.map +1 -0
  15. package/{guillotine → dist/guillotine}/buildPage.js +1 -1
  16. package/dist/guillotine/buildPage.js.map +1 -0
  17. package/{guillotine → dist/guillotine}/collectComponentDescriptors.d.ts +1 -1
  18. package/{guillotine → dist/guillotine}/collectComponentDescriptors.js +4 -4
  19. package/dist/guillotine/collectComponentDescriptors.js.map +1 -0
  20. package/{guillotine → dist/guillotine}/combineMultipleQueries.js +1 -1
  21. package/dist/guillotine/combineMultipleQueries.js.map +1 -0
  22. package/{guillotine → dist/guillotine}/createMetaData.d.ts +1 -1
  23. package/{guillotine → dist/guillotine}/createMetaData.js +2 -2
  24. package/dist/guillotine/createMetaData.js.map +1 -0
  25. package/{guillotine → dist/guillotine}/fetchContent.js +10 -10
  26. package/dist/guillotine/fetchContent.js.map +1 -0
  27. package/{guillotine → dist/guillotine}/fetchContentData.js +2 -2
  28. package/dist/guillotine/fetchContentData.js.map +1 -0
  29. package/dist/guillotine/fetchContentPathsForAllLocales.js.map +1 -0
  30. package/{guillotine → dist/guillotine}/fetchContentPathsForLocale.js +4 -4
  31. package/dist/guillotine/fetchContentPathsForLocale.js.map +1 -0
  32. package/{guillotine → dist/guillotine}/fetchFromApi.js +7 -7
  33. package/dist/guillotine/fetchFromApi.js.map +1 -0
  34. package/{guillotine → dist/guillotine}/fetchGuillotine.js +6 -6
  35. package/dist/guillotine/fetchGuillotine.js.map +1 -0
  36. package/{guillotine → dist/guillotine}/fetchMetaData.js +4 -4
  37. package/dist/guillotine/fetchMetaData.js.map +1 -0
  38. package/{guillotine → dist/guillotine}/getCleanContentPathArrayOrThrow400.js +1 -1
  39. package/dist/guillotine/getCleanContentPathArrayOrThrow400.js.map +1 -0
  40. package/dist/guillotine/getComponentConfig.js.map +1 -0
  41. package/dist/guillotine/getContentAndComponentPaths.js.map +1 -0
  42. package/dist/guillotine/getMetaData.js.map +1 -0
  43. package/{guillotine → dist/guillotine}/getParentRegion.js +1 -1
  44. package/dist/guillotine/getParentRegion.js.map +1 -0
  45. package/{guillotine → dist/guillotine}/getQueryAndVariables.js +2 -2
  46. package/dist/guillotine/getQueryAndVariables.js.map +1 -0
  47. package/dist/guillotine/metadata/configQuery.js.map +1 -0
  48. package/dist/guillotine/metadata/richTextQuery.js.map +1 -0
  49. package/{guillotine → dist/guillotine}/parseComponentPath.js +3 -3
  50. package/dist/guillotine/parseComponentPath.js.map +1 -0
  51. package/dist/guillotine/prefixFragmentCmpPath.js.map +1 -0
  52. package/dist/guillotine/processComponentConfig.js.map +1 -0
  53. package/dist/guillotine/restrictComponentsToPath.js.map +1 -0
  54. package/dist/guillotine/validateData.js.map +1 -0
  55. package/dist/guillotine/validateNotFound.js.map +1 -0
  56. package/dist/guillotine/validateShortcut.js.map +1 -0
  57. package/{i18n → dist/i18n}/LocaleContext.d.ts +1 -1
  58. package/{i18n → dist/i18n}/LocaleContext.jsx +3 -3
  59. package/dist/i18n/LocaleContext.jsx.map +1 -0
  60. package/dist/i18n/i18n.js.map +1 -0
  61. package/{index.d.ts → dist/index.d.ts} +3 -3
  62. package/{index.js → dist/index.js} +3 -3
  63. package/dist/index.js.map +1 -0
  64. package/dist/query/Shortcut.js.map +1 -0
  65. package/dist/server/getServerRenderedHtml.js.map +1 -0
  66. package/dist/server.js.map +1 -0
  67. package/{types → dist/types}/component.js.map +1 -1
  68. package/{types → dist/types}/componentProps.d.ts +2 -1
  69. package/dist/types/componentProps.js.map +1 -0
  70. package/{types → dist/types}/guillotine.d.ts +1 -1
  71. package/{types → dist/types}/guillotine.js.map +1 -1
  72. package/dist/types/i18n.js.map +1 -0
  73. package/dist/types/index.js.map +1 -0
  74. package/dist/types/next.js.map +1 -0
  75. package/dist/types/util.js.map +1 -0
  76. package/dist/utils/addLineNumbers.js.map +1 -0
  77. package/{utils → dist/utils}/buildGuillotineRequestHeaders.d.ts +1 -1
  78. package/{utils → dist/utils}/buildGuillotineRequestHeaders.js +3 -3
  79. package/dist/utils/buildGuillotineRequestHeaders.js.map +1 -0
  80. package/dist/utils/commonChars.js.map +1 -0
  81. package/dist/utils/enonicLog.js.map +1 -0
  82. package/dist/utils/fixDoubleSlashes.js.map +1 -0
  83. package/dist/utils/getAllLocales.js.map +1 -0
  84. package/dist/utils/getContentApiUrl.js.map +1 -0
  85. package/dist/utils/getLocaleMapping.js.map +1 -0
  86. package/dist/utils/getLocaleMappingByLocale.js.map +1 -0
  87. package/dist/utils/getLocaleMappingByProjectId.js.map +1 -0
  88. package/{utils → dist/utils}/getLocaleMappings.js +1 -1
  89. package/dist/utils/getLocaleMappings.js.map +1 -0
  90. package/{utils → dist/utils}/getRenderMode.js +1 -1
  91. package/dist/utils/getRenderMode.js.map +1 -0
  92. package/dist/utils/getRequestLocaleInfo.js.map +1 -0
  93. package/dist/utils/getXpBaseUrl.js.map +1 -0
  94. package/dist/utils/indent.js.map +1 -0
  95. package/dist/utils/sanitizeGraphqlName.js.map +1 -0
  96. package/{views → dist/views}/BaseComponent.d.ts +1 -1
  97. package/{views → dist/views}/BaseComponent.jsx +5 -5
  98. package/dist/views/BaseComponent.jsx.map +1 -0
  99. package/{views → dist/views}/BaseContent.jsx +1 -1
  100. package/dist/views/BaseContent.jsx.map +1 -0
  101. package/dist/views/BaseLayout.jsx.map +1 -0
  102. package/dist/views/BaseMacro.jsx.map +1 -0
  103. package/dist/views/BasePage.jsx.map +1 -0
  104. package/dist/views/BasePart.jsx.map +1 -0
  105. package/dist/views/Empty.jsx.map +1 -0
  106. package/dist/views/Fragment.jsx.map +1 -0
  107. package/dist/views/MainView.jsx.map +1 -0
  108. package/{views → dist/views}/PropsView.jsx +1 -1
  109. package/dist/views/PropsView.jsx.map +1 -0
  110. package/dist/views/Region.jsx.map +1 -0
  111. package/dist/views/RichTextView.jsx +65 -0
  112. package/dist/views/RichTextView.jsx.map +1 -0
  113. package/dist/views/SingleComponent.jsx.map +1 -0
  114. package/dist/views/StaticContent.jsx.map +1 -0
  115. package/dist/views/Text.jsx.map +1 -0
  116. package/dist/views/macros/DefaultMacro.jsx.map +1 -0
  117. package/dist/views/macros/DisableMacro.jsx.map +1 -0
  118. package/package.json +49 -42
  119. package/baseMappings.js.map +0 -1
  120. package/client/getClientHydratedHtml.jsx.map +0 -1
  121. package/client.js.map +0 -1
  122. package/common/ComponentRegistry.js.map +0 -1
  123. package/common/UrlProcessor.js.map +0 -1
  124. package/common/constants.js.map +0 -1
  125. package/common/env.js.map +0 -1
  126. package/guillotine/applyProcessors.js.map +0 -1
  127. package/guillotine/buildComponentTree.js.map +0 -1
  128. package/guillotine/buildErrorResponse.js.map +0 -1
  129. package/guillotine/buildPage.js.map +0 -1
  130. package/guillotine/collectComponentDescriptors.js.map +0 -1
  131. package/guillotine/combineMultipleQueries.js.map +0 -1
  132. package/guillotine/createMetaData.js.map +0 -1
  133. package/guillotine/fetchContent.js.map +0 -1
  134. package/guillotine/fetchContentData.js.map +0 -1
  135. package/guillotine/fetchContentPathsForAllLocales.js.map +0 -1
  136. package/guillotine/fetchContentPathsForLocale.js.map +0 -1
  137. package/guillotine/fetchFromApi.js.map +0 -1
  138. package/guillotine/fetchGuillotine.js.map +0 -1
  139. package/guillotine/fetchMetaData.js.map +0 -1
  140. package/guillotine/getCleanContentPathArrayOrThrow400.js.map +0 -1
  141. package/guillotine/getComponentConfig.js.map +0 -1
  142. package/guillotine/getContentAndComponentPaths.js.map +0 -1
  143. package/guillotine/getMetaData.js.map +0 -1
  144. package/guillotine/getParentRegion.js.map +0 -1
  145. package/guillotine/getQueryAndVariables.js.map +0 -1
  146. package/guillotine/metadata/configQuery.js.map +0 -1
  147. package/guillotine/metadata/richTextQuery.js.map +0 -1
  148. package/guillotine/parseComponentPath.js.map +0 -1
  149. package/guillotine/prefixFragmentCmpPath.js.map +0 -1
  150. package/guillotine/processComponentConfig.js.map +0 -1
  151. package/guillotine/restrictComponentsToPath.js.map +0 -1
  152. package/guillotine/validateData.js.map +0 -1
  153. package/guillotine/validateNotFound.js.map +0 -1
  154. package/guillotine/validateShortcut.js.map +0 -1
  155. package/i18n/LocaleContext.jsx.map +0 -1
  156. package/i18n/i18n.js.map +0 -1
  157. package/index.js.map +0 -1
  158. package/query/Shortcut.js.map +0 -1
  159. package/server/getServerRenderedHtml.js.map +0 -1
  160. package/server.js.map +0 -1
  161. package/src/baseMappings.ts +0 -53
  162. package/src/client/getClientHydratedHtml.tsx +0 -12
  163. package/src/client.ts +0 -2
  164. package/src/common/ComponentRegistry.ts +0 -162
  165. package/src/common/UrlProcessor.ts +0 -172
  166. package/src/common/constants.ts +0 -92
  167. package/src/common/env.ts +0 -41
  168. package/src/guillotine/applyProcessors.ts +0 -38
  169. package/src/guillotine/buildComponentTree.ts +0 -57
  170. package/src/guillotine/buildErrorResponse.ts +0 -35
  171. package/src/guillotine/buildPage.ts +0 -15
  172. package/src/guillotine/collectComponentDescriptors.ts +0 -63
  173. package/src/guillotine/combineMultipleQueries.ts +0 -75
  174. package/src/guillotine/createMetaData.ts +0 -72
  175. package/src/guillotine/fetchContent.ts +0 -246
  176. package/src/guillotine/fetchContentData.ts +0 -37
  177. package/src/guillotine/fetchContentPathsForAllLocales.ts +0 -21
  178. package/src/guillotine/fetchContentPathsForLocale.ts +0 -43
  179. package/src/guillotine/fetchFromApi.ts +0 -76
  180. package/src/guillotine/fetchGuillotine.ts +0 -76
  181. package/src/guillotine/fetchMetaData.ts +0 -31
  182. package/src/guillotine/getCleanContentPathArrayOrThrow400.ts +0 -22
  183. package/src/guillotine/getComponentConfig.ts +0 -7
  184. package/src/guillotine/getContentAndComponentPaths.ts +0 -11
  185. package/src/guillotine/getMetaData.ts +0 -74
  186. package/src/guillotine/getParentRegion.ts +0 -54
  187. package/src/guillotine/getQueryAndVariables.ts +0 -52
  188. package/src/guillotine/metadata/configQuery.ts +0 -46
  189. package/src/guillotine/metadata/richTextQuery.ts +0 -49
  190. package/src/guillotine/parseComponentPath.ts +0 -29
  191. package/src/guillotine/prefixFragmentCmpPath.ts +0 -13
  192. package/src/guillotine/processComponentConfig.ts +0 -38
  193. package/src/guillotine/restrictComponentsToPath.ts +0 -48
  194. package/src/guillotine/validateData.ts +0 -11
  195. package/src/guillotine/validateNotFound.ts +0 -20
  196. package/src/guillotine/validateShortcut.ts +0 -43
  197. package/src/i18n/LocaleContext.tsx +0 -59
  198. package/src/i18n/i18n.ts +0 -57
  199. package/src/index.ts +0 -42
  200. package/src/query/Shortcut.ts +0 -18
  201. package/src/server/getServerRenderedHtml.ts +0 -3
  202. package/src/server.ts +0 -5
  203. package/src/types/component.ts +0 -131
  204. package/src/types/componentProps.ts +0 -142
  205. package/src/types/guillotine.ts +0 -428
  206. package/src/types/i18n.ts +0 -8
  207. package/src/types/index.ts +0 -62
  208. package/src/types/next.ts +0 -7
  209. package/src/types/util.ts +0 -5
  210. package/src/utils/addLineNumbers.ts +0 -3
  211. package/src/utils/buildGuillotineRequestHeaders.ts +0 -32
  212. package/src/utils/commonChars.ts +0 -16
  213. package/src/utils/enonicLog.ts +0 -28
  214. package/src/utils/fixDoubleSlashes.ts +0 -3
  215. package/src/utils/getAllLocales.ts +0 -6
  216. package/src/utils/getContentApiUrl.ts +0 -20
  217. package/src/utils/getLocaleMapping.ts +0 -24
  218. package/src/utils/getLocaleMappingByLocale.ts +0 -19
  219. package/src/utils/getLocaleMappingByProjectId.ts +0 -21
  220. package/src/utils/getLocaleMappings.ts +0 -36
  221. package/src/utils/getRenderMode.ts +0 -14
  222. package/src/utils/getRequestLocaleInfo.ts +0 -30
  223. package/src/utils/getXpBaseUrl.ts +0 -12
  224. package/src/utils/indent.ts +0 -4
  225. package/src/utils/sanitizeGraphqlName.ts +0 -11
  226. package/src/views/BaseComponent.tsx +0 -156
  227. package/src/views/BaseContent.tsx +0 -47
  228. package/src/views/BaseLayout.tsx +0 -33
  229. package/src/views/BaseMacro.tsx +0 -105
  230. package/src/views/BasePage.tsx +0 -42
  231. package/src/views/BasePart.tsx +0 -34
  232. package/src/views/Empty.tsx +0 -5
  233. package/src/views/Fragment.tsx +0 -41
  234. package/src/views/MainView.tsx +0 -22
  235. package/src/views/PropsView.tsx +0 -38
  236. package/src/views/Region.tsx +0 -76
  237. package/src/views/RichTextView.tsx +0 -63
  238. package/src/views/SingleComponent.tsx +0 -19
  239. package/src/views/StaticContent.tsx +0 -39
  240. package/src/views/Text.tsx +0 -19
  241. package/src/views/macros/DefaultMacro.tsx +0 -9
  242. package/src/views/macros/DisableMacro.tsx +0 -8
  243. package/types/componentProps.js.map +0 -1
  244. package/types/i18n.js.map +0 -1
  245. package/types/index.js.map +0 -1
  246. package/types/next.js.map +0 -1
  247. package/types/util.js.map +0 -1
  248. package/utils/addLineNumbers.js.map +0 -1
  249. package/utils/buildGuillotineRequestHeaders.js.map +0 -1
  250. package/utils/commonChars.js.map +0 -1
  251. package/utils/enonicLog.js.map +0 -1
  252. package/utils/fixDoubleSlashes.js.map +0 -1
  253. package/utils/getAllLocales.js.map +0 -1
  254. package/utils/getContentApiUrl.js.map +0 -1
  255. package/utils/getLocaleMapping.js.map +0 -1
  256. package/utils/getLocaleMappingByLocale.js.map +0 -1
  257. package/utils/getLocaleMappingByProjectId.js.map +0 -1
  258. package/utils/getLocaleMappings.js.map +0 -1
  259. package/utils/getRenderMode.js.map +0 -1
  260. package/utils/getRequestLocaleInfo.js.map +0 -1
  261. package/utils/getXpBaseUrl.js.map +0 -1
  262. package/utils/indent.js.map +0 -1
  263. package/utils/sanitizeGraphqlName.js.map +0 -1
  264. package/views/BaseComponent.jsx.map +0 -1
  265. package/views/BaseContent.jsx.map +0 -1
  266. package/views/BaseLayout.jsx.map +0 -1
  267. package/views/BaseMacro.jsx.map +0 -1
  268. package/views/BasePage.jsx.map +0 -1
  269. package/views/BasePart.jsx.map +0 -1
  270. package/views/Empty.jsx.map +0 -1
  271. package/views/Fragment.jsx.map +0 -1
  272. package/views/MainView.jsx.map +0 -1
  273. package/views/PropsView.jsx.map +0 -1
  274. package/views/Region.jsx.map +0 -1
  275. package/views/RichTextView.jsx +0 -39
  276. package/views/RichTextView.jsx.map +0 -1
  277. package/views/SingleComponent.jsx.map +0 -1
  278. package/views/StaticContent.jsx.map +0 -1
  279. package/views/Text.jsx.map +0 -1
  280. package/views/macros/DefaultMacro.jsx.map +0 -1
  281. package/views/macros/DisableMacro.jsx.map +0 -1
  282. /package/{baseMappings.d.ts → dist/baseMappings.d.ts} +0 -0
  283. /package/{client → dist/client}/getClientHydratedHtml.d.ts +0 -0
  284. /package/{client → dist/client}/getClientHydratedHtml.jsx +0 -0
  285. /package/{client.d.ts → dist/client.d.ts} +0 -0
  286. /package/{client.js → dist/client.js} +0 -0
  287. /package/{common → dist/common}/ComponentRegistry.d.ts +0 -0
  288. /package/{common → dist/common}/UrlProcessor.d.ts +0 -0
  289. /package/{common → dist/common}/UrlProcessor.js +0 -0
  290. /package/{common → dist/common}/constants.d.ts +0 -0
  291. /package/{common → dist/common}/constants.js +0 -0
  292. /package/{common → dist/common}/env.d.ts +0 -0
  293. /package/{guillotine → dist/guillotine}/applyProcessors.d.ts +0 -0
  294. /package/{guillotine → dist/guillotine}/applyProcessors.js +0 -0
  295. /package/{guillotine → dist/guillotine}/buildComponentTree.d.ts +0 -0
  296. /package/{guillotine → dist/guillotine}/buildComponentTree.js +0 -0
  297. /package/{guillotine → dist/guillotine}/buildErrorResponse.d.ts +0 -0
  298. /package/{guillotine → dist/guillotine}/buildPage.d.ts +0 -0
  299. /package/{guillotine → dist/guillotine}/combineMultipleQueries.d.ts +0 -0
  300. /package/{guillotine → dist/guillotine}/fetchContent.d.ts +0 -0
  301. /package/{guillotine → dist/guillotine}/fetchContentData.d.ts +0 -0
  302. /package/{guillotine → dist/guillotine}/fetchContentPathsForAllLocales.d.ts +0 -0
  303. /package/{guillotine → dist/guillotine}/fetchContentPathsForAllLocales.js +0 -0
  304. /package/{guillotine → dist/guillotine}/fetchContentPathsForLocale.d.ts +0 -0
  305. /package/{guillotine → dist/guillotine}/fetchFromApi.d.ts +0 -0
  306. /package/{guillotine → dist/guillotine}/fetchGuillotine.d.ts +0 -0
  307. /package/{guillotine → dist/guillotine}/fetchMetaData.d.ts +0 -0
  308. /package/{guillotine → dist/guillotine}/getCleanContentPathArrayOrThrow400.d.ts +0 -0
  309. /package/{guillotine → dist/guillotine}/getComponentConfig.d.ts +0 -0
  310. /package/{guillotine → dist/guillotine}/getComponentConfig.js +0 -0
  311. /package/{guillotine → dist/guillotine}/getContentAndComponentPaths.d.ts +0 -0
  312. /package/{guillotine → dist/guillotine}/getContentAndComponentPaths.js +0 -0
  313. /package/{guillotine → dist/guillotine}/getMetaData.d.ts +0 -0
  314. /package/{guillotine → dist/guillotine}/getMetaData.js +0 -0
  315. /package/{guillotine → dist/guillotine}/getParentRegion.d.ts +0 -0
  316. /package/{guillotine → dist/guillotine}/getQueryAndVariables.d.ts +0 -0
  317. /package/{guillotine → dist/guillotine}/metadata/configQuery.d.ts +0 -0
  318. /package/{guillotine → dist/guillotine}/metadata/configQuery.js +0 -0
  319. /package/{guillotine → dist/guillotine}/metadata/richTextQuery.d.ts +0 -0
  320. /package/{guillotine → dist/guillotine}/metadata/richTextQuery.js +0 -0
  321. /package/{guillotine → dist/guillotine}/parseComponentPath.d.ts +0 -0
  322. /package/{guillotine → dist/guillotine}/prefixFragmentCmpPath.d.ts +0 -0
  323. /package/{guillotine → dist/guillotine}/prefixFragmentCmpPath.js +0 -0
  324. /package/{guillotine → dist/guillotine}/processComponentConfig.d.ts +0 -0
  325. /package/{guillotine → dist/guillotine}/processComponentConfig.js +0 -0
  326. /package/{guillotine → dist/guillotine}/restrictComponentsToPath.d.ts +0 -0
  327. /package/{guillotine → dist/guillotine}/restrictComponentsToPath.js +0 -0
  328. /package/{guillotine → dist/guillotine}/validateData.d.ts +0 -0
  329. /package/{guillotine → dist/guillotine}/validateData.js +0 -0
  330. /package/{guillotine → dist/guillotine}/validateNotFound.d.ts +0 -0
  331. /package/{guillotine → dist/guillotine}/validateNotFound.js +0 -0
  332. /package/{guillotine → dist/guillotine}/validateShortcut.d.ts +0 -0
  333. /package/{guillotine → dist/guillotine}/validateShortcut.js +0 -0
  334. /package/{i18n → dist/i18n}/i18n.d.ts +0 -0
  335. /package/{i18n → dist/i18n}/i18n.js +0 -0
  336. /package/{query → dist/query}/Shortcut.d.ts +0 -0
  337. /package/{query → dist/query}/Shortcut.js +0 -0
  338. /package/{server → dist/server}/getServerRenderedHtml.d.ts +0 -0
  339. /package/{server → dist/server}/getServerRenderedHtml.js +0 -0
  340. /package/{server.d.ts → dist/server.d.ts} +0 -0
  341. /package/{server.js → dist/server.js} +0 -0
  342. /package/{types → dist/types}/component.d.ts +0 -0
  343. /package/{types → dist/types}/component.js +0 -0
  344. /package/{types → dist/types}/componentProps.js +0 -0
  345. /package/{types → dist/types}/guillotine.js +0 -0
  346. /package/{types → dist/types}/i18n.d.ts +0 -0
  347. /package/{types → dist/types}/i18n.js +0 -0
  348. /package/{types → dist/types}/index.d.ts +0 -0
  349. /package/{types → dist/types}/index.js +0 -0
  350. /package/{types → dist/types}/next.d.ts +0 -0
  351. /package/{types → dist/types}/next.js +0 -0
  352. /package/{types → dist/types}/util.d.ts +0 -0
  353. /package/{types → dist/types}/util.js +0 -0
  354. /package/{utils → dist/utils}/addLineNumbers.d.ts +0 -0
  355. /package/{utils → dist/utils}/addLineNumbers.js +0 -0
  356. /package/{utils → dist/utils}/commonChars.d.ts +0 -0
  357. /package/{utils → dist/utils}/commonChars.js +0 -0
  358. /package/{utils → dist/utils}/enonicLog.d.ts +0 -0
  359. /package/{utils → dist/utils}/enonicLog.js +0 -0
  360. /package/{utils → dist/utils}/fixDoubleSlashes.d.ts +0 -0
  361. /package/{utils → dist/utils}/fixDoubleSlashes.js +0 -0
  362. /package/{utils → dist/utils}/getAllLocales.d.ts +0 -0
  363. /package/{utils → dist/utils}/getAllLocales.js +0 -0
  364. /package/{utils → dist/utils}/getContentApiUrl.d.ts +0 -0
  365. /package/{utils → dist/utils}/getContentApiUrl.js +0 -0
  366. /package/{utils → dist/utils}/getLocaleMapping.d.ts +0 -0
  367. /package/{utils → dist/utils}/getLocaleMapping.js +0 -0
  368. /package/{utils → dist/utils}/getLocaleMappingByLocale.d.ts +0 -0
  369. /package/{utils → dist/utils}/getLocaleMappingByLocale.js +0 -0
  370. /package/{utils → dist/utils}/getLocaleMappingByProjectId.d.ts +0 -0
  371. /package/{utils → dist/utils}/getLocaleMappingByProjectId.js +0 -0
  372. /package/{utils → dist/utils}/getLocaleMappings.d.ts +0 -0
  373. /package/{utils → dist/utils}/getRenderMode.d.ts +0 -0
  374. /package/{utils → dist/utils}/getRequestLocaleInfo.d.ts +0 -0
  375. /package/{utils → dist/utils}/getRequestLocaleInfo.js +0 -0
  376. /package/{utils → dist/utils}/getXpBaseUrl.d.ts +0 -0
  377. /package/{utils → dist/utils}/getXpBaseUrl.js +0 -0
  378. /package/{utils → dist/utils}/indent.d.ts +0 -0
  379. /package/{utils → dist/utils}/indent.js +0 -0
  380. /package/{utils → dist/utils}/sanitizeGraphqlName.d.ts +0 -0
  381. /package/{utils → dist/utils}/sanitizeGraphqlName.js +0 -0
  382. /package/{views → dist/views}/BaseContent.d.ts +0 -0
  383. /package/{views → dist/views}/BaseLayout.d.ts +0 -0
  384. /package/{views → dist/views}/BaseLayout.jsx +0 -0
  385. /package/{views → dist/views}/BaseMacro.d.ts +0 -0
  386. /package/{views → dist/views}/BaseMacro.jsx +0 -0
  387. /package/{views → dist/views}/BasePage.d.ts +0 -0
  388. /package/{views → dist/views}/BasePage.jsx +0 -0
  389. /package/{views → dist/views}/BasePart.d.ts +0 -0
  390. /package/{views → dist/views}/BasePart.jsx +0 -0
  391. /package/{views → dist/views}/Empty.d.ts +0 -0
  392. /package/{views → dist/views}/Empty.jsx +0 -0
  393. /package/{views → dist/views}/Fragment.d.ts +0 -0
  394. /package/{views → dist/views}/Fragment.jsx +0 -0
  395. /package/{views → dist/views}/MainView.d.ts +0 -0
  396. /package/{views → dist/views}/MainView.jsx +0 -0
  397. /package/{views → dist/views}/PropsView.d.ts +0 -0
  398. /package/{views → dist/views}/Region.d.ts +0 -0
  399. /package/{views → dist/views}/Region.jsx +0 -0
  400. /package/{views → dist/views}/RichTextView.d.ts +0 -0
  401. /package/{views → dist/views}/SingleComponent.d.ts +0 -0
  402. /package/{views → dist/views}/SingleComponent.jsx +0 -0
  403. /package/{views → dist/views}/StaticContent.d.ts +0 -0
  404. /package/{views → dist/views}/StaticContent.jsx +0 -0
  405. /package/{views → dist/views}/Text.d.ts +0 -0
  406. /package/{views → dist/views}/Text.jsx +0 -0
  407. /package/{views → dist/views}/macros/DefaultMacro.d.ts +0 -0
  408. /package/{views → dist/views}/macros/DefaultMacro.jsx +0 -0
  409. /package/{views → dist/views}/macros/DisableMacro.d.ts +0 -0
  410. /package/{views → dist/views}/macros/DisableMacro.jsx +0 -0
package/src/index.ts DELETED
@@ -1,42 +0,0 @@
1
- export {
2
- APP_NAME,
3
- APP_NAME_DASHED,
4
- APP_NAME_UNDERSCORED,
5
- IS_DEV_MODE,
6
- } from './common/env';
7
-
8
- export type * from './types';
9
-
10
- export {ComponentRegistry} from './common/ComponentRegistry';
11
-
12
- export {
13
- CATCH_ALL,
14
- JSESSIONID_HEADER,
15
- PORTAL_COMPONENT_ATTRIBUTE,
16
- PORTAL_REGION_ATTRIBUTE,
17
- PROJECT_ID_HEADER,
18
- RENDER_MODE,
19
- RENDER_MODE_HEADER,
20
- XP_BASE_URL_HEADER,
21
- XP_COMPONENT_TYPE,
22
- XP_REQUEST_TYPE,
23
- } from './common/constants';
24
-
25
-
26
- export {richTextQuery} from './guillotine/metadata/richTextQuery';
27
- export {validateData} from './guillotine/validateData';
28
-
29
- export {I18n} from './i18n/i18n';
30
-
31
- export {getContentApiUrl} from './utils/getContentApiUrl';
32
- export {getLocaleMapping} from './utils/getLocaleMapping';
33
- export {getLocaleMappingByProjectId} from './utils/getLocaleMappingByProjectId';
34
- export {getLocaleMappingByLocale} from './utils/getLocaleMappingByLocale';
35
- export {getRequestLocaleInfo} from './utils/getRequestLocaleInfo';
36
- export {sanitizeGraphqlName} from './utils/sanitizeGraphqlName';
37
-
38
- export {
39
- UrlProcessor,
40
- getAsset,
41
- getUrl,
42
- } from './common/UrlProcessor';
@@ -1,18 +0,0 @@
1
- export const getShortcutQuery = `
2
- query($path:ID!){
3
- guillotine {
4
- get(key:$path) {
5
- ... on base_Shortcut {
6
- data {
7
- target {
8
- pageUrl(type: absolute)
9
- }
10
- parameters {
11
- name
12
- value
13
- }
14
- }
15
- }
16
- }
17
- }
18
- }`;
@@ -1,3 +0,0 @@
1
- export function getServerRenderedHtml(component: React.ReactNode): string {
2
- return require('react-dom/server').renderToString(component);
3
- }
package/src/server.ts DELETED
@@ -1,5 +0,0 @@
1
- export {fetchContent} from './guillotine/fetchContent';
2
- export {fetchContentPathsForAllLocales} from './guillotine/fetchContentPathsForAllLocales';
3
- export {fetchContentPathsForLocale} from './guillotine/fetchContentPathsForLocale';
4
- export {fetchFromApi} from './guillotine/fetchFromApi';
5
- export {fetchGuillotine} from './guillotine/fetchGuillotine';
@@ -1,131 +0,0 @@
1
- import type {XP_COMPONENT_TYPE} from '../common/constants';
2
- import type {Context} from './next';
3
- import type {
4
- RichTextData as CompsRichTextData,
5
- LinkData as CompsLinkData,
6
- ImageData as CompsImageData,
7
- MacroData as CompsMacroData,
8
- } from '@enonic/react-components';
9
-
10
- // Differs from ComponentDefinition to avoid storing catchAll on all components
11
- // catchAll is calculated in getType instead
12
- export interface ComponentDefinitionParams {
13
- query?: SelectedQueryMaybeVariablesFunc
14
- configQuery?: string
15
- processor?: DataProcessor
16
- view?: React.FunctionComponent<any>
17
- }
18
-
19
- /**
20
- * Object that configures the handling of a particular content type. All attributes are optional (see examples below), and missing values will fall back to default behavior:
21
- * - 'query' (used in fetchContent.ts) Guillotine query for fetching content data, may also have a function that supplies guillotine variables. So, 'query' can EITHER be only a query string, OR also add a get-guillotine-variables function. In the latter case, 'query' can be an object with 'query' and 'variables' attributes, or an array where the query string is first and the get-variables function is second. Either way, the get-variables function takes two arguments: path (content path, mandatory) and context (next.js-supplied Context from getServerSideProps etc. Optional, and requires that fetchContent is called with the context, of course).
22
- * - 'props' (used in fetchContent.ts) is a function for processing props after fetching them
23
- * - 'view' (used in BasePage.tsx) is a React component: top-level content-type-specific rendering with the props first fetched from guillotine (and then optionally preprocessed with the function in 'props').
24
- */
25
- export interface ComponentDefinition {
26
- catchAll?: boolean; // will be set automatically depending on the binding
27
- query?: SelectedQueryMaybeVariablesFunc,
28
- configQuery?: string,
29
- processor?: DataProcessor,
30
- view?: React.FunctionComponent<any>
31
- }
32
-
33
- export interface ComponentDescriptor {
34
- type?: ComponentDefinition;
35
- component?: PageComponent;
36
- queryAndVariables?: QueryAndVariables;
37
- }
38
-
39
- export type ComponentDictionary = Record<string, ComponentDefinitionParams>;
40
-
41
- // NB! Always return null or empty object from processor for next is unable to serialize undefined
42
- export type DataProcessor = (data: any, context?: Context, config?: any) => Promise<Record<string, any>>;
43
-
44
- export interface FragmentData {
45
- id: string;
46
- fragment: {
47
- components: PageComponent[];
48
- }
49
- }
50
-
51
- export type ImageData = CompsImageData;
52
-
53
- export interface LayoutData {
54
- descriptor: string;
55
- config?: any;
56
-
57
- [customKeysFromQuery: string]: any;
58
- }
59
-
60
- export type LinkData = CompsLinkData;
61
-
62
- export type MacroConfig = Record<string, any>;
63
-
64
- export type MacroData = CompsMacroData;
65
-
66
- export interface PageComponent {
67
- [key: string]: any; // keeps ts happy when accessing component data field by XP_COMPONENT_TYPE type
68
- type: XP_COMPONENT_TYPE;
69
- path: string;
70
- page?: PageData;
71
- part?: PartData;
72
- layout?: LayoutData;
73
- fragment?: FragmentData;
74
- text?: TextData;
75
- image?: any;
76
- regions?: RegionTree;
77
- data?: any;
78
- error?: any;
79
- }
80
-
81
- export interface PageData {
82
- descriptor: string;
83
- config?: any;
84
- template?: string | null;
85
- regions?: RegionTree;
86
- }
87
-
88
- export interface PageRegion {
89
- name: string;
90
- components: PageComponent[];
91
- }
92
-
93
- export interface PartData {
94
- descriptor: string;
95
- config: any; // TODO NestedRecord?;
96
-
97
- [customKeysFromQuery: string]: any;
98
- }
99
-
100
- export interface QueryAndVariables {
101
- query: string
102
- variables?: Record<string, any>
103
- }
104
-
105
- export type QueryGetter = (path: string, context?: Context, config?: any) => string;
106
-
107
- export type SelectedQueryMaybeVariablesFunc =
108
- | string
109
- | QueryGetter
110
- | {
111
- query: string | QueryGetter
112
- variables: VariablesGetter
113
- }
114
- | [string | QueryGetter, VariablesGetter];
115
-
116
- export type RegionTree = Record<string, PageRegion>;
117
-
118
- export type RichTextData = CompsRichTextData;
119
-
120
- export interface TextData {
121
- value: RichTextData;
122
- }
123
-
124
- // TODO: also access as arguments: dataAsJson, pageAsJson, configAsJson from the first (meta) call here?
125
- // Another option could be to let the component or page controller pass those values to NextJS by a header
126
- export type VariablesGetter = (path: string, context?: Context, config?: any) => VariablesGetterResult;
127
-
128
- export interface VariablesGetterResult {
129
- [variables: string]: any
130
- path: string
131
- }
@@ -1,142 +0,0 @@
1
- import {DOMNode} from 'html-react-parser';
2
- import type {RENDER_MODE, XP_REQUEST_TYPE} from '../common/constants';
3
- import type {
4
- FragmentData,
5
- LayoutData,
6
- MacroConfig,
7
- MacroData,
8
- PageComponent,
9
- PageData,
10
- PartData,
11
- RichTextData,
12
- RegionTree,
13
- } from './component';
14
-
15
-
16
- export interface BaseComponentProps {
17
- component: PageComponent;
18
- meta: MetaData;
19
- common?: any; // Content is passed down for optional consumption in componentviews.
20
- // TODO: Use a react contextprovider instead of "manually" passing everything down
21
- }
22
-
23
- export interface BaseLayoutProps {
24
- component?: LayoutData;
25
- path: string;
26
- regions?: RegionTree;
27
- common?: any;
28
- meta: MetaData;
29
- }
30
-
31
- export interface BaseMacroProps {
32
- children: string | React.ReactNode;
33
- data: Omit<MacroData, 'ref'>;
34
- meta: MetaData;
35
- renderInEditMode?: boolean;
36
- }
37
-
38
- export interface BasePageProps {
39
- component?: PageData;
40
- path?: string;
41
- common?: any;
42
- data?: any;
43
- error?: string;
44
- meta: MetaData;
45
- }
46
-
47
- export interface BasePartProps {
48
- component?: PartData;
49
- path: string;
50
- common?: any;
51
- data?: any;
52
- error?: string;
53
- meta: MetaData;
54
- }
55
-
56
- export interface FragmentProps {
57
- page?: PageData;
58
- component?: FragmentData;
59
- common?: any;
60
- meta: MetaData;
61
- }
62
-
63
- export interface LayoutProps {
64
- layout: LayoutData;
65
- path: string;
66
- common: any;
67
- meta: MetaData;
68
- }
69
-
70
- export interface MacroProps {
71
- name: string;
72
- children: string | React.ReactNode;
73
- config: MacroConfig;
74
- meta: MetaData;
75
- }
76
-
77
- export interface MetaData {
78
- id: string,
79
- type: string,
80
- path: string,
81
- requestType: XP_REQUEST_TYPE,
82
- renderMode: RENDER_MODE,
83
- requestedComponent?: PageComponent,
84
- canRender: boolean,
85
- catchAll: boolean,
86
- apiUrl: string,
87
- baseUrl: string,
88
- locale: string,
89
- defaultLocale: string,
90
- }
91
-
92
- export interface PageProps {
93
- page: PageData;
94
- path: string;
95
- data?: any;
96
- common?: any; // Content is passed down to componentviews. TODO: Use a react contextprovider instead?
97
- meta: MetaData;
98
- }
99
-
100
- export interface PartProps {
101
- part: PartData
102
- path: string
103
- data?: any
104
- // Content is passed down to componentviews. TODO: Use a react contextprovider instead?
105
- common?: any
106
- meta: MetaData
107
- }
108
-
109
- export interface RegionProps {
110
- name: string
111
- components?: PageComponent[]
112
- className?: string
113
- // Content is passed down for optional consumption in componentviews. TODO: Use a react contextprovider instead?
114
- common?: any
115
- meta: MetaData
116
- }
117
-
118
- export interface RegionsProps {
119
- page: PageData | null;
120
- name?: string;
121
- // Content is passed down for optional consumption in componentviews. TODO: Use a react contextprovider instead?
122
- common?: any;
123
- meta: MetaData;
124
- }
125
-
126
- export type Replacer = (
127
- domNode: DOMNode,
128
- data: RichTextData,
129
- meta: MetaData,
130
- renderMacroInEditMode: boolean
131
- ) => ReplacerResult;
132
-
133
- export type ReplacerResult = JSX.Element | DOMNode;
134
-
135
- export interface RichTextViewProps {
136
- data: RichTextData
137
- meta: MetaData
138
- className?: string
139
- tag?: string
140
- renderMacroInEditMode?: boolean
141
- customReplacer?: Replacer
142
- }