@plasmicapp/nextjs-app-router 1.0.6 → 1.0.7
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/index.esm.js +3 -3
- package/dist/index.esm.js.map +2 -2
- package/dist/index.js +3 -3
- package/dist/index.js.map +2 -2
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -5,14 +5,14 @@ import { extractPlasmicQueryData } from "@plasmicapp/prepass";
|
|
|
5
5
|
import * as React from "react";
|
|
6
6
|
function ExtractPlasmicQueryData(props) {
|
|
7
7
|
const { children } = props;
|
|
8
|
-
if (!
|
|
8
|
+
if (!("useId" in React) || !("use" in React)) {
|
|
9
9
|
throw new Error(
|
|
10
10
|
`You can only use <ExtractPlasmicQueryData /> from server components.`
|
|
11
11
|
);
|
|
12
12
|
}
|
|
13
|
-
const scriptId = `plasmic-prefetch-${React
|
|
13
|
+
const scriptId = `plasmic-prefetch-${React["useId"]()}`;
|
|
14
14
|
if (typeof window === "undefined") {
|
|
15
|
-
const data = React
|
|
15
|
+
const data = React["use"](
|
|
16
16
|
extractPlasmicQueryData(/* @__PURE__ */ React.createElement(React.Fragment, null, children))
|
|
17
17
|
);
|
|
18
18
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/ExtractPlasmicQueryData.tsx"],
|
|
4
|
-
"sourcesContent": ["import { extractPlasmicQueryData } from \"@plasmicapp/prepass\";\nimport * as React from \"react\";\n\n/**\n * EXPERIMENTAL\n *\n * A component that serves the same purpose as extractPlasmicQueryData(), but from\n * React server components. This only works from frameworks that support\n * React.useId() and React.use() (like Next.js 13).\n *\n * The children of this component will be run through `extractPlasmicQueryData()`.\n */\nexport function ExtractPlasmicQueryData(props: { children?: React.ReactNode }) {\n const { children } = props;\n if (!
|
|
5
|
-
"mappings": ";;;AAAA,SAAS,+BAA+B;AACxC,YAAY,WAAW;AAWhB,SAAS,wBAAwB,OAAuC;AAC7E,QAAM,EAAE,SAAS,IAAI;AACrB,MAAI,
|
|
4
|
+
"sourcesContent": ["import { extractPlasmicQueryData } from \"@plasmicapp/prepass\";\nimport * as React from \"react\";\n\n/**\n * EXPERIMENTAL\n *\n * A component that serves the same purpose as extractPlasmicQueryData(), but from\n * React server components. This only works from frameworks that support\n * React.useId() and React.use() (like Next.js 13).\n *\n * The children of this component will be run through `extractPlasmicQueryData()`.\n */\nexport function ExtractPlasmicQueryData(props: { children?: React.ReactNode }) {\n const { children } = props;\n if (!(\"useId\" in React) || !(\"use\" in React)) {\n throw new Error(\n `You can only use <ExtractPlasmicQueryData /> from server components.`\n );\n }\n const scriptId = `plasmic-prefetch-${(React as any)[\"\" + \"useId\"]()}`;\n if (typeof window === \"undefined\") {\n const data: Record<string, any> = (React as any)[\"\" + \"use\"](\n extractPlasmicQueryData(<>{children}</>)\n );\n return (\n <>\n <script\n type=\"application/json\"\n dangerouslySetInnerHTML={{ __html: JSON.stringify(data) }}\n data-plasmic-prefetch-id={scriptId}\n suppressHydrationWarning={true}\n />\n </>\n );\n } else {\n return null;\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;AAAA,SAAS,+BAA+B;AACxC,YAAY,WAAW;AAWhB,SAAS,wBAAwB,OAAuC;AAC7E,QAAM,EAAE,SAAS,IAAI;AACrB,MAAI,EAAE,WAAW,UAAU,EAAE,SAAS,QAAQ;AAC5C,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,QAAM,WAAW,oBAAmC,eAAc;AAClE,MAAI,OAAO,WAAW,aAAa;AACjC,UAAM,OAA2C;AAAA,MAC/C,wBAAwB,0DAAG,QAAS,CAAG;AAAA,IACzC;AACA,WACE,0DACE;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,yBAAyB,EAAE,QAAQ,KAAK,UAAU,IAAI,EAAE;AAAA,QACxD,4BAA0B;AAAA,QAC1B,0BAA0B;AAAA;AAAA,IAC5B,CACF;AAAA,EAEJ,OAAO;AACL,WAAO;AAAA,EACT;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/index.js
CHANGED
|
@@ -40,14 +40,14 @@ var import_prepass = require("@plasmicapp/prepass");
|
|
|
40
40
|
var React = __toESM(require("react"));
|
|
41
41
|
function ExtractPlasmicQueryData(props) {
|
|
42
42
|
const { children } = props;
|
|
43
|
-
if (!
|
|
43
|
+
if (!("useId" in React) || !("use" in React)) {
|
|
44
44
|
throw new Error(
|
|
45
45
|
`You can only use <ExtractPlasmicQueryData /> from server components.`
|
|
46
46
|
);
|
|
47
47
|
}
|
|
48
|
-
const scriptId = `plasmic-prefetch-${React
|
|
48
|
+
const scriptId = `plasmic-prefetch-${React["useId"]()}`;
|
|
49
49
|
if (typeof window === "undefined") {
|
|
50
|
-
const data = React
|
|
50
|
+
const data = React["use"](
|
|
51
51
|
(0, import_prepass.extractPlasmicQueryData)(/* @__PURE__ */ React.createElement(React.Fragment, null, children))
|
|
52
52
|
);
|
|
53
53
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts", "../src/ExtractPlasmicQueryData.tsx"],
|
|
4
|
-
"sourcesContent": ["export * from \"./ExtractPlasmicQueryData\";\n", "import { extractPlasmicQueryData } from \"@plasmicapp/prepass\";\nimport * as React from \"react\";\n\n/**\n * EXPERIMENTAL\n *\n * A component that serves the same purpose as extractPlasmicQueryData(), but from\n * React server components. This only works from frameworks that support\n * React.useId() and React.use() (like Next.js 13).\n *\n * The children of this component will be run through `extractPlasmicQueryData()`.\n */\nexport function ExtractPlasmicQueryData(props: { children?: React.ReactNode }) {\n const { children } = props;\n if (!
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,qBAAwC;AACxC,YAAuB;AAWhB,SAAS,wBAAwB,OAAuC;AAC7E,QAAM,EAAE,SAAS,IAAI;AACrB,MAAI,
|
|
4
|
+
"sourcesContent": ["export * from \"./ExtractPlasmicQueryData\";\n", "import { extractPlasmicQueryData } from \"@plasmicapp/prepass\";\nimport * as React from \"react\";\n\n/**\n * EXPERIMENTAL\n *\n * A component that serves the same purpose as extractPlasmicQueryData(), but from\n * React server components. This only works from frameworks that support\n * React.useId() and React.use() (like Next.js 13).\n *\n * The children of this component will be run through `extractPlasmicQueryData()`.\n */\nexport function ExtractPlasmicQueryData(props: { children?: React.ReactNode }) {\n const { children } = props;\n if (!(\"useId\" in React) || !(\"use\" in React)) {\n throw new Error(\n `You can only use <ExtractPlasmicQueryData /> from server components.`\n );\n }\n const scriptId = `plasmic-prefetch-${(React as any)[\"\" + \"useId\"]()}`;\n if (typeof window === \"undefined\") {\n const data: Record<string, any> = (React as any)[\"\" + \"use\"](\n extractPlasmicQueryData(<>{children}</>)\n );\n return (\n <>\n <script\n type=\"application/json\"\n dangerouslySetInnerHTML={{ __html: JSON.stringify(data) }}\n data-plasmic-prefetch-id={scriptId}\n suppressHydrationWarning={true}\n />\n </>\n );\n } else {\n return null;\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,qBAAwC;AACxC,YAAuB;AAWhB,SAAS,wBAAwB,OAAuC;AAC7E,QAAM,EAAE,SAAS,IAAI;AACrB,MAAI,EAAE,WAAW,UAAU,EAAE,SAAS,QAAQ;AAC5C,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,QAAM,WAAW,oBAAmC,eAAc;AAClE,MAAI,OAAO,WAAW,aAAa;AACjC,UAAM,OAA2C;AAAA,UAC/C,wCAAwB,0DAAG,QAAS,CAAG;AAAA,IACzC;AACA,WACE,0DACE;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,yBAAyB,EAAE,QAAQ,KAAK,UAAU,IAAI,EAAE;AAAA,QACxD,4BAA0B;AAAA,QAC1B,0BAA0B;AAAA;AAAA,IAC5B,CACF;AAAA,EAEJ,OAAO;AACL,WAAO;AAAA,EACT;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasmicapp/nextjs-app-router",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"types": "./dist/index.d.ts",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.esm.js",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"react": "^18.2.0",
|
|
71
71
|
"typescript": "^5.2.2"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "352998d1e1e9ef88b49a892bd547058ee2e5e28f"
|
|
74
74
|
}
|