@prismicio/next 2.2.1-pr.131.6624bed → 2.2.1-pr.131.c82c510

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.
@@ -9,7 +9,7 @@ let _prismicio_simulator_kit = require("@prismicio/simulator/kit");
9
9
  */
10
10
  const SliceSimulatorWrapper = ({ className, children, zIndex, background, message }) => {
11
11
  const defaultProps = (0, _prismicio_simulator_kit.getDefaultProps)();
12
- const outerProps = {
12
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
13
13
  className: [_prismicio_simulator_kit.simulatorClass, className].filter(Boolean).join(" "),
14
14
  style: {
15
15
  zIndex: typeof zIndex === "undefined" ? defaultProps.zIndex : zIndex ?? void 0,
@@ -20,15 +20,8 @@ const SliceSimulatorWrapper = ({ className, children, zIndex, background, messag
20
20
  height: "100vh",
21
21
  overflow: "auto",
22
22
  background: typeof background === "undefined" ? defaultProps.background : background ?? void 0
23
- }
24
- };
25
- if (message) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
26
- ...outerProps,
27
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("article", { dangerouslySetInnerHTML: { __html: message } })
28
- });
29
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
30
- ...outerProps,
31
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
23
+ },
24
+ children: message ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("article", { dangerouslySetInnerHTML: { __html: message } }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
32
25
  id: "root",
33
26
  className: _prismicio_simulator_kit.simulatorRootClass,
34
27
  onClickCapture: _prismicio_simulator_kit.onClickHandler,
@@ -1 +1 @@
1
- {"version":3,"file":"SliceSimulatorWrapper.cjs","names":["simulatorClass","simulatorRootClass","onClickHandler","disableEventHandler"],"sources":["../src/SliceSimulatorWrapper.tsx"],"sourcesContent":["import {\n\tdisableEventHandler,\n\tgetDefaultProps,\n\tonClickHandler,\n\tsimulatorClass,\n\tsimulatorRootClass,\n} from \"@prismicio/simulator/kit\";\nimport type { SliceSimulatorProps } from \"@prismicio/simulator/kit\";\nimport type { FC, ReactNode } from \"react\";\n\ntype SliceSimulatorWrapperProps = SliceSimulatorProps & {\n\tchildren: ReactNode;\n\tclassName?: string;\n\tmessage?: string;\n};\n\n/**\n * A wrapper for the slice simulator that isolates the given children from the\n * page's layout.\n */\nexport const SliceSimulatorWrapper: FC<SliceSimulatorWrapperProps> = ({\n\tclassName,\n\tchildren,\n\tzIndex,\n\tbackground,\n\tmessage,\n}) => {\n\tconst defaultProps = getDefaultProps();\n\n\tconst outerProps = {\n\t\tclassName: [simulatorClass, className].filter(Boolean).join(\" \"),\n\t\tstyle: {\n\t\t\tzIndex:\n\t\t\t\ttypeof zIndex === \"undefined\"\n\t\t\t\t\t? defaultProps.zIndex\n\t\t\t\t\t: (zIndex ?? undefined),\n\t\t\tposition: \"fixed\" as const,\n\t\t\ttop: 0,\n\t\t\tleft: 0,\n\t\t\twidth: \"100%\",\n\t\t\theight: \"100vh\",\n\t\t\toverflow: \"auto\",\n\t\t\tbackground:\n\t\t\t\ttypeof background === \"undefined\"\n\t\t\t\t\t? defaultProps.background\n\t\t\t\t\t: (background ?? undefined),\n\t\t},\n\t};\n\n\tif (message) {\n\t\treturn (\n\t\t\t<div {...outerProps}>\n\t\t\t\t<article dangerouslySetInnerHTML={{ __html: message }} />\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div {...outerProps}>\n\t\t\t<div\n\t\t\t\tid=\"root\"\n\t\t\t\tclassName={simulatorRootClass}\n\t\t\t\tonClickCapture={onClickHandler as unknown as React.MouseEventHandler}\n\t\t\t\tonSubmitCapture={\n\t\t\t\t\tdisableEventHandler as unknown as React.FormEventHandler\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n"],"mappings":";;;;;;;;;AAoBA,MAAa,yBAAyD,EACrE,WACA,UACA,QACA,YACA,cACK;CACL,MAAM,8DAAgC;CAEtC,MAAM,aAAa;EAClB,WAAW,CAACA,yCAAgB,UAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;EAChE,OAAO;GACN,QACC,OAAO,WAAW,cACf,aAAa,SACZ,UAAU;GACf,UAAU;GACV,KAAK;GACL,MAAM;GACN,OAAO;GACP,QAAQ;GACR,UAAU;GACV,YACC,OAAO,eAAe,cACnB,aAAa,aACZ,cAAc;GACnB;EACD;AAED,KAAI,QACH,QACC,2CAAC;EAAI,GAAI;YACR,2CAAC,aAAQ,yBAAyB,EAAE,QAAQ,SAAS,GAAI;GACpD;AAIR,QACC,2CAAC;EAAI,GAAI;YACR,2CAAC;GACA,IAAG;GACH,WAAWC;GACX,gBAAgBC;GAChB,iBACCC;GAGA;IACI;GACD"}
1
+ {"version":3,"file":"SliceSimulatorWrapper.cjs","names":["simulatorClass","simulatorRootClass","onClickHandler","disableEventHandler"],"sources":["../src/SliceSimulatorWrapper.tsx"],"sourcesContent":["import {\n\tdisableEventHandler,\n\tgetDefaultProps,\n\tonClickHandler,\n\tsimulatorClass,\n\tsimulatorRootClass,\n} from \"@prismicio/simulator/kit\";\nimport type { SliceSimulatorProps } from \"@prismicio/simulator/kit\";\nimport type { FC, ReactNode } from \"react\";\n\ntype SliceSimulatorWrapperProps = SliceSimulatorProps & {\n\tchildren: ReactNode;\n\tclassName?: string;\n\tmessage?: string;\n};\n\n/**\n * A wrapper for the slice simulator that isolates the given children from the\n * page's layout.\n */\nexport const SliceSimulatorWrapper: FC<SliceSimulatorWrapperProps> = ({\n\tclassName,\n\tchildren,\n\tzIndex,\n\tbackground,\n\tmessage,\n}) => {\n\tconst defaultProps = getDefaultProps();\n\n\treturn (\n\t\t<div\n\t\t\tclassName={[simulatorClass, className].filter(Boolean).join(\" \")}\n\t\t\tstyle={{\n\t\t\t\tzIndex:\n\t\t\t\t\ttypeof zIndex === \"undefined\"\n\t\t\t\t\t\t? defaultProps.zIndex\n\t\t\t\t\t\t: (zIndex ?? undefined),\n\t\t\t\tposition: \"fixed\",\n\t\t\t\ttop: 0,\n\t\t\t\tleft: 0,\n\t\t\t\twidth: \"100%\",\n\t\t\t\theight: \"100vh\",\n\t\t\t\toverflow: \"auto\",\n\t\t\t\tbackground:\n\t\t\t\t\ttypeof background === \"undefined\"\n\t\t\t\t\t\t? defaultProps.background\n\t\t\t\t\t\t: (background ?? undefined),\n\t\t\t}}\n\t\t>\n\t\t\t{message ? (\n\t\t\t\t<article dangerouslySetInnerHTML={{ __html: message }} />\n\t\t\t) : (\n\t\t\t\t<div\n\t\t\t\t\tid=\"root\"\n\t\t\t\t\tclassName={simulatorRootClass}\n\t\t\t\t\tonClickCapture={onClickHandler as unknown as React.MouseEventHandler}\n\t\t\t\t\tonSubmitCapture={\n\t\t\t\t\t\tdisableEventHandler as unknown as React.FormEventHandler\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n"],"mappings":";;;;;;;;;AAoBA,MAAa,yBAAyD,EACrE,WACA,UACA,QACA,YACA,cACK;CACL,MAAM,8DAAgC;AAEtC,QACC,2CAAC;EACA,WAAW,CAACA,yCAAgB,UAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;EAChE,OAAO;GACN,QACC,OAAO,WAAW,cACf,aAAa,SACZ,UAAU;GACf,UAAU;GACV,KAAK;GACL,MAAM;GACN,OAAO;GACP,QAAQ;GACR,UAAU;GACV,YACC,OAAO,eAAe,cACnB,aAAa,aACZ,cAAc;GACnB;YAEA,UACA,2CAAC,aAAQ,yBAAyB,EAAE,QAAQ,SAAS,GAAI,GAEzD,2CAAC;GACA,IAAG;GACH,WAAWC;GACX,gBAAgBC;GAChB,iBACCC;GAGA;IACI;GAEF"}
@@ -8,7 +8,7 @@ import { disableEventHandler, getDefaultProps, onClickHandler, simulatorClass, s
8
8
  */
9
9
  const SliceSimulatorWrapper = ({ className, children, zIndex, background, message }) => {
10
10
  const defaultProps = getDefaultProps();
11
- const outerProps = {
11
+ return /* @__PURE__ */ jsx("div", {
12
12
  className: [simulatorClass, className].filter(Boolean).join(" "),
13
13
  style: {
14
14
  zIndex: typeof zIndex === "undefined" ? defaultProps.zIndex : zIndex ?? void 0,
@@ -19,15 +19,8 @@ const SliceSimulatorWrapper = ({ className, children, zIndex, background, messag
19
19
  height: "100vh",
20
20
  overflow: "auto",
21
21
  background: typeof background === "undefined" ? defaultProps.background : background ?? void 0
22
- }
23
- };
24
- if (message) return /* @__PURE__ */ jsx("div", {
25
- ...outerProps,
26
- children: /* @__PURE__ */ jsx("article", { dangerouslySetInnerHTML: { __html: message } })
27
- });
28
- return /* @__PURE__ */ jsx("div", {
29
- ...outerProps,
30
- children: /* @__PURE__ */ jsx("div", {
22
+ },
23
+ children: message ? /* @__PURE__ */ jsx("article", { dangerouslySetInnerHTML: { __html: message } }) : /* @__PURE__ */ jsx("div", {
31
24
  id: "root",
32
25
  className: simulatorRootClass,
33
26
  onClickCapture: onClickHandler,
@@ -1 +1 @@
1
- {"version":3,"file":"SliceSimulatorWrapper.js","names":[],"sources":["../src/SliceSimulatorWrapper.tsx"],"sourcesContent":["import {\n\tdisableEventHandler,\n\tgetDefaultProps,\n\tonClickHandler,\n\tsimulatorClass,\n\tsimulatorRootClass,\n} from \"@prismicio/simulator/kit\";\nimport type { SliceSimulatorProps } from \"@prismicio/simulator/kit\";\nimport type { FC, ReactNode } from \"react\";\n\ntype SliceSimulatorWrapperProps = SliceSimulatorProps & {\n\tchildren: ReactNode;\n\tclassName?: string;\n\tmessage?: string;\n};\n\n/**\n * A wrapper for the slice simulator that isolates the given children from the\n * page's layout.\n */\nexport const SliceSimulatorWrapper: FC<SliceSimulatorWrapperProps> = ({\n\tclassName,\n\tchildren,\n\tzIndex,\n\tbackground,\n\tmessage,\n}) => {\n\tconst defaultProps = getDefaultProps();\n\n\tconst outerProps = {\n\t\tclassName: [simulatorClass, className].filter(Boolean).join(\" \"),\n\t\tstyle: {\n\t\t\tzIndex:\n\t\t\t\ttypeof zIndex === \"undefined\"\n\t\t\t\t\t? defaultProps.zIndex\n\t\t\t\t\t: (zIndex ?? undefined),\n\t\t\tposition: \"fixed\" as const,\n\t\t\ttop: 0,\n\t\t\tleft: 0,\n\t\t\twidth: \"100%\",\n\t\t\theight: \"100vh\",\n\t\t\toverflow: \"auto\",\n\t\t\tbackground:\n\t\t\t\ttypeof background === \"undefined\"\n\t\t\t\t\t? defaultProps.background\n\t\t\t\t\t: (background ?? undefined),\n\t\t},\n\t};\n\n\tif (message) {\n\t\treturn (\n\t\t\t<div {...outerProps}>\n\t\t\t\t<article dangerouslySetInnerHTML={{ __html: message }} />\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div {...outerProps}>\n\t\t\t<div\n\t\t\t\tid=\"root\"\n\t\t\t\tclassName={simulatorRootClass}\n\t\t\t\tonClickCapture={onClickHandler as unknown as React.MouseEventHandler}\n\t\t\t\tonSubmitCapture={\n\t\t\t\t\tdisableEventHandler as unknown as React.FormEventHandler\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n"],"mappings":";;;;;;;;AAoBA,MAAa,yBAAyD,EACrE,WACA,UACA,QACA,YACA,cACK;CACL,MAAM,eAAe,iBAAiB;CAEtC,MAAM,aAAa;EAClB,WAAW,CAAC,gBAAgB,UAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;EAChE,OAAO;GACN,QACC,OAAO,WAAW,cACf,aAAa,SACZ,UAAU;GACf,UAAU;GACV,KAAK;GACL,MAAM;GACN,OAAO;GACP,QAAQ;GACR,UAAU;GACV,YACC,OAAO,eAAe,cACnB,aAAa,aACZ,cAAc;GACnB;EACD;AAED,KAAI,QACH,QACC,oBAAC;EAAI,GAAI;YACR,oBAAC,aAAQ,yBAAyB,EAAE,QAAQ,SAAS,GAAI;GACpD;AAIR,QACC,oBAAC;EAAI,GAAI;YACR,oBAAC;GACA,IAAG;GACH,WAAW;GACX,gBAAgB;GAChB,iBACC;GAGA;IACI;GACD"}
1
+ {"version":3,"file":"SliceSimulatorWrapper.js","names":[],"sources":["../src/SliceSimulatorWrapper.tsx"],"sourcesContent":["import {\n\tdisableEventHandler,\n\tgetDefaultProps,\n\tonClickHandler,\n\tsimulatorClass,\n\tsimulatorRootClass,\n} from \"@prismicio/simulator/kit\";\nimport type { SliceSimulatorProps } from \"@prismicio/simulator/kit\";\nimport type { FC, ReactNode } from \"react\";\n\ntype SliceSimulatorWrapperProps = SliceSimulatorProps & {\n\tchildren: ReactNode;\n\tclassName?: string;\n\tmessage?: string;\n};\n\n/**\n * A wrapper for the slice simulator that isolates the given children from the\n * page's layout.\n */\nexport const SliceSimulatorWrapper: FC<SliceSimulatorWrapperProps> = ({\n\tclassName,\n\tchildren,\n\tzIndex,\n\tbackground,\n\tmessage,\n}) => {\n\tconst defaultProps = getDefaultProps();\n\n\treturn (\n\t\t<div\n\t\t\tclassName={[simulatorClass, className].filter(Boolean).join(\" \")}\n\t\t\tstyle={{\n\t\t\t\tzIndex:\n\t\t\t\t\ttypeof zIndex === \"undefined\"\n\t\t\t\t\t\t? defaultProps.zIndex\n\t\t\t\t\t\t: (zIndex ?? undefined),\n\t\t\t\tposition: \"fixed\",\n\t\t\t\ttop: 0,\n\t\t\t\tleft: 0,\n\t\t\t\twidth: \"100%\",\n\t\t\t\theight: \"100vh\",\n\t\t\t\toverflow: \"auto\",\n\t\t\t\tbackground:\n\t\t\t\t\ttypeof background === \"undefined\"\n\t\t\t\t\t\t? defaultProps.background\n\t\t\t\t\t\t: (background ?? undefined),\n\t\t\t}}\n\t\t>\n\t\t\t{message ? (\n\t\t\t\t<article dangerouslySetInnerHTML={{ __html: message }} />\n\t\t\t) : (\n\t\t\t\t<div\n\t\t\t\t\tid=\"root\"\n\t\t\t\t\tclassName={simulatorRootClass}\n\t\t\t\t\tonClickCapture={onClickHandler as unknown as React.MouseEventHandler}\n\t\t\t\t\tonSubmitCapture={\n\t\t\t\t\t\tdisableEventHandler as unknown as React.FormEventHandler\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n"],"mappings":";;;;;;;;AAoBA,MAAa,yBAAyD,EACrE,WACA,UACA,QACA,YACA,cACK;CACL,MAAM,eAAe,iBAAiB;AAEtC,QACC,oBAAC;EACA,WAAW,CAAC,gBAAgB,UAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;EAChE,OAAO;GACN,QACC,OAAO,WAAW,cACf,aAAa,SACZ,UAAU;GACf,UAAU;GACV,KAAK;GACL,MAAM;GACN,OAAO;GACP,QAAQ;GACR,UAAU;GACV,YACC,OAAO,eAAe,cACnB,aAAa,aACZ,cAAc;GACnB;YAEA,UACA,oBAAC,aAAQ,yBAAyB,EAAE,QAAQ,SAAS,GAAI,GAEzD,oBAAC;GACA,IAAG;GACH,WAAW;GACX,gBAAgB;GAChB,iBACC;GAGA;IACI;GAEF"}
package/dist/package.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  //#region package.json
3
- var version = "2.2.1-pr.131.6624bed";
3
+ var version = "2.2.1-pr.131.c82c510";
4
4
 
5
5
  //#endregion
6
6
  Object.defineProperty(exports, 'version', {
package/dist/package.js CHANGED
@@ -1,5 +1,5 @@
1
1
  //#region package.json
2
- var version = "2.2.1-pr.131.6624bed";
2
+ var version = "2.2.1-pr.131.c82c510";
3
3
 
4
4
  //#endregion
5
5
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prismicio/next",
3
- "version": "2.2.1-pr.131.6624bed",
3
+ "version": "2.2.1-pr.131.c82c510",
4
4
  "description": "Helpers to integrate Prismic into Next.js apps",
5
5
  "keywords": [
6
6
  "typescript",
@@ -27,46 +27,40 @@ export const SliceSimulatorWrapper: FC<SliceSimulatorWrapperProps> = ({
27
27
  }) => {
28
28
  const defaultProps = getDefaultProps();
29
29
 
30
- const outerProps = {
31
- className: [simulatorClass, className].filter(Boolean).join(" "),
32
- style: {
33
- zIndex:
34
- typeof zIndex === "undefined"
35
- ? defaultProps.zIndex
36
- : (zIndex ?? undefined),
37
- position: "fixed" as const,
38
- top: 0,
39
- left: 0,
40
- width: "100%",
41
- height: "100vh",
42
- overflow: "auto",
43
- background:
44
- typeof background === "undefined"
45
- ? defaultProps.background
46
- : (background ?? undefined),
47
- },
48
- };
49
-
50
- if (message) {
51
- return (
52
- <div {...outerProps}>
53
- <article dangerouslySetInnerHTML={{ __html: message }} />
54
- </div>
55
- );
56
- }
57
-
58
30
  return (
59
- <div {...outerProps}>
60
- <div
61
- id="root"
62
- className={simulatorRootClass}
63
- onClickCapture={onClickHandler as unknown as React.MouseEventHandler}
64
- onSubmitCapture={
65
- disableEventHandler as unknown as React.FormEventHandler
66
- }
67
- >
68
- {children}
69
- </div>
31
+ <div
32
+ className={[simulatorClass, className].filter(Boolean).join(" ")}
33
+ style={{
34
+ zIndex:
35
+ typeof zIndex === "undefined"
36
+ ? defaultProps.zIndex
37
+ : (zIndex ?? undefined),
38
+ position: "fixed",
39
+ top: 0,
40
+ left: 0,
41
+ width: "100%",
42
+ height: "100vh",
43
+ overflow: "auto",
44
+ background:
45
+ typeof background === "undefined"
46
+ ? defaultProps.background
47
+ : (background ?? undefined),
48
+ }}
49
+ >
50
+ {message ? (
51
+ <article dangerouslySetInnerHTML={{ __html: message }} />
52
+ ) : (
53
+ <div
54
+ id="root"
55
+ className={simulatorRootClass}
56
+ onClickCapture={onClickHandler as unknown as React.MouseEventHandler}
57
+ onSubmitCapture={
58
+ disableEventHandler as unknown as React.FormEventHandler
59
+ }
60
+ >
61
+ {children}
62
+ </div>
63
+ )}
70
64
  </div>
71
65
  );
72
66
  };