@enonic/nextjs-adapter 3.3.0-B1 → 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 (296) hide show
  1. package/dist/baseMappings.d.ts +1 -0
  2. package/{src/baseMappings.ts → dist/baseMappings.js} +4 -14
  3. package/dist/baseMappings.js.map +1 -0
  4. package/dist/client/getClientHydratedHtml.d.ts +1 -0
  5. package/{src/client/getClientHydratedHtml.tsx → dist/client/getClientHydratedHtml.jsx} +3 -6
  6. package/dist/client/getClientHydratedHtml.jsx.map +1 -0
  7. package/dist/client.d.ts +1 -0
  8. package/dist/client.js +3 -0
  9. package/dist/client.js.map +1 -0
  10. package/dist/common/ComponentRegistry.d.ts +34 -0
  11. package/dist/common/ComponentRegistry.js +121 -0
  12. package/dist/common/ComponentRegistry.js.map +1 -0
  13. package/dist/common/UrlProcessor.d.ts +25 -0
  14. package/{src/common/UrlProcessor.ts → dist/common/UrlProcessor.js} +49 -70
  15. package/dist/common/UrlProcessor.js.map +1 -0
  16. package/dist/common/constants.d.ts +51 -0
  17. package/{src/common/constants.ts → dist/common/constants.js} +38 -44
  18. package/dist/common/constants.js.map +1 -0
  19. package/dist/common/env.d.ts +12 -0
  20. package/{src/common/env.ts → dist/common/env.js} +3 -14
  21. package/dist/common/env.js.map +1 -0
  22. package/dist/guillotine/applyProcessors.d.ts +2 -0
  23. package/dist/guillotine/applyProcessors.js +33 -0
  24. package/dist/guillotine/applyProcessors.js.map +1 -0
  25. package/dist/guillotine/buildComponentTree.d.ts +2 -0
  26. package/{src/guillotine/buildComponentTree.ts → dist/guillotine/buildComponentTree.js} +13 -25
  27. package/dist/guillotine/buildComponentTree.js.map +1 -0
  28. package/dist/guillotine/buildErrorResponse.d.ts +3 -0
  29. package/{src/guillotine/buildErrorResponse.ts → dist/guillotine/buildErrorResponse.js} +2 -10
  30. package/dist/guillotine/buildErrorResponse.js.map +1 -0
  31. package/dist/guillotine/buildPage.d.ts +2 -0
  32. package/dist/guillotine/buildPage.js +10 -0
  33. package/dist/guillotine/buildPage.js.map +1 -0
  34. package/dist/guillotine/collectComponentDescriptors.d.ts +6 -0
  35. package/{src/guillotine/collectComponentDescriptors.ts → dist/guillotine/collectComponentDescriptors.js} +13 -26
  36. package/dist/guillotine/collectComponentDescriptors.js.map +1 -0
  37. package/dist/guillotine/combineMultipleQueries.d.ts +2 -0
  38. package/{src/guillotine/combineMultipleQueries.ts → dist/guillotine/combineMultipleQueries.js} +9 -23
  39. package/dist/guillotine/combineMultipleQueries.js.map +1 -0
  40. package/dist/guillotine/createMetaData.d.ts +18 -0
  41. package/dist/guillotine/createMetaData.js +45 -0
  42. package/dist/guillotine/createMetaData.js.map +1 -0
  43. package/dist/guillotine/fetchContent.d.ts +9 -0
  44. package/dist/guillotine/fetchContent.js +222 -0
  45. package/dist/guillotine/fetchContent.js.map +1 -0
  46. package/dist/guillotine/fetchContentData.d.ts +2 -0
  47. package/dist/guillotine/fetchContentData.js +30 -0
  48. package/dist/guillotine/fetchContentData.js.map +1 -0
  49. package/dist/guillotine/fetchContentPathsForAllLocales.d.ts +2 -0
  50. package/dist/guillotine/fetchContentPathsForAllLocales.js +21 -0
  51. package/dist/guillotine/fetchContentPathsForAllLocales.js.map +1 -0
  52. package/dist/guillotine/fetchContentPathsForLocale.d.ts +2 -0
  53. package/dist/guillotine/fetchContentPathsForLocale.js +41 -0
  54. package/dist/guillotine/fetchContentPathsForLocale.js.map +1 -0
  55. package/dist/guillotine/fetchFromApi.d.ts +3 -0
  56. package/dist/guillotine/fetchFromApi.js +76 -0
  57. package/dist/guillotine/fetchFromApi.js.map +1 -0
  58. package/dist/guillotine/fetchGuillotine.d.ts +3 -0
  59. package/dist/guillotine/fetchGuillotine.js +75 -0
  60. package/dist/guillotine/fetchGuillotine.js.map +1 -0
  61. package/dist/guillotine/fetchMetaData.d.ts +2 -0
  62. package/dist/guillotine/fetchMetaData.js +33 -0
  63. package/dist/guillotine/fetchMetaData.js.map +1 -0
  64. package/dist/guillotine/getCleanContentPathArrayOrThrow400.d.ts +2 -0
  65. package/{src/guillotine/getCleanContentPathArrayOrThrow400.ts → dist/guillotine/getCleanContentPathArrayOrThrow400.js} +5 -7
  66. package/dist/guillotine/getCleanContentPathArrayOrThrow400.js.map +1 -0
  67. package/dist/guillotine/getComponentConfig.d.ts +2 -0
  68. package/{src/guillotine/getComponentConfig.ts → dist/guillotine/getComponentConfig.js} +3 -5
  69. package/dist/guillotine/getComponentConfig.js.map +1 -0
  70. package/dist/guillotine/getContentAndComponentPaths.d.ts +1 -0
  71. package/{src/guillotine/getContentAndComponentPaths.ts → dist/guillotine/getContentAndComponentPaths.js} +6 -5
  72. package/dist/guillotine/getContentAndComponentPaths.js.map +1 -0
  73. package/dist/guillotine/getMetaData.d.ts +2 -0
  74. package/{src/guillotine/getMetaData.ts → dist/guillotine/getMetaData.js} +11 -18
  75. package/dist/guillotine/getMetaData.js.map +1 -0
  76. package/dist/guillotine/getParentRegion.d.ts +2 -0
  77. package/{src/guillotine/getParentRegion.ts → dist/guillotine/getParentRegion.js} +9 -23
  78. package/dist/guillotine/getParentRegion.js.map +1 -0
  79. package/dist/guillotine/getQueryAndVariables.d.ts +2 -0
  80. package/{src/guillotine/getQueryAndVariables.ts → dist/guillotine/getQueryAndVariables.js} +7 -23
  81. package/dist/guillotine/getQueryAndVariables.js.map +1 -0
  82. package/dist/guillotine/metadata/configQuery.d.ts +2 -0
  83. package/dist/guillotine/metadata/configQuery.js +36 -0
  84. package/dist/guillotine/metadata/configQuery.js.map +1 -0
  85. package/dist/guillotine/metadata/richTextQuery.d.ts +1 -0
  86. package/{src/guillotine/metadata/richTextQuery.ts → dist/guillotine/metadata/richTextQuery.js} +6 -8
  87. package/dist/guillotine/metadata/richTextQuery.js.map +1 -0
  88. package/dist/guillotine/parseComponentPath.d.ts +2 -0
  89. package/{src/guillotine/parseComponentPath.ts → dist/guillotine/parseComponentPath.js} +4 -8
  90. package/dist/guillotine/parseComponentPath.js.map +1 -0
  91. package/dist/guillotine/prefixFragmentCmpPath.d.ts +1 -0
  92. package/{src/guillotine/prefixFragmentCmpPath.ts → dist/guillotine/prefixFragmentCmpPath.js} +5 -5
  93. package/dist/guillotine/prefixFragmentCmpPath.js.map +1 -0
  94. package/dist/guillotine/processComponentConfig.d.ts +2 -0
  95. package/{src/guillotine/processComponentConfig.ts → dist/guillotine/processComponentConfig.js} +4 -12
  96. package/dist/guillotine/processComponentConfig.js.map +1 -0
  97. package/dist/guillotine/restrictComponentsToPath.d.ts +2 -0
  98. package/{src/guillotine/restrictComponentsToPath.ts → dist/guillotine/restrictComponentsToPath.js} +9 -19
  99. package/dist/guillotine/restrictComponentsToPath.js.map +1 -0
  100. package/dist/guillotine/validateData.d.ts +2 -0
  101. package/dist/guillotine/validateData.js +7 -0
  102. package/dist/guillotine/validateData.js.map +1 -0
  103. package/dist/guillotine/validateNotFound.d.ts +2 -0
  104. package/{src/guillotine/validateNotFound.ts → dist/guillotine/validateNotFound.js} +5 -9
  105. package/dist/guillotine/validateNotFound.js.map +1 -0
  106. package/dist/guillotine/validateShortcut.d.ts +2 -0
  107. package/{src/guillotine/validateShortcut.ts → dist/guillotine/validateShortcut.js} +12 -20
  108. package/dist/guillotine/validateShortcut.js.map +1 -0
  109. package/dist/i18n/LocaleContext.d.ts +7 -0
  110. package/dist/i18n/LocaleContext.jsx +50 -0
  111. package/dist/i18n/LocaleContext.jsx.map +1 -0
  112. package/dist/i18n/i18n.d.ts +12 -0
  113. package/dist/i18n/i18n.js +59 -0
  114. package/dist/i18n/i18n.js.map +1 -0
  115. package/dist/index.d.ts +14 -0
  116. package/dist/index.js +14 -0
  117. package/dist/index.js.map +1 -0
  118. package/dist/query/Shortcut.d.ts +1 -0
  119. package/{src/query/Shortcut.ts → dist/query/Shortcut.js} +1 -0
  120. package/dist/query/Shortcut.js.map +1 -0
  121. package/dist/server/getServerRenderedHtml.d.ts +1 -0
  122. package/dist/server/getServerRenderedHtml.js +4 -0
  123. package/dist/server/getServerRenderedHtml.js.map +1 -0
  124. package/dist/server.d.ts +5 -0
  125. package/dist/server.js +6 -0
  126. package/dist/server.js.map +1 -0
  127. package/{src/types/component.ts → dist/types/component.d.ts} +23 -62
  128. package/dist/types/component.js +2 -0
  129. package/dist/types/component.js.map +1 -0
  130. package/dist/types/componentProps.d.ts +107 -0
  131. package/dist/types/componentProps.js +2 -0
  132. package/dist/types/componentProps.js.map +1 -0
  133. package/dist/types/guillotine.d.ts +344 -0
  134. package/dist/types/guillotine.js +2 -0
  135. package/dist/types/guillotine.js.map +1 -0
  136. package/dist/types/i18n.d.ts +7 -0
  137. package/dist/types/i18n.js +2 -0
  138. package/dist/types/i18n.js.map +1 -0
  139. package/{src/types/index.ts → dist/types/index.d.ts} +19 -34
  140. package/dist/types/index.js +3 -0
  141. package/dist/types/index.js.map +1 -0
  142. package/dist/types/next.d.ts +6 -0
  143. package/dist/types/next.js +2 -0
  144. package/dist/types/next.js.map +1 -0
  145. package/dist/types/util.d.ts +3 -0
  146. package/dist/types/util.js +3 -0
  147. package/dist/types/util.js.map +1 -0
  148. package/dist/utils/addLineNumbers.d.ts +1 -0
  149. package/dist/utils/addLineNumbers.js +4 -0
  150. package/dist/utils/addLineNumbers.js.map +1 -0
  151. package/dist/utils/buildGuillotineRequestHeaders.d.ts +7 -0
  152. package/dist/utils/buildGuillotineRequestHeaders.js +16 -0
  153. package/dist/utils/buildGuillotineRequestHeaders.js.map +1 -0
  154. package/dist/utils/commonChars.d.ts +1 -0
  155. package/{src/utils/commonChars.ts → dist/utils/commonChars.js} +5 -4
  156. package/dist/utils/commonChars.js.map +1 -0
  157. package/dist/utils/enonicLog.d.ts +5 -0
  158. package/dist/utils/enonicLog.js +23 -0
  159. package/dist/utils/enonicLog.js.map +1 -0
  160. package/dist/utils/fixDoubleSlashes.d.ts +1 -0
  161. package/dist/utils/fixDoubleSlashes.js +4 -0
  162. package/dist/utils/fixDoubleSlashes.js.map +1 -0
  163. package/dist/utils/getAllLocales.d.ts +1 -0
  164. package/dist/utils/getAllLocales.js +5 -0
  165. package/dist/utils/getAllLocales.js.map +1 -0
  166. package/dist/utils/getContentApiUrl.d.ts +2 -0
  167. package/dist/utils/getContentApiUrl.js +15 -0
  168. package/dist/utils/getContentApiUrl.js.map +1 -0
  169. package/dist/utils/getLocaleMapping.d.ts +2 -0
  170. package/dist/utils/getLocaleMapping.js +19 -0
  171. package/dist/utils/getLocaleMapping.js.map +1 -0
  172. package/dist/utils/getLocaleMappingByLocale.d.ts +2 -0
  173. package/dist/utils/getLocaleMappingByLocale.js +13 -0
  174. package/dist/utils/getLocaleMappingByLocale.js.map +1 -0
  175. package/dist/utils/getLocaleMappingByProjectId.d.ts +2 -0
  176. package/dist/utils/getLocaleMappingByProjectId.js +16 -0
  177. package/dist/utils/getLocaleMappingByProjectId.js.map +1 -0
  178. package/dist/utils/getLocaleMappings.d.ts +2 -0
  179. package/{src/utils/getLocaleMappings.ts → dist/utils/getLocaleMappings.js} +8 -14
  180. package/dist/utils/getLocaleMappings.js.map +1 -0
  181. package/dist/utils/getRenderMode.d.ts +3 -0
  182. package/dist/utils/getRenderMode.js +8 -0
  183. package/dist/utils/getRenderMode.js.map +1 -0
  184. package/dist/utils/getRequestLocaleInfo.d.ts +6 -0
  185. package/{src/utils/getRequestLocaleInfo.ts → dist/utils/getRequestLocaleInfo.js} +12 -13
  186. package/dist/utils/getRequestLocaleInfo.js.map +1 -0
  187. package/dist/utils/getXpBaseUrl.d.ts +2 -0
  188. package/dist/utils/getXpBaseUrl.js +8 -0
  189. package/dist/utils/getXpBaseUrl.js.map +1 -0
  190. package/dist/utils/indent.d.ts +1 -0
  191. package/dist/utils/indent.js +5 -0
  192. package/dist/utils/indent.js.map +1 -0
  193. package/dist/utils/sanitizeGraphqlName.d.ts +1 -0
  194. package/{src/utils/sanitizeGraphqlName.ts → dist/utils/sanitizeGraphqlName.js} +3 -2
  195. package/dist/utils/sanitizeGraphqlName.js.map +1 -0
  196. package/dist/views/BaseComponent.d.ts +20 -0
  197. package/{src/views/BaseComponent.tsx → dist/views/BaseComponent.jsx} +49 -76
  198. package/dist/views/BaseComponent.jsx.map +1 -0
  199. package/dist/views/BaseContent.d.ts +3 -0
  200. package/dist/views/BaseContent.jsx +38 -0
  201. package/dist/views/BaseContent.jsx.map +1 -0
  202. package/dist/views/BaseLayout.d.ts +3 -0
  203. package/dist/views/BaseLayout.jsx +24 -0
  204. package/dist/views/BaseLayout.jsx.map +1 -0
  205. package/dist/views/BaseMacro.d.ts +6 -0
  206. package/{src/views/BaseMacro.tsx → dist/views/BaseMacro.jsx} +37 -42
  207. package/dist/views/BaseMacro.jsx.map +1 -0
  208. package/dist/views/BasePage.d.ts +3 -0
  209. package/dist/views/BasePage.jsx +34 -0
  210. package/dist/views/BasePage.jsx.map +1 -0
  211. package/dist/views/BasePart.d.ts +3 -0
  212. package/dist/views/BasePart.jsx +24 -0
  213. package/dist/views/BasePart.jsx.map +1 -0
  214. package/dist/views/Empty.d.ts +2 -0
  215. package/{src/views/Empty.tsx → dist/views/Empty.jsx} +1 -2
  216. package/dist/views/Empty.jsx.map +1 -0
  217. package/dist/views/Fragment.d.ts +3 -0
  218. package/dist/views/Fragment.jsx +30 -0
  219. package/dist/views/Fragment.jsx.map +1 -0
  220. package/dist/views/MainView.d.ts +3 -0
  221. package/dist/views/MainView.jsx +14 -0
  222. package/dist/views/MainView.jsx.map +1 -0
  223. package/dist/views/PropsView.d.ts +2 -0
  224. package/dist/views/PropsView.jsx +21 -0
  225. package/dist/views/PropsView.jsx.map +1 -0
  226. package/dist/views/Region.d.ts +6 -0
  227. package/{src/views/Region.tsx → dist/views/Region.jsx} +17 -41
  228. package/dist/views/Region.jsx.map +1 -0
  229. package/dist/views/RichTextView.d.ts +3 -0
  230. package/dist/views/RichTextView.jsx +65 -0
  231. package/dist/views/RichTextView.jsx.map +1 -0
  232. package/dist/views/SingleComponent.d.ts +4 -0
  233. package/dist/views/SingleComponent.jsx +10 -0
  234. package/dist/views/SingleComponent.jsx.map +1 -0
  235. package/dist/views/StaticContent.d.ts +10 -0
  236. package/dist/views/StaticContent.jsx +37 -0
  237. package/dist/views/StaticContent.jsx.map +1 -0
  238. package/dist/views/Text.d.ts +8 -0
  239. package/dist/views/Text.jsx +4 -0
  240. package/dist/views/Text.jsx.map +1 -0
  241. package/dist/views/macros/DefaultMacro.d.ts +3 -0
  242. package/dist/views/macros/DefaultMacro.jsx +4 -0
  243. package/dist/views/macros/DefaultMacro.jsx.map +1 -0
  244. package/dist/views/macros/DisableMacro.d.ts +3 -0
  245. package/dist/views/macros/DisableMacro.jsx +3 -0
  246. package/dist/views/macros/DisableMacro.jsx.map +1 -0
  247. package/package.json +19 -31
  248. package/src/client.ts +0 -2
  249. package/src/common/ComponentRegistry.ts +0 -159
  250. package/src/guillotine/applyProcessors.ts +0 -34
  251. package/src/guillotine/buildPage.ts +0 -15
  252. package/src/guillotine/createMetaData.ts +0 -72
  253. package/src/guillotine/fetchContent.ts +0 -240
  254. package/src/guillotine/fetchContentData.ts +0 -31
  255. package/src/guillotine/fetchContentPathsForAllLocales.ts +0 -21
  256. package/src/guillotine/fetchContentPathsForLocale.ts +0 -43
  257. package/src/guillotine/fetchFromApi.ts +0 -76
  258. package/src/guillotine/fetchGuillotine.ts +0 -76
  259. package/src/guillotine/fetchMetaData.ts +0 -31
  260. package/src/guillotine/metadata/configQuery.ts +0 -46
  261. package/src/guillotine/validateData.ts +0 -11
  262. package/src/i18n/LocaleContext.tsx +0 -59
  263. package/src/i18n/i18n.ts +0 -57
  264. package/src/index.ts +0 -42
  265. package/src/server/getServerRenderedHtml.ts +0 -3
  266. package/src/server.ts +0 -5
  267. package/src/types/componentProps.ts +0 -143
  268. package/src/types/guillotine.ts +0 -428
  269. package/src/types/i18n.ts +0 -8
  270. package/src/types/next.ts +0 -7
  271. package/src/types/util.ts +0 -5
  272. package/src/utils/addLineNumbers.ts +0 -3
  273. package/src/utils/buildGuillotineRequestHeaders.ts +0 -29
  274. package/src/utils/enonicLog.ts +0 -28
  275. package/src/utils/fixDoubleSlashes.ts +0 -3
  276. package/src/utils/getAllLocales.ts +0 -6
  277. package/src/utils/getContentApiUrl.ts +0 -20
  278. package/src/utils/getLocaleMapping.ts +0 -24
  279. package/src/utils/getLocaleMappingByLocale.ts +0 -19
  280. package/src/utils/getLocaleMappingByProjectId.ts +0 -21
  281. package/src/utils/getRenderMode.ts +0 -11
  282. package/src/utils/getXpBaseUrl.ts +0 -12
  283. package/src/utils/indent.ts +0 -4
  284. package/src/views/BaseContent.tsx +0 -47
  285. package/src/views/BaseLayout.tsx +0 -33
  286. package/src/views/BasePage.tsx +0 -42
  287. package/src/views/BasePart.tsx +0 -34
  288. package/src/views/Fragment.tsx +0 -41
  289. package/src/views/MainView.tsx +0 -22
  290. package/src/views/PropsView.tsx +0 -38
  291. package/src/views/RichTextView.tsx +0 -106
  292. package/src/views/SingleComponent.tsx +0 -19
  293. package/src/views/StaticContent.tsx +0 -39
  294. package/src/views/Text.tsx +0 -19
  295. package/src/views/macros/DefaultMacro.tsx +0 -9
  296. package/src/views/macros/DisableMacro.tsx +0 -8
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getComponentConfig.js","sourceRoot":"","sources":["../../src/guillotine/getComponentConfig.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,kBAAkB,CAAC,GAAmB;IAClD,MAAM,OAAO,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACrC,OAAO,OAAO,IAAI,QAAQ,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AACvE,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const getContentAndComponentPaths: (requestPath: string) => string[];
@@ -1,11 +1,12 @@
1
- const COMPONENT_PATH_KEY = /\/?_\/component/; // first slash is optional for root components
2
-
3
- export const getContentAndComponentPaths = (requestPath: string): string[] => {
1
+ const COMPONENT_PATH_KEY = /\/?_\/component/; // first slash is optional for root components
2
+ export const getContentAndComponentPaths = (requestPath) => {
4
3
  let contentPath, componentPath;
5
4
  if (COMPONENT_PATH_KEY.test(requestPath)) {
6
5
  [contentPath, componentPath] = requestPath.split(COMPONENT_PATH_KEY);
7
- } else {
6
+ }
7
+ else {
8
8
  contentPath = requestPath;
9
9
  }
10
10
  return [contentPath, componentPath];
11
- };
11
+ };
12
+ //# sourceMappingURL=getContentAndComponentPaths.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getContentAndComponentPaths.js","sourceRoot":"","sources":["../../src/guillotine/getContentAndComponentPaths.ts"],"names":[],"mappings":"AAAA,MAAM,kBAAkB,GAAG,iBAAiB,CAAC,CAAG,8CAA8C;AAE9F,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,WAAmB,EAAY,EAAE;IACzE,IAAI,WAAW,EAAE,aAAa,CAAC;IAC/B,IAAI,kBAAkB,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;QACvC,CAAC,WAAW,EAAE,aAAa,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;IACzE,CAAC;SAAM,CAAC;QACJ,WAAW,GAAG,WAAW,CAAC;IAC9B,CAAC;IACD,OAAO,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;AACxC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const pageFragmentQuery: () => string;
2
+ export declare function getMetaQuery(pageFragment?: string): string;
@@ -1,22 +1,16 @@
1
- import {ComponentRegistry} from '../common/ComponentRegistry';
2
- import {configQuery} from './metadata/configQuery';
3
- import {richTextQuery} from './metadata/richTextQuery';
4
- import {indent} from '../utils/indent';
5
-
6
-
7
- const partConfigQuery = (): string => {
1
+ import { ComponentRegistry } from '../common/ComponentRegistry';
2
+ import { configQuery } from './metadata/configQuery';
3
+ import { richTextQuery } from './metadata/richTextQuery';
4
+ import { indent } from '../utils/indent';
5
+ const partConfigQuery = () => {
8
6
  return configQuery(ComponentRegistry.getParts());
9
7
  };
10
-
11
- const layoutConfigQuery = (): string => {
8
+ const layoutConfigQuery = () => {
12
9
  return configQuery(ComponentRegistry.getLayouts());
13
10
  };
14
-
15
- const pageConfigQuery = (): string => {
11
+ const pageConfigQuery = () => {
16
12
  return configQuery(ComponentRegistry.getPages());
17
13
  };
18
-
19
-
20
14
  /*
21
15
  IMPORTANT: make sure to transform your queries into functions too when using this function inside them !!!
22
16
  */
@@ -46,21 +40,19 @@ image {
46
40
  imageUrl (type:absolute, scale: "width-768")
47
41
  }
48
42
  }`;
49
-
50
43
  // THIS QUERY DOES NOT SUPPORT NESTED FRAGMENTS
51
44
  export const pageFragmentQuery = () => `components(resolveFragment: false, resolveTemplate: true) {
52
45
  fragment {
53
46
  id
54
47
  fragment {
55
48
  components {
56
- ${indent(componentsQuery(),16)}
49
+ ${indent(componentsQuery(), 16)}
57
50
  }
58
51
  }
59
52
  }
60
- ${indent(componentsQuery(),4)}
53
+ ${indent(componentsQuery(), 4)}
61
54
  }`;
62
-
63
- export function getMetaQuery(pageFragment?: string): string {
55
+ export function getMetaQuery(pageFragment) {
64
56
  return `query($path:ID!) {
65
57
  guillotine {
66
58
  get(key:$path) {
@@ -72,3 +64,4 @@ ${indent(pageFragment || '', 12)}
72
64
  }
73
65
  }`;
74
66
  }
67
+ //# sourceMappingURL=getMetaData.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getMetaData.js","sourceRoot":"","sources":["../../src/guillotine/getMetaData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAC,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAC,WAAW,EAAC,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAC,aAAa,EAAC,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAC,MAAM,EAAC,MAAM,iBAAiB,CAAC;AAGvC,MAAM,eAAe,GAAG,GAAW,EAAE;IACjC,OAAO,WAAW,CAAC,iBAAiB,CAAC,QAAQ,EAAE,CAAC,CAAC;AACrD,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAAG,GAAW,EAAE;IACnC,OAAO,WAAW,CAAC,iBAAiB,CAAC,UAAU,EAAE,CAAC,CAAC;AACvD,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,GAAW,EAAE;IACjC,OAAO,WAAW,CAAC,iBAAiB,CAAC,QAAQ,EAAE,CAAC,CAAC;AACrD,CAAC,CAAC;AAGF;;GAEG;AACH,MAAM,eAAe,GAAG,GAAG,EAAE,CAAC;;;;EAI5B,MAAM,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC;;;;;;;EAO5B,MAAM,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC;;;EAG9B,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;;;;EAIjC,MAAM,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC;;;;;;;EAO5B,CAAC;AAEH,+CAA+C;AAC/C,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,EAAE,CAAC;;;;;EAKrC,MAAM,CAAC,eAAe,EAAE,EAAC,EAAE,CAAC;;;;EAI5B,MAAM,CAAC,eAAe,EAAE,EAAC,CAAC,CAAC;EAC3B,CAAC;AAEH,MAAM,UAAU,YAAY,CAAC,YAAqB;IAC9C,OAAO;;;;;;EAMT,MAAM,CAAC,YAAY,IAAI,EAAE,EAAE,EAAE,CAAC;;;EAG9B,CAAC;AACH,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { PageComponent, PageRegion, PathFragment, RegionTree } from '../types';
2
+ export declare function getParentRegion(source: RegionTree, contentType: string, cmpPath: PathFragment[], components?: PageComponent[], createMissing?: boolean): PageRegion | undefined;
@@ -1,27 +1,14 @@
1
- import type {PageComponent, PageRegion, PathFragment, RegionTree} from '../types';
2
-
3
-
4
- import {XP_COMPONENT_TYPE} from '../common/constants';
5
- import {prefixFragmentCmpPath} from './prefixFragmentCmpPath';
6
-
7
-
8
- export function getParentRegion(
9
- source: RegionTree,
10
- contentType: string,
11
- cmpPath: PathFragment[],
12
- components: PageComponent[] = [],
13
- createMissing ?: boolean
14
- ): PageRegion | undefined {
15
- let currentTree: RegionTree = source;
16
- let currentRegion: PageRegion | undefined;
1
+ import { XP_COMPONENT_TYPE } from '../common/constants';
2
+ import { prefixFragmentCmpPath } from './prefixFragmentCmpPath';
3
+ export function getParentRegion(source, contentType, cmpPath, components = [], createMissing) {
4
+ let currentTree = source;
5
+ let currentRegion;
17
6
  let parentPath = '';
18
-
19
7
  for (let i = 0; i < cmpPath.length; i++) {
20
8
  const pathFragment = cmpPath[i];
21
9
  const regionName = pathFragment.region;
22
10
  parentPath += `/${pathFragment.region}/${pathFragment.index}`;
23
11
  currentRegion = currentTree[regionName];
24
-
25
12
  if (!currentRegion) {
26
13
  if (createMissing) {
27
14
  currentRegion = {
@@ -29,15 +16,14 @@ export function getParentRegion(
29
16
  components: []
30
17
  };
31
18
  currentTree[regionName] = currentRegion;
32
- } else {
19
+ }
20
+ else {
33
21
  throw new Error(`Region [${regionName}] was not found`);
34
22
  }
35
23
  }
36
-
37
24
  if (i < cmpPath.length - 1) {
38
25
  // look for layouts inside if this is not the last path fragment
39
-
40
- const layout = components.find((cmp: PageComponent) => {
26
+ const layout = components.find((cmp) => {
41
27
  return cmp.type === XP_COMPONENT_TYPE.LAYOUT && prefixFragmentCmpPath(contentType, cmp.path) === parentPath;
42
28
  });
43
29
  if (!layout) {
@@ -49,6 +35,6 @@ export function getParentRegion(
49
35
  currentTree = layout.regions;
50
36
  }
51
37
  } // for
52
-
53
38
  return currentRegion;
54
39
  }
40
+ //# sourceMappingURL=getParentRegion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getParentRegion.js","sourceRoot":"","sources":["../../src/guillotine/getParentRegion.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAC,qBAAqB,EAAC,MAAM,yBAAyB,CAAC;AAG9D,MAAM,UAAU,eAAe,CAC3B,MAAkB,EAClB,WAAmB,EACnB,OAAuB,EACvB,aAA8B,EAAE,EAChC,aAAwB;IAExB,IAAI,WAAW,GAAe,MAAM,CAAC;IACrC,IAAI,aAAqC,CAAC;IAC1C,IAAI,UAAU,GAAG,EAAE,CAAC;IAEpB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,MAAM,YAAY,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QAChC,MAAM,UAAU,GAAG,YAAY,CAAC,MAAM,CAAC;QACvC,UAAU,IAAI,IAAI,YAAY,CAAC,MAAM,IAAI,YAAY,CAAC,KAAK,EAAE,CAAC;QAC9D,aAAa,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;QAExC,IAAI,CAAC,aAAa,EAAE,CAAC;YACjB,IAAI,aAAa,EAAE,CAAC;gBAChB,aAAa,GAAG;oBACZ,IAAI,EAAE,UAAU;oBAChB,UAAU,EAAE,EAAE;iBACjB,CAAC;gBACF,WAAW,CAAC,UAAU,CAAC,GAAG,aAAa,CAAC;YAC5C,CAAC;iBAAM,CAAC;gBACJ,MAAM,IAAI,KAAK,CAAC,WAAW,UAAU,iBAAiB,CAAC,CAAC;YAC5D,CAAC;QACL,CAAC;QAED,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACzB,gEAAgE;YAEhE,MAAM,MAAM,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,GAAkB,EAAE,EAAE;gBAClD,OAAO,GAAG,CAAC,IAAI,KAAK,iBAAiB,CAAC,MAAM,IAAI,qBAAqB,CAAC,WAAW,EAAE,GAAG,CAAC,IAAI,CAAC,KAAK,UAAU,CAAC;YAChH,CAAC,CAAC,CAAC;YACH,IAAI,CAAC,MAAM,EAAE,CAAC;gBACV,MAAM,IAAI,KAAK,CAAC,WAAW,UAAU,2DAA2D,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;YACzI,CAAC;YACD,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;gBAClB,MAAM,CAAC,OAAO,GAAG,EAAE,CAAC;YACxB,CAAC;YACD,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC;QACjC,CAAC;IACL,CAAC,CAAC,MAAM;IAER,OAAO,aAAa,CAAC;AACzB,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { Context, QueryAndVariables, SelectedQueryMaybeVariablesFunc } from '../types';
2
+ export declare function getQueryAndVariables(type: string, path: string, context: Context, selectedQuery?: SelectedQueryMaybeVariablesFunc, config?: any): QueryAndVariables | undefined;
@@ -1,42 +1,25 @@
1
- import type {Context, QueryAndVariables, SelectedQueryMaybeVariablesFunc} from '../types';
2
-
3
-
4
- export function getQueryAndVariables(
5
- type: string,
6
- path: string,
7
- context: Context,
8
- selectedQuery?: SelectedQueryMaybeVariablesFunc,
9
- config?: any
10
- ): QueryAndVariables | undefined {
11
-
1
+ export function getQueryAndVariables(type, path, context, selectedQuery, config) {
12
2
  let query, getVariables;
13
-
14
- if (
15
- typeof selectedQuery === 'string' || typeof selectedQuery === 'function'
16
- ) {
3
+ if (typeof selectedQuery === 'string' || typeof selectedQuery === 'function') {
17
4
  query = selectedQuery;
18
-
19
- } else if (Array.isArray(selectedQuery)) {
5
+ }
6
+ else if (Array.isArray(selectedQuery)) {
20
7
  query = selectedQuery[0];
21
8
  getVariables = selectedQuery[1];
22
-
23
- } else if (typeof selectedQuery === 'object') {
9
+ }
10
+ else if (typeof selectedQuery === 'object') {
24
11
  query = selectedQuery.query;
25
12
  getVariables = selectedQuery.variables;
26
13
  }
27
-
28
14
  if (getVariables && typeof getVariables !== 'function') {
29
15
  throw Error(`getVariables for content type ${type} should be a function, not: ${typeof getVariables}`);
30
16
  }
31
-
32
17
  if (query && typeof query !== 'string' && typeof query !== 'function') {
33
18
  throw Error(`Query for content type ${type} should be a string or function, not: ${typeof query}`);
34
19
  }
35
-
36
20
  if (typeof query === 'function') {
37
21
  query = query(path, context, config);
38
22
  }
39
-
40
23
  if (query) {
41
24
  return {
42
25
  query,
@@ -46,3 +29,4 @@ export function getQueryAndVariables(
46
29
  };
47
30
  }
48
31
  }
32
+ //# sourceMappingURL=getQueryAndVariables.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getQueryAndVariables.js","sourceRoot":"","sources":["../../src/guillotine/getQueryAndVariables.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,oBAAoB,CAChC,IAAY,EACZ,IAAY,EACZ,OAAgB,EAChB,aAA+C,EAC/C,MAAY;IAGZ,IAAI,KAAK,EAAE,YAAY,CAAC;IAExB,IACI,OAAO,aAAa,KAAK,QAAQ,IAAI,OAAO,aAAa,KAAK,UAAU,EAC1E,CAAC;QACC,KAAK,GAAG,aAAa,CAAC;IAE1B,CAAC;SAAM,IAAI,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC;QACtC,KAAK,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;QACzB,YAAY,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;IAEpC,CAAC;SAAM,IAAI,OAAO,aAAa,KAAK,QAAQ,EAAE,CAAC;QAC3C,KAAK,GAAG,aAAa,CAAC,KAAK,CAAC;QAC5B,YAAY,GAAG,aAAa,CAAC,SAAS,CAAC;IAC3C,CAAC;IAED,IAAI,YAAY,IAAI,OAAO,YAAY,KAAK,UAAU,EAAE,CAAC;QACrD,MAAM,KAAK,CAAC,iCAAiC,IAAI,+BAA+B,OAAO,YAAY,EAAE,CAAC,CAAC;IAC3G,CAAC;IAED,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE,CAAC;QACpE,MAAM,KAAK,CAAC,0BAA0B,IAAI,yCAAyC,OAAO,KAAK,EAAE,CAAC,CAAC;IACvG,CAAC;IAED,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE,CAAC;QAC9B,KAAK,GAAG,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IACzC,CAAC;IAED,IAAI,KAAK,EAAE,CAAC;QACR,OAAO;YACH,KAAK;YACL,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;gBAC5D,IAAI;aACP;SACJ,CAAC;IACN,CAAC;AACL,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { ComponentDefinition } from '../../types';
2
+ export declare const configQuery: (list: [string, ComponentDefinition][], includeAppName?: boolean, canUseConfigAsJson?: boolean) => string;
@@ -0,0 +1,36 @@
1
+ import { sanitizeGraphqlName } from '../../utils/sanitizeGraphqlName';
2
+ export const configQuery = (list, includeAppName = true, canUseConfigAsJson = true) => {
3
+ const hasQueryList = (list === null || list === void 0 ? void 0 : list.filter(([key, def]) => def.configQuery)) || [];
4
+ if (hasQueryList.length === 0) {
5
+ return canUseConfigAsJson ? 'configAsJson' : '';
6
+ }
7
+ const configsByApp = {};
8
+ hasQueryList
9
+ .forEach((entry) => {
10
+ const nameParts = entry[0].split(':');
11
+ if (nameParts.length === 2) {
12
+ const sanitizedAppName = sanitizeGraphqlName(nameParts[0]);
13
+ let existingConfigs = configsByApp[sanitizedAppName];
14
+ if (!existingConfigs) {
15
+ existingConfigs = [];
16
+ configsByApp[sanitizedAppName] = existingConfigs;
17
+ }
18
+ existingConfigs.push(`${sanitizeGraphqlName(nameParts[1])}${entry[1].configQuery}`);
19
+ }
20
+ });
21
+ // Still query for configAsJson if at least one item has no configQuery defined
22
+ const configAsJsonQuery = canUseConfigAsJson && hasQueryList.length < list.length ? 'configAsJson' : '';
23
+ if (!includeAppName) {
24
+ return `${configAsJsonQuery}
25
+ config {
26
+ ${Object.values(configsByApp).reduce((arr, curr) => arr.concat(curr), []).join('\n')}
27
+ }`;
28
+ }
29
+ else {
30
+ return `${configAsJsonQuery}
31
+ config {
32
+ ${Object.entries(configsByApp).map(entry => entry[0] + '{\n' + entry[1].join('\n') + '\n}')}
33
+ }`;
34
+ }
35
+ };
36
+ //# sourceMappingURL=configQuery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configQuery.js","sourceRoot":"","sources":["../../../src/guillotine/metadata/configQuery.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,mBAAmB,EAAC,MAAM,iCAAiC,CAAC;AAGpE,MAAM,CAAC,MAAM,WAAW,GAAG,CACvB,IAAqC,EACrC,cAAc,GAAG,IAAI,EACrB,kBAAkB,GAAG,IAAI,EACnB,EAAE;IACR,MAAM,YAAY,GAAG,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,WAAW,CAAC,KAAI,EAAE,CAAC;IACzE,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC5B,OAAO,kBAAkB,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC;IACpD,CAAC;IAED,MAAM,YAAY,GAA4B,EAAE,CAAC;IACjD,YAAY;SACP,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QACf,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACtC,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACzB,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;YAC3D,IAAI,eAAe,GAAG,YAAY,CAAC,gBAAgB,CAAC,CAAC;YACrD,IAAI,CAAC,eAAe,EAAE,CAAC;gBACnB,eAAe,GAAG,EAAE,CAAC;gBACrB,YAAY,CAAC,gBAAgB,CAAC,GAAG,eAAe,CAAC;YACrD,CAAC;YACD,eAAe,CAAC,IAAI,CAAC,GAAG,mBAAmB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;QACxF,CAAC;IACL,CAAC,CAAC,CAAC;IAEP,+EAA+E;IAC/E,MAAM,iBAAiB,GAAG,kBAAkB,IAAI,YAAY,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC;IAExG,IAAI,CAAC,cAAc,EAAE,CAAC;QAClB,OAAO,GAAG,iBAAiB;;sBAEb,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;kBACtF,CAAC;IACf,CAAC;SAAM,CAAC;QACJ,OAAO,GAAG,iBAAiB;;sBAEb,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;kBAC7F,CAAC;IACf,CAAC;AACL,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const richTextQuery: (fieldName: string) => string;
@@ -1,13 +1,10 @@
1
- import {ComponentRegistry} from '../../common/ComponentRegistry';
2
- import {configQuery} from './configQuery';
3
- import {indent} from '../../utils/indent';
4
-
5
-
6
- const macroConfigQuery = (): string => {
1
+ import { ComponentRegistry } from '../../common/ComponentRegistry';
2
+ import { configQuery } from './configQuery';
3
+ import { indent } from '../../utils/indent';
4
+ const macroConfigQuery = () => {
7
5
  return configQuery(ComponentRegistry.getMacros(), false, false);
8
6
  };
9
-
10
- export const richTextQuery = (fieldName: string) => {
7
+ export const richTextQuery = (fieldName) => {
11
8
  return `${fieldName}(processHtml:{type:absolute, imageWidths:[400, 800, 1200], imageSizes:"(max-width: 400px) 400px, (max-width: 800px) 800px, 1200px"}) {
12
9
  processedHtml
13
10
  macros {
@@ -47,3 +44,4 @@ export const richTextQuery = (fieldName: string) => {
47
44
  }
48
45
  }}`;
49
46
  };
47
+ //# sourceMappingURL=richTextQuery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"richTextQuery.js","sourceRoot":"","sources":["../../../src/guillotine/metadata/richTextQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAC,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAC,MAAM,EAAC,MAAM,oBAAoB,CAAC;AAG1C,MAAM,gBAAgB,GAAG,GAAW,EAAE;IAClC,OAAO,WAAW,CAAC,iBAAiB,CAAC,SAAS,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AACpE,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,SAAiB,EAAE,EAAE;IAC/C,OAAO,GAAG,SAAS;;;;;;UAMb,MAAM,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BhC,CAAC;AACR,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { PathFragment } from '../types';
2
+ export declare function parseComponentPath(contentType: string, path: string): PathFragment[];
@@ -1,11 +1,6 @@
1
- import type {PathFragment} from '../types';
2
-
3
-
4
- import {FRAGMENT_CONTENTTYPE_NAME, FRAGMENT_DEFAULT_REGION_NAME} from '../common/constants';
5
-
6
-
7
- export function parseComponentPath(contentType: string, path: string): PathFragment[] {
8
- const matches: PathFragment[] = [];
1
+ import { FRAGMENT_CONTENTTYPE_NAME, FRAGMENT_DEFAULT_REGION_NAME } from '../common/constants';
2
+ export function parseComponentPath(contentType, path) {
3
+ const matches = [];
9
4
  let match;
10
5
  const myRegexp = /(?:(\w+)\/(\d+))+/g;
11
6
  while ((match = myRegexp.exec(path)) !== null) {
@@ -24,3 +19,4 @@ export function parseComponentPath(contentType: string, path: string): PathFragm
24
19
  }
25
20
  return matches;
26
21
  }
22
+ //# sourceMappingURL=parseComponentPath.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseComponentPath.js","sourceRoot":"","sources":["../../src/guillotine/parseComponentPath.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,yBAAyB,EAAE,4BAA4B,EAAC,MAAM,qBAAqB,CAAC;AAG5F,MAAM,UAAU,kBAAkB,CAAC,WAAmB,EAAE,IAAY;IAChE,MAAM,OAAO,GAAmB,EAAE,CAAC;IACnC,IAAI,KAAK,CAAC;IACV,MAAM,QAAQ,GAAG,oBAAoB,CAAC;IACtC,OAAO,CAAC,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;QAC5C,OAAO,CAAC,IAAI,CAAC;YACT,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;YAChB,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;SACnB,CAAC,CAAC;IACP,CAAC;IACD,IAAI,WAAW,KAAK,yBAAyB,EAAE,CAAC;QAC5C,kFAAkF;QAClF,4EAA4E;QAC5E,OAAO,CAAC,OAAO,CAAC;YACZ,MAAM,EAAE,4BAA4B;YACpC,KAAK,EAAE,CAAC;SACX,CAAC,CAAC;IACP,CAAC;IACD,OAAO,OAAO,CAAC;AACnB,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function prefixFragmentCmpPath(contentType: string, path: string): string;
@@ -1,13 +1,13 @@
1
- import {FRAGMENT_CONTENTTYPE_NAME, FRAGMENT_DEFAULT_REGION_NAME} from '../common/constants';
2
-
3
-
4
- export function prefixFragmentCmpPath(contentType: string, path: string): string {
1
+ import { FRAGMENT_CONTENTTYPE_NAME, FRAGMENT_DEFAULT_REGION_NAME } from '../common/constants';
2
+ export function prefixFragmentCmpPath(contentType, path) {
5
3
  if (contentType !== FRAGMENT_CONTENTTYPE_NAME) {
6
4
  return path;
7
- } else {
5
+ }
6
+ else {
8
7
  // prepend FRAGMENT_DEFAULT_REGION_NAME to path to conform to page structure
9
8
  // so that component with path '/' becomes /FRAGMENT_DEFAULT_REGION_NAME/0
10
9
  // path /left/1 becomes /FRAGMENT_DEFAULT_REGION_NAME/0/left/1
11
10
  return `/${FRAGMENT_DEFAULT_REGION_NAME}/0${path === '/' ? '' : path}`;
12
11
  }
13
12
  }
13
+ //# sourceMappingURL=prefixFragmentCmpPath.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prefixFragmentCmpPath.js","sourceRoot":"","sources":["../../src/guillotine/prefixFragmentCmpPath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,yBAAyB,EAAE,4BAA4B,EAAC,MAAM,qBAAqB,CAAC;AAG5F,MAAM,UAAU,qBAAqB,CAAC,WAAmB,EAAE,IAAY;IACnE,IAAI,WAAW,KAAK,yBAAyB,EAAE,CAAC;QAC5C,OAAO,IAAI,CAAC;IAChB,CAAC;SAAM,CAAC;QACJ,4EAA4E;QAC5E,0EAA0E;QAC1E,8DAA8D;QAC9D,OAAO,IAAI,4BAA4B,KAAK,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAC3E,CAAC;AACL,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { PageComponent } from '../types';
2
+ export declare function processComponentConfig(myAppName: string, myAppNameDashed: string, cmp: PageComponent): void;
@@ -1,14 +1,5 @@
1
- import type {PageComponent} from '../types';
2
-
3
-
4
- import {sanitizeGraphqlName} from '../utils/sanitizeGraphqlName';
5
-
6
-
7
- export function processComponentConfig(
8
- myAppName: string,
9
- myAppNameDashed: string,
10
- cmp: PageComponent
11
- ): void {
1
+ import { sanitizeGraphqlName } from '../utils/sanitizeGraphqlName';
2
+ export function processComponentConfig(myAppName, myAppNameDashed, cmp) {
12
3
  const cmpData = cmp[cmp.type];
13
4
  if (cmpData && 'descriptor' in cmpData && cmpData.descriptor) {
14
5
  const [appName, cmpName] = cmpData.descriptor.split(':');
@@ -16,7 +7,7 @@ export function processComponentConfig(
16
7
  return;
17
8
  }
18
9
  let config;
19
- const configArray: object[] = [];
10
+ const configArray = [];
20
11
  if ('configAsJson' in cmpData && cmpData.configAsJson && cmpData.configAsJson[myAppNameDashed]) {
21
12
  config = cmpData.configAsJson[myAppNameDashed][cmpName];
22
13
  if (config) {
@@ -36,3 +27,4 @@ export function processComponentConfig(
36
27
  }
37
28
  }
38
29
  }
30
+ //# sourceMappingURL=processComponentConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"processComponentConfig.js","sourceRoot":"","sources":["../../src/guillotine/processComponentConfig.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,mBAAmB,EAAC,MAAM,8BAA8B,CAAC;AAGjE,MAAM,UAAU,sBAAsB,CAClC,SAAiB,EACjB,eAAuB,EACvB,GAAkB;IAElB,MAAM,OAAO,GAAG,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC9B,IAAI,OAAO,IAAI,YAAY,IAAI,OAAO,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;QAC3D,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACzD,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YACxB,OAAO;QACX,CAAC;QACD,IAAI,MAAM,CAAC;QACX,MAAM,WAAW,GAAa,EAAE,CAAC;QACjC,IAAI,cAAc,IAAI,OAAO,IAAI,OAAO,CAAC,YAAY,IAAI,OAAO,CAAC,YAAY,CAAC,eAAe,CAAC,EAAE,CAAC;YAC7F,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,CAAC;YACxD,IAAI,MAAM,EAAE,CAAC;gBACT,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;gBACzB,OAAO,OAAO,CAAC,YAAY,CAAC;YAChC,CAAC;QACL,CAAC;QACD,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC;QACtD,IAAI,QAAQ,IAAI,OAAO,IAAI,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,EAAE,CAAC;YAC5E,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,CAAC;YACxE,IAAI,MAAM,EAAE,CAAC;gBACT,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAC7B,CAAC;QACL,CAAC;QACD,IAAI,WAAW,CAAC,MAAM,EAAE,CAAC;YACrB,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,GAAG,WAAW,CAAC,CAAC;QACvD,CAAC;IACL,CAAC;AACL,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { PageComponent } from '../types';
2
+ export declare function restrictComponentsToPath(contentType: string, components?: PageComponent[], componentPath?: string): PageComponent[];
@@ -1,30 +1,18 @@
1
- import type {PageComponent} from '../types';
2
-
3
-
4
- import {XP_COMPONENT_TYPE} from '../common/constants';
5
- import {parseComponentPath} from './parseComponentPath';
6
- import {prefixFragmentCmpPath} from './prefixFragmentCmpPath';
7
-
8
-
9
- export function restrictComponentsToPath(
10
- contentType: string,
11
- components?: PageComponent[],
12
- componentPath?: string
13
- ): PageComponent[] {
14
- if (!componentPath || !components?.length) {
1
+ import { XP_COMPONENT_TYPE } from '../common/constants';
2
+ import { parseComponentPath } from './parseComponentPath';
3
+ import { prefixFragmentCmpPath } from './prefixFragmentCmpPath';
4
+ export function restrictComponentsToPath(contentType, components, componentPath) {
5
+ if (!componentPath || !(components === null || components === void 0 ? void 0 : components.length)) {
15
6
  return components || [];
16
7
  }
17
-
18
8
  // filter components to the requested one only
19
9
  const component = components.find(cmp => {
20
10
  return cmp.path === componentPath;
21
11
  });
22
-
23
12
  if (!component) {
24
13
  return [];
25
14
  }
26
-
27
- let result: PageComponent[] = [component];
15
+ let result = [component];
28
16
  if (component.type !== XP_COMPONENT_TYPE.LAYOUT) {
29
17
  // remember to include all parent layouts too !
30
18
  const cmpPath = parseComponentPath(contentType, component.path);
@@ -37,7 +25,8 @@ export function restrictComponentsToPath(
37
25
  result.unshift(parentCmp);
38
26
  }
39
27
  }
40
- } else {
28
+ }
29
+ else {
41
30
  // It's a layout, include child components
42
31
  const childCmps = components.filter(cmp => cmp.path !== component.path && cmp.path.startsWith(component.path));
43
32
  if (childCmps.length) {
@@ -46,3 +35,4 @@ export function restrictComponentsToPath(
46
35
  }
47
36
  return result;
48
37
  }
38
+ //# sourceMappingURL=restrictComponentsToPath.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"restrictComponentsToPath.js","sourceRoot":"","sources":["../../src/guillotine/restrictComponentsToPath.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAC,qBAAqB,EAAC,MAAM,yBAAyB,CAAC;AAG9D,MAAM,UAAU,wBAAwB,CACpC,WAAmB,EACnB,UAA4B,EAC5B,aAAsB;IAEtB,IAAI,CAAC,aAAa,IAAI,CAAC,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,MAAM,CAAA,EAAE,CAAC;QACxC,OAAO,UAAU,IAAI,EAAE,CAAC;IAC5B,CAAC;IAED,8CAA8C;IAC9C,MAAM,SAAS,GAAG,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;QACpC,OAAO,GAAG,CAAC,IAAI,KAAK,aAAa,CAAC;IACtC,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,SAAS,EAAE,CAAC;QACb,OAAO,EAAE,CAAC;IACd,CAAC;IAED,IAAI,MAAM,GAAoB,CAAC,SAAS,CAAC,CAAC;IAC1C,IAAI,SAAS,CAAC,IAAI,KAAK,iBAAiB,CAAC,MAAM,EAAE,CAAC;QAC9C,+CAA+C;QAC/C,MAAM,OAAO,GAAG,kBAAkB,CAAC,WAAW,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;QAChE,KAAK,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YAC3C,MAAM,UAAU,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;YAC9B,MAAM,SAAS,GAAG,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;gBACpC,OAAO,qBAAqB,CAAC,WAAW,EAAE,GAAG,CAAC,IAAI,CAAC,KAAK,IAAI,UAAU,CAAC,MAAM,IAAI,UAAU,CAAC,KAAK,EAAE,CAAC;YACxG,CAAC,CAAC,CAAC;YACH,IAAI,SAAS,EAAE,CAAC;gBACZ,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;YAC9B,CAAC;QACL,CAAC;IACL,CAAC;SAAM,CAAC;QACJ,0CAA0C;QAC1C,MAAM,SAAS,GAAG,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,IAAI,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;QAC/G,IAAI,SAAS,CAAC,MAAM,EAAE,CAAC;YACnB,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACtC,CAAC;IACL,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { FetchContentResult } from '../types';
2
+ export declare function validateData(props: FetchContentResult): void;
@@ -0,0 +1,7 @@
1
+ import { validateNotFound } from './validateNotFound';
2
+ import { validateShortcut } from './validateShortcut';
3
+ export function validateData(props) {
4
+ validateNotFound(props);
5
+ validateShortcut(props);
6
+ }
7
+ //# sourceMappingURL=validateData.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validateData.js","sourceRoot":"","sources":["../../src/guillotine/validateData.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AAGpD,MAAM,UAAU,YAAY,CAAC,KAAyB;IAClD,gBAAgB,CAAC,KAAK,CAAC,CAAC;IACxB,gBAAgB,CAAC,KAAK,CAAC,CAAC;AAC5B,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { FetchContentResult } from '../types';
2
+ export declare function validateNotFound(props: FetchContentResult): void;
@@ -1,11 +1,6 @@
1
- import type {FetchContentResult} from '../types';
2
-
3
-
4
- import {notFound} from 'next/navigation';
5
-
6
-
7
- export function validateNotFound(props: FetchContentResult): void {
8
- const {error} = props;
1
+ import { notFound } from 'next/navigation';
2
+ export function validateNotFound(props) {
3
+ const { error } = props;
9
4
  if (error) {
10
5
  switch (error.code) {
11
6
  case '404':
@@ -17,4 +12,5 @@ export function validateNotFound(props: FetchContentResult): void {
17
12
  throw new Error(error.message);
18
13
  }
19
14
  }
20
- }
15
+ }
16
+ //# sourceMappingURL=validateNotFound.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validateNotFound.js","sourceRoot":"","sources":["../../src/guillotine/validateNotFound.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AAGzC,MAAM,UAAU,gBAAgB,CAAC,KAAyB;IACtD,MAAM,EAAC,KAAK,EAAC,GAAG,KAAK,CAAC;IACtB,IAAI,KAAK,EAAE,CAAC;QACR,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;YACjB,KAAK,KAAK;gBACN,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;gBACxC,QAAQ,EAAE,CAAC;gBACX,MAAM;YACV;gBACI,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;gBACzC,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACvC,CAAC;IACL,CAAC;AACL,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { FetchContentResult } from '../types';
2
+ export declare function validateShortcut(props: FetchContentResult): void;
@@ -1,43 +1,35 @@
1
- import type {FetchContentResult} from '../types';
2
-
3
-
4
- import {notFound, redirect, RedirectType} from 'next/navigation';
5
- import {RENDER_MODE} from '../common/constants';
6
- import {IS_DEV_MODE} from '../common/env';
7
- import {UrlProcessor} from '../common/UrlProcessor';
8
-
9
-
10
- export function validateShortcut(props: FetchContentResult): void {
11
- const {data, meta, error} = props;
12
- const dataObj = data?.get?.data;
13
- const pageUrl = dataObj?.target?.pageUrl;
14
- const parameters = dataObj?.parameters;
1
+ import { notFound, redirect, RedirectType } from 'next/navigation';
2
+ import { RENDER_MODE } from '../common/constants';
3
+ import { IS_DEV_MODE } from '../common/env';
4
+ import { UrlProcessor } from '../common/UrlProcessor';
5
+ export function validateShortcut(props) {
6
+ var _a, _b;
7
+ const { data, meta, error } = props;
8
+ const dataObj = (_a = data === null || data === void 0 ? void 0 : data.get) === null || _a === void 0 ? void 0 : _a.data;
9
+ const pageUrl = (_b = dataObj === null || dataObj === void 0 ? void 0 : dataObj.target) === null || _b === void 0 ? void 0 : _b.pageUrl;
10
+ const parameters = dataObj === null || dataObj === void 0 ? void 0 : dataObj.parameters;
15
11
  if (meta.type === 'base:shortcut' && pageUrl) {
16
12
  if (meta.renderMode !== RENDER_MODE.NEXT) {
17
13
  // do not show shortcut targets in preview/edit mode
18
14
  console.warn(404, `Shortcuts are not available in ${meta.renderMode} render mode`);
19
15
  notFound();
20
16
  }
21
-
22
17
  let destination = UrlProcessor.process(pageUrl, meta, true);
23
18
  if (parameters) {
24
- const searchParams = parameters.map(({name, value}) => `${encodeURIComponent(name)}=${encodeURIComponent(value)}`).join('&');
19
+ const searchParams = parameters.map(({ name, value }) => `${encodeURIComponent(name)}=${encodeURIComponent(value)}`).join('&');
25
20
  destination += '?' + searchParams;
26
21
  }
27
22
  console.debug(`Redirecting shortcut content [${meta.path}] to`, destination);
28
23
  redirect(destination, RedirectType.replace);
29
24
  }
30
-
31
25
  // we can not set 418 for static paths,
32
26
  // but we can show 404 instead to be handled in CS
33
27
  const canNotRender = meta && !meta.canRender && meta.renderMode !== RENDER_MODE.EDIT;
34
-
35
28
  const catchAllInNextProdMode = meta.renderMode === RENDER_MODE.NEXT && !IS_DEV_MODE && meta.catchAll;
36
-
37
29
  const isNotFound = (error && error.code === '404') || canNotRender || catchAllInNextProdMode;
38
-
39
30
  if (isNotFound) {
40
31
  console.warn(404, `Can not render content at [${meta.path}]`);
41
32
  notFound();
42
33
  }
43
34
  }
35
+ //# sourceMappingURL=validateShortcut.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validateShortcut.js","sourceRoot":"","sources":["../../src/guillotine/validateShortcut.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAC,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAC,WAAW,EAAC,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAC,YAAY,EAAC,MAAM,wBAAwB,CAAC;AAGpD,MAAM,UAAU,gBAAgB,CAAC,KAAyB;;IACtD,MAAM,EAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAC,GAAG,KAAK,CAAC;IAClC,MAAM,OAAO,GAAG,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,GAAG,0CAAE,IAAI,CAAC;IAChC,MAAM,OAAO,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,0CAAE,OAAO,CAAC;IACzC,MAAM,UAAU,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,UAAU,CAAC;IACvC,IAAI,IAAI,CAAC,IAAI,KAAK,eAAe,IAAI,OAAO,EAAE,CAAC;QAC3C,IAAI,IAAI,CAAC,UAAU,KAAK,WAAW,CAAC,IAAI,EAAE,CAAC;YACvC,oDAAoD;YACpD,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,kCAAkC,IAAI,CAAC,UAAU,cAAc,CAAC,CAAC;YACnF,QAAQ,EAAE,CAAC;QACf,CAAC;QAED,IAAI,WAAW,GAAG,YAAY,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAC5D,IAAI,UAAU,EAAE,CAAC;YACb,MAAM,YAAY,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,EAAC,IAAI,EAAE,KAAK,EAAC,EAAE,EAAE,CAAC,GAAG,kBAAkB,CAAC,IAAI,CAAC,IAAI,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAC7H,WAAW,IAAI,GAAG,GAAG,YAAY,CAAC;QACtC,CAAC;QACD,OAAO,CAAC,KAAK,CAAC,iCAAiC,IAAI,CAAC,IAAI,MAAM,EAAE,WAAW,CAAC,CAAC;QAC7E,QAAQ,CAAC,WAAW,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IAChD,CAAC;IAED,uCAAuC;IACvC,kDAAkD;IAClD,MAAM,YAAY,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,UAAU,KAAK,WAAW,CAAC,IAAI,CAAC;IAErF,MAAM,sBAAsB,GAAG,IAAI,CAAC,UAAU,KAAK,WAAW,CAAC,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,QAAQ,CAAC;IAErG,MAAM,UAAU,GAAG,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,YAAY,IAAI,sBAAsB,CAAC;IAE7F,IAAI,UAAU,EAAE,CAAC;QACb,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,8BAA8B,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;QAC9D,QAAQ,EAAE,CAAC;IACf,CAAC;AACL,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { LocaleContextType } from '../types';
2
+ import React from 'react';
3
+ export declare const useLocaleContext: () => LocaleContextType;
4
+ export declare const LocaleContextProvider: ({ children, locale: localeProps }: {
5
+ children: any;
6
+ locale?: string;
7
+ }) => React.JSX.Element;