@enonic/nextjs-adapter 3.3.0-B1 → 3.3.0
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.
- package/dist/baseMappings.d.ts +1 -0
- package/{src/baseMappings.ts → dist/baseMappings.js} +4 -14
- package/dist/baseMappings.js.map +1 -0
- package/dist/client/getClientHydratedHtml.d.ts +1 -0
- package/{src/client/getClientHydratedHtml.tsx → dist/client/getClientHydratedHtml.jsx} +3 -6
- package/dist/client/getClientHydratedHtml.jsx.map +1 -0
- package/dist/client.d.ts +1 -0
- package/dist/client.js +3 -0
- package/dist/client.js.map +1 -0
- package/dist/common/ComponentRegistry.d.ts +34 -0
- package/dist/common/ComponentRegistry.js +121 -0
- package/dist/common/ComponentRegistry.js.map +1 -0
- package/dist/common/UrlProcessor.d.ts +25 -0
- package/{src/common/UrlProcessor.ts → dist/common/UrlProcessor.js} +49 -70
- package/dist/common/UrlProcessor.js.map +1 -0
- package/dist/common/constants.d.ts +51 -0
- package/{src/common/constants.ts → dist/common/constants.js} +38 -44
- package/dist/common/constants.js.map +1 -0
- package/dist/common/env.d.ts +12 -0
- package/{src/common/env.ts → dist/common/env.js} +3 -14
- package/dist/common/env.js.map +1 -0
- package/dist/guillotine/applyProcessors.d.ts +2 -0
- package/dist/guillotine/applyProcessors.js +33 -0
- package/dist/guillotine/applyProcessors.js.map +1 -0
- package/dist/guillotine/buildComponentTree.d.ts +2 -0
- package/{src/guillotine/buildComponentTree.ts → dist/guillotine/buildComponentTree.js} +13 -25
- package/dist/guillotine/buildComponentTree.js.map +1 -0
- package/dist/guillotine/buildErrorResponse.d.ts +3 -0
- package/{src/guillotine/buildErrorResponse.ts → dist/guillotine/buildErrorResponse.js} +2 -10
- package/dist/guillotine/buildErrorResponse.js.map +1 -0
- package/dist/guillotine/buildPage.d.ts +2 -0
- package/dist/guillotine/buildPage.js +10 -0
- package/dist/guillotine/buildPage.js.map +1 -0
- package/dist/guillotine/collectComponentDescriptors.d.ts +6 -0
- package/{src/guillotine/collectComponentDescriptors.ts → dist/guillotine/collectComponentDescriptors.js} +13 -26
- package/dist/guillotine/collectComponentDescriptors.js.map +1 -0
- package/dist/guillotine/combineMultipleQueries.d.ts +2 -0
- package/{src/guillotine/combineMultipleQueries.ts → dist/guillotine/combineMultipleQueries.js} +9 -23
- package/dist/guillotine/combineMultipleQueries.js.map +1 -0
- package/dist/guillotine/createMetaData.d.ts +18 -0
- package/dist/guillotine/createMetaData.js +45 -0
- package/dist/guillotine/createMetaData.js.map +1 -0
- package/dist/guillotine/fetchContent.d.ts +9 -0
- package/dist/guillotine/fetchContent.js +222 -0
- package/dist/guillotine/fetchContent.js.map +1 -0
- package/dist/guillotine/fetchContentData.d.ts +2 -0
- package/dist/guillotine/fetchContentData.js +30 -0
- package/dist/guillotine/fetchContentData.js.map +1 -0
- package/dist/guillotine/fetchContentPathsForAllLocales.d.ts +2 -0
- package/dist/guillotine/fetchContentPathsForAllLocales.js +21 -0
- package/dist/guillotine/fetchContentPathsForAllLocales.js.map +1 -0
- package/dist/guillotine/fetchContentPathsForLocale.d.ts +2 -0
- package/dist/guillotine/fetchContentPathsForLocale.js +42 -0
- package/dist/guillotine/fetchContentPathsForLocale.js.map +1 -0
- package/dist/guillotine/fetchFromApi.d.ts +3 -0
- package/dist/guillotine/fetchFromApi.js +76 -0
- package/dist/guillotine/fetchFromApi.js.map +1 -0
- package/dist/guillotine/fetchGuillotine.d.ts +3 -0
- package/dist/guillotine/fetchGuillotine.js +75 -0
- package/dist/guillotine/fetchGuillotine.js.map +1 -0
- package/dist/guillotine/fetchMetaData.d.ts +2 -0
- package/dist/guillotine/fetchMetaData.js +33 -0
- package/dist/guillotine/fetchMetaData.js.map +1 -0
- package/dist/guillotine/getCleanContentPathArrayOrThrow400.d.ts +2 -0
- package/{src/guillotine/getCleanContentPathArrayOrThrow400.ts → dist/guillotine/getCleanContentPathArrayOrThrow400.js} +7 -9
- package/dist/guillotine/getCleanContentPathArrayOrThrow400.js.map +1 -0
- package/dist/guillotine/getComponentConfig.d.ts +2 -0
- package/{src/guillotine/getComponentConfig.ts → dist/guillotine/getComponentConfig.js} +3 -5
- package/dist/guillotine/getComponentConfig.js.map +1 -0
- package/dist/guillotine/getContentAndComponentPaths.d.ts +1 -0
- package/{src/guillotine/getContentAndComponentPaths.ts → dist/guillotine/getContentAndComponentPaths.js} +6 -5
- package/dist/guillotine/getContentAndComponentPaths.js.map +1 -0
- package/dist/guillotine/getMetaData.d.ts +2 -0
- package/{src/guillotine/getMetaData.ts → dist/guillotine/getMetaData.js} +11 -18
- package/dist/guillotine/getMetaData.js.map +1 -0
- package/dist/guillotine/getParentRegion.d.ts +2 -0
- package/{src/guillotine/getParentRegion.ts → dist/guillotine/getParentRegion.js} +9 -23
- package/dist/guillotine/getParentRegion.js.map +1 -0
- package/dist/guillotine/getQueryAndVariables.d.ts +2 -0
- package/{src/guillotine/getQueryAndVariables.ts → dist/guillotine/getQueryAndVariables.js} +7 -23
- package/dist/guillotine/getQueryAndVariables.js.map +1 -0
- package/dist/guillotine/metadata/configQuery.d.ts +2 -0
- package/dist/guillotine/metadata/configQuery.js +36 -0
- package/dist/guillotine/metadata/configQuery.js.map +1 -0
- package/dist/guillotine/metadata/richTextQuery.d.ts +1 -0
- package/{src/guillotine/metadata/richTextQuery.ts → dist/guillotine/metadata/richTextQuery.js} +6 -8
- package/dist/guillotine/metadata/richTextQuery.js.map +1 -0
- package/dist/guillotine/parseComponentPath.d.ts +2 -0
- package/{src/guillotine/parseComponentPath.ts → dist/guillotine/parseComponentPath.js} +4 -8
- package/dist/guillotine/parseComponentPath.js.map +1 -0
- package/dist/guillotine/prefixFragmentCmpPath.d.ts +1 -0
- package/{src/guillotine/prefixFragmentCmpPath.ts → dist/guillotine/prefixFragmentCmpPath.js} +5 -5
- package/dist/guillotine/prefixFragmentCmpPath.js.map +1 -0
- package/dist/guillotine/processComponentConfig.d.ts +2 -0
- package/{src/guillotine/processComponentConfig.ts → dist/guillotine/processComponentConfig.js} +4 -12
- package/dist/guillotine/processComponentConfig.js.map +1 -0
- package/dist/guillotine/restrictComponentsToPath.d.ts +2 -0
- package/{src/guillotine/restrictComponentsToPath.ts → dist/guillotine/restrictComponentsToPath.js} +9 -19
- package/dist/guillotine/restrictComponentsToPath.js.map +1 -0
- package/dist/guillotine/validateData.d.ts +2 -0
- package/dist/guillotine/validateData.js +7 -0
- package/dist/guillotine/validateData.js.map +1 -0
- package/dist/guillotine/validateNotFound.d.ts +2 -0
- package/{src/guillotine/validateNotFound.ts → dist/guillotine/validateNotFound.js} +5 -9
- package/dist/guillotine/validateNotFound.js.map +1 -0
- package/dist/guillotine/validateShortcut.d.ts +2 -0
- package/{src/guillotine/validateShortcut.ts → dist/guillotine/validateShortcut.js} +12 -20
- package/dist/guillotine/validateShortcut.js.map +1 -0
- package/dist/i18n/LocaleContext.d.ts +7 -0
- package/dist/i18n/LocaleContext.jsx +50 -0
- package/dist/i18n/LocaleContext.jsx.map +1 -0
- package/dist/i18n/i18n.d.ts +12 -0
- package/dist/i18n/i18n.js +59 -0
- package/dist/i18n/i18n.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/query/Shortcut.d.ts +1 -0
- package/{src/query/Shortcut.ts → dist/query/Shortcut.js} +1 -0
- package/dist/query/Shortcut.js.map +1 -0
- package/dist/server/getServerRenderedHtml.d.ts +1 -0
- package/dist/server/getServerRenderedHtml.js +4 -0
- package/dist/server/getServerRenderedHtml.js.map +1 -0
- package/dist/server.d.ts +5 -0
- package/dist/server.js +6 -0
- package/dist/server.js.map +1 -0
- package/{src/types/component.ts → dist/types/component.d.ts} +23 -62
- package/dist/types/component.js +2 -0
- package/dist/types/component.js.map +1 -0
- package/dist/types/componentProps.d.ts +107 -0
- package/dist/types/componentProps.js +2 -0
- package/dist/types/componentProps.js.map +1 -0
- package/dist/types/guillotine.d.ts +344 -0
- package/dist/types/guillotine.js +2 -0
- package/dist/types/guillotine.js.map +1 -0
- package/dist/types/i18n.d.ts +7 -0
- package/dist/types/i18n.js +2 -0
- package/dist/types/i18n.js.map +1 -0
- package/{src/types/index.ts → dist/types/index.d.ts} +19 -34
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/next.d.ts +6 -0
- package/dist/types/next.js +2 -0
- package/dist/types/next.js.map +1 -0
- package/dist/types/util.d.ts +3 -0
- package/dist/types/util.js +3 -0
- package/dist/types/util.js.map +1 -0
- package/dist/utils/addLineNumbers.d.ts +1 -0
- package/dist/utils/addLineNumbers.js +4 -0
- package/dist/utils/addLineNumbers.js.map +1 -0
- package/dist/utils/buildGuillotineRequestHeaders.d.ts +7 -0
- package/dist/utils/buildGuillotineRequestHeaders.js +16 -0
- package/dist/utils/buildGuillotineRequestHeaders.js.map +1 -0
- package/dist/utils/commonChars.d.ts +1 -0
- package/{src/utils/commonChars.ts → dist/utils/commonChars.js} +5 -4
- package/dist/utils/commonChars.js.map +1 -0
- package/dist/utils/enonicLog.d.ts +5 -0
- package/dist/utils/enonicLog.js +23 -0
- package/dist/utils/enonicLog.js.map +1 -0
- package/dist/utils/fixDoubleSlashes.d.ts +1 -0
- package/dist/utils/fixDoubleSlashes.js +4 -0
- package/dist/utils/fixDoubleSlashes.js.map +1 -0
- package/dist/utils/getAllLocales.d.ts +1 -0
- package/dist/utils/getAllLocales.js +5 -0
- package/dist/utils/getAllLocales.js.map +1 -0
- package/dist/utils/getContentApiUrl.d.ts +2 -0
- package/dist/utils/getContentApiUrl.js +15 -0
- package/dist/utils/getContentApiUrl.js.map +1 -0
- package/dist/utils/getLocaleMapping.d.ts +2 -0
- package/dist/utils/getLocaleMapping.js +19 -0
- package/dist/utils/getLocaleMapping.js.map +1 -0
- package/dist/utils/getLocaleMappingByLocale.d.ts +2 -0
- package/dist/utils/getLocaleMappingByLocale.js +13 -0
- package/dist/utils/getLocaleMappingByLocale.js.map +1 -0
- package/dist/utils/getLocaleMappingByProjectId.d.ts +2 -0
- package/dist/utils/getLocaleMappingByProjectId.js +16 -0
- package/dist/utils/getLocaleMappingByProjectId.js.map +1 -0
- package/dist/utils/getLocaleMappings.d.ts +2 -0
- package/{src/utils/getLocaleMappings.ts → dist/utils/getLocaleMappings.js} +8 -14
- package/dist/utils/getLocaleMappings.js.map +1 -0
- package/dist/utils/getRenderMode.d.ts +3 -0
- package/dist/utils/getRenderMode.js +8 -0
- package/dist/utils/getRenderMode.js.map +1 -0
- package/dist/utils/getRequestLocaleInfo.d.ts +6 -0
- package/{src/utils/getRequestLocaleInfo.ts → dist/utils/getRequestLocaleInfo.js} +12 -13
- package/dist/utils/getRequestLocaleInfo.js.map +1 -0
- package/dist/utils/getXpBaseUrl.d.ts +2 -0
- package/dist/utils/getXpBaseUrl.js +8 -0
- package/dist/utils/getXpBaseUrl.js.map +1 -0
- package/dist/utils/indent.d.ts +1 -0
- package/dist/utils/indent.js +5 -0
- package/dist/utils/indent.js.map +1 -0
- package/dist/utils/sanitizeGraphqlName.d.ts +1 -0
- package/{src/utils/sanitizeGraphqlName.ts → dist/utils/sanitizeGraphqlName.js} +3 -2
- package/dist/utils/sanitizeGraphqlName.js.map +1 -0
- package/dist/views/BaseComponent.d.ts +20 -0
- package/{src/views/BaseComponent.tsx → dist/views/BaseComponent.jsx} +49 -76
- package/dist/views/BaseComponent.jsx.map +1 -0
- package/dist/views/BaseContent.d.ts +3 -0
- package/dist/views/BaseContent.jsx +38 -0
- package/dist/views/BaseContent.jsx.map +1 -0
- package/dist/views/BaseLayout.d.ts +3 -0
- package/dist/views/BaseLayout.jsx +24 -0
- package/dist/views/BaseLayout.jsx.map +1 -0
- package/dist/views/BaseMacro.d.ts +6 -0
- package/{src/views/BaseMacro.tsx → dist/views/BaseMacro.jsx} +37 -42
- package/dist/views/BaseMacro.jsx.map +1 -0
- package/dist/views/BasePage.d.ts +3 -0
- package/dist/views/BasePage.jsx +34 -0
- package/dist/views/BasePage.jsx.map +1 -0
- package/dist/views/BasePart.d.ts +3 -0
- package/dist/views/BasePart.jsx +24 -0
- package/dist/views/BasePart.jsx.map +1 -0
- package/dist/views/Empty.d.ts +2 -0
- package/{src/views/Empty.tsx → dist/views/Empty.jsx} +1 -2
- package/dist/views/Empty.jsx.map +1 -0
- package/dist/views/Fragment.d.ts +3 -0
- package/dist/views/Fragment.jsx +30 -0
- package/dist/views/Fragment.jsx.map +1 -0
- package/dist/views/MainView.d.ts +3 -0
- package/dist/views/MainView.jsx +14 -0
- package/dist/views/MainView.jsx.map +1 -0
- package/dist/views/PropsView.d.ts +2 -0
- package/dist/views/PropsView.jsx +21 -0
- package/dist/views/PropsView.jsx.map +1 -0
- package/dist/views/Region.d.ts +6 -0
- package/{src/views/Region.tsx → dist/views/Region.jsx} +17 -41
- package/dist/views/Region.jsx.map +1 -0
- package/dist/views/RichTextView.d.ts +3 -0
- package/dist/views/RichTextView.jsx +65 -0
- package/dist/views/RichTextView.jsx.map +1 -0
- package/dist/views/SingleComponent.d.ts +4 -0
- package/dist/views/SingleComponent.jsx +10 -0
- package/dist/views/SingleComponent.jsx.map +1 -0
- package/dist/views/StaticContent.d.ts +10 -0
- package/dist/views/StaticContent.jsx +37 -0
- package/dist/views/StaticContent.jsx.map +1 -0
- package/dist/views/Text.d.ts +8 -0
- package/dist/views/Text.jsx +4 -0
- package/dist/views/Text.jsx.map +1 -0
- package/dist/views/macros/DefaultMacro.d.ts +3 -0
- package/dist/views/macros/DefaultMacro.jsx +4 -0
- package/dist/views/macros/DefaultMacro.jsx.map +1 -0
- package/dist/views/macros/DisableMacro.d.ts +3 -0
- package/dist/views/macros/DisableMacro.jsx +3 -0
- package/dist/views/macros/DisableMacro.jsx.map +1 -0
- package/package.json +20 -32
- package/src/client.ts +0 -2
- package/src/common/ComponentRegistry.ts +0 -159
- package/src/guillotine/applyProcessors.ts +0 -34
- package/src/guillotine/buildPage.ts +0 -15
- package/src/guillotine/createMetaData.ts +0 -72
- package/src/guillotine/fetchContent.ts +0 -240
- package/src/guillotine/fetchContentData.ts +0 -31
- package/src/guillotine/fetchContentPathsForAllLocales.ts +0 -21
- package/src/guillotine/fetchContentPathsForLocale.ts +0 -43
- package/src/guillotine/fetchFromApi.ts +0 -76
- package/src/guillotine/fetchGuillotine.ts +0 -76
- package/src/guillotine/fetchMetaData.ts +0 -31
- package/src/guillotine/metadata/configQuery.ts +0 -46
- package/src/guillotine/validateData.ts +0 -11
- package/src/i18n/LocaleContext.tsx +0 -59
- package/src/i18n/i18n.ts +0 -57
- package/src/index.ts +0 -42
- package/src/server/getServerRenderedHtml.ts +0 -3
- package/src/server.ts +0 -5
- package/src/types/componentProps.ts +0 -143
- package/src/types/guillotine.ts +0 -428
- package/src/types/i18n.ts +0 -8
- package/src/types/next.ts +0 -7
- package/src/types/util.ts +0 -5
- package/src/utils/addLineNumbers.ts +0 -3
- package/src/utils/buildGuillotineRequestHeaders.ts +0 -29
- package/src/utils/enonicLog.ts +0 -28
- package/src/utils/fixDoubleSlashes.ts +0 -3
- package/src/utils/getAllLocales.ts +0 -6
- package/src/utils/getContentApiUrl.ts +0 -20
- package/src/utils/getLocaleMapping.ts +0 -24
- package/src/utils/getLocaleMappingByLocale.ts +0 -19
- package/src/utils/getLocaleMappingByProjectId.ts +0 -21
- package/src/utils/getRenderMode.ts +0 -11
- package/src/utils/getXpBaseUrl.ts +0 -12
- package/src/utils/indent.ts +0 -4
- package/src/views/BaseContent.tsx +0 -47
- package/src/views/BaseLayout.tsx +0 -33
- package/src/views/BasePage.tsx +0 -42
- package/src/views/BasePart.tsx +0 -34
- package/src/views/Fragment.tsx +0 -41
- package/src/views/MainView.tsx +0 -22
- package/src/views/PropsView.tsx +0 -38
- package/src/views/RichTextView.tsx +0 -106
- package/src/views/SingleComponent.tsx +0 -19
- package/src/views/StaticContent.tsx +0 -39
- package/src/views/Text.tsx +0 -19
- package/src/views/macros/DefaultMacro.tsx +0 -9
- package/src/views/macros/DisableMacro.tsx +0 -8
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getLocaleMapping.js","sourceRoot":"","sources":["../../src/utils/getLocaleMapping.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAC,2BAA2B,EAAC,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAAC,wBAAwB,EAAC,MAAM,4BAA4B,CAAC;AAGpE,MAAM,UAAU,gBAAgB,CAAC,OAAgB;;IAC7C,MAAM,SAAS,GAAG,MAAA,OAAO,CAAC,OAAO,0CAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC;IAE1D,IAAI,MAAqB,CAAC;IAC1B,IAAI,SAAS,EAAE,CAAC;QACZ,8BAA8B;QAC9B,MAAM,GAAG,2BAA2B,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IAC3D,CAAC;IACD,IAAI,CAAC,MAAM,EAAE,CAAC;QACV,kCAAkC;QAClC,mDAAmD;QACnD,MAAM,GAAG,wBAAwB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACtD,CAAC;IAED,OAAO,MAAM,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { getLocaleMappings } from './getLocaleMappings';
|
|
2
|
+
export function getLocaleMappingByLocale(locale, useDefault = true) {
|
|
3
|
+
const mappings = getLocaleMappings();
|
|
4
|
+
let config;
|
|
5
|
+
if (locale) {
|
|
6
|
+
config = mappings[locale];
|
|
7
|
+
}
|
|
8
|
+
if (!config && useDefault) {
|
|
9
|
+
config = Object.values(mappings).find(c => c.default);
|
|
10
|
+
}
|
|
11
|
+
return config;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=getLocaleMappingByLocale.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getLocaleMappingByLocale.js","sourceRoot":"","sources":["../../src/utils/getLocaleMappingByLocale.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AAGtD,MAAM,UAAU,wBAAwB,CAAC,MAAe,EAAE,UAAU,GAAG,IAAI;IACvE,MAAM,QAAQ,GAAG,iBAAiB,EAAE,CAAC;IAErC,IAAI,MAAqB,CAAC;IAC1B,IAAI,MAAM,EAAE,CAAC;QACT,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC9B,CAAC;IACD,IAAI,CAAC,MAAM,IAAI,UAAU,EAAE,CAAC;QACxB,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IAC1D,CAAC;IAED,OAAO,MAAM,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { getLocaleMappings } from './getLocaleMappings';
|
|
2
|
+
export function getLocaleMappingByProjectId(projectId, useDefault = true) {
|
|
3
|
+
const mappings = getLocaleMappings();
|
|
4
|
+
let config;
|
|
5
|
+
if (projectId) {
|
|
6
|
+
config = Object.values(mappings).find(p => {
|
|
7
|
+
var _a;
|
|
8
|
+
return ((_a = p === null || p === void 0 ? void 0 : p.project) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === projectId.toLowerCase();
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
if (!config && useDefault) {
|
|
12
|
+
config = Object.values(mappings).find(c => c.default);
|
|
13
|
+
}
|
|
14
|
+
return config;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=getLocaleMappingByProjectId.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getLocaleMappingByProjectId.js","sourceRoot":"","sources":["../../src/utils/getLocaleMappingByProjectId.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AAGtD,MAAM,UAAU,2BAA2B,CAAC,SAAkB,EAAE,UAAU,GAAG,IAAI;IAC7E,MAAM,QAAQ,GAAG,iBAAiB,EAAE,CAAC;IAErC,IAAI,MAAqB,CAAC;IAC1B,IAAI,SAAS,EAAE,CAAC;QACZ,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;;YACtC,OAAO,CAAA,MAAA,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,OAAO,0CAAE,WAAW,EAAE,MAAK,SAAS,CAAC,WAAW,EAAE,CAAC;QACjE,CAAC,CAAC,CAAC;IACP,CAAC;IACD,IAAI,CAAC,MAAM,IAAI,UAAU,EAAE,CAAC;QACxB,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IAC1D,CAAC;IAED,OAAO,MAAM,CAAC;AAClB,CAAC"}
|
|
@@ -1,27 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {ENV_VARS} from '../common/constants';
|
|
5
|
-
import {MAPPINGS} from '../common/env';
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { ENV_VARS } from '../common/constants';
|
|
2
|
+
import { MAPPINGS } from '../common/env';
|
|
8
3
|
// NOTE: Dissallowing slash and any whitespace in 2nd capture group.
|
|
9
4
|
const PROJECT_CONFIG_REGEXP = /^([\w-]+):([^/\s]+)(\/[\w.-]+)?$/i;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export function getLocaleMappings(): LocaleMappings {
|
|
5
|
+
export function getLocaleMappings() {
|
|
13
6
|
const str = MAPPINGS;
|
|
14
|
-
if (!str
|
|
7
|
+
if (!(str === null || str === void 0 ? void 0 : str.length)) {
|
|
15
8
|
throw new Error(`Did you forget to define "${ENV_VARS.MAPPINGS}" environmental variable?
|
|
16
9
|
Format: <default-language>:<default-repository-name>/<default-site-path>,<language>:<repository-name>/<site-path>,...`);
|
|
17
10
|
}
|
|
18
|
-
return str.split(',').reduce((config, prjStr, index
|
|
11
|
+
return str.split(',').reduce((config, prjStr, index) => {
|
|
19
12
|
const trimmedprjStr = prjStr.trim();
|
|
20
13
|
if (!trimmedprjStr.length) {
|
|
21
14
|
return config;
|
|
22
15
|
}
|
|
23
|
-
const matches
|
|
24
|
-
if (!matches
|
|
16
|
+
const matches = PROJECT_CONFIG_REGEXP.exec(trimmedprjStr);
|
|
17
|
+
if (!(matches === null || matches === void 0 ? void 0 : matches.length)) {
|
|
25
18
|
throw new Error(`Project "${prjStr}" doesn't match format: <default-language>:<default-repository-name>/<default-site-path>,<language>:<repository-name>/<site-path>`);
|
|
26
19
|
}
|
|
27
20
|
const [_full, lang, project, site] = matches;
|
|
@@ -34,3 +27,4 @@ export function getLocaleMappings(): LocaleMappings {
|
|
|
34
27
|
return config;
|
|
35
28
|
}, {});
|
|
36
29
|
}
|
|
30
|
+
//# sourceMappingURL=getLocaleMappings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getLocaleMappings.js","sourceRoot":"","sources":["../../src/utils/getLocaleMappings.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,iBAAiB;IAC7B,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,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,EAAC,WAAW,EAAE,kBAAkB,EAAC,MAAM,qBAAqB,CAAC;AAGpE,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"}
|
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export function getRequestLocaleInfo(context: Context) {
|
|
8
|
-
let locale: string;
|
|
1
|
+
import { PROJECT_ID_HEADER } from '../common/constants';
|
|
2
|
+
import { getLocaleMappings } from './getLocaleMappings';
|
|
3
|
+
import { getLocaleMappingByProjectId } from './getLocaleMappingByProjectId';
|
|
4
|
+
export function getRequestLocaleInfo(context) {
|
|
5
|
+
var _a, _b;
|
|
6
|
+
let locale;
|
|
9
7
|
const configs = getLocaleMappings();
|
|
10
8
|
const locales = Object.keys(configs);
|
|
11
9
|
const defaultLocale = locales.find((locale) => configs[locale].default);
|
|
12
|
-
const projectId = context.headers
|
|
10
|
+
const projectId = (_a = context.headers) === null || _a === void 0 ? void 0 : _a.get(PROJECT_ID_HEADER);
|
|
13
11
|
if (projectId) {
|
|
14
|
-
locale = getLocaleMappingByProjectId(projectId, false)
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
locale = (_b = getLocaleMappingByProjectId(projectId, false)) === null || _b === void 0 ? void 0 : _b.locale;
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
17
15
|
locale = context.locale;
|
|
18
16
|
/* Disabled to prevent situation when www.site.com redirects to www.site.com/no when accept-header is set to 'no'
|
|
19
17
|
|
|
@@ -26,5 +24,6 @@ export function getRequestLocaleInfo(context: Context) {
|
|
|
26
24
|
locale = defaultLocale;
|
|
27
25
|
}
|
|
28
26
|
}
|
|
29
|
-
return {locale, locales, defaultLocale};
|
|
27
|
+
return { locale, locales, defaultLocale };
|
|
30
28
|
}
|
|
29
|
+
//# sourceMappingURL=getRequestLocaleInfo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getRequestLocaleInfo.js","sourceRoot":"","sources":["../../src/utils/getRequestLocaleInfo.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAC,2BAA2B,EAAC,MAAM,+BAA+B,CAAC;AAG1E,MAAM,UAAU,oBAAoB,CAAC,OAAgB;;IACjD,IAAI,MAAc,CAAC;IACnB,MAAM,OAAO,GAAG,iBAAiB,EAAE,CAAC;IACpC,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,2BAA2B,CAAC,SAAS,EAAE,KAAK,CAAC,0CAAE,MAAM,CAAC;IAEnE,CAAC;SAAM,CAAC;QACJ,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QACxB;;;;;;WAMG;QACH,IAAI,CAAC,MAAM,EAAE,CAAC;YACV,MAAM,GAAG,aAAa,CAAC;QAC3B,CAAC;IACL,CAAC;IACD,OAAO,EAAC,MAAM,EAAE,OAAO,EAAE,aAAa,EAAC,CAAC;AAC5C,CAAC"}
|
|
@@ -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 @@
|
|
|
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;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// sanitizes text according to graphql naming spec http://spec.graphql.org/October2021/#sec-Names
|
|
2
|
-
export const sanitizeGraphqlName = (text
|
|
2
|
+
export const sanitizeGraphqlName = (text) => {
|
|
3
3
|
if (!text || text.trim().length === 0) {
|
|
4
4
|
return '';
|
|
5
5
|
}
|
|
@@ -8,4 +8,5 @@ export const sanitizeGraphqlName = (text: string) => {
|
|
|
8
8
|
result = '_' + result;
|
|
9
9
|
}
|
|
10
10
|
return result;
|
|
11
|
-
};
|
|
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"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { BaseComponentProps, MetaData } from '../types';
|
|
3
|
+
declare const BaseComponent: ({ component, meta, common }: BaseComponentProps) => JSX.Element;
|
|
4
|
+
export default BaseComponent;
|
|
5
|
+
export declare const MissingComponent: ({ descriptor, type }: {
|
|
6
|
+
descriptor?: string;
|
|
7
|
+
type: string;
|
|
8
|
+
}) => React.JSX.Element;
|
|
9
|
+
export declare function shouldShowMissingView(meta: MetaData): boolean;
|
|
10
|
+
export declare const ErrorComponent: ({ type, descriptor, reason }: {
|
|
11
|
+
type?: string;
|
|
12
|
+
descriptor?: string;
|
|
13
|
+
reason: string;
|
|
14
|
+
}) => React.JSX.Element;
|
|
15
|
+
export declare function shouldShowErrorView(meta: MetaData): boolean;
|
|
16
|
+
export declare const PlaceholderComponent: ({ type, descriptor }: {
|
|
17
|
+
type?: string;
|
|
18
|
+
descriptor?: string;
|
|
19
|
+
}) => React.JSX.Element;
|
|
20
|
+
export declare function shouldShowPlaceholderView(meta: MetaData): boolean;
|
|
@@ -1,156 +1,129 @@
|
|
|
1
|
-
import React, {Suspense} from 'react';
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import {PORTAL_COMPONENT_ATTRIBUTE, RENDER_MODE, XP_COMPONENT_TYPE} from '../common/constants';
|
|
6
|
-
import {IS_DEV_MODE} from '../common/env';
|
|
7
|
-
import {ComponentRegistry} from '../common/ComponentRegistry';
|
|
1
|
+
import React, { Suspense } from 'react';
|
|
2
|
+
import { PORTAL_COMPONENT_ATTRIBUTE, RENDER_MODE, XP_COMPONENT_TYPE } from '../common/constants';
|
|
3
|
+
import { IS_DEV_MODE } from '../common/env';
|
|
4
|
+
import { ComponentRegistry } from '../common/ComponentRegistry';
|
|
8
5
|
import Empty from './Empty';
|
|
9
6
|
import getClientHydratedHtml from '../client/getClientHydratedHtml';
|
|
10
|
-
import {enonicDebug} from '../utils/enonicLog';
|
|
11
|
-
import {getServerRenderedHtml} from '../server/getServerRenderedHtml';
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
const {type, error} = component;
|
|
7
|
+
import { enonicDebug } from '../utils/enonicLog';
|
|
8
|
+
import { getServerRenderedHtml } from '../server/getServerRenderedHtml';
|
|
9
|
+
const BaseComponent = ({ component, meta, common }) => {
|
|
10
|
+
var _a;
|
|
11
|
+
const { type, error } = component;
|
|
16
12
|
const cmpData = component[type];
|
|
17
13
|
const descriptor = cmpData && 'descriptor' in cmpData ? cmpData.descriptor : undefined;
|
|
18
|
-
|
|
19
|
-
let ComponentView: JSX.Element | null;
|
|
20
|
-
|
|
14
|
+
let ComponentView;
|
|
21
15
|
enonicDebug('BaseComponent', type, cmpData);
|
|
22
|
-
|
|
23
16
|
if (error) {
|
|
24
17
|
// renders error component when rendering whole page
|
|
25
18
|
console.warn(`BaseComponent: ${type} '${descriptor}' error: ${error}`);
|
|
26
|
-
ComponentView = shouldShowErrorView(meta) ? <ErrorComponent type={type} reason={error} descriptor={descriptor}/> : <Empty/>;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const ViewFn = ComponentRegistry.getComponent(type)?.view;
|
|
19
|
+
ComponentView = shouldShowErrorView(meta) ? <ErrorComponent type={type} reason={error} descriptor={descriptor}/> : <Empty />;
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
const ViewFn = (_a = ComponentRegistry.getComponent(type)) === null || _a === void 0 ? void 0 : _a.view;
|
|
31
23
|
if (!ViewFn) {
|
|
32
24
|
// show missing component kind, i.e. 'part', 'layout', 'text'
|
|
33
25
|
console.warn(`BaseComponent: can not render component '${type}': no next view or catch-all defined`);
|
|
34
|
-
ComponentView = shouldShowMissingView(meta) ? <MissingComponent type={type} descriptor={descriptor}/> : <Empty/>;
|
|
35
|
-
|
|
36
|
-
|
|
26
|
+
ComponentView = shouldShowMissingView(meta) ? <MissingComponent type={type} descriptor={descriptor}/> : <Empty />;
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
37
29
|
const cmpAttrs = createComponentAttrs(component, meta, common);
|
|
38
30
|
ComponentView = <ViewFn {...cmpAttrs}/>;
|
|
39
31
|
}
|
|
40
32
|
}
|
|
41
|
-
|
|
42
33
|
// need to display a placeholder if descriptor is empty as component is not initialized yet
|
|
43
34
|
if (descriptor && shouldShowPlaceholderView(meta) && isComponentOutputEmpty(ComponentView)) {
|
|
44
35
|
ComponentView = <PlaceholderComponent type={type} descriptor={descriptor}/>;
|
|
45
36
|
}
|
|
46
|
-
|
|
47
37
|
if (meta.renderMode === RENDER_MODE.EDIT) {
|
|
48
|
-
return (
|
|
49
|
-
<div {...createEditorAttrs(type)}>
|
|
38
|
+
return (<div {...createEditorAttrs(type)}>
|
|
50
39
|
{ComponentView}
|
|
51
|
-
</div>
|
|
52
|
-
|
|
53
|
-
|
|
40
|
+
</div>);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
54
43
|
// do not make component wrappers in live mode
|
|
55
44
|
return ComponentView;
|
|
56
45
|
}
|
|
57
46
|
};
|
|
58
47
|
export default BaseComponent;
|
|
59
|
-
|
|
60
48
|
/*
|
|
61
49
|
* Used for displaying components with missing implementations on the page, while rendering whole page
|
|
62
50
|
*/
|
|
63
|
-
export const MissingComponent = ({
|
|
64
|
-
return (
|
|
65
|
-
<div style={{
|
|
51
|
+
export const MissingComponent = ({ descriptor, type }) => {
|
|
52
|
+
return (<div style={{
|
|
66
53
|
border: '2px dashed lightgrey',
|
|
67
54
|
padding: '16px'
|
|
68
55
|
}}>
|
|
69
|
-
<h3 style={{margin: 0}}>Missing component</h3>
|
|
70
|
-
<p style={{marginBottom: 0, color: 'grey'}}>
|
|
56
|
+
<h3 style={{ margin: 0 }}>Missing component</h3>
|
|
57
|
+
<p style={{ marginBottom: 0, color: 'grey' }}>
|
|
71
58
|
Missing {type} with descriptor: <strong>{descriptor}</strong>. Did you forget to register it ?
|
|
72
59
|
</p>
|
|
73
|
-
</div>
|
|
74
|
-
);
|
|
60
|
+
</div>);
|
|
75
61
|
};
|
|
76
|
-
|
|
77
|
-
|
|
62
|
+
const isComponentOutputEmpty = (component) => {
|
|
63
|
+
var _a;
|
|
78
64
|
if (typeof document !== 'undefined') {
|
|
79
65
|
// render component on the client to see if it's empty
|
|
80
|
-
return !getClientHydratedHtml(component)
|
|
81
|
-
}
|
|
66
|
+
return !((_a = getClientHydratedHtml(component)) === null || _a === void 0 ? void 0 : _a.length);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
82
69
|
// render component on the server to see if it's empty
|
|
83
70
|
// Suspense is needed to render component on the server
|
|
84
71
|
return getServerRenderedHtml(<Suspense fallback={<p>Loading...</p>}>{component}</Suspense>) === '<!--$--><!--/$-->';
|
|
85
72
|
}
|
|
86
73
|
};
|
|
87
|
-
|
|
88
|
-
export function shouldShowMissingView(meta: MetaData): boolean {
|
|
74
|
+
export function shouldShowMissingView(meta) {
|
|
89
75
|
return IS_DEV_MODE || meta.renderMode !== RENDER_MODE.NEXT;
|
|
90
76
|
}
|
|
91
|
-
|
|
92
77
|
/*
|
|
93
78
|
* Used for displaying components with errors on the page, while rendering whole page
|
|
94
79
|
*/
|
|
95
|
-
export const ErrorComponent = ({
|
|
96
|
-
return (
|
|
97
|
-
<div style={{
|
|
80
|
+
export const ErrorComponent = ({ type, descriptor, reason }) => {
|
|
81
|
+
return (<div style={{
|
|
98
82
|
border: '2px solid red',
|
|
99
83
|
padding: '16px'
|
|
100
84
|
}}>
|
|
101
|
-
<h3 style={{margin: 0, textTransform: 'capitalize'}}>{reason ? reason : 'Unknown error'}</h3>
|
|
102
|
-
{descriptor && <p style={{color: 'grey'}}>{`${type}: ${descriptor}`}</p>}
|
|
103
|
-
</div>
|
|
104
|
-
);
|
|
85
|
+
<h3 style={{ margin: 0, textTransform: 'capitalize' }}>{reason ? reason : 'Unknown error'}</h3>
|
|
86
|
+
{descriptor && <p style={{ color: 'grey' }}>{`${type}: ${descriptor}`}</p>}
|
|
87
|
+
</div>);
|
|
105
88
|
};
|
|
106
|
-
|
|
107
|
-
export function shouldShowErrorView(meta: MetaData): boolean {
|
|
89
|
+
export function shouldShowErrorView(meta) {
|
|
108
90
|
return meta.renderMode === RENDER_MODE.EDIT;
|
|
109
91
|
}
|
|
110
|
-
|
|
111
|
-
function createEditorAttrs(type: XP_COMPONENT_TYPE): Record<string,string> {
|
|
92
|
+
function createEditorAttrs(type) {
|
|
112
93
|
return {
|
|
113
94
|
[PORTAL_COMPONENT_ATTRIBUTE]: type
|
|
114
95
|
};
|
|
115
96
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
const
|
|
119
|
-
const cmpAttrs: Record<string,any> = {
|
|
97
|
+
function createComponentAttrs(component, meta, common) {
|
|
98
|
+
const { type, data, error } = component;
|
|
99
|
+
const cmpAttrs = {
|
|
120
100
|
component: component[type],
|
|
121
101
|
path: component.path,
|
|
122
102
|
meta,
|
|
123
103
|
common
|
|
124
104
|
};
|
|
125
|
-
|
|
126
105
|
if (data) {
|
|
127
106
|
cmpAttrs.data = data;
|
|
128
107
|
}
|
|
129
|
-
|
|
130
108
|
if (error) {
|
|
131
109
|
cmpAttrs.error = error;
|
|
132
110
|
}
|
|
133
|
-
|
|
134
111
|
if (component.type === XP_COMPONENT_TYPE.LAYOUT) {
|
|
135
112
|
// add regions to layout because they are not present in component[component.type] above
|
|
136
113
|
cmpAttrs.regions = component.regions;
|
|
137
114
|
}
|
|
138
115
|
return cmpAttrs;
|
|
139
116
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
return (
|
|
143
|
-
<div style={{
|
|
117
|
+
export const PlaceholderComponent = ({ type, descriptor }) => {
|
|
118
|
+
return (<div style={{
|
|
144
119
|
border: '2px solid lightgrey',
|
|
145
120
|
padding: '16px'
|
|
146
121
|
}}>
|
|
147
|
-
<h3 style={{margin: 0, textTransform: 'capitalize'}}>Empty output</h3>
|
|
148
|
-
{descriptor && <p style={{color: 'grey'}}>{`${type} '${descriptor}' output is empty`}</p>}
|
|
149
|
-
</div>
|
|
150
|
-
);
|
|
122
|
+
<h3 style={{ margin: 0, textTransform: 'capitalize' }}>Empty output</h3>
|
|
123
|
+
{descriptor && <p style={{ color: 'grey' }}>{`${type} '${descriptor}' output is empty`}</p>}
|
|
124
|
+
</div>);
|
|
151
125
|
};
|
|
152
|
-
|
|
153
|
-
export function shouldShowPlaceholderView(meta: MetaData): boolean {
|
|
126
|
+
export function shouldShowPlaceholderView(meta) {
|
|
154
127
|
return meta.renderMode === RENDER_MODE.EDIT;
|
|
155
128
|
}
|
|
156
|
-
|
|
129
|
+
//# sourceMappingURL=BaseComponent.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseComponent.jsx","sourceRoot":"","sources":["../../src/views/BaseComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAC,QAAQ,EAAC,MAAM,OAAO,CAAC;AAItC,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,iCAAiC,CAAC;AACpE,OAAO,EAAC,WAAW,EAAC,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAC,qBAAqB,EAAC,MAAM,iCAAiC,CAAC;AAGtE,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,WAAW,CAAC,eAAe,EAAE,IAAI,EAAE,OAAO,CAAC,C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0,0 +1,38 @@
|
|
|
1
|
+
import { ComponentRegistry } from '../common/ComponentRegistry';
|
|
2
|
+
import BasePage from './BasePage';
|
|
3
|
+
const BaseContent = (props) => {
|
|
4
|
+
const { common, meta, page } = props;
|
|
5
|
+
if (!(meta === null || meta === void 0 ? void 0 : meta.type)) {
|
|
6
|
+
console.warn("BaseContent props are missing 'meta.type'");
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
const pageData = page === null || page === void 0 ? void 0 : page.page;
|
|
10
|
+
const pageDesc = pageData === null || pageData === void 0 ? void 0 : pageData.descriptor;
|
|
11
|
+
const typeDef = ComponentRegistry.getContentType(meta.type);
|
|
12
|
+
const ContentTypeView = typeDef === null || typeDef === void 0 ? void 0 : typeDef.view;
|
|
13
|
+
if (ContentTypeView && !(typeDef === null || typeDef === void 0 ? void 0 : typeDef.catchAll)) {
|
|
14
|
+
return <ContentTypeView {...props}/>;
|
|
15
|
+
}
|
|
16
|
+
else if (pageDesc) {
|
|
17
|
+
const pageAttrs = {
|
|
18
|
+
component: pageData,
|
|
19
|
+
path: page === null || page === void 0 ? void 0 : page.path,
|
|
20
|
+
meta,
|
|
21
|
+
common
|
|
22
|
+
};
|
|
23
|
+
if (page === null || page === void 0 ? void 0 : page.data) {
|
|
24
|
+
pageAttrs.data = page.data;
|
|
25
|
+
}
|
|
26
|
+
if (page === null || page === void 0 ? void 0 : page.error) {
|
|
27
|
+
pageAttrs.error = page.error;
|
|
28
|
+
}
|
|
29
|
+
return <BasePage {...pageAttrs}/>;
|
|
30
|
+
}
|
|
31
|
+
else if (ContentTypeView) {
|
|
32
|
+
return <ContentTypeView {...props}/>;
|
|
33
|
+
}
|
|
34
|
+
console.log(`BaseContent: can not render ${meta.type}: no content type or page view defined`);
|
|
35
|
+
return null;
|
|
36
|
+
};
|
|
37
|
+
export default BaseContent;
|
|
38
|
+
//# sourceMappingURL=BaseContent.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"B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AAC;QAC/B,CAAC;QACD,IAAI,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,EAAE,CAAC;YACd,SAAS,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACjC,CAAC;QAED,OAAO,CAAC,QAAQ,CAAC,IAAI,SAAS,CAAC,EAAE,CAAC;IACtC,CAAC;SAAM,IAAI,eAAe,EAAE,CAAC;QACzB,OAAO,CAAC,eAAe,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;IACzC,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,+BAA+B,IAAI,CAAC,IAAI,wCAAwC,CAAC,CAAC;IAC9F,OAAO,IAAI,CAAC;AAChB,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { XP_COMPONENT_TYPE } from '../common/constants';
|
|
2
|
+
import { ComponentRegistry } from '../common/ComponentRegistry';
|
|
3
|
+
import { MissingComponent, shouldShowMissingView } from './BaseComponent';
|
|
4
|
+
const BaseLayout = (props) => {
|
|
5
|
+
const { component, common, regions, meta, path } = props;
|
|
6
|
+
let layoutSelection;
|
|
7
|
+
if (component) {
|
|
8
|
+
layoutSelection = ComponentRegistry.getLayout(component.descriptor);
|
|
9
|
+
}
|
|
10
|
+
const SelectedLayoutView = layoutSelection === null || layoutSelection === void 0 ? void 0 : layoutSelection.view;
|
|
11
|
+
if (SelectedLayoutView) {
|
|
12
|
+
return <SelectedLayoutView layout={{ descriptor: component === null || component === void 0 ? void 0 : component.descriptor, regions: regions || {}, config: component === null || component === void 0 ? void 0 : component.config }} path={path} common={common} meta={meta}/>;
|
|
13
|
+
}
|
|
14
|
+
else if (component === null || component === void 0 ? void 0 : component.descriptor) {
|
|
15
|
+
// empty descriptor usually means uninitialized layout
|
|
16
|
+
console.warn(`BaseLayout: can not render layout '${component === null || component === void 0 ? void 0 : component.descriptor}': no next view or catch-all defined`);
|
|
17
|
+
if (shouldShowMissingView(meta)) {
|
|
18
|
+
return <MissingComponent type={XP_COMPONENT_TYPE.LAYOUT} descriptor={component.descriptor}/>;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return null;
|
|
22
|
+
};
|
|
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"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { BaseMacroProps } from '../types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export declare const MACRO_DISABLE = "system:disable";
|
|
4
|
+
export declare const MACRO_EMBED = "system:embed";
|
|
5
|
+
declare const BaseMacro: (props: BaseMacroProps) => React.JSX.Element;
|
|
6
|
+
export default BaseMacro;
|