@remkoj/optimizely-cms-react 2.0.0-pre2 → 2.0.0-pre4
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/browser/context.js.map +1 -1
- package/dist/browser/index.d.ts +1 -1
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/rich-text/index.d.ts +1 -1
- package/dist/errors.js +0 -1
- package/dist/errors.js.map +1 -1
- package/dist/factory.d.ts +1 -1
- package/dist/factory.js +1 -2
- package/dist/factory.js.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/server/components/cms-content-area.d.ts +3 -3
- package/dist/server/components/cms-content-area.js +4 -4
- package/dist/server/components/cms-content-area.js.map +1 -1
- package/dist/server/components/cms-content.d.ts +3 -3
- package/dist/server/components/cms-content.js +9 -9
- package/dist/server/components/cms-content.js.map +1 -1
- package/dist/server/components/get-content-type.d.ts +1 -1
- package/dist/server/components/get-content-type.js +1 -1
- package/dist/server/components/get-content-type.js.map +1 -1
- package/dist/server/components/index.d.ts +3 -3
- package/dist/server/components/index.js +3 -3
- package/dist/server/components/index.js.map +1 -1
- package/dist/server/components/types.d.ts +6 -2
- package/dist/server/components/visual-builder/Composition.d.ts +2 -2
- package/dist/server/components/visual-builder/Composition.js +64 -15
- package/dist/server/components/visual-builder/Composition.js.map +1 -1
- package/dist/server/components/visual-builder/functions.d.ts +1 -1
- package/dist/server/components/visual-builder/index.d.ts +4 -4
- package/dist/server/components/visual-builder/index.js +3 -3
- package/dist/server/components/visual-builder/index.js.map +1 -1
- package/dist/server/components/visual-builder/types.d.ts +16 -11
- package/dist/server/context.d.ts +1 -1
- package/dist/server/context.js +10 -8
- package/dist/server/context.js.map +1 -1
- package/dist/server/factory.d.ts +3 -3
- package/dist/server/factory.js +3 -3
- package/dist/server/factory.js.map +1 -1
- package/dist/server/index.d.ts +5 -5
- package/dist/server/index.js +4 -4
- package/dist/server/index.js.map +1 -1
- package/dist/types.d.ts +5 -0
- package/dist/utilities.d.ts +14 -1
- package/dist/utilities.js +20 -0
- package/dist/utilities.js.map +1 -1
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/browser/context.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/browser/context.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAqD,MAAM,iCAAiC,CAAA;AAC7G,OAAO,EAAE,aAAa,EAAE,UAAU,EAAkD,MAAM,OAAO,CAAA;AAEjG,MAAM,oBAAoB,GAAG,aAAa,CAAqC,SAAS,CAAC,CAAA;AAEzF,MAAM,CAAC,MAAM,wBAAwB,GAAwG,CAAC,EAAE,cAAc,EAAE,QAAQ,EAAE,EAAE,EAAE;IAE1K,MAAM,MAAM,GAAG,IAAI,QAAQ,CAAC,aAAa,CAAC,cAAc,CAAC,CAAA;IACzD,OAAO,KAAC,oBAAoB,CAAC,QAAQ,IAAC,KAAK,EAAG,MAAM,YAAK,QAAQ,GAAkC,CAAA;AACvG,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAkC,GAAG,EAAE;IACnE,MAAM,MAAM,GAAG,UAAU,CAAC,oBAAoB,CAAC,CAAA;IAC/C,IAAI,MAAM,IAAI,SAAS;QACnB,MAAM,IAAI,KAAK,CAAC,8GAA8G,CAAC,CAAA;IACnI,OAAO,MAAM,CAAA;AACjB,CAAC,CAAA"}
|
package/dist/browser/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './context';
|
|
1
|
+
export * from './context.js';
|
package/dist/browser/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './context';
|
|
1
|
+
export * from './context.js';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/browser/index.tsx"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/browser/index.tsx"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './rich-text';
|
|
1
|
+
export * from './rich-text/index.js';
|
package/dist/components/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './rich-text';
|
|
1
|
+
export * from './rich-text/index.js';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA"}
|
package/dist/errors.js
CHANGED
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,uBAAwB,SAAQ,KAAK;
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IAI9C,IAAW,WAAW;QAElB,OAAO,IAAI,CAAC,YAAY,CAAA;IAC5B,CAAC;IAED,YAAmB,kBAAwB,EAAE,OAAgB;QAEzD,KAAK,CAAC,OAAO,IAAI,sBAAsB,CAAC,CAAA;QACxC,IAAI,CAAC,YAAY,GAAG,kBAAkB,CAAA;IAC1C,CAAC;CACJ"}
|
package/dist/factory.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ComponentFactory, ComponentType, ComponentTypeHandle, ComponentTypeDictionary } from './types';
|
|
1
|
+
import type { ComponentFactory, ComponentType, ComponentTypeHandle, ComponentTypeDictionary } from './types.js';
|
|
2
2
|
export declare const EmptyComponentHandle = "$$fragment$$";
|
|
3
3
|
/**
|
|
4
4
|
* The default implementation of the ComponentFactory iterface
|
package/dist/factory.js
CHANGED
|
@@ -4,9 +4,8 @@ export const EmptyComponentHandle = '$$fragment$$';
|
|
|
4
4
|
* The default implementation of the ComponentFactory iterface
|
|
5
5
|
*/
|
|
6
6
|
export class DefaultComponentFactory {
|
|
7
|
-
registry = {};
|
|
8
|
-
dbg;
|
|
9
7
|
constructor() {
|
|
8
|
+
this.registry = {};
|
|
10
9
|
this.dbg = process.env.OPTIMIZELY_DEBUG == '1';
|
|
11
10
|
}
|
|
12
11
|
register(type, component) {
|
package/dist/factory.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AACA,MAAM,YAAY,GAAG,GAAG,CAAA;AAExB,MAAM,CAAC,MAAM,oBAAoB,GAAI,cAAc,CAAA;AAEnD;;GAEG;AACH,MAAM,OAAO,uBAAuB;
|
|
1
|
+
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AACA,MAAM,YAAY,GAAG,GAAG,CAAA;AAExB,MAAM,CAAC,MAAM,oBAAoB,GAAI,cAAc,CAAA;AAEnD;;GAEG;AACH,MAAM,OAAO,uBAAuB;IAIhC;QAHQ,aAAQ,GAA2C,EAAE,CAAA;QAKzD,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,GAAG,CAAA;IAClD,CAAC;IAED,QAAQ,CAAC,IAAyB,EAAE,SAAwB;QAExD,IAAI,GAAG,0BAA0B,CAAC,IAAI,CAAC,CAAA;QACvC,IAAI,IAAI,CAAC,GAAG;YAAE,OAAO,CAAC,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CAAC,IAAI,QAAQ,CAAC;QACjE,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,IAAI,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;IAC3H,MAAM,IAAI,KAAK,CAAC,kCAAmC,OAAM,CAAC,MAAM,CAAE,EAAE,CAAC,CAAA;AACzE,CAAC;AAED,MAAM,OAAO,GAAqC,EAAE,CAAA;AAEpD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,UAAU,GAA4B,GAAG,EAAE;IACpD,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,GAAG,CAAA;IAC/C,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;QACnB,IAAI,GAAG;YAAE,OAAO,CAAC,GAAG,CAAC,qDAAqD,CAAC,CAAA;QAC3E,OAAO,CAAC,OAAO,GAAG,IAAI,uBAAuB,EAAE,CAAA;IACnD,CAAC;SAAM,CAAC;QACJ,IAAI,GAAG;YAAE,OAAO,CAAC,GAAG,CAAC,yDAAyD,CAAC,CAAA;IACnF,CAAC;IACD,OAAO,OAAO,CAAC,OAAO,CAAA;AAC1B,CAAC,CAAA;AACD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,UAAU,GAA4C,CAAC,UAA4B,EAAE,EAAE;IAChG,OAAO,CAAC,OAAO,GAAG,UAAU,CAAA;AAChC,CAAC,CAAA;AACD,eAAe,UAAU,EAAE,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The version of the current Optimizely DXP React SDK
|
|
3
3
|
*/
|
|
4
|
-
export declare const Version = "0.0
|
|
5
|
-
export * from './types';
|
|
6
|
-
export * as Errors from './errors';
|
|
7
|
-
export * as Utils from './utilities';
|
|
8
|
-
export * from './factory';
|
|
4
|
+
export declare const Version = "2.0.0";
|
|
5
|
+
export * from './types.js';
|
|
6
|
+
export * as Errors from './errors.js';
|
|
7
|
+
export * as Utils from './utilities.js';
|
|
8
|
+
export * from './factory.js';
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The version of the current Optimizely DXP React SDK
|
|
3
3
|
*/
|
|
4
|
-
export const Version = '0.0
|
|
4
|
+
export const Version = '2.0.0';
|
|
5
5
|
// Export library
|
|
6
|
-
export * from './types';
|
|
7
|
-
export * as Errors from './errors';
|
|
8
|
-
export * as Utils from './utilities';
|
|
9
|
-
export * from './factory';
|
|
6
|
+
export * from './types.js';
|
|
7
|
+
export * as Errors from './errors.js';
|
|
8
|
+
export * as Utils from './utilities.js';
|
|
9
|
+
export * from './factory.js';
|
|
10
10
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAA;AAE9B,iBAAiB;AACjB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAA;AAE9B,iBAAiB;AACjB,cAAc,YAAY,CAAA;AAC1B,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAA;AACvC,cAAc,cAAc,CAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import 'server-only';
|
|
3
|
-
import type { ElementType } from '../type-utils';
|
|
4
|
-
import type { CmsContentAreaProps, ContentAreaItemDefinition } from './types';
|
|
5
|
-
export type { CmsContentAreaClassMapper, CmsContentAreaProps, ContentAreaItemDefinition } from './types';
|
|
3
|
+
import type { ElementType } from '../type-utils.js';
|
|
4
|
+
import type { CmsContentAreaProps, ContentAreaItemDefinition } from './types.js';
|
|
5
|
+
export type { CmsContentAreaClassMapper, CmsContentAreaProps, ContentAreaItemDefinition } from './types.js';
|
|
6
6
|
/**
|
|
7
7
|
* React server component to render a content area
|
|
8
8
|
*
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import 'server-only';
|
|
3
|
-
import CmsContent from './cms-content';
|
|
4
|
-
import * as Utils from '../../utilities';
|
|
5
|
-
import * as Errors from '../../errors';
|
|
3
|
+
import CmsContent from './cms-content.js';
|
|
4
|
+
import * as Utils from '../../utilities.js';
|
|
5
|
+
import * as Errors from '../../errors.js';
|
|
6
6
|
import createClient from '@remkoj/optimizely-graph-client';
|
|
7
7
|
import { normalizeContentLinkWithLocale, contentLinkToString } from '@remkoj/optimizely-graph-client/utils';
|
|
8
|
-
import getServerContext from '../context';
|
|
8
|
+
import getServerContext from '../context.js';
|
|
9
9
|
//#endregion
|
|
10
10
|
/**
|
|
11
11
|
* React server component to render a content area
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cms-content-area.js","sourceRoot":"","sources":["../../../src/server/components/cms-content-area.tsx"],"names":[],"mappings":";AAAA,OAAO,aAAa,CAAA;AAEpB,OAAO,UAAU,MAAM,
|
|
1
|
+
{"version":3,"file":"cms-content-area.js","sourceRoot":"","sources":["../../../src/server/components/cms-content-area.tsx"],"names":[],"mappings":";AAAA,OAAO,aAAa,CAAA;AAEpB,OAAO,UAAU,MAAM,kBAAkB,CAAA;AAEzC,OAAO,KAAK,KAAK,MAAM,oBAAoB,CAAA;AAC3C,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAA;AACzC,OAAO,YAAY,MA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AAA;QAE3F,eAAe;QACf,OAAO,MAAM,UAAU,CAAC,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAA;IACvF,CAAC,CAAC,CAAC,CAAA;AACP,CAAC;AAED,eAAe,cAAc,CAAA"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import 'server-only';
|
|
3
|
-
import type { CmsContentProps } from './types';
|
|
4
|
-
export type { CmsContentProps } from './types';
|
|
3
|
+
import type { CmsContentProps } from './types.js';
|
|
4
|
+
export type { CmsContentProps } from './types.js';
|
|
5
5
|
/**
|
|
6
6
|
* React Server Side component for the CmsContent
|
|
7
7
|
*
|
|
8
8
|
* @param param0
|
|
9
9
|
* @returns
|
|
10
10
|
*/
|
|
11
|
-
export declare const CmsContent: <LocalesType = string>({ contentType, contentTypePrefix, contentLink: rawContentLink, children, fragmentData }: CmsContentProps<LocalesType>) => Promise<JSX.Element>;
|
|
11
|
+
export declare const CmsContent: <LocalesType = string>({ contentType, contentTypePrefix, contentLink: rawContentLink, children, fragmentData, layoutProps }: CmsContentProps<LocalesType>) => Promise<JSX.Element>;
|
|
12
12
|
export default CmsContent;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import 'server-only';
|
|
3
|
-
import getContentType from './get-content-type';
|
|
4
|
-
import getServerContext from '../context';
|
|
3
|
+
import getContentType from './get-content-type.js';
|
|
4
|
+
import getServerContext from '../context.js';
|
|
5
5
|
import createClient, { AuthMode, normalizeContentLink, contentLinkToString, isInlineContentLink } from '@remkoj/optimizely-graph-client';
|
|
6
6
|
import { print } from 'graphql';
|
|
7
|
-
import * as Utils from "../../utilities";
|
|
8
|
-
import * as Queries from './queries';
|
|
7
|
+
import * as Utils from "../../utilities.js";
|
|
8
|
+
import * as Queries from './queries.js';
|
|
9
9
|
/**
|
|
10
10
|
* React Server Side component for the CmsContent
|
|
11
11
|
*
|
|
12
12
|
* @param param0
|
|
13
13
|
* @returns
|
|
14
14
|
*/
|
|
15
|
-
export const CmsContent = async ({ contentType, contentTypePrefix, contentLink: rawContentLink, children, fragmentData }) => {
|
|
15
|
+
export const CmsContent = async ({ contentType, contentTypePrefix, contentLink: rawContentLink, children, fragmentData, layoutProps }) => {
|
|
16
16
|
const context = getServerContext();
|
|
17
17
|
const contentLink = normalizeContentLink(rawContentLink);
|
|
18
18
|
if (!contentLink) {
|
|
@@ -80,7 +80,7 @@ export const CmsContent = async ({ contentType, contentTypePrefix, contentLink:
|
|
|
80
80
|
console.error("🔴 [CmsContent] Invalid fragment data received for ", Component.displayName ?? contentType?.join("/") ?? "[Undetermined component]");
|
|
81
81
|
return _jsx(_Fragment, {});
|
|
82
82
|
}
|
|
83
|
-
return _jsx(Component, { contentLink: contentLink, data: fragmentData || {}, inEditMode: context.inEditMode });
|
|
83
|
+
return _jsx(Component, { contentLink: contentLink, data: fragmentData || {}, inEditMode: context.inEditMode, layoutProps: layoutProps, children: children });
|
|
84
84
|
}
|
|
85
85
|
if (isInline) {
|
|
86
86
|
console.error(`🔴 [CmsContent] No data for content ${contentLinkToString(contentLink)}, data cannot be resolved for inline content`);
|
|
@@ -95,7 +95,7 @@ export const CmsContent = async ({ contentType, contentTypePrefix, contentLink:
|
|
|
95
95
|
const gqlResponse = await client.request(gqlQuery, gqlVariables);
|
|
96
96
|
if (context.isDebug)
|
|
97
97
|
console.log("⚪ [CmsContent] Component request the following data:", gqlResponse);
|
|
98
|
-
return _jsx(Component, { contentLink: contentLink, data: gqlResponse, inEditMode: context.inEditMode });
|
|
98
|
+
return _jsx(Component, { contentLink: contentLink, data: gqlResponse, inEditMode: context.inEditMode, layoutProps: layoutProps, children: children });
|
|
99
99
|
}
|
|
100
100
|
// Render using included fragment
|
|
101
101
|
if (Utils.isCmsComponentWithFragment(Component)) {
|
|
@@ -112,12 +112,12 @@ export const CmsContent = async ({ contentType, contentTypePrefix, contentLink:
|
|
|
112
112
|
throw new Error(`CmsContent expected to load exactly one content item of type ${name}, received ${totalItems} from Optimizely Graph. Content Item: ${JSON.stringify(fragmentVariables)}`);
|
|
113
113
|
if (totalItems > 1 && context.isDebug)
|
|
114
114
|
console.warn(`🟠 [CmsContent] Resolved ${totalItems} content items, expected only 1. Picked the first one`);
|
|
115
|
-
return _jsx(Component, { contentLink: contentLink, data: fragmentResponse.contentById.items[0], inEditMode: context.inEditMode });
|
|
115
|
+
return _jsx(Component, { contentLink: contentLink, data: fragmentResponse.contentById.items[0], inEditMode: context.inEditMode, layoutProps: layoutProps, children: children });
|
|
116
116
|
}
|
|
117
117
|
// Assume there's no server side prepared data needed for the component
|
|
118
118
|
if (context.isDebug)
|
|
119
119
|
console.log(`⚪ [CmsContent] Component of type "${contentType?.join('/') ?? Component.displayName ?? '?'}" did not request pre-loading of data`);
|
|
120
|
-
return _jsx(Component, { contentLink: contentLink, data: fragmentData || {}, inEditMode: context.inEditMode });
|
|
120
|
+
return _jsx(Component, { contentLink: contentLink, data: fragmentData || {}, inEditMode: context.inEditMode, layoutProps: layoutProps, children: children });
|
|
121
121
|
};
|
|
122
122
|
export default CmsContent;
|
|
123
123
|
//# sourceMappingURL=cms-content.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cms-content.js","sourceRoot":"","sources":["../../../src/server/components/cms-content.tsx"],"names":[],"mappings":";AAAA,OAAO,aAAa,CAAA;AAIpB,OAAO,cAAc,MAAM,
|
|
1
|
+
{"version":3,"file":"cms-content.js","sourceRoot":"","sources":["../../../src/server/components/cms-content.tsx"],"names":[],"mappings":";AAAA,OAAO,aAAa,CAAA;AAIpB,OAAO,cAAc,MAAM,uBAAuB,CAAA;AAClD,OAAO,gBAAgB,MAAM,eAAe,CAAA;AAC5C,OAAO,YAAY,EAAE,EAAE,QAAQ,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,mBAAmB,EAAoB,MA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,KAAK,CAAC,gEAAiE,IAAK,cAAe,UAAW,yCAA0C,IAAI,CAAC,SAAS,CAAE,iBAAiB,CAAE,EAAE,CAAC,CAAA;QACpM,IAAI,UAAU,GAAG,CAAC,IAAI,OAAO,CAAC,OAAO;YAAE,OAAO,CAAC,IAAI,CAAC,4BAA6B,UAAW,uDAAuD,CAAC,CAAA;QACpJ,OAAO,KAAC,SAAS,IAAC,WAAW,EAAG,WAA0B,EAAG,IAAI,EAAG,gBAAgB,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,EAAG,UAAU,EAAG,OAAO,CAAC,UAAU,EAAG,WAAW,EAAG,WAAW,YAAK,QAAQ,GAAa,CAAA;IACrM,CAAC;IAED,uEAAuE;IACvE,IAAI,OAAO,CAAC,OAAO;QACf,OAAO,CAAC,GAAG,CAAC,qCAAsC,WAAW,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC,WAAW,IAAI,GAAG,uCAAuC,CAAC,CAAA;IACpJ,OAAO,KAAC,SAAS,IAAC,WAAW,EAAG,WAA0B,EAAG,IAAI,EAAG,YAAY,IAAI,EAAE,EAAG,UAAU,EAAG,OAAO,CAAC,UAAU,EAAG,WAAW,EAAG,WAAW,YAAK,QAAQ,GAAa,CAAA;AAClL,CAAC,CAAA;AAED,eAAe,UAAU,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IOptiGraphClient } from "@remkoj/optimizely-graph-client";
|
|
2
|
-
import type { ContentType, ContentLinkWithLocale } from "../../types";
|
|
2
|
+
import type { ContentType, ContentLinkWithLocale } from "../../types.js";
|
|
3
3
|
/**
|
|
4
4
|
* Resolve the ContentType of an Optimizely CMS Component, identified by its content link
|
|
5
5
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-content-type.js","sourceRoot":"","sources":["../../../src/server/components/get-content-type.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA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;AACtB,CAAC;AAED,eAAe,cAAc,CAAA;AAW7B,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;EAwBpC,CAAA"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './cms-content';
|
|
2
|
-
export * from './cms-content-area';
|
|
3
|
-
export * from './visual-builder';
|
|
1
|
+
export * from './cms-content.js';
|
|
2
|
+
export * from './cms-content-area.js';
|
|
3
|
+
export * from './visual-builder/index.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './cms-content';
|
|
2
|
-
export * from './cms-content-area';
|
|
3
|
-
export * from './visual-builder';
|
|
1
|
+
export * from './cms-content.js';
|
|
2
|
+
export * from './cms-content-area.js';
|
|
3
|
+
export * from './visual-builder/index.js';
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/server/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/server/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,uBAAuB,CAAA;AACrC,cAAc,2BAA2B,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SuspenseProps, PropsWithChildren } from "react";
|
|
2
|
-
import type { ComponentFactory, ContentType } from "../../types";
|
|
3
|
-
import type { ElementChildrenProps, ElementProps, ElementType, PropTypeIfPropExists, MayBeArray, TypeIfPropExists } from '../type-utils';
|
|
2
|
+
import type { ComponentFactory, ContentType } from "../../types.js";
|
|
3
|
+
import type { ElementChildrenProps, ElementProps, ElementType, PropTypeIfPropExists, MayBeArray, TypeIfPropExists } from '../type-utils.js';
|
|
4
4
|
import type { IOptiGraphClient, ContentLinkWithLocale, InlineContentLinkWithLocale } from "@remkoj/optimizely-graph-client";
|
|
5
5
|
export type CmsContentProps<LocalesType = string> = PropsWithChildren<{
|
|
6
6
|
/**
|
|
@@ -59,6 +59,10 @@ export type CmsContentProps<LocalesType = string> = PropsWithChildren<{
|
|
|
59
59
|
* it will not be applied.
|
|
60
60
|
*/
|
|
61
61
|
contentTypePrefix?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Any layout properties inferred from the context
|
|
64
|
+
*/
|
|
65
|
+
layoutProps?: Record<string, any>;
|
|
62
66
|
}>;
|
|
63
67
|
export type ContentAreaItemDefinition = {
|
|
64
68
|
__typename?: string | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import 'server-only';
|
|
3
|
-
import type { OptimizelyCompositionProps } from './types';
|
|
4
|
-
export declare function OptimizelyComposition({ node,
|
|
3
|
+
import type { OptimizelyCompositionProps } from './types.js';
|
|
4
|
+
export declare function OptimizelyComposition({ node, leafPropsFactory, nodePropsFactory }: OptimizelyCompositionProps): Promise<JSX.Element>;
|
|
5
5
|
export default OptimizelyComposition;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
import 'server-only';
|
|
3
|
-
import { isElementNode } from './functions';
|
|
4
|
-
import { CmsContent } from '../cms-content';
|
|
2
|
+
import { isElementNode } from './functions.js';
|
|
3
|
+
import { CmsContent } from '../cms-content.js';
|
|
5
4
|
import { isContentLink, isInlineContentLink } from '@remkoj/optimizely-graph-client';
|
|
5
|
+
import getServerContext from '../../context.js';
|
|
6
6
|
function isContentType(toTest) {
|
|
7
7
|
return Array.isArray(toTest) && toTest.every(x => typeof (x) == 'string' && x.length > 0);
|
|
8
8
|
}
|
|
@@ -17,21 +17,70 @@ const defaultPropsFactory = (node) => {
|
|
|
17
17
|
};
|
|
18
18
|
if (!(isContentLink(contentLink) || isInlineContentLink(contentLink)))
|
|
19
19
|
throw new Error("Invalid content link: " + JSON.stringify(contentLink));
|
|
20
|
-
|
|
20
|
+
const layoutData = {
|
|
21
|
+
type: node.type,
|
|
22
|
+
layoutType: node.layoutType,
|
|
23
|
+
template: node.template,
|
|
24
|
+
settings: node.settings
|
|
25
|
+
};
|
|
26
|
+
return [contentLink, contentType, node.element, layoutData];
|
|
27
|
+
};
|
|
28
|
+
function ucFirst(input) {
|
|
29
|
+
return input[0].toUpperCase() + input.substring(1);
|
|
30
|
+
}
|
|
31
|
+
const defaultNodePropsFactory = (node) => {
|
|
32
|
+
const componentTypes = [
|
|
33
|
+
[node.template, node.type ? ucFirst(node.type) : null, ucFirst(node.layoutType), "Component", "Content"].filter(x => x),
|
|
34
|
+
(node.template && node.type) ? [node.type ? ucFirst(node.type) : null, ucFirst(node.layoutType), "Component", "Content"].filter(x => x) : null,
|
|
35
|
+
["Node", "Component", "Content"]
|
|
36
|
+
].filter(x => x);
|
|
37
|
+
const contentLink = { key: node.key ?? '' };
|
|
38
|
+
const componentData = {};
|
|
39
|
+
const layoutData = {
|
|
40
|
+
type: node.type,
|
|
41
|
+
layoutType: node.layoutType,
|
|
42
|
+
template: node.template,
|
|
43
|
+
settings: node.settings
|
|
44
|
+
};
|
|
45
|
+
if (!(isContentLink(contentLink) || isInlineContentLink(contentLink)))
|
|
46
|
+
throw new Error("Invalid content link: " + JSON.stringify(contentLink));
|
|
47
|
+
return [contentLink, componentTypes, componentData, layoutData];
|
|
21
48
|
};
|
|
22
|
-
export async function OptimizelyComposition({ node,
|
|
49
|
+
export async function OptimizelyComposition({ node, leafPropsFactory = defaultPropsFactory, nodePropsFactory = defaultNodePropsFactory }) {
|
|
23
50
|
if (isElementNode(node)) {
|
|
24
|
-
const [contentLink, contentType, fragmentData] =
|
|
25
|
-
return CmsContent({ contentLink, contentType, fragmentData });
|
|
51
|
+
const [contentLink, contentType, fragmentData, layoutProps] = leafPropsFactory(node);
|
|
52
|
+
return CmsContent({ contentLink, contentType, fragmentData, layoutProps });
|
|
26
53
|
}
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
54
|
+
const { factory, isDebug } = getServerContext();
|
|
55
|
+
if (!factory)
|
|
56
|
+
throw new Error("OptimizelyComposition requires the factory be defined within the serverContext");
|
|
57
|
+
const children = await Promise.all((node.nodes ?? []).map((child, idx) => {
|
|
58
|
+
const childKey = `vb::node::${child.key}::${child.name}`;
|
|
59
|
+
return OptimizelyComposition({
|
|
60
|
+
key: childKey,
|
|
61
|
+
node: child,
|
|
62
|
+
leafPropsFactory,
|
|
63
|
+
nodePropsFactory
|
|
64
|
+
});
|
|
65
|
+
}));
|
|
66
|
+
const [contentLink, contentTypes, fragmentData, layoutProps] = nodePropsFactory(node);
|
|
67
|
+
const firstExistingType = contentTypes.map(ct => {
|
|
68
|
+
const reversed = [...ct].reverse();
|
|
69
|
+
const hasType = factory.has(reversed);
|
|
70
|
+
if (!hasType && isDebug)
|
|
71
|
+
console.log(`🟡 [VisualBuilder] Content type ${reversed.join('/')} not found within factory`);
|
|
72
|
+
return hasType;
|
|
73
|
+
}).indexOf(true);
|
|
74
|
+
const contentType = contentTypes[firstExistingType];
|
|
75
|
+
if (!contentType)
|
|
76
|
+
throw new Error("OptimizelyComposition requires the factory have a definition for Component/Node");
|
|
77
|
+
return CmsContent({
|
|
78
|
+
contentType,
|
|
79
|
+
contentLink,
|
|
80
|
+
fragmentData,
|
|
81
|
+
children,
|
|
82
|
+
layoutProps
|
|
83
|
+
});
|
|
35
84
|
}
|
|
36
85
|
export default OptimizelyComposition;
|
|
37
86
|
//# sourceMappingURL=Composition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Composition.js","sourceRoot":"","sources":["../../../../src/server/components/visual-builder/Composition.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Composition.js","sourceRoot":"","sources":["../../../../src/server/components/visual-builder/Composition.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AACpB,OAAO,EAAE,aA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,CAAC;YACzB,GAAG,EAAE,QAAQ;YACb,IAAI,EAAE,KAAK;YACX,gBAAgB;YAChB,gBAAgB;SACnB,CAAC,CAAA;IACN,CAAC,CAAC,CAAC,CAAC;IAEJ,MAAM,CAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,CAAE,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAA;IACvF,MAAM,iBAAiB,GAAG,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE;QAC5C,MAAM,QAAQ,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,OAAO,EAAE,CAAA;QAClC,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;QACrC,IAAI,CAAC,OAAO,IAAI,OAAO;YACnB,OAAO,CAAC,GAAG,CAAC,mCAAoC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAE,2BAA2B,CAAC,CAAA;QACnG,OAAO,OAAO,CAAA;IAClB,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;IAChB,MAAM,WAAW,GAAG,YAAY,CAAC,iBAAiB,CAAC,CAAA;IACnD,IAAI,CAAC,WAAW;QACZ,MAAM,IAAI,KAAK,CAAC,iFAAiF,CAAC,CAAA;IAEtG,OAAO,UAAU,CAAC;QACd,WAAW;QACX,WAAW;QACX,YAAY;QACZ,QAAQ;QACR,WAAW;KACd,CAAC,CAAA;AACN,CAAC;AAED,eAAe,qBAAqB,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CompositionNode, CompositionElementNode, CompositionStructureNode } from './types';
|
|
1
|
+
import { CompositionNode, CompositionElementNode, CompositionStructureNode } from './types.js';
|
|
2
2
|
export declare function isElementNode(node: CompositionNode<Record<string, any>>): node is CompositionElementNode<Record<string, any>>;
|
|
3
3
|
export declare function isElementNodeOfType<ET extends Record<string, any>>(node: CompositionNode<Record<string, any>>, test: (data: Record<string, any>) => data is ET): node is CompositionElementNode<ET>;
|
|
4
4
|
export declare function isStructureNode(node: CompositionNode<Record<string, any>>): node is CompositionStructureNode;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type * from './types';
|
|
2
|
-
export * from './functions';
|
|
3
|
-
export { OptimizelyComposition } from './Composition';
|
|
4
|
-
export { OptimizelyComposition as default } from './Composition';
|
|
1
|
+
export type * from './types.js';
|
|
2
|
+
export * from './functions.js';
|
|
3
|
+
export { OptimizelyComposition } from './Composition.js';
|
|
4
|
+
export { OptimizelyComposition as default } from './Composition.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './functions';
|
|
2
|
-
export { OptimizelyComposition } from './Composition';
|
|
3
|
-
export { OptimizelyComposition as default } from './Composition';
|
|
1
|
+
export * from './functions.js';
|
|
2
|
+
export { OptimizelyComposition } from './Composition.js';
|
|
3
|
+
export { OptimizelyComposition as default } from './Composition.js';
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/server/components/visual-builder/index.ts"],"names":[],"mappings":"AAEA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/server/components/visual-builder/index.ts"],"names":[],"mappings":"AAEA,cAAc,gBAAgB,CAAA;AAE9B,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,EAAE,qBAAqB,IAAI,OAAO,EAAE,MAAM,kBAAkB,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ComponentType, type PropsWithChildren } from "react";
|
|
2
|
-
import { type ContentType } from "../../../types";
|
|
2
|
+
import { type ContentType } from "../../../types.js";
|
|
3
3
|
import { type InlineContentLinkWithLocale, type ContentLinkWithLocale } from "@remkoj/optimizely-graph-client";
|
|
4
4
|
export declare enum StructureNodeTypes {
|
|
5
5
|
Outline = "outline",
|
|
@@ -7,18 +7,23 @@ export declare enum StructureNodeTypes {
|
|
|
7
7
|
Row = "row",
|
|
8
8
|
Column = "column"
|
|
9
9
|
}
|
|
10
|
-
export type
|
|
10
|
+
export type CompositionNodeBase = {
|
|
11
11
|
name: string | null;
|
|
12
|
+
key: string | null;
|
|
13
|
+
type?: string | null;
|
|
14
|
+
template?: string | null;
|
|
15
|
+
settings?: Array<{
|
|
16
|
+
key: string;
|
|
17
|
+
value: string | number | boolean;
|
|
18
|
+
} | null> | null;
|
|
19
|
+
};
|
|
20
|
+
export type CompositionStructureNode = CompositionNodeBase & {
|
|
12
21
|
layoutType: "outline" | "grid" | "row" | "column";
|
|
13
22
|
nodes?: Array<CompositionNode>;
|
|
14
|
-
key: string | null;
|
|
15
|
-
type: string | null;
|
|
16
23
|
};
|
|
17
|
-
export type CompositionElementNode<E extends Record<string, any> = Record<string, any>> = {
|
|
18
|
-
name: string | null;
|
|
24
|
+
export type CompositionElementNode<E extends Record<string, any> = Record<string, any>> = CompositionNodeBase & {
|
|
19
25
|
layoutType: "element";
|
|
20
26
|
element: E;
|
|
21
|
-
key: string | null;
|
|
22
27
|
};
|
|
23
28
|
export type CompositionNode<E extends Record<string, any> = Record<string, any>> = CompositionStructureNode | CompositionElementNode<E>;
|
|
24
29
|
export type CompositionComponentType<NT extends CompositionNode> = ComponentType<NT extends CompositionElementNode<infer DT> ? {
|
|
@@ -27,11 +32,11 @@ export type CompositionComponentType<NT extends CompositionNode> = ComponentType
|
|
|
27
32
|
} : PropsWithChildren<{
|
|
28
33
|
node: Omit<NT, 'nodes'>;
|
|
29
34
|
}>>;
|
|
30
|
-
export type
|
|
31
|
-
export type
|
|
35
|
+
export type LeafPropsFactory = <ET extends Record<string, any>, LT = string>(node: CompositionElementNode<ET>) => [ContentLinkWithLocale<LT> | InlineContentLinkWithLocale<LT>, ContentType, ET] | [ContentLinkWithLocale<LT> | InlineContentLinkWithLocale<LT>, ContentType, ET, Record<string, any>];
|
|
36
|
+
export type NodePropsFactory = <ET extends Record<string, any>, LT = string>(node: CompositionStructureNode) => [ContentLinkWithLocale<LT> | InlineContentLinkWithLocale<LT>, Array<ContentType>, ET] | [ContentLinkWithLocale<LT> | InlineContentLinkWithLocale<LT>, Array<ContentType>, ET, Record<string, any>];
|
|
32
37
|
export type OptimizelyCompositionProps = {
|
|
33
38
|
node: CompositionNode<Record<string, any>>;
|
|
34
|
-
|
|
35
|
-
|
|
39
|
+
leafPropsFactory?: LeafPropsFactory;
|
|
40
|
+
nodePropsFactory?: NodePropsFactory;
|
|
36
41
|
key?: string;
|
|
37
42
|
};
|
package/dist/server/context.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import 'server-only';
|
|
2
|
-
import type { ComponentFactory, GenericContext } from '../types';
|
|
2
|
+
import type { ComponentFactory, GenericContext } from '../types.js';
|
|
3
3
|
import { type IOptiGraphClient, type ContentLink } from "@remkoj/optimizely-graph-client";
|
|
4
4
|
export interface ServerContext extends GenericContext {
|
|
5
5
|
readonly forceEditorWarnings: boolean;
|
package/dist/server/context.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import 'server-only';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { isDevelopment, isDebug } from "./is-debug";
|
|
4
|
-
import { getFactory } from '../factory';
|
|
3
|
+
import { isDevelopment, isDebug } from "./is-debug.js";
|
|
4
|
+
import { getFactory } from '../factory.js';
|
|
5
5
|
import { contentLinkIsEqual } from "@remkoj/optimizely-graph-client";
|
|
6
6
|
class DefaultServerContext {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
constructor() {
|
|
8
|
+
this._inEditMode = false;
|
|
9
|
+
this._forceEditorWarnings = false;
|
|
10
|
+
this._client = undefined;
|
|
11
|
+
this._factory = undefined;
|
|
12
|
+
this._locale = undefined;
|
|
13
|
+
this._editableContent = undefined;
|
|
14
|
+
}
|
|
13
15
|
get inEditMode() {
|
|
14
16
|
return this._inEditMode;
|
|
15
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/server/context.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AACpB,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/server/context.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AACpB,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE1C,OAAO,EAAE,kBAAkB,EAA2C,MAAM,iCAAiC,CAAA;AAgB7G,MAAM,oBAAoB;IAA1B;QACY,gBAAW,GAAa,KAAK,CAAA;QAC7B,yBAAoB,GAAa,KAAK,CAAA;QACtC,YAAO,GAAkC,SAAS,CAAA;QAClD,aAAQ,GAAkC,SAAS,CAAA;QACnD,YAAO,GAAwB,SAAS,CAAA;QACxC,qBAAgB,GAA6B,SAAS,CAAA;IAsDlE,CAAC;IArDG,IAAW,UAAU;QACjB,OAAO,IAAI,CAAC,WAAW,CAAA;IAC3B,CAAC;IACD,IAAW,OAAO;QACd,OAAO,OAAO,EAAE,CAAA;IACpB,CAAC;IACD,IAAW,aAAa;QACpB,OAAO,aAAa,EAAE,CAAA;IAC1B,CAAC;IACD,IAAW,oBAAoB;QAC3B,OAAO,aAAa,EAAE,IAAI,OAAO,EAAE,CAAA;IACvC,CAAC;IACD,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,OAAO,CAAA;IACvB,CAAC;IACD,IAAW,OAAO;QACd,OAAO,IAAI,CAAC,QAAQ,IAAI,UAAU,EAAE,CAAA;IACxC,CAAC;IACD,IAAW,mBAAmB;QAC1B,OAAO,IAAI,CAAC,oBAAoB,CAAA;IACpC,CAAC;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dist/server/factory.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import 'server-only';
|
|
2
|
-
import type * as Types from '../types';
|
|
3
|
-
export type { ComponentFactory } from '../types';
|
|
4
|
-
export { DefaultComponentFactory } from '../factory';
|
|
2
|
+
import type * as Types from '../types.js';
|
|
3
|
+
export type { ComponentFactory } from '../types.js';
|
|
4
|
+
export { DefaultComponentFactory } from '../factory.js';
|
|
5
5
|
/**
|
|
6
6
|
* Retrieve the working instance of the component factory, which is memoized through the React.cache()
|
|
7
7
|
* server side react method
|
package/dist/server/factory.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import 'server-only';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { DefaultComponentFactory as DefaultFactory } from '../factory';
|
|
4
|
-
import isDebug from './is-debug';
|
|
5
|
-
export { DefaultComponentFactory } from '../factory';
|
|
3
|
+
import { DefaultComponentFactory as DefaultFactory } from '../factory.js';
|
|
4
|
+
import isDebug from './is-debug.js';
|
|
5
|
+
export { DefaultComponentFactory } from '../factory.js';
|
|
6
6
|
/**
|
|
7
7
|
* Retrieve the working instance of the component factory, which is memoized through the React.cache()
|
|
8
8
|
* server side react method
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../../src/server/factory.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AACpB,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,uBAAuB,IAAI,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../../src/server/factory.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AACpB,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,uBAAuB,IAAI,cAAc,EAAE,MAAM,eAAe,CAAA;AACzE,OAAO,OAAO,MAAM,eAAe,CAAA;AAGnC,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAA;AAEvD;;;GAGG;AACH,oGAAoG;AACpG,MAAM,CAAC,MAAM,UAAU,GAAkC,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE;IACtE,MAAM,OAAO,GAAG,IAAI,cAAc,EAAE,CAAA;IACpC,IAAI,OAAO,EAAE;QACT,OAAO,CAAC,GAAG,CAAC,gEAAgE,CAAC,CAAA;IACjF,OAAO,OAAO,CAAA;AAClB,CAAC,CAAC,CAAA;AAEF,eAAe,UAAU,CAAA"}
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import 'server-only';
|
|
2
|
-
export * from './factory';
|
|
3
|
-
export * from './components';
|
|
4
|
-
export * from './context';
|
|
5
|
-
export * from './is-debug';
|
|
6
|
-
export type { CmsComponent, CmsComponentProps } from '../types';
|
|
2
|
+
export * from './factory.js';
|
|
3
|
+
export * from './components/index.js';
|
|
4
|
+
export * from './context.js';
|
|
5
|
+
export * from './is-debug.js';
|
|
6
|
+
export type { CmsComponent, CmsComponentProps } from '../types.js';
|
package/dist/server/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import 'server-only';
|
|
2
|
-
export * from './factory';
|
|
3
|
-
export * from './components';
|
|
4
|
-
export * from './context';
|
|
5
|
-
export * from './is-debug';
|
|
2
|
+
export * from './factory.js';
|
|
3
|
+
export * from './components/index.js';
|
|
4
|
+
export * from './context.js';
|
|
5
|
+
export * from './is-debug.js';
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
package/dist/server/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AACpB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AACpB,cAAc,cAAc,CAAA;AAC5B,cAAc,uBAAuB,CAAA;AACrC,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA"}
|
package/dist/types.d.ts
CHANGED
|
@@ -18,6 +18,10 @@ export type CmsComponentProps<T> = PropsWithChildren<{
|
|
|
18
18
|
* Use the Server/Client context instead if you need this information
|
|
19
19
|
*/
|
|
20
20
|
inEditMode?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Contextual layout data, if any
|
|
23
|
+
*/
|
|
24
|
+
layoutProps?: Record<string, any>;
|
|
21
25
|
}>;
|
|
22
26
|
export type ContentQueryProps<LocaleType = string> = ContentLink & {
|
|
23
27
|
locale?: Array<LocaleType> | LocaleType | null;
|
|
@@ -62,6 +66,7 @@ export type CmsComponentWithOptionalQuery<T = DocumentNode> = BaseCmsComponent<T
|
|
|
62
66
|
export type CmsComponent<T = DocumentNode> = T extends TypedDocumentNode<infer R, any> ? CmsComponentWithQuery<R> : T extends DocumentNode ? CmsComponentWithQuery<{
|
|
63
67
|
[key: string]: any;
|
|
64
68
|
}> : T extends GraphQLFragmentBase ? CmsComponentWithFragment<T> : T extends GraphQLQueryBase ? CmsComponentWithQuery<T> : CmsComponentWithOptionalQuery<T>;
|
|
69
|
+
export type CmsLayoutComponent<T = never> = ReactComponentType<CmsComponentProps<T>>;
|
|
65
70
|
export type ComponentType = (ReactComponentType<any>) | (ReactExoticComponent<any>) | (keyof JSX.IntrinsicElements);
|
|
66
71
|
export type ComponentTypeHandle = string | string[];
|
|
67
72
|
export type ComponentTypeDictionary = {
|
package/dist/utilities.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ComponentType } from 'react';
|
|
2
|
-
import type * as Types from './types';
|
|
2
|
+
import type * as Types from './types.js';
|
|
3
3
|
import type { DocumentNode } from 'graphql';
|
|
4
4
|
export declare function isNonEmptyString(toTest: any): toTest is string;
|
|
5
5
|
export declare function isNotNullOrUndefined<T>(toTest?: T | null): toTest is T;
|
|
@@ -12,3 +12,16 @@ export declare function contentLinkToRequestVariables(contentLink: Types.Content
|
|
|
12
12
|
export declare function toUniqueValues<R extends any>(value: R, index: number, array: Array<R>): value is R;
|
|
13
13
|
export declare function trim<T extends string | null | undefined>(valueToTrim: T): T;
|
|
14
14
|
export declare function getContentEditId(contentLink: Types.ContentLink): string;
|
|
15
|
+
/**
|
|
16
|
+
* Generate a pseudo-random identifier usable to satisfy the unique key
|
|
17
|
+
* requirement for children within a React node. However this effectively will
|
|
18
|
+
* tell React that the childrend will be unique for each render and thus cause
|
|
19
|
+
* them to update.
|
|
20
|
+
*
|
|
21
|
+
* Only use this method to generate keys if there's no other way to test the
|
|
22
|
+
* uniqueness of the child
|
|
23
|
+
*
|
|
24
|
+
* @param prefix The prefix to apply to the children
|
|
25
|
+
* @returns The unique key
|
|
26
|
+
*/
|
|
27
|
+
export declare function getRandomKey(prefix?: string): string;
|
package/dist/utilities.js
CHANGED
|
@@ -56,4 +56,24 @@ export function trim(valueToTrim) {
|
|
|
56
56
|
export function getContentEditId(contentLink) {
|
|
57
57
|
return contentLink.key;
|
|
58
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* Generate a pseudo-random identifier usable to satisfy the unique key
|
|
61
|
+
* requirement for children within a React node. However this effectively will
|
|
62
|
+
* tell React that the childrend will be unique for each render and thus cause
|
|
63
|
+
* them to update.
|
|
64
|
+
*
|
|
65
|
+
* Only use this method to generate keys if there's no other way to test the
|
|
66
|
+
* uniqueness of the child
|
|
67
|
+
*
|
|
68
|
+
* @param prefix The prefix to apply to the children
|
|
69
|
+
* @returns The unique key
|
|
70
|
+
*/
|
|
71
|
+
export function getRandomKey(prefix = "rnd") {
|
|
72
|
+
try {
|
|
73
|
+
return `${prefix}::${crypto.randomUUID()}`;
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
return `${prefix}::${Math.round(Math.random() * 10000)}::${Math.round(Math.random() * 10000)}`;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
59
79
|
//# sourceMappingURL=utilities.js.map
|
package/dist/ut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
"name": "@remkoj/optimizely-cms-react",
|
|
3
3
|
"license": "Apache-2.0",
|
|
4
|
-
"version": "2.0.0-
|
|
4
|
+
"version": "2.0.0-pre4",
|
|
5
5
|
"packageManager": "yarn@4.1.1",
|
|
6
6
|
"repository": "https://github.com/remkoj/optimizely-dxp-clients.git",
|
|
7
7
|
"author": "Remko Jantzen <693172+remkoj@users.noreply.github.com>",
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@remkoj/optimizely-graph-client": "2.0.0-
|
|
43
|
+
"@remkoj/optimizely-graph-client": "2.0.0-pre4",
|
|
44
44
|
"@types/crypto-js": "^4.2.2",
|
|
45
|
-
"@types/node": "^20.12.
|
|
46
|
-
"@types/react": "^18.3.
|
|
45
|
+
"@types/node": "^20.12.12",
|
|
46
|
+
"@types/react": "^18.3.3",
|
|
47
47
|
"@types/react-dom": "18.3.0",
|
|
48
48
|
"graphql": "^16.8.1",
|
|
49
49
|
"graphql-request": "^6.1.0",
|
|
@@ -58,9 +58,9 @@
|
|
|
58
58
|
"crypto-js": "^4.2.0"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
|
-
"@remkoj/optimizely-graph-client": "2.0.0-
|
|
62
|
-
"graphql": "
|
|
63
|
-
"graphql-request": "
|
|
61
|
+
"@remkoj/optimizely-graph-client": "2.0.0-pre4",
|
|
62
|
+
"graphql": "^16.8.1",
|
|
63
|
+
"graphql-request": "^6.1.0",
|
|
64
64
|
"react": "*",
|
|
65
65
|
"react-dom": "*"
|
|
66
66
|
},
|