mirror of
https://github.com/HumanAIGC-Engineering/gradio-webrtc.git
synced 2026-02-05 18:09:23 +08:00
Add text mode (#321)
* Pretty good spot * Working draft * Fix other mode * Add js to git * Working * Add code * fix * Fix * Add code * Fix submit race condition * demo * fix * Fix * Fix
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import { _ as n, j as r, k as g, l as d } from "./mermaid.core-C0Blj36u.js";
|
||||
var u = /* @__PURE__ */ n((t, e) => {
|
||||
let o;
|
||||
return e === "sandbox" && (o = r("#i" + t)), (e === "sandbox" ? r(o.nodes()[0].contentDocument.body) : r("body")).select(`[id="${t}"]`);
|
||||
}, "getDiagramElement"), b = /* @__PURE__ */ n((t, e, o, i) => {
|
||||
t.attr("class", o);
|
||||
const { width: a, height: s, x: h, y: x } = l(t, e);
|
||||
g(t, s, a, i);
|
||||
const c = w(h, x, a, s, e);
|
||||
t.attr("viewBox", c), d.debug(`viewBox configured: ${c} with padding: ${e}`);
|
||||
}, "setupViewPortForSVG"), l = /* @__PURE__ */ n((t, e) => {
|
||||
var i;
|
||||
const o = ((i = t.node()) == null ? void 0 : i.getBBox()) || { width: 0, height: 0, x: 0, y: 0 };
|
||||
return {
|
||||
width: o.width + e * 2,
|
||||
height: o.height + e * 2,
|
||||
x: o.x,
|
||||
y: o.y
|
||||
};
|
||||
}, "calculateDimensionsWithPadding"), w = /* @__PURE__ */ n((t, e, o, i, a) => `${t - a} ${e - a} ${o} ${i}`, "createViewBox");
|
||||
export {
|
||||
u as g,
|
||||
b as s
|
||||
};
|
||||
Reference in New Issue
Block a user