@wordpress/server-side-render 4.27.0 → 4.28.0
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/build/index.js +1 -2
- package/build/index.js.map +1 -1
- package/package.json +11 -11
package/CHANGELOG.md
CHANGED
package/build/index.js
CHANGED
|
@@ -58,6 +58,5 @@ const ExportedServerSideRender = (0, _data.withSelect)(select => {
|
|
|
58
58
|
...props
|
|
59
59
|
});
|
|
60
60
|
});
|
|
61
|
-
var _default = ExportedServerSideRender;
|
|
62
|
-
exports.default = _default;
|
|
61
|
+
var _default = exports.default = ExportedServerSideRender;
|
|
63
62
|
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_data","_serverSideRender","_interopRequireDefault","EMPTY_OBJECT","ExportedServerSideRender","withSelect","select","coreEditorSelect","currentPostId","getCurrentPostId","urlQueryArgs","props","newUrlQueryArgs","useMemo","post_id","_react","createElement","default","_default","exports"],"sources":["@wordpress/server-side-render/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { withSelect } from '@wordpress/data';\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\nexport default ExportedServerSideRender;\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,iBAAA,GAAAC,sBAAA,CAAAH,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACA;AACA;AACA,MAAMI,YAAY,GAAG,CAAC,CAAC;AAEvB,MAAMC,wBAAwB,GAAG,IAAAC,gBAAU,EAAIC,MAAM,IAAM;EAC1D;EACA;EACA;EACA,MAAMC,gBAAgB,GAAGD,MAAM,CAAE,aAAc,CAAC;EAChD,IAAKC,gBAAgB,EAAG;IACvB,MAAMC,aAAa,GAAGD,gBAAgB,CAACE,gBAAgB,CAAC,CAAC;IACzD;IACA;IACA;IACA;IACA,IAAKD,aAAa,IAAI,OAAOA,aAAa,KAAK,QAAQ,EAAG;MACzD,OAAO;QACNA;MACD,CAAC;IACF;EACD;EACA,OAAOL,YAAY;AACpB,CAAE,CAAC,CAAE,CAAE;EAAEO,YAAY,GAAGP,YAAY;EAAEK,aAAa;EAAE,GAAGG;AAAM,CAAC,KAAM;EACpE,MAAMC,eAAe,GAAG,IAAAC,gBAAO,EAAE,MAAM;IACtC,IAAK,CAAEL,aAAa,EAAG;MACtB,OAAOE,YAAY;IACpB;IACA,OAAO;MACNI,OAAO,EAAEN,aAAa;MACtB,GAAGE;IACJ,CAAC;EACF,CAAC,EAAE,CAAEF,aAAa,EAAEE,YAAY,CAAG,CAAC;EAEpC,OAAO,IAAAK,MAAA,CAAAC,aAAA,EAACf,iBAAA,CAAAgB,OAAgB;IAACP,YAAY,EAAGE,eAAiB;IAAA,GAAMD;EAAK,CAAI,CAAC;AAC1E,CAAE,CAAC;AAAC,IAAAO,QAAA,
|
|
1
|
+
{"version":3,"names":["_element","require","_data","_serverSideRender","_interopRequireDefault","EMPTY_OBJECT","ExportedServerSideRender","withSelect","select","coreEditorSelect","currentPostId","getCurrentPostId","urlQueryArgs","props","newUrlQueryArgs","useMemo","post_id","_react","createElement","default","_default","exports"],"sources":["@wordpress/server-side-render/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { withSelect } from '@wordpress/data';\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\nexport default ExportedServerSideRender;\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,iBAAA,GAAAC,sBAAA,CAAAH,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACA;AACA;AACA,MAAMI,YAAY,GAAG,CAAC,CAAC;AAEvB,MAAMC,wBAAwB,GAAG,IAAAC,gBAAU,EAAIC,MAAM,IAAM;EAC1D;EACA;EACA;EACA,MAAMC,gBAAgB,GAAGD,MAAM,CAAE,aAAc,CAAC;EAChD,IAAKC,gBAAgB,EAAG;IACvB,MAAMC,aAAa,GAAGD,gBAAgB,CAACE,gBAAgB,CAAC,CAAC;IACzD;IACA;IACA;IACA;IACA,IAAKD,aAAa,IAAI,OAAOA,aAAa,KAAK,QAAQ,EAAG;MACzD,OAAO;QACNA;MACD,CAAC;IACF;EACD;EACA,OAAOL,YAAY;AACpB,CAAE,CAAC,CAAE,CAAE;EAAEO,YAAY,GAAGP,YAAY;EAAEK,aAAa;EAAE,GAAGG;AAAM,CAAC,KAAM;EACpE,MAAMC,eAAe,GAAG,IAAAC,gBAAO,EAAE,MAAM;IACtC,IAAK,CAAEL,aAAa,EAAG;MACtB,OAAOE,YAAY;IACpB;IACA,OAAO;MACNI,OAAO,EAAEN,aAAa;MACtB,GAAGE;IACJ,CAAC;EACF,CAAC,EAAE,CAAEF,aAAa,EAAEE,YAAY,CAAG,CAAC;EAEpC,OAAO,IAAAK,MAAA,CAAAC,aAAA,EAACf,iBAAA,CAAAgB,OAAgB;IAACP,YAAY,EAAGE,eAAiB;IAAA,GAAMD;EAAK,CAAI,CAAC;AAC1E,CAAE,CAAC;AAAC,IAAAO,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAEWb,wBAAwB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/server-side-render",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.28.0",
|
|
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,15 +27,15 @@
|
|
|
27
27
|
"react-native": "src/index",
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@babel/runtime": "^7.16.0",
|
|
30
|
-
"@wordpress/api-fetch": "^6.
|
|
31
|
-
"@wordpress/blocks": "^12.
|
|
32
|
-
"@wordpress/components": "^
|
|
33
|
-
"@wordpress/compose": "^6.
|
|
34
|
-
"@wordpress/data": "^9.
|
|
35
|
-
"@wordpress/deprecated": "^3.
|
|
36
|
-
"@wordpress/element": "^5.
|
|
37
|
-
"@wordpress/i18n": "^4.
|
|
38
|
-
"@wordpress/url": "^3.
|
|
30
|
+
"@wordpress/api-fetch": "^6.48.0",
|
|
31
|
+
"@wordpress/blocks": "^12.28.0",
|
|
32
|
+
"@wordpress/components": "^26.0.0",
|
|
33
|
+
"@wordpress/compose": "^6.28.0",
|
|
34
|
+
"@wordpress/data": "^9.21.0",
|
|
35
|
+
"@wordpress/deprecated": "^3.51.0",
|
|
36
|
+
"@wordpress/element": "^5.28.0",
|
|
37
|
+
"@wordpress/i18n": "^4.51.0",
|
|
38
|
+
"@wordpress/url": "^3.52.0",
|
|
39
39
|
"fast-deep-equal": "^3.1.3"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"publishConfig": {
|
|
46
46
|
"access": "public"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "eb796371e9630636a4a8837033807b0c4a06ed67"
|
|
49
49
|
}
|