@enonic/nextjs-adapter 3.0.0-B3 → 3.0.0-B5
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/LICENSE +201 -0
- package/baseMappings.js.map +1 -1
- package/client.js.map +1 -1
- package/common/ComponentRegistry.js.map +1 -1
- package/common/UrlProcessor.js.map +1 -1
- package/common/constants.d.ts +1 -1
- package/common/constants.js +1 -1
- package/common/constants.js.map +1 -1
- package/common/env.d.ts +1 -1
- package/common/env.js +2 -2
- package/common/env.js.map +1 -1
- package/guillotine/applyProcessors.js.map +1 -1
- package/guillotine/buildComponentTree.js.map +1 -1
- package/guillotine/buildErrorResponse.js.map +1 -1
- package/guillotine/buildPage.js.map +1 -1
- package/guillotine/collectComponentDescriptors.js.map +1 -1
- package/guillotine/combineMultipleQueries.js.map +1 -1
- package/guillotine/createMetaData.js.map +1 -1
- package/guillotine/fetchContent.js.map +1 -1
- package/guillotine/fetchContentData.js +4 -1
- package/guillotine/fetchContentData.js.map +1 -1
- package/guillotine/fetchContentPathsForAllLocales.js.map +1 -1
- package/guillotine/fetchContentPathsForLocale.js +1 -1
- package/guillotine/fetchContentPathsForLocale.js.map +1 -1
- package/guillotine/fetchFromApi.d.ts +2 -2
- package/guillotine/fetchFromApi.js +22 -13
- package/guillotine/fetchFromApi.js.map +1 -1
- package/guillotine/fetchGuillotine.d.ts +2 -2
- package/guillotine/fetchGuillotine.js +4 -4
- package/guillotine/fetchGuillotine.js.map +1 -1
- package/guillotine/fetchMetaData.js +4 -1
- package/guillotine/fetchMetaData.js.map +1 -1
- package/guillotine/getCleanContentPathArrayOrThrow400.js.map +1 -1
- package/guillotine/getComponentConfig.js.map +1 -1
- package/guillotine/getContentAndComponentPaths.js.map +1 -1
- package/guillotine/getMetaData.js.map +1 -1
- package/guillotine/getParentRegion.js.map +1 -1
- package/guillotine/getQueryAndVariables.js.map +1 -1
- package/guillotine/metadata/configQuery.js.map +1 -1
- package/guillotine/metadata/richTextQuery.js.map +1 -1
- package/guillotine/parseComponentPath.js.map +1 -1
- package/guillotine/prefixLayoutPath.js.map +1 -1
- package/guillotine/processComponentConfig.js.map +1 -1
- package/guillotine/restrictComponentsToPath.js.map +1 -1
- package/guillotine/validateData.js.map +1 -1
- package/guillotine/validateNotFound.js.map +1 -1
- package/guillotine/validateShortcut.js.map +1 -1
- package/i18n/LocaleContext.jsx.map +1 -1
- package/i18n/i18n.js.map +1 -1
- package/index.js.map +1 -1
- package/package.json +8 -9
- package/query/Shortcut.js.map +1 -1
- package/server.js +6 -0
- package/server.js.map +1 -1
- package/src/baseMappings.ts +53 -0
- package/src/client.ts +2 -0
- package/src/common/ComponentRegistry.ts +162 -0
- package/src/common/UrlProcessor.ts +142 -0
- package/src/common/constants.ts +85 -0
- package/src/common/env.ts +39 -0
- package/src/guillotine/applyProcessors.ts +38 -0
- package/src/guillotine/buildComponentTree.ts +63 -0
- package/src/guillotine/buildErrorResponse.ts +39 -0
- package/src/guillotine/buildPage.ts +15 -0
- package/src/guillotine/collectComponentDescriptors.ts +63 -0
- package/src/guillotine/combineMultipleQueries.ts +75 -0
- package/src/guillotine/createMetaData.ts +73 -0
- package/src/guillotine/fetchContent.ts +250 -0
- package/src/guillotine/fetchContentData.ts +32 -0
- package/src/guillotine/fetchContentPathsForAllLocales.ts +21 -0
- package/src/guillotine/fetchContentPathsForLocale.ts +42 -0
- package/src/guillotine/fetchFromApi.ts +76 -0
- package/src/guillotine/fetchGuillotine.ts +60 -0
- package/src/guillotine/fetchMetaData.ts +31 -0
- package/src/guillotine/getCleanContentPathArrayOrThrow400.ts +22 -0
- package/src/guillotine/getComponentConfig.ts +7 -0
- package/src/guillotine/getContentAndComponentPaths.ts +11 -0
- package/src/guillotine/getMetaData.ts +73 -0
- package/src/guillotine/getParentRegion.ts +59 -0
- package/src/guillotine/getQueryAndVariables.ts +52 -0
- package/src/guillotine/metadata/configQuery.ts +46 -0
- package/src/guillotine/metadata/richTextQuery.ts +34 -0
- package/src/guillotine/parseComponentPath.ts +29 -0
- package/src/guillotine/prefixLayoutPath.ts +16 -0
- package/src/guillotine/processComponentConfig.ts +38 -0
- package/src/guillotine/restrictComponentsToPath.ts +45 -0
- package/src/guillotine/validateData.ts +11 -0
- package/src/guillotine/validateNotFound.ts +20 -0
- package/src/guillotine/validateShortcut.ts +37 -0
- package/src/i18n/LocaleContext.tsx +54 -0
- package/src/i18n/i18n.ts +54 -0
- package/src/index.ts +42 -0
- package/src/query/Shortcut.ts +14 -0
- package/src/server.ts +5 -0
- package/src/types/component.ts +147 -0
- package/src/types/componentProps.ts +142 -0
- package/src/types/guillotine.ts +426 -0
- package/src/types/i18n.ts +8 -0
- package/src/types/index.ts +60 -0
- package/src/types/next.ts +7 -0
- package/src/types/util.ts +5 -0
- package/src/utils/addLineNumbers.ts +3 -0
- package/src/utils/buildGuillotineRequestHeaders.ts +32 -0
- package/src/utils/commonChars.ts +16 -0
- package/src/utils/fixDoubleSlashes.ts +3 -0
- package/src/utils/getContentApiUrl.ts +20 -0
- package/src/utils/getProjectLocaleConfig.ts +24 -0
- package/src/utils/getProjectLocaleConfigById.ts +21 -0
- package/src/utils/getProjectLocaleConfigByLocale.ts +19 -0
- package/src/utils/getProjectLocaleConfigs.ts +36 -0
- package/src/utils/getProjectLocales.ts +6 -0
- package/src/utils/getRenderMode.ts +14 -0
- package/src/utils/getRequestLocaleInfo.ts +29 -0
- package/src/utils/getXpBaseUrl.ts +12 -0
- package/src/utils/indent.ts +4 -0
- package/src/utils/sanitizeGraphqlName.ts +11 -0
- package/src/views/BaseComponent.tsx +153 -0
- package/src/views/BaseContent.tsx +47 -0
- package/src/views/BaseLayout.tsx +33 -0
- package/src/views/BaseMacro.tsx +94 -0
- package/src/views/BasePage.tsx +42 -0
- package/src/views/BasePart.tsx +34 -0
- package/src/views/Empty.tsx +5 -0
- package/src/views/Fragment.tsx +41 -0
- package/src/views/MainView.tsx +22 -0
- package/src/views/PropsView.tsx +38 -0
- package/src/views/Region.tsx +76 -0
- package/src/views/RichTextView.tsx +75 -0
- package/src/views/SingleComponent.tsx +19 -0
- package/src/views/StaticContent.tsx +39 -0
- package/src/views/Text.tsx +19 -0
- package/src/views/getClientHydratedHtml.tsx +12 -0
- package/src/views/macros/DefaultMacro.tsx +9 -0
- package/src/views/macros/DisableMacro.tsx +8 -0
- package/types/component.js.map +1 -1
- package/types/componentProps.js.map +1 -1
- package/types/guillotine.js.map +1 -1
- package/types/i18n.js.map +1 -1
- package/types/index.d.ts +7 -5
- package/types/index.js.map +1 -1
- package/types/next.js.map +1 -1
- package/types/util.js.map +1 -1
- package/utils/addLineNumbers.js.map +1 -1
- package/utils/buildGuillotineRequestHeaders.js.map +1 -1
- package/utils/commonChars.js.map +1 -1
- package/utils/fixDoubleSlashes.js.map +1 -1
- package/utils/getContentApiUrl.js.map +1 -1
- package/utils/getProjectLocaleConfig.js.map +1 -1
- package/utils/getProjectLocaleConfigById.js.map +1 -1
- package/utils/getProjectLocaleConfigByLocale.js.map +1 -1
- package/utils/getProjectLocaleConfigs.js +3 -3
- package/utils/getProjectLocaleConfigs.js.map +1 -1
- package/utils/getProjectLocales.js.map +1 -1
- package/utils/getRenderMode.js.map +1 -1
- package/utils/getRequestLocaleInfo.js.map +1 -1
- package/utils/getXpBaseUrl.js.map +1 -1
- package/utils/indent.js.map +1 -1
- package/utils/sanitizeGraphqlName.js.map +1 -1
- package/views/BaseComponent.jsx.map +1 -1
- package/views/BaseContent.jsx.map +1 -1
- package/views/BaseLayout.jsx.map +1 -1
- package/views/BaseMacro.jsx.map +1 -1
- package/views/BasePage.jsx.map +1 -1
- package/views/BasePart.jsx.map +1 -1
- package/views/Empty.jsx.map +1 -1
- package/views/Fragment.jsx.map +1 -1
- package/views/MainView.jsx.map +1 -1
- package/views/PropsView.jsx.map +1 -1
- package/views/Region.jsx.map +1 -1
- package/views/RichTextView.jsx.map +1 -1
- package/views/SingleComponent.jsx.map +1 -1
- package/views/StaticContent.jsx.map +1 -1
- package/views/Text.jsx.map +1 -1
- package/views/getClientHydratedHtml.jsx.map +1 -1
- package/views/macros/DefaultMacro.jsx.map +1 -1
- package/views/macros/DisableMacro.jsx.map +1 -1
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type {BasePageProps} from '../types';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
import {ComponentRegistry} from '../common/ComponentRegistry';
|
|
6
|
+
import {XP_COMPONENT_TYPE} from '../common/constants';
|
|
7
|
+
import {ErrorComponent, MissingComponent, shouldShowErrorView, shouldShowMissingView} from './BaseComponent';
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
const BasePage = (props: BasePageProps) => {
|
|
11
|
+
const {component, data, common, error, meta, path} = props;
|
|
12
|
+
const desc = component?.descriptor;
|
|
13
|
+
if (error) {
|
|
14
|
+
console.warn(`BasePage: '${desc}' error: ${error}`);
|
|
15
|
+
if (shouldShowErrorView(meta)) {
|
|
16
|
+
return <ErrorComponent reason={error} descriptor={desc} type={XP_COMPONENT_TYPE.PAGE}/>;
|
|
17
|
+
} else {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
let pageDef;
|
|
22
|
+
if (desc) {
|
|
23
|
+
pageDef = ComponentRegistry.getPage(desc);
|
|
24
|
+
}
|
|
25
|
+
const PageView = pageDef?.view;
|
|
26
|
+
if (PageView) {
|
|
27
|
+
return <PageView page={component}
|
|
28
|
+
path={path}
|
|
29
|
+
data={data}
|
|
30
|
+
common={common}
|
|
31
|
+
meta={meta}/>;
|
|
32
|
+
} else if (component?.descriptor) {
|
|
33
|
+
// empty descriptor usually means uninitialized page
|
|
34
|
+
console.warn(`BasePage: can not render page '${desc}': no next view or catch-all defined`);
|
|
35
|
+
if (shouldShowMissingView(meta)) {
|
|
36
|
+
return <MissingComponent type={XP_COMPONENT_TYPE.PAGE} descriptor={component.descriptor}/>;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return null;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export default BasePage;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type {BasePartProps} from '../types';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
import {ComponentRegistry} from '../common/ComponentRegistry';
|
|
6
|
+
import {XP_COMPONENT_TYPE} from '../common/constants';
|
|
7
|
+
import {MissingComponent, shouldShowMissingView} from './BaseComponent';
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
const BasePart = (props: BasePartProps) => {
|
|
11
|
+
const {component, data, common, meta, path} = props;
|
|
12
|
+
|
|
13
|
+
let partSelection;
|
|
14
|
+
if (component) {
|
|
15
|
+
partSelection = ComponentRegistry.getPart(component.descriptor);
|
|
16
|
+
}
|
|
17
|
+
const SelectedPartView = partSelection?.view;
|
|
18
|
+
if (SelectedPartView) {
|
|
19
|
+
return <SelectedPartView part={component}
|
|
20
|
+
path={path}
|
|
21
|
+
data={data}
|
|
22
|
+
common={common}
|
|
23
|
+
meta={meta}/>;
|
|
24
|
+
} else if (component?.descriptor) {
|
|
25
|
+
// empty descriptor usually means uninitialized part
|
|
26
|
+
console.warn(`BasePart: can not render part '${component.descriptor}': no next view or catch-all defined`);
|
|
27
|
+
if (shouldShowMissingView(meta)) {
|
|
28
|
+
return <MissingComponent type={XP_COMPONENT_TYPE.PART} descriptor={component.descriptor}/>;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return null;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export default BasePart;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type {FragmentProps, PageComponent} from '../types';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
import {FRAGMENT_DEFAULT_REGION_NAME, XP_COMPONENT_TYPE} from '../common/constants';
|
|
6
|
+
import BaseComponent, {MissingComponent, shouldShowMissingView} from './BaseComponent';
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
const FragmentView = (props: FragmentProps) => {
|
|
10
|
+
const {component, page} = props;
|
|
11
|
+
const comps: PageComponent[] = [];
|
|
12
|
+
if (page) {
|
|
13
|
+
// rendering whole page
|
|
14
|
+
const regions = page.regions || {};
|
|
15
|
+
const regionComps = regions[FRAGMENT_DEFAULT_REGION_NAME]?.components;
|
|
16
|
+
if (regionComps) {
|
|
17
|
+
comps.push(...regionComps);
|
|
18
|
+
}
|
|
19
|
+
} else if (component?.fragment) {
|
|
20
|
+
// rendering a part of a page
|
|
21
|
+
comps.push(...component.fragment.components);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (!comps.length && shouldShowMissingView(props.meta)) {
|
|
25
|
+
return <MissingComponent type={XP_COMPONENT_TYPE.FRAGMENT} descriptor={page?.descriptor || component?.id}/>;
|
|
26
|
+
} else {
|
|
27
|
+
const {common, meta} = props;
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<>
|
|
31
|
+
{
|
|
32
|
+
comps.map((comp: PageComponent, i: number) => (
|
|
33
|
+
<BaseComponent key={i} component={comp} common={common} meta={meta}/>
|
|
34
|
+
))
|
|
35
|
+
}
|
|
36
|
+
</>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export default FragmentView;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type {FetchContentResult} from '../types';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
import {XP_REQUEST_TYPE} from '../common/constants';
|
|
6
|
+
import SingleComponent from './SingleComponent';
|
|
7
|
+
import BaseContent from './BaseContent';
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
const _MainView = (props: FetchContentResult) => {
|
|
11
|
+
const {meta} = props;
|
|
12
|
+
|
|
13
|
+
// Single-component render:
|
|
14
|
+
if (meta?.requestType === XP_REQUEST_TYPE.COMPONENT) {
|
|
15
|
+
return <SingleComponent {...props} />;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// meta.requestType="type", and hence content-type based, is standard view for now.
|
|
19
|
+
return <BaseContent {...props} />;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default _MainView;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
|
|
3
|
+
interface Props {
|
|
4
|
+
label: string
|
|
5
|
+
data: any
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const PropsView = (props: any) => {
|
|
9
|
+
return (
|
|
10
|
+
<div className='debug'
|
|
11
|
+
style={{margin: '10px', padding: '10px', border: '2px solid lightgrey'}}>
|
|
12
|
+
<DataDump label='Page' data={props.page}/>
|
|
13
|
+
<DataDump label='Part' data={props.part}/>
|
|
14
|
+
<DataDump label='Layout' data={props.layout}/>
|
|
15
|
+
<DataDump label='Data' data={props.data}/>
|
|
16
|
+
<DataDump label='Common' data={props.common}/>
|
|
17
|
+
</div>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default PropsView;
|
|
22
|
+
|
|
23
|
+
const DataDump = ({label, data}: Props) => (
|
|
24
|
+
(data && (
|
|
25
|
+
<>
|
|
26
|
+
{label && (
|
|
27
|
+
<h5 style={{marginTop: '0', marginBottom: '0'}}>{label}:</h5>
|
|
28
|
+
)}
|
|
29
|
+
<pre style={{
|
|
30
|
+
fontSize: '.8em',
|
|
31
|
+
width: '100%',
|
|
32
|
+
whiteSpace: 'pre-wrap',
|
|
33
|
+
wordWrap: 'break-word',
|
|
34
|
+
}}>{JSON.stringify(data, null, 2)}</pre>
|
|
35
|
+
</>
|
|
36
|
+
)
|
|
37
|
+
) || null
|
|
38
|
+
);
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type {PageComponent, RegionProps, RegionsProps} from '../types';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
import {PORTAL_REGION_ATTRIBUTE, RENDER_MODE} from '../common/constants';
|
|
6
|
+
import BaseComponent from './BaseComponent';
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
/** Single region */
|
|
10
|
+
export const RegionView = (props: RegionProps) => {
|
|
11
|
+
const {name, components, common, meta, className} = props;
|
|
12
|
+
const regionAttrs: Record<string,string> = {};
|
|
13
|
+
|
|
14
|
+
if (className) {
|
|
15
|
+
regionAttrs.className = className;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const children = (components || [])
|
|
19
|
+
.sort(sortPageComponentsByPath)
|
|
20
|
+
.map((component: PageComponent, i: number) => (
|
|
21
|
+
<BaseComponent key={`${regionAttrs.id}-${i}`} component={component} common={common} meta={meta}/>
|
|
22
|
+
));
|
|
23
|
+
|
|
24
|
+
if (meta.renderMode === RENDER_MODE.EDIT) {
|
|
25
|
+
regionAttrs.id = name + 'Region';
|
|
26
|
+
regionAttrs[PORTAL_REGION_ATTRIBUTE] = name;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return <div {...regionAttrs}>{children}</div>;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
/** Multiple regions, or only one if named in props.selected */
|
|
34
|
+
const RegionsView = (props: RegionsProps) => {
|
|
35
|
+
const {page, name, meta, common} = props;
|
|
36
|
+
const regions = page?.regions;
|
|
37
|
+
if (!regions || !Object.keys(regions)) {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Detect if any single region is selected for rendering and if so, handle that
|
|
42
|
+
if (name) {
|
|
43
|
+
const selectedRegion = regions[name];
|
|
44
|
+
if (!selectedRegion) {
|
|
45
|
+
console.warn(
|
|
46
|
+
`Region name '${name}' was selected but not found among regions (${JSON.stringify(Object.keys(regions))}). Skipping.`); // TODO: Throw error instead of this? Return null?
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
return <RegionView {...selectedRegion} common={common} meta={meta}/>;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<>
|
|
54
|
+
{
|
|
55
|
+
Object.keys(regions).map((name: string, i) => {
|
|
56
|
+
const region = regions[name];
|
|
57
|
+
return <RegionView key={i} {...region} common={common} meta={meta}/>;
|
|
58
|
+
})
|
|
59
|
+
}
|
|
60
|
+
</>
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
function sortPageComponentsByPath(aComp: PageComponent, bComp: PageComponent): number {
|
|
65
|
+
// sort according to index in region, otherwise there will be a mismatch of views and data
|
|
66
|
+
// because after 10 components the order will be: /main/1, /main/11, /main/2, /main/3,...
|
|
67
|
+
|
|
68
|
+
let pathArr = aComp.path.split('/');
|
|
69
|
+
const aIndex = +(pathArr[pathArr.length - 1] || 0);
|
|
70
|
+
pathArr = bComp.path.split('/');
|
|
71
|
+
const bIndex = +(pathArr[pathArr.length - 1] || 0);
|
|
72
|
+
|
|
73
|
+
return aIndex - bIndex;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export default RegionsView;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type {MetaData, Replacer, ReplacerResult, RichTextData, RichTextViewProps} from '../types';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
import {getUrl, UrlProcessor} from '../common/UrlProcessor';
|
|
6
|
+
import HTMLReactParser, {DOMNode} from 'html-react-parser';
|
|
7
|
+
import {ElementType} from 'domelementtype';
|
|
8
|
+
import BaseMacro from './BaseMacro';
|
|
9
|
+
import Link from 'next/link';
|
|
10
|
+
import {Text} from 'domhandler';
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
export function createReplacer(allData: RichTextData, meta: MetaData, renderMacroInEditMode = true, customReplacer?: Replacer): (domNode: DOMNode) => ReplacerResult {
|
|
14
|
+
// eslint-disable-next-line react/display-name
|
|
15
|
+
return (domNode: DOMNode): ReplacerResult => {
|
|
16
|
+
if (domNode.type !== ElementType.Tag) {
|
|
17
|
+
return domNode;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const el = domNode;
|
|
21
|
+
let ref: string;
|
|
22
|
+
switch (el.tagName) {
|
|
23
|
+
case UrlProcessor.IMG_TAG:
|
|
24
|
+
ref = el.attribs[UrlProcessor.IMG_ATTR];
|
|
25
|
+
if (ref) {
|
|
26
|
+
if (UrlProcessor.isContentImage(ref, allData.images)) {
|
|
27
|
+
const src = el.attribs['src'];
|
|
28
|
+
if (src) {
|
|
29
|
+
el.attribs['src'] = getUrl(src, meta);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const srcset = el.attribs['srcset'];
|
|
33
|
+
if (srcset) {
|
|
34
|
+
el.attribs['srcset'] = UrlProcessor.processSrcSet(srcset, meta);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
break;
|
|
39
|
+
case UrlProcessor.LINK_TAG:
|
|
40
|
+
ref = el.attribs[UrlProcessor.LINK_ATTR];
|
|
41
|
+
const href = el.attribs['href'];
|
|
42
|
+
|
|
43
|
+
if (ref && href) {
|
|
44
|
+
const textChild = el.children?.find(c => c.type === ElementType.Text) as Text;
|
|
45
|
+
return <Link href={getUrl(href, meta)}>{textChild?.data}</Link>;
|
|
46
|
+
}
|
|
47
|
+
break;
|
|
48
|
+
case UrlProcessor.MACRO_TAG:
|
|
49
|
+
ref = el.attribs[UrlProcessor.MACRO_ATTR];
|
|
50
|
+
const data = ref && allData.macros.find((d) => d.ref === ref);
|
|
51
|
+
if (data) {
|
|
52
|
+
return <BaseMacro data={data} meta={meta} renderInEditMode={renderMacroInEditMode}/>;
|
|
53
|
+
}
|
|
54
|
+
break;
|
|
55
|
+
default:
|
|
56
|
+
if (customReplacer) {
|
|
57
|
+
const result = customReplacer(domNode, allData, meta, renderMacroInEditMode);
|
|
58
|
+
if (result) {
|
|
59
|
+
return result;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
return el;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const RichTextView = ({className, tag, data, meta, renderMacroInEditMode, customReplacer}: RichTextViewProps) => {
|
|
69
|
+
const CustomTag = tag as keyof JSX.IntrinsicElements || 'section';
|
|
70
|
+
return <CustomTag className={className}>
|
|
71
|
+
{data.processedHtml ? HTMLReactParser(data.processedHtml, {replace: createReplacer(data, meta, renderMacroInEditMode, customReplacer)}) : ''}
|
|
72
|
+
</CustomTag>;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export default RichTextView;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/** Render only one component as a result of a request from XP-side .../_/component/... during edit refresh. */
|
|
3
|
+
import type {FetchContentResult} from '../types';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
import BaseComponent from './BaseComponent';
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
const SingleComponent = ({meta, common}: FetchContentResult) => {
|
|
10
|
+
|
|
11
|
+
if (!meta?.requestedComponent) {
|
|
12
|
+
// TODO: Handle missing target region (Throw a 404, "component path not found"?)
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return <BaseComponent component={meta.requestedComponent} common={common} meta={meta}/>;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export default SingleComponent;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import {StaticContentProps} from '../types';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
import {createElement, createRef} from 'react';
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
function useStaticContent(ref, isServer) {
|
|
8
|
+
if (isServer) {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
if (ref?.current?.innerHTML === '') {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
export default function StaticContent({children, element = 'div', condition = true, ...props}: StaticContentProps) {
|
|
21
|
+
const isServer = typeof window === 'undefined';
|
|
22
|
+
const ref = createRef();
|
|
23
|
+
const isStatic = useStaticContent(ref, isServer);
|
|
24
|
+
|
|
25
|
+
// avoid re-render on the client
|
|
26
|
+
if (isStatic && condition) {
|
|
27
|
+
return createElement(element, {
|
|
28
|
+
...props,
|
|
29
|
+
ref,
|
|
30
|
+
suppressHydrationWarning: true,
|
|
31
|
+
dangerouslySetInnerHTML: {__html: ''},
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// just render if:
|
|
36
|
+
// - condition is false
|
|
37
|
+
// - we're in the server or a spa navigation
|
|
38
|
+
return createElement(element, props, ...[].concat(children));
|
|
39
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type {MetaData, TextData} from '../types';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
import RichTextView from './RichTextView';
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
interface Props {
|
|
9
|
+
meta: MetaData
|
|
10
|
+
component: TextData
|
|
11
|
+
path: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
const DefaultTextView = ({component, meta, path}: Props) => (
|
|
16
|
+
<RichTextView data={component.value} meta={meta} renderMacroInEditMode={false}/>
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
export default DefaultTextView;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
/// <reference types="react" />
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
import {hydrateRoot} from 'react-dom/client';
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
export default function getClientHydratedHtml(component: React.ReactNode) {
|
|
9
|
+
const root = document.createElement('div');
|
|
10
|
+
hydrateRoot(root, component);
|
|
11
|
+
return root.innerHTML;
|
|
12
|
+
}
|
package/types/component.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"component.js","sourceRoot":"","sources":["../src/types/component.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"componentProps.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"componentProps.js","sourceRoot":"","sources":["../src/types/componentProps.ts"],"names":[],"mappings":""}
|
package/types/guillotine.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guillotine.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"guillotine.js","sourceRoot":"","sources":["../src/types/guillotine.ts"],"names":[],"mappings":""}
|
package/types/i18n.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../src/types/i18n.ts"],"names":[],"mappings":""}
|
package/types/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
/// <reference types="react" />
|
|
3
2
|
export type * from './component';
|
|
4
3
|
export type * from './componentProps';
|
|
@@ -34,10 +33,13 @@ export interface ProjectLocaleConfig {
|
|
|
34
33
|
}
|
|
35
34
|
export type ProjectLocalesConfig = Record<string, ProjectLocaleConfig>;
|
|
36
35
|
export type SelectorName = 'contentType' | 'page' | 'component' | 'part' | 'layout' | 'macro';
|
|
37
|
-
export
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
export type FetchOptions = Omit<RequestInit, 'body'> & {
|
|
37
|
+
body?: ContentApiBaseBody;
|
|
38
|
+
next?: {
|
|
39
|
+
revalidate?: boolean | number;
|
|
40
|
+
tags?: string[];
|
|
41
|
+
};
|
|
42
|
+
};
|
|
41
43
|
export interface StaticContentProps extends Record<string, any> {
|
|
42
44
|
children?: React.ReactNode;
|
|
43
45
|
element?: string;
|
package/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/types/index.ts"],"names":[],"mappings":"AAAA,+BAA+B"}
|
package/types/next.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"next.js","sourceRoot":"","sources":["../src/types/next.ts"],"names":[],"mappings":""}
|
package/types/util.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["../src/types/util.ts"],"names":[],"mappings":";AAIA,sFAAsF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addLineNumbers.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"addLineNumbers.js","sourceRoot":"","sources":["../src/utils/addLineNumbers.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,cAAc,CAAC,CAAS;IACpC,OAAO,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1E,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildGuillotineRequestHeaders.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"buildGuillotineRequestHeaders.js","sourceRoot":"","sources":["../src/utils/buildGuillotineRequestHeaders.ts"],"names":[],"mappings":"AAGA,OAAO,EACH,0BAA0B,EAC1B,iBAAiB,GACpB,MAAM,qBAAqB,CAAC;AAG7B,MAAM,UAAU,6BAA6B,CAAC,EAC1C,OAAO,EACP,aAAa,EACb,MAAM,EACN,OAAO,GAMV;;IACG,MAAM,wBAAwB,GAA6B;QACvD,CAAC,0BAA0B,CAAC,cAAc,CAAC,EAAE,aAAa;QAC1D,CAAC,0BAA0B,CAAC,MAAM,CAAC,EAAE,MAAM;QAC3C,CAAC,0BAA0B,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;KAChE,CAAC;IACF,MAAM,UAAU,GAAG,MAAA,OAAO,CAAC,OAAO,0CAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC;IAC3D,IAAI,UAAU,EAAE,CAAC;QACb,wBAAwB,CAAC,0BAA0B,CAAC,MAAM,CAAC;YACvD,GAAG,iBAAiB,IAAI,UAAU,EAAE,CAAC;IAC7C,CAAC;IACD,OAAO,wBAAwB,CAAC;AACpC,CAAC"}
|
package/utils/commonChars.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commonChars.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"commonChars.js","sourceRoot":"","sources":["../src/utils/commonChars.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAAW,EAAE,EAAW,EAAE,EAAE;IACpD,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACnD,OAAO,MAAM,CAAC;IAClB,CAAC;IACD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACjC,MAAM,SAAS,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;QACxB,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,SAAS,EAAE,CAAC;YACtB,MAAM,IAAI,SAAS,CAAC;QACxB,CAAC;aAAM,CAAC;YACJ,MAAM;QACV,CAAC;IACL,CAAC;IAED,OAAO,MAAM,CAAC;AAClB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fixDoubleSlashes.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"fixDoubleSlashes.js","sourceRoot":"","sources":["../src/utils/fixDoubleSlashes.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,gBAAgB,CAAC,GAAW;IACxC,OAAO,GAAG,CAAC,OAAO,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC;AAClD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getContentApiUrl.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"getContentApiUrl.js","sourceRoot":"","sources":["../src/utils/getContentApiUrl.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,WAAW,EAAC,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAC,OAAO,EAAC,MAAM,eAAe,CAAC;AACtC,OAAO,EAAC,sBAAsB,EAAC,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAG9C,MAAM,UAAU,gBAAgB,CAAC,OAAgB;IAC7C,MAAM,OAAO,GAAG,sBAAsB,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC;IACxD,MAAM,MAAM,GAAG,aAAa,CAAC,OAAO,CAAC,KAAK,WAAW,CAAC,IAAI;QACtD,CAAC,CAAC,QAAQ;QACV,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,KAAK,WAAW,CAAC,IAAI;YACzC,CAAC,CAAC,QAAQ;YACV,CAAC,CAAC,OAAO,CAAC;IAElB,OAAO,gBAAgB,CAAC,GAAG,OAAO,IAAI,OAAO,IAAI,MAAM,EAAE,CAAC,CAAC;AAC/D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getProjectLocaleConfig.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"getProjectLocaleConfig.js","sourceRoot":"","sources":["../src/utils/getProjectLocaleConfig.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAC,0BAA0B,EAAC,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAC,8BAA8B,EAAC,MAAM,kCAAkC,CAAC;AAGhF,MAAM,UAAU,sBAAsB,CAAC,OAAgB;;IACnD,MAAM,SAAS,GAAG,MAAA,OAAO,CAAC,OAAO,0CAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC;IAE1D,IAAI,MAA2B,CAAC;IAChC,IAAI,SAAS,EAAE,CAAC;QACZ,8BAA8B;QAC9B,MAAM,GAAG,0BAA0B,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IAC1D,CAAC;IACD,IAAI,CAAC,MAAM,EAAE,CAAC;QACV,kCAAkC;QAClC,mDAAmD;QACnD,MAAM,GAAG,8BAA8B,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5D,CAAC;IAED,OAAO,MAAM,CAAC;AAClB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getProjectLocaleConfigById.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"getProjectLocaleConfigById.js","sourceRoot":"","sources":["../src/utils/getProjectLocaleConfigById.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,uBAAuB,EAAC,MAAM,2BAA2B,CAAC;AAGlE,MAAM,UAAU,0BAA0B,CAAC,SAAkB,EAAE,UAAU,GAAG,IAAI;IAC5E,MAAM,OAAO,GAAG,uBAAuB,EAAE,CAAC;IAE1C,IAAI,MAA2B,CAAC;IAChC,IAAI,SAAS,EAAE,CAAC;QACZ,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;;YACrC,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,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IACzD,CAAC;IAED,OAAO,MAAM,CAAC;AAClB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getProjectLocaleConfigByLocale.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"getProjectLocaleConfigByLocale.js","sourceRoot":"","sources":["../src/utils/getProjectLocaleConfigByLocale.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,uBAAuB,EAAC,MAAM,2BAA2B,CAAC;AAGlE,MAAM,UAAU,8BAA8B,CAAC,MAAe,EAAE,UAAU,GAAG,IAAI;IAC7E,MAAM,OAAO,GAAG,uBAAuB,EAAE,CAAC;IAE1C,IAAI,MAA2B,CAAC;IAChC,IAAI,MAAM,EAAE,CAAC;QACT,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC;IACD,IAAI,CAAC,MAAM,IAAI,UAAU,EAAE,CAAC;QACxB,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IACzD,CAAC;IAED,OAAO,MAAM,CAAC;AAClB,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ENV_VARS } from '../common/constants';
|
|
2
|
-
import {
|
|
2
|
+
import { MAPPINGS } from '../common/env';
|
|
3
3
|
// NOTE: Dissallowing slash and any whitespace in 2nd capture group.
|
|
4
4
|
const PROJECT_CONFIG_REGEXP = /^([\w-]+):([^/\s]+)(\/[\w.-]+)?$/i;
|
|
5
5
|
export function getProjectLocaleConfigs() {
|
|
6
|
-
const str =
|
|
6
|
+
const str = MAPPINGS;
|
|
7
7
|
if (!(str === null || str === void 0 ? void 0 : str.length)) {
|
|
8
|
-
throw new Error(`Did you forget to define "${ENV_VARS.
|
|
8
|
+
throw new Error(`Did you forget to define "${ENV_VARS.MAPPINGS}" environmental variable?
|
|
9
9
|
Format: <default-language>:<default-repository-name>/<default-site-path>,<language>:<repository-name>/<site-path>,...`);
|
|
10
10
|
}
|
|
11
11
|
return str.split(',').reduce((config, prjStr, index) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getProjectLocaleConfigs.js","sourceRoot":"","sources":["
|
|
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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getProjectLocales.js","sourceRoot":"","sources":["
|
|
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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRenderMode.js","sourceRoot":"","sources":["
|
|
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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRequestLocaleInfo.js","sourceRoot":"","sources":["
|
|
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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getXpBaseUrl.js","sourceRoot":"","sources":["
|
|
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"}
|
package/utils/indent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indent.js","sourceRoot":"","sources":["
|
|
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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sanitizeGraphqlName.js","sourceRoot":"","sources":["
|
|
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"}
|