reifyui 0.13.5 → 0.13.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.cjs +9 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +9 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/FilePreview.jsx +5 -4
package/dist/index.cjs
CHANGED
|
@@ -4416,7 +4416,11 @@ var LANG = {
|
|
|
4416
4416
|
lua: "lua",
|
|
4417
4417
|
pl: "perl",
|
|
4418
4418
|
dockerfile: "dockerfile",
|
|
4419
|
-
diff: "diff"
|
|
4419
|
+
diff: "diff",
|
|
4420
|
+
md: "markdown",
|
|
4421
|
+
txt: "plaintext",
|
|
4422
|
+
log: "plaintext",
|
|
4423
|
+
csv: "plaintext"
|
|
4420
4424
|
};
|
|
4421
4425
|
var OFFICE = /* @__PURE__ */ new Set(["pptx", "ppt", "pptm", "odp", "doc", "docx", "odt", "rtf"]);
|
|
4422
4426
|
var SHEET = /* @__PURE__ */ new Set(["xls", "xlsx", "xlsm", "xlsb", "ods"]);
|
|
@@ -4496,7 +4500,7 @@ function FilePreview({
|
|
|
4496
4500
|
const kind = kindOf(name, mime);
|
|
4497
4501
|
if (kind === "office") {
|
|
4498
4502
|
if (!officePdfUrl) {
|
|
4499
|
-
setSt({ kind: "binary", error: "This format has no
|
|
4503
|
+
setSt({ kind: "binary", error: "This format has no preview here. Download it to open it." });
|
|
4500
4504
|
return;
|
|
4501
4505
|
}
|
|
4502
4506
|
const r = await get(officePdfUrl(url));
|
|
@@ -4507,7 +4511,7 @@ function FilePreview({
|
|
|
4507
4511
|
}
|
|
4508
4512
|
if (kind === "sheet") {
|
|
4509
4513
|
if (!parseWorkbook) {
|
|
4510
|
-
setSt({ kind: "binary", error: "This format has no
|
|
4514
|
+
setSt({ kind: "binary", error: "This format has no preview here. Download it to open it." });
|
|
4511
4515
|
return;
|
|
4512
4516
|
}
|
|
4513
4517
|
try {
|
|
@@ -4590,8 +4594,8 @@ function FilePreview({
|
|
|
4590
4594
|
st.kind === "video" && st.objUrl && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "uic-fp-center", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("video", { className: "uic-fp-media", src: st.objUrl, controls: true }) }),
|
|
4591
4595
|
st.kind === "audio" && st.objUrl && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "uic-fp-center", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("audio", { src: st.objUrl, controls: true }) }),
|
|
4592
4596
|
st.kind === "markdown" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "uic-fp-doc", children: renderMarkdown ? renderMarkdown(st.text || "") : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("pre", { className: "uic-fp-pre", children: st.text }) }),
|
|
4593
|
-
st.kind === "code" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(CodeBlock, { code: st.text || "",
|
|
4594
|
-
st.kind === "html" && view === "source" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(CodeBlock, { code: st.text || "",
|
|
4597
|
+
st.kind === "code" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(CodeBlock, { code: st.text || "", language: LANG[extOf(name)] || "plaintext" }),
|
|
4598
|
+
st.kind === "html" && view === "source" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(CodeBlock, { code: st.text || "", language: "xml" }),
|
|
4595
4599
|
st.kind === "html" && view === "preview" && // The page runs in its own origin with scripts only: a mockup's own script and styles
|
|
4596
4600
|
// work, and nothing in it can read the host page, its cookies or its storage.
|
|
4597
4601
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("iframe", { className: "uic-fp-frame", title: name, sandbox: "allow-scripts", srcDoc: st.text || "" }),
|