@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.
- package/dist/SliceSimulatorWrapper.cjs +3 -10
- package/dist/SliceSimulatorWrapper.cjs.map +1 -1
- package/dist/SliceSimulatorWrapper.js +3 -10
- package/dist/SliceSimulatorWrapper.js.map +1 -1
- package/dist/package.cjs +1 -1
- package/dist/package.js +1 -1
- package/package.json +1 -1
- package/src/SliceSimulatorWrapper.tsx +33 -39
|
@@ -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
|
-
|
|
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\
|
|
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
|
-
|
|
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\
|
|
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
package/dist/package.js
CHANGED
package/package.json
CHANGED
|
@@ -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
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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
|
};
|