@wordpress/server-side-render 3.0.17 → 3.1.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.
- package/CHANGELOG.md +2 -0
- package/LICENSE.md +1 -1
- package/README.md +8 -0
- package/build/index.js +1 -0
- package/build/index.js.map +1 -1
- package/build-module/index.js +1 -0
- package/build-module/index.js.map +1 -1
- package/package.json +11 -11
- package/src/index.js +1 -0
package/CHANGELOG.md
CHANGED
package/LICENSE.md
CHANGED
package/README.md
CHANGED
|
@@ -176,3 +176,11 @@ register_block_type(
|
|
|
176
176
|
)
|
|
177
177
|
);
|
|
178
178
|
```
|
|
179
|
+
|
|
180
|
+
## Contributing to this package
|
|
181
|
+
|
|
182
|
+
This is an individual package that's part of the Gutenberg project. The project is organized as a monorepo. It's made up of multiple self-contained software packages, each with a specific purpose. The packages in this monorepo are published to [npm](https://www.npmjs.com/) and used by [WordPress](https://make.wordpress.org/core/) as well as other software projects.
|
|
183
|
+
|
|
184
|
+
To find out more about contributing to this package or Gutenberg as a whole, please read the project's main [contributor guide](https://github.com/WordPress/gutenberg/tree/HEAD/CONTRIBUTING.md).
|
|
185
|
+
|
|
186
|
+
<br /><br /><p align="center"><img src="https://s.w.org/style/images/codeispoetry.png?1" alt="Code is Poetry." /></p>
|
package/build/index.js
CHANGED
|
@@ -73,6 +73,7 @@ const ExportedServerSideRender = (0, _data.withSelect)(select => {
|
|
|
73
73
|
if (window && window.wp && window.wp.components) {
|
|
74
74
|
window.wp.components.ServerSideRender = (0, _element.forwardRef)((props, ref) => {
|
|
75
75
|
(0, _deprecated.default)('wp.components.ServerSideRender', {
|
|
76
|
+
version: '6.2',
|
|
76
77
|
since: '5.3',
|
|
77
78
|
alternative: 'wp.serverSideRender'
|
|
78
79
|
});
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/server-side-render/src/index.js"],"names":["EMPTY_OBJECT","ExportedServerSideRender","select","coreEditorSelect","currentPostId","getCurrentPostId","urlQueryArgs","props","newUrlQueryArgs","post_id","window","wp","components","ServerSideRender","ref","since","alternative"],"mappings":";;;;;;;;;AAGA;;;;AACA;;AACA;;AAKA;;AAVA;AACA;AACA;;AAKA;AACA;AACA;;AAGA;AACA;AACA;AACA,MAAMA,YAAY,GAAG,EAArB;AAEA,MAAMC,wBAAwB,GAAG,sBAAcC,MAAF,IAAc;AAC1D;AACA;AACA;AACA,QAAMC,gBAAgB,GAAGD,MAAM,CAAE,aAAF,CAA/B;;AACA,MAAKC,gBAAL,EAAwB;AACvB,UAAMC,aAAa,GAAGD,gBAAgB,CAACE,gBAAjB,EAAtB,CADuB,CAEvB;AACA;AACA;AACA;;AACA,QAAKD,aAAa,IAAI,OAAOA,aAAP,KAAyB,QAA/C,EAA0D;AACzD,aAAO;AACNA,QAAAA;AADM,OAAP;AAGA;AACD;;AACD,SAAOJ,YAAP;AACA,CAlBgC,EAkB5B,QAAgE;AAAA,MAA9D;AAAEM,IAAAA,YAAY,GAAGN,YAAjB;AAA+BI,IAAAA,aAA/B;AAA8C,OAAGG;AAAjD,GAA8D;AACpE,QAAMC,eAAe,GAAG,sBAAS,MAAM;AACtC,QAAK,CAAEJ,aAAP,EAAuB;AACtB,aAAOE,YAAP;AACA;;AACD,WAAO;AACNG,MAAAA,OAAO,EAAEL,aADH;AAEN,SAAGE;AAFG,KAAP;AAIA,GARuB,EAQrB,CAAEF,aAAF,EAAiBE,YAAjB,CARqB,CAAxB;AAUA,SAAO,4BAAC,yBAAD;AAAkB,IAAA,YAAY,EAAGE;AAAjC,KAAwDD,KAAxD,EAAP;AACA,CA9BgC,CAAjC;;AAgCA,IAAKG,MAAM,IAAIA,MAAM,CAACC,EAAjB,IAAuBD,MAAM,CAACC,EAAP,CAAUC,UAAtC,EAAmD;AAClDF,EAAAA,MAAM,CAACC,EAAP,CAAUC,UAAV,CAAqBC,gBAArB,GAAwC,yBAAY,CAAEN,KAAF,EAASO,GAAT,KAAkB;AACrE,6BAAY,gCAAZ,EAA8C;AAC7CC,MAAAA,
|
|
1
|
+
{"version":3,"sources":["@wordpress/server-side-render/src/index.js"],"names":["EMPTY_OBJECT","ExportedServerSideRender","select","coreEditorSelect","currentPostId","getCurrentPostId","urlQueryArgs","props","newUrlQueryArgs","post_id","window","wp","components","ServerSideRender","ref","version","since","alternative"],"mappings":";;;;;;;;;AAGA;;;;AACA;;AACA;;AAKA;;AAVA;AACA;AACA;;AAKA;AACA;AACA;;AAGA;AACA;AACA;AACA,MAAMA,YAAY,GAAG,EAArB;AAEA,MAAMC,wBAAwB,GAAG,sBAAcC,MAAF,IAAc;AAC1D;AACA;AACA;AACA,QAAMC,gBAAgB,GAAGD,MAAM,CAAE,aAAF,CAA/B;;AACA,MAAKC,gBAAL,EAAwB;AACvB,UAAMC,aAAa,GAAGD,gBAAgB,CAACE,gBAAjB,EAAtB,CADuB,CAEvB;AACA;AACA;AACA;;AACA,QAAKD,aAAa,IAAI,OAAOA,aAAP,KAAyB,QAA/C,EAA0D;AACzD,aAAO;AACNA,QAAAA;AADM,OAAP;AAGA;AACD;;AACD,SAAOJ,YAAP;AACA,CAlBgC,EAkB5B,QAAgE;AAAA,MAA9D;AAAEM,IAAAA,YAAY,GAAGN,YAAjB;AAA+BI,IAAAA,aAA/B;AAA8C,OAAGG;AAAjD,GAA8D;AACpE,QAAMC,eAAe,GAAG,sBAAS,MAAM;AACtC,QAAK,CAAEJ,aAAP,EAAuB;AACtB,aAAOE,YAAP;AACA;;AACD,WAAO;AACNG,MAAAA,OAAO,EAAEL,aADH;AAEN,SAAGE;AAFG,KAAP;AAIA,GARuB,EAQrB,CAAEF,aAAF,EAAiBE,YAAjB,CARqB,CAAxB;AAUA,SAAO,4BAAC,yBAAD;AAAkB,IAAA,YAAY,EAAGE;AAAjC,KAAwDD,KAAxD,EAAP;AACA,CA9BgC,CAAjC;;AAgCA,IAAKG,MAAM,IAAIA,MAAM,CAACC,EAAjB,IAAuBD,MAAM,CAACC,EAAP,CAAUC,UAAtC,EAAmD;AAClDF,EAAAA,MAAM,CAACC,EAAP,CAAUC,UAAV,CAAqBC,gBAArB,GAAwC,yBAAY,CAAEN,KAAF,EAASO,GAAT,KAAkB;AACrE,6BAAY,gCAAZ,EAA8C;AAC7CC,MAAAA,OAAO,EAAE,KADoC;AAE7CC,MAAAA,KAAK,EAAE,KAFsC;AAG7CC,MAAAA,WAAW,EAAE;AAHgC,KAA9C;AAKA,WAAO,4BAAC,wBAAD,6BAA+BV,KAA/B;AAAuC,MAAA,GAAG,EAAGO;AAA7C,OAAP;AACA,GAPuC,CAAxC;AAQA;;eAEcb,wB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo, forwardRef } from '@wordpress/element';\nimport { withSelect } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport ServerSideRender from './server-side-render';\n\n/**\n * Constants\n */\nconst EMPTY_OBJECT = {};\n\nconst ExportedServerSideRender = withSelect( ( select ) => {\n\t// FIXME: @wordpress/server-side-render should not depend on @wordpress/editor.\n\t// It is used by blocks that can be loaded into a *non-post* block editor.\n\t// eslint-disable-next-line @wordpress/data-no-store-string-literals\n\tconst coreEditorSelect = select( 'core/editor' );\n\tif ( coreEditorSelect ) {\n\t\tconst currentPostId = coreEditorSelect.getCurrentPostId();\n\t\t// For templates and template parts we use a custom ID format.\n\t\t// Since they aren't real posts, we don't want to use their ID\n\t\t// for server-side rendering. Since they use a string based ID,\n\t\t// we can assume real post IDs are numbers.\n\t\tif ( currentPostId && typeof currentPostId === 'number' ) {\n\t\t\treturn {\n\t\t\t\tcurrentPostId,\n\t\t\t};\n\t\t}\n\t}\n\treturn EMPTY_OBJECT;\n} )( ( { urlQueryArgs = EMPTY_OBJECT, currentPostId, ...props } ) => {\n\tconst newUrlQueryArgs = useMemo( () => {\n\t\tif ( ! currentPostId ) {\n\t\t\treturn urlQueryArgs;\n\t\t}\n\t\treturn {\n\t\t\tpost_id: currentPostId,\n\t\t\t...urlQueryArgs,\n\t\t};\n\t}, [ currentPostId, urlQueryArgs ] );\n\n\treturn <ServerSideRender urlQueryArgs={ newUrlQueryArgs } { ...props } />;\n} );\n\nif ( window && window.wp && window.wp.components ) {\n\twindow.wp.components.ServerSideRender = forwardRef( ( props, ref ) => {\n\t\tdeprecated( 'wp.components.ServerSideRender', {\n\t\t\tversion: '6.2',\n\t\t\tsince: '5.3',\n\t\t\talternative: 'wp.serverSideRender',\n\t\t} );\n\t\treturn <ExportedServerSideRender { ...props } ref={ ref } />;\n\t} );\n}\n\nexport default ExportedServerSideRender;\n"]}
|
package/build-module/index.js
CHANGED
|
@@ -61,6 +61,7 @@ const ExportedServerSideRender = withSelect(select => {
|
|
|
61
61
|
if (window && window.wp && window.wp.components) {
|
|
62
62
|
window.wp.components.ServerSideRender = forwardRef((props, ref) => {
|
|
63
63
|
deprecated('wp.components.ServerSideRender', {
|
|
64
|
+
version: '6.2',
|
|
64
65
|
since: '5.3',
|
|
65
66
|
alternative: 'wp.serverSideRender'
|
|
66
67
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/server-side-render/src/index.js"],"names":["useMemo","forwardRef","withSelect","deprecated","ServerSideRender","EMPTY_OBJECT","ExportedServerSideRender","select","coreEditorSelect","currentPostId","getCurrentPostId","urlQueryArgs","props","newUrlQueryArgs","post_id","window","wp","components","ref","since","alternative"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,OAAT,EAAkBC,UAAlB,QAAoC,oBAApC;AACA,SAASC,UAAT,QAA2B,iBAA3B;AACA,OAAOC,UAAP,MAAuB,uBAAvB;AAEA;AACA;AACA;;AACA,OAAOC,gBAAP,MAA6B,sBAA7B;AAEA;AACA;AACA;;AACA,MAAMC,YAAY,GAAG,EAArB;AAEA,MAAMC,wBAAwB,GAAGJ,UAAU,CAAIK,MAAF,IAAc;AAC1D;AACA;AACA;AACA,QAAMC,gBAAgB,GAAGD,MAAM,CAAE,aAAF,CAA/B;;AACA,MAAKC,gBAAL,EAAwB;AACvB,UAAMC,aAAa,GAAGD,gBAAgB,CAACE,gBAAjB,EAAtB,CADuB,CAEvB;AACA;AACA;AACA;;AACA,QAAKD,aAAa,IAAI,OAAOA,aAAP,KAAyB,QAA/C,EAA0D;AACzD,aAAO;AACNA,QAAAA;AADM,OAAP;AAGA;AACD;;AACD,SAAOJ,YAAP;AACA,CAlB0C,CAAV,CAkB5B,QAAgE;AAAA,MAA9D;AAAEM,IAAAA,YAAY,GAAGN,YAAjB;AAA+BI,IAAAA,aAA/B;AAA8C,OAAGG;AAAjD,GAA8D;AACpE,QAAMC,eAAe,GAAGb,OAAO,CAAE,MAAM;AACtC,QAAK,CAAES,aAAP,EAAuB;AACtB,aAAOE,YAAP;AACA;;AACD,WAAO;AACNG,MAAAA,OAAO,EAAEL,aADH;AAEN,SAAGE;AAFG,KAAP;AAIA,GAR8B,EAQ5B,CAAEF,aAAF,EAAiBE,YAAjB,CAR4B,CAA/B;AAUA,SAAO,cAAC,gBAAD;AAAkB,IAAA,YAAY,EAAGE;AAAjC,KAAwDD,KAAxD,EAAP;AACA,CA9BgC,CAAjC;;AAgCA,IAAKG,MAAM,IAAIA,MAAM,CAACC,EAAjB,IAAuBD,MAAM,CAACC,EAAP,CAAUC,UAAtC,EAAmD;AAClDF,EAAAA,MAAM,CAACC,EAAP,CAAUC,UAAV,CAAqBb,gBAArB,GAAwCH,UAAU,CAAE,CAAEW,KAAF,EAASM,GAAT,KAAkB;AACrEf,IAAAA,UAAU,CAAE,gCAAF,EAAoC;AAC7CgB,MAAAA,
|
|
1
|
+
{"version":3,"sources":["@wordpress/server-side-render/src/index.js"],"names":["useMemo","forwardRef","withSelect","deprecated","ServerSideRender","EMPTY_OBJECT","ExportedServerSideRender","select","coreEditorSelect","currentPostId","getCurrentPostId","urlQueryArgs","props","newUrlQueryArgs","post_id","window","wp","components","ref","version","since","alternative"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,OAAT,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KAAkB;AACrEf,IAAAA,UAAU,CAAE,gCAAF,EAAoC;AAC7CgB,MAAAA,OAAO,EAAE,KADoC;AAE7CC,MAAAA,KAAK,EAAE,KAFsC;AAG7CC,MAAAA,WAAW,EAAE;AAHgC,KAApC,CAAV;AAKA,WAAO,cAAC,wBAAD,eAA+BT,KAA/B;AAAuC,MAAA,GAAG,EAAGM;AAA7C,OAAP;AACA,GAPiD,CAAlD;AAQA;;AAED,eAAeZ,wBAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo, forwardRef } from '@wordpress/element';\nimport { withSelect } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport ServerSideRender from './server-side-render';\n\n/**\n * Constants\n */\nconst EMPTY_OBJECT = {};\n\nconst ExportedServerSideRender = withSelect( ( select ) => {\n\t// FIXME: @wordpress/server-side-render should not depend on @wordpress/editor.\n\t// It is used by blocks that can be loaded into a *non-post* block editor.\n\t// eslint-disable-next-line @wordpress/data-no-store-string-literals\n\tconst coreEditorSelect = select( 'core/editor' );\n\tif ( coreEditorSelect ) {\n\t\tconst currentPostId = coreEditorSelect.getCurrentPostId();\n\t\t// For templates and template parts we use a custom ID format.\n\t\t// Since they aren't real posts, we don't want to use their ID\n\t\t// for server-side rendering. Since they use a string based ID,\n\t\t// we can assume real post IDs are numbers.\n\t\tif ( currentPostId && typeof currentPostId === 'number' ) {\n\t\t\treturn {\n\t\t\t\tcurrentPostId,\n\t\t\t};\n\t\t}\n\t}\n\treturn EMPTY_OBJECT;\n} )( ( { urlQueryArgs = EMPTY_OBJECT, currentPostId, ...props } ) => {\n\tconst newUrlQueryArgs = useMemo( () => {\n\t\tif ( ! currentPostId ) {\n\t\t\treturn urlQueryArgs;\n\t\t}\n\t\treturn {\n\t\t\tpost_id: currentPostId,\n\t\t\t...urlQueryArgs,\n\t\t};\n\t}, [ currentPostId, urlQueryArgs ] );\n\n\treturn <ServerSideRender urlQueryArgs={ newUrlQueryArgs } { ...props } />;\n} );\n\nif ( window && window.wp && window.wp.components ) {\n\twindow.wp.components.ServerSideRender = forwardRef( ( props, ref ) => {\n\t\tdeprecated( 'wp.components.ServerSideRender', {\n\t\t\tversion: '6.2',\n\t\t\tsince: '5.3',\n\t\t\talternative: 'wp.serverSideRender',\n\t\t} );\n\t\treturn <ExportedServerSideRender { ...props } ref={ ref } />;\n\t} );\n}\n\nexport default ExportedServerSideRender;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/server-side-render",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.1",
|
|
4
4
|
"description": "The component used with WordPress to server-side render a preview of dynamic blocks to display in the editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -27,19 +27,19 @@
|
|
|
27
27
|
"react-native": "src/index",
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@babel/runtime": "^7.16.0",
|
|
30
|
-
"@wordpress/api-fetch": "^
|
|
31
|
-
"@wordpress/blocks": "^11.1
|
|
32
|
-
"@wordpress/components": "^19.
|
|
33
|
-
"@wordpress/compose": "^5.
|
|
34
|
-
"@wordpress/data": "^6.1
|
|
35
|
-
"@wordpress/deprecated": "^3.
|
|
36
|
-
"@wordpress/element": "^4.
|
|
37
|
-
"@wordpress/i18n": "^4.
|
|
38
|
-
"@wordpress/url": "^3.
|
|
30
|
+
"@wordpress/api-fetch": "^6.0.1",
|
|
31
|
+
"@wordpress/blocks": "^11.2.1",
|
|
32
|
+
"@wordpress/components": "^19.4.0",
|
|
33
|
+
"@wordpress/compose": "^5.1.1",
|
|
34
|
+
"@wordpress/data": "^6.2.1",
|
|
35
|
+
"@wordpress/deprecated": "^3.3.1",
|
|
36
|
+
"@wordpress/element": "^4.1.1",
|
|
37
|
+
"@wordpress/i18n": "^4.3.1",
|
|
38
|
+
"@wordpress/url": "^3.4.1",
|
|
39
39
|
"lodash": "^4.17.21"
|
|
40
40
|
},
|
|
41
41
|
"publishConfig": {
|
|
42
42
|
"access": "public"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "2e4922861e49f5a090f9dc52056165092cfba163"
|
|
45
45
|
}
|
package/src/index.js
CHANGED
|
@@ -50,6 +50,7 @@ const ExportedServerSideRender = withSelect( ( select ) => {
|
|
|
50
50
|
if ( window && window.wp && window.wp.components ) {
|
|
51
51
|
window.wp.components.ServerSideRender = forwardRef( ( props, ref ) => {
|
|
52
52
|
deprecated( 'wp.components.ServerSideRender', {
|
|
53
|
+
version: '6.2',
|
|
53
54
|
since: '5.3',
|
|
54
55
|
alternative: 'wp.serverSideRender',
|
|
55
56
|
} );
|