@sitecore-jss/sitecore-jss-react 22.3.0-canary.9 → 22.3.1-canary.10
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/cjs/components/FEaaSComponent.js +0 -1
- package/dist/cjs/components/PlaceholderMetadata.js +0 -1
- package/dist/cjs/enhancers/withSitecoreContext.js +1 -5
- package/dist/cjs/utils.js +1 -1
- package/dist/esm/components/FEaaSComponent.js +0 -1
- package/dist/esm/components/PlaceholderMetadata.js +0 -1
- package/dist/esm/enhancers/withSitecoreContext.js +1 -5
- package/dist/esm/utils.js +1 -1
- package/package.json +8 -8
- package/types/components/PlaceholderMetadata.d.ts +0 -1
- package/types/enhancers/withEmptyFieldEditingComponent.d.ts +1 -1
- package/types/enhancers/withSitecoreContext.d.ts +1 -5
- package/types/utils.d.ts +1 -1
|
@@ -118,7 +118,6 @@ function fetchComponentTemplate(src, params, revisionFallback) {
|
|
|
118
118
|
/**
|
|
119
119
|
* Fetches component data based on the provided data options.
|
|
120
120
|
* This function asynchronously fetches data using the FEAAS.DataSettings.fetch method.
|
|
121
|
-
*
|
|
122
121
|
* @param {FEAAS.DataOptions} dataOptions - Options to customize data fetching.
|
|
123
122
|
* @returns {Promise<FEAAS.DataScopes>} A promise that resolves with the fetched data,
|
|
124
123
|
* or rejects with an error if data fetching encounters an issue.
|
|
@@ -11,7 +11,6 @@ const editing_1 = require("@sitecore-jss/sitecore-jss/editing");
|
|
|
11
11
|
* A React component to generate metadata blocks for a placeholder or rendering.
|
|
12
12
|
* It utilizes dynamic attributes based on whether the component acts as a placeholder
|
|
13
13
|
* or as a rendering to properly render the surrounding code blocks.
|
|
14
|
-
*
|
|
15
14
|
* @param {object} props The properties passed to the component.
|
|
16
15
|
* @param {ComponentRendering} props.rendering The rendering data.
|
|
17
16
|
* @param {string} [props.placeholderName] The name of the placeholder.
|
|
@@ -23,24 +23,20 @@ exports.withSitecoreContext = withSitecoreContext;
|
|
|
23
23
|
* - pageEditing - Provided by Layout Service, a boolean indicating whether the route is being accessed via the Experience Editor.
|
|
24
24
|
* - pageState - Like pageEditing, but a string: normal, preview or edit.
|
|
25
25
|
* - site - Provided by Layout Service, an object containing the name of the current Sitecore site context.
|
|
26
|
-
*
|
|
27
26
|
* @see https://jss.sitecore.com/docs/techniques/extending-layout-service/layoutservice-extending-context
|
|
28
|
-
*
|
|
29
27
|
* @param {WithSitecoreContextOptions} [options] hook options
|
|
30
|
-
*
|
|
31
28
|
* @example
|
|
32
29
|
* const EditMode = () => {
|
|
33
30
|
* const { sitecoreContext } = useSitecoreContext();
|
|
34
31
|
* return <span>Edit Mode is {sitecoreContext.pageEditing ? 'active' : 'inactive'}</span>
|
|
35
32
|
* }
|
|
36
|
-
*
|
|
37
33
|
* @example
|
|
38
34
|
* const EditMode = () => {
|
|
39
35
|
* const { sitecoreContext, updateSitecoreContext } = useSitecoreContext({ updatable: true });
|
|
40
36
|
* const onClick = () => updateSitecoreContext({ pageEditing: true });
|
|
41
37
|
* return <span onClick={onClick}>Edit Mode is {sitecoreContext.pageEditing ? 'active' : 'inactive'}</span>
|
|
42
38
|
* }
|
|
43
|
-
* @returns {
|
|
39
|
+
* @returns {object} { sitecoreContext, updateSitecoreContext }
|
|
44
40
|
*/
|
|
45
41
|
function useSitecoreContext(options) {
|
|
46
42
|
const reactContext = react_1.default.useContext(SitecoreContext_1.SitecoreContextReactContext);
|
package/dist/cjs/utils.js
CHANGED
|
@@ -82,7 +82,7 @@ const addClassName = (otherAttrs) => {
|
|
|
82
82
|
exports.addClassName = addClassName;
|
|
83
83
|
/**
|
|
84
84
|
* Converts the given tag attributes object to a string
|
|
85
|
-
* @param {
|
|
85
|
+
* @param {{[key: string]: unknown}} attributes the attributes object
|
|
86
86
|
* @returns {string} string representation of the attributes
|
|
87
87
|
*/
|
|
88
88
|
const getAttributesString = (attributes) => {
|
|
@@ -87,7 +87,6 @@ function fetchComponentTemplate(src, params, revisionFallback) {
|
|
|
87
87
|
/**
|
|
88
88
|
* Fetches component data based on the provided data options.
|
|
89
89
|
* This function asynchronously fetches data using the FEAAS.DataSettings.fetch method.
|
|
90
|
-
*
|
|
91
90
|
* @param {FEAAS.DataOptions} dataOptions - Options to customize data fetching.
|
|
92
91
|
* @returns {Promise<FEAAS.DataScopes>} A promise that resolves with the fetched data,
|
|
93
92
|
* or rejects with an error if data fetching encounters an issue.
|
|
@@ -5,7 +5,6 @@ import { MetadataKind, DEFAULT_PLACEHOLDER_UID } from '@sitecore-jss/sitecore-js
|
|
|
5
5
|
* A React component to generate metadata blocks for a placeholder or rendering.
|
|
6
6
|
* It utilizes dynamic attributes based on whether the component acts as a placeholder
|
|
7
7
|
* or as a rendering to properly render the surrounding code blocks.
|
|
8
|
-
*
|
|
9
8
|
* @param {object} props The properties passed to the component.
|
|
10
9
|
* @param {ComponentRendering} props.rendering The rendering data.
|
|
11
10
|
* @param {string} [props.placeholderName] The name of the placeholder.
|
|
@@ -16,24 +16,20 @@ export function withSitecoreContext(options) {
|
|
|
16
16
|
* - pageEditing - Provided by Layout Service, a boolean indicating whether the route is being accessed via the Experience Editor.
|
|
17
17
|
* - pageState - Like pageEditing, but a string: normal, preview or edit.
|
|
18
18
|
* - site - Provided by Layout Service, an object containing the name of the current Sitecore site context.
|
|
19
|
-
*
|
|
20
19
|
* @see https://jss.sitecore.com/docs/techniques/extending-layout-service/layoutservice-extending-context
|
|
21
|
-
*
|
|
22
20
|
* @param {WithSitecoreContextOptions} [options] hook options
|
|
23
|
-
*
|
|
24
21
|
* @example
|
|
25
22
|
* const EditMode = () => {
|
|
26
23
|
* const { sitecoreContext } = useSitecoreContext();
|
|
27
24
|
* return <span>Edit Mode is {sitecoreContext.pageEditing ? 'active' : 'inactive'}</span>
|
|
28
25
|
* }
|
|
29
|
-
*
|
|
30
26
|
* @example
|
|
31
27
|
* const EditMode = () => {
|
|
32
28
|
* const { sitecoreContext, updateSitecoreContext } = useSitecoreContext({ updatable: true });
|
|
33
29
|
* const onClick = () => updateSitecoreContext({ pageEditing: true });
|
|
34
30
|
* return <span onClick={onClick}>Edit Mode is {sitecoreContext.pageEditing ? 'active' : 'inactive'}</span>
|
|
35
31
|
* }
|
|
36
|
-
* @returns {
|
|
32
|
+
* @returns {object} { sitecoreContext, updateSitecoreContext }
|
|
37
33
|
*/
|
|
38
34
|
export function useSitecoreContext(options) {
|
|
39
35
|
const reactContext = React.useContext(SitecoreContextReactContext);
|
package/dist/esm/utils.js
CHANGED
|
@@ -75,7 +75,7 @@ export const addClassName = (otherAttrs) => {
|
|
|
75
75
|
};
|
|
76
76
|
/**
|
|
77
77
|
* Converts the given tag attributes object to a string
|
|
78
|
-
* @param {
|
|
78
|
+
* @param {{[key: string]: unknown}} attributes the attributes object
|
|
79
79
|
* @returns {string} string representation of the attributes
|
|
80
80
|
*/
|
|
81
81
|
export const getAttributesString = (attributes) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sitecore-jss/sitecore-jss-react",
|
|
3
|
-
"version": "22.3.
|
|
3
|
+
"version": "22.3.1-canary.10",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
"test": "mocha --require ts-node/register/transpile-only --require ./src/tests/shim.ts ./src/tests/jsdom-setup.ts ./src/tests/enzyme-setup.ts \"./src/**/*.test.ts\" \"./src/**/*.test.tsx\" --exit",
|
|
12
12
|
"prepublishOnly": "npm run build",
|
|
13
13
|
"coverage": "nyc npm test",
|
|
14
|
-
"generate-docs": "npx typedoc --plugin typedoc-plugin-markdown --readme none --out ../../ref-docs/sitecore-jss-react src/index.ts --githubPages false"
|
|
14
|
+
"generate-docs": "npx typedoc --plugin typedoc-plugin-markdown --outputFileStrategy Members --parametersFormat table --readme none --out ../../ref-docs/sitecore-jss-react src/index.ts --githubPages false"
|
|
15
15
|
},
|
|
16
16
|
"engines": {
|
|
17
|
-
"node": ">=
|
|
17
|
+
"node": ">=22"
|
|
18
18
|
},
|
|
19
19
|
"author": {
|
|
20
20
|
"name": "Sitecore Corporation",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@types/mocha": "^10.0.1",
|
|
34
34
|
"@types/node": "20.14.2",
|
|
35
35
|
"@types/prop-types": "^15.7.5",
|
|
36
|
-
"@types/react": "^18.2.
|
|
36
|
+
"@types/react": "^18.2.45",
|
|
37
37
|
"@types/react-dom": "^18.0.10",
|
|
38
38
|
"@types/sinon": "^10.0.13",
|
|
39
39
|
"@types/sinon-chai": "^3.2.9",
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
"cheerio": "1.0.0-rc.12",
|
|
44
44
|
"del-cli": "^5.0.0",
|
|
45
45
|
"enzyme": "^3.11.0",
|
|
46
|
-
"eslint": "^8.
|
|
46
|
+
"eslint": "^8.56.0",
|
|
47
47
|
"eslint-plugin-react": "^7.31.11",
|
|
48
|
-
"jsdom": "^
|
|
48
|
+
"jsdom": "^25.0.1",
|
|
49
49
|
"mocha": "^10.2.0",
|
|
50
50
|
"nyc": "^15.1.0",
|
|
51
51
|
"react": "^18.2.0",
|
|
@@ -61,14 +61,14 @@
|
|
|
61
61
|
"react-dom": "^18.2.0"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@sitecore-jss/sitecore-jss": "^22.3.
|
|
64
|
+
"@sitecore-jss/sitecore-jss": "^22.3.1-canary.10",
|
|
65
65
|
"fast-deep-equal": "^3.1.3",
|
|
66
66
|
"prop-types": "^15.8.1",
|
|
67
67
|
"style-attr": "^1.3.0"
|
|
68
68
|
},
|
|
69
69
|
"description": "",
|
|
70
70
|
"types": "types/index.d.ts",
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "501bf3b7c73be6cf633b4f86a9ca418c4d61745d",
|
|
72
72
|
"files": [
|
|
73
73
|
"dist",
|
|
74
74
|
"types"
|
|
@@ -20,7 +20,6 @@ export type CodeBlockAttributes = {
|
|
|
20
20
|
* A React component to generate metadata blocks for a placeholder or rendering.
|
|
21
21
|
* It utilizes dynamic attributes based on whether the component acts as a placeholder
|
|
22
22
|
* or as a rendering to properly render the surrounding code blocks.
|
|
23
|
-
*
|
|
24
23
|
* @param {object} props The properties passed to the component.
|
|
25
24
|
* @param {ComponentRendering} props.rendering The rendering data.
|
|
26
25
|
* @param {string} [props.placeholderName] The name of the placeholder.
|
|
@@ -3,7 +3,7 @@ import React, { ComponentType } from 'react';
|
|
|
3
3
|
import { GenericFieldValue, Field, FieldMetadata } from '@sitecore-jss/sitecore-jss/layout';
|
|
4
4
|
/**
|
|
5
5
|
* The HOC options
|
|
6
|
-
|
|
6
|
+
*/
|
|
7
7
|
export interface WithEmptyFieldEditingComponentOptions {
|
|
8
8
|
/**
|
|
9
9
|
* the default empty field component
|
|
@@ -20,24 +20,20 @@ export declare function withSitecoreContext(options?: WithSitecoreContextOptions
|
|
|
20
20
|
* - pageEditing - Provided by Layout Service, a boolean indicating whether the route is being accessed via the Experience Editor.
|
|
21
21
|
* - pageState - Like pageEditing, but a string: normal, preview or edit.
|
|
22
22
|
* - site - Provided by Layout Service, an object containing the name of the current Sitecore site context.
|
|
23
|
-
*
|
|
24
23
|
* @see https://jss.sitecore.com/docs/techniques/extending-layout-service/layoutservice-extending-context
|
|
25
|
-
*
|
|
26
24
|
* @param {WithSitecoreContextOptions} [options] hook options
|
|
27
|
-
*
|
|
28
25
|
* @example
|
|
29
26
|
* const EditMode = () => {
|
|
30
27
|
* const { sitecoreContext } = useSitecoreContext();
|
|
31
28
|
* return <span>Edit Mode is {sitecoreContext.pageEditing ? 'active' : 'inactive'}</span>
|
|
32
29
|
* }
|
|
33
|
-
*
|
|
34
30
|
* @example
|
|
35
31
|
* const EditMode = () => {
|
|
36
32
|
* const { sitecoreContext, updateSitecoreContext } = useSitecoreContext({ updatable: true });
|
|
37
33
|
* const onClick = () => updateSitecoreContext({ pageEditing: true });
|
|
38
34
|
* return <span onClick={onClick}>Edit Mode is {sitecoreContext.pageEditing ? 'active' : 'inactive'}</span>
|
|
39
35
|
* }
|
|
40
|
-
* @returns {
|
|
36
|
+
* @returns {object} { sitecoreContext, updateSitecoreContext }
|
|
41
37
|
*/
|
|
42
38
|
export declare function useSitecoreContext(options?: WithSitecoreContextOptions): {
|
|
43
39
|
sitecoreContext: SitecoreContextValue;
|
package/types/utils.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export declare const addClassName: (otherAttrs: {
|
|
|
26
26
|
}) => void;
|
|
27
27
|
/**
|
|
28
28
|
* Converts the given tag attributes object to a string
|
|
29
|
-
* @param {
|
|
29
|
+
* @param {{[key: string]: unknown}} attributes the attributes object
|
|
30
30
|
* @returns {string} string representation of the attributes
|
|
31
31
|
*/
|
|
32
32
|
export declare const getAttributesString: (attributes: {
|