@workflow/web 5.0.0-beta.1 → 5.0.0-beta.2

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.
Files changed (34) hide show
  1. package/README.md +1 -1
  2. package/build/client/assets/encryption-80GMP4r0.js +26 -0
  3. package/build/client/assets/entry.client-BWsSsWQm.js +11899 -0
  4. package/build/client/assets/highlighted-body-B3W2YXNL-DPWdt39H.js +18 -0
  5. package/build/client/assets/home-OcN-ARTU.js +3992 -0
  6. package/build/client/assets/index-DQa-BExo.js +9432 -0
  7. package/build/client/assets/{manifest-2d7ab41e.js → manifest-62352cd9.js} +1 -1
  8. package/build/client/assets/mermaid-3ZIDBTTL-B9v3aKRl.js +48141 -0
  9. package/build/client/assets/root-BrnNveEi.css +1 -0
  10. package/build/client/assets/root-ClRrWHkX.js +690 -0
  11. package/build/client/assets/run-detail-BdYMODbi.js +6710 -0
  12. package/build/client/assets/{server-build-CiTtikBY.css → server-build-DKWv59Tp.css} +1 -1
  13. package/build/client/assets/worker-CqHKTA7D.js +115 -0
  14. package/build/client/assets/workflow-graph-viewer-BdFIMYrh.js +16175 -0
  15. package/build/server/assets/{app-DaJqmGT8.js → app-coxrYAYu.js} +1 -1
  16. package/build/server/assets/{highlighted-body-B3W2YXNL-xowfciga.js → highlighted-body-B3W2YXNL-DhGWas67.js} +2 -2
  17. package/build/server/assets/{index-CFBIzXaR.js → index-DJ8Yt9MV.js} +30 -29
  18. package/build/server/assets/{mermaid-3ZIDBTTL-nU8V7hWp.js → mermaid-3ZIDBTTL-DJkW_cc4.js} +3 -3
  19. package/build/server/assets/{server-build-rhQJXUIP.js → server-build-dCNkWo2d.js} +420 -95
  20. package/build/server/assets/{token-BZ35B6LQ.js → token-Bi1ru9oe.js} +2 -2
  21. package/build/server/assets/{token-util-vRsmZMJV.js → token-util-Bwj_Mj31.js} +2 -2
  22. package/build/server/index.js +1 -1
  23. package/package.json +6 -6
  24. package/build/client/assets/encryption-8OvC6eoJ.js +0 -1
  25. package/build/client/assets/entry.client-BiVEcoV8.js +0 -29
  26. package/build/client/assets/highlighted-body-B3W2YXNL-epbVCzUZ.js +0 -1
  27. package/build/client/assets/home-cYqw84jW.js +0 -40
  28. package/build/client/assets/index-BmZS3y7B.js +0 -59
  29. package/build/client/assets/mermaid-3ZIDBTTL-CCXSRVd3.js +0 -210
  30. package/build/client/assets/root-aMfmV5uh.css +0 -1
  31. package/build/client/assets/root-kDmPgm4u.js +0 -26
  32. package/build/client/assets/run-detail-B5k2OYOu.js +0 -37
  33. package/build/client/assets/worker-D-HfgUMl.js +0 -1
  34. package/build/client/assets/workflow-graph-viewer-B5c_xYyF.js +0 -161
@@ -0,0 +1,115 @@
1
+ (function() {
2
+ "use strict";
3
+ const addToRow = (placed, node, precision) => {
4
+ const parent = node.parent;
5
+ for (let y = ((parent == null ? void 0 : parent.row) || -1) + 1; ; ++y) {
6
+ let row = placed[y];
7
+ if (!row) {
8
+ row = [];
9
+ placed.push(row);
10
+ } else if (!row.every(({ startTime, endTime }) => startTime + precision > node.endTime || endTime - precision < node.startTime)) {
11
+ continue;
12
+ }
13
+ node.row = y;
14
+ row.push(node);
15
+ break;
16
+ }
17
+ };
18
+ let requestId = 0;
19
+ self.addEventListener("message", (event) => {
20
+ const data = event.data;
21
+ requestId = Math.max(requestId, (data == null ? void 0 : data.requestId) || 0);
22
+ switch (data.type) {
23
+ case "calculateSpanPositions":
24
+ calculateSpanPositions(data.root);
25
+ break;
26
+ case "filterSpans":
27
+ filterSpans(data.root, data.filter);
28
+ break;
29
+ }
30
+ });
31
+ const positionHelper = (node, pending) => {
32
+ if ("parent" in node) {
33
+ const n = node;
34
+ n.row = -1;
35
+ n.isVisible = true;
36
+ pending.push(n);
37
+ }
38
+ const sortedChildren = node.children.slice().sort((a, b) => a.startTime - b.startTime || b.duration - a.duration);
39
+ for (const child of sortedChildren) {
40
+ positionHelper(child, pending);
41
+ }
42
+ };
43
+ const calculateSpanPositions = (root) => {
44
+ const responseId = requestId;
45
+ const placed = [];
46
+ const pending = [];
47
+ positionHelper(root, pending);
48
+ let lastFlushT = Date.now() - 10;
49
+ let lastFlushC = -64;
50
+ let count = 0;
51
+ const flush = () => {
52
+ for (const row of placed) {
53
+ row.sort((a, b) => a.startTime - b.startTime);
54
+ }
55
+ const message = {
56
+ requestId: responseId,
57
+ type: "setRowsResult",
58
+ rows: placed,
59
+ isEnd: !pending.length
60
+ };
61
+ postMessage(message);
62
+ lastFlushT = Date.now();
63
+ lastFlushC = count;
64
+ };
65
+ while (true) {
66
+ const node = pending.shift();
67
+ if (!node) {
68
+ flush();
69
+ return;
70
+ }
71
+ addToRow(placed, node, 1e-3);
72
+ ++count;
73
+ if (Date.now() - lastFlushT >= 15 || count - lastFlushC >= 256) {
74
+ flush();
75
+ }
76
+ }
77
+ };
78
+ const ATTR_FILTER_REGEX = new RegExp("(?<=^|\\s)(?<pair>(?<key>[\\w.]+):(?<value>\\S*))", "g");
79
+ const filterSpans = (root, filter) => {
80
+ const responseId = requestId;
81
+ const matches = /* @__PURE__ */ new Set();
82
+ const name = filter.replace(ATTR_FILTER_REGEX, "").replace(/\s{2,}/g, " ").trim();
83
+ const attrs = [];
84
+ for (const m of filter.matchAll(ATTR_FILTER_REGEX)) {
85
+ const { key = "", value = "" } = m.groups || {};
86
+ attrs.push([key, value.toLocaleLowerCase()]);
87
+ }
88
+ const match = (span) => {
89
+ const nameMatch = span.name.toLocaleLowerCase().includes(name) || span.spanId.toLocaleLowerCase().includes(name);
90
+ if (!nameMatch)
91
+ return false;
92
+ return attrs.every(([key, value]) => {
93
+ const v = span.attributes[key];
94
+ if (!v)
95
+ return false;
96
+ return String(v).toLocaleLowerCase().includes(value);
97
+ });
98
+ };
99
+ const helper = (node) => {
100
+ for (const child of node.children) {
101
+ if (match(child.span)) {
102
+ matches.add(child.span.spanId);
103
+ }
104
+ helper(child);
105
+ }
106
+ };
107
+ helper(root);
108
+ const message = {
109
+ requestId: responseId,
110
+ type: "updateHighlight",
111
+ matches
112
+ };
113
+ postMessage(message);
114
+ };
115
+ })();