miral 0.0.6 → 0.0.8
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/Viewer.js +2 -5
- package/dist/cli.js +2 -1
- package/dist/main.js +6 -0
- package/dist/theme.css +1 -1
- package/package.json +1 -1
package/dist/Viewer.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import { createRoot } from "react-dom/client";
|
|
4
3
|
import { Icon } from "./icons.js";
|
|
5
4
|
import "/__miral-viewer.css";
|
|
6
5
|
import { Assets } from "./Assets.js";
|
|
@@ -163,7 +162,7 @@ const FrameLoading = () => {
|
|
|
163
162
|
}, []);
|
|
164
163
|
return null;
|
|
165
164
|
};
|
|
166
|
-
const
|
|
165
|
+
const Catalog = () => {
|
|
167
166
|
const [url, setUrl] = React.useState(initialUrl);
|
|
168
167
|
const entry = assets &&
|
|
169
168
|
(url.searchParams.get("component") === assetsEntry.path || !entries.length)
|
|
@@ -359,6 +358,4 @@ const Viewer = () => {
|
|
|
359
358
|
transform: isolated || scale === 1 ? "none" : "scale(" + scale + ")",
|
|
360
359
|
}, title: entry.name, width: size?.[0] ?? "100%", height: size?.[1] ?? "100%", src: frameUrl }, frameUrl) }) }), selected === "Playground" && !!page.PropsSchema && (_jsx(Controls, { schema: page.PropsSchema, values: values, onChange: setValues }))] })) })] }));
|
|
361
360
|
};
|
|
362
|
-
const
|
|
363
|
-
if (container)
|
|
364
|
-
createRoot(container).render(_jsx(React.Suspense, { fallback: frame && parent !== window ? _jsx(FrameLoading, {}) : _jsx(Spinner, {}), children: _jsx(Viewer, {}) }));
|
|
361
|
+
export const Viewer = () => (_jsx(React.Suspense, { fallback: frame && parent !== window ? _jsx(FrameLoading, {}) : _jsx(Spinner, {}), children: _jsx(Catalog, {}) }));
|
package/dist/cli.js
CHANGED
|
@@ -63,10 +63,11 @@ const frameworkPlugins = (preset.default.plugins ?? [])
|
|
|
63
63
|
/^(vite:react|preact:|vite:preact|prefresh$)/.test(plugin.name));
|
|
64
64
|
const htmlId = path.join(root, "index.html");
|
|
65
65
|
const extension = import.meta.filename.endsWith(".ts") ? "tsx" : "js";
|
|
66
|
-
const entry = `/@miral/
|
|
66
|
+
const entry = `/@miral/main.${extension}`;
|
|
67
67
|
const html = `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Miral</title></head><body><div id="root"></div><script type="module" src="${entry}"></script></body></html>`;
|
|
68
68
|
const sources = new Map();
|
|
69
69
|
for (const name of [
|
|
70
|
+
"main",
|
|
70
71
|
"Viewer",
|
|
71
72
|
"icons",
|
|
72
73
|
"Assets",
|
package/dist/main.js
ADDED
package/dist/theme.css
CHANGED
|
@@ -58,7 +58,7 @@ body {
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
.preview-prop-row {
|
|
61
|
-
@apply miral:grid miral:grid-cols-[minmax(0,9rem)_minmax(0,14rem)] miral:gap-4 miral:items-center miral:min-h-10 miral:
|
|
61
|
+
@apply miral:grid miral:grid-cols-[minmax(0,9rem)_minmax(0,14rem)] miral:gap-4 miral:items-center miral:min-h-10 miral:wrap-anywhere;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
.preview-prop-row > :is(input, select) {
|