@miragon/dmn-modeler 0.7.0 → 0.9.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.
- package/CHANGELOG.md +30 -0
- package/README.md +29 -136
- package/dist/darkTheme.css +1 -1
- package/dist/dmn-modeler.css +1 -1
- package/dist/index.d.ts +168 -0
- package/dist/index.js +541 -97
- package/dist/lightTheme.css +1 -1
- package/package.json +13 -11
package/dist/index.js
CHANGED
|
@@ -4,12 +4,15 @@ import r from "dmn-js/lib/Modeler";
|
|
|
4
4
|
import { CamundaPropertiesProviderModule as i, DmnPropertiesPanelModule as a, DmnPropertiesProviderModule as o } from "dmn-js-properties-panel";
|
|
5
5
|
import s from "@emaarco/dmn-js-simulation";
|
|
6
6
|
import c from "camunda-dmn-moddle/resources/camunda.json";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
import l from "dmn-js/lib/Viewer";
|
|
8
|
+
import u from "diagram-js/lib/navigation/movecanvas";
|
|
9
|
+
import d from "diagram-js/lib/navigation/zoomscroll";
|
|
10
|
+
// ../../libs/bpmn-i18n-extras/src/languages/index.ts
|
|
11
|
+
var f = {
|
|
10
12
|
de: {
|
|
11
13
|
"The linked form is missing or invalid. Check the form reference.": "Das verknüpfte Formular fehlt oder ist ungültig. Prüfen Sie den Formularverweis.",
|
|
12
14
|
"Preview linked form": "Verknüpftes Formular vorschauen",
|
|
15
|
+
"Fit diagram to view": "Diagramm einpassen",
|
|
13
16
|
"Linked form preview": "Vorschau des verknüpften Formulars",
|
|
14
17
|
Refresh: "Aktualisieren",
|
|
15
18
|
"Close form preview": "Formularvorschau schließen",
|
|
@@ -22,6 +25,10 @@ var l = {
|
|
|
22
25
|
"The host did not answer. Refresh to try again.": "Der Host hat nicht geantwortet. Aktualisieren Sie die Vorschau.",
|
|
23
26
|
"The saved form is invalid or unsupported. Open it in the form editor.": "Das gespeicherte Formular ist ungültig oder wird nicht unterstützt. Öffnen Sie es im Formulareditor.",
|
|
24
27
|
"The form preview could not be loaded. Refresh to try again.": "Die Formularvorschau konnte nicht geladen werden. Aktualisieren Sie die Vorschau.",
|
|
28
|
+
Changes: "Änderungen",
|
|
29
|
+
"Not in this version": "Nicht in dieser Version",
|
|
30
|
+
"It was removed. The version on the left shows it.": "Es wurde entfernt. Die Version links zeigt es.",
|
|
31
|
+
"It is new. The version on the right shows it.": "Es ist neu. Die Version rechts zeigt es.",
|
|
25
32
|
"A form is either a form id or an external reference, not both.": "Ein Formular ist entweder eine Formular-ID oder eine externe Referenz, nicht beides.",
|
|
26
33
|
"A property cannot depend on itself.": "Eine Eigenschaft kann nicht von sich selbst abhängen.",
|
|
27
34
|
"A regular expression the value must match.": "Ein regulärer Ausdruck, dem der Wert entsprechen muss.",
|
|
@@ -233,6 +240,7 @@ var l = {
|
|
|
233
240
|
en: {
|
|
234
241
|
"The linked form is missing or invalid. Check the form reference.": "The linked form is missing or invalid. Check the form reference.",
|
|
235
242
|
"Preview linked form": "Preview linked form",
|
|
243
|
+
"Fit diagram to view": "Fit diagram to view",
|
|
236
244
|
"Linked form preview": "Linked form preview",
|
|
237
245
|
Refresh: "Refresh",
|
|
238
246
|
"Close form preview": "Close form preview",
|
|
@@ -245,6 +253,10 @@ var l = {
|
|
|
245
253
|
"The host did not answer. Refresh to try again.": "The host did not answer. Refresh to try again.",
|
|
246
254
|
"The saved form is invalid or unsupported. Open it in the form editor.": "The saved form is invalid or unsupported. Open it in the form editor.",
|
|
247
255
|
"The form preview could not be loaded. Refresh to try again.": "The form preview could not be loaded. Refresh to try again.",
|
|
256
|
+
Changes: "Changes",
|
|
257
|
+
"Not in this version": "Not in this version",
|
|
258
|
+
"It was removed. The version on the left shows it.": "It was removed. The version on the left shows it.",
|
|
259
|
+
"It is new. The version on the right shows it.": "It is new. The version on the right shows it.",
|
|
248
260
|
"A form is either a form id or an external reference, not both.": "A form is either a form id or an external reference, not both.",
|
|
249
261
|
"A property cannot depend on itself.": "A property cannot depend on itself.",
|
|
250
262
|
"A regular expression the value must match.": "A regular expression the value must match.",
|
|
@@ -456,6 +468,7 @@ var l = {
|
|
|
456
468
|
es: {
|
|
457
469
|
"The linked form is missing or invalid. Check the form reference.": "El formulario vinculado no existe o no es válido. Compruebe la referencia al formulario.",
|
|
458
470
|
"Preview linked form": "Previsualizar formulario vinculado",
|
|
471
|
+
"Fit diagram to view": "Ajustar el diagrama a la vista",
|
|
459
472
|
"Linked form preview": "Vista previa del formulario vinculado",
|
|
460
473
|
Refresh: "Actualizar",
|
|
461
474
|
"Close form preview": "Cerrar vista previa del formulario",
|
|
@@ -468,6 +481,10 @@ var l = {
|
|
|
468
481
|
"The host did not answer. Refresh to try again.": "El host no respondió. Actualice para reintentar.",
|
|
469
482
|
"The saved form is invalid or unsupported. Open it in the form editor.": "El formulario guardado no es válido o no es compatible. Ábralo en el editor de formularios.",
|
|
470
483
|
"The form preview could not be loaded. Refresh to try again.": "No se pudo cargar la vista previa. Actualice para reintentar.",
|
|
484
|
+
Changes: "Cambios",
|
|
485
|
+
"Not in this version": "No está en esta versión",
|
|
486
|
+
"It was removed. The version on the left shows it.": "Se eliminó. La versión de la izquierda lo muestra.",
|
|
487
|
+
"It is new. The version on the right shows it.": "Es nuevo. La versión de la derecha lo muestra.",
|
|
471
488
|
"A form is either a form id or an external reference, not both.": "Un formulario usa un ID de formulario o una referencia externa, no ambos.",
|
|
472
489
|
"A property cannot depend on itself.": "Una propiedad no puede depender de sí misma.",
|
|
473
490
|
"A regular expression the value must match.": "Una expresión regular con la que debe coincidir el valor.",
|
|
@@ -679,6 +696,7 @@ var l = {
|
|
|
679
696
|
fr: {
|
|
680
697
|
"The linked form is missing or invalid. Check the form reference.": "Le formulaire lié est introuvable ou invalide. Vérifiez la référence au formulaire.",
|
|
681
698
|
"Preview linked form": "Prévisualiser le formulaire lié",
|
|
699
|
+
"Fit diagram to view": "Ajuster le diagramme à la vue",
|
|
682
700
|
"Linked form preview": "Aperçu du formulaire lié",
|
|
683
701
|
Refresh: "Actualiser",
|
|
684
702
|
"Close form preview": "Fermer l’aperçu du formulaire",
|
|
@@ -691,6 +709,10 @@ var l = {
|
|
|
691
709
|
"The host did not answer. Refresh to try again.": "L’hôte n’a pas répondu. Actualisez pour réessayer.",
|
|
692
710
|
"The saved form is invalid or unsupported. Open it in the form editor.": "Le formulaire enregistré est invalide ou non pris en charge. Ouvrez-le dans l’éditeur de formulaires.",
|
|
693
711
|
"The form preview could not be loaded. Refresh to try again.": "Impossible de charger l’aperçu du formulaire. Actualisez pour réessayer.",
|
|
712
|
+
Changes: "Modifications",
|
|
713
|
+
"Not in this version": "Absent de cette version",
|
|
714
|
+
"It was removed. The version on the left shows it.": "Il a été supprimé. La version de gauche l'affiche.",
|
|
715
|
+
"It is new. The version on the right shows it.": "Il est nouveau. La version de droite l'affiche.",
|
|
694
716
|
"A form is either a form id or an external reference, not both.": "Un formulaire est soit un ID de formulaire, soit une référence externe, pas les deux.",
|
|
695
717
|
"A property cannot depend on itself.": "Une propriété ne peut pas dépendre d'elle-même.",
|
|
696
718
|
"A regular expression the value must match.": "Une expression régulière à laquelle la valeur doit correspondre.",
|
|
@@ -902,6 +924,7 @@ var l = {
|
|
|
902
924
|
it: {
|
|
903
925
|
"The linked form is missing or invalid. Check the form reference.": "Il modulo collegato è mancante o non valido. Controllare il riferimento al modulo.",
|
|
904
926
|
"Preview linked form": "Visualizza anteprima del modulo collegato",
|
|
927
|
+
"Fit diagram to view": "Adatta il diagramma alla vista",
|
|
905
928
|
"Linked form preview": "Anteprima del modulo collegato",
|
|
906
929
|
Refresh: "Aggiorna",
|
|
907
930
|
"Close form preview": "Chiudi anteprima del modulo",
|
|
@@ -914,6 +937,10 @@ var l = {
|
|
|
914
937
|
"The host did not answer. Refresh to try again.": "L’host non ha risposto. Aggiorna per riprovare.",
|
|
915
938
|
"The saved form is invalid or unsupported. Open it in the form editor.": "Il modulo salvato non è valido o supportato. Aprilo nell’editor di moduli.",
|
|
916
939
|
"The form preview could not be loaded. Refresh to try again.": "Impossibile caricare l’anteprima del modulo. Aggiorna per riprovare.",
|
|
940
|
+
Changes: "Modifiche",
|
|
941
|
+
"Not in this version": "Non presente in questa versione",
|
|
942
|
+
"It was removed. The version on the left shows it.": "È stato rimosso. La versione a sinistra lo mostra.",
|
|
943
|
+
"It is new. The version on the right shows it.": "È nuovo. La versione a destra lo mostra.",
|
|
917
944
|
"A form is either a form id or an external reference, not both.": "Un modulo usa un ID modulo o un riferimento esterno, non entrambi.",
|
|
918
945
|
"A property cannot depend on itself.": "Una proprietà non può dipendere da sé stessa.",
|
|
919
946
|
"A regular expression the value must match.": "Un'espressione regolare a cui il valore deve corrispondere.",
|
|
@@ -1125,6 +1152,7 @@ var l = {
|
|
|
1125
1152
|
ja: {
|
|
1126
1153
|
"The linked form is missing or invalid. Check the form reference.": "リンクされたフォームが見つからないか無効です。フォームの参照を確認してください。",
|
|
1127
1154
|
"Preview linked form": "リンクされたフォームをプレビュー",
|
|
1155
|
+
"Fit diagram to view": "ダイアグラムを画面に合わせる",
|
|
1128
1156
|
"Linked form preview": "リンクされたフォームのプレビュー",
|
|
1129
1157
|
Refresh: "更新",
|
|
1130
1158
|
"Close form preview": "フォームのプレビューを閉じる",
|
|
@@ -1137,6 +1165,10 @@ var l = {
|
|
|
1137
1165
|
"The host did not answer. Refresh to try again.": "ホストから応答がありませんでした。更新して再試行してください。",
|
|
1138
1166
|
"The saved form is invalid or unsupported. Open it in the form editor.": "保存済みフォームが無効か未対応です。フォームエディターで開いてください。",
|
|
1139
1167
|
"The form preview could not be loaded. Refresh to try again.": "フォームのプレビューを読み込めませんでした。更新して再試行してください。",
|
|
1168
|
+
Changes: "変更",
|
|
1169
|
+
"Not in this version": "このバージョンにはありません",
|
|
1170
|
+
"It was removed. The version on the left shows it.": "削除されました。左側のバージョンに表示されています。",
|
|
1171
|
+
"It is new. The version on the right shows it.": "新しく追加されました。右側のバージョンに表示されています。",
|
|
1140
1172
|
"A form is either a form id or an external reference, not both.": "フォームに指定できるのは、フォーム ID か外部参照のどちらか一方だけです。",
|
|
1141
1173
|
"A property cannot depend on itself.": "プロパティは自分自身に依存できません。",
|
|
1142
1174
|
"A regular expression the value must match.": "値が一致する必要がある正規表現です。",
|
|
@@ -1348,6 +1380,7 @@ var l = {
|
|
|
1348
1380
|
ko: {
|
|
1349
1381
|
"The linked form is missing or invalid. Check the form reference.": "연결된 양식이 없거나 유효하지 않습니다. 양식 참조를 확인하세요.",
|
|
1350
1382
|
"Preview linked form": "연결된 양식 미리보기",
|
|
1383
|
+
"Fit diagram to view": "다이어그램을 화면에 맞추기",
|
|
1351
1384
|
"Linked form preview": "연결된 양식 미리보기",
|
|
1352
1385
|
Refresh: "새로 고침",
|
|
1353
1386
|
"Close form preview": "양식 미리보기 닫기",
|
|
@@ -1360,6 +1393,10 @@ var l = {
|
|
|
1360
1393
|
"The host did not answer. Refresh to try again.": "호스트가 응답하지 않았습니다. 새로 고침하여 다시 시도하세요.",
|
|
1361
1394
|
"The saved form is invalid or unsupported. Open it in the form editor.": "저장된 양식이 유효하지 않거나 지원되지 않습니다. 양식 편집기에서 여세요.",
|
|
1362
1395
|
"The form preview could not be loaded. Refresh to try again.": "양식 미리보기를 불러올 수 없습니다. 새로 고침하여 다시 시도하세요.",
|
|
1396
|
+
Changes: "변경 사항",
|
|
1397
|
+
"Not in this version": "이 버전에 없음",
|
|
1398
|
+
"It was removed. The version on the left shows it.": "제거되었습니다. 왼쪽 버전에 표시됩니다.",
|
|
1399
|
+
"It is new. The version on the right shows it.": "새로 추가되었습니다. 오른쪽 버전에 표시됩니다.",
|
|
1363
1400
|
"A form is either a form id or an external reference, not both.": "양식에는 양식 ID와 외부 참조 중 하나만 지정할 수 있습니다.",
|
|
1364
1401
|
"A property cannot depend on itself.": "속성은 자기 자신에 종속될 수 없습니다.",
|
|
1365
1402
|
"A regular expression the value must match.": "값이 일치해야 하는 정규식입니다.",
|
|
@@ -1571,6 +1608,7 @@ var l = {
|
|
|
1571
1608
|
"nl-nl": {
|
|
1572
1609
|
"The linked form is missing or invalid. Check the form reference.": "Het gekoppelde formulier ontbreekt of is ongeldig. Controleer de formulierverwijzing.",
|
|
1573
1610
|
"Preview linked form": "Gekoppeld formulier bekijken",
|
|
1611
|
+
"Fit diagram to view": "Diagram passend maken",
|
|
1574
1612
|
"Linked form preview": "Voorbeeld van gekoppeld formulier",
|
|
1575
1613
|
Refresh: "Vernieuwen",
|
|
1576
1614
|
"Close form preview": "Formuliervoorbeeld sluiten",
|
|
@@ -1583,6 +1621,10 @@ var l = {
|
|
|
1583
1621
|
"The host did not answer. Refresh to try again.": "De host heeft niet geantwoord. Vernieuw om opnieuw te proberen.",
|
|
1584
1622
|
"The saved form is invalid or unsupported. Open it in the form editor.": "Het opgeslagen formulier is ongeldig of niet ondersteund. Open het in de formuliereditor.",
|
|
1585
1623
|
"The form preview could not be loaded. Refresh to try again.": "Het formuliervoorbeeld kon niet worden geladen. Vernieuw om opnieuw te proberen.",
|
|
1624
|
+
Changes: "Wijzigingen",
|
|
1625
|
+
"Not in this version": "Niet in deze versie",
|
|
1626
|
+
"It was removed. The version on the left shows it.": "Het is verwijderd. De versie links toont het.",
|
|
1627
|
+
"It is new. The version on the right shows it.": "Het is nieuw. De versie rechts toont het.",
|
|
1586
1628
|
"A form is either a form id or an external reference, not both.": "Een formulier is óf een form-ID óf een externe referentie, niet allebei.",
|
|
1587
1629
|
"A property cannot depend on itself.": "Een eigenschap kan niet van zichzelf afhangen.",
|
|
1588
1630
|
"A regular expression the value must match.": "Een reguliere expressie waaraan de waarde moet voldoen.",
|
|
@@ -1794,6 +1836,7 @@ var l = {
|
|
|
1794
1836
|
"pt-br": {
|
|
1795
1837
|
"The linked form is missing or invalid. Check the form reference.": "O formulário vinculado está ausente ou é inválido. Verifique a referência ao formulário.",
|
|
1796
1838
|
"Preview linked form": "Visualizar formulário vinculado",
|
|
1839
|
+
"Fit diagram to view": "Ajustar o diagrama à visualização",
|
|
1797
1840
|
"Linked form preview": "Prévia do formulário vinculado",
|
|
1798
1841
|
Refresh: "Atualizar",
|
|
1799
1842
|
"Close form preview": "Fechar prévia do formulário",
|
|
@@ -1806,6 +1849,10 @@ var l = {
|
|
|
1806
1849
|
"The host did not answer. Refresh to try again.": "O host não respondeu. Atualize para tentar novamente.",
|
|
1807
1850
|
"The saved form is invalid or unsupported. Open it in the form editor.": "O formulário salvo é inválido ou não suportado. Abra-o no editor de formulários.",
|
|
1808
1851
|
"The form preview could not be loaded. Refresh to try again.": "Não foi possível carregar a prévia do formulário. Atualize para tentar novamente.",
|
|
1852
|
+
Changes: "Alterações",
|
|
1853
|
+
"Not in this version": "Não está nesta versão",
|
|
1854
|
+
"It was removed. The version on the left shows it.": "Foi removido. A versão à esquerda o mostra.",
|
|
1855
|
+
"It is new. The version on the right shows it.": "É novo. A versão à direita o mostra.",
|
|
1809
1856
|
"A form is either a form id or an external reference, not both.": "Um formulário usa um ID de formulário ou uma referência externa, não ambos.",
|
|
1810
1857
|
"A property cannot depend on itself.": "Uma propriedade não pode depender de si mesma.",
|
|
1811
1858
|
"A regular expression the value must match.": "Uma expressão regular à qual o valor deve corresponder.",
|
|
@@ -2017,6 +2064,7 @@ var l = {
|
|
|
2017
2064
|
ru: {
|
|
2018
2065
|
"The linked form is missing or invalid. Check the form reference.": "Связанная форма отсутствует или недействительна. Проверьте ссылку на форму.",
|
|
2019
2066
|
"Preview linked form": "Просмотреть связанную форму",
|
|
2067
|
+
"Fit diagram to view": "Вписать диаграмму в окно",
|
|
2020
2068
|
"Linked form preview": "Предпросмотр связанной формы",
|
|
2021
2069
|
Refresh: "Обновить",
|
|
2022
2070
|
"Close form preview": "Закрыть предпросмотр формы",
|
|
@@ -2029,6 +2077,10 @@ var l = {
|
|
|
2029
2077
|
"The host did not answer. Refresh to try again.": "Хост не ответил. Обновите для повторной попытки.",
|
|
2030
2078
|
"The saved form is invalid or unsupported. Open it in the form editor.": "Сохранённая форма недопустима или не поддерживается. Откройте её в редакторе форм.",
|
|
2031
2079
|
"The form preview could not be loaded. Refresh to try again.": "Не удалось загрузить предпросмотр формы. Обновите для повторной попытки.",
|
|
2080
|
+
Changes: "Изменения",
|
|
2081
|
+
"Not in this version": "Нет в этой версии",
|
|
2082
|
+
"It was removed. The version on the left shows it.": "Элемент удалён. Он показан в версии слева.",
|
|
2083
|
+
"It is new. The version on the right shows it.": "Элемент новый. Он показан в версии справа.",
|
|
2032
2084
|
"A form is either a form id or an external reference, not both.": "Форма задаётся либо ID формы, либо внешней ссылкой, но не обоими сразу.",
|
|
2033
2085
|
"A property cannot depend on itself.": "Свойство не может зависеть от самого себя.",
|
|
2034
2086
|
"A regular expression the value must match.": "Регулярное выражение, которому должно соответствовать значение.",
|
|
@@ -2240,6 +2292,7 @@ var l = {
|
|
|
2240
2292
|
"zh-Hans": {
|
|
2241
2293
|
"The linked form is missing or invalid. Check the form reference.": "关联的表单不存在或无效。请检查表单引用。",
|
|
2242
2294
|
"Preview linked form": "预览关联表单",
|
|
2295
|
+
"Fit diagram to view": "使图表适合视图",
|
|
2243
2296
|
"Linked form preview": "关联表单预览",
|
|
2244
2297
|
Refresh: "刷新",
|
|
2245
2298
|
"Close form preview": "关闭表单预览",
|
|
@@ -2252,6 +2305,10 @@ var l = {
|
|
|
2252
2305
|
"The host did not answer. Refresh to try again.": "主机未响应。请刷新重试。",
|
|
2253
2306
|
"The saved form is invalid or unsupported. Open it in the form editor.": "已保存的表单无效或不受支持。请在表单编辑器中打开。",
|
|
2254
2307
|
"The form preview could not be loaded. Refresh to try again.": "无法加载表单预览。请刷新重试。",
|
|
2308
|
+
Changes: "更改",
|
|
2309
|
+
"Not in this version": "此版本中不存在",
|
|
2310
|
+
"It was removed. The version on the left shows it.": "它已被删除。左侧版本中可以看到它。",
|
|
2311
|
+
"It is new. The version on the right shows it.": "它是新增的。右侧版本中可以看到它。",
|
|
2255
2312
|
"A form is either a form id or an external reference, not both.": "表单只能使用表单 ID 或外部引用之一,不能同时使用两者。",
|
|
2256
2313
|
"A property cannot depend on itself.": "属性不能依赖自身。",
|
|
2257
2314
|
"A regular expression the value must match.": "值必须匹配的正则表达式。",
|
|
@@ -2463,6 +2520,7 @@ var l = {
|
|
|
2463
2520
|
"zh-Hant": {
|
|
2464
2521
|
"The linked form is missing or invalid. Check the form reference.": "連結的表單不存在或無效。請檢查表單參照。",
|
|
2465
2522
|
"Preview linked form": "預覽關聯表單",
|
|
2523
|
+
"Fit diagram to view": "使圖表適合檢視",
|
|
2466
2524
|
"Linked form preview": "關聯表單預覽",
|
|
2467
2525
|
Refresh: "重新整理",
|
|
2468
2526
|
"Close form preview": "關閉表單預覽",
|
|
@@ -2475,6 +2533,10 @@ var l = {
|
|
|
2475
2533
|
"The host did not answer. Refresh to try again.": "主機未回應。請重新整理後再試。",
|
|
2476
2534
|
"The saved form is invalid or unsupported. Open it in the form editor.": "已儲存的表單無效或不受支援。請在表單編輯器中開啟。",
|
|
2477
2535
|
"The form preview could not be loaded. Refresh to try again.": "無法載入表單預覽。請重新整理後再試。",
|
|
2536
|
+
Changes: "變更",
|
|
2537
|
+
"Not in this version": "此版本中不存在",
|
|
2538
|
+
"It was removed. The version on the left shows it.": "它已被刪除。左側版本中可以看到它。",
|
|
2539
|
+
"It is new. The version on the right shows it.": "它是新增的。右側版本中可以看到它。",
|
|
2478
2540
|
"A form is either a form id or an external reference, not both.": "表單只能使用表單 ID 或外部引用之一,不能同時使用兩者。",
|
|
2479
2541
|
"A property cannot depend on itself.": "屬性不能依賴自身。",
|
|
2480
2542
|
"A regular expression the value must match.": "值必須符合的正規表達式。",
|
|
@@ -2683,8 +2745,8 @@ var l = {
|
|
|
2683
2745
|
"Use the task definition": "使用工作定義",
|
|
2684
2746
|
"Users cannot enter FEEL into a field they cannot edit.": "使用者無法在不可編輯的欄位中輸入 FEEL。"
|
|
2685
2747
|
}
|
|
2686
|
-
},
|
|
2687
|
-
function
|
|
2748
|
+
}, ee = 10;
|
|
2749
|
+
function p(e) {
|
|
2688
2750
|
let t = /* @__PURE__ */ new Set();
|
|
2689
2751
|
function r(r) {
|
|
2690
2752
|
let i = n((...e) => {
|
|
@@ -2705,7 +2767,7 @@ function d(e) {
|
|
|
2705
2767
|
hasPending: () => t.size > 0,
|
|
2706
2768
|
flush: () => {
|
|
2707
2769
|
let e = [];
|
|
2708
|
-
for (let n = 0; n <
|
|
2770
|
+
for (let n = 0; n < ee && t.size > 0; n++) for (let n of [...t]) try {
|
|
2709
2771
|
n.flush();
|
|
2710
2772
|
} catch (t) {
|
|
2711
2773
|
e.push(t);
|
|
@@ -2714,30 +2776,49 @@ function d(e) {
|
|
|
2714
2776
|
}
|
|
2715
2777
|
});
|
|
2716
2778
|
}
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2779
|
+
// ../../libs/modeler-types/src/diffVocabulary.ts
|
|
2780
|
+
var m = [
|
|
2781
|
+
"added",
|
|
2782
|
+
"removed",
|
|
2783
|
+
"changed",
|
|
2784
|
+
"layoutChanged"
|
|
2785
|
+
], h = {
|
|
2786
|
+
added: "diff-added",
|
|
2787
|
+
removed: "diff-removed",
|
|
2788
|
+
changed: "diff-changed",
|
|
2789
|
+
layoutChanged: "diff-layout-changed"
|
|
2790
|
+
}, g = "diff-selected", _ = {
|
|
2791
|
+
changes: "Changes",
|
|
2792
|
+
added: "Added",
|
|
2793
|
+
removed: "Removed",
|
|
2794
|
+
changed: "Changed",
|
|
2795
|
+
moved: "Moved",
|
|
2796
|
+
previous: "Prev change",
|
|
2797
|
+
next: "Next change",
|
|
2798
|
+
swap: "Swap sides"
|
|
2799
|
+
};
|
|
2800
|
+
_.added, _.removed, _.changed, _.moved;
|
|
2801
|
+
// ../../libs/modeler-types/src/errors.ts
|
|
2802
|
+
var v = class extends Error {
|
|
2720
2803
|
constructor() {
|
|
2721
2804
|
super("Modeler is not initialized!");
|
|
2722
2805
|
}
|
|
2723
2806
|
};
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
let r = n.createObserver ?? m();
|
|
2807
|
+
// ../../libs/modeler-types/src/canvasResize.ts
|
|
2808
|
+
function y(e, t, n = {}) {
|
|
2809
|
+
let r = n.createObserver ?? te();
|
|
2728
2810
|
if (!r) return () => void 0;
|
|
2729
2811
|
let i = n.applyInitialViewport === void 0, a = r(() => {
|
|
2730
2812
|
e.resized(), i ||= n.applyInitialViewport();
|
|
2731
2813
|
});
|
|
2732
2814
|
return a.observe(t), () => a.disconnect();
|
|
2733
2815
|
}
|
|
2734
|
-
function
|
|
2816
|
+
function te() {
|
|
2735
2817
|
let e = globalThis.ResizeObserver;
|
|
2736
2818
|
return e ? (t) => new e(t) : void 0;
|
|
2737
2819
|
}
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
var h = class {
|
|
2820
|
+
// ../../libs/modeler-types/src/disposableStore.ts
|
|
2821
|
+
var b = class {
|
|
2741
2822
|
constructor() {
|
|
2742
2823
|
this.disposers = [], this.disposed = !1;
|
|
2743
2824
|
}
|
|
@@ -2759,7 +2840,7 @@ var h = class {
|
|
|
2759
2840
|
}
|
|
2760
2841
|
if (n) throw t;
|
|
2761
2842
|
}
|
|
2762
|
-
},
|
|
2843
|
+
}, x = class {
|
|
2763
2844
|
constructor() {
|
|
2764
2845
|
this.disposed = !1;
|
|
2765
2846
|
}
|
|
@@ -2772,22 +2853,44 @@ var h = class {
|
|
|
2772
2853
|
let e = this.current;
|
|
2773
2854
|
this.current = void 0, e?.();
|
|
2774
2855
|
}
|
|
2775
|
-
},
|
|
2776
|
-
function
|
|
2777
|
-
let t =
|
|
2778
|
-
t.
|
|
2779
|
-
let n = e.isFocused(), r = e.hasSelection(), i = () => {
|
|
2780
|
-
t.classList.toggle("is-focused", n && !r);
|
|
2781
|
-
};
|
|
2782
|
-
return i(), e.onFocusChanged((e) => {
|
|
2783
|
-
n = e, i();
|
|
2784
|
-
}), e.onSelectionChanged((e) => {
|
|
2785
|
-
r = e, i();
|
|
2786
|
-
}), e.parent.append(t), () => t.remove();
|
|
2856
|
+
}, S = 40, C = 30;
|
|
2857
|
+
function w(e) {
|
|
2858
|
+
let { outer: t } = e.viewbox();
|
|
2859
|
+
return t.width >= 40 && t.height >= 40;
|
|
2787
2860
|
}
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2861
|
+
function T(e) {
|
|
2862
|
+
if (!w(e)) return !1;
|
|
2863
|
+
let { inner: t, outer: n } = e.viewbox();
|
|
2864
|
+
if (!t.width || !t.height) return e.zoom("fit-viewport"), !0;
|
|
2865
|
+
let r = n.width / 4, i = n.height / 4, a = {
|
|
2866
|
+
top: Math.min(S, i),
|
|
2867
|
+
right: Math.min(S, r),
|
|
2868
|
+
bottom: Math.min(S, i),
|
|
2869
|
+
left: Math.min(E(e.getContainer()) + S, r)
|
|
2870
|
+
}, o = n.width - a.left - a.right, s = n.height - a.top - a.bottom, c = Math.min(1, o / t.width, s / t.height), l = a.left + (o - t.width * c) / 2, u = a.top + (s - t.height * c) / 2;
|
|
2871
|
+
return e.viewbox({
|
|
2872
|
+
x: t.x - l / c,
|
|
2873
|
+
y: t.y - u / c,
|
|
2874
|
+
width: n.width / c,
|
|
2875
|
+
height: n.height / c
|
|
2876
|
+
}), !0;
|
|
2877
|
+
}
|
|
2878
|
+
function E(e) {
|
|
2879
|
+
let t = e.querySelector(".djs-palette");
|
|
2880
|
+
return t ? t.getBoundingClientRect().right - e.getBoundingClientRect().left : C;
|
|
2881
|
+
}
|
|
2882
|
+
// ../../libs/modeler-types/src/fitViewportButton.ts
|
|
2883
|
+
var D = "<svg viewBox=\"0 -960 960 960\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M800-600v-120H680v-80h120q33 0 56.5 23.5T880-720v120h-80Zm-720 0v-120q0-33 23.5-56.5T160-800h120v80H160v120H80Zm600 440v-80h120v-120h80v120q0 33-23.5 56.5T800-160H680Zm-520 0q-33 0-56.5-23.5T80-240v-120h80v120h120v80H160Zm80-160v-320h480v320H240Zm80-80h320v-160H320v160Zm0 0v-160 160Z\"/></svg>";
|
|
2884
|
+
function O({ parent: e, label: t, fit: n, focusCanvas: r, isCanvasFocused: i, onCanvasFocusChanged: a }) {
|
|
2885
|
+
let o = document.createElement("button");
|
|
2886
|
+
return o.type = "button", o.className = "fit-viewport-button", o.title = t, o.setAttribute("aria-label", t), o.innerHTML = D, o.addEventListener("click", (e) => {
|
|
2887
|
+
n(), e.detail > 0 && r();
|
|
2888
|
+
}), o.toggleAttribute("data-canvas-focused", i()), a((e) => {
|
|
2889
|
+
o.toggleAttribute("data-canvas-focused", e);
|
|
2890
|
+
}), e.append(o), () => o.remove();
|
|
2891
|
+
}
|
|
2892
|
+
// ../../libs/modeler-types/src/surfaceTheme.ts
|
|
2893
|
+
var k = class {
|
|
2791
2894
|
constructor(e, t) {
|
|
2792
2895
|
this.scopeRoots = e, this.attribute = t, this.disposed = !1;
|
|
2793
2896
|
}
|
|
@@ -2800,11 +2903,11 @@ var b = class {
|
|
|
2800
2903
|
}
|
|
2801
2904
|
apply(e) {
|
|
2802
2905
|
for (let t of this.scopeRoots) t.setAttribute(this.attribute, e);
|
|
2803
|
-
|
|
2906
|
+
ne(e);
|
|
2804
2907
|
}
|
|
2805
2908
|
startFollowingPreferredScheme() {
|
|
2806
2909
|
let e = window.matchMedia("(prefers-color-scheme: dark)");
|
|
2807
|
-
this.apply(e.matches ? "dark" : "light"),
|
|
2910
|
+
this.apply(e.matches ? "dark" : "light"), this.mediaListener || (this.mediaQuery = e, this.mediaListener = (e) => {
|
|
2808
2911
|
this.mode === "automatic" && this.apply(e.matches ? "dark" : "light");
|
|
2809
2912
|
}, this.mediaQuery.addEventListener("change", this.mediaListener));
|
|
2810
2913
|
}
|
|
@@ -2812,53 +2915,48 @@ var b = class {
|
|
|
2812
2915
|
this.mediaQuery && this.mediaListener && this.mediaQuery.removeEventListener("change", this.mediaListener), this.mediaQuery = void 0, this.mediaListener = void 0;
|
|
2813
2916
|
}
|
|
2814
2917
|
};
|
|
2815
|
-
function
|
|
2918
|
+
function ne(e) {
|
|
2816
2919
|
let t = document.querySelector("#theme-link");
|
|
2817
2920
|
if (!t) return;
|
|
2818
2921
|
let n = t.href, r = n.split("/").pop();
|
|
2819
2922
|
e === "dark" && r === "lightTheme.css" ? t.href = n.replace(/lightTheme\.css$/, "darkTheme.css") : e === "light" && r === "darkTheme.css" && (t.href = n.replace(/darkTheme\.css$/, "lightTheme.css"));
|
|
2820
2923
|
}
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
function S(e) {
|
|
2924
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/typeof.js
|
|
2925
|
+
function A(e) {
|
|
2824
2926
|
"@babel/helpers - typeof";
|
|
2825
|
-
return
|
|
2927
|
+
return A = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
2826
2928
|
return typeof e;
|
|
2827
2929
|
} : function(e) {
|
|
2828
2930
|
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
2829
|
-
},
|
|
2931
|
+
}, A(e);
|
|
2830
2932
|
}
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
if (S(e) != "object" || !e) return e;
|
|
2933
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/toPrimitive.js
|
|
2934
|
+
function re(e, t) {
|
|
2935
|
+
if (A(e) != "object" || !e) return e;
|
|
2835
2936
|
var n = e[Symbol.toPrimitive];
|
|
2836
2937
|
if (n !== void 0) {
|
|
2837
2938
|
var r = n.call(e, t || "default");
|
|
2838
|
-
if (
|
|
2939
|
+
if (A(r) != "object") return r;
|
|
2839
2940
|
throw TypeError("@@toPrimitive must return a primitive value.");
|
|
2840
2941
|
}
|
|
2841
2942
|
return (t === "string" ? String : Number)(e);
|
|
2842
2943
|
}
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
return S(t) == "symbol" ? t : t + "";
|
|
2944
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/toPropertyKey.js
|
|
2945
|
+
function j(e) {
|
|
2946
|
+
var t = re(e, "string");
|
|
2947
|
+
return A(t) == "symbol" ? t : t + "";
|
|
2848
2948
|
}
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
return (t = w(t)) in e ? Object.defineProperty(e, t, {
|
|
2949
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/defineProperty.js
|
|
2950
|
+
function M(e, t, n) {
|
|
2951
|
+
return (t = j(t)) in e ? Object.defineProperty(e, t, {
|
|
2853
2952
|
value: n,
|
|
2854
2953
|
enumerable: !0,
|
|
2855
2954
|
configurable: !0,
|
|
2856
2955
|
writable: !0
|
|
2857
2956
|
}) : e[t] = n, e;
|
|
2858
2957
|
}
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
var E = {
|
|
2958
|
+
// src/modeler.ts
|
|
2959
|
+
var N = {
|
|
2862
2960
|
options: [
|
|
2863
2961
|
{
|
|
2864
2962
|
value: "feel",
|
|
@@ -2886,18 +2984,18 @@ var E = {
|
|
|
2886
2984
|
}
|
|
2887
2985
|
],
|
|
2888
2986
|
defaults: { editor: "feel" }
|
|
2889
|
-
},
|
|
2987
|
+
}, P = "data-dmn-theme", F = [
|
|
2890
2988
|
"string",
|
|
2891
2989
|
"boolean",
|
|
2892
2990
|
"integer",
|
|
2893
2991
|
"long",
|
|
2894
2992
|
"double",
|
|
2895
2993
|
"date"
|
|
2896
|
-
],
|
|
2994
|
+
], I = 600, L = 300, R = class {
|
|
2897
2995
|
constructor(t, n) {
|
|
2898
|
-
|
|
2996
|
+
M(this, "container", void 0), M(this, "options", void 0), M(this, "modeler", void 0), M(this, "store", new b()), M(this, "canvasOverlays", new x()), M(this, "commandStackBinding", new x()), M(this, "propertiesPanelInput", p(I)), M(this, "viewEditorInput", p(L)), M(this, "activeEventBus", void 0), M(this, "themeController", void 0), M(this, "handleViewsChanged", (e) => {
|
|
2899
2997
|
this.store.isDisposed || (this.bindActiveViewer(), this.options.onViewChanged?.(e));
|
|
2900
|
-
}),
|
|
2998
|
+
}), M(this, "handleContentChanged", () => {
|
|
2901
2999
|
this.store.isDisposed || this.options.onContentChanged?.();
|
|
2902
3000
|
}), this.container = t, this.options = n;
|
|
2903
3001
|
let l = n.additionalModules ?? {};
|
|
@@ -2914,40 +3012,40 @@ var E = {
|
|
|
2914
3012
|
o,
|
|
2915
3013
|
i,
|
|
2916
3014
|
s.decisionRequirementsDiagram,
|
|
2917
|
-
|
|
3015
|
+
z(this.propertiesPanelInput),
|
|
2918
3016
|
...l.drd ?? []
|
|
2919
3017
|
]
|
|
2920
3018
|
},
|
|
2921
3019
|
decisionTable: { additionalModules: [
|
|
2922
3020
|
e,
|
|
2923
3021
|
s.decisionTable,
|
|
2924
|
-
|
|
3022
|
+
z(this.viewEditorInput),
|
|
2925
3023
|
...l.decisionTable ?? []
|
|
2926
3024
|
] },
|
|
2927
3025
|
literalExpression: { additionalModules: [
|
|
2928
3026
|
e,
|
|
2929
|
-
|
|
3027
|
+
z(this.viewEditorInput),
|
|
2930
3028
|
...l.literalExpression ?? []
|
|
2931
3029
|
] },
|
|
2932
3030
|
boxedExpression: { additionalModules: [
|
|
2933
3031
|
e,
|
|
2934
|
-
|
|
3032
|
+
z(this.viewEditorInput),
|
|
2935
3033
|
...l.boxedExpression ?? []
|
|
2936
3034
|
] },
|
|
2937
3035
|
common: {
|
|
2938
|
-
expressionLanguages: n.expressionLanguages ??
|
|
2939
|
-
dataTypes: n.dataTypes ??
|
|
3036
|
+
expressionLanguages: n.expressionLanguages ?? N,
|
|
3037
|
+
dataTypes: n.dataTypes ?? F,
|
|
2940
3038
|
keyboard: n.keyboard
|
|
2941
3039
|
},
|
|
2942
3040
|
moddleExtensions: {
|
|
2943
3041
|
camunda: c,
|
|
2944
3042
|
...n.moddleExtensions
|
|
2945
3043
|
}
|
|
2946
|
-
}), this.store.add(() => this.modeler.destroy()), this.modeler.on("views.changed", this.handleViewsChanged), this.store.add(() => this.modeler.off("views.changed", this.handleViewsChanged)), this.store.add(
|
|
3044
|
+
}), this.store.add(() => this.modeler.destroy()), this.modeler.on("views.changed", this.handleViewsChanged), this.store.add(() => this.modeler.off("views.changed", this.handleViewsChanged)), this.store.add(y({ resized: () => {
|
|
2947
3045
|
this.store.isDisposed || this.getActiveCanvas()?.resized();
|
|
2948
3046
|
} }, t)), this.store.add(() => {
|
|
2949
3047
|
this.commandStackBinding.dispose(), this.activeEventBus = void 0;
|
|
2950
|
-
}, () => this.
|
|
3048
|
+
}, () => this.canvasOverlays.dispose());
|
|
2951
3049
|
}
|
|
2952
3050
|
async loadDiagram(e) {
|
|
2953
3051
|
this.assertLive();
|
|
@@ -2955,7 +3053,7 @@ var E = {
|
|
|
2955
3053
|
let t = await this.modeler.importXML(e);
|
|
2956
3054
|
return this.bindActiveViewer(), this.reportWarnings(t.warnings), t;
|
|
2957
3055
|
} catch (e) {
|
|
2958
|
-
throw
|
|
3056
|
+
throw B("Unable to import DMN", e);
|
|
2959
3057
|
}
|
|
2960
3058
|
}
|
|
2961
3059
|
async exportDiagram() {
|
|
@@ -2976,7 +3074,7 @@ var E = {
|
|
|
2976
3074
|
let t = await this.modeler.open(e);
|
|
2977
3075
|
return this.bindActiveViewer(), this.reportWarnings(t.warnings), t;
|
|
2978
3076
|
} catch (t) {
|
|
2979
|
-
throw
|
|
3077
|
+
throw B(`Unable to open DMN view <${e.id}>`, t);
|
|
2980
3078
|
}
|
|
2981
3079
|
}
|
|
2982
3080
|
isDrdViewActive() {
|
|
@@ -3000,7 +3098,7 @@ var E = {
|
|
|
3000
3098
|
setTheme(e) {
|
|
3001
3099
|
if (!this.store.isDisposed) {
|
|
3002
3100
|
if (!this.themeController) {
|
|
3003
|
-
let e = new
|
|
3101
|
+
let e = new k([this.container, this.options.propertiesPanel.parent], P);
|
|
3004
3102
|
this.themeController = e, this.store.add(() => e.dispose());
|
|
3005
3103
|
}
|
|
3006
3104
|
this.themeController.setMode(e);
|
|
@@ -3028,21 +3126,24 @@ var E = {
|
|
|
3028
3126
|
bindActiveViewer() {
|
|
3029
3127
|
if (this.store.isDisposed) return;
|
|
3030
3128
|
let e = this.getActiveViewer()?.get("eventBus");
|
|
3031
|
-
e !== this.activeEventBus && (this.activeEventBus = e, e?.on("commandStack.changed", this.handleContentChanged), this.commandStackBinding.set(e && (() => e.off("commandStack.changed", this.handleContentChanged))), this.
|
|
3129
|
+
e !== this.activeEventBus && (this.activeEventBus = e, e?.on("commandStack.changed", this.handleContentChanged), this.commandStackBinding.set(e && (() => e.off("commandStack.changed", this.handleContentChanged))), this.syncCanvasOverlays());
|
|
3032
3130
|
}
|
|
3033
|
-
|
|
3034
|
-
if (this.
|
|
3035
|
-
let e = this.getActiveViewer(), t = e?.get("canvas", !1), n = e?.get("
|
|
3036
|
-
t
|
|
3131
|
+
syncCanvasOverlays() {
|
|
3132
|
+
if (this.canvasOverlays.set(void 0), this.modeler.getActiveView()?.type !== "drd") return;
|
|
3133
|
+
let e = this.getActiveViewer(), t = e?.get("canvas", !1), n = e?.get("translate", !1), r = e?.get("eventBus", !1);
|
|
3134
|
+
if (!t || !n || !r) return;
|
|
3135
|
+
let i = new b();
|
|
3136
|
+
i.add(O({
|
|
3037
3137
|
parent: t.getContainer(),
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3138
|
+
label: n("Fit diagram to view"),
|
|
3139
|
+
fit: () => T(t),
|
|
3140
|
+
focusCanvas: () => t.focus(),
|
|
3141
|
+
isCanvasFocused: () => t.isFocused(),
|
|
3142
|
+
onCanvasFocusChanged: (e) => r.on("canvas.focus.changed", (t) => e(t.focused))
|
|
3143
|
+
})), this.canvasOverlays.set(() => i.dispose());
|
|
3043
3144
|
}
|
|
3044
3145
|
reportWarnings(e) {
|
|
3045
|
-
if (!this.store.isDisposed) for (let t of e) this.options.onWarning?.(
|
|
3146
|
+
if (!this.store.isDisposed) for (let t of e) this.options.onWarning?.(H(t));
|
|
3046
3147
|
}
|
|
3047
3148
|
getActiveViewer() {
|
|
3048
3149
|
return this.modeler.getActiveViewer();
|
|
@@ -3057,33 +3158,32 @@ var E = {
|
|
|
3057
3158
|
if (this.modeler.getActiveView()?.type === "drd") return this.getActiveViewer()?.get("canvas", !1);
|
|
3058
3159
|
}
|
|
3059
3160
|
assertLive() {
|
|
3060
|
-
if (this.store.isDisposed) throw new
|
|
3161
|
+
if (this.store.isDisposed) throw new v();
|
|
3061
3162
|
}
|
|
3062
3163
|
};
|
|
3063
|
-
function
|
|
3164
|
+
function z(e) {
|
|
3064
3165
|
return { debounceInput: ["value", e] };
|
|
3065
3166
|
}
|
|
3066
|
-
function
|
|
3067
|
-
let n = t instanceof Error ? t.message : String(t), r =
|
|
3167
|
+
function B(e, t) {
|
|
3168
|
+
let n = t instanceof Error ? t.message : String(t), r = V(t).map(H).filter(Boolean), i = r.length > 0 ? `\n${r.join("\n")}` : "";
|
|
3068
3169
|
return Error(`${e}: ${n}${i}`, { cause: t });
|
|
3069
3170
|
}
|
|
3070
|
-
function
|
|
3171
|
+
function V(e) {
|
|
3071
3172
|
if (typeof e != "object" || !e || !("warnings" in e)) return [];
|
|
3072
3173
|
let t = e.warnings;
|
|
3073
3174
|
return Array.isArray(t) ? t : [];
|
|
3074
3175
|
}
|
|
3075
|
-
function
|
|
3176
|
+
function H(e) {
|
|
3076
3177
|
return [
|
|
3077
3178
|
e.message,
|
|
3078
3179
|
e.error?.message,
|
|
3079
3180
|
e.error?.stack
|
|
3080
3181
|
].filter((e) => !!e).join("\n");
|
|
3081
3182
|
}
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
let r = new j(e, n);
|
|
3183
|
+
// src/createModeler.ts
|
|
3184
|
+
async function U(e, n) {
|
|
3185
|
+
t.extend(f);
|
|
3186
|
+
let r = new R(e, n);
|
|
3087
3187
|
try {
|
|
3088
3188
|
r.setTheme(n.theme ?? "automatic"), n.locale && t.setLanguage(n.locale);
|
|
3089
3189
|
} catch (e) {
|
|
@@ -3094,5 +3194,349 @@ async function I(e, n) {
|
|
|
3094
3194
|
}
|
|
3095
3195
|
return r;
|
|
3096
3196
|
}
|
|
3097
|
-
|
|
3098
|
-
|
|
3197
|
+
// src/diff/diffMarks.ts
|
|
3198
|
+
function W(e, t) {
|
|
3199
|
+
if (e.added.includes(t)) return "added";
|
|
3200
|
+
if (e.removed.includes(t)) return "removed";
|
|
3201
|
+
if (e.expressions.includes(t)) return "changed";
|
|
3202
|
+
}
|
|
3203
|
+
function G(e, t, n) {
|
|
3204
|
+
let r = q(e, n), i = (e, t) => `background-color: color-mix(in srgb, var(--dmn-diff-${e}) ${t}%, var(--decision-table-background-color)) !important;`, a = (e) => `box-shadow: inset 4px 0 0 var(--dmn-diff-${e});`, o = (e) => `box-shadow: inset 0 0 0 2px var(--dmn-diff-${e});`, { rules: s, columns: c } = t;
|
|
3205
|
+
return [
|
|
3206
|
+
J(r.rows(s.added), i("added", 16)),
|
|
3207
|
+
J(r.ruleNumbers(s.added), a("added")),
|
|
3208
|
+
J(r.rows(s.removed), i("removed", 14)),
|
|
3209
|
+
J(r.ruleNumbers(s.removed), a("removed")),
|
|
3210
|
+
J(r.ruleNumbers(s.changed), a("changed")),
|
|
3211
|
+
J(r.ruleNumbers(s.moved), "background-image: repeating-linear-gradient(to bottom, var(--dmn-diff-moved) 0 4px, transparent 4px 7px) !important; background-size: 4px 100% !important; background-repeat: no-repeat !important;"),
|
|
3212
|
+
J(r.ruleNumbers(s.moved).map((e) => `${e}::after`), "content: \" ↕\"; color: var(--dmn-diff-moved);"),
|
|
3213
|
+
J(r.cells(t.cells), `${i("changed", 18)} ${o("changed")}`),
|
|
3214
|
+
J(r.annotations(t.annotations), `${i("changed", 18)} ${o("changed")}`),
|
|
3215
|
+
J(r.columnCells(c.added), i("added", 10)),
|
|
3216
|
+
J(r.headers(c.added), "box-shadow: inset 0 3px 0 var(--dmn-diff-added);"),
|
|
3217
|
+
J(r.columnCells(c.removed), i("removed", 10)),
|
|
3218
|
+
J(r.headers(c.removed), "box-shadow: inset 0 3px 0 var(--dmn-diff-removed);"),
|
|
3219
|
+
J(r.headers(c.changed), `${i("changed", 18)} ${o("changed")}`),
|
|
3220
|
+
J(t.properties.length > 0 ? [`${e} .hit-policy`] : [], `${i("changed", 18)} ${o("changed")}`)
|
|
3221
|
+
].join("");
|
|
3222
|
+
}
|
|
3223
|
+
function K(e, t, n) {
|
|
3224
|
+
if (!t) return "";
|
|
3225
|
+
let r = q(e, n), i = {
|
|
3226
|
+
rule: [`${e} tr:has(> td[data-row-id="${Y(t.id)}"])`],
|
|
3227
|
+
column: r.columnCells([t.id]),
|
|
3228
|
+
table: [`${e} .hit-policy`]
|
|
3229
|
+
}[t.kind];
|
|
3230
|
+
return J(i, "outline: 2px solid var(--dmn-diff-current); outline-offset: -2px;");
|
|
3231
|
+
}
|
|
3232
|
+
function q(e, t) {
|
|
3233
|
+
let n = (t) => (n) => n.map((n) => `${e} ${t(Y(n))}`), r = (n) => n.map((e) => t.indexOf(e)).filter((e) => e >= 0).map((t) => `${e} thead th:nth-child(${t + 2}):not([data-col-id])`), i = (e) => [...n((e) => `th[data-col-id="${e}"]`)(e), ...r(e)];
|
|
3234
|
+
return {
|
|
3235
|
+
rows: n((e) => `td[data-row-id="${e}"]`),
|
|
3236
|
+
ruleNumbers: n((e) => `td.rule-index[data-row-id="${e}"]`),
|
|
3237
|
+
cells: n((e) => `td[data-element-id="${e}"]`),
|
|
3238
|
+
annotations: n((e) => `td.annotation[data-element-id="${e}"]`),
|
|
3239
|
+
headers: i,
|
|
3240
|
+
columnCells: (e) => [...n((e) => `td[data-col-id="${e}"]`)(e), ...i(e)]
|
|
3241
|
+
};
|
|
3242
|
+
}
|
|
3243
|
+
function J(e, t) {
|
|
3244
|
+
return e.length > 0 ? `${e.join(",\n")} { ${t} }\n` : "";
|
|
3245
|
+
}
|
|
3246
|
+
function Y(e) {
|
|
3247
|
+
return e.replace(/["\\]/g, "\\$&");
|
|
3248
|
+
}
|
|
3249
|
+
// src/diff/DmnDiffViewer.ts
|
|
3250
|
+
var X = "dmn-diff-counts", ie = 80, Z = 0, ae = class {
|
|
3251
|
+
constructor(t, n = 0) {
|
|
3252
|
+
M(this, "container", void 0), M(this, "topInset", void 0), M(this, "viewer", void 0), M(this, "store", new b()), M(this, "style", void 0), M(this, "scope", void 0), M(this, "viewListeners", /* @__PURE__ */ new Set()), M(this, "viewportListeners", /* @__PURE__ */ new Set()), M(this, "scrollListeners", /* @__PURE__ */ new Set()), M(this, "boundDrdBuses", /* @__PURE__ */ new WeakSet()), M(this, "marks", void 0), M(this, "markOptions", {}), M(this, "focused", void 0), M(this, "selectedOnCanvas", void 0), M(this, "announcedView", null), M(this, "openingView", !1), M(this, "movingViewport", !1), M(this, "expectedScroll", void 0), M(this, "viewportTimer", void 0), M(this, "drdViewport", void 0), M(this, "themeController", void 0), this.container = t, this.topInset = n, Z += 1, this.scope = `[data-dmn-diff="${Z}"]`, t.classList.add("dmn-diff"), t.dataset.dmnDiff = String(Z), this.style = document.createElement("style"), t.append(this.style), this.viewer = new l({
|
|
3253
|
+
container: t,
|
|
3254
|
+
drd: { additionalModules: [
|
|
3255
|
+
e,
|
|
3256
|
+
d,
|
|
3257
|
+
u
|
|
3258
|
+
] },
|
|
3259
|
+
decisionTable: { additionalModules: [e] },
|
|
3260
|
+
literalExpression: { additionalModules: [e] },
|
|
3261
|
+
boxedExpression: { additionalModules: [e] },
|
|
3262
|
+
moddleExtensions: { camunda: c }
|
|
3263
|
+
});
|
|
3264
|
+
let r = () => {
|
|
3265
|
+
this.placeDrd(), this.applyMarks();
|
|
3266
|
+
}, i = () => this.notifyViewChanged(), a = (e) => this.onScroll(e);
|
|
3267
|
+
this.viewer.on("import.render.complete", r), this.viewer.on("views.changed", i), t.addEventListener("scroll", a, !0), this.store.add(() => this.viewer.off("import.render.complete", r), () => this.viewer.off("views.changed", i), () => t.removeEventListener("scroll", a, !0), () => clearTimeout(this.viewportTimer), () => this.viewer.destroy(), () => this.style.remove(), y({ resized: () => this.drd()?.canvas.resized() }, t));
|
|
3268
|
+
}
|
|
3269
|
+
async importXML(e) {
|
|
3270
|
+
this.openingView = !0;
|
|
3271
|
+
try {
|
|
3272
|
+
await this.viewer.importXML(e);
|
|
3273
|
+
} finally {
|
|
3274
|
+
this.openingView = !1;
|
|
3275
|
+
}
|
|
3276
|
+
this.announcedView = this.getActiveElementId();
|
|
3277
|
+
}
|
|
3278
|
+
setMarks(e, t = {}) {
|
|
3279
|
+
this.marks = e, this.markOptions = t, this.applyMarks();
|
|
3280
|
+
}
|
|
3281
|
+
async openView(e) {
|
|
3282
|
+
let t = this.viewer.getViews().find((t) => e === null ? t.type === "drd" : t.element.id === e);
|
|
3283
|
+
if (!t) return !1;
|
|
3284
|
+
if (this.announcedView = e, t !== this.viewer.getActiveView()) {
|
|
3285
|
+
this.openingView = !0;
|
|
3286
|
+
try {
|
|
3287
|
+
await this.viewer.open(t);
|
|
3288
|
+
} finally {
|
|
3289
|
+
this.openingView = !1;
|
|
3290
|
+
}
|
|
3291
|
+
}
|
|
3292
|
+
return !0;
|
|
3293
|
+
}
|
|
3294
|
+
getActiveElementId() {
|
|
3295
|
+
let e = this.viewer.getActiveView();
|
|
3296
|
+
return !e || e.type === "drd" ? null : e.element.id;
|
|
3297
|
+
}
|
|
3298
|
+
getViewStatus() {
|
|
3299
|
+
let e = this.activeElement();
|
|
3300
|
+
return e && this.statusOf(e);
|
|
3301
|
+
}
|
|
3302
|
+
onViewChanged(e) {
|
|
3303
|
+
return $(this.viewListeners, e);
|
|
3304
|
+
}
|
|
3305
|
+
focus(e) {
|
|
3306
|
+
this.focused = e, this.applyMarks(), e !== void 0 && this.reveal(e);
|
|
3307
|
+
}
|
|
3308
|
+
reveal(e) {
|
|
3309
|
+
let t = this.drd();
|
|
3310
|
+
t ? this.centerOn(t, e) : this.scrollTableTo(e);
|
|
3311
|
+
}
|
|
3312
|
+
getViewport() {
|
|
3313
|
+
let e = this.drd()?.canvas.viewbox();
|
|
3314
|
+
return e && {
|
|
3315
|
+
x: e.x,
|
|
3316
|
+
y: e.y,
|
|
3317
|
+
width: e.width,
|
|
3318
|
+
height: e.height
|
|
3319
|
+
};
|
|
3320
|
+
}
|
|
3321
|
+
setViewport(e) {
|
|
3322
|
+
let t = this.drd()?.canvas;
|
|
3323
|
+
if (t) {
|
|
3324
|
+
this.movingViewport = !0;
|
|
3325
|
+
try {
|
|
3326
|
+
t.viewbox(e), this.drdViewport = e;
|
|
3327
|
+
} finally {
|
|
3328
|
+
this.movingViewport = !1;
|
|
3329
|
+
}
|
|
3330
|
+
}
|
|
3331
|
+
}
|
|
3332
|
+
onViewportChanged(e) {
|
|
3333
|
+
return $(this.viewportListeners, e);
|
|
3334
|
+
}
|
|
3335
|
+
getTableScroll() {
|
|
3336
|
+
let e = this.scroller();
|
|
3337
|
+
if (!e) return;
|
|
3338
|
+
let t = new Set(this.sideOnlyRules()), n = this.ruleNumberCells().find((n) => !t.has(n.dataset.rowId ?? "") && Q(e, n) + n.offsetHeight > e.scrollTop);
|
|
3339
|
+
return n ? {
|
|
3340
|
+
rule: n.dataset.rowId,
|
|
3341
|
+
offset: e.scrollTop - Q(e, n),
|
|
3342
|
+
left: e.scrollLeft
|
|
3343
|
+
} : {
|
|
3344
|
+
offset: e.scrollTop,
|
|
3345
|
+
left: e.scrollLeft
|
|
3346
|
+
};
|
|
3347
|
+
}
|
|
3348
|
+
setTableScroll(e) {
|
|
3349
|
+
let t = this.scroller();
|
|
3350
|
+
if (!t) return;
|
|
3351
|
+
let n = e.rule ? this.ruleNumberCells().find((t) => t.dataset.rowId === e.rule) : void 0, r = (n ? Q(t, n) : 0) + e.offset;
|
|
3352
|
+
this.expectedScroll = {
|
|
3353
|
+
top: Math.round(r),
|
|
3354
|
+
left: Math.round(e.left)
|
|
3355
|
+
}, t.scrollTo({
|
|
3356
|
+
top: r,
|
|
3357
|
+
left: e.left
|
|
3358
|
+
});
|
|
3359
|
+
}
|
|
3360
|
+
onTableScroll(e) {
|
|
3361
|
+
return $(this.scrollListeners, e);
|
|
3362
|
+
}
|
|
3363
|
+
setTheme(e) {
|
|
3364
|
+
if (!this.themeController) {
|
|
3365
|
+
let e = new k([this.container], "data-dmn-theme");
|
|
3366
|
+
this.themeController = e, this.store.add(() => e.dispose());
|
|
3367
|
+
}
|
|
3368
|
+
this.themeController.setMode(e);
|
|
3369
|
+
}
|
|
3370
|
+
async setLocale(e) {
|
|
3371
|
+
let n = t.getLocale();
|
|
3372
|
+
t.setLanguage(e);
|
|
3373
|
+
let r = this.viewer.getActiveView();
|
|
3374
|
+
if (t.getLocale() !== n && r) {
|
|
3375
|
+
this.openingView = !0;
|
|
3376
|
+
try {
|
|
3377
|
+
await this.viewer.open(r);
|
|
3378
|
+
} finally {
|
|
3379
|
+
this.openingView = !1;
|
|
3380
|
+
}
|
|
3381
|
+
}
|
|
3382
|
+
}
|
|
3383
|
+
destroy() {
|
|
3384
|
+
this.viewListeners.clear(), this.viewportListeners.clear(), this.scrollListeners.clear(), this.store.dispose();
|
|
3385
|
+
}
|
|
3386
|
+
drd() {
|
|
3387
|
+
if (this.viewer.getActiveView()?.type !== "drd") return;
|
|
3388
|
+
let e = this.viewer.getActiveViewer();
|
|
3389
|
+
if (e) return {
|
|
3390
|
+
canvas: e.get("canvas"),
|
|
3391
|
+
elementRegistry: e.get("elementRegistry"),
|
|
3392
|
+
overlays: e.get("overlays"),
|
|
3393
|
+
eventBus: e.get("eventBus")
|
|
3394
|
+
};
|
|
3395
|
+
}
|
|
3396
|
+
activeElement() {
|
|
3397
|
+
let e = this.viewer.getActiveView();
|
|
3398
|
+
return e && e.type !== "drd" ? e.element : void 0;
|
|
3399
|
+
}
|
|
3400
|
+
applyMarks() {
|
|
3401
|
+
let e = this.drd(), t = this.activeElement();
|
|
3402
|
+
this.style.textContent = "", delete this.container.dataset.dmnDiffView, e ? this.markDrd(e) : t && this.markView(t);
|
|
3403
|
+
}
|
|
3404
|
+
markDrd(e) {
|
|
3405
|
+
this.bindViewport(e);
|
|
3406
|
+
let t = this.marks;
|
|
3407
|
+
if (t) {
|
|
3408
|
+
for (let n of m) for (let r of t[n]) e.elementRegistry.get(r) && e.canvas.addMarker(r, h[n]);
|
|
3409
|
+
if (this.selectedOnCanvas && e.elementRegistry.get(this.selectedOnCanvas) && e.canvas.removeMarker(this.selectedOnCanvas, g), this.selectedOnCanvas = void 0, this.focused && e.elementRegistry.get(this.focused) && (e.canvas.addMarker(this.focused, g), this.selectedOnCanvas = this.focused), e.overlays.remove({ type: X }), this.markOptions.countBadges) for (let [n, r] of Object.entries(t.tables)) e.elementRegistry.get(n) && e.overlays.add(n, X, {
|
|
3410
|
+
position: {
|
|
3411
|
+
top: -11,
|
|
3412
|
+
right: 8
|
|
3413
|
+
},
|
|
3414
|
+
html: ce(r.counts)
|
|
3415
|
+
});
|
|
3416
|
+
}
|
|
3417
|
+
}
|
|
3418
|
+
markView(e) {
|
|
3419
|
+
let t = this.statusOf(e);
|
|
3420
|
+
t && (this.container.dataset.dmnDiffView = t);
|
|
3421
|
+
let n = this.marks?.tables[e.id];
|
|
3422
|
+
if (!n) return;
|
|
3423
|
+
let r = se(e);
|
|
3424
|
+
this.style.textContent = G(this.scope, n, r) + K(this.scope, this.tableFocus(n), r);
|
|
3425
|
+
}
|
|
3426
|
+
statusOf(e) {
|
|
3427
|
+
return this.marks && W(this.marks, e.id);
|
|
3428
|
+
}
|
|
3429
|
+
tableFocus(e) {
|
|
3430
|
+
let t = this.focused;
|
|
3431
|
+
if (t === void 0) return;
|
|
3432
|
+
if (t === e.attributesStep) return {
|
|
3433
|
+
kind: "table",
|
|
3434
|
+
id: t
|
|
3435
|
+
};
|
|
3436
|
+
let { columns: n } = e;
|
|
3437
|
+
return [
|
|
3438
|
+
...n.added,
|
|
3439
|
+
...n.removed,
|
|
3440
|
+
...n.changed
|
|
3441
|
+
].includes(t) ? {
|
|
3442
|
+
kind: "column",
|
|
3443
|
+
id: t
|
|
3444
|
+
} : {
|
|
3445
|
+
kind: "rule",
|
|
3446
|
+
id: t
|
|
3447
|
+
};
|
|
3448
|
+
}
|
|
3449
|
+
bindViewport(e) {
|
|
3450
|
+
this.boundDrdBuses.has(e.eventBus) || (this.boundDrdBuses.add(e.eventBus), e.eventBus.on("canvas.viewbox.changed", () => {
|
|
3451
|
+
this.movingViewport || this.openingView || (this.drdViewport = this.getViewport(), clearTimeout(this.viewportTimer), this.viewportTimer = setTimeout(() => {
|
|
3452
|
+
let e = this.getViewport();
|
|
3453
|
+
e && this.viewportListeners.forEach((t) => t(e));
|
|
3454
|
+
}, ie));
|
|
3455
|
+
}));
|
|
3456
|
+
}
|
|
3457
|
+
placeDrd() {
|
|
3458
|
+
let e = this.drd();
|
|
3459
|
+
if (!e) return;
|
|
3460
|
+
if (this.drdViewport) {
|
|
3461
|
+
this.setViewport(this.drdViewport);
|
|
3462
|
+
return;
|
|
3463
|
+
}
|
|
3464
|
+
let { inner: t, outer: n } = e.canvas.viewbox();
|
|
3465
|
+
if (!n.width || !n.height || !t.width || !t.height) return;
|
|
3466
|
+
let r = Math.min(1, (n.width - 48) / t.width, (n.height - this.topInset - 48) / t.height), i = n.width / r;
|
|
3467
|
+
this.setViewport({
|
|
3468
|
+
x: t.x + t.width / 2 - i / 2,
|
|
3469
|
+
y: t.y - (this.topInset + 24) / r,
|
|
3470
|
+
width: i,
|
|
3471
|
+
height: n.height / r
|
|
3472
|
+
});
|
|
3473
|
+
}
|
|
3474
|
+
centerOn(e, t) {
|
|
3475
|
+
let n = e.elementRegistry.get(t);
|
|
3476
|
+
if (!n || n.x === void 0 || n.y === void 0) return;
|
|
3477
|
+
let r = e.canvas.viewbox(), i = n.x + (n.width ?? 0) / 2, a = n.y + (n.height ?? 0) / 2;
|
|
3478
|
+
this.setViewport({
|
|
3479
|
+
x: i - r.width / 2,
|
|
3480
|
+
y: a - r.height / 2,
|
|
3481
|
+
width: r.width,
|
|
3482
|
+
height: r.height
|
|
3483
|
+
});
|
|
3484
|
+
}
|
|
3485
|
+
scrollTableTo(e) {
|
|
3486
|
+
let t = (e) => this.container.querySelector(e), n = Y(e);
|
|
3487
|
+
((this.marks?.tables[this.activeElement()?.id ?? ""]?.cells ?? []).map((e) => t(`td[data-element-id="${Y(e)}"]`)).filter((t) => t?.dataset.rowId === e)[0] ?? t(`td.rule-index[data-row-id="${n}"]`) ?? t(`[data-col-id="${n}"]`) ?? t(".hit-policy"))?.scrollIntoView({
|
|
3488
|
+
block: "center",
|
|
3489
|
+
inline: "center"
|
|
3490
|
+
});
|
|
3491
|
+
}
|
|
3492
|
+
notifyViewChanged() {
|
|
3493
|
+
let e = this.getActiveElementId();
|
|
3494
|
+
e !== this.announcedView && (this.announcedView = e, this.viewListeners.forEach((t) => t(e)));
|
|
3495
|
+
}
|
|
3496
|
+
onScroll(e) {
|
|
3497
|
+
let t = this.scroller();
|
|
3498
|
+
if (!t || e.target !== t) return;
|
|
3499
|
+
let n = this.expectedScroll;
|
|
3500
|
+
if (n && Math.abs(t.scrollTop - n.top) <= 1 && Math.abs(t.scrollLeft - n.left) <= 1) {
|
|
3501
|
+
this.expectedScroll = void 0;
|
|
3502
|
+
return;
|
|
3503
|
+
}
|
|
3504
|
+
let r = this.getTableScroll();
|
|
3505
|
+
r && this.scrollListeners.forEach((e) => e(r));
|
|
3506
|
+
}
|
|
3507
|
+
scroller() {
|
|
3508
|
+
return this.container.querySelector(".tjs-table-container");
|
|
3509
|
+
}
|
|
3510
|
+
ruleNumberCells() {
|
|
3511
|
+
return [...this.container.querySelectorAll("td.rule-index[data-row-id]")];
|
|
3512
|
+
}
|
|
3513
|
+
sideOnlyRules() {
|
|
3514
|
+
let e = this.marks?.tables[this.activeElement()?.id ?? ""];
|
|
3515
|
+
return e ? [...e.rules.added, ...e.rules.removed] : [];
|
|
3516
|
+
}
|
|
3517
|
+
};
|
|
3518
|
+
function oe(e, n = {}) {
|
|
3519
|
+
t.extend(f);
|
|
3520
|
+
let r = new ae(e, n.topInset);
|
|
3521
|
+
return n.theme && r.setTheme(n.theme), r;
|
|
3522
|
+
}
|
|
3523
|
+
function se(e) {
|
|
3524
|
+
let t = e.decisionLogic;
|
|
3525
|
+
return [...t?.input ?? [], ...t?.output ?? []].map((e) => e.id);
|
|
3526
|
+
}
|
|
3527
|
+
function Q(e, t) {
|
|
3528
|
+
return t.getBoundingClientRect().top - e.getBoundingClientRect().top + e.scrollTop;
|
|
3529
|
+
}
|
|
3530
|
+
function ce(e) {
|
|
3531
|
+
let t = document.createElement("div");
|
|
3532
|
+
t.className = "dmn-diff-counts";
|
|
3533
|
+
for (let n of m) {
|
|
3534
|
+
let r = document.createElement("span");
|
|
3535
|
+
r.className = `dmn-diff-counts__${n}`, r.textContent = String(e[n]), t.append(r);
|
|
3536
|
+
}
|
|
3537
|
+
return t;
|
|
3538
|
+
}
|
|
3539
|
+
function $(e, t) {
|
|
3540
|
+
return e.add(t), () => e.delete(t);
|
|
3541
|
+
}
|
|
3542
|
+
export { v as NoModelerError, oe as createDiffViewer, U as createModeler };
|