@remkoj/optimizely-cms-react 5.1.0 → 6.0.0-pre1
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/components/cms-content/rsc.js +1 -0
- package/dist/components/cms-content/rsc.js.map +1 -1
- package/dist/components/cms-content-area/index.js.map +1 -1
- package/dist/components/rich-text/components.d.ts +1 -1
- package/dist/components/rsc-components.d.ts +31 -0
- package/dist/components/rsc-components.js +53 -0
- package/dist/components/rsc-components.js.map +1 -0
- package/dist/components/rsc.d.ts +0 -45
- package/dist/components/rsc.js +0 -51
- package/dist/components/rsc.js.map +1 -1
- package/dist/components/type-utils.d.ts +1 -1
- package/dist/components/visual-builder/types.d.ts +1 -1
- package/dist/context/rsc.js +8 -6
- package/dist/context/rsc.js.map +1 -1
- package/dist/factory/types.d.ts +1 -1
- package/dist/rsc.d.ts +1 -0
- package/dist/rsc.js +1 -0
- package/dist/rsc.js.map +1 -1
- package/package.json +15 -21
- package/dist/components.d.ts +0 -29
- package/dist/components.js +0 -24
- package/dist/components.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rsc.js","sourceRoot":"","sources":["../../../src/components/cms-content/rsc.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rsc.js","sourceRoot":"","sources":["../../../src/components/cms-content/rsc.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAGZ,OAAO,cAAc,MAAM,uBAAuB,CAAA;AAClD,OAAO,UAAU,MAAM,kBAAkB,CAAA;AACzC,OAAO,EACL,QAAQ,EACR,oBAAoB,GAGrB,MAAM,iCAAiC,CAAA;AACxC,OAAO,gBAAgB,EAAE,EACvB,2BAA2B,GAC5B,MAAM,wBAAwB,CAAA;AAC/B,OAAO,kBAAkB,MAAM,2BAA2B,CAAA;AAI1D;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAuB;AACrD,iBAAiB;AACjB,WAAW,EACX,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AAS,IAAC,WAAW,EAAE,WAA0B,GAAI,CAAA;IAE/D,kDAAkD;IAClD,MAAM,IAAI,GAAG,MAAM,UAAU,CAC3B,WAAW,EACX,WAAW,EACX,SAAS,EACT,YAAY,EACZ,UAAU,CACX,CAAA;IAED,8BAA8B;IAC9B,OAAO,CACL,KAAC,SAAS,IACR,WAAW,EAAE,WAA0B,EACvC,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,GAAG,CAAC,UAAU,EAC1B,WAAW,EAAE,WAAW,EACxB,GAAG,EAAE,GAAG,YAEP,QAAQ,GACC,CACb,CAAA;AACH,CAAC;AAED,eAAe,UAAU,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/cms-content-area/index.tsx"],"names":[],"mappings":";AACA,OAAO,KAAK,KAAK,MAAM,oBAAoB,CAAA;AAC3C,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAA;AACzC,OAAO,EACL,8BAA8B,EAC9B,mBAAmB,GACpB,MAAM,uCAAuC,CAAA;AAO9C,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/cms-content-area/index.tsx"],"names":[],"mappings":";AACA,OAAO,KAAK,KAAK,MAAM,oBAAoB,CAAA;AAC3C,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAA;AACzC,OAAO,EACL,8BAA8B,EAC9B,mBAAmB,GACpB,MAAM,uCAAuC,CAAA;AAO9C,OAAO,EAAE,QAAQ,EAAY,MAAM,OAAO,CAAA;AAS1C,YAAY;AAEZ;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GAAgC,CAGzD,EACA,KAAK,GAAG,EAA4C,EACpD,WAAW,EACX,SAAS,EACT,EAAE,EAAE,WAAW,EACf,aAAa,EACb,WAAW,EACX,WAAW,GAAG,KAAqD,EACnE,QAAQ,EACR,SAAS,EAAE,sBAAsB,GAAG,KAGtB,EACd,OAA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WAAW,IAAI,KAAK,CAAA;IAC9D,OAAO,CACL,KAAC,oBAAoB,OAAK,yBAAyB,YAChD,4BAA4B,GACR,CACxB,CAAA;AACH,CAAC,CAAA;AAED,SAAS,wBAAwB,CAC/B,GAAsC;IAEtC,OAAO,CACL,OAAO,GAAG,IAAI,QAAQ;QACtB,GAAG,IAAI,IAAI;QACX,OAAO,GAAG,CAAC,SAAS,IAAI,QAAQ;QAChC,GAAG,CAAC,SAAS,IAAI,IAAI,CACtB,CAAA;AACH,CAAC;AAED,eAAe,cAAc,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type FunctionComponent, type PropsWithChildren } from 'react';
|
|
1
|
+
import { type FunctionComponent, type PropsWithChildren, type JSX } from 'react';
|
|
2
2
|
import { ComponentTypeDictionary } from '../../factory/types.js';
|
|
3
3
|
import type { TextNode, TypedNode } from './types.js';
|
|
4
4
|
import { type PropsWithOptionalContext } from '../../context/types.js';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type CmsContentAreaComponent } from './cms-content-area/index.js';
|
|
2
|
+
import { type CmsEditableComponent } from './cms-editable/index.js';
|
|
3
|
+
import { type CmsContentComponent } from './cms-content/rsc.js';
|
|
4
|
+
import { type OptimizelyCompositionComponent } from './visual-builder/index.js';
|
|
5
|
+
import { type RichTextComponent } from './rich-text/index.js';
|
|
6
|
+
/**
|
|
7
|
+
* Client side Optimizely CMS Editable
|
|
8
|
+
*/
|
|
9
|
+
export declare const CmsEditable: CmsEditableComponent;
|
|
10
|
+
/**
|
|
11
|
+
* Client side Optimizely CMS Content, leveraging the CMS Context to load the
|
|
12
|
+
* content type and content data when needed
|
|
13
|
+
*/
|
|
14
|
+
export declare const CmsContent: CmsContentComponent;
|
|
15
|
+
export type { CmsContentComponent, CmsContentProps } from './cms-content/rsc.js';
|
|
16
|
+
/**
|
|
17
|
+
* Client side Optimizely CMS Content Area, leveraging the CMS Context to infer
|
|
18
|
+
* the connection to Optimizely Graph and component dictionary.
|
|
19
|
+
*/
|
|
20
|
+
export declare const CmsContentArea: CmsContentAreaComponent;
|
|
21
|
+
export type { CmsContentAreaClassMapper, CmsContentAreaComponent, CmsContentAreaProps, ContentAreaItemDefinition, } from './cms-content-area/index.js';
|
|
22
|
+
/**
|
|
23
|
+
* Client side Optimizely Composition (e.g. Visual Builder), leveraging the CMS
|
|
24
|
+
* Context to infer the connection to Optimizely Graph and component
|
|
25
|
+
* dictionary.
|
|
26
|
+
*/
|
|
27
|
+
export declare const OptimizelyComposition: OptimizelyCompositionComponent;
|
|
28
|
+
/**
|
|
29
|
+
* Client side renderer for Rich Text
|
|
30
|
+
*/
|
|
31
|
+
export declare const RichText: RichTextComponent;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
'use server';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { getServerContext } from '../context/rsc.js';
|
|
4
|
+
import { cmsContentAware } from './cms-content/utils.js';
|
|
5
|
+
import { CmsContentArea as BaseContentArea, } from './cms-content-area/index.js'; // Both RSC & Client capable
|
|
6
|
+
import { CmsEditable as BaseEditable, } from './cms-editable/index.js'; // Both RSC & Client capable
|
|
7
|
+
import { CmsContent as BaseCmsContent, } from './cms-content/rsc.js'; // Different components for RSC & Client
|
|
8
|
+
import { OptimizelyComposition as BaseOptimizelyComposition, } from './visual-builder/index.js'; // Both RSC & Client capable
|
|
9
|
+
import { RichText as BaseRichText, } from './rich-text/index.js';
|
|
10
|
+
/**
|
|
11
|
+
* Wrapper function to turn context dependant components into easy to use
|
|
12
|
+
* server components
|
|
13
|
+
*
|
|
14
|
+
* @param component The component where the `ctx` parameter must be fulfilled
|
|
15
|
+
* @returns The component, without CTX parameter
|
|
16
|
+
*/
|
|
17
|
+
function serverContextAware(component) {
|
|
18
|
+
const BaseComponent = component;
|
|
19
|
+
const ServerContextInjector = ({ ctx, ...props }) => {
|
|
20
|
+
if (!ctx)
|
|
21
|
+
console.error(`🔴 [ServerContextAware] Context for context aware component ${BaseComponent.displayName ?? BaseComponent.name ?? '[ANONYMOUS]'} is not defined!`);
|
|
22
|
+
const cmpCtx = ctx || getServerContext();
|
|
23
|
+
const componentProps = { ...props, ctx: cmpCtx };
|
|
24
|
+
return _jsx(BaseComponent, { ...componentProps });
|
|
25
|
+
};
|
|
26
|
+
ServerContextInjector.displayName = 'Server Context Injector';
|
|
27
|
+
return ServerContextInjector;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Client side Optimizely CMS Editable
|
|
31
|
+
*/
|
|
32
|
+
export const CmsEditable = serverContextAware(BaseEditable);
|
|
33
|
+
/**
|
|
34
|
+
* Client side Optimizely CMS Content, leveraging the CMS Context to load the
|
|
35
|
+
* content type and content data when needed
|
|
36
|
+
*/
|
|
37
|
+
export const CmsContent = serverContextAware(BaseCmsContent);
|
|
38
|
+
/**
|
|
39
|
+
* Client side Optimizely CMS Content Area, leveraging the CMS Context to infer
|
|
40
|
+
* the connection to Optimizely Graph and component dictionary.
|
|
41
|
+
*/
|
|
42
|
+
export const CmsContentArea = cmsContentAware(serverContextAware(BaseContentArea), CmsContent);
|
|
43
|
+
/**
|
|
44
|
+
* Client side Optimizely Composition (e.g. Visual Builder), leveraging the CMS
|
|
45
|
+
* Context to infer the connection to Optimizely Graph and component
|
|
46
|
+
* dictionary.
|
|
47
|
+
*/
|
|
48
|
+
export const OptimizelyComposition = cmsContentAware(serverContextAware(BaseOptimizelyComposition), CmsContent);
|
|
49
|
+
/**
|
|
50
|
+
* Client side renderer for Rich Text
|
|
51
|
+
*/
|
|
52
|
+
export const RichText = serverContextAware(BaseRichText);
|
|
53
|
+
//# sourceMappingURL=rsc-components.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rsc-components.js","sourceRoot":"","sources":["../../src/components/rsc-components.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAMZ,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,EA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,CAC3C,kBAAkB,CAAC,eAAe,CAAC,EACnC,UAAU,CACgB,CAAA;AAQ5B;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,eAAe,CAClD,kBAAkB,CAAC,yBAAyB,CAAC,EAC7C,UAAU,CACuB,CAAA;AAEnC;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,kBAAkB,CAAC,YAAY,CAAsB,CAAA"}
|
package/dist/components/rsc.d.ts
CHANGED
|
@@ -1,53 +1,8 @@
|
|
|
1
1
|
import 'server-only';
|
|
2
|
-
import { type ReactNode, type ComponentType } from 'react';
|
|
3
|
-
import { type PropsWithContext, type PropsWithOptionalContext } from '../context/types.js';
|
|
4
|
-
import { type CmsContentAreaComponent } from './cms-content-area/index.js';
|
|
5
|
-
import { type CmsEditableComponent } from './cms-editable/index.js';
|
|
6
|
-
import { type CmsContentComponent } from './cms-content/rsc.js';
|
|
7
|
-
import { type OptimizelyCompositionComponent } from './visual-builder/index.js';
|
|
8
|
-
import { type RichTextComponent } from './rich-text/index.js';
|
|
9
2
|
export type { BaseStyleDefinition, ElementStyleDefinition, LayoutProps, LayoutPropsSetting, LayoutPropsSettingChoices, LayoutPropsSettingKeys, LayoutPropsSettingValues, NodeStyleDefinition, StyleDefinition, StyleSetting, } from './cms-styles/index.js';
|
|
10
3
|
export { extractSettings, readSetting } from './cms-styles/index.js';
|
|
11
4
|
export * from './cms-styles/index.js';
|
|
12
5
|
export { isNode, isComponentNode, isComponentNodeOfType, isStructureNode, isElementNode, } from './visual-builder/functions.js';
|
|
13
|
-
/**
|
|
14
|
-
* Fallback while RSC hasn't been moved from Canary to Main
|
|
15
|
-
*/
|
|
16
|
-
type ReactServerComponentType<P = any> = ComponentType<P> | ((props: P) => Promise<ReactNode>);
|
|
17
|
-
/**
|
|
18
|
-
* Wrapper function to turn context dependant components into easy to use
|
|
19
|
-
* server components
|
|
20
|
-
*
|
|
21
|
-
* @param component The component where the `ctx` parameter must be fulfilled
|
|
22
|
-
* @returns The component, without CTX parameter
|
|
23
|
-
*/
|
|
24
|
-
export declare function serverContextAware<P extends PropsWithContext>(component: ReactServerComponentType<P>): ComponentType<PropsWithOptionalContext<Omit<P, 'ctx'>>>;
|
|
25
|
-
/**
|
|
26
|
-
* Client side Optimizely CMS Editable
|
|
27
|
-
*/
|
|
28
|
-
export declare const CmsEditable: CmsEditableComponent;
|
|
29
|
-
/**
|
|
30
|
-
* Client side Optimizely CMS Content, leveraging the CMS Context to load the
|
|
31
|
-
* content type and content data when needed
|
|
32
|
-
*/
|
|
33
|
-
export declare const CmsContent: CmsContentComponent;
|
|
34
|
-
export type { CmsContentComponent, CmsContentProps } from './cms-content/rsc.js';
|
|
35
|
-
/**
|
|
36
|
-
* Client side Optimizely CMS Content Area, leveraging the CMS Context to infer
|
|
37
|
-
* the connection to Optimizely Graph and component dictionary.
|
|
38
|
-
*/
|
|
39
|
-
export declare const CmsContentArea: CmsContentAreaComponent;
|
|
40
|
-
export type { CmsContentAreaClassMapper, CmsContentAreaComponent, CmsContentAreaProps, ContentAreaItemDefinition, } from './cms-content-area/index.js';
|
|
41
|
-
/**
|
|
42
|
-
* Client side Optimizely Composition (e.g. Visual Builder), leveraging the CMS
|
|
43
|
-
* Context to infer the connection to Optimizely Graph and component
|
|
44
|
-
* dictionary.
|
|
45
|
-
*/
|
|
46
|
-
export declare const OptimizelyComposition: OptimizelyCompositionComponent;
|
|
47
|
-
/**
|
|
48
|
-
* Client side renderer for Rich Text
|
|
49
|
-
*/
|
|
50
|
-
export declare const RichText: RichTextComponent;
|
|
51
6
|
export type { RichTextComponent, RichTextProps, RichTextNode, StringNode, TypedNode, NodeInput, } from './rich-text/index.js';
|
|
52
7
|
export { DefaultComponents as RichTextComponentDictionary, createHtmlComponent, } from './rich-text/components.js';
|
|
53
8
|
export { isNodeInput, isNonEmptyString, isRichTextNode, isStringNode, isText, isTypedNode, } from './rich-text/utils.js';
|
package/dist/components/rsc.js
CHANGED
|
@@ -1,59 +1,8 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
import 'server-only';
|
|
3
|
-
import { getServerContext } from '../context/rsc.js';
|
|
4
|
-
import { cmsContentAware } from './cms-content/utils.js';
|
|
5
|
-
import { CmsContentArea as BaseContentArea, } from './cms-content-area/index.js'; // Both RSC & Client capable
|
|
6
|
-
import { CmsEditable as BaseEditable, } from './cms-editable/index.js'; // Both RSC & Client capable
|
|
7
|
-
import { CmsContent as BaseCmsContent, } from './cms-content/rsc.js'; // Different components for RSC & Client
|
|
8
|
-
import { OptimizelyComposition as BaseOptimizelyComposition, } from './visual-builder/index.js'; // Both RSC & Client capable
|
|
9
|
-
import { RichText as BaseRichText, } from './rich-text/index.js';
|
|
10
2
|
export { extractSettings, readSetting } from './cms-styles/index.js';
|
|
11
3
|
export * from './cms-styles/index.js';
|
|
12
4
|
// Visual Builder items
|
|
13
5
|
export { isNode, isComponentNode, isComponentNodeOfType, isStructureNode, isElementNode, } from './visual-builder/functions.js';
|
|
14
|
-
/**
|
|
15
|
-
* Wrapper function to turn context dependant components into easy to use
|
|
16
|
-
* server components
|
|
17
|
-
*
|
|
18
|
-
* @param component The component where the `ctx` parameter must be fulfilled
|
|
19
|
-
* @returns The component, without CTX parameter
|
|
20
|
-
*/
|
|
21
|
-
export function serverContextAware(component) {
|
|
22
|
-
const BaseComponent = component;
|
|
23
|
-
const ServerContextInjector = ({ ctx, ...props }) => {
|
|
24
|
-
if (!ctx)
|
|
25
|
-
console.error(`🔴 [ServerContextAware] Context for context aware component ${BaseComponent.displayName ?? BaseComponent.name ?? '[ANONYMOUS]'} is not defined!`);
|
|
26
|
-
const cmpCtx = ctx || getServerContext();
|
|
27
|
-
const componentProps = { ...props, ctx: cmpCtx };
|
|
28
|
-
return _jsx(BaseComponent, { ...componentProps });
|
|
29
|
-
};
|
|
30
|
-
ServerContextInjector.displayName = 'Server Context Injector';
|
|
31
|
-
return ServerContextInjector;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Client side Optimizely CMS Editable
|
|
35
|
-
*/
|
|
36
|
-
export const CmsEditable = serverContextAware(BaseEditable);
|
|
37
|
-
/**
|
|
38
|
-
* Client side Optimizely CMS Content, leveraging the CMS Context to load the
|
|
39
|
-
* content type and content data when needed
|
|
40
|
-
*/
|
|
41
|
-
export const CmsContent = serverContextAware(BaseCmsContent);
|
|
42
|
-
/**
|
|
43
|
-
* Client side Optimizely CMS Content Area, leveraging the CMS Context to infer
|
|
44
|
-
* the connection to Optimizely Graph and component dictionary.
|
|
45
|
-
*/
|
|
46
|
-
export const CmsContentArea = cmsContentAware(serverContextAware(BaseContentArea), CmsContent);
|
|
47
|
-
/**
|
|
48
|
-
* Client side Optimizely Composition (e.g. Visual Builder), leveraging the CMS
|
|
49
|
-
* Context to infer the connection to Optimizely Graph and component
|
|
50
|
-
* dictionary.
|
|
51
|
-
*/
|
|
52
|
-
export const OptimizelyComposition = cmsContentAware(serverContextAware(BaseOptimizelyComposition), CmsContent);
|
|
53
|
-
/**
|
|
54
|
-
* Client side renderer for Rich Text
|
|
55
|
-
*/
|
|
56
|
-
export const RichText = serverContextAware(BaseRichText);
|
|
57
6
|
export { DefaultComponents as RichTextComponentDictionary, createHtmlComponent, } from './rich-text/components.js';
|
|
58
7
|
export { isNodeInput, isNonEmptyString, isRichTextNode, isStringNode, isText, isTypedNode, } from './rich-text/utils.js';
|
|
59
8
|
//# sourceMappingURL=rsc.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rsc.js","sourceRoot":"","sources":["../../src/components/rsc.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rsc.js","sourceRoot":"","sources":["../../src/components/rsc.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AAepB,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACpE,cAAc,uBAAuB,CAAA;AAErC,uBAAuB;AACvB,OAAO,EACL,MAAM,EACN,eAAe,EACf,qBAAqB,EACrB,eAAe,EACf,aAAa,GACd,MAAM,+BAA+B,CAAA;AAUtC,OAAO,EACL,iBAAiB,IAAI,2BAA2B,EAChD,mBAAmB,GACpB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,MAAM,EACN,WAAW,GACZ,MAAM,sBAAsB,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { GenericContext } from "../rsc.js";
|
|
2
|
-
import type { PropsWithChildren } from "react";
|
|
2
|
+
import type { PropsWithChildren, JSX } from "react";
|
|
3
3
|
/**
|
|
4
4
|
* Define an element as a React Component, React ExoticComponent or string name
|
|
5
5
|
* representing a HTML Element (e.g. "div", "a", etc...), this value can be used
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ComponentType, type PropsWithChildren } from "react";
|
|
1
|
+
import { type ComponentType, type PropsWithChildren, type JSX } from "react";
|
|
2
2
|
import { type InlineContentLinkWithLocale, type ContentLinkWithLocale } from "@remkoj/optimizely-graph-client";
|
|
3
3
|
import { type ContentType } from "../../types.js";
|
|
4
4
|
import { type PropsWithContext, type PropsWithOptionalContext } from "../../context/types.js";
|
package/dist/context/rsc.js
CHANGED
|
@@ -87,12 +87,14 @@ export class ServerContext {
|
|
|
87
87
|
this._editableIsExperience = isExperience;
|
|
88
88
|
}
|
|
89
89
|
toJSON(key) {
|
|
90
|
-
if (this.isDebugOrDevelopment) {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
90
|
+
/*if (this.isDebugOrDevelopment) {
|
|
91
|
+
console.warn(
|
|
92
|
+
'🦺 [ServerContext] Converting Context to JSON, this is typically a side effect of the context being passed between Server & Client components'
|
|
93
|
+
)
|
|
94
|
+
if (this.isDebug) {
|
|
95
|
+
console.trace('The conversion happened here')
|
|
96
|
+
}
|
|
97
|
+
}*/
|
|
96
98
|
return {
|
|
97
99
|
inEditMode: this.inEditMode,
|
|
98
100
|
inPreviewMode: this.inPreviewMode,
|
package/dist/context/rsc.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rsc.js","sourceRoot":"","sources":["../../src/context/rsc.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AACpB,OAAO,EACL,YAAY,EACZ,iBAAiB,GAGlB,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,OAAO,EAGL,uBAAuB,GACxB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAE5D,cAAc,YAAY,CAAA;AAU1B,MAAM,OAAO,aAAa;IAQxB,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;IACD,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,QAAQ,CAAA;IACtB,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;IACD,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,KAAK,IAAI,MAAM,CAAA;IAC7B,CAAC;IACD,IAAI,aAAa;QACf,OAAO,IAAI,CAAC,KAAK,IAAI,SAAS,CAAA;IAChC,CAAC;IACD,IAAI,aAAa;QACf,OAAO,aAAa,EAAE,CAAA;IACxB,CAAC;IACD,IAAI,OAAO;QACT,OAAO,OAAO,EAAE,CAAA;IAClB,CAAC;IACD,IAAI,oBAAoB;QACtB,OAAO,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,aAAa,CAAA;IAC3C,CAAC;IACD,IAAI,eAAe;QACjB,OAAO,IAAI,CAAC,SAAS,CAAA;IACvB,CAAC;IACD,IAAI,2BAA2B;QAC7B,OAAO,IAAI,CAAC,qBAAqB,CAAA;IACnC,CAAC;IACD,IAAI,2BAA2B,CAAC,QAAiB;QAC/C,IAAI,CAAC,qBAAqB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CAAC,SAAS,CAAC,CAAA;SAC1D,IAAI,CAAC,UAAU,CAAC,UAAU,IAAI,CAAC,UAAU,CAAC,aAAa;QAC1D,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;IAE7B,0BAA0B;IAC1B,SAAS,CAAC,oBAAoB,CAAC,UAAU,CAAC,eAAe,CAAC,CAAA;IAC1D,OAAO,SAAS,CAAA;AAClB,CAAC;AAOD,MAAM,gBAAgB,GAAqB,CACzC,OAAU,EACV,EAAE;IACF,IAAI,OAAO,EAAE,IAAI,aAAa,EAAE;QAC9B,OAAO,CAAC,IAAI,CACV,sGAAsG,CACvG,CAAA;IACH,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA;AAED,sEAAsE;AACtE,MAAM,KAAK,GAAG,CAAC,KAAK,CAAC,KAAK,IAAI,gBAAgB,CAAqB,CAAA;AAEnE,MAAM,wBAAwB,GAAG,KAAK,CAAC,GAAG,EAAE;IAC1C,MAAM,GAAG,GAAG,IAAI,aAAa,CAAC,EAAE,CAAC,CAAA;IACjC,IAAI,GAAG,CAAC,OAAO;QAAE,OAAO,CAAC,GAAG,CAAC,wCAAwC,CAAC,CAAA;IACtE,OAAO,GAAG,CAAA;AACZ,CAAC,CAAC,CAAA;AACF,YAAY"}
|
package/dist/factory/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ComponentType as ReactComponentType, ExoticComponent as ReactExoticComponent } from "react";
|
|
1
|
+
import type { ComponentType as ReactComponentType, ExoticComponent as ReactExoticComponent, JSX } from "react";
|
|
2
2
|
/**
|
|
3
3
|
* Basic Component Type descriptor for the Component Factory
|
|
4
4
|
*/
|
package/dist/rsc.d.ts
CHANGED
package/dist/rsc.js
CHANGED
|
@@ -12,5 +12,6 @@ export * from './context/types.js';
|
|
|
12
12
|
// Export React Server Components
|
|
13
13
|
export * from './context/rsc.js';
|
|
14
14
|
export * from './components/rsc.js';
|
|
15
|
+
export * from './components/rsc-components.js';
|
|
15
16
|
export * from './rsc-utilities.js';
|
|
16
17
|
//# sourceMappingURL=rsc.js.map
|
package/dist/rsc.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rsc.js","sourceRoot":"","sources":["../src/rsc.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,SAAS,MAAM,gBAAgB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AAC5D,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAA;AAExC,iBAAiB;AACjB,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAA;AACvC,cAAc,YAAY,CAAA;AAC1B,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAElC,iCAAiC;AACjC,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AACnC,cAAc,oBAAoB,CAAA"}
|
|
1
|
+
{"version":3,"file":"rsc.js","sourceRoot":"","sources":["../src/rsc.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,SAAS,MAAM,gBAAgB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AAC5D,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAA;AAExC,iBAAiB;AACjB,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAA;AACvC,cAAc,YAAY,CAAA;AAC1B,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAElC,iCAAiC;AACjC,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AACnC,cAAc,gCAAgC,CAAA;AAC9C,cAAc,oBAAoB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remkoj/optimizely-cms-react",
|
|
3
3
|
"license": "Apache-2.0",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "6.0.0-pre1",
|
|
5
5
|
"repository": "https://github.com/remkoj/optimizely-dxp-clients.git",
|
|
6
6
|
"author": "Remko Jantzen <693172+remkoj@users.noreply.github.com>",
|
|
7
7
|
"homepage": "https://github.com/remkoj/optimizely-dxp-clients/tree/main/packages/optimizely-cms-react",
|
|
@@ -13,50 +13,44 @@
|
|
|
13
13
|
],
|
|
14
14
|
"exports": {
|
|
15
15
|
".": "./dist/index.js",
|
|
16
|
-
"./components": "./dist/components.js",
|
|
17
16
|
"./rsc": "./dist/rsc.js"
|
|
18
17
|
},
|
|
19
18
|
"typesVersions": {
|
|
20
19
|
"*": {
|
|
21
|
-
"components": [
|
|
22
|
-
"dist/components.d.ts"
|
|
23
|
-
],
|
|
24
20
|
"rsc": [
|
|
25
21
|
"dist/rsc.d.ts"
|
|
26
22
|
]
|
|
27
23
|
}
|
|
28
24
|
},
|
|
29
25
|
"devDependencies": {
|
|
30
|
-
"@remkoj/optimizely-graph-client": "
|
|
26
|
+
"@remkoj/optimizely-graph-client": "6.0.0-pre1",
|
|
31
27
|
"@types/crypto-js": "^4.2.2",
|
|
32
28
|
"@types/node": "^22.16.0",
|
|
33
|
-
"@types/react": "^
|
|
34
|
-
"@types/react-dom": "
|
|
35
|
-
"entities": "^6.0.1",
|
|
36
|
-
"graphql": "^16.11.0",
|
|
37
|
-
"graphql-request": "^6.1.0",
|
|
29
|
+
"@types/react": "^19.1.8",
|
|
30
|
+
"@types/react-dom": "^19.1.6",
|
|
38
31
|
"prop-types": "^15.8.1",
|
|
39
|
-
"react": "^
|
|
40
|
-
"react-dom": "^
|
|
32
|
+
"react": "^19.1.0",
|
|
33
|
+
"react-dom": "^19.1.0",
|
|
41
34
|
"scheduler": "^0.26.0",
|
|
42
35
|
"typescript": "^5.8.3"
|
|
43
36
|
},
|
|
44
37
|
"dependencies": {
|
|
45
38
|
"@graphql-typed-document-node/core": "^3.2.0",
|
|
46
|
-
"
|
|
39
|
+
"@remkoj/optimizely-graph-client": "^6.0.0-pre1",
|
|
40
|
+
"crypto-js": "^4.2.0",
|
|
41
|
+
"entities": "^6.0.1",
|
|
42
|
+
"graphql": "^16.11.0",
|
|
43
|
+
"graphql-request": "^7.2.0"
|
|
47
44
|
},
|
|
48
45
|
"peerDependencies": {
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"graphql": "^16",
|
|
52
|
-
"graphql-request": "^6",
|
|
53
|
-
"react": "^18",
|
|
54
|
-
"react-dom": "^18"
|
|
46
|
+
"react": "^19",
|
|
47
|
+
"react-dom": "^19"
|
|
55
48
|
},
|
|
56
49
|
"scripts": {
|
|
57
50
|
"clean": "tsc --build --clean",
|
|
58
51
|
"prepare": "yarn tsc --build --force",
|
|
59
52
|
"watch": "tsc --watch",
|
|
60
53
|
"recompile": "tsc --build --clean && tsc --build --force"
|
|
61
|
-
}
|
|
54
|
+
},
|
|
55
|
+
"stableVersion": "5.1.0"
|
|
62
56
|
}
|
package/dist/components.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @deprecated The `@remkoj/optimizely-cms-react/components` export has been deprecated
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* @deprecated The `@remkoj/optimizely-cms-react/components` export has been
|
|
6
|
-
* deprecated, use either `@remkoj/optimizely-cms-react` or
|
|
7
|
-
* `@remkoj/optimizely-cms-react/rsc`, dependingn on your context
|
|
8
|
-
*/
|
|
9
|
-
export declare const RichText: import("react").ComponentType<import("./rsc.js").PropsWithOptionalContext<Omit<import("./components/rich-text/types.js").RichTextImplProps<import("./components/type-utils.js").ElementWithChildrenType>, "ctx">>>;
|
|
10
|
-
/**
|
|
11
|
-
* @deprecated The `@remkoj/optimizely-cms-react/components` export has been deprecated
|
|
12
|
-
*/
|
|
13
|
-
export { DefaultComponents, DefaultTextNode, createHtmlComponent } from "./components/rich-text/components.js";
|
|
14
|
-
/**
|
|
15
|
-
* @deprecated The `@remkoj/optimizely-cms-react/components` export has been deprecated
|
|
16
|
-
*/
|
|
17
|
-
export * as Utils from "./components/rich-text/utils.js";
|
|
18
|
-
/**
|
|
19
|
-
* @deprecated The `@remkoj/optimizely-cms-react/components` export has been deprecated
|
|
20
|
-
*/
|
|
21
|
-
export type * from "./components/rich-text/types.js";
|
|
22
|
-
/**
|
|
23
|
-
* @deprecated The `@remkoj/optimizely-cms-react/components` export has been deprecated
|
|
24
|
-
*/
|
|
25
|
-
export type { BaseStyleDefinition, ElementStyleDefinition, LayoutProps, LayoutPropsSetting, LayoutPropsSettingChoices, LayoutPropsSettingKeys, LayoutPropsSettingValues, NodeStyleDefinition, StyleDefinition, StyleSetting } from "./components/cms-styles/index.js";
|
|
26
|
-
/**
|
|
27
|
-
* @deprecated The `@remkoj/optimizely-cms-react/components` export has been deprecated
|
|
28
|
-
*/
|
|
29
|
-
export { extractSettings, readSetting } from "./components/cms-styles/index.js";
|
package/dist/components.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @deprecated The `@remkoj/optimizely-cms-react/components` export has been deprecated
|
|
3
|
-
*/
|
|
4
|
-
import { RichText as BaseRichText } from "./components/rich-text/index.js";
|
|
5
|
-
import { serverContextAware } from "./rsc.js";
|
|
6
|
-
/**
|
|
7
|
-
* @deprecated The `@remkoj/optimizely-cms-react/components` export has been
|
|
8
|
-
* deprecated, use either `@remkoj/optimizely-cms-react` or
|
|
9
|
-
* `@remkoj/optimizely-cms-react/rsc`, dependingn on your context
|
|
10
|
-
*/
|
|
11
|
-
export const RichText = serverContextAware(BaseRichText);
|
|
12
|
-
/**
|
|
13
|
-
* @deprecated The `@remkoj/optimizely-cms-react/components` export has been deprecated
|
|
14
|
-
*/
|
|
15
|
-
export { DefaultComponents, DefaultTextNode, createHtmlComponent } from "./components/rich-text/components.js";
|
|
16
|
-
/**
|
|
17
|
-
* @deprecated The `@remkoj/optimizely-cms-react/components` export has been deprecated
|
|
18
|
-
*/
|
|
19
|
-
export * as Utils from "./components/rich-text/utils.js";
|
|
20
|
-
/**
|
|
21
|
-
* @deprecated The `@remkoj/optimizely-cms-react/components` export has been deprecated
|
|
22
|
-
*/
|
|
23
|
-
export { extractSettings, readSetting } from "./components/cms-styles/index.js";
|
|
24
|
-
//# sourceMappingURL=components.js.map
|
package/dist/components.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"components.js","sourceRoot":"","sources":["../src/components.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAC7C;;;;GAIG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,kBAAkB,CAAC,YAAY,CAAC,CAAA;AACxD;;GAEG;AACH,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAA;AAC9G;;GAEG;AACH,OAAO,KAAK,KAAK,MAAM,iCAAiC,CAAA;AASxD;;GAEG;AACH,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA"}
|