@etrepum/lexical-builder-devtools-core 0.0.25-nightly.20240624.0 → 0.0.25

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- {"version":3,"file":"BuilderGraphPlan.d.ts","sourceRoot":"","sources":["../src/BuilderGraphPlan.tsx"],"names":[],"mappings":";AASA,eAAO,MAAM,qBAAqB,qGAEjC,CAAC;AAEF,eAAO,MAAM,gBAAgB;;WAiB3B,CAAC"}
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"}
@@ -1 +1 @@
1
- {"version":3,"file":"buildGraph.d.ts","sourceRoot":"","sources":["../src/buildGraph.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAIxC,wBAAgB,UAAU,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CAkCxD"}
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 y, jsx as s } from "react/jsx-runtime";
2
- import { lazy as m, useMemo as G, Suspense as v } from "react";
3
- import { LexicalBuilder as f, PACKAGE_VERSION as B, definePlan as P, provideOutput as x } from "@etrepum/lexical-builder";
4
- import { deflate as A } from "pako";
5
- import { fromUint8Array as E } from "js-base64";
6
- import { ReactPlan as $ } from "@etrepum/lexical-react-plan";
7
- function h(r, e, ...t) {
8
- if (!r)
9
- throw new Error(
10
- t.reduce((o, i) => o.replace("%s", String(i)), e || "")
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 = [...e.sortedPlanReps()], l = {};
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: a } = n;
32
- o(`${p(a)}["${g(a)}"]`);
33
- for (const d of a.dependencies || [])
34
- o(`${p(a)} --> ${p(Array.isArray(d) ? d[0] : d)}`);
35
- for (const [d] of a.peerDependencies || []) {
36
- const c = e.planNameMap.get(d);
37
- c && o(`${p(a)} -.-> ${p(c.plan)}`);
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 t.join(`
28
+ return e.join(`
41
29
  `) + `
42
30
  `;
43
31
  }
44
- function C(r) {
45
- const e = JSON.stringify({
46
- code: r,
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:" + E(A(new TextEncoder().encode(e), { level: 9 }));
42
+ return "https://mermaid.live/edit#pako:" + G(B(new TextEncoder().encode(r), { level: 9 }));
55
43
  }
56
- const S = m(() => import("./Mermaid-Dwi2amgd.js"));
57
- function g(r) {
58
- const { name: e } = r, t = e.split(/\//g);
59
- for (; t.length > 1 && /^plan$/i.test(t[t.length - 1] ?? ""); )
60
- t.pop();
61
- return (t[t.length - 1] || e).replaceAll("/", "-").replaceAll(/[\\"<>]/g, "");
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 u({
64
- editor: r,
65
- ...e
51
+ function m({
52
+ editor: t,
53
+ ...r
66
54
  }) {
67
- const { text: t, href: o } = G(() => {
68
- const l = b(r);
55
+ const { text: e, href: a } = g(() => {
56
+ const l = b(t);
69
57
  return {
70
58
  text: l,
71
- href: C(l)
59
+ href: A(l)
72
60
  };
73
- }, [r]), i = e.className ? {} : { style: { display: "grid", gap: "1rem" } };
74
- return /* @__PURE__ */ y("div", { ...i, ...e, children: [
75
- /* @__PURE__ */ s("a", { href: o, target: "_blank", children: "mermaid.live" }),
76
- /* @__PURE__ */ s(S, { text: t })
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 N = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
67
+ const S = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
80
68
  __proto__: null,
81
- BuilderGraphComponent: u,
82
- default: u,
83
- displayName: g
84
- }, Symbol.toStringTag, { value: "Module" })), O = m(
85
- () => Promise.resolve().then(() => N)
86
- ), L = P({
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(r) {
90
- const e = f.fromEditor(r);
91
- return h(
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
- }), T = "0.0.25-nightly.20240624.0";
82
+ }), k = "0.0.25";
99
83
  export {
100
- u as BuilderGraphComponent,
101
- L as BuilderGraphPlan,
102
- T as PACKAGE_VERSION,
84
+ m as BuilderGraphComponent,
85
+ T as BuilderGraphPlan,
86
+ k as PACKAGE_VERSION,
103
87
  b as buildGraph,
104
- C as getMermaidLiveUrl
88
+ A as getMermaidLiveUrl
105
89
  };
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "test": "vitest run",
16
16
  "test:watch": "vitest"
17
17
  },
18
- "version": "0.0.25-nightly.20240624.0",
18
+ "version": "0.0.25",
19
19
  "license": "MIT",
20
20
  "repository": {
21
21
  "type": "git",