bpmn-js 17.6.3 → 17.7.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.
@@ -59,6 +59,7 @@
59
59
  --popup-font-size: 14px;
60
60
  --popup-header-entry-selected-color: var(--color-blue-205-100-50);
61
61
  --popup-header-font-weight: bolder;
62
+ --popup-header-group-divider-color: var(--color-grey-225-10-75);
62
63
  --popup-background-color: var(--color-white);
63
64
  --popup-border-color: transparent;
64
65
  --popup-shadow-color: var(--color-black-opacity-30);
@@ -568,6 +569,29 @@ marker.djs-dragger tspan {
568
569
  color: inherit;
569
570
  }
570
571
 
572
+ .djs-popup-header-group {
573
+ display: flex;
574
+ flex-direction: row;
575
+ align-items: center;
576
+ list-style: none;
577
+ margin: 0;
578
+ padding: 0;
579
+ }
580
+
581
+ .djs-popup-header-group .entry {
582
+ display: flex;
583
+ flex-direction: row;
584
+ align-items: center;
585
+ }
586
+
587
+ .djs-popup-header-group + .djs-popup-header-group:before {
588
+ content: '';
589
+ width: 1px;
590
+ height: 20px;
591
+ background: var(--popup-header-group-divider-color);
592
+ margin: 0 5px;
593
+ }
594
+
571
595
  .djs-popup-search {
572
596
  margin: 10px 12px;
573
597
  }
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * bpmn-js - bpmn-modeler v17.6.3
2
+ * bpmn-js - bpmn-modeler v17.7.0
3
3
  *
4
4
  * Copyright (c) 2014-present, camunda Services GmbH
5
5
  *
@@ -8,7 +8,7 @@
8
8
  *
9
9
  * Source Code: https://github.com/bpmn-io/bpmn-js
10
10
  *
11
- * Date: 2024-05-08
11
+ * Date: 2024-05-22
12
12
  */
13
13
  (function (global, factory) {
14
14
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -26976,10 +26976,7 @@
26976
26976
  alignElements: [ 'type', AlignElements$1 ]
26977
26977
  };
26978
26978
 
26979
- var MARKERS_HIDDEN = [
26980
- 'djs-element-hidden',
26981
- 'djs-label-hidden'
26982
- ];
26979
+ var MARKER_HIDDEN$1 = 'djs-element-hidden';
26983
26980
 
26984
26981
  /**
26985
26982
  * @typedef {import('../../model/Types').Element} Element
@@ -27592,9 +27589,7 @@
27592
27589
  var targets = isArray$3(target) ? target : [ target ];
27593
27590
 
27594
27591
  var isHidden = targets.some(function(target) {
27595
- return MARKERS_HIDDEN.some(function(marker) {
27596
- return self._canvas.hasMarker(target, marker);
27597
- });
27592
+ return self._canvas.hasMarker(target, MARKER_HIDDEN$1);
27598
27593
  });
27599
27594
 
27600
27595
  if (isHidden) {
@@ -27704,6 +27699,94 @@
27704
27699
 
27705
27700
  function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
27706
27701
 
27702
+ /**
27703
+ * @typedef {import('./PopupMenuProvider').PopupMenuHeaderEntry} PopupMenuHeaderEntry
27704
+ */
27705
+
27706
+ /**
27707
+ * Component that renders a popup menu header.
27708
+ *
27709
+ * @param {Object} props
27710
+ * @param {PopupMenuHeaderEntry[]} props.headerEntries
27711
+ * @param {PopupMenuHeaderEntry} props.selectedEntry
27712
+ * @param {(event: MouseEvent, entry: PopupMenuHeaderEntry) => void} props.onSelect
27713
+ * @param {(entry: PopupMenuHeaderEntry | null) => void} props.setSelectedEntry
27714
+ * @param {string} props.title
27715
+ */
27716
+ function PopupMenuHeader(props) {
27717
+ const {
27718
+ headerEntries,
27719
+ onSelect,
27720
+ selectedEntry,
27721
+ setSelectedEntry,
27722
+ title
27723
+ } = props;
27724
+
27725
+ const groups = q(() => groupEntries$1(headerEntries), [ headerEntries ]);
27726
+
27727
+ return m$1`
27728
+ <div class="djs-popup-header">
27729
+ <h3 class="djs-popup-title" title=${ title }>${ title }</h3>
27730
+ ${ groups.map((group) => m$1`
27731
+ <ul key=${ group.id } class="djs-popup-header-group" data-header-group=${ group.id }>
27732
+
27733
+ ${ group.entries.map(entry => m$1`
27734
+ <li key=${ entry.id }>
27735
+ <${ entry.action ? 'button' : 'span' }
27736
+ class=${ getHeaderClasses(entry, entry === selectedEntry) }
27737
+ onClick=${ event => entry.action && onSelect(event, entry) }
27738
+ title=${ entry.title || entry.label }
27739
+ data-id=${ entry.id }
27740
+ onMouseEnter=${ () => entry.action && setSelectedEntry(entry) }
27741
+ onMouseLeave=${ () => entry.action && setSelectedEntry(null) }
27742
+ onFocus=${ () => entry.action && setSelectedEntry(entry) }
27743
+ onBlur=${ () => entry.action && setSelectedEntry(null) }
27744
+ >
27745
+ ${(entry.imageUrl && m$1`<img class="djs-popup-entry-icon" src=${ entry.imageUrl } alt="" />`) ||
27746
+ (entry.imageHtml && m$1`<div class="djs-popup-entry-icon" dangerouslySetInnerHTML=${ { __html: entry.imageHtml } } />`)}
27747
+ ${ entry.label ? m$1`
27748
+ <span class="djs-popup-label">${ entry.label }</span>
27749
+ ` : null }
27750
+ </${ entry.action ? 'button' : 'span' }>
27751
+ </li>
27752
+ `) }
27753
+ </ul>
27754
+ `) }
27755
+ </div>
27756
+ `;
27757
+ }
27758
+
27759
+
27760
+ // helpers
27761
+ function groupEntries$1(entries) {
27762
+ return entries.reduce((groups, entry) => {
27763
+ const groupId = entry.group || 'default';
27764
+
27765
+ const group = groups.find(group => group.id === groupId);
27766
+
27767
+ if (group) {
27768
+ group.entries.push(entry);
27769
+ } else {
27770
+ groups.push({
27771
+ id: groupId,
27772
+ entries: [ entry ]
27773
+ });
27774
+ }
27775
+
27776
+ return groups;
27777
+ }, []);
27778
+ }
27779
+
27780
+ function getHeaderClasses(entry, selected) {
27781
+ return clsx(
27782
+ 'entry',
27783
+ entry.className,
27784
+ entry.active ? 'active' : '',
27785
+ entry.disabled ? 'disabled' : '',
27786
+ selected ? 'selected' : ''
27787
+ );
27788
+ }
27789
+
27707
27790
  /**
27708
27791
  * @typedef {import('./PopupMenuProvider').PopupMenuEntry} PopupMenuEntry
27709
27792
  */
@@ -27901,6 +27984,7 @@
27901
27984
  *
27902
27985
  * @param {Object} props
27903
27986
  * @param {() => void} props.onClose
27987
+ * @param {() => void} props.onSelect
27904
27988
  * @param {(element: HTMLElement) => Point} props.position
27905
27989
  * @param {string} props.className
27906
27990
  * @param {PopupMenuEntry[]} props.entries
@@ -28051,28 +28135,13 @@
28051
28135
  scale=${ scale }
28052
28136
  >
28053
28137
  ${ displayHeader && m$1`
28054
- <div class="djs-popup-header">
28055
- <h3 class="djs-popup-title" title=${ title }>${ title }</h3>
28056
- ${ headerEntries.map(entry => m$1`
28057
- <${ entry.action ? 'button' : 'span' }
28058
- class=${ getHeaderClasses(entry, entry === selectedEntry) }
28059
- onClick=${ event => onSelect(event, entry) }
28060
- title=${ entry.title || entry.label }
28061
- data-id=${ entry.id }
28062
- onMouseEnter=${ () => setSelectedEntry(entry) }
28063
- onMouseLeave=${ () => setSelectedEntry(null) }
28064
- onFocus=${ () => setSelectedEntry(entry) }
28065
- onBlur=${ () => setSelectedEntry(null) }
28066
- >
28067
- ${(entry.imageUrl && m$1`<img class="djs-popup-entry-icon" src=${ entry.imageUrl } alt="" />`) ||
28068
- (entry.imageHtml && m$1`<div class="djs-popup-entry-icon" dangerouslySetInnerHTML=${ { __html: entry.imageHtml } } />`)}
28069
-
28070
- ${ entry.label ? m$1`
28071
- <span class="djs-popup-label">${ entry.label }</span>
28072
- ` : null }
28073
- </${ entry.action ? 'button' : 'span' }>
28074
- `) }
28075
- </div>
28138
+ <${PopupMenuHeader}
28139
+ headerEntries=${ headerEntries }
28140
+ onSelect=${ onSelect }
28141
+ selectedEntry=${ selectedEntry }
28142
+ setSelectedEntry=${ setSelectedEntry }
28143
+ title=${ title }
28144
+ />
28076
28145
  ` }
28077
28146
  ${ originalEntries.length > 0 && m$1`
28078
28147
  <div class="djs-popup-body">
@@ -28195,16 +28264,6 @@
28195
28264
  width: `${props.width}px`,
28196
28265
  'transform-origin': 'top left'
28197
28266
  };
28198
- }
28199
-
28200
- function getHeaderClasses(entry, selected) {
28201
- return clsx(
28202
- 'entry',
28203
- entry.className,
28204
- entry.active ? 'active' : '',
28205
- entry.disabled ? 'disabled' : '',
28206
- selected ? 'selected' : ''
28207
- );
28208
28267
  }
28209
28268
 
28210
28269
  /**