@bpmn-io/properties-panel 3.22.2 → 3.22.4
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/LICENSE +20 -20
- package/README.md +35 -35
- package/assets/properties-panel.css +3 -3
- package/dist/assets/properties-panel.css +1505 -1499
- package/dist/index.esm.js +529 -507
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +529 -506
- package/dist/index.js.map +1 -1
- package/package.json +91 -92
package/dist/index.js
CHANGED
|
@@ -247,19 +247,19 @@ const ErrorsContext = preact.createContext({
|
|
|
247
247
|
errors: {}
|
|
248
248
|
});
|
|
249
249
|
|
|
250
|
-
/**
|
|
251
|
-
* @typedef {Function} <propertiesPanel.showEntry> callback
|
|
252
|
-
*
|
|
253
|
-
* @example
|
|
254
|
-
*
|
|
255
|
-
* useEvent('propertiesPanel.showEntry', ({ focus = false, ...rest }) => {
|
|
256
|
-
* // ...
|
|
257
|
-
* });
|
|
258
|
-
*
|
|
259
|
-
* @param {Object} context
|
|
260
|
-
* @param {boolean} [context.focus]
|
|
261
|
-
*
|
|
262
|
-
* @returns void
|
|
250
|
+
/**
|
|
251
|
+
* @typedef {Function} <propertiesPanel.showEntry> callback
|
|
252
|
+
*
|
|
253
|
+
* @example
|
|
254
|
+
*
|
|
255
|
+
* useEvent('propertiesPanel.showEntry', ({ focus = false, ...rest }) => {
|
|
256
|
+
* // ...
|
|
257
|
+
* });
|
|
258
|
+
*
|
|
259
|
+
* @param {Object} context
|
|
260
|
+
* @param {boolean} [context.focus]
|
|
261
|
+
*
|
|
262
|
+
* @returns void
|
|
263
263
|
*/
|
|
264
264
|
|
|
265
265
|
const EventContext = preact.createContext({
|
|
@@ -278,20 +278,20 @@ const TooltipContext = preact.createContext({
|
|
|
278
278
|
getTooltipForId: () => {}
|
|
279
279
|
});
|
|
280
280
|
|
|
281
|
-
/**
|
|
282
|
-
* Accesses the global TooltipContext and returns a tooltip for a given id and element.
|
|
283
|
-
*
|
|
284
|
-
* @example
|
|
285
|
-
* ```jsx
|
|
286
|
-
* function TextField(props) {
|
|
287
|
-
* const tooltip = useTooltipContext('input1', element);
|
|
288
|
-
* }
|
|
289
|
-
* ```
|
|
290
|
-
*
|
|
291
|
-
* @param {string} id
|
|
292
|
-
* @param {object} element
|
|
293
|
-
*
|
|
294
|
-
* @returns {string}
|
|
281
|
+
/**
|
|
282
|
+
* Accesses the global TooltipContext and returns a tooltip for a given id and element.
|
|
283
|
+
*
|
|
284
|
+
* @example
|
|
285
|
+
* ```jsx
|
|
286
|
+
* function TextField(props) {
|
|
287
|
+
* const tooltip = useTooltipContext('input1', element);
|
|
288
|
+
* }
|
|
289
|
+
* ```
|
|
290
|
+
*
|
|
291
|
+
* @param {string} id
|
|
292
|
+
* @param {object} element
|
|
293
|
+
*
|
|
294
|
+
* @returns {string}
|
|
295
295
|
*/
|
|
296
296
|
function useTooltipContext(id, element) {
|
|
297
297
|
const {
|
|
@@ -444,20 +444,20 @@ function prefixId$9(id) {
|
|
|
444
444
|
return `bio-properties-panel-${id}`;
|
|
445
445
|
}
|
|
446
446
|
|
|
447
|
-
/**
|
|
448
|
-
* Accesses the global DescriptionContext and returns a description for a given id and element.
|
|
449
|
-
*
|
|
450
|
-
* @example
|
|
451
|
-
* ```jsx
|
|
452
|
-
* function TextField(props) {
|
|
453
|
-
* const description = useDescriptionContext('input1', element);
|
|
454
|
-
* }
|
|
455
|
-
* ```
|
|
456
|
-
*
|
|
457
|
-
* @param {string} id
|
|
458
|
-
* @param {object} element
|
|
459
|
-
*
|
|
460
|
-
* @returns {string}
|
|
447
|
+
/**
|
|
448
|
+
* Accesses the global DescriptionContext and returns a description for a given id and element.
|
|
449
|
+
*
|
|
450
|
+
* @example
|
|
451
|
+
* ```jsx
|
|
452
|
+
* function TextField(props) {
|
|
453
|
+
* const description = useDescriptionContext('input1', element);
|
|
454
|
+
* }
|
|
455
|
+
* ```
|
|
456
|
+
*
|
|
457
|
+
* @param {string} id
|
|
458
|
+
* @param {object} element
|
|
459
|
+
*
|
|
460
|
+
* @returns {string}
|
|
461
461
|
*/
|
|
462
462
|
function useDescriptionContext(id, element) {
|
|
463
463
|
const {
|
|
@@ -479,11 +479,11 @@ function useErrors() {
|
|
|
479
479
|
return errors;
|
|
480
480
|
}
|
|
481
481
|
|
|
482
|
-
/**
|
|
483
|
-
* Subscribe to an event immediately. Update subscription after inputs changed.
|
|
484
|
-
*
|
|
485
|
-
* @param {string} event
|
|
486
|
-
* @param {Function} callback
|
|
482
|
+
/**
|
|
483
|
+
* Subscribe to an event immediately. Update subscription after inputs changed.
|
|
484
|
+
*
|
|
485
|
+
* @param {string} event
|
|
486
|
+
* @param {Function} callback
|
|
487
487
|
*/
|
|
488
488
|
function useEvent(event, callback, eventBus) {
|
|
489
489
|
const eventContext = hooks.useContext(EventContext);
|
|
@@ -515,24 +515,24 @@ function useEvent(event, callback, eventBus) {
|
|
|
515
515
|
|
|
516
516
|
const KEY_LENGTH = 6;
|
|
517
517
|
|
|
518
|
-
/**
|
|
519
|
-
* Create a persistent key factory for plain objects without id.
|
|
520
|
-
*
|
|
521
|
-
* @example
|
|
522
|
-
* ```jsx
|
|
523
|
-
* function List({ objects }) {
|
|
524
|
-
* const getKey = useKeyFactory();
|
|
525
|
-
* return (<ol>{
|
|
526
|
-
* objects.map(obj => {
|
|
527
|
-
* const key = getKey(obj);
|
|
528
|
-
* return <li key={key}>obj.name</li>
|
|
529
|
-
* })
|
|
530
|
-
* }</ol>);
|
|
531
|
-
* }
|
|
532
|
-
* ```
|
|
533
|
-
*
|
|
534
|
-
* @param {any[]} dependencies
|
|
535
|
-
* @returns {(element: object) => string}
|
|
518
|
+
/**
|
|
519
|
+
* Create a persistent key factory for plain objects without id.
|
|
520
|
+
*
|
|
521
|
+
* @example
|
|
522
|
+
* ```jsx
|
|
523
|
+
* function List({ objects }) {
|
|
524
|
+
* const getKey = useKeyFactory();
|
|
525
|
+
* return (<ol>{
|
|
526
|
+
* objects.map(obj => {
|
|
527
|
+
* const key = getKey(obj);
|
|
528
|
+
* return <li key={key}>obj.name</li>
|
|
529
|
+
* })
|
|
530
|
+
* }</ol>);
|
|
531
|
+
* }
|
|
532
|
+
* ```
|
|
533
|
+
*
|
|
534
|
+
* @param {any[]} dependencies
|
|
535
|
+
* @returns {(element: object) => string}
|
|
536
536
|
*/
|
|
537
537
|
function useKeyFactory(dependencies = []) {
|
|
538
538
|
const map = hooks.useMemo(() => new Map(), dependencies);
|
|
@@ -547,20 +547,20 @@ function useKeyFactory(dependencies = []) {
|
|
|
547
547
|
return getKey;
|
|
548
548
|
}
|
|
549
549
|
|
|
550
|
-
/**
|
|
551
|
-
* Creates a state that persists in the global LayoutContext.
|
|
552
|
-
*
|
|
553
|
-
* @example
|
|
554
|
-
* ```jsx
|
|
555
|
-
* function Group(props) {
|
|
556
|
-
* const [ open, setOpen ] = useLayoutState([ 'groups', 'foo', 'open' ], false);
|
|
557
|
-
* }
|
|
558
|
-
* ```
|
|
559
|
-
*
|
|
560
|
-
* @param {(string|number)[]} path
|
|
561
|
-
* @param {any} [defaultValue]
|
|
562
|
-
*
|
|
563
|
-
* @returns {[ any, Function ]}
|
|
550
|
+
/**
|
|
551
|
+
* Creates a state that persists in the global LayoutContext.
|
|
552
|
+
*
|
|
553
|
+
* @example
|
|
554
|
+
* ```jsx
|
|
555
|
+
* function Group(props) {
|
|
556
|
+
* const [ open, setOpen ] = useLayoutState([ 'groups', 'foo', 'open' ], false);
|
|
557
|
+
* }
|
|
558
|
+
* ```
|
|
559
|
+
*
|
|
560
|
+
* @param {(string|number)[]} path
|
|
561
|
+
* @param {any} [defaultValue]
|
|
562
|
+
*
|
|
563
|
+
* @returns {[ any, Function ]}
|
|
564
564
|
*/
|
|
565
565
|
function useLayoutState(path, defaultValue) {
|
|
566
566
|
const {
|
|
@@ -574,11 +574,11 @@ function useLayoutState(path, defaultValue) {
|
|
|
574
574
|
return [layoutForKey, setState];
|
|
575
575
|
}
|
|
576
576
|
|
|
577
|
-
/**
|
|
578
|
-
* @pinussilvestrus: we need to introduce our own hook to persist the previous
|
|
579
|
-
* state on updates.
|
|
580
|
-
*
|
|
581
|
-
* cf. https://reactjs.org/docs/hooks-faq.html#how-to-get-the-previous-props-or-state
|
|
577
|
+
/**
|
|
578
|
+
* @pinussilvestrus: we need to introduce our own hook to persist the previous
|
|
579
|
+
* state on updates.
|
|
580
|
+
*
|
|
581
|
+
* cf. https://reactjs.org/docs/hooks-faq.html#how-to-get-the-previous-props-or-state
|
|
582
582
|
*/
|
|
583
583
|
|
|
584
584
|
function usePrevious(value) {
|
|
@@ -589,12 +589,12 @@ function usePrevious(value) {
|
|
|
589
589
|
return ref.current;
|
|
590
590
|
}
|
|
591
591
|
|
|
592
|
-
/**
|
|
593
|
-
* Subscribe to `propertiesPanel.showEntry`.
|
|
594
|
-
*
|
|
595
|
-
* @param {string} id
|
|
596
|
-
*
|
|
597
|
-
* @returns {import('preact').Ref}
|
|
592
|
+
/**
|
|
593
|
+
* Subscribe to `propertiesPanel.showEntry`.
|
|
594
|
+
*
|
|
595
|
+
* @param {string} id
|
|
596
|
+
*
|
|
597
|
+
* @returns {import('preact').Ref}
|
|
598
598
|
*/
|
|
599
599
|
function useShowEntryEvent(id) {
|
|
600
600
|
const {
|
|
@@ -625,20 +625,20 @@ function useShowEntryEvent(id) {
|
|
|
625
625
|
return ref;
|
|
626
626
|
}
|
|
627
627
|
|
|
628
|
-
/**
|
|
629
|
-
* @callback setSticky
|
|
630
|
-
* @param {boolean} value
|
|
628
|
+
/**
|
|
629
|
+
* @callback setSticky
|
|
630
|
+
* @param {boolean} value
|
|
631
631
|
*/
|
|
632
632
|
|
|
633
|
-
/**
|
|
634
|
-
* Use IntersectionObserver to identify when DOM element is in sticky mode.
|
|
635
|
-
* If sticky is observered setSticky(true) will be called.
|
|
636
|
-
* If sticky mode is left, setSticky(false) will be called.
|
|
637
|
-
*
|
|
638
|
-
*
|
|
639
|
-
* @param {Object} ref
|
|
640
|
-
* @param {string} scrollContainerSelector
|
|
641
|
-
* @param {setSticky} setSticky
|
|
633
|
+
/**
|
|
634
|
+
* Use IntersectionObserver to identify when DOM element is in sticky mode.
|
|
635
|
+
* If sticky is observered setSticky(true) will be called.
|
|
636
|
+
* If sticky mode is left, setSticky(false) will be called.
|
|
637
|
+
*
|
|
638
|
+
*
|
|
639
|
+
* @param {Object} ref
|
|
640
|
+
* @param {string} scrollContainerSelector
|
|
641
|
+
* @param {setSticky} setSticky
|
|
642
642
|
*/
|
|
643
643
|
function useStickyIntersectionObserver(ref, scrollContainerSelector, setSticky) {
|
|
644
644
|
const [scrollContainer, setScrollContainer] = hooks.useState(minDom.query(scrollContainerSelector));
|
|
@@ -692,19 +692,19 @@ function useStickyIntersectionObserver(ref, scrollContainerSelector, setSticky)
|
|
|
692
692
|
}, [ref.current, scrollContainer, setSticky]);
|
|
693
693
|
}
|
|
694
694
|
|
|
695
|
-
/**
|
|
696
|
-
* Creates a static function reference with changing body.
|
|
697
|
-
* This is necessary when external libraries require a callback function
|
|
698
|
-
* that has references to state variables.
|
|
699
|
-
*
|
|
700
|
-
* Usage:
|
|
701
|
-
* const callback = useStaticCallback((val) => {val === currentState});
|
|
702
|
-
*
|
|
703
|
-
* The `callback` reference is static and can be safely used in external
|
|
704
|
-
* libraries or as a prop that does not cause rerendering of children.
|
|
705
|
-
*
|
|
706
|
-
* @param {Function} callback function with changing reference
|
|
707
|
-
* @returns {Function} static function reference
|
|
695
|
+
/**
|
|
696
|
+
* Creates a static function reference with changing body.
|
|
697
|
+
* This is necessary when external libraries require a callback function
|
|
698
|
+
* that has references to state variables.
|
|
699
|
+
*
|
|
700
|
+
* Usage:
|
|
701
|
+
* const callback = useStaticCallback((val) => {val === currentState});
|
|
702
|
+
*
|
|
703
|
+
* The `callback` reference is static and can be safely used in external
|
|
704
|
+
* libraries or as a prop that does not cause rerendering of children.
|
|
705
|
+
*
|
|
706
|
+
* @param {Function} callback function with changing reference
|
|
707
|
+
* @returns {Function} static function reference
|
|
708
708
|
*/
|
|
709
709
|
function useStaticCallback(callback) {
|
|
710
710
|
const callbackRef = hooks.useRef(callback);
|
|
@@ -712,6 +712,24 @@ function useStaticCallback(callback) {
|
|
|
712
712
|
return hooks.useCallback((...args) => callbackRef.current(...args), []);
|
|
713
713
|
}
|
|
714
714
|
|
|
715
|
+
function useElementVisible(element) {
|
|
716
|
+
const [visible, setVisible] = hooks.useState(!!element && !!element.clientHeight);
|
|
717
|
+
hooks.useLayoutEffect(() => {
|
|
718
|
+
if (!element) return;
|
|
719
|
+
const resizeObserver = new ResizeObserver(([entry]) => {
|
|
720
|
+
requestAnimationFrame(() => {
|
|
721
|
+
const newVisible = !!entry.contentRect.height;
|
|
722
|
+
if (newVisible !== visible) {
|
|
723
|
+
setVisible(newVisible);
|
|
724
|
+
}
|
|
725
|
+
});
|
|
726
|
+
});
|
|
727
|
+
resizeObserver.observe(element);
|
|
728
|
+
return () => resizeObserver.disconnect();
|
|
729
|
+
}, [element, visible]);
|
|
730
|
+
return visible;
|
|
731
|
+
}
|
|
732
|
+
|
|
715
733
|
function Group(props) {
|
|
716
734
|
const {
|
|
717
735
|
element,
|
|
@@ -829,13 +847,13 @@ function DataMarker(props) {
|
|
|
829
847
|
return null;
|
|
830
848
|
}
|
|
831
849
|
|
|
832
|
-
/**
|
|
833
|
-
* @typedef { {
|
|
834
|
-
* text: (element: object) => string,
|
|
835
|
-
* icon?: (element: Object) => import('preact').Component
|
|
836
|
-
* } } PlaceholderDefinition
|
|
837
|
-
*
|
|
838
|
-
* @param { PlaceholderDefinition } props
|
|
850
|
+
/**
|
|
851
|
+
* @typedef { {
|
|
852
|
+
* text: (element: object) => string,
|
|
853
|
+
* icon?: (element: Object) => import('preact').Component
|
|
854
|
+
* } } PlaceholderDefinition
|
|
855
|
+
*
|
|
856
|
+
* @param { PlaceholderDefinition } props
|
|
839
857
|
*/
|
|
840
858
|
function Placeholder(props) {
|
|
841
859
|
const {
|
|
@@ -874,9 +892,9 @@ function Description(props) {
|
|
|
874
892
|
|
|
875
893
|
const noop$6 = () => {};
|
|
876
894
|
|
|
877
|
-
/**
|
|
878
|
-
* Buffer `.focus()` calls while the editor is not initialized.
|
|
879
|
-
* Set Focus inside when the editor is ready.
|
|
895
|
+
/**
|
|
896
|
+
* Buffer `.focus()` calls while the editor is not initialized.
|
|
897
|
+
* Set Focus inside when the editor is ready.
|
|
880
898
|
*/
|
|
881
899
|
const useBufferedFocus$1 = function (editor, ref) {
|
|
882
900
|
const [buffer, setBuffer] = hooks.useState(undefined);
|
|
@@ -977,9 +995,9 @@ const CodeEditor$1 = compat.forwardRef((props, ref) => {
|
|
|
977
995
|
|
|
978
996
|
const noop$5 = () => {};
|
|
979
997
|
|
|
980
|
-
/**
|
|
981
|
-
* Buffer `.focus()` calls while the editor is not initialized.
|
|
982
|
-
* Set Focus inside when the editor is ready.
|
|
998
|
+
/**
|
|
999
|
+
* Buffer `.focus()` calls while the editor is not initialized.
|
|
1000
|
+
* Set Focus inside when the editor is ready.
|
|
983
1001
|
*/
|
|
984
1002
|
const useBufferedFocus = function (editor, ref) {
|
|
985
1003
|
const [buffer, setBuffer] = hooks.useState(undefined);
|
|
@@ -1028,10 +1046,10 @@ const CodeEditor = compat.forwardRef((props, ref) => {
|
|
|
1028
1046
|
hooks.useEffect(() => {
|
|
1029
1047
|
let editor;
|
|
1030
1048
|
|
|
1031
|
-
/* Trigger FEEL toggle when
|
|
1032
|
-
*
|
|
1033
|
-
* - `backspace` is pressed
|
|
1034
|
-
* - AND the cursor is at the beginning of the input
|
|
1049
|
+
/* Trigger FEEL toggle when
|
|
1050
|
+
*
|
|
1051
|
+
* - `backspace` is pressed
|
|
1052
|
+
* - AND the cursor is at the beginning of the input
|
|
1035
1053
|
*/
|
|
1036
1054
|
const onKeyDown = e => {
|
|
1037
1055
|
if (e.key !== 'Backspace' || !editor) {
|
|
@@ -1122,10 +1140,10 @@ function FeelIndicator(props) {
|
|
|
1122
1140
|
|
|
1123
1141
|
const noop$4 = () => {};
|
|
1124
1142
|
|
|
1125
|
-
/**
|
|
1126
|
-
* @param {Object} props
|
|
1127
|
-
* @param {Object} props.label
|
|
1128
|
-
* @param {String} props.feel
|
|
1143
|
+
/**
|
|
1144
|
+
* @param {Object} props
|
|
1145
|
+
* @param {Object} props.label
|
|
1146
|
+
* @param {String} props.feel
|
|
1129
1147
|
*/
|
|
1130
1148
|
function FeelIcon(props) {
|
|
1131
1149
|
const {
|
|
@@ -1160,22 +1178,22 @@ const FeelPopupContext = preact.createContext({
|
|
|
1160
1178
|
source: null
|
|
1161
1179
|
});
|
|
1162
1180
|
|
|
1163
|
-
/**
|
|
1164
|
-
* Add a dragger that calls back the passed function with
|
|
1165
|
-
* { event, delta } on drag.
|
|
1166
|
-
*
|
|
1167
|
-
* @example
|
|
1168
|
-
*
|
|
1169
|
-
* function dragMove(event, delta) {
|
|
1170
|
-
* // we are dragging (!!)
|
|
1171
|
-
* }
|
|
1172
|
-
*
|
|
1173
|
-
* domElement.addEventListener('dragstart', dragger(dragMove));
|
|
1174
|
-
*
|
|
1175
|
-
* @param {Function} fn
|
|
1176
|
-
* @param {Element} [dragPreview]
|
|
1177
|
-
*
|
|
1178
|
-
* @return {Function} drag start callback function
|
|
1181
|
+
/**
|
|
1182
|
+
* Add a dragger that calls back the passed function with
|
|
1183
|
+
* { event, delta } on drag.
|
|
1184
|
+
*
|
|
1185
|
+
* @example
|
|
1186
|
+
*
|
|
1187
|
+
* function dragMove(event, delta) {
|
|
1188
|
+
* // we are dragging (!!)
|
|
1189
|
+
* }
|
|
1190
|
+
*
|
|
1191
|
+
* domElement.addEventListener('dragstart', dragger(dragMove));
|
|
1192
|
+
*
|
|
1193
|
+
* @param {Function} fn
|
|
1194
|
+
* @param {Element} [dragPreview]
|
|
1195
|
+
*
|
|
1196
|
+
* @return {Function} drag start callback function
|
|
1179
1197
|
*/
|
|
1180
1198
|
function createDragger(fn, dragPreview) {
|
|
1181
1199
|
let self;
|
|
@@ -1230,23 +1248,23 @@ function emptyCanvas() {
|
|
|
1230
1248
|
|
|
1231
1249
|
const noop$3 = () => {};
|
|
1232
1250
|
|
|
1233
|
-
/**
|
|
1234
|
-
* A generic popup component.
|
|
1235
|
-
*
|
|
1236
|
-
* @param {Object} props
|
|
1237
|
-
* @param {HTMLElement} [props.container]
|
|
1238
|
-
* @param {string} [props.className]
|
|
1239
|
-
* @param {boolean} [props.delayInitialFocus]
|
|
1240
|
-
* @param {{x: number, y: number}} [props.position]
|
|
1241
|
-
* @param {number} [props.width]
|
|
1242
|
-
* @param {number} [props.height]
|
|
1243
|
-
* @param {Function} props.onClose
|
|
1244
|
-
* @param {Function} [props.onPostActivate]
|
|
1245
|
-
* @param {Function} [props.onPostDeactivate]
|
|
1246
|
-
* @param {boolean} [props.returnFocus]
|
|
1247
|
-
* @param {boolean} [props.closeOnEscape]
|
|
1248
|
-
* @param {string} props.title
|
|
1249
|
-
* @param {Ref} [ref]
|
|
1251
|
+
/**
|
|
1252
|
+
* A generic popup component.
|
|
1253
|
+
*
|
|
1254
|
+
* @param {Object} props
|
|
1255
|
+
* @param {HTMLElement} [props.container]
|
|
1256
|
+
* @param {string} [props.className]
|
|
1257
|
+
* @param {boolean} [props.delayInitialFocus]
|
|
1258
|
+
* @param {{x: number, y: number}} [props.position]
|
|
1259
|
+
* @param {number} [props.width]
|
|
1260
|
+
* @param {number} [props.height]
|
|
1261
|
+
* @param {Function} props.onClose
|
|
1262
|
+
* @param {Function} [props.onPostActivate]
|
|
1263
|
+
* @param {Function} [props.onPostDeactivate]
|
|
1264
|
+
* @param {boolean} [props.returnFocus]
|
|
1265
|
+
* @param {boolean} [props.closeOnEscape]
|
|
1266
|
+
* @param {string} props.title
|
|
1267
|
+
* @param {Ref} [ref]
|
|
1250
1268
|
*/
|
|
1251
1269
|
function PopupComponent(props, globalRef) {
|
|
1252
1270
|
const {
|
|
@@ -1465,12 +1483,12 @@ function getContainerNode(node) {
|
|
|
1465
1483
|
const FEEL_POPUP_WIDTH = 700;
|
|
1466
1484
|
const FEEL_POPUP_HEIGHT = 250;
|
|
1467
1485
|
|
|
1468
|
-
/**
|
|
1469
|
-
* FEEL popup component, built as a singleton. Emits lifecycle events as follows:
|
|
1470
|
-
* - `feelPopup.open` - fired before the popup is mounted
|
|
1471
|
-
* - `feelPopup.opened` - fired after the popup is mounted. Event context contains the DOM node of the popup
|
|
1472
|
-
* - `feelPopup.close` - fired before the popup is unmounted. Event context contains the DOM node of the popup
|
|
1473
|
-
* - `feelPopup.closed` - fired after the popup is unmounted
|
|
1486
|
+
/**
|
|
1487
|
+
* FEEL popup component, built as a singleton. Emits lifecycle events as follows:
|
|
1488
|
+
* - `feelPopup.open` - fired before the popup is mounted
|
|
1489
|
+
* - `feelPopup.opened` - fired after the popup is mounted. Event context contains the DOM node of the popup
|
|
1490
|
+
* - `feelPopup.close` - fired before the popup is unmounted. Event context contains the DOM node of the popup
|
|
1491
|
+
* - `feelPopup.closed` - fired after the popup is unmounted
|
|
1474
1492
|
*/
|
|
1475
1493
|
function FEELPopupRoot(props) {
|
|
1476
1494
|
const {
|
|
@@ -1693,11 +1711,11 @@ function autoCompletionOpen(element) {
|
|
|
1693
1711
|
return element.closest('.cm-editor').querySelector('.cm-tooltip-autocomplete');
|
|
1694
1712
|
}
|
|
1695
1713
|
|
|
1696
|
-
/**
|
|
1697
|
-
* This hook behaves like useEffect, but does not trigger on the first render.
|
|
1698
|
-
*
|
|
1699
|
-
* @param {Function} effect
|
|
1700
|
-
* @param {Array} deps
|
|
1714
|
+
/**
|
|
1715
|
+
* This hook behaves like useEffect, but does not trigger on the first render.
|
|
1716
|
+
*
|
|
1717
|
+
* @param {Function} effect
|
|
1718
|
+
* @param {Array} deps
|
|
1701
1719
|
*/
|
|
1702
1720
|
function useUpdateEffect(effect, deps) {
|
|
1703
1721
|
const isMounted = hooks.useRef(false);
|
|
@@ -1775,19 +1793,19 @@ function ToggleSwitch(props) {
|
|
|
1775
1793
|
});
|
|
1776
1794
|
}
|
|
1777
1795
|
|
|
1778
|
-
/**
|
|
1779
|
-
* @param {Object} props
|
|
1780
|
-
* @param {Object} props.element
|
|
1781
|
-
* @param {String} props.id
|
|
1782
|
-
* @param {String} props.description
|
|
1783
|
-
* @param {String} props.label
|
|
1784
|
-
* @param {String} props.switcherLabel
|
|
1785
|
-
* @param {Boolean} props.inline
|
|
1786
|
-
* @param {Function} props.getValue
|
|
1787
|
-
* @param {Function} props.setValue
|
|
1788
|
-
* @param {Function} props.onFocus
|
|
1789
|
-
* @param {Function} props.onBlur
|
|
1790
|
-
* @param {string|import('preact').Component} props.tooltip
|
|
1796
|
+
/**
|
|
1797
|
+
* @param {Object} props
|
|
1798
|
+
* @param {Object} props.element
|
|
1799
|
+
* @param {String} props.id
|
|
1800
|
+
* @param {String} props.description
|
|
1801
|
+
* @param {String} props.label
|
|
1802
|
+
* @param {String} props.switcherLabel
|
|
1803
|
+
* @param {Boolean} props.inline
|
|
1804
|
+
* @param {Function} props.getValue
|
|
1805
|
+
* @param {Function} props.setValue
|
|
1806
|
+
* @param {Function} props.onFocus
|
|
1807
|
+
* @param {Function} props.onBlur
|
|
1808
|
+
* @param {string|import('preact').Component} props.tooltip
|
|
1791
1809
|
*/
|
|
1792
1810
|
function ToggleSwitchEntry(props) {
|
|
1793
1811
|
const {
|
|
@@ -1895,22 +1913,22 @@ function NumberField(props) {
|
|
|
1895
1913
|
});
|
|
1896
1914
|
}
|
|
1897
1915
|
|
|
1898
|
-
/**
|
|
1899
|
-
* @param {Object} props
|
|
1900
|
-
* @param {Boolean} props.debounce
|
|
1901
|
-
* @param {String} props.description
|
|
1902
|
-
* @param {Boolean} props.disabled
|
|
1903
|
-
* @param {Object} props.element
|
|
1904
|
-
* @param {Function} props.getValue
|
|
1905
|
-
* @param {String} props.id
|
|
1906
|
-
* @param {String} props.label
|
|
1907
|
-
* @param {String} props.max
|
|
1908
|
-
* @param {String} props.min
|
|
1909
|
-
* @param {Function} props.setValue
|
|
1910
|
-
* @param {Function} props.onFocus
|
|
1911
|
-
* @param {Function} props.onBlur
|
|
1912
|
-
* @param {String} props.step
|
|
1913
|
-
* @param {Function} props.validate
|
|
1916
|
+
/**
|
|
1917
|
+
* @param {Object} props
|
|
1918
|
+
* @param {Boolean} props.debounce
|
|
1919
|
+
* @param {String} props.description
|
|
1920
|
+
* @param {Boolean} props.disabled
|
|
1921
|
+
* @param {Object} props.element
|
|
1922
|
+
* @param {Function} props.getValue
|
|
1923
|
+
* @param {String} props.id
|
|
1924
|
+
* @param {String} props.label
|
|
1925
|
+
* @param {String} props.max
|
|
1926
|
+
* @param {String} props.min
|
|
1927
|
+
* @param {Function} props.setValue
|
|
1928
|
+
* @param {Function} props.onFocus
|
|
1929
|
+
* @param {Function} props.onBlur
|
|
1930
|
+
* @param {String} props.step
|
|
1931
|
+
* @param {Function} props.validate
|
|
1914
1932
|
*/
|
|
1915
1933
|
function NumberFieldEntry(props) {
|
|
1916
1934
|
const {
|
|
@@ -2395,26 +2413,26 @@ const OptionalFeelCheckbox = compat.forwardRef((props, ref) => {
|
|
|
2395
2413
|
});
|
|
2396
2414
|
});
|
|
2397
2415
|
|
|
2398
|
-
/**
|
|
2399
|
-
* @param {Object} props
|
|
2400
|
-
* @param {Object} props.element
|
|
2401
|
-
* @param {String} props.id
|
|
2402
|
-
* @param {String} props.description
|
|
2403
|
-
* @param {Boolean} props.debounce
|
|
2404
|
-
* @param {Boolean} props.disabled
|
|
2405
|
-
* @param {Boolean} props.feel
|
|
2406
|
-
* @param {String} props.label
|
|
2407
|
-
* @param {Function} props.getValue
|
|
2408
|
-
* @param {Function} props.setValue
|
|
2409
|
-
* @param {Function} props.tooltipContainer
|
|
2410
|
-
* @param {Function} props.validate
|
|
2411
|
-
* @param {Function} props.show
|
|
2412
|
-
* @param {Function} props.example
|
|
2413
|
-
* @param {Function} props.variables
|
|
2414
|
-
* @param {Function} props.onFocus
|
|
2415
|
-
* @param {Function} props.onBlur
|
|
2416
|
-
* @param {string} [props.placeholder]
|
|
2417
|
-
* @param {string|import('preact').Component} props.tooltip
|
|
2416
|
+
/**
|
|
2417
|
+
* @param {Object} props
|
|
2418
|
+
* @param {Object} props.element
|
|
2419
|
+
* @param {String} props.id
|
|
2420
|
+
* @param {String} props.description
|
|
2421
|
+
* @param {Boolean} props.debounce
|
|
2422
|
+
* @param {Boolean} props.disabled
|
|
2423
|
+
* @param {Boolean} props.feel
|
|
2424
|
+
* @param {String} props.label
|
|
2425
|
+
* @param {Function} props.getValue
|
|
2426
|
+
* @param {Function} props.setValue
|
|
2427
|
+
* @param {Function} props.tooltipContainer
|
|
2428
|
+
* @param {Function} props.validate
|
|
2429
|
+
* @param {Function} props.show
|
|
2430
|
+
* @param {Function} props.example
|
|
2431
|
+
* @param {Function} props.variables
|
|
2432
|
+
* @param {Function} props.onFocus
|
|
2433
|
+
* @param {Function} props.onBlur
|
|
2434
|
+
* @param {string} [props.placeholder]
|
|
2435
|
+
* @param {string|import('preact').Component} props.tooltip
|
|
2418
2436
|
*/
|
|
2419
2437
|
function FeelEntry(props) {
|
|
2420
2438
|
const {
|
|
@@ -2501,27 +2519,27 @@ function FeelEntry(props) {
|
|
|
2501
2519
|
});
|
|
2502
2520
|
}
|
|
2503
2521
|
|
|
2504
|
-
/**
|
|
2505
|
-
* @param {Object} props
|
|
2506
|
-
* @param {Object} props.element
|
|
2507
|
-
* @param {String} props.id
|
|
2508
|
-
* @param {String} props.description
|
|
2509
|
-
* @param {Boolean} props.debounce
|
|
2510
|
-
* @param {Boolean} props.disabled
|
|
2511
|
-
* @param {String} props.max
|
|
2512
|
-
* @param {String} props.min
|
|
2513
|
-
* @param {String} props.step
|
|
2514
|
-
* @param {Boolean} props.feel
|
|
2515
|
-
* @param {String} props.label
|
|
2516
|
-
* @param {Function} props.getValue
|
|
2517
|
-
* @param {Function} props.setValue
|
|
2518
|
-
* @param {Function} props.tooltipContainer
|
|
2519
|
-
* @param {Function} props.validate
|
|
2520
|
-
* @param {Function} props.show
|
|
2521
|
-
* @param {Function} props.example
|
|
2522
|
-
* @param {Function} props.variables
|
|
2523
|
-
* @param {Function} props.onFocus
|
|
2524
|
-
* @param {Function} props.onBlur
|
|
2522
|
+
/**
|
|
2523
|
+
* @param {Object} props
|
|
2524
|
+
* @param {Object} props.element
|
|
2525
|
+
* @param {String} props.id
|
|
2526
|
+
* @param {String} props.description
|
|
2527
|
+
* @param {Boolean} props.debounce
|
|
2528
|
+
* @param {Boolean} props.disabled
|
|
2529
|
+
* @param {String} props.max
|
|
2530
|
+
* @param {String} props.min
|
|
2531
|
+
* @param {String} props.step
|
|
2532
|
+
* @param {Boolean} props.feel
|
|
2533
|
+
* @param {String} props.label
|
|
2534
|
+
* @param {Function} props.getValue
|
|
2535
|
+
* @param {Function} props.setValue
|
|
2536
|
+
* @param {Function} props.tooltipContainer
|
|
2537
|
+
* @param {Function} props.validate
|
|
2538
|
+
* @param {Function} props.show
|
|
2539
|
+
* @param {Function} props.example
|
|
2540
|
+
* @param {Function} props.variables
|
|
2541
|
+
* @param {Function} props.onFocus
|
|
2542
|
+
* @param {Function} props.onBlur
|
|
2525
2543
|
*/
|
|
2526
2544
|
function FeelNumberEntry(props) {
|
|
2527
2545
|
return jsxRuntime.jsx(FeelEntry, {
|
|
@@ -2531,25 +2549,25 @@ function FeelNumberEntry(props) {
|
|
|
2531
2549
|
});
|
|
2532
2550
|
}
|
|
2533
2551
|
|
|
2534
|
-
/**
|
|
2535
|
-
* @param {Object} props
|
|
2536
|
-
* @param {Object} props.element
|
|
2537
|
-
* @param {String} props.id
|
|
2538
|
-
* @param {String} props.description
|
|
2539
|
-
* @param {Boolean} props.debounce
|
|
2540
|
-
* @param {Boolean} props.disabled
|
|
2541
|
-
* @param {Boolean} props.feel
|
|
2542
|
-
* @param {String} props.label
|
|
2543
|
-
* @param {Function} props.getValue
|
|
2544
|
-
* @param {Function} props.setValue
|
|
2545
|
-
* @param {Function} props.tooltipContainer
|
|
2546
|
-
* @param {Function} props.validate
|
|
2547
|
-
* @param {Function} props.show
|
|
2548
|
-
* @param {Function} props.example
|
|
2549
|
-
* @param {Function} props.variables
|
|
2550
|
-
* @param {Function} props.onFocus
|
|
2551
|
-
* @param {Function} props.onBlur
|
|
2552
|
-
* @param {string} [props.placeholder]
|
|
2552
|
+
/**
|
|
2553
|
+
* @param {Object} props
|
|
2554
|
+
* @param {Object} props.element
|
|
2555
|
+
* @param {String} props.id
|
|
2556
|
+
* @param {String} props.description
|
|
2557
|
+
* @param {Boolean} props.debounce
|
|
2558
|
+
* @param {Boolean} props.disabled
|
|
2559
|
+
* @param {Boolean} props.feel
|
|
2560
|
+
* @param {String} props.label
|
|
2561
|
+
* @param {Function} props.getValue
|
|
2562
|
+
* @param {Function} props.setValue
|
|
2563
|
+
* @param {Function} props.tooltipContainer
|
|
2564
|
+
* @param {Function} props.validate
|
|
2565
|
+
* @param {Function} props.show
|
|
2566
|
+
* @param {Function} props.example
|
|
2567
|
+
* @param {Function} props.variables
|
|
2568
|
+
* @param {Function} props.onFocus
|
|
2569
|
+
* @param {Function} props.onBlur
|
|
2570
|
+
* @param {string} [props.placeholder]
|
|
2553
2571
|
*/
|
|
2554
2572
|
function FeelTextAreaEntry(props) {
|
|
2555
2573
|
return jsxRuntime.jsx(FeelEntry, {
|
|
@@ -2559,24 +2577,24 @@ function FeelTextAreaEntry(props) {
|
|
|
2559
2577
|
});
|
|
2560
2578
|
}
|
|
2561
2579
|
|
|
2562
|
-
/**
|
|
2563
|
-
* @param {Object} props
|
|
2564
|
-
* @param {Object} props.element
|
|
2565
|
-
* @param {String} props.id
|
|
2566
|
-
* @param {String} props.description
|
|
2567
|
-
* @param {Boolean} props.debounce
|
|
2568
|
-
* @param {Boolean} props.disabled
|
|
2569
|
-
* @param {Boolean} props.feel
|
|
2570
|
-
* @param {String} props.label
|
|
2571
|
-
* @param {Function} props.getValue
|
|
2572
|
-
* @param {Function} props.setValue
|
|
2573
|
-
* @param {Function} props.tooltipContainer
|
|
2574
|
-
* @param {Function} props.validate
|
|
2575
|
-
* @param {Function} props.show
|
|
2576
|
-
* @param {Function} props.example
|
|
2577
|
-
* @param {Function} props.variables
|
|
2578
|
-
* @param {Function} props.onFocus
|
|
2579
|
-
* @param {Function} props.onBlur
|
|
2580
|
+
/**
|
|
2581
|
+
* @param {Object} props
|
|
2582
|
+
* @param {Object} props.element
|
|
2583
|
+
* @param {String} props.id
|
|
2584
|
+
* @param {String} props.description
|
|
2585
|
+
* @param {Boolean} props.debounce
|
|
2586
|
+
* @param {Boolean} props.disabled
|
|
2587
|
+
* @param {Boolean} props.feel
|
|
2588
|
+
* @param {String} props.label
|
|
2589
|
+
* @param {Function} props.getValue
|
|
2590
|
+
* @param {Function} props.setValue
|
|
2591
|
+
* @param {Function} props.tooltipContainer
|
|
2592
|
+
* @param {Function} props.validate
|
|
2593
|
+
* @param {Function} props.show
|
|
2594
|
+
* @param {Function} props.example
|
|
2595
|
+
* @param {Function} props.variables
|
|
2596
|
+
* @param {Function} props.onFocus
|
|
2597
|
+
* @param {Function} props.onBlur
|
|
2580
2598
|
*/
|
|
2581
2599
|
function FeelToggleSwitchEntry(props) {
|
|
2582
2600
|
return jsxRuntime.jsx(FeelEntry, {
|
|
@@ -2586,24 +2604,24 @@ function FeelToggleSwitchEntry(props) {
|
|
|
2586
2604
|
});
|
|
2587
2605
|
}
|
|
2588
2606
|
|
|
2589
|
-
/**
|
|
2590
|
-
* @param {Object} props
|
|
2591
|
-
* @param {Object} props.element
|
|
2592
|
-
* @param {String} props.id
|
|
2593
|
-
* @param {String} props.description
|
|
2594
|
-
* @param {Boolean} props.debounce
|
|
2595
|
-
* @param {Boolean} props.disabled
|
|
2596
|
-
* @param {Boolean} props.feel
|
|
2597
|
-
* @param {String} props.label
|
|
2598
|
-
* @param {Function} props.getValue
|
|
2599
|
-
* @param {Function} props.setValue
|
|
2600
|
-
* @param {Function} props.tooltipContainer
|
|
2601
|
-
* @param {Function} props.validate
|
|
2602
|
-
* @param {Function} props.show
|
|
2603
|
-
* @param {Function} props.example
|
|
2604
|
-
* @param {Function} props.variables
|
|
2605
|
-
* @param {Function} props.onFocus
|
|
2606
|
-
* @param {Function} props.onBlur
|
|
2607
|
+
/**
|
|
2608
|
+
* @param {Object} props
|
|
2609
|
+
* @param {Object} props.element
|
|
2610
|
+
* @param {String} props.id
|
|
2611
|
+
* @param {String} props.description
|
|
2612
|
+
* @param {Boolean} props.debounce
|
|
2613
|
+
* @param {Boolean} props.disabled
|
|
2614
|
+
* @param {Boolean} props.feel
|
|
2615
|
+
* @param {String} props.label
|
|
2616
|
+
* @param {Function} props.getValue
|
|
2617
|
+
* @param {Function} props.setValue
|
|
2618
|
+
* @param {Function} props.tooltipContainer
|
|
2619
|
+
* @param {Function} props.validate
|
|
2620
|
+
* @param {Function} props.show
|
|
2621
|
+
* @param {Function} props.example
|
|
2622
|
+
* @param {Function} props.variables
|
|
2623
|
+
* @param {Function} props.onFocus
|
|
2624
|
+
* @param {Function} props.onBlur
|
|
2607
2625
|
*/
|
|
2608
2626
|
function FeelCheckboxEntry(props) {
|
|
2609
2627
|
return jsxRuntime.jsx(FeelEntry, {
|
|
@@ -2613,26 +2631,26 @@ function FeelCheckboxEntry(props) {
|
|
|
2613
2631
|
});
|
|
2614
2632
|
}
|
|
2615
2633
|
|
|
2616
|
-
/**
|
|
2617
|
-
* @param {Object} props
|
|
2618
|
-
* @param {Object} props.element
|
|
2619
|
-
* @param {String} props.id
|
|
2620
|
-
* @param {String} props.description
|
|
2621
|
-
* @param {String} props.hostLanguage
|
|
2622
|
-
* @param {Boolean} props.singleLine
|
|
2623
|
-
* @param {Boolean} props.debounce
|
|
2624
|
-
* @param {Boolean} props.disabled
|
|
2625
|
-
* @param {Boolean} props.feel
|
|
2626
|
-
* @param {String} props.label
|
|
2627
|
-
* @param {Function} props.getValue
|
|
2628
|
-
* @param {Function} props.setValue
|
|
2629
|
-
* @param {Function} props.tooltipContainer
|
|
2630
|
-
* @param {Function} props.validate
|
|
2631
|
-
* @param {Function} props.show
|
|
2632
|
-
* @param {Function} props.example
|
|
2633
|
-
* @param {Function} props.variables
|
|
2634
|
-
* @param {Function} props.onFocus
|
|
2635
|
-
* @param {Function} props.onBlur
|
|
2634
|
+
/**
|
|
2635
|
+
* @param {Object} props
|
|
2636
|
+
* @param {Object} props.element
|
|
2637
|
+
* @param {String} props.id
|
|
2638
|
+
* @param {String} props.description
|
|
2639
|
+
* @param {String} props.hostLanguage
|
|
2640
|
+
* @param {Boolean} props.singleLine
|
|
2641
|
+
* @param {Boolean} props.debounce
|
|
2642
|
+
* @param {Boolean} props.disabled
|
|
2643
|
+
* @param {Boolean} props.feel
|
|
2644
|
+
* @param {String} props.label
|
|
2645
|
+
* @param {Function} props.getValue
|
|
2646
|
+
* @param {Function} props.setValue
|
|
2647
|
+
* @param {Function} props.tooltipContainer
|
|
2648
|
+
* @param {Function} props.validate
|
|
2649
|
+
* @param {Function} props.show
|
|
2650
|
+
* @param {Function} props.example
|
|
2651
|
+
* @param {Function} props.variables
|
|
2652
|
+
* @param {Function} props.onFocus
|
|
2653
|
+
* @param {Function} props.onBlur
|
|
2636
2654
|
*/
|
|
2637
2655
|
function FeelTemplatingEntry(props) {
|
|
2638
2656
|
return jsxRuntime.jsx(FeelEntry, {
|
|
@@ -2701,84 +2719,84 @@ const DEFAULT_LAYOUT = {};
|
|
|
2701
2719
|
const DEFAULT_DESCRIPTION = {};
|
|
2702
2720
|
const DEFAULT_TOOLTIP = {};
|
|
2703
2721
|
|
|
2704
|
-
/**
|
|
2705
|
-
* @typedef { {
|
|
2706
|
-
* component: import('preact').Component,
|
|
2707
|
-
* id: String,
|
|
2708
|
-
* isEdited?: Function
|
|
2709
|
-
* } } EntryDefinition
|
|
2710
|
-
*
|
|
2711
|
-
* @typedef { {
|
|
2712
|
-
* autoFocusEntry: String,
|
|
2713
|
-
* autoOpen?: Boolean,
|
|
2714
|
-
* entries: Array<EntryDefinition>,
|
|
2715
|
-
* id: String,
|
|
2716
|
-
* label: String,
|
|
2717
|
-
* remove: (event: MouseEvent) => void
|
|
2718
|
-
* } } ListItemDefinition
|
|
2719
|
-
*
|
|
2720
|
-
* @typedef { {
|
|
2721
|
-
* add: (event: MouseEvent) => void,
|
|
2722
|
-
* component: import('preact').Component,
|
|
2723
|
-
* element: Object,
|
|
2724
|
-
* id: String,
|
|
2725
|
-
* items: Array<ListItemDefinition>,
|
|
2726
|
-
* label: String,
|
|
2727
|
-
* shouldOpen?: Boolean
|
|
2728
|
-
* } } ListGroupDefinition
|
|
2729
|
-
*
|
|
2730
|
-
* @typedef { {
|
|
2731
|
-
* component?: import('preact').Component,
|
|
2732
|
-
* entries: Array<EntryDefinition>,
|
|
2733
|
-
* id: String,
|
|
2734
|
-
* label: String,
|
|
2735
|
-
* shouldOpen?: Boolean
|
|
2736
|
-
* } } GroupDefinition
|
|
2737
|
-
*
|
|
2738
|
-
* @typedef { {
|
|
2739
|
-
* [id: String]: GetDescriptionFunction
|
|
2740
|
-
* } } DescriptionConfig
|
|
2741
|
-
*
|
|
2742
|
-
* @typedef { {
|
|
2743
|
-
* [id: String]: GetTooltipFunction
|
|
2744
|
-
* } } TooltipConfig
|
|
2745
|
-
*
|
|
2746
|
-
* @callback { {
|
|
2747
|
-
* @param {string} id
|
|
2748
|
-
* @param {Object} element
|
|
2749
|
-
* @returns {string}
|
|
2750
|
-
* } } GetDescriptionFunction
|
|
2751
|
-
*
|
|
2752
|
-
* @callback { {
|
|
2753
|
-
* @param {string} id
|
|
2754
|
-
* @param {Object} element
|
|
2755
|
-
* @returns {string}
|
|
2756
|
-
* } } GetTooltipFunction
|
|
2757
|
-
*
|
|
2758
|
-
* @typedef { {
|
|
2759
|
-
* getEmpty: (element: object) => import('./components/Placeholder').PlaceholderDefinition,
|
|
2760
|
-
* getMultiple: (element: Object) => import('./components/Placeholder').PlaceholderDefinition
|
|
2761
|
-
* } } PlaceholderProvider
|
|
2762
|
-
*
|
|
2722
|
+
/**
|
|
2723
|
+
* @typedef { {
|
|
2724
|
+
* component: import('preact').Component,
|
|
2725
|
+
* id: String,
|
|
2726
|
+
* isEdited?: Function
|
|
2727
|
+
* } } EntryDefinition
|
|
2728
|
+
*
|
|
2729
|
+
* @typedef { {
|
|
2730
|
+
* autoFocusEntry: String,
|
|
2731
|
+
* autoOpen?: Boolean,
|
|
2732
|
+
* entries: Array<EntryDefinition>,
|
|
2733
|
+
* id: String,
|
|
2734
|
+
* label: String,
|
|
2735
|
+
* remove: (event: MouseEvent) => void
|
|
2736
|
+
* } } ListItemDefinition
|
|
2737
|
+
*
|
|
2738
|
+
* @typedef { {
|
|
2739
|
+
* add: (event: MouseEvent) => void,
|
|
2740
|
+
* component: import('preact').Component,
|
|
2741
|
+
* element: Object,
|
|
2742
|
+
* id: String,
|
|
2743
|
+
* items: Array<ListItemDefinition>,
|
|
2744
|
+
* label: String,
|
|
2745
|
+
* shouldOpen?: Boolean
|
|
2746
|
+
* } } ListGroupDefinition
|
|
2747
|
+
*
|
|
2748
|
+
* @typedef { {
|
|
2749
|
+
* component?: import('preact').Component,
|
|
2750
|
+
* entries: Array<EntryDefinition>,
|
|
2751
|
+
* id: String,
|
|
2752
|
+
* label: String,
|
|
2753
|
+
* shouldOpen?: Boolean
|
|
2754
|
+
* } } GroupDefinition
|
|
2755
|
+
*
|
|
2756
|
+
* @typedef { {
|
|
2757
|
+
* [id: String]: GetDescriptionFunction
|
|
2758
|
+
* } } DescriptionConfig
|
|
2759
|
+
*
|
|
2760
|
+
* @typedef { {
|
|
2761
|
+
* [id: String]: GetTooltipFunction
|
|
2762
|
+
* } } TooltipConfig
|
|
2763
|
+
*
|
|
2764
|
+
* @callback { {
|
|
2765
|
+
* @param {string} id
|
|
2766
|
+
* @param {Object} element
|
|
2767
|
+
* @returns {string}
|
|
2768
|
+
* } } GetDescriptionFunction
|
|
2769
|
+
*
|
|
2770
|
+
* @callback { {
|
|
2771
|
+
* @param {string} id
|
|
2772
|
+
* @param {Object} element
|
|
2773
|
+
* @returns {string}
|
|
2774
|
+
* } } GetTooltipFunction
|
|
2775
|
+
*
|
|
2776
|
+
* @typedef { {
|
|
2777
|
+
* getEmpty: (element: object) => import('./components/Placeholder').PlaceholderDefinition,
|
|
2778
|
+
* getMultiple: (element: Object) => import('./components/Placeholder').PlaceholderDefinition
|
|
2779
|
+
* } } PlaceholderProvider
|
|
2780
|
+
*
|
|
2763
2781
|
*/
|
|
2764
2782
|
|
|
2765
|
-
/**
|
|
2766
|
-
* A basic properties panel component. Describes *how* content will be rendered, accepts
|
|
2767
|
-
* data from implementor to describe *what* will be rendered.
|
|
2768
|
-
*
|
|
2769
|
-
* @param {Object} props
|
|
2770
|
-
* @param {Object|Array} props.element
|
|
2771
|
-
* @param {import('./components/Header').HeaderProvider} props.headerProvider
|
|
2772
|
-
* @param {PlaceholderProvider} [props.placeholderProvider]
|
|
2773
|
-
* @param {Array<GroupDefinition|ListGroupDefinition>} props.groups
|
|
2774
|
-
* @param {Object} [props.layoutConfig]
|
|
2775
|
-
* @param {Function} [props.layoutChanged]
|
|
2776
|
-
* @param {DescriptionConfig} [props.descriptionConfig]
|
|
2777
|
-
* @param {Function} [props.descriptionLoaded]
|
|
2778
|
-
* @param {TooltipConfig} [props.tooltipConfig]
|
|
2779
|
-
* @param {Function} [props.tooltipLoaded]
|
|
2780
|
-
* @param {HTMLElement} [props.feelPopupContainer]
|
|
2781
|
-
* @param {Object} [props.eventBus]
|
|
2783
|
+
/**
|
|
2784
|
+
* A basic properties panel component. Describes *how* content will be rendered, accepts
|
|
2785
|
+
* data from implementor to describe *what* will be rendered.
|
|
2786
|
+
*
|
|
2787
|
+
* @param {Object} props
|
|
2788
|
+
* @param {Object|Array} props.element
|
|
2789
|
+
* @param {import('./components/Header').HeaderProvider} props.headerProvider
|
|
2790
|
+
* @param {PlaceholderProvider} [props.placeholderProvider]
|
|
2791
|
+
* @param {Array<GroupDefinition|ListGroupDefinition>} props.groups
|
|
2792
|
+
* @param {Object} [props.layoutConfig]
|
|
2793
|
+
* @param {Function} [props.layoutChanged]
|
|
2794
|
+
* @param {DescriptionConfig} [props.descriptionConfig]
|
|
2795
|
+
* @param {Function} [props.descriptionLoaded]
|
|
2796
|
+
* @param {TooltipConfig} [props.tooltipConfig]
|
|
2797
|
+
* @param {Function} [props.tooltipLoaded]
|
|
2798
|
+
* @param {HTMLElement} [props.feelPopupContainer]
|
|
2799
|
+
* @param {Object} [props.eventBus]
|
|
2782
2800
|
*/
|
|
2783
2801
|
function PropertiesPanel(props) {
|
|
2784
2802
|
const {
|
|
@@ -2949,11 +2967,11 @@ function createTooltipContext(overrides = {}) {
|
|
|
2949
2967
|
|
|
2950
2968
|
// hooks //////////////////
|
|
2951
2969
|
|
|
2952
|
-
/**
|
|
2953
|
-
* This hook behaves like useLayoutEffect, but does not trigger on the first render.
|
|
2954
|
-
*
|
|
2955
|
-
* @param {Function} effect
|
|
2956
|
-
* @param {Array} deps
|
|
2970
|
+
/**
|
|
2971
|
+
* This hook behaves like useLayoutEffect, but does not trigger on the first render.
|
|
2972
|
+
*
|
|
2973
|
+
* @param {Function} effect
|
|
2974
|
+
* @param {Array} deps
|
|
2957
2975
|
*/
|
|
2958
2976
|
function useUpdateLayoutEffect(effect, deps) {
|
|
2959
2977
|
const isMounted = hooks.useRef(false);
|
|
@@ -3028,15 +3046,15 @@ function MenuItem({
|
|
|
3028
3046
|
});
|
|
3029
3047
|
}
|
|
3030
3048
|
|
|
3031
|
-
/**
|
|
3032
|
-
*
|
|
3033
|
-
* @param {Array<null | Element>} ignoredElements
|
|
3034
|
-
* @param {Function} callback
|
|
3049
|
+
/**
|
|
3050
|
+
*
|
|
3051
|
+
* @param {Array<null | Element>} ignoredElements
|
|
3052
|
+
* @param {Function} callback
|
|
3035
3053
|
*/
|
|
3036
3054
|
function useGlobalClick(ignoredElements, callback) {
|
|
3037
3055
|
hooks.useEffect(() => {
|
|
3038
|
-
/**
|
|
3039
|
-
* @param {MouseEvent} event
|
|
3056
|
+
/**
|
|
3057
|
+
* @param {MouseEvent} event
|
|
3040
3058
|
*/
|
|
3041
3059
|
function listener(event) {
|
|
3042
3060
|
if (ignoredElements.some(element => element && element.contains(event.target))) {
|
|
@@ -3069,20 +3087,20 @@ function HeaderButton(props) {
|
|
|
3069
3087
|
});
|
|
3070
3088
|
}
|
|
3071
3089
|
|
|
3072
|
-
/**
|
|
3073
|
-
* @typedef { {
|
|
3074
|
-
* [key: string]: string;
|
|
3075
|
-
* } } TranslateReplacements
|
|
3090
|
+
/**
|
|
3091
|
+
* @typedef { {
|
|
3092
|
+
* [key: string]: string;
|
|
3093
|
+
* } } TranslateReplacements
|
|
3076
3094
|
*/
|
|
3077
3095
|
|
|
3078
|
-
/**
|
|
3079
|
-
* A simple translation stub to be used for multi-language support.
|
|
3080
|
-
* Can be easily replaced with a more sophisticated solution.
|
|
3081
|
-
*
|
|
3082
|
-
* @param {string} template to interpolate
|
|
3083
|
-
* @param {TranslateReplacements} [replacements] a map with substitutes
|
|
3084
|
-
*
|
|
3085
|
-
* @return {string} the translated string
|
|
3096
|
+
/**
|
|
3097
|
+
* A simple translation stub to be used for multi-language support.
|
|
3098
|
+
* Can be easily replaced with a more sophisticated solution.
|
|
3099
|
+
*
|
|
3100
|
+
* @param {string} template to interpolate
|
|
3101
|
+
* @param {TranslateReplacements} [replacements] a map with substitutes
|
|
3102
|
+
*
|
|
3103
|
+
* @return {string} the translated string
|
|
3086
3104
|
*/
|
|
3087
3105
|
function translateFallback(template, replacements) {
|
|
3088
3106
|
replacements = replacements || {};
|
|
@@ -3194,8 +3212,8 @@ function ListItem(props) {
|
|
|
3194
3212
|
|
|
3195
3213
|
const noop$1 = () => {};
|
|
3196
3214
|
|
|
3197
|
-
/**
|
|
3198
|
-
* @param {import('../PropertiesPanel').ListGroupDefinition} props
|
|
3215
|
+
/**
|
|
3216
|
+
* @param {import('../PropertiesPanel').ListGroupDefinition} props
|
|
3199
3217
|
*/
|
|
3200
3218
|
function ListGroup(props) {
|
|
3201
3219
|
const {
|
|
@@ -3387,18 +3405,18 @@ function Checkbox(props) {
|
|
|
3387
3405
|
});
|
|
3388
3406
|
}
|
|
3389
3407
|
|
|
3390
|
-
/**
|
|
3391
|
-
* @param {Object} props
|
|
3392
|
-
* @param {Object} props.element
|
|
3393
|
-
* @param {String} props.id
|
|
3394
|
-
* @param {String} props.description
|
|
3395
|
-
* @param {String} props.label
|
|
3396
|
-
* @param {Function} props.getValue
|
|
3397
|
-
* @param {Function} props.setValue
|
|
3398
|
-
* @param {Function} props.onFocus
|
|
3399
|
-
* @param {Function} props.onBlur
|
|
3400
|
-
* @param {string|import('preact').Component} props.tooltip
|
|
3401
|
-
* @param {boolean} [props.disabled]
|
|
3408
|
+
/**
|
|
3409
|
+
* @param {Object} props
|
|
3410
|
+
* @param {Object} props.element
|
|
3411
|
+
* @param {String} props.id
|
|
3412
|
+
* @param {String} props.description
|
|
3413
|
+
* @param {String} props.label
|
|
3414
|
+
* @param {Function} props.getValue
|
|
3415
|
+
* @param {Function} props.setValue
|
|
3416
|
+
* @param {Function} props.onFocus
|
|
3417
|
+
* @param {Function} props.onBlur
|
|
3418
|
+
* @param {string|import('preact').Component} props.tooltip
|
|
3419
|
+
* @param {boolean} [props.disabled]
|
|
3402
3420
|
*/
|
|
3403
3421
|
function CheckboxEntry(props) {
|
|
3404
3422
|
const {
|
|
@@ -3450,19 +3468,19 @@ function prefixId$4(id) {
|
|
|
3450
3468
|
|
|
3451
3469
|
const noop = () => {};
|
|
3452
3470
|
|
|
3453
|
-
/**
|
|
3454
|
-
* @param {Object} props
|
|
3455
|
-
* @param {Object} props.element
|
|
3456
|
-
* @param {String} props.id
|
|
3457
|
-
* @param {String} props.description
|
|
3458
|
-
* @param {Boolean} props.debounce
|
|
3459
|
-
* @param {Boolean} props.disabled
|
|
3460
|
-
* @param {String} props.label
|
|
3461
|
-
* @param {Function} props.getValue
|
|
3462
|
-
* @param {Function} props.setValue
|
|
3463
|
-
* @param {Function} props.tooltipContainer
|
|
3464
|
-
* @param {Function} props.validate
|
|
3465
|
-
* @param {Function} props.show
|
|
3471
|
+
/**
|
|
3472
|
+
* @param {Object} props
|
|
3473
|
+
* @param {Object} props.element
|
|
3474
|
+
* @param {String} props.id
|
|
3475
|
+
* @param {String} props.description
|
|
3476
|
+
* @param {Boolean} props.debounce
|
|
3477
|
+
* @param {Boolean} props.disabled
|
|
3478
|
+
* @param {String} props.label
|
|
3479
|
+
* @param {Function} props.getValue
|
|
3480
|
+
* @param {Function} props.setValue
|
|
3481
|
+
* @param {Function} props.tooltipContainer
|
|
3482
|
+
* @param {Function} props.validate
|
|
3483
|
+
* @param {Function} props.show
|
|
3466
3484
|
*/
|
|
3467
3485
|
function TemplatingEntry(props) {
|
|
3468
3486
|
const {
|
|
@@ -3637,8 +3655,8 @@ function List(props) {
|
|
|
3637
3655
|
}
|
|
3638
3656
|
}, [open, hasItems]);
|
|
3639
3657
|
|
|
3640
|
-
/**
|
|
3641
|
-
* @param {MouseEvent} event
|
|
3658
|
+
/**
|
|
3659
|
+
* @param {MouseEvent} event
|
|
3642
3660
|
*/
|
|
3643
3661
|
function addItem(event) {
|
|
3644
3662
|
event.stopPropagation();
|
|
@@ -3830,20 +3848,20 @@ function Select(props) {
|
|
|
3830
3848
|
});
|
|
3831
3849
|
}
|
|
3832
3850
|
|
|
3833
|
-
/**
|
|
3834
|
-
* @param {object} props
|
|
3835
|
-
* @param {object} props.element
|
|
3836
|
-
* @param {string} props.id
|
|
3837
|
-
* @param {string} [props.description]
|
|
3838
|
-
* @param {string} props.label
|
|
3839
|
-
* @param {Function} props.getValue
|
|
3840
|
-
* @param {Function} props.setValue
|
|
3841
|
-
* @param {Function} props.onFocus
|
|
3842
|
-
* @param {Function} props.onBlur
|
|
3843
|
-
* @param {Function} props.getOptions
|
|
3844
|
-
* @param {boolean} [props.disabled]
|
|
3845
|
-
* @param {Function} [props.validate]
|
|
3846
|
-
* @param {string|import('preact').Component} props.tooltip
|
|
3851
|
+
/**
|
|
3852
|
+
* @param {object} props
|
|
3853
|
+
* @param {object} props.element
|
|
3854
|
+
* @param {string} props.id
|
|
3855
|
+
* @param {string} [props.description]
|
|
3856
|
+
* @param {string} props.label
|
|
3857
|
+
* @param {Function} props.getValue
|
|
3858
|
+
* @param {Function} props.setValue
|
|
3859
|
+
* @param {Function} props.onFocus
|
|
3860
|
+
* @param {Function} props.onBlur
|
|
3861
|
+
* @param {Function} props.getOptions
|
|
3862
|
+
* @param {boolean} [props.disabled]
|
|
3863
|
+
* @param {Function} [props.validate]
|
|
3864
|
+
* @param {string|import('preact').Component} props.tooltip
|
|
3847
3865
|
*/
|
|
3848
3866
|
function SelectEntry(props) {
|
|
3849
3867
|
const {
|
|
@@ -3992,6 +4010,7 @@ function TextArea(props) {
|
|
|
3992
4010
|
} = props;
|
|
3993
4011
|
const [localValue, setLocalValue] = hooks.useState(value);
|
|
3994
4012
|
const ref = useShowEntryEvent(id);
|
|
4013
|
+
const visible = useElementVisible(ref.current);
|
|
3995
4014
|
const handleInputCallback = hooks.useMemo(() => {
|
|
3996
4015
|
return debounce(target => onInput(target.value.length ? target.value : undefined));
|
|
3997
4016
|
}, [onInput, debounce]);
|
|
@@ -4003,6 +4022,9 @@ function TextArea(props) {
|
|
|
4003
4022
|
hooks.useLayoutEffect(() => {
|
|
4004
4023
|
autoResize && resizeToContents(ref.current);
|
|
4005
4024
|
}, []);
|
|
4025
|
+
hooks.useLayoutEffect(() => {
|
|
4026
|
+
visible && autoResize && resizeToContents(ref.current);
|
|
4027
|
+
}, [visible]);
|
|
4006
4028
|
hooks.useEffect(() => {
|
|
4007
4029
|
if (value === localValue) {
|
|
4008
4030
|
return;
|
|
@@ -4038,21 +4060,21 @@ function TextArea(props) {
|
|
|
4038
4060
|
});
|
|
4039
4061
|
}
|
|
4040
4062
|
|
|
4041
|
-
/**
|
|
4042
|
-
* @param {object} props
|
|
4043
|
-
* @param {object} props.element
|
|
4044
|
-
* @param {string} props.id
|
|
4045
|
-
* @param {string} props.description
|
|
4046
|
-
* @param {boolean} props.debounce
|
|
4047
|
-
* @param {string} props.label
|
|
4048
|
-
* @param {Function} props.getValue
|
|
4049
|
-
* @param {Function} props.setValue
|
|
4050
|
-
* @param {Function} props.onFocus
|
|
4051
|
-
* @param {Function} props.onBlur
|
|
4052
|
-
* @param {number} props.rows
|
|
4053
|
-
* @param {boolean} props.monospace
|
|
4054
|
-
* @param {Function} [props.validate]
|
|
4055
|
-
* @param {boolean} [props.disabled]
|
|
4063
|
+
/**
|
|
4064
|
+
* @param {object} props
|
|
4065
|
+
* @param {object} props.element
|
|
4066
|
+
* @param {string} props.id
|
|
4067
|
+
* @param {string} props.description
|
|
4068
|
+
* @param {boolean} props.debounce
|
|
4069
|
+
* @param {string} props.label
|
|
4070
|
+
* @param {Function} props.getValue
|
|
4071
|
+
* @param {Function} props.setValue
|
|
4072
|
+
* @param {Function} props.onFocus
|
|
4073
|
+
* @param {Function} props.onBlur
|
|
4074
|
+
* @param {number} props.rows
|
|
4075
|
+
* @param {boolean} props.monospace
|
|
4076
|
+
* @param {Function} [props.validate]
|
|
4077
|
+
* @param {boolean} [props.disabled]
|
|
4056
4078
|
*/
|
|
4057
4079
|
function TextAreaEntry(props) {
|
|
4058
4080
|
const {
|
|
@@ -4186,20 +4208,20 @@ function Textfield(props) {
|
|
|
4186
4208
|
});
|
|
4187
4209
|
}
|
|
4188
4210
|
|
|
4189
|
-
/**
|
|
4190
|
-
* @param {Object} props
|
|
4191
|
-
* @param {Object} props.element
|
|
4192
|
-
* @param {String} props.id
|
|
4193
|
-
* @param {String} props.description
|
|
4194
|
-
* @param {Boolean} props.debounce
|
|
4195
|
-
* @param {Boolean} props.disabled
|
|
4196
|
-
* @param {String} props.label
|
|
4197
|
-
* @param {Function} props.getValue
|
|
4198
|
-
* @param {Function} props.setValue
|
|
4199
|
-
* @param {Function} props.onFocus
|
|
4200
|
-
* @param {Function} props.onBlur
|
|
4201
|
-
* @param {string|import('preact').Component} props.tooltip
|
|
4202
|
-
* @param {Function} props.validate
|
|
4211
|
+
/**
|
|
4212
|
+
* @param {Object} props
|
|
4213
|
+
* @param {Object} props.element
|
|
4214
|
+
* @param {String} props.id
|
|
4215
|
+
* @param {String} props.description
|
|
4216
|
+
* @param {Boolean} props.debounce
|
|
4217
|
+
* @param {Boolean} props.disabled
|
|
4218
|
+
* @param {String} props.label
|
|
4219
|
+
* @param {Function} props.getValue
|
|
4220
|
+
* @param {Function} props.setValue
|
|
4221
|
+
* @param {Function} props.onFocus
|
|
4222
|
+
* @param {Function} props.onBlur
|
|
4223
|
+
* @param {string|import('preact').Component} props.tooltip
|
|
4224
|
+
* @param {Function} props.validate
|
|
4203
4225
|
*/
|
|
4204
4226
|
function TextfieldEntry(props) {
|
|
4205
4227
|
const {
|
|
@@ -4292,20 +4314,20 @@ class FeelPopupModule {
|
|
|
4292
4314
|
this._eventBus = eventBus;
|
|
4293
4315
|
}
|
|
4294
4316
|
|
|
4295
|
-
/**
|
|
4296
|
-
* Check if the FEEL popup is open.
|
|
4297
|
-
* @return {Boolean}
|
|
4317
|
+
/**
|
|
4318
|
+
* Check if the FEEL popup is open.
|
|
4319
|
+
* @return {Boolean}
|
|
4298
4320
|
*/
|
|
4299
4321
|
isOpen() {
|
|
4300
4322
|
return this._eventBus.fire('feelPopup._isOpen');
|
|
4301
4323
|
}
|
|
4302
4324
|
|
|
4303
|
-
/**
|
|
4304
|
-
* Open the FEEL popup.
|
|
4305
|
-
*
|
|
4306
|
-
* @param {String} entryId
|
|
4307
|
-
* @param {Object} popupConfig
|
|
4308
|
-
* @param {HTMLElement} sourceElement
|
|
4325
|
+
/**
|
|
4326
|
+
* Open the FEEL popup.
|
|
4327
|
+
*
|
|
4328
|
+
* @param {String} entryId
|
|
4329
|
+
* @param {Object} popupConfig
|
|
4330
|
+
* @param {HTMLElement} sourceElement
|
|
4309
4331
|
*/
|
|
4310
4332
|
open(entryId, popupConfig, sourceElement) {
|
|
4311
4333
|
return this._eventBus.fire('feelPopup._open', {
|
|
@@ -4315,8 +4337,8 @@ class FeelPopupModule {
|
|
|
4315
4337
|
});
|
|
4316
4338
|
}
|
|
4317
4339
|
|
|
4318
|
-
/**
|
|
4319
|
-
* Close the FEEL popup.
|
|
4340
|
+
/**
|
|
4341
|
+
* Close the FEEL popup.
|
|
4320
4342
|
*/
|
|
4321
4343
|
close() {
|
|
4322
4344
|
return this._eventBus.fire('feelPopup._close');
|
|
@@ -4382,6 +4404,7 @@ exports.isTextAreaEntryEdited = isEdited$1;
|
|
|
4382
4404
|
exports.isTextFieldEntryEdited = isEdited;
|
|
4383
4405
|
exports.isToggleSwitchEntryEdited = isEdited$8;
|
|
4384
4406
|
exports.useDescriptionContext = useDescriptionContext;
|
|
4407
|
+
exports.useElementVisible = useElementVisible;
|
|
4385
4408
|
exports.useError = useError;
|
|
4386
4409
|
exports.useErrors = useErrors;
|
|
4387
4410
|
exports.useEvent = useEvent;
|