@kern0x1b/penstock-cli 26.10.4 → 26.10.5
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.
- package/dist/chunk-account-C8EHysMH.js +1 -0
- package/dist/chunk-agentFailure-piRAFLGH.js +1 -0
- package/dist/chunk-agentLaunch-C5Uo40vv.js +1 -0
- package/dist/chunk-agentServe-4O0syoYQ.js +10 -0
- package/dist/chunk-analyze-Brxlb4U1.js +1 -0
- package/dist/chunk-analyze-CUxuBgNS.js +1 -0
- package/dist/chunk-apply-BAMwoXG9.js +1 -0
- package/dist/chunk-atomicWrite-C6J1gDtO.js +1 -0
- package/dist/chunk-baseline-DvS2S0am.js +1 -0
- package/dist/chunk-bot-I4kuhjyv.js +11 -0
- package/dist/chunk-cacheDirectory-7sa0970e.js +1 -0
- package/dist/chunk-codeFactSet-DOOlbIIj.js +1 -0
- package/dist/chunk-codeIndex-CzENd6hG.js +1 -0
- package/dist/chunk-codeLinks-D-gzUjYv.js +1 -0
- package/dist/chunk-codeLinks-DLxEBWPi.js +1 -0
- package/dist/chunk-command-BR4memGJ.js +1 -0
- package/dist/chunk-command-BctoT00W.js +5 -0
- package/dist/chunk-command-Jl1msVwF.js +1 -0
- package/dist/chunk-commands-CeRlfHY-.js +1 -0
- package/dist/chunk-compose-BV9Jg348.js +4 -0
- package/dist/chunk-connectors-CVfz5pSg.js +1 -0
- package/dist/chunk-connectors-eXPldvkc.js +2 -0
- package/dist/chunk-context-DPJmldqg.js +1 -0
- package/dist/chunk-convert-B1sgT9kl.js +1 -0
- package/dist/chunk-deploy-C4KJK-tw.js +1 -0
- package/dist/chunk-deploy-DOXu2-8q.js +2 -0
- package/dist/chunk-diagram-BaVwLa4h.js +1 -0
- package/dist/chunk-diagram-CCA1-fT5.js +1 -0
- package/dist/chunk-diagramDefects-7UG_Iwsr.js +1 -0
- package/dist/chunk-diagrams-6suPQBVQ.js +1 -0
- package/dist/chunk-diff-BC8gZX5w.js +1 -0
- package/dist/chunk-diff-D1m_eKvv.js +1 -0
- package/dist/chunk-diffModels-DYtf3au1.js +3 -0
- package/dist/chunk-dispatch-CW2CJI0C.js +6 -0
- package/dist/chunk-docs-CY6ICsip.js +1 -0
- package/dist/chunk-docs-CwY3Ce9M.js +30 -0
- package/dist/chunk-doctor-m0mnVdDE.js +1 -0
- package/dist/chunk-drawing-shRfnrs9.js +8 -0
- package/dist/chunk-editPreview-BgH1JVOD.js +1 -0
- package/dist/chunk-engine-CxgdJ2wO.js +1 -0
- package/dist/chunk-export-9AWsr5ai.js +1 -0
- package/dist/chunk-export-D5kPD4Or.js +20 -0
- package/dist/chunk-facts-DA3Y-k9a.js +1 -0
- package/dist/chunk-failure-BsimkHy_.js +1 -0
- package/dist/chunk-features-BfRg2kR5.js +1 -0
- package/dist/chunk-features-BwnwB6jL.js +1 -0
- package/dist/chunk-folders-13vx0i0n.js +1 -0
- package/dist/chunk-folders-C1Nes4Ap.js +1 -0
- package/dist/chunk-formChecks-acRgARZ3.js +1 -0
- package/dist/chunk-git-BOKyPQj7.js +3 -0
- package/dist/chunk-help-CFhmAhz8.js +85 -0
- package/dist/chunk-importCommand-5SJxu2k4.js +1 -0
- package/dist/chunk-init-AIh_7yE0.js +227 -0
- package/dist/chunk-license-B_To2110.js +1 -0
- package/dist/chunk-license-x3oHbKe2.js +1 -0
- package/dist/chunk-lint-C_fAcLIg.js +1 -0
- package/dist/chunk-load-BVJUBU5S.js +5 -0
- package/dist/chunk-main-D3S4Xr__.js +1 -0
- package/dist/chunk-mcp-ByMCWlXC.js +76 -0
- package/dist/chunk-mcpLaunch-C13ViiIP.js +592 -0
- package/dist/chunk-migrate-CLQ-hrae.js +1 -0
- package/dist/chunk-migrate-CVUR1K7f.js +1 -0
- package/dist/chunk-moddle-AjPH0QEc.js +1 -0
- package/dist/chunk-moddle-Dlk0NR-u.js +1 -0
- package/dist/chunk-own-CX-3lIbf.js +1 -0
- package/dist/chunk-penstockCli-CqiOKC75.js +1 -0
- package/dist/chunk-placeholderLayout-B18ekWmh.js +1 -0
- package/dist/chunk-plural-Bq_4vgOr.js +1 -0
- package/dist/chunk-pr-tC3-PSNM.js +1 -0
- package/dist/chunk-preferencesFile-F6bAlNrk.js +1 -0
- package/dist/chunk-project-qT-Fk_Rz.js +1 -0
- package/dist/chunk-report-CDz78nCI.js +1 -0
- package/dist/chunk-review-BqZSohXR.js +1 -0
- package/dist/chunk-rules-DJlL7K_Q.js +1 -0
- package/dist/chunk-security-5SU-bq3A.js +18 -0
- package/dist/chunk-share-YSewfw3F.js +239 -0
- package/dist/chunk-src-BLyg_6UX.js +879 -0
- package/dist/chunk-stages-C-nhLoBW.js +3 -0
- package/dist/chunk-status-DgeSOz3A.js +1 -0
- package/dist/chunk-systemError-2me5k57V.js +1 -0
- package/dist/chunk-systemError-B-1nL94i.js +1 -0
- package/dist/chunk-table-CJtiXv0e.js +1 -0
- package/dist/chunk-taskTest-4rIxp0rL.js +2 -0
- package/dist/chunk-taskTest-rng12v_b.js +1 -0
- package/dist/chunk-templates-Bxe3J0qy.js +1 -0
- package/dist/chunk-testCases-CwQ-Mi7L.js +1 -0
- package/dist/chunk-testCases-xculyxH_.js +4 -0
- package/dist/chunk-tests-C-kNQNpq.js +1 -0
- package/dist/chunk-tests-C3XJ9LMT.js +23 -0
- package/dist/chunk-translator-BFUJmSkR.js +21 -0
- package/dist/chunk-trust-u1vZ6Yk0.js +1 -0
- package/dist/chunk-trust-yKw_pXRj.js +1 -0
- package/dist/chunk-version-CdS8_QQd.js +1 -0
- package/dist/chunk-workerVariables-CCLcoR0U.js +1 -0
- package/dist/chunk-wrapper-AJWl6ru-.js +3 -0
- package/dist/chunk-wrapper-Bxz1Lgp5.js +1 -0
- package/dist/locales/de.json +9176 -0
- package/dist/locales/es.json +9176 -0
- package/dist/locales/fr.json +9176 -0
- package/dist/locales/ja.json +9023 -0
- package/dist/locales/ko.json +9023 -0
- package/dist/locales/pt-BR.json +9176 -0
- package/dist/locales/ru.json +9482 -0
- package/dist/locales/zh.json +9023 -0
- package/dist/penstock.js +1 -2363
- package/dist/web/assets/{AgentSettings-BvzT4Itb.js → AgentSettings-C3Er_rlW.js} +1 -1
- package/dist/web/assets/{AgentsDialog-BqY3wKcV.js → AgentsDialog-Bo7kikb6.js} +1 -1
- package/dist/web/assets/{BpmnCanvas-BTdM1l9l.js → BpmnCanvas-Dw5zgCN3.js} +3 -3
- package/dist/web/assets/{BpmnDocument-uifU3NGG.js → BpmnDocument-CuU0biX9.js} +4 -4
- package/dist/web/assets/{ConflictDialog-C4A9-Psr.js → ConflictDialog-GxZ-d8SK.js} +1 -1
- package/dist/web/assets/{DiffDocument-BMTSevd7.js → DiffDocument-Bh3hFmmi.js} +1 -1
- package/dist/web/assets/{DmnDocument-B8wWuhfX.js → DmnDocument-C8HpJAcE.js} +1 -1
- package/dist/web/assets/{FormDocument-bQ5VRsrh.js → FormDocument-CH-4KB3x.js} +1 -1
- package/dist/web/assets/{FormStepView-DbMCFSO1.js → FormStepView-DraPVoAN.js} +1 -1
- package/dist/web/assets/GraphAwareLayoutService-C8J8YHJI.js +21 -0
- package/dist/web/assets/NewFileDialog-j09JqpPj.js +47 -0
- package/dist/web/assets/{QuickOpen-mzlfRqvG.js → QuickOpen-CeBhsCzA.js} +1 -1
- package/dist/web/assets/{ScriptPane-C9q5wLfO.js → ScriptPane-DDikZDv6.js} +2 -2
- package/dist/web/assets/{ScriptRunDialog-Dm-_0H1Z.js → ScriptRunDialog-DdzJ0pvT.js} +1 -1
- package/dist/web/assets/{SettingsDialog-Bhwwtyg7.js → SettingsDialog-JUc5zUR9.js} +1 -1
- package/dist/web/assets/{ShortcutsDialog-BXP0h7Tp.js → ShortcutsDialog-DECqWPNE.js} +1 -1
- package/dist/web/assets/{SourceDocument-DgrNCprS.js → SourceDocument-X8ajUcxM.js} +1 -1
- package/dist/web/assets/{TextDocument-D8N0uaQa.js → TextDocument-0z7qojAh.js} +1 -1
- package/dist/web/assets/{UnreadableFileLayer-D2Rcxnt7.js → UnreadableFileLayer-D3G59F4u.js} +1 -1
- package/dist/web/assets/{UploadDialog-Dinga4TP.js → UploadDialog-CiahYkTc.js} +1 -1
- package/dist/web/assets/{apply-CzXxiRWK.js → apply-HqvoGwLE.js} +1 -1
- package/dist/web/assets/{bpmnTheme-db4tYvop.js → bpmnTheme-cOvp4qFc.js} +1 -1
- package/dist/web/assets/{bridgeInstance-BPwbITOf.js → bridgeInstance-DQk-c8L1.js} +1 -1
- package/dist/web/assets/{commands-BAnBjEk3.js → commands-nPznxvPp.js} +1 -1
- package/dist/web/assets/de-Dj813wjn.js +1 -0
- package/dist/web/assets/{dialog-KVjfqSrB.js → dialog-CtGB1LHI.js} +1 -1
- package/dist/web/assets/{diff-Cw0ENHJR.js → diff-NgYeO98t.js} +1 -1
- package/dist/web/assets/{documentBridge-D5SaBThP.js → documentBridge-QW0IZ9Bq.js} +2 -2
- package/dist/web/assets/{documents-Dkor36oS.js → documents-KeXEdK1U.js} +1 -1
- package/dist/web/assets/{duplicate-ud-StKuO.js → duplicate-DNPpPVse.js} +1 -1
- package/dist/web/assets/{engines-BQRXHtW8.js → engines-DU0BfbYM.js} +1 -1
- package/dist/web/assets/es-CyJDEw4H.js +1 -0
- package/dist/web/assets/{formChecks-DFrCuO4I.js → formChecks-sU20kKkU.js} +1 -1
- package/dist/web/assets/fr-B1lqrd3d.js +1 -0
- package/dist/web/assets/frontend-caI7mOAL.js +1 -0
- package/dist/web/assets/{httpHost-DX-P_FDg.js → httpHost-Dqit__mm.js} +1 -1
- package/dist/web/assets/{index.es-dFUgH_-g.js → index.es-BqVUpGyA.js} +1 -1
- package/dist/web/assets/{index.es-DR-czZl7.js → index.es-DqkfrvWI.js} +1 -1
- package/dist/web/assets/{intelligence-BkxcJMU_.js → intelligence-Ck_Q9upa.js} +1 -1
- package/dist/web/assets/ja-BUAM_DzQ.js +1 -0
- package/dist/web/assets/{jspdf.es.min-BMfOi0te.js → jspdf.es.min-CM3S4IDt.js} +3 -3
- package/dist/web/assets/ko-7l4EjTF9.js +1 -0
- package/dist/web/assets/{lib-C3uYnGWx.js → lib-DAKOOgix.js} +1 -1
- package/dist/web/assets/{platform-zEAtGnYc.js → platform-CkWAyNst.js} +1 -1
- package/dist/web/assets/{preferences-K6VRM9Ah.js → preferences-nBrFGN89.js} +1 -1
- package/dist/web/assets/pt-BR-CxxRL7kF.js +1 -0
- package/dist/web/assets/ru-C4gbkVXL.js +1 -0
- package/dist/web/assets/{run-fV7AmV4q.js → run-B3YvrVeP.js} +1 -1
- package/dist/web/assets/{samples-D-3Bquy_.js → samples-BVuIm-bu.js} +1 -1
- package/dist/web/assets/{testCaseRuns-C-0blM3d.js → testCaseRuns-DYKnccnc.js} +1 -1
- package/dist/web/assets/translator-B2N3PQBL.js +1 -0
- package/dist/web/assets/{ui-TBzvKaKQ.js → ui-3pEQJ50t.js} +1 -1
- package/dist/web/assets/{useTrace-BgpeAcQR.js → useTrace-BAXnn0Bt.js} +1 -1
- package/dist/web/assets/{web-qJCedJJw.js → web-B2zkonPE.js} +5 -5
- package/dist/web/assets/zh-DIYPlVjz.js +1 -0
- package/dist/web/index.html +19 -19
- package/package.json +1 -1
- package/dist/web/assets/GraphAwareLayoutService-CePcz6pL.js +0 -21
- package/dist/web/assets/NewFileDialog-DsoFURD9.js +0 -47
- package/dist/web/assets/de-Cd75cvcZ.js +0 -1
- package/dist/web/assets/es-D2PUEg_Z.js +0 -1
- package/dist/web/assets/fr-DkGYGarc.js +0 -1
- package/dist/web/assets/frontend-B05iyhCp.js +0 -1
- package/dist/web/assets/ja-De4NAvK-.js +0 -1
- package/dist/web/assets/ko-Ci27KQ5n.js +0 -1
- package/dist/web/assets/pt-BR-CNmIseZJ.js +0 -1
- package/dist/web/assets/ru-BtK7W4xW.js +0 -1
- package/dist/web/assets/translator-Dvvasoz-.js +0 -1
- package/dist/web/assets/zh-DxI_A5kC.js +0 -1
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import{r as e,t}from"./chunk-translator-BFUJmSkR.js";import{S as n,at as r,b as i,dn as a,it as o,rt as s,w as c,x as l}from"./chunk-src-BLyg_6UX.js";import"./chunk-moddle-Dlk0NR-u.js";import"./chunk-docs-CY6ICsip.js";import{s as u}from"./chunk-failure-BsimkHy_.js";import"./chunk-apply-BAMwoXG9.js";import{r as d}from"./chunk-context-DPJmldqg.js";import"./chunk-rules-DJlL7K_Q.js";import"./chunk-formChecks-acRgARZ3.js";import{t as f}from"./chunk-drawing-shRfnrs9.js";import"./chunk-diagramDefects-7UG_Iwsr.js";import{n as p}from"./chunk-systemError-B-1nL94i.js";import m from"node:path";import{mkdirSync as h,readFileSync as g,writeFileSync as _}from"node:fs";import{BPMNIO_IMG as v}from"bpmn-js/lib/util/PoweredByUtil.js";function y(){return`(function () {
|
|
2
|
+
var canvas = document.getElementById('canvas');
|
|
3
|
+
var noDocumentation = ${JSON.stringify(e(`app.share.noDocumentation`))};
|
|
4
|
+
var closeLabel = ${JSON.stringify(e(`app.common.close`))};
|
|
5
|
+
var svg = canvas.querySelector('svg');
|
|
6
|
+
var info = document.getElementById('info');
|
|
7
|
+
var entries = JSON.parse(document.getElementById('docs').textContent || '[]');
|
|
8
|
+
var docs = {};
|
|
9
|
+
entries.forEach(function (entry) { docs[entry.id] = entry; });
|
|
10
|
+
var base = svg.getAttribute('viewBox').split(/[\\s,]+/).map(Number);
|
|
11
|
+
var view = base.slice();
|
|
12
|
+
var moved = false;
|
|
13
|
+
var pointers = {};
|
|
14
|
+
var drag = null;
|
|
15
|
+
var pinch = 0;
|
|
16
|
+
|
|
17
|
+
function apply() {
|
|
18
|
+
svg.setAttribute('viewBox', view.map(function (value) { return Math.round(value * 100) / 100; }).join(' '));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function fit() {
|
|
22
|
+
view = base.slice();
|
|
23
|
+
apply();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function scale() {
|
|
27
|
+
var box = svg.getBoundingClientRect();
|
|
28
|
+
if (!box.width || !box.height) return { factor: 1, left: 0, top: 0 };
|
|
29
|
+
var factor = Math.min(box.width / view[2], box.height / view[3]);
|
|
30
|
+
return { factor: factor, left: (box.width - view[2] * factor) / 2, top: (box.height - view[3] * factor) / 2, box: box };
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function zoom(factor, x, y) {
|
|
34
|
+
var next = view[2] / factor;
|
|
35
|
+
if (next < base[2] / 40 || next > base[2] * 8) return;
|
|
36
|
+
view = [x - (x - view[0]) / factor, y - (y - view[1]) / factor, next, view[3] / factor];
|
|
37
|
+
apply();
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function centre() {
|
|
41
|
+
return [view[0] + view[2] / 2, view[1] + view[3] / 2];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function at(clientX, clientY) {
|
|
45
|
+
var s = scale();
|
|
46
|
+
if (!s.box) return centre();
|
|
47
|
+
return [view[0] + (clientX - s.box.left - s.left) / s.factor, view[1] + (clientY - s.box.top - s.top) / s.factor];
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function press(id, factor) {
|
|
51
|
+
document.getElementById(id).addEventListener('click', function () {
|
|
52
|
+
var c = centre();
|
|
53
|
+
zoom(factor, c[0], c[1]);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
press('zoom-in', 1.25);
|
|
58
|
+
press('zoom-out', 1 / 1.25);
|
|
59
|
+
document.getElementById('zoom-fit').addEventListener('click', fit);
|
|
60
|
+
|
|
61
|
+
canvas.addEventListener('wheel', function (event) {
|
|
62
|
+
event.preventDefault();
|
|
63
|
+
var p = at(event.clientX, event.clientY);
|
|
64
|
+
var factor = event.ctrlKey ? Math.exp(-event.deltaY * 0.01) : event.deltaY < 0 ? 1.1 : 1 / 1.1;
|
|
65
|
+
zoom(factor, p[0], p[1]);
|
|
66
|
+
}, { passive: false });
|
|
67
|
+
|
|
68
|
+
function spread() {
|
|
69
|
+
var ids = Object.keys(pointers);
|
|
70
|
+
var a = pointers[ids[0]];
|
|
71
|
+
var b = pointers[ids[1]];
|
|
72
|
+
return Math.hypot(a.x - b.x, a.y - b.y);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
canvas.addEventListener('pointerdown', function (event) {
|
|
76
|
+
pointers[event.pointerId] = { x: event.clientX, y: event.clientY };
|
|
77
|
+
moved = false;
|
|
78
|
+
if (Object.keys(pointers).length === 2) pinch = spread();
|
|
79
|
+
drag = { x: event.clientX, y: event.clientY, view: view.slice() };
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
canvas.addEventListener('pointermove', function (event) {
|
|
83
|
+
if (!pointers[event.pointerId]) return;
|
|
84
|
+
pointers[event.pointerId] = { x: event.clientX, y: event.clientY };
|
|
85
|
+
if (Object.keys(pointers).length === 2) {
|
|
86
|
+
var now = spread();
|
|
87
|
+
if (pinch && now) {
|
|
88
|
+
var ids = Object.keys(pointers);
|
|
89
|
+
var mid = at((pointers[ids[0]].x + pointers[ids[1]].x) / 2, (pointers[ids[0]].y + pointers[ids[1]].y) / 2);
|
|
90
|
+
zoom(now / pinch, mid[0], mid[1]);
|
|
91
|
+
}
|
|
92
|
+
pinch = now;
|
|
93
|
+
moved = true;
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
if (!drag) return;
|
|
97
|
+
var dx = event.clientX - drag.x;
|
|
98
|
+
var dy = event.clientY - drag.y;
|
|
99
|
+
if (!moved && Math.abs(dx) + Math.abs(dy) < 4) return;
|
|
100
|
+
moved = true;
|
|
101
|
+
var factor = scale().factor;
|
|
102
|
+
view = [drag.view[0] - dx / factor, drag.view[1] - dy / factor, view[2], view[3]];
|
|
103
|
+
apply();
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
function release(event) {
|
|
107
|
+
delete pointers[event.pointerId];
|
|
108
|
+
pinch = 0;
|
|
109
|
+
drag = null;
|
|
110
|
+
}
|
|
111
|
+
canvas.addEventListener('pointerup', release);
|
|
112
|
+
canvas.addEventListener('pointercancel', release);
|
|
113
|
+
|
|
114
|
+
canvas.addEventListener('keydown', function (event) {
|
|
115
|
+
var c = centre();
|
|
116
|
+
var step = view[2] / 10;
|
|
117
|
+
if (event.key === '+' || event.key === '=') zoom(1.25, c[0], c[1]);
|
|
118
|
+
else if (event.key === '-') zoom(1 / 1.25, c[0], c[1]);
|
|
119
|
+
else if (event.key === '0') fit();
|
|
120
|
+
else if (event.key === 'ArrowLeft') { view[0] -= step; apply(); }
|
|
121
|
+
else if (event.key === 'ArrowRight') { view[0] += step; apply(); }
|
|
122
|
+
else if (event.key === 'ArrowUp') { view[1] -= step; apply(); }
|
|
123
|
+
else if (event.key === 'ArrowDown') { view[1] += step; apply(); }
|
|
124
|
+
else if (event.key === 'Escape') select(null);
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
function select(node) {
|
|
128
|
+
var previous = svg.querySelector('.penstock-selected');
|
|
129
|
+
if (previous) previous.classList.remove('penstock-selected');
|
|
130
|
+
if (!node) {
|
|
131
|
+
info.hidden = true;
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
node.classList.add('penstock-selected');
|
|
135
|
+
var id = node.getAttribute('data-element-id');
|
|
136
|
+
var entry = Object.prototype.hasOwnProperty.call(docs, id) ? docs[id] : { id: id, type: '', name: '', documentation: '' };
|
|
137
|
+
info.textContent = '';
|
|
138
|
+
var title = document.createElement('h2');
|
|
139
|
+
title.textContent = entry.name || entry.id;
|
|
140
|
+
info.appendChild(title);
|
|
141
|
+
if (entry.type) {
|
|
142
|
+
var kind = document.createElement('p');
|
|
143
|
+
kind.className = 'kind';
|
|
144
|
+
kind.textContent = entry.type;
|
|
145
|
+
info.appendChild(kind);
|
|
146
|
+
}
|
|
147
|
+
var text = document.createElement('p');
|
|
148
|
+
if (entry.documentation) {
|
|
149
|
+
text.textContent = entry.documentation;
|
|
150
|
+
} else {
|
|
151
|
+
text.className = 'none';
|
|
152
|
+
text.textContent = noDocumentation;
|
|
153
|
+
}
|
|
154
|
+
info.appendChild(text);
|
|
155
|
+
var close = document.createElement('button');
|
|
156
|
+
close.type = 'button';
|
|
157
|
+
close.setAttribute('aria-label', closeLabel);
|
|
158
|
+
close.textContent = '\\u00d7';
|
|
159
|
+
close.addEventListener('click', function (event) {
|
|
160
|
+
event.stopPropagation();
|
|
161
|
+
select(null);
|
|
162
|
+
});
|
|
163
|
+
info.appendChild(close);
|
|
164
|
+
info.hidden = false;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
canvas.addEventListener('click', function (event) {
|
|
168
|
+
if (moved) {
|
|
169
|
+
moved = false;
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
var target = event.target && event.target.closest ? event.target.closest('[data-element-id]') : null;
|
|
173
|
+
select(target);
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
fit();
|
|
177
|
+
})();`}const b=`http://www.omg.org/spec/BPMN/20100524/MODEL`,x=/* @__PURE__ */ new Set([`definitions`,`process`,`collaboration`,`laneSet`,`message`,`signal`,`error`,`escalation`,`itemDefinition`,`dataStore`,`documentation`]),S={"zoom-in":`<path d="M3 8h10M8 3v10"/>`,"zoom-out":`<path d="M3 8h10"/>`,"zoom-fit":`<path d="M2 6V2h4M10 2h4v4M14 10v4h-4M6 14H2v-4"/>`};function C(e){let t=c(e);return t.charAt(0).toUpperCase()+t.slice(1)}function w(e){let t=e.children.find(e=>e.local===`documentation`);return t?t.text.trim():``}function T(e){let t=r(e),n=[],i=e=>{for(let t of e.children){if(t.ns===b&&t.attrs.id&&!x.has(t.local)){let e=(t.attrs.name??``).replace(/\s+/g,` `).trim(),r=w(t);(e||r)&&n.push({id:t.attrs.id,type:C(t.local),name:e,documentation:r})}t.ns===b&&i(t)}};return i(t),n}function E(e,t){let n=r(e),i=e=>o(n,e).map(e=>(e.attrs.name??``).replace(/\s+/g,` `).trim()).find(Boolean),a=(n.attrs.name??``).trim();return i(`collaboration`)||(o(n,`participant`).length>1?a||t:i(`participant`)??i(`process`)??(a||t))}function D(t){let n=t.indexOf(`<svg`);if(n<0)throw Error(e(`app.share.couldNotBeDrawn`));let r=t.slice(n),i=/^<svg[^>]*>/.exec(r);if(!i)throw Error(e(`app.share.couldNotBeDrawn`));let a=i[0];if(!/viewBox="/.test(a)){let e=/\swidth="([\d.]+)/.exec(a)?.[1]??`100`,t=/\sheight="([\d.]+)/.exec(a)?.[1]??`100`;a=a.replace(`<svg`,`<svg viewBox="0 0 ${e} ${t}"`)}return a=a.replace(/\s(width|height|preserveAspectRatio)="[^"]*"/g,``).replace(`<svg`,`<svg preserveAspectRatio="xMidYMid meet" role="img"`),r=a+r.slice(i[0].length),r}function O(e){return JSON.stringify(e).replace(/</g,`\\u003c`).replace(/* @__PURE__ */ RegExp(`\u2028`,`g`),`\\u2028`).replace(/* @__PURE__ */ RegExp(`\u2029`,`g`),`\\u2029`)}function k(e,t){return`<table><thead><tr>${e.map(e=>`<th>${s(e)}</th>`).join(``)}</tr></thead><tbody>\n${t.map(e=>`<tr>${e.map(e=>`<td>${s(e)}</td>`).join(``)}</tr>`).join(`
|
|
178
|
+
`)}\n</tbody></table>`}function A(e,t){return`<section><h2${t?` class="name"`:``}>${s(e.title)}</h2>${e.description?`<p>${s(e.description)}</p>`:``}${e.note?`<p class="note">${s(e.note)}</p>`:``}${k(e.head,e.rows)}</section>`}function j(){let t=(e,t)=>`<button type="button" id="${e}" aria-label="${t}" title="${t}"><svg viewBox="0 0 16 16" aria-hidden="true">${S[e]}</svg></button>`;return`<div id="controls">${t(`zoom-in`,e(`app.share.zoomIn`))}${t(`zoom-out`,e(`app.share.zoomOut`))}${t(`zoom-fit`,e(`app.share.fitToScreen`))}</div>`}function M(n){let r=s(n.title),i=`<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src data:; style-src 'unsafe-inline'; script-src 'unsafe-inline'; base-uri 'none'; form-action 'none'"><meta name="generator" content="Penstock"><title>${r}</title><style>
|
|
179
|
+
:root{color-scheme:light dark;--bg:#ffffff;--surface:#f7f8fa;--border:#ebecf0;--fg:#27282c;--muted:#6c707e;--accent:#3574f0;--hover:#ebecf0}
|
|
180
|
+
@media (prefers-color-scheme: dark){:root{--bg:#1e1f22;--surface:#2b2d30;--border:#43454a;--fg:#ced0d6;--muted:#868a91;--accent:#548af7;--hover:#393b40}#canvas svg{filter:invert(.9) hue-rotate(180deg)}}
|
|
181
|
+
*{box-sizing:border-box}
|
|
182
|
+
html,body{height:100%;margin:0}
|
|
183
|
+
body{display:flex;flex-direction:column;background:var(--bg);color:var(--fg);font:13px/1.5 "JetBrains Mono",ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}
|
|
184
|
+
header{padding:12px 16px}
|
|
185
|
+
h1{font-size:16px;line-height:24px;margin:0;font-weight:600}
|
|
186
|
+
.hint{margin:0;color:var(--muted);font-size:12px}
|
|
187
|
+
main{position:relative;flex:1;min-height:0}
|
|
188
|
+
footer{padding:8px 16px;color:var(--muted);font-size:12px;line-height:24px}
|
|
189
|
+
#canvas{position:absolute;inset:0;overflow:hidden;cursor:grab;touch-action:none;outline:none}
|
|
190
|
+
#canvas:active{cursor:grabbing}
|
|
191
|
+
#canvas svg{display:block;width:100%;height:100%}
|
|
192
|
+
#canvas .djs-element{cursor:pointer}
|
|
193
|
+
.penstock-selected{filter:drop-shadow(0 0 3px var(--accent))}
|
|
194
|
+
#controls{position:absolute;top:12px;left:12px;display:flex;gap:4px;padding:4px;background:var(--surface);border:1px solid var(--border);border-radius:8px}
|
|
195
|
+
#controls button{width:28px;height:28px;padding:0;display:grid;place-items:center;background:transparent;color:var(--fg);border:0;border-radius:6px;cursor:pointer}
|
|
196
|
+
#controls button:hover{background:var(--hover)}
|
|
197
|
+
#controls button:focus-visible,#info button:focus-visible{outline:2px solid var(--accent);outline-offset:1px}
|
|
198
|
+
#controls svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1;stroke-linecap:round;stroke-linejoin:round}
|
|
199
|
+
#info{position:absolute;top:12px;right:12px;width:320px;max-width:calc(100% - 24px);max-height:calc(100vh - 128px);overflow:auto;padding:12px;background:var(--surface);border:1px solid var(--border);border-radius:10px;box-shadow:0 4px 16px rgba(0,0,0,.12)}
|
|
200
|
+
#info[hidden]{display:none}
|
|
201
|
+
#info h2{margin:0 24px 0 0;font-size:13px;line-height:20px;font-weight:600}
|
|
202
|
+
#info .kind{margin:0 0 8px;font-size:11px;letter-spacing:.04em;text-transform:uppercase;color:var(--muted)}
|
|
203
|
+
#info p{margin:0;white-space:pre-wrap;overflow-wrap:anywhere}
|
|
204
|
+
#info .none{color:var(--muted)}
|
|
205
|
+
#info button{position:absolute;top:8px;right:8px;width:28px;height:28px;padding:0;background:transparent;color:var(--muted);border:0;border-radius:6px;cursor:pointer}
|
|
206
|
+
#info button:hover{background:var(--hover);color:var(--fg)}
|
|
207
|
+
.document{flex:1;overflow:auto;padding:16px}
|
|
208
|
+
.document section{max-width:1100px;margin:0 auto 24px}
|
|
209
|
+
.document h2{margin:0 0 4px;font-size:11px;line-height:20px;letter-spacing:.04em;text-transform:uppercase;color:var(--muted);font-weight:600}
|
|
210
|
+
.document h2.name{font-size:13px;letter-spacing:0;text-transform:none;color:var(--fg)}
|
|
211
|
+
.document p{margin:0 0 8px}
|
|
212
|
+
.document .note{color:var(--muted);font-size:12px}
|
|
213
|
+
.document table{border-collapse:collapse;width:100%}
|
|
214
|
+
.document th,.document td{padding:4px 8px;text-align:left;vertical-align:top;overflow-wrap:anywhere}
|
|
215
|
+
.document th{color:var(--muted);font-weight:600;font-size:12px;border-bottom:1px solid var(--border)}
|
|
216
|
+
.document tbody tr:hover{background:var(--hover)}
|
|
217
|
+
${n.kind===`bpmn`?`
|
|
218
|
+
.bjs-powered-by{position:fixed;bottom:12px;right:12px;z-index:1000;color:var(--muted);line-height:0}
|
|
219
|
+
.bjs-powered-by:hover{color:var(--fg)}
|
|
220
|
+
.bjs-powered-by svg{display:block}
|
|
221
|
+
`:``}</style>`,a=`<footer>${s(e(`app.share.madeWith`))}</footer>`;if(n.kind===`bpmn`){let o=n.subtitle??e(`app.share.clickAnElement`);return`<!doctype html>
|
|
222
|
+
<html lang="${t()}"><head>${i}</head>
|
|
223
|
+
<body>
|
|
224
|
+
<header><h1>${r}</h1><p class="hint">${s(o)}</p></header>
|
|
225
|
+
<main><div id="canvas" tabindex="0">${D(n.svg)}</div>${j()}<aside id="info" role="region" aria-live="polite" aria-label="${s(e(`app.share.elementDocumentation`))}" hidden></aside></main>
|
|
226
|
+
${a}
|
|
227
|
+
<a class="bjs-powered-by" href="https://bpmn.io" target="_blank" rel="noopener" title="Powered by bpmn.io" aria-label="Powered by bpmn.io">${v}</a>
|
|
228
|
+
<script type="application/json" id="docs">${O(n.docs)}<\/script>
|
|
229
|
+
<script>${y()}<\/script>
|
|
230
|
+
</body></html>
|
|
231
|
+
`}let o=n.sections.filter(e=>e.rows.length>0),c=o.length>1;return`<!doctype html>
|
|
232
|
+
<html lang="${t()}"><head>${i}</head>
|
|
233
|
+
<body>
|
|
234
|
+
<header><h1>${r}</h1>${n.subtitle?`<p class="hint">${s(n.subtitle)}</p>`:``}</header>
|
|
235
|
+
<div class="document">${o.map(e=>A(e,c)).join(`
|
|
236
|
+
`)}</div>
|
|
237
|
+
${a}
|
|
238
|
+
</body></html>
|
|
239
|
+
`}function N(e,t,n){return M({kind:`bpmn`,title:E(e,n),svg:t,docs:T(e)})}async function P(t,n){let{rootElement:r}=await a(t),o=i(r.drgElement??[]);return M({kind:`sections`,title:r.name?.trim()||n,subtitle:e(`app.toolWindow.section.decisions`),sections:o})}function F(t,r){let i=JSON.parse(t);return M({kind:`sections`,title:r,subtitle:e(`app.sections.form`),sections:[l(n(i.components??[],[]))]})}const I=/\.(bpmn(\.xml|20\.xml)?|dmn|form)$/i;async function L(t,n){if(!t)return{ok:!1,lines:[e(`app.cli.share.needsDiagram`)]};let r=/\.dmn$/i.test(t)?`dmn`:/\.form$/i.test(t)?`form`:/\.bpmn(\.xml|20\.xml)?$/i.test(t)?`bpmn`:null;if(!r)return{ok:!1,lines:[e(`app.cli.share.notADiagram`,{file:d(t)})]};let i=m.basename(t).replace(I,``),a;try{let e=g(t,`utf8`);a=r===`bpmn`?N(e,(await f(e)).svg,i):r===`dmn`?await P(e,i):F(e,i)}catch(n){return{ok:!1,lines:[u(d(t),n),e(`app.cli.nothingWritten`)]}}let o=m.resolve(n??m.join(m.dirname(t),`${i}.html`));try{h(m.dirname(o),{recursive:!0}),_(o,a)}catch(t){return{ok:!1,lines:[p(t,o),e(`app.cli.nothingWritten`)]}}return{ok:!0,lines:[e(`app.cli.wrote`,{file:d(o)}),e(`app.cli.share.offline`)]}}export{L as shareCommand};
|