@etrepum/lexical-builder-devtools-core 0.0.28-nightly.20240708.0 → 0.0.28
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/BuilderGraphComponent.d.ts +0 -2
- package/dist/BuilderGraphComponent.d.ts.map +1 -1
- package/dist/BuilderGraphPlan.d.ts +1 -2
- package/dist/BuilderGraphPlan.d.ts.map +1 -1
- package/dist/Mermaid-hdIyOO2O.js +46 -0
- package/dist/Mermaid.d.ts.map +1 -1
- package/dist/buildGraph.d.ts.map +1 -1
- package/dist/displayName.d.ts +4 -0
- package/dist/displayName.d.ts.map +1 -0
- package/dist/getMermaidLiveUrl.d.ts.map +1 -1
- package/dist/index.js +49 -54
- package/package.json +1 -1
- package/dist/Mermaid-Dwi2amgd.js +0 -44
@@ -1,4 +1,3 @@
|
|
1
|
-
import { AnyLexicalPlan } from '@etrepum/lexical-builder';
|
2
1
|
import { LexicalEditor } from 'lexical';
|
3
2
|
import { ComponentProps } from 'react';
|
4
3
|
|
@@ -6,7 +5,6 @@ export interface BuilderGraphComponentProps {
|
|
6
5
|
editor: LexicalEditor;
|
7
6
|
className?: string;
|
8
7
|
}
|
9
|
-
export declare function displayName(plan: AnyLexicalPlan): string;
|
10
8
|
export declare function BuilderGraphComponent({ editor, ...rest }: BuilderGraphComponentProps & ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
11
9
|
export default BuilderGraphComponent;
|
12
10
|
//# sourceMappingURL=BuilderGraphComponent.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"BuilderGraphComponent.d.ts","sourceRoot":"","sources":["../src/BuilderGraphComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"BuilderGraphComponent.d.ts","sourceRoot":"","sources":["../src/BuilderGraphComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,KAAK,cAAc,EAAiB,MAAM,OAAO,CAAC;AAM3D,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,aAAa,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,qBAAqB,CAAC,EACpC,MAAM,EACN,GAAG,IAAI,EACR,EAAE,0BAA0B,GAAG,cAAc,CAAC,KAAK,CAAC,2CAoBpD;AAED,eAAe,qBAAqB,CAAC"}
|
@@ -1,5 +1,4 @@
|
|
1
|
-
export declare const
|
2
|
-
export declare const BuilderGraphPlan: import('@etrepum/lexical-builder').LexicalPlan<import('@etrepum/lexical-builder').PlanConfigBase, "@etrepum/lexical-builder-devtools-core/BuilderGraphPlan", {
|
1
|
+
export declare const BuilderGraphPlan: import('@etrepum/lexical-builder').LexicalPlan<import('@etrepum/lexical-builder').PlanConfigBase, "@etrepum/lexical-builder-devtools-core/BuilderGraph", {
|
3
2
|
Component: () => import("react/jsx-runtime").JSX.Element;
|
4
3
|
}, unknown>;
|
5
4
|
//# sourceMappingURL=BuilderGraphPlan.d.ts.map
|
@@ -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":"AAKA,eAAO,MAAM,gBAAgB;;WAY3B,CAAC"}
|
@@ -0,0 +1,46 @@
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
2
|
+
import m from "mermaid";
|
3
|
+
import { useState as c, useEffect as s, useRef as f } from "react";
|
4
|
+
let l = 0;
|
5
|
+
function p() {
|
6
|
+
return `mermaid-tmp-${String(++l)}`;
|
7
|
+
}
|
8
|
+
function S(t, n) {
|
9
|
+
const [i, e] = c();
|
10
|
+
return s(() => {
|
11
|
+
const r = p();
|
12
|
+
let o = !1;
|
13
|
+
return m.mermaidAPI.initialize({
|
14
|
+
startOnLoad: !1,
|
15
|
+
...n
|
16
|
+
}), m.render(r, t).then(
|
17
|
+
(u) => {
|
18
|
+
o || e(u);
|
19
|
+
},
|
20
|
+
(u) => {
|
21
|
+
var d;
|
22
|
+
throw (d = document.querySelector(`#d${r}`)) == null || d.remove(), u;
|
23
|
+
}
|
24
|
+
), () => {
|
25
|
+
o = !0;
|
26
|
+
};
|
27
|
+
}, [t, n]), i;
|
28
|
+
}
|
29
|
+
function R({ text: t, config: n, ...i }) {
|
30
|
+
const e = S(t, n), r = f(null);
|
31
|
+
return s(() => {
|
32
|
+
e != null && e.bindFunctions && r.current && e.bindFunctions(r.current);
|
33
|
+
}, [e]), e != null && e.svg ? /* @__PURE__ */ a(
|
34
|
+
"div",
|
35
|
+
{
|
36
|
+
...i,
|
37
|
+
ref: r,
|
38
|
+
dangerouslySetInnerHTML: { __html: e.svg }
|
39
|
+
}
|
40
|
+
) : null;
|
41
|
+
}
|
42
|
+
export {
|
43
|
+
R as Mermaid,
|
44
|
+
R as default,
|
45
|
+
S as useMermaidRenderResult
|
46
|
+
};
|
package/dist/Mermaid.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Mermaid.d.ts","sourceRoot":"","sources":["../src/Mermaid.tsx"],"names":[],"mappings":"AAAA,OAAgB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;
|
1
|
+
{"version":3,"file":"Mermaid.d.ts","sourceRoot":"","sources":["../src/Mermaid.tsx"],"names":[],"mappings":"AAAA,OAAgB,EAAE,KAAK,aAAa,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AACzE,OAAO,EAAE,KAAK,cAAc,EAA+B,MAAM,OAAO,CAAC;AAEzE,MAAM,WAAW,YAAa,SAAQ,cAAc,CAAC,KAAK,CAAC;IACzD,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,aAAa,CAAC;CACxB;AAMD,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,aAAa,GACrB,YAAY,GAAG,SAAS,CA0B1B;AAED,wBAAgB,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,EAAE,YAAY,kDAe/D;AAED,eAAe,OAAO,CAAC"}
|
package/dist/buildGraph.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"buildGraph.d.ts","sourceRoot":"","sources":["../src/buildGraph.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;
|
1
|
+
{"version":3,"file":"buildGraph.d.ts","sourceRoot":"","sources":["../src/buildGraph.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,SAAS,CAAC;AAG7C,wBAAgB,UAAU,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CA4BxD"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"displayName.d.ts","sourceRoot":"","sources":["../src/displayName.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE/D,wBAAgB,WAAW,CAAC,IAAI,EAAE,cAAc,UAS/C"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getMermaidLiveUrl.d.ts","sourceRoot":"","sources":["../src/getMermaidLiveUrl.tsx"],"names":[],"mappings":"AAGA,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,
|
1
|
+
{"version":3,"file":"getMermaidLiveUrl.d.ts","sourceRoot":"","sources":["../src/getMermaidLiveUrl.tsx"],"names":[],"mappings":"AAGA,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAatD"}
|
package/dist/index.js
CHANGED
@@ -1,35 +1,41 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { lazy as u, useMemo as
|
3
|
-
import { LexicalBuilder as
|
4
|
-
import { deflate as
|
5
|
-
import { fromUint8Array as
|
6
|
-
import { ReactPlan as
|
7
|
-
function
|
8
|
-
const r =
|
9
|
-
|
1
|
+
import { jsxs as m, jsx as c } from "react/jsx-runtime";
|
2
|
+
import { lazy as u, useMemo as f, Suspense as h } from "react";
|
3
|
+
import { LexicalBuilder as g, definePlan as y, provideOutput as $ } from "@etrepum/lexical-builder";
|
4
|
+
import { deflate as x } from "pako";
|
5
|
+
import { fromUint8Array as v } from "js-base64";
|
6
|
+
import { ReactPlan as A } from "@etrepum/lexical-react-plan";
|
7
|
+
function N(t) {
|
8
|
+
const { name: r } = t, e = r.split(/\//g);
|
9
|
+
for (; e.length > 1 && /^plan$/i.test(e[e.length - 1] ?? ""); )
|
10
|
+
e.pop();
|
11
|
+
return (e[e.length - 1] || r).replaceAll("/", "-").replaceAll(/[\\"<>]/g, "");
|
12
|
+
}
|
13
|
+
function P(t) {
|
14
|
+
const r = g.fromEditor(t), e = ["flowchart TB"];
|
15
|
+
function i(n) {
|
10
16
|
e.push(n);
|
11
17
|
}
|
12
|
-
const
|
13
|
-
for (let n = 0; n <
|
14
|
-
l[
|
18
|
+
const a = r.sortedPlanReps(), l = {};
|
19
|
+
for (let n = 0; n < a.length; n++)
|
20
|
+
l[a[n].plan.name] = `P${String(n)}`;
|
15
21
|
function p(n) {
|
16
22
|
return l[n.name];
|
17
23
|
}
|
18
|
-
for (const n of
|
24
|
+
for (const n of a) {
|
19
25
|
const { plan: o } = n;
|
20
|
-
|
26
|
+
i(`${p(o)}["${N(o)}"]`);
|
21
27
|
for (const s of o.dependencies || [])
|
22
|
-
|
28
|
+
i(`${p(o)} --> ${p(Array.isArray(s) ? s[0] : s)}`);
|
23
29
|
for (const [s] of o.peerDependencies || []) {
|
24
|
-
const
|
25
|
-
|
30
|
+
const d = r.planNameMap.get(s);
|
31
|
+
d && i(`${p(o)} -.-> ${p(d.plan)}`);
|
26
32
|
}
|
27
33
|
}
|
28
|
-
return e.join(`
|
29
|
-
`)
|
34
|
+
return `${e.join(`
|
35
|
+
`)}
|
30
36
|
`;
|
31
37
|
}
|
32
|
-
function
|
38
|
+
function S(t) {
|
33
39
|
const r = JSON.stringify({
|
34
40
|
code: t,
|
35
41
|
mermaid: JSON.stringify({ theme: "dark" }, null, 2),
|
@@ -39,51 +45,40 @@ function A(t) {
|
|
39
45
|
updateEditor: !1,
|
40
46
|
editorMode: "code"
|
41
47
|
});
|
42
|
-
return
|
43
|
-
}
|
44
|
-
|
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, "");
|
48
|
+
return `https://mermaid.live/edit#pako:${v(
|
49
|
+
x(new TextEncoder().encode(r), { level: 9 })
|
50
|
+
)}`;
|
50
51
|
}
|
51
|
-
|
52
|
+
const B = u(() => import("./Mermaid-hdIyOO2O.js"));
|
53
|
+
function E({
|
52
54
|
editor: t,
|
53
55
|
...r
|
54
56
|
}) {
|
55
|
-
const { text: e, href:
|
56
|
-
const l =
|
57
|
+
const { text: e, href: i } = f(() => {
|
58
|
+
const l = P(t);
|
57
59
|
return {
|
58
60
|
text: l,
|
59
|
-
href:
|
61
|
+
href: S(l)
|
60
62
|
};
|
61
|
-
}, [t]),
|
62
|
-
return /* @__PURE__ */
|
63
|
-
/* @__PURE__ */
|
64
|
-
/* @__PURE__ */
|
63
|
+
}, [t]), a = r.className ? {} : { style: { display: "grid", gap: "1rem" } };
|
64
|
+
return /* @__PURE__ */ m("div", { ...a, ...r, children: [
|
65
|
+
/* @__PURE__ */ c("a", { href: i, target: "_blank", rel: "noopener", children: "mermaid.live" }),
|
66
|
+
/* @__PURE__ */ c(B, { text: e })
|
65
67
|
] });
|
66
68
|
}
|
67
|
-
const
|
68
|
-
|
69
|
-
|
70
|
-
default: m,
|
71
|
-
displayName: f
|
72
|
-
}, Symbol.toStringTag, { value: "Module" })), M = u(
|
73
|
-
() => Promise.resolve().then(() => S)
|
74
|
-
), T = v({
|
75
|
-
name: "@etrepum/lexical-builder-devtools-core/BuilderGraphPlan",
|
76
|
-
dependencies: [P],
|
69
|
+
const k = y({
|
70
|
+
name: "@etrepum/lexical-builder-devtools-core/BuilderGraph",
|
71
|
+
dependencies: [A],
|
77
72
|
register(t) {
|
78
|
-
return
|
79
|
-
Component: () => /* @__PURE__ */
|
73
|
+
return $({
|
74
|
+
Component: () => /* @__PURE__ */ c(h, { children: /* @__PURE__ */ c(E, { editor: t }) })
|
80
75
|
});
|
81
76
|
}
|
82
|
-
}),
|
77
|
+
}), w = "0.0.28";
|
83
78
|
export {
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
79
|
+
E as BuilderGraphComponent,
|
80
|
+
k as BuilderGraphPlan,
|
81
|
+
w as PACKAGE_VERSION,
|
82
|
+
P as buildGraph,
|
83
|
+
S as getMermaidLiveUrl
|
89
84
|
};
|
package/package.json
CHANGED
package/dist/Mermaid-Dwi2amgd.js
DELETED
@@ -1,44 +0,0 @@
|
|
1
|
-
import { jsx as m } from "react/jsx-runtime";
|
2
|
-
import d from "mermaid";
|
3
|
-
import { useState as a, useEffect as l, useRef as c } from "react";
|
4
|
-
let f = 0;
|
5
|
-
function p() {
|
6
|
-
return `mermaid-tmp-${++f}`;
|
7
|
-
}
|
8
|
-
function v(t, n) {
|
9
|
-
const [u, e] = a();
|
10
|
-
return l(() => {
|
11
|
-
const r = p();
|
12
|
-
let s = !1;
|
13
|
-
return d.mermaidAPI.initialize({
|
14
|
-
startOnLoad: !1,
|
15
|
-
...n
|
16
|
-
}), d.render(r, t).then(
|
17
|
-
(i) => s ? null : e(i),
|
18
|
-
(i) => {
|
19
|
-
var o;
|
20
|
-
throw (o = document.querySelector(`#d${r}`)) == null || o.remove(), i;
|
21
|
-
}
|
22
|
-
), () => {
|
23
|
-
s = !0;
|
24
|
-
};
|
25
|
-
}, [t, n]), u;
|
26
|
-
}
|
27
|
-
function g({ text: t, config: n, ...u }) {
|
28
|
-
const e = v(t, n), r = c(null);
|
29
|
-
return l(() => {
|
30
|
-
e && e.bindFunctions && r.current && e.bindFunctions(r.current);
|
31
|
-
}, [e]), e && e.svg ? /* @__PURE__ */ m(
|
32
|
-
"div",
|
33
|
-
{
|
34
|
-
...u,
|
35
|
-
ref: r,
|
36
|
-
dangerouslySetInnerHTML: { __html: e.svg }
|
37
|
-
}
|
38
|
-
) : null;
|
39
|
-
}
|
40
|
-
export {
|
41
|
-
g as Mermaid,
|
42
|
-
g as default,
|
43
|
-
v as useMermaidRenderResult
|
44
|
-
};
|