@bpmn-io/properties-panel 3.26.0 → 3.26.1
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 +1521 -1517
- package/dist/index.esm.js +492 -492
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +492 -492
- package/dist/index.js.map +1 -1
- package/package.json +91 -91
package/dist/index.esm.js
CHANGED
|
@@ -217,19 +217,19 @@ const ErrorsContext = createContext({
|
|
|
217
217
|
errors: {}
|
|
218
218
|
});
|
|
219
219
|
|
|
220
|
-
/**
|
|
221
|
-
* @typedef {Function} <propertiesPanel.showEntry> callback
|
|
222
|
-
*
|
|
223
|
-
* @example
|
|
224
|
-
*
|
|
225
|
-
* useEvent('propertiesPanel.showEntry', ({ focus = false, ...rest }) => {
|
|
226
|
-
* // ...
|
|
227
|
-
* });
|
|
228
|
-
*
|
|
229
|
-
* @param {Object} context
|
|
230
|
-
* @param {boolean} [context.focus]
|
|
231
|
-
*
|
|
232
|
-
* @returns void
|
|
220
|
+
/**
|
|
221
|
+
* @typedef {Function} <propertiesPanel.showEntry> callback
|
|
222
|
+
*
|
|
223
|
+
* @example
|
|
224
|
+
*
|
|
225
|
+
* useEvent('propertiesPanel.showEntry', ({ focus = false, ...rest }) => {
|
|
226
|
+
* // ...
|
|
227
|
+
* });
|
|
228
|
+
*
|
|
229
|
+
* @param {Object} context
|
|
230
|
+
* @param {boolean} [context.focus]
|
|
231
|
+
*
|
|
232
|
+
* @returns void
|
|
233
233
|
*/
|
|
234
234
|
|
|
235
235
|
const EventContext = createContext({
|
|
@@ -248,20 +248,20 @@ const TooltipContext = createContext({
|
|
|
248
248
|
getTooltipForId: () => {}
|
|
249
249
|
});
|
|
250
250
|
|
|
251
|
-
/**
|
|
252
|
-
* Accesses the global TooltipContext and returns a tooltip for a given id and element.
|
|
253
|
-
*
|
|
254
|
-
* @example
|
|
255
|
-
* ```jsx
|
|
256
|
-
* function TextField(props) {
|
|
257
|
-
* const tooltip = useTooltipContext('input1', element);
|
|
258
|
-
* }
|
|
259
|
-
* ```
|
|
260
|
-
*
|
|
261
|
-
* @param {string} id
|
|
262
|
-
* @param {object} element
|
|
263
|
-
*
|
|
264
|
-
* @returns {string}
|
|
251
|
+
/**
|
|
252
|
+
* Accesses the global TooltipContext and returns a tooltip for a given id and element.
|
|
253
|
+
*
|
|
254
|
+
* @example
|
|
255
|
+
* ```jsx
|
|
256
|
+
* function TextField(props) {
|
|
257
|
+
* const tooltip = useTooltipContext('input1', element);
|
|
258
|
+
* }
|
|
259
|
+
* ```
|
|
260
|
+
*
|
|
261
|
+
* @param {string} id
|
|
262
|
+
* @param {object} element
|
|
263
|
+
*
|
|
264
|
+
* @returns {string}
|
|
265
265
|
*/
|
|
266
266
|
function useTooltipContext(id, element) {
|
|
267
267
|
const {
|
|
@@ -414,20 +414,20 @@ function prefixId$9(id) {
|
|
|
414
414
|
return `bio-properties-panel-${id}`;
|
|
415
415
|
}
|
|
416
416
|
|
|
417
|
-
/**
|
|
418
|
-
* Accesses the global DescriptionContext and returns a description for a given id and element.
|
|
419
|
-
*
|
|
420
|
-
* @example
|
|
421
|
-
* ```jsx
|
|
422
|
-
* function TextField(props) {
|
|
423
|
-
* const description = useDescriptionContext('input1', element);
|
|
424
|
-
* }
|
|
425
|
-
* ```
|
|
426
|
-
*
|
|
427
|
-
* @param {string} id
|
|
428
|
-
* @param {object} element
|
|
429
|
-
*
|
|
430
|
-
* @returns {string}
|
|
417
|
+
/**
|
|
418
|
+
* Accesses the global DescriptionContext and returns a description for a given id and element.
|
|
419
|
+
*
|
|
420
|
+
* @example
|
|
421
|
+
* ```jsx
|
|
422
|
+
* function TextField(props) {
|
|
423
|
+
* const description = useDescriptionContext('input1', element);
|
|
424
|
+
* }
|
|
425
|
+
* ```
|
|
426
|
+
*
|
|
427
|
+
* @param {string} id
|
|
428
|
+
* @param {object} element
|
|
429
|
+
*
|
|
430
|
+
* @returns {string}
|
|
431
431
|
*/
|
|
432
432
|
function useDescriptionContext(id, element) {
|
|
433
433
|
const {
|
|
@@ -449,11 +449,11 @@ function useErrors() {
|
|
|
449
449
|
return errors;
|
|
450
450
|
}
|
|
451
451
|
|
|
452
|
-
/**
|
|
453
|
-
* Subscribe to an event immediately. Update subscription after inputs changed.
|
|
454
|
-
*
|
|
455
|
-
* @param {string} event
|
|
456
|
-
* @param {Function} callback
|
|
452
|
+
/**
|
|
453
|
+
* Subscribe to an event immediately. Update subscription after inputs changed.
|
|
454
|
+
*
|
|
455
|
+
* @param {string} event
|
|
456
|
+
* @param {Function} callback
|
|
457
457
|
*/
|
|
458
458
|
function useEvent(event, callback, eventBus) {
|
|
459
459
|
const eventContext = useContext(EventContext);
|
|
@@ -485,24 +485,24 @@ function useEvent(event, callback, eventBus) {
|
|
|
485
485
|
|
|
486
486
|
const KEY_LENGTH = 6;
|
|
487
487
|
|
|
488
|
-
/**
|
|
489
|
-
* Create a persistent key factory for plain objects without id.
|
|
490
|
-
*
|
|
491
|
-
* @example
|
|
492
|
-
* ```jsx
|
|
493
|
-
* function List({ objects }) {
|
|
494
|
-
* const getKey = useKeyFactory();
|
|
495
|
-
* return (<ol>{
|
|
496
|
-
* objects.map(obj => {
|
|
497
|
-
* const key = getKey(obj);
|
|
498
|
-
* return <li key={key}>obj.name</li>
|
|
499
|
-
* })
|
|
500
|
-
* }</ol>);
|
|
501
|
-
* }
|
|
502
|
-
* ```
|
|
503
|
-
*
|
|
504
|
-
* @param {any[]} dependencies
|
|
505
|
-
* @returns {(element: object) => string}
|
|
488
|
+
/**
|
|
489
|
+
* Create a persistent key factory for plain objects without id.
|
|
490
|
+
*
|
|
491
|
+
* @example
|
|
492
|
+
* ```jsx
|
|
493
|
+
* function List({ objects }) {
|
|
494
|
+
* const getKey = useKeyFactory();
|
|
495
|
+
* return (<ol>{
|
|
496
|
+
* objects.map(obj => {
|
|
497
|
+
* const key = getKey(obj);
|
|
498
|
+
* return <li key={key}>obj.name</li>
|
|
499
|
+
* })
|
|
500
|
+
* }</ol>);
|
|
501
|
+
* }
|
|
502
|
+
* ```
|
|
503
|
+
*
|
|
504
|
+
* @param {any[]} dependencies
|
|
505
|
+
* @returns {(element: object) => string}
|
|
506
506
|
*/
|
|
507
507
|
function useKeyFactory(dependencies = []) {
|
|
508
508
|
const map = useMemo(() => new Map(), dependencies);
|
|
@@ -517,20 +517,20 @@ function useKeyFactory(dependencies = []) {
|
|
|
517
517
|
return getKey;
|
|
518
518
|
}
|
|
519
519
|
|
|
520
|
-
/**
|
|
521
|
-
* Creates a state that persists in the global LayoutContext.
|
|
522
|
-
*
|
|
523
|
-
* @example
|
|
524
|
-
* ```jsx
|
|
525
|
-
* function Group(props) {
|
|
526
|
-
* const [ open, setOpen ] = useLayoutState([ 'groups', 'foo', 'open' ], false);
|
|
527
|
-
* }
|
|
528
|
-
* ```
|
|
529
|
-
*
|
|
530
|
-
* @param {(string|number)[]} path
|
|
531
|
-
* @param {any} [defaultValue]
|
|
532
|
-
*
|
|
533
|
-
* @returns {[ any, Function ]}
|
|
520
|
+
/**
|
|
521
|
+
* Creates a state that persists in the global LayoutContext.
|
|
522
|
+
*
|
|
523
|
+
* @example
|
|
524
|
+
* ```jsx
|
|
525
|
+
* function Group(props) {
|
|
526
|
+
* const [ open, setOpen ] = useLayoutState([ 'groups', 'foo', 'open' ], false);
|
|
527
|
+
* }
|
|
528
|
+
* ```
|
|
529
|
+
*
|
|
530
|
+
* @param {(string|number)[]} path
|
|
531
|
+
* @param {any} [defaultValue]
|
|
532
|
+
*
|
|
533
|
+
* @returns {[ any, Function ]}
|
|
534
534
|
*/
|
|
535
535
|
function useLayoutState(path, defaultValue) {
|
|
536
536
|
const {
|
|
@@ -544,11 +544,11 @@ function useLayoutState(path, defaultValue) {
|
|
|
544
544
|
return [layoutForKey, setState];
|
|
545
545
|
}
|
|
546
546
|
|
|
547
|
-
/**
|
|
548
|
-
* @pinussilvestrus: we need to introduce our own hook to persist the previous
|
|
549
|
-
* state on updates.
|
|
550
|
-
*
|
|
551
|
-
* cf. https://reactjs.org/docs/hooks-faq.html#how-to-get-the-previous-props-or-state
|
|
547
|
+
/**
|
|
548
|
+
* @pinussilvestrus: we need to introduce our own hook to persist the previous
|
|
549
|
+
* state on updates.
|
|
550
|
+
*
|
|
551
|
+
* cf. https://reactjs.org/docs/hooks-faq.html#how-to-get-the-previous-props-or-state
|
|
552
552
|
*/
|
|
553
553
|
|
|
554
554
|
function usePrevious(value) {
|
|
@@ -559,12 +559,12 @@ function usePrevious(value) {
|
|
|
559
559
|
return ref.current;
|
|
560
560
|
}
|
|
561
561
|
|
|
562
|
-
/**
|
|
563
|
-
* Subscribe to `propertiesPanel.showEntry`.
|
|
564
|
-
*
|
|
565
|
-
* @param {string} id
|
|
566
|
-
*
|
|
567
|
-
* @returns {import('preact').Ref}
|
|
562
|
+
/**
|
|
563
|
+
* Subscribe to `propertiesPanel.showEntry`.
|
|
564
|
+
*
|
|
565
|
+
* @param {string} id
|
|
566
|
+
*
|
|
567
|
+
* @returns {import('preact').Ref}
|
|
568
568
|
*/
|
|
569
569
|
function useShowEntryEvent(id) {
|
|
570
570
|
const {
|
|
@@ -595,20 +595,20 @@ function useShowEntryEvent(id) {
|
|
|
595
595
|
return ref;
|
|
596
596
|
}
|
|
597
597
|
|
|
598
|
-
/**
|
|
599
|
-
* @callback setSticky
|
|
600
|
-
* @param {boolean} value
|
|
598
|
+
/**
|
|
599
|
+
* @callback setSticky
|
|
600
|
+
* @param {boolean} value
|
|
601
601
|
*/
|
|
602
602
|
|
|
603
|
-
/**
|
|
604
|
-
* Use IntersectionObserver to identify when DOM element is in sticky mode.
|
|
605
|
-
* If sticky is observered setSticky(true) will be called.
|
|
606
|
-
* If sticky mode is left, setSticky(false) will be called.
|
|
607
|
-
*
|
|
608
|
-
*
|
|
609
|
-
* @param {Object} ref
|
|
610
|
-
* @param {string} scrollContainerSelector
|
|
611
|
-
* @param {setSticky} setSticky
|
|
603
|
+
/**
|
|
604
|
+
* Use IntersectionObserver to identify when DOM element is in sticky mode.
|
|
605
|
+
* If sticky is observered setSticky(true) will be called.
|
|
606
|
+
* If sticky mode is left, setSticky(false) will be called.
|
|
607
|
+
*
|
|
608
|
+
*
|
|
609
|
+
* @param {Object} ref
|
|
610
|
+
* @param {string} scrollContainerSelector
|
|
611
|
+
* @param {setSticky} setSticky
|
|
612
612
|
*/
|
|
613
613
|
function useStickyIntersectionObserver(ref, scrollContainerSelector, setSticky) {
|
|
614
614
|
const [scrollContainer, setScrollContainer] = useState(query(scrollContainerSelector));
|
|
@@ -662,19 +662,19 @@ function useStickyIntersectionObserver(ref, scrollContainerSelector, setSticky)
|
|
|
662
662
|
}, [ref.current, scrollContainer, setSticky]);
|
|
663
663
|
}
|
|
664
664
|
|
|
665
|
-
/**
|
|
666
|
-
* Creates a static function reference with changing body.
|
|
667
|
-
* This is necessary when external libraries require a callback function
|
|
668
|
-
* that has references to state variables.
|
|
669
|
-
*
|
|
670
|
-
* Usage:
|
|
671
|
-
* const callback = useStaticCallback((val) => {val === currentState});
|
|
672
|
-
*
|
|
673
|
-
* The `callback` reference is static and can be safely used in external
|
|
674
|
-
* libraries or as a prop that does not cause rerendering of children.
|
|
675
|
-
*
|
|
676
|
-
* @param {Function} callback function with changing reference
|
|
677
|
-
* @returns {Function} static function reference
|
|
665
|
+
/**
|
|
666
|
+
* Creates a static function reference with changing body.
|
|
667
|
+
* This is necessary when external libraries require a callback function
|
|
668
|
+
* that has references to state variables.
|
|
669
|
+
*
|
|
670
|
+
* Usage:
|
|
671
|
+
* const callback = useStaticCallback((val) => {val === currentState});
|
|
672
|
+
*
|
|
673
|
+
* The `callback` reference is static and can be safely used in external
|
|
674
|
+
* libraries or as a prop that does not cause rerendering of children.
|
|
675
|
+
*
|
|
676
|
+
* @param {Function} callback function with changing reference
|
|
677
|
+
* @returns {Function} static function reference
|
|
678
678
|
*/
|
|
679
679
|
function useStaticCallback(callback) {
|
|
680
680
|
const callbackRef = useRef(callback);
|
|
@@ -817,13 +817,13 @@ function DataMarker(props) {
|
|
|
817
817
|
return null;
|
|
818
818
|
}
|
|
819
819
|
|
|
820
|
-
/**
|
|
821
|
-
* @typedef { {
|
|
822
|
-
* text: (element: object) => string,
|
|
823
|
-
* icon?: (element: Object) => import('preact').Component
|
|
824
|
-
* } } PlaceholderDefinition
|
|
825
|
-
*
|
|
826
|
-
* @param { PlaceholderDefinition } props
|
|
820
|
+
/**
|
|
821
|
+
* @typedef { {
|
|
822
|
+
* text: (element: object) => string,
|
|
823
|
+
* icon?: (element: Object) => import('preact').Component
|
|
824
|
+
* } } PlaceholderDefinition
|
|
825
|
+
*
|
|
826
|
+
* @param { PlaceholderDefinition } props
|
|
827
827
|
*/
|
|
828
828
|
function Placeholder(props) {
|
|
829
829
|
const {
|
|
@@ -862,9 +862,9 @@ function Description(props) {
|
|
|
862
862
|
|
|
863
863
|
const noop$6 = () => {};
|
|
864
864
|
|
|
865
|
-
/**
|
|
866
|
-
* Buffer `.focus()` calls while the editor is not initialized.
|
|
867
|
-
* Set Focus inside when the editor is ready.
|
|
865
|
+
/**
|
|
866
|
+
* Buffer `.focus()` calls while the editor is not initialized.
|
|
867
|
+
* Set Focus inside when the editor is ready.
|
|
868
868
|
*/
|
|
869
869
|
const useBufferedFocus$1 = function (editor, ref) {
|
|
870
870
|
const [buffer, setBuffer] = useState(undefined);
|
|
@@ -965,9 +965,9 @@ const CodeEditor$1 = forwardRef((props, ref) => {
|
|
|
965
965
|
|
|
966
966
|
const noop$5 = () => {};
|
|
967
967
|
|
|
968
|
-
/**
|
|
969
|
-
* Buffer `.focus()` calls while the editor is not initialized.
|
|
970
|
-
* Set Focus inside when the editor is ready.
|
|
968
|
+
/**
|
|
969
|
+
* Buffer `.focus()` calls while the editor is not initialized.
|
|
970
|
+
* Set Focus inside when the editor is ready.
|
|
971
971
|
*/
|
|
972
972
|
const useBufferedFocus = function (editor, ref) {
|
|
973
973
|
const [buffer, setBuffer] = useState(undefined);
|
|
@@ -1016,10 +1016,10 @@ const CodeEditor = forwardRef((props, ref) => {
|
|
|
1016
1016
|
useEffect(() => {
|
|
1017
1017
|
let editor;
|
|
1018
1018
|
|
|
1019
|
-
/* Trigger FEEL toggle when
|
|
1020
|
-
*
|
|
1021
|
-
* - `backspace` is pressed
|
|
1022
|
-
* - AND the cursor is at the beginning of the input
|
|
1019
|
+
/* Trigger FEEL toggle when
|
|
1020
|
+
*
|
|
1021
|
+
* - `backspace` is pressed
|
|
1022
|
+
* - AND the cursor is at the beginning of the input
|
|
1023
1023
|
*/
|
|
1024
1024
|
const onKeyDown = e => {
|
|
1025
1025
|
if (e.key !== 'Backspace' || !editor) {
|
|
@@ -1110,10 +1110,10 @@ function FeelIndicator(props) {
|
|
|
1110
1110
|
|
|
1111
1111
|
const noop$4 = () => {};
|
|
1112
1112
|
|
|
1113
|
-
/**
|
|
1114
|
-
* @param {Object} props
|
|
1115
|
-
* @param {Object} props.label
|
|
1116
|
-
* @param {String} props.feel
|
|
1113
|
+
/**
|
|
1114
|
+
* @param {Object} props
|
|
1115
|
+
* @param {Object} props.label
|
|
1116
|
+
* @param {String} props.feel
|
|
1117
1117
|
*/
|
|
1118
1118
|
function FeelIcon(props) {
|
|
1119
1119
|
const {
|
|
@@ -1148,22 +1148,22 @@ const FeelPopupContext = createContext({
|
|
|
1148
1148
|
source: null
|
|
1149
1149
|
});
|
|
1150
1150
|
|
|
1151
|
-
/**
|
|
1152
|
-
* Add a dragger that calls back the passed function with
|
|
1153
|
-
* { event, delta } on drag.
|
|
1154
|
-
*
|
|
1155
|
-
* @example
|
|
1156
|
-
*
|
|
1157
|
-
* function dragMove(event, delta) {
|
|
1158
|
-
* // we are dragging (!!)
|
|
1159
|
-
* }
|
|
1160
|
-
*
|
|
1161
|
-
* domElement.addEventListener('dragstart', dragger(dragMove));
|
|
1162
|
-
*
|
|
1163
|
-
* @param {Function} fn
|
|
1164
|
-
* @param {Element} [dragPreview]
|
|
1165
|
-
*
|
|
1166
|
-
* @return {Function} drag start callback function
|
|
1151
|
+
/**
|
|
1152
|
+
* Add a dragger that calls back the passed function with
|
|
1153
|
+
* { event, delta } on drag.
|
|
1154
|
+
*
|
|
1155
|
+
* @example
|
|
1156
|
+
*
|
|
1157
|
+
* function dragMove(event, delta) {
|
|
1158
|
+
* // we are dragging (!!)
|
|
1159
|
+
* }
|
|
1160
|
+
*
|
|
1161
|
+
* domElement.addEventListener('dragstart', dragger(dragMove));
|
|
1162
|
+
*
|
|
1163
|
+
* @param {Function} fn
|
|
1164
|
+
* @param {Element} [dragPreview]
|
|
1165
|
+
*
|
|
1166
|
+
* @return {Function} drag start callback function
|
|
1167
1167
|
*/
|
|
1168
1168
|
function createDragger(fn, dragPreview) {
|
|
1169
1169
|
let self;
|
|
@@ -1218,23 +1218,23 @@ function emptyCanvas() {
|
|
|
1218
1218
|
|
|
1219
1219
|
const noop$3 = () => {};
|
|
1220
1220
|
|
|
1221
|
-
/**
|
|
1222
|
-
* A generic popup component.
|
|
1223
|
-
*
|
|
1224
|
-
* @param {Object} props
|
|
1225
|
-
* @param {HTMLElement} [props.container]
|
|
1226
|
-
* @param {string} [props.className]
|
|
1227
|
-
* @param {boolean} [props.delayInitialFocus]
|
|
1228
|
-
* @param {{x: number, y: number}} [props.position]
|
|
1229
|
-
* @param {number} [props.width]
|
|
1230
|
-
* @param {number} [props.height]
|
|
1231
|
-
* @param {Function} props.onClose
|
|
1232
|
-
* @param {Function} [props.onPostActivate]
|
|
1233
|
-
* @param {Function} [props.onPostDeactivate]
|
|
1234
|
-
* @param {boolean} [props.returnFocus]
|
|
1235
|
-
* @param {boolean} [props.closeOnEscape]
|
|
1236
|
-
* @param {string} props.title
|
|
1237
|
-
* @param {Ref} [ref]
|
|
1221
|
+
/**
|
|
1222
|
+
* A generic popup component.
|
|
1223
|
+
*
|
|
1224
|
+
* @param {Object} props
|
|
1225
|
+
* @param {HTMLElement} [props.container]
|
|
1226
|
+
* @param {string} [props.className]
|
|
1227
|
+
* @param {boolean} [props.delayInitialFocus]
|
|
1228
|
+
* @param {{x: number, y: number}} [props.position]
|
|
1229
|
+
* @param {number} [props.width]
|
|
1230
|
+
* @param {number} [props.height]
|
|
1231
|
+
* @param {Function} props.onClose
|
|
1232
|
+
* @param {Function} [props.onPostActivate]
|
|
1233
|
+
* @param {Function} [props.onPostDeactivate]
|
|
1234
|
+
* @param {boolean} [props.returnFocus]
|
|
1235
|
+
* @param {boolean} [props.closeOnEscape]
|
|
1236
|
+
* @param {string} props.title
|
|
1237
|
+
* @param {Ref} [ref]
|
|
1238
1238
|
*/
|
|
1239
1239
|
function PopupComponent(props, globalRef) {
|
|
1240
1240
|
const {
|
|
@@ -1453,12 +1453,12 @@ function getContainerNode(node) {
|
|
|
1453
1453
|
const FEEL_POPUP_WIDTH = 700;
|
|
1454
1454
|
const FEEL_POPUP_HEIGHT = 250;
|
|
1455
1455
|
|
|
1456
|
-
/**
|
|
1457
|
-
* FEEL popup component, built as a singleton. Emits lifecycle events as follows:
|
|
1458
|
-
* - `feelPopup.open` - fired before the popup is mounted
|
|
1459
|
-
* - `feelPopup.opened` - fired after the popup is mounted. Event context contains the DOM node of the popup
|
|
1460
|
-
* - `feelPopup.close` - fired before the popup is unmounted. Event context contains the DOM node of the popup
|
|
1461
|
-
* - `feelPopup.closed` - fired after the popup is unmounted
|
|
1456
|
+
/**
|
|
1457
|
+
* FEEL popup component, built as a singleton. Emits lifecycle events as follows:
|
|
1458
|
+
* - `feelPopup.open` - fired before the popup is mounted
|
|
1459
|
+
* - `feelPopup.opened` - fired after the popup is mounted. Event context contains the DOM node of the popup
|
|
1460
|
+
* - `feelPopup.close` - fired before the popup is unmounted. Event context contains the DOM node of the popup
|
|
1461
|
+
* - `feelPopup.closed` - fired after the popup is unmounted
|
|
1462
1462
|
*/
|
|
1463
1463
|
function FEELPopupRoot(props) {
|
|
1464
1464
|
const {
|
|
@@ -1684,11 +1684,11 @@ function autoCompletionOpen(element) {
|
|
|
1684
1684
|
return element.closest('.cm-editor').querySelector('.cm-tooltip-autocomplete');
|
|
1685
1685
|
}
|
|
1686
1686
|
|
|
1687
|
-
/**
|
|
1688
|
-
* This hook behaves like useEffect, but does not trigger on the first render.
|
|
1689
|
-
*
|
|
1690
|
-
* @param {Function} effect
|
|
1691
|
-
* @param {Array} deps
|
|
1687
|
+
/**
|
|
1688
|
+
* This hook behaves like useEffect, but does not trigger on the first render.
|
|
1689
|
+
*
|
|
1690
|
+
* @param {Function} effect
|
|
1691
|
+
* @param {Array} deps
|
|
1692
1692
|
*/
|
|
1693
1693
|
function useUpdateEffect(effect, deps) {
|
|
1694
1694
|
const isMounted = useRef(false);
|
|
@@ -1766,19 +1766,19 @@ function ToggleSwitch(props) {
|
|
|
1766
1766
|
});
|
|
1767
1767
|
}
|
|
1768
1768
|
|
|
1769
|
-
/**
|
|
1770
|
-
* @param {Object} props
|
|
1771
|
-
* @param {Object} props.element
|
|
1772
|
-
* @param {String} props.id
|
|
1773
|
-
* @param {String} props.description
|
|
1774
|
-
* @param {String} props.label
|
|
1775
|
-
* @param {String} props.switcherLabel
|
|
1776
|
-
* @param {Boolean} props.inline
|
|
1777
|
-
* @param {Function} props.getValue
|
|
1778
|
-
* @param {Function} props.setValue
|
|
1779
|
-
* @param {Function} props.onFocus
|
|
1780
|
-
* @param {Function} props.onBlur
|
|
1781
|
-
* @param {string|import('preact').Component} props.tooltip
|
|
1769
|
+
/**
|
|
1770
|
+
* @param {Object} props
|
|
1771
|
+
* @param {Object} props.element
|
|
1772
|
+
* @param {String} props.id
|
|
1773
|
+
* @param {String} props.description
|
|
1774
|
+
* @param {String} props.label
|
|
1775
|
+
* @param {String} props.switcherLabel
|
|
1776
|
+
* @param {Boolean} props.inline
|
|
1777
|
+
* @param {Function} props.getValue
|
|
1778
|
+
* @param {Function} props.setValue
|
|
1779
|
+
* @param {Function} props.onFocus
|
|
1780
|
+
* @param {Function} props.onBlur
|
|
1781
|
+
* @param {string|import('preact').Component} props.tooltip
|
|
1782
1782
|
*/
|
|
1783
1783
|
function ToggleSwitchEntry(props) {
|
|
1784
1784
|
const {
|
|
@@ -1886,22 +1886,22 @@ function NumberField(props) {
|
|
|
1886
1886
|
});
|
|
1887
1887
|
}
|
|
1888
1888
|
|
|
1889
|
-
/**
|
|
1890
|
-
* @param {Object} props
|
|
1891
|
-
* @param {Boolean} props.debounce
|
|
1892
|
-
* @param {String} props.description
|
|
1893
|
-
* @param {Boolean} props.disabled
|
|
1894
|
-
* @param {Object} props.element
|
|
1895
|
-
* @param {Function} props.getValue
|
|
1896
|
-
* @param {String} props.id
|
|
1897
|
-
* @param {String} props.label
|
|
1898
|
-
* @param {String} props.max
|
|
1899
|
-
* @param {String} props.min
|
|
1900
|
-
* @param {Function} props.setValue
|
|
1901
|
-
* @param {Function} props.onFocus
|
|
1902
|
-
* @param {Function} props.onBlur
|
|
1903
|
-
* @param {String} props.step
|
|
1904
|
-
* @param {Function} props.validate
|
|
1889
|
+
/**
|
|
1890
|
+
* @param {Object} props
|
|
1891
|
+
* @param {Boolean} props.debounce
|
|
1892
|
+
* @param {String} props.description
|
|
1893
|
+
* @param {Boolean} props.disabled
|
|
1894
|
+
* @param {Object} props.element
|
|
1895
|
+
* @param {Function} props.getValue
|
|
1896
|
+
* @param {String} props.id
|
|
1897
|
+
* @param {String} props.label
|
|
1898
|
+
* @param {String} props.max
|
|
1899
|
+
* @param {String} props.min
|
|
1900
|
+
* @param {Function} props.setValue
|
|
1901
|
+
* @param {Function} props.onFocus
|
|
1902
|
+
* @param {Function} props.onBlur
|
|
1903
|
+
* @param {String} props.step
|
|
1904
|
+
* @param {Function} props.validate
|
|
1905
1905
|
*/
|
|
1906
1906
|
function NumberFieldEntry(props) {
|
|
1907
1907
|
const {
|
|
@@ -2387,26 +2387,26 @@ const OptionalFeelCheckbox = forwardRef((props, ref) => {
|
|
|
2387
2387
|
});
|
|
2388
2388
|
});
|
|
2389
2389
|
|
|
2390
|
-
/**
|
|
2391
|
-
* @param {Object} props
|
|
2392
|
-
* @param {Object} props.element
|
|
2393
|
-
* @param {String} props.id
|
|
2394
|
-
* @param {String} props.description
|
|
2395
|
-
* @param {Boolean} props.debounce
|
|
2396
|
-
* @param {Boolean} props.disabled
|
|
2397
|
-
* @param {Boolean} props.feel
|
|
2398
|
-
* @param {String} props.label
|
|
2399
|
-
* @param {Function} props.getValue
|
|
2400
|
-
* @param {Function} props.setValue
|
|
2401
|
-
* @param {Function} props.tooltipContainer
|
|
2402
|
-
* @param {Function} props.validate
|
|
2403
|
-
* @param {Function} props.show
|
|
2404
|
-
* @param {Function} props.example
|
|
2405
|
-
* @param {Function} props.variables
|
|
2406
|
-
* @param {Function} props.onFocus
|
|
2407
|
-
* @param {Function} props.onBlur
|
|
2408
|
-
* @param {string} [props.placeholder]
|
|
2409
|
-
* @param {string|import('preact').Component} props.tooltip
|
|
2390
|
+
/**
|
|
2391
|
+
* @param {Object} props
|
|
2392
|
+
* @param {Object} props.element
|
|
2393
|
+
* @param {String} props.id
|
|
2394
|
+
* @param {String} props.description
|
|
2395
|
+
* @param {Boolean} props.debounce
|
|
2396
|
+
* @param {Boolean} props.disabled
|
|
2397
|
+
* @param {Boolean} props.feel
|
|
2398
|
+
* @param {String} props.label
|
|
2399
|
+
* @param {Function} props.getValue
|
|
2400
|
+
* @param {Function} props.setValue
|
|
2401
|
+
* @param {Function} props.tooltipContainer
|
|
2402
|
+
* @param {Function} props.validate
|
|
2403
|
+
* @param {Function} props.show
|
|
2404
|
+
* @param {Function} props.example
|
|
2405
|
+
* @param {Function} props.variables
|
|
2406
|
+
* @param {Function} props.onFocus
|
|
2407
|
+
* @param {Function} props.onBlur
|
|
2408
|
+
* @param {string} [props.placeholder]
|
|
2409
|
+
* @param {string|import('preact').Component} props.tooltip
|
|
2410
2410
|
*/
|
|
2411
2411
|
function FeelEntry(props) {
|
|
2412
2412
|
const {
|
|
@@ -2493,27 +2493,27 @@ function FeelEntry(props) {
|
|
|
2493
2493
|
});
|
|
2494
2494
|
}
|
|
2495
2495
|
|
|
2496
|
-
/**
|
|
2497
|
-
* @param {Object} props
|
|
2498
|
-
* @param {Object} props.element
|
|
2499
|
-
* @param {String} props.id
|
|
2500
|
-
* @param {String} props.description
|
|
2501
|
-
* @param {Boolean} props.debounce
|
|
2502
|
-
* @param {Boolean} props.disabled
|
|
2503
|
-
* @param {String} props.max
|
|
2504
|
-
* @param {String} props.min
|
|
2505
|
-
* @param {String} props.step
|
|
2506
|
-
* @param {Boolean} props.feel
|
|
2507
|
-
* @param {String} props.label
|
|
2508
|
-
* @param {Function} props.getValue
|
|
2509
|
-
* @param {Function} props.setValue
|
|
2510
|
-
* @param {Function} props.tooltipContainer
|
|
2511
|
-
* @param {Function} props.validate
|
|
2512
|
-
* @param {Function} props.show
|
|
2513
|
-
* @param {Function} props.example
|
|
2514
|
-
* @param {Function} props.variables
|
|
2515
|
-
* @param {Function} props.onFocus
|
|
2516
|
-
* @param {Function} props.onBlur
|
|
2496
|
+
/**
|
|
2497
|
+
* @param {Object} props
|
|
2498
|
+
* @param {Object} props.element
|
|
2499
|
+
* @param {String} props.id
|
|
2500
|
+
* @param {String} props.description
|
|
2501
|
+
* @param {Boolean} props.debounce
|
|
2502
|
+
* @param {Boolean} props.disabled
|
|
2503
|
+
* @param {String} props.max
|
|
2504
|
+
* @param {String} props.min
|
|
2505
|
+
* @param {String} props.step
|
|
2506
|
+
* @param {Boolean} props.feel
|
|
2507
|
+
* @param {String} props.label
|
|
2508
|
+
* @param {Function} props.getValue
|
|
2509
|
+
* @param {Function} props.setValue
|
|
2510
|
+
* @param {Function} props.tooltipContainer
|
|
2511
|
+
* @param {Function} props.validate
|
|
2512
|
+
* @param {Function} props.show
|
|
2513
|
+
* @param {Function} props.example
|
|
2514
|
+
* @param {Function} props.variables
|
|
2515
|
+
* @param {Function} props.onFocus
|
|
2516
|
+
* @param {Function} props.onBlur
|
|
2517
2517
|
*/
|
|
2518
2518
|
function FeelNumberEntry(props) {
|
|
2519
2519
|
return jsx(FeelEntry, {
|
|
@@ -2523,25 +2523,25 @@ function FeelNumberEntry(props) {
|
|
|
2523
2523
|
});
|
|
2524
2524
|
}
|
|
2525
2525
|
|
|
2526
|
-
/**
|
|
2527
|
-
* @param {Object} props
|
|
2528
|
-
* @param {Object} props.element
|
|
2529
|
-
* @param {String} props.id
|
|
2530
|
-
* @param {String} props.description
|
|
2531
|
-
* @param {Boolean} props.debounce
|
|
2532
|
-
* @param {Boolean} props.disabled
|
|
2533
|
-
* @param {Boolean} props.feel
|
|
2534
|
-
* @param {String} props.label
|
|
2535
|
-
* @param {Function} props.getValue
|
|
2536
|
-
* @param {Function} props.setValue
|
|
2537
|
-
* @param {Function} props.tooltipContainer
|
|
2538
|
-
* @param {Function} props.validate
|
|
2539
|
-
* @param {Function} props.show
|
|
2540
|
-
* @param {Function} props.example
|
|
2541
|
-
* @param {Function} props.variables
|
|
2542
|
-
* @param {Function} props.onFocus
|
|
2543
|
-
* @param {Function} props.onBlur
|
|
2544
|
-
* @param {string} [props.placeholder]
|
|
2526
|
+
/**
|
|
2527
|
+
* @param {Object} props
|
|
2528
|
+
* @param {Object} props.element
|
|
2529
|
+
* @param {String} props.id
|
|
2530
|
+
* @param {String} props.description
|
|
2531
|
+
* @param {Boolean} props.debounce
|
|
2532
|
+
* @param {Boolean} props.disabled
|
|
2533
|
+
* @param {Boolean} props.feel
|
|
2534
|
+
* @param {String} props.label
|
|
2535
|
+
* @param {Function} props.getValue
|
|
2536
|
+
* @param {Function} props.setValue
|
|
2537
|
+
* @param {Function} props.tooltipContainer
|
|
2538
|
+
* @param {Function} props.validate
|
|
2539
|
+
* @param {Function} props.show
|
|
2540
|
+
* @param {Function} props.example
|
|
2541
|
+
* @param {Function} props.variables
|
|
2542
|
+
* @param {Function} props.onFocus
|
|
2543
|
+
* @param {Function} props.onBlur
|
|
2544
|
+
* @param {string} [props.placeholder]
|
|
2545
2545
|
*/
|
|
2546
2546
|
function FeelTextAreaEntry(props) {
|
|
2547
2547
|
return jsx(FeelEntry, {
|
|
@@ -2551,24 +2551,24 @@ function FeelTextAreaEntry(props) {
|
|
|
2551
2551
|
});
|
|
2552
2552
|
}
|
|
2553
2553
|
|
|
2554
|
-
/**
|
|
2555
|
-
* @param {Object} props
|
|
2556
|
-
* @param {Object} props.element
|
|
2557
|
-
* @param {String} props.id
|
|
2558
|
-
* @param {String} props.description
|
|
2559
|
-
* @param {Boolean} props.debounce
|
|
2560
|
-
* @param {Boolean} props.disabled
|
|
2561
|
-
* @param {Boolean} props.feel
|
|
2562
|
-
* @param {String} props.label
|
|
2563
|
-
* @param {Function} props.getValue
|
|
2564
|
-
* @param {Function} props.setValue
|
|
2565
|
-
* @param {Function} props.tooltipContainer
|
|
2566
|
-
* @param {Function} props.validate
|
|
2567
|
-
* @param {Function} props.show
|
|
2568
|
-
* @param {Function} props.example
|
|
2569
|
-
* @param {Function} props.variables
|
|
2570
|
-
* @param {Function} props.onFocus
|
|
2571
|
-
* @param {Function} props.onBlur
|
|
2554
|
+
/**
|
|
2555
|
+
* @param {Object} props
|
|
2556
|
+
* @param {Object} props.element
|
|
2557
|
+
* @param {String} props.id
|
|
2558
|
+
* @param {String} props.description
|
|
2559
|
+
* @param {Boolean} props.debounce
|
|
2560
|
+
* @param {Boolean} props.disabled
|
|
2561
|
+
* @param {Boolean} props.feel
|
|
2562
|
+
* @param {String} props.label
|
|
2563
|
+
* @param {Function} props.getValue
|
|
2564
|
+
* @param {Function} props.setValue
|
|
2565
|
+
* @param {Function} props.tooltipContainer
|
|
2566
|
+
* @param {Function} props.validate
|
|
2567
|
+
* @param {Function} props.show
|
|
2568
|
+
* @param {Function} props.example
|
|
2569
|
+
* @param {Function} props.variables
|
|
2570
|
+
* @param {Function} props.onFocus
|
|
2571
|
+
* @param {Function} props.onBlur
|
|
2572
2572
|
*/
|
|
2573
2573
|
function FeelToggleSwitchEntry(props) {
|
|
2574
2574
|
return jsx(FeelEntry, {
|
|
@@ -2578,24 +2578,24 @@ function FeelToggleSwitchEntry(props) {
|
|
|
2578
2578
|
});
|
|
2579
2579
|
}
|
|
2580
2580
|
|
|
2581
|
-
/**
|
|
2582
|
-
* @param {Object} props
|
|
2583
|
-
* @param {Object} props.element
|
|
2584
|
-
* @param {String} props.id
|
|
2585
|
-
* @param {String} props.description
|
|
2586
|
-
* @param {Boolean} props.debounce
|
|
2587
|
-
* @param {Boolean} props.disabled
|
|
2588
|
-
* @param {Boolean} props.feel
|
|
2589
|
-
* @param {String} props.label
|
|
2590
|
-
* @param {Function} props.getValue
|
|
2591
|
-
* @param {Function} props.setValue
|
|
2592
|
-
* @param {Function} props.tooltipContainer
|
|
2593
|
-
* @param {Function} props.validate
|
|
2594
|
-
* @param {Function} props.show
|
|
2595
|
-
* @param {Function} props.example
|
|
2596
|
-
* @param {Function} props.variables
|
|
2597
|
-
* @param {Function} props.onFocus
|
|
2598
|
-
* @param {Function} props.onBlur
|
|
2581
|
+
/**
|
|
2582
|
+
* @param {Object} props
|
|
2583
|
+
* @param {Object} props.element
|
|
2584
|
+
* @param {String} props.id
|
|
2585
|
+
* @param {String} props.description
|
|
2586
|
+
* @param {Boolean} props.debounce
|
|
2587
|
+
* @param {Boolean} props.disabled
|
|
2588
|
+
* @param {Boolean} props.feel
|
|
2589
|
+
* @param {String} props.label
|
|
2590
|
+
* @param {Function} props.getValue
|
|
2591
|
+
* @param {Function} props.setValue
|
|
2592
|
+
* @param {Function} props.tooltipContainer
|
|
2593
|
+
* @param {Function} props.validate
|
|
2594
|
+
* @param {Function} props.show
|
|
2595
|
+
* @param {Function} props.example
|
|
2596
|
+
* @param {Function} props.variables
|
|
2597
|
+
* @param {Function} props.onFocus
|
|
2598
|
+
* @param {Function} props.onBlur
|
|
2599
2599
|
*/
|
|
2600
2600
|
function FeelCheckboxEntry(props) {
|
|
2601
2601
|
return jsx(FeelEntry, {
|
|
@@ -2605,26 +2605,26 @@ function FeelCheckboxEntry(props) {
|
|
|
2605
2605
|
});
|
|
2606
2606
|
}
|
|
2607
2607
|
|
|
2608
|
-
/**
|
|
2609
|
-
* @param {Object} props
|
|
2610
|
-
* @param {Object} props.element
|
|
2611
|
-
* @param {String} props.id
|
|
2612
|
-
* @param {String} props.description
|
|
2613
|
-
* @param {String} props.hostLanguage
|
|
2614
|
-
* @param {Boolean} props.singleLine
|
|
2615
|
-
* @param {Boolean} props.debounce
|
|
2616
|
-
* @param {Boolean} props.disabled
|
|
2617
|
-
* @param {Boolean} props.feel
|
|
2618
|
-
* @param {String} props.label
|
|
2619
|
-
* @param {Function} props.getValue
|
|
2620
|
-
* @param {Function} props.setValue
|
|
2621
|
-
* @param {Function} props.tooltipContainer
|
|
2622
|
-
* @param {Function} props.validate
|
|
2623
|
-
* @param {Function} props.show
|
|
2624
|
-
* @param {Function} props.example
|
|
2625
|
-
* @param {Function} props.variables
|
|
2626
|
-
* @param {Function} props.onFocus
|
|
2627
|
-
* @param {Function} props.onBlur
|
|
2608
|
+
/**
|
|
2609
|
+
* @param {Object} props
|
|
2610
|
+
* @param {Object} props.element
|
|
2611
|
+
* @param {String} props.id
|
|
2612
|
+
* @param {String} props.description
|
|
2613
|
+
* @param {String} props.hostLanguage
|
|
2614
|
+
* @param {Boolean} props.singleLine
|
|
2615
|
+
* @param {Boolean} props.debounce
|
|
2616
|
+
* @param {Boolean} props.disabled
|
|
2617
|
+
* @param {Boolean} props.feel
|
|
2618
|
+
* @param {String} props.label
|
|
2619
|
+
* @param {Function} props.getValue
|
|
2620
|
+
* @param {Function} props.setValue
|
|
2621
|
+
* @param {Function} props.tooltipContainer
|
|
2622
|
+
* @param {Function} props.validate
|
|
2623
|
+
* @param {Function} props.show
|
|
2624
|
+
* @param {Function} props.example
|
|
2625
|
+
* @param {Function} props.variables
|
|
2626
|
+
* @param {Function} props.onFocus
|
|
2627
|
+
* @param {Function} props.onBlur
|
|
2628
2628
|
*/
|
|
2629
2629
|
function FeelTemplatingEntry(props) {
|
|
2630
2630
|
return jsx(FeelEntry, {
|
|
@@ -2693,85 +2693,85 @@ const DEFAULT_LAYOUT = {};
|
|
|
2693
2693
|
const DEFAULT_DESCRIPTION = {};
|
|
2694
2694
|
const DEFAULT_TOOLTIP = {};
|
|
2695
2695
|
|
|
2696
|
-
/**
|
|
2697
|
-
* @typedef { {
|
|
2698
|
-
* component: import('preact').Component,
|
|
2699
|
-
* id: String,
|
|
2700
|
-
* isEdited?: Function
|
|
2701
|
-
* } } EntryDefinition
|
|
2702
|
-
*
|
|
2703
|
-
* @typedef { {
|
|
2704
|
-
* autoFocusEntry: String,
|
|
2705
|
-
* autoOpen?: Boolean,
|
|
2706
|
-
* entries: Array<EntryDefinition>,
|
|
2707
|
-
* id: String,
|
|
2708
|
-
* label: String,
|
|
2709
|
-
* remove: (event: MouseEvent) => void
|
|
2710
|
-
* } } ListItemDefinition
|
|
2711
|
-
*
|
|
2712
|
-
* @typedef { {
|
|
2713
|
-
* add: (event: MouseEvent) => void,
|
|
2714
|
-
* component: import('preact').Component,
|
|
2715
|
-
* element: Object,
|
|
2716
|
-
* id: String,
|
|
2717
|
-
* items: Array<ListItemDefinition>,
|
|
2718
|
-
* label: String,
|
|
2719
|
-
* shouldOpen?: Boolean
|
|
2720
|
-
* } } ListGroupDefinition
|
|
2721
|
-
*
|
|
2722
|
-
* @typedef { {
|
|
2723
|
-
* component?: import('preact').Component,
|
|
2724
|
-
* entries: Array<EntryDefinition>,
|
|
2725
|
-
* id: String,
|
|
2726
|
-
* label: String,
|
|
2727
|
-
* shouldOpen?: Boolean
|
|
2728
|
-
* } } GroupDefinition
|
|
2729
|
-
*
|
|
2730
|
-
* @typedef { {
|
|
2731
|
-
* [id: String]: GetDescriptionFunction
|
|
2732
|
-
* } } DescriptionConfig
|
|
2733
|
-
*
|
|
2734
|
-
* @typedef { {
|
|
2735
|
-
* [id: String]: GetTooltipFunction
|
|
2736
|
-
* } } TooltipConfig
|
|
2737
|
-
*
|
|
2738
|
-
* @callback { {
|
|
2739
|
-
* @param {string} id
|
|
2740
|
-
* @param {Object} element
|
|
2741
|
-
* @returns {string}
|
|
2742
|
-
* } } GetDescriptionFunction
|
|
2743
|
-
*
|
|
2744
|
-
* @callback { {
|
|
2745
|
-
* @param {string} id
|
|
2746
|
-
* @param {Object} element
|
|
2747
|
-
* @returns {string}
|
|
2748
|
-
* } } GetTooltipFunction
|
|
2749
|
-
*
|
|
2750
|
-
* @typedef { {
|
|
2751
|
-
* getEmpty: (element: object) => import('./components/Placeholder').PlaceholderDefinition,
|
|
2752
|
-
* getMultiple: (element: Object) => import('./components/Placeholder').PlaceholderDefinition
|
|
2753
|
-
* } } PlaceholderProvider
|
|
2754
|
-
*
|
|
2696
|
+
/**
|
|
2697
|
+
* @typedef { {
|
|
2698
|
+
* component: import('preact').Component,
|
|
2699
|
+
* id: String,
|
|
2700
|
+
* isEdited?: Function
|
|
2701
|
+
* } } EntryDefinition
|
|
2702
|
+
*
|
|
2703
|
+
* @typedef { {
|
|
2704
|
+
* autoFocusEntry: String,
|
|
2705
|
+
* autoOpen?: Boolean,
|
|
2706
|
+
* entries: Array<EntryDefinition>,
|
|
2707
|
+
* id: String,
|
|
2708
|
+
* label: String,
|
|
2709
|
+
* remove: (event: MouseEvent) => void
|
|
2710
|
+
* } } ListItemDefinition
|
|
2711
|
+
*
|
|
2712
|
+
* @typedef { {
|
|
2713
|
+
* add: (event: MouseEvent) => void,
|
|
2714
|
+
* component: import('preact').Component,
|
|
2715
|
+
* element: Object,
|
|
2716
|
+
* id: String,
|
|
2717
|
+
* items: Array<ListItemDefinition>,
|
|
2718
|
+
* label: String,
|
|
2719
|
+
* shouldOpen?: Boolean
|
|
2720
|
+
* } } ListGroupDefinition
|
|
2721
|
+
*
|
|
2722
|
+
* @typedef { {
|
|
2723
|
+
* component?: import('preact').Component,
|
|
2724
|
+
* entries: Array<EntryDefinition>,
|
|
2725
|
+
* id: String,
|
|
2726
|
+
* label: String,
|
|
2727
|
+
* shouldOpen?: Boolean
|
|
2728
|
+
* } } GroupDefinition
|
|
2729
|
+
*
|
|
2730
|
+
* @typedef { {
|
|
2731
|
+
* [id: String]: GetDescriptionFunction
|
|
2732
|
+
* } } DescriptionConfig
|
|
2733
|
+
*
|
|
2734
|
+
* @typedef { {
|
|
2735
|
+
* [id: String]: GetTooltipFunction
|
|
2736
|
+
* } } TooltipConfig
|
|
2737
|
+
*
|
|
2738
|
+
* @callback { {
|
|
2739
|
+
* @param {string} id
|
|
2740
|
+
* @param {Object} element
|
|
2741
|
+
* @returns {string}
|
|
2742
|
+
* } } GetDescriptionFunction
|
|
2743
|
+
*
|
|
2744
|
+
* @callback { {
|
|
2745
|
+
* @param {string} id
|
|
2746
|
+
* @param {Object} element
|
|
2747
|
+
* @returns {string}
|
|
2748
|
+
* } } GetTooltipFunction
|
|
2749
|
+
*
|
|
2750
|
+
* @typedef { {
|
|
2751
|
+
* getEmpty: (element: object) => import('./components/Placeholder').PlaceholderDefinition,
|
|
2752
|
+
* getMultiple: (element: Object) => import('./components/Placeholder').PlaceholderDefinition
|
|
2753
|
+
* } } PlaceholderProvider
|
|
2754
|
+
*
|
|
2755
2755
|
*/
|
|
2756
2756
|
|
|
2757
|
-
/**
|
|
2758
|
-
* A basic properties panel component. Describes *how* content will be rendered, accepts
|
|
2759
|
-
* data from implementor to describe *what* will be rendered.
|
|
2760
|
-
*
|
|
2761
|
-
* @param {Object} props
|
|
2762
|
-
* @param {Object|Array} props.element
|
|
2763
|
-
* @param {import('./components/Header').HeaderProvider} props.headerProvider
|
|
2764
|
-
* @param {PlaceholderProvider} [props.placeholderProvider]
|
|
2765
|
-
* @param {Array<GroupDefinition|ListGroupDefinition>} props.groups
|
|
2766
|
-
* @param {Object} [props.layoutConfig]
|
|
2767
|
-
* @param {Function} [props.layoutChanged]
|
|
2768
|
-
* @param {DescriptionConfig} [props.descriptionConfig]
|
|
2769
|
-
* @param {Function} [props.descriptionLoaded]
|
|
2770
|
-
* @param {TooltipConfig} [props.tooltipConfig]
|
|
2771
|
-
* @param {Function} [props.tooltipLoaded]
|
|
2772
|
-
* @param {HTMLElement} [props.feelPopupContainer]
|
|
2773
|
-
* @param {Function} [props.getFeelPopupLinks]
|
|
2774
|
-
* @param {Object} [props.eventBus]
|
|
2757
|
+
/**
|
|
2758
|
+
* A basic properties panel component. Describes *how* content will be rendered, accepts
|
|
2759
|
+
* data from implementor to describe *what* will be rendered.
|
|
2760
|
+
*
|
|
2761
|
+
* @param {Object} props
|
|
2762
|
+
* @param {Object|Array} props.element
|
|
2763
|
+
* @param {import('./components/Header').HeaderProvider} props.headerProvider
|
|
2764
|
+
* @param {PlaceholderProvider} [props.placeholderProvider]
|
|
2765
|
+
* @param {Array<GroupDefinition|ListGroupDefinition>} props.groups
|
|
2766
|
+
* @param {Object} [props.layoutConfig]
|
|
2767
|
+
* @param {Function} [props.layoutChanged]
|
|
2768
|
+
* @param {DescriptionConfig} [props.descriptionConfig]
|
|
2769
|
+
* @param {Function} [props.descriptionLoaded]
|
|
2770
|
+
* @param {TooltipConfig} [props.tooltipConfig]
|
|
2771
|
+
* @param {Function} [props.tooltipLoaded]
|
|
2772
|
+
* @param {HTMLElement} [props.feelPopupContainer]
|
|
2773
|
+
* @param {Function} [props.getFeelPopupLinks]
|
|
2774
|
+
* @param {Object} [props.eventBus]
|
|
2775
2775
|
*/
|
|
2776
2776
|
function PropertiesPanel(props) {
|
|
2777
2777
|
const {
|
|
@@ -2944,11 +2944,11 @@ function createTooltipContext(overrides = {}) {
|
|
|
2944
2944
|
|
|
2945
2945
|
// hooks //////////////////
|
|
2946
2946
|
|
|
2947
|
-
/**
|
|
2948
|
-
* This hook behaves like useLayoutEffect, but does not trigger on the first render.
|
|
2949
|
-
*
|
|
2950
|
-
* @param {Function} effect
|
|
2951
|
-
* @param {Array} deps
|
|
2947
|
+
/**
|
|
2948
|
+
* This hook behaves like useLayoutEffect, but does not trigger on the first render.
|
|
2949
|
+
*
|
|
2950
|
+
* @param {Function} effect
|
|
2951
|
+
* @param {Array} deps
|
|
2952
2952
|
*/
|
|
2953
2953
|
function useUpdateLayoutEffect(effect, deps) {
|
|
2954
2954
|
const isMounted = useRef(false);
|
|
@@ -3023,15 +3023,15 @@ function MenuItem({
|
|
|
3023
3023
|
});
|
|
3024
3024
|
}
|
|
3025
3025
|
|
|
3026
|
-
/**
|
|
3027
|
-
*
|
|
3028
|
-
* @param {Array<null | Element>} ignoredElements
|
|
3029
|
-
* @param {Function} callback
|
|
3026
|
+
/**
|
|
3027
|
+
*
|
|
3028
|
+
* @param {Array<null | Element>} ignoredElements
|
|
3029
|
+
* @param {Function} callback
|
|
3030
3030
|
*/
|
|
3031
3031
|
function useGlobalClick(ignoredElements, callback) {
|
|
3032
3032
|
useEffect(() => {
|
|
3033
|
-
/**
|
|
3034
|
-
* @param {MouseEvent} event
|
|
3033
|
+
/**
|
|
3034
|
+
* @param {MouseEvent} event
|
|
3035
3035
|
*/
|
|
3036
3036
|
function listener(event) {
|
|
3037
3037
|
if (ignoredElements.some(element => element && element.contains(event.target))) {
|
|
@@ -3064,20 +3064,20 @@ function HeaderButton(props) {
|
|
|
3064
3064
|
});
|
|
3065
3065
|
}
|
|
3066
3066
|
|
|
3067
|
-
/**
|
|
3068
|
-
* @typedef { {
|
|
3069
|
-
* [key: string]: string;
|
|
3070
|
-
* } } TranslateReplacements
|
|
3067
|
+
/**
|
|
3068
|
+
* @typedef { {
|
|
3069
|
+
* [key: string]: string;
|
|
3070
|
+
* } } TranslateReplacements
|
|
3071
3071
|
*/
|
|
3072
3072
|
|
|
3073
|
-
/**
|
|
3074
|
-
* A simple translation stub to be used for multi-language support.
|
|
3075
|
-
* Can be easily replaced with a more sophisticated solution.
|
|
3076
|
-
*
|
|
3077
|
-
* @param {string} template to interpolate
|
|
3078
|
-
* @param {TranslateReplacements} [replacements] a map with substitutes
|
|
3079
|
-
*
|
|
3080
|
-
* @return {string} the translated string
|
|
3073
|
+
/**
|
|
3074
|
+
* A simple translation stub to be used for multi-language support.
|
|
3075
|
+
* Can be easily replaced with a more sophisticated solution.
|
|
3076
|
+
*
|
|
3077
|
+
* @param {string} template to interpolate
|
|
3078
|
+
* @param {TranslateReplacements} [replacements] a map with substitutes
|
|
3079
|
+
*
|
|
3080
|
+
* @return {string} the translated string
|
|
3081
3081
|
*/
|
|
3082
3082
|
function translateFallback(template, replacements) {
|
|
3083
3083
|
replacements = replacements || {};
|
|
@@ -3189,8 +3189,8 @@ function ListItem(props) {
|
|
|
3189
3189
|
|
|
3190
3190
|
const noop$1 = () => {};
|
|
3191
3191
|
|
|
3192
|
-
/**
|
|
3193
|
-
* @param {import('../PropertiesPanel').ListGroupDefinition} props
|
|
3192
|
+
/**
|
|
3193
|
+
* @param {import('../PropertiesPanel').ListGroupDefinition} props
|
|
3194
3194
|
*/
|
|
3195
3195
|
function ListGroup(props) {
|
|
3196
3196
|
const {
|
|
@@ -3382,18 +3382,18 @@ function Checkbox(props) {
|
|
|
3382
3382
|
});
|
|
3383
3383
|
}
|
|
3384
3384
|
|
|
3385
|
-
/**
|
|
3386
|
-
* @param {Object} props
|
|
3387
|
-
* @param {Object} props.element
|
|
3388
|
-
* @param {String} props.id
|
|
3389
|
-
* @param {String} props.description
|
|
3390
|
-
* @param {String} props.label
|
|
3391
|
-
* @param {Function} props.getValue
|
|
3392
|
-
* @param {Function} props.setValue
|
|
3393
|
-
* @param {Function} props.onFocus
|
|
3394
|
-
* @param {Function} props.onBlur
|
|
3395
|
-
* @param {string|import('preact').Component} props.tooltip
|
|
3396
|
-
* @param {boolean} [props.disabled]
|
|
3385
|
+
/**
|
|
3386
|
+
* @param {Object} props
|
|
3387
|
+
* @param {Object} props.element
|
|
3388
|
+
* @param {String} props.id
|
|
3389
|
+
* @param {String} props.description
|
|
3390
|
+
* @param {String} props.label
|
|
3391
|
+
* @param {Function} props.getValue
|
|
3392
|
+
* @param {Function} props.setValue
|
|
3393
|
+
* @param {Function} props.onFocus
|
|
3394
|
+
* @param {Function} props.onBlur
|
|
3395
|
+
* @param {string|import('preact').Component} props.tooltip
|
|
3396
|
+
* @param {boolean} [props.disabled]
|
|
3397
3397
|
*/
|
|
3398
3398
|
function CheckboxEntry(props) {
|
|
3399
3399
|
const {
|
|
@@ -3445,19 +3445,19 @@ function prefixId$4(id) {
|
|
|
3445
3445
|
|
|
3446
3446
|
const noop = () => {};
|
|
3447
3447
|
|
|
3448
|
-
/**
|
|
3449
|
-
* @param {Object} props
|
|
3450
|
-
* @param {Object} props.element
|
|
3451
|
-
* @param {String} props.id
|
|
3452
|
-
* @param {String} props.description
|
|
3453
|
-
* @param {Boolean} props.debounce
|
|
3454
|
-
* @param {Boolean} props.disabled
|
|
3455
|
-
* @param {String} props.label
|
|
3456
|
-
* @param {Function} props.getValue
|
|
3457
|
-
* @param {Function} props.setValue
|
|
3458
|
-
* @param {Function} props.tooltipContainer
|
|
3459
|
-
* @param {Function} props.validate
|
|
3460
|
-
* @param {Function} props.show
|
|
3448
|
+
/**
|
|
3449
|
+
* @param {Object} props
|
|
3450
|
+
* @param {Object} props.element
|
|
3451
|
+
* @param {String} props.id
|
|
3452
|
+
* @param {String} props.description
|
|
3453
|
+
* @param {Boolean} props.debounce
|
|
3454
|
+
* @param {Boolean} props.disabled
|
|
3455
|
+
* @param {String} props.label
|
|
3456
|
+
* @param {Function} props.getValue
|
|
3457
|
+
* @param {Function} props.setValue
|
|
3458
|
+
* @param {Function} props.tooltipContainer
|
|
3459
|
+
* @param {Function} props.validate
|
|
3460
|
+
* @param {Function} props.show
|
|
3461
3461
|
*/
|
|
3462
3462
|
function TemplatingEntry(props) {
|
|
3463
3463
|
const {
|
|
@@ -3632,8 +3632,8 @@ function List(props) {
|
|
|
3632
3632
|
}
|
|
3633
3633
|
}, [open, hasItems]);
|
|
3634
3634
|
|
|
3635
|
-
/**
|
|
3636
|
-
* @param {MouseEvent} event
|
|
3635
|
+
/**
|
|
3636
|
+
* @param {MouseEvent} event
|
|
3637
3637
|
*/
|
|
3638
3638
|
function addItem(event) {
|
|
3639
3639
|
event.stopPropagation();
|
|
@@ -3825,20 +3825,20 @@ function Select(props) {
|
|
|
3825
3825
|
});
|
|
3826
3826
|
}
|
|
3827
3827
|
|
|
3828
|
-
/**
|
|
3829
|
-
* @param {object} props
|
|
3830
|
-
* @param {object} props.element
|
|
3831
|
-
* @param {string} props.id
|
|
3832
|
-
* @param {string} [props.description]
|
|
3833
|
-
* @param {string} props.label
|
|
3834
|
-
* @param {Function} props.getValue
|
|
3835
|
-
* @param {Function} props.setValue
|
|
3836
|
-
* @param {Function} props.onFocus
|
|
3837
|
-
* @param {Function} props.onBlur
|
|
3838
|
-
* @param {Function} props.getOptions
|
|
3839
|
-
* @param {boolean} [props.disabled]
|
|
3840
|
-
* @param {Function} [props.validate]
|
|
3841
|
-
* @param {string|import('preact').Component} props.tooltip
|
|
3828
|
+
/**
|
|
3829
|
+
* @param {object} props
|
|
3830
|
+
* @param {object} props.element
|
|
3831
|
+
* @param {string} props.id
|
|
3832
|
+
* @param {string} [props.description]
|
|
3833
|
+
* @param {string} props.label
|
|
3834
|
+
* @param {Function} props.getValue
|
|
3835
|
+
* @param {Function} props.setValue
|
|
3836
|
+
* @param {Function} props.onFocus
|
|
3837
|
+
* @param {Function} props.onBlur
|
|
3838
|
+
* @param {Function} props.getOptions
|
|
3839
|
+
* @param {boolean} [props.disabled]
|
|
3840
|
+
* @param {Function} [props.validate]
|
|
3841
|
+
* @param {string|import('preact').Component} props.tooltip
|
|
3842
3842
|
*/
|
|
3843
3843
|
function SelectEntry(props) {
|
|
3844
3844
|
const {
|
|
@@ -4185,20 +4185,20 @@ function Textfield(props) {
|
|
|
4185
4185
|
});
|
|
4186
4186
|
}
|
|
4187
4187
|
|
|
4188
|
-
/**
|
|
4189
|
-
* @param {Object} props
|
|
4190
|
-
* @param {Object} props.element
|
|
4191
|
-
* @param {String} props.id
|
|
4192
|
-
* @param {String} props.description
|
|
4193
|
-
* @param {Boolean} props.debounce
|
|
4194
|
-
* @param {Boolean} props.disabled
|
|
4195
|
-
* @param {String} props.label
|
|
4196
|
-
* @param {Function} props.getValue
|
|
4197
|
-
* @param {Function} props.setValue
|
|
4198
|
-
* @param {Function} props.onFocus
|
|
4199
|
-
* @param {Function} props.onBlur
|
|
4200
|
-
* @param {string|import('preact').Component} props.tooltip
|
|
4201
|
-
* @param {Function} props.validate
|
|
4188
|
+
/**
|
|
4189
|
+
* @param {Object} props
|
|
4190
|
+
* @param {Object} props.element
|
|
4191
|
+
* @param {String} props.id
|
|
4192
|
+
* @param {String} props.description
|
|
4193
|
+
* @param {Boolean} props.debounce
|
|
4194
|
+
* @param {Boolean} props.disabled
|
|
4195
|
+
* @param {String} props.label
|
|
4196
|
+
* @param {Function} props.getValue
|
|
4197
|
+
* @param {Function} props.setValue
|
|
4198
|
+
* @param {Function} props.onFocus
|
|
4199
|
+
* @param {Function} props.onBlur
|
|
4200
|
+
* @param {string|import('preact').Component} props.tooltip
|
|
4201
|
+
* @param {Function} props.validate
|
|
4202
4202
|
*/
|
|
4203
4203
|
function TextfieldEntry(props) {
|
|
4204
4204
|
const {
|
|
@@ -4291,20 +4291,20 @@ class FeelPopupModule {
|
|
|
4291
4291
|
this._eventBus = eventBus;
|
|
4292
4292
|
}
|
|
4293
4293
|
|
|
4294
|
-
/**
|
|
4295
|
-
* Check if the FEEL popup is open.
|
|
4296
|
-
* @return {Boolean}
|
|
4294
|
+
/**
|
|
4295
|
+
* Check if the FEEL popup is open.
|
|
4296
|
+
* @return {Boolean}
|
|
4297
4297
|
*/
|
|
4298
4298
|
isOpen() {
|
|
4299
4299
|
return this._eventBus.fire('feelPopup._isOpen');
|
|
4300
4300
|
}
|
|
4301
4301
|
|
|
4302
|
-
/**
|
|
4303
|
-
* Open the FEEL popup.
|
|
4304
|
-
*
|
|
4305
|
-
* @param {String} entryId
|
|
4306
|
-
* @param {Object} popupConfig
|
|
4307
|
-
* @param {HTMLElement} sourceElement
|
|
4302
|
+
/**
|
|
4303
|
+
* Open the FEEL popup.
|
|
4304
|
+
*
|
|
4305
|
+
* @param {String} entryId
|
|
4306
|
+
* @param {Object} popupConfig
|
|
4307
|
+
* @param {HTMLElement} sourceElement
|
|
4308
4308
|
*/
|
|
4309
4309
|
open(entryId, popupConfig, sourceElement) {
|
|
4310
4310
|
return this._eventBus.fire('feelPopup._open', {
|
|
@@ -4314,8 +4314,8 @@ class FeelPopupModule {
|
|
|
4314
4314
|
});
|
|
4315
4315
|
}
|
|
4316
4316
|
|
|
4317
|
-
/**
|
|
4318
|
-
* Close the FEEL popup.
|
|
4317
|
+
/**
|
|
4318
|
+
* Close the FEEL popup.
|
|
4319
4319
|
*/
|
|
4320
4320
|
close() {
|
|
4321
4321
|
return this._eventBus.fire('feelPopup._close');
|