@miragon/dmn-modeler 0.8.0 → 0.10.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/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
- //#endregion
8
- //#region ../../libs/bpmn-i18n-extras/src/languages/index.ts
9
- var l = {
7
+ import l from "dmn-js/lib/Viewer";
8
+ import u from "diagram-js/lib/navigation/movecanvas";
9
+ import ee from "diagram-js/lib/navigation/zoomscroll";
10
+ // ../../libs/bpmn-i18n-extras/src/languages/index.ts
11
+ var d = {
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,15 @@ 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
+ "No changes": "Keine Änderungen",
30
+ "Show all": "Alle anzeigen",
31
+ "Show XML changes": "XML-Änderungen anzeigen",
32
+ "Old version": "Alte Version",
33
+ "New version": "Neue Version",
34
+ "Not in this version": "Nicht in dieser Version",
35
+ "It was removed. The version on the left shows it.": "Es wurde entfernt. Die Version links zeigt es.",
36
+ "It is new. The version on the right shows it.": "Es ist neu. Die Version rechts zeigt es.",
25
37
  "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
38
  "A property cannot depend on itself.": "Eine Eigenschaft kann nicht von sich selbst abhängen.",
27
39
  "A regular expression the value must match.": "Ein regulärer Ausdruck, dem der Wert entsprechen muss.",
@@ -233,6 +245,7 @@ var l = {
233
245
  en: {
234
246
  "The linked form is missing or invalid. Check the form reference.": "The linked form is missing or invalid. Check the form reference.",
235
247
  "Preview linked form": "Preview linked form",
248
+ "Fit diagram to view": "Fit diagram to view",
236
249
  "Linked form preview": "Linked form preview",
237
250
  Refresh: "Refresh",
238
251
  "Close form preview": "Close form preview",
@@ -245,6 +258,15 @@ var l = {
245
258
  "The host did not answer. Refresh to try again.": "The host did not answer. Refresh to try again.",
246
259
  "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
260
  "The form preview could not be loaded. Refresh to try again.": "The form preview could not be loaded. Refresh to try again.",
261
+ Changes: "Changes",
262
+ "No changes": "No changes",
263
+ "Show all": "Show all",
264
+ "Show XML changes": "Show XML changes",
265
+ "Old version": "Old version",
266
+ "New version": "New version",
267
+ "Not in this version": "Not in this version",
268
+ "It was removed. The version on the left shows it.": "It was removed. The version on the left shows it.",
269
+ "It is new. The version on the right shows it.": "It is new. The version on the right shows it.",
248
270
  "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
271
  "A property cannot depend on itself.": "A property cannot depend on itself.",
250
272
  "A regular expression the value must match.": "A regular expression the value must match.",
@@ -456,6 +478,7 @@ var l = {
456
478
  es: {
457
479
  "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
480
  "Preview linked form": "Previsualizar formulario vinculado",
481
+ "Fit diagram to view": "Ajustar el diagrama a la vista",
459
482
  "Linked form preview": "Vista previa del formulario vinculado",
460
483
  Refresh: "Actualizar",
461
484
  "Close form preview": "Cerrar vista previa del formulario",
@@ -468,6 +491,15 @@ var l = {
468
491
  "The host did not answer. Refresh to try again.": "El host no respondió. Actualice para reintentar.",
469
492
  "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
493
  "The form preview could not be loaded. Refresh to try again.": "No se pudo cargar la vista previa. Actualice para reintentar.",
494
+ Changes: "Cambios",
495
+ "No changes": "Sin cambios",
496
+ "Show all": "Mostrar todo",
497
+ "Show XML changes": "Mostrar cambios en el XML",
498
+ "Old version": "Versión anterior",
499
+ "New version": "Versión nueva",
500
+ "Not in this version": "No está en esta versión",
501
+ "It was removed. The version on the left shows it.": "Se eliminó. La versión de la izquierda lo muestra.",
502
+ "It is new. The version on the right shows it.": "Es nuevo. La versión de la derecha lo muestra.",
471
503
  "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
504
  "A property cannot depend on itself.": "Una propiedad no puede depender de sí misma.",
473
505
  "A regular expression the value must match.": "Una expresión regular con la que debe coincidir el valor.",
@@ -679,6 +711,7 @@ var l = {
679
711
  fr: {
680
712
  "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
713
  "Preview linked form": "Prévisualiser le formulaire lié",
714
+ "Fit diagram to view": "Ajuster le diagramme à la vue",
682
715
  "Linked form preview": "Aperçu du formulaire lié",
683
716
  Refresh: "Actualiser",
684
717
  "Close form preview": "Fermer l’aperçu du formulaire",
@@ -691,6 +724,15 @@ var l = {
691
724
  "The host did not answer. Refresh to try again.": "L’hôte n’a pas répondu. Actualisez pour réessayer.",
692
725
  "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
726
  "The form preview could not be loaded. Refresh to try again.": "Impossible de charger l’aperçu du formulaire. Actualisez pour réessayer.",
727
+ Changes: "Modifications",
728
+ "No changes": "Aucune modification",
729
+ "Show all": "Tout afficher",
730
+ "Show XML changes": "Afficher les modifications XML",
731
+ "Old version": "Ancienne version",
732
+ "New version": "Nouvelle version",
733
+ "Not in this version": "Absent de cette version",
734
+ "It was removed. The version on the left shows it.": "Il a été supprimé. La version de gauche l'affiche.",
735
+ "It is new. The version on the right shows it.": "Il est nouveau. La version de droite l'affiche.",
694
736
  "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
737
  "A property cannot depend on itself.": "Une propriété ne peut pas dépendre d'elle-même.",
696
738
  "A regular expression the value must match.": "Une expression régulière à laquelle la valeur doit correspondre.",
@@ -902,6 +944,7 @@ var l = {
902
944
  it: {
903
945
  "The linked form is missing or invalid. Check the form reference.": "Il modulo collegato è mancante o non valido. Controllare il riferimento al modulo.",
904
946
  "Preview linked form": "Visualizza anteprima del modulo collegato",
947
+ "Fit diagram to view": "Adatta il diagramma alla vista",
905
948
  "Linked form preview": "Anteprima del modulo collegato",
906
949
  Refresh: "Aggiorna",
907
950
  "Close form preview": "Chiudi anteprima del modulo",
@@ -914,6 +957,15 @@ var l = {
914
957
  "The host did not answer. Refresh to try again.": "L’host non ha risposto. Aggiorna per riprovare.",
915
958
  "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
959
  "The form preview could not be loaded. Refresh to try again.": "Impossibile caricare l’anteprima del modulo. Aggiorna per riprovare.",
960
+ Changes: "Modifiche",
961
+ "No changes": "Nessuna modifica",
962
+ "Show all": "Mostra tutto",
963
+ "Show XML changes": "Mostra modifiche XML",
964
+ "Old version": "Versione precedente",
965
+ "New version": "Nuova versione",
966
+ "Not in this version": "Non presente in questa versione",
967
+ "It was removed. The version on the left shows it.": "È stato rimosso. La versione a sinistra lo mostra.",
968
+ "It is new. The version on the right shows it.": "È nuovo. La versione a destra lo mostra.",
917
969
  "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
970
  "A property cannot depend on itself.": "Una proprietà non può dipendere da sé stessa.",
919
971
  "A regular expression the value must match.": "Un'espressione regolare a cui il valore deve corrispondere.",
@@ -1125,6 +1177,7 @@ var l = {
1125
1177
  ja: {
1126
1178
  "The linked form is missing or invalid. Check the form reference.": "リンクされたフォームが見つからないか無効です。フォームの参照を確認してください。",
1127
1179
  "Preview linked form": "リンクされたフォームをプレビュー",
1180
+ "Fit diagram to view": "ダイアグラムを画面に合わせる",
1128
1181
  "Linked form preview": "リンクされたフォームのプレビュー",
1129
1182
  Refresh: "更新",
1130
1183
  "Close form preview": "フォームのプレビューを閉じる",
@@ -1137,6 +1190,15 @@ var l = {
1137
1190
  "The host did not answer. Refresh to try again.": "ホストから応答がありませんでした。更新して再試行してください。",
1138
1191
  "The saved form is invalid or unsupported. Open it in the form editor.": "保存済みフォームが無効か未対応です。フォームエディターで開いてください。",
1139
1192
  "The form preview could not be loaded. Refresh to try again.": "フォームのプレビューを読み込めませんでした。更新して再試行してください。",
1193
+ Changes: "変更",
1194
+ "No changes": "変更なし",
1195
+ "Show all": "すべて表示",
1196
+ "Show XML changes": "XML の変更を表示",
1197
+ "Old version": "旧バージョン",
1198
+ "New version": "新バージョン",
1199
+ "Not in this version": "このバージョンにはありません",
1200
+ "It was removed. The version on the left shows it.": "削除されました。左側のバージョンに表示されています。",
1201
+ "It is new. The version on the right shows it.": "新しく追加されました。右側のバージョンに表示されています。",
1140
1202
  "A form is either a form id or an external reference, not both.": "フォームに指定できるのは、フォーム ID か外部参照のどちらか一方だけです。",
1141
1203
  "A property cannot depend on itself.": "プロパティは自分自身に依存できません。",
1142
1204
  "A regular expression the value must match.": "値が一致する必要がある正規表現です。",
@@ -1348,6 +1410,7 @@ var l = {
1348
1410
  ko: {
1349
1411
  "The linked form is missing or invalid. Check the form reference.": "연결된 양식이 없거나 유효하지 않습니다. 양식 참조를 확인하세요.",
1350
1412
  "Preview linked form": "연결된 양식 미리보기",
1413
+ "Fit diagram to view": "다이어그램을 화면에 맞추기",
1351
1414
  "Linked form preview": "연결된 양식 미리보기",
1352
1415
  Refresh: "새로 고침",
1353
1416
  "Close form preview": "양식 미리보기 닫기",
@@ -1360,6 +1423,15 @@ var l = {
1360
1423
  "The host did not answer. Refresh to try again.": "호스트가 응답하지 않았습니다. 새로 고침하여 다시 시도하세요.",
1361
1424
  "The saved form is invalid or unsupported. Open it in the form editor.": "저장된 양식이 유효하지 않거나 지원되지 않습니다. 양식 편집기에서 여세요.",
1362
1425
  "The form preview could not be loaded. Refresh to try again.": "양식 미리보기를 불러올 수 없습니다. 새로 고침하여 다시 시도하세요.",
1426
+ Changes: "변경 사항",
1427
+ "No changes": "변경 사항 없음",
1428
+ "Show all": "모두 표시",
1429
+ "Show XML changes": "XML 변경 사항 표시",
1430
+ "Old version": "이전 버전",
1431
+ "New version": "새 버전",
1432
+ "Not in this version": "이 버전에 없음",
1433
+ "It was removed. The version on the left shows it.": "제거되었습니다. 왼쪽 버전에 표시됩니다.",
1434
+ "It is new. The version on the right shows it.": "새로 추가되었습니다. 오른쪽 버전에 표시됩니다.",
1363
1435
  "A form is either a form id or an external reference, not both.": "양식에는 양식 ID와 외부 참조 중 하나만 지정할 수 있습니다.",
1364
1436
  "A property cannot depend on itself.": "속성은 자기 자신에 종속될 수 없습니다.",
1365
1437
  "A regular expression the value must match.": "값이 일치해야 하는 정규식입니다.",
@@ -1571,6 +1643,7 @@ var l = {
1571
1643
  "nl-nl": {
1572
1644
  "The linked form is missing or invalid. Check the form reference.": "Het gekoppelde formulier ontbreekt of is ongeldig. Controleer de formulierverwijzing.",
1573
1645
  "Preview linked form": "Gekoppeld formulier bekijken",
1646
+ "Fit diagram to view": "Diagram passend maken",
1574
1647
  "Linked form preview": "Voorbeeld van gekoppeld formulier",
1575
1648
  Refresh: "Vernieuwen",
1576
1649
  "Close form preview": "Formuliervoorbeeld sluiten",
@@ -1583,6 +1656,15 @@ var l = {
1583
1656
  "The host did not answer. Refresh to try again.": "De host heeft niet geantwoord. Vernieuw om opnieuw te proberen.",
1584
1657
  "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
1658
  "The form preview could not be loaded. Refresh to try again.": "Het formuliervoorbeeld kon niet worden geladen. Vernieuw om opnieuw te proberen.",
1659
+ Changes: "Wijzigingen",
1660
+ "No changes": "Geen wijzigingen",
1661
+ "Show all": "Alles tonen",
1662
+ "Show XML changes": "XML-wijzigingen tonen",
1663
+ "Old version": "Oude versie",
1664
+ "New version": "Nieuwe versie",
1665
+ "Not in this version": "Niet in deze versie",
1666
+ "It was removed. The version on the left shows it.": "Het is verwijderd. De versie links toont het.",
1667
+ "It is new. The version on the right shows it.": "Het is nieuw. De versie rechts toont het.",
1586
1668
  "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
1669
  "A property cannot depend on itself.": "Een eigenschap kan niet van zichzelf afhangen.",
1588
1670
  "A regular expression the value must match.": "Een reguliere expressie waaraan de waarde moet voldoen.",
@@ -1794,6 +1876,7 @@ var l = {
1794
1876
  "pt-br": {
1795
1877
  "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
1878
  "Preview linked form": "Visualizar formulário vinculado",
1879
+ "Fit diagram to view": "Ajustar o diagrama à visualização",
1797
1880
  "Linked form preview": "Prévia do formulário vinculado",
1798
1881
  Refresh: "Atualizar",
1799
1882
  "Close form preview": "Fechar prévia do formulário",
@@ -1806,6 +1889,15 @@ var l = {
1806
1889
  "The host did not answer. Refresh to try again.": "O host não respondeu. Atualize para tentar novamente.",
1807
1890
  "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
1891
  "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.",
1892
+ Changes: "Alterações",
1893
+ "No changes": "Nenhuma alteração",
1894
+ "Show all": "Mostrar tudo",
1895
+ "Show XML changes": "Mostrar alterações no XML",
1896
+ "Old version": "Versão antiga",
1897
+ "New version": "Versão nova",
1898
+ "Not in this version": "Não está nesta versão",
1899
+ "It was removed. The version on the left shows it.": "Foi removido. A versão à esquerda o mostra.",
1900
+ "It is new. The version on the right shows it.": "É novo. A versão à direita o mostra.",
1809
1901
  "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
1902
  "A property cannot depend on itself.": "Uma propriedade não pode depender de si mesma.",
1811
1903
  "A regular expression the value must match.": "Uma expressão regular à qual o valor deve corresponder.",
@@ -2017,6 +2109,7 @@ var l = {
2017
2109
  ru: {
2018
2110
  "The linked form is missing or invalid. Check the form reference.": "Связанная форма отсутствует или недействительна. Проверьте ссылку на форму.",
2019
2111
  "Preview linked form": "Просмотреть связанную форму",
2112
+ "Fit diagram to view": "Вписать диаграмму в окно",
2020
2113
  "Linked form preview": "Предпросмотр связанной формы",
2021
2114
  Refresh: "Обновить",
2022
2115
  "Close form preview": "Закрыть предпросмотр формы",
@@ -2029,6 +2122,15 @@ var l = {
2029
2122
  "The host did not answer. Refresh to try again.": "Хост не ответил. Обновите для повторной попытки.",
2030
2123
  "The saved form is invalid or unsupported. Open it in the form editor.": "Сохранённая форма недопустима или не поддерживается. Откройте её в редакторе форм.",
2031
2124
  "The form preview could not be loaded. Refresh to try again.": "Не удалось загрузить предпросмотр формы. Обновите для повторной попытки.",
2125
+ Changes: "Изменения",
2126
+ "No changes": "Нет изменений",
2127
+ "Show all": "Показать все",
2128
+ "Show XML changes": "Показать изменения XML",
2129
+ "Old version": "Старая версия",
2130
+ "New version": "Новая версия",
2131
+ "Not in this version": "Нет в этой версии",
2132
+ "It was removed. The version on the left shows it.": "Элемент удалён. Он показан в версии слева.",
2133
+ "It is new. The version on the right shows it.": "Элемент новый. Он показан в версии справа.",
2032
2134
  "A form is either a form id or an external reference, not both.": "Форма задаётся либо ID формы, либо внешней ссылкой, но не обоими сразу.",
2033
2135
  "A property cannot depend on itself.": "Свойство не может зависеть от самого себя.",
2034
2136
  "A regular expression the value must match.": "Регулярное выражение, которому должно соответствовать значение.",
@@ -2240,6 +2342,7 @@ var l = {
2240
2342
  "zh-Hans": {
2241
2343
  "The linked form is missing or invalid. Check the form reference.": "关联的表单不存在或无效。请检查表单引用。",
2242
2344
  "Preview linked form": "预览关联表单",
2345
+ "Fit diagram to view": "使图表适合视图",
2243
2346
  "Linked form preview": "关联表单预览",
2244
2347
  Refresh: "刷新",
2245
2348
  "Close form preview": "关闭表单预览",
@@ -2252,6 +2355,15 @@ var l = {
2252
2355
  "The host did not answer. Refresh to try again.": "主机未响应。请刷新重试。",
2253
2356
  "The saved form is invalid or unsupported. Open it in the form editor.": "已保存的表单无效或不受支持。请在表单编辑器中打开。",
2254
2357
  "The form preview could not be loaded. Refresh to try again.": "无法加载表单预览。请刷新重试。",
2358
+ Changes: "更改",
2359
+ "No changes": "无更改",
2360
+ "Show all": "显示全部",
2361
+ "Show XML changes": "显示 XML 更改",
2362
+ "Old version": "旧版本",
2363
+ "New version": "新版本",
2364
+ "Not in this version": "此版本中不存在",
2365
+ "It was removed. The version on the left shows it.": "它已被删除。左侧版本中可以看到它。",
2366
+ "It is new. The version on the right shows it.": "它是新增的。右侧版本中可以看到它。",
2255
2367
  "A form is either a form id or an external reference, not both.": "表单只能使用表单 ID 或外部引用之一,不能同时使用两者。",
2256
2368
  "A property cannot depend on itself.": "属性不能依赖自身。",
2257
2369
  "A regular expression the value must match.": "值必须匹配的正则表达式。",
@@ -2463,6 +2575,7 @@ var l = {
2463
2575
  "zh-Hant": {
2464
2576
  "The linked form is missing or invalid. Check the form reference.": "連結的表單不存在或無效。請檢查表單參照。",
2465
2577
  "Preview linked form": "預覽關聯表單",
2578
+ "Fit diagram to view": "使圖表適合檢視",
2466
2579
  "Linked form preview": "關聯表單預覽",
2467
2580
  Refresh: "重新整理",
2468
2581
  "Close form preview": "關閉表單預覽",
@@ -2475,6 +2588,15 @@ var l = {
2475
2588
  "The host did not answer. Refresh to try again.": "主機未回應。請重新整理後再試。",
2476
2589
  "The saved form is invalid or unsupported. Open it in the form editor.": "已儲存的表單無效或不受支援。請在表單編輯器中開啟。",
2477
2590
  "The form preview could not be loaded. Refresh to try again.": "無法載入表單預覽。請重新整理後再試。",
2591
+ Changes: "變更",
2592
+ "No changes": "無變更",
2593
+ "Show all": "顯示全部",
2594
+ "Show XML changes": "顯示 XML 變更",
2595
+ "Old version": "舊版本",
2596
+ "New version": "新版本",
2597
+ "Not in this version": "此版本中不存在",
2598
+ "It was removed. The version on the left shows it.": "它已被刪除。左側版本中可以看到它。",
2599
+ "It is new. The version on the right shows it.": "它是新增的。右側版本中可以看到它。",
2478
2600
  "A form is either a form id or an external reference, not both.": "表單只能使用表單 ID 或外部引用之一,不能同時使用兩者。",
2479
2601
  "A property cannot depend on itself.": "屬性不能依賴自身。",
2480
2602
  "A regular expression the value must match.": "值必須符合的正規表達式。",
@@ -2683,8 +2805,8 @@ var l = {
2683
2805
  "Use the task definition": "使用工作定義",
2684
2806
  "Users cannot enter FEEL into a field they cannot edit.": "使用者無法在不可編輯的欄位中輸入 FEEL。"
2685
2807
  }
2686
- }, u = 10;
2687
- function d(e) {
2808
+ }, f = 10;
2809
+ function p(e) {
2688
2810
  let t = /* @__PURE__ */ new Set();
2689
2811
  function r(r) {
2690
2812
  let i = n((...e) => {
@@ -2705,7 +2827,7 @@ function d(e) {
2705
2827
  hasPending: () => t.size > 0,
2706
2828
  flush: () => {
2707
2829
  let e = [];
2708
- for (let n = 0; n < u && t.size > 0; n++) for (let n of [...t]) try {
2830
+ for (let n = 0; n < f && t.size > 0; n++) for (let n of [...t]) try {
2709
2831
  n.flush();
2710
2832
  } catch (t) {
2711
2833
  e.push(t);
@@ -2714,30 +2836,160 @@ function d(e) {
2714
2836
  }
2715
2837
  });
2716
2838
  }
2717
- //#endregion
2718
- //#region ../../libs/modeler-types/src/errors.ts
2719
- var f = class extends Error {
2839
+ // ../../libs/modeler-types/src/diffVocabulary.ts
2840
+ var m = [
2841
+ "added",
2842
+ "removed",
2843
+ "changed",
2844
+ "layoutChanged"
2845
+ ], h = {
2846
+ added: "diff-added",
2847
+ removed: "diff-removed",
2848
+ changed: "diff-changed",
2849
+ layoutChanged: "diff-layout-changed"
2850
+ }, g = "diff-selected", _ = {
2851
+ changes: "Changes",
2852
+ added: "Added",
2853
+ removed: "Removed",
2854
+ changed: "Changed",
2855
+ moved: "Moved",
2856
+ previous: "Prev change",
2857
+ next: "Next change",
2858
+ swap: "Swap sides",
2859
+ none: "No changes",
2860
+ showAll: "Show all"
2861
+ }, v = {
2862
+ added: _.added,
2863
+ removed: _.removed,
2864
+ changed: _.changed,
2865
+ layoutChanged: _.moved
2866
+ };
2867
+ // ../../libs/modeler-types/src/dom.ts
2868
+ function y(e, t, n) {
2869
+ let r = document.createElement(e);
2870
+ return r.className = t, n !== void 0 && (r.textContent = n), r;
2871
+ }
2872
+ function b(e, t, n) {
2873
+ let r = y("button", e, n);
2874
+ return r.type = "button", r.addEventListener("click", t), r;
2875
+ }
2876
+ // ../../libs/modeler-types/src/diffLegendView.ts
2877
+ var x, S = {
2878
+ added: "added",
2879
+ removed: "removed",
2880
+ changed: "changed",
2881
+ layoutChanged: "layout"
2882
+ };
2883
+ x = class e {
2884
+ constructor(t, n, r) {
2885
+ this.actions = n, this.translator = r, this.element = y("div", "diff-legend"), this.filename = y("div", "diff-legend__filename"), this.countsRow = y("div", "diff-legend__counts"), this.countSlots = m.map((t) => e.countSlot(t)), this.none = y("span", "diff-legend__none"), this.position = y("span", "diff-legend__position"), this.swapGroup = y("div", "diff-legend__swap-group"), this.previousButton = e.iconButton("diff-legend__prev-btn", e.CHEVRON_LEFT, n.onPrevious), this.nextButton = e.iconButton("diff-legend__next-btn", e.CHEVRON_RIGHT, n.onNext), this.showAllButton = b("diff-legend__nav-btn diff-legend__show-all-btn", () => this.actions.onShowAll?.()), this.swapButton = b("diff-legend__nav-btn diff-legend__swap-btn", () => this.actions.onSwap?.(), "⇄"), this.assemble(), t.append(this.element), this.renderWords(), this.stopTranslating = r.onChange(() => this.renderWords());
2886
+ }
2887
+ update(e) {
2888
+ this.state = e, this.element.hidden = !1, this.countsRow.hidden = e.showChanges === !1, this.enableStepping(e.canStep), this.swapGroup.hidden = !(e.showSwap && this.actions.onSwap), this.filename.hidden = !e.filename, this.filename.textContent = e.filename ?? "", this.showStatus(e.status), this.showCounts(e.counts), this.showPosition(e.position), this.renderWords();
2889
+ }
2890
+ reserveRoomOn(e) {
2891
+ typeof ResizeObserver < "u" && (this.sizeObserver?.disconnect(), this.sizeObserver = new ResizeObserver(() => {
2892
+ let t = this.element.offsetHeight;
2893
+ t > 0 && e.style.setProperty("--diff-legend-height", `${t}px`);
2894
+ }), this.sizeObserver.observe(this.element));
2895
+ }
2896
+ destroy() {
2897
+ this.stopTranslating(), this.sizeObserver?.disconnect(), this.element.remove();
2898
+ }
2899
+ assemble() {
2900
+ this.element.setAttribute("role", "toolbar"), this.element.hidden = !0, this.none.hidden = !0, this.position.hidden = !0, this.showAllButton.hidden = !this.actions.onShowAll, this.swapGroup.hidden = !0, this.swapGroup.append(this.swapButton);
2901
+ let e = y("div", "diff-legend__nav");
2902
+ e.append(this.previousButton, this.nextButton, this.position, this.showAllButton), this.countsRow.append(...this.countSlots.map(({ slot: e }) => e), this.none, e, this.swapGroup), this.element.append(this.filename, this.countsRow);
2903
+ }
2904
+ enableStepping(e) {
2905
+ for (let t of [
2906
+ this.previousButton,
2907
+ this.nextButton,
2908
+ this.showAllButton
2909
+ ]) t.disabled = !e;
2910
+ }
2911
+ showStatus(t) {
2912
+ t && (this.status ??= this.prependStatusSlot(), this.status.swatch.className = e.swatchClass(t)), this.status && (this.status.slot.hidden = !t);
2913
+ }
2914
+ showCounts(t) {
2915
+ for (let { category: e, slot: n, count: r } of this.countSlots) {
2916
+ let i = t?.[e] ?? 0;
2917
+ n.hidden = i === 0, r.textContent = String(i);
2918
+ }
2919
+ this.none.hidden = !t || e.hasChanges(t);
2920
+ }
2921
+ showPosition(e) {
2922
+ this.position.hidden = !e, this.position.textContent = e ? `${e.index + 1}/${e.total}` : "";
2923
+ }
2924
+ prependStatusSlot() {
2925
+ let t = e.statusSlot();
2926
+ return this.countsRow.prepend(t.slot), t;
2927
+ }
2928
+ renderWords() {
2929
+ let t = (e) => this.translator.translate(e);
2930
+ this.element.setAttribute("aria-label", t(_.changes));
2931
+ for (let { category: e, label: n } of this.countSlots) n.data = `${t(v[e])} `;
2932
+ let n = this.state?.status;
2933
+ this.status && (this.status.label.data = n ? t(v[n]) : ""), this.none.textContent = t(_.none), this.showAllButton.textContent = t(_.showAll), e.nameIconButton(this.previousButton, t(_.previous)), e.nameIconButton(this.nextButton, t(_.next)), e.nameIconButton(this.swapButton, t(_.swap));
2934
+ }
2935
+ static hasChanges(e) {
2936
+ return m.some((t) => e[t] > 0);
2937
+ }
2938
+ static nameIconButton(e, t) {
2939
+ e.title = t, e.setAttribute("aria-label", t);
2940
+ }
2941
+ static iconButton(t, n, r) {
2942
+ let i = b(`diff-legend__nav-btn ${t}`, r);
2943
+ return i.append(e.chevron(n)), i;
2944
+ }
2945
+ static chevron(e) {
2946
+ let t = "http://www.w3.org/2000/svg", n = document.createElementNS(t, "svg");
2947
+ n.setAttribute("viewBox", "0 0 24 24"), n.setAttribute("aria-hidden", "true"), n.classList.add("diff-legend__icon");
2948
+ let r = document.createElementNS(t, "path");
2949
+ return r.setAttribute("d", e), n.append(r), n;
2950
+ }
2951
+ static countSlot(t) {
2952
+ let n = y("div", `diff-legend__slot diff-legend__slot--${S[t]}`), r = y("span", "diff-legend__label"), i = document.createTextNode(""), a = y("b", "diff-legend__count");
2953
+ return r.append(i, a), n.append(y("span", e.swatchClass(t)), r), {
2954
+ category: t,
2955
+ slot: n,
2956
+ label: i,
2957
+ count: a
2958
+ };
2959
+ }
2960
+ static statusSlot() {
2961
+ let e = y("div", "diff-legend__slot diff-legend__slot--status"), t = y("span", "diff-legend__swatch"), n = y("span", "diff-legend__label"), r = document.createTextNode("");
2962
+ return n.append(r), e.append(t, n), {
2963
+ slot: e,
2964
+ swatch: t,
2965
+ label: r
2966
+ };
2967
+ }
2968
+ static swatchClass(e) {
2969
+ return `diff-legend__swatch diff-legend__swatch--${S[e]}`;
2970
+ }
2971
+ }, x.CHEVRON_LEFT = "m15 18-6-6 6-6", x.CHEVRON_RIGHT = "m9 18 6-6-6-6";
2972
+ // ../../libs/modeler-types/src/errors.ts
2973
+ var C = class extends Error {
2720
2974
  constructor() {
2721
2975
  super("Modeler is not initialized!");
2722
2976
  }
2723
2977
  };
2724
- //#endregion
2725
- //#region ../../libs/modeler-types/src/canvasResize.ts
2726
- function p(e, t, n = {}) {
2727
- let r = n.createObserver ?? m();
2978
+ // ../../libs/modeler-types/src/canvasResize.ts
2979
+ function w(e, t, n = {}) {
2980
+ let r = n.createObserver ?? te();
2728
2981
  if (!r) return () => void 0;
2729
2982
  let i = n.applyInitialViewport === void 0, a = r(() => {
2730
2983
  e.resized(), i ||= n.applyInitialViewport();
2731
2984
  });
2732
2985
  return a.observe(t), () => a.disconnect();
2733
2986
  }
2734
- function m() {
2987
+ function te() {
2735
2988
  let e = globalThis.ResizeObserver;
2736
2989
  return e ? (t) => new e(t) : void 0;
2737
2990
  }
2738
- //#endregion
2739
- //#region ../../libs/modeler-types/src/disposableStore.ts
2740
- var h = class {
2991
+ // ../../libs/modeler-types/src/disposableStore.ts
2992
+ var T = class {
2741
2993
  constructor() {
2742
2994
  this.disposers = [], this.disposed = !1;
2743
2995
  }
@@ -2759,7 +3011,7 @@ var h = class {
2759
3011
  }
2760
3012
  if (n) throw t;
2761
3013
  }
2762
- }, g = class {
3014
+ }, E = class {
2763
3015
  constructor() {
2764
3016
  this.disposed = !1;
2765
3017
  }
@@ -2772,22 +3024,44 @@ var h = class {
2772
3024
  let e = this.current;
2773
3025
  this.current = void 0, e?.();
2774
3026
  }
2775
- }, _ = "<svg class=\"canvas-focus-indicator__off\" viewBox=\"0 -960 960 960\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M367-367q-47-47-47-113t47-113q47-47 113-47t113 47q47 47 47 113t-47 113q-47 47-113 47t-113-47Zm169.5-56.5Q560-447 560-480t-23.5-56.5Q513-560 480-560t-56.5 23.5Q400-513 400-480t23.5 56.5Q447-400 480-400t56.5-23.5ZM480-480ZM200-120q-33 0-56.5-23.5T120-200v-160h80v160h160v80H200Zm400 0v-80h160v-160h80v160q0 33-23.5 56.5T760-120H600ZM120-600v-160q0-33 23.5-56.5T200-840h160v80H200v160h-80Zm640 0v-160H600v-80h160q33 0 56.5 23.5T840-760v160h-80Z\"/></svg>", v = "<svg class=\"canvas-focus-indicator__on\" viewBox=\"0 -960 960 960\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M200-120q-33 0-56.5-23.5T120-200v-160h80v160h160v80H200Zm400 0v-80h160v-160h80v160q0 33-23.5 56.5T760-120H600ZM120-600v-160q0-33 23.5-56.5T200-840h160v80H200v160h-80Zm640 0v-160H600v-80h160q33 0 56.5 23.5T840-760v160h-80ZM338.5-338.5Q280-397 280-480t58.5-141.5Q397-680 480-680t141.5 58.5Q680-563 680-480t-58.5 141.5Q563-280 480-280t-141.5-58.5Z\"/></svg>";
2776
- function y(e) {
2777
- let t = document.createElement("div");
2778
- t.className = "canvas-focus-indicator", t.setAttribute("aria-hidden", "true"), t.innerHTML = _ + v;
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();
3027
+ }, D = 40, O = 30;
3028
+ function k(e) {
3029
+ let { outer: t } = e.viewbox();
3030
+ return t.width >= 40 && t.height >= 40;
3031
+ }
3032
+ function ne(e) {
3033
+ if (!k(e)) return !1;
3034
+ let { inner: t, outer: n } = e.viewbox();
3035
+ if (!t.width || !t.height) return e.zoom("fit-viewport"), !0;
3036
+ let r = n.width / 4, i = n.height / 4, a = {
3037
+ top: Math.min(D, i),
3038
+ right: Math.min(D, r),
3039
+ bottom: Math.min(D, i),
3040
+ left: Math.min(re(e.getContainer()) + D, r)
3041
+ }, 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;
3042
+ return e.viewbox({
3043
+ x: t.x - l / c,
3044
+ y: t.y - u / c,
3045
+ width: n.width / c,
3046
+ height: n.height / c
3047
+ }), !0;
3048
+ }
3049
+ function re(e) {
3050
+ let t = e.querySelector(".djs-palette");
3051
+ return t ? t.getBoundingClientRect().right - e.getBoundingClientRect().left : O;
2787
3052
  }
2788
- //#endregion
2789
- //#region ../../libs/modeler-types/src/surfaceTheme.ts
2790
- var b = class {
3053
+ // ../../libs/modeler-types/src/fitViewportButton.ts
3054
+ var ie = "<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>";
3055
+ function ae({ parent: e, label: t, fit: n, focusCanvas: r, isCanvasFocused: i, onCanvasFocusChanged: a }) {
3056
+ let o = document.createElement("button");
3057
+ return o.type = "button", o.className = "fit-viewport-button", o.title = t, o.setAttribute("aria-label", t), o.innerHTML = ie, o.addEventListener("click", (e) => {
3058
+ n(), e.detail > 0 && r();
3059
+ }), o.toggleAttribute("data-canvas-focused", i()), a((e) => {
3060
+ o.toggleAttribute("data-canvas-focused", e);
3061
+ }), e.append(o), () => o.remove();
3062
+ }
3063
+ // ../../libs/modeler-types/src/surfaceTheme.ts
3064
+ var A = class {
2791
3065
  constructor(e, t) {
2792
3066
  this.scopeRoots = e, this.attribute = t, this.disposed = !1;
2793
3067
  }
@@ -2800,11 +3074,11 @@ var b = class {
2800
3074
  }
2801
3075
  apply(e) {
2802
3076
  for (let t of this.scopeRoots) t.setAttribute(this.attribute, e);
2803
- x(e);
3077
+ oe(e);
2804
3078
  }
2805
3079
  startFollowingPreferredScheme() {
2806
3080
  let e = window.matchMedia("(prefers-color-scheme: dark)");
2807
- this.apply(e.matches ? "dark" : "light"), !this.mediaListener && (this.mediaQuery = e, this.mediaListener = (e) => {
3081
+ this.apply(e.matches ? "dark" : "light"), this.mediaListener || (this.mediaQuery = e, this.mediaListener = (e) => {
2808
3082
  this.mode === "automatic" && this.apply(e.matches ? "dark" : "light");
2809
3083
  }, this.mediaQuery.addEventListener("change", this.mediaListener));
2810
3084
  }
@@ -2812,53 +3086,48 @@ var b = class {
2812
3086
  this.mediaQuery && this.mediaListener && this.mediaQuery.removeEventListener("change", this.mediaListener), this.mediaQuery = void 0, this.mediaListener = void 0;
2813
3087
  }
2814
3088
  };
2815
- function x(e) {
3089
+ function oe(e) {
2816
3090
  let t = document.querySelector("#theme-link");
2817
3091
  if (!t) return;
2818
3092
  let n = t.href, r = n.split("/").pop();
2819
3093
  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
3094
  }
2821
- //#endregion
2822
- //#region \0@oxc-project+runtime@0.153.0/helpers/esm/typeof.js
2823
- function S(e) {
3095
+ // \0@oxc-project+runtime@0.156.0/helpers/esm/typeof.js
3096
+ function j(e) {
2824
3097
  "@babel/helpers - typeof";
2825
- return S = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
3098
+ return j = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
2826
3099
  return typeof e;
2827
3100
  } : function(e) {
2828
3101
  return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
2829
- }, S(e);
3102
+ }, j(e);
2830
3103
  }
2831
- //#endregion
2832
- //#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPrimitive.js
2833
- function C(e, t) {
2834
- if (S(e) != "object" || !e) return e;
3104
+ // \0@oxc-project+runtime@0.156.0/helpers/esm/toPrimitive.js
3105
+ function se(e, t) {
3106
+ if (j(e) != "object" || !e) return e;
2835
3107
  var n = e[Symbol.toPrimitive];
2836
3108
  if (n !== void 0) {
2837
3109
  var r = n.call(e, t || "default");
2838
- if (S(r) != "object") return r;
3110
+ if (j(r) != "object") return r;
2839
3111
  throw TypeError("@@toPrimitive must return a primitive value.");
2840
3112
  }
2841
3113
  return (t === "string" ? String : Number)(e);
2842
3114
  }
2843
- //#endregion
2844
- //#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPropertyKey.js
2845
- function w(e) {
2846
- var t = C(e, "string");
2847
- return S(t) == "symbol" ? t : t + "";
3115
+ // \0@oxc-project+runtime@0.156.0/helpers/esm/toPropertyKey.js
3116
+ function M(e) {
3117
+ var t = se(e, "string");
3118
+ return j(t) == "symbol" ? t : t + "";
2848
3119
  }
2849
- //#endregion
2850
- //#region \0@oxc-project+runtime@0.153.0/helpers/esm/defineProperty.js
2851
- function T(e, t, n) {
2852
- return (t = w(t)) in e ? Object.defineProperty(e, t, {
3120
+ // \0@oxc-project+runtime@0.156.0/helpers/esm/defineProperty.js
3121
+ function N(e, t, n) {
3122
+ return (t = M(t)) in e ? Object.defineProperty(e, t, {
2853
3123
  value: n,
2854
3124
  enumerable: !0,
2855
3125
  configurable: !0,
2856
3126
  writable: !0
2857
3127
  }) : e[t] = n, e;
2858
3128
  }
2859
- //#endregion
2860
- //#region src/modeler.ts
2861
- var E = {
3129
+ // src/modeler.ts
3130
+ var P = {
2862
3131
  options: [
2863
3132
  {
2864
3133
  value: "feel",
@@ -2886,18 +3155,18 @@ var E = {
2886
3155
  }
2887
3156
  ],
2888
3157
  defaults: { editor: "feel" }
2889
- }, D = "data-dmn-theme", O = [
3158
+ }, F = "data-dmn-theme", I = [
2890
3159
  "string",
2891
3160
  "boolean",
2892
3161
  "integer",
2893
3162
  "long",
2894
3163
  "double",
2895
3164
  "date"
2896
- ], k = 600, A = 300, j = class {
3165
+ ], L = 600, R = 300, z = class {
2897
3166
  constructor(t, n) {
2898
- T(this, "container", void 0), T(this, "options", void 0), T(this, "modeler", void 0), T(this, "store", new h()), T(this, "focusIndicator", new g()), T(this, "commandStackBinding", new g()), T(this, "propertiesPanelInput", d(k)), T(this, "viewEditorInput", d(A)), T(this, "activeEventBus", void 0), T(this, "themeController", void 0), T(this, "handleViewsChanged", (e) => {
3167
+ N(this, "container", void 0), N(this, "options", void 0), N(this, "modeler", void 0), N(this, "store", new T()), N(this, "canvasOverlays", new E()), N(this, "commandStackBinding", new E()), N(this, "propertiesPanelInput", p(L)), N(this, "viewEditorInput", p(R)), N(this, "activeEventBus", void 0), N(this, "themeController", void 0), N(this, "handleViewsChanged", (e) => {
2899
3168
  this.store.isDisposed || (this.bindActiveViewer(), this.options.onViewChanged?.(e));
2900
- }), T(this, "handleContentChanged", () => {
3169
+ }), N(this, "handleContentChanged", () => {
2901
3170
  this.store.isDisposed || this.options.onContentChanged?.();
2902
3171
  }), this.container = t, this.options = n;
2903
3172
  let l = n.additionalModules ?? {};
@@ -2914,40 +3183,40 @@ var E = {
2914
3183
  o,
2915
3184
  i,
2916
3185
  s.decisionRequirementsDiagram,
2917
- M(this.propertiesPanelInput),
3186
+ B(this.propertiesPanelInput),
2918
3187
  ...l.drd ?? []
2919
3188
  ]
2920
3189
  },
2921
3190
  decisionTable: { additionalModules: [
2922
3191
  e,
2923
3192
  s.decisionTable,
2924
- M(this.viewEditorInput),
3193
+ B(this.viewEditorInput),
2925
3194
  ...l.decisionTable ?? []
2926
3195
  ] },
2927
3196
  literalExpression: { additionalModules: [
2928
3197
  e,
2929
- M(this.viewEditorInput),
3198
+ B(this.viewEditorInput),
2930
3199
  ...l.literalExpression ?? []
2931
3200
  ] },
2932
3201
  boxedExpression: { additionalModules: [
2933
3202
  e,
2934
- M(this.viewEditorInput),
3203
+ B(this.viewEditorInput),
2935
3204
  ...l.boxedExpression ?? []
2936
3205
  ] },
2937
3206
  common: {
2938
- expressionLanguages: n.expressionLanguages ?? E,
2939
- dataTypes: n.dataTypes ?? O,
3207
+ expressionLanguages: n.expressionLanguages ?? P,
3208
+ dataTypes: n.dataTypes ?? I,
2940
3209
  keyboard: n.keyboard
2941
3210
  },
2942
3211
  moddleExtensions: {
2943
3212
  camunda: c,
2944
3213
  ...n.moddleExtensions
2945
3214
  }
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(p({ resized: () => {
3215
+ }), 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(w({ resized: () => {
2947
3216
  this.store.isDisposed || this.getActiveCanvas()?.resized();
2948
3217
  } }, t)), this.store.add(() => {
2949
3218
  this.commandStackBinding.dispose(), this.activeEventBus = void 0;
2950
- }, () => this.focusIndicator.dispose());
3219
+ }, () => this.canvasOverlays.dispose());
2951
3220
  }
2952
3221
  async loadDiagram(e) {
2953
3222
  this.assertLive();
@@ -2955,7 +3224,7 @@ var E = {
2955
3224
  let t = await this.modeler.importXML(e);
2956
3225
  return this.bindActiveViewer(), this.reportWarnings(t.warnings), t;
2957
3226
  } catch (e) {
2958
- throw N("Unable to import DMN", e);
3227
+ throw V("Unable to import DMN", e);
2959
3228
  }
2960
3229
  }
2961
3230
  async exportDiagram() {
@@ -2976,7 +3245,7 @@ var E = {
2976
3245
  let t = await this.modeler.open(e);
2977
3246
  return this.bindActiveViewer(), this.reportWarnings(t.warnings), t;
2978
3247
  } catch (t) {
2979
- throw N(`Unable to open DMN view <${e.id}>`, t);
3248
+ throw V(`Unable to open DMN view <${e.id}>`, t);
2980
3249
  }
2981
3250
  }
2982
3251
  isDrdViewActive() {
@@ -3000,7 +3269,7 @@ var E = {
3000
3269
  setTheme(e) {
3001
3270
  if (!this.store.isDisposed) {
3002
3271
  if (!this.themeController) {
3003
- let e = new b([this.container, this.options.propertiesPanel.parent], D);
3272
+ let e = new A([this.container, this.options.propertiesPanel.parent], F);
3004
3273
  this.themeController = e, this.store.add(() => e.dispose());
3005
3274
  }
3006
3275
  this.themeController.setMode(e);
@@ -3028,21 +3297,24 @@ var E = {
3028
3297
  bindActiveViewer() {
3029
3298
  if (this.store.isDisposed) return;
3030
3299
  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.syncCanvasFocusIndicator());
3300
+ 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
3301
  }
3033
- syncCanvasFocusIndicator() {
3034
- if (this.focusIndicator.set(void 0), this.modeler.getActiveView()?.type !== "drd") return;
3035
- let e = this.getActiveViewer(), t = e?.get("canvas", !1), n = e?.get("selection", !1), r = e?.get("eventBus", !1);
3036
- t && n && r && this.focusIndicator.set(y({
3302
+ syncCanvasOverlays() {
3303
+ if (this.canvasOverlays.set(void 0), this.modeler.getActiveView()?.type !== "drd") return;
3304
+ let e = this.getActiveViewer(), t = e?.get("canvas", !1), n = e?.get("translate", !1), r = e?.get("eventBus", !1);
3305
+ if (!t || !n || !r) return;
3306
+ let i = new T();
3307
+ i.add(ae({
3037
3308
  parent: t.getContainer(),
3038
- isFocused: () => t.isFocused(),
3039
- onFocusChanged: (e) => r.on("canvas.focus.changed", (t) => e(t.focused)),
3040
- hasSelection: () => n.get().length > 0,
3041
- onSelectionChanged: (e) => r.on("selection.changed", (t) => e(t.newSelection.length > 0))
3042
- }));
3309
+ label: n("Fit diagram to view"),
3310
+ fit: () => ne(t),
3311
+ focusCanvas: () => t.focus(),
3312
+ isCanvasFocused: () => t.isFocused(),
3313
+ onCanvasFocusChanged: (e) => r.on("canvas.focus.changed", (t) => e(t.focused))
3314
+ })), this.canvasOverlays.set(() => i.dispose());
3043
3315
  }
3044
3316
  reportWarnings(e) {
3045
- if (!this.store.isDisposed) for (let t of e) this.options.onWarning?.(F(t));
3317
+ if (!this.store.isDisposed) for (let t of e) this.options.onWarning?.(U(t));
3046
3318
  }
3047
3319
  getActiveViewer() {
3048
3320
  return this.modeler.getActiveViewer();
@@ -3057,33 +3329,32 @@ var E = {
3057
3329
  if (this.modeler.getActiveView()?.type === "drd") return this.getActiveViewer()?.get("canvas", !1);
3058
3330
  }
3059
3331
  assertLive() {
3060
- if (this.store.isDisposed) throw new f();
3332
+ if (this.store.isDisposed) throw new C();
3061
3333
  }
3062
3334
  };
3063
- function M(e) {
3335
+ function B(e) {
3064
3336
  return { debounceInput: ["value", e] };
3065
3337
  }
3066
- function N(e, t) {
3067
- let n = t instanceof Error ? t.message : String(t), r = P(t).map(F).filter(Boolean), i = r.length > 0 ? `\n${r.join("\n")}` : "";
3338
+ function V(e, t) {
3339
+ let n = t instanceof Error ? t.message : String(t), r = H(t).map(U).filter(Boolean), i = r.length > 0 ? `\n${r.join("\n")}` : "";
3068
3340
  return Error(`${e}: ${n}${i}`, { cause: t });
3069
3341
  }
3070
- function P(e) {
3342
+ function H(e) {
3071
3343
  if (typeof e != "object" || !e || !("warnings" in e)) return [];
3072
3344
  let t = e.warnings;
3073
3345
  return Array.isArray(t) ? t : [];
3074
3346
  }
3075
- function F(e) {
3347
+ function U(e) {
3076
3348
  return [
3077
3349
  e.message,
3078
3350
  e.error?.message,
3079
3351
  e.error?.stack
3080
3352
  ].filter((e) => !!e).join("\n");
3081
3353
  }
3082
- //#endregion
3083
- //#region src/createModeler.ts
3084
- async function I(e, n) {
3085
- t.extend(l);
3086
- let r = new j(e, n);
3354
+ // src/createModeler.ts
3355
+ async function W(e, n) {
3356
+ t.extend(d);
3357
+ let r = new z(e, n);
3087
3358
  try {
3088
3359
  r.setTheme(n.theme ?? "automatic"), n.locale && t.setLanguage(n.locale);
3089
3360
  } catch (e) {
@@ -3094,5 +3365,355 @@ async function I(e, n) {
3094
3365
  }
3095
3366
  return r;
3096
3367
  }
3097
- //#endregion
3098
- export { f as NoModelerError, I as createModeler };
3368
+ // src/diff/diffMarks.ts
3369
+ function G(e, t) {
3370
+ if (e.added.includes(t)) return "added";
3371
+ if (e.removed.includes(t)) return "removed";
3372
+ if (e.expressions.includes(t)) return "changed";
3373
+ }
3374
+ function ce(e, t, n) {
3375
+ let r = K(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;
3376
+ return [
3377
+ q(r.rows(s.added), i("added", 16)),
3378
+ q(r.ruleNumbers(s.added), a("added")),
3379
+ q(r.rows(s.removed), i("removed", 14)),
3380
+ q(r.ruleNumbers(s.removed), a("removed")),
3381
+ q(r.ruleNumbers(s.changed), a("changed")),
3382
+ q(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;"),
3383
+ q(r.ruleNumbers(s.moved).map((e) => `${e}::after`), "content: \" ↕\"; color: var(--dmn-diff-moved);"),
3384
+ q(r.cells(t.cells), `${i("changed", 18)} ${o("changed")}`),
3385
+ q(r.annotations(t.annotations), `${i("changed", 18)} ${o("changed")}`),
3386
+ q(r.columnCells(c.added), i("added", 10)),
3387
+ q(r.headers(c.added), "box-shadow: inset 0 3px 0 var(--dmn-diff-added);"),
3388
+ q(r.columnCells(c.removed), i("removed", 10)),
3389
+ q(r.headers(c.removed), "box-shadow: inset 0 3px 0 var(--dmn-diff-removed);"),
3390
+ q(r.headers(c.changed), `${i("changed", 18)} ${o("changed")}`),
3391
+ q(t.properties.length > 0 ? [`${e} .hit-policy`] : [], `${i("changed", 18)} ${o("changed")}`)
3392
+ ].join("");
3393
+ }
3394
+ function le(e, t, n) {
3395
+ if (!t) return "";
3396
+ let r = K(e, n), i = {
3397
+ rule: [`${e} tr:has(> td[data-row-id="${J(t.id)}"])`],
3398
+ column: r.columnCells([t.id]),
3399
+ table: [`${e} .hit-policy`]
3400
+ }[t.kind];
3401
+ return q(i, "outline: 2px solid var(--dmn-diff-current); outline-offset: -2px;");
3402
+ }
3403
+ function K(e, t) {
3404
+ let n = (t) => (n) => n.map((n) => `${e} ${t(J(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)];
3405
+ return {
3406
+ rows: n((e) => `td[data-row-id="${e}"]`),
3407
+ ruleNumbers: n((e) => `td.rule-index[data-row-id="${e}"]`),
3408
+ cells: n((e) => `td[data-element-id="${e}"]`),
3409
+ annotations: n((e) => `td.annotation[data-element-id="${e}"]`),
3410
+ headers: i,
3411
+ columnCells: (e) => [...n((e) => `td[data-col-id="${e}"]`)(e), ...i(e)]
3412
+ };
3413
+ }
3414
+ function q(e, t) {
3415
+ return e.length > 0 ? `${e.join(",\n")} { ${t} }\n` : "";
3416
+ }
3417
+ function J(e) {
3418
+ return e.replace(/["\\]/g, "\\$&");
3419
+ }
3420
+ // src/diff/DmnDiffViewer.ts
3421
+ var Y = "dmn-diff-counts", ue = 80, X = 0, de = class {
3422
+ constructor(t, n = 0) {
3423
+ N(this, "container", void 0), N(this, "topInset", void 0), N(this, "viewer", void 0), N(this, "store", new T()), N(this, "style", void 0), N(this, "scope", void 0), N(this, "viewListeners", /* @__PURE__ */ new Set()), N(this, "viewportListeners", /* @__PURE__ */ new Set()), N(this, "scrollListeners", /* @__PURE__ */ new Set()), N(this, "boundDrdBuses", /* @__PURE__ */ new WeakSet()), N(this, "marks", void 0), N(this, "markOptions", {}), N(this, "focused", void 0), N(this, "selectedOnCanvas", void 0), N(this, "announcedView", null), N(this, "openingView", !1), N(this, "movingViewport", !1), N(this, "expectedScroll", void 0), N(this, "viewportTimer", void 0), N(this, "drdViewport", void 0), N(this, "themeController", void 0), this.container = t, this.topInset = n, X += 1, this.scope = `[data-dmn-diff="${X}"]`, t.classList.add("dmn-diff"), t.dataset.dmnDiff = String(X), this.style = document.createElement("style"), t.append(this.style), this.viewer = new l({
3424
+ container: t,
3425
+ drd: { additionalModules: [
3426
+ e,
3427
+ ee,
3428
+ u
3429
+ ] },
3430
+ decisionTable: { additionalModules: [e] },
3431
+ literalExpression: { additionalModules: [e] },
3432
+ boxedExpression: { additionalModules: [e] },
3433
+ moddleExtensions: { camunda: c }
3434
+ });
3435
+ let r = () => {
3436
+ this.placeDrd(), this.applyMarks();
3437
+ }, i = () => this.notifyViewChanged(), a = (e) => this.onScroll(e);
3438
+ 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(), w({ resized: () => this.drd()?.canvas.resized() }, t));
3439
+ }
3440
+ async importXML(e) {
3441
+ this.openingView = !0;
3442
+ try {
3443
+ await this.viewer.importXML(e);
3444
+ } finally {
3445
+ this.openingView = !1;
3446
+ }
3447
+ this.announcedView = this.getActiveElementId();
3448
+ }
3449
+ setMarks(e, t = {}) {
3450
+ this.marks = e, this.markOptions = t, this.applyMarks();
3451
+ }
3452
+ async openView(e) {
3453
+ let t = this.viewer.getViews().find((t) => e === null ? t.type === "drd" : t.element.id === e);
3454
+ if (!t) return !1;
3455
+ if (this.announcedView = e, t !== this.viewer.getActiveView()) {
3456
+ this.openingView = !0;
3457
+ try {
3458
+ await this.viewer.open(t);
3459
+ } finally {
3460
+ this.openingView = !1;
3461
+ }
3462
+ }
3463
+ return !0;
3464
+ }
3465
+ getActiveElementId() {
3466
+ let e = this.viewer.getActiveView();
3467
+ return !e || e.type === "drd" ? null : e.element.id;
3468
+ }
3469
+ getViewStatus() {
3470
+ let e = this.activeElement();
3471
+ return e && this.statusOf(e);
3472
+ }
3473
+ onViewChanged(e) {
3474
+ return $(this.viewListeners, e);
3475
+ }
3476
+ focus(e) {
3477
+ this.focused = e, this.applyMarks(), e !== void 0 && this.reveal(e);
3478
+ }
3479
+ showWholeView() {
3480
+ this.focus(void 0), this.drd() ? (this.drdViewport = void 0, this.placeDrd()) : this.setTableScroll({
3481
+ offset: 0,
3482
+ left: 0
3483
+ });
3484
+ }
3485
+ reveal(e) {
3486
+ let t = this.drd();
3487
+ t ? this.centerOn(t, e) : this.scrollTableTo(e);
3488
+ }
3489
+ getViewport() {
3490
+ let e = this.drd()?.canvas.viewbox();
3491
+ return e && {
3492
+ x: e.x,
3493
+ y: e.y,
3494
+ width: e.width,
3495
+ height: e.height
3496
+ };
3497
+ }
3498
+ setViewport(e) {
3499
+ let t = this.drd()?.canvas;
3500
+ if (t) {
3501
+ this.movingViewport = !0;
3502
+ try {
3503
+ t.viewbox(e), this.drdViewport = e;
3504
+ } finally {
3505
+ this.movingViewport = !1;
3506
+ }
3507
+ }
3508
+ }
3509
+ onViewportChanged(e) {
3510
+ return $(this.viewportListeners, e);
3511
+ }
3512
+ getTableScroll() {
3513
+ let e = this.scroller();
3514
+ if (!e) return;
3515
+ let t = new Set(this.sideOnlyRules()), n = this.ruleNumberCells().find((n) => !t.has(n.dataset.rowId ?? "") && Q(e, n) + n.offsetHeight > e.scrollTop);
3516
+ return n ? {
3517
+ rule: n.dataset.rowId,
3518
+ offset: e.scrollTop - Q(e, n),
3519
+ left: e.scrollLeft
3520
+ } : {
3521
+ offset: e.scrollTop,
3522
+ left: e.scrollLeft
3523
+ };
3524
+ }
3525
+ setTableScroll(e) {
3526
+ let t = this.scroller();
3527
+ if (!t) return;
3528
+ let n = e.rule ? this.ruleNumberCells().find((t) => t.dataset.rowId === e.rule) : void 0, r = (n ? Q(t, n) : 0) + e.offset;
3529
+ this.expectedScroll = {
3530
+ top: Math.round(r),
3531
+ left: Math.round(e.left)
3532
+ }, t.scrollTo({
3533
+ top: r,
3534
+ left: e.left
3535
+ });
3536
+ }
3537
+ onTableScroll(e) {
3538
+ return $(this.scrollListeners, e);
3539
+ }
3540
+ setTheme(e) {
3541
+ if (!this.themeController) {
3542
+ let e = new A([this.container], "data-dmn-theme");
3543
+ this.themeController = e, this.store.add(() => e.dispose());
3544
+ }
3545
+ this.themeController.setMode(e);
3546
+ }
3547
+ async setLocale(e) {
3548
+ let n = t.getLocale();
3549
+ t.setLanguage(e);
3550
+ let r = this.viewer.getActiveView();
3551
+ if (t.getLocale() !== n && r) {
3552
+ this.openingView = !0;
3553
+ try {
3554
+ await this.viewer.open(r);
3555
+ } finally {
3556
+ this.openingView = !1;
3557
+ }
3558
+ }
3559
+ }
3560
+ destroy() {
3561
+ this.viewListeners.clear(), this.viewportListeners.clear(), this.scrollListeners.clear(), this.store.dispose();
3562
+ }
3563
+ drd() {
3564
+ if (this.viewer.getActiveView()?.type !== "drd") return;
3565
+ let e = this.viewer.getActiveViewer();
3566
+ if (e) return {
3567
+ canvas: e.get("canvas"),
3568
+ elementRegistry: e.get("elementRegistry"),
3569
+ overlays: e.get("overlays"),
3570
+ eventBus: e.get("eventBus")
3571
+ };
3572
+ }
3573
+ activeElement() {
3574
+ let e = this.viewer.getActiveView();
3575
+ return e && e.type !== "drd" ? e.element : void 0;
3576
+ }
3577
+ applyMarks() {
3578
+ let e = this.drd(), t = this.activeElement();
3579
+ this.style.textContent = "", delete this.container.dataset.dmnDiffView, e ? this.markDrd(e) : t && this.markView(t);
3580
+ }
3581
+ markDrd(e) {
3582
+ this.bindViewport(e);
3583
+ let t = this.marks;
3584
+ if (t) {
3585
+ for (let n of m) for (let r of t[n]) e.elementRegistry.get(r) && e.canvas.addMarker(r, h[n]);
3586
+ 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: Y }), this.markOptions.countBadges) for (let [n, r] of Object.entries(t.tables)) e.elementRegistry.get(n) && e.overlays.add(n, Y, {
3587
+ position: {
3588
+ top: -11,
3589
+ right: 8
3590
+ },
3591
+ html: pe(r.counts)
3592
+ });
3593
+ }
3594
+ }
3595
+ markView(e) {
3596
+ let t = this.statusOf(e);
3597
+ t && (this.container.dataset.dmnDiffView = t);
3598
+ let n = this.marks?.tables[e.id];
3599
+ if (!n) return;
3600
+ let r = fe(e);
3601
+ this.style.textContent = ce(this.scope, n, r) + le(this.scope, this.tableFocus(n), r);
3602
+ }
3603
+ statusOf(e) {
3604
+ return this.marks && G(this.marks, e.id);
3605
+ }
3606
+ tableFocus(e) {
3607
+ let t = this.focused;
3608
+ if (t === void 0) return;
3609
+ if (t === e.attributesStep) return {
3610
+ kind: "table",
3611
+ id: t
3612
+ };
3613
+ let { columns: n } = e;
3614
+ return [
3615
+ ...n.added,
3616
+ ...n.removed,
3617
+ ...n.changed
3618
+ ].includes(t) ? {
3619
+ kind: "column",
3620
+ id: t
3621
+ } : {
3622
+ kind: "rule",
3623
+ id: t
3624
+ };
3625
+ }
3626
+ bindViewport(e) {
3627
+ this.boundDrdBuses.has(e.eventBus) || (this.boundDrdBuses.add(e.eventBus), e.eventBus.on("canvas.viewbox.changed", () => {
3628
+ this.movingViewport || this.openingView || (this.drdViewport = this.getViewport(), clearTimeout(this.viewportTimer), this.viewportTimer = setTimeout(() => {
3629
+ let e = this.getViewport();
3630
+ e && this.viewportListeners.forEach((t) => t(e));
3631
+ }, ue));
3632
+ }));
3633
+ }
3634
+ placeDrd() {
3635
+ let e = this.drd();
3636
+ if (!e) return;
3637
+ if (this.drdViewport) {
3638
+ this.setViewport(this.drdViewport);
3639
+ return;
3640
+ }
3641
+ let { inner: t, outer: n } = e.canvas.viewbox();
3642
+ if (!n.width || !n.height || !t.width || !t.height) return;
3643
+ let r = Math.min(1, (n.width - 48) / t.width, (n.height - this.topInset - 48) / t.height), i = n.width / r, a = this.topInset + (n.height - this.topInset) / 2;
3644
+ this.setViewport({
3645
+ x: t.x + t.width / 2 - i / 2,
3646
+ y: t.y + t.height / 2 - a / r,
3647
+ width: i,
3648
+ height: n.height / r
3649
+ });
3650
+ }
3651
+ centerOn(e, t) {
3652
+ let n = e.elementRegistry.get(t);
3653
+ if (!n || n.x === void 0 || n.y === void 0) return;
3654
+ let r = e.canvas.viewbox(), i = n.x + (n.width ?? 0) / 2, a = n.y + (n.height ?? 0) / 2;
3655
+ this.setViewport({
3656
+ x: i - r.width / 2,
3657
+ y: a - r.height / 2,
3658
+ width: r.width,
3659
+ height: r.height
3660
+ });
3661
+ }
3662
+ scrollTableTo(e) {
3663
+ let t = (e) => this.container.querySelector(e), n = J(e);
3664
+ ((this.marks?.tables[this.activeElement()?.id ?? ""]?.cells ?? []).map((e) => t(`td[data-element-id="${J(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({
3665
+ block: "center",
3666
+ inline: "center"
3667
+ });
3668
+ }
3669
+ notifyViewChanged() {
3670
+ let e = this.getActiveElementId();
3671
+ e !== this.announcedView && (this.announcedView = e, this.viewListeners.forEach((t) => t(e)));
3672
+ }
3673
+ onScroll(e) {
3674
+ let t = this.scroller();
3675
+ if (!t || e.target !== t) return;
3676
+ let n = this.expectedScroll;
3677
+ if (n && Math.abs(t.scrollTop - n.top) <= 1 && Math.abs(t.scrollLeft - n.left) <= 1) {
3678
+ this.expectedScroll = void 0;
3679
+ return;
3680
+ }
3681
+ let r = this.getTableScroll();
3682
+ r && this.scrollListeners.forEach((e) => e(r));
3683
+ }
3684
+ scroller() {
3685
+ return this.container.querySelector(".tjs-table-container");
3686
+ }
3687
+ ruleNumberCells() {
3688
+ return [...this.container.querySelectorAll("td.rule-index[data-row-id]")];
3689
+ }
3690
+ sideOnlyRules() {
3691
+ let e = this.marks?.tables[this.activeElement()?.id ?? ""];
3692
+ return e ? [...e.rules.added, ...e.rules.removed] : [];
3693
+ }
3694
+ };
3695
+ function Z(e, n = {}) {
3696
+ t.extend(d);
3697
+ let r = new de(e, n.topInset);
3698
+ return n.theme && r.setTheme(n.theme), r;
3699
+ }
3700
+ function fe(e) {
3701
+ let t = e.decisionLogic;
3702
+ return [...t?.input ?? [], ...t?.output ?? []].map((e) => e.id);
3703
+ }
3704
+ function Q(e, t) {
3705
+ return t.getBoundingClientRect().top - e.getBoundingClientRect().top + e.scrollTop;
3706
+ }
3707
+ function pe(e) {
3708
+ let t = document.createElement("div");
3709
+ t.className = "dmn-diff-counts";
3710
+ for (let n of m) {
3711
+ let r = document.createElement("span");
3712
+ r.className = `dmn-diff-counts__${n}`, r.textContent = String(e[n]), t.append(r);
3713
+ }
3714
+ return t;
3715
+ }
3716
+ function $(e, t) {
3717
+ return e.add(t), () => e.delete(t);
3718
+ }
3719
+ export { C as NoModelerError, Z as createDiffViewer, W as createModeler };