@floegence/floe-webapp-core 0.82.1 → 0.84.0

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.
@@ -0,0 +1,186 @@
1
+ import { commonjsRequire as k } from "../../../../../../_virtual/_commonjs-dynamic-modules.js";
2
+ import { __module as _ } from "../../../../../../_virtual/elk-api2.js";
3
+ var E;
4
+ function S() {
5
+ return E ? _.exports : (E = 1, (function(O, L) {
6
+ (function(p) {
7
+ O.exports = p();
8
+ })(function() {
9
+ return (/* @__PURE__ */ (function() {
10
+ function p(l, u, i) {
11
+ function y(a, w) {
12
+ if (!u[a]) {
13
+ if (!l[a]) {
14
+ var g = typeof k == "function" && k;
15
+ if (!w && g) return g(a, !0);
16
+ if (v) return v(a, !0);
17
+ var o = new Error("Cannot find module '" + a + "'");
18
+ throw o.code = "MODULE_NOT_FOUND", o;
19
+ }
20
+ var e = u[a] = { exports: {} };
21
+ l[a][0].call(e.exports, function(r) {
22
+ var t = l[a][1][r];
23
+ return y(t || r);
24
+ }, e, e.exports, p, l, u, i);
25
+ }
26
+ return u[a].exports;
27
+ }
28
+ for (var v = typeof k == "function" && k, d = 0; d < i.length; d++) y(i[d]);
29
+ return y;
30
+ }
31
+ return p;
32
+ })())({ 1: [function(p, l, u) {
33
+ Object.defineProperty(u, "__esModule", {
34
+ value: !0
35
+ }), u.default = void 0;
36
+ function i(o) {
37
+ "@babel/helpers - typeof";
38
+ return i = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
39
+ return typeof e;
40
+ } : function(e) {
41
+ return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
42
+ }, i(o);
43
+ }
44
+ function y(o, e) {
45
+ if (!(o instanceof e)) throw new TypeError("Cannot call a class as a function");
46
+ }
47
+ function v(o, e) {
48
+ for (var r = 0; r < e.length; r++) {
49
+ var t = e[r];
50
+ t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(o, a(t.key), t);
51
+ }
52
+ }
53
+ function d(o, e, r) {
54
+ return e && v(o.prototype, e), Object.defineProperty(o, "prototype", { writable: !1 }), o;
55
+ }
56
+ function a(o) {
57
+ var e = w(o, "string");
58
+ return i(e) == "symbol" ? e : e + "";
59
+ }
60
+ function w(o, e) {
61
+ if (i(o) != "object" || !o) return o;
62
+ var r = o[Symbol.toPrimitive];
63
+ if (r !== void 0) {
64
+ var t = r.call(o, e);
65
+ if (i(t) != "object") return t;
66
+ throw new TypeError("@@toPrimitive must return a primitive value.");
67
+ }
68
+ return String(o);
69
+ }
70
+ u.default = /* @__PURE__ */ (function() {
71
+ function o() {
72
+ var e = this, r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = r.defaultLayoutOptions, n = t === void 0 ? {} : t, s = r.algorithms, m = s === void 0 ? ["layered", "stress", "mrtree", "radial", "force", "disco", "sporeOverlap", "sporeCompaction", "rectpacking"] : s, f = r.workerFactory, c = r.workerUrl;
73
+ if (y(this, o), this.defaultLayoutOptions = n, this.initialized = !1, typeof c > "u" && typeof f > "u")
74
+ throw new Error("Cannot construct an ELK without both 'workerUrl' and 'workerFactory'.");
75
+ var h = f;
76
+ typeof c < "u" && typeof f > "u" && (h = function(j) {
77
+ return new Worker(j);
78
+ });
79
+ var b = h(c);
80
+ if (typeof b.postMessage != "function")
81
+ throw new TypeError("Created worker does not provide the required 'postMessage' function.");
82
+ this.worker = new g(b), this.worker.postMessage({
83
+ cmd: "register",
84
+ algorithms: m
85
+ }).then(function(x) {
86
+ return e.initialized = !0;
87
+ }).catch(console.err);
88
+ }
89
+ return d(o, [{
90
+ key: "layout",
91
+ value: function(r) {
92
+ var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = t.layoutOptions, s = n === void 0 ? this.defaultLayoutOptions : n, m = t.logging, f = m === void 0 ? !1 : m, c = t.measureExecutionTime, h = c === void 0 ? !1 : c;
93
+ return r ? this.worker.postMessage({
94
+ cmd: "layout",
95
+ graph: r,
96
+ layoutOptions: s,
97
+ options: {
98
+ logging: f,
99
+ measureExecutionTime: h
100
+ }
101
+ }) : Promise.reject(new Error("Missing mandatory parameter 'graph'."));
102
+ }
103
+ }, {
104
+ key: "knownLayoutAlgorithms",
105
+ value: function() {
106
+ return this.worker.postMessage({
107
+ cmd: "algorithms"
108
+ });
109
+ }
110
+ }, {
111
+ key: "knownLayoutOptions",
112
+ value: function() {
113
+ return this.worker.postMessage({
114
+ cmd: "options"
115
+ });
116
+ }
117
+ }, {
118
+ key: "knownLayoutCategories",
119
+ value: function() {
120
+ return this.worker.postMessage({
121
+ cmd: "categories"
122
+ });
123
+ }
124
+ }, {
125
+ key: "terminateWorker",
126
+ value: function() {
127
+ this.worker && this.worker.terminate();
128
+ }
129
+ }]);
130
+ })();
131
+ var g = /* @__PURE__ */ (function() {
132
+ function o(e) {
133
+ var r = this;
134
+ if (y(this, o), e === void 0)
135
+ throw new Error("Missing mandatory parameter 'worker'.");
136
+ this.resolvers = {}, this.worker = e, this.worker.onmessage = function(t) {
137
+ setTimeout(function() {
138
+ r.receive(r, t);
139
+ }, 0);
140
+ };
141
+ }
142
+ return d(o, [{
143
+ key: "postMessage",
144
+ value: function(r) {
145
+ var t = this.id || 0;
146
+ this.id = t + 1, r.id = t;
147
+ var n = this;
148
+ return new Promise(function(s, m) {
149
+ n.resolvers[t] = function(f, c) {
150
+ f ? (n.convertGwtStyleError(f), m(f)) : s(c);
151
+ }, n.worker.postMessage(r);
152
+ });
153
+ }
154
+ }, {
155
+ key: "receive",
156
+ value: function(r, t) {
157
+ var n = t.data, s = r.resolvers[n.id];
158
+ s && (delete r.resolvers[n.id], n.error ? s(n.error) : s(null, n.data));
159
+ }
160
+ }, {
161
+ key: "terminate",
162
+ value: function() {
163
+ this.worker && this.worker.terminate();
164
+ }
165
+ }, {
166
+ key: "convertGwtStyleError",
167
+ value: function(r) {
168
+ if (r) {
169
+ var t = r.__java$exception;
170
+ t && (t.cause && t.cause.backingJsObject && (r.cause = t.cause.backingJsObject, this.convertGwtStyleError(r.cause)), delete r.__java$exception);
171
+ }
172
+ }
173
+ }]);
174
+ })();
175
+ }, {}], 2: [function(p, l, u) {
176
+ var i = p("./elk-api.js").default;
177
+ Object.defineProperty(l.exports, "__esModule", {
178
+ value: !0
179
+ }), l.exports = i, i.default = i;
180
+ }, { "./elk-api.js": 1 }] }, {}, [2])(2);
181
+ });
182
+ })(_), _.exports);
183
+ }
184
+ export {
185
+ S as __require
186
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floegence/floe-webapp-core",
3
- "version": "0.82.1",
3
+ "version": "0.84.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -134,7 +134,12 @@
134
134
  "./code-highlight": {
135
135
  "types": "./dist/code-highlight.d.ts",
136
136
  "import": "./dist/code-highlight.js"
137
- }
137
+ },
138
+ "./graph": {
139
+ "types": "./dist/graph.d.ts",
140
+ "import": "./dist/graph.js"
141
+ },
142
+ "./graph.css": "./dist/graph.css"
138
143
  },
139
144
  "files": [
140
145
  "dist",
@@ -157,6 +162,7 @@
157
162
  "clsx": "^2.1.1",
158
163
  "diff": "^8.0.4",
159
164
  "dompurify": "^3.4.16",
165
+ "elkjs": "0.12.0",
160
166
  "marked": "^17.0.6",
161
167
  "mermaid": "^11.17.2",
162
168
  "monaco-editor": "^0.57.0",