@sitecore-jss/sitecore-jss-react 21.5.0-canary.9 → 21.6.0-beta.1

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.
@@ -103,7 +103,8 @@ class BYOCComponent extends react_1.default.Component {
103
103
  componentProps = props.fields ? (0, utils_1.getDataFromFields)(props.fields) : {};
104
104
  }
105
105
  }
106
- return (react_1.default.createElement(FEAAS.ExternalComponent, Object.assign({ componentName: componentName, fallback: fallbackComponent }, componentProps)));
106
+ // we render fallback on client to avoid problems with client-only components
107
+ return (react_1.default.createElement(FEAAS.ExternalComponent, Object.assign({ componentName: componentName, clientFallback: fallbackComponent }, componentProps)));
107
108
  }
108
109
  }
109
110
  exports.BYOCComponent = BYOCComponent;
@@ -76,7 +76,8 @@ const FEaaSComponent = (props) => {
76
76
  // FEaaS control would still be hydrated by client
77
77
  // we pass all the props as a workaround to avoid hydration error, until we convert all JSS components to server side
78
78
  // this also allows component to fall back to full client-side rendering when template or src is empty
79
- return (react_1.default.createElement(FEAAS.Component, { data: props.fetchedData || data, template: props.template, cdn: (_c = props.params) === null || _c === void 0 ? void 0 : _c.ComponentHostName, library: (_d = props.params) === null || _d === void 0 ? void 0 : _d.LibraryId, version: (_e = props.params) === null || _e === void 0 ? void 0 : _e.ComponentVersion, component: (_f = props.params) === null || _f === void 0 ? void 0 : _f.ComponentId, instance: (_g = props.params) === null || _g === void 0 ? void 0 : _g.ComponentInstanceId, revision: computedRevision }));
79
+ // FEAAS should not fetch anything, since JSS does the fetching - so we pass empty array into fetch param
80
+ return (react_1.default.createElement(FEAAS.Component, { data: props.fetchedData || data, template: props.template, cdn: (_c = props.params) === null || _c === void 0 ? void 0 : _c.ComponentHostName, library: (_d = props.params) === null || _d === void 0 ? void 0 : _d.LibraryId, version: (_e = props.params) === null || _e === void 0 ? void 0 : _e.ComponentVersion, component: (_f = props.params) === null || _f === void 0 ? void 0 : _f.ComponentId, instance: (_g = props.params) === null || _g === void 0 ? void 0 : _g.ComponentInstanceId, revision: computedRevision, fetch: [] }));
80
81
  };
81
82
  exports.FEaaSComponent = FEaaSComponent;
82
83
  /**
@@ -48,7 +48,8 @@ class PlaceholderCommon extends react_1.default.Component {
48
48
  if (rendering === null || rendering === void 0 ? void 0 : rendering.placeholders) {
49
49
  Object.keys(rendering.placeholders).forEach((placeholder) => {
50
50
  if (placeholder.indexOf('{*}') !== -1 &&
51
- !EXCLUDE_PLACEHOLDERS_RENDER.some((pattern) => name.search(pattern) !== -1)) {
51
+ !EXCLUDE_PLACEHOLDERS_RENDER.some((pattern) => name.search(pattern) !== -1) &&
52
+ name.replace(/[^a-zA-Z]*/gi, '') === placeholder.replace(/[^a-zA-Z]*/gi, '')) {
52
53
  rendering.placeholders[name] = rendering.placeholders[placeholder];
53
54
  delete rendering.placeholders[placeholder];
54
55
  }
@@ -74,7 +74,8 @@ export class BYOCComponent extends React.Component {
74
74
  componentProps = props.fields ? getDataFromFields(props.fields) : {};
75
75
  }
76
76
  }
77
- return (React.createElement(FEAAS.ExternalComponent, Object.assign({ componentName: componentName, fallback: fallbackComponent }, componentProps)));
77
+ // we render fallback on client to avoid problems with client-only components
78
+ return (React.createElement(FEAAS.ExternalComponent, Object.assign({ componentName: componentName, clientFallback: fallbackComponent }, componentProps)));
78
79
  }
79
80
  }
80
81
  /**
@@ -47,7 +47,8 @@ export const FEaaSComponent = (props) => {
47
47
  // FEaaS control would still be hydrated by client
48
48
  // we pass all the props as a workaround to avoid hydration error, until we convert all JSS components to server side
49
49
  // this also allows component to fall back to full client-side rendering when template or src is empty
50
- return (React.createElement(FEAAS.Component, { data: props.fetchedData || data, template: props.template, cdn: (_c = props.params) === null || _c === void 0 ? void 0 : _c.ComponentHostName, library: (_d = props.params) === null || _d === void 0 ? void 0 : _d.LibraryId, version: (_e = props.params) === null || _e === void 0 ? void 0 : _e.ComponentVersion, component: (_f = props.params) === null || _f === void 0 ? void 0 : _f.ComponentId, instance: (_g = props.params) === null || _g === void 0 ? void 0 : _g.ComponentInstanceId, revision: computedRevision }));
50
+ // FEAAS should not fetch anything, since JSS does the fetching - so we pass empty array into fetch param
51
+ return (React.createElement(FEAAS.Component, { data: props.fetchedData || data, template: props.template, cdn: (_c = props.params) === null || _c === void 0 ? void 0 : _c.ComponentHostName, library: (_d = props.params) === null || _d === void 0 ? void 0 : _d.LibraryId, version: (_e = props.params) === null || _e === void 0 ? void 0 : _e.ComponentVersion, component: (_f = props.params) === null || _f === void 0 ? void 0 : _f.ComponentId, instance: (_g = props.params) === null || _g === void 0 ? void 0 : _g.ComponentInstanceId, revision: computedRevision, fetch: [] }));
51
52
  };
52
53
  /**
53
54
  * Fetches server component props required for server rendering, based on rendering params.
@@ -42,7 +42,8 @@ export class PlaceholderCommon extends React.Component {
42
42
  if (rendering === null || rendering === void 0 ? void 0 : rendering.placeholders) {
43
43
  Object.keys(rendering.placeholders).forEach((placeholder) => {
44
44
  if (placeholder.indexOf('{*}') !== -1 &&
45
- !EXCLUDE_PLACEHOLDERS_RENDER.some((pattern) => name.search(pattern) !== -1)) {
45
+ !EXCLUDE_PLACEHOLDERS_RENDER.some((pattern) => name.search(pattern) !== -1) &&
46
+ name.replace(/[^a-zA-Z]*/gi, '') === placeholder.replace(/[^a-zA-Z]*/gi, '')) {
46
47
  rendering.placeholders[name] = rendering.placeholders[placeholder];
47
48
  delete rendering.placeholders[placeholder];
48
49
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sitecore-jss/sitecore-jss-react",
3
- "version": "21.5.0-canary.9",
3
+ "version": "21.6.0-beta.1",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "sideEffects": false,
@@ -27,7 +27,7 @@
27
27
  "url": "https://github.com/sitecore/jss/issues"
28
28
  },
29
29
  "devDependencies": {
30
- "@sitecore-feaas/clientside": "^0.3.17",
30
+ "@sitecore-feaas/clientside": "^0.4.12",
31
31
  "@types/chai": "^4.3.4",
32
32
  "@types/chai-string": "^1.4.2",
33
33
  "@types/deep-equal": "^1.0.1",
@@ -58,19 +58,19 @@
58
58
  "typescript": "~4.9.3"
59
59
  },
60
60
  "peerDependencies": {
61
- "@sitecore-feaas/clientside": "^0.3.17",
61
+ "@sitecore-feaas/clientside": "^0.4.12",
62
62
  "react": "^18.2.0",
63
63
  "react-dom": "^18.2.0"
64
64
  },
65
65
  "dependencies": {
66
- "@sitecore-jss/sitecore-jss": "^21.5.0-canary.9",
66
+ "@sitecore-jss/sitecore-jss": "^21.6.0-beta.1",
67
67
  "deep-equal": "^2.1.0",
68
68
  "prop-types": "^15.8.1",
69
69
  "style-attr": "^1.3.0"
70
70
  },
71
71
  "description": "",
72
72
  "types": "types/index.d.ts",
73
- "gitHead": "d04cef72a0eafdaa6654c7741d7fa4ab325a7f38",
73
+ "gitHead": "b14b3dc875d5e822d97232843b5fd2b760fe2c8d",
74
74
  "files": [
75
75
  "dist",
76
76
  "types"
@@ -1,3 +1,4 @@
1
+ /// <reference types="@types/react" />
1
2
  import { ComponentType } from 'react';
2
3
  import { ComponentFactory } from './components/sharedTypes';
3
4
  /**
@@ -1,3 +1,4 @@
1
+ /// <reference types="@types/react" />
1
2
  import React from 'react';
2
3
  import { ComponentFields } from '@sitecore-jss/sitecore-jss/layout';
3
4
  import { MissingComponentProps } from './MissingComponent';
@@ -1,3 +1,4 @@
1
+ /// <reference types="@types/react" />
1
2
  import React from 'react';
2
3
  export interface DateFieldProps {
3
4
  /** The date field data. */
@@ -1,3 +1,4 @@
1
+ /// <reference types="@types/react" />
1
2
  import React, { PropsWithChildren } from 'react';
2
3
  import { EditFrameDataSource, EditButtonTypes } from '@sitecore-jss/sitecore-jss/utils';
3
4
  export interface EditFrameProps {
@@ -1,3 +1,4 @@
1
+ /// <reference types="@types/react" />
1
2
  import React from 'react';
2
3
  export interface FileFieldValue {
3
4
  [propName: string]: unknown;
@@ -1,3 +1,4 @@
1
+ /// <reference types="@types/react" />
1
2
  import React from 'react';
2
3
  export declare const HiddenRendering: () => React.JSX.Element;
3
4
  export declare const HIDDEN_RENDERING_NAME = "Hidden Rendering";
@@ -1,3 +1,4 @@
1
+ /// <reference types="@types/react" />
1
2
  import React from 'react';
2
3
  export interface ImageFieldValue {
3
4
  [attributeName: string]: unknown;
@@ -1,3 +1,4 @@
1
+ /// <reference types="@types/react" />
1
2
  import React from 'react';
2
3
  import PropTypes from 'prop-types';
3
4
  export interface LinkFieldValue {
@@ -1,3 +1,4 @@
1
+ /// <reference types="@types/react" />
1
2
  import React from 'react';
2
3
  export interface MissingComponentProps {
3
4
  rendering?: {
@@ -1,3 +1,4 @@
1
+ /// <reference types="@types/react" />
1
2
  import React from 'react';
2
3
  import { PlaceholderProps } from './PlaceholderCommon';
3
4
  import { ComponentRendering, HtmlElementRendering } from '@sitecore-jss/sitecore-jss/layout';
@@ -1,3 +1,4 @@
1
+ /// <reference types="@types/react" />
1
2
  import React, { ComponentType } from 'react';
2
3
  import PropTypes from 'prop-types';
3
4
  import { ComponentFactory } from './sharedTypes';
@@ -1,3 +1,4 @@
1
+ /// <reference types="@types/react" />
1
2
  import React from 'react';
2
3
  import PropTypes from 'prop-types';
3
4
  export interface RichTextField {
@@ -1,3 +1,4 @@
1
+ /// <reference types="@types/react" />
1
2
  import React from 'react';
2
3
  import PropTypes from 'prop-types';
3
4
  import { ComponentFactory } from './sharedTypes';
@@ -1,3 +1,4 @@
1
+ /// <reference types="@types/react" />
1
2
  import { FunctionComponent } from 'react';
2
3
  export interface TextField {
3
4
  value?: string | number;
@@ -1,3 +1,4 @@
1
+ /// <reference types="@types/react" />
1
2
  import React from 'react';
2
3
  interface VisitorIdentificationProps {
3
4
  defer?: boolean;
@@ -1,3 +1,4 @@
1
+ /// <reference types="@types/react" />
1
2
  import { ComponentType } from 'react';
2
3
  /**
3
4
  * @param {string} componentName component to be imported from the component factory
@@ -1,3 +1,4 @@
1
+ /// <reference types="@types/react" />
1
2
  import React from 'react';
2
3
  import { ComponentFactory } from '../components/sharedTypes';
3
4
  export interface ComponentFactoryProps {
@@ -1,3 +1,4 @@
1
+ /// <reference types="@types/react" />
1
2
  import React from 'react';
2
3
  import { ComponentRendering } from '@sitecore-jss/sitecore-jss/layout';
3
4
  export declare const DefaultEditingError: () => JSX.Element;
@@ -1,2 +1,3 @@
1
+ /// <reference types="@types/react" />
1
2
  import React from 'react';
2
3
  export declare const withEditorChromes: (WrappedComponent: React.ComponentClass<unknown> | React.FC<unknown>) => React.ComponentClass<{}, any>;
@@ -1,3 +1,4 @@
1
+ /// <reference types="@types/react" />
1
2
  import React, { ReactNode } from 'react';
2
3
  import { SitecoreContextValue } from '../components/SitecoreContext';
3
4
  export interface WithSitecoreContextOptions {