@enonic/nextjs-adapter 2.0.0 → 3.0.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 (245) hide show
  1. package/baseMappings.js +3 -2
  2. package/baseMappings.js.map +1 -0
  3. package/client.d.ts +1 -0
  4. package/client.js +3 -0
  5. package/client.js.map +1 -0
  6. package/common/ComponentRegistry.d.ts +34 -0
  7. package/{ComponentRegistry.js → common/ComponentRegistry.js} +26 -26
  8. package/common/ComponentRegistry.js.map +1 -0
  9. package/{UrlProcessor.d.ts → common/UrlProcessor.d.ts} +5 -4
  10. package/{UrlProcessor.js → common/UrlProcessor.js} +40 -17
  11. package/common/UrlProcessor.js.map +1 -0
  12. package/common/constants.d.ts +50 -0
  13. package/common/constants.js +79 -0
  14. package/common/constants.js.map +1 -0
  15. package/common/env.d.ts +11 -0
  16. package/common/env.js +28 -0
  17. package/common/env.js.map +1 -0
  18. package/guillotine/applyProcessors.d.ts +2 -0
  19. package/guillotine/applyProcessors.js +33 -0
  20. package/guillotine/applyProcessors.js.map +1 -0
  21. package/guillotine/buildComponentTree.d.ts +2 -0
  22. package/guillotine/buildComponentTree.js +45 -0
  23. package/guillotine/buildComponentTree.js.map +1 -0
  24. package/guillotine/buildErrorResponse.d.ts +3 -0
  25. package/guillotine/buildErrorResponse.js +26 -0
  26. package/guillotine/buildErrorResponse.js.map +1 -0
  27. package/guillotine/buildPage.d.ts +2 -0
  28. package/guillotine/buildPage.js +10 -0
  29. package/guillotine/buildPage.js.map +1 -0
  30. package/guillotine/collectComponentDescriptors.d.ts +6 -0
  31. package/guillotine/collectComponentDescriptors.js +43 -0
  32. package/guillotine/collectComponentDescriptors.js.map +1 -0
  33. package/guillotine/combineMultipleQueries.d.ts +2 -0
  34. package/guillotine/combineMultipleQueries.js +58 -0
  35. package/guillotine/combineMultipleQueries.js.map +1 -0
  36. package/guillotine/createMetaData.d.ts +17 -0
  37. package/guillotine/createMetaData.js +44 -0
  38. package/guillotine/createMetaData.js.map +1 -0
  39. package/guillotine/fetchContent.d.ts +1 -41
  40. package/guillotine/fetchContent.js +193 -800
  41. package/guillotine/fetchContent.js.map +1 -0
  42. package/guillotine/fetchContentData.d.ts +2 -0
  43. package/guillotine/fetchContentData.js +27 -0
  44. package/guillotine/fetchContentData.js.map +1 -0
  45. package/guillotine/fetchContentPathsForAllLocales.d.ts +2 -0
  46. package/guillotine/fetchContentPathsForAllLocales.js +21 -0
  47. package/guillotine/fetchContentPathsForAllLocales.js.map +1 -0
  48. package/guillotine/fetchContentPathsForLocale.d.ts +2 -0
  49. package/guillotine/fetchContentPathsForLocale.js +40 -0
  50. package/guillotine/fetchContentPathsForLocale.js.map +1 -0
  51. package/guillotine/fetchFromApi.d.ts +3 -0
  52. package/guillotine/fetchFromApi.js +65 -0
  53. package/guillotine/fetchFromApi.js.map +1 -0
  54. package/guillotine/fetchGuillotine.d.ts +3 -0
  55. package/guillotine/fetchGuillotine.js +55 -0
  56. package/guillotine/fetchGuillotine.js.map +1 -0
  57. package/guillotine/fetchMetaData.d.ts +2 -0
  58. package/guillotine/fetchMetaData.js +30 -0
  59. package/guillotine/fetchMetaData.js.map +1 -0
  60. package/guillotine/getCleanContentPathArrayOrThrow400.d.ts +2 -0
  61. package/guillotine/getCleanContentPathArrayOrThrow400.js +20 -0
  62. package/guillotine/getCleanContentPathArrayOrThrow400.js.map +1 -0
  63. package/guillotine/getComponentConfig.d.ts +2 -0
  64. package/guillotine/getComponentConfig.js +5 -0
  65. package/guillotine/getComponentConfig.js.map +1 -0
  66. package/guillotine/getContentAndComponentPaths.d.ts +1 -0
  67. package/guillotine/getContentAndComponentPaths.js +12 -0
  68. package/guillotine/getContentAndComponentPaths.js.map +1 -0
  69. package/guillotine/getMetaData.d.ts +0 -92
  70. package/guillotine/getMetaData.js +47 -109
  71. package/guillotine/getMetaData.js.map +1 -0
  72. package/guillotine/getParentRegion.d.ts +2 -0
  73. package/guillotine/getParentRegion.js +40 -0
  74. package/guillotine/getParentRegion.js.map +1 -0
  75. package/guillotine/getQueryAndVariables.d.ts +2 -0
  76. package/guillotine/getQueryAndVariables.js +32 -0
  77. package/guillotine/getQueryAndVariables.js.map +1 -0
  78. package/guillotine/metadata/configQuery.d.ts +2 -0
  79. package/guillotine/metadata/configQuery.js +36 -0
  80. package/guillotine/metadata/configQuery.js.map +1 -0
  81. package/guillotine/metadata/richTextQuery.d.ts +1 -0
  82. package/guillotine/metadata/richTextQuery.js +32 -0
  83. package/guillotine/metadata/richTextQuery.js.map +1 -0
  84. package/guillotine/parseComponentPath.d.ts +2 -0
  85. package/guillotine/parseComponentPath.js +22 -0
  86. package/guillotine/parseComponentPath.js.map +1 -0
  87. package/guillotine/prefixLayoutPath.d.ts +1 -0
  88. package/guillotine/prefixLayoutPath.js +13 -0
  89. package/guillotine/prefixLayoutPath.js.map +1 -0
  90. package/guillotine/processComponentConfig.d.ts +2 -0
  91. package/guillotine/processComponentConfig.js +30 -0
  92. package/guillotine/processComponentConfig.js.map +1 -0
  93. package/guillotine/restrictComponentsToPath.d.ts +2 -0
  94. package/guillotine/restrictComponentsToPath.js +35 -0
  95. package/guillotine/restrictComponentsToPath.js.map +1 -0
  96. package/guillotine/validateData.d.ts +2 -0
  97. package/guillotine/validateData.js +7 -0
  98. package/guillotine/validateData.js.map +1 -0
  99. package/guillotine/validateNotFound.d.ts +2 -0
  100. package/guillotine/validateNotFound.js +16 -0
  101. package/guillotine/validateNotFound.js.map +1 -0
  102. package/guillotine/validateShortcut.d.ts +2 -0
  103. package/guillotine/validateShortcut.js +29 -0
  104. package/guillotine/validateShortcut.js.map +1 -0
  105. package/i18n/LocaleContext.d.ts +7 -0
  106. package/i18n/LocaleContext.jsx +46 -0
  107. package/i18n/LocaleContext.jsx.map +1 -0
  108. package/i18n/i18n.d.ts +11 -0
  109. package/i18n/i18n.js +57 -0
  110. package/i18n/i18n.js.map +1 -0
  111. package/index.d.ts +18 -5
  112. package/index.js +18 -5
  113. package/index.js.map +1 -0
  114. package/package.json +67 -16
  115. package/query/Shortcut.js +1 -0
  116. package/query/Shortcut.js.map +1 -0
  117. package/types/component.d.ts +114 -0
  118. package/types/component.js +2 -0
  119. package/types/component.js.map +1 -0
  120. package/types/componentProps.d.ts +104 -0
  121. package/types/componentProps.js +2 -0
  122. package/types/componentProps.js.map +1 -0
  123. package/types/guillotine.d.ts +342 -0
  124. package/types/guillotine.js +2 -0
  125. package/types/guillotine.js.map +1 -0
  126. package/types/i18n.d.ts +7 -0
  127. package/types/i18n.js +2 -0
  128. package/types/i18n.js.map +1 -0
  129. package/types/index.d.ts +45 -0
  130. package/types/index.js +3 -0
  131. package/types/index.js.map +1 -0
  132. package/types/next.d.ts +6 -0
  133. package/types/next.js +2 -0
  134. package/types/next.js.map +1 -0
  135. package/types/util.d.ts +3 -0
  136. package/types/util.js +3 -0
  137. package/types/util.js.map +1 -0
  138. package/utils/addLineNumbers.d.ts +1 -0
  139. package/utils/addLineNumbers.js +4 -0
  140. package/utils/addLineNumbers.js.map +1 -0
  141. package/utils/buildGuillotineRequestHeaders.d.ts +7 -0
  142. package/utils/buildGuillotineRequestHeaders.js +16 -0
  143. package/utils/buildGuillotineRequestHeaders.js.map +1 -0
  144. package/utils/commonChars.d.ts +1 -0
  145. package/utils/commonChars.js +17 -0
  146. package/utils/commonChars.js.map +1 -0
  147. package/utils/fixDoubleSlashes.d.ts +1 -0
  148. package/utils/fixDoubleSlashes.js +4 -0
  149. package/utils/fixDoubleSlashes.js.map +1 -0
  150. package/utils/getContentApiUrl.d.ts +2 -0
  151. package/utils/getContentApiUrl.js +15 -0
  152. package/utils/getContentApiUrl.js.map +1 -0
  153. package/utils/getProjectLocaleConfig.d.ts +2 -0
  154. package/utils/getProjectLocaleConfig.js +19 -0
  155. package/utils/getProjectLocaleConfig.js.map +1 -0
  156. package/utils/getProjectLocaleConfigById.d.ts +2 -0
  157. package/utils/getProjectLocaleConfigById.js +16 -0
  158. package/utils/getProjectLocaleConfigById.js.map +1 -0
  159. package/utils/getProjectLocaleConfigByLocale.d.ts +2 -0
  160. package/utils/getProjectLocaleConfigByLocale.js +13 -0
  161. package/utils/getProjectLocaleConfigByLocale.js.map +1 -0
  162. package/utils/getProjectLocaleConfigs.d.ts +2 -0
  163. package/utils/getProjectLocaleConfigs.js +30 -0
  164. package/utils/getProjectLocaleConfigs.js.map +1 -0
  165. package/utils/getProjectLocales.d.ts +1 -0
  166. package/utils/getProjectLocales.js +5 -0
  167. package/utils/getProjectLocales.js.map +1 -0
  168. package/utils/getRenderMode.d.ts +3 -0
  169. package/utils/getRenderMode.js +8 -0
  170. package/utils/getRenderMode.js.map +1 -0
  171. package/utils/getRequestLocaleInfo.d.ts +6 -0
  172. package/utils/getRequestLocaleInfo.js +26 -0
  173. package/utils/getRequestLocaleInfo.js.map +1 -0
  174. package/utils/getXpBaseUrl.d.ts +2 -0
  175. package/utils/getXpBaseUrl.js +8 -0
  176. package/utils/getXpBaseUrl.js.map +1 -0
  177. package/utils/indent.d.ts +1 -0
  178. package/utils/indent.js +5 -0
  179. package/utils/indent.js.map +1 -0
  180. package/utils/sanitizeGraphqlName.d.ts +1 -0
  181. package/utils/sanitizeGraphqlName.js +12 -0
  182. package/utils/sanitizeGraphqlName.js.map +1 -0
  183. package/views/BaseComponent.d.ts +5 -10
  184. package/views/BaseComponent.jsx +17 -6
  185. package/views/BaseComponent.jsx.map +1 -0
  186. package/views/BaseContent.d.ts +3 -3
  187. package/views/BaseContent.jsx +2 -5
  188. package/views/BaseContent.jsx.map +1 -0
  189. package/views/BaseLayout.d.ts +3 -16
  190. package/views/BaseLayout.jsx +3 -3
  191. package/views/BaseLayout.jsx.map +1 -0
  192. package/views/BaseMacro.d.ts +3 -13
  193. package/views/BaseMacro.jsx +4 -3
  194. package/views/BaseMacro.jsx.map +1 -0
  195. package/views/BasePage.d.ts +3 -18
  196. package/views/BasePage.jsx +3 -3
  197. package/views/BasePage.jsx.map +1 -0
  198. package/views/BasePart.d.ts +3 -18
  199. package/views/BasePart.jsx +3 -3
  200. package/views/BasePart.jsx.map +1 -0
  201. package/views/Empty.d.ts +2 -2
  202. package/views/Empty.jsx +2 -1
  203. package/views/Empty.jsx.map +1 -0
  204. package/views/Fragment.d.ts +3 -9
  205. package/views/Fragment.jsx +2 -2
  206. package/views/Fragment.jsx.map +1 -0
  207. package/views/MainView.d.ts +3 -3
  208. package/views/MainView.jsx +2 -2
  209. package/views/MainView.jsx.map +1 -0
  210. package/views/PropsView.d.ts +3 -0
  211. package/views/PropsView.jsx +21 -0
  212. package/views/PropsView.jsx.map +1 -0
  213. package/views/Region.d.ts +4 -17
  214. package/views/Region.jsx +2 -2
  215. package/views/Region.jsx.map +1 -0
  216. package/views/RichTextView.d.ts +3 -13
  217. package/views/RichTextView.jsx +6 -3
  218. package/views/RichTextView.jsx.map +1 -0
  219. package/views/SingleComponent.d.ts +3 -3
  220. package/views/SingleComponent.jsx +1 -2
  221. package/views/SingleComponent.jsx.map +1 -0
  222. package/views/StaticContent.d.ts +2 -6
  223. package/views/StaticContent.jsx +1 -0
  224. package/views/StaticContent.jsx.map +1 -0
  225. package/views/Text.d.ts +5 -5
  226. package/views/Text.jsx +1 -1
  227. package/views/Text.jsx.map +1 -0
  228. package/views/getClientHydratedHtml.d.ts +2 -0
  229. package/views/getClientHydratedHtml.jsx +9 -0
  230. package/views/getClientHydratedHtml.jsx.map +1 -0
  231. package/views/macros/DefaultMacro.d.ts +1 -1
  232. package/views/macros/DefaultMacro.jsx +1 -0
  233. package/views/macros/DefaultMacro.jsx.map +1 -0
  234. package/views/macros/DisableMacro.d.ts +1 -1
  235. package/views/macros/DisableMacro.jsx +1 -0
  236. package/views/macros/DisableMacro.jsx.map +1 -0
  237. package/ComponentRegistry.d.ts +0 -64
  238. package/server/ClearableFileCache.d.ts +0 -31
  239. package/server/ClearableFileCache.js +0 -472
  240. package/server/cache.d.ts +0 -2
  241. package/server/cache.js +0 -129
  242. package/server/index.d.ts +0 -5
  243. package/server/index.js +0 -132
  244. package/utils.d.ts +0 -114
  245. package/utils.js +0 -241
@@ -0,0 +1,30 @@
1
+ import { ENV_VARS } from '../common/constants';
2
+ import { PROJECTS } from '../common/env';
3
+ // NOTE: Dissallowing slash and any whitespace in 2nd capture group.
4
+ const PROJECT_CONFIG_REGEXP = /^([\w-]+):([^/\s]+)(\/[\w.-]+)?$/i;
5
+ export function getProjectLocaleConfigs() {
6
+ const str = PROJECTS;
7
+ if (!(str === null || str === void 0 ? void 0 : str.length)) {
8
+ throw new Error(`Did you forget to define "${ENV_VARS.PROJECTS}" environmental variable?
9
+ Format: <default-language>:<default-repository-name>/<default-site-path>,<language>:<repository-name>/<site-path>,...`);
10
+ }
11
+ return str.split(',').reduce((config, prjStr, index) => {
12
+ const trimmedprjStr = prjStr.trim();
13
+ if (!trimmedprjStr.length) {
14
+ return config;
15
+ }
16
+ const matches = PROJECT_CONFIG_REGEXP.exec(trimmedprjStr);
17
+ if (!(matches === null || matches === void 0 ? void 0 : matches.length)) {
18
+ throw new Error(`Project "${prjStr}" doesn't match format: <default-language>:<default-repository-name>/<default-site-path>,<language>:<repository-name>/<site-path>`);
19
+ }
20
+ const [_full, lang, project, site] = matches;
21
+ config[lang] = {
22
+ default: index === 0,
23
+ project,
24
+ site,
25
+ locale: lang,
26
+ };
27
+ return config;
28
+ }, {});
29
+ }
30
+ //# sourceMappingURL=getProjectLocaleConfigs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getProjectLocaleConfigs.js","sourceRoot":"","sources":["../../src/utils/getProjectLocaleConfigs.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,QAAQ,EAAC,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AAGvC,oEAAoE;AACpE,MAAM,qBAAqB,GAAG,mCAAmC,CAAC;AAGlE,MAAM,UAAU,uBAAuB;IACnC,MAAM,GAAG,GAAG,QAAQ,CAAC;IACrB,IAAI,CAAC,CAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,MAAM,CAAA,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,6BAA6B,QAAQ,CAAC,QAAQ;8HACwD,CAAC,CAAC;IAC5H,CAAC;IACD,OAAO,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,KAAa,EAAE,EAAE;QAC3D,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;QACpC,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC;YACxB,OAAO,MAAM,CAAC;QAClB,CAAC;QACD,MAAM,OAAO,GAAoB,qBAAqB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAC3E,IAAI,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,CAAA,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,YAAY,MAAM,mIAAmI,CAAC,CAAC;QAC3K,CAAC;QACD,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC;QAC7C,MAAM,CAAC,IAAI,CAAC,GAAG;YACX,OAAO,EAAE,KAAK,KAAK,CAAC;YACpB,OAAO;YACP,IAAI;YACJ,MAAM,EAAE,IAAI;SACf,CAAC;QACF,OAAO,MAAM,CAAC;IAClB,CAAC,EAAE,EAAE,CAAC,CAAC;AACX,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function getProjectLocales(): string[];
@@ -0,0 +1,5 @@
1
+ import { getProjectLocaleConfigs } from './getProjectLocaleConfigs';
2
+ export function getProjectLocales() {
3
+ return Object.keys(getProjectLocaleConfigs());
4
+ }
5
+ //# sourceMappingURL=getProjectLocales.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getProjectLocales.js","sourceRoot":"","sources":["../../src/utils/getProjectLocales.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,uBAAuB,EAAC,MAAM,2BAA2B,CAAC;AAGlE,MAAM,UAAU,iBAAiB;IAC7B,OAAO,MAAM,CAAC,IAAI,CAAC,uBAAuB,EAAE,CAAC,CAAC;AAClD,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Context } from '../types';
2
+ import { RENDER_MODE } from '../common/constants';
3
+ export declare const getRenderMode: (context: Context) => RENDER_MODE;
@@ -0,0 +1,8 @@
1
+ import { RENDER_MODE, RENDER_MODE_HEADER, } from '../common/constants';
2
+ export const getRenderMode = (context) => {
3
+ var _a;
4
+ const value = (_a = context.headers) === null || _a === void 0 ? void 0 : _a.get(RENDER_MODE_HEADER);
5
+ const enumValue = RENDER_MODE[value === null || value === void 0 ? void 0 : value.toUpperCase()];
6
+ return enumValue || RENDER_MODE[process.env.RENDER_MODE] || RENDER_MODE.NEXT;
7
+ };
8
+ //# sourceMappingURL=getRenderMode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getRenderMode.js","sourceRoot":"","sources":["../../src/utils/getRenderMode.ts"],"names":[],"mappings":"AAGA,OAAO,EACH,WAAW,EACX,kBAAkB,GACrB,MAAM,qBAAqB,CAAC;AAG7B,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,OAAgB,EAAe,EAAE;;IAC3D,MAAM,KAAK,GAAG,MAAA,OAAO,CAAC,OAAO,0CAAE,GAAG,CAAC,kBAAkB,CAAC,CAAC;IACvD,MAAM,SAAS,GAAG,WAAW,CAAE,KAAkC,aAAlC,KAAK,uBAAL,KAAK,CAA+B,WAAW,EAAE,CAAC,CAAC;IAClF,OAAO,SAAS,IAAI,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC;AACjF,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { Context } from '../types';
2
+ export declare function getRequestLocaleInfo(context: Context): {
3
+ locale: string;
4
+ locales: string[];
5
+ defaultLocale: string;
6
+ };
@@ -0,0 +1,26 @@
1
+ import Negotiator from 'negotiator';
2
+ import { match as localeMatcher } from '@formatjs/intl-localematcher';
3
+ import { PROJECT_ID_HEADER } from '../common/constants';
4
+ import { getProjectLocaleConfigs } from './getProjectLocaleConfigs';
5
+ import { getProjectLocaleConfigById } from './getProjectLocaleConfigById';
6
+ export function getRequestLocaleInfo(context) {
7
+ var _a, _b, _c;
8
+ let locale;
9
+ const configs = getProjectLocaleConfigs();
10
+ const locales = Object.keys(configs);
11
+ const defaultLocale = locales.find((locale) => configs[locale].default);
12
+ const projectId = (_a = context.headers) === null || _a === void 0 ? void 0 : _a.get(PROJECT_ID_HEADER);
13
+ if (projectId) {
14
+ locale = (_b = getProjectLocaleConfigById(projectId, false)) === null || _b === void 0 ? void 0 : _b.locale;
15
+ }
16
+ else {
17
+ locale = context.locale;
18
+ if (!locale) {
19
+ const acceptLang = ((_c = context.headers) === null || _c === void 0 ? void 0 : _c.get('accept-language')) || '';
20
+ const langs = new Negotiator({ headers: { 'accept-language': acceptLang } }).languages();
21
+ locale = localeMatcher(langs, locales, defaultLocale);
22
+ }
23
+ }
24
+ return { locale, locales, defaultLocale };
25
+ }
26
+ //# sourceMappingURL=getRequestLocaleInfo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getRequestLocaleInfo.js","sourceRoot":"","sources":["../../src/utils/getRequestLocaleInfo.ts"],"names":[],"mappings":"AAGA,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAC,KAAK,IAAI,aAAa,EAAC,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAC,uBAAuB,EAAC,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAC,0BAA0B,EAAC,MAAM,8BAA8B,CAAC;AAGxE,MAAM,UAAU,oBAAoB,CAAC,OAAgB;;IACjD,IAAI,MAAc,CAAC;IACnB,MAAM,OAAO,GAAG,uBAAuB,EAAE,CAAC;IAC1C,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACrC,MAAM,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC;IACxE,MAAM,SAAS,GAAG,MAAA,OAAO,CAAC,OAAO,0CAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC;IAC1D,IAAI,SAAS,EAAE,CAAC;QACZ,MAAM,GAAG,MAAA,0BAA0B,CAAC,SAAS,EAAE,KAAK,CAAC,0CAAE,MAAM,CAAC;IAElE,CAAC;SAAM,CAAC;QACJ,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QACxB,IAAI,CAAC,MAAM,EAAE,CAAC;YACV,MAAM,UAAU,GAAG,CAAA,MAAA,OAAO,CAAC,OAAO,0CAAE,GAAG,CAAC,iBAAiB,CAAC,KAAI,EAAE,CAAC;YACjE,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,EAAC,OAAO,EAAE,EAAC,iBAAiB,EAAE,UAAU,EAAC,EAAC,CAAC,CAAC,SAAS,EAAE,CAAC;YACrF,MAAM,GAAG,aAAa,CAAC,KAAK,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC;QAC1D,CAAC;IACL,CAAC;IACD,OAAO,EAAC,MAAM,EAAE,OAAO,EAAE,aAAa,EAAC,CAAC;AAC5C,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { Context } from '../types';
2
+ export declare const getXpBaseUrl: (context: Context) => string;
@@ -0,0 +1,8 @@
1
+ import { XP_BASE_URL_HEADER } from '../common/constants';
2
+ export const getXpBaseUrl = (context) => {
3
+ var _a;
4
+ const header = ((_a = context.headers) === null || _a === void 0 ? void 0 : _a.get(XP_BASE_URL_HEADER)) || '/';
5
+ // TODO: workaround for XP pattern controller mapping not picked up in edit mode
6
+ return header.replace(/\/edit\//, '/inline/');
7
+ };
8
+ //# sourceMappingURL=getXpBaseUrl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getXpBaseUrl.js","sourceRoot":"","sources":["../../src/utils/getXpBaseUrl.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,kBAAkB,EAAC,MAAM,qBAAqB,CAAC;AAGvD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,OAAgB,EAAU,EAAE;;IACrD,MAAM,MAAM,GAAG,CAAA,MAAA,OAAO,CAAC,OAAO,0CAAE,GAAG,CAAC,kBAAkB,CAAC,KAAI,GAAG,CAAC;IAE/D,gFAAgF;IAChF,OAAO,MAAM,CAAC,OAAO,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;AAClD,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const indent: (s: string, count?: number, indentChar?: string) => string;
@@ -0,0 +1,5 @@
1
+ export const indent = (s, count = 2, indentChar = ' ') => s
2
+ .split('\n')
3
+ .map((line) => `${indentChar.repeat(count)}${line}`)
4
+ .join('\n');
5
+ //# sourceMappingURL=indent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"indent.js","sourceRoot":"","sources":["../../src/utils/indent.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,CAAS,EAAE,KAAK,GAAG,CAAC,EAAE,UAAU,GAAG,GAAG,EAAE,EAAE,CAAC,CAAC;KAC9D,KAAK,CAAC,IAAI,CAAC;KACX,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,EAAE,CAAC;KACnD,IAAI,CAAC,IAAI,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const sanitizeGraphqlName: (text: string) => string;
@@ -0,0 +1,12 @@
1
+ // sanitizes text according to graphql naming spec http://spec.graphql.org/October2021/#sec-Names
2
+ export const sanitizeGraphqlName = (text) => {
3
+ if (!text || text.trim().length === 0) {
4
+ return '';
5
+ }
6
+ let result = text.replace(/([^0-9A-Za-z])+/g, '_');
7
+ if (result.length > 0 && /[0-9]/.test(result.charAt(0))) {
8
+ result = '_' + result;
9
+ }
10
+ return result;
11
+ };
12
+ //# sourceMappingURL=sanitizeGraphqlName.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sanitizeGraphqlName.js","sourceRoot":"","sources":["../../src/utils/sanitizeGraphqlName.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,IAAY,EAAE,EAAE;IAChD,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACpC,OAAO,EAAE,CAAC;IACd,CAAC;IACD,IAAI,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,kBAAkB,EAAE,GAAG,CAAC,CAAC;IACnD,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACtD,MAAM,GAAG,GAAG,GAAG,MAAM,CAAC;IAC1B,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC,CAAC"}
@@ -1,25 +1,20 @@
1
- import React from 'react';
2
- import { MetaData, PageComponent } from '../guillotine/getMetaData';
3
- export type BaseComponentProps = {
4
- component: PageComponent;
5
- meta: MetaData;
6
- common?: any;
7
- };
1
+ /// <reference types="react" />
2
+ import type { BaseComponentProps, MetaData } from '../types';
8
3
  declare const BaseComponent: ({ component, meta, common }: BaseComponentProps) => JSX.Element;
9
4
  export default BaseComponent;
10
5
  export declare const MissingComponent: ({ descriptor, type }: {
11
6
  descriptor?: string;
12
7
  type: string;
13
- }) => React.JSX.Element;
8
+ }) => import("react").JSX.Element;
14
9
  export declare function shouldShowMissingView(meta: MetaData): boolean;
15
10
  export declare const ErrorComponent: ({ type, descriptor, reason }: {
16
11
  type?: string;
17
12
  descriptor?: string;
18
13
  reason: string;
19
- }) => React.JSX.Element;
14
+ }) => import("react").JSX.Element;
20
15
  export declare function shouldShowErrorView(meta: MetaData): boolean;
21
16
  export declare const PlaceholderComponent: ({ type, descriptor }: {
22
17
  type?: string;
23
18
  descriptor?: string;
24
- }) => React.JSX.Element;
19
+ }) => import("react").JSX.Element;
25
20
  export declare function shouldShowPlaceholderView(meta: MetaData): boolean;
@@ -1,8 +1,8 @@
1
- import React from 'react';
2
- import { IS_DEV_MODE, PORTAL_COMPONENT_ATTRIBUTE, RENDER_MODE, XP_COMPONENT_TYPE } from '../utils';
3
- import { ComponentRegistry } from '../ComponentRegistry';
1
+ import { PORTAL_COMPONENT_ATTRIBUTE, RENDER_MODE, XP_COMPONENT_TYPE } from '../common/constants';
2
+ import { IS_DEV_MODE } from '../common/env';
3
+ import { ComponentRegistry } from '../common/ComponentRegistry';
4
4
  import Empty from './Empty';
5
- import * as ReactDOMServer from 'react-dom/server';
5
+ import getClientHydratedHtml from './getClientHydratedHtml';
6
6
  const BaseComponent = ({ component, meta, common }) => {
7
7
  var _a;
8
8
  const { type, error } = component;
@@ -28,8 +28,8 @@ const BaseComponent = ({ component, meta, common }) => {
28
28
  }
29
29
  // need to display a placeholder if descriptor is empty as component is not initialized yet
30
30
  if (descriptor && shouldShowPlaceholderView(meta)) {
31
- const outputHTML = ReactDOMServer.renderToString(ComponentView);
32
- if (!outputHTML || outputHTML.trim().length === 0) {
31
+ const outputHTML = renderComponent(ComponentView);
32
+ if (!(outputHTML === null || outputHTML === void 0 ? void 0 : outputHTML.trim().length)) {
33
33
  // render some placeholder in case of empty output
34
34
  ComponentView = <PlaceholderComponent type={type} descriptor={descriptor}/>;
35
35
  }
@@ -57,6 +57,16 @@ export const MissingComponent = ({ descriptor, type }) => {
57
57
  <p style={{ marginBottom: 0, color: 'grey' }}>{`Missing ${type} with descriptor: ${descriptor}`}</p>
58
58
  </div>);
59
59
  };
60
+ const renderComponent = (component) => {
61
+ if (typeof document !== 'undefined') {
62
+ // render component on the client to see if it's empty
63
+ return getClientHydratedHtml(component);
64
+ }
65
+ else {
66
+ // report non-empty output for server-side rendering
67
+ return '<div>Server-side rendered component</div>';
68
+ }
69
+ };
60
70
  export function shouldShowMissingView(meta) {
61
71
  return IS_DEV_MODE || meta.renderMode !== RENDER_MODE.NEXT;
62
72
  }
@@ -112,3 +122,4 @@ export const PlaceholderComponent = ({ type, descriptor }) => {
112
122
  export function shouldShowPlaceholderView(meta) {
113
123
  return meta.renderMode === RENDER_MODE.EDIT;
114
124
  }
125
+ //# sourceMappingURL=BaseComponent.jsx.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseComponent.jsx","sourceRoot":"","sources":["../../src/views/BaseComponent.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAC,0BAA0B,EAAE,WAAW,EAAE,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AAC/F,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAC,iBAAiB,EAAC,MAAM,6BAA6B,CAAC;AAC9D,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,qBAAqB,MAAM,yBAAyB,CAAC;AAG5D,MAAM,aAAa,GAAG,CAAC,EAAC,SAAS,EAAE,IAAI,EAAE,MAAM,EAAqB,EAAE,EAAE;;IACpE,MAAM,EAAC,IAAI,EAAE,KAAK,EAAC,GAAG,SAAS,CAAC;IAChC,MAAM,OAAO,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;IAChC,MAAM,UAAU,GAAG,OAAO,IAAI,YAAY,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC;IAEvF,IAAI,aAAiC,CAAC;IAEtC,IAAI,KAAK,EAAE,CAAC;QACR,oDAAoD;QACpD,OAAO,CAAC,IAAI,CAAC,kBAAkB,IAAI,KAAK,UAAU,YAAY,KAAK,EAAE,CAAC,CAAC;QACvE,aAAa,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,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QAAQ,CAAC,KAAK,GAAG,KAAK,CAAC;IAC3B,CAAC;IAED,IAAI,SAAS,CAAC,IAAI,KAAK,iBAAiB,CAAC,MAAM,EAAE,CAAC;QAC9C,wFAAwF;QACxF,QAAQ,CAAC,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC;IACzC,CAAC;IACD,OAAO,QAAQ,CAAC;AACpB,CAAC;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,EAAC,IAAI,EAAE,UAAU,EAAyC,EAAE,EAAE;IAC/F,OAAO,CACH,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YACR,MAAM,EAAE,qBAAqB;YAC7B,OAAO,EAAE,MAAM;SAClB,CAAC,CACE;YAAA,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,EAAC,MAAM,EAAE,CAAC,EAAE,aAAa,EAAE,YAAY,EAAC,CAAC,CAAC,YAAY,EAAE,EAAE,CACrE;YAAA,CAAC,UAAU,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAC,KAAK,EAAE,MAAM,EAAC,CAAC,CAAC,CAAC,GAAG,IAAI,KAAK,UAAU,mBAAmB,CAAC,EAAE,CAAC,CAAC,CAC7F;QAAA,EAAE,GAAG,CAAC,CACT,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,UAAU,yBAAyB,CAAC,IAAc;IACpD,OAAO,IAAI,CAAC,UAAU,KAAK,WAAW,CAAC,IAAI,CAAC;AAChD,CAAC"}
@@ -1,4 +1,4 @@
1
- import React from 'react';
2
- import { FetchContentResult } from '../guillotine/fetchContent';
3
- declare const BaseContent: (props: FetchContentResult) => React.JSX.Element;
1
+ /// <reference types="react" />
2
+ import type { FetchContentResult } from '../types';
3
+ declare const BaseContent: (props: FetchContentResult) => import("react").JSX.Element;
4
4
  export default BaseContent;
@@ -1,5 +1,4 @@
1
- import React from 'react';
2
- import { ComponentRegistry } from '../ComponentRegistry';
1
+ import { ComponentRegistry } from '../common/ComponentRegistry';
3
2
  import BasePage from './BasePage';
4
3
  const BaseContent = (props) => {
5
4
  const { common, meta, page } = props;
@@ -12,11 +11,9 @@ const BaseContent = (props) => {
12
11
  const typeDef = ComponentRegistry.getContentType(meta.type);
13
12
  const ContentTypeView = typeDef === null || typeDef === void 0 ? void 0 : typeDef.view;
14
13
  if (ContentTypeView && !(typeDef === null || typeDef === void 0 ? void 0 : typeDef.catchAll)) {
15
- // console.info(`BaseContent: rendering '${meta.type}' with content type: ${ContentTypeView.name}`);
16
14
  return <ContentTypeView {...props}/>;
17
15
  }
18
16
  else if (pageDesc) {
19
- // console.info(`BaseContent: rendering '${meta.type}' with page: ${BasePage.name}`);
20
17
  const pageAttrs = {
21
18
  component: pageData,
22
19
  path: page === null || page === void 0 ? void 0 : page.path,
@@ -32,10 +29,10 @@ const BaseContent = (props) => {
32
29
  return <BasePage {...pageAttrs}/>;
33
30
  }
34
31
  else if (ContentTypeView) {
35
- // console.info(`BaseContent: rendering '${meta.type}' with content type catch-all: ${ContentTypeView.name}`);
36
32
  return <ContentTypeView {...props}/>;
37
33
  }
38
34
  console.log(`BaseContent: can not render ${meta.type}: no content type or page view defined`);
39
35
  return null;
40
36
  };
41
37
  export default BaseContent;
38
+ //# sourceMappingURL=BaseContent.jsx.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseContent.jsx","sourceRoot":"","sources":["../../src/views/BaseContent.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAC,iBAAiB,EAAC,MAAM,6BAA6B,CAAC;AAC9D,OAAO,QAAQ,MAAM,YAAY,CAAC;AAGlC,MAAM,WAAW,GAAG,CAAC,KAAyB,EAAE,EAAE;IAC9C,MAAM,EAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAC,GAAG,KAAK,CAAC;IAEnC,IAAI,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,CAAA,EAAE,CAAC;QACd,OAAO,CAAC,IAAI,CAAC,2CAA2C,CAAC,CAAC;QAC1D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,CAAC;AAChB,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -1,17 +1,4 @@
1
- import React from 'react';
2
- import { LayoutData, MetaData, RegionTree } from '../guillotine/getMetaData';
3
- export interface LayoutProps {
4
- layout: LayoutData;
5
- path: string;
6
- common: any;
7
- meta: MetaData;
8
- }
9
- interface BaseLayoutProps {
10
- component?: LayoutData;
11
- path: string;
12
- regions?: RegionTree;
13
- common?: any;
14
- meta: MetaData;
15
- }
16
- declare const BaseLayout: (props: BaseLayoutProps) => React.JSX.Element;
1
+ /// <reference types="react" />
2
+ import type { BaseLayoutProps } from '../types';
3
+ declare const BaseLayout: (props: BaseLayoutProps) => import("react").JSX.Element;
17
4
  export default BaseLayout;
@@ -1,6 +1,5 @@
1
- import React from 'react';
2
- import { ComponentRegistry } from '../ComponentRegistry';
3
- import { XP_COMPONENT_TYPE } from '../utils';
1
+ import { XP_COMPONENT_TYPE } from '../common/constants';
2
+ import { ComponentRegistry } from '../common/ComponentRegistry';
4
3
  import { MissingComponent, shouldShowMissingView } from './BaseComponent';
5
4
  const BaseLayout = (props) => {
6
5
  const { component, common, regions, meta, path } = props;
@@ -22,3 +21,4 @@ const BaseLayout = (props) => {
22
21
  return null;
23
22
  };
24
23
  export default BaseLayout;
24
+ //# sourceMappingURL=BaseLayout.jsx.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseLayout.jsx","sourceRoot":"","sources":["../../src/views/BaseLayout.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAC,iBAAiB,EAAC,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAC,gBAAgB,EAAE,qBAAqB,EAAC,MAAM,iBAAiB,CAAC;AAGxE,MAAM,UAAU,GAAG,CAAC,KAAsB,EAAE,EAAE;IAE1C,MAAM,EAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAC,GAAG,KAAK,CAAC;IACvD,IAAI,eAAe,CAAC;IACpB,IAAI,SAAS,EAAE,CAAC;QACZ,eAAe,GAAG,iBAAiB,CAAC,SAAS,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IACxE,CAAC;IACD,MAAM,kBAAkB,GAAG,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,IAAI,CAAC;IACjD,IAAI,kBAAkB,EAAE,CAAC;QACrB,OAAO,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,EAAC,UAAU,EAAE,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,UAAU,EAAE,OAAO,EAAE,OAAO,IAAI,EAAE,EAAE,MAAM,EAAE,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,MAAM,EAAC,CAAC,CAC/F,IAAI,CAAC,CAAC,IAAI,CAAC,CACX,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;IAC7C,CAAC;SAAM,IAAI,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,UAAU,EAAE,CAAC;QAC/B,sDAAsD;QACtD,OAAO,CAAC,IAAI,CAAC,sCAAsC,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,UAAU,sCAAsC,CAAC,CAAC;QAChH,IAAI,qBAAqB,CAAC,IAAI,CAAC,EAAE,CAAC;YAC9B,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,CAAC;QACjG,CAAC;IACL,CAAC;IACD,OAAO,IAAI,CAAC;AAChB,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -1,16 +1,6 @@
1
- import React from 'react';
2
- import { MacroConfig, MacroData, MetaData } from '../guillotine/getMetaData';
1
+ /// <reference types="react" />
2
+ import type { BaseMacroProps } from '../types';
3
3
  export declare const MACRO_DISABLE = "system:disable";
4
4
  export declare const MACRO_EMBED = "system:embed";
5
- interface BaseMacroProps {
6
- data: MacroData;
7
- meta: MetaData;
8
- renderInEditMode?: boolean;
9
- }
10
- export interface MacroProps {
11
- name: string;
12
- config: MacroConfig;
13
- meta: MetaData;
14
- }
15
- declare const BaseMacro: (props: BaseMacroProps) => React.JSX.Element;
5
+ declare const BaseMacro: (props: BaseMacroProps) => import("react").JSX.Element;
16
6
  export default BaseMacro;
@@ -1,6 +1,6 @@
1
- import React from 'react';
2
- import { ComponentRegistry } from '../ComponentRegistry';
3
- import { RENDER_MODE, sanitizeGraphqlName } from '../utils';
1
+ import { ComponentRegistry } from '../common/ComponentRegistry';
2
+ import { RENDER_MODE } from '../common/constants';
3
+ import { sanitizeGraphqlName } from '../utils/sanitizeGraphqlName';
4
4
  import HTMLReactParser from 'html-react-parser';
5
5
  const unescape = require('unescape');
6
6
  export const MACRO_DISABLE = 'system:disable';
@@ -83,3 +83,4 @@ function formatAttributes(config) {
83
83
  return attrs.length ? ` ${attrs.join(' ')}` : '';
84
84
  }
85
85
  export default BaseMacro;
86
+ //# sourceMappingURL=BaseMacro.jsx.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseMacro.jsx","sourceRoot":"","sources":["../../src/views/BaseMacro.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAC,iBAAiB,EAAC,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAC,WAAW,EAAC,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAC,mBAAmB,EAAC,MAAM,8BAA8B,CAAC;AACjE,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAGhD,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAErC,MAAM,CAAC,MAAM,aAAa,GAAG,gBAAgB,CAAC;AAC9C,MAAM,CAAC,MAAM,WAAW,GAAG,cAAc,CAAC;AAG1C,MAAM,SAAS,GAAG,CAAC,KAAqB,EAAE,EAAE;IACxC,MAAM,EAAC,IAAI,EAAE,IAAI,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;YAAC,OAAO,CAAC,EAAE,CAAC;gBACT,0CAA0C;gBAC1C,SAAS,GAAG,cAAc,CAAC;YAC/B,CAAC;QACL,CAAC;IACL,CAAC;SAAM,CAAC;QACJ,uCAAuC;QACvC,SAAS,GAAG,KAAK,CAAC;IACtB,CAAC;IACD,OAAO,SAAS,CAAC;AACrB,CAAC;AAED,SAAS,gBAAgB,CAAC,MAAmB;IACzC,MAAM,KAAK,GAAa,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC;SACzC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC;SACpC,MAAM,CAAW,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;QAC/B,4CAA4C;QAC5C,EAAE,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC;QACvF,OAAO,KAAK,CAAC;IACjB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEX,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AACrD,CAAC;AAED,eAAe,SAAS,CAAC"}
@@ -1,19 +1,4 @@
1
- import React from 'react';
2
- import { MetaData, PageData } from '../guillotine/getMetaData';
3
- export interface PageProps {
4
- page: PageData;
5
- path: string;
6
- data?: any;
7
- common?: any;
8
- meta: MetaData;
9
- }
10
- export interface BasePageProps {
11
- component?: PageData;
12
- path?: string;
13
- common?: any;
14
- data?: any;
15
- error?: string;
16
- meta: MetaData;
17
- }
18
- declare const BasePage: (props: BasePageProps) => React.JSX.Element;
1
+ /// <reference types="react" />
2
+ import type { BasePageProps } from '../types';
3
+ declare const BasePage: (props: BasePageProps) => import("react").JSX.Element;
19
4
  export default BasePage;
@@ -1,6 +1,5 @@
1
- import React from 'react';
2
- import { ComponentRegistry } from '../ComponentRegistry';
3
- import { XP_COMPONENT_TYPE } from '../utils';
1
+ import { ComponentRegistry } from '../common/ComponentRegistry';
2
+ import { XP_COMPONENT_TYPE } from '../common/constants';
4
3
  import { ErrorComponent, MissingComponent, shouldShowErrorView, shouldShowMissingView } from './BaseComponent';
5
4
  const BasePage = (props) => {
6
5
  const { component, data, common, error, meta, path } = props;
@@ -32,3 +31,4 @@ const BasePage = (props) => {
32
31
  return null;
33
32
  };
34
33
  export default BasePage;
34
+ //# sourceMappingURL=BasePage.jsx.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BasePage.jsx","sourceRoot":"","sources":["../../src/views/BasePage.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAC,iBAAiB,EAAC,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAC,cAAc,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,qBAAqB,EAAC,MAAM,iBAAiB,CAAC;AAG7G,MAAM,QAAQ,GAAG,CAAC,KAAoB,EAAE,EAAE;IACtC,MAAM,EAAC,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAC,GAAG,KAAK,CAAC;IAC3D,MAAM,IAAI,GAAG,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,UAAU,CAAC;IACnC,IAAI,KAAK,EAAE,CAAC;QACR,OAAO,CAAC,IAAI,CAAC,cAAc,IAAI,YAAY,KAAK,EAAE,CAAC,CAAC;QACpD,IAAI,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC;YAC5B,OAAO,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,iBAAiB,CAAC,IAAI,CAAC,EAAE,CAAC;QAC5F,CAAC;aAAM,CAAC;YACJ,OAAO,IAAI,CAAC;QAChB,CAAC;IACL,CAAC;IACD,IAAI,OAAO,CAAC;IACZ,IAAI,IAAI,EAAE,CAAC;QACP,OAAO,GAAG,iBAAiB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C,CAAC;IACD,MAAM,QAAQ,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAC;IAC/B,IAAI,QAAQ,EAAE,CAAC;QACX,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAChB,IAAI,CAAC,CAAC,IAAI,CAAC,CACX,IAAI,CAAC,CAAC,IAAI,CAAC,CACX,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;IACnC,CAAC;SAAM,IAAI,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,UAAU,EAAE,CAAC;QAC/B,oDAAoD;QACpD,OAAO,CAAC,IAAI,CAAC,kCAAkC,IAAI,sCAAsC,CAAC,CAAC;QAC3F,IAAI,qBAAqB,CAAC,IAAI,CAAC,EAAE,CAAC;YAC9B,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,CAAC;QAC/F,CAAC;IACL,CAAC;IACD,OAAO,IAAI,CAAC;AAChB,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -1,19 +1,4 @@
1
- import React from 'react';
2
- import { MetaData, PartData } from '../guillotine/getMetaData';
3
- export interface PartProps {
4
- part: PartData;
5
- path: string;
6
- data?: any;
7
- common?: any;
8
- meta: MetaData;
9
- }
10
- interface BasePartProps {
11
- component?: PartData;
12
- path: string;
13
- common?: any;
14
- data?: any;
15
- error?: string;
16
- meta: MetaData;
17
- }
18
- declare const BasePart: (props: BasePartProps) => React.JSX.Element;
1
+ /// <reference types="react" />
2
+ import type { BasePartProps } from '../types';
3
+ declare const BasePart: (props: BasePartProps) => import("react").JSX.Element;
19
4
  export default BasePart;
@@ -1,6 +1,5 @@
1
- import React from 'react';
2
- import { ComponentRegistry } from '../ComponentRegistry';
3
- import { XP_COMPONENT_TYPE } from '../utils';
1
+ import { ComponentRegistry } from '../common/ComponentRegistry';
2
+ import { XP_COMPONENT_TYPE } from '../common/constants';
4
3
  import { MissingComponent, shouldShowMissingView } from './BaseComponent';
5
4
  const BasePart = (props) => {
6
5
  const { component, data, common, meta, path } = props;
@@ -22,3 +21,4 @@ const BasePart = (props) => {
22
21
  return null;
23
22
  };
24
23
  export default BasePart;
24
+ //# sourceMappingURL=BasePart.jsx.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BasePart.jsx","sourceRoot":"","sources":["../../src/views/BasePart.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAC,iBAAiB,EAAC,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAC,gBAAgB,EAAE,qBAAqB,EAAC,MAAM,iBAAiB,CAAC;AAGxE,MAAM,QAAQ,GAAG,CAAC,KAAoB,EAAE,EAAE;IACtC,MAAM,EAAC,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAC,GAAG,KAAK,CAAC;IAEpD,IAAI,aAAa,CAAC;IAClB,IAAI,SAAS,EAAE,CAAC;QACZ,aAAa,GAAG,iBAAiB,CAAC,OAAO,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IACpE,CAAC;IACD,MAAM,gBAAgB,GAAG,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,IAAI,CAAC;IAC7C,IAAI,gBAAgB,EAAE,CAAC;QACnB,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAChB,IAAI,CAAC,CAAC,IAAI,CAAC,CACX,IAAI,CAAC,CAAC,IAAI,CAAC,CACX,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;IAC3C,CAAC;SAAM,IAAI,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,UAAU,EAAE,CAAC;QAC/B,oDAAoD;QACpD,OAAO,CAAC,IAAI,CAAC,kCAAkC,SAAS,CAAC,UAAU,sCAAsC,CAAC,CAAC;QAC3G,IAAI,qBAAqB,CAAC,IAAI,CAAC,EAAE,CAAC;YAC9B,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,CAAC;QAC/F,CAAC;IACL,CAAC;IACD,OAAO,IAAI,CAAC;AAChB,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
package/views/Empty.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import React from 'react';
2
- declare const Empty: () => React.JSX.Element;
1
+ /// <reference types="react" />
2
+ declare const Empty: () => import("react").JSX.Element;
3
3
  export default Empty;
package/views/Empty.jsx CHANGED
@@ -1,3 +1,4 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  const Empty = () => <></>;
3
3
  export default Empty;
4
+ //# sourceMappingURL=Empty.jsx.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Empty.jsx","sourceRoot":"","sources":["../../src/views/Empty.tsx"],"names":[],"mappings":"AAAA,+BAA+B;AAE/B,MAAM,KAAK,GAAG,GAAG,EAAE,CAAC,EAAE,GAAG,CAAC;AAE1B,eAAe,KAAK,CAAC"}
@@ -1,10 +1,4 @@
1
- import React from 'react';
2
- import { FragmentData, MetaData, PageData } from '../guillotine/getMetaData';
3
- interface FragmentProps {
4
- page?: PageData;
5
- component?: FragmentData;
6
- common?: any;
7
- meta: MetaData;
8
- }
9
- declare const FragmentView: (props: FragmentProps) => React.JSX.Element;
1
+ /// <reference types="react" />
2
+ import type { FragmentProps } from '../types';
3
+ declare const FragmentView: (props: FragmentProps) => import("react").JSX.Element;
10
4
  export default FragmentView;
@@ -1,6 +1,5 @@
1
- import React from 'react';
1
+ import { FRAGMENT_DEFAULT_REGION_NAME, XP_COMPONENT_TYPE } from '../common/constants';
2
2
  import BaseComponent, { MissingComponent, shouldShowMissingView } from './BaseComponent';
3
- import { FRAGMENT_DEFAULT_REGION_NAME, XP_COMPONENT_TYPE } from '../utils';
4
3
  const FragmentView = (props) => {
5
4
  var _a;
6
5
  const { component, page } = props;
@@ -28,3 +27,4 @@ const FragmentView = (props) => {
28
27
  }
29
28
  };
30
29
  export default FragmentView;
30
+ //# sourceMappingURL=Fragment.jsx.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Fragment.jsx","sourceRoot":"","sources":["../../src/views/Fragment.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAC,4BAA4B,EAAE,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AACpF,OAAO,aAAa,EAAE,EAAC,gBAAgB,EAAE,qBAAqB,EAAC,MAAM,iBAAiB,CAAC;AAGvF,MAAM,YAAY,GAAG,CAAC,KAAoB,EAAE,EAAE;;IAC1C,MAAM,EAAC,SAAS,EAAE,IAAI,EAAC,GAAG,KAAK,CAAC;IAChC,MAAM,KAAK,GAAoB,EAAE,CAAC;IAClC,IAAI,IAAI,EAAE,CAAC;QACP,uBAAuB;QACvB,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC;QACnC,MAAM,WAAW,GAAG,MAAA,OAAO,CAAC,4BAA4B,CAAC,0CAAE,UAAU,CAAC;QACtE,IAAI,WAAW,EAAE,CAAC;YACd,KAAK,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,CAAC;QAC/B,CAAC;IACL,CAAC;SAAM,IAAI,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,QAAQ,EAAE,CAAC;QAC7B,6BAA6B;QAC7B,KAAK,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;IACjD,CAAC;IAED,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,qBAAqB,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QACrD,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,UAAU,CAAC,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,UAAU,MAAI,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,EAAE,CAAA,CAAC,EAAE,CAAC;IAChH,CAAC;SAAM,CAAC;QACJ,MAAM,EAAC,MAAM,EAAE,IAAI,EAAC,GAAG,KAAK,CAAC;QAE7B,OAAO,CACH,EACI;gBAAA,CACI,KAAK,CAAC,GAAG,CAAC,CAAC,IAAmB,EAAE,CAAS,EAAE,EAAE,CAAC,CAC1C,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,CACxE,CACL,CACJ;YAAA,GAAG,CACN,CAAC;IACN,CAAC;AACL,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -1,4 +1,4 @@
1
- import React from 'react';
2
- import { FetchContentResult } from '../guillotine/fetchContent';
3
- declare const _MainView: (props: FetchContentResult) => React.JSX.Element;
1
+ /// <reference types="react" />
2
+ import type { FetchContentResult } from '../types';
3
+ declare const _MainView: (props: FetchContentResult) => import("react").JSX.Element;
4
4
  export default _MainView;
@@ -1,7 +1,6 @@
1
- import React from 'react';
1
+ import { XP_REQUEST_TYPE } from '../common/constants';
2
2
  import SingleComponent from './SingleComponent';
3
3
  import BaseContent from './BaseContent';
4
- import { XP_REQUEST_TYPE } from '../utils';
5
4
  const _MainView = (props) => {
6
5
  const { meta } = props;
7
6
  // Single-component render:
@@ -12,3 +11,4 @@ const _MainView = (props) => {
12
11
  return <BaseContent {...props}/>;
13
12
  };
14
13
  export default _MainView;
14
+ //# sourceMappingURL=MainView.jsx.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MainView.jsx","sourceRoot":"","sources":["../../src/views/MainView.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAC,eAAe,EAAC,MAAM,qBAAqB,CAAC;AACpD,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,WAAW,MAAM,eAAe,CAAC;AAGxC,MAAM,SAAS,GAAG,CAAC,KAAyB,EAAE,EAAE;IAC5C,MAAM,EAAC,IAAI,EAAC,GAAG,KAAK,CAAC;IAErB,2BAA2B;IAC3B,IAAI,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,WAAW,MAAK,eAAe,CAAC,SAAS,EAAE,CAAC;QAClD,OAAO,CAAC,eAAe,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;IAC1C,CAAC;IAED,mFAAmF;IACnF,OAAO,CAAC,WAAW,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;AACtC,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const PropsView: (props: any) => import("react").JSX.Element;
3
+ export default PropsView;
@@ -0,0 +1,21 @@
1
+ /// <reference types="react" />
2
+ const PropsView = (props) => {
3
+ return (<div className='debug' style={{ margin: '10px', padding: '10px', border: '2px solid lightgrey' }}>
4
+ <DataDump label='Page' data={props.page}/>
5
+ <DataDump label='Part' data={props.part}/>
6
+ <DataDump label='Layout' data={props.layout}/>
7
+ <DataDump label='Data' data={props.data}/>
8
+ <DataDump label='Common' data={props.common}/>
9
+ </div>);
10
+ };
11
+ export default PropsView;
12
+ const DataDump = ({ label, data }) => ((data && (<>
13
+ {label && (<h5 style={{ marginTop: '0', marginBottom: '0' }}>{label}:</h5>)}
14
+ <pre style={{
15
+ fontSize: '.8em',
16
+ width: '100%',
17
+ whiteSpace: 'pre-wrap',
18
+ wordWrap: 'break-word',
19
+ }}>{JSON.stringify(data, null, 2)}</pre>
20
+ </>)) || null);
21
+ //# sourceMappingURL=PropsView.jsx.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PropsView.jsx","sourceRoot":"","sources":["../../src/views/PropsView.tsx"],"names":[],"mappings":"AAAA,+BAA+B;AAO/B,MAAM,SAAS,GAAG,CAAC,KAAU,EAAE,EAAE;IAC7B,OAAO,CACH,CAAC,GAAG,CAAC,SAAS,CAAC,OAAO,CAClB,KAAK,CAAC,CAAC,EAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,qBAAqB,EAAC,CAAC,CACxE;YAAA,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EACxC;YAAA,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EACxC;YAAA,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,EAC5C;YAAA,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EACxC;YAAA,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,EAChD;QAAA,EAAE,GAAG,CAAC,CACT,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC;AAEzB,MAAM,QAAQ,GAAG,CAAC,EAAC,KAAK,EAAE,IAAI,EAAQ,EAAE,EAAE,CAAC,CACvC,CAAC,IAAI,IAAI,CACD,EACI;gBAAA,CAAC,KAAK,IAAI,C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