@etrepum/lexical-builder-devtools-core 0.0.25-nightly.20240624.0 → 0.0.26-nightly.20240625.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/BuilderGraphPlan.d.ts.map +1 -1
- package/dist/buildGraph.d.ts.map +1 -1
- package/dist/index.js +55 -71
- package/package.json +1 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"BuilderGraphPlan.d.ts","sourceRoot":"","sources":["../src/BuilderGraphPlan.tsx"],"names":[],"mappings":";
|
1
|
+
{"version":3,"file":"BuilderGraphPlan.d.ts","sourceRoot":"","sources":["../src/BuilderGraphPlan.tsx"],"names":[],"mappings":";AAIA,eAAO,MAAM,qBAAqB,qGAEjC,CAAC;AAEF,eAAO,MAAM,gBAAgB;;WAY3B,CAAC"}
|
package/dist/buildGraph.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"buildGraph.d.ts","sourceRoot":"","sources":["../src/buildGraph.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"buildGraph.d.ts","sourceRoot":"","sources":["../src/buildGraph.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAGxC,wBAAgB,UAAU,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CA4BxD"}
|
package/dist/index.js
CHANGED
@@ -1,49 +1,37 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { lazy as
|
3
|
-
import { LexicalBuilder as
|
4
|
-
import { deflate as
|
5
|
-
import { fromUint8Array as
|
6
|
-
import { ReactPlan as
|
7
|
-
function
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
);
|
12
|
-
}
|
13
|
-
function b(r) {
|
14
|
-
const e = f.fromEditor(r);
|
15
|
-
h(
|
16
|
-
e !== void 0,
|
17
|
-
"buildGraph: editor was not created with this build of Lexical Builder %s",
|
18
|
-
B
|
19
|
-
);
|
20
|
-
const t = ["flowchart TB"];
|
21
|
-
function o(n) {
|
22
|
-
t.push(n);
|
1
|
+
import { jsxs as h, jsx as d } from "react/jsx-runtime";
|
2
|
+
import { lazy as u, useMemo as g, Suspense as y } from "react";
|
3
|
+
import { LexicalBuilder as $, definePlan as v, provideOutput as x } from "@etrepum/lexical-builder";
|
4
|
+
import { deflate as B } from "pako";
|
5
|
+
import { fromUint8Array as G } from "js-base64";
|
6
|
+
import { ReactPlan as P } from "@etrepum/lexical-react-plan";
|
7
|
+
function b(t) {
|
8
|
+
const r = $.fromEditor(t), e = ["flowchart TB"];
|
9
|
+
function a(n) {
|
10
|
+
e.push(n);
|
23
11
|
}
|
24
|
-
const i = [...
|
12
|
+
const i = [...r.sortedPlanReps()], l = {};
|
25
13
|
for (let n = 0; n < i.length; n++)
|
26
14
|
l[i[n].plan.name] = `P${n}`;
|
27
15
|
function p(n) {
|
28
16
|
return l[n.name];
|
29
17
|
}
|
30
18
|
for (const n of i) {
|
31
|
-
const { plan:
|
32
|
-
|
33
|
-
for (const
|
34
|
-
|
35
|
-
for (const [
|
36
|
-
const c =
|
37
|
-
c &&
|
19
|
+
const { plan: o } = n;
|
20
|
+
a(`${p(o)}["${f(o)}"]`);
|
21
|
+
for (const s of o.dependencies || [])
|
22
|
+
a(`${p(o)} --> ${p(Array.isArray(s) ? s[0] : s)}`);
|
23
|
+
for (const [s] of o.peerDependencies || []) {
|
24
|
+
const c = r.planNameMap.get(s);
|
25
|
+
c && a(`${p(o)} -.-> ${p(c.plan)}`);
|
38
26
|
}
|
39
27
|
}
|
40
|
-
return
|
28
|
+
return e.join(`
|
41
29
|
`) + `
|
42
30
|
`;
|
43
31
|
}
|
44
|
-
function
|
45
|
-
const
|
46
|
-
code:
|
32
|
+
function A(t) {
|
33
|
+
const r = JSON.stringify({
|
34
|
+
code: t,
|
47
35
|
mermaid: JSON.stringify({ theme: "dark" }, null, 2),
|
48
36
|
autoSync: !0,
|
49
37
|
rough: !1,
|
@@ -51,55 +39,51 @@ function C(r) {
|
|
51
39
|
updateEditor: !1,
|
52
40
|
editorMode: "code"
|
53
41
|
});
|
54
|
-
return "https://mermaid.live/edit#pako:" +
|
42
|
+
return "https://mermaid.live/edit#pako:" + G(B(new TextEncoder().encode(r), { level: 9 }));
|
55
43
|
}
|
56
|
-
const
|
57
|
-
function
|
58
|
-
const { name:
|
59
|
-
for (;
|
60
|
-
|
61
|
-
return (
|
44
|
+
const C = u(() => import("./Mermaid-Dwi2amgd.js"));
|
45
|
+
function f(t) {
|
46
|
+
const { name: r } = t, e = r.split(/\//g);
|
47
|
+
for (; e.length > 1 && /^plan$/i.test(e[e.length - 1] ?? ""); )
|
48
|
+
e.pop();
|
49
|
+
return (e[e.length - 1] || r).replaceAll("/", "-").replaceAll(/[\\"<>]/g, "");
|
62
50
|
}
|
63
|
-
function
|
64
|
-
editor:
|
65
|
-
...
|
51
|
+
function m({
|
52
|
+
editor: t,
|
53
|
+
...r
|
66
54
|
}) {
|
67
|
-
const { text:
|
68
|
-
const l = b(
|
55
|
+
const { text: e, href: a } = g(() => {
|
56
|
+
const l = b(t);
|
69
57
|
return {
|
70
58
|
text: l,
|
71
|
-
href:
|
59
|
+
href: A(l)
|
72
60
|
};
|
73
|
-
}, [
|
74
|
-
return /* @__PURE__ */
|
75
|
-
/* @__PURE__ */
|
76
|
-
/* @__PURE__ */
|
61
|
+
}, [t]), i = r.className ? {} : { style: { display: "grid", gap: "1rem" } };
|
62
|
+
return /* @__PURE__ */ h("div", { ...i, ...r, children: [
|
63
|
+
/* @__PURE__ */ d("a", { href: a, target: "_blank", children: "mermaid.live" }),
|
64
|
+
/* @__PURE__ */ d(C, { text: e })
|
77
65
|
] });
|
78
66
|
}
|
79
|
-
const
|
67
|
+
const S = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
80
68
|
__proto__: null,
|
81
|
-
BuilderGraphComponent:
|
82
|
-
default:
|
83
|
-
displayName:
|
84
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
85
|
-
() => Promise.resolve().then(() =>
|
86
|
-
),
|
69
|
+
BuilderGraphComponent: m,
|
70
|
+
default: m,
|
71
|
+
displayName: f
|
72
|
+
}, Symbol.toStringTag, { value: "Module" })), M = u(
|
73
|
+
() => Promise.resolve().then(() => S)
|
74
|
+
), T = v({
|
87
75
|
name: "@etrepum/lexical-builder-devtools-core/BuilderGraphPlan",
|
88
|
-
dependencies: [
|
89
|
-
register(
|
90
|
-
|
91
|
-
|
92
|
-
e !== void 0,
|
93
|
-
"BuilderGraphPlan: Could not get a LexicalBuilder reference"
|
94
|
-
), x({
|
95
|
-
Component: () => /* @__PURE__ */ s(v, { children: /* @__PURE__ */ s(O, { editor: r }) })
|
76
|
+
dependencies: [P],
|
77
|
+
register(t) {
|
78
|
+
return x({
|
79
|
+
Component: () => /* @__PURE__ */ d(y, { children: /* @__PURE__ */ d(M, { editor: t }) })
|
96
80
|
});
|
97
81
|
}
|
98
|
-
}),
|
82
|
+
}), k = "0.0.26-nightly.20240625.0";
|
99
83
|
export {
|
100
|
-
|
101
|
-
|
102
|
-
|
84
|
+
m as BuilderGraphComponent,
|
85
|
+
T as BuilderGraphPlan,
|
86
|
+
k as PACKAGE_VERSION,
|
103
87
|
b as buildGraph,
|
104
|
-
|
88
|
+
A as getMermaidLiveUrl
|
105
89
|
};
|