@bpmn-io/form-js-editor 0.10.0 → 0.10.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.
Files changed (95) hide show
  1. package/LICENSE +22 -22
  2. package/README.md +119 -119
  3. package/dist/assets/form-js-editor.css +295 -287
  4. package/dist/index.cjs +202 -202
  5. package/dist/index.cjs.map +1 -1
  6. package/dist/index.es.js +202 -202
  7. package/dist/index.es.js.map +1 -1
  8. package/dist/types/FormEditor.d.ts +155 -155
  9. package/dist/types/core/Debounce.d.ts +10 -10
  10. package/dist/types/core/EventBus.d.ts +1 -1
  11. package/dist/types/core/FieldFactory.d.ts +18 -18
  12. package/dist/types/core/FormFieldRegistry.d.ts +19 -19
  13. package/dist/types/core/index.d.ts +17 -17
  14. package/dist/types/features/editor-actions/FormEditorActions.d.ts +8 -8
  15. package/dist/types/features/editor-actions/index.d.ts +6 -6
  16. package/dist/types/features/keyboard/FormEditorKeyboardBindings.d.ts +8 -8
  17. package/dist/types/features/keyboard/index.d.ts +7 -7
  18. package/dist/types/features/modeling/Modeling.d.ts +34 -34
  19. package/dist/types/features/modeling/behavior/IdBehavior.d.ts +7 -7
  20. package/dist/types/features/modeling/behavior/KeyBehavior.d.ts +7 -7
  21. package/dist/types/features/modeling/behavior/index.d.ts +8 -8
  22. package/dist/types/features/modeling/cmd/AddFormFieldHandler.d.ts +16 -16
  23. package/dist/types/features/modeling/cmd/EditFormFieldHandler.d.ts +16 -16
  24. package/dist/types/features/modeling/cmd/MoveFormFieldHandler.d.ts +17 -17
  25. package/dist/types/features/modeling/cmd/RemoveFormFieldHandler.d.ts +16 -16
  26. package/dist/types/features/modeling/cmd/UpdateIdClaimHandler.d.ts +14 -14
  27. package/dist/types/features/modeling/cmd/UpdateKeyClaimHandler.d.ts +14 -14
  28. package/dist/types/features/modeling/cmd/Util.d.ts +4 -4
  29. package/dist/types/features/modeling/index.d.ts +7 -7
  30. package/dist/types/features/palette/PaletteRenderer.d.ts +33 -33
  31. package/dist/types/features/palette/components/Palette.d.ts +1 -1
  32. package/dist/types/features/palette/index.d.ts +5 -5
  33. package/dist/types/features/properties-panel/PropertiesPanel.d.ts +1 -1
  34. package/dist/types/features/properties-panel/PropertiesPanelHeaderProvider.d.ts +5 -5
  35. package/dist/types/features/properties-panel/PropertiesPanelPlaceholderProvider.d.ts +8 -8
  36. package/dist/types/features/properties-panel/PropertiesPanelRenderer.d.ts +37 -37
  37. package/dist/types/features/properties-panel/Util.d.ts +9 -9
  38. package/dist/types/features/properties-panel/context/FormPropertiesPanelContext.d.ts +11 -11
  39. package/dist/types/features/properties-panel/context/index.d.ts +1 -1
  40. package/dist/types/features/properties-panel/entries/ActionEntry.d.ts +9 -9
  41. package/dist/types/features/properties-panel/entries/AdornerEntry.d.ts +11 -11
  42. package/dist/types/features/properties-panel/entries/AltTextEntry.d.ts +9 -9
  43. package/dist/types/features/properties-panel/entries/ColumnsEntry.d.ts +9 -9
  44. package/dist/types/features/properties-panel/entries/ConditionEntry.d.ts +9 -9
  45. package/dist/types/features/properties-panel/entries/CustomValueEntry.d.ts +11 -11
  46. package/dist/types/features/properties-panel/entries/DateTimeConstraintsEntry.d.ts +9 -9
  47. package/dist/types/features/properties-panel/entries/DateTimeEntry.d.ts +9 -9
  48. package/dist/types/features/properties-panel/entries/DateTimeSerializationEntry.d.ts +9 -9
  49. package/dist/types/features/properties-panel/entries/DefaultValueEntry.d.ts +1 -1
  50. package/dist/types/features/properties-panel/entries/DescriptionEntry.d.ts +9 -9
  51. package/dist/types/features/properties-panel/entries/DisabledEntry.d.ts +9 -9
  52. package/dist/types/features/properties-panel/entries/IdEntry.d.ts +9 -9
  53. package/dist/types/features/properties-panel/entries/ImageSourceEntry.d.ts +9 -9
  54. package/dist/types/features/properties-panel/entries/InputKeyValuesSourceEntry.d.ts +11 -11
  55. package/dist/types/features/properties-panel/entries/KeyEntry.d.ts +9 -9
  56. package/dist/types/features/properties-panel/entries/LabelEntry.d.ts +9 -9
  57. package/dist/types/features/properties-panel/entries/NumberEntries.d.ts +9 -9
  58. package/dist/types/features/properties-panel/entries/NumberSerializationEntry.d.ts +9 -9
  59. package/dist/types/features/properties-panel/entries/StaticValuesSourceEntry.d.ts +5 -5
  60. package/dist/types/features/properties-panel/entries/TextEntry.d.ts +9 -9
  61. package/dist/types/features/properties-panel/entries/ValueEntry.d.ts +11 -11
  62. package/dist/types/features/properties-panel/entries/ValuesSourceSelectEntry.d.ts +9 -9
  63. package/dist/types/features/properties-panel/entries/factories/index.d.ts +1 -1
  64. package/dist/types/features/properties-panel/entries/factories/simpleStringEntryFactory.d.ts +9 -9
  65. package/dist/types/features/properties-panel/entries/index.d.ts +23 -23
  66. package/dist/types/features/properties-panel/groups/AppearanceGroup.d.ts +13 -13
  67. package/dist/types/features/properties-panel/groups/ConditionGroup.d.ts +11 -11
  68. package/dist/types/features/properties-panel/groups/ConstraintsGroup.d.ts +11 -11
  69. package/dist/types/features/properties-panel/groups/CustomValuesGroup.d.ts +31 -31
  70. package/dist/types/features/properties-panel/groups/GeneralGroup.d.ts +5 -5
  71. package/dist/types/features/properties-panel/groups/SerializationGroup.d.ts +11 -11
  72. package/dist/types/features/properties-panel/groups/ValidationGroup.d.ts +14 -14
  73. package/dist/types/features/properties-panel/groups/ValuesGroups.d.ts +1 -1
  74. package/dist/types/features/properties-panel/groups/index.d.ts +8 -8
  75. package/dist/types/features/properties-panel/hooks/index.d.ts +2 -2
  76. package/dist/types/features/properties-panel/hooks/usePropertiesPanelService.d.ts +1 -1
  77. package/dist/types/features/properties-panel/hooks/useVariables.d.ts +6 -6
  78. package/dist/types/features/properties-panel/icons/index.d.ts +1 -1
  79. package/dist/types/features/properties-panel/index.d.ts +6 -6
  80. package/dist/types/features/selection/Selection.d.ts +14 -14
  81. package/dist/types/features/selection/SelectionBehavior.d.ts +7 -7
  82. package/dist/types/features/selection/index.d.ts +8 -8
  83. package/dist/types/import/Importer.d.ts +51 -51
  84. package/dist/types/import/index.d.ts +5 -5
  85. package/dist/types/index.d.ts +15 -15
  86. package/dist/types/render/Renderer.d.ts +26 -26
  87. package/dist/types/render/components/FormEditor.d.ts +1 -1
  88. package/dist/types/render/components/icons/index.d.ts +1 -1
  89. package/dist/types/render/context/DragAndDropContext.d.ts +4 -4
  90. package/dist/types/render/context/FormEditorContext.d.ts +11 -11
  91. package/dist/types/render/context/index.d.ts +2 -2
  92. package/dist/types/render/hooks/useService.d.ts +1 -1
  93. package/dist/types/render/index.d.ts +8 -8
  94. package/dist/types/src/types.d.ts +28 -28
  95. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../node_modules/diagram-js/lib/core/EventBus.js","../src/core/Debounce.js","../src/core/FieldFactory.js","../src/core/FormFieldRegistry.js","../src/import/Importer.js","../src/import/index.js","../src/render/context/DragAndDropContext.js","../src/render/context/FormEditorContext.js","../src/render/hooks/useService.js","../src/features/properties-panel/icons/pp-list-delete.svg","../src/render/components/FormEditor.js","../src/render/Renderer.js","../src/render/index.js","../src/core/index.js","../../../node_modules/diagram-js/lib/features/editor-actions/EditorActions.js","../../../node_modules/diagram-js/lib/features/editor-actions/index.js","../src/features/editor-actions/FormEditorActions.js","../src/features/editor-actions/index.js","../../../node_modules/diagram-js/lib/features/keyboard/KeyboardUtil.js","../../../node_modules/diagram-js/lib/features/keyboard/Keyboard.js","../../../node_modules/diagram-js/lib/features/keyboard/KeyboardBindings.js","../../../node_modules/diagram-js/lib/features/keyboard/index.js","../src/features/keyboard/FormEditorKeyboardBindings.js","../src/features/keyboard/index.js","../src/features/modeling/cmd/Util.js","../src/features/modeling/cmd/AddFormFieldHandler.js","../src/features/modeling/cmd/EditFormFieldHandler.js","../src/features/modeling/cmd/MoveFormFieldHandler.js","../src/features/modeling/cmd/RemoveFormFieldHandler.js","../src/features/modeling/cmd/UpdateIdClaimHandler.js","../src/features/modeling/cmd/UpdateKeyClaimHandler.js","../src/features/modeling/Modeling.js","../../../node_modules/diagram-js/lib/command/CommandInterceptor.js","../src/features/modeling/behavior/IdBehavior.js","../src/features/modeling/behavior/KeyBehavior.js","../src/features/modeling/behavior/index.js","../../../node_modules/diagram-js/lib/command/CommandStack.js","../../../node_modules/diagram-js/lib/command/index.js","../src/features/modeling/index.js","../src/features/selection/Selection.js","../src/features/selection/SelectionBehavior.js","../src/features/selection/index.js","../src/features/palette/components/Palette.js","../src/features/palette/PaletteRenderer.js","../src/features/palette/index.js","../../../node_modules/@bpmn-io/properties-panel/dist/index.esm.js","../src/features/properties-panel/context/FormPropertiesPanelContext.js","../src/features/properties-panel/Util.js","../src/features/properties-panel/PropertiesPanelHeaderProvider.js","../src/features/properties-panel/PropertiesPanelPlaceholderProvider.js","../src/features/properties-panel/entries/ActionEntry.js","../src/features/properties-panel/hooks/usePropertiesPanelService.js","../src/features/properties-panel/hooks/useVariables.js","../src/features/properties-panel/entries/AltTextEntry.js","../src/features/properties-panel/entries/ColumnsEntry.js","../src/features/properties-panel/entries/DescriptionEntry.js","../src/features/properties-panel/entries/DefaultValueEntry.js","../src/features/properties-panel/entries/DisabledEntry.js","../src/features/properties-panel/entries/IdEntry.js","../src/features/properties-panel/entries/KeyEntry.js","../src/features/properties-panel/entries/factories/simpleStringEntryFactory.js","../src/features/properties-panel/entries/LabelEntry.js","../src/features/properties-panel/entries/ImageSourceEntry.js","../src/features/properties-panel/entries/TextEntry.js","../src/features/properties-panel/entries/NumberEntries.js","../src/features/properties-panel/entries/NumberSerializationEntry.js","../src/features/properties-panel/entries/DateTimeEntry.js","../src/features/properties-panel/entries/DateTimeConstraintsEntry.js","../src/features/properties-panel/entries/DateTimeSerializationEntry.js","../src/features/properties-panel/entries/ValueEntry.js","../src/features/properties-panel/entries/CustomValueEntry.js","../src/features/properties-panel/entries/ValuesSourceSelectEntry.js","../src/features/properties-panel/entries/InputKeyValuesSourceEntry.js","../src/features/properties-panel/entries/StaticValuesSourceEntry.js","../src/features/properties-panel/entries/AdornerEntry.js","../src/features/properties-panel/entries/ConditionEntry.js","../src/features/properties-panel/groups/GeneralGroup.js","../src/features/properties-panel/groups/SerializationGroup.js","../src/features/properties-panel/groups/ConstraintsGroup.js","../src/features/properties-panel/groups/ValidationGroup.js","../src/features/properties-panel/groups/ValuesGroups.js","../src/features/properties-panel/groups/CustomValuesGroup.js","../src/features/properties-panel/groups/AppearanceGroup.js","../src/features/properties-panel/groups/ConditionGroup.js","../src/features/properties-panel/PropertiesPanel.js","../src/features/properties-panel/PropertiesPanelRenderer.js","../src/features/properties-panel/index.js","../src/FormEditor.js","../src/index.js"],"sourcesContent":["import {\n isFunction,\n isArray,\n isNumber,\n bind,\n assign\n} from 'min-dash';\n\nvar FN_REF = '__fn';\n\nvar DEFAULT_PRIORITY = 1000;\n\nvar slice = Array.prototype.slice;\n\n/**\n * A general purpose event bus.\n *\n * This component is used to communicate across a diagram instance.\n * Other parts of a diagram can use it to listen to and broadcast events.\n *\n *\n * ## Registering for Events\n *\n * The event bus provides the {@link EventBus#on} and {@link EventBus#once}\n * methods to register for events. {@link EventBus#off} can be used to\n * remove event registrations. Listeners receive an instance of {@link Event}\n * as the first argument. It allows them to hook into the event execution.\n *\n * ```javascript\n *\n * // listen for event\n * eventBus.on('foo', function(event) {\n *\n * // access event type\n * event.type; // 'foo'\n *\n * // stop propagation to other listeners\n * event.stopPropagation();\n *\n * // prevent event default\n * event.preventDefault();\n * });\n *\n * // listen for event with custom payload\n * eventBus.on('bar', function(event, payload) {\n * console.log(payload);\n * });\n *\n * // listen for event returning value\n * eventBus.on('foobar', function(event) {\n *\n * // stop event propagation + prevent default\n * return false;\n *\n * // stop event propagation + return custom result\n * return {\n * complex: 'listening result'\n * };\n * });\n *\n *\n * // listen with custom priority (default=1000, higher is better)\n * eventBus.on('priorityfoo', 1500, function(event) {\n * console.log('invoked first!');\n * });\n *\n *\n * // listen for event and pass the context (`this`)\n * eventBus.on('foobar', function(event) {\n * this.foo();\n * }, this);\n * ```\n *\n *\n * ## Emitting Events\n *\n * Events can be emitted via the event bus using {@link EventBus#fire}.\n *\n * ```javascript\n *\n * // false indicates that the default action\n * // was prevented by listeners\n * if (eventBus.fire('foo') === false) {\n * console.log('default has been prevented!');\n * };\n *\n *\n * // custom args + return value listener\n * eventBus.on('sum', function(event, a, b) {\n * return a + b;\n * });\n *\n * // you can pass custom arguments + retrieve result values.\n * var sum = eventBus.fire('sum', 1, 2);\n * console.log(sum); // 3\n * ```\n */\nexport default function EventBus() {\n this._listeners = {};\n\n // cleanup on destroy on lowest priority to allow\n // message passing until the bitter end\n this.on('diagram.destroy', 1, this._destroy, this);\n}\n\n\n/**\n * Register an event listener for events with the given name.\n *\n * The callback will be invoked with `event, ...additionalArguments`\n * that have been passed to {@link EventBus#fire}.\n *\n * Returning false from a listener will prevent the events default action\n * (if any is specified). To stop an event from being processed further in\n * other listeners execute {@link Event#stopPropagation}.\n *\n * Returning anything but `undefined` from a listener will stop the listener propagation.\n *\n * @param {string|Array<string>} events\n * @param {number} [priority=1000] the priority in which this listener is called, larger is higher\n * @param {Function} callback\n * @param {Object} [that] Pass context (`this`) to the callback\n */\nEventBus.prototype.on = function(events, priority, callback, that) {\n\n events = isArray(events) ? events : [ events ];\n\n if (isFunction(priority)) {\n that = callback;\n callback = priority;\n priority = DEFAULT_PRIORITY;\n }\n\n if (!isNumber(priority)) {\n throw new Error('priority must be a number');\n }\n\n var actualCallback = callback;\n\n if (that) {\n actualCallback = bind(callback, that);\n\n // make sure we remember and are able to remove\n // bound callbacks via {@link #off} using the original\n // callback\n actualCallback[FN_REF] = callback[FN_REF] || callback;\n }\n\n var self = this;\n\n events.forEach(function(e) {\n self._addListener(e, {\n priority: priority,\n callback: actualCallback,\n next: null\n });\n });\n};\n\n\n/**\n * Register an event listener that is executed only once.\n *\n * @param {string} event the event name to register for\n * @param {number} [priority=1000] the priority in which this listener is called, larger is higher\n * @param {Function} callback the callback to execute\n * @param {Object} [that] Pass context (`this`) to the callback\n */\nEventBus.prototype.once = function(event, priority, callback, that) {\n var self = this;\n\n if (isFunction(priority)) {\n that = callback;\n callback = priority;\n priority = DEFAULT_PRIORITY;\n }\n\n if (!isNumber(priority)) {\n throw new Error('priority must be a number');\n }\n\n function wrappedCallback() {\n wrappedCallback.__isTomb = true;\n\n var result = callback.apply(that, arguments);\n\n self.off(event, wrappedCallback);\n\n return result;\n }\n\n // make sure we remember and are able to remove\n // bound callbacks via {@link #off} using the original\n // callback\n wrappedCallback[FN_REF] = callback;\n\n this.on(event, priority, wrappedCallback);\n};\n\n\n/**\n * Removes event listeners by event and callback.\n *\n * If no callback is given, all listeners for a given event name are being removed.\n *\n * @param {string|Array<string>} events\n * @param {Function} [callback]\n */\nEventBus.prototype.off = function(events, callback) {\n\n events = isArray(events) ? events : [ events ];\n\n var self = this;\n\n events.forEach(function(event) {\n self._removeListener(event, callback);\n });\n\n};\n\n\n/**\n * Create an EventBus event.\n *\n * @param {Object} data\n *\n * @return {Object} event, recognized by the eventBus\n */\nEventBus.prototype.createEvent = function(data) {\n var event = new InternalEvent();\n\n event.init(data);\n\n return event;\n};\n\n\n/**\n * Fires a named event.\n *\n * @example\n *\n * // fire event by name\n * events.fire('foo');\n *\n * // fire event object with nested type\n * var event = { type: 'foo' };\n * events.fire(event);\n *\n * // fire event with explicit type\n * var event = { x: 10, y: 20 };\n * events.fire('element.moved', event);\n *\n * // pass additional arguments to the event\n * events.on('foo', function(event, bar) {\n * alert(bar);\n * });\n *\n * events.fire({ type: 'foo' }, 'I am bar!');\n *\n * @param {string} [name] the optional event name\n * @param {Object} [event] the event object\n * @param {...Object} additional arguments to be passed to the callback functions\n *\n * @return {boolean} the events return value, if specified or false if the\n * default action was prevented by listeners\n */\nEventBus.prototype.fire = function(type, data) {\n var event,\n firstListener,\n returnValue,\n args;\n\n args = slice.call(arguments);\n\n if (typeof type === 'object') {\n data = type;\n type = data.type;\n }\n\n if (!type) {\n throw new Error('no event type specified');\n }\n\n firstListener = this._listeners[type];\n\n if (!firstListener) {\n return;\n }\n\n // we make sure we fire instances of our home made\n // events here. We wrap them only once, though\n if (data instanceof InternalEvent) {\n\n // we are fine, we alread have an event\n event = data;\n } else {\n event = this.createEvent(data);\n }\n\n // ensure we pass the event as the first parameter\n args[0] = event;\n\n // original event type (in case we delegate)\n var originalType = event.type;\n\n // update event type before delegation\n if (type !== originalType) {\n event.type = type;\n }\n\n try {\n returnValue = this._invokeListeners(event, args, firstListener);\n } finally {\n\n // reset event type after delegation\n if (type !== originalType) {\n event.type = originalType;\n }\n }\n\n // set the return value to false if the event default\n // got prevented and no other return value exists\n if (returnValue === undefined && event.defaultPrevented) {\n returnValue = false;\n }\n\n return returnValue;\n};\n\n\nEventBus.prototype.handleError = function(error) {\n return this.fire('error', { error: error }) === false;\n};\n\n\nEventBus.prototype._destroy = function() {\n this._listeners = {};\n};\n\nEventBus.prototype._invokeListeners = function(event, args, listener) {\n\n var returnValue;\n\n while (listener) {\n\n // handle stopped propagation\n if (event.cancelBubble) {\n break;\n }\n\n returnValue = this._invokeListener(event, args, listener);\n\n listener = listener.next;\n }\n\n return returnValue;\n};\n\nEventBus.prototype._invokeListener = function(event, args, listener) {\n\n var returnValue;\n\n if (listener.callback.__isTomb) {\n return returnValue;\n }\n\n try {\n\n // returning false prevents the default action\n returnValue = invokeFunction(listener.callback, args);\n\n // stop propagation on return value\n if (returnValue !== undefined) {\n event.returnValue = returnValue;\n event.stopPropagation();\n }\n\n // prevent default on return false\n if (returnValue === false) {\n event.preventDefault();\n }\n } catch (error) {\n if (!this.handleError(error)) {\n console.error('unhandled error in event listener', error);\n\n throw error;\n }\n }\n\n return returnValue;\n};\n\n/*\n * Add new listener with a certain priority to the list\n * of listeners (for the given event).\n *\n * The semantics of listener registration / listener execution are\n * first register, first serve: New listeners will always be inserted\n * after existing listeners with the same priority.\n *\n * Example: Inserting two listeners with priority 1000 and 1300\n *\n * * before: [ 1500, 1500, 1000, 1000 ]\n * * after: [ 1500, 1500, (new=1300), 1000, 1000, (new=1000) ]\n *\n * @param {string} event\n * @param {Object} listener { priority, callback }\n */\nEventBus.prototype._addListener = function(event, newListener) {\n\n var listener = this._getListeners(event),\n previousListener;\n\n // no prior listeners\n if (!listener) {\n this._setListeners(event, newListener);\n\n return;\n }\n\n // ensure we order listeners by priority from\n // 0 (high) to n > 0 (low)\n while (listener) {\n\n if (listener.priority < newListener.priority) {\n\n newListener.next = listener;\n\n if (previousListener) {\n previousListener.next = newListener;\n } else {\n this._setListeners(event, newListener);\n }\n\n return;\n }\n\n previousListener = listener;\n listener = listener.next;\n }\n\n // add new listener to back\n previousListener.next = newListener;\n};\n\n\nEventBus.prototype._getListeners = function(name) {\n return this._listeners[name];\n};\n\nEventBus.prototype._setListeners = function(name, listener) {\n this._listeners[name] = listener;\n};\n\nEventBus.prototype._removeListener = function(event, callback) {\n\n var listener = this._getListeners(event),\n nextListener,\n previousListener,\n listenerCallback;\n\n if (!callback) {\n\n // clear listeners\n this._setListeners(event, null);\n\n return;\n }\n\n while (listener) {\n\n nextListener = listener.next;\n\n listenerCallback = listener.callback;\n\n if (listenerCallback === callback || listenerCallback[FN_REF] === callback) {\n if (previousListener) {\n previousListener.next = nextListener;\n } else {\n\n // new first listener\n this._setListeners(event, nextListener);\n }\n }\n\n previousListener = listener;\n listener = nextListener;\n }\n};\n\n/**\n * A event that is emitted via the event bus.\n */\nfunction InternalEvent() { }\n\nInternalEvent.prototype.stopPropagation = function() {\n this.cancelBubble = true;\n};\n\nInternalEvent.prototype.preventDefault = function() {\n this.defaultPrevented = true;\n};\n\nInternalEvent.prototype.init = function(data) {\n assign(this, data || {});\n};\n\n\n/**\n * Invoke function. Be fast...\n *\n * @param {Function} fn\n * @param {Array<Object>} args\n *\n * @return {Any}\n */\nfunction invokeFunction(fn, args) {\n return fn.apply(null, args);\n}\n","import { debounce } from 'min-dash';\n\n/**\n * A factory to create a configurable debouncer.\n *\n * @param {number|boolean} [config=true]\n */\nexport default function DebounceFactory(config = true) {\n\n const timeout = typeof config === 'number' ? config : config ? 300 : 0;\n\n if (timeout) {\n return fn => debounce(fn, timeout);\n } else {\n return fn => fn;\n }\n}\n\nDebounceFactory.$inject = [ 'config.debounce' ];","export default class FieldFactory {\n\n /**\n * @constructor\n *\n * @param { import('./FormFieldRegistry').default } formFieldRegistry\n * @param { import('@bpmn-io/form-js-viewer').FormFields } formFields\n */\n constructor(formFieldRegistry, formFields) {\n this._formFieldRegistry = formFieldRegistry;\n this._formFields = formFields;\n }\n\n create(attrs, applyDefaults = true) {\n\n const {\n id,\n key,\n type\n } = attrs;\n\n const fieldDefinition = this._formFields.get(type);\n\n if (!fieldDefinition) {\n throw new Error(`form field of type <${ type }> not supported`);\n }\n\n if (id && this._formFieldRegistry._ids.assigned(id)) {\n throw new Error(`ID <${ id }> already assigned`);\n }\n\n if (key && this._formFieldRegistry._keys.assigned(key)) {\n throw new Error(`key <${ key }> already assigned`);\n }\n\n const labelAttrs = applyDefaults && fieldDefinition.label ? {\n label: fieldDefinition.label\n } : {};\n\n const field = fieldDefinition.create({\n ...labelAttrs,\n ...attrs\n });\n\n this._ensureId(field);\n\n if (fieldDefinition.keyed) {\n this._ensureKey(field, applyDefaults);\n }\n\n return field;\n }\n\n _ensureId(field) {\n\n if (field.id) {\n this._formFieldRegistry._ids.claim(field.id, field);\n\n return;\n }\n\n let prefix = 'Field';\n\n if (field.type === 'default') {\n prefix = 'Form';\n }\n\n field.id = this._formFieldRegistry._ids.nextPrefixed(`${prefix}_`, field);\n }\n\n _ensureKey(field, applyDefaults) {\n\n if (field.key) {\n this._formFieldRegistry._keys.claim(field.key, field);\n\n return;\n }\n\n if (applyDefaults) {\n let prefix = 'field';\n\n field.key = this._formFieldRegistry._keys.nextPrefixed(`${prefix}_`, field);\n }\n }\n}\n\n\nFieldFactory.$inject = [\n 'formFieldRegistry',\n 'formFields'\n];","import {\n FormFieldRegistry as BaseFieldRegistry\n} from '@bpmn-io/form-js-viewer';\n\n\nexport default class FormFieldRegistry extends BaseFieldRegistry {\n\n /**\n * Updates a form fields id.\n *\n * @param {Object} formField\n * @param {string} newId\n */\n updateId(formField, newId) {\n\n this._validateId(newId);\n\n this._eventBus.fire('formField.updateId', {\n formField,\n newId: newId\n });\n\n this.remove(formField);\n\n formField.id = newId;\n\n this.add(formField);\n\n // TODO(nikku): make this a proper object graph so we\n // do not have to deal with IDs this way...\n if ('components' in formField) {\n for (const component of formField.components) {\n component._parent = newId;\n }\n }\n\n }\n\n\n /**\n * Validate the suitability of the given id and signals a problem\n * with an exception.\n *\n * @param {string} id\n *\n * @throws {Error} if id is empty or already assigned\n */\n _validateId(id) {\n if (!id) {\n throw new Error('formField must have an id');\n }\n\n if (this.get(id)) {\n throw new Error('formField with id ' + id + ' already added');\n }\n }\n\n}","import { clone } from '@bpmn-io/form-js-viewer';\n\n\nexport default class Importer {\n\n /**\n * @constructor\n * @param { import('../core/FormFieldRegistry').default } formFieldRegistry\n * @param { import('../core/FieldFactory').default } fieldFactory\n */\n constructor(formFieldRegistry, fieldFactory) {\n this._formFieldRegistry = formFieldRegistry;\n this._fieldFactory = fieldFactory;\n }\n\n /**\n * Import schema creating fields, attaching additional\n * information to each field and adding fields to the\n * field registry.\n *\n * Additional information attached:\n *\n * * `id` (unless present)\n * * `_parent`\n * * `_path`\n *\n * @param {any} schema\n *\n * @typedef {{ warnings: Error[], schema: any }} ImportResult\n * @returns {ImportResult}\n */\n importSchema(schema) {\n\n // TODO: Add warnings\n const warnings = [];\n\n try {\n const importedSchema = this.importFormField(clone(schema));\n\n return {\n schema: importedSchema,\n warnings\n };\n } catch (err) {\n err.warnings = warnings;\n\n throw err;\n }\n }\n\n /**\n * @param {{[x: string]: any}} fieldAttrs\n * @param {String} [parentId]\n * @param {number} [index]\n *\n * @return {any} field\n */\n importFormField(fieldAttrs, parentId, index) {\n const {\n components,\n id,\n key\n } = fieldAttrs;\n\n let parent, path;\n\n if (parentId) {\n parent = this._formFieldRegistry.get(parentId);\n }\n\n // validate <id> uniqueness\n if (id && this._formFieldRegistry._ids.assigned(id)) {\n throw new Error(`form field with id <${ id }> already exists`);\n }\n\n // validate <key> uniqueness\n if (key && this._formFieldRegistry._keys.assigned(key)) {\n throw new Error(`form field with key <${ key }> already exists`);\n }\n\n // set form field path\n path = parent ? [ ...parent._path, 'components', index ] : [];\n\n const field = this._fieldFactory.create({\n ...fieldAttrs,\n _path: path,\n _parent: parent && parent.id\n }, false);\n\n this._formFieldRegistry.add(field);\n\n if (components) {\n field.components = this.importFormFields(components, field.id);\n }\n\n return field;\n }\n\n /**\n * @param {Array<any>} components\n * @param {string} parentId\n *\n * @return {Array<any>} imported components\n */\n importFormFields(components, parentId) {\n return components.map((component, index) => {\n return this.importFormField(component, parentId, index);\n });\n }\n\n}\n\nImporter.$inject = [ 'formFieldRegistry', 'fieldFactory' ];","import Importer from './Importer';\n\nexport default {\n importer: [ 'type', Importer ]\n};","import { createContext } from 'preact';\n\nconst DragAndDropContext = createContext({\n drake: null\n});\n\nexport default DragAndDropContext;","import { createContext } from 'preact';\n\n/**\n * @param {string} type\n * @param {boolean} [strict]\n *\n * @returns {any}\n */\nfunction getService(type, strict) {}\n\nconst FormEditorContext = createContext({\n getService\n});\n\nexport default FormEditorContext;","import {\n useContext\n} from 'preact/hooks';\n\nimport { FormEditorContext } from '../context';\n\n\nexport default function(type, strict) {\n const {\n getService\n } = useContext(FormEditorContext);\n\n return getService(type, strict);\n}","function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nimport React from \"react\";\nexport default (({\n styles = {},\n ...props\n}) => /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"11\",\n height: \"14\"\n}, props), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M10 4v8c0 1.1-.9 2-2 2H3c-1.1 0-2-.9-2-2V4h9zM8 6H3v4.8c0 .66.5 1.2 1.111 1.2H6.89C7.5 12 8 11.46 8 10.8V6zm3-5H8.5l-1-1h-4l-1 1H0v1.5h11V1z\"\n})));","import { render } from 'preact';\nimport {\n useCallback,\n useContext,\n useEffect,\n useRef,\n useState\n} from 'preact/hooks';\n\nimport {\n FormComponent,\n FormContext,\n FormRenderContext\n} from '@bpmn-io/form-js-viewer';\n\nimport useService from '../hooks/useService';\n\nimport { DragAndDropContext } from '../context';\n\nimport dragula from 'dragula';\n\nimport { ListDeleteIcon } from '../../features/properties-panel/icons';\n\nimport { iconsByType } from './icons';\n\nfunction ContextPad(props) {\n if (!props.children) {\n return null;\n }\n\n return (\n <div class=\"fjs-context-pad\">\n {\n props.children\n }\n </div>\n );\n}\n\nfunction Empty(props) {\n return null;\n}\n\nfunction Element(props) {\n const eventBus = useService('eventBus'),\n formEditor = useService('formEditor'),\n formFieldRegistry = useService('formFieldRegistry'),\n modeling = useService('modeling'),\n selection = useService('selection');\n\n const { field } = props;\n\n const {\n id,\n type\n } = field;\n\n const ref = useRef();\n\n function scrollIntoView({ selection }) {\n if (!selection || selection.id !== id || !ref.current) {\n return;\n }\n\n const elementBounds = ref.current.getBoundingClientRect(),\n containerBounds = formEditor._container.getBoundingClientRect();\n\n if (elementBounds.top < 0 || elementBounds.top > containerBounds.bottom) {\n ref.current.scrollIntoView();\n }\n }\n\n useEffect(() => {\n eventBus.on('selection.changed', scrollIntoView);\n\n return () => eventBus.off('selection.changed', scrollIntoView);\n }, [ id ]);\n\n function onClick(event) {\n event.stopPropagation();\n\n selection.toggle(field);\n }\n\n const classes = [ 'fjs-element' ];\n\n if (props.class) {\n classes.push(...props.class.split(' '));\n }\n\n if (selection.isSelected(field)) {\n classes.push('fjs-editor-selected');\n }\n\n const onRemove = (event) => {\n event.stopPropagation();\n\n const parentField = formFieldRegistry.get(field._parent);\n\n const index = getFormFieldIndex(parentField, field);\n\n modeling.removeFormField(field, parentField, index);\n };\n\n return (\n <div\n class={ classes.join(' ') }\n data-id={ id }\n data-field-type={ type }\n onClick={ onClick }\n ref={ ref }>\n <ContextPad>\n {\n selection.isSelected(field) && field.type !== 'default'\n ? <button class=\"fjs-context-pad-item\" onClick={ onRemove }><ListDeleteIcon /></button>\n : null\n }\n </ContextPad>\n { props.children }\n </div>\n );\n}\n\nfunction Children(props) {\n const { field } = props;\n\n const { id } = field;\n\n const classes = [ 'fjs-children', 'fjs-drag-container' ];\n\n if (props.class) {\n classes.push(...props.class.split(' '));\n }\n\n return (\n <div\n class={ classes.join(' ') }\n data-id={ id }>\n { props.children }\n </div>\n );\n}\n\nexport default function FormEditor(props) {\n const eventBus = useService('eventBus'),\n formEditor = useService('formEditor'),\n formFieldRegistry = useService('formFieldRegistry'),\n injector = useService('injector'),\n modeling = useService('modeling'),\n selection = useService('selection'),\n palette = useService('palette'),\n paletteConfig = useService('config.palette'),\n propertiesPanel = useService('propertiesPanel'),\n propertiesPanelConfig = useService('config.propertiesPanel');\n\n const { schema } = formEditor._getState();\n\n const paletteRef = useRef(null);\n const propertiesPanelRef = useRef(null);\n\n const [ , setSelection ] = useState(schema);\n\n useEffect(() => {\n function handleSelectionChanged(event) {\n setSelection(event.selection || schema);\n }\n\n eventBus.on('selection.changed', handleSelectionChanged);\n\n setSelection(selection.get() || schema);\n\n return () => {\n eventBus.off('selection.changed', handleSelectionChanged);\n };\n }, [ schema, selection ]);\n\n const [ drake, setDrake ] = useState(null);\n\n const dragAndDropContext = {\n drake\n };\n\n useEffect(() => {\n const createDragulaInstance = () => {\n const dragulaInstance = dragula({\n isContainer(el) {\n return el.classList.contains('fjs-drag-container');\n },\n copy(el) {\n return el.classList.contains('fjs-drag-copy');\n },\n accepts(el, target) {\n return !target.classList.contains('fjs-no-drop');\n },\n slideFactorX: 10,\n slideFactorY: 5\n });\n\n dragulaInstance.on('drop', (el, target, source, sibling) => {\n dragulaInstance.remove();\n\n if (!target) {\n return;\n }\n\n const targetFormField = formFieldRegistry.get(target.dataset.id);\n\n const siblingFormField = sibling && formFieldRegistry.get(sibling.dataset.id),\n targetIndex = siblingFormField ? getFormFieldIndex(targetFormField, siblingFormField) : targetFormField.components.length;\n\n if (source.classList.contains('fjs-palette-fields')) {\n const type = el.dataset.fieldType;\n\n modeling.addFormField({ type }, targetFormField, targetIndex);\n } else {\n const formField = formFieldRegistry.get(el.dataset.id),\n sourceFormField = formFieldRegistry.get(source.dataset.id),\n sourceIndex = getFormFieldIndex(sourceFormField, formField);\n\n modeling.moveFormField(formField, sourceFormField, targetFormField, sourceIndex, targetIndex);\n }\n });\n\n eventBus.fire('dragula.created');\n\n setDrake(dragulaInstance);\n\n return dragulaInstance;\n };\n\n let dragulaInstance = createDragulaInstance();\n\n const onDetach = () => {\n if (dragulaInstance) {\n dragulaInstance.destroy();\n\n eventBus.fire('dragula.destroyed');\n }\n };\n\n const onAttach = () => {\n onDetach();\n\n dragulaInstance = createDragulaInstance();\n };\n\n eventBus.on('attach', onAttach);\n eventBus.on('detach', onDetach);\n\n return () => {\n onDetach();\n\n eventBus.off('attach', onAttach);\n eventBus.off('detach', onDetach);\n };\n }, []);\n\n // fire event after render to notify interested parties\n useEffect(() => {\n eventBus.fire('formEditor.rendered');\n }, []);\n\n const formRenderContext = {\n Children,\n Element,\n Empty\n };\n\n const formContext = {\n getService(type, strict = true) {\n\n // TODO(philippfromme): clean up\n if (type === 'formFieldRegistry') {\n return new Map();\n } else if (type === 'form') {\n return {\n _getState() {\n return {\n data: {},\n errors: {},\n properties: {\n readOnly: true\n },\n schema\n };\n }\n };\n }\n\n return injector.get(type, strict);\n },\n formId: formEditor._id\n };\n\n const onSubmit = useCallback(() => {}, []);\n\n const onReset = useCallback(() => {}, []);\n\n // attach default palette\n const hasDefaultPalette = defaultPalette(paletteConfig);\n\n useEffect(() => {\n if (hasDefaultPalette) {\n palette.attachTo(paletteRef.current);\n }\n }, [ palette, paletteRef, hasDefaultPalette ]);\n\n // attach default properties panel\n const hasDefaultPropertiesPanel = defaultPropertiesPanel(propertiesPanelConfig);\n\n useEffect(() => {\n if (hasDefaultPropertiesPanel) {\n propertiesPanel.attachTo(propertiesPanelRef.current);\n }\n }, [ propertiesPanelRef, propertiesPanel, hasDefaultPropertiesPanel ]);\n\n return (\n <div class=\"fjs-form-editor\">\n\n <DragAndDropContext.Provider value={ dragAndDropContext }>\n { hasDefaultPalette && <div class=\"fjs-editor-palette-container\" ref={ paletteRef } /> }\n <div class=\"fjs-form-container\">\n\n <FormContext.Provider value={ formContext }>\n <FormRenderContext.Provider value={ formRenderContext }>\n <FormComponent onSubmit={ onSubmit } onReset={ onReset } />\n </FormRenderContext.Provider>\n </FormContext.Provider>\n\n </div>\n <CreatePreview />\n </DragAndDropContext.Provider>\n\n { hasDefaultPropertiesPanel && <div class=\"fjs-editor-properties-container\" ref={ propertiesPanelRef } /> }\n </div>\n );\n}\n\nfunction getFormFieldIndex(parent, formField) {\n let fieldFormIndex = parent.components.length;\n\n parent.components.forEach(({ id }, index) => {\n if (id === formField.id) {\n fieldFormIndex = index;\n }\n });\n\n return fieldFormIndex;\n}\n\nfunction CreatePreview(props) {\n\n const { drake } = useContext(DragAndDropContext);\n\n function handleCloned(clone, original, type) {\n\n const fieldType = clone.dataset.fieldType;\n\n const Icon = iconsByType[ fieldType ];\n\n if (fieldType) {\n clone.innerHTML = '';\n\n clone.class = 'gu-mirror';\n\n render(<Icon />, clone);\n }\n }\n\n useEffect(() => {\n if (!drake) {\n return;\n }\n\n drake.on('cloned', handleCloned);\n\n return () => drake.off('cloned', handleCloned);\n }, [ drake ]);\n\n return null;\n}\n\n\n// helper //////\n\nfunction defaultPalette(paletteConfig) {\n return !(paletteConfig && paletteConfig.parent);\n}\n\nfunction defaultPropertiesPanel(propertiesPanelConfig) {\n return !(propertiesPanelConfig && propertiesPanelConfig.parent);\n}","import { render } from 'preact';\nimport { useState } from 'preact/hooks';\n\nimport FormEditor from './components/FormEditor';\n\nimport { FormEditorContext } from './context';\n\n/**\n * @typedef { { container: Element, compact?: boolean } } RenderConfig\n * @typedef { import('didi').Injector } Injector\n * @typedef { import('../core/EventBus').default } EventBus\n * @typedef { import('../FormEditor').default } FormEditor\n */\n\n/**\n * @param {RenderConfig} renderConfig\n * @param {EventBus} eventBus\n * @param {FormEditor} formEditor\n * @param {Injector} injector\n */\nexport default class Renderer {\n constructor(renderConfig, eventBus, formEditor, injector) {\n\n const {\n container,\n compact = false\n } = renderConfig;\n\n const App = () => {\n const [ state, setState ] = useState(formEditor._getState());\n\n const formEditorContext = {\n getService(type, strict = true) {\n return injector.get(type, strict);\n }\n };\n\n formEditor.on('changed', (newState) => {\n setState(newState);\n });\n\n const { schema } = state;\n\n if (!schema) {\n return null;\n }\n\n return (\n <div class={ `fjs-container fjs-editor-container ${ compact ? 'fjs-editor-compact' : '' }` }>\n <FormEditorContext.Provider value={ formEditorContext }>\n <FormEditor />\n </FormEditorContext.Provider>\n </div>\n );\n };\n\n eventBus.on('form.init', () => {\n render(<App />, container);\n });\n\n eventBus.on('form.destroy', () => {\n render(null, container);\n });\n }\n}\n\nRenderer.$inject = [ 'config.renderer', 'eventBus', 'formEditor', 'injector' ];","import { FormFields } from '@bpmn-io/form-js-viewer';\n\nimport Renderer from './Renderer';\n\nexport default {\n __init__: [ 'formFields', 'renderer' ],\n formFields: [ 'type', FormFields ],\n renderer: [ 'type', Renderer ]\n};","import EventBus from './EventBus';\nimport DebounceFactory from './Debounce';\nimport FieldFactory from './FieldFactory';\nimport FormFieldRegistry from './FormFieldRegistry';\n\nimport importModule from '../import';\nimport renderModule from '../render';\n\nexport default {\n __depends__: [\n importModule,\n renderModule\n ],\n eventBus: [ 'type', EventBus ],\n formFieldRegistry: [ 'type', FormFieldRegistry ],\n fieldFactory: [ 'type', FieldFactory ],\n debounce: [ 'factory', DebounceFactory ]\n};","import {\n forEach,\n isArray\n} from 'min-dash';\n\nvar NOT_REGISTERED_ERROR = 'is not a registered action',\n IS_REGISTERED_ERROR = 'is already registered';\n\n\n/**\n * An interface that provides access to modeling actions by decoupling\n * the one who requests the action to be triggered and the trigger itself.\n *\n * It's possible to add new actions by registering them with ´registerAction´\n * and likewise unregister existing ones with ´unregisterAction´.\n *\n *\n * ## Life-Cycle and configuration\n *\n * The editor actions will wait for diagram initialization before\n * registering default actions _and_ firing an `editorActions.init` event.\n *\n * Interested parties may listen to the `editorActions.init` event with\n * low priority to check, which actions got registered. Other components\n * may use the event to register their own actions via `registerAction`.\n *\n * @param {EventBus} eventBus\n * @param {Injector} injector\n */\nexport default function EditorActions(eventBus, injector) {\n\n // initialize actions\n this._actions = {};\n\n var self = this;\n\n eventBus.on('diagram.init', function() {\n\n // all diagram modules got loaded; check which ones\n // are available and register the respective default actions\n self._registerDefaultActions(injector);\n\n // ask interested parties to register available editor\n // actions on diagram initialization\n eventBus.fire('editorActions.init', {\n editorActions: self\n });\n });\n\n}\n\nEditorActions.$inject = [\n 'eventBus',\n 'injector'\n];\n\n/**\n * Register default actions.\n *\n * @param {Injector} injector\n */\nEditorActions.prototype._registerDefaultActions = function(injector) {\n\n // (1) retrieve optional components to integrate with\n\n var commandStack = injector.get('commandStack', false);\n var modeling = injector.get('modeling', false);\n var selection = injector.get('selection', false);\n var zoomScroll = injector.get('zoomScroll', false);\n var copyPaste = injector.get('copyPaste', false);\n var canvas = injector.get('canvas', false);\n var rules = injector.get('rules', false);\n var keyboardMove = injector.get('keyboardMove', false);\n var keyboardMoveSelection = injector.get('keyboardMoveSelection', false);\n\n // (2) check components and register actions\n\n if (commandStack) {\n this.register('undo', function() {\n commandStack.undo();\n });\n\n this.register('redo', function() {\n commandStack.redo();\n });\n }\n\n if (copyPaste && selection) {\n this.register('copy', function() {\n var selectedElements = selection.get();\n\n if (selectedElements.length) {\n return copyPaste.copy(selectedElements);\n }\n });\n }\n\n if (copyPaste) {\n this.register('paste', function() {\n copyPaste.paste();\n });\n }\n\n if (zoomScroll) {\n this.register('stepZoom', function(opts) {\n zoomScroll.stepZoom(opts.value);\n });\n }\n\n if (canvas) {\n this.register('zoom', function(opts) {\n canvas.zoom(opts.value);\n });\n }\n\n if (modeling && selection && rules) {\n this.register('removeSelection', function() {\n\n var selectedElements = selection.get();\n\n if (!selectedElements.length) {\n return;\n }\n\n var allowed = rules.allowed('elements.delete', { elements: selectedElements }),\n removableElements;\n\n if (allowed === false) {\n return;\n }\n else if (isArray(allowed)) {\n removableElements = allowed;\n }\n else {\n removableElements = selectedElements;\n }\n\n if (removableElements.length) {\n modeling.removeElements(removableElements.slice());\n }\n });\n }\n\n if (keyboardMove) {\n this.register('moveCanvas', function(opts) {\n keyboardMove.moveCanvas(opts);\n });\n }\n\n if (keyboardMoveSelection) {\n this.register('moveSelection', function(opts) {\n keyboardMoveSelection.moveSelection(opts.direction, opts.accelerated);\n });\n }\n\n};\n\n\n/**\n * Triggers a registered action\n *\n * @param {string} action\n * @param {Object} opts\n *\n * @return {Unknown} Returns what the registered listener returns\n */\nEditorActions.prototype.trigger = function(action, opts) {\n if (!this._actions[action]) {\n throw error(action, NOT_REGISTERED_ERROR);\n }\n\n return this._actions[action](opts);\n};\n\n\n/**\n * Registers a collections of actions.\n * The key of the object will be the name of the action.\n *\n * @example\n * ´´´\n * var actions = {\n * spaceTool: function() {\n * spaceTool.activateSelection();\n * },\n * lassoTool: function() {\n * lassoTool.activateSelection();\n * }\n * ];\n *\n * editorActions.register(actions);\n *\n * editorActions.isRegistered('spaceTool'); // true\n * ´´´\n *\n * @param {Object} actions\n */\nEditorActions.prototype.register = function(actions, listener) {\n var self = this;\n\n if (typeof actions === 'string') {\n return this._registerAction(actions, listener);\n }\n\n forEach(actions, function(listener, action) {\n self._registerAction(action, listener);\n });\n};\n\n/**\n * Registers a listener to an action key\n *\n * @param {string} action\n * @param {Function} listener\n */\nEditorActions.prototype._registerAction = function(action, listener) {\n if (this.isRegistered(action)) {\n throw error(action, IS_REGISTERED_ERROR);\n }\n\n this._actions[action] = listener;\n};\n\n/**\n * Unregister an existing action\n *\n * @param {string} action\n */\nEditorActions.prototype.unregister = function(action) {\n if (!this.isRegistered(action)) {\n throw error(action, NOT_REGISTERED_ERROR);\n }\n\n this._actions[action] = undefined;\n};\n\n/**\n * Returns the number of actions that are currently registered\n *\n * @return {number}\n */\nEditorActions.prototype.getActions = function() {\n return Object.keys(this._actions);\n};\n\n/**\n * Checks wether the given action is registered\n *\n * @param {string} action\n *\n * @return {boolean}\n */\nEditorActions.prototype.isRegistered = function(action) {\n return !!this._actions[action];\n};\n\n\nfunction error(action, message) {\n return new Error(action + ' ' + message);\n}\n","import EditorActions from './EditorActions';\n\nexport default {\n __init__: [ 'editorActions' ],\n editorActions: [ 'type', EditorActions ]\n};\n","import EditorActions from 'diagram-js/lib/features/editor-actions/EditorActions';\n\n\nexport default class FormEditorActions extends EditorActions {\n constructor(eventBus, injector) {\n super(eventBus, injector);\n\n eventBus.on('form.init', () => {\n this._registerDefaultActions(injector);\n\n eventBus.fire('editorActions.init', {\n editorActions: this\n });\n });\n }\n\n _registerDefaultActions(injector) {\n const commandStack = injector.get('commandStack', false),\n formFieldRegistry = injector.get('formFieldRegistry', false),\n selection = injector.get('selection', false);\n\n if (commandStack) {\n\n // @ts-ignore\n this.register('undo', () => {\n commandStack.undo();\n });\n\n // @ts-ignore\n this.register('redo', () => {\n commandStack.redo();\n });\n }\n\n if (formFieldRegistry && selection) {\n\n // @ts-ignore\n this.register('selectFormField', (options = {}) => {\n const { id } = options;\n\n if (!id) {\n return;\n }\n\n const formField = formFieldRegistry.get(id);\n\n if (formField) {\n selection.set(formField);\n }\n });\n }\n }\n}\n\nFormEditorActions.$inject = [\n 'eventBus',\n 'injector'\n];","import EditorActionsModule from 'diagram-js/lib/features/editor-actions';\n\nimport FormEditorActions from './FormEditorActions';\n\nexport default {\n __depends__: [\n EditorActionsModule\n ],\n editorActions: [ 'type', FormEditorActions ]\n};\n","import { isArray } from 'min-dash';\r\n\r\nvar KEYS_COPY = [ 'c', 'C', 'KeyC' ];\r\nvar KEYS_PASTE = [ 'v', 'V', 'KeyV' ];\r\nvar KEYS_REDO = [ 'y', 'Y', 'KeyY' ];\r\nvar KEYS_UNDO = [ 'z', 'Z', 'KeyZ' ];\r\n\r\n/**\r\n * Returns true if event was triggered with any modifier\r\n * @param {KeyboardEvent} event\r\n */\r\nexport function hasModifier(event) {\r\n return (event.ctrlKey || event.metaKey || event.shiftKey || event.altKey);\r\n}\r\n\r\n/**\r\n * @param {KeyboardEvent} event\r\n */\r\nexport function isCmd(event) {\r\n\r\n // ensure we don't react to AltGr\r\n // (mapped to CTRL + ALT)\r\n if (event.altKey) {\r\n return false;\r\n }\r\n\r\n return event.ctrlKey || event.metaKey;\r\n}\r\n\r\n/**\r\n * Checks if key pressed is one of provided keys.\r\n *\r\n * @param {string|Array<string>} keys\r\n * @param {KeyboardEvent} event\r\n */\r\nexport function isKey(keys, event) {\r\n keys = isArray(keys) ? keys : [ keys ];\r\n\r\n return keys.indexOf(event.key) !== -1 || keys.indexOf(event.code) !== -1;\r\n}\r\n\r\n/**\r\n * @param {KeyboardEvent} event\r\n */\r\nexport function isShift(event) {\r\n return event.shiftKey;\r\n}\r\n\r\nexport function isCopy(event) {\r\n return isCmd(event) && isKey(KEYS_COPY, event);\r\n}\r\n\r\nexport function isPaste(event) {\r\n return isCmd(event) && isKey(KEYS_PASTE, event);\r\n}\r\n\r\nexport function isUndo(event) {\r\n return isCmd(event) && !isShift(event) && isKey(KEYS_UNDO, event);\r\n}\r\n\r\nexport function isRedo(event) {\r\n return isCmd(event) && (\r\n isKey(KEYS_REDO, event) || (\r\n isKey(KEYS_UNDO, event) && isShift(event)\r\n )\r\n );\r\n}","import {\n isFunction\n} from 'min-dash';\n\nimport {\n closest as domClosest,\n event as domEvent,\n matches as domMatches\n} from 'min-dom';\n\nimport {\n hasModifier,\n isCmd,\n isKey,\n isShift\n} from './KeyboardUtil';\n\nvar KEYDOWN_EVENT = 'keyboard.keydown',\n KEYUP_EVENT = 'keyboard.keyup';\n\nvar HANDLE_MODIFIER_ATTRIBUTE = 'input-handle-modified-keys';\n\nvar DEFAULT_PRIORITY = 1000;\n\n/**\n * A keyboard abstraction that may be activated and\n * deactivated by users at will, consuming global key events\n * and triggering diagram actions.\n *\n * For keys pressed down, keyboard fires `keyboard.keydown` event.\n * The event context contains one field which is `KeyboardEvent` event.\n *\n * The implementation fires the following key events that allow\n * other components to hook into key handling:\n *\n * - keyboard.bind\n * - keyboard.unbind\n * - keyboard.init\n * - keyboard.destroy\n *\n * All events contain one field which is node.\n *\n * A default binding for the keyboard may be specified via the\n * `keyboard.bindTo` configuration option.\n *\n * @param {Config} config\n * @param {EventBus} eventBus\n */\nexport default function Keyboard(config, eventBus) {\n var self = this;\n\n this._config = config || {};\n this._eventBus = eventBus;\n\n this._keydownHandler = this._keydownHandler.bind(this);\n this._keyupHandler = this._keyupHandler.bind(this);\n\n // properly clean dom registrations\n eventBus.on('diagram.destroy', function() {\n self._fire('destroy');\n\n self.unbind();\n });\n\n eventBus.on('diagram.init', function() {\n self._fire('init');\n });\n\n eventBus.on('attach', function() {\n if (config && config.bindTo) {\n self.bind(config.bindTo);\n }\n });\n\n eventBus.on('detach', function() {\n self.unbind();\n });\n}\n\nKeyboard.$inject = [\n 'config.keyboard',\n 'eventBus'\n];\n\nKeyboard.prototype._keydownHandler = function(event) {\n this._keyHandler(event, KEYDOWN_EVENT);\n};\n\nKeyboard.prototype._keyupHandler = function(event) {\n this._keyHandler(event, KEYUP_EVENT);\n};\n\nKeyboard.prototype._keyHandler = function(event, type) {\n var eventBusResult;\n\n if (this._isEventIgnored(event)) {\n return;\n }\n\n var context = {\n keyEvent: event\n };\n\n eventBusResult = this._eventBus.fire(type || KEYDOWN_EVENT, context);\n\n if (eventBusResult) {\n event.preventDefault();\n }\n};\n\nKeyboard.prototype._isEventIgnored = function(event) {\n if (event.defaultPrevented) {\n return true;\n }\n\n return isInput(event.target) && this._isModifiedKeyIgnored(event);\n};\n\nKeyboard.prototype._isModifiedKeyIgnored = function(event) {\n if (!isCmd(event)) {\n return true;\n }\n\n var allowedModifiers = this._getAllowedModifiers(event.target);\n return allowedModifiers.indexOf(event.key) === -1;\n};\n\nKeyboard.prototype._getAllowedModifiers = function(element) {\n var modifierContainer = domClosest(element, '[' + HANDLE_MODIFIER_ATTRIBUTE + ']', true);\n\n if (!modifierContainer || (this._node && !this._node.contains(modifierContainer))) {\n return [];\n }\n\n return modifierContainer.getAttribute(HANDLE_MODIFIER_ATTRIBUTE).split(',');\n};\n\nKeyboard.prototype.bind = function(node) {\n\n // make sure that the keyboard is only bound once to the DOM\n this.unbind();\n\n this._node = node;\n\n // bind key events\n domEvent.bind(node, 'keydown', this._keydownHandler);\n domEvent.bind(node, 'keyup', this._keyupHandler);\n\n this._fire('bind');\n};\n\nKeyboard.prototype.getBinding = function() {\n return this._node;\n};\n\nKeyboard.prototype.unbind = function() {\n var node = this._node;\n\n if (node) {\n this._fire('unbind');\n\n // unbind key events\n domEvent.unbind(node, 'keydown', this._keydownHandler);\n domEvent.unbind(node, 'keyup', this._keyupHandler);\n }\n\n this._node = null;\n};\n\nKeyboard.prototype._fire = function(event) {\n this._eventBus.fire('keyboard.' + event, { node: this._node });\n};\n\n/**\n * Add a listener function that is notified with `KeyboardEvent` whenever\n * the keyboard is bound and the user presses a key. If no priority is\n * provided, the default value of 1000 is used.\n *\n * @param {number} [priority]\n * @param {Function} listener\n * @param {string} type\n */\nKeyboard.prototype.addListener = function(priority, listener, type) {\n if (isFunction(priority)) {\n type = listener;\n listener = priority;\n priority = DEFAULT_PRIORITY;\n }\n\n this._eventBus.on(type || KEYDOWN_EVENT, priority, listener);\n};\n\nKeyboard.prototype.removeListener = function(listener, type) {\n this._eventBus.off(type || KEYDOWN_EVENT, listener);\n};\n\nKeyboard.prototype.hasModifier = hasModifier;\nKeyboard.prototype.isCmd = isCmd;\nKeyboard.prototype.isShift = isShift;\nKeyboard.prototype.isKey = isKey;\n\n\n\n// helpers ///////\n\nfunction isInput(target) {\n return target && (domMatches(target, 'input, textarea') || target.contentEditable === 'true');\n}\n","import {\n isCmd,\n isKey,\n isCopy,\n isPaste,\n isUndo,\n isRedo\n} from './KeyboardUtil';\n\nvar LOW_PRIORITY = 500;\n\nexport var KEYS_COPY = [ 'c', 'C', 'KeyC' ];\nexport var KEYS_PASTE = [ 'v', 'V', 'KeyV' ];\nexport var KEYS_REDO = [ 'y', 'Y', 'KeyY' ];\nexport var KEYS_UNDO = [ 'z', 'Z', 'KeyZ' ];\n\n\n/**\n * Adds default keyboard bindings.\n *\n * This does not pull in any features will bind only actions that\n * have previously been registered against the editorActions component.\n *\n * @param {EventBus} eventBus\n * @param {Keyboard} keyboard\n */\nexport default function KeyboardBindings(eventBus, keyboard) {\n\n var self = this;\n\n eventBus.on('editorActions.init', LOW_PRIORITY, function(event) {\n\n var editorActions = event.editorActions;\n\n self.registerBindings(keyboard, editorActions);\n });\n}\n\nKeyboardBindings.$inject = [\n 'eventBus',\n 'keyboard'\n];\n\n\n/**\n * Register available keyboard bindings.\n *\n * @param {Keyboard} keyboard\n * @param {EditorActions} editorActions\n */\nKeyboardBindings.prototype.registerBindings = function(keyboard, editorActions) {\n\n /**\n * Add keyboard binding if respective editor action\n * is registered.\n *\n * @param {string} action name\n * @param {Function} fn that implements the key binding\n */\n function addListener(action, fn) {\n\n if (editorActions.isRegistered(action)) {\n keyboard.addListener(fn);\n }\n }\n\n\n // undo\n // (CTRL|CMD) + Z\n addListener('undo', function(context) {\n\n var event = context.keyEvent;\n\n if (isUndo(event)) {\n editorActions.trigger('undo');\n\n return true;\n }\n });\n\n // redo\n // CTRL + Y\n // CMD + SHIFT + Z\n addListener('redo', function(context) {\n\n var event = context.keyEvent;\n\n if (isRedo(event)) {\n editorActions.trigger('redo');\n\n return true;\n }\n });\n\n // copy\n // CTRL/CMD + C\n addListener('copy', function(context) {\n\n var event = context.keyEvent;\n\n if (isCopy(event)) {\n editorActions.trigger('copy');\n\n return true;\n }\n });\n\n // paste\n // CTRL/CMD + V\n addListener('paste', function(context) {\n\n var event = context.keyEvent;\n\n if (isPaste(event)) {\n editorActions.trigger('paste');\n\n return true;\n }\n });\n\n // zoom in one step\n // CTRL/CMD + +\n addListener('stepZoom', function(context) {\n\n var event = context.keyEvent;\n\n // quirk: it has to be triggered by `=` as well to work on international keyboard layout\n // cf: https://github.com/bpmn-io/bpmn-js/issues/1362#issuecomment-722989754\n if (isKey([ '+', 'Add', '=' ], event) && isCmd(event)) {\n editorActions.trigger('stepZoom', { value: 1 });\n\n return true;\n }\n });\n\n // zoom out one step\n // CTRL + -\n addListener('stepZoom', function(context) {\n\n var event = context.keyEvent;\n\n if (isKey([ '-', 'Subtract' ], event) && isCmd(event)) {\n editorActions.trigger('stepZoom', { value: -1 });\n\n return true;\n }\n });\n\n // zoom to the default level\n // CTRL + 0\n addListener('zoom', function(context) {\n\n var event = context.keyEvent;\n\n if (isKey('0', event) && isCmd(event)) {\n editorActions.trigger('zoom', { value: 1 });\n\n return true;\n }\n });\n\n // delete selected element\n // DEL\n addListener('removeSelection', function(context) {\n\n var event = context.keyEvent;\n\n if (isKey([ 'Backspace', 'Delete', 'Del' ], event)) {\n editorActions.trigger('removeSelection');\n\n return true;\n }\n });\n};","import Keyboard from './Keyboard';\nimport KeyboardBindings from './KeyboardBindings';\n\nexport default {\n __init__: [ 'keyboard', 'keyboardBindings' ],\n keyboard: [ 'type', Keyboard ],\n keyboardBindings: [ 'type', KeyboardBindings ]\n};\n","import {\n isCmd,\n isKey,\n isShift\n} from 'diagram-js/lib/features/keyboard/KeyboardUtil';\n\nimport {\n KEYS_REDO,\n KEYS_UNDO\n} from 'diagram-js/lib/features/keyboard/KeyboardBindings';\n\nconst LOW_PRIORITY = 500;\n\nexport default class FormEditorKeyboardBindings {\n constructor(eventBus, keyboard) {\n eventBus.on('editorActions.init', LOW_PRIORITY, (event) => {\n const { editorActions } = event;\n\n this.registerBindings(keyboard, editorActions);\n });\n }\n\n registerBindings(keyboard, editorActions) {\n\n function addListener(action, fn) {\n if (editorActions.isRegistered(action)) {\n keyboard.addListener(fn);\n }\n }\n\n // undo\n // (CTRL|CMD) + Z\n addListener('undo', (context) => {\n const { keyEvent } = context;\n\n if (isCmd(keyEvent) && !isShift(keyEvent) && isKey(KEYS_UNDO, keyEvent)) {\n editorActions.trigger('undo');\n\n return true;\n }\n });\n\n // redo\n // CTRL + Y\n // CMD + SHIFT + Z\n addListener('redo', (context) => {\n const { keyEvent } = context;\n\n if (isCmd(keyEvent) && (isKey(KEYS_REDO, keyEvent) || (isKey(KEYS_UNDO, keyEvent) && isShift(keyEvent)))) {\n editorActions.trigger('redo');\n\n return true;\n }\n });\n\n }\n}\n\nFormEditorKeyboardBindings.$inject = [ 'eventBus', 'keyboard' ];","import KeyboardModule from 'diagram-js/lib/features/keyboard';\n\nimport FormEditorKeyboardBindings from './FormEditorKeyboardBindings';\n\nexport default {\n __depends__: [\n KeyboardModule\n ],\n __init__: [ 'keyboardBindings' ],\n keyboardBindings: [ 'type', FormEditorKeyboardBindings ]\n};","export function arrayAdd(array, index, item) {\n array.splice(index, 0, item);\n\n return array;\n}\n\nexport { mutate as arrayMove } from 'array-move';\n\nexport function arrayRemove(array, index) {\n array.splice(index, 1);\n\n return array;\n}\n\nexport function updatePath(formFieldRegistry, formField, index) {\n const parent = formFieldRegistry.get(formField._parent);\n\n formField._path = [ ...parent._path, 'components', index ];\n\n return formField;\n}","import { get } from 'min-dash';\n\nimport {\n arrayAdd,\n arrayRemove,\n updatePath\n} from './Util';\n\nexport default class AddFormFieldHandler {\n\n /**\n * @constructor\n * @param { import('../../../FormEditor').default } formEditor\n * @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry\n */\n constructor(formEditor, formFieldRegistry) {\n this._formEditor = formEditor;\n this._formFieldRegistry = formFieldRegistry;\n }\n\n execute(context) {\n const {\n formField,\n targetFormField,\n targetIndex\n } = context;\n\n const { schema } = this._formEditor._getState();\n\n const targetPath = [ ...targetFormField._path, 'components' ];\n\n formField._parent = targetFormField.id;\n\n // (1) Add new form field\n arrayAdd(get(schema, targetPath), targetIndex, formField);\n\n // (2) Update paths of new form field and its siblings\n get(schema, targetPath).forEach((formField, index) => updatePath(this._formFieldRegistry, formField, index));\n\n // (3) Add new form field to form field registry\n this._formFieldRegistry.add(formField);\n\n // TODO: Create updater/change support that automatically updates paths and schema on command execution\n this._formEditor._setState({ schema });\n }\n\n revert(context) {\n const {\n formField,\n targetFormField,\n targetIndex\n } = context;\n\n const { schema } = this._formEditor._getState();\n\n const targetPath = [ ...targetFormField._path, 'components' ];\n\n // (1) Remove new form field\n arrayRemove(get(schema, targetPath), targetIndex);\n\n // (2) Update paths of new form field and its siblings\n get(schema, targetPath).forEach((formField, index) => updatePath(this._formFieldRegistry, formField, index));\n\n // (3) Remove new form field from form field registry\n this._formFieldRegistry.remove(formField);\n\n // TODO: Create updater/change support that automatically updates paths and schema on command execution\n this._formEditor._setState({ schema });\n }\n}\n\nAddFormFieldHandler.$inject = [ 'formEditor', 'formFieldRegistry' ];","export default class EditFormFieldHandler {\n\n /**\n * @constructor\n * @param { import('../../../FormEditor').default } formEditor\n * @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry\n */\n constructor(formEditor, formFieldRegistry) {\n this._formEditor = formEditor;\n this._formFieldRegistry = formFieldRegistry;\n }\n\n execute(context) {\n const {\n formField,\n properties\n } = context;\n\n let { schema } = this._formEditor._getState();\n\n const oldProperties = {};\n\n for (let key in properties) {\n oldProperties[ key ] = formField[ key ];\n\n const property = properties[ key ];\n\n if (key === 'id') {\n if (property !== formField.id) {\n this._formFieldRegistry.updateId(formField, property);\n }\n } else {\n formField[ key ] = property;\n }\n }\n\n context.oldProperties = oldProperties;\n\n // TODO: Create updater/change support that automatically updates paths and schema on command execution\n this._formEditor._setState({ schema });\n\n return formField;\n }\n\n revert(context) {\n const {\n formField,\n oldProperties\n } = context;\n\n let { schema } = this._formEditor._getState();\n\n for (let key in oldProperties) {\n\n const property = oldProperties[ key ];\n\n if (key === 'id') {\n if (property !== formField.id) {\n this._formFieldRegistry.updateId(formField, property);\n }\n } else {\n formField[ key ] = property;\n }\n }\n\n // TODO: Create updater/change support that automatically updates paths and schema on command execution\n this._formEditor._setState({ schema });\n\n return formField;\n }\n\n}\n\nEditFormFieldHandler.$inject = [\n 'formEditor',\n 'formFieldRegistry'\n];","import { get } from 'min-dash';\n\nimport {\n arrayAdd,\n arrayMove,\n arrayRemove,\n updatePath\n} from './Util';\n\nexport default class MoveFormFieldHandler {\n\n /**\n * @constructor\n * @param { import('../../../FormEditor').default } formEditor\n * @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry\n */\n constructor(formEditor, formFieldRegistry) {\n this._formEditor = formEditor;\n this._formFieldRegistry = formFieldRegistry;\n }\n\n execute(context) {\n this.moveFormField(context);\n }\n\n revert(context) {\n let {\n sourceFormField,\n targetFormField,\n sourceIndex,\n targetIndex\n } = context;\n\n this.moveFormField({\n sourceFormField: targetFormField,\n targetFormField: sourceFormField,\n sourceIndex: targetIndex,\n targetIndex: sourceIndex\n }, true);\n }\n\n moveFormField(context, revert) {\n let {\n sourceFormField,\n targetFormField,\n sourceIndex,\n targetIndex\n } = context;\n\n let { schema } = this._formEditor._getState();\n\n const sourcePath = [ ...sourceFormField._path, 'components' ];\n\n if (sourceFormField.id === targetFormField.id) {\n\n if (revert) {\n if (sourceIndex > targetIndex) {\n sourceIndex--;\n }\n } else {\n if (sourceIndex < targetIndex) {\n targetIndex--;\n }\n }\n\n // (1) Move form field\n arrayMove(get(schema, sourcePath), sourceIndex, targetIndex);\n\n // (2) Update paths of new form field and its siblings\n get(schema, sourcePath).forEach((formField, index) => updatePath(this._formFieldRegistry, formField, index));\n\n } else {\n const formField = get(schema, [ ...sourcePath, sourceIndex ]);\n\n formField._parent = targetFormField.id;\n\n // (1) Remove form field\n arrayRemove(get(schema, sourcePath), sourceIndex);\n\n // (2) Update paths of siblings\n get(schema, sourcePath).forEach((formField, index) => updatePath(this._formFieldRegistry, formField, index));\n\n const targetPath = [ ...targetFormField._path, 'components' ];\n\n // (3) Add form field\n arrayAdd(get(schema, targetPath), targetIndex, formField);\n\n // (4) Update paths of siblings\n get(schema, targetPath).forEach((formField, index) => updatePath(this._formFieldRegistry, formField, index));\n }\n\n // TODO: Create updater/change support that automatically updates paths and schema on command execution\n this._formEditor._setState({ schema });\n }\n}\n\nMoveFormFieldHandler.$inject = [ 'formEditor', 'formFieldRegistry' ];","import { get } from 'min-dash';\n\nimport {\n arrayAdd,\n arrayRemove,\n updatePath\n} from './Util';\n\nexport default class RemoveFormFieldHandler {\n\n /**\n * @constructor\n * @param { import('../../../FormEditor').default } formEditor\n * @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry\n */\n constructor(formEditor, formFieldRegistry) {\n this._formEditor = formEditor;\n this._formFieldRegistry = formFieldRegistry;\n }\n\n execute(context) {\n const {\n sourceFormField,\n sourceIndex\n } = context;\n\n let { schema } = this._formEditor._getState();\n\n const sourcePath = [ ...sourceFormField._path, 'components' ];\n\n const formField = context.formField = get(schema, [ ...sourcePath, sourceIndex ]);\n\n // (1) Remove form field\n arrayRemove(get(schema, sourcePath), sourceIndex);\n\n // (2) Update paths of its siblings\n get(schema, sourcePath).forEach((formField, index) => updatePath(this._formFieldRegistry, formField, index));\n\n // (3) Remove form field from form field registry\n this._formFieldRegistry.remove(formField);\n\n // TODO: Create updater/change support that automatically updates paths and schema on command execution\n this._formEditor._setState({ schema });\n }\n\n revert(context) {\n const {\n formField,\n sourceFormField,\n sourceIndex\n } = context;\n\n let { schema } = this._formEditor._getState();\n\n const sourcePath = [ ...sourceFormField._path, 'components' ];\n\n // (1) Add form field\n arrayAdd(get(schema, sourcePath), sourceIndex, formField);\n\n // (2) Update paths of its siblings\n get(schema, sourcePath).forEach((formField, index) => updatePath(this._formFieldRegistry, formField, index));\n\n // (3) Add form field to form field registry\n this._formFieldRegistry.add(formField);\n\n // TODO: Create updater/change support that automatically updates paths and schema on command execution\n this._formEditor._setState({ schema });\n }\n}\n\nRemoveFormFieldHandler.$inject = [ 'formEditor', 'formFieldRegistry' ];","export default class UpdateIdClaimHandler {\n\n /**\n * @constructor\n * @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry\n */\n constructor(formFieldRegistry) {\n this._formFieldRegistry = formFieldRegistry;\n }\n\n execute(context) {\n const {\n claiming,\n formField,\n id\n } = context;\n\n if (claiming) {\n this._formFieldRegistry._ids.claim(id, formField);\n } else {\n this._formFieldRegistry._ids.unclaim(id);\n }\n }\n\n revert(context) {\n const {\n claiming,\n formField,\n id\n } = context;\n\n if (claiming) {\n this._formFieldRegistry._ids.unclaim(id);\n } else {\n this._formFieldRegistry._ids.claim(id, formField);\n }\n }\n}\n\nUpdateIdClaimHandler.$inject = [ 'formFieldRegistry' ];","export default class UpdateKeyClaimHandler {\n\n /**\n * @constructor\n * @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry\n */\n constructor(formFieldRegistry) {\n this._formFieldRegistry = formFieldRegistry;\n }\n\n execute(context) {\n const {\n claiming,\n formField,\n key\n } = context;\n\n if (claiming) {\n this._formFieldRegistry._keys.claim(key, formField);\n } else {\n this._formFieldRegistry._keys.unclaim(key);\n }\n }\n\n revert(context) {\n const {\n claiming,\n formField,\n key\n } = context;\n\n if (claiming) {\n this._formFieldRegistry._keys.unclaim(key);\n } else {\n this._formFieldRegistry._keys.claim(key, formField);\n }\n }\n}\n\nUpdateKeyClaimHandler.$inject = [ 'formFieldRegistry' ];","import AddFormFieldHandler from './cmd/AddFormFieldHandler';\nimport EditFormFieldHandler from './cmd/EditFormFieldHandler';\nimport MoveFormFieldHandler from './cmd/MoveFormFieldHandler';\nimport RemoveFormFieldHandler from './cmd/RemoveFormFieldHandler';\nimport UpdateIdClaimHandler from './cmd/UpdateIdClaimHandler';\nimport UpdateKeyClaimHandler from './cmd/UpdateKeyClaimHandler';\n\nimport { isObject } from 'min-dash';\n\n\nexport default class Modeling {\n constructor(commandStack, eventBus, formEditor, formFieldRegistry, fieldFactory) {\n this._commandStack = commandStack;\n this._formEditor = formEditor;\n this._formFieldRegistry = formFieldRegistry;\n this._fieldFactory = fieldFactory;\n\n eventBus.on('form.init', () => {\n this.registerHandlers();\n });\n }\n\n registerHandlers() {\n Object.entries(this.getHandlers()).forEach(([ id, handler ]) => {\n this._commandStack.registerHandler(id, handler);\n });\n }\n\n getHandlers() {\n return {\n 'formField.add': AddFormFieldHandler,\n 'formField.edit': EditFormFieldHandler,\n 'formField.move': MoveFormFieldHandler,\n 'formField.remove': RemoveFormFieldHandler,\n 'id.updateClaim': UpdateIdClaimHandler,\n 'key.updateClaim': UpdateKeyClaimHandler\n };\n }\n\n addFormField(attrs, targetFormField, targetIndex) {\n\n const formField = this._fieldFactory.create(attrs);\n\n const context = {\n formField,\n targetFormField,\n targetIndex\n };\n\n this._commandStack.execute('formField.add', context);\n\n return formField;\n }\n\n editFormField(formField, properties, value) {\n if (!isObject(properties)) {\n properties = {\n [ properties ]: value\n };\n }\n\n const context = {\n formField,\n properties\n };\n\n this._commandStack.execute('formField.edit', context);\n }\n\n moveFormField(formField, sourceFormField, targetFormField, sourceIndex, targetIndex) {\n const context = {\n formField,\n sourceFormField,\n targetFormField,\n sourceIndex,\n targetIndex\n };\n\n this._commandStack.execute('formField.move', context);\n }\n\n removeFormField(formField, sourceFormField, sourceIndex) {\n const context = {\n formField,\n sourceFormField,\n sourceIndex\n };\n\n this._commandStack.execute('formField.remove', context);\n }\n\n claimId(formField, id) {\n const context = {\n formField,\n id,\n claiming: true\n };\n\n this._commandStack.execute('id.updateClaim', context);\n }\n\n unclaimId(formField, id) {\n const context = {\n formField,\n id,\n claiming: false\n };\n\n this._commandStack.execute('id.updateClaim', context);\n }\n\n claimKey(formField, key) {\n const context = {\n formField,\n key,\n claiming: true\n };\n\n this._commandStack.execute('key.updateClaim', context);\n }\n\n unclaimKey(formField, key) {\n const context = {\n formField,\n key,\n claiming: false\n };\n\n this._commandStack.execute('key.updateClaim', context);\n }\n}\n\nModeling.$inject = [\n 'commandStack',\n 'eventBus',\n 'formEditor',\n 'formFieldRegistry',\n 'fieldFactory'\n];","import {\n forEach,\n isFunction,\n isArray,\n isNumber,\n isObject\n} from 'min-dash';\n\n\nvar DEFAULT_PRIORITY = 1000;\n\n/**\n * A utility that can be used to plug-in into the command execution for\n * extension and/or validation.\n *\n * @param {EventBus} eventBus\n *\n * @example\n *\n * import inherits from 'inherits-browser';\n *\n * import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';\n *\n * function CommandLogger(eventBus) {\n * CommandInterceptor.call(this, eventBus);\n *\n * this.preExecute(function(event) {\n * console.log('command pre-execute', event);\n * });\n * }\n *\n * inherits(CommandLogger, CommandInterceptor);\n *\n */\nexport default function CommandInterceptor(eventBus) {\n this._eventBus = eventBus;\n}\n\nCommandInterceptor.$inject = [ 'eventBus' ];\n\nfunction unwrapEvent(fn, that) {\n return function(event) {\n return fn.call(that || null, event.context, event.command, event);\n };\n}\n\n/**\n * Register an interceptor for a command execution\n *\n * @param {string|Array<string>} [events] list of commands to register on\n * @param {string} [hook] command hook, i.e. preExecute, executed to listen on\n * @param {number} [priority] the priority on which to hook into the execution\n * @param {Function} handlerFn interceptor to be invoked with (event)\n * @param {boolean} unwrap if true, unwrap the event and pass (context, command, event) to the\n * listener instead\n * @param {Object} [that] Pass context (`this`) to the handler function\n */\nCommandInterceptor.prototype.on = function(events, hook, priority, handlerFn, unwrap, that) {\n\n if (isFunction(hook) || isNumber(hook)) {\n that = unwrap;\n unwrap = handlerFn;\n handlerFn = priority;\n priority = hook;\n hook = null;\n }\n\n if (isFunction(priority)) {\n that = unwrap;\n unwrap = handlerFn;\n handlerFn = priority;\n priority = DEFAULT_PRIORITY;\n }\n\n if (isObject(unwrap)) {\n that = unwrap;\n unwrap = false;\n }\n\n if (!isFunction(handlerFn)) {\n throw new Error('handlerFn must be a function');\n }\n\n if (!isArray(events)) {\n events = [ events ];\n }\n\n var eventBus = this._eventBus;\n\n forEach(events, function(event) {\n\n // concat commandStack(.event)?(.hook)?\n var fullEvent = [ 'commandStack', event, hook ].filter(function(e) { return e; }).join('.');\n\n eventBus.on(fullEvent, priority, unwrap ? unwrapEvent(handlerFn, that) : handlerFn, that);\n });\n};\n\n\nvar hooks = [\n 'canExecute',\n 'preExecute',\n 'preExecuted',\n 'execute',\n 'executed',\n 'postExecute',\n 'postExecuted',\n 'revert',\n 'reverted'\n];\n\n/*\n * Install hook shortcuts\n *\n * This will generate the CommandInterceptor#(preExecute|...|reverted) methods\n * which will in term forward to CommandInterceptor#on.\n */\nforEach(hooks, function(hook) {\n\n /**\n * {canExecute|preExecute|preExecuted|execute|executed|postExecute|postExecuted|revert|reverted}\n *\n * A named hook for plugging into the command execution\n *\n * @param {string|Array<string>} [events] list of commands to register on\n * @param {number} [priority] the priority on which to hook into the execution\n * @param {Function} handlerFn interceptor to be invoked with (event)\n * @param {boolean} [unwrap=false] if true, unwrap the event and pass (context, command, event) to the\n * listener instead\n * @param {Object} [that] Pass context (`this`) to the handler function\n */\n CommandInterceptor.prototype[hook] = function(events, priority, handlerFn, unwrap, that) {\n\n if (isFunction(events) || isNumber(events)) {\n that = unwrap;\n unwrap = handlerFn;\n handlerFn = priority;\n priority = events;\n events = null;\n }\n\n this.on(events, hook, priority, handlerFn, unwrap, that);\n };\n});\n","import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';\n\nexport default class IdBehavior extends CommandInterceptor {\n constructor(eventBus, modeling) {\n super(eventBus);\n\n // @ts-ignore-next-line\n this.preExecute('formField.remove', function(context) {\n const { formField } = context;\n\n const { id } = formField;\n\n modeling.unclaimId(formField, id);\n }, true);\n\n // @ts-ignore-next-line\n this.preExecute('formField.edit', function(context) {\n const {\n formField,\n properties\n } = context;\n\n if ('id' in properties) {\n modeling.unclaimId(formField, formField.id);\n\n modeling.claimId(formField, properties.id);\n }\n }, true);\n }\n}\n\nIdBehavior.$inject = [ 'eventBus', 'modeling' ];","import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';\n\nexport default class KeyBehavior extends CommandInterceptor {\n constructor(eventBus, modeling) {\n super(eventBus);\n\n // @ts-ignore-next-line\n this.preExecute('formField.remove', function(context) {\n const { formField } = context;\n\n const { key } = formField;\n\n if (key) {\n modeling.unclaimKey(formField, key);\n }\n }, true);\n\n // @ts-ignore-next-line\n this.preExecute('formField.edit', function(context) {\n const {\n formField,\n properties\n } = context;\n\n if ('key' in properties) {\n modeling.unclaimKey(formField, formField.key);\n\n modeling.claimKey(formField, properties.key);\n }\n }, true);\n }\n}\n\nKeyBehavior.$inject = [ 'eventBus', 'modeling' ];","import IdBehavior from './IdBehavior';\nimport KeyBehavior from './KeyBehavior';\n\nexport default {\n __init__: [\n 'idBehavior',\n 'keyBehavior'\n ],\n idBehavior: [ 'type', IdBehavior ],\n keyBehavior: [ 'type', KeyBehavior ]\n};\n","import {\n uniqueBy,\n isArray\n} from 'min-dash';\n\n\n/**\n * A service that offers un- and redoable execution of commands.\n *\n * The command stack is responsible for executing modeling actions\n * in a un- and redoable manner. To do this it delegates the actual\n * command execution to {@link CommandHandler}s.\n *\n * Command handlers provide {@link CommandHandler#execute(ctx)} and\n * {@link CommandHandler#revert(ctx)} methods to un- and redo a command\n * identified by a command context.\n *\n *\n * ## Life-Cycle events\n *\n * In the process the command stack fires a number of life-cycle events\n * that other components to participate in the command execution.\n *\n * * preExecute\n * * preExecuted\n * * execute\n * * executed\n * * postExecute\n * * postExecuted\n * * revert\n * * reverted\n *\n * A special event is used for validating, whether a command can be\n * performed prior to its execution.\n *\n * * canExecute\n *\n * Each of the events is fired as `commandStack.{eventName}` and\n * `commandStack.{commandName}.{eventName}`, respectively. This gives\n * components fine grained control on where to hook into.\n *\n * The event object fired transports `command`, the name of the\n * command and `context`, the command context.\n *\n *\n * ## Creating Command Handlers\n *\n * Command handlers should provide the {@link CommandHandler#execute(ctx)}\n * and {@link CommandHandler#revert(ctx)} methods to implement\n * redoing and undoing of a command.\n *\n * A command handler _must_ ensure undo is performed properly in order\n * not to break the undo chain. It must also return the shapes that\n * got changed during the `execute` and `revert` operations.\n *\n * Command handlers may execute other modeling operations (and thus\n * commands) in their `preExecute` and `postExecute` phases. The command\n * stack will properly group all commands together into a logical unit\n * that may be re- and undone atomically.\n *\n * Command handlers must not execute other commands from within their\n * core implementation (`execute`, `revert`).\n *\n *\n * ## Change Tracking\n *\n * During the execution of the CommandStack it will keep track of all\n * elements that have been touched during the command's execution.\n *\n * At the end of the CommandStack execution it will notify interested\n * components via an 'elements.changed' event with all the dirty\n * elements.\n *\n * The event can be picked up by components that are interested in the fact\n * that elements have been changed. One use case for this is updating\n * their graphical representation after moving / resizing or deletion.\n *\n * @see CommandHandler\n *\n * @param {EventBus} eventBus\n * @param {Injector} injector\n */\nexport default function CommandStack(eventBus, injector) {\n\n /**\n * A map of all registered command handlers.\n *\n * @type {Object}\n */\n this._handlerMap = {};\n\n /**\n * A stack containing all re/undoable actions on the diagram\n *\n * @type {Array<Object>}\n */\n this._stack = [];\n\n /**\n * The current index on the stack\n *\n * @type {number}\n */\n this._stackIdx = -1;\n\n /**\n * Current active commandStack execution\n *\n * @type {Object}\n * @property {Object[]} actions\n * @property {Object[]} dirty\n * @property { 'undo' | 'redo' | 'clear' | 'execute' | null } trigger the cause of the current excecution\n */\n this._currentExecution = {\n actions: [],\n dirty: [],\n trigger: null\n };\n\n\n this._injector = injector;\n this._eventBus = eventBus;\n\n this._uid = 1;\n\n eventBus.on([\n 'diagram.destroy',\n 'diagram.clear'\n ], function() {\n this.clear(false);\n }, this);\n}\n\nCommandStack.$inject = [ 'eventBus', 'injector' ];\n\n\n/**\n * Execute a command\n *\n * @param {string} command the command to execute\n * @param {Object} context the environment to execute the command in\n */\nCommandStack.prototype.execute = function(command, context) {\n if (!command) {\n throw new Error('command required');\n }\n\n this._currentExecution.trigger = 'execute';\n\n const action = { command: command, context: context };\n\n this._pushAction(action);\n this._internalExecute(action);\n this._popAction(action);\n};\n\n\n/**\n * Ask whether a given command can be executed.\n *\n * Implementors may hook into the mechanism on two ways:\n *\n * * in event listeners:\n *\n * Users may prevent the execution via an event listener.\n * It must prevent the default action for `commandStack.(<command>.)canExecute` events.\n *\n * * in command handlers:\n *\n * If the method {@link CommandHandler#canExecute} is implemented in a handler\n * it will be called to figure out whether the execution is allowed.\n *\n * @param {string} command the command to execute\n * @param {Object} context the environment to execute the command in\n *\n * @return {boolean} true if the command can be executed\n */\nCommandStack.prototype.canExecute = function(command, context) {\n\n const action = { command: command, context: context };\n\n const handler = this._getHandler(command);\n\n let result = this._fire(command, 'canExecute', action);\n\n // handler#canExecute will only be called if no listener\n // decided on a result already\n if (result === undefined) {\n if (!handler) {\n return false;\n }\n\n if (handler.canExecute) {\n result = handler.canExecute(context);\n }\n }\n\n return result;\n};\n\n\n/**\n * Clear the command stack, erasing all undo / redo history\n */\nCommandStack.prototype.clear = function(emit) {\n this._stack.length = 0;\n this._stackIdx = -1;\n\n if (emit !== false) {\n this._fire('changed', { trigger: 'clear' });\n }\n};\n\n\n/**\n * Undo last command(s)\n */\nCommandStack.prototype.undo = function() {\n let action = this._getUndoAction(),\n next;\n\n if (action) {\n this._currentExecution.trigger = 'undo';\n\n this._pushAction(action);\n\n while (action) {\n this._internalUndo(action);\n next = this._getUndoAction();\n\n if (!next || next.id !== action.id) {\n break;\n }\n\n action = next;\n }\n\n this._popAction();\n }\n};\n\n\n/**\n * Redo last command(s)\n */\nCommandStack.prototype.redo = function() {\n let action = this._getRedoAction(),\n next;\n\n if (action) {\n this._currentExecution.trigger = 'redo';\n\n this._pushAction(action);\n\n while (action) {\n this._internalExecute(action, true);\n next = this._getRedoAction();\n\n if (!next || next.id !== action.id) {\n break;\n }\n\n action = next;\n }\n\n this._popAction();\n }\n};\n\n\n/**\n * Register a handler instance with the command stack\n *\n * @param {string} command\n * @param {CommandHandler} handler\n */\nCommandStack.prototype.register = function(command, handler) {\n this._setHandler(command, handler);\n};\n\n\n/**\n * Register a handler type with the command stack\n * by instantiating it and injecting its dependencies.\n *\n * @param {string} command\n * @param {Function} a constructor for a {@link CommandHandler}\n */\nCommandStack.prototype.registerHandler = function(command, handlerCls) {\n\n if (!command || !handlerCls) {\n throw new Error('command and handlerCls must be defined');\n }\n\n const handler = this._injector.instantiate(handlerCls);\n this.register(command, handler);\n};\n\nCommandStack.prototype.canUndo = function() {\n return !!this._getUndoAction();\n};\n\nCommandStack.prototype.canRedo = function() {\n return !!this._getRedoAction();\n};\n\n// stack access //////////////////////\n\nCommandStack.prototype._getRedoAction = function() {\n return this._stack[this._stackIdx + 1];\n};\n\n\nCommandStack.prototype._getUndoAction = function() {\n return this._stack[this._stackIdx];\n};\n\n\n// internal functionality //////////////////////\n\nCommandStack.prototype._internalUndo = function(action) {\n const command = action.command,\n context = action.context;\n\n const handler = this._getHandler(command);\n\n // guard against illegal nested command stack invocations\n this._atomicDo(() => {\n this._fire(command, 'revert', action);\n\n if (handler.revert) {\n this._markDirty(handler.revert(context));\n }\n\n this._revertedAction(action);\n\n this._fire(command, 'reverted', action);\n });\n};\n\n\nCommandStack.prototype._fire = function(command, qualifier, event) {\n if (arguments.length < 3) {\n event = qualifier;\n qualifier = null;\n }\n\n const names = qualifier ? [ command + '.' + qualifier, qualifier ] : [ command ];\n let result;\n\n event = this._eventBus.createEvent(event);\n\n for (const name of names) {\n result = this._eventBus.fire('commandStack.' + name, event);\n\n if (event.cancelBubble) {\n break;\n }\n }\n\n return result;\n};\n\nCommandStack.prototype._createId = function() {\n return this._uid++;\n};\n\nCommandStack.prototype._atomicDo = function(fn) {\n\n const execution = this._currentExecution;\n\n execution.atomic = true;\n\n try {\n fn();\n } finally {\n execution.atomic = false;\n }\n};\n\nCommandStack.prototype._internalExecute = function(action, redo) {\n const command = action.command,\n context = action.context;\n\n const handler = this._getHandler(command);\n\n if (!handler) {\n throw new Error('no command handler registered for <' + command + '>');\n }\n\n this._pushAction(action);\n\n if (!redo) {\n this._fire(command, 'preExecute', action);\n\n if (handler.preExecute) {\n handler.preExecute(context);\n }\n\n this._fire(command, 'preExecuted', action);\n }\n\n // guard against illegal nested command stack invocations\n this._atomicDo(() => {\n\n this._fire(command, 'execute', action);\n\n if (handler.execute) {\n\n // actual execute + mark return results as dirty\n this._markDirty(handler.execute(context));\n }\n\n // log to stack\n this._executedAction(action, redo);\n\n this._fire(command, 'executed', action);\n });\n\n if (!redo) {\n this._fire(command, 'postExecute', action);\n\n if (handler.postExecute) {\n handler.postExecute(context);\n }\n\n this._fire(command, 'postExecuted', action);\n }\n\n this._popAction(action);\n};\n\n\nCommandStack.prototype._pushAction = function(action) {\n\n const execution = this._currentExecution,\n actions = execution.actions;\n\n const baseAction = actions[0];\n\n if (execution.atomic) {\n throw new Error('illegal invocation in <execute> or <revert> phase (action: ' + action.command + ')');\n }\n\n if (!action.id) {\n action.id = (baseAction && baseAction.id) || this._createId();\n }\n\n actions.push(action);\n};\n\n\nCommandStack.prototype._popAction = function() {\n const execution = this._currentExecution,\n trigger = execution.trigger,\n actions = execution.actions,\n dirty = execution.dirty;\n\n actions.pop();\n\n if (!actions.length) {\n this._eventBus.fire('elements.changed', { elements: uniqueBy('id', dirty.reverse()) });\n\n dirty.length = 0;\n\n this._fire('changed', { trigger: trigger });\n\n execution.trigger = null;\n }\n};\n\n\nCommandStack.prototype._markDirty = function(elements) {\n const execution = this._currentExecution;\n\n if (!elements) {\n return;\n }\n\n elements = isArray(elements) ? elements : [ elements ];\n\n execution.dirty = execution.dirty.concat(elements);\n};\n\n\nCommandStack.prototype._executedAction = function(action, redo) {\n const stackIdx = ++this._stackIdx;\n\n if (!redo) {\n this._stack.splice(stackIdx, this._stack.length, action);\n }\n};\n\n\nCommandStack.prototype._revertedAction = function(action) {\n this._stackIdx--;\n};\n\n\nCommandStack.prototype._getHandler = function(command) {\n return this._handlerMap[command];\n};\n\nCommandStack.prototype._setHandler = function(command, handler) {\n if (!command || !handler) {\n throw new Error('command and handler required');\n }\n\n if (this._handlerMap[command]) {\n throw new Error('overriding handler for command <' + command + '>');\n }\n\n this._handlerMap[command] = handler;\n};\n","import CommandStack from './CommandStack';\n\nexport default {\n commandStack: [ 'type', CommandStack ]\n};\n","import Modeling from './Modeling';\n\nimport behaviorModule from './behavior';\nimport commandModule from 'diagram-js/lib/command';\n\nexport default {\n __depends__: [\n behaviorModule,\n commandModule\n ],\n __init__: [ 'modeling' ],\n modeling: [ 'type', Modeling ]\n};\n","export default class Selection {\n constructor(eventBus) {\n this._eventBus = eventBus;\n this._selection = null;\n }\n\n get() {\n return this._selection;\n }\n\n set(selection) {\n if (this._selection === selection) {\n return;\n }\n\n this._selection = selection;\n\n this._eventBus.fire('selection.changed', {\n selection: this._selection\n });\n }\n\n toggle(selection) {\n const newSelection = this._selection === selection ? null : selection;\n\n this.set(newSelection);\n }\n\n clear() {\n this.set(null);\n }\n\n isSelected(formField) {\n return this._selection === formField;\n }\n}\n\nSelection.$inject = [ 'eventBus' ];","export default class SelectionBehavior {\n constructor(eventBus, selection) {\n eventBus.on([\n 'commandStack.formField.add.postExecuted',\n 'commandStack.formField.move.postExecuted'\n ], ({ context }) => {\n const { formField } = context;\n\n selection.set(formField);\n });\n\n eventBus.on('commandStack.formField.remove.postExecuted', ({ context }) => {\n const {\n sourceFormField,\n sourceIndex\n } = context;\n\n const formField = sourceFormField.components[ sourceIndex ] || sourceFormField.components[ sourceIndex - 1 ];\n\n if (formField) {\n selection.set(formField);\n } else {\n selection.clear();\n }\n });\n\n eventBus.on('formField.remove', ({ formField }) => {\n if (selection.isSelected(formField)) {\n selection.clear();\n }\n });\n }\n}\n\nSelectionBehavior.$inject = [ 'eventBus', 'selection' ];","import Selection from './Selection';\nimport SelectionBehavior from './SelectionBehavior';\n\nexport default {\n __init__: [ 'selection', 'selectionBehavior' ],\n selection: [ 'type', Selection ],\n selectionBehavior: [ 'type', SelectionBehavior ]\n};","import { iconsByType } from '../../../render/components/icons';\n\nconst types = [\n {\n label: 'Text field',\n type: 'textfield'\n },\n {\n label: 'Text area',\n type: 'textarea'\n },\n {\n label: 'Number',\n type: 'number'\n },\n {\n label: 'Datetime',\n type: 'datetime'\n },\n {\n label: 'Checkbox',\n type: 'checkbox'\n },\n {\n label: 'Checklist',\n type: 'checklist'\n },\n {\n label: 'Taglist',\n type: 'taglist'\n },\n {\n label: 'Radio',\n type: 'radio'\n },\n {\n label: 'Select',\n type: 'select'\n },\n {\n label: 'Text view',\n type: 'text'\n },\n {\n label: 'Image view',\n type: 'image'\n },\n {\n label: 'Button',\n type: 'button'\n }\n];\n\n\nexport default function Palette(props) {\n return <div class=\"fjs-palette\">\n <div class=\"fjs-palette-header\" title=\"Form elements library\">\n <span class=\"fjs-hide-compact\">FORM ELEMENTS </span>LIBRARY\n </div>\n <div class=\"fjs-palette-fields fjs-drag-container fjs-no-drop\">\n {\n types.map(({ label, type }) => {\n const Icon = iconsByType[ type ];\n\n return (\n <div\n class=\"fjs-palette-field fjs-drag-copy fjs-no-drop\"\n data-field-type={ type }\n title={ `Create a ${ label } element` }\n >\n {\n Icon ? <Icon class=\"fjs-palette-field-icon\" width=\"36\" height=\"36\" viewBox=\"0 0 54 54\" /> : null\n }\n <span class=\"fjs-palette-field-text\">{ label }</span>\n </div>\n );\n })\n }\n </div>\n </div>;\n}","import Palette from './components/Palette';\n\nimport {\n render\n} from 'preact';\n\nimport {\n domify,\n query as domQuery\n} from 'min-dom';\n\n\n/**\n * @typedef { { parent: Element } } PaletteConfig\n * @typedef { import('../../core/EventBus').default } EventBus\n */\n\n/**\n * @param {PaletteConfig} paletteConfig\n * @param {EventBus} eventBus\n */\nexport default class PaletteRenderer {\n\n constructor(paletteConfig, eventBus) {\n const {\n parent\n } = paletteConfig || {};\n\n this._eventBus = eventBus;\n\n this._container = domify('<div class=\"fjs-palette-container\"></div>');\n\n if (parent) {\n this.attachTo(parent);\n }\n\n this._eventBus.once('formEditor.rendered', 500, () => {\n this._render();\n });\n }\n\n\n /**\n * Attach the palette to a parent node.\n *\n * @param {HTMLElement} container\n */\n attachTo(container) {\n if (!container) {\n throw new Error('container required');\n }\n\n if (typeof container === 'string') {\n container = domQuery(container);\n }\n\n // (1) detach from old parent\n this.detach();\n\n // (2) append to parent container\n container.appendChild(this._container);\n\n // (3) notify interested parties\n this._eventBus.fire('palette.attach');\n }\n\n /**\n * Detach the palette from its parent node.\n */\n detach() {\n const parentNode = this._container.parentNode;\n\n if (parentNode) {\n parentNode.removeChild(this._container);\n\n this._eventBus.fire('palette.detach');\n }\n }\n\n _render() {\n render(\n <Palette />,\n this._container\n );\n\n this._eventBus.fire('palette.rendered');\n }\n\n _destroy() {\n if (this._container) {\n render(null, this._container);\n\n this._eventBus.fire('palette.destroyed');\n }\n }\n}\n\nPaletteRenderer.$inject = [ 'config.palette', 'eventBus' ];","import PaletteRenderer from './PaletteRenderer';\n\nexport default {\n palette: [ 'type', PaletteRenderer ]\n};\n","import { useContext, useRef, useEffect, useMemo, useState, useCallback } from '../preact/hooks';\nimport { isFunction, isArray, get, assign, set, sortBy, find, isNumber, debounce } from 'min-dash';\nimport classnames from 'classnames';\nimport { forwardRef } from '../preact/compat';\nimport { jsx, jsxs } from '../preact/jsx-runtime';\nimport { query } from 'min-dom';\nimport { createContext, createElement } from '../preact';\nimport FeelEditor from '@bpmn-io/feel-editor';\n\nvar ArrowIcon = function ArrowIcon(props) {\n return jsx(\"svg\", {\n ...props,\n children: jsx(\"path\", {\n fillRule: \"evenodd\",\n d: \"m11.657 8-4.95 4.95a1 1 0 0 1-1.414-1.414L8.828 8 5.293 4.464A1 1 0 1 1 6.707 3.05L11.657 8Z\"\n })\n });\n};\nArrowIcon.defaultProps = {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"16\",\n height: \"16\"\n};\nvar CreateIcon = function CreateIcon(props) {\n return jsx(\"svg\", {\n ...props,\n children: jsx(\"path\", {\n fillRule: \"evenodd\",\n d: \"M9 13V9h4a1 1 0 0 0 0-2H9V3a1 1 0 1 0-2 0v4H3a1 1 0 1 0 0 2h4v4a1 1 0 0 0 2 0Z\"\n })\n });\n};\nCreateIcon.defaultProps = {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"16\",\n height: \"16\"\n};\nvar DeleteIcon = function DeleteIcon(props) {\n return jsx(\"svg\", {\n ...props,\n children: jsx(\"path\", {\n fillRule: \"evenodd\",\n d: \"M12 6v7c0 1.1-.4 1.55-1.5 1.55h-5C4.4 14.55 4 14.1 4 13V6h8Zm-1.5 1.5h-5v4.3c0 .66.5 1.2 1.111 1.2H9.39c.611 0 1.111-.54 1.111-1.2V7.5ZM13 3h-2l-1-1H6L5 3H3v1.5h10V3Z\"\n })\n });\n};\nDeleteIcon.defaultProps = {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"16\",\n height: \"16\"\n};\nvar ExternalLinkIcon = function ExternalLinkIcon(props) {\n return jsx(\"svg\", {\n ...props,\n children: jsx(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M12.637 12.637v-4.72h1.362v4.721c0 .36-.137.676-.411.95-.275.275-.591.412-.95.412H3.362c-.38 0-.703-.132-.967-.396A1.315 1.315 0 0 1 2 12.638V3.362c0-.38.132-.703.396-.967S2.982 2 3.363 2h4.553v1.363H3.363v9.274h9.274ZM14 2H9.28l-.001 1.362h2.408L5.065 9.984l.95.95 6.622-6.622v2.409H14V2Z\",\n fill: \"#818798\"\n })\n });\n};\nExternalLinkIcon.defaultProps = {\n width: \"16\",\n height: \"16\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n};\nvar FeelRequiredIcon = function FeelRequiredIcon(props) {\n return jsxs(\"svg\", {\n ...props,\n children: [jsx(\"path\", {\n d: \"M5.8 7.06V5.95h4.307v1.11H5.8Zm0 3.071v-1.11h4.307v1.11H5.8Z\",\n fill: \"currentColor\"\n }), jsx(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M8 3.268A4.732 4.732 0 1 0 12.732 8H14a6 6 0 1 1-6-6v1.268Z\",\n fill: \"currentColor\"\n }), jsx(\"path\", {\n d: \"m11.28 6.072-.832-.56 1.016-1.224L10 3.848l.312-.912 1.392.584L11.632 2h1.032l-.072 1.52 1.392-.584.312.912-1.464.44 1.008 1.224-.832.552-.864-1.296-.864 1.304Z\",\n fill: \"currentColor\"\n })]\n });\n};\nFeelRequiredIcon.defaultProps = {\n viewBox: \"0 0 16 16\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n};\nvar FeelOptionalIcon = function FeelOptionalIcon(props) {\n return jsxs(\"svg\", {\n ...props,\n children: [jsx(\"path\", {\n d: \"M5.845 7.04V5.93h4.307v1.11H5.845Zm0 3.07V9h4.307v1.11H5.845Z\",\n fill: \"currentColor\"\n }), jsx(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M3.286 8a4.714 4.714 0 1 0 9.428 0 4.714 4.714 0 0 0-9.428 0ZM8 2a6 6 0 1 0 0 12A6 6 0 0 0 8 2Z\",\n fill: \"currentColor\"\n })]\n });\n};\nFeelOptionalIcon.defaultProps = {\n viewBox: \"0 0 16 16\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n};\n\nfunction Header(props) {\n const {\n element,\n headerProvider\n } = props;\n const {\n getElementIcon,\n getDocumentationRef,\n getElementLabel,\n getTypeLabel\n } = headerProvider;\n const label = getElementLabel(element);\n const type = getTypeLabel(element);\n const documentationRef = getDocumentationRef && getDocumentationRef(element);\n const ElementIcon = getElementIcon(element);\n return jsxs(\"div\", {\n class: \"bio-properties-panel-header\",\n children: [jsx(\"div\", {\n class: \"bio-properties-panel-header-icon\",\n children: ElementIcon && jsx(ElementIcon, {\n width: \"32\",\n height: \"32\",\n viewBox: \"0 0 32 32\"\n })\n }), jsxs(\"div\", {\n class: \"bio-properties-panel-header-labels\",\n children: [jsx(\"div\", {\n title: type,\n class: \"bio-properties-panel-header-type\",\n children: type\n }), label ? jsx(\"div\", {\n title: label,\n class: \"bio-properties-panel-header-label\",\n children: label\n }) : null]\n }), jsx(\"div\", {\n class: \"bio-properties-panel-header-actions\",\n children: documentationRef ? jsx(\"a\", {\n rel: \"noopener\",\n class: \"bio-properties-panel-header-link\",\n href: documentationRef,\n title: \"Open documentation\",\n target: \"_blank\",\n children: jsx(ExternalLinkIcon, {})\n }) : null\n })]\n });\n}\n\nconst DescriptionContext = createContext({\n description: {},\n getDescriptionForId: () => {}\n});\n\nconst ErrorsContext = createContext({\n errors: {}\n});\n\n/**\n * @typedef {Function} <propertiesPanel.showEntry> callback\n *\n * @example\n *\n * useEvent('propertiesPanel.showEntry', ({ focus = false, ...rest }) => {\n * // ...\n * });\n *\n * @param {Object} context\n * @param {boolean} [context.focus]\n *\n * @returns void\n */\nconst EventContext = createContext({\n eventBus: null\n});\n\nconst LayoutContext = createContext({\n layout: {},\n setLayout: () => {},\n getLayoutForKey: () => {},\n setLayoutForKey: () => {}\n});\n\n/**\n * Accesses the global DescriptionContext and returns a description for a given id and element.\n *\n * @example\n * ```jsx\n * function TextField(props) {\n * const description = useDescriptionContext('input1', element);\n * }\n * ```\n *\n * @param {string} id\n * @param {object} element\n *\n * @returns {string}\n */\nfunction useDescriptionContext(id, element) {\n const {\n getDescriptionForId\n } = useContext(DescriptionContext);\n return getDescriptionForId(id, element);\n}\n\nfunction useError(id) {\n const {\n errors\n } = useContext(ErrorsContext);\n return errors[id];\n}\n\n/**\n * Subscribe to an event immediately. Update subscription after inputs changed.\n *\n * @param {string} event\n * @param {Function} callback\n */\nfunction useEvent(event, callback, eventBus) {\n const eventContext = useContext(EventContext);\n if (!eventBus) {\n ({\n eventBus\n } = eventContext);\n }\n const didMount = useRef(false);\n\n // (1) subscribe immediately\n if (eventBus && !didMount.current) {\n eventBus.on(event, callback);\n }\n\n // (2) update subscription after inputs changed\n useEffect(() => {\n if (eventBus && didMount.current) {\n eventBus.on(event, callback);\n }\n didMount.current = true;\n return () => {\n if (eventBus) {\n eventBus.off(event, callback);\n }\n };\n }, [callback, event, eventBus]);\n}\n\nconst KEY_LENGTH = 6;\n\n/**\n * Create a persistent key factory for plain objects without id.\n *\n * @example\n * ```jsx\n * function List({ objects }) {\n * const getKey = useKeyFactory();\n * return (<ol>{\n * objects.map(obj => {\n * const key = getKey(obj);\n * return <li key={key}>obj.name</li>\n * })\n * }</ol>);\n * }\n * ```\n *\n * @param {any[]} dependencies\n * @returns {(element: object) => string}\n */\nfunction useKeyFactory(dependencies = []) {\n const map = useMemo(() => new Map(), dependencies);\n const getKey = el => {\n let key = map.get(el);\n if (!key) {\n key = Math.random().toString().slice(-KEY_LENGTH);\n map.set(el, key);\n }\n return key;\n };\n return getKey;\n}\n\n/**\n * Creates a state that persists in the global LayoutContext.\n *\n * @example\n * ```jsx\n * function Group(props) {\n * const [ open, setOpen ] = useLayoutState([ 'groups', 'foo', 'open' ], false);\n * }\n * ```\n *\n * @param {(string|number)[]} path\n * @param {any} [defaultValue]\n *\n * @returns {[ any, Function ]}\n */\nfunction useLayoutState(path, defaultValue) {\n const {\n getLayoutForKey,\n setLayoutForKey\n } = useContext(LayoutContext);\n const layoutForKey = getLayoutForKey(path, defaultValue);\n const [value, set] = useState(layoutForKey);\n const setState = newValue => {\n // (1) set component state\n set(newValue);\n\n // (2) set context\n setLayoutForKey(path, newValue);\n };\n return [value, setState];\n}\n\n/**\n * @pinussilvestrus: we need to introduce our own hook to persist the previous\n * state on updates.\n *\n * cf. https://reactjs.org/docs/hooks-faq.html#how-to-get-the-previous-props-or-state\n */\n\nfunction usePrevious(value) {\n const ref = useRef();\n useEffect(() => {\n ref.current = value;\n });\n return ref.current;\n}\n\n/**\n * Subscribe to `propertiesPanel.showEntry`.\n *\n * @param {string} id\n *\n * @returns {import('preact').Ref}\n */\nfunction useShowEntryEvent(id) {\n const {\n onShow\n } = useContext(LayoutContext);\n const ref = useRef();\n const focus = useRef(false);\n const onShowEntry = useCallback(event => {\n if (event.id === id) {\n onShow();\n if (!focus.current) {\n focus.current = true;\n }\n }\n }, [id]);\n useEffect(() => {\n if (focus.current && ref.current) {\n if (isFunction(ref.current.focus)) {\n ref.current.focus();\n }\n if (isFunction(ref.current.select)) {\n ref.current.select();\n }\n focus.current = false;\n }\n });\n useEvent('propertiesPanel.showEntry', onShowEntry);\n return ref;\n}\n\n/**\n * @callback setSticky\n * @param {boolean} value\n */\n\n/**\n * Use IntersectionObserver to identify when DOM element is in sticky mode.\n * If sticky is observered setSticky(true) will be called.\n * If sticky mode is left, setSticky(false) will be called.\n *\n *\n * @param {Object} ref\n * @param {string} scrollContainerSelector\n * @param {setSticky} setSticky\n */\nfunction useStickyIntersectionObserver(ref, scrollContainerSelector, setSticky) {\n useEffect(() => {\n const Observer = IntersectionObserver;\n\n // return early if IntersectionObserver is not available\n if (!Observer) {\n return;\n }\n let observer;\n if (ref.current) {\n const scrollContainer = query(scrollContainerSelector);\n observer = new Observer(entries => {\n entries.forEach(entry => {\n if (entry.intersectionRatio < 1) {\n setSticky(true);\n } else if (entry.intersectionRatio === 1) {\n setSticky(false);\n }\n });\n }, {\n root: scrollContainer,\n rootMargin: '0px 0px 999999% 0px',\n // Use bottom margin to avoid stickyness when scrolling out to bottom\n threshold: [1]\n });\n observer.observe(ref.current);\n }\n\n // Unobserve if unmounted\n return () => {\n if (ref.current && observer) {\n observer.unobserve(ref.current);\n }\n };\n }, [ref, scrollContainerSelector, setSticky]);\n}\n\n/**\n * Creates a static function reference with changing body.\n * This is necessary when external libraries require a callback function\n * that has references to state variables.\n *\n * Usage:\n * const callback = useStaticCallback((val) => {val === currentState});\n *\n * The `callback` reference is static and can be safely used in external\n * libraries or as a prop that does not cause rerendering of children.\n *\n * @param {Function} callback function with changing reference\n * @returns {Function} static function reference\n */\nfunction useStaticCallback(callback) {\n const callbackRef = useRef(callback);\n callbackRef.current = callback;\n return useCallback((...args) => callbackRef.current(...args), []);\n}\n\nfunction Group(props) {\n const {\n element,\n entries = [],\n id,\n label,\n shouldOpen = false\n } = props;\n const groupRef = useRef(null);\n const [open, setOpen] = useLayoutState(['groups', id, 'open'], shouldOpen);\n const onShow = useCallback(() => setOpen(true), [setOpen]);\n const toggleOpen = () => setOpen(!open);\n const [edited, setEdited] = useState(false);\n const [sticky, setSticky] = useState(false);\n\n // set edited state depending on all entries\n useEffect(() => {\n const hasOneEditedEntry = entries.find(entry => {\n const {\n id,\n isEdited\n } = entry;\n const entryNode = query(`[data-entry-id=\"${id}\"]`);\n if (!isFunction(isEdited) || !entryNode) {\n return false;\n }\n const inputNode = query('.bio-properties-panel-input', entryNode);\n return isEdited(inputNode);\n });\n setEdited(hasOneEditedEntry);\n }, [entries]);\n\n // set css class when group is sticky to top\n useStickyIntersectionObserver(groupRef, 'div.bio-properties-panel-scroll-container', setSticky);\n const propertiesPanelContext = {\n ...useContext(LayoutContext),\n onShow\n };\n return jsxs(\"div\", {\n class: \"bio-properties-panel-group\",\n \"data-group-id\": 'group-' + id,\n ref: groupRef,\n children: [jsxs(\"div\", {\n class: classnames('bio-properties-panel-group-header', edited ? '' : 'empty', open ? 'open' : '', sticky && open ? 'sticky' : ''),\n onClick: toggleOpen,\n children: [jsx(\"div\", {\n title: label,\n class: \"bio-properties-panel-group-header-title\",\n children: label\n }), jsxs(\"div\", {\n class: \"bio-properties-panel-group-header-buttons\",\n children: [edited && jsx(DataMarker, {}), jsx(\"button\", {\n title: \"Toggle section\",\n class: \"bio-properties-panel-group-header-button bio-properties-panel-arrow\",\n children: jsx(ArrowIcon, {\n class: open ? 'bio-properties-panel-arrow-down' : 'bio-properties-panel-arrow-right'\n })\n })]\n })]\n }), jsx(\"div\", {\n class: classnames('bio-properties-panel-group-entries', open ? 'open' : ''),\n children: jsx(LayoutContext.Provider, {\n value: propertiesPanelContext,\n children: entries.map(entry => {\n const {\n component: Component,\n id\n } = entry;\n return createElement(Component, {\n ...entry,\n element: element,\n key: id\n });\n })\n })\n })]\n });\n}\nfunction DataMarker() {\n return jsx(\"div\", {\n title: \"Section contains data\",\n class: \"bio-properties-panel-dot\"\n });\n}\n\n/**\n * @typedef { {\n * text: (element: object) => string,\n * icon?: (element: Object) => import('preact').Component\n * } } PlaceholderDefinition\n *\n * @param { PlaceholderDefinition } props\n */\nfunction Placeholder(props) {\n const {\n text,\n icon: Icon\n } = props;\n return jsx(\"div\", {\n class: \"bio-properties-panel open\",\n children: jsxs(\"section\", {\n class: \"bio-properties-panel-placeholder\",\n children: [Icon && jsx(Icon, {\n class: \"bio-properties-panel-placeholder-icon\"\n }), jsx(\"p\", {\n class: \"bio-properties-panel-placeholder-text\",\n children: text\n })]\n })\n });\n}\n\nconst DEFAULT_LAYOUT = {\n open: true\n};\nconst DEFAULT_DESCRIPTION = {};\n\n/**\n * @typedef { {\n * component: import('preact').Component,\n * id: String,\n * isEdited?: Function\n * } } EntryDefinition\n *\n * @typedef { {\n * autoFocusEntry: String,\n * autoOpen?: Boolean,\n * entries: Array<EntryDefinition>,\n * id: String,\n * label: String,\n * remove: (event: MouseEvent) => void\n * } } ListItemDefinition\n *\n * @typedef { {\n * add: (event: MouseEvent) => void,\n * component: import('preact').Component,\n * element: Object,\n * id: String,\n * items: Array<ListItemDefinition>,\n * label: String,\n * shouldSort?: Boolean,\n * shouldOpen?: Boolean\n * } } ListGroupDefinition\n *\n * @typedef { {\n * component?: import('preact').Component,\n * entries: Array<EntryDefinition>,\n * id: String,\n * label: String,\n * shouldOpen?: Boolean\n * } } GroupDefinition\n *\n * @typedef { {\n * [id: String]: GetDescriptionFunction\n * } } DescriptionConfig\n *\n * @callback { {\n * @param {string} id\n * @param {Object} element\n * @returns {string}\n * } } GetDescriptionFunction\n *\n * @typedef { {\n * getEmpty: (element: object) => import('./components/Placeholder').PlaceholderDefinition,\n * getMultiple: (element: Object) => import('./components/Placeholder').PlaceholderDefinition\n * } } PlaceholderProvider\n *\n */\n\n/**\n * A basic properties panel component. Describes *how* content will be rendered, accepts\n * data from implementor to describe *what* will be rendered.\n *\n * @param {Object} props\n * @param {Object|Array} props.element\n * @param {import('./components/Header').HeaderProvider} props.headerProvider\n * @param {PlaceholderProvider} [props.placeholderProvider]\n * @param {Array<GroupDefinition|ListGroupDefinition>} props.groups\n * @param {Object} [props.layoutConfig]\n * @param {Function} [props.layoutChanged]\n * @param {DescriptionConfig} [props.descriptionConfig]\n * @param {Function} [props.descriptionLoaded]\n * @param {Object} [props.eventBus]\n */\nfunction PropertiesPanel(props) {\n const {\n element,\n headerProvider,\n placeholderProvider,\n groups,\n layoutConfig = {},\n layoutChanged,\n descriptionConfig = {},\n descriptionLoaded,\n eventBus\n } = props;\n\n // set-up layout context\n const [layout, setLayout] = useState(createLayout(layoutConfig));\n useEffect(() => {\n if (typeof layoutChanged === 'function') {\n layoutChanged(layout);\n }\n }, [layout, layoutChanged]);\n const getLayoutForKey = (key, defaultValue) => {\n return get(layout, key, defaultValue);\n };\n const setLayoutForKey = (key, config) => {\n const newLayout = assign({}, layout);\n set(newLayout, key, config);\n setLayout(newLayout);\n };\n const layoutContext = {\n layout,\n setLayout,\n getLayoutForKey,\n setLayoutForKey\n };\n\n // set-up description context\n const description = createDescriptionContext(descriptionConfig);\n if (typeof descriptionLoaded === 'function') {\n descriptionLoaded(description);\n }\n const getDescriptionForId = (id, element) => {\n return description[id] && description[id](element);\n };\n const descriptionContext = {\n description,\n getDescriptionForId\n };\n const [errors, setErrors] = useState({});\n const onSetErrors = ({\n errors\n }) => setErrors(errors);\n useEvent('propertiesPanel.setErrors', onSetErrors, eventBus);\n const errorsContext = {\n errors\n };\n const eventContext = {\n eventBus\n };\n const propertiesPanelContext = {\n element\n };\n\n // empty state\n if (placeholderProvider && !element) {\n return jsx(Placeholder, {\n ...placeholderProvider.getEmpty()\n });\n }\n\n // multiple state\n if (placeholderProvider && isArray(element)) {\n return jsx(Placeholder, {\n ...placeholderProvider.getMultiple()\n });\n }\n return jsx(LayoutContext.Provider, {\n value: propertiesPanelContext,\n children: jsx(ErrorsContext.Provider, {\n value: errorsContext,\n children: jsx(DescriptionContext.Provider, {\n value: descriptionContext,\n children: jsx(LayoutContext.Provider, {\n value: layoutContext,\n children: jsx(EventContext.Provider, {\n value: eventContext,\n children: jsxs(\"div\", {\n class: classnames('bio-properties-panel', layout.open ? 'open' : ''),\n children: [jsx(Header, {\n element: element,\n headerProvider: headerProvider\n }), jsx(\"div\", {\n class: \"bio-properties-panel-scroll-container\",\n children: groups.map(group => {\n const {\n component: Component = Group,\n id\n } = group;\n return createElement(Component, {\n ...group,\n key: id,\n element: element\n });\n })\n })]\n })\n })\n })\n })\n })\n });\n}\n\n// helpers //////////////////\n\nfunction createLayout(overrides) {\n return {\n ...DEFAULT_LAYOUT,\n ...overrides\n };\n}\nfunction createDescriptionContext(overrides) {\n return {\n ...DEFAULT_DESCRIPTION,\n ...overrides\n };\n}\n\nfunction DropdownButton(props) {\n const {\n class: className,\n children,\n menuItems = []\n } = props;\n const dropdownRef = useRef(null);\n const menuRef = useRef(null);\n const [open, setOpen] = useState(false);\n const close = () => setOpen(false);\n function onDropdownToggle(event) {\n if (menuRef.current && menuRef.current.contains(event.target)) {\n return;\n }\n event.stopPropagation();\n setOpen(open => !open);\n }\n function onActionClick(event, action) {\n event.stopPropagation();\n close();\n action();\n }\n useGlobalClick([dropdownRef.current], () => close());\n return jsxs(\"div\", {\n class: classnames('bio-properties-panel-dropdown-button', {\n open\n }, className),\n onClick: onDropdownToggle,\n ref: dropdownRef,\n children: [children, jsx(\"div\", {\n class: \"bio-properties-panel-dropdown-button__menu\",\n ref: menuRef,\n children: menuItems.map((item, index) => jsx(MenuItem, {\n onClick: onActionClick,\n item: item\n }, index))\n })]\n });\n}\nfunction MenuItem({\n item,\n onClick\n}) {\n if (item.separator) {\n return jsx(\"div\", {\n class: \"bio-properties-panel-dropdown-button__menu-item bio-properties-panel-dropdown-button__menu-item--separator\"\n });\n }\n if (item.action) {\n return jsx(\"button\", {\n class: \"bio-properties-panel-dropdown-button__menu-item bio-properties-panel-dropdown-button__menu-item--actionable\",\n onClick: event => onClick(event, item.action),\n children: item.entry\n });\n }\n return jsx(\"div\", {\n class: \"bio-properties-panel-dropdown-button__menu-item\",\n children: item.entry\n });\n}\n\n/**\n *\n * @param {Array<null | Element>} ignoredElements\n * @param {Function} callback\n */\nfunction useGlobalClick(ignoredElements, callback) {\n useEffect(() => {\n /**\n * @param {MouseEvent} event\n */\n function listener(event) {\n if (ignoredElements.some(element => element && element.contains(event.target))) {\n return;\n }\n callback();\n }\n document.addEventListener('click', listener, {\n capture: true\n });\n return () => document.removeEventListener('click', listener, {\n capture: true\n });\n }, [...ignoredElements, callback]);\n}\n\nfunction HeaderButton(props) {\n const {\n children = null,\n class: classname,\n onClick = () => {},\n ...otherProps\n } = props;\n return jsx(\"button\", {\n ...otherProps,\n onClick: onClick,\n class: classnames('bio-properties-panel-group-header-button', classname),\n children: children\n });\n}\n\nfunction CollapsibleEntry(props) {\n const {\n element,\n entries = [],\n id,\n label,\n open: shouldOpen,\n remove\n } = props;\n const [open, setOpen] = useState(shouldOpen);\n const toggleOpen = () => setOpen(!open);\n const {\n onShow\n } = useContext(LayoutContext);\n const propertiesPanelContext = {\n ...useContext(LayoutContext),\n onShow: useCallback(() => {\n setOpen(true);\n if (isFunction(onShow)) {\n onShow();\n }\n }, [onShow, setOpen])\n };\n\n // todo(pinussilvestrus): translate once we have a translate mechanism for the core\n const placeholderLabel = '<empty>';\n return jsxs(\"div\", {\n \"data-entry-id\": id,\n class: classnames('bio-properties-panel-collapsible-entry', open ? 'open' : ''),\n children: [jsxs(\"div\", {\n class: \"bio-properties-panel-collapsible-entry-header\",\n onClick: toggleOpen,\n children: [jsx(\"div\", {\n title: label || placeholderLabel,\n class: classnames('bio-properties-panel-collapsible-entry-header-title', !label && 'empty'),\n children: label || placeholderLabel\n }), jsx(\"button\", {\n title: \"Toggle list item\",\n class: \"bio-properties-panel-arrow bio-properties-panel-collapsible-entry-arrow\",\n children: jsx(ArrowIcon, {\n class: open ? 'bio-properties-panel-arrow-down' : 'bio-properties-panel-arrow-right'\n })\n }), remove ? jsx(\"button\", {\n title: \"Delete item\",\n class: \"bio-properties-panel-remove-entry\",\n onClick: remove,\n children: jsx(DeleteIcon, {})\n }) : null]\n }), jsx(\"div\", {\n class: classnames('bio-properties-panel-collapsible-entry-entries', open ? 'open' : ''),\n children: jsx(LayoutContext.Provider, {\n value: propertiesPanelContext,\n children: entries.map(entry => {\n const {\n component: Component,\n id\n } = entry;\n return createElement(Component, {\n ...entry,\n element: element,\n key: id\n });\n })\n })\n })]\n });\n}\n\nfunction ListItem(props) {\n const {\n autoFocusEntry,\n autoOpen\n } = props;\n\n // focus specified entry on auto open\n useEffect(() => {\n if (autoOpen && autoFocusEntry) {\n const entry = query(`[data-entry-id=\"${autoFocusEntry}\"]`);\n const focusableInput = query('.bio-properties-panel-input', entry);\n if (focusableInput) {\n if (isFunction(focusableInput.select)) {\n focusableInput.select();\n } else if (isFunction(focusableInput.focus)) {\n focusableInput.focus();\n }\n }\n }\n }, [autoOpen, autoFocusEntry]);\n return jsx(\"div\", {\n class: \"bio-properties-panel-list-item\",\n children: jsx(CollapsibleEntry, {\n ...props,\n open: autoOpen\n })\n });\n}\n\nconst noop$2 = () => {};\n\n/**\n * @param {import('../PropertiesPanel').ListGroupDefinition} props\n */\nfunction ListGroup(props) {\n const {\n add,\n element,\n id,\n items,\n label,\n shouldOpen = true,\n shouldSort = true\n } = props;\n const groupRef = useRef(null);\n const [open, setOpen] = useLayoutState(['groups', id, 'open'], false);\n const [sticky, setSticky] = useState(false);\n const onShow = useCallback(() => setOpen(true), [setOpen]);\n const [ordering, setOrdering] = useState([]);\n const [newItemAdded, setNewItemAdded] = useState(false);\n const prevItems = usePrevious(items);\n const prevElement = usePrevious(element);\n const elementChanged = element !== prevElement;\n const shouldHandleEffects = !elementChanged && (shouldSort || shouldOpen);\n\n // reset initial ordering when element changes (before first render)\n if (elementChanged) {\n setOrdering(createOrdering(shouldSort ? sortItems(items) : items));\n }\n\n // keep ordering in sync to items - and open changes\n\n // (0) set initial ordering from given items\n useEffect(() => {\n if (!prevItems || !shouldSort) {\n setOrdering(createOrdering(items));\n }\n }, [items, element]);\n\n // (1) items were added\n useEffect(() => {\n if (shouldHandleEffects && prevItems && items.length > prevItems.length) {\n let add = [];\n items.forEach(item => {\n if (!ordering.includes(item.id)) {\n add.push(item.id);\n }\n });\n let newOrdering = ordering;\n\n // open if not open and configured\n if (!open && shouldOpen) {\n toggleOpen();\n\n // if I opened and I should sort, then sort items\n if (shouldSort) {\n newOrdering = createOrdering(sortItems(items));\n }\n }\n\n // add new items on top or bottom depending on sorting behavior\n newOrdering = newOrdering.filter(item => !add.includes(item));\n if (shouldSort) {\n newOrdering.unshift(...add);\n } else {\n newOrdering.push(...add);\n }\n setOrdering(newOrdering);\n setNewItemAdded(true);\n } else {\n setNewItemAdded(false);\n }\n }, [items, open, shouldHandleEffects]);\n\n // (2) sort items on open if shouldSort is set\n useEffect(() => {\n if (shouldSort && open && !newItemAdded) {\n setOrdering(createOrdering(sortItems(items)));\n }\n }, [open, shouldSort]);\n\n // (3) items were deleted\n useEffect(() => {\n if (shouldHandleEffects && prevItems && items.length < prevItems.length) {\n let keep = [];\n ordering.forEach(o => {\n if (getItem(items, o)) {\n keep.push(o);\n }\n });\n setOrdering(keep);\n }\n }, [items, shouldHandleEffects]);\n\n // set css class when group is sticky to top\n useStickyIntersectionObserver(groupRef, 'div.bio-properties-panel-scroll-container', setSticky);\n const toggleOpen = () => setOpen(!open);\n const hasItems = !!items.length;\n const propertiesPanelContext = {\n ...useContext(LayoutContext),\n onShow\n };\n return jsxs(\"div\", {\n class: \"bio-properties-panel-group\",\n \"data-group-id\": 'group-' + id,\n ref: groupRef,\n children: [jsxs(\"div\", {\n class: classnames('bio-properties-panel-group-header', hasItems ? '' : 'empty', hasItems && open ? 'open' : '', sticky && open ? 'sticky' : ''),\n onClick: hasItems ? toggleOpen : noop$2,\n children: [jsx(\"div\", {\n title: label,\n class: \"bio-properties-panel-group-header-title\",\n children: label\n }), jsxs(\"div\", {\n class: \"bio-properties-panel-group-header-buttons\",\n children: [add ? jsxs(\"button\", {\n title: \"Create new list item\",\n class: \"bio-properties-panel-group-header-button bio-properties-panel-add-entry\",\n onClick: add,\n children: [jsx(CreateIcon, {}), !hasItems ? jsx(\"span\", {\n class: \"bio-properties-panel-add-entry-label\",\n children: \"Create\"\n }) : null]\n }) : null, hasItems ? jsx(\"div\", {\n title: `List contains ${items.length} item${items.length != 1 ? 's' : ''}`,\n class: \"bio-properties-panel-list-badge\",\n children: items.length\n }) : null, hasItems ? jsx(\"button\", {\n title: \"Toggle section\",\n class: \"bio-properties-panel-group-header-button bio-properties-panel-arrow\",\n children: jsx(ArrowIcon, {\n class: open ? 'bio-properties-panel-arrow-down' : 'bio-properties-panel-arrow-right'\n })\n }) : null]\n })]\n }), jsx(\"div\", {\n class: classnames('bio-properties-panel-list', open && hasItems ? 'open' : ''),\n children: jsx(LayoutContext.Provider, {\n value: propertiesPanelContext,\n children: ordering.map((o, index) => {\n const item = getItem(items, o);\n if (!item) {\n return;\n }\n const {\n id\n } = item;\n\n // if item was added, open first or last item based on ordering\n const autoOpen = newItemAdded && (shouldSort ? index === 0 : index === ordering.length - 1);\n return createElement(ListItem, {\n ...item,\n autoOpen: autoOpen,\n element: element,\n index: index,\n key: id\n });\n })\n })\n })]\n });\n}\n\n// helpers ////////////////////\n\n/**\n * Sorts given items alphanumeric by label\n */\nfunction sortItems(items) {\n return sortBy(items, i => i.label.toLowerCase());\n}\nfunction getItem(items, id) {\n return find(items, i => i.id === id);\n}\nfunction createOrdering(items) {\n return items.map(i => i.id);\n}\n\nfunction Description(props) {\n const {\n element,\n forId,\n value\n } = props;\n const contextDescription = useDescriptionContext(forId, element);\n const description = value || contextDescription;\n if (description) {\n return jsx(\"div\", {\n class: \"bio-properties-panel-description\",\n children: description\n });\n }\n}\n\nfunction Checkbox(props) {\n const {\n id,\n label,\n onChange,\n disabled,\n value = false,\n onFocus,\n onBlur\n } = props;\n const [localValue, setLocalValue] = useState(value);\n const handleChangeCallback = ({\n target\n }) => {\n onChange(target.checked);\n };\n const handleChange = e => {\n handleChangeCallback(e);\n setLocalValue(e.target.value);\n };\n useEffect(() => {\n if (value === localValue) {\n return;\n }\n setLocalValue(value);\n }, [value]);\n const ref = useShowEntryEvent(id);\n return jsxs(\"div\", {\n class: \"bio-properties-panel-checkbox\",\n children: [jsx(\"input\", {\n ref: ref,\n id: prefixId$7(id),\n name: id,\n onFocus: onFocus,\n onBlur: onBlur,\n type: \"checkbox\",\n class: \"bio-properties-panel-input\",\n onChange: handleChange,\n checked: localValue,\n disabled: disabled\n }), jsx(\"label\", {\n for: prefixId$7(id),\n class: \"bio-properties-panel-label\",\n children: label\n })]\n });\n}\n\n/**\n * @param {Object} props\n * @param {Object} props.element\n * @param {String} props.id\n * @param {String} props.description\n * @param {String} props.label\n * @param {Function} props.getValue\n * @param {Function} props.setValue\n * @param {Function} props.onFocus\n * @param {Function} props.onBlur\n * @param {boolean} [props.disabled]\n */\nfunction CheckboxEntry(props) {\n const {\n element,\n id,\n description,\n label,\n getValue,\n setValue,\n disabled,\n onFocus,\n onBlur\n } = props;\n const value = getValue(element);\n const error = useError(id);\n return jsxs(\"div\", {\n class: \"bio-properties-panel-entry bio-properties-panel-checkbox-entry\",\n \"data-entry-id\": id,\n children: [jsx(Checkbox, {\n disabled: disabled,\n id: id,\n label: label,\n onChange: setValue,\n onFocus: onFocus,\n onBlur: onBlur,\n value: value\n }, element), error && jsx(\"div\", {\n class: \"bio-properties-panel-error\",\n children: error\n }), jsx(Description, {\n forId: id,\n element: element,\n value: description\n })]\n });\n}\nfunction isEdited$7(node) {\n return node && !!node.checked;\n}\n\n// helpers /////////////////\n\nfunction prefixId$7(id) {\n return `bio-properties-panel-${id}`;\n}\n\nconst useBufferedFocus = function (editor, ref) {\n const [buffer, setBuffer] = useState(undefined);\n ref.current = useMemo(() => ({\n focus: offset => {\n if (editor) {\n editor.focus(offset);\n } else {\n if (typeof offset === 'undefined') {\n offset = Infinity;\n }\n setBuffer(offset);\n }\n }\n }), [editor]);\n useEffect(() => {\n if (typeof buffer !== 'undefined' && editor) {\n editor.focus(buffer);\n setBuffer(false);\n }\n }, [editor, buffer]);\n};\nconst CodeEditor = forwardRef((props, ref) => {\n const {\n value,\n onInput,\n onFeelToggle,\n onLint = () => {},\n disabled,\n tooltipContainer,\n variables\n } = props;\n const inputRef = useRef();\n const [editor, setEditor] = useState();\n const [localValue, setLocalValue] = useState(value || '');\n useBufferedFocus(editor, ref);\n const handleInput = useStaticCallback(newValue => {\n onInput(newValue);\n setLocalValue(newValue);\n });\n useEffect(() => {\n let editor;\n\n /* Trigger FEEL toggle when\n *\n * - `backspace` is pressed\n * - AND the cursor is at the beginning of the input\n */\n const onKeyDown = e => {\n if (e.key !== 'Backspace' || !editor) {\n return;\n }\n const selection = editor.getSelection();\n const range = selection.ranges[selection.mainIndex];\n if (range.from === 0 && range.to === 0) {\n onFeelToggle();\n }\n };\n editor = new FeelEditor({\n container: inputRef.current,\n onChange: handleInput,\n onKeyDown: onKeyDown,\n onLint: onLint,\n tooltipContainer: tooltipContainer,\n value: localValue,\n variables: variables\n });\n setEditor(editor);\n return () => {\n onLint([]);\n inputRef.current.innerHTML = '';\n setEditor(null);\n };\n }, []);\n useEffect(() => {\n if (!editor) {\n return;\n }\n if (value === localValue) {\n return;\n }\n editor.setValue(value);\n setLocalValue(value);\n }, [value]);\n useEffect(() => {\n if (!editor) {\n return;\n }\n editor.setVariables(variables);\n }, [variables]);\n const handleClick = () => {\n ref.current.focus();\n };\n return jsx(\"div\", {\n class: classnames('bio-properties-panel-feel-editor-container', disabled ? 'disabled' : null),\n children: jsx(\"div\", {\n name: props.name,\n class: classnames('bio-properties-panel-input', localValue ? 'edited' : null),\n ref: inputRef,\n onClick: handleClick\n })\n });\n});\n\nfunction FeelIndicator(props) {\n const {\n active\n } = props;\n if (!active) {\n return null;\n }\n return jsx(\"span\", {\n class: \"bio-properties-panel-feel-indicator\",\n children: \"=\"\n });\n}\n\nconst noop$1 = () => {};\n\n/**\n * @param {Object} props\n * @param {Object} props.label\n * @param {String} props.feel\n */\nfunction FeelIcon(props) {\n const {\n label,\n feel = false,\n active,\n disabled = false,\n onClick = noop$1\n } = props;\n const feelRequiredLabel = ' must be a FEEL expression';\n const feelOptionalLabel = ' can optionally be a FEEL expression';\n const handleClick = e => {\n onClick(e);\n\n // when pointer event was created from keyboard, keep focus on button\n if (!e.pointerType) {\n e.stopPropagation();\n }\n };\n return jsx(\"button\", {\n class: classnames('bio-properties-panel-feel-icon', active ? 'active' : null, feel === 'required' ? 'required' : 'optional'),\n onClick: handleClick,\n disabled: feel === 'required' || disabled,\n title: label + (feel === 'required' ? feelRequiredLabel : feelOptionalLabel),\n children: feel === 'required' ? jsx(FeelRequiredIcon, {}) : jsx(FeelOptionalIcon, {})\n });\n}\n\nconst noop = () => {};\nfunction FeelTextfield(props) {\n const {\n debounce,\n id,\n label,\n onInput,\n onError,\n feel,\n value = '',\n disabled = false,\n variables,\n tooltipContainer,\n OptionalComponent = OptionalFeelInput\n } = props;\n const [localValue, _setLocalValue] = useState(value);\n const editorRef = useShowEntryEvent(id);\n const containerRef = useRef();\n const feelActive = localValue.startsWith('=') || feel === 'required';\n const feelOnlyValue = localValue.startsWith('=') ? localValue.substring(1) : localValue;\n const [focus, _setFocus] = useState(undefined);\n const setFocus = (offset = 0) => {\n const hasFocus = containerRef.current.contains(document.activeElement);\n\n // Keep caret position if it is already focused, otherwise focus at the end\n const position = hasFocus ? document.activeElement.selectionStart : Infinity;\n _setFocus(position + offset);\n };\n const handleInputCallback = useMemo(() => {\n return debounce(newValue => {\n onInput(newValue);\n });\n }, [onInput, debounce]);\n const setLocalValue = newValue => {\n _setLocalValue(newValue);\n if (!newValue || newValue === '=') {\n handleInputCallback(undefined);\n } else {\n handleInputCallback(newValue);\n }\n };\n const handleFeelToggle = useStaticCallback(() => {\n if (feel === 'required') {\n return;\n }\n if (!feelActive) {\n setLocalValue('=' + localValue);\n } else {\n setLocalValue(feelOnlyValue);\n }\n });\n const handleLocalInput = newValue => {\n if (feelActive) {\n newValue = '=' + newValue;\n }\n if (newValue === localValue) {\n return;\n }\n setLocalValue(newValue);\n if (!feelActive && newValue.startsWith('=')) {\n // focus is behind `=` sign that will be removed\n setFocus(-1);\n }\n };\n const handleLint = useStaticCallback(lint => {\n if (!(lint && lint.length)) {\n onError(undefined);\n return;\n }\n const error = lint[0];\n const message = `${error.source}: ${error.message}`;\n onError(message);\n });\n useEffect(() => {\n if (typeof focus !== 'undefined') {\n editorRef.current.focus(focus);\n _setFocus(undefined);\n }\n }, [focus]);\n useEffect(() => {\n if (value === localValue) {\n return;\n }\n\n // External value change removed content => keep FEEL configuration\n if (!value) {\n setLocalValue(feelActive ? '=' : '');\n return;\n }\n setLocalValue(value);\n }, [value]);\n\n // copy-paste integration\n useEffect(() => {\n const copyHandler = event => {\n if (!feelActive) {\n return;\n }\n event.clipboardData.setData('application/FEEL', event.clipboardData.getData('text'));\n };\n const pasteHandler = event => {\n if (feelActive) {\n return;\n }\n const data = event.clipboardData.getData('application/FEEL');\n if (data) {\n setTimeout(() => {\n handleFeelToggle();\n setFocus();\n });\n }\n };\n containerRef.current.addEventListener('copy', copyHandler);\n containerRef.current.addEventListener('cut', copyHandler);\n containerRef.current.addEventListener('paste', pasteHandler);\n return () => {\n containerRef.current.removeEventListener('copy', copyHandler);\n containerRef.current.removeEventListener('cut', copyHandler);\n containerRef.current.removeEventListener('paste', pasteHandler);\n };\n }, [containerRef, feelActive, handleFeelToggle, setFocus]);\n return jsxs(\"div\", {\n class: \"bio-properties-panel-feel-entry\",\n children: [jsxs(\"label\", {\n for: prefixId$6(id),\n class: \"bio-properties-panel-label\",\n onClick: () => setFocus(),\n children: [label, jsx(FeelIcon, {\n label: label,\n feel: feel,\n onClick: handleFeelToggle,\n active: feelActive\n })]\n }), jsxs(\"div\", {\n class: \"bio-properties-panel-feel-container\",\n ref: containerRef,\n children: [jsx(FeelIndicator, {\n active: feelActive,\n disabled: feel !== 'optional' || disabled,\n onClick: handleFeelToggle\n }), feelActive ? jsx(CodeEditor, {\n id: prefixId$6(id),\n name: id,\n onInput: handleLocalInput,\n disabled: disabled,\n onFeelToggle: () => {\n handleFeelToggle();\n setFocus(true);\n },\n onLint: handleLint,\n value: feelOnlyValue,\n variables: variables,\n ref: editorRef,\n tooltipContainer: tooltipContainer\n }) : jsx(OptionalComponent, {\n ...props,\n onInput: handleLocalInput,\n value: localValue,\n ref: editorRef\n })]\n })]\n });\n}\nconst OptionalFeelInput = forwardRef((props, ref) => {\n const {\n id,\n disabled,\n onInput,\n value,\n onFocus,\n onBlur\n } = props;\n const inputRef = useRef();\n\n // To be consistent with the FEEL editor, set focus at start of input\n // this ensures clean editing experience when switching with the keyboard\n ref.current = {\n focus: position => {\n const input = inputRef.current;\n if (!input) {\n return;\n }\n input.focus();\n if (typeof position === 'number') {\n if (position > value.length) {\n position = value.length;\n }\n input.setSelectionRange(position, position);\n }\n }\n };\n return jsx(\"input\", {\n id: prefixId$6(id),\n type: \"text\",\n ref: inputRef,\n name: id,\n spellCheck: \"false\",\n autoComplete: \"off\",\n disabled: disabled,\n class: \"bio-properties-panel-input\",\n onInput: e => onInput(e.target.value),\n onFocus: onFocus,\n onBlur: onBlur,\n value: value || ''\n });\n});\nconst OptionalFeelTextArea = forwardRef((props, ref) => {\n const {\n id,\n disabled,\n onInput,\n value,\n onFocus,\n onBlur\n } = props;\n const inputRef = useRef();\n\n // To be consistent with the FEEL editor, set focus at start of input\n // this ensures clean editing experience when switching with the keyboard\n ref.current = {\n focus: () => {\n const input = inputRef.current;\n if (!input) {\n return;\n }\n input.focus();\n input.setSelectionRange(0, 0);\n }\n };\n return jsx(\"textarea\", {\n id: prefixId$6(id),\n type: \"text\",\n ref: inputRef,\n name: id,\n spellCheck: \"false\",\n autoComplete: \"off\",\n disabled: disabled,\n class: \"bio-properties-panel-input\",\n onInput: e => onInput(e.target.value),\n onFocus: onFocus,\n onBlur: onBlur,\n value: value || '',\n \"data-gramm\": \"false\"\n });\n});\n\n/**\n * @param {Object} props\n * @param {Object} props.element\n * @param {String} props.id\n * @param {String} props.description\n * @param {Boolean} props.debounce\n * @param {Boolean} props.disabled\n * @param {String} props.label\n * @param {Function} props.getValue\n * @param {Function} props.setValue\n * @param {Function} props.validate\n */\nfunction FeelEntry(props) {\n const {\n element,\n id,\n description,\n debounce,\n disabled,\n feel,\n label,\n getValue,\n setValue,\n tooltipContainer,\n validate,\n show = noop,\n example,\n variables,\n onFocus,\n onBlur\n } = props;\n const [cachedInvalidValue, setCachedInvalidValue] = useState(null);\n const [validationError, setValidationError] = useState(null);\n const [localError, setLocalError] = useState(null);\n let value = getValue(element);\n const previousValue = usePrevious(value);\n useEffect(() => {\n if (isFunction(validate)) {\n const newValidationError = validate(value) || null;\n setValidationError(newValidationError);\n }\n }, [value]);\n const onInput = useStaticCallback(newValue => {\n let newValidationError = null;\n if (isFunction(validate)) {\n newValidationError = validate(newValue) || null;\n }\n if (newValidationError) {\n setCachedInvalidValue(newValue);\n } else {\n // don't create multiple commandStack entries for the same value\n if (newValue !== value) {\n setValue(newValue);\n }\n }\n setValidationError(newValidationError);\n });\n const onError = useCallback(err => {\n setLocalError(err);\n }, []);\n if (previousValue === value && validationError) {\n value = cachedInvalidValue;\n }\n const temporaryError = useError(id);\n const error = localError || temporaryError || validationError;\n return jsxs(\"div\", {\n class: classnames(props.class, 'bio-properties-panel-entry', error ? 'has-error' : ''),\n \"data-entry-id\": id,\n children: [jsx(FeelTextfield, {\n debounce: debounce,\n disabled: disabled,\n feel: feel,\n id: id,\n label: label,\n onInput: onInput,\n onError: onError,\n onFocus: onFocus,\n onBlur: onBlur,\n example: example,\n show: show,\n value: value,\n variables: variables,\n tooltipContainer: tooltipContainer,\n OptionalComponent: props.OptionalComponent\n }, element), error && jsx(\"div\", {\n class: \"bio-properties-panel-error\",\n children: error\n }), jsx(Description, {\n forId: id,\n element: element,\n value: description\n })]\n });\n}\n\n/**\n * @param {Object} props\n * @param {Object} props.element\n * @param {String} props.id\n * @param {String} props.description\n * @param {Boolean} props.debounce\n * @param {Boolean} props.disabled\n * @param {String} props.label\n * @param {Function} props.getValue\n * @param {Function} props.setValue\n * @param {Function} props.onFocus\n * @param {Function} props.onBlur\n * @param {Function} props.validate\n */\nfunction FeelTextArea(props) {\n return jsx(FeelEntry, {\n class: \"bio-properties-panel-feel-textarea\",\n OptionalComponent: OptionalFeelTextArea,\n ...props\n });\n}\nfunction isEdited$6(node) {\n return node && (!!node.value || node.classList.contains('edited'));\n}\n\n// helpers /////////////////\n\nfunction prefixId$6(id) {\n return `bio-properties-panel-${id}`;\n}\n\nfunction List(props) {\n const {\n id,\n element,\n items = [],\n component,\n label = '<empty>',\n open: shouldOpen,\n onAdd,\n onRemove,\n autoFocusEntry,\n compareFn,\n ...restProps\n } = props;\n const [open, setOpen] = useState(!!shouldOpen);\n const hasItems = !!items.length;\n const toggleOpen = () => hasItems && setOpen(!open);\n const opening = !usePrevious(open) && open;\n const elementChanged = usePrevious(element) !== element;\n const shouldReset = opening || elementChanged;\n const sortedItems = useSortedItems(items, compareFn, shouldReset);\n const newItems = useNewItems(items, elementChanged);\n useEffect(() => {\n if (open && !hasItems) {\n setOpen(false);\n }\n }, [open, hasItems]);\n\n /**\n * @param {MouseEvent} event\n */\n function addItem(event) {\n event.stopPropagation();\n onAdd();\n if (!open) {\n setOpen(true);\n }\n }\n return jsxs(\"div\", {\n \"data-entry-id\": id,\n class: classnames('bio-properties-panel-entry', 'bio-properties-panel-list-entry', hasItems ? '' : 'empty', open ? 'open' : ''),\n children: [jsxs(\"div\", {\n class: \"bio-properties-panel-list-entry-header\",\n onClick: toggleOpen,\n children: [jsx(\"div\", {\n title: label,\n class: classnames('bio-properties-panel-list-entry-header-title', open && 'open'),\n children: label\n }), jsxs(\"div\", {\n class: \"bio-properties-panel-list-entry-header-buttons\",\n children: [jsxs(\"button\", {\n title: \"Create new list item\",\n onClick: addItem,\n class: \"bio-properties-panel-add-entry\",\n children: [jsx(CreateIcon, {}), !hasItems ? jsx(\"span\", {\n class: \"bio-properties-panel-add-entry-label\",\n children: \"Create\"\n }) : null]\n }), hasItems && jsx(\"div\", {\n title: `List contains ${items.length} item${items.length != 1 ? 's' : ''}`,\n class: \"bio-properties-panel-list-badge\",\n children: items.length\n }), hasItems && jsx(\"button\", {\n title: \"Toggle list item\",\n class: \"bio-properties-panel-arrow\",\n children: jsx(ArrowIcon, {\n class: open ? 'bio-properties-panel-arrow-down' : 'bio-properties-panel-arrow-right'\n })\n })]\n })]\n }), hasItems && jsx(ItemsList, {\n ...restProps,\n autoFocusEntry: autoFocusEntry,\n component: component,\n element: element,\n id: id,\n items: sortedItems,\n newItems: newItems,\n onRemove: onRemove,\n open: open\n })]\n });\n}\nfunction ItemsList(props) {\n const {\n autoFocusEntry,\n component: Component,\n element,\n id,\n items,\n newItems,\n onRemove,\n open,\n ...restProps\n } = props;\n const getKey = useKeyFactory();\n const newItem = newItems[0];\n useEffect(() => {\n if (newItem && autoFocusEntry) {\n // (0) select the parent entry (containing all list items)\n const entry = query(`[data-entry-id=\"${id}\"]`);\n\n // (1) select the first input or a custom element to be focussed\n const selector = typeof autoFocusEntry === 'boolean' ? '.bio-properties-panel-input' : autoFocusEntry;\n const focusableInput = query(selector, entry);\n\n // (2) set focus\n if (focusableInput) {\n if (isFunction(focusableInput.select)) {\n focusableInput.select();\n } else if (isFunction(focusableInput.focus)) {\n focusableInput.focus();\n }\n }\n }\n }, [newItem, autoFocusEntry, id]);\n return jsx(\"ol\", {\n class: classnames('bio-properties-panel-list-entry-items', open ? 'open' : ''),\n children: items.map((item, index) => {\n const key = getKey(item);\n return jsxs(\"li\", {\n class: \"bio-properties-panel-list-entry-item\",\n children: [jsx(Component, {\n ...restProps,\n element: element,\n id: id,\n index: index,\n item: item,\n open: item === newItem\n }), onRemove && jsx(\"button\", {\n type: \"button\",\n title: \"Delete item\",\n class: \"bio-properties-panel-remove-entry bio-properties-panel-remove-list-entry\",\n onClick: () => onRemove && onRemove(item),\n children: jsx(DeleteIcon, {})\n })]\n }, key);\n })\n });\n}\n\n/**\n * Place new items in the beginning of the list and sort the rest with provided function.\n *\n * @template Item\n * @param {Item[]} currentItems\n * @param {(a: Item, b: Item) => 0 | 1 | -1} [compareFn] function used to sort items\n * @param {boolean} [shouldReset=false] set to `true` to reset state of the hook\n * @returns {Item[]}\n */\nfunction useSortedItems(currentItems, compareFn, shouldReset = false) {\n const itemsRef = useRef(currentItems.slice());\n\n // (1) Reset and optionally sort.\n if (shouldReset) {\n itemsRef.current = currentItems.slice();\n if (compareFn) {\n itemsRef.current.sort(compareFn);\n }\n } else {\n const items = itemsRef.current;\n\n // (2) Add new item to the list.\n for (const item of currentItems) {\n if (!items.includes(item)) {\n // Unshift or push depending on whether we have a compareFn\n compareFn ? items.unshift(item) : items.push(item);\n }\n }\n\n // (3) Filter out removed items.\n itemsRef.current = items.filter(item => currentItems.includes(item));\n }\n return itemsRef.current;\n}\nfunction useNewItems(items = [], shouldReset) {\n const previousItems = usePrevious(items.slice()) || [];\n if (shouldReset) {\n return [];\n }\n return previousItems ? items.filter(item => !previousItems.includes(item)) : [];\n}\n\nfunction NumberField(props) {\n const {\n debounce,\n disabled,\n id,\n label,\n max,\n min,\n onInput,\n step,\n value = '',\n onFocus,\n onBlur\n } = props;\n const [localValue, setLocalValue] = useState(value);\n const handleInputCallback = useMemo(() => {\n return debounce(event => {\n const {\n validity,\n value\n } = event.target;\n if (validity.valid) {\n onInput(value ? parseFloat(value) : undefined);\n }\n });\n }, [onInput, debounce]);\n const handleInput = e => {\n handleInputCallback(e);\n setLocalValue(e.target.value);\n };\n useEffect(() => {\n if (value === localValue) {\n return;\n }\n setLocalValue(value);\n }, [value]);\n return jsxs(\"div\", {\n class: \"bio-properties-panel-numberfield\",\n children: [jsx(\"label\", {\n for: prefixId$5(id),\n class: \"bio-properties-panel-label\",\n children: label\n }), jsx(\"input\", {\n id: prefixId$5(id),\n type: \"number\",\n name: id,\n spellCheck: \"false\",\n autoComplete: \"off\",\n disabled: disabled,\n class: \"bio-properties-panel-input\",\n max: max,\n min: min,\n onInput: handleInput,\n onFocus: onFocus,\n onBlur: onBlur,\n step: step,\n value: localValue\n })]\n });\n}\n\n/**\n * @param {Object} props\n * @param {Boolean} props.debounce\n * @param {String} props.description\n * @param {Boolean} props.disabled\n * @param {Object} props.element\n * @param {Function} props.getValue\n * @param {String} props.id\n * @param {String} props.label\n * @param {String} props.max\n * @param {String} props.min\n * @param {Function} props.setValue\n * @param {Function} props.onFocus\n * @param {Function} props.onBlur\n * @param {String} props.step\n */\nfunction NumberFieldEntry(props) {\n const {\n debounce,\n description,\n disabled,\n element,\n getValue,\n id,\n label,\n max,\n min,\n setValue,\n step,\n onFocus,\n onBlur\n } = props;\n const value = getValue(element);\n return jsxs(\"div\", {\n class: \"bio-properties-panel-entry\",\n \"data-entry-id\": id,\n children: [jsx(NumberField, {\n debounce: debounce,\n disabled: disabled,\n id: id,\n label: label,\n onInput: setValue,\n onFocus: onFocus,\n onBlur: onBlur,\n max: max,\n min: min,\n step: step,\n value: value\n }, element), jsx(Description, {\n forId: id,\n element: element,\n value: description\n })]\n });\n}\nfunction isEdited$5(node) {\n return node && !!node.value;\n}\n\n// helpers /////////////////\n\nfunction prefixId$5(id) {\n return `bio-properties-panel-${id}`;\n}\n\nfunction Select(props) {\n const {\n id,\n label,\n onChange,\n options = [],\n value,\n disabled,\n onFocus,\n onBlur\n } = props;\n const ref = useShowEntryEvent(id);\n const [localValue, setLocalValue] = useState(value);\n const handleChangeCallback = ({\n target\n }) => {\n onChange(target.value);\n };\n const handleChange = e => {\n handleChangeCallback(e);\n setLocalValue(e.target.value);\n };\n useEffect(() => {\n if (value === localValue) {\n return;\n }\n setLocalValue(value);\n }, [value]);\n return jsxs(\"div\", {\n class: \"bio-properties-panel-select\",\n children: [jsx(\"label\", {\n for: prefixId$4(id),\n class: \"bio-properties-panel-label\",\n children: label\n }), jsx(\"select\", {\n ref: ref,\n id: prefixId$4(id),\n name: id,\n class: \"bio-properties-panel-input\",\n onInput: handleChange,\n onFocus: onFocus,\n onBlur: onBlur,\n value: localValue,\n disabled: disabled,\n children: options.map((option, idx) => {\n return jsx(\"option\", {\n value: option.value,\n disabled: option.disabled,\n children: option.label\n }, idx);\n })\n })]\n });\n}\n\n/**\n * @param {object} props\n * @param {object} props.element\n * @param {string} props.id\n * @param {string} [props.description]\n * @param {string} props.label\n * @param {Function} props.getValue\n * @param {Function} props.setValue\n * @param {Function} props.onFocus\n * @param {Function} props.onBlur\n * @param {Function} props.getOptions\n * @param {boolean} [props.disabled]\n */\nfunction SelectEntry(props) {\n const {\n element,\n id,\n description,\n label,\n getValue,\n setValue,\n getOptions,\n disabled,\n onFocus,\n onBlur\n } = props;\n const value = getValue(element);\n const options = getOptions(element);\n const error = useError(id);\n return jsxs(\"div\", {\n class: classnames('bio-properties-panel-entry', error ? 'has-error' : ''),\n \"data-entry-id\": id,\n children: [jsx(Select, {\n id: id,\n label: label,\n value: value,\n onChange: setValue,\n onFocus: onFocus,\n onBlur: onBlur,\n options: options,\n disabled: disabled\n }, element), error && jsx(\"div\", {\n class: \"bio-properties-panel-error\",\n children: error\n }), jsx(Description, {\n forId: id,\n element: element,\n value: description\n })]\n });\n}\nfunction isEdited$4(node) {\n return node && !!node.value;\n}\n\n// helpers /////////////////\n\nfunction prefixId$4(id) {\n return `bio-properties-panel-${id}`;\n}\n\nfunction Simple(props) {\n const {\n debounce,\n disabled,\n element,\n getValue,\n id,\n onBlur,\n onFocus,\n setValue\n } = props;\n const value = getValue(element);\n const [localValue, setLocalValue] = useState(value);\n const handleInputCallback = useMemo(() => {\n return debounce(({\n target\n }) => setValue(target.value.length ? target.value : undefined));\n }, [setValue, debounce]);\n const handleInput = e => {\n handleInputCallback(e);\n setLocalValue(e.target.value);\n };\n useEffect(() => {\n if (value === localValue) {\n return;\n }\n setLocalValue(value);\n }, [value]);\n return jsx(\"div\", {\n class: \"bio-properties-panel-simple\",\n children: jsx(\"input\", {\n id: prefixId$3(id),\n type: \"text\",\n name: id,\n spellCheck: \"false\",\n autoComplete: \"off\",\n disabled: disabled,\n class: \"bio-properties-panel-input\",\n onInput: handleInput,\n \"aria-label\": localValue || '<empty>',\n onFocus: onFocus,\n onBlur: onBlur,\n value: localValue\n }, element)\n });\n}\nfunction isEdited$3(node) {\n return node && !!node.value;\n}\n\n// helpers /////////////////\n\nfunction prefixId$3(id) {\n return `bio-properties-panel-${id}`;\n}\n\nfunction TextArea(props) {\n const {\n id,\n label,\n rows = 2,\n debounce,\n onInput,\n value = '',\n disabled,\n monospace,\n onFocus,\n onBlur\n } = props;\n const [localValue, setLocalValue] = useState(value);\n const ref = useShowEntryEvent(id);\n const handleInputCallback = useMemo(() => {\n return debounce(({\n target\n }) => onInput(target.value.length ? target.value : undefined));\n }, [onInput, debounce]);\n const handleInput = e => {\n handleInputCallback(e);\n setLocalValue(e.target.value);\n };\n useEffect(() => {\n if (value === localValue) {\n return;\n }\n setLocalValue(value);\n }, [value]);\n return jsxs(\"div\", {\n class: \"bio-properties-panel-textarea\",\n children: [jsx(\"label\", {\n for: prefixId$2(id),\n class: \"bio-properties-panel-label\",\n children: label\n }), jsx(\"textarea\", {\n ref: ref,\n id: prefixId$2(id),\n name: id,\n spellCheck: \"false\",\n class: classnames('bio-properties-panel-input', monospace ? 'bio-properties-panel-input-monospace' : ''),\n onInput: handleInput,\n onFocus: onFocus,\n onBlur: onBlur,\n rows: rows,\n value: localValue,\n disabled: disabled,\n \"data-gramm\": \"false\"\n })]\n });\n}\n\n/**\n * @param {object} props\n * @param {object} props.element\n * @param {string} props.id\n * @param {string} props.description\n * @param {boolean} props.debounce\n * @param {string} props.label\n * @param {Function} props.getValue\n * @param {Function} props.setValue\n * @param {Function} props.onFocus\n * @param {Function} props.onBlur\n * @param {number} props.rows\n * @param {boolean} props.monospace\n * @param {boolean} [props.disabled]\n */\nfunction TextAreaEntry(props) {\n const {\n element,\n id,\n description,\n debounce,\n label,\n getValue,\n setValue,\n rows,\n monospace,\n disabled,\n onFocus,\n onBlur\n } = props;\n const value = getValue(element);\n const error = useError(id);\n return jsxs(\"div\", {\n class: classnames('bio-properties-panel-entry', error ? 'has-error' : ''),\n \"data-entry-id\": id,\n children: [jsx(TextArea, {\n id: id,\n label: label,\n value: value,\n onInput: setValue,\n onFocus: onFocus,\n onBlur: onBlur,\n rows: rows,\n debounce: debounce,\n monospace: monospace,\n disabled: disabled\n }, element), error && jsx(\"div\", {\n class: \"bio-properties-panel-error\",\n children: error\n }), jsx(Description, {\n forId: id,\n element: element,\n value: description\n })]\n });\n}\nfunction isEdited$2(node) {\n return node && !!node.value;\n}\n\n// helpers /////////////////\n\nfunction prefixId$2(id) {\n return `bio-properties-panel-${id}`;\n}\n\nfunction Textfield(props) {\n const {\n debounce,\n disabled = false,\n id,\n label,\n onInput,\n onFocus,\n onBlur,\n value = ''\n } = props;\n const [localValue, setLocalValue] = useState(value || '');\n const ref = useShowEntryEvent(id);\n const handleInputCallback = useMemo(() => {\n return debounce(({\n target\n }) => onInput(target.value.length ? target.value : undefined));\n }, [onInput, debounce]);\n const handleInput = e => {\n handleInputCallback(e);\n setLocalValue(e.target.value);\n };\n useEffect(() => {\n if (value === localValue) {\n return;\n }\n setLocalValue(value);\n }, [value]);\n return jsxs(\"div\", {\n class: \"bio-properties-panel-textfield\",\n children: [jsx(\"label\", {\n for: prefixId$1(id),\n class: \"bio-properties-panel-label\",\n children: label\n }), jsx(\"input\", {\n ref: ref,\n id: prefixId$1(id),\n type: \"text\",\n name: id,\n spellCheck: \"false\",\n autoComplete: \"off\",\n disabled: disabled,\n class: \"bio-properties-panel-input\",\n onInput: handleInput,\n onFocus: onFocus,\n onBlur: onBlur,\n value: localValue\n })]\n });\n}\n\n/**\n * @param {Object} props\n * @param {Object} props.element\n * @param {String} props.id\n * @param {String} props.description\n * @param {Boolean} props.debounce\n * @param {Boolean} props.disabled\n * @param {String} props.label\n * @param {Function} props.getValue\n * @param {Function} props.setValue\n * @param {Function} props.onFocus\n * @param {Function} props.onBlur\n * @param {Function} props.validate\n */\nfunction TextfieldEntry(props) {\n const {\n element,\n id,\n description,\n debounce,\n disabled,\n label,\n getValue,\n setValue,\n validate,\n onFocus,\n onBlur\n } = props;\n const [cachedInvalidValue, setCachedInvalidValue] = useState(null);\n const globalError = useError(id);\n const [localError, setLocalError] = useState(null);\n let value = getValue(element);\n const previousValue = usePrevious(value);\n useEffect(() => {\n if (isFunction(validate)) {\n const newValidationError = validate(value) || null;\n setLocalError(newValidationError);\n }\n }, [value]);\n const onInput = newValue => {\n let newValidationError = null;\n if (isFunction(validate)) {\n newValidationError = validate(newValue) || null;\n }\n if (newValidationError) {\n setCachedInvalidValue(newValue);\n } else {\n setValue(newValue);\n }\n setLocalError(newValidationError);\n };\n if (previousValue === value && localError) {\n value = cachedInvalidValue;\n }\n const error = globalError || localError;\n return jsxs(\"div\", {\n class: classnames('bio-properties-panel-entry', error ? 'has-error' : ''),\n \"data-entry-id\": id,\n children: [jsx(Textfield, {\n debounce: debounce,\n disabled: disabled,\n id: id,\n label: label,\n onInput: onInput,\n onFocus: onFocus,\n onBlur: onBlur,\n value: value\n }, element), error && jsx(\"div\", {\n class: \"bio-properties-panel-error\",\n children: error\n }), jsx(Description, {\n forId: id,\n element: element,\n value: description\n })]\n });\n}\nfunction isEdited$1(node) {\n return node && !!node.value;\n}\n\n// helpers /////////////////\n\nfunction prefixId$1(id) {\n return `bio-properties-panel-${id}`;\n}\n\nfunction ToggleSwitch(props) {\n const {\n id,\n label,\n onInput,\n value,\n switcherLabel,\n onFocus,\n onBlur\n } = props;\n const [localValue, setLocalValue] = useState(value);\n const handleInputCallback = async () => {\n onInput(!value);\n };\n const handleInput = e => {\n handleInputCallback();\n setLocalValue(e.target.value);\n };\n useEffect(() => {\n if (value === localValue) {\n return;\n }\n setLocalValue(value);\n }, [value]);\n return jsxs(\"div\", {\n class: \"bio-properties-panel-toggle-switch\",\n children: [jsx(\"label\", {\n class: \"bio-properties-panel-label\",\n for: prefixId(id),\n children: label\n }), jsxs(\"div\", {\n class: \"bio-properties-panel-field-wrapper\",\n children: [jsxs(\"label\", {\n class: \"bio-properties-panel-toggle-switch__switcher\",\n children: [jsx(\"input\", {\n id: prefixId(id),\n class: \"bio-properties-panel-input\",\n type: \"checkbox\",\n onFocus: onFocus,\n onBlur: onBlur,\n name: id,\n onInput: handleInput,\n checked: !!localValue\n }), jsx(\"span\", {\n class: \"bio-properties-panel-toggle-switch__slider\"\n })]\n }), jsx(\"p\", {\n class: \"bio-properties-panel-toggle-switch__label\",\n children: switcherLabel\n })]\n })]\n });\n}\n\n/**\n * @param {Object} props\n * @param {Object} props.element\n * @param {String} props.id\n * @param {String} props.description\n * @param {String} props.label\n * @param {String} props.switcherLabel\n * @param {Function} props.getValue\n * @param {Function} props.setValue\n * @param {Function} props.onFocus\n * @param {Function} props.onBlur\n */\nfunction ToggleSwitchEntry(props) {\n const {\n element,\n id,\n description,\n label,\n switcherLabel,\n getValue,\n setValue,\n onFocus,\n onBlur\n } = props;\n const value = getValue(element);\n return jsxs(\"div\", {\n class: \"bio-properties-panel-entry bio-properties-panel-toggle-switch-entry\",\n \"data-entry-id\": id,\n children: [jsx(ToggleSwitch, {\n id: id,\n label: label,\n value: value,\n onInput: setValue,\n onFocus: onFocus,\n onBlur: onBlur,\n switcherLabel: switcherLabel\n }), jsx(Description, {\n forId: id,\n element: element,\n value: description\n })]\n });\n}\nfunction isEdited(node) {\n return node && !!node.checked;\n}\n\n// helpers /////////////////\n\nfunction prefixId(id) {\n return `bio-properties-panel-${id}`;\n}\n\nconst DEFAULT_DEBOUNCE_TIME = 300;\nfunction debounceInput(debounceDelay) {\n return function _debounceInput(fn) {\n if (debounceDelay !== false) {\n var debounceTime = isNumber(debounceDelay) ? debounceDelay : DEFAULT_DEBOUNCE_TIME;\n return debounce(fn, debounceTime);\n } else {\n return fn;\n }\n };\n}\ndebounceInput.$inject = ['config.debounceInput'];\n\nvar index = {\n debounceInput: ['factory', debounceInput]\n};\n\nexport { ArrowIcon, CheckboxEntry, CollapsibleEntry, CreateIcon, index as DebounceInputModule, DeleteIcon, DescriptionContext, Description as DescriptionEntry, DropdownButton, ErrorsContext, EventContext, ExternalLinkIcon, FeelEntry, FeelOptionalIcon, FeelRequiredIcon, FeelTextArea as FeelTextAreaEntry, Group, Header, HeaderButton, LayoutContext, List as ListEntry, ListGroup, ListItem, NumberFieldEntry, Placeholder, PropertiesPanel, LayoutContext as PropertiesPanelContext, SelectEntry, Simple as SimpleEntry, TextAreaEntry, TextfieldEntry as TextFieldEntry, ToggleSwitchEntry, isEdited$7 as isCheckboxEntryEdited, isEdited$6 as isFeelEntryEdited, isEdited$5 as isNumberFieldEntryEdited, isEdited$4 as isSelectEntryEdited, isEdited$3 as isSimpleEntryEdited, isEdited$2 as isTextAreaEntryEdited, isEdited$1 as isTextFieldEntryEdited, isEdited as isToggleSwitchEntryEdited, useDescriptionContext, useError, useEvent, useKeyFactory, useLayoutState, usePrevious, useShowEntryEvent, useStaticCallback, useStickyIntersectionObserver };\n//# sourceMappingURL=index.esm.js.map\n","import { createContext } from 'preact';\n\n/**\n * @param {string} type\n * @param {boolean} [strict]\n *\n * @returns {any}\n */\nfunction getService(type, strict) {}\n\nconst PropertiesPanelContext = createContext({\n getService\n});\n\nexport default PropertiesPanelContext;","import Big from 'big.js';\n\nexport function arrayAdd(array, index, item) {\n const copy = [ ...array ];\n\n copy.splice(index, 0, item);\n\n return copy;\n}\n\nexport function arrayRemove(array, index) {\n const copy = [ ...array ];\n\n copy.splice(index, 1);\n\n return copy;\n}\n\nexport function prefixId(id) {\n return `fjs-properties-panel-${ id }`;\n}\n\n\nexport function countDecimals(number) {\n const num = Big(number);\n if (num.toString() === num.toFixed(0)) return 0;\n return num.toFixed().split('.')[1].length || 0;\n}\n\nexport function isValidNumber(value) {\n return (typeof value === 'number' || typeof value === 'string') && value !== '' && !isNaN(Number(value));\n}\n\nexport function stopPropagation(listener) {\n return (event) => {\n event.stopPropagation();\n\n listener(event);\n };\n}\n\nexport function textToLabel(text) {\n\n if (typeof text != 'string') return null;\n\n for (const line of text.split('\\n')) {\n\n const displayLine = line.trim();\n\n // we use the first non-whitespace line in the text as label\n if (displayLine !== '') {\n return displayLine;\n }\n }\n\n return null;\n}\n\nexport const INPUTS = [\n 'checkbox',\n 'checklist',\n 'datetime',\n 'number',\n 'radio',\n 'select',\n 'taglist',\n 'textfield',\n 'textarea'\n];\n\nexport const VALUES_INPUTS = [\n 'checklist',\n 'radio',\n 'select',\n 'taglist'\n];","import {\n textToLabel\n} from './Util';\n\nimport { iconsByType } from '../../render/components/icons';\n\nconst labelsByType = {\n button: 'BUTTON',\n checkbox: 'CHECKBOX',\n checklist: 'CHECKLIST',\n columns: 'COLUMNS',\n default: 'FORM',\n datetime: 'DATETIME',\n image: 'IMAGE VIEW',\n number: 'NUMBER',\n radio: 'RADIO',\n select: 'SELECT',\n taglist: 'TAGLIST',\n text: 'TEXT VIEW',\n textfield: 'TEXT FIELD',\n textarea: 'TEXT AREA',\n};\n\nexport const PropertiesPanelHeaderProvider = {\n\n getElementLabel: (field) => {\n const {\n type\n } = field;\n\n if (type === 'text') {\n return textToLabel(field.text);\n }\n\n if (type === 'image') {\n return field.alt;\n }\n\n if (type === 'default') {\n return field.id;\n }\n\n return field.label;\n },\n\n getElementIcon: (field) => {\n const {\n type\n } = field;\n\n const Icon = iconsByType[type];\n\n if (Icon) {\n return () => <Icon width=\"36\" height=\"36\" viewBox=\"0 0 54 54\" />;\n }\n },\n\n getTypeLabel: (field) => {\n const {\n type\n } = field;\n\n return labelsByType[type];\n }\n};","/**\n * Provide placeholders for empty and multiple state.\n */\nexport const PropertiesPanelPlaceholderProvider = {\n\n getEmpty: () => {\n return {\n text: 'Select a form field to edit its properties.'\n };\n },\n\n getMultiple: () => {\n return {\n text: 'Multiple form fields are selected. Select a single form field to edit its properties.'\n };\n }\n};","import { get } from 'min-dash';\n\nimport { SelectEntry, isSelectEntryEdited } from '@bpmn-io/properties-panel';\n\n\nexport default function ActionEntry(props) {\n const {\n editField,\n field\n } = props;\n\n const {\n type\n } = field;\n\n const entries = [];\n\n if (type === 'button') {\n entries.push({\n id: 'action',\n component: Action,\n editField: editField,\n field: field,\n isEdited: isSelectEntryEdited\n });\n }\n\n return entries;\n}\n\nfunction Action(props) {\n const {\n editField,\n field,\n id\n } = props;\n\n const path = [ 'action' ];\n\n const getValue = () => {\n return get(field, path, '');\n };\n\n const setValue = (value) => {\n return editField(field, path, value);\n };\n\n const getOptions = () => [\n {\n label: 'Submit',\n value: 'submit'\n },\n {\n label: 'Reset',\n value: 'reset'\n }\n ];\n\n return SelectEntry({\n element: field,\n getOptions,\n getValue,\n id,\n label: 'Action',\n setValue\n });\n}","import {\n useContext\n} from 'preact/hooks';\n\nimport { FormPropertiesPanelContext } from '../context';\n\n\nexport default function(type, strict) {\n const {\n getService\n } = useContext(FormPropertiesPanelContext);\n\n return getService(type, strict);\n}","import { getSchemaVariables } from '@bpmn-io/form-js-viewer';\nimport useService from './usePropertiesPanelService';\n\n/**\n * Retrieve list of variables from the form schema.\n *\n * @returns { string[] } list of variables used in form schema\n */\nexport function useVariables() {\n const form = useService('formEditor');\n const schema = form.getSchema();\n\n return getSchemaVariables(schema);\n}\n","import { get } from 'min-dash';\n\nimport { useService, useVariables } from '../hooks';\n\nimport { FeelEntry, isFeelEntryEdited } from '@bpmn-io/properties-panel';\n\nexport default function AltTextEntry(props) {\n const {\n editField,\n field\n } = props;\n\n const {\n type\n } = field;\n\n const entries = [];\n\n if (type === 'image') {\n entries.push({\n id: 'alt',\n component: AltText,\n editField: editField,\n field: field,\n isEdited: isFeelEntryEdited\n });\n }\n\n return entries;\n}\n\nfunction AltText(props) {\n const {\n editField,\n field,\n id\n } = props;\n\n const debounce = useService('debounce');\n\n const variables = useVariables().map(name => ({ name }));\n\n const path = [ 'alt' ];\n\n const getValue = () => {\n return get(field, path, '');\n };\n\n const setValue = (value) => {\n return editField(field, path, value);\n };\n\n return FeelEntry({\n debounce,\n element: field,\n feel: 'optional',\n getValue,\n id,\n label: 'Alternative text',\n setValue,\n variables\n });\n}\n","import { Default } from '@bpmn-io/form-js-viewer';\n\nimport { useService } from '../hooks';\n\nimport { NumberFieldEntry, isNumberFieldEntryEdited } from '@bpmn-io/properties-panel';\n\n\nexport default function ColumnsEntry(props) {\n const {\n editField,\n field\n } = props;\n\n const {\n type\n } = field;\n\n const entries = [];\n\n if (type === 'columns') {\n entries.push({\n id: 'columns',\n component: Columns,\n editField: editField,\n field: field,\n isEdited: isNumberFieldEntryEdited\n });\n }\n\n return entries;\n}\n\nfunction Columns(props) {\n const {\n editField,\n field,\n id\n } = props;\n\n const debounce = useService('debounce');\n\n const getValue = () => {\n return field.components.length;\n };\n\n const setValue = (value) => {\n let components = field.components.slice();\n\n if (value > components.length) {\n while (value > components.length) {\n components.push(Default.create({ _parent: field.id }));\n }\n } else {\n components = components.slice(0, value);\n }\n\n editField(field, 'components', components);\n };\n\n return NumberFieldEntry({\n debounce,\n element: field,\n getValue,\n id,\n label: 'Columns',\n setValue\n });\n}","import { get } from 'min-dash';\n\nimport { useService } from '../hooks';\n\nimport { INPUTS } from '../Util';\n\nimport { TextFieldEntry, isTextFieldEntryEdited } from '@bpmn-io/properties-panel';\n\n\nexport default function DescriptionEntry(props) {\n const {\n editField,\n field\n } = props;\n\n const {\n type\n } = field;\n\n const entries = [];\n\n if (INPUTS.includes(type)) {\n entries.push({\n id: 'description',\n component: Description,\n editField: editField,\n field: field,\n isEdited: isTextFieldEntryEdited\n });\n }\n\n return entries;\n}\n\n\nfunction Description(props) {\n const {\n editField,\n field,\n id\n } = props;\n\n const debounce = useService('debounce');\n\n const path = [ 'description' ];\n\n const getValue = () => {\n return get(field, path, '');\n };\n\n const setValue = (value) => {\n return editField(field, path, value);\n };\n\n return TextFieldEntry({\n debounce,\n element: field,\n getValue,\n id,\n label: 'Field description',\n setValue\n });\n}","import {\n isSelectEntryEdited,\n isTextFieldEntryEdited,\n isTextAreaEntryEdited,\n SelectEntry,\n TextFieldEntry,\n TextAreaEntry\n} from '@bpmn-io/properties-panel';\n\nimport { get } from 'min-dash';\n\nimport Big from 'big.js';\n\nimport { useService } from '../hooks';\n\nimport { countDecimals, INPUTS, isValidNumber, VALUES_INPUTS } from '../Util';\n\nexport default function DefaultOptionEntry(props) {\n const {\n editField,\n field\n } = props;\n\n const {\n type\n } = field;\n\n const entries = [];\n\n // Only make default values available when they are statically defined\n if (!INPUTS.includes(type) || VALUES_INPUTS.includes(type) && !field.values) {\n return entries;\n }\n\n const defaultOptions = {\n editField,\n field,\n id: 'defaultValue',\n label: 'Default value'\n };\n\n if (type === 'checkbox') {\n entries.push({\n ...defaultOptions,\n component: DefaultValueCheckbox,\n isEdited: isSelectEntryEdited\n });\n }\n\n if (type === 'number') {\n entries.push({\n ...defaultOptions,\n component: DefaultValueNumber,\n isEdited: isTextFieldEntryEdited\n });\n }\n\n if (type === 'radio' || type === 'select') {\n entries.push({\n ...defaultOptions,\n component: DefaultValueSingleSelect,\n isEdited: isSelectEntryEdited\n });\n }\n\n // todo(Skaiir): implement a multiselect equivalent (cf. https://github.com/bpmn-io/form-js/issues/265)\n\n if (type === 'textfield') {\n entries.push({\n ...defaultOptions,\n component: DefaultValueTextfield,\n isEdited: isTextFieldEntryEdited\n });\n }\n\n if (type === 'textarea') {\n entries.push({\n ...defaultOptions,\n component: DefaultValueTextarea,\n isEdited: isTextAreaEntryEdited\n });\n }\n\n return entries;\n}\n\nfunction DefaultValueCheckbox(props) {\n const {\n editField,\n field,\n id,\n label\n } = props;\n\n const {\n defaultValue\n } = field;\n\n const path = [ 'defaultValue' ];\n\n const getOptions = () => {\n return [\n {\n label: 'Checked',\n value: 'true'\n },\n {\n label: 'Not checked',\n value: 'false'\n }\n ];\n };\n\n const setValue = (value) => {\n return editField(field, path, parseStringToBoolean(value));\n };\n\n const getValue = () => {\n return parseBooleanToString(defaultValue);\n };\n\n return SelectEntry({\n element: field,\n getOptions,\n getValue,\n id,\n label,\n setValue\n });\n}\n\nfunction DefaultValueNumber(props) {\n const {\n editField,\n field,\n id,\n label\n } = props;\n\n const {\n decimalDigits,\n serializeToString = false\n } = field;\n\n const debounce = useService('debounce');\n\n const path = [ 'defaultValue' ];\n\n const getValue = (e) => {\n\n let value = get(field, path);\n\n if (!isValidNumber(value)) return;\n\n // Enforces decimal notation so that we do not submit defaults in exponent form\n return serializeToString ? Big(value).toFixed() : value;\n };\n\n const setValue = (value) => {\n\n let newValue;\n\n if (isValidNumber(value)) {\n newValue = serializeToString ? value : Number(value);\n }\n\n return editField(field, path, newValue);\n };\n\n const decimalDigitsSet = decimalDigits || decimalDigits === 0;\n\n return TextFieldEntry({\n debounce,\n label,\n element: field,\n getValue,\n id,\n setValue,\n validate: (value) => {\n if (value === undefined || value === null) return;\n if (!isValidNumber(value)) return 'Should be a valid number';\n if (decimalDigitsSet && countDecimals(value) > decimalDigits) return `Should not contain more than ${decimalDigits} decimal digits`;\n }\n });\n}\n\nfunction DefaultValueSingleSelect(props) {\n const {\n editField,\n field,\n id,\n label\n } = props;\n\n const {\n defaultValue,\n values = []\n } = field;\n\n const path = [ 'defaultValue' ];\n\n const getOptions = () => {\n return [\n {\n label: '<none>'\n },\n ...values\n ];\n };\n\n const setValue = (value) => {\n return editField(field, path, value.length ? value : undefined);\n };\n\n const getValue = () => {\n return defaultValue;\n };\n\n return SelectEntry({\n element: field,\n getOptions,\n getValue,\n id,\n label,\n setValue\n });\n}\n\nfunction DefaultValueTextfield(props) {\n const {\n editField,\n field,\n id,\n label\n } = props;\n\n const debounce = useService('debounce');\n\n const path = [ 'defaultValue' ];\n\n const getValue = () => {\n return get(field, path, '');\n };\n\n const setValue = (value) => {\n return editField(field, path, value);\n };\n\n return TextFieldEntry({\n debounce,\n element: field,\n getValue,\n id,\n label,\n setValue\n });\n}\n\nfunction DefaultValueTextarea(props) {\n const {\n editField,\n field,\n id,\n label\n } = props;\n\n const debounce = useService('debounce');\n\n const path = [ 'defaultValue' ];\n\n const getValue = () => {\n return get(field, path, '');\n };\n\n const setValue = (value) => {\n return editField(field, path, value);\n };\n\n return TextAreaEntry({\n debounce,\n element: field,\n getValue,\n id,\n label,\n setValue\n });\n}\n\n// helpers /////////////////\n\nfunction parseStringToBoolean(value) {\n if (value === 'true') {\n return true;\n }\n\n return false;\n}\n\nfunction parseBooleanToString(value) {\n if (value === true) {\n return 'true';\n }\n\n return 'false';\n}","import { get } from 'min-dash';\n\nimport { INPUTS } from '../Util';\n\nimport { CheckboxEntry, isCheckboxEntryEdited } from '@bpmn-io/properties-panel';\n\n\nexport default function DisabledEntry(props) {\n const {\n editField,\n field\n } = props;\n\n const {\n type\n } = field;\n\n const entries = [];\n\n if (INPUTS.includes(type)) {\n entries.push({\n id: 'disabled',\n component: Disabled,\n editField: editField,\n field: field,\n isEdited: isCheckboxEntryEdited\n });\n }\n\n return entries;\n}\n\nfunction Disabled(props) {\n const {\n editField,\n field,\n id\n } = props;\n\n const path = [ 'disabled' ];\n\n const getValue = () => {\n return get(field, path, '');\n };\n\n const setValue = (value) => {\n return editField(field, path, value);\n };\n\n return CheckboxEntry({\n element: field,\n getValue,\n id,\n label: 'Disabled',\n setValue\n });\n}","import { get, isUndefined } from 'min-dash';\n\nimport { useService } from '../hooks';\n\nimport { TextFieldEntry, isTextFieldEntryEdited } from '@bpmn-io/properties-panel';\n\n\nexport default function IdEntry(props) {\n const {\n editField,\n field\n } = props;\n\n const entries = [];\n\n if (field.type === 'default') {\n entries.push({\n id: 'id',\n component: Id,\n editField: editField,\n field: field,\n isEdited: isTextFieldEntryEdited\n });\n }\n\n return entries;\n}\n\nfunction Id(props) {\n const {\n editField,\n field,\n id\n } = props;\n\n const formFieldRegistry = useService('formFieldRegistry');\n const debounce = useService('debounce');\n\n const path = [ 'id' ];\n\n const getValue = () => {\n return get(field, path, '');\n };\n\n const setValue = (value) => {\n return editField(field, path, value);\n };\n\n const validate = (value) => {\n if (isUndefined(value) || !value.length) {\n return 'Must not be empty.';\n }\n\n const assigned = formFieldRegistry._ids.assigned(value);\n\n if (assigned && assigned !== field) {\n return 'Must be unique.';\n }\n\n return validateId(value) || null;\n };\n\n return TextFieldEntry({\n debounce,\n element: field,\n getValue,\n id,\n label: 'ID',\n setValue,\n validate,\n });\n}\n\n// id structural validation /////////////\n\nconst SPACE_REGEX = /\\s/;\n\n// for QName validation as per http://www.w3.org/TR/REC-xml/#NT-NameChar\nconst QNAME_REGEX = /^([a-z][\\w-.]*:)?[a-z_][\\w-.]*$/i;\n\n// for ID validation as per BPMN Schema (QName - Namespace)\nconst ID_REGEX = /^[a-z_][\\w-.]*$/i;\n\nfunction validateId(idValue) {\n\n if (containsSpace(idValue)) {\n return 'Must not contain spaces.';\n }\n\n if (!ID_REGEX.test(idValue)) {\n\n if (QNAME_REGEX.test(idValue)) {\n return 'Must not contain prefix.';\n }\n\n return 'Must be a valid QName.';\n }\n}\n\nfunction containsSpace(value) {\n return SPACE_REGEX.test(value);\n}","import { isUndefined } from 'min-dash';\n\nimport { get } from 'min-dash';\n\nimport { INPUTS } from '../Util';\n\nimport { useService } from '../hooks';\n\nimport { TextFieldEntry, isTextFieldEntryEdited } from '@bpmn-io/properties-panel';\n\n\nexport default function KeyEntry(props) {\n const {\n editField,\n field\n } = props;\n\n const {\n type\n } = field;\n\n const entries = [];\n\n if (INPUTS.includes(type)) {\n entries.push({\n id: 'key',\n component: Key,\n editField: editField,\n field: field,\n isEdited: isTextFieldEntryEdited\n });\n }\n\n return entries;\n}\n\nfunction Key(props) {\n const {\n editField,\n field,\n id\n } = props;\n\n const formFieldRegistry = useService('formFieldRegistry');\n\n const debounce = useService('debounce');\n\n const path = [ 'key' ];\n\n const getValue = () => {\n return get(field, path, '');\n };\n\n const setValue = (value) => {\n return editField(field, path, value);\n };\n\n const validate = (value) => {\n if (isUndefined(value) || !value.length) {\n return 'Must not be empty.';\n }\n\n if (/\\s/.test(value)) {\n return 'Must not contain spaces.';\n }\n\n const assigned = formFieldRegistry._keys.assigned(value);\n\n if (assigned && assigned !== field) {\n return 'Must be unique.';\n }\n\n return null;\n };\n\n return TextFieldEntry({\n debounce,\n description: 'Binds to a form variable',\n element: field,\n getValue,\n id,\n label: 'Key',\n setValue,\n validate\n });\n}","import { get } from 'min-dash';\nimport { useService } from '../../hooks';\nimport { TextFieldEntry, isTextFieldEntryEdited } from '@bpmn-io/properties-panel';\n\nexport default function simpleStringEntryFactory(options) {\n const {\n id,\n label,\n path,\n props\n } = options;\n\n const {\n editField,\n field\n } = props;\n\n return {\n id,\n label,\n path,\n field,\n editField,\n component: SimpleStringComponent,\n isEdited: isTextFieldEntryEdited\n };\n}\n\nconst SimpleStringComponent = (props) => {\n const {\n id,\n label,\n path,\n field,\n editField\n } = props;\n\n const debounce = useService('debounce');\n\n const getValue = () => get(field, path, '');\n\n const setValue = (value) => editField(field, path, value);\n\n return TextFieldEntry({\n debounce,\n element: field,\n getValue,\n id,\n label,\n setValue\n });\n};\n","import { INPUTS } from '../Util';\nimport { DATETIME_SUBTYPES, DATE_LABEL_PATH, TIME_LABEL_PATH } from '@bpmn-io/form-js-viewer';\nimport { simpleStringEntryFactory } from './factories';\n\nexport default function LabelEntry(props) {\n const {\n field\n } = props;\n\n const {\n type,\n subtype\n } = field;\n\n const entries = [];\n\n if (type === 'datetime') {\n if (subtype === DATETIME_SUBTYPES.DATE || subtype === DATETIME_SUBTYPES.DATETIME) {\n entries.push(\n simpleStringEntryFactory({\n id: 'date-label',\n path: DATE_LABEL_PATH,\n label: 'Date label',\n props\n })\n );\n }\n if (subtype === DATETIME_SUBTYPES.TIME || subtype === DATETIME_SUBTYPES.DATETIME) {\n entries.push(\n simpleStringEntryFactory({\n id: 'time-label',\n path: TIME_LABEL_PATH,\n label: 'Time label',\n props\n })\n );\n }\n }\n else if (INPUTS.includes(type) || type === 'button') {\n entries.push(\n simpleStringEntryFactory({\n id: 'label',\n path: [ 'label' ],\n label: 'Field label',\n props\n })\n );\n }\n\n return entries;\n}\n","import { get } from 'min-dash';\n\nimport { useService, useVariables } from '../hooks';\n\nimport { FeelEntry, isFeelEntryEdited } from '@bpmn-io/properties-panel';\n\nexport default function SourceEntry(props) {\n const {\n editField,\n field\n } = props;\n\n const {\n type\n } = field;\n\n const entries = [];\n\n if (type === 'image') {\n entries.push({\n id: 'source',\n component: Source,\n editField: editField,\n field: field,\n isEdited: isFeelEntryEdited\n });\n }\n\n return entries;\n}\n\nfunction Source(props) {\n const {\n editField,\n field,\n id\n } = props;\n\n const debounce = useService('debounce');\n\n const variables = useVariables().map(name => ({ name }));\n\n const path = [ 'source' ];\n\n const getValue = () => {\n return get(field, path, '');\n };\n\n const setValue = (value) => {\n return editField(field, path, value);\n };\n\n return FeelEntry({\n debounce,\n description: 'Expression or static value (link/data URI)',\n element: field,\n feel: 'optional',\n getValue,\n id,\n label: 'Image source',\n setValue,\n variables\n });\n}\n","import { get } from 'min-dash';\n\nimport { useService, useVariables } from '../hooks';\n\nimport { FeelTextAreaEntry, isFeelEntryEdited } from '@bpmn-io/properties-panel';\n\n\nexport default function TextEntry(props) {\n const {\n editField,\n field\n } = props;\n\n const {\n type\n } = field;\n\n if (type !== 'text') {\n return [];\n }\n\n return [\n {\n id: 'text',\n component: Text,\n editField: editField,\n field: field,\n isEdited: isFeelEntryEdited\n }\n ];\n}\n\nfunction Text(props) {\n const {\n editField,\n field,\n id\n } = props;\n\n const debounce = useService('debounce');\n\n const variables = useVariables().map(name => ({ name }));\n\n const path = [ 'text' ];\n\n const getValue = () => {\n return get(field, path, '');\n };\n\n const setValue = (value) => {\n return editField(field, path, value);\n };\n\n return FeelTextAreaEntry({\n debounce,\n description: 'Use an Expression, Markdown or basic HTML to format.',\n element: field,\n feel: 'optional',\n getValue,\n id,\n label: 'Text',\n rows: 10,\n setValue,\n variables\n });\n}","import { NumberFieldEntry, isNumberFieldEntryEdited, TextFieldEntry, isTextFieldEntryEdited } from '@bpmn-io/properties-panel';\n\nimport Big from 'big.js';\nimport { get } from 'min-dash';\nimport { useService } from '../hooks';\nimport { countDecimals, isValidNumber } from '../Util';\n\nexport default function NumberEntries(props) {\n const {\n editField,\n field,\n id\n } = props;\n\n const {\n type\n } = field;\n\n if (type !== 'number') {\n return [];\n }\n\n const entries = [];\n\n entries.push({\n id: id + '-decimalDigits',\n component: NumberDecimalDigits,\n isEdited: isNumberFieldEntryEdited,\n editField,\n field\n });\n\n entries.push({\n id: id + '-step',\n component: NumberArrowStep,\n isEdited: isTextFieldEntryEdited,\n editField,\n field\n });\n\n return entries;\n}\n\nfunction NumberDecimalDigits(props) {\n\n const {\n editField,\n field,\n id\n } = props;\n\n const debounce = useService('debounce');\n\n const getValue = (e) => get(field, [ 'decimalDigits' ]);\n\n const setValue = (value) => editField(field, [ 'decimalDigits' ], value);\n\n return NumberFieldEntry({\n debounce,\n label: 'Decimal digits',\n element: field,\n min: 0,\n step: 1,\n getValue,\n id,\n setValue\n });\n\n}\n\nfunction NumberArrowStep(props) {\n\n const {\n editField,\n field,\n id\n } = props;\n\n const {\n decimalDigits\n } = field;\n\n const debounce = useService('debounce');\n\n const getValue = (e) => {\n\n let value = get(field, [ 'increment' ]);\n\n if (!isValidNumber(value)) return null;\n\n return value;\n };\n\n const setValue = (value) => editField(field, [ 'increment' ], value);\n\n const decimalDigitsSet = decimalDigits || decimalDigits === 0;\n\n return TextFieldEntry({\n debounce,\n label: 'Increment',\n element: field,\n getValue,\n id,\n setValue,\n validate: (value) => {\n\n if (value === undefined || value === null) return;\n\n if (!isValidNumber(value)) return 'Should be a valid number.';\n\n if (Big(value).cmp(0) <= 0) return 'Should be greater than zero.';\n\n if (decimalDigitsSet) {\n const minimumValue = Big(`1e-${decimalDigits}`);\n\n if (Big(value).cmp(minimumValue) < 0) return `Should be at least ${minimumValue.toString()}.`;\n if (countDecimals(value) > decimalDigits) return `Should not contain more than ${decimalDigits} decimal digits.`;\n\n }\n }\n });\n\n}","import { CheckboxEntry, isCheckboxEntryEdited } from '@bpmn-io/properties-panel';\n\nimport { get } from 'min-dash';\n\nimport Big from 'big.js';\n\nexport default function NumberSerializationEntry(props) {\n const {\n editField,\n field\n } = props;\n\n const {\n type\n } = field;\n\n if (type !== 'number') {\n return [];\n }\n\n const entries = [];\n\n entries.push({\n id: 'serialize-to-string',\n component: SerializeToString,\n isEdited: isCheckboxEntryEdited,\n editField,\n field\n });\n\n return entries;\n}\n\nfunction SerializeToString(props) {\n const {\n editField,\n field,\n id\n } = props;\n\n const {\n defaultValue\n } = field;\n\n const path = [ 'serializeToString' ];\n\n const getValue = () => {\n return get(field, path, '');\n };\n\n const setValue = (value) => {\n\n // Whenever changing the formatting, make sure to change the default value type along with it\n if (defaultValue || defaultValue === 0) {\n editField(field, [ 'defaultValue' ], value ? Big(defaultValue).toFixed() : Number(defaultValue));\n }\n\n return editField(field, path, value);\n };\n\n return CheckboxEntry({\n element: field,\n getValue,\n id,\n label: 'Serialize to string',\n description: 'Allows arbitrary precision values',\n setValue\n });\n}","import { CheckboxEntry, isCheckboxEntryEdited, SelectEntry, isSelectEntryEdited } from '@bpmn-io/properties-panel';\n\nimport {\n DATETIME_SUBTYPES,\n DATETIME_SUBTYPES_LABELS,\n DATETIME_SUBTYPE_PATH,\n DATE_LABEL_PATH,\n DATE_DISALLOW_PAST_PATH,\n TIME_USE24H_PATH,\n TIME_LABEL_PATH,\n TIME_INTERVAL_PATH,\n TIME_SERIALISING_FORMAT_PATH,\n TIME_SERIALISING_FORMATS\n} from '@bpmn-io/form-js-viewer';\n\nimport { get } from 'min-dash';\n\nexport default function DateTimeEntry(props) {\n const {\n editField,\n field\n } = props;\n\n const {\n type,\n subtype\n } = field;\n\n if (type !== 'datetime') {\n return [];\n }\n\n const entries = [\n {\n id: 'subtype',\n component: DateTimeSubtypeSelect,\n isEdited: isSelectEntryEdited,\n editField,\n field\n }\n ];\n\n if (subtype === DATETIME_SUBTYPES.TIME || subtype === DATETIME_SUBTYPES.DATETIME) {\n\n entries.push({\n id: 'use24h',\n component: Use24h,\n isEdited: isCheckboxEntryEdited,\n editField,\n field\n });\n\n }\n\n return entries;\n}\n\nfunction DateTimeSubtypeSelect(props) {\n\n const {\n editField,\n field,\n id\n } = props;\n\n const getValue = (e) => get(field, DATETIME_SUBTYPE_PATH);\n\n const clearTimeConfig = () => {\n const timeConfigPaths = [ TIME_LABEL_PATH, TIME_USE24H_PATH, TIME_INTERVAL_PATH, TIME_SERIALISING_FORMAT_PATH ];\n for (const path of timeConfigPaths) {\n editField(field, path, undefined);\n }\n };\n\n const initTimeConfig = () => {\n editField(field, TIME_LABEL_PATH, 'Time');\n editField(field, TIME_SERIALISING_FORMAT_PATH, TIME_SERIALISING_FORMATS.UTC_OFFSET);\n editField(field, TIME_INTERVAL_PATH, 15);\n };\n\n const clearDateConfig = () => {\n const dateConfigPaths = [ DATE_LABEL_PATH, DATE_DISALLOW_PAST_PATH ];\n for (const path of dateConfigPaths) {\n editField(field, path, undefined);\n }\n };\n\n const initDateConfig = () => {\n editField(field, DATE_LABEL_PATH, 'Date');\n };\n\n const setValue = (value) => {\n\n const oldValue = getValue();\n\n if (oldValue === value) return;\n\n if (value === DATETIME_SUBTYPES.DATE) {\n clearTimeConfig();\n oldValue === DATETIME_SUBTYPES.TIME && initDateConfig();\n }\n else if (value === DATETIME_SUBTYPES.TIME) {\n clearDateConfig();\n oldValue === DATETIME_SUBTYPES.DATE && initTimeConfig();\n }\n else if (value === DATETIME_SUBTYPES.DATETIME) {\n oldValue === DATETIME_SUBTYPES.DATE && initTimeConfig();\n oldValue === DATETIME_SUBTYPES.TIME && initDateConfig();\n }\n\n return editField(field, DATETIME_SUBTYPE_PATH, value);\n };\n\n const getDatetimeSubtypes = () => {\n\n return Object.values(DATETIME_SUBTYPES).map((subtype) => ({\n label: DATETIME_SUBTYPES_LABELS[subtype],\n value: subtype\n }));\n };\n\n return SelectEntry({\n label: 'Subtype',\n element: field,\n getOptions: getDatetimeSubtypes,\n getValue,\n id,\n setValue\n });\n}\n\nfunction Use24h(props) {\n const {\n editField,\n field,\n id\n } = props;\n\n const path = TIME_USE24H_PATH;\n\n const getValue = () => {\n return get(field, path, '');\n };\n\n const setValue = (value) => {\n return editField(field, path, value);\n };\n\n return CheckboxEntry({\n element: field,\n getValue,\n id,\n label: 'Use 24h',\n setValue\n });\n}\n","import { CheckboxEntry, isCheckboxEntryEdited, SelectEntry, isSelectEntryEdited } from '@bpmn-io/properties-panel';\n\nimport { DATETIME_SUBTYPES, DATE_DISALLOW_PAST_PATH, TIME_INTERVAL_PATH } from '@bpmn-io/form-js-viewer';\n\nimport { get } from 'min-dash';\n\nexport default function DateTimeConstraintsEntry(props) {\n const {\n editField,\n field,\n id\n } = props;\n\n const {\n type,\n subtype\n } = field;\n\n if (type !== 'datetime') {\n return [];\n }\n\n const entries = [];\n\n if (subtype === DATETIME_SUBTYPES.TIME || subtype === DATETIME_SUBTYPES.DATETIME) {\n entries.push({\n id: id + '-timeInterval',\n component: TimeIntervalSelect,\n isEdited: isSelectEntryEdited,\n editField,\n field\n });\n }\n\n if (subtype === DATETIME_SUBTYPES.DATE || subtype === DATETIME_SUBTYPES.DATETIME) {\n entries.push({\n id: id + '-disallowPassedDates',\n component: DisallowPassedDates,\n isEdited: isCheckboxEntryEdited,\n editField,\n field\n });\n }\n\n return entries;\n}\n\nfunction DisallowPassedDates(props) {\n const {\n editField,\n field,\n id\n } = props;\n\n const path = DATE_DISALLOW_PAST_PATH;\n\n const getValue = () => {\n return get(field, path, '');\n };\n\n const setValue = (value) => {\n return editField(field, path, value);\n };\n\n return CheckboxEntry({\n element: field,\n getValue,\n id,\n label: 'Disallow past dates',\n setValue\n });\n}\n\nfunction TimeIntervalSelect(props) {\n\n const {\n editField,\n field,\n id\n } = props;\n\n const timeIntervals = [ 1, 5, 10, 15, 30, 60 ];\n\n const getValue = (e) => get(field, TIME_INTERVAL_PATH);\n\n const setValue = (value) => editField(field, TIME_INTERVAL_PATH, parseInt(value));\n\n const getTimeIntervals = () => {\n\n return timeIntervals.map((timeInterval) => ({\n label: timeInterval === 60 ? '1h' : (timeInterval + 'm'),\n value: timeInterval\n }));\n };\n\n return SelectEntry({\n label: 'Time interval',\n element: field,\n getOptions: getTimeIntervals,\n getValue,\n id,\n setValue\n });\n}","import { SelectEntry, isSelectEntryEdited } from '@bpmn-io/properties-panel';\n\nimport { DATETIME_SUBTYPES, TIME_SERIALISING_FORMATS, TIME_SERIALISINGFORMAT_LABELS, TIME_SERIALISING_FORMAT_PATH } from '@bpmn-io/form-js-viewer';\n\nimport { get } from 'min-dash';\n\nexport default function DateTimeFormatEntry(props) {\n const {\n editField,\n field\n } = props;\n\n const {\n type,\n subtype\n } = field;\n\n if (type !== 'datetime') {\n return [];\n }\n\n const entries = [];\n\n if (subtype === DATETIME_SUBTYPES.TIME || subtype === DATETIME_SUBTYPES.DATETIME) {\n entries.push({\n id: 'time-format',\n component: TimeFormatSelect,\n isEdited: isSelectEntryEdited,\n editField,\n field\n });\n }\n\n return entries;\n}\n\nfunction TimeFormatSelect(props) {\n\n const {\n editField,\n field,\n id\n } = props;\n\n const getValue = (e) => get(field, TIME_SERIALISING_FORMAT_PATH);\n\n const setValue = (value) => editField(field, TIME_SERIALISING_FORMAT_PATH, value);\n\n const getTimeSerialisingFormats = () => {\n\n return Object.values(TIME_SERIALISING_FORMATS).map((format) => ({\n label: TIME_SERIALISINGFORMAT_LABELS[format],\n value: format\n }));\n };\n\n return SelectEntry({\n label: 'Time format',\n element: field,\n getOptions: getTimeSerialisingFormats,\n getValue,\n id,\n setValue\n });\n}","import {\n get,\n set\n} from 'min-dash';\n\nimport { useService } from '../hooks';\n\nimport { TextFieldEntry } from '@bpmn-io/properties-panel';\n\n\nexport default function ValueEntry(props) {\n const {\n editField,\n field,\n idPrefix,\n index,\n validateFactory\n } = props;\n\n const entries = [\n {\n component: Label,\n editField,\n field,\n id: idPrefix + '-label',\n idPrefix,\n index,\n validateFactory\n },\n {\n component: Value,\n editField,\n field,\n id: idPrefix + '-value',\n idPrefix,\n index,\n validateFactory\n }\n ];\n\n return entries;\n}\n\nfunction Label(props) {\n const {\n editField,\n field,\n id,\n index,\n validateFactory\n } = props;\n\n const debounce = useService('debounce');\n\n const setValue = (value) => {\n const values = get(field, [ 'values' ]);\n return editField(field, 'values', set(values, [ index, 'label' ], value));\n };\n\n const getValue = () => {\n return get(field, [ 'values', index, 'label' ]);\n };\n\n return TextFieldEntry({\n debounce,\n element: field,\n getValue,\n id,\n label: 'Label',\n setValue,\n validate: validateFactory(getValue())\n });\n}\n\nfunction Value(props) {\n const {\n editField,\n field,\n id,\n index,\n validateFactory\n } = props;\n\n const debounce = useService('debounce');\n\n const setValue = (value) => {\n const values = get(field, [ 'values' ]);\n return editField(field, 'values', set(values, [ index, 'value' ], value));\n };\n\n const getValue = () => {\n return get(field, [ 'values', index, 'value' ]);\n };\n\n return TextFieldEntry({\n debounce,\n element: field,\n getValue,\n id,\n label: 'Value',\n setValue,\n validate: validateFactory(getValue())\n });\n}","import { get } from 'min-dash';\n\nimport { useService } from '../hooks';\n\nimport { TextFieldEntry } from '@bpmn-io/properties-panel';\n\n\nexport default function CustomValueEntry(props) {\n const {\n editField,\n field,\n idPrefix,\n index,\n validateFactory\n } = props;\n\n const entries = [\n {\n component: Key,\n editField,\n field,\n id: idPrefix + '-key',\n idPrefix,\n index,\n validateFactory\n },\n {\n component: Value,\n editField,\n field,\n id: idPrefix + '-value',\n idPrefix,\n index,\n validateFactory\n }\n ];\n\n return entries;\n}\n\nfunction Key(props) {\n const {\n editField,\n field,\n id,\n index,\n validateFactory\n } = props;\n\n const debounce = useService('debounce');\n\n const setValue = (value) => {\n const properties = get(field, [ 'properties' ]);\n const key = Object.keys(properties)[ index ];\n return editField(field, 'properties', updateKey(properties, key, value));\n };\n\n const getValue = () => {\n return Object.keys(get(field, [ 'properties' ]))[ index ];\n };\n\n return TextFieldEntry({\n debounce,\n element: field,\n getValue,\n id,\n label: 'Key',\n setValue,\n validate: validateFactory(getValue())\n });\n}\n\nfunction Value(props) {\n const {\n editField,\n field,\n id,\n index,\n validateFactory\n } = props;\n\n const debounce = useService('debounce');\n\n const setValue = (value) => {\n const properties = get(field, [ 'properties' ]);\n const key = Object.keys(properties)[ index ];\n editField(field, 'properties', updateValue(properties, key, value));\n };\n\n const getValue = () => {\n const properties = get(field, [ 'properties' ]);\n const key = Object.keys(properties)[ index ];\n return get(field, [ 'properties', key ]);\n };\n\n return TextFieldEntry({\n debounce,\n element: field,\n getValue,\n id,\n label: 'Value',\n setValue,\n validate: validateFactory(getValue())\n });\n}\n\n\n// helpers //////////\n\n/**\n * Returns copy of object with updated value.\n *\n * @param {Object} properties\n * @param {string} key\n * @param {string} value\n *\n * @returns {Object}\n */\nfunction updateValue(properties, key, value) {\n return {\n ...properties,\n [ key ]: value\n };\n}\n\n/**\n * Returns copy of object with updated key.\n *\n * @param {Object} properties\n * @param {string} oldKey\n * @param {string} newKey\n *\n * @returns {Object}\n */\nfunction updateKey(properties, oldKey, newKey) {\n return Object.entries(properties).reduce((newProperties, entry) => {\n const [ key, value ] = entry;\n\n return {\n ...newProperties,\n [ key === oldKey ? newKey : key ]: value\n };\n }, {});\n}","import { SelectEntry, isSelectEntryEdited } from '@bpmn-io/properties-panel';\nimport { getValuesSource, VALUES_SOURCES, VALUES_SOURCES_DEFAULTS, VALUES_SOURCES_LABELS, VALUES_SOURCES_PATHS } from '@bpmn-io/form-js-viewer';\n\nexport default function ValuesSourceSelectEntry(props) {\n const {\n editField,\n field,\n id\n } = props;\n\n return [\n {\n id: id + '-select',\n component: ValuesSourceSelect,\n isEdited: isSelectEntryEdited,\n editField,\n field\n }\n ];\n}\n\nfunction ValuesSourceSelect(props) {\n\n const {\n editField,\n field,\n id\n } = props;\n\n const getValue = getValuesSource;\n\n const setValue = (value) => {\n\n let newField = field;\n\n const newProperties = {};\n\n Object.values(VALUES_SOURCES).forEach(source => {\n\n // Clear all values source definitions and default the newly selected one\n const newValue = value === source ? VALUES_SOURCES_DEFAULTS[source] : undefined;\n newProperties[VALUES_SOURCES_PATHS[source]] = newValue;\n });\n\n newField = editField(field, newProperties);\n return newField;\n };\n\n const getValuesSourceOptions = () => {\n\n return Object.values(VALUES_SOURCES).map((valueSource) => ({\n label: VALUES_SOURCES_LABELS[valueSource],\n value: valueSource\n }));\n };\n\n return SelectEntry({\n label: 'Type',\n element: field,\n getOptions: getValuesSourceOptions,\n getValue,\n id,\n setValue\n });\n}\n","import { TextFieldEntry, isTextFieldEntryEdited } from '@bpmn-io/properties-panel';\nimport { get, isUndefined } from 'min-dash';\nimport { useService } from '../hooks';\nimport { VALUES_SOURCES, VALUES_SOURCES_PATHS } from '@bpmn-io/form-js-viewer';\n\n\nexport default function InputKeyValuesSourceEntry(props) {\n const {\n editField,\n field,\n id\n } = props;\n\n return [\n {\n id: id + '-key',\n component: InputValuesKey,\n label: 'Input values key',\n description: 'Define which input property to populate the values from',\n isEdited: isTextFieldEntryEdited,\n editField,\n field,\n }\n ];\n}\n\nfunction InputValuesKey(props) {\n const {\n editField,\n field,\n id,\n label,\n description\n } = props;\n\n const debounce = useService('debounce');\n\n const path = VALUES_SOURCES_PATHS[VALUES_SOURCES.INPUT];\n\n const getValue = () => get(field, path, '');\n\n const setValue = (value) => editField(field, path, value || '');\n\n const validate = (value) => {\n if (isUndefined(value) || !value.length) {\n return 'Must not be empty.';\n }\n\n if (/\\s/.test(value)) {\n return 'Must not contain spaces.';\n }\n\n return null;\n };\n\n return TextFieldEntry({\n debounce,\n description,\n element: field,\n getValue,\n id,\n label,\n setValue,\n validate\n });\n}\n","import { isUndefined, without } from 'min-dash';\nimport { arrayAdd } from '../Util';\nimport ValueEntry from './ValueEntry';\nimport { VALUES_SOURCES, VALUES_SOURCES_PATHS } from '@bpmn-io/form-js-viewer';\n\nexport default function StaticValuesSourceEntry(props) {\n const {\n editField,\n field,\n id: idPrefix\n } = props;\n\n const {\n values\n } = field;\n\n const addEntry = (e) => {\n\n e.stopPropagation();\n\n const index = values.length + 1;\n\n const entry = getIndexedEntry(index);\n\n editField(field, VALUES_SOURCES_PATHS[VALUES_SOURCES.STATIC], arrayAdd(values, values.length, entry));\n };\n\n const removeEntry = (entry) => {\n editField(field, VALUES_SOURCES_PATHS[VALUES_SOURCES.STATIC], without(values, entry));\n };\n\n const validateFactory = (key) => {\n return (value) => {\n if (value === key) {\n return;\n }\n\n if (isUndefined(value) || !value.length) {\n return 'Must not be empty.';\n }\n\n const isValueAssigned = values.find(entry => entry.value === value);\n\n if (isValueAssigned) {\n return 'Must be unique.';\n }\n };\n };\n\n const items = values.map((entry, index) => {\n const id = idPrefix + '-' + index;\n\n return {\n id,\n label: entry.label,\n entries: ValueEntry({\n editField,\n field,\n idPrefix: id,\n index,\n validateFactory\n }),\n autoFocusEntry: id + '-label',\n remove: () => removeEntry(entry)\n };\n });\n\n return {\n items,\n add: addEntry,\n shouldSort: false\n };\n}\n\n\n// helper\n\nfunction getIndexedEntry(index) {\n const entry = {\n label: 'Value',\n value: 'value'\n };\n\n if (index > 1) {\n entry.label += ` ${index}`;\n entry.value += `${index}`;\n }\n\n return entry;\n}","import { TextFieldEntry, isTextFieldEntryEdited } from '@bpmn-io/properties-panel';\n\nimport { get, set } from 'min-dash';\nimport { useService } from '../hooks';\n\nexport default function AdornerEntry(props) {\n const {\n editField,\n field\n } = props;\n\n const {\n type\n } = field;\n\n const entries = [];\n\n const onChange = (key) => {\n return (value) => {\n const appearance = get(field, [ 'appearance' ], {});\n\n editField(field, [ 'appearance' ], set(appearance, [ key ], value));\n };\n };\n\n const getValue = (key) => {\n return () => {\n return get(field, [ 'appearance', key ]);\n };\n };\n\n if ([ 'number', 'textfield' ].includes(type)) {\n entries.push({\n id: 'prefix-adorner',\n component: PrefixAdorner,\n isEdited: isTextFieldEntryEdited,\n editField,\n field,\n onChange,\n getValue\n });\n\n entries.push({\n id: 'suffix-adorner',\n component: SuffixAdorner,\n isEdited: isTextFieldEntryEdited,\n editField,\n field,\n onChange,\n getValue\n });\n }\n\n return entries;\n}\n\nfunction PrefixAdorner(props) {\n const {\n field,\n id,\n onChange,\n getValue\n } = props;\n\n const debounce = useService('debounce');\n\n return TextFieldEntry({\n debounce,\n element: field,\n getValue: getValue('prefixAdorner'),\n id,\n label: 'Prefix',\n setValue: onChange('prefixAdorner')\n });\n}\n\nfunction SuffixAdorner(props) {\n const {\n field,\n id,\n onChange,\n getValue\n } = props;\n\n const debounce = useService('debounce');\n\n return TextFieldEntry({\n debounce,\n element: field,\n getValue: getValue('suffixAdorner'),\n id,\n label: 'Suffix',\n setValue: onChange('suffixAdorner')\n });\n}","import { FeelEntry, isFeelEntryEdited } from '@bpmn-io/properties-panel';\nimport { get } from 'min-dash';\n\nimport { useService, useVariables } from '../hooks';\n\n\nexport function ConditionEntry(props) {\n const {\n editField,\n field\n } = props;\n\n return [\n {\n id: 'conditional-hide',\n component: Condition,\n editField: editField,\n field: field,\n isEdited: isFeelEntryEdited\n }\n ];\n}\n\n\nfunction Condition(props) {\n const {\n editField,\n field,\n id\n } = props;\n\n const debounce = useService('debounce');\n\n const variables = useVariables().map(name => ({ name }));\n\n const path = [ 'conditional', 'hide' ];\n\n const getValue = () => {\n return get(field, path, '');\n };\n\n const setValue = (value) => {\n if (!value) {\n return editField(field, 'conditional', undefined);\n }\n\n return editField(field, 'conditional', { hide: value });\n };\n\n return FeelEntry({\n debounce,\n description: 'Condition under which the field is hidden',\n element: field,\n feel: 'required',\n getValue,\n id,\n label: 'Hide if',\n setValue,\n variables\n });\n}\n","import {\n ActionEntry,\n AltTextEntry,\n ColumnsEntry,\n DescriptionEntry,\n DefaultValueEntry,\n DisabledEntry,\n IdEntry,\n ImageSourceEntry,\n KeyEntry,\n LabelEntry,\n TextEntry,\n NumberEntries,\n DateTimeEntry\n} from '../entries';\n\n\nexport default function GeneralGroup(field, editField) {\n\n const entries = [\n ...IdEntry({ field, editField }),\n ...LabelEntry({ field, editField }),\n ...DescriptionEntry({ field, editField }),\n ...KeyEntry({ field, editField }),\n ...DefaultValueEntry({ field, editField }),\n ...ActionEntry({ field, editField }),\n ...ColumnsEntry({ field, editField }),\n ...DateTimeEntry({ field, editField }),\n ...TextEntry({ field, editField }),\n ...NumberEntries({ field, editField }),\n ...ImageSourceEntry({ field, editField }),\n ...AltTextEntry({ field, editField }),\n ...DisabledEntry({ field, editField })\n ];\n\n return {\n id: 'general',\n label: 'General',\n entries\n };\n}","import {\n NumberSerializationEntry,\n DateTimeSerializationEntry\n} from '../entries';\n\n\nexport default function SerializationGroup(field, editField) {\n\n const entries = [\n ...NumberSerializationEntry({ field, editField }),\n ...DateTimeSerializationEntry({ field, editField })\n ];\n\n if (!entries.length) {\n return null;\n }\n\n return {\n id: 'serialization',\n label: 'Serialization',\n entries\n };\n}","import {\n DateTimeConstraintsEntry\n} from '../entries';\n\n\nexport default function ConstraintsGroup(field, editField) {\n\n const entries = [\n ...DateTimeConstraintsEntry({ field, editField })\n ];\n\n if (!entries.length) {\n return null;\n }\n\n return {\n id: 'constraints',\n label: 'Constraints',\n entries\n };\n}","import {\n get,\n set\n} from 'min-dash';\n\nimport {\n CheckboxEntry,\n isCheckboxEntryEdited,\n isNumberFieldEntryEdited,\n isTextFieldEntryEdited,\n NumberFieldEntry,\n TextFieldEntry,\n SelectEntry\n} from '@bpmn-io/properties-panel';\n\nimport { useService } from '../hooks';\n\nimport { INPUTS } from '../Util';\n\nconst VALIDATION_TYPE_OPTIONS = {\n custom: {\n value: 'custom',\n label: 'Custom',\n },\n email: {\n value: 'email',\n label: 'Email',\n },\n phone: {\n value: 'phone',\n label: 'Phone',\n },\n};\n\nexport default function ValidationGroup(field, editField) {\n const { type } = field;\n const validate = get(field, [ 'validate' ], {});\n const isCustomValidation = [ undefined, VALIDATION_TYPE_OPTIONS.custom.value ].includes(validate?.validationType);\n\n if (!(INPUTS.includes(type) && type !== 'checkbox' && type !== 'checklist' && type !== 'taglist')) {\n return null;\n }\n\n const onChange = (key) => {\n return (value) => {\n const validate = get(field, [ 'validate' ], {});\n\n editField(field, [ 'validate' ], set(validate, [ key ], value));\n };\n };\n\n const getValue = (key) => {\n return () => {\n return get(field, [ 'validate', key ]);\n };\n };\n\n let entries = [\n {\n id: 'required',\n component: Required,\n getValue,\n field,\n isEdited: isCheckboxEntryEdited,\n onChange\n }\n ];\n\n if (type === 'textfield') {\n entries.push(\n {\n id: 'validationType',\n component: ValidationType,\n getValue,\n field,\n isEdited: isTextFieldEntryEdited,\n onChange\n }\n );\n }\n\n if (type === 'textarea' || (type === 'textfield' && isCustomValidation)) {\n entries.push(\n {\n id: 'minLength',\n component: MinLength,\n getValue,\n field,\n isEdited: isNumberFieldEntryEdited,\n onChange\n },\n {\n id: 'maxLength',\n component: MaxLength,\n getValue,\n field,\n isEdited: isNumberFieldEntryEdited,\n onChange\n }\n );\n }\n\n if (type === 'textfield' && isCustomValidation) {\n entries.push(\n {\n id: 'pattern',\n component: Pattern,\n getValue,\n field,\n isEdited: isTextFieldEntryEdited,\n onChange\n }\n );\n }\n\n if (type === 'number') {\n entries.push(\n {\n id: 'min',\n component: Min,\n getValue,\n field,\n isEdited: isNumberFieldEntryEdited,\n onChange\n },\n {\n id: 'max',\n component: Max,\n getValue,\n field,\n isEdited: isNumberFieldEntryEdited,\n onChange\n }\n );\n }\n\n return {\n id: 'validation',\n label: 'Validation',\n entries\n };\n}\n\nfunction Required(props) {\n const {\n field,\n getValue,\n id,\n onChange\n } = props;\n\n return CheckboxEntry({\n element: field,\n getValue: getValue('required'),\n id,\n label: 'Required',\n setValue: onChange('required')\n });\n}\n\nfunction MinLength(props) {\n const {\n field,\n getValue,\n id,\n onChange\n } = props;\n\n const debounce = useService('debounce');\n\n return NumberFieldEntry({\n debounce,\n element: field,\n getValue: getValue('minLength'),\n id,\n label: 'Minimum length',\n min: 0,\n setValue: onChange('minLength')\n });\n}\n\nfunction MaxLength(props) {\n const {\n field,\n getValue,\n id,\n onChange\n } = props;\n\n const debounce = useService('debounce');\n\n return NumberFieldEntry({\n debounce,\n element: field,\n getValue: getValue('maxLength'),\n id,\n label: 'Maximum length',\n min: 0,\n setValue: onChange('maxLength')\n });\n}\n\nfunction Pattern(props) {\n const {\n field,\n getValue,\n id,\n onChange\n } = props;\n\n const debounce = useService('debounce');\n\n return TextFieldEntry({\n debounce,\n element: field,\n getValue: getValue('pattern'),\n id,\n label: 'Regular expression pattern',\n setValue: onChange('pattern')\n });\n}\n\nfunction Min(props) {\n const {\n field,\n getValue,\n id,\n onChange\n } = props;\n\n const debounce = useService('debounce');\n\n return NumberFieldEntry({\n debounce,\n element: field,\n getValue: getValue('min'),\n id,\n label: 'Minimum',\n min: 0,\n setValue: onChange('min')\n });\n}\n\nfunction Max(props) {\n const {\n field,\n getValue,\n id,\n onChange\n } = props;\n\n const debounce = useService('debounce');\n\n return NumberFieldEntry({\n debounce,\n element: field,\n getValue: getValue('max'),\n id,\n label: 'Maximum',\n min: 0,\n setValue: onChange('max')\n });\n}\n\nfunction ValidationType(props) {\n const {\n field,\n getValue,\n id,\n onChange\n } = props;\n\n const debounce = useService('debounce');\n\n return SelectEntry({\n debounce,\n element: field,\n getValue: getValue('validationType'),\n id,\n label: 'Regular expression validation',\n setValue: onChange('validationType'),\n getOptions() {\n return Object.values(VALIDATION_TYPE_OPTIONS);\n }\n });\n}\n","import { ValuesSourceSelectEntry, StaticValuesSourceEntry, InputKeyValuesSourceEntry } from '../entries';\nimport { getValuesSource, VALUES_SOURCES } from '@bpmn-io/form-js-viewer';\n\nimport { Group, ListGroup } from '@bpmn-io/properties-panel';\n\nimport {\n VALUES_INPUTS\n} from '../Util';\n\nexport default function ValuesGroups(field, editField) {\n const {\n type,\n id: fieldId\n } = field;\n\n if (!VALUES_INPUTS.includes(type)) {\n return [];\n }\n\n const context = { editField, field };\n const valuesSourceId = `${fieldId}-valuesSource`;\n\n /**\n * @type {Array<Group|ListGroup>}\n */\n const groups = [\n {\n id: valuesSourceId,\n label: 'Options source',\n component: Group,\n entries: ValuesSourceSelectEntry({ ...context, id: valuesSourceId })\n }\n ];\n\n const valuesSource = getValuesSource(field);\n\n if (valuesSource === VALUES_SOURCES.INPUT) {\n const dynamicValuesId = `${fieldId}-dynamicValues`;\n groups.push({\n id: dynamicValuesId,\n label: 'Dynamic options',\n component: Group,\n entries: InputKeyValuesSourceEntry({ ...context, id: dynamicValuesId })\n });\n }\n else if (valuesSource === VALUES_SOURCES.STATIC) {\n const staticValuesId = `${fieldId}-staticValues`;\n groups.push({\n id: staticValuesId,\n label: 'Static options',\n component: ListGroup,\n ...StaticValuesSourceEntry({ ...context, id: staticValuesId })\n });\n }\n\n return groups;\n}","import { ListGroup } from '@bpmn-io/properties-panel';\n\nimport {\n has,\n isUndefined\n} from 'min-dash';\n\nimport { CustomValueEntry } from '../entries';\n\nexport default function CustomValuesGroup(field, editField) {\n const {\n properties = {},\n type\n } = field;\n\n if (type === 'default') {\n return null;\n }\n\n const addEntry = (event) => {\n event.stopPropagation();\n\n const index = Object.keys(properties).length + 1;\n\n const key = `key${ index }`,\n value = 'value';\n\n editField(field, [ 'properties' ], { ...properties, [ key ]: value });\n };\n\n const validateFactory = (key) => {\n return (value) => {\n if (value === key) {\n return;\n }\n\n if (isUndefined(value) || !value.length) {\n return 'Must not be empty.';\n }\n\n if (has(properties, value)) {\n return 'Must be unique.';\n }\n };\n };\n\n const items = Object.keys(properties).map((key, index) => {\n const removeEntry = (event) => {\n event.stopPropagation();\n\n return editField(field, [ 'properties' ], removeKey(properties, key));\n };\n\n const id = `${ field.id }-property-${ index }`;\n\n return {\n autoFocusEntry: id + '-key',\n entries: CustomValueEntry({\n editField,\n field,\n idPrefix: id,\n index,\n validateFactory\n }),\n id,\n label: key || '',\n remove: removeEntry\n };\n });\n\n return {\n add: addEntry,\n component: ListGroup,\n id: 'custom-values',\n items,\n label: 'Custom properties',\n shouldSort: false\n };\n}\n\n\n// helpers //////////\n\n/**\n * Returns copy of object without key.\n *\n * @param {Object} properties\n * @param {string} oldKey\n *\n * @returns {Object}\n */\nexport function removeKey(properties, oldKey) {\n return Object.entries(properties).reduce((newProperties, entry) => {\n const [ key, value ] = entry;\n\n if (key === oldKey) {\n return newProperties;\n }\n\n return {\n ...newProperties,\n [ key ]: value\n };\n }, {});\n}","import {\n AdornerEntry\n} from '../entries';\n\n\nexport default function AppearanceGroup(field, editField) {\n\n const entries = [\n ...AdornerEntry({ field, editField })\n ];\n\n if (!entries.length) {\n return null;\n }\n\n return {\n id: 'appearance',\n label: 'Appearance',\n entries\n };\n}","import {\n ConditionEntry\n} from '../entries';\n\n\nexport function ConditionGroup(field, editField) {\n\n const { type } = field;\n\n if (type === 'default') {\n return null;\n }\n\n const entries = [\n ...ConditionEntry({ field, editField })\n ];\n\n return {\n id: 'condition',\n label: 'Condition',\n entries\n };\n}","import { PropertiesPanel } from '@bpmn-io/properties-panel';\n\nimport {\n useCallback,\n useState,\n useLayoutEffect\n} from 'preact/hooks';\n\nimport { FormPropertiesPanelContext } from './context';\n\nimport { PropertiesPanelHeaderProvider } from './PropertiesPanelHeaderProvider';\nimport { PropertiesPanelPlaceholderProvider } from './PropertiesPanelPlaceholderProvider';\n\nimport {\n ConditionGroup,\n AppearanceGroup,\n CustomValuesGroup,\n GeneralGroup,\n SerializationGroup,\n ConstraintsGroup,\n ValidationGroup,\n ValuesGroups\n} from './groups';\n\nfunction getGroups(field, editField) {\n\n if (!field) {\n return [];\n }\n\n const groups = [\n GeneralGroup(field, editField),\n ConditionGroup(field, editField),\n AppearanceGroup(field, editField),\n SerializationGroup(field, editField),\n ...ValuesGroups(field, editField),\n ConstraintsGroup(field, editField),\n ValidationGroup(field, editField),\n CustomValuesGroup(field, editField)\n ];\n\n // contract: if a group returns null, it should not be displayed at all\n return groups.filter(group => group !== null);\n}\n\nexport default function FormPropertiesPanel(props) {\n const {\n eventBus,\n injector\n } = props;\n\n const formEditor = injector.get('formEditor');\n const modeling = injector.get('modeling');\n const selection = injector.get('selection');\n\n const { schema } = formEditor._getState();\n\n const [ state, setState ] = useState({\n selectedFormField: selection.get() || schema\n });\n\n const _update = (field) => {\n\n setState({\n ...state,\n selectedFormField: field\n });\n\n // notify interested parties on property panel updates\n eventBus.fire('propertiesPanel.updated', {\n formField: field\n });\n };\n\n useLayoutEffect(() => {\n function onSelectionChange(event) {\n _update(event.selection || schema);\n }\n\n eventBus.on('selection.changed', onSelectionChange);\n\n return () => {\n eventBus.off('selection.changed', onSelectionChange);\n };\n }, []);\n\n useLayoutEffect(() => {\n const onFieldChanged = () => {\n\n /**\n * TODO(pinussilvestrus): update with actual updated element,\n * once we have a proper updater/change support\n */\n _update(selection.get() || schema);\n };\n\n eventBus.on('changed', onFieldChanged);\n\n return () => {\n eventBus.off('changed', onFieldChanged);\n };\n }, []);\n\n const selectedFormField = state.selectedFormField;\n\n const propertiesPanelContext = {\n getService(type, strict = true) {\n return injector.get(type, strict);\n }\n };\n\n const onFocus = () => eventBus.fire('propertiesPanel.focusin');\n\n const onBlur = () => eventBus.fire('propertiesPanel.focusout');\n\n const editField = useCallback((formField, key, value) => modeling.editFormField(formField, key, value), [ modeling ]);\n\n return (\n <div\n class=\"fjs-properties-panel\"\n data-field={ selectedFormField && selectedFormField.id }\n onFocusCapture={ onFocus }\n onBlurCapture={ onBlur }\n >\n <FormPropertiesPanelContext.Provider value={ propertiesPanelContext }>\n <PropertiesPanel\n element={ selectedFormField }\n eventBus={ eventBus }\n groups={ getGroups(selectedFormField, editField) }\n headerProvider={ PropertiesPanelHeaderProvider }\n placeholderProvider={ PropertiesPanelPlaceholderProvider }\n />\n </FormPropertiesPanelContext.Provider>\n </div>\n );\n}","import PropertiesPanel from './PropertiesPanel';\n\nimport {\n render\n} from 'preact';\n\nimport {\n domify,\n query as domQuery\n} from 'min-dom';\n\n/**\n * @typedef { { parent: Element } } PropertiesPanelConfig\n * @typedef { import('../../core/EventBus').default } EventBus\n * @typedef { import('../../types').Injector } Injector\n */\n\n/**\n * @param {PropertiesPanelConfig} propertiesPanelConfig\n * @param {Injector} injector\n * @param {EventBus} eventBus\n */\nexport default class PropertiesPanelRenderer {\n\n constructor(propertiesPanelConfig, injector, eventBus) {\n const {\n parent\n } = propertiesPanelConfig || {};\n\n this._eventBus = eventBus;\n this._injector = injector;\n\n this._container = domify('<div class=\"fjs-properties-container\" input-handle-modified-keys=\"y,z\"></div>');\n\n if (parent) {\n this.attachTo(parent);\n }\n\n this._eventBus.once('formEditor.rendered', 500, () => {\n this._render();\n });\n }\n\n\n /**\n * Attach the properties panel to a parent node.\n *\n * @param {HTMLElement} container\n */\n attachTo(container) {\n if (!container) {\n throw new Error('container required');\n }\n\n if (typeof container === 'string') {\n container = domQuery(container);\n }\n\n // (1) detach from old parent\n this.detach();\n\n // (2) append to parent container\n container.appendChild(this._container);\n\n // (3) notify interested parties\n this._eventBus.fire('propertiesPanel.attach');\n }\n\n /**\n * Detach the properties panel from its parent node.\n */\n detach() {\n const parentNode = this._container.parentNode;\n\n if (parentNode) {\n parentNode.removeChild(this._container);\n\n this._eventBus.fire('propertiesPanel.detach');\n }\n }\n\n _render() {\n render(\n <PropertiesPanel\n eventBus={ this._eventBus }\n injector={ this._injector }\n />,\n this._container\n );\n\n this._eventBus.fire('propertiesPanel.rendered');\n }\n\n _destroy() {\n if (this._container) {\n render(null, this._container);\n\n this._eventBus.fire('propertiesPanel.destroyed');\n }\n }\n}\n\nPropertiesPanelRenderer.$inject = [ 'config.propertiesPanel', 'injector', 'eventBus' ];","import PropertiesPanelRenderer from './PropertiesPanelRenderer';\n\nexport default {\n __init__: [ 'propertiesPanel' ],\n propertiesPanel: [ 'type', PropertiesPanelRenderer ]\n};","import { clone, createFormContainer, createInjector, schemaVersion } from '@bpmn-io/form-js-viewer';\nimport Ids from 'ids';\nimport { isString, set } from 'min-dash';\n\nimport core from './core';\n\nimport EditorActionsModule from './features/editor-actions';\nimport KeyboardModule from './features/keyboard';\nimport ModelingModule from './features/modeling';\nimport SelectionModule from './features/selection';\nimport PaletteModule from './features/palette';\nimport PropertiesPanelModule from './features/properties-panel';\n\nconst ids = new Ids([ 32, 36, 1 ]);\n\n/**\n * @typedef { import('./types').Injector } Injector\n * @typedef { import('./types').Module } Module\n * @typedef { import('./types').Schema } Schema\n *\n * @typedef { import('./types').FormEditorOptions } FormEditorOptions\n * @typedef { import('./types').FormEditorProperties } FormEditorProperties\n *\n * @typedef { {\n * properties: FormEditorProperties,\n * schema: Schema\n * } } State\n *\n * @typedef { (type:string, priority:number, handler:Function) => void } OnEventWithPriority\n * @typedef { (type:string, handler:Function) => void } OnEventWithOutPriority\n * @typedef { OnEventWithPriority & OnEventWithOutPriority } OnEventType\n */\n\n/**\n * The form editor.\n */\nexport default class FormEditor {\n\n /**\n * @constructor\n * @param {FormEditorOptions} options\n */\n constructor(options = {}) {\n\n /**\n * @public\n * @type {OnEventType}\n */\n this.on = this._onEvent;\n\n /**\n * @public\n * @type {String}\n */\n this._id = ids.next();\n\n /**\n * @private\n * @type {Element}\n */\n this._container = createFormContainer();\n\n this._container.setAttribute('input-handle-modified-keys', 'z,y');\n\n const {\n container,\n exporter,\n injector = this._createInjector(options, this._container),\n properties = {}\n } = options;\n\n /**\n * @private\n * @type {any}\n */\n this.exporter = exporter;\n\n /**\n * @private\n * @type {State}\n */\n this._state = {\n properties,\n schema: null\n };\n\n this.get = injector.get;\n\n this.invoke = injector.invoke;\n\n this.get('eventBus').fire('form.init');\n\n if (container) {\n this.attachTo(container);\n }\n }\n\n clear() {\n\n // clear form services\n this._emit('diagram.clear');\n\n // clear diagram services (e.g. EventBus)\n this._emit('form.clear');\n }\n\n destroy() {\n\n // destroy form services\n this.get('eventBus').fire('form.destroy');\n\n // destroy diagram services (e.g. EventBus)\n this.get('eventBus').fire('diagram.destroy');\n\n this._detach(false);\n }\n\n /**\n * @param {Schema} schema\n *\n * @return {Promise<{ warnings: Array<any> }>}\n */\n importSchema(schema) {\n return new Promise((resolve, reject) => {\n try {\n this.clear();\n\n const {\n schema: importedSchema,\n warnings\n } = this.get('importer').importSchema(schema);\n\n this._setState({\n schema: importedSchema\n });\n\n this._emit('import.done', { warnings });\n\n return resolve({ warnings });\n } catch (error) {\n this._emit('import.done', {\n error: error,\n warnings: error.warnings || []\n });\n\n return reject(error);\n }\n });\n }\n\n /**\n * @returns {Schema}\n */\n saveSchema() {\n return this.getSchema();\n }\n\n /**\n * @returns {Schema}\n */\n getSchema() {\n const { schema } = this._getState();\n\n return exportSchema(\n schema,\n this.exporter,\n schemaVersion\n );\n }\n\n /**\n * @param {Element|string} parentNode\n */\n attachTo(parentNode) {\n if (!parentNode) {\n throw new Error('parentNode required');\n }\n\n this.detach();\n\n if (isString(parentNode)) {\n parentNode = document.querySelector(parentNode);\n }\n\n const container = this._container;\n\n parentNode.appendChild(container);\n\n this._emit('attach');\n }\n\n detach() {\n this._detach();\n }\n\n /**\n * @internal\n *\n * @param {boolean} [emit]\n */\n _detach(emit = true) {\n const container = this._container,\n parentNode = container.parentNode;\n\n if (!parentNode) {\n return;\n }\n\n if (emit) {\n this._emit('detach');\n }\n\n parentNode.removeChild(container);\n }\n\n /**\n * @param {any} property\n * @param {any} value\n */\n setProperty(property, value) {\n const properties = set(this._getState().properties, [ property ], value);\n\n this._setState({ properties });\n }\n\n\n /**\n * @param {string} type\n * @param {Function} handler\n */\n off(type, handler) {\n this.get('eventBus').off(type, handler);\n }\n\n /**\n * @internal\n *\n * @param {FormEditorOptions} options\n * @param {Element} container\n *\n * @returns {Injector}\n */\n _createInjector(options, container) {\n const {\n additionalModules = [],\n modules = this._getModules(),\n renderer = {}\n } = options;\n\n const config = {\n ...options,\n renderer: {\n ...renderer,\n container\n }\n };\n\n return createInjector([\n { config: [ 'value', config ] },\n { formEditor: [ 'value', this ] },\n core,\n ...modules,\n ...additionalModules\n ]);\n }\n\n /**\n * @internal\n */\n _emit(type, data) {\n this.get('eventBus').fire(type, data);\n }\n\n /**\n * @internal\n */\n _getState() {\n return this._state;\n }\n\n /**\n * @internal\n */\n _setState(state) {\n this._state = {\n ...this._state,\n ...state\n };\n\n this._emit('changed', this._getState());\n }\n\n /**\n * @internal\n */\n _getModules() {\n return [\n ModelingModule,\n EditorActionsModule,\n KeyboardModule,\n SelectionModule,\n PaletteModule,\n PropertiesPanelModule\n ];\n }\n\n /**\n * @internal\n */\n _onEvent(type, priority, handler) {\n this.get('eventBus').on(type, priority, handler);\n }\n\n}\n\n// helpers //////////\n\nexport function exportSchema(schema, exporter, schemaVersion) {\n\n const exportDetails = exporter ? {\n exporter\n } : {};\n\n const cleanedSchema = clone(schema, (name, value) => {\n if ([ '_parent', '_path' ].includes(name)) {\n return undefined;\n }\n\n return value;\n });\n\n return {\n ...cleanedSchema,\n ...exportDetails,\n schemaVersion\n };\n}","import FormEditor from './FormEditor';\r\n\r\nimport { schemaVersion } from '@bpmn-io/form-js-viewer';\r\n\r\nexport {\r\n FormEditor,\r\n schemaVersion\r\n};\r\n\r\n/**\r\n * @typedef { import('./types').CreateFormEditorOptions } CreateFormEditorOptions\r\n */\r\n\r\n/**\r\n * Create a form editor.\r\n *\r\n * @param {CreateFormEditorOptions} options\r\n *\r\n * @return {Promise<FormEditor>}\r\n */\r\nexport function createFormEditor(options) {\r\n const {\r\n schema,\r\n ...rest\r\n } = options;\r\n\r\n const formEditor = new FormEditor(rest);\r\n\r\n return formEditor.importSchema(schema).then(() => {\r\n return formEditor;\r\n });\r\n}"],"names":["FN_REF","DEFAULT_PRIORITY","slice","Array","prototype","EventBus","_listeners","on","_destroy","events","priority","callback","that","isArray","isFunction","isNumber","Error","actualCallback","bind","self","forEach","e","_addListener","next","once","event","wrappedCallback","__isTomb","result","apply","arguments","off","_removeListener","createEvent","data","InternalEvent","init","fire","type","firstListener","returnValue","args","call","originalType","_invokeListeners","undefined","defaultPrevented","handleError","error","listener","cancelBubble","_invokeListener","invokeFunction","stopPropagation","preventDefault","console","newListener","_getListeners","previousListener","_setListeners","name","nextListener","listenerCallback","assign","fn","DebounceFactory","config","timeout","debounce","$inject","FieldFactory","constructor","formFieldRegistry","formFields","_formFieldRegistry","_formFields","create","attrs","applyDefaults","id","key","fieldDefinition","get","_ids","assigned","_keys","labelAttrs","label","field","_ensureId","keyed","_ensureKey","claim","prefix","nextPrefixed","FormFieldRegistry","BaseFieldRegistry","updateId","formField","newId","_validateId","_eventBus","remove","add","component","components","_parent","Importer","fieldFactory","_fieldFactory","importSchema","schema","warnings","importedSchema","importFormField","clone","err","fieldAttrs","parentId","index","parent","path","_path","importFormFields","map","importer","DragAndDropContext","createContext","drake","getService","strict","FormEditorContext","useContext","React","ContextPad","props","children","_jsx","Empty","Element","eventBus","useService","formEditor","modeling","selection","ref","useRef","scrollIntoView","current","elementBounds","getBoundingClientRect","containerBounds","_container","top","bottom","useEffect","onClick","toggle","classes","class","push","split","isSelected","onRemove","parentField","getFormFieldIndex","removeFormField","_jsxs","join","Children","FormEditor","injector","palette","paletteConfig","propertiesPanel","propertiesPanelConfig","_getState","paletteRef","propertiesPanelRef","setSelection","useState","handleSelectionChanged","setDrake","dragAndDropContext","createDragulaInstance","dragulaInstance","dragula","isContainer","el","classList","contains","copy","accepts","target","slideFactorX","slideFactorY","source","sibling","targetFormField","dataset","siblingFormField","targetIndex","length","fieldType","addFormField","sourceFormField","sourceIndex","moveFormField","onDetach","destroy","onAttach","formRenderContext","formContext","Map","errors","properties","readOnly","formId","_id","onSubmit","useCallback","onReset","hasDefaultPalette","defaultPalette","attachTo","hasDefaultPropertiesPanel","defaultPropertiesPanel","FormContext","FormRenderContext","FormComponent","fieldFormIndex","CreatePreview","handleCloned","original","Icon","iconsByType","innerHTML","render","Renderer","renderConfig","container","compact","App","state","setState","formEditorContext","newState","__init__","FormFields","renderer","__depends__","importModule","renderModule","NOT_REGISTERED_ERROR","IS_REGISTERED_ERROR","EditorActions","_actions","_registerDefaultActions","editorActions","commandStack","zoomScroll","copyPaste","canvas","rules","keyboardMove","keyboardMoveSelection","register","undo","redo","selectedElements","paste","opts","stepZoom","value","zoom","allowed","elements","removableElements","removeElements","moveCanvas","moveSelection","direction","accelerated","trigger","action","actions","_registerAction","isRegistered","unregister","getActions","Object","keys","message","FormEditorActions","options","set","EditorActionsModule","KEYS_COPY","KEYS_PASTE","KEYS_REDO","KEYS_UNDO","hasModifier","ctrlKey","metaKey","shiftKey","altKey","isCmd","isKey","indexOf","code","isShift","isCopy","isPaste","isUndo","isRedo","KEYDOWN_EVENT","KEYUP_EVENT","HANDLE_MODIFIER_ATTRIBUTE","Keyboard","_config","_keydownHandler","_keyupHandler","_fire","unbind","bindTo","_keyHandler","eventBusResult","_isEventIgnored","context","keyEvent","isInput","_isModifiedKeyIgnored","allowedModifiers","_getAllowedModifiers","element","modifierContainer","domClosest","_node","getAttribute","node","domEvent","getBinding","addListener","removeListener","domMatches","contentEditable","LOW_PRIORITY","KeyboardBindings","keyboard","registerBindings","keyboardBindings","FormEditorKeyboardBindings","KeyboardModule","arrayAdd","array","item","splice","arrayRemove","updatePath","AddFormFieldHandler","_formEditor","execute","targetPath","_setState","revert","EditFormFieldHandler","oldProperties","property","MoveFormFieldHandler","sourcePath","arrayMove","RemoveFormFieldHandler","UpdateIdClaimHandler","claiming","unclaim","UpdateKeyClaimHandler","Modeling","_commandStack","registerHandlers","entries","getHandlers","handler","registerHandler","editFormField","isObject","claimId","unclaimId","claimKey","unclaimKey","CommandInterceptor","unwrapEvent","command","hook","handlerFn","unwrap","fullEvent","filter","hooks","IdBehavior","preExecute","KeyBehavior","idBehavior","keyBehavior","CommandStack","_handlerMap","_stack","_stackIdx","_currentExecution","dirty","_injector","_uid","clear","_pushAction","_internalExecute","_popAction","canExecute","_getHandler","emit","_getUndoAction","_internalUndo","_getRedoAction","_setHandler","handlerCls","instantiate","canUndo","canRedo","_atomicDo","_markDirty","_revertedAction","qualifier","names","_createId","execution","atomic","_executedAction","postExecute","baseAction","pop","uniqueBy","reverse","concat","stackIdx","behaviorModule","commandModule","Selection","_selection","newSelection","SelectionBehavior","selectionBehavior","types","Palette","PaletteRenderer","domify","_render","domQuery","detach","appendChild","parentNode","removeChild","Header","headerProvider","getElementIcon","getDocumentationRef","getElementLabel","getTypeLabel","documentationRef","ElementIcon","width","height","viewBox","title","rel","href","ExternalLinkIcon","PropertiesPanelContext","countDecimals","number","num","Big","toString","toFixed","isValidNumber","isNaN","Number","textToLabel","text","line","displayLine","trim","INPUTS","VALUES_INPUTS","labelsByType","button","checkbox","checklist","columns","default","datetime","image","radio","select","taglist","textfield","textarea","PropertiesPanelHeaderProvider","alt","PropertiesPanelPlaceholderProvider","getEmpty","getMultiple","ActionEntry","editField","Action","isEdited","isSelectEntryEdited","getValue","setValue","getOptions","SelectEntry","FormPropertiesPanelContext","useVariables","form","getSchema","getSchemaVariables","AltTextEntry","AltText","isFeelEntryEdited","variables","FeelEntry","feel","ColumnsEntry","Columns","isNumberFieldEntryEdited","Default","NumberFieldEntry","DescriptionEntry","includes","Description","isTextFieldEntryEdited","TextFieldEntry","DefaultOptionEntry","values","defaultOptions","DefaultValueCheckbox","DefaultValueNumber","DefaultValueSingleSelect","DefaultValueTextfield","DefaultValueTextarea","isTextAreaEntryEdited","defaultValue","parseStringToBoolean","parseBooleanToString","decimalDigits","serializeToString","newValue","decimalDigitsSet","validate","TextAreaEntry","DisabledEntry","Disabled","isCheckboxEntryEdited","CheckboxEntry","IdEntry","Id","isUndefined","validateId","SPACE_REGEX","QNAME_REGEX","ID_REGEX","idValue","containsSpace","test","KeyEntry","Key","description","simpleStringEntryFactory","SimpleStringComponent","LabelEntry","subtype","DATETIME_SUBTYPES","DATE","DATETIME","DATE_LABEL_PATH","TIME","TIME_LABEL_PATH","SourceEntry","Source","TextEntry","Text","FeelTextAreaEntry","rows","NumberEntries","NumberDecimalDigits","NumberArrowStep","min","step","cmp","minimumValue","NumberSerializationEntry","SerializeToString","DateTimeEntry","DateTimeSubtypeSelect","Use24h","DATETIME_SUBTYPE_PATH","clearTimeConfig","timeConfigPaths","TIME_USE24H_PATH","TIME_INTERVAL_PATH","TIME_SERIALISING_FORMAT_PATH","initTimeConfig","TIME_SERIALISING_FORMATS","UTC_OFFSET","clearDateConfig","dateConfigPaths","DATE_DISALLOW_PAST_PATH","initDateConfig","oldValue","getDatetimeSubtypes","DATETIME_SUBTYPES_LABELS","DateTimeConstraintsEntry","TimeIntervalSelect","DisallowPassedDates","timeIntervals","parseInt","getTimeIntervals","timeInterval","DateTimeFormatEntry","TimeFormatSelect","getTimeSerialisingFormats","format","TIME_SERIALISINGFORMAT_LABELS","ValueEntry","idPrefix","validateFactory","Label","Value","CustomValueEntry","updateKey","updateValue","oldKey","newKey","reduce","newProperties","entry","ValuesSourceSelectEntry","ValuesSourceSelect","getValuesSource","newField","VALUES_SOURCES","VALUES_SOURCES_DEFAULTS","VALUES_SOURCES_PATHS","getValuesSourceOptions","valueSource","VALUES_SOURCES_LABELS","InputKeyValuesSourceEntry","InputValuesKey","INPUT","StaticValuesSourceEntry","addEntry","getIndexedEntry","STATIC","removeEntry","without","isValueAssigned","find","items","autoFocusEntry","shouldSort","AdornerEntry","onChange","appearance","PrefixAdorner","SuffixAdorner","ConditionEntry","Condition","hide","GeneralGroup","DefaultValueEntry","ImageSourceEntry","SerializationGroup","DateTimeSerializationEntry","ConstraintsGroup","VALIDATION_TYPE_OPTIONS","custom","email","phone","ValidationGroup","isCustomValidation","validationType","Required","ValidationType","MinLength","MaxLength","Pattern","Min","Max","ValuesGroups","fieldId","valuesSourceId","groups","Group","valuesSource","dynamicValuesId","staticValuesId","ListGroup","CustomValuesGroup","has","removeKey","AppearanceGroup","ConditionGroup","getGroups","group","FormPropertiesPanel","selectedFormField","_update","useLayoutEffect","onSelectionChange","onFieldChanged","propertiesPanelContext","onFocus","onBlur","PropertiesPanelRenderer","PropertiesPanel","ids","Ids","_onEvent","createFormContainer","setAttribute","exporter","_createInjector","_state","invoke","_emit","_detach","Promise","resolve","reject","saveSchema","exportSchema","schemaVersion","isString","document","querySelector","setProperty","additionalModules","modules","_getModules","createInjector","core","ModelingModule","SelectionModule","PaletteModule","PropertiesPanelModule","exportDetails","cleanedSchema","createFormEditor","rest","then"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,IAAIA,MAAM,GAAG,MAAM;AAEnB,IAAIC,kBAAgB,GAAG,IAAI;AAE3B,IAAIC,KAAK,GAAGC,KAAK,CAACC,SAAS,CAACF,KAAK;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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,CAACnD,IAAI,EAAEqN,KAAK,KAAK;IACnD,IAAI,CAAE,SAAS,EAAE,OAAO,CAAE,CAACsQ,QAAQ,CAAC3d,IAAI,CAAC,EAAE;MACzC,OAAOf,SAAS;;IAGlB,OAAOoO,KAAK;GACb,CAAC;EAEF,OAAO;IACL,GAAGge,aAAa;IAChB,GAAGD,aAAa;IAChBd;GACD;AACH;;ACvUA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASgB,gBAAgB,CAAC5c,OAAO,EAAE;EACxC,MAAM;IACJvL,MAAM;IACN,GAAGooB;GACJ,GAAG7c,OAAO;EAEX,MAAMxJ,UAAU,GAAG,IAAI4B,UAAU,CAACykB,IAAI,CAAC;EAEvC,OAAOrmB,UAAU,CAAChC,YAAY,CAACC,MAAM,CAAC,CAACqoB,IAAI,CAAC,MAAM;IAChD,OAAOtmB,UAAU;GAClB,CAAC;AACJ;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../node_modules/diagram-js/lib/core/EventBus.js","../src/core/Debounce.js","../src/core/FieldFactory.js","../src/core/FormFieldRegistry.js","../src/import/Importer.js","../src/import/index.js","../src/render/context/DragAndDropContext.js","../src/render/context/FormEditorContext.js","../src/render/hooks/useService.js","../src/features/properties-panel/icons/pp-list-delete.svg","../src/render/components/FormEditor.js","../src/render/Renderer.js","../src/render/index.js","../src/core/index.js","../../../node_modules/diagram-js/lib/features/editor-actions/EditorActions.js","../../../node_modules/diagram-js/lib/features/editor-actions/index.js","../src/features/editor-actions/FormEditorActions.js","../src/features/editor-actions/index.js","../../../node_modules/diagram-js/lib/features/keyboard/KeyboardUtil.js","../../../node_modules/diagram-js/lib/features/keyboard/Keyboard.js","../../../node_modules/diagram-js/lib/features/keyboard/KeyboardBindings.js","../../../node_modules/diagram-js/lib/features/keyboard/index.js","../src/features/keyboard/FormEditorKeyboardBindings.js","../src/features/keyboard/index.js","../src/features/modeling/cmd/Util.js","../src/features/modeling/cmd/AddFormFieldHandler.js","../src/features/modeling/cmd/EditFormFieldHandler.js","../src/features/modeling/cmd/MoveFormFieldHandler.js","../src/features/modeling/cmd/RemoveFormFieldHandler.js","../src/features/modeling/cmd/UpdateIdClaimHandler.js","../src/features/modeling/cmd/UpdateKeyClaimHandler.js","../src/features/modeling/Modeling.js","../../../node_modules/diagram-js/lib/command/CommandInterceptor.js","../src/features/modeling/behavior/IdBehavior.js","../src/features/modeling/behavior/KeyBehavior.js","../src/features/modeling/behavior/index.js","../../../node_modules/diagram-js/lib/command/CommandStack.js","../../../node_modules/diagram-js/lib/command/index.js","../src/features/modeling/index.js","../src/features/selection/Selection.js","../src/features/selection/SelectionBehavior.js","../src/features/selection/index.js","../src/features/palette/components/Palette.js","../src/features/palette/PaletteRenderer.js","../src/features/palette/index.js","../../../node_modules/@bpmn-io/properties-panel/dist/index.esm.js","../src/features/properties-panel/context/FormPropertiesPanelContext.js","../src/features/properties-panel/Util.js","../src/features/properties-panel/PropertiesPanelHeaderProvider.js","../src/features/properties-panel/PropertiesPanelPlaceholderProvider.js","../src/features/properties-panel/entries/ActionEntry.js","../src/features/properties-panel/hooks/usePropertiesPanelService.js","../src/features/properties-panel/hooks/useVariables.js","../src/features/properties-panel/entries/AltTextEntry.js","../src/features/properties-panel/entries/ColumnsEntry.js","../src/features/properties-panel/entries/DescriptionEntry.js","../src/features/properties-panel/entries/DefaultValueEntry.js","../src/features/properties-panel/entries/DisabledEntry.js","../src/features/properties-panel/entries/IdEntry.js","../src/features/properties-panel/entries/KeyEntry.js","../src/features/properties-panel/entries/factories/simpleStringEntryFactory.js","../src/features/properties-panel/entries/LabelEntry.js","../src/features/properties-panel/entries/ImageSourceEntry.js","../src/features/properties-panel/entries/TextEntry.js","../src/features/properties-panel/entries/NumberEntries.js","../src/features/properties-panel/entries/NumberSerializationEntry.js","../src/features/properties-panel/entries/DateTimeEntry.js","../src/features/properties-panel/entries/DateTimeConstraintsEntry.js","../src/features/properties-panel/entries/DateTimeSerializationEntry.js","../src/features/properties-panel/entries/ValueEntry.js","../src/features/properties-panel/entries/CustomValueEntry.js","../src/features/properties-panel/entries/ValuesSourceSelectEntry.js","../src/features/properties-panel/entries/InputKeyValuesSourceEntry.js","../src/features/properties-panel/entries/StaticValuesSourceEntry.js","../src/features/properties-panel/entries/AdornerEntry.js","../src/features/properties-panel/entries/ConditionEntry.js","../src/features/properties-panel/groups/GeneralGroup.js","../src/features/properties-panel/groups/SerializationGroup.js","../src/features/properties-panel/groups/ConstraintsGroup.js","../src/features/properties-panel/groups/ValidationGroup.js","../src/features/properties-panel/groups/ValuesGroups.js","../src/features/properties-panel/groups/CustomValuesGroup.js","../src/features/properties-panel/groups/AppearanceGroup.js","../src/features/properties-panel/groups/ConditionGroup.js","../src/features/properties-panel/PropertiesPanel.js","../src/features/properties-panel/PropertiesPanelRenderer.js","../src/features/properties-panel/index.js","../src/FormEditor.js","../src/index.js"],"sourcesContent":["import {\n isFunction,\n isArray,\n isNumber,\n bind,\n assign\n} from 'min-dash';\n\nvar FN_REF = '__fn';\n\nvar DEFAULT_PRIORITY = 1000;\n\nvar slice = Array.prototype.slice;\n\n/**\n * A general purpose event bus.\n *\n * This component is used to communicate across a diagram instance.\n * Other parts of a diagram can use it to listen to and broadcast events.\n *\n *\n * ## Registering for Events\n *\n * The event bus provides the {@link EventBus#on} and {@link EventBus#once}\n * methods to register for events. {@link EventBus#off} can be used to\n * remove event registrations. Listeners receive an instance of {@link Event}\n * as the first argument. It allows them to hook into the event execution.\n *\n * ```javascript\n *\n * // listen for event\n * eventBus.on('foo', function(event) {\n *\n * // access event type\n * event.type; // 'foo'\n *\n * // stop propagation to other listeners\n * event.stopPropagation();\n *\n * // prevent event default\n * event.preventDefault();\n * });\n *\n * // listen for event with custom payload\n * eventBus.on('bar', function(event, payload) {\n * console.log(payload);\n * });\n *\n * // listen for event returning value\n * eventBus.on('foobar', function(event) {\n *\n * // stop event propagation + prevent default\n * return false;\n *\n * // stop event propagation + return custom result\n * return {\n * complex: 'listening result'\n * };\n * });\n *\n *\n * // listen with custom priority (default=1000, higher is better)\n * eventBus.on('priorityfoo', 1500, function(event) {\n * console.log('invoked first!');\n * });\n *\n *\n * // listen for event and pass the context (`this`)\n * eventBus.on('foobar', function(event) {\n * this.foo();\n * }, this);\n * ```\n *\n *\n * ## Emitting Events\n *\n * Events can be emitted via the event bus using {@link EventBus#fire}.\n *\n * ```javascript\n *\n * // false indicates that the default action\n * // was prevented by listeners\n * if (eventBus.fire('foo') === false) {\n * console.log('default has been prevented!');\n * };\n *\n *\n * // custom args + return value listener\n * eventBus.on('sum', function(event, a, b) {\n * return a + b;\n * });\n *\n * // you can pass custom arguments + retrieve result values.\n * var sum = eventBus.fire('sum', 1, 2);\n * console.log(sum); // 3\n * ```\n */\nexport default function EventBus() {\n this._listeners = {};\n\n // cleanup on destroy on lowest priority to allow\n // message passing until the bitter end\n this.on('diagram.destroy', 1, this._destroy, this);\n}\n\n\n/**\n * Register an event listener for events with the given name.\n *\n * The callback will be invoked with `event, ...additionalArguments`\n * that have been passed to {@link EventBus#fire}.\n *\n * Returning false from a listener will prevent the events default action\n * (if any is specified). To stop an event from being processed further in\n * other listeners execute {@link Event#stopPropagation}.\n *\n * Returning anything but `undefined` from a listener will stop the listener propagation.\n *\n * @param {string|Array<string>} events\n * @param {number} [priority=1000] the priority in which this listener is called, larger is higher\n * @param {Function} callback\n * @param {Object} [that] Pass context (`this`) to the callback\n */\nEventBus.prototype.on = function(events, priority, callback, that) {\n\n events = isArray(events) ? events : [ events ];\n\n if (isFunction(priority)) {\n that = callback;\n callback = priority;\n priority = DEFAULT_PRIORITY;\n }\n\n if (!isNumber(priority)) {\n throw new Error('priority must be a number');\n }\n\n var actualCallback = callback;\n\n if (that) {\n actualCallback = bind(callback, that);\n\n // make sure we remember and are able to remove\n // bound callbacks via {@link #off} using the original\n // callback\n actualCallback[FN_REF] = callback[FN_REF] || callback;\n }\n\n var self = this;\n\n events.forEach(function(e) {\n self._addListener(e, {\n priority: priority,\n callback: actualCallback,\n next: null\n });\n });\n};\n\n\n/**\n * Register an event listener that is executed only once.\n *\n * @param {string} event the event name to register for\n * @param {number} [priority=1000] the priority in which this listener is called, larger is higher\n * @param {Function} callback the callback to execute\n * @param {Object} [that] Pass context (`this`) to the callback\n */\nEventBus.prototype.once = function(event, priority, callback, that) {\n var self = this;\n\n if (isFunction(priority)) {\n that = callback;\n callback = priority;\n priority = DEFAULT_PRIORITY;\n }\n\n if (!isNumber(priority)) {\n throw new Error('priority must be a number');\n }\n\n function wrappedCallback() {\n wrappedCallback.__isTomb = true;\n\n var result = callback.apply(that, arguments);\n\n self.off(event, wrappedCallback);\n\n return result;\n }\n\n // make sure we remember and are able to remove\n // bound callbacks via {@link #off} using the original\n // callback\n wrappedCallback[FN_REF] = callback;\n\n this.on(event, priority, wrappedCallback);\n};\n\n\n/**\n * Removes event listeners by event and callback.\n *\n * If no callback is given, all listeners for a given event name are being removed.\n *\n * @param {string|Array<string>} events\n * @param {Function} [callback]\n */\nEventBus.prototype.off = function(events, callback) {\n\n events = isArray(events) ? events : [ events ];\n\n var self = this;\n\n events.forEach(function(event) {\n self._removeListener(event, callback);\n });\n\n};\n\n\n/**\n * Create an EventBus event.\n *\n * @param {Object} data\n *\n * @return {Object} event, recognized by the eventBus\n */\nEventBus.prototype.createEvent = function(data) {\n var event = new InternalEvent();\n\n event.init(data);\n\n return event;\n};\n\n\n/**\n * Fires a named event.\n *\n * @example\n *\n * // fire event by name\n * events.fire('foo');\n *\n * // fire event object with nested type\n * var event = { type: 'foo' };\n * events.fire(event);\n *\n * // fire event with explicit type\n * var event = { x: 10, y: 20 };\n * events.fire('element.moved', event);\n *\n * // pass additional arguments to the event\n * events.on('foo', function(event, bar) {\n * alert(bar);\n * });\n *\n * events.fire({ type: 'foo' }, 'I am bar!');\n *\n * @param {string} [name] the optional event name\n * @param {Object} [event] the event object\n * @param {...Object} additional arguments to be passed to the callback functions\n *\n * @return {boolean} the events return value, if specified or false if the\n * default action was prevented by listeners\n */\nEventBus.prototype.fire = function(type, data) {\n var event,\n firstListener,\n returnValue,\n args;\n\n args = slice.call(arguments);\n\n if (typeof type === 'object') {\n data = type;\n type = data.type;\n }\n\n if (!type) {\n throw new Error('no event type specified');\n }\n\n firstListener = this._listeners[type];\n\n if (!firstListener) {\n return;\n }\n\n // we make sure we fire instances of our home made\n // events here. We wrap them only once, though\n if (data instanceof InternalEvent) {\n\n // we are fine, we alread have an event\n event = data;\n } else {\n event = this.createEvent(data);\n }\n\n // ensure we pass the event as the first parameter\n args[0] = event;\n\n // original event type (in case we delegate)\n var originalType = event.type;\n\n // update event type before delegation\n if (type !== originalType) {\n event.type = type;\n }\n\n try {\n returnValue = this._invokeListeners(event, args, firstListener);\n } finally {\n\n // reset event type after delegation\n if (type !== originalType) {\n event.type = originalType;\n }\n }\n\n // set the return value to false if the event default\n // got prevented and no other return value exists\n if (returnValue === undefined && event.defaultPrevented) {\n returnValue = false;\n }\n\n return returnValue;\n};\n\n\nEventBus.prototype.handleError = function(error) {\n return this.fire('error', { error: error }) === false;\n};\n\n\nEventBus.prototype._destroy = function() {\n this._listeners = {};\n};\n\nEventBus.prototype._invokeListeners = function(event, args, listener) {\n\n var returnValue;\n\n while (listener) {\n\n // handle stopped propagation\n if (event.cancelBubble) {\n break;\n }\n\n returnValue = this._invokeListener(event, args, listener);\n\n listener = listener.next;\n }\n\n return returnValue;\n};\n\nEventBus.prototype._invokeListener = function(event, args, listener) {\n\n var returnValue;\n\n if (listener.callback.__isTomb) {\n return returnValue;\n }\n\n try {\n\n // returning false prevents the default action\n returnValue = invokeFunction(listener.callback, args);\n\n // stop propagation on return value\n if (returnValue !== undefined) {\n event.returnValue = returnValue;\n event.stopPropagation();\n }\n\n // prevent default on return false\n if (returnValue === false) {\n event.preventDefault();\n }\n } catch (error) {\n if (!this.handleError(error)) {\n console.error('unhandled error in event listener', error);\n\n throw error;\n }\n }\n\n return returnValue;\n};\n\n/*\n * Add new listener with a certain priority to the list\n * of listeners (for the given event).\n *\n * The semantics of listener registration / listener execution are\n * first register, first serve: New listeners will always be inserted\n * after existing listeners with the same priority.\n *\n * Example: Inserting two listeners with priority 1000 and 1300\n *\n * * before: [ 1500, 1500, 1000, 1000 ]\n * * after: [ 1500, 1500, (new=1300), 1000, 1000, (new=1000) ]\n *\n * @param {string} event\n * @param {Object} listener { priority, callback }\n */\nEventBus.prototype._addListener = function(event, newListener) {\n\n var listener = this._getListeners(event),\n previousListener;\n\n // no prior listeners\n if (!listener) {\n this._setListeners(event, newListener);\n\n return;\n }\n\n // ensure we order listeners by priority from\n // 0 (high) to n > 0 (low)\n while (listener) {\n\n if (listener.priority < newListener.priority) {\n\n newListener.next = listener;\n\n if (previousListener) {\n previousListener.next = newListener;\n } else {\n this._setListeners(event, newListener);\n }\n\n return;\n }\n\n previousListener = listener;\n listener = listener.next;\n }\n\n // add new listener to back\n previousListener.next = newListener;\n};\n\n\nEventBus.prototype._getListeners = function(name) {\n return this._listeners[name];\n};\n\nEventBus.prototype._setListeners = function(name, listener) {\n this._listeners[name] = listener;\n};\n\nEventBus.prototype._removeListener = function(event, callback) {\n\n var listener = this._getListeners(event),\n nextListener,\n previousListener,\n listenerCallback;\n\n if (!callback) {\n\n // clear listeners\n this._setListeners(event, null);\n\n return;\n }\n\n while (listener) {\n\n nextListener = listener.next;\n\n listenerCallback = listener.callback;\n\n if (listenerCallback === callback || listenerCallback[FN_REF] === callback) {\n if (previousListener) {\n previousListener.next = nextListener;\n } else {\n\n // new first listener\n this._setListeners(event, nextListener);\n }\n }\n\n previousListener = listener;\n listener = nextListener;\n }\n};\n\n/**\n * A event that is emitted via the event bus.\n */\nfunction InternalEvent() { }\n\nInternalEvent.prototype.stopPropagation = function() {\n this.cancelBubble = true;\n};\n\nInternalEvent.prototype.preventDefault = function() {\n this.defaultPrevented = true;\n};\n\nInternalEvent.prototype.init = function(data) {\n assign(this, data || {});\n};\n\n\n/**\n * Invoke function. Be fast...\n *\n * @param {Function} fn\n * @param {Array<Object>} args\n *\n * @return {Any}\n */\nfunction invokeFunction(fn, args) {\n return fn.apply(null, args);\n}\n","import { debounce } from 'min-dash';\r\n\r\n/**\r\n * A factory to create a configurable debouncer.\r\n *\r\n * @param {number|boolean} [config=true]\r\n */\r\nexport default function DebounceFactory(config = true) {\r\n\r\n const timeout = typeof config === 'number' ? config : config ? 300 : 0;\r\n\r\n if (timeout) {\r\n return fn => debounce(fn, timeout);\r\n } else {\r\n return fn => fn;\r\n }\r\n}\r\n\r\nDebounceFactory.$inject = [ 'config.debounce' ];","export default class FieldFactory {\r\n\r\n /**\r\n * @constructor\r\n *\r\n * @param { import('./FormFieldRegistry').default } formFieldRegistry\r\n * @param { import('@bpmn-io/form-js-viewer').FormFields } formFields\r\n */\r\n constructor(formFieldRegistry, formFields) {\r\n this._formFieldRegistry = formFieldRegistry;\r\n this._formFields = formFields;\r\n }\r\n\r\n create(attrs, applyDefaults = true) {\r\n\r\n const {\r\n id,\r\n key,\r\n type\r\n } = attrs;\r\n\r\n const fieldDefinition = this._formFields.get(type);\r\n\r\n if (!fieldDefinition) {\r\n throw new Error(`form field of type <${ type }> not supported`);\r\n }\r\n\r\n if (id && this._formFieldRegistry._ids.assigned(id)) {\r\n throw new Error(`ID <${ id }> already assigned`);\r\n }\r\n\r\n if (key && this._formFieldRegistry._keys.assigned(key)) {\r\n throw new Error(`key <${ key }> already assigned`);\r\n }\r\n\r\n const labelAttrs = applyDefaults && fieldDefinition.label ? {\r\n label: fieldDefinition.label\r\n } : {};\r\n\r\n const field = fieldDefinition.create({\r\n ...labelAttrs,\r\n ...attrs\r\n });\r\n\r\n this._ensureId(field);\r\n\r\n if (fieldDefinition.keyed) {\r\n this._ensureKey(field, applyDefaults);\r\n }\r\n\r\n return field;\r\n }\r\n\r\n _ensureId(field) {\r\n\r\n if (field.id) {\r\n this._formFieldRegistry._ids.claim(field.id, field);\r\n\r\n return;\r\n }\r\n\r\n let prefix = 'Field';\r\n\r\n if (field.type === 'default') {\r\n prefix = 'Form';\r\n }\r\n\r\n field.id = this._formFieldRegistry._ids.nextPrefixed(`${prefix}_`, field);\r\n }\r\n\r\n _ensureKey(field, applyDefaults) {\r\n\r\n if (field.key) {\r\n this._formFieldRegistry._keys.claim(field.key, field);\r\n\r\n return;\r\n }\r\n\r\n if (applyDefaults) {\r\n let prefix = 'field';\r\n\r\n field.key = this._formFieldRegistry._keys.nextPrefixed(`${prefix}_`, field);\r\n }\r\n }\r\n}\r\n\r\n\r\nFieldFactory.$inject = [\r\n 'formFieldRegistry',\r\n 'formFields'\r\n];","import {\r\n FormFieldRegistry as BaseFieldRegistry\r\n} from '@bpmn-io/form-js-viewer';\r\n\r\n\r\nexport default class FormFieldRegistry extends BaseFieldRegistry {\r\n\r\n /**\r\n * Updates a form fields id.\r\n *\r\n * @param {Object} formField\r\n * @param {string} newId\r\n */\r\n updateId(formField, newId) {\r\n\r\n this._validateId(newId);\r\n\r\n this._eventBus.fire('formField.updateId', {\r\n formField,\r\n newId: newId\r\n });\r\n\r\n this.remove(formField);\r\n\r\n formField.id = newId;\r\n\r\n this.add(formField);\r\n\r\n // TODO(nikku): make this a proper object graph so we\r\n // do not have to deal with IDs this way...\r\n if ('components' in formField) {\r\n for (const component of formField.components) {\r\n component._parent = newId;\r\n }\r\n }\r\n\r\n }\r\n\r\n\r\n /**\r\n * Validate the suitability of the given id and signals a problem\r\n * with an exception.\r\n *\r\n * @param {string} id\r\n *\r\n * @throws {Error} if id is empty or already assigned\r\n */\r\n _validateId(id) {\r\n if (!id) {\r\n throw new Error('formField must have an id');\r\n }\r\n\r\n if (this.get(id)) {\r\n throw new Error('formField with id ' + id + ' already added');\r\n }\r\n }\r\n\r\n}","import { clone } from '@bpmn-io/form-js-viewer';\r\n\r\n\r\nexport default class Importer {\r\n\r\n /**\r\n * @constructor\r\n * @param { import('../core/FormFieldRegistry').default } formFieldRegistry\r\n * @param { import('../core/FieldFactory').default } fieldFactory\r\n */\r\n constructor(formFieldRegistry, fieldFactory) {\r\n this._formFieldRegistry = formFieldRegistry;\r\n this._fieldFactory = fieldFactory;\r\n }\r\n\r\n /**\r\n * Import schema creating fields, attaching additional\r\n * information to each field and adding fields to the\r\n * field registry.\r\n *\r\n * Additional information attached:\r\n *\r\n * * `id` (unless present)\r\n * * `_parent`\r\n * * `_path`\r\n *\r\n * @param {any} schema\r\n *\r\n * @typedef {{ warnings: Error[], schema: any }} ImportResult\r\n * @returns {ImportResult}\r\n */\r\n importSchema(schema) {\r\n\r\n // TODO: Add warnings\r\n const warnings = [];\r\n\r\n try {\r\n const importedSchema = this.importFormField(clone(schema));\r\n\r\n return {\r\n schema: importedSchema,\r\n warnings\r\n };\r\n } catch (err) {\r\n err.warnings = warnings;\r\n\r\n throw err;\r\n }\r\n }\r\n\r\n /**\r\n * @param {{[x: string]: any}} fieldAttrs\r\n * @param {String} [parentId]\r\n * @param {number} [index]\r\n *\r\n * @return {any} field\r\n */\r\n importFormField(fieldAttrs, parentId, index) {\r\n const {\r\n components,\r\n id,\r\n key\r\n } = fieldAttrs;\r\n\r\n let parent, path;\r\n\r\n if (parentId) {\r\n parent = this._formFieldRegistry.get(parentId);\r\n }\r\n\r\n // validate <id> uniqueness\r\n if (id && this._formFieldRegistry._ids.assigned(id)) {\r\n throw new Error(`form field with id <${ id }> already exists`);\r\n }\r\n\r\n // validate <key> uniqueness\r\n if (key && this._formFieldRegistry._keys.assigned(key)) {\r\n throw new Error(`form field with key <${ key }> already exists`);\r\n }\r\n\r\n // set form field path\r\n path = parent ? [ ...parent._path, 'components', index ] : [];\r\n\r\n const field = this._fieldFactory.create({\r\n ...fieldAttrs,\r\n _path: path,\r\n _parent: parent && parent.id\r\n }, false);\r\n\r\n this._formFieldRegistry.add(field);\r\n\r\n if (components) {\r\n field.components = this.importFormFields(components, field.id);\r\n }\r\n\r\n return field;\r\n }\r\n\r\n /**\r\n * @param {Array<any>} components\r\n * @param {string} parentId\r\n *\r\n * @return {Array<any>} imported components\r\n */\r\n importFormFields(components, parentId) {\r\n return components.map((component, index) => {\r\n return this.importFormField(component, parentId, index);\r\n });\r\n }\r\n\r\n}\r\n\r\nImporter.$inject = [ 'formFieldRegistry', 'fieldFactory' ];","import Importer from './Importer';\r\n\r\nexport default {\r\n importer: [ 'type', Importer ]\r\n};","import { createContext } from 'preact';\r\n\r\nconst DragAndDropContext = createContext({\r\n drake: null\r\n});\r\n\r\nexport default DragAndDropContext;","import { createContext } from 'preact';\r\n\r\n/**\r\n * @param {string} type\r\n * @param {boolean} [strict]\r\n *\r\n * @returns {any}\r\n */\r\nfunction getService(type, strict) {}\r\n\r\nconst FormEditorContext = createContext({\r\n getService\r\n});\r\n\r\nexport default FormEditorContext;","import {\r\n useContext\r\n} from 'preact/hooks';\r\n\r\nimport { FormEditorContext } from '../context';\r\n\r\n\r\nexport default function(type, strict) {\r\n const {\r\n getService\r\n } = useContext(FormEditorContext);\r\n\r\n return getService(type, strict);\r\n}","function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nimport React from \"react\";\nexport default (({\n styles = {},\n ...props\n}) => /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"11\",\n height: \"14\"\n}, props), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M10 4v8c0 1.1-.9 2-2 2H3c-1.1 0-2-.9-2-2V4h9zM8 6H3v4.8c0 .66.5 1.2 1.111 1.2H6.89C7.5 12 8 11.46 8 10.8V6zm3-5H8.5l-1-1h-4l-1 1H0v1.5h11V1z\"\n})));","import { render } from 'preact';\r\nimport {\r\n useCallback,\r\n useContext,\r\n useEffect,\r\n useRef,\r\n useState\r\n} from 'preact/hooks';\r\n\r\nimport {\r\n FormComponent,\r\n FormContext,\r\n FormRenderContext\r\n} from '@bpmn-io/form-js-viewer';\r\n\r\nimport useService from '../hooks/useService';\r\n\r\nimport { DragAndDropContext } from '../context';\r\n\r\nimport dragula from 'dragula';\r\n\r\nimport { ListDeleteIcon } from '../../features/properties-panel/icons';\r\n\r\nimport { iconsByType } from './icons';\r\n\r\nfunction ContextPad(props) {\r\n if (!props.children) {\r\n return null;\r\n }\r\n\r\n return (\r\n <div class=\"fjs-context-pad\">\r\n {\r\n props.children\r\n }\r\n </div>\r\n );\r\n}\r\n\r\nfunction Empty(props) {\r\n return null;\r\n}\r\n\r\nfunction Element(props) {\r\n const eventBus = useService('eventBus'),\r\n formEditor = useService('formEditor'),\r\n formFieldRegistry = useService('formFieldRegistry'),\r\n modeling = useService('modeling'),\r\n selection = useService('selection');\r\n\r\n const { field } = props;\r\n\r\n const {\r\n id,\r\n type\r\n } = field;\r\n\r\n const ref = useRef();\r\n\r\n function scrollIntoView({ selection }) {\r\n if (!selection || selection.id !== id || !ref.current) {\r\n return;\r\n }\r\n\r\n const elementBounds = ref.current.getBoundingClientRect(),\r\n containerBounds = formEditor._container.getBoundingClientRect();\r\n\r\n if (elementBounds.top < 0 || elementBounds.top > containerBounds.bottom) {\r\n ref.current.scrollIntoView();\r\n }\r\n }\r\n\r\n useEffect(() => {\r\n eventBus.on('selection.changed', scrollIntoView);\r\n\r\n return () => eventBus.off('selection.changed', scrollIntoView);\r\n }, [ id ]);\r\n\r\n function onClick(event) {\r\n event.stopPropagation();\r\n\r\n selection.toggle(field);\r\n }\r\n\r\n const classes = [ 'fjs-element' ];\r\n\r\n if (props.class) {\r\n classes.push(...props.class.split(' '));\r\n }\r\n\r\n if (selection.isSelected(field)) {\r\n classes.push('fjs-editor-selected');\r\n }\r\n\r\n const onRemove = (event) => {\r\n event.stopPropagation();\r\n\r\n const parentField = formFieldRegistry.get(field._parent);\r\n\r\n const index = getFormFieldIndex(parentField, field);\r\n\r\n modeling.removeFormField(field, parentField, index);\r\n };\r\n\r\n return (\r\n <div\r\n class={ classes.join(' ') }\r\n data-id={ id }\r\n data-field-type={ type }\r\n onClick={ onClick }\r\n ref={ ref }>\r\n <ContextPad>\r\n {\r\n selection.isSelected(field) && field.type !== 'default'\r\n ? <button class=\"fjs-context-pad-item\" onClick={ onRemove }><ListDeleteIcon /></button>\r\n : null\r\n }\r\n </ContextPad>\r\n { props.children }\r\n </div>\r\n );\r\n}\r\n\r\nfunction Children(props) {\r\n const { field } = props;\r\n\r\n const { id } = field;\r\n\r\n const classes = [ 'fjs-children', 'fjs-drag-container' ];\r\n\r\n if (props.class) {\r\n classes.push(...props.class.split(' '));\r\n }\r\n\r\n return (\r\n <div\r\n class={ classes.join(' ') }\r\n data-id={ id }>\r\n { props.children }\r\n </div>\r\n );\r\n}\r\n\r\nexport default function FormEditor(props) {\r\n const eventBus = useService('eventBus'),\r\n formEditor = useService('formEditor'),\r\n formFieldRegistry = useService('formFieldRegistry'),\r\n injector = useService('injector'),\r\n modeling = useService('modeling'),\r\n selection = useService('selection'),\r\n palette = useService('palette'),\r\n paletteConfig = useService('config.palette'),\r\n propertiesPanel = useService('propertiesPanel'),\r\n propertiesPanelConfig = useService('config.propertiesPanel');\r\n\r\n const { schema } = formEditor._getState();\r\n\r\n const paletteRef = useRef(null);\r\n const propertiesPanelRef = useRef(null);\r\n\r\n const [ , setSelection ] = useState(schema);\r\n\r\n useEffect(() => {\r\n function handleSelectionChanged(event) {\r\n setSelection(event.selection || schema);\r\n }\r\n\r\n eventBus.on('selection.changed', handleSelectionChanged);\r\n\r\n setSelection(selection.get() || schema);\r\n\r\n return () => {\r\n eventBus.off('selection.changed', handleSelectionChanged);\r\n };\r\n }, [ schema, selection ]);\r\n\r\n const [ drake, setDrake ] = useState(null);\r\n\r\n const dragAndDropContext = {\r\n drake\r\n };\r\n\r\n useEffect(() => {\r\n const createDragulaInstance = () => {\r\n const dragulaInstance = dragula({\r\n isContainer(el) {\r\n return el.classList.contains('fjs-drag-container');\r\n },\r\n copy(el) {\r\n return el.classList.contains('fjs-drag-copy');\r\n },\r\n accepts(el, target) {\r\n return !target.classList.contains('fjs-no-drop');\r\n },\r\n slideFactorX: 10,\r\n slideFactorY: 5\r\n });\r\n\r\n dragulaInstance.on('drop', (el, target, source, sibling) => {\r\n dragulaInstance.remove();\r\n\r\n if (!target) {\r\n return;\r\n }\r\n\r\n const targetFormField = formFieldRegistry.get(target.dataset.id);\r\n\r\n const siblingFormField = sibling && formFieldRegistry.get(sibling.dataset.id),\r\n targetIndex = siblingFormField ? getFormFieldIndex(targetFormField, siblingFormField) : targetFormField.components.length;\r\n\r\n if (source.classList.contains('fjs-palette-fields')) {\r\n const type = el.dataset.fieldType;\r\n\r\n modeling.addFormField({ type }, targetFormField, targetIndex);\r\n } else {\r\n const formField = formFieldRegistry.get(el.dataset.id),\r\n sourceFormField = formFieldRegistry.get(source.dataset.id),\r\n sourceIndex = getFormFieldIndex(sourceFormField, formField);\r\n\r\n modeling.moveFormField(formField, sourceFormField, targetFormField, sourceIndex, targetIndex);\r\n }\r\n });\r\n\r\n eventBus.fire('dragula.created');\r\n\r\n setDrake(dragulaInstance);\r\n\r\n return dragulaInstance;\r\n };\r\n\r\n let dragulaInstance = createDragulaInstance();\r\n\r\n const onDetach = () => {\r\n if (dragulaInstance) {\r\n dragulaInstance.destroy();\r\n\r\n eventBus.fire('dragula.destroyed');\r\n }\r\n };\r\n\r\n const onAttach = () => {\r\n onDetach();\r\n\r\n dragulaInstance = createDragulaInstance();\r\n };\r\n\r\n eventBus.on('attach', onAttach);\r\n eventBus.on('detach', onDetach);\r\n\r\n return () => {\r\n onDetach();\r\n\r\n eventBus.off('attach', onAttach);\r\n eventBus.off('detach', onDetach);\r\n };\r\n }, []);\r\n\r\n // fire event after render to notify interested parties\r\n useEffect(() => {\r\n eventBus.fire('formEditor.rendered');\r\n }, []);\r\n\r\n const formRenderContext = {\r\n Children,\r\n Element,\r\n Empty\r\n };\r\n\r\n const formContext = {\r\n getService(type, strict = true) {\r\n\r\n // TODO(philippfromme): clean up\r\n if (type === 'formFieldRegistry') {\r\n return new Map();\r\n } else if (type === 'form') {\r\n return {\r\n _getState() {\r\n return {\r\n data: {},\r\n errors: {},\r\n properties: {\r\n readOnly: true\r\n },\r\n schema\r\n };\r\n }\r\n };\r\n }\r\n\r\n return injector.get(type, strict);\r\n },\r\n formId: formEditor._id\r\n };\r\n\r\n const onSubmit = useCallback(() => {}, []);\r\n\r\n const onReset = useCallback(() => {}, []);\r\n\r\n // attach default palette\r\n const hasDefaultPalette = defaultPalette(paletteConfig);\r\n\r\n useEffect(() => {\r\n if (hasDefaultPalette) {\r\n palette.attachTo(paletteRef.current);\r\n }\r\n }, [ palette, paletteRef, hasDefaultPalette ]);\r\n\r\n // attach default properties panel\r\n const hasDefaultPropertiesPanel = defaultPropertiesPanel(propertiesPanelConfig);\r\n\r\n useEffect(() => {\r\n if (hasDefaultPropertiesPanel) {\r\n propertiesPanel.attachTo(propertiesPanelRef.current);\r\n }\r\n }, [ propertiesPanelRef, propertiesPanel, hasDefaultPropertiesPanel ]);\r\n\r\n return (\r\n <div class=\"fjs-form-editor\">\r\n\r\n <DragAndDropContext.Provider value={ dragAndDropContext }>\r\n { hasDefaultPalette && <div class=\"fjs-editor-palette-container\" ref={ paletteRef } /> }\r\n <div class=\"fjs-form-container\">\r\n\r\n <FormContext.Provider value={ formContext }>\r\n <FormRenderContext.Provider value={ formRenderContext }>\r\n <FormComponent onSubmit={ onSubmit } onReset={ onReset } />\r\n </FormRenderContext.Provider>\r\n </FormContext.Provider>\r\n\r\n </div>\r\n <CreatePreview />\r\n </DragAndDropContext.Provider>\r\n\r\n { hasDefaultPropertiesPanel && <div class=\"fjs-editor-properties-container\" ref={ propertiesPanelRef } /> }\r\n </div>\r\n );\r\n}\r\n\r\nfunction getFormFieldIndex(parent, formField) {\r\n let fieldFormIndex = parent.components.length;\r\n\r\n parent.components.forEach(({ id }, index) => {\r\n if (id === formField.id) {\r\n fieldFormIndex = index;\r\n }\r\n });\r\n\r\n return fieldFormIndex;\r\n}\r\n\r\nfunction CreatePreview(props) {\r\n\r\n const { drake } = useContext(DragAndDropContext);\r\n\r\n function handleCloned(clone, original, type) {\r\n\r\n const fieldType = clone.dataset.fieldType;\r\n\r\n const Icon = iconsByType[ fieldType ];\r\n\r\n if (fieldType) {\r\n clone.innerHTML = '';\r\n\r\n clone.class = 'gu-mirror';\r\n\r\n render(<Icon />, clone);\r\n }\r\n }\r\n\r\n useEffect(() => {\r\n if (!drake) {\r\n return;\r\n }\r\n\r\n drake.on('cloned', handleCloned);\r\n\r\n return () => drake.off('cloned', handleCloned);\r\n }, [ drake ]);\r\n\r\n return null;\r\n}\r\n\r\n\r\n// helper //////\r\n\r\nfunction defaultPalette(paletteConfig) {\r\n return !(paletteConfig && paletteConfig.parent);\r\n}\r\n\r\nfunction defaultPropertiesPanel(propertiesPanelConfig) {\r\n return !(propertiesPanelConfig && propertiesPanelConfig.parent);\r\n}","import { render } from 'preact';\r\nimport { useState } from 'preact/hooks';\r\n\r\nimport FormEditor from './components/FormEditor';\r\n\r\nimport { FormEditorContext } from './context';\r\n\r\n/**\r\n * @typedef { { container: Element, compact?: boolean } } RenderConfig\r\n * @typedef { import('didi').Injector } Injector\r\n * @typedef { import('../core/EventBus').default } EventBus\r\n * @typedef { import('../FormEditor').default } FormEditor\r\n */\r\n\r\n/**\r\n * @param {RenderConfig} renderConfig\r\n * @param {EventBus} eventBus\r\n * @param {FormEditor} formEditor\r\n * @param {Injector} injector\r\n */\r\nexport default class Renderer {\r\n constructor(renderConfig, eventBus, formEditor, injector) {\r\n\r\n const {\r\n container,\r\n compact = false\r\n } = renderConfig;\r\n\r\n const App = () => {\r\n const [ state, setState ] = useState(formEditor._getState());\r\n\r\n const formEditorContext = {\r\n getService(type, strict = true) {\r\n return injector.get(type, strict);\r\n }\r\n };\r\n\r\n formEditor.on('changed', (newState) => {\r\n setState(newState);\r\n });\r\n\r\n const { schema } = state;\r\n\r\n if (!schema) {\r\n return null;\r\n }\r\n\r\n return (\r\n <div class={ `fjs-container fjs-editor-container ${ compact ? 'fjs-editor-compact' : '' }` }>\r\n <FormEditorContext.Provider value={ formEditorContext }>\r\n <FormEditor />\r\n </FormEditorContext.Provider>\r\n </div>\r\n );\r\n };\r\n\r\n eventBus.on('form.init', () => {\r\n render(<App />, container);\r\n });\r\n\r\n eventBus.on('form.destroy', () => {\r\n render(null, container);\r\n });\r\n }\r\n}\r\n\r\nRenderer.$inject = [ 'config.renderer', 'eventBus', 'formEditor', 'injector' ];","import { FormFields } from '@bpmn-io/form-js-viewer';\r\n\r\nimport Renderer from './Renderer';\r\n\r\nexport default {\r\n __init__: [ 'formFields', 'renderer' ],\r\n formFields: [ 'type', FormFields ],\r\n renderer: [ 'type', Renderer ]\r\n};","import EventBus from './EventBus';\r\nimport DebounceFactory from './Debounce';\r\nimport FieldFactory from './FieldFactory';\r\nimport FormFieldRegistry from './FormFieldRegistry';\r\n\r\nimport importModule from '../import';\r\nimport renderModule from '../render';\r\n\r\nexport default {\r\n __depends__: [\r\n importModule,\r\n renderModule\r\n ],\r\n eventBus: [ 'type', EventBus ],\r\n formFieldRegistry: [ 'type', FormFieldRegistry ],\r\n fieldFactory: [ 'type', FieldFactory ],\r\n debounce: [ 'factory', DebounceFactory ]\r\n};","import {\n forEach,\n isArray\n} from 'min-dash';\n\nvar NOT_REGISTERED_ERROR = 'is not a registered action',\n IS_REGISTERED_ERROR = 'is already registered';\n\n\n/**\n * An interface that provides access to modeling actions by decoupling\n * the one who requests the action to be triggered and the trigger itself.\n *\n * It's possible to add new actions by registering them with ´registerAction´\n * and likewise unregister existing ones with ´unregisterAction´.\n *\n *\n * ## Life-Cycle and configuration\n *\n * The editor actions will wait for diagram initialization before\n * registering default actions _and_ firing an `editorActions.init` event.\n *\n * Interested parties may listen to the `editorActions.init` event with\n * low priority to check, which actions got registered. Other components\n * may use the event to register their own actions via `registerAction`.\n *\n * @param {EventBus} eventBus\n * @param {Injector} injector\n */\nexport default function EditorActions(eventBus, injector) {\n\n // initialize actions\n this._actions = {};\n\n var self = this;\n\n eventBus.on('diagram.init', function() {\n\n // all diagram modules got loaded; check which ones\n // are available and register the respective default actions\n self._registerDefaultActions(injector);\n\n // ask interested parties to register available editor\n // actions on diagram initialization\n eventBus.fire('editorActions.init', {\n editorActions: self\n });\n });\n\n}\n\nEditorActions.$inject = [\n 'eventBus',\n 'injector'\n];\n\n/**\n * Register default actions.\n *\n * @param {Injector} injector\n */\nEditorActions.prototype._registerDefaultActions = function(injector) {\n\n // (1) retrieve optional components to integrate with\n\n var commandStack = injector.get('commandStack', false);\n var modeling = injector.get('modeling', false);\n var selection = injector.get('selection', false);\n var zoomScroll = injector.get('zoomScroll', false);\n var copyPaste = injector.get('copyPaste', false);\n var canvas = injector.get('canvas', false);\n var rules = injector.get('rules', false);\n var keyboardMove = injector.get('keyboardMove', false);\n var keyboardMoveSelection = injector.get('keyboardMoveSelection', false);\n\n // (2) check components and register actions\n\n if (commandStack) {\n this.register('undo', function() {\n commandStack.undo();\n });\n\n this.register('redo', function() {\n commandStack.redo();\n });\n }\n\n if (copyPaste && selection) {\n this.register('copy', function() {\n var selectedElements = selection.get();\n\n if (selectedElements.length) {\n return copyPaste.copy(selectedElements);\n }\n });\n }\n\n if (copyPaste) {\n this.register('paste', function() {\n copyPaste.paste();\n });\n }\n\n if (zoomScroll) {\n this.register('stepZoom', function(opts) {\n zoomScroll.stepZoom(opts.value);\n });\n }\n\n if (canvas) {\n this.register('zoom', function(opts) {\n canvas.zoom(opts.value);\n });\n }\n\n if (modeling && selection && rules) {\n this.register('removeSelection', function() {\n\n var selectedElements = selection.get();\n\n if (!selectedElements.length) {\n return;\n }\n\n var allowed = rules.allowed('elements.delete', { elements: selectedElements }),\n removableElements;\n\n if (allowed === false) {\n return;\n }\n else if (isArray(allowed)) {\n removableElements = allowed;\n }\n else {\n removableElements = selectedElements;\n }\n\n if (removableElements.length) {\n modeling.removeElements(removableElements.slice());\n }\n });\n }\n\n if (keyboardMove) {\n this.register('moveCanvas', function(opts) {\n keyboardMove.moveCanvas(opts);\n });\n }\n\n if (keyboardMoveSelection) {\n this.register('moveSelection', function(opts) {\n keyboardMoveSelection.moveSelection(opts.direction, opts.accelerated);\n });\n }\n\n};\n\n\n/**\n * Triggers a registered action\n *\n * @param {string} action\n * @param {Object} opts\n *\n * @return {Unknown} Returns what the registered listener returns\n */\nEditorActions.prototype.trigger = function(action, opts) {\n if (!this._actions[action]) {\n throw error(action, NOT_REGISTERED_ERROR);\n }\n\n return this._actions[action](opts);\n};\n\n\n/**\n * Registers a collections of actions.\n * The key of the object will be the name of the action.\n *\n * @example\n * ´´´\n * var actions = {\n * spaceTool: function() {\n * spaceTool.activateSelection();\n * },\n * lassoTool: function() {\n * lassoTool.activateSelection();\n * }\n * ];\n *\n * editorActions.register(actions);\n *\n * editorActions.isRegistered('spaceTool'); // true\n * ´´´\n *\n * @param {Object} actions\n */\nEditorActions.prototype.register = function(actions, listener) {\n var self = this;\n\n if (typeof actions === 'string') {\n return this._registerAction(actions, listener);\n }\n\n forEach(actions, function(listener, action) {\n self._registerAction(action, listener);\n });\n};\n\n/**\n * Registers a listener to an action key\n *\n * @param {string} action\n * @param {Function} listener\n */\nEditorActions.prototype._registerAction = function(action, listener) {\n if (this.isRegistered(action)) {\n throw error(action, IS_REGISTERED_ERROR);\n }\n\n this._actions[action] = listener;\n};\n\n/**\n * Unregister an existing action\n *\n * @param {string} action\n */\nEditorActions.prototype.unregister = function(action) {\n if (!this.isRegistered(action)) {\n throw error(action, NOT_REGISTERED_ERROR);\n }\n\n this._actions[action] = undefined;\n};\n\n/**\n * Returns the number of actions that are currently registered\n *\n * @return {number}\n */\nEditorActions.prototype.getActions = function() {\n return Object.keys(this._actions);\n};\n\n/**\n * Checks wether the given action is registered\n *\n * @param {string} action\n *\n * @return {boolean}\n */\nEditorActions.prototype.isRegistered = function(action) {\n return !!this._actions[action];\n};\n\n\nfunction error(action, message) {\n return new Error(action + ' ' + message);\n}\n","import EditorActions from './EditorActions';\n\nexport default {\n __init__: [ 'editorActions' ],\n editorActions: [ 'type', EditorActions ]\n};\n","import EditorActions from 'diagram-js/lib/features/editor-actions/EditorActions';\r\n\r\n\r\nexport default class FormEditorActions extends EditorActions {\r\n constructor(eventBus, injector) {\r\n super(eventBus, injector);\r\n\r\n eventBus.on('form.init', () => {\r\n this._registerDefaultActions(injector);\r\n\r\n eventBus.fire('editorActions.init', {\r\n editorActions: this\r\n });\r\n });\r\n }\r\n\r\n _registerDefaultActions(injector) {\r\n const commandStack = injector.get('commandStack', false),\r\n formFieldRegistry = injector.get('formFieldRegistry', false),\r\n selection = injector.get('selection', false);\r\n\r\n if (commandStack) {\r\n\r\n // @ts-ignore\r\n this.register('undo', () => {\r\n commandStack.undo();\r\n });\r\n\r\n // @ts-ignore\r\n this.register('redo', () => {\r\n commandStack.redo();\r\n });\r\n }\r\n\r\n if (formFieldRegistry && selection) {\r\n\r\n // @ts-ignore\r\n this.register('selectFormField', (options = {}) => {\r\n const { id } = options;\r\n\r\n if (!id) {\r\n return;\r\n }\r\n\r\n const formField = formFieldRegistry.get(id);\r\n\r\n if (formField) {\r\n selection.set(formField);\r\n }\r\n });\r\n }\r\n }\r\n}\r\n\r\nFormEditorActions.$inject = [\r\n 'eventBus',\r\n 'injector'\r\n];","import EditorActionsModule from 'diagram-js/lib/features/editor-actions';\r\n\r\nimport FormEditorActions from './FormEditorActions';\r\n\r\nexport default {\r\n __depends__: [\r\n EditorActionsModule\r\n ],\r\n editorActions: [ 'type', FormEditorActions ]\r\n};\r\n","import { isArray } from 'min-dash';\r\n\r\nvar KEYS_COPY = [ 'c', 'C', 'KeyC' ];\r\nvar KEYS_PASTE = [ 'v', 'V', 'KeyV' ];\r\nvar KEYS_REDO = [ 'y', 'Y', 'KeyY' ];\r\nvar KEYS_UNDO = [ 'z', 'Z', 'KeyZ' ];\r\n\r\n/**\r\n * Returns true if event was triggered with any modifier\r\n * @param {KeyboardEvent} event\r\n */\r\nexport function hasModifier(event) {\r\n return (event.ctrlKey || event.metaKey || event.shiftKey || event.altKey);\r\n}\r\n\r\n/**\r\n * @param {KeyboardEvent} event\r\n */\r\nexport function isCmd(event) {\r\n\r\n // ensure we don't react to AltGr\r\n // (mapped to CTRL + ALT)\r\n if (event.altKey) {\r\n return false;\r\n }\r\n\r\n return event.ctrlKey || event.metaKey;\r\n}\r\n\r\n/**\r\n * Checks if key pressed is one of provided keys.\r\n *\r\n * @param {string|Array<string>} keys\r\n * @param {KeyboardEvent} event\r\n */\r\nexport function isKey(keys, event) {\r\n keys = isArray(keys) ? keys : [ keys ];\r\n\r\n return keys.indexOf(event.key) !== -1 || keys.indexOf(event.code) !== -1;\r\n}\r\n\r\n/**\r\n * @param {KeyboardEvent} event\r\n */\r\nexport function isShift(event) {\r\n return event.shiftKey;\r\n}\r\n\r\nexport function isCopy(event) {\r\n return isCmd(event) && isKey(KEYS_COPY, event);\r\n}\r\n\r\nexport function isPaste(event) {\r\n return isCmd(event) && isKey(KEYS_PASTE, event);\r\n}\r\n\r\nexport function isUndo(event) {\r\n return isCmd(event) && !isShift(event) && isKey(KEYS_UNDO, event);\r\n}\r\n\r\nexport function isRedo(event) {\r\n return isCmd(event) && (\r\n isKey(KEYS_REDO, event) || (\r\n isKey(KEYS_UNDO, event) && isShift(event)\r\n )\r\n );\r\n}","import {\n isFunction\n} from 'min-dash';\n\nimport {\n closest as domClosest,\n event as domEvent,\n matches as domMatches\n} from 'min-dom';\n\nimport {\n hasModifier,\n isCmd,\n isKey,\n isShift\n} from './KeyboardUtil';\n\nvar KEYDOWN_EVENT = 'keyboard.keydown',\n KEYUP_EVENT = 'keyboard.keyup';\n\nvar HANDLE_MODIFIER_ATTRIBUTE = 'input-handle-modified-keys';\n\nvar DEFAULT_PRIORITY = 1000;\n\n/**\n * A keyboard abstraction that may be activated and\n * deactivated by users at will, consuming global key events\n * and triggering diagram actions.\n *\n * For keys pressed down, keyboard fires `keyboard.keydown` event.\n * The event context contains one field which is `KeyboardEvent` event.\n *\n * The implementation fires the following key events that allow\n * other components to hook into key handling:\n *\n * - keyboard.bind\n * - keyboard.unbind\n * - keyboard.init\n * - keyboard.destroy\n *\n * All events contain one field which is node.\n *\n * A default binding for the keyboard may be specified via the\n * `keyboard.bindTo` configuration option.\n *\n * @param {Config} config\n * @param {EventBus} eventBus\n */\nexport default function Keyboard(config, eventBus) {\n var self = this;\n\n this._config = config || {};\n this._eventBus = eventBus;\n\n this._keydownHandler = this._keydownHandler.bind(this);\n this._keyupHandler = this._keyupHandler.bind(this);\n\n // properly clean dom registrations\n eventBus.on('diagram.destroy', function() {\n self._fire('destroy');\n\n self.unbind();\n });\n\n eventBus.on('diagram.init', function() {\n self._fire('init');\n });\n\n eventBus.on('attach', function() {\n if (config && config.bindTo) {\n self.bind(config.bindTo);\n }\n });\n\n eventBus.on('detach', function() {\n self.unbind();\n });\n}\n\nKeyboard.$inject = [\n 'config.keyboard',\n 'eventBus'\n];\n\nKeyboard.prototype._keydownHandler = function(event) {\n this._keyHandler(event, KEYDOWN_EVENT);\n};\n\nKeyboard.prototype._keyupHandler = function(event) {\n this._keyHandler(event, KEYUP_EVENT);\n};\n\nKeyboard.prototype._keyHandler = function(event, type) {\n var eventBusResult;\n\n if (this._isEventIgnored(event)) {\n return;\n }\n\n var context = {\n keyEvent: event\n };\n\n eventBusResult = this._eventBus.fire(type || KEYDOWN_EVENT, context);\n\n if (eventBusResult) {\n event.preventDefault();\n }\n};\n\nKeyboard.prototype._isEventIgnored = function(event) {\n if (event.defaultPrevented) {\n return true;\n }\n\n return isInput(event.target) && this._isModifiedKeyIgnored(event);\n};\n\nKeyboard.prototype._isModifiedKeyIgnored = function(event) {\n if (!isCmd(event)) {\n return true;\n }\n\n var allowedModifiers = this._getAllowedModifiers(event.target);\n return allowedModifiers.indexOf(event.key) === -1;\n};\n\nKeyboard.prototype._getAllowedModifiers = function(element) {\n var modifierContainer = domClosest(element, '[' + HANDLE_MODIFIER_ATTRIBUTE + ']', true);\n\n if (!modifierContainer || (this._node && !this._node.contains(modifierContainer))) {\n return [];\n }\n\n return modifierContainer.getAttribute(HANDLE_MODIFIER_ATTRIBUTE).split(',');\n};\n\nKeyboard.prototype.bind = function(node) {\n\n // make sure that the keyboard is only bound once to the DOM\n this.unbind();\n\n this._node = node;\n\n // bind key events\n domEvent.bind(node, 'keydown', this._keydownHandler);\n domEvent.bind(node, 'keyup', this._keyupHandler);\n\n this._fire('bind');\n};\n\nKeyboard.prototype.getBinding = function() {\n return this._node;\n};\n\nKeyboard.prototype.unbind = function() {\n var node = this._node;\n\n if (node) {\n this._fire('unbind');\n\n // unbind key events\n domEvent.unbind(node, 'keydown', this._keydownHandler);\n domEvent.unbind(node, 'keyup', this._keyupHandler);\n }\n\n this._node = null;\n};\n\nKeyboard.prototype._fire = function(event) {\n this._eventBus.fire('keyboard.' + event, { node: this._node });\n};\n\n/**\n * Add a listener function that is notified with `KeyboardEvent` whenever\n * the keyboard is bound and the user presses a key. If no priority is\n * provided, the default value of 1000 is used.\n *\n * @param {number} [priority]\n * @param {Function} listener\n * @param {string} type\n */\nKeyboard.prototype.addListener = function(priority, listener, type) {\n if (isFunction(priority)) {\n type = listener;\n listener = priority;\n priority = DEFAULT_PRIORITY;\n }\n\n this._eventBus.on(type || KEYDOWN_EVENT, priority, listener);\n};\n\nKeyboard.prototype.removeListener = function(listener, type) {\n this._eventBus.off(type || KEYDOWN_EVENT, listener);\n};\n\nKeyboard.prototype.hasModifier = hasModifier;\nKeyboard.prototype.isCmd = isCmd;\nKeyboard.prototype.isShift = isShift;\nKeyboard.prototype.isKey = isKey;\n\n\n\n// helpers ///////\n\nfunction isInput(target) {\n return target && (domMatches(target, 'input, textarea') || target.contentEditable === 'true');\n}\n","import {\n isCmd,\n isKey,\n isCopy,\n isPaste,\n isUndo,\n isRedo\n} from './KeyboardUtil';\n\nvar LOW_PRIORITY = 500;\n\nexport var KEYS_COPY = [ 'c', 'C', 'KeyC' ];\nexport var KEYS_PASTE = [ 'v', 'V', 'KeyV' ];\nexport var KEYS_REDO = [ 'y', 'Y', 'KeyY' ];\nexport var KEYS_UNDO = [ 'z', 'Z', 'KeyZ' ];\n\n\n/**\n * Adds default keyboard bindings.\n *\n * This does not pull in any features will bind only actions that\n * have previously been registered against the editorActions component.\n *\n * @param {EventBus} eventBus\n * @param {Keyboard} keyboard\n */\nexport default function KeyboardBindings(eventBus, keyboard) {\n\n var self = this;\n\n eventBus.on('editorActions.init', LOW_PRIORITY, function(event) {\n\n var editorActions = event.editorActions;\n\n self.registerBindings(keyboard, editorActions);\n });\n}\n\nKeyboardBindings.$inject = [\n 'eventBus',\n 'keyboard'\n];\n\n\n/**\n * Register available keyboard bindings.\n *\n * @param {Keyboard} keyboard\n * @param {EditorActions} editorActions\n */\nKeyboardBindings.prototype.registerBindings = function(keyboard, editorActions) {\n\n /**\n * Add keyboard binding if respective editor action\n * is registered.\n *\n * @param {string} action name\n * @param {Function} fn that implements the key binding\n */\n function addListener(action, fn) {\n\n if (editorActions.isRegistered(action)) {\n keyboard.addListener(fn);\n }\n }\n\n\n // undo\n // (CTRL|CMD) + Z\n addListener('undo', function(context) {\n\n var event = context.keyEvent;\n\n if (isUndo(event)) {\n editorActions.trigger('undo');\n\n return true;\n }\n });\n\n // redo\n // CTRL + Y\n // CMD + SHIFT + Z\n addListener('redo', function(context) {\n\n var event = context.keyEvent;\n\n if (isRedo(event)) {\n editorActions.trigger('redo');\n\n return true;\n }\n });\n\n // copy\n // CTRL/CMD + C\n addListener('copy', function(context) {\n\n var event = context.keyEvent;\n\n if (isCopy(event)) {\n editorActions.trigger('copy');\n\n return true;\n }\n });\n\n // paste\n // CTRL/CMD + V\n addListener('paste', function(context) {\n\n var event = context.keyEvent;\n\n if (isPaste(event)) {\n editorActions.trigger('paste');\n\n return true;\n }\n });\n\n // zoom in one step\n // CTRL/CMD + +\n addListener('stepZoom', function(context) {\n\n var event = context.keyEvent;\n\n // quirk: it has to be triggered by `=` as well to work on international keyboard layout\n // cf: https://github.com/bpmn-io/bpmn-js/issues/1362#issuecomment-722989754\n if (isKey([ '+', 'Add', '=' ], event) && isCmd(event)) {\n editorActions.trigger('stepZoom', { value: 1 });\n\n return true;\n }\n });\n\n // zoom out one step\n // CTRL + -\n addListener('stepZoom', function(context) {\n\n var event = context.keyEvent;\n\n if (isKey([ '-', 'Subtract' ], event) && isCmd(event)) {\n editorActions.trigger('stepZoom', { value: -1 });\n\n return true;\n }\n });\n\n // zoom to the default level\n // CTRL + 0\n addListener('zoom', function(context) {\n\n var event = context.keyEvent;\n\n if (isKey('0', event) && isCmd(event)) {\n editorActions.trigger('zoom', { value: 1 });\n\n return true;\n }\n });\n\n // delete selected element\n // DEL\n addListener('removeSelection', function(context) {\n\n var event = context.keyEvent;\n\n if (isKey([ 'Backspace', 'Delete', 'Del' ], event)) {\n editorActions.trigger('removeSelection');\n\n return true;\n }\n });\n};","import Keyboard from './Keyboard';\nimport KeyboardBindings from './KeyboardBindings';\n\nexport default {\n __init__: [ 'keyboard', 'keyboardBindings' ],\n keyboard: [ 'type', Keyboard ],\n keyboardBindings: [ 'type', KeyboardBindings ]\n};\n","import {\r\n isCmd,\r\n isKey,\r\n isShift\r\n} from 'diagram-js/lib/features/keyboard/KeyboardUtil';\r\n\r\nimport {\r\n KEYS_REDO,\r\n KEYS_UNDO\r\n} from 'diagram-js/lib/features/keyboard/KeyboardBindings';\r\n\r\nconst LOW_PRIORITY = 500;\r\n\r\nexport default class FormEditorKeyboardBindings {\r\n constructor(eventBus, keyboard) {\r\n eventBus.on('editorActions.init', LOW_PRIORITY, (event) => {\r\n const { editorActions } = event;\r\n\r\n this.registerBindings(keyboard, editorActions);\r\n });\r\n }\r\n\r\n registerBindings(keyboard, editorActions) {\r\n\r\n function addListener(action, fn) {\r\n if (editorActions.isRegistered(action)) {\r\n keyboard.addListener(fn);\r\n }\r\n }\r\n\r\n // undo\r\n // (CTRL|CMD) + Z\r\n addListener('undo', (context) => {\r\n const { keyEvent } = context;\r\n\r\n if (isCmd(keyEvent) && !isShift(keyEvent) && isKey(KEYS_UNDO, keyEvent)) {\r\n editorActions.trigger('undo');\r\n\r\n return true;\r\n }\r\n });\r\n\r\n // redo\r\n // CTRL + Y\r\n // CMD + SHIFT + Z\r\n addListener('redo', (context) => {\r\n const { keyEvent } = context;\r\n\r\n if (isCmd(keyEvent) && (isKey(KEYS_REDO, keyEvent) || (isKey(KEYS_UNDO, keyEvent) && isShift(keyEvent)))) {\r\n editorActions.trigger('redo');\r\n\r\n return true;\r\n }\r\n });\r\n\r\n }\r\n}\r\n\r\nFormEditorKeyboardBindings.$inject = [ 'eventBus', 'keyboard' ];","import KeyboardModule from 'diagram-js/lib/features/keyboard';\r\n\r\nimport FormEditorKeyboardBindings from './FormEditorKeyboardBindings';\r\n\r\nexport default {\r\n __depends__: [\r\n KeyboardModule\r\n ],\r\n __init__: [ 'keyboardBindings' ],\r\n keyboardBindings: [ 'type', FormEditorKeyboardBindings ]\r\n};","export function arrayAdd(array, index, item) {\r\n array.splice(index, 0, item);\r\n\r\n return array;\r\n}\r\n\r\nexport { mutate as arrayMove } from 'array-move';\r\n\r\nexport function arrayRemove(array, index) {\r\n array.splice(index, 1);\r\n\r\n return array;\r\n}\r\n\r\nexport function updatePath(formFieldRegistry, formField, index) {\r\n const parent = formFieldRegistry.get(formField._parent);\r\n\r\n formField._path = [ ...parent._path, 'components', index ];\r\n\r\n return formField;\r\n}","import { get } from 'min-dash';\r\n\r\nimport {\r\n arrayAdd,\r\n arrayRemove,\r\n updatePath\r\n} from './Util';\r\n\r\nexport default class AddFormFieldHandler {\r\n\r\n /**\r\n * @constructor\r\n * @param { import('../../../FormEditor').default } formEditor\r\n * @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry\r\n */\r\n constructor(formEditor, formFieldRegistry) {\r\n this._formEditor = formEditor;\r\n this._formFieldRegistry = formFieldRegistry;\r\n }\r\n\r\n execute(context) {\r\n const {\r\n formField,\r\n targetFormField,\r\n targetIndex\r\n } = context;\r\n\r\n const { schema } = this._formEditor._getState();\r\n\r\n const targetPath = [ ...targetFormField._path, 'components' ];\r\n\r\n formField._parent = targetFormField.id;\r\n\r\n // (1) Add new form field\r\n arrayAdd(get(schema, targetPath), targetIndex, formField);\r\n\r\n // (2) Update paths of new form field and its siblings\r\n get(schema, targetPath).forEach((formField, index) => updatePath(this._formFieldRegistry, formField, index));\r\n\r\n // (3) Add new form field to form field registry\r\n this._formFieldRegistry.add(formField);\r\n\r\n // TODO: Create updater/change support that automatically updates paths and schema on command execution\r\n this._formEditor._setState({ schema });\r\n }\r\n\r\n revert(context) {\r\n const {\r\n formField,\r\n targetFormField,\r\n targetIndex\r\n } = context;\r\n\r\n const { schema } = this._formEditor._getState();\r\n\r\n const targetPath = [ ...targetFormField._path, 'components' ];\r\n\r\n // (1) Remove new form field\r\n arrayRemove(get(schema, targetPath), targetIndex);\r\n\r\n // (2) Update paths of new form field and its siblings\r\n get(schema, targetPath).forEach((formField, index) => updatePath(this._formFieldRegistry, formField, index));\r\n\r\n // (3) Remove new form field from form field registry\r\n this._formFieldRegistry.remove(formField);\r\n\r\n // TODO: Create updater/change support that automatically updates paths and schema on command execution\r\n this._formEditor._setState({ schema });\r\n }\r\n}\r\n\r\nAddFormFieldHandler.$inject = [ 'formEditor', 'formFieldRegistry' ];","export default class EditFormFieldHandler {\r\n\r\n /**\r\n * @constructor\r\n * @param { import('../../../FormEditor').default } formEditor\r\n * @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry\r\n */\r\n constructor(formEditor, formFieldRegistry) {\r\n this._formEditor = formEditor;\r\n this._formFieldRegistry = formFieldRegistry;\r\n }\r\n\r\n execute(context) {\r\n const {\r\n formField,\r\n properties\r\n } = context;\r\n\r\n let { schema } = this._formEditor._getState();\r\n\r\n const oldProperties = {};\r\n\r\n for (let key in properties) {\r\n oldProperties[ key ] = formField[ key ];\r\n\r\n const property = properties[ key ];\r\n\r\n if (key === 'id') {\r\n if (property !== formField.id) {\r\n this._formFieldRegistry.updateId(formField, property);\r\n }\r\n } else {\r\n formField[ key ] = property;\r\n }\r\n }\r\n\r\n context.oldProperties = oldProperties;\r\n\r\n // TODO: Create updater/change support that automatically updates paths and schema on command execution\r\n this._formEditor._setState({ schema });\r\n\r\n return formField;\r\n }\r\n\r\n revert(context) {\r\n const {\r\n formField,\r\n oldProperties\r\n } = context;\r\n\r\n let { schema } = this._formEditor._getState();\r\n\r\n for (let key in oldProperties) {\r\n\r\n const property = oldProperties[ key ];\r\n\r\n if (key === 'id') {\r\n if (property !== formField.id) {\r\n this._formFieldRegistry.updateId(formField, property);\r\n }\r\n } else {\r\n formField[ key ] = property;\r\n }\r\n }\r\n\r\n // TODO: Create updater/change support that automatically updates paths and schema on command execution\r\n this._formEditor._setState({ schema });\r\n\r\n return formField;\r\n }\r\n\r\n}\r\n\r\nEditFormFieldHandler.$inject = [\r\n 'formEditor',\r\n 'formFieldRegistry'\r\n];","import { get } from 'min-dash';\r\n\r\nimport {\r\n arrayAdd,\r\n arrayMove,\r\n arrayRemove,\r\n updatePath\r\n} from './Util';\r\n\r\nexport default class MoveFormFieldHandler {\r\n\r\n /**\r\n * @constructor\r\n * @param { import('../../../FormEditor').default } formEditor\r\n * @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry\r\n */\r\n constructor(formEditor, formFieldRegistry) {\r\n this._formEditor = formEditor;\r\n this._formFieldRegistry = formFieldRegistry;\r\n }\r\n\r\n execute(context) {\r\n this.moveFormField(context);\r\n }\r\n\r\n revert(context) {\r\n let {\r\n sourceFormField,\r\n targetFormField,\r\n sourceIndex,\r\n targetIndex\r\n } = context;\r\n\r\n this.moveFormField({\r\n sourceFormField: targetFormField,\r\n targetFormField: sourceFormField,\r\n sourceIndex: targetIndex,\r\n targetIndex: sourceIndex\r\n }, true);\r\n }\r\n\r\n moveFormField(context, revert) {\r\n let {\r\n sourceFormField,\r\n targetFormField,\r\n sourceIndex,\r\n targetIndex\r\n } = context;\r\n\r\n let { schema } = this._formEditor._getState();\r\n\r\n const sourcePath = [ ...sourceFormField._path, 'components' ];\r\n\r\n if (sourceFormField.id === targetFormField.id) {\r\n\r\n if (revert) {\r\n if (sourceIndex > targetIndex) {\r\n sourceIndex--;\r\n }\r\n } else {\r\n if (sourceIndex < targetIndex) {\r\n targetIndex--;\r\n }\r\n }\r\n\r\n // (1) Move form field\r\n arrayMove(get(schema, sourcePath), sourceIndex, targetIndex);\r\n\r\n // (2) Update paths of new form field and its siblings\r\n get(schema, sourcePath).forEach((formField, index) => updatePath(this._formFieldRegistry, formField, index));\r\n\r\n } else {\r\n const formField = get(schema, [ ...sourcePath, sourceIndex ]);\r\n\r\n formField._parent = targetFormField.id;\r\n\r\n // (1) Remove form field\r\n arrayRemove(get(schema, sourcePath), sourceIndex);\r\n\r\n // (2) Update paths of siblings\r\n get(schema, sourcePath).forEach((formField, index) => updatePath(this._formFieldRegistry, formField, index));\r\n\r\n const targetPath = [ ...targetFormField._path, 'components' ];\r\n\r\n // (3) Add form field\r\n arrayAdd(get(schema, targetPath), targetIndex, formField);\r\n\r\n // (4) Update paths of siblings\r\n get(schema, targetPath).forEach((formField, index) => updatePath(this._formFieldRegistry, formField, index));\r\n }\r\n\r\n // TODO: Create updater/change support that automatically updates paths and schema on command execution\r\n this._formEditor._setState({ schema });\r\n }\r\n}\r\n\r\nMoveFormFieldHandler.$inject = [ 'formEditor', 'formFieldRegistry' ];","import { get } from 'min-dash';\r\n\r\nimport {\r\n arrayAdd,\r\n arrayRemove,\r\n updatePath\r\n} from './Util';\r\n\r\nexport default class RemoveFormFieldHandler {\r\n\r\n /**\r\n * @constructor\r\n * @param { import('../../../FormEditor').default } formEditor\r\n * @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry\r\n */\r\n constructor(formEditor, formFieldRegistry) {\r\n this._formEditor = formEditor;\r\n this._formFieldRegistry = formFieldRegistry;\r\n }\r\n\r\n execute(context) {\r\n const {\r\n sourceFormField,\r\n sourceIndex\r\n } = context;\r\n\r\n let { schema } = this._formEditor._getState();\r\n\r\n const sourcePath = [ ...sourceFormField._path, 'components' ];\r\n\r\n const formField = context.formField = get(schema, [ ...sourcePath, sourceIndex ]);\r\n\r\n // (1) Remove form field\r\n arrayRemove(get(schema, sourcePath), sourceIndex);\r\n\r\n // (2) Update paths of its siblings\r\n get(schema, sourcePath).forEach((formField, index) => updatePath(this._formFieldRegistry, formField, index));\r\n\r\n // (3) Remove form field from form field registry\r\n this._formFieldRegistry.remove(formField);\r\n\r\n // TODO: Create updater/change support that automatically updates paths and schema on command execution\r\n this._formEditor._setState({ schema });\r\n }\r\n\r\n revert(context) {\r\n const {\r\n formField,\r\n sourceFormField,\r\n sourceIndex\r\n } = context;\r\n\r\n let { schema } = this._formEditor._getState();\r\n\r\n const sourcePath = [ ...sourceFormField._path, 'components' ];\r\n\r\n // (1) Add form field\r\n arrayAdd(get(schema, sourcePath), sourceIndex, formField);\r\n\r\n // (2) Update paths of its siblings\r\n get(schema, sourcePath).forEach((formField, index) => updatePath(this._formFieldRegistry, formField, index));\r\n\r\n // (3) Add form field to form field registry\r\n this._formFieldRegistry.add(formField);\r\n\r\n // TODO: Create updater/change support that automatically updates paths and schema on command execution\r\n this._formEditor._setState({ schema });\r\n }\r\n}\r\n\r\nRemoveFormFieldHandler.$inject = [ 'formEditor', 'formFieldRegistry' ];","export default class UpdateIdClaimHandler {\r\n\r\n /**\r\n * @constructor\r\n * @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry\r\n */\r\n constructor(formFieldRegistry) {\r\n this._formFieldRegistry = formFieldRegistry;\r\n }\r\n\r\n execute(context) {\r\n const {\r\n claiming,\r\n formField,\r\n id\r\n } = context;\r\n\r\n if (claiming) {\r\n this._formFieldRegistry._ids.claim(id, formField);\r\n } else {\r\n this._formFieldRegistry._ids.unclaim(id);\r\n }\r\n }\r\n\r\n revert(context) {\r\n const {\r\n claiming,\r\n formField,\r\n id\r\n } = context;\r\n\r\n if (claiming) {\r\n this._formFieldRegistry._ids.unclaim(id);\r\n } else {\r\n this._formFieldRegistry._ids.claim(id, formField);\r\n }\r\n }\r\n}\r\n\r\nUpdateIdClaimHandler.$inject = [ 'formFieldRegistry' ];","export default class UpdateKeyClaimHandler {\r\n\r\n /**\r\n * @constructor\r\n * @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry\r\n */\r\n constructor(formFieldRegistry) {\r\n this._formFieldRegistry = formFieldRegistry;\r\n }\r\n\r\n execute(context) {\r\n const {\r\n claiming,\r\n formField,\r\n key\r\n } = context;\r\n\r\n if (claiming) {\r\n this._formFieldRegistry._keys.claim(key, formField);\r\n } else {\r\n this._formFieldRegistry._keys.unclaim(key);\r\n }\r\n }\r\n\r\n revert(context) {\r\n const {\r\n claiming,\r\n formField,\r\n key\r\n } = context;\r\n\r\n if (claiming) {\r\n this._formFieldRegistry._keys.unclaim(key);\r\n } else {\r\n this._formFieldRegistry._keys.claim(key, formField);\r\n }\r\n }\r\n}\r\n\r\nUpdateKeyClaimHandler.$inject = [ 'formFieldRegistry' ];","import AddFormFieldHandler from './cmd/AddFormFieldHandler';\r\nimport EditFormFieldHandler from './cmd/EditFormFieldHandler';\r\nimport MoveFormFieldHandler from './cmd/MoveFormFieldHandler';\r\nimport RemoveFormFieldHandler from './cmd/RemoveFormFieldHandler';\r\nimport UpdateIdClaimHandler from './cmd/UpdateIdClaimHandler';\r\nimport UpdateKeyClaimHandler from './cmd/UpdateKeyClaimHandler';\r\n\r\nimport { isObject } from 'min-dash';\r\n\r\n\r\nexport default class Modeling {\r\n constructor(commandStack, eventBus, formEditor, formFieldRegistry, fieldFactory) {\r\n this._commandStack = commandStack;\r\n this._formEditor = formEditor;\r\n this._formFieldRegistry = formFieldRegistry;\r\n this._fieldFactory = fieldFactory;\r\n\r\n eventBus.on('form.init', () => {\r\n this.registerHandlers();\r\n });\r\n }\r\n\r\n registerHandlers() {\r\n Object.entries(this.getHandlers()).forEach(([ id, handler ]) => {\r\n this._commandStack.registerHandler(id, handler);\r\n });\r\n }\r\n\r\n getHandlers() {\r\n return {\r\n 'formField.add': AddFormFieldHandler,\r\n 'formField.edit': EditFormFieldHandler,\r\n 'formField.move': MoveFormFieldHandler,\r\n 'formField.remove': RemoveFormFieldHandler,\r\n 'id.updateClaim': UpdateIdClaimHandler,\r\n 'key.updateClaim': UpdateKeyClaimHandler\r\n };\r\n }\r\n\r\n addFormField(attrs, targetFormField, targetIndex) {\r\n\r\n const formField = this._fieldFactory.create(attrs);\r\n\r\n const context = {\r\n formField,\r\n targetFormField,\r\n targetIndex\r\n };\r\n\r\n this._commandStack.execute('formField.add', context);\r\n\r\n return formField;\r\n }\r\n\r\n editFormField(formField, properties, value) {\r\n if (!isObject(properties)) {\r\n properties = {\r\n [ properties ]: value\r\n };\r\n }\r\n\r\n const context = {\r\n formField,\r\n properties\r\n };\r\n\r\n this._commandStack.execute('formField.edit', context);\r\n }\r\n\r\n moveFormField(formField, sourceFormField, targetFormField, sourceIndex, targetIndex) {\r\n const context = {\r\n formField,\r\n sourceFormField,\r\n targetFormField,\r\n sourceIndex,\r\n targetIndex\r\n };\r\n\r\n this._commandStack.execute('formField.move', context);\r\n }\r\n\r\n removeFormField(formField, sourceFormField, sourceIndex) {\r\n const context = {\r\n formField,\r\n sourceFormField,\r\n sourceIndex\r\n };\r\n\r\n this._commandStack.execute('formField.remove', context);\r\n }\r\n\r\n claimId(formField, id) {\r\n const context = {\r\n formField,\r\n id,\r\n claiming: true\r\n };\r\n\r\n this._commandStack.execute('id.updateClaim', context);\r\n }\r\n\r\n unclaimId(formField, id) {\r\n const context = {\r\n formField,\r\n id,\r\n claiming: false\r\n };\r\n\r\n this._commandStack.execute('id.updateClaim', context);\r\n }\r\n\r\n claimKey(formField, key) {\r\n const context = {\r\n formField,\r\n key,\r\n claiming: true\r\n };\r\n\r\n this._commandStack.execute('key.updateClaim', context);\r\n }\r\n\r\n unclaimKey(formField, key) {\r\n const context = {\r\n formField,\r\n key,\r\n claiming: false\r\n };\r\n\r\n this._commandStack.execute('key.updateClaim', context);\r\n }\r\n}\r\n\r\nModeling.$inject = [\r\n 'commandStack',\r\n 'eventBus',\r\n 'formEditor',\r\n 'formFieldRegistry',\r\n 'fieldFactory'\r\n];","import {\n forEach,\n isFunction,\n isArray,\n isNumber,\n isObject\n} from 'min-dash';\n\n\nvar DEFAULT_PRIORITY = 1000;\n\n/**\n * A utility that can be used to plug-in into the command execution for\n * extension and/or validation.\n *\n * @param {EventBus} eventBus\n *\n * @example\n *\n * import inherits from 'inherits-browser';\n *\n * import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';\n *\n * function CommandLogger(eventBus) {\n * CommandInterceptor.call(this, eventBus);\n *\n * this.preExecute(function(event) {\n * console.log('command pre-execute', event);\n * });\n * }\n *\n * inherits(CommandLogger, CommandInterceptor);\n *\n */\nexport default function CommandInterceptor(eventBus) {\n this._eventBus = eventBus;\n}\n\nCommandInterceptor.$inject = [ 'eventBus' ];\n\nfunction unwrapEvent(fn, that) {\n return function(event) {\n return fn.call(that || null, event.context, event.command, event);\n };\n}\n\n/**\n * Register an interceptor for a command execution\n *\n * @param {string|Array<string>} [events] list of commands to register on\n * @param {string} [hook] command hook, i.e. preExecute, executed to listen on\n * @param {number} [priority] the priority on which to hook into the execution\n * @param {Function} handlerFn interceptor to be invoked with (event)\n * @param {boolean} unwrap if true, unwrap the event and pass (context, command, event) to the\n * listener instead\n * @param {Object} [that] Pass context (`this`) to the handler function\n */\nCommandInterceptor.prototype.on = function(events, hook, priority, handlerFn, unwrap, that) {\n\n if (isFunction(hook) || isNumber(hook)) {\n that = unwrap;\n unwrap = handlerFn;\n handlerFn = priority;\n priority = hook;\n hook = null;\n }\n\n if (isFunction(priority)) {\n that = unwrap;\n unwrap = handlerFn;\n handlerFn = priority;\n priority = DEFAULT_PRIORITY;\n }\n\n if (isObject(unwrap)) {\n that = unwrap;\n unwrap = false;\n }\n\n if (!isFunction(handlerFn)) {\n throw new Error('handlerFn must be a function');\n }\n\n if (!isArray(events)) {\n events = [ events ];\n }\n\n var eventBus = this._eventBus;\n\n forEach(events, function(event) {\n\n // concat commandStack(.event)?(.hook)?\n var fullEvent = [ 'commandStack', event, hook ].filter(function(e) { return e; }).join('.');\n\n eventBus.on(fullEvent, priority, unwrap ? unwrapEvent(handlerFn, that) : handlerFn, that);\n });\n};\n\n\nvar hooks = [\n 'canExecute',\n 'preExecute',\n 'preExecuted',\n 'execute',\n 'executed',\n 'postExecute',\n 'postExecuted',\n 'revert',\n 'reverted'\n];\n\n/*\n * Install hook shortcuts\n *\n * This will generate the CommandInterceptor#(preExecute|...|reverted) methods\n * which will in term forward to CommandInterceptor#on.\n */\nforEach(hooks, function(hook) {\n\n /**\n * {canExecute|preExecute|preExecuted|execute|executed|postExecute|postExecuted|revert|reverted}\n *\n * A named hook for plugging into the command execution\n *\n * @param {string|Array<string>} [events] list of commands to register on\n * @param {number} [priority] the priority on which to hook into the execution\n * @param {Function} handlerFn interceptor to be invoked with (event)\n * @param {boolean} [unwrap=false] if true, unwrap the event and pass (context, command, event) to the\n * listener instead\n * @param {Object} [that] Pass context (`this`) to the handler function\n */\n CommandInterceptor.prototype[hook] = function(events, priority, handlerFn, unwrap, that) {\n\n if (isFunction(events) || isNumber(events)) {\n that = unwrap;\n unwrap = handlerFn;\n handlerFn = priority;\n priority = events;\n events = null;\n }\n\n this.on(events, hook, priority, handlerFn, unwrap, that);\n };\n});\n","import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';\r\n\r\nexport default class IdBehavior extends CommandInterceptor {\r\n constructor(eventBus, modeling) {\r\n super(eventBus);\r\n\r\n // @ts-ignore-next-line\r\n this.preExecute('formField.remove', function(context) {\r\n const { formField } = context;\r\n\r\n const { id } = formField;\r\n\r\n modeling.unclaimId(formField, id);\r\n }, true);\r\n\r\n // @ts-ignore-next-line\r\n this.preExecute('formField.edit', function(context) {\r\n const {\r\n formField,\r\n properties\r\n } = context;\r\n\r\n if ('id' in properties) {\r\n modeling.unclaimId(formField, formField.id);\r\n\r\n modeling.claimId(formField, properties.id);\r\n }\r\n }, true);\r\n }\r\n}\r\n\r\nIdBehavior.$inject = [ 'eventBus', 'modeling' ];","import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';\r\n\r\nexport default class KeyBehavior extends CommandInterceptor {\r\n constructor(eventBus, modeling) {\r\n super(eventBus);\r\n\r\n // @ts-ignore-next-line\r\n this.preExecute('formField.remove', function(context) {\r\n const { formField } = context;\r\n\r\n const { key } = formField;\r\n\r\n if (key) {\r\n modeling.unclaimKey(formField, key);\r\n }\r\n }, true);\r\n\r\n // @ts-ignore-next-line\r\n this.preExecute('formField.edit', function(context) {\r\n const {\r\n formField,\r\n properties\r\n } = context;\r\n\r\n if ('key' in properties) {\r\n modeling.unclaimKey(formField, formField.key);\r\n\r\n modeling.claimKey(formField, properties.key);\r\n }\r\n }, true);\r\n }\r\n}\r\n\r\nKeyBehavior.$inject = [ 'eventBus', 'modeling' ];","import IdBehavior from './IdBehavior';\r\nimport KeyBehavior from './KeyBehavior';\r\n\r\nexport default {\r\n __init__: [\r\n 'idBehavior',\r\n 'keyBehavior'\r\n ],\r\n idBehavior: [ 'type', IdBehavior ],\r\n keyBehavior: [ 'type', KeyBehavior ]\r\n};\r\n","import {\n uniqueBy,\n isArray\n} from 'min-dash';\n\n\n/**\n * A service that offers un- and redoable execution of commands.\n *\n * The command stack is responsible for executing modeling actions\n * in a un- and redoable manner. To do this it delegates the actual\n * command execution to {@link CommandHandler}s.\n *\n * Command handlers provide {@link CommandHandler#execute(ctx)} and\n * {@link CommandHandler#revert(ctx)} methods to un- and redo a command\n * identified by a command context.\n *\n *\n * ## Life-Cycle events\n *\n * In the process the command stack fires a number of life-cycle events\n * that other components to participate in the command execution.\n *\n * * preExecute\n * * preExecuted\n * * execute\n * * executed\n * * postExecute\n * * postExecuted\n * * revert\n * * reverted\n *\n * A special event is used for validating, whether a command can be\n * performed prior to its execution.\n *\n * * canExecute\n *\n * Each of the events is fired as `commandStack.{eventName}` and\n * `commandStack.{commandName}.{eventName}`, respectively. This gives\n * components fine grained control on where to hook into.\n *\n * The event object fired transports `command`, the name of the\n * command and `context`, the command context.\n *\n *\n * ## Creating Command Handlers\n *\n * Command handlers should provide the {@link CommandHandler#execute(ctx)}\n * and {@link CommandHandler#revert(ctx)} methods to implement\n * redoing and undoing of a command.\n *\n * A command handler _must_ ensure undo is performed properly in order\n * not to break the undo chain. It must also return the shapes that\n * got changed during the `execute` and `revert` operations.\n *\n * Command handlers may execute other modeling operations (and thus\n * commands) in their `preExecute` and `postExecute` phases. The command\n * stack will properly group all commands together into a logical unit\n * that may be re- and undone atomically.\n *\n * Command handlers must not execute other commands from within their\n * core implementation (`execute`, `revert`).\n *\n *\n * ## Change Tracking\n *\n * During the execution of the CommandStack it will keep track of all\n * elements that have been touched during the command's execution.\n *\n * At the end of the CommandStack execution it will notify interested\n * components via an 'elements.changed' event with all the dirty\n * elements.\n *\n * The event can be picked up by components that are interested in the fact\n * that elements have been changed. One use case for this is updating\n * their graphical representation after moving / resizing or deletion.\n *\n * @see CommandHandler\n *\n * @param {EventBus} eventBus\n * @param {Injector} injector\n */\nexport default function CommandStack(eventBus, injector) {\n\n /**\n * A map of all registered command handlers.\n *\n * @type {Object}\n */\n this._handlerMap = {};\n\n /**\n * A stack containing all re/undoable actions on the diagram\n *\n * @type {Array<Object>}\n */\n this._stack = [];\n\n /**\n * The current index on the stack\n *\n * @type {number}\n */\n this._stackIdx = -1;\n\n /**\n * Current active commandStack execution\n *\n * @type {Object}\n * @property {Object[]} actions\n * @property {Object[]} dirty\n * @property { 'undo' | 'redo' | 'clear' | 'execute' | null } trigger the cause of the current excecution\n */\n this._currentExecution = {\n actions: [],\n dirty: [],\n trigger: null\n };\n\n\n this._injector = injector;\n this._eventBus = eventBus;\n\n this._uid = 1;\n\n eventBus.on([\n 'diagram.destroy',\n 'diagram.clear'\n ], function() {\n this.clear(false);\n }, this);\n}\n\nCommandStack.$inject = [ 'eventBus', 'injector' ];\n\n\n/**\n * Execute a command\n *\n * @param {string} command the command to execute\n * @param {Object} context the environment to execute the command in\n */\nCommandStack.prototype.execute = function(command, context) {\n if (!command) {\n throw new Error('command required');\n }\n\n this._currentExecution.trigger = 'execute';\n\n const action = { command: command, context: context };\n\n this._pushAction(action);\n this._internalExecute(action);\n this._popAction(action);\n};\n\n\n/**\n * Ask whether a given command can be executed.\n *\n * Implementors may hook into the mechanism on two ways:\n *\n * * in event listeners:\n *\n * Users may prevent the execution via an event listener.\n * It must prevent the default action for `commandStack.(<command>.)canExecute` events.\n *\n * * in command handlers:\n *\n * If the method {@link CommandHandler#canExecute} is implemented in a handler\n * it will be called to figure out whether the execution is allowed.\n *\n * @param {string} command the command to execute\n * @param {Object} context the environment to execute the command in\n *\n * @return {boolean} true if the command can be executed\n */\nCommandStack.prototype.canExecute = function(command, context) {\n\n const action = { command: command, context: context };\n\n const handler = this._getHandler(command);\n\n let result = this._fire(command, 'canExecute', action);\n\n // handler#canExecute will only be called if no listener\n // decided on a result already\n if (result === undefined) {\n if (!handler) {\n return false;\n }\n\n if (handler.canExecute) {\n result = handler.canExecute(context);\n }\n }\n\n return result;\n};\n\n\n/**\n * Clear the command stack, erasing all undo / redo history\n */\nCommandStack.prototype.clear = function(emit) {\n this._stack.length = 0;\n this._stackIdx = -1;\n\n if (emit !== false) {\n this._fire('changed', { trigger: 'clear' });\n }\n};\n\n\n/**\n * Undo last command(s)\n */\nCommandStack.prototype.undo = function() {\n let action = this._getUndoAction(),\n next;\n\n if (action) {\n this._currentExecution.trigger = 'undo';\n\n this._pushAction(action);\n\n while (action) {\n this._internalUndo(action);\n next = this._getUndoAction();\n\n if (!next || next.id !== action.id) {\n break;\n }\n\n action = next;\n }\n\n this._popAction();\n }\n};\n\n\n/**\n * Redo last command(s)\n */\nCommandStack.prototype.redo = function() {\n let action = this._getRedoAction(),\n next;\n\n if (action) {\n this._currentExecution.trigger = 'redo';\n\n this._pushAction(action);\n\n while (action) {\n this._internalExecute(action, true);\n next = this._getRedoAction();\n\n if (!next || next.id !== action.id) {\n break;\n }\n\n action = next;\n }\n\n this._popAction();\n }\n};\n\n\n/**\n * Register a handler instance with the command stack\n *\n * @param {string} command\n * @param {CommandHandler} handler\n */\nCommandStack.prototype.register = function(command, handler) {\n this._setHandler(command, handler);\n};\n\n\n/**\n * Register a handler type with the command stack\n * by instantiating it and injecting its dependencies.\n *\n * @param {string} command\n * @param {Function} a constructor for a {@link CommandHandler}\n */\nCommandStack.prototype.registerHandler = function(command, handlerCls) {\n\n if (!command || !handlerCls) {\n throw new Error('command and handlerCls must be defined');\n }\n\n const handler = this._injector.instantiate(handlerCls);\n this.register(command, handler);\n};\n\nCommandStack.prototype.canUndo = function() {\n return !!this._getUndoAction();\n};\n\nCommandStack.prototype.canRedo = function() {\n return !!this._getRedoAction();\n};\n\n// stack access //////////////////////\n\nCommandStack.prototype._getRedoAction = function() {\n return this._stack[this._stackIdx + 1];\n};\n\n\nCommandStack.prototype._getUndoAction = function() {\n return this._stack[this._stackIdx];\n};\n\n\n// internal functionality //////////////////////\n\nCommandStack.prototype._internalUndo = function(action) {\n const command = action.command,\n context = action.context;\n\n const handler = this._getHandler(command);\n\n // guard against illegal nested command stack invocations\n this._atomicDo(() => {\n this._fire(command, 'revert', action);\n\n if (handler.revert) {\n this._markDirty(handler.revert(context));\n }\n\n this._revertedAction(action);\n\n this._fire(command, 'reverted', action);\n });\n};\n\n\nCommandStack.prototype._fire = function(command, qualifier, event) {\n if (arguments.length < 3) {\n event = qualifier;\n qualifier = null;\n }\n\n const names = qualifier ? [ command + '.' + qualifier, qualifier ] : [ command ];\n let result;\n\n event = this._eventBus.createEvent(event);\n\n for (const name of names) {\n result = this._eventBus.fire('commandStack.' + name, event);\n\n if (event.cancelBubble) {\n break;\n }\n }\n\n return result;\n};\n\nCommandStack.prototype._createId = function() {\n return this._uid++;\n};\n\nCommandStack.prototype._atomicDo = function(fn) {\n\n const execution = this._currentExecution;\n\n execution.atomic = true;\n\n try {\n fn();\n } finally {\n execution.atomic = false;\n }\n};\n\nCommandStack.prototype._internalExecute = function(action, redo) {\n const command = action.command,\n context = action.context;\n\n const handler = this._getHandler(command);\n\n if (!handler) {\n throw new Error('no command handler registered for <' + command + '>');\n }\n\n this._pushAction(action);\n\n if (!redo) {\n this._fire(command, 'preExecute', action);\n\n if (handler.preExecute) {\n handler.preExecute(context);\n }\n\n this._fire(command, 'preExecuted', action);\n }\n\n // guard against illegal nested command stack invocations\n this._atomicDo(() => {\n\n this._fire(command, 'execute', action);\n\n if (handler.execute) {\n\n // actual execute + mark return results as dirty\n this._markDirty(handler.execute(context));\n }\n\n // log to stack\n this._executedAction(action, redo);\n\n this._fire(command, 'executed', action);\n });\n\n if (!redo) {\n this._fire(command, 'postExecute', action);\n\n if (handler.postExecute) {\n handler.postExecute(context);\n }\n\n this._fire(command, 'postExecuted', action);\n }\n\n this._popAction(action);\n};\n\n\nCommandStack.prototype._pushAction = function(action) {\n\n const execution = this._currentExecution,\n actions = execution.actions;\n\n const baseAction = actions[0];\n\n if (execution.atomic) {\n throw new Error('illegal invocation in <execute> or <revert> phase (action: ' + action.command + ')');\n }\n\n if (!action.id) {\n action.id = (baseAction && baseAction.id) || this._createId();\n }\n\n actions.push(action);\n};\n\n\nCommandStack.prototype._popAction = function() {\n const execution = this._currentExecution,\n trigger = execution.trigger,\n actions = execution.actions,\n dirty = execution.dirty;\n\n actions.pop();\n\n if (!actions.length) {\n this._eventBus.fire('elements.changed', { elements: uniqueBy('id', dirty.reverse()) });\n\n dirty.length = 0;\n\n this._fire('changed', { trigger: trigger });\n\n execution.trigger = null;\n }\n};\n\n\nCommandStack.prototype._markDirty = function(elements) {\n const execution = this._currentExecution;\n\n if (!elements) {\n return;\n }\n\n elements = isArray(elements) ? elements : [ elements ];\n\n execution.dirty = execution.dirty.concat(elements);\n};\n\n\nCommandStack.prototype._executedAction = function(action, redo) {\n const stackIdx = ++this._stackIdx;\n\n if (!redo) {\n this._stack.splice(stackIdx, this._stack.length, action);\n }\n};\n\n\nCommandStack.prototype._revertedAction = function(action) {\n this._stackIdx--;\n};\n\n\nCommandStack.prototype._getHandler = function(command) {\n return this._handlerMap[command];\n};\n\nCommandStack.prototype._setHandler = function(command, handler) {\n if (!command || !handler) {\n throw new Error('command and handler required');\n }\n\n if (this._handlerMap[command]) {\n throw new Error('overriding handler for command <' + command + '>');\n }\n\n this._handlerMap[command] = handler;\n};\n","import CommandStack from './CommandStack';\n\nexport default {\n commandStack: [ 'type', CommandStack ]\n};\n","import Modeling from './Modeling';\r\n\r\nimport behaviorModule from './behavior';\r\nimport commandModule from 'diagram-js/lib/command';\r\n\r\nexport default {\r\n __depends__: [\r\n behaviorModule,\r\n commandModule\r\n ],\r\n __init__: [ 'modeling' ],\r\n modeling: [ 'type', Modeling ]\r\n};\r\n","export default class Selection {\r\n constructor(eventBus) {\r\n this._eventBus = eventBus;\r\n this._selection = null;\r\n }\r\n\r\n get() {\r\n return this._selection;\r\n }\r\n\r\n set(selection) {\r\n if (this._selection === selection) {\r\n return;\r\n }\r\n\r\n this._selection = selection;\r\n\r\n this._eventBus.fire('selection.changed', {\r\n selection: this._selection\r\n });\r\n }\r\n\r\n toggle(selection) {\r\n const newSelection = this._selection === selection ? null : selection;\r\n\r\n this.set(newSelection);\r\n }\r\n\r\n clear() {\r\n this.set(null);\r\n }\r\n\r\n isSelected(formField) {\r\n return this._selection === formField;\r\n }\r\n}\r\n\r\nSelection.$inject = [ 'eventBus' ];","export default class SelectionBehavior {\r\n constructor(eventBus, selection) {\r\n eventBus.on([\r\n 'commandStack.formField.add.postExecuted',\r\n 'commandStack.formField.move.postExecuted'\r\n ], ({ context }) => {\r\n const { formField } = context;\r\n\r\n selection.set(formField);\r\n });\r\n\r\n eventBus.on('commandStack.formField.remove.postExecuted', ({ context }) => {\r\n const {\r\n sourceFormField,\r\n sourceIndex\r\n } = context;\r\n\r\n const formField = sourceFormField.components[ sourceIndex ] || sourceFormField.components[ sourceIndex - 1 ];\r\n\r\n if (formField) {\r\n selection.set(formField);\r\n } else {\r\n selection.clear();\r\n }\r\n });\r\n\r\n eventBus.on('formField.remove', ({ formField }) => {\r\n if (selection.isSelected(formField)) {\r\n selection.clear();\r\n }\r\n });\r\n }\r\n}\r\n\r\nSelectionBehavior.$inject = [ 'eventBus', 'selection' ];","import Selection from './Selection';\r\nimport SelectionBehavior from './SelectionBehavior';\r\n\r\nexport default {\r\n __init__: [ 'selection', 'selectionBehavior' ],\r\n selection: [ 'type', Selection ],\r\n selectionBehavior: [ 'type', SelectionBehavior ]\r\n};","import { iconsByType } from '../../../render/components/icons';\r\n\r\nconst types = [\r\n {\r\n label: 'Text field',\r\n type: 'textfield'\r\n },\r\n {\r\n label: 'Text area',\r\n type: 'textarea'\r\n },\r\n {\r\n label: 'Number',\r\n type: 'number'\r\n },\r\n {\r\n label: 'Datetime',\r\n type: 'datetime'\r\n },\r\n {\r\n label: 'Checkbox',\r\n type: 'checkbox'\r\n },\r\n {\r\n label: 'Checklist',\r\n type: 'checklist'\r\n },\r\n {\r\n label: 'Taglist',\r\n type: 'taglist'\r\n },\r\n {\r\n label: 'Radio',\r\n type: 'radio'\r\n },\r\n {\r\n label: 'Select',\r\n type: 'select'\r\n },\r\n {\r\n label: 'Text view',\r\n type: 'text'\r\n },\r\n {\r\n label: 'Image view',\r\n type: 'image'\r\n },\r\n {\r\n label: 'Button',\r\n type: 'button'\r\n }\r\n];\r\n\r\n\r\nexport default function Palette(props) {\r\n return <div class=\"fjs-palette\">\r\n <div class=\"fjs-palette-header\" title=\"Form elements library\">\r\n <span class=\"fjs-hide-compact\">FORM ELEMENTS </span>LIBRARY\r\n </div>\r\n <div class=\"fjs-palette-fields fjs-drag-container fjs-no-drop\">\r\n {\r\n types.map(({ label, type }) => {\r\n const Icon = iconsByType[ type ];\r\n\r\n return (\r\n <div\r\n class=\"fjs-palette-field fjs-drag-copy fjs-no-drop\"\r\n data-field-type={ type }\r\n title={ `Create a ${ label } element` }\r\n >\r\n {\r\n Icon ? <Icon class=\"fjs-palette-field-icon\" width=\"36\" height=\"36\" viewBox=\"0 0 54 54\" /> : null\r\n }\r\n <span class=\"fjs-palette-field-text\">{ label }</span>\r\n </div>\r\n );\r\n })\r\n }\r\n </div>\r\n </div>;\r\n}","import Palette from './components/Palette';\r\n\r\nimport {\r\n render\r\n} from 'preact';\r\n\r\nimport {\r\n domify,\r\n query as domQuery\r\n} from 'min-dom';\r\n\r\n\r\n/**\r\n * @typedef { { parent: Element } } PaletteConfig\r\n * @typedef { import('../../core/EventBus').default } EventBus\r\n */\r\n\r\n/**\r\n * @param {PaletteConfig} paletteConfig\r\n * @param {EventBus} eventBus\r\n */\r\nexport default class PaletteRenderer {\r\n\r\n constructor(paletteConfig, eventBus) {\r\n const {\r\n parent\r\n } = paletteConfig || {};\r\n\r\n this._eventBus = eventBus;\r\n\r\n this._container = domify('<div class=\"fjs-palette-container\"></div>');\r\n\r\n if (parent) {\r\n this.attachTo(parent);\r\n }\r\n\r\n this._eventBus.once('formEditor.rendered', 500, () => {\r\n this._render();\r\n });\r\n }\r\n\r\n\r\n /**\r\n * Attach the palette to a parent node.\r\n *\r\n * @param {HTMLElement} container\r\n */\r\n attachTo(container) {\r\n if (!container) {\r\n throw new Error('container required');\r\n }\r\n\r\n if (typeof container === 'string') {\r\n container = domQuery(container);\r\n }\r\n\r\n // (1) detach from old parent\r\n this.detach();\r\n\r\n // (2) append to parent container\r\n container.appendChild(this._container);\r\n\r\n // (3) notify interested parties\r\n this._eventBus.fire('palette.attach');\r\n }\r\n\r\n /**\r\n * Detach the palette from its parent node.\r\n */\r\n detach() {\r\n const parentNode = this._container.parentNode;\r\n\r\n if (parentNode) {\r\n parentNode.removeChild(this._container);\r\n\r\n this._eventBus.fire('palette.detach');\r\n }\r\n }\r\n\r\n _render() {\r\n render(\r\n <Palette />,\r\n this._container\r\n );\r\n\r\n this._eventBus.fire('palette.rendered');\r\n }\r\n\r\n _destroy() {\r\n if (this._container) {\r\n render(null, this._container);\r\n\r\n this._eventBus.fire('palette.destroyed');\r\n }\r\n }\r\n}\r\n\r\nPaletteRenderer.$inject = [ 'config.palette', 'eventBus' ];","import PaletteRenderer from './PaletteRenderer';\r\n\r\nexport default {\r\n palette: [ 'type', PaletteRenderer ]\r\n};\r\n","import { useContext, useRef, useEffect, useMemo, useState, useCallback } from '../preact/hooks';\nimport { isFunction, isArray, get, assign, set, sortBy, find, isNumber, debounce } from 'min-dash';\nimport classnames from 'classnames';\nimport { forwardRef } from '../preact/compat';\nimport { jsx, jsxs } from '../preact/jsx-runtime';\nimport { query } from 'min-dom';\nimport { createContext, createElement } from '../preact';\nimport FeelEditor from '@bpmn-io/feel-editor';\n\nvar ArrowIcon = function ArrowIcon(props) {\n return jsx(\"svg\", {\n ...props,\n children: jsx(\"path\", {\n fillRule: \"evenodd\",\n d: \"m11.657 8-4.95 4.95a1 1 0 0 1-1.414-1.414L8.828 8 5.293 4.464A1 1 0 1 1 6.707 3.05L11.657 8Z\"\n })\n });\n};\nArrowIcon.defaultProps = {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"16\",\n height: \"16\"\n};\nvar CreateIcon = function CreateIcon(props) {\n return jsx(\"svg\", {\n ...props,\n children: jsx(\"path\", {\n fillRule: \"evenodd\",\n d: \"M9 13V9h4a1 1 0 0 0 0-2H9V3a1 1 0 1 0-2 0v4H3a1 1 0 1 0 0 2h4v4a1 1 0 0 0 2 0Z\"\n })\n });\n};\nCreateIcon.defaultProps = {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"16\",\n height: \"16\"\n};\nvar DeleteIcon = function DeleteIcon(props) {\n return jsx(\"svg\", {\n ...props,\n children: jsx(\"path\", {\n fillRule: \"evenodd\",\n d: \"M12 6v7c0 1.1-.4 1.55-1.5 1.55h-5C4.4 14.55 4 14.1 4 13V6h8Zm-1.5 1.5h-5v4.3c0 .66.5 1.2 1.111 1.2H9.39c.611 0 1.111-.54 1.111-1.2V7.5ZM13 3h-2l-1-1H6L5 3H3v1.5h10V3Z\"\n })\n });\n};\nDeleteIcon.defaultProps = {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"16\",\n height: \"16\"\n};\nvar ExternalLinkIcon = function ExternalLinkIcon(props) {\n return jsx(\"svg\", {\n ...props,\n children: jsx(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M12.637 12.637v-4.72h1.362v4.721c0 .36-.137.676-.411.95-.275.275-.591.412-.95.412H3.362c-.38 0-.703-.132-.967-.396A1.315 1.315 0 0 1 2 12.638V3.362c0-.38.132-.703.396-.967S2.982 2 3.363 2h4.553v1.363H3.363v9.274h9.274ZM14 2H9.28l-.001 1.362h2.408L5.065 9.984l.95.95 6.622-6.622v2.409H14V2Z\",\n fill: \"#818798\"\n })\n });\n};\nExternalLinkIcon.defaultProps = {\n width: \"16\",\n height: \"16\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n};\nvar FeelRequiredIcon = function FeelRequiredIcon(props) {\n return jsxs(\"svg\", {\n ...props,\n children: [jsx(\"path\", {\n d: \"M5.8 7.06V5.95h4.307v1.11H5.8Zm0 3.071v-1.11h4.307v1.11H5.8Z\",\n fill: \"currentColor\"\n }), jsx(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M8 3.268A4.732 4.732 0 1 0 12.732 8H14a6 6 0 1 1-6-6v1.268Z\",\n fill: \"currentColor\"\n }), jsx(\"path\", {\n d: \"m11.28 6.072-.832-.56 1.016-1.224L10 3.848l.312-.912 1.392.584L11.632 2h1.032l-.072 1.52 1.392-.584.312.912-1.464.44 1.008 1.224-.832.552-.864-1.296-.864 1.304Z\",\n fill: \"currentColor\"\n })]\n });\n};\nFeelRequiredIcon.defaultProps = {\n viewBox: \"0 0 16 16\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n};\nvar FeelOptionalIcon = function FeelOptionalIcon(props) {\n return jsxs(\"svg\", {\n ...props,\n children: [jsx(\"path\", {\n d: \"M5.845 7.04V5.93h4.307v1.11H5.845Zm0 3.07V9h4.307v1.11H5.845Z\",\n fill: \"currentColor\"\n }), jsx(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M3.286 8a4.714 4.714 0 1 0 9.428 0 4.714 4.714 0 0 0-9.428 0ZM8 2a6 6 0 1 0 0 12A6 6 0 0 0 8 2Z\",\n fill: \"currentColor\"\n })]\n });\n};\nFeelOptionalIcon.defaultProps = {\n viewBox: \"0 0 16 16\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n};\n\nfunction Header(props) {\n const {\n element,\n headerProvider\n } = props;\n const {\n getElementIcon,\n getDocumentationRef,\n getElementLabel,\n getTypeLabel\n } = headerProvider;\n const label = getElementLabel(element);\n const type = getTypeLabel(element);\n const documentationRef = getDocumentationRef && getDocumentationRef(element);\n const ElementIcon = getElementIcon(element);\n return jsxs(\"div\", {\n class: \"bio-properties-panel-header\",\n children: [jsx(\"div\", {\n class: \"bio-properties-panel-header-icon\",\n children: ElementIcon && jsx(ElementIcon, {\n width: \"32\",\n height: \"32\",\n viewBox: \"0 0 32 32\"\n })\n }), jsxs(\"div\", {\n class: \"bio-properties-panel-header-labels\",\n children: [jsx(\"div\", {\n title: type,\n class: \"bio-properties-panel-header-type\",\n children: type\n }), label ? jsx(\"div\", {\n title: label,\n class: \"bio-properties-panel-header-label\",\n children: label\n }) : null]\n }), jsx(\"div\", {\n class: \"bio-properties-panel-header-actions\",\n children: documentationRef ? jsx(\"a\", {\n rel: \"noopener\",\n class: \"bio-properties-panel-header-link\",\n href: documentationRef,\n title: \"Open documentation\",\n target: \"_blank\",\n children: jsx(ExternalLinkIcon, {})\n }) : null\n })]\n });\n}\n\nconst DescriptionContext = createContext({\n description: {},\n getDescriptionForId: () => {}\n});\n\nconst ErrorsContext = createContext({\n errors: {}\n});\n\n/**\n * @typedef {Function} <propertiesPanel.showEntry> callback\n *\n * @example\n *\n * useEvent('propertiesPanel.showEntry', ({ focus = false, ...rest }) => {\n * // ...\n * });\n *\n * @param {Object} context\n * @param {boolean} [context.focus]\n *\n * @returns void\n */\nconst EventContext = createContext({\n eventBus: null\n});\n\nconst LayoutContext = createContext({\n layout: {},\n setLayout: () => {},\n getLayoutForKey: () => {},\n setLayoutForKey: () => {}\n});\n\n/**\n * Accesses the global DescriptionContext and returns a description for a given id and element.\n *\n * @example\n * ```jsx\n * function TextField(props) {\n * const description = useDescriptionContext('input1', element);\n * }\n * ```\n *\n * @param {string} id\n * @param {object} element\n *\n * @returns {string}\n */\nfunction useDescriptionContext(id, element) {\n const {\n getDescriptionForId\n } = useContext(DescriptionContext);\n return getDescriptionForId(id, element);\n}\n\nfunction useError(id) {\n const {\n errors\n } = useContext(ErrorsContext);\n return errors[id];\n}\n\n/**\n * Subscribe to an event immediately. Update subscription after inputs changed.\n *\n * @param {string} event\n * @param {Function} callback\n */\nfunction useEvent(event, callback, eventBus) {\n const eventContext = useContext(EventContext);\n if (!eventBus) {\n ({\n eventBus\n } = eventContext);\n }\n const didMount = useRef(false);\n\n // (1) subscribe immediately\n if (eventBus && !didMount.current) {\n eventBus.on(event, callback);\n }\n\n // (2) update subscription after inputs changed\n useEffect(() => {\n if (eventBus && didMount.current) {\n eventBus.on(event, callback);\n }\n didMount.current = true;\n return () => {\n if (eventBus) {\n eventBus.off(event, callback);\n }\n };\n }, [callback, event, eventBus]);\n}\n\nconst KEY_LENGTH = 6;\n\n/**\n * Create a persistent key factory for plain objects without id.\n *\n * @example\n * ```jsx\n * function List({ objects }) {\n * const getKey = useKeyFactory();\n * return (<ol>{\n * objects.map(obj => {\n * const key = getKey(obj);\n * return <li key={key}>obj.name</li>\n * })\n * }</ol>);\n * }\n * ```\n *\n * @param {any[]} dependencies\n * @returns {(element: object) => string}\n */\nfunction useKeyFactory(dependencies = []) {\n const map = useMemo(() => new Map(), dependencies);\n const getKey = el => {\n let key = map.get(el);\n if (!key) {\n key = Math.random().toString().slice(-KEY_LENGTH);\n map.set(el, key);\n }\n return key;\n };\n return getKey;\n}\n\n/**\n * Creates a state that persists in the global LayoutContext.\n *\n * @example\n * ```jsx\n * function Group(props) {\n * const [ open, setOpen ] = useLayoutState([ 'groups', 'foo', 'open' ], false);\n * }\n * ```\n *\n * @param {(string|number)[]} path\n * @param {any} [defaultValue]\n *\n * @returns {[ any, Function ]}\n */\nfunction useLayoutState(path, defaultValue) {\n const {\n getLayoutForKey,\n setLayoutForKey\n } = useContext(LayoutContext);\n const layoutForKey = getLayoutForKey(path, defaultValue);\n const [value, set] = useState(layoutForKey);\n const setState = newValue => {\n // (1) set component state\n set(newValue);\n\n // (2) set context\n setLayoutForKey(path, newValue);\n };\n return [value, setState];\n}\n\n/**\n * @pinussilvestrus: we need to introduce our own hook to persist the previous\n * state on updates.\n *\n * cf. https://reactjs.org/docs/hooks-faq.html#how-to-get-the-previous-props-or-state\n */\n\nfunction usePrevious(value) {\n const ref = useRef();\n useEffect(() => {\n ref.current = value;\n });\n return ref.current;\n}\n\n/**\n * Subscribe to `propertiesPanel.showEntry`.\n *\n * @param {string} id\n *\n * @returns {import('preact').Ref}\n */\nfunction useShowEntryEvent(id) {\n const {\n onShow\n } = useContext(LayoutContext);\n const ref = useRef();\n const focus = useRef(false);\n const onShowEntry = useCallback(event => {\n if (event.id === id) {\n onShow();\n if (!focus.current) {\n focus.current = true;\n }\n }\n }, [id]);\n useEffect(() => {\n if (focus.current && ref.current) {\n if (isFunction(ref.current.focus)) {\n ref.current.focus();\n }\n if (isFunction(ref.current.select)) {\n ref.current.select();\n }\n focus.current = false;\n }\n });\n useEvent('propertiesPanel.showEntry', onShowEntry);\n return ref;\n}\n\n/**\n * @callback setSticky\n * @param {boolean} value\n */\n\n/**\n * Use IntersectionObserver to identify when DOM element is in sticky mode.\n * If sticky is observered setSticky(true) will be called.\n * If sticky mode is left, setSticky(false) will be called.\n *\n *\n * @param {Object} ref\n * @param {string} scrollContainerSelector\n * @param {setSticky} setSticky\n */\nfunction useStickyIntersectionObserver(ref, scrollContainerSelector, setSticky) {\n useEffect(() => {\n const Observer = IntersectionObserver;\n\n // return early if IntersectionObserver is not available\n if (!Observer) {\n return;\n }\n let observer;\n if (ref.current) {\n const scrollContainer = query(scrollContainerSelector);\n observer = new Observer(entries => {\n entries.forEach(entry => {\n if (entry.intersectionRatio < 1) {\n setSticky(true);\n } else if (entry.intersectionRatio === 1) {\n setSticky(false);\n }\n });\n }, {\n root: scrollContainer,\n rootMargin: '0px 0px 999999% 0px',\n // Use bottom margin to avoid stickyness when scrolling out to bottom\n threshold: [1]\n });\n observer.observe(ref.current);\n }\n\n // Unobserve if unmounted\n return () => {\n if (ref.current && observer) {\n observer.unobserve(ref.current);\n }\n };\n }, [ref, scrollContainerSelector, setSticky]);\n}\n\n/**\n * Creates a static function reference with changing body.\n * This is necessary when external libraries require a callback function\n * that has references to state variables.\n *\n * Usage:\n * const callback = useStaticCallback((val) => {val === currentState});\n *\n * The `callback` reference is static and can be safely used in external\n * libraries or as a prop that does not cause rerendering of children.\n *\n * @param {Function} callback function with changing reference\n * @returns {Function} static function reference\n */\nfunction useStaticCallback(callback) {\n const callbackRef = useRef(callback);\n callbackRef.current = callback;\n return useCallback((...args) => callbackRef.current(...args), []);\n}\n\nfunction Group(props) {\n const {\n element,\n entries = [],\n id,\n label,\n shouldOpen = false\n } = props;\n const groupRef = useRef(null);\n const [open, setOpen] = useLayoutState(['groups', id, 'open'], shouldOpen);\n const onShow = useCallback(() => setOpen(true), [setOpen]);\n const toggleOpen = () => setOpen(!open);\n const [edited, setEdited] = useState(false);\n const [sticky, setSticky] = useState(false);\n\n // set edited state depending on all entries\n useEffect(() => {\n const hasOneEditedEntry = entries.find(entry => {\n const {\n id,\n isEdited\n } = entry;\n const entryNode = query(`[data-entry-id=\"${id}\"]`);\n if (!isFunction(isEdited) || !entryNode) {\n return false;\n }\n const inputNode = query('.bio-properties-panel-input', entryNode);\n return isEdited(inputNode);\n });\n setEdited(hasOneEditedEntry);\n }, [entries]);\n\n // set css class when group is sticky to top\n useStickyIntersectionObserver(groupRef, 'div.bio-properties-panel-scroll-container', setSticky);\n const propertiesPanelContext = {\n ...useContext(LayoutContext),\n onShow\n };\n return jsxs(\"div\", {\n class: \"bio-properties-panel-group\",\n \"data-group-id\": 'group-' + id,\n ref: groupRef,\n children: [jsxs(\"div\", {\n class: classnames('bio-properties-panel-group-header', edited ? '' : 'empty', open ? 'open' : '', sticky && open ? 'sticky' : ''),\n onClick: toggleOpen,\n children: [jsx(\"div\", {\n title: label,\n class: \"bio-properties-panel-group-header-title\",\n children: label\n }), jsxs(\"div\", {\n class: \"bio-properties-panel-group-header-buttons\",\n children: [edited && jsx(DataMarker, {}), jsx(\"button\", {\n title: \"Toggle section\",\n class: \"bio-properties-panel-group-header-button bio-properties-panel-arrow\",\n children: jsx(ArrowIcon, {\n class: open ? 'bio-properties-panel-arrow-down' : 'bio-properties-panel-arrow-right'\n })\n })]\n })]\n }), jsx(\"div\", {\n class: classnames('bio-properties-panel-group-entries', open ? 'open' : ''),\n children: jsx(LayoutContext.Provider, {\n value: propertiesPanelContext,\n children: entries.map(entry => {\n const {\n component: Component,\n id\n } = entry;\n return createElement(Component, {\n ...entry,\n element: element,\n key: id\n });\n })\n })\n })]\n });\n}\nfunction DataMarker() {\n return jsx(\"div\", {\n title: \"Section contains data\",\n class: \"bio-properties-panel-dot\"\n });\n}\n\n/**\n * @typedef { {\n * text: (element: object) => string,\n * icon?: (element: Object) => import('preact').Component\n * } } PlaceholderDefinition\n *\n * @param { PlaceholderDefinition } props\n */\nfunction Placeholder(props) {\n const {\n text,\n icon: Icon\n } = props;\n return jsx(\"div\", {\n class: \"bio-properties-panel open\",\n children: jsxs(\"section\", {\n class: \"bio-properties-panel-placeholder\",\n children: [Icon && jsx(Icon, {\n class: \"bio-properties-panel-placeholder-icon\"\n }), jsx(\"p\", {\n class: \"bio-properties-panel-placeholder-text\",\n children: text\n })]\n })\n });\n}\n\nconst DEFAULT_LAYOUT = {\n open: true\n};\nconst DEFAULT_DESCRIPTION = {};\n\n/**\n * @typedef { {\n * component: import('preact').Component,\n * id: String,\n * isEdited?: Function\n * } } EntryDefinition\n *\n * @typedef { {\n * autoFocusEntry: String,\n * autoOpen?: Boolean,\n * entries: Array<EntryDefinition>,\n * id: String,\n * label: String,\n * remove: (event: MouseEvent) => void\n * } } ListItemDefinition\n *\n * @typedef { {\n * add: (event: MouseEvent) => void,\n * component: import('preact').Component,\n * element: Object,\n * id: String,\n * items: Array<ListItemDefinition>,\n * label: String,\n * shouldSort?: Boolean,\n * shouldOpen?: Boolean\n * } } ListGroupDefinition\n *\n * @typedef { {\n * component?: import('preact').Component,\n * entries: Array<EntryDefinition>,\n * id: String,\n * label: String,\n * shouldOpen?: Boolean\n * } } GroupDefinition\n *\n * @typedef { {\n * [id: String]: GetDescriptionFunction\n * } } DescriptionConfig\n *\n * @callback { {\n * @param {string} id\n * @param {Object} element\n * @returns {string}\n * } } GetDescriptionFunction\n *\n * @typedef { {\n * getEmpty: (element: object) => import('./components/Placeholder').PlaceholderDefinition,\n * getMultiple: (element: Object) => import('./components/Placeholder').PlaceholderDefinition\n * } } PlaceholderProvider\n *\n */\n\n/**\n * A basic properties panel component. Describes *how* content will be rendered, accepts\n * data from implementor to describe *what* will be rendered.\n *\n * @param {Object} props\n * @param {Object|Array} props.element\n * @param {import('./components/Header').HeaderProvider} props.headerProvider\n * @param {PlaceholderProvider} [props.placeholderProvider]\n * @param {Array<GroupDefinition|ListGroupDefinition>} props.groups\n * @param {Object} [props.layoutConfig]\n * @param {Function} [props.layoutChanged]\n * @param {DescriptionConfig} [props.descriptionConfig]\n * @param {Function} [props.descriptionLoaded]\n * @param {Object} [props.eventBus]\n */\nfunction PropertiesPanel(props) {\n const {\n element,\n headerProvider,\n placeholderProvider,\n groups,\n layoutConfig = {},\n layoutChanged,\n descriptionConfig = {},\n descriptionLoaded,\n eventBus\n } = props;\n\n // set-up layout context\n const [layout, setLayout] = useState(createLayout(layoutConfig));\n useEffect(() => {\n if (typeof layoutChanged === 'function') {\n layoutChanged(layout);\n }\n }, [layout, layoutChanged]);\n const getLayoutForKey = (key, defaultValue) => {\n return get(layout, key, defaultValue);\n };\n const setLayoutForKey = (key, config) => {\n const newLayout = assign({}, layout);\n set(newLayout, key, config);\n setLayout(newLayout);\n };\n const layoutContext = {\n layout,\n setLayout,\n getLayoutForKey,\n setLayoutForKey\n };\n\n // set-up description context\n const description = createDescriptionContext(descriptionConfig);\n if (typeof descriptionLoaded === 'function') {\n descriptionLoaded(description);\n }\n const getDescriptionForId = (id, element) => {\n return description[id] && description[id](element);\n };\n const descriptionContext = {\n description,\n getDescriptionForId\n };\n const [errors, setErrors] = useState({});\n const onSetErrors = ({\n errors\n }) => setErrors(errors);\n useEvent('propertiesPanel.setErrors', onSetErrors, eventBus);\n const errorsContext = {\n errors\n };\n const eventContext = {\n eventBus\n };\n const propertiesPanelContext = {\n element\n };\n\n // empty state\n if (placeholderProvider && !element) {\n return jsx(Placeholder, {\n ...placeholderProvider.getEmpty()\n });\n }\n\n // multiple state\n if (placeholderProvider && isArray(element)) {\n return jsx(Placeholder, {\n ...placeholderProvider.getMultiple()\n });\n }\n return jsx(LayoutContext.Provider, {\n value: propertiesPanelContext,\n children: jsx(ErrorsContext.Provider, {\n value: errorsContext,\n children: jsx(DescriptionContext.Provider, {\n value: descriptionContext,\n children: jsx(LayoutContext.Provider, {\n value: layoutContext,\n children: jsx(EventContext.Provider, {\n value: eventContext,\n children: jsxs(\"div\", {\n class: classnames('bio-properties-panel', layout.open ? 'open' : ''),\n children: [jsx(Header, {\n element: element,\n headerProvider: headerProvider\n }), jsx(\"div\", {\n class: \"bio-properties-panel-scroll-container\",\n children: groups.map(group => {\n const {\n component: Component = Group,\n id\n } = group;\n return createElement(Component, {\n ...group,\n key: id,\n element: element\n });\n })\n })]\n })\n })\n })\n })\n })\n });\n}\n\n// helpers //////////////////\n\nfunction createLayout(overrides) {\n return {\n ...DEFAULT_LAYOUT,\n ...overrides\n };\n}\nfunction createDescriptionContext(overrides) {\n return {\n ...DEFAULT_DESCRIPTION,\n ...overrides\n };\n}\n\nfunction DropdownButton(props) {\n const {\n class: className,\n children,\n menuItems = []\n } = props;\n const dropdownRef = useRef(null);\n const menuRef = useRef(null);\n const [open, setOpen] = useState(false);\n const close = () => setOpen(false);\n function onDropdownToggle(event) {\n if (menuRef.current && menuRef.current.contains(event.target)) {\n return;\n }\n event.stopPropagation();\n setOpen(open => !open);\n }\n function onActionClick(event, action) {\n event.stopPropagation();\n close();\n action();\n }\n useGlobalClick([dropdownRef.current], () => close());\n return jsxs(\"div\", {\n class: classnames('bio-properties-panel-dropdown-button', {\n open\n }, className),\n onClick: onDropdownToggle,\n ref: dropdownRef,\n children: [children, jsx(\"div\", {\n class: \"bio-properties-panel-dropdown-button__menu\",\n ref: menuRef,\n children: menuItems.map((item, index) => jsx(MenuItem, {\n onClick: onActionClick,\n item: item\n }, index))\n })]\n });\n}\nfunction MenuItem({\n item,\n onClick\n}) {\n if (item.separator) {\n return jsx(\"div\", {\n class: \"bio-properties-panel-dropdown-button__menu-item bio-properties-panel-dropdown-button__menu-item--separator\"\n });\n }\n if (item.action) {\n return jsx(\"button\", {\n class: \"bio-properties-panel-dropdown-button__menu-item bio-properties-panel-dropdown-button__menu-item--actionable\",\n onClick: event => onClick(event, item.action),\n children: item.entry\n });\n }\n return jsx(\"div\", {\n class: \"bio-properties-panel-dropdown-button__menu-item\",\n children: item.entry\n });\n}\n\n/**\n *\n * @param {Array<null | Element>} ignoredElements\n * @param {Function} callback\n */\nfunction useGlobalClick(ignoredElements, callback) {\n useEffect(() => {\n /**\n * @param {MouseEvent} event\n */\n function listener(event) {\n if (ignoredElements.some(element => element && element.contains(event.target))) {\n return;\n }\n callback();\n }\n document.addEventListener('click', listener, {\n capture: true\n });\n return () => document.removeEventListener('click', listener, {\n capture: true\n });\n }, [...ignoredElements, callback]);\n}\n\nfunction HeaderButton(props) {\n const {\n children = null,\n class: classname,\n onClick = () => {},\n ...otherProps\n } = props;\n return jsx(\"button\", {\n ...otherProps,\n onClick: onClick,\n class: classnames('bio-properties-panel-group-header-button', classname),\n children: children\n });\n}\n\nfunction CollapsibleEntry(props) {\n const {\n element,\n entries = [],\n id,\n label,\n open: shouldOpen,\n remove\n } = props;\n const [open, setOpen] = useState(shouldOpen);\n const toggleOpen = () => setOpen(!open);\n const {\n onShow\n } = useContext(LayoutContext);\n const propertiesPanelContext = {\n ...useContext(LayoutContext),\n onShow: useCallback(() => {\n setOpen(true);\n if (isFunction(onShow)) {\n onShow();\n }\n }, [onShow, setOpen])\n };\n\n // todo(pinussilvestrus): translate once we have a translate mechanism for the core\n const placeholderLabel = '<empty>';\n return jsxs(\"div\", {\n \"data-entry-id\": id,\n class: classnames('bio-properties-panel-collapsible-entry', open ? 'open' : ''),\n children: [jsxs(\"div\", {\n class: \"bio-properties-panel-collapsible-entry-header\",\n onClick: toggleOpen,\n children: [jsx(\"div\", {\n title: label || placeholderLabel,\n class: classnames('bio-properties-panel-collapsible-entry-header-title', !label && 'empty'),\n children: label || placeholderLabel\n }), jsx(\"button\", {\n title: \"Toggle list item\",\n class: \"bio-properties-panel-arrow bio-properties-panel-collapsible-entry-arrow\",\n children: jsx(ArrowIcon, {\n class: open ? 'bio-properties-panel-arrow-down' : 'bio-properties-panel-arrow-right'\n })\n }), remove ? jsx(\"button\", {\n title: \"Delete item\",\n class: \"bio-properties-panel-remove-entry\",\n onClick: remove,\n children: jsx(DeleteIcon, {})\n }) : null]\n }), jsx(\"div\", {\n class: classnames('bio-properties-panel-collapsible-entry-entries', open ? 'open' : ''),\n children: jsx(LayoutContext.Provider, {\n value: propertiesPanelContext,\n children: entries.map(entry => {\n const {\n component: Component,\n id\n } = entry;\n return createElement(Component, {\n ...entry,\n element: element,\n key: id\n });\n })\n })\n })]\n });\n}\n\nfunction ListItem(props) {\n const {\n autoFocusEntry,\n autoOpen\n } = props;\n\n // focus specified entry on auto open\n useEffect(() => {\n if (autoOpen && autoFocusEntry) {\n const entry = query(`[data-entry-id=\"${autoFocusEntry}\"]`);\n const focusableInput = query('.bio-properties-panel-input', entry);\n if (focusableInput) {\n if (isFunction(focusableInput.select)) {\n focusableInput.select();\n } else if (isFunction(focusableInput.focus)) {\n focusableInput.focus();\n }\n }\n }\n }, [autoOpen, autoFocusEntry]);\n return jsx(\"div\", {\n class: \"bio-properties-panel-list-item\",\n children: jsx(CollapsibleEntry, {\n ...props,\n open: autoOpen\n })\n });\n}\n\nconst noop$2 = () => {};\n\n/**\n * @param {import('../PropertiesPanel').ListGroupDefinition} props\n */\nfunction ListGroup(props) {\n const {\n add,\n element,\n id,\n items,\n label,\n shouldOpen = true,\n shouldSort = true\n } = props;\n const groupRef = useRef(null);\n const [open, setOpen] = useLayoutState(['groups', id, 'open'], false);\n const [sticky, setSticky] = useState(false);\n const onShow = useCallback(() => setOpen(true), [setOpen]);\n const [ordering, setOrdering] = useState([]);\n const [newItemAdded, setNewItemAdded] = useState(false);\n const prevItems = usePrevious(items);\n const prevElement = usePrevious(element);\n const elementChanged = element !== prevElement;\n const shouldHandleEffects = !elementChanged && (shouldSort || shouldOpen);\n\n // reset initial ordering when element changes (before first render)\n if (elementChanged) {\n setOrdering(createOrdering(shouldSort ? sortItems(items) : items));\n }\n\n // keep ordering in sync to items - and open changes\n\n // (0) set initial ordering from given items\n useEffect(() => {\n if (!prevItems || !shouldSort) {\n setOrdering(createOrdering(items));\n }\n }, [items, element]);\n\n // (1) items were added\n useEffect(() => {\n if (shouldHandleEffects && prevItems && items.length > prevItems.length) {\n let add = [];\n items.forEach(item => {\n if (!ordering.includes(item.id)) {\n add.push(item.id);\n }\n });\n let newOrdering = ordering;\n\n // open if not open and configured\n if (!open && shouldOpen) {\n toggleOpen();\n\n // if I opened and I should sort, then sort items\n if (shouldSort) {\n newOrdering = createOrdering(sortItems(items));\n }\n }\n\n // add new items on top or bottom depending on sorting behavior\n newOrdering = newOrdering.filter(item => !add.includes(item));\n if (shouldSort) {\n newOrdering.unshift(...add);\n } else {\n newOrdering.push(...add);\n }\n setOrdering(newOrdering);\n setNewItemAdded(true);\n } else {\n setNewItemAdded(false);\n }\n }, [items, open, shouldHandleEffects]);\n\n // (2) sort items on open if shouldSort is set\n useEffect(() => {\n if (shouldSort && open && !newItemAdded) {\n setOrdering(createOrdering(sortItems(items)));\n }\n }, [open, shouldSort]);\n\n // (3) items were deleted\n useEffect(() => {\n if (shouldHandleEffects && prevItems && items.length < prevItems.length) {\n let keep = [];\n ordering.forEach(o => {\n if (getItem(items, o)) {\n keep.push(o);\n }\n });\n setOrdering(keep);\n }\n }, [items, shouldHandleEffects]);\n\n // set css class when group is sticky to top\n useStickyIntersectionObserver(groupRef, 'div.bio-properties-panel-scroll-container', setSticky);\n const toggleOpen = () => setOpen(!open);\n const hasItems = !!items.length;\n const propertiesPanelContext = {\n ...useContext(LayoutContext),\n onShow\n };\n return jsxs(\"div\", {\n class: \"bio-properties-panel-group\",\n \"data-group-id\": 'group-' + id,\n ref: groupRef,\n children: [jsxs(\"div\", {\n class: classnames('bio-properties-panel-group-header', hasItems ? '' : 'empty', hasItems && open ? 'open' : '', sticky && open ? 'sticky' : ''),\n onClick: hasItems ? toggleOpen : noop$2,\n children: [jsx(\"div\", {\n title: label,\n class: \"bio-properties-panel-group-header-title\",\n children: label\n }), jsxs(\"div\", {\n class: \"bio-properties-panel-group-header-buttons\",\n children: [add ? jsxs(\"button\", {\n title: \"Create new list item\",\n class: \"bio-properties-panel-group-header-button bio-properties-panel-add-entry\",\n onClick: add,\n children: [jsx(CreateIcon, {}), !hasItems ? jsx(\"span\", {\n class: \"bio-properties-panel-add-entry-label\",\n children: \"Create\"\n }) : null]\n }) : null, hasItems ? jsx(\"div\", {\n title: `List contains ${items.length} item${items.length != 1 ? 's' : ''}`,\n class: \"bio-properties-panel-list-badge\",\n children: items.length\n }) : null, hasItems ? jsx(\"button\", {\n title: \"Toggle section\",\n class: \"bio-properties-panel-group-header-button bio-properties-panel-arrow\",\n children: jsx(ArrowIcon, {\n class: open ? 'bio-properties-panel-arrow-down' : 'bio-properties-panel-arrow-right'\n })\n }) : null]\n })]\n }), jsx(\"div\", {\n class: classnames('bio-properties-panel-list', open && hasItems ? 'open' : ''),\n children: jsx(LayoutContext.Provider, {\n value: propertiesPanelContext,\n children: ordering.map((o, index) => {\n const item = getItem(items, o);\n if (!item) {\n return;\n }\n const {\n id\n } = item;\n\n // if item was added, open first or last item based on ordering\n const autoOpen = newItemAdded && (shouldSort ? index === 0 : index === ordering.length - 1);\n return createElement(ListItem, {\n ...item,\n autoOpen: autoOpen,\n element: element,\n index: index,\n key: id\n });\n })\n })\n })]\n });\n}\n\n// helpers ////////////////////\n\n/**\n * Sorts given items alphanumeric by label\n */\nfunction sortItems(items) {\n return sortBy(items, i => i.label.toLowerCase());\n}\nfunction getItem(items, id) {\n return find(items, i => i.id === id);\n}\nfunction createOrdering(items) {\n return items.map(i => i.id);\n}\n\nfunction Description(props) {\n const {\n element,\n forId,\n value\n } = props;\n const contextDescription = useDescriptionContext(forId, element);\n const description = value || contextDescription;\n if (description) {\n return jsx(\"div\", {\n class: \"bio-properties-panel-description\",\n children: description\n });\n }\n}\n\nfunction Checkbox(props) {\n const {\n id,\n label,\n onChange,\n disabled,\n value = false,\n onFocus,\n onBlur\n } = props;\n const [localValue, setLocalValue] = useState(value);\n const handleChangeCallback = ({\n target\n }) => {\n onChange(target.checked);\n };\n const handleChange = e => {\n handleChangeCallback(e);\n setLocalValue(e.target.value);\n };\n useEffect(() => {\n if (value === localValue) {\n return;\n }\n setLocalValue(value);\n }, [value]);\n const ref = useShowEntryEvent(id);\n return jsxs(\"div\", {\n class: \"bio-properties-panel-checkbox\",\n children: [jsx(\"input\", {\n ref: ref,\n id: prefixId$7(id),\n name: id,\n onFocus: onFocus,\n onBlur: onBlur,\n type: \"checkbox\",\n class: \"bio-properties-panel-input\",\n onChange: handleChange,\n checked: localValue,\n disabled: disabled\n }), jsx(\"label\", {\n for: prefixId$7(id),\n class: \"bio-properties-panel-label\",\n children: label\n })]\n });\n}\n\n/**\n * @param {Object} props\n * @param {Object} props.element\n * @param {String} props.id\n * @param {String} props.description\n * @param {String} props.label\n * @param {Function} props.getValue\n * @param {Function} props.setValue\n * @param {Function} props.onFocus\n * @param {Function} props.onBlur\n * @param {boolean} [props.disabled]\n */\nfunction CheckboxEntry(props) {\n const {\n element,\n id,\n description,\n label,\n getValue,\n setValue,\n disabled,\n onFocus,\n onBlur\n } = props;\n const value = getValue(element);\n const error = useError(id);\n return jsxs(\"div\", {\n class: \"bio-properties-panel-entry bio-properties-panel-checkbox-entry\",\n \"data-entry-id\": id,\n children: [jsx(Checkbox, {\n disabled: disabled,\n id: id,\n label: label,\n onChange: setValue,\n onFocus: onFocus,\n onBlur: onBlur,\n value: value\n }, element), error && jsx(\"div\", {\n class: \"bio-properties-panel-error\",\n children: error\n }), jsx(Description, {\n forId: id,\n element: element,\n value: description\n })]\n });\n}\nfunction isEdited$7(node) {\n return node && !!node.checked;\n}\n\n// helpers /////////////////\n\nfunction prefixId$7(id) {\n return `bio-properties-panel-${id}`;\n}\n\nconst useBufferedFocus = function (editor, ref) {\n const [buffer, setBuffer] = useState(undefined);\n ref.current = useMemo(() => ({\n focus: offset => {\n if (editor) {\n editor.focus(offset);\n } else {\n if (typeof offset === 'undefined') {\n offset = Infinity;\n }\n setBuffer(offset);\n }\n }\n }), [editor]);\n useEffect(() => {\n if (typeof buffer !== 'undefined' && editor) {\n editor.focus(buffer);\n setBuffer(false);\n }\n }, [editor, buffer]);\n};\nconst CodeEditor = forwardRef((props, ref) => {\n const {\n value,\n onInput,\n onFeelToggle,\n onLint = () => {},\n disabled,\n tooltipContainer,\n variables\n } = props;\n const inputRef = useRef();\n const [editor, setEditor] = useState();\n const [localValue, setLocalValue] = useState(value || '');\n useBufferedFocus(editor, ref);\n const handleInput = useStaticCallback(newValue => {\n onInput(newValue);\n setLocalValue(newValue);\n });\n useEffect(() => {\n let editor;\n\n /* Trigger FEEL toggle when\n *\n * - `backspace` is pressed\n * - AND the cursor is at the beginning of the input\n */\n const onKeyDown = e => {\n if (e.key !== 'Backspace' || !editor) {\n return;\n }\n const selection = editor.getSelection();\n const range = selection.ranges[selection.mainIndex];\n if (range.from === 0 && range.to === 0) {\n onFeelToggle();\n }\n };\n editor = new FeelEditor({\n container: inputRef.current,\n onChange: handleInput,\n onKeyDown: onKeyDown,\n onLint: onLint,\n tooltipContainer: tooltipContainer,\n value: localValue,\n variables: variables\n });\n setEditor(editor);\n return () => {\n onLint([]);\n inputRef.current.innerHTML = '';\n setEditor(null);\n };\n }, []);\n useEffect(() => {\n if (!editor) {\n return;\n }\n if (value === localValue) {\n return;\n }\n editor.setValue(value);\n setLocalValue(value);\n }, [value]);\n useEffect(() => {\n if (!editor) {\n return;\n }\n editor.setVariables(variables);\n }, [variables]);\n const handleClick = () => {\n ref.current.focus();\n };\n return jsx(\"div\", {\n class: classnames('bio-properties-panel-feel-editor-container', disabled ? 'disabled' : null),\n children: jsx(\"div\", {\n name: props.name,\n class: classnames('bio-properties-panel-input', localValue ? 'edited' : null),\n ref: inputRef,\n onClick: handleClick\n })\n });\n});\n\nfunction FeelIndicator(props) {\n const {\n active\n } = props;\n if (!active) {\n return null;\n }\n return jsx(\"span\", {\n class: \"bio-properties-panel-feel-indicator\",\n children: \"=\"\n });\n}\n\nconst noop$1 = () => {};\n\n/**\n * @param {Object} props\n * @param {Object} props.label\n * @param {String} props.feel\n */\nfunction FeelIcon(props) {\n const {\n label,\n feel = false,\n active,\n disabled = false,\n onClick = noop$1\n } = props;\n const feelRequiredLabel = ' must be a FEEL expression';\n const feelOptionalLabel = ' can optionally be a FEEL expression';\n const handleClick = e => {\n onClick(e);\n\n // when pointer event was created from keyboard, keep focus on button\n if (!e.pointerType) {\n e.stopPropagation();\n }\n };\n return jsx(\"button\", {\n class: classnames('bio-properties-panel-feel-icon', active ? 'active' : null, feel === 'required' ? 'required' : 'optional'),\n onClick: handleClick,\n disabled: feel === 'required' || disabled,\n title: label + (feel === 'required' ? feelRequiredLabel : feelOptionalLabel),\n children: feel === 'required' ? jsx(FeelRequiredIcon, {}) : jsx(FeelOptionalIcon, {})\n });\n}\n\nconst noop = () => {};\nfunction FeelTextfield(props) {\n const {\n debounce,\n id,\n label,\n onInput,\n onError,\n feel,\n value = '',\n disabled = false,\n variables,\n tooltipContainer,\n OptionalComponent = OptionalFeelInput\n } = props;\n const [localValue, _setLocalValue] = useState(value);\n const editorRef = useShowEntryEvent(id);\n const containerRef = useRef();\n const feelActive = localValue.startsWith('=') || feel === 'required';\n const feelOnlyValue = localValue.startsWith('=') ? localValue.substring(1) : localValue;\n const [focus, _setFocus] = useState(undefined);\n const setFocus = (offset = 0) => {\n const hasFocus = containerRef.current.contains(document.activeElement);\n\n // Keep caret position if it is already focused, otherwise focus at the end\n const position = hasFocus ? document.activeElement.selectionStart : Infinity;\n _setFocus(position + offset);\n };\n const handleInputCallback = useMemo(() => {\n return debounce(newValue => {\n onInput(newValue);\n });\n }, [onInput, debounce]);\n const setLocalValue = newValue => {\n _setLocalValue(newValue);\n if (!newValue || newValue === '=') {\n handleInputCallback(undefined);\n } else {\n handleInputCallback(newValue);\n }\n };\n const handleFeelToggle = useStaticCallback(() => {\n if (feel === 'required') {\n return;\n }\n if (!feelActive) {\n setLocalValue('=' + localValue);\n } else {\n setLocalValue(feelOnlyValue);\n }\n });\n const handleLocalInput = newValue => {\n if (feelActive) {\n newValue = '=' + newValue;\n }\n if (newValue === localValue) {\n return;\n }\n setLocalValue(newValue);\n if (!feelActive && newValue.startsWith('=')) {\n // focus is behind `=` sign that will be removed\n setFocus(-1);\n }\n };\n const handleLint = useStaticCallback(lint => {\n if (!(lint && lint.length)) {\n onError(undefined);\n return;\n }\n const error = lint[0];\n const message = `${error.source}: ${error.message}`;\n onError(message);\n });\n useEffect(() => {\n if (typeof focus !== 'undefined') {\n editorRef.current.focus(focus);\n _setFocus(undefined);\n }\n }, [focus]);\n useEffect(() => {\n if (value === localValue) {\n return;\n }\n\n // External value change removed content => keep FEEL configuration\n if (!value) {\n setLocalValue(feelActive ? '=' : '');\n return;\n }\n setLocalValue(value);\n }, [value]);\n\n // copy-paste integration\n useEffect(() => {\n const copyHandler = event => {\n if (!feelActive) {\n return;\n }\n event.clipboardData.setData('application/FEEL', event.clipboardData.getData('text'));\n };\n const pasteHandler = event => {\n if (feelActive) {\n return;\n }\n const data = event.clipboardData.getData('application/FEEL');\n if (data) {\n setTimeout(() => {\n handleFeelToggle();\n setFocus();\n });\n }\n };\n containerRef.current.addEventListener('copy', copyHandler);\n containerRef.current.addEventListener('cut', copyHandler);\n containerRef.current.addEventListener('paste', pasteHandler);\n return () => {\n containerRef.current.removeEventListener('copy', copyHandler);\n containerRef.current.removeEventListener('cut', copyHandler);\n containerRef.current.removeEventListener('paste', pasteHandler);\n };\n }, [containerRef, feelActive, handleFeelToggle, setFocus]);\n return jsxs(\"div\", {\n class: \"bio-properties-panel-feel-entry\",\n children: [jsxs(\"label\", {\n for: prefixId$6(id),\n class: \"bio-properties-panel-label\",\n onClick: () => setFocus(),\n children: [label, jsx(FeelIcon, {\n label: label,\n feel: feel,\n onClick: handleFeelToggle,\n active: feelActive\n })]\n }), jsxs(\"div\", {\n class: \"bio-properties-panel-feel-container\",\n ref: containerRef,\n children: [jsx(FeelIndicator, {\n active: feelActive,\n disabled: feel !== 'optional' || disabled,\n onClick: handleFeelToggle\n }), feelActive ? jsx(CodeEditor, {\n id: prefixId$6(id),\n name: id,\n onInput: handleLocalInput,\n disabled: disabled,\n onFeelToggle: () => {\n handleFeelToggle();\n setFocus(true);\n },\n onLint: handleLint,\n value: feelOnlyValue,\n variables: variables,\n ref: editorRef,\n tooltipContainer: tooltipContainer\n }) : jsx(OptionalComponent, {\n ...props,\n onInput: handleLocalInput,\n value: localValue,\n ref: editorRef\n })]\n })]\n });\n}\nconst OptionalFeelInput = forwardRef((props, ref) => {\n const {\n id,\n disabled,\n onInput,\n value,\n onFocus,\n onBlur\n } = props;\n const inputRef = useRef();\n\n // To be consistent with the FEEL editor, set focus at start of input\n // this ensures clean editing experience when switching with the keyboard\n ref.current = {\n focus: position => {\n const input = inputRef.current;\n if (!input) {\n return;\n }\n input.focus();\n if (typeof position === 'number') {\n if (position > value.length) {\n position = value.length;\n }\n input.setSelectionRange(position, position);\n }\n }\n };\n return jsx(\"input\", {\n id: prefixId$6(id),\n type: \"text\",\n ref: inputRef,\n name: id,\n spellCheck: \"false\",\n autoComplete: \"off\",\n disabled: disabled,\n class: \"bio-properties-panel-input\",\n onInput: e => onInput(e.target.value),\n onFocus: onFocus,\n onBlur: onBlur,\n value: value || ''\n });\n});\nconst OptionalFeelTextArea = forwardRef((props, ref) => {\n const {\n id,\n disabled,\n onInput,\n value,\n onFocus,\n onBlur\n } = props;\n const inputRef = useRef();\n\n // To be consistent with the FEEL editor, set focus at start of input\n // this ensures clean editing experience when switching with the keyboard\n ref.current = {\n focus: () => {\n const input = inputRef.current;\n if (!input) {\n return;\n }\n input.focus();\n input.setSelectionRange(0, 0);\n }\n };\n return jsx(\"textarea\", {\n id: prefixId$6(id),\n type: \"text\",\n ref: inputRef,\n name: id,\n spellCheck: \"false\",\n autoComplete: \"off\",\n disabled: disabled,\n class: \"bio-properties-panel-input\",\n onInput: e => onInput(e.target.value),\n onFocus: onFocus,\n onBlur: onBlur,\n value: value || '',\n \"data-gramm\": \"false\"\n });\n});\n\n/**\n * @param {Object} props\n * @param {Object} props.element\n * @param {String} props.id\n * @param {String} props.description\n * @param {Boolean} props.debounce\n * @param {Boolean} props.disabled\n * @param {String} props.label\n * @param {Function} props.getValue\n * @param {Function} props.setValue\n * @param {Function} props.validate\n */\nfunction FeelEntry(props) {\n const {\n element,\n id,\n description,\n debounce,\n disabled,\n feel,\n label,\n getValue,\n setValue,\n tooltipContainer,\n validate,\n show = noop,\n example,\n variables,\n onFocus,\n onBlur\n } = props;\n const [cachedInvalidValue, setCachedInvalidValue] = useState(null);\n const [validationError, setValidationError] = useState(null);\n const [localError, setLocalError] = useState(null);\n let value = getValue(element);\n const previousValue = usePrevious(value);\n useEffect(() => {\n if (isFunction(validate)) {\n const newValidationError = validate(value) || null;\n setValidationError(newValidationError);\n }\n }, [value]);\n const onInput = useStaticCallback(newValue => {\n let newValidationError = null;\n if (isFunction(validate)) {\n newValidationError = validate(newValue) || null;\n }\n if (newValidationError) {\n setCachedInvalidValue(newValue);\n } else {\n // don't create multiple commandStack entries for the same value\n if (newValue !== value) {\n setValue(newValue);\n }\n }\n setValidationError(newValidationError);\n });\n const onError = useCallback(err => {\n setLocalError(err);\n }, []);\n if (previousValue === value && validationError) {\n value = cachedInvalidValue;\n }\n const temporaryError = useError(id);\n const error = localError || temporaryError || validationError;\n return jsxs(\"div\", {\n class: classnames(props.class, 'bio-properties-panel-entry', error ? 'has-error' : ''),\n \"data-entry-id\": id,\n children: [jsx(FeelTextfield, {\n debounce: debounce,\n disabled: disabled,\n feel: feel,\n id: id,\n label: label,\n onInput: onInput,\n onError: onError,\n onFocus: onFocus,\n onBlur: onBlur,\n example: example,\n show: show,\n value: value,\n variables: variables,\n tooltipContainer: tooltipContainer,\n OptionalComponent: props.OptionalComponent\n }, element), error && jsx(\"div\", {\n class: \"bio-properties-panel-error\",\n children: error\n }), jsx(Description, {\n forId: id,\n element: element,\n value: description\n })]\n });\n}\n\n/**\n * @param {Object} props\n * @param {Object} props.element\n * @param {String} props.id\n * @param {String} props.description\n * @param {Boolean} props.debounce\n * @param {Boolean} props.disabled\n * @param {String} props.label\n * @param {Function} props.getValue\n * @param {Function} props.setValue\n * @param {Function} props.onFocus\n * @param {Function} props.onBlur\n * @param {Function} props.validate\n */\nfunction FeelTextArea(props) {\n return jsx(FeelEntry, {\n class: \"bio-properties-panel-feel-textarea\",\n OptionalComponent: OptionalFeelTextArea,\n ...props\n });\n}\nfunction isEdited$6(node) {\n return node && (!!node.value || node.classList.contains('edited'));\n}\n\n// helpers /////////////////\n\nfunction prefixId$6(id) {\n return `bio-properties-panel-${id}`;\n}\n\nfunction List(props) {\n const {\n id,\n element,\n items = [],\n component,\n label = '<empty>',\n open: shouldOpen,\n onAdd,\n onRemove,\n autoFocusEntry,\n compareFn,\n ...restProps\n } = props;\n const [open, setOpen] = useState(!!shouldOpen);\n const hasItems = !!items.length;\n const toggleOpen = () => hasItems && setOpen(!open);\n const opening = !usePrevious(open) && open;\n const elementChanged = usePrevious(element) !== element;\n const shouldReset = opening || elementChanged;\n const sortedItems = useSortedItems(items, compareFn, shouldReset);\n const newItems = useNewItems(items, elementChanged);\n useEffect(() => {\n if (open && !hasItems) {\n setOpen(false);\n }\n }, [open, hasItems]);\n\n /**\n * @param {MouseEvent} event\n */\n function addItem(event) {\n event.stopPropagation();\n onAdd();\n if (!open) {\n setOpen(true);\n }\n }\n return jsxs(\"div\", {\n \"data-entry-id\": id,\n class: classnames('bio-properties-panel-entry', 'bio-properties-panel-list-entry', hasItems ? '' : 'empty', open ? 'open' : ''),\n children: [jsxs(\"div\", {\n class: \"bio-properties-panel-list-entry-header\",\n onClick: toggleOpen,\n children: [jsx(\"div\", {\n title: label,\n class: classnames('bio-properties-panel-list-entry-header-title', open && 'open'),\n children: label\n }), jsxs(\"div\", {\n class: \"bio-properties-panel-list-entry-header-buttons\",\n children: [jsxs(\"button\", {\n title: \"Create new list item\",\n onClick: addItem,\n class: \"bio-properties-panel-add-entry\",\n children: [jsx(CreateIcon, {}), !hasItems ? jsx(\"span\", {\n class: \"bio-properties-panel-add-entry-label\",\n children: \"Create\"\n }) : null]\n }), hasItems && jsx(\"div\", {\n title: `List contains ${items.length} item${items.length != 1 ? 's' : ''}`,\n class: \"bio-properties-panel-list-badge\",\n children: items.length\n }), hasItems && jsx(\"button\", {\n title: \"Toggle list item\",\n class: \"bio-properties-panel-arrow\",\n children: jsx(ArrowIcon, {\n class: open ? 'bio-properties-panel-arrow-down' : 'bio-properties-panel-arrow-right'\n })\n })]\n })]\n }), hasItems && jsx(ItemsList, {\n ...restProps,\n autoFocusEntry: autoFocusEntry,\n component: component,\n element: element,\n id: id,\n items: sortedItems,\n newItems: newItems,\n onRemove: onRemove,\n open: open\n })]\n });\n}\nfunction ItemsList(props) {\n const {\n autoFocusEntry,\n component: Component,\n element,\n id,\n items,\n newItems,\n onRemove,\n open,\n ...restProps\n } = props;\n const getKey = useKeyFactory();\n const newItem = newItems[0];\n useEffect(() => {\n if (newItem && autoFocusEntry) {\n // (0) select the parent entry (containing all list items)\n const entry = query(`[data-entry-id=\"${id}\"]`);\n\n // (1) select the first input or a custom element to be focussed\n const selector = typeof autoFocusEntry === 'boolean' ? '.bio-properties-panel-input' : autoFocusEntry;\n const focusableInput = query(selector, entry);\n\n // (2) set focus\n if (focusableInput) {\n if (isFunction(focusableInput.select)) {\n focusableInput.select();\n } else if (isFunction(focusableInput.focus)) {\n focusableInput.focus();\n }\n }\n }\n }, [newItem, autoFocusEntry, id]);\n return jsx(\"ol\", {\n class: classnames('bio-properties-panel-list-entry-items', open ? 'open' : ''),\n children: items.map((item, index) => {\n const key = getKey(item);\n return jsxs(\"li\", {\n class: \"bio-properties-panel-list-entry-item\",\n children: [jsx(Component, {\n ...restProps,\n element: element,\n id: id,\n index: index,\n item: item,\n open: item === newItem\n }), onRemove && jsx(\"button\", {\n type: \"button\",\n title: \"Delete item\",\n class: \"bio-properties-panel-remove-entry bio-properties-panel-remove-list-entry\",\n onClick: () => onRemove && onRemove(item),\n children: jsx(DeleteIcon, {})\n })]\n }, key);\n })\n });\n}\n\n/**\n * Place new items in the beginning of the list and sort the rest with provided function.\n *\n * @template Item\n * @param {Item[]} currentItems\n * @param {(a: Item, b: Item) => 0 | 1 | -1} [compareFn] function used to sort items\n * @param {boolean} [shouldReset=false] set to `true` to reset state of the hook\n * @returns {Item[]}\n */\nfunction useSortedItems(currentItems, compareFn, shouldReset = false) {\n const itemsRef = useRef(currentItems.slice());\n\n // (1) Reset and optionally sort.\n if (shouldReset) {\n itemsRef.current = currentItems.slice();\n if (compareFn) {\n itemsRef.current.sort(compareFn);\n }\n } else {\n const items = itemsRef.current;\n\n // (2) Add new item to the list.\n for (const item of currentItems) {\n if (!items.includes(item)) {\n // Unshift or push depending on whether we have a compareFn\n compareFn ? items.unshift(item) : items.push(item);\n }\n }\n\n // (3) Filter out removed items.\n itemsRef.current = items.filter(item => currentItems.includes(item));\n }\n return itemsRef.current;\n}\nfunction useNewItems(items = [], shouldReset) {\n const previousItems = usePrevious(items.slice()) || [];\n if (shouldReset) {\n return [];\n }\n return previousItems ? items.filter(item => !previousItems.includes(item)) : [];\n}\n\nfunction NumberField(props) {\n const {\n debounce,\n disabled,\n id,\n label,\n max,\n min,\n onInput,\n step,\n value = '',\n onFocus,\n onBlur\n } = props;\n const [localValue, setLocalValue] = useState(value);\n const handleInputCallback = useMemo(() => {\n return debounce(event => {\n const {\n validity,\n value\n } = event.target;\n if (validity.valid) {\n onInput(value ? parseFloat(value) : undefined);\n }\n });\n }, [onInput, debounce]);\n const handleInput = e => {\n handleInputCallback(e);\n setLocalValue(e.target.value);\n };\n useEffect(() => {\n if (value === localValue) {\n return;\n }\n setLocalValue(value);\n }, [value]);\n return jsxs(\"div\", {\n class: \"bio-properties-panel-numberfield\",\n children: [jsx(\"label\", {\n for: prefixId$5(id),\n class: \"bio-properties-panel-label\",\n children: label\n }), jsx(\"input\", {\n id: prefixId$5(id),\n type: \"number\",\n name: id,\n spellCheck: \"false\",\n autoComplete: \"off\",\n disabled: disabled,\n class: \"bio-properties-panel-input\",\n max: max,\n min: min,\n onInput: handleInput,\n onFocus: onFocus,\n onBlur: onBlur,\n step: step,\n value: localValue\n })]\n });\n}\n\n/**\n * @param {Object} props\n * @param {Boolean} props.debounce\n * @param {String} props.description\n * @param {Boolean} props.disabled\n * @param {Object} props.element\n * @param {Function} props.getValue\n * @param {String} props.id\n * @param {String} props.label\n * @param {String} props.max\n * @param {String} props.min\n * @param {Function} props.setValue\n * @param {Function} props.onFocus\n * @param {Function} props.onBlur\n * @param {String} props.step\n */\nfunction NumberFieldEntry(props) {\n const {\n debounce,\n description,\n disabled,\n element,\n getValue,\n id,\n label,\n max,\n min,\n setValue,\n step,\n onFocus,\n onBlur\n } = props;\n const value = getValue(element);\n return jsxs(\"div\", {\n class: \"bio-properties-panel-entry\",\n \"data-entry-id\": id,\n children: [jsx(NumberField, {\n debounce: debounce,\n disabled: disabled,\n id: id,\n label: label,\n onInput: setValue,\n onFocus: onFocus,\n onBlur: onBlur,\n max: max,\n min: min,\n step: step,\n value: value\n }, element), jsx(Description, {\n forId: id,\n element: element,\n value: description\n })]\n });\n}\nfunction isEdited$5(node) {\n return node && !!node.value;\n}\n\n// helpers /////////////////\n\nfunction prefixId$5(id) {\n return `bio-properties-panel-${id}`;\n}\n\nfunction Select(props) {\n const {\n id,\n label,\n onChange,\n options = [],\n value,\n disabled,\n onFocus,\n onBlur\n } = props;\n const ref = useShowEntryEvent(id);\n const [localValue, setLocalValue] = useState(value);\n const handleChangeCallback = ({\n target\n }) => {\n onChange(target.value);\n };\n const handleChange = e => {\n handleChangeCallback(e);\n setLocalValue(e.target.value);\n };\n useEffect(() => {\n if (value === localValue) {\n return;\n }\n setLocalValue(value);\n }, [value]);\n return jsxs(\"div\", {\n class: \"bio-properties-panel-select\",\n children: [jsx(\"label\", {\n for: prefixId$4(id),\n class: \"bio-properties-panel-label\",\n children: label\n }), jsx(\"select\", {\n ref: ref,\n id: prefixId$4(id),\n name: id,\n class: \"bio-properties-panel-input\",\n onInput: handleChange,\n onFocus: onFocus,\n onBlur: onBlur,\n value: localValue,\n disabled: disabled,\n children: options.map((option, idx) => {\n return jsx(\"option\", {\n value: option.value,\n disabled: option.disabled,\n children: option.label\n }, idx);\n })\n })]\n });\n}\n\n/**\n * @param {object} props\n * @param {object} props.element\n * @param {string} props.id\n * @param {string} [props.description]\n * @param {string} props.label\n * @param {Function} props.getValue\n * @param {Function} props.setValue\n * @param {Function} props.onFocus\n * @param {Function} props.onBlur\n * @param {Function} props.getOptions\n * @param {boolean} [props.disabled]\n */\nfunction SelectEntry(props) {\n const {\n element,\n id,\n description,\n label,\n getValue,\n setValue,\n getOptions,\n disabled,\n onFocus,\n onBlur\n } = props;\n const value = getValue(element);\n const options = getOptions(element);\n const error = useError(id);\n return jsxs(\"div\", {\n class: classnames('bio-properties-panel-entry', error ? 'has-error' : ''),\n \"data-entry-id\": id,\n children: [jsx(Select, {\n id: id,\n label: label,\n value: value,\n onChange: setValue,\n onFocus: onFocus,\n onBlur: onBlur,\n options: options,\n disabled: disabled\n }, element), error && jsx(\"div\", {\n class: \"bio-properties-panel-error\",\n children: error\n }), jsx(Description, {\n forId: id,\n element: element,\n value: description\n })]\n });\n}\nfunction isEdited$4(node) {\n return node && !!node.value;\n}\n\n// helpers /////////////////\n\nfunction prefixId$4(id) {\n return `bio-properties-panel-${id}`;\n}\n\nfunction Simple(props) {\n const {\n debounce,\n disabled,\n element,\n getValue,\n id,\n onBlur,\n onFocus,\n setValue\n } = props;\n const value = getValue(element);\n const [localValue, setLocalValue] = useState(value);\n const handleInputCallback = useMemo(() => {\n return debounce(({\n target\n }) => setValue(target.value.length ? target.value : undefined));\n }, [setValue, debounce]);\n const handleInput = e => {\n handleInputCallback(e);\n setLocalValue(e.target.value);\n };\n useEffect(() => {\n if (value === localValue) {\n return;\n }\n setLocalValue(value);\n }, [value]);\n return jsx(\"div\", {\n class: \"bio-properties-panel-simple\",\n children: jsx(\"input\", {\n id: prefixId$3(id),\n type: \"text\",\n name: id,\n spellCheck: \"false\",\n autoComplete: \"off\",\n disabled: disabled,\n class: \"bio-properties-panel-input\",\n onInput: handleInput,\n \"aria-label\": localValue || '<empty>',\n onFocus: onFocus,\n onBlur: onBlur,\n value: localValue\n }, element)\n });\n}\nfunction isEdited$3(node) {\n return node && !!node.value;\n}\n\n// helpers /////////////////\n\nfunction prefixId$3(id) {\n return `bio-properties-panel-${id}`;\n}\n\nfunction TextArea(props) {\n const {\n id,\n label,\n rows = 2,\n debounce,\n onInput,\n value = '',\n disabled,\n monospace,\n onFocus,\n onBlur\n } = props;\n const [localValue, setLocalValue] = useState(value);\n const ref = useShowEntryEvent(id);\n const handleInputCallback = useMemo(() => {\n return debounce(({\n target\n }) => onInput(target.value.length ? target.value : undefined));\n }, [onInput, debounce]);\n const handleInput = e => {\n handleInputCallback(e);\n setLocalValue(e.target.value);\n };\n useEffect(() => {\n if (value === localValue) {\n return;\n }\n setLocalValue(value);\n }, [value]);\n return jsxs(\"div\", {\n class: \"bio-properties-panel-textarea\",\n children: [jsx(\"label\", {\n for: prefixId$2(id),\n class: \"bio-properties-panel-label\",\n children: label\n }), jsx(\"textarea\", {\n ref: ref,\n id: prefixId$2(id),\n name: id,\n spellCheck: \"false\",\n class: classnames('bio-properties-panel-input', monospace ? 'bio-properties-panel-input-monospace' : ''),\n onInput: handleInput,\n onFocus: onFocus,\n onBlur: onBlur,\n rows: rows,\n value: localValue,\n disabled: disabled,\n \"data-gramm\": \"false\"\n })]\n });\n}\n\n/**\n * @param {object} props\n * @param {object} props.element\n * @param {string} props.id\n * @param {string} props.description\n * @param {boolean} props.debounce\n * @param {string} props.label\n * @param {Function} props.getValue\n * @param {Function} props.setValue\n * @param {Function} props.onFocus\n * @param {Function} props.onBlur\n * @param {number} props.rows\n * @param {boolean} props.monospace\n * @param {boolean} [props.disabled]\n */\nfunction TextAreaEntry(props) {\n const {\n element,\n id,\n description,\n debounce,\n label,\n getValue,\n setValue,\n rows,\n monospace,\n disabled,\n onFocus,\n onBlur\n } = props;\n const value = getValue(element);\n const error = useError(id);\n return jsxs(\"div\", {\n class: classnames('bio-properties-panel-entry', error ? 'has-error' : ''),\n \"data-entry-id\": id,\n children: [jsx(TextArea, {\n id: id,\n label: label,\n value: value,\n onInput: setValue,\n onFocus: onFocus,\n onBlur: onBlur,\n rows: rows,\n debounce: debounce,\n monospace: monospace,\n disabled: disabled\n }, element), error && jsx(\"div\", {\n class: \"bio-properties-panel-error\",\n children: error\n }), jsx(Description, {\n forId: id,\n element: element,\n value: description\n })]\n });\n}\nfunction isEdited$2(node) {\n return node && !!node.value;\n}\n\n// helpers /////////////////\n\nfunction prefixId$2(id) {\n return `bio-properties-panel-${id}`;\n}\n\nfunction Textfield(props) {\n const {\n debounce,\n disabled = false,\n id,\n label,\n onInput,\n onFocus,\n onBlur,\n value = ''\n } = props;\n const [localValue, setLocalValue] = useState(value || '');\n const ref = useShowEntryEvent(id);\n const handleInputCallback = useMemo(() => {\n return debounce(({\n target\n }) => onInput(target.value.length ? target.value : undefined));\n }, [onInput, debounce]);\n const handleInput = e => {\n handleInputCallback(e);\n setLocalValue(e.target.value);\n };\n useEffect(() => {\n if (value === localValue) {\n return;\n }\n setLocalValue(value);\n }, [value]);\n return jsxs(\"div\", {\n class: \"bio-properties-panel-textfield\",\n children: [jsx(\"label\", {\n for: prefixId$1(id),\n class: \"bio-properties-panel-label\",\n children: label\n }), jsx(\"input\", {\n ref: ref,\n id: prefixId$1(id),\n type: \"text\",\n name: id,\n spellCheck: \"false\",\n autoComplete: \"off\",\n disabled: disabled,\n class: \"bio-properties-panel-input\",\n onInput: handleInput,\n onFocus: onFocus,\n onBlur: onBlur,\n value: localValue\n })]\n });\n}\n\n/**\n * @param {Object} props\n * @param {Object} props.element\n * @param {String} props.id\n * @param {String} props.description\n * @param {Boolean} props.debounce\n * @param {Boolean} props.disabled\n * @param {String} props.label\n * @param {Function} props.getValue\n * @param {Function} props.setValue\n * @param {Function} props.onFocus\n * @param {Function} props.onBlur\n * @param {Function} props.validate\n */\nfunction TextfieldEntry(props) {\n const {\n element,\n id,\n description,\n debounce,\n disabled,\n label,\n getValue,\n setValue,\n validate,\n onFocus,\n onBlur\n } = props;\n const [cachedInvalidValue, setCachedInvalidValue] = useState(null);\n const globalError = useError(id);\n const [localError, setLocalError] = useState(null);\n let value = getValue(element);\n const previousValue = usePrevious(value);\n useEffect(() => {\n if (isFunction(validate)) {\n const newValidationError = validate(value) || null;\n setLocalError(newValidationError);\n }\n }, [value]);\n const onInput = newValue => {\n let newValidationError = null;\n if (isFunction(validate)) {\n newValidationError = validate(newValue) || null;\n }\n if (newValidationError) {\n setCachedInvalidValue(newValue);\n } else {\n setValue(newValue);\n }\n setLocalError(newValidationError);\n };\n if (previousValue === value && localError) {\n value = cachedInvalidValue;\n }\n const error = globalError || localError;\n return jsxs(\"div\", {\n class: classnames('bio-properties-panel-entry', error ? 'has-error' : ''),\n \"data-entry-id\": id,\n children: [jsx(Textfield, {\n debounce: debounce,\n disabled: disabled,\n id: id,\n label: label,\n onInput: onInput,\n onFocus: onFocus,\n onBlur: onBlur,\n value: value\n }, element), error && jsx(\"div\", {\n class: \"bio-properties-panel-error\",\n children: error\n }), jsx(Description, {\n forId: id,\n element: element,\n value: description\n })]\n });\n}\nfunction isEdited$1(node) {\n return node && !!node.value;\n}\n\n// helpers /////////////////\n\nfunction prefixId$1(id) {\n return `bio-properties-panel-${id}`;\n}\n\nfunction ToggleSwitch(props) {\n const {\n id,\n label,\n onInput,\n value,\n switcherLabel,\n onFocus,\n onBlur\n } = props;\n const [localValue, setLocalValue] = useState(value);\n const handleInputCallback = async () => {\n onInput(!value);\n };\n const handleInput = e => {\n handleInputCallback();\n setLocalValue(e.target.value);\n };\n useEffect(() => {\n if (value === localValue) {\n return;\n }\n setLocalValue(value);\n }, [value]);\n return jsxs(\"div\", {\n class: \"bio-properties-panel-toggle-switch\",\n children: [jsx(\"label\", {\n class: \"bio-properties-panel-label\",\n for: prefixId(id),\n children: label\n }), jsxs(\"div\", {\n class: \"bio-properties-panel-field-wrapper\",\n children: [jsxs(\"label\", {\n class: \"bio-properties-panel-toggle-switch__switcher\",\n children: [jsx(\"input\", {\n id: prefixId(id),\n class: \"bio-properties-panel-input\",\n type: \"checkbox\",\n onFocus: onFocus,\n onBlur: onBlur,\n name: id,\n onInput: handleInput,\n checked: !!localValue\n }), jsx(\"span\", {\n class: \"bio-properties-panel-toggle-switch__slider\"\n })]\n }), jsx(\"p\", {\n class: \"bio-properties-panel-toggle-switch__label\",\n children: switcherLabel\n })]\n })]\n });\n}\n\n/**\n * @param {Object} props\n * @param {Object} props.element\n * @param {String} props.id\n * @param {String} props.description\n * @param {String} props.label\n * @param {String} props.switcherLabel\n * @param {Function} props.getValue\n * @param {Function} props.setValue\n * @param {Function} props.onFocus\n * @param {Function} props.onBlur\n */\nfunction ToggleSwitchEntry(props) {\n const {\n element,\n id,\n description,\n label,\n switcherLabel,\n getValue,\n setValue,\n onFocus,\n onBlur\n } = props;\n const value = getValue(element);\n return jsxs(\"div\", {\n class: \"bio-properties-panel-entry bio-properties-panel-toggle-switch-entry\",\n \"data-entry-id\": id,\n children: [jsx(ToggleSwitch, {\n id: id,\n label: label,\n value: value,\n onInput: setValue,\n onFocus: onFocus,\n onBlur: onBlur,\n switcherLabel: switcherLabel\n }), jsx(Description, {\n forId: id,\n element: element,\n value: description\n })]\n });\n}\nfunction isEdited(node) {\n return node && !!node.checked;\n}\n\n// helpers /////////////////\n\nfunction prefixId(id) {\n return `bio-properties-panel-${id}`;\n}\n\nconst DEFAULT_DEBOUNCE_TIME = 300;\nfunction debounceInput(debounceDelay) {\n return function _debounceInput(fn) {\n if (debounceDelay !== false) {\n var debounceTime = isNumber(debounceDelay) ? debounceDelay : DEFAULT_DEBOUNCE_TIME;\n return debounce(fn, debounceTime);\n } else {\n return fn;\n }\n };\n}\ndebounceInput.$inject = ['config.debounceInput'];\n\nvar index = {\n debounceInput: ['factory', debounceInput]\n};\n\nexport { ArrowIcon, CheckboxEntry, CollapsibleEntry, CreateIcon, index as DebounceInputModule, DeleteIcon, DescriptionContext, Description as DescriptionEntry, DropdownButton, ErrorsContext, EventContext, ExternalLinkIcon, FeelEntry, FeelOptionalIcon, FeelRequiredIcon, FeelTextArea as FeelTextAreaEntry, Group, Header, HeaderButton, LayoutContext, List as ListEntry, ListGroup, ListItem, NumberFieldEntry, Placeholder, PropertiesPanel, LayoutContext as PropertiesPanelContext, SelectEntry, Simple as SimpleEntry, TextAreaEntry, TextfieldEntry as TextFieldEntry, ToggleSwitchEntry, isEdited$7 as isCheckboxEntryEdited, isEdited$6 as isFeelEntryEdited, isEdited$5 as isNumberFieldEntryEdited, isEdited$4 as isSelectEntryEdited, isEdited$3 as isSimpleEntryEdited, isEdited$2 as isTextAreaEntryEdited, isEdited$1 as isTextFieldEntryEdited, isEdited as isToggleSwitchEntryEdited, useDescriptionContext, useError, useEvent, useKeyFactory, useLayoutState, usePrevious, useShowEntryEvent, useStaticCallback, useStickyIntersectionObserver };\n//# sourceMappingURL=index.esm.js.map\n","import { createContext } from 'preact';\r\n\r\n/**\r\n * @param {string} type\r\n * @param {boolean} [strict]\r\n *\r\n * @returns {any}\r\n */\r\nfunction getService(type, strict) {}\r\n\r\nconst PropertiesPanelContext = createContext({\r\n getService\r\n});\r\n\r\nexport default PropertiesPanelContext;","import Big from 'big.js';\r\n\r\nexport function arrayAdd(array, index, item) {\r\n const copy = [ ...array ];\r\n\r\n copy.splice(index, 0, item);\r\n\r\n return copy;\r\n}\r\n\r\nexport function arrayRemove(array, index) {\r\n const copy = [ ...array ];\r\n\r\n copy.splice(index, 1);\r\n\r\n return copy;\r\n}\r\n\r\nexport function prefixId(id) {\r\n return `fjs-properties-panel-${ id }`;\r\n}\r\n\r\n\r\nexport function countDecimals(number) {\r\n const num = Big(number);\r\n if (num.toString() === num.toFixed(0)) return 0;\r\n return num.toFixed().split('.')[1].length || 0;\r\n}\r\n\r\nexport function isValidNumber(value) {\r\n return (typeof value === 'number' || typeof value === 'string') && value !== '' && !isNaN(Number(value));\r\n}\r\n\r\nexport function stopPropagation(listener) {\r\n return (event) => {\r\n event.stopPropagation();\r\n\r\n listener(event);\r\n };\r\n}\r\n\r\nexport function textToLabel(text) {\r\n\r\n if (typeof text != 'string') return null;\r\n\r\n for (const line of text.split('\\n')) {\r\n\r\n const displayLine = line.trim();\r\n\r\n // we use the first non-whitespace line in the text as label\r\n if (displayLine !== '') {\r\n return displayLine;\r\n }\r\n }\r\n\r\n return null;\r\n}\r\n\r\nexport const INPUTS = [\r\n 'checkbox',\r\n 'checklist',\r\n 'datetime',\r\n 'number',\r\n 'radio',\r\n 'select',\r\n 'taglist',\r\n 'textfield',\r\n 'textarea'\r\n];\r\n\r\nexport const VALUES_INPUTS = [\r\n 'checklist',\r\n 'radio',\r\n 'select',\r\n 'taglist'\r\n];","import {\r\n textToLabel\r\n} from './Util';\r\n\r\nimport { iconsByType } from '../../render/components/icons';\r\n\r\nconst labelsByType = {\r\n button: 'BUTTON',\r\n checkbox: 'CHECKBOX',\r\n checklist: 'CHECKLIST',\r\n columns: 'COLUMNS',\r\n default: 'FORM',\r\n datetime: 'DATETIME',\r\n image: 'IMAGE VIEW',\r\n number: 'NUMBER',\r\n radio: 'RADIO',\r\n select: 'SELECT',\r\n taglist: 'TAGLIST',\r\n text: 'TEXT VIEW',\r\n textfield: 'TEXT FIELD',\r\n textarea: 'TEXT AREA',\r\n};\r\n\r\nexport const PropertiesPanelHeaderProvider = {\r\n\r\n getElementLabel: (field) => {\r\n const {\r\n type\r\n } = field;\r\n\r\n if (type === 'text') {\r\n return textToLabel(field.text);\r\n }\r\n\r\n if (type === 'image') {\r\n return field.alt;\r\n }\r\n\r\n if (type === 'default') {\r\n return field.id;\r\n }\r\n\r\n return field.label;\r\n },\r\n\r\n getElementIcon: (field) => {\r\n const {\r\n type\r\n } = field;\r\n\r\n const Icon = iconsByType[type];\r\n\r\n if (Icon) {\r\n return () => <Icon width=\"36\" height=\"36\" viewBox=\"0 0 54 54\" />;\r\n }\r\n },\r\n\r\n getTypeLabel: (field) => {\r\n const {\r\n type\r\n } = field;\r\n\r\n return labelsByType[type];\r\n }\r\n};","/**\r\n * Provide placeholders for empty and multiple state.\r\n */\r\nexport const PropertiesPanelPlaceholderProvider = {\r\n\r\n getEmpty: () => {\r\n return {\r\n text: 'Select a form field to edit its properties.'\r\n };\r\n },\r\n\r\n getMultiple: () => {\r\n return {\r\n text: 'Multiple form fields are selected. Select a single form field to edit its properties.'\r\n };\r\n }\r\n};","import { get } from 'min-dash';\r\n\r\nimport { SelectEntry, isSelectEntryEdited } from '@bpmn-io/properties-panel';\r\n\r\n\r\nexport default function ActionEntry(props) {\r\n const {\r\n editField,\r\n field\r\n } = props;\r\n\r\n const {\r\n type\r\n } = field;\r\n\r\n const entries = [];\r\n\r\n if (type === 'button') {\r\n entries.push({\r\n id: 'action',\r\n component: Action,\r\n editField: editField,\r\n field: field,\r\n isEdited: isSelectEntryEdited\r\n });\r\n }\r\n\r\n return entries;\r\n}\r\n\r\nfunction Action(props) {\r\n const {\r\n editField,\r\n field,\r\n id\r\n } = props;\r\n\r\n const path = [ 'action' ];\r\n\r\n const getValue = () => {\r\n return get(field, path, '');\r\n };\r\n\r\n const setValue = (value) => {\r\n return editField(field, path, value);\r\n };\r\n\r\n const getOptions = () => [\r\n {\r\n label: 'Submit',\r\n value: 'submit'\r\n },\r\n {\r\n label: 'Reset',\r\n value: 'reset'\r\n }\r\n ];\r\n\r\n return SelectEntry({\r\n element: field,\r\n getOptions,\r\n getValue,\r\n id,\r\n label: 'Action',\r\n setValue\r\n });\r\n}","import {\r\n useContext\r\n} from 'preact/hooks';\r\n\r\nimport { FormPropertiesPanelContext } from '../context';\r\n\r\n\r\nexport default function(type, strict) {\r\n const {\r\n getService\r\n } = useContext(FormPropertiesPanelContext);\r\n\r\n return getService(type, strict);\r\n}","import { getSchemaVariables } from '@bpmn-io/form-js-viewer';\r\nimport useService from './usePropertiesPanelService';\r\n\r\n/**\r\n * Retrieve list of variables from the form schema.\r\n *\r\n * @returns { string[] } list of variables used in form schema\r\n */\r\nexport function useVariables() {\r\n const form = useService('formEditor');\r\n const schema = form.getSchema();\r\n\r\n return getSchemaVariables(schema);\r\n}\r\n","import { get } from 'min-dash';\r\n\r\nimport { useService, useVariables } from '../hooks';\r\n\r\nimport { FeelEntry, isFeelEntryEdited } from '@bpmn-io/properties-panel';\r\n\r\nexport default function AltTextEntry(props) {\r\n const {\r\n editField,\r\n field\r\n } = props;\r\n\r\n const {\r\n type\r\n } = field;\r\n\r\n const entries = [];\r\n\r\n if (type === 'image') {\r\n entries.push({\r\n id: 'alt',\r\n component: AltText,\r\n editField: editField,\r\n field: field,\r\n isEdited: isFeelEntryEdited\r\n });\r\n }\r\n\r\n return entries;\r\n}\r\n\r\nfunction AltText(props) {\r\n const {\r\n editField,\r\n field,\r\n id\r\n } = props;\r\n\r\n const debounce = useService('debounce');\r\n\r\n const variables = useVariables().map(name => ({ name }));\r\n\r\n const path = [ 'alt' ];\r\n\r\n const getValue = () => {\r\n return get(field, path, '');\r\n };\r\n\r\n const setValue = (value) => {\r\n return editField(field, path, value);\r\n };\r\n\r\n return FeelEntry({\r\n debounce,\r\n element: field,\r\n feel: 'optional',\r\n getValue,\r\n id,\r\n label: 'Alternative text',\r\n setValue,\r\n variables\r\n });\r\n}\r\n","import { Default } from '@bpmn-io/form-js-viewer';\r\n\r\nimport { useService } from '../hooks';\r\n\r\nimport { NumberFieldEntry, isNumberFieldEntryEdited } from '@bpmn-io/properties-panel';\r\n\r\n\r\nexport default function ColumnsEntry(props) {\r\n const {\r\n editField,\r\n field\r\n } = props;\r\n\r\n const {\r\n type\r\n } = field;\r\n\r\n const entries = [];\r\n\r\n if (type === 'columns') {\r\n entries.push({\r\n id: 'columns',\r\n component: Columns,\r\n editField: editField,\r\n field: field,\r\n isEdited: isNumberFieldEntryEdited\r\n });\r\n }\r\n\r\n return entries;\r\n}\r\n\r\nfunction Columns(props) {\r\n const {\r\n editField,\r\n field,\r\n id\r\n } = props;\r\n\r\n const debounce = useService('debounce');\r\n\r\n const getValue = () => {\r\n return field.components.length;\r\n };\r\n\r\n const setValue = (value) => {\r\n let components = field.components.slice();\r\n\r\n if (value > components.length) {\r\n while (value > components.length) {\r\n components.push(Default.create({ _parent: field.id }));\r\n }\r\n } else {\r\n components = components.slice(0, value);\r\n }\r\n\r\n editField(field, 'components', components);\r\n };\r\n\r\n return NumberFieldEntry({\r\n debounce,\r\n element: field,\r\n getValue,\r\n id,\r\n label: 'Columns',\r\n setValue\r\n });\r\n}","import { get } from 'min-dash';\r\n\r\nimport { useService } from '../hooks';\r\n\r\nimport { INPUTS } from '../Util';\r\n\r\nimport { TextFieldEntry, isTextFieldEntryEdited } from '@bpmn-io/properties-panel';\r\n\r\n\r\nexport default function DescriptionEntry(props) {\r\n const {\r\n editField,\r\n field\r\n } = props;\r\n\r\n const {\r\n type\r\n } = field;\r\n\r\n const entries = [];\r\n\r\n if (INPUTS.includes(type)) {\r\n entries.push({\r\n id: 'description',\r\n component: Description,\r\n editField: editField,\r\n field: field,\r\n isEdited: isTextFieldEntryEdited\r\n });\r\n }\r\n\r\n return entries;\r\n}\r\n\r\n\r\nfunction Description(props) {\r\n const {\r\n editField,\r\n field,\r\n id\r\n } = props;\r\n\r\n const debounce = useService('debounce');\r\n\r\n const path = [ 'description' ];\r\n\r\n const getValue = () => {\r\n return get(field, path, '');\r\n };\r\n\r\n const setValue = (value) => {\r\n return editField(field, path, value);\r\n };\r\n\r\n return TextFieldEntry({\r\n debounce,\r\n element: field,\r\n getValue,\r\n id,\r\n label: 'Field description',\r\n setValue\r\n });\r\n}","import {\r\n isSelectEntryEdited,\r\n isTextFieldEntryEdited,\r\n isTextAreaEntryEdited,\r\n SelectEntry,\r\n TextFieldEntry,\r\n TextAreaEntry\r\n} from '@bpmn-io/properties-panel';\r\n\r\nimport { get } from 'min-dash';\r\n\r\nimport Big from 'big.js';\r\n\r\nimport { useService } from '../hooks';\r\n\r\nimport { countDecimals, INPUTS, isValidNumber, VALUES_INPUTS } from '../Util';\r\n\r\nexport default function DefaultOptionEntry(props) {\r\n const {\r\n editField,\r\n field\r\n } = props;\r\n\r\n const {\r\n type\r\n } = field;\r\n\r\n const entries = [];\r\n\r\n // Only make default values available when they are statically defined\r\n if (!INPUTS.includes(type) || VALUES_INPUTS.includes(type) && !field.values) {\r\n return entries;\r\n }\r\n\r\n const defaultOptions = {\r\n editField,\r\n field,\r\n id: 'defaultValue',\r\n label: 'Default value'\r\n };\r\n\r\n if (type === 'checkbox') {\r\n entries.push({\r\n ...defaultOptions,\r\n component: DefaultValueCheckbox,\r\n isEdited: isSelectEntryEdited\r\n });\r\n }\r\n\r\n if (type === 'number') {\r\n entries.push({\r\n ...defaultOptions,\r\n component: DefaultValueNumber,\r\n isEdited: isTextFieldEntryEdited\r\n });\r\n }\r\n\r\n if (type === 'radio' || type === 'select') {\r\n entries.push({\r\n ...defaultOptions,\r\n component: DefaultValueSingleSelect,\r\n isEdited: isSelectEntryEdited\r\n });\r\n }\r\n\r\n // todo(Skaiir): implement a multiselect equivalent (cf. https://github.com/bpmn-io/form-js/issues/265)\r\n\r\n if (type === 'textfield') {\r\n entries.push({\r\n ...defaultOptions,\r\n component: DefaultValueTextfield,\r\n isEdited: isTextFieldEntryEdited\r\n });\r\n }\r\n\r\n if (type === 'textarea') {\r\n entries.push({\r\n ...defaultOptions,\r\n component: DefaultValueTextarea,\r\n isEdited: isTextAreaEntryEdited\r\n });\r\n }\r\n\r\n return entries;\r\n}\r\n\r\nfunction DefaultValueCheckbox(props) {\r\n const {\r\n editField,\r\n field,\r\n id,\r\n label\r\n } = props;\r\n\r\n const {\r\n defaultValue\r\n } = field;\r\n\r\n const path = [ 'defaultValue' ];\r\n\r\n const getOptions = () => {\r\n return [\r\n {\r\n label: 'Checked',\r\n value: 'true'\r\n },\r\n {\r\n label: 'Not checked',\r\n value: 'false'\r\n }\r\n ];\r\n };\r\n\r\n const setValue = (value) => {\r\n return editField(field, path, parseStringToBoolean(value));\r\n };\r\n\r\n const getValue = () => {\r\n return parseBooleanToString(defaultValue);\r\n };\r\n\r\n return SelectEntry({\r\n element: field,\r\n getOptions,\r\n getValue,\r\n id,\r\n label,\r\n setValue\r\n });\r\n}\r\n\r\nfunction DefaultValueNumber(props) {\r\n const {\r\n editField,\r\n field,\r\n id,\r\n label\r\n } = props;\r\n\r\n const {\r\n decimalDigits,\r\n serializeToString = false\r\n } = field;\r\n\r\n const debounce = useService('debounce');\r\n\r\n const path = [ 'defaultValue' ];\r\n\r\n const getValue = (e) => {\r\n\r\n let value = get(field, path);\r\n\r\n if (!isValidNumber(value)) return;\r\n\r\n // Enforces decimal notation so that we do not submit defaults in exponent form\r\n return serializeToString ? Big(value).toFixed() : value;\r\n };\r\n\r\n const setValue = (value) => {\r\n\r\n let newValue;\r\n\r\n if (isValidNumber(value)) {\r\n newValue = serializeToString ? value : Number(value);\r\n }\r\n\r\n return editField(field, path, newValue);\r\n };\r\n\r\n const decimalDigitsSet = decimalDigits || decimalDigits === 0;\r\n\r\n return TextFieldEntry({\r\n debounce,\r\n label,\r\n element: field,\r\n getValue,\r\n id,\r\n setValue,\r\n validate: (value) => {\r\n if (value === undefined || value === null) return;\r\n if (!isValidNumber(value)) return 'Should be a valid number';\r\n if (decimalDigitsSet && countDecimals(value) > decimalDigits) return `Should not contain more than ${decimalDigits} decimal digits`;\r\n }\r\n });\r\n}\r\n\r\nfunction DefaultValueSingleSelect(props) {\r\n const {\r\n editField,\r\n field,\r\n id,\r\n label\r\n } = props;\r\n\r\n const {\r\n defaultValue,\r\n values = []\r\n } = field;\r\n\r\n const path = [ 'defaultValue' ];\r\n\r\n const getOptions = () => {\r\n return [\r\n {\r\n label: '<none>'\r\n },\r\n ...values\r\n ];\r\n };\r\n\r\n const setValue = (value) => {\r\n return editField(field, path, value.length ? value : undefined);\r\n };\r\n\r\n const getValue = () => {\r\n return defaultValue;\r\n };\r\n\r\n return SelectEntry({\r\n element: field,\r\n getOptions,\r\n getValue,\r\n id,\r\n label,\r\n setValue\r\n });\r\n}\r\n\r\nfunction DefaultValueTextfield(props) {\r\n const {\r\n editField,\r\n field,\r\n id,\r\n label\r\n } = props;\r\n\r\n const debounce = useService('debounce');\r\n\r\n const path = [ 'defaultValue' ];\r\n\r\n const getValue = () => {\r\n return get(field, path, '');\r\n };\r\n\r\n const setValue = (value) => {\r\n return editField(field, path, value);\r\n };\r\n\r\n return TextFieldEntry({\r\n debounce,\r\n element: field,\r\n getValue,\r\n id,\r\n label,\r\n setValue\r\n });\r\n}\r\n\r\nfunction DefaultValueTextarea(props) {\r\n const {\r\n editField,\r\n field,\r\n id,\r\n label\r\n } = props;\r\n\r\n const debounce = useService('debounce');\r\n\r\n const path = [ 'defaultValue' ];\r\n\r\n const getValue = () => {\r\n return get(field, path, '');\r\n };\r\n\r\n const setValue = (value) => {\r\n return editField(field, path, value);\r\n };\r\n\r\n return TextAreaEntry({\r\n debounce,\r\n element: field,\r\n getValue,\r\n id,\r\n label,\r\n setValue\r\n });\r\n}\r\n\r\n// helpers /////////////////\r\n\r\nfunction parseStringToBoolean(value) {\r\n if (value === 'true') {\r\n return true;\r\n }\r\n\r\n return false;\r\n}\r\n\r\nfunction parseBooleanToString(value) {\r\n if (value === true) {\r\n return 'true';\r\n }\r\n\r\n return 'false';\r\n}","import { get } from 'min-dash';\r\n\r\nimport { INPUTS } from '../Util';\r\n\r\nimport { CheckboxEntry, isCheckboxEntryEdited } from '@bpmn-io/properties-panel';\r\n\r\n\r\nexport default function DisabledEntry(props) {\r\n const {\r\n editField,\r\n field\r\n } = props;\r\n\r\n const {\r\n type\r\n } = field;\r\n\r\n const entries = [];\r\n\r\n if (INPUTS.includes(type)) {\r\n entries.push({\r\n id: 'disabled',\r\n component: Disabled,\r\n editField: editField,\r\n field: field,\r\n isEdited: isCheckboxEntryEdited\r\n });\r\n }\r\n\r\n return entries;\r\n}\r\n\r\nfunction Disabled(props) {\r\n const {\r\n editField,\r\n field,\r\n id\r\n } = props;\r\n\r\n const path = [ 'disabled' ];\r\n\r\n const getValue = () => {\r\n return get(field, path, '');\r\n };\r\n\r\n const setValue = (value) => {\r\n return editField(field, path, value);\r\n };\r\n\r\n return CheckboxEntry({\r\n element: field,\r\n getValue,\r\n id,\r\n label: 'Disabled',\r\n setValue\r\n });\r\n}","import { get, isUndefined } from 'min-dash';\r\n\r\nimport { useService } from '../hooks';\r\n\r\nimport { TextFieldEntry, isTextFieldEntryEdited } from '@bpmn-io/properties-panel';\r\n\r\n\r\nexport default function IdEntry(props) {\r\n const {\r\n editField,\r\n field\r\n } = props;\r\n\r\n const entries = [];\r\n\r\n if (field.type === 'default') {\r\n entries.push({\r\n id: 'id',\r\n component: Id,\r\n editField: editField,\r\n field: field,\r\n isEdited: isTextFieldEntryEdited\r\n });\r\n }\r\n\r\n return entries;\r\n}\r\n\r\nfunction Id(props) {\r\n const {\r\n editField,\r\n field,\r\n id\r\n } = props;\r\n\r\n const formFieldRegistry = useService('formFieldRegistry');\r\n const debounce = useService('debounce');\r\n\r\n const path = [ 'id' ];\r\n\r\n const getValue = () => {\r\n return get(field, path, '');\r\n };\r\n\r\n const setValue = (value) => {\r\n return editField(field, path, value);\r\n };\r\n\r\n const validate = (value) => {\r\n if (isUndefined(value) || !value.length) {\r\n return 'Must not be empty.';\r\n }\r\n\r\n const assigned = formFieldRegistry._ids.assigned(value);\r\n\r\n if (assigned && assigned !== field) {\r\n return 'Must be unique.';\r\n }\r\n\r\n return validateId(value) || null;\r\n };\r\n\r\n return TextFieldEntry({\r\n debounce,\r\n element: field,\r\n getValue,\r\n id,\r\n label: 'ID',\r\n setValue,\r\n validate,\r\n });\r\n}\r\n\r\n// id structural validation /////////////\r\n\r\nconst SPACE_REGEX = /\\s/;\r\n\r\n// for QName validation as per http://www.w3.org/TR/REC-xml/#NT-NameChar\r\nconst QNAME_REGEX = /^([a-z][\\w-.]*:)?[a-z_][\\w-.]*$/i;\r\n\r\n// for ID validation as per BPMN Schema (QName - Namespace)\r\nconst ID_REGEX = /^[a-z_][\\w-.]*$/i;\r\n\r\nfunction validateId(idValue) {\r\n\r\n if (containsSpace(idValue)) {\r\n return 'Must not contain spaces.';\r\n }\r\n\r\n if (!ID_REGEX.test(idValue)) {\r\n\r\n if (QNAME_REGEX.test(idValue)) {\r\n return 'Must not contain prefix.';\r\n }\r\n\r\n return 'Must be a valid QName.';\r\n }\r\n}\r\n\r\nfunction containsSpace(value) {\r\n return SPACE_REGEX.test(value);\r\n}","import { isUndefined } from 'min-dash';\r\n\r\nimport { get } from 'min-dash';\r\n\r\nimport { INPUTS } from '../Util';\r\n\r\nimport { useService } from '../hooks';\r\n\r\nimport { TextFieldEntry, isTextFieldEntryEdited } from '@bpmn-io/properties-panel';\r\n\r\n\r\nexport default function KeyEntry(props) {\r\n const {\r\n editField,\r\n field\r\n } = props;\r\n\r\n const {\r\n type\r\n } = field;\r\n\r\n const entries = [];\r\n\r\n if (INPUTS.includes(type)) {\r\n entries.push({\r\n id: 'key',\r\n component: Key,\r\n editField: editField,\r\n field: field,\r\n isEdited: isTextFieldEntryEdited\r\n });\r\n }\r\n\r\n return entries;\r\n}\r\n\r\nfunction Key(props) {\r\n const {\r\n editField,\r\n field,\r\n id\r\n } = props;\r\n\r\n const formFieldRegistry = useService('formFieldRegistry');\r\n\r\n const debounce = useService('debounce');\r\n\r\n const path = [ 'key' ];\r\n\r\n const getValue = () => {\r\n return get(field, path, '');\r\n };\r\n\r\n const setValue = (value) => {\r\n return editField(field, path, value);\r\n };\r\n\r\n const validate = (value) => {\r\n if (isUndefined(value) || !value.length) {\r\n return 'Must not be empty.';\r\n }\r\n\r\n if (/\\s/.test(value)) {\r\n return 'Must not contain spaces.';\r\n }\r\n\r\n const assigned = formFieldRegistry._keys.assigned(value);\r\n\r\n if (assigned && assigned !== field) {\r\n return 'Must be unique.';\r\n }\r\n\r\n return null;\r\n };\r\n\r\n return TextFieldEntry({\r\n debounce,\r\n description: 'Binds to a form variable',\r\n element: field,\r\n getValue,\r\n id,\r\n label: 'Key',\r\n setValue,\r\n validate\r\n });\r\n}","import { get } from 'min-dash';\r\nimport { useService } from '../../hooks';\r\nimport { TextFieldEntry, isTextFieldEntryEdited } from '@bpmn-io/properties-panel';\r\n\r\nexport default function simpleStringEntryFactory(options) {\r\n const {\r\n id,\r\n label,\r\n path,\r\n props\r\n } = options;\r\n\r\n const {\r\n editField,\r\n field\r\n } = props;\r\n\r\n return {\r\n id,\r\n label,\r\n path,\r\n field,\r\n editField,\r\n component: SimpleStringComponent,\r\n isEdited: isTextFieldEntryEdited\r\n };\r\n}\r\n\r\nconst SimpleStringComponent = (props) => {\r\n const {\r\n id,\r\n label,\r\n path,\r\n field,\r\n editField\r\n } = props;\r\n\r\n const debounce = useService('debounce');\r\n\r\n const getValue = () => get(field, path, '');\r\n\r\n const setValue = (value) => editField(field, path, value);\r\n\r\n return TextFieldEntry({\r\n debounce,\r\n element: field,\r\n getValue,\r\n id,\r\n label,\r\n setValue\r\n });\r\n};\r\n","import { INPUTS } from '../Util';\r\nimport { DATETIME_SUBTYPES, DATE_LABEL_PATH, TIME_LABEL_PATH } from '@bpmn-io/form-js-viewer';\r\nimport { simpleStringEntryFactory } from './factories';\r\n\r\nexport default function LabelEntry(props) {\r\n const {\r\n field\r\n } = props;\r\n\r\n const {\r\n type,\r\n subtype\r\n } = field;\r\n\r\n const entries = [];\r\n\r\n if (type === 'datetime') {\r\n if (subtype === DATETIME_SUBTYPES.DATE || subtype === DATETIME_SUBTYPES.DATETIME) {\r\n entries.push(\r\n simpleStringEntryFactory({\r\n id: 'date-label',\r\n path: DATE_LABEL_PATH,\r\n label: 'Date label',\r\n props\r\n })\r\n );\r\n }\r\n if (subtype === DATETIME_SUBTYPES.TIME || subtype === DATETIME_SUBTYPES.DATETIME) {\r\n entries.push(\r\n simpleStringEntryFactory({\r\n id: 'time-label',\r\n path: TIME_LABEL_PATH,\r\n label: 'Time label',\r\n props\r\n })\r\n );\r\n }\r\n }\r\n else if (INPUTS.includes(type) || type === 'button') {\r\n entries.push(\r\n simpleStringEntryFactory({\r\n id: 'label',\r\n path: [ 'label' ],\r\n label: 'Field label',\r\n props\r\n })\r\n );\r\n }\r\n\r\n return entries;\r\n}\r\n","import { get } from 'min-dash';\r\n\r\nimport { useService, useVariables } from '../hooks';\r\n\r\nimport { FeelEntry, isFeelEntryEdited } from '@bpmn-io/properties-panel';\r\n\r\nexport default function SourceEntry(props) {\r\n const {\r\n editField,\r\n field\r\n } = props;\r\n\r\n const {\r\n type\r\n } = field;\r\n\r\n const entries = [];\r\n\r\n if (type === 'image') {\r\n entries.push({\r\n id: 'source',\r\n component: Source,\r\n editField: editField,\r\n field: field,\r\n isEdited: isFeelEntryEdited\r\n });\r\n }\r\n\r\n return entries;\r\n}\r\n\r\nfunction Source(props) {\r\n const {\r\n editField,\r\n field,\r\n id\r\n } = props;\r\n\r\n const debounce = useService('debounce');\r\n\r\n const variables = useVariables().map(name => ({ name }));\r\n\r\n const path = [ 'source' ];\r\n\r\n const getValue = () => {\r\n return get(field, path, '');\r\n };\r\n\r\n const setValue = (value) => {\r\n return editField(field, path, value);\r\n };\r\n\r\n return FeelEntry({\r\n debounce,\r\n description: 'Expression or static value (link/data URI)',\r\n element: field,\r\n feel: 'optional',\r\n getValue,\r\n id,\r\n label: 'Image source',\r\n setValue,\r\n variables\r\n });\r\n}\r\n","import { get } from 'min-dash';\r\n\r\nimport { useService, useVariables } from '../hooks';\r\n\r\nimport { FeelTextAreaEntry, isFeelEntryEdited } from '@bpmn-io/properties-panel';\r\n\r\n\r\nexport default function TextEntry(props) {\r\n const {\r\n editField,\r\n field\r\n } = props;\r\n\r\n const {\r\n type\r\n } = field;\r\n\r\n if (type !== 'text') {\r\n return [];\r\n }\r\n\r\n return [\r\n {\r\n id: 'text',\r\n component: Text,\r\n editField: editField,\r\n field: field,\r\n isEdited: isFeelEntryEdited\r\n }\r\n ];\r\n}\r\n\r\nfunction Text(props) {\r\n const {\r\n editField,\r\n field,\r\n id\r\n } = props;\r\n\r\n const debounce = useService('debounce');\r\n\r\n const variables = useVariables().map(name => ({ name }));\r\n\r\n const path = [ 'text' ];\r\n\r\n const getValue = () => {\r\n return get(field, path, '');\r\n };\r\n\r\n const setValue = (value) => {\r\n return editField(field, path, value);\r\n };\r\n\r\n return FeelTextAreaEntry({\r\n debounce,\r\n description: 'Use an Expression, Markdown or basic HTML to format.',\r\n element: field,\r\n feel: 'optional',\r\n getValue,\r\n id,\r\n label: 'Text',\r\n rows: 10,\r\n setValue,\r\n variables\r\n });\r\n}","import { NumberFieldEntry, isNumberFieldEntryEdited, TextFieldEntry, isTextFieldEntryEdited } from '@bpmn-io/properties-panel';\r\n\r\nimport Big from 'big.js';\r\nimport { get } from 'min-dash';\r\nimport { useService } from '../hooks';\r\nimport { countDecimals, isValidNumber } from '../Util';\r\n\r\nexport default function NumberEntries(props) {\r\n const {\r\n editField,\r\n field,\r\n id\r\n } = props;\r\n\r\n const {\r\n type\r\n } = field;\r\n\r\n if (type !== 'number') {\r\n return [];\r\n }\r\n\r\n const entries = [];\r\n\r\n entries.push({\r\n id: id + '-decimalDigits',\r\n component: NumberDecimalDigits,\r\n isEdited: isNumberFieldEntryEdited,\r\n editField,\r\n field\r\n });\r\n\r\n entries.push({\r\n id: id + '-step',\r\n component: NumberArrowStep,\r\n isEdited: isTextFieldEntryEdited,\r\n editField,\r\n field\r\n });\r\n\r\n return entries;\r\n}\r\n\r\nfunction NumberDecimalDigits(props) {\r\n\r\n const {\r\n editField,\r\n field,\r\n id\r\n } = props;\r\n\r\n const debounce = useService('debounce');\r\n\r\n const getValue = (e) => get(field, [ 'decimalDigits' ]);\r\n\r\n const setValue = (value) => editField(field, [ 'decimalDigits' ], value);\r\n\r\n return NumberFieldEntry({\r\n debounce,\r\n label: 'Decimal digits',\r\n element: field,\r\n min: 0,\r\n step: 1,\r\n getValue,\r\n id,\r\n setValue\r\n });\r\n\r\n}\r\n\r\nfunction NumberArrowStep(props) {\r\n\r\n const {\r\n editField,\r\n field,\r\n id\r\n } = props;\r\n\r\n const {\r\n decimalDigits\r\n } = field;\r\n\r\n const debounce = useService('debounce');\r\n\r\n const getValue = (e) => {\r\n\r\n let value = get(field, [ 'increment' ]);\r\n\r\n if (!isValidNumber(value)) return null;\r\n\r\n return value;\r\n };\r\n\r\n const setValue = (value) => editField(field, [ 'increment' ], value);\r\n\r\n const decimalDigitsSet = decimalDigits || decimalDigits === 0;\r\n\r\n return TextFieldEntry({\r\n debounce,\r\n label: 'Increment',\r\n element: field,\r\n getValue,\r\n id,\r\n setValue,\r\n validate: (value) => {\r\n\r\n if (value === undefined || value === null) return;\r\n\r\n if (!isValidNumber(value)) return 'Should be a valid number.';\r\n\r\n if (Big(value).cmp(0) <= 0) return 'Should be greater than zero.';\r\n\r\n if (decimalDigitsSet) {\r\n const minimumValue = Big(`1e-${decimalDigits}`);\r\n\r\n if (Big(value).cmp(minimumValue) < 0) return `Should be at least ${minimumValue.toString()}.`;\r\n if (countDecimals(value) > decimalDigits) return `Should not contain more than ${decimalDigits} decimal digits.`;\r\n\r\n }\r\n }\r\n });\r\n\r\n}","import { CheckboxEntry, isCheckboxEntryEdited } from '@bpmn-io/properties-panel';\r\n\r\nimport { get } from 'min-dash';\r\n\r\nimport Big from 'big.js';\r\n\r\nexport default function NumberSerializationEntry(props) {\r\n const {\r\n editField,\r\n field\r\n } = props;\r\n\r\n const {\r\n type\r\n } = field;\r\n\r\n if (type !== 'number') {\r\n return [];\r\n }\r\n\r\n const entries = [];\r\n\r\n entries.push({\r\n id: 'serialize-to-string',\r\n component: SerializeToString,\r\n isEdited: isCheckboxEntryEdited,\r\n editField,\r\n field\r\n });\r\n\r\n return entries;\r\n}\r\n\r\nfunction SerializeToString(props) {\r\n const {\r\n editField,\r\n field,\r\n id\r\n } = props;\r\n\r\n const {\r\n defaultValue\r\n } = field;\r\n\r\n const path = [ 'serializeToString' ];\r\n\r\n const getValue = () => {\r\n return get(field, path, '');\r\n };\r\n\r\n const setValue = (value) => {\r\n\r\n // Whenever changing the formatting, make sure to change the default value type along with it\r\n if (defaultValue || defaultValue === 0) {\r\n editField(field, [ 'defaultValue' ], value ? Big(defaultValue).toFixed() : Number(defaultValue));\r\n }\r\n\r\n return editField(field, path, value);\r\n };\r\n\r\n return CheckboxEntry({\r\n element: field,\r\n getValue,\r\n id,\r\n label: 'Serialize to string',\r\n description: 'Allows arbitrary precision values',\r\n setValue\r\n });\r\n}","import { CheckboxEntry, isCheckboxEntryEdited, SelectEntry, isSelectEntryEdited } from '@bpmn-io/properties-panel';\r\n\r\nimport {\r\n DATETIME_SUBTYPES,\r\n DATETIME_SUBTYPES_LABELS,\r\n DATETIME_SUBTYPE_PATH,\r\n DATE_LABEL_PATH,\r\n DATE_DISALLOW_PAST_PATH,\r\n TIME_USE24H_PATH,\r\n TIME_LABEL_PATH,\r\n TIME_INTERVAL_PATH,\r\n TIME_SERIALISING_FORMAT_PATH,\r\n TIME_SERIALISING_FORMATS\r\n} from '@bpmn-io/form-js-viewer';\r\n\r\nimport { get } from 'min-dash';\r\n\r\nexport default function DateTimeEntry(props) {\r\n const {\r\n editField,\r\n field\r\n } = props;\r\n\r\n const {\r\n type,\r\n subtype\r\n } = field;\r\n\r\n if (type !== 'datetime') {\r\n return [];\r\n }\r\n\r\n const entries = [\r\n {\r\n id: 'subtype',\r\n component: DateTimeSubtypeSelect,\r\n isEdited: isSelectEntryEdited,\r\n editField,\r\n field\r\n }\r\n ];\r\n\r\n if (subtype === DATETIME_SUBTYPES.TIME || subtype === DATETIME_SUBTYPES.DATETIME) {\r\n\r\n entries.push({\r\n id: 'use24h',\r\n component: Use24h,\r\n isEdited: isCheckboxEntryEdited,\r\n editField,\r\n field\r\n });\r\n\r\n }\r\n\r\n return entries;\r\n}\r\n\r\nfunction DateTimeSubtypeSelect(props) {\r\n\r\n const {\r\n editField,\r\n field,\r\n id\r\n } = props;\r\n\r\n const getValue = (e) => get(field, DATETIME_SUBTYPE_PATH);\r\n\r\n const clearTimeConfig = () => {\r\n const timeConfigPaths = [ TIME_LABEL_PATH, TIME_USE24H_PATH, TIME_INTERVAL_PATH, TIME_SERIALISING_FORMAT_PATH ];\r\n for (const path of timeConfigPaths) {\r\n editField(field, path, undefined);\r\n }\r\n };\r\n\r\n const initTimeConfig = () => {\r\n editField(field, TIME_LABEL_PATH, 'Time');\r\n editField(field, TIME_SERIALISING_FORMAT_PATH, TIME_SERIALISING_FORMATS.UTC_OFFSET);\r\n editField(field, TIME_INTERVAL_PATH, 15);\r\n };\r\n\r\n const clearDateConfig = () => {\r\n const dateConfigPaths = [ DATE_LABEL_PATH, DATE_DISALLOW_PAST_PATH ];\r\n for (const path of dateConfigPaths) {\r\n editField(field, path, undefined);\r\n }\r\n };\r\n\r\n const initDateConfig = () => {\r\n editField(field, DATE_LABEL_PATH, 'Date');\r\n };\r\n\r\n const setValue = (value) => {\r\n\r\n const oldValue = getValue();\r\n\r\n if (oldValue === value) return;\r\n\r\n if (value === DATETIME_SUBTYPES.DATE) {\r\n clearTimeConfig();\r\n oldValue === DATETIME_SUBTYPES.TIME && initDateConfig();\r\n }\r\n else if (value === DATETIME_SUBTYPES.TIME) {\r\n clearDateConfig();\r\n oldValue === DATETIME_SUBTYPES.DATE && initTimeConfig();\r\n }\r\n else if (value === DATETIME_SUBTYPES.DATETIME) {\r\n oldValue === DATETIME_SUBTYPES.DATE && initTimeConfig();\r\n oldValue === DATETIME_SUBTYPES.TIME && initDateConfig();\r\n }\r\n\r\n return editField(field, DATETIME_SUBTYPE_PATH, value);\r\n };\r\n\r\n const getDatetimeSubtypes = () => {\r\n\r\n return Object.values(DATETIME_SUBTYPES).map((subtype) => ({\r\n label: DATETIME_SUBTYPES_LABELS[subtype],\r\n value: subtype\r\n }));\r\n };\r\n\r\n return SelectEntry({\r\n label: 'Subtype',\r\n element: field,\r\n getOptions: getDatetimeSubtypes,\r\n getValue,\r\n id,\r\n setValue\r\n });\r\n}\r\n\r\nfunction Use24h(props) {\r\n const {\r\n editField,\r\n field,\r\n id\r\n } = props;\r\n\r\n const path = TIME_USE24H_PATH;\r\n\r\n const getValue = () => {\r\n return get(field, path, '');\r\n };\r\n\r\n const setValue = (value) => {\r\n return editField(field, path, value);\r\n };\r\n\r\n return CheckboxEntry({\r\n element: field,\r\n getValue,\r\n id,\r\n label: 'Use 24h',\r\n setValue\r\n });\r\n}\r\n","import { CheckboxEntry, isCheckboxEntryEdited, SelectEntry, isSelectEntryEdited } from '@bpmn-io/properties-panel';\r\n\r\nimport { DATETIME_SUBTYPES, DATE_DISALLOW_PAST_PATH, TIME_INTERVAL_PATH } from '@bpmn-io/form-js-viewer';\r\n\r\nimport { get } from 'min-dash';\r\n\r\nexport default function DateTimeConstraintsEntry(props) {\r\n const {\r\n editField,\r\n field,\r\n id\r\n } = props;\r\n\r\n const {\r\n type,\r\n subtype\r\n } = field;\r\n\r\n if (type !== 'datetime') {\r\n return [];\r\n }\r\n\r\n const entries = [];\r\n\r\n if (subtype === DATETIME_SUBTYPES.TIME || subtype === DATETIME_SUBTYPES.DATETIME) {\r\n entries.push({\r\n id: id + '-timeInterval',\r\n component: TimeIntervalSelect,\r\n isEdited: isSelectEntryEdited,\r\n editField,\r\n field\r\n });\r\n }\r\n\r\n if (subtype === DATETIME_SUBTYPES.DATE || subtype === DATETIME_SUBTYPES.DATETIME) {\r\n entries.push({\r\n id: id + '-disallowPassedDates',\r\n component: DisallowPassedDates,\r\n isEdited: isCheckboxEntryEdited,\r\n editField,\r\n field\r\n });\r\n }\r\n\r\n return entries;\r\n}\r\n\r\nfunction DisallowPassedDates(props) {\r\n const {\r\n editField,\r\n field,\r\n id\r\n } = props;\r\n\r\n const path = DATE_DISALLOW_PAST_PATH;\r\n\r\n const getValue = () => {\r\n return get(field, path, '');\r\n };\r\n\r\n const setValue = (value) => {\r\n return editField(field, path, value);\r\n };\r\n\r\n return CheckboxEntry({\r\n element: field,\r\n getValue,\r\n id,\r\n label: 'Disallow past dates',\r\n setValue\r\n });\r\n}\r\n\r\nfunction TimeIntervalSelect(props) {\r\n\r\n const {\r\n editField,\r\n field,\r\n id\r\n } = props;\r\n\r\n const timeIntervals = [ 1, 5, 10, 15, 30, 60 ];\r\n\r\n const getValue = (e) => get(field, TIME_INTERVAL_PATH);\r\n\r\n const setValue = (value) => editField(field, TIME_INTERVAL_PATH, parseInt(value));\r\n\r\n const getTimeIntervals = () => {\r\n\r\n return timeIntervals.map((timeInterval) => ({\r\n label: timeInterval === 60 ? '1h' : (timeInterval + 'm'),\r\n value: timeInterval\r\n }));\r\n };\r\n\r\n return SelectEntry({\r\n label: 'Time interval',\r\n element: field,\r\n getOptions: getTimeIntervals,\r\n getValue,\r\n id,\r\n setValue\r\n });\r\n}","import { SelectEntry, isSelectEntryEdited } from '@bpmn-io/properties-panel';\r\n\r\nimport { DATETIME_SUBTYPES, TIME_SERIALISING_FORMATS, TIME_SERIALISINGFORMAT_LABELS, TIME_SERIALISING_FORMAT_PATH } from '@bpmn-io/form-js-viewer';\r\n\r\nimport { get } from 'min-dash';\r\n\r\nexport default function DateTimeFormatEntry(props) {\r\n const {\r\n editField,\r\n field\r\n } = props;\r\n\r\n const {\r\n type,\r\n subtype\r\n } = field;\r\n\r\n if (type !== 'datetime') {\r\n return [];\r\n }\r\n\r\n const entries = [];\r\n\r\n if (subtype === DATETIME_SUBTYPES.TIME || subtype === DATETIME_SUBTYPES.DATETIME) {\r\n entries.push({\r\n id: 'time-format',\r\n component: TimeFormatSelect,\r\n isEdited: isSelectEntryEdited,\r\n editField,\r\n field\r\n });\r\n }\r\n\r\n return entries;\r\n}\r\n\r\nfunction TimeFormatSelect(props) {\r\n\r\n const {\r\n editField,\r\n field,\r\n id\r\n } = props;\r\n\r\n const getValue = (e) => get(field, TIME_SERIALISING_FORMAT_PATH);\r\n\r\n const setValue = (value) => editField(field, TIME_SERIALISING_FORMAT_PATH, value);\r\n\r\n const getTimeSerialisingFormats = () => {\r\n\r\n return Object.values(TIME_SERIALISING_FORMATS).map((format) => ({\r\n label: TIME_SERIALISINGFORMAT_LABELS[format],\r\n value: format\r\n }));\r\n };\r\n\r\n return SelectEntry({\r\n label: 'Time format',\r\n element: field,\r\n getOptions: getTimeSerialisingFormats,\r\n getValue,\r\n id,\r\n setValue\r\n });\r\n}","import {\r\n get,\r\n set\r\n} from 'min-dash';\r\n\r\nimport { useService } from '../hooks';\r\n\r\nimport { TextFieldEntry } from '@bpmn-io/properties-panel';\r\n\r\n\r\nexport default function ValueEntry(props) {\r\n const {\r\n editField,\r\n field,\r\n idPrefix,\r\n index,\r\n validateFactory\r\n } = props;\r\n\r\n const entries = [\r\n {\r\n component: Label,\r\n editField,\r\n field,\r\n id: idPrefix + '-label',\r\n idPrefix,\r\n index,\r\n validateFactory\r\n },\r\n {\r\n component: Value,\r\n editField,\r\n field,\r\n id: idPrefix + '-value',\r\n idPrefix,\r\n index,\r\n validateFactory\r\n }\r\n ];\r\n\r\n return entries;\r\n}\r\n\r\nfunction Label(props) {\r\n const {\r\n editField,\r\n field,\r\n id,\r\n index,\r\n validateFactory\r\n } = props;\r\n\r\n const debounce = useService('debounce');\r\n\r\n const setValue = (value) => {\r\n const values = get(field, [ 'values' ]);\r\n return editField(field, 'values', set(values, [ index, 'label' ], value));\r\n };\r\n\r\n const getValue = () => {\r\n return get(field, [ 'values', index, 'label' ]);\r\n };\r\n\r\n return TextFieldEntry({\r\n debounce,\r\n element: field,\r\n getValue,\r\n id,\r\n label: 'Label',\r\n setValue,\r\n validate: validateFactory(getValue())\r\n });\r\n}\r\n\r\nfunction Value(props) {\r\n const {\r\n editField,\r\n field,\r\n id,\r\n index,\r\n validateFactory\r\n } = props;\r\n\r\n const debounce = useService('debounce');\r\n\r\n const setValue = (value) => {\r\n const values = get(field, [ 'values' ]);\r\n return editField(field, 'values', set(values, [ index, 'value' ], value));\r\n };\r\n\r\n const getValue = () => {\r\n return get(field, [ 'values', index, 'value' ]);\r\n };\r\n\r\n return TextFieldEntry({\r\n debounce,\r\n element: field,\r\n getValue,\r\n id,\r\n label: 'Value',\r\n setValue,\r\n validate: validateFactory(getValue())\r\n });\r\n}","import { get } from 'min-dash';\r\n\r\nimport { useService } from '../hooks';\r\n\r\nimport { TextFieldEntry } from '@bpmn-io/properties-panel';\r\n\r\n\r\nexport default function CustomValueEntry(props) {\r\n const {\r\n editField,\r\n field,\r\n idPrefix,\r\n index,\r\n validateFactory\r\n } = props;\r\n\r\n const entries = [\r\n {\r\n component: Key,\r\n editField,\r\n field,\r\n id: idPrefix + '-key',\r\n idPrefix,\r\n index,\r\n validateFactory\r\n },\r\n {\r\n component: Value,\r\n editField,\r\n field,\r\n id: idPrefix + '-value',\r\n idPrefix,\r\n index,\r\n validateFactory\r\n }\r\n ];\r\n\r\n return entries;\r\n}\r\n\r\nfunction Key(props) {\r\n const {\r\n editField,\r\n field,\r\n id,\r\n index,\r\n validateFactory\r\n } = props;\r\n\r\n const debounce = useService('debounce');\r\n\r\n const setValue = (value) => {\r\n const properties = get(field, [ 'properties' ]);\r\n const key = Object.keys(properties)[ index ];\r\n return editField(field, 'properties', updateKey(properties, key, value));\r\n };\r\n\r\n const getValue = () => {\r\n return Object.keys(get(field, [ 'properties' ]))[ index ];\r\n };\r\n\r\n return TextFieldEntry({\r\n debounce,\r\n element: field,\r\n getValue,\r\n id,\r\n label: 'Key',\r\n setValue,\r\n validate: validateFactory(getValue())\r\n });\r\n}\r\n\r\nfunction Value(props) {\r\n const {\r\n editField,\r\n field,\r\n id,\r\n index,\r\n validateFactory\r\n } = props;\r\n\r\n const debounce = useService('debounce');\r\n\r\n const setValue = (value) => {\r\n const properties = get(field, [ 'properties' ]);\r\n const key = Object.keys(properties)[ index ];\r\n editField(field, 'properties', updateValue(properties, key, value));\r\n };\r\n\r\n const getValue = () => {\r\n const properties = get(field, [ 'properties' ]);\r\n const key = Object.keys(properties)[ index ];\r\n return get(field, [ 'properties', key ]);\r\n };\r\n\r\n return TextFieldEntry({\r\n debounce,\r\n element: field,\r\n getValue,\r\n id,\r\n label: 'Value',\r\n setValue,\r\n validate: validateFactory(getValue())\r\n });\r\n}\r\n\r\n\r\n// helpers //////////\r\n\r\n/**\r\n * Returns copy of object with updated value.\r\n *\r\n * @param {Object} properties\r\n * @param {string} key\r\n * @param {string} value\r\n *\r\n * @returns {Object}\r\n */\r\nfunction updateValue(properties, key, value) {\r\n return {\r\n ...properties,\r\n [ key ]: value\r\n };\r\n}\r\n\r\n/**\r\n * Returns copy of object with updated key.\r\n *\r\n * @param {Object} properties\r\n * @param {string} oldKey\r\n * @param {string} newKey\r\n *\r\n * @returns {Object}\r\n */\r\nfunction updateKey(properties, oldKey, newKey) {\r\n return Object.entries(properties).reduce((newProperties, entry) => {\r\n const [ key, value ] = entry;\r\n\r\n return {\r\n ...newProperties,\r\n [ key === oldKey ? newKey : key ]: value\r\n };\r\n }, {});\r\n}","import { SelectEntry, isSelectEntryEdited } from '@bpmn-io/properties-panel';\r\nimport { getValuesSource, VALUES_SOURCES, VALUES_SOURCES_DEFAULTS, VALUES_SOURCES_LABELS, VALUES_SOURCES_PATHS } from '@bpmn-io/form-js-viewer';\r\n\r\nexport default function ValuesSourceSelectEntry(props) {\r\n const {\r\n editField,\r\n field,\r\n id\r\n } = props;\r\n\r\n return [\r\n {\r\n id: id + '-select',\r\n component: ValuesSourceSelect,\r\n isEdited: isSelectEntryEdited,\r\n editField,\r\n field\r\n }\r\n ];\r\n}\r\n\r\nfunction ValuesSourceSelect(props) {\r\n\r\n const {\r\n editField,\r\n field,\r\n id\r\n } = props;\r\n\r\n const getValue = getValuesSource;\r\n\r\n const setValue = (value) => {\r\n\r\n let newField = field;\r\n\r\n const newProperties = {};\r\n\r\n Object.values(VALUES_SOURCES).forEach(source => {\r\n\r\n // Clear all values source definitions and default the newly selected one\r\n const newValue = value === source ? VALUES_SOURCES_DEFAULTS[source] : undefined;\r\n newProperties[VALUES_SOURCES_PATHS[source]] = newValue;\r\n });\r\n\r\n newField = editField(field, newProperties);\r\n return newField;\r\n };\r\n\r\n const getValuesSourceOptions = () => {\r\n\r\n return Object.values(VALUES_SOURCES).map((valueSource) => ({\r\n label: VALUES_SOURCES_LABELS[valueSource],\r\n value: valueSource\r\n }));\r\n };\r\n\r\n return SelectEntry({\r\n label: 'Type',\r\n element: field,\r\n getOptions: getValuesSourceOptions,\r\n getValue,\r\n id,\r\n setValue\r\n });\r\n}\r\n","import { TextFieldEntry, isTextFieldEntryEdited } from '@bpmn-io/properties-panel';\r\nimport { get, isUndefined } from 'min-dash';\r\nimport { useService } from '../hooks';\r\nimport { VALUES_SOURCES, VALUES_SOURCES_PATHS } from '@bpmn-io/form-js-viewer';\r\n\r\n\r\nexport default function InputKeyValuesSourceEntry(props) {\r\n const {\r\n editField,\r\n field,\r\n id\r\n } = props;\r\n\r\n return [\r\n {\r\n id: id + '-key',\r\n component: InputValuesKey,\r\n label: 'Input values key',\r\n description: 'Define which input property to populate the values from',\r\n isEdited: isTextFieldEntryEdited,\r\n editField,\r\n field,\r\n }\r\n ];\r\n}\r\n\r\nfunction InputValuesKey(props) {\r\n const {\r\n editField,\r\n field,\r\n id,\r\n label,\r\n description\r\n } = props;\r\n\r\n const debounce = useService('debounce');\r\n\r\n const path = VALUES_SOURCES_PATHS[VALUES_SOURCES.INPUT];\r\n\r\n const getValue = () => get(field, path, '');\r\n\r\n const setValue = (value) => editField(field, path, value || '');\r\n\r\n const validate = (value) => {\r\n if (isUndefined(value) || !value.length) {\r\n return 'Must not be empty.';\r\n }\r\n\r\n if (/\\s/.test(value)) {\r\n return 'Must not contain spaces.';\r\n }\r\n\r\n return null;\r\n };\r\n\r\n return TextFieldEntry({\r\n debounce,\r\n description,\r\n element: field,\r\n getValue,\r\n id,\r\n label,\r\n setValue,\r\n validate\r\n });\r\n}\r\n","import { isUndefined, without } from 'min-dash';\r\nimport { arrayAdd } from '../Util';\r\nimport ValueEntry from './ValueEntry';\r\nimport { VALUES_SOURCES, VALUES_SOURCES_PATHS } from '@bpmn-io/form-js-viewer';\r\n\r\nexport default function StaticValuesSourceEntry(props) {\r\n const {\r\n editField,\r\n field,\r\n id: idPrefix\r\n } = props;\r\n\r\n const {\r\n values\r\n } = field;\r\n\r\n const addEntry = (e) => {\r\n\r\n e.stopPropagation();\r\n\r\n const index = values.length + 1;\r\n\r\n const entry = getIndexedEntry(index);\r\n\r\n editField(field, VALUES_SOURCES_PATHS[VALUES_SOURCES.STATIC], arrayAdd(values, values.length, entry));\r\n };\r\n\r\n const removeEntry = (entry) => {\r\n editField(field, VALUES_SOURCES_PATHS[VALUES_SOURCES.STATIC], without(values, entry));\r\n };\r\n\r\n const validateFactory = (key) => {\r\n return (value) => {\r\n if (value === key) {\r\n return;\r\n }\r\n\r\n if (isUndefined(value) || !value.length) {\r\n return 'Must not be empty.';\r\n }\r\n\r\n const isValueAssigned = values.find(entry => entry.value === value);\r\n\r\n if (isValueAssigned) {\r\n return 'Must be unique.';\r\n }\r\n };\r\n };\r\n\r\n const items = values.map((entry, index) => {\r\n const id = idPrefix + '-' + index;\r\n\r\n return {\r\n id,\r\n label: entry.label,\r\n entries: ValueEntry({\r\n editField,\r\n field,\r\n idPrefix: id,\r\n index,\r\n validateFactory\r\n }),\r\n autoFocusEntry: id + '-label',\r\n remove: () => removeEntry(entry)\r\n };\r\n });\r\n\r\n return {\r\n items,\r\n add: addEntry,\r\n shouldSort: false\r\n };\r\n}\r\n\r\n\r\n// helper\r\n\r\nfunction getIndexedEntry(index) {\r\n const entry = {\r\n label: 'Value',\r\n value: 'value'\r\n };\r\n\r\n if (index > 1) {\r\n entry.label += ` ${index}`;\r\n entry.value += `${index}`;\r\n }\r\n\r\n return entry;\r\n}","import { TextFieldEntry, isTextFieldEntryEdited } from '@bpmn-io/properties-panel';\r\n\r\nimport { get, set } from 'min-dash';\r\nimport { useService } from '../hooks';\r\n\r\nexport default function AdornerEntry(props) {\r\n const {\r\n editField,\r\n field\r\n } = props;\r\n\r\n const {\r\n type\r\n } = field;\r\n\r\n const entries = [];\r\n\r\n const onChange = (key) => {\r\n return (value) => {\r\n const appearance = get(field, [ 'appearance' ], {});\r\n\r\n editField(field, [ 'appearance' ], set(appearance, [ key ], value));\r\n };\r\n };\r\n\r\n const getValue = (key) => {\r\n return () => {\r\n return get(field, [ 'appearance', key ]);\r\n };\r\n };\r\n\r\n if ([ 'number', 'textfield' ].includes(type)) {\r\n entries.push({\r\n id: 'prefix-adorner',\r\n component: PrefixAdorner,\r\n isEdited: isTextFieldEntryEdited,\r\n editField,\r\n field,\r\n onChange,\r\n getValue\r\n });\r\n\r\n entries.push({\r\n id: 'suffix-adorner',\r\n component: SuffixAdorner,\r\n isEdited: isTextFieldEntryEdited,\r\n editField,\r\n field,\r\n onChange,\r\n getValue\r\n });\r\n }\r\n\r\n return entries;\r\n}\r\n\r\nfunction PrefixAdorner(props) {\r\n const {\r\n field,\r\n id,\r\n onChange,\r\n getValue\r\n } = props;\r\n\r\n const debounce = useService('debounce');\r\n\r\n return TextFieldEntry({\r\n debounce,\r\n element: field,\r\n getValue: getValue('prefixAdorner'),\r\n id,\r\n label: 'Prefix',\r\n setValue: onChange('prefixAdorner')\r\n });\r\n}\r\n\r\nfunction SuffixAdorner(props) {\r\n const {\r\n field,\r\n id,\r\n onChange,\r\n getValue\r\n } = props;\r\n\r\n const debounce = useService('debounce');\r\n\r\n return TextFieldEntry({\r\n debounce,\r\n element: field,\r\n getValue: getValue('suffixAdorner'),\r\n id,\r\n label: 'Suffix',\r\n setValue: onChange('suffixAdorner')\r\n });\r\n}","import { FeelEntry, isFeelEntryEdited } from '@bpmn-io/properties-panel';\r\nimport { get } from 'min-dash';\r\n\r\nimport { useService, useVariables } from '../hooks';\r\n\r\n\r\nexport function ConditionEntry(props) {\r\n const {\r\n editField,\r\n field\r\n } = props;\r\n\r\n return [\r\n {\r\n id: 'conditional-hide',\r\n component: Condition,\r\n editField: editField,\r\n field: field,\r\n isEdited: isFeelEntryEdited\r\n }\r\n ];\r\n}\r\n\r\n\r\nfunction Condition(props) {\r\n const {\r\n editField,\r\n field,\r\n id\r\n } = props;\r\n\r\n const debounce = useService('debounce');\r\n\r\n const variables = useVariables().map(name => ({ name }));\r\n\r\n const path = [ 'conditional', 'hide' ];\r\n\r\n const getValue = () => {\r\n return get(field, path, '');\r\n };\r\n\r\n const setValue = (value) => {\r\n if (!value) {\r\n return editField(field, 'conditional', undefined);\r\n }\r\n\r\n return editField(field, 'conditional', { hide: value });\r\n };\r\n\r\n return FeelEntry({\r\n debounce,\r\n description: 'Condition under which the field is hidden',\r\n element: field,\r\n feel: 'required',\r\n getValue,\r\n id,\r\n label: 'Hide if',\r\n setValue,\r\n variables\r\n });\r\n}\r\n","import {\r\n ActionEntry,\r\n AltTextEntry,\r\n ColumnsEntry,\r\n DescriptionEntry,\r\n DefaultValueEntry,\r\n DisabledEntry,\r\n IdEntry,\r\n ImageSourceEntry,\r\n KeyEntry,\r\n LabelEntry,\r\n TextEntry,\r\n NumberEntries,\r\n DateTimeEntry\r\n} from '../entries';\r\n\r\n\r\nexport default function GeneralGroup(field, editField) {\r\n\r\n const entries = [\r\n ...IdEntry({ field, editField }),\r\n ...LabelEntry({ field, editField }),\r\n ...DescriptionEntry({ field, editField }),\r\n ...KeyEntry({ field, editField }),\r\n ...DefaultValueEntry({ field, editField }),\r\n ...ActionEntry({ field, editField }),\r\n ...ColumnsEntry({ field, editField }),\r\n ...DateTimeEntry({ field, editField }),\r\n ...TextEntry({ field, editField }),\r\n ...NumberEntries({ field, editField }),\r\n ...ImageSourceEntry({ field, editField }),\r\n ...AltTextEntry({ field, editField }),\r\n ...DisabledEntry({ field, editField })\r\n ];\r\n\r\n return {\r\n id: 'general',\r\n label: 'General',\r\n entries\r\n };\r\n}","import {\r\n NumberSerializationEntry,\r\n DateTimeSerializationEntry\r\n} from '../entries';\r\n\r\n\r\nexport default function SerializationGroup(field, editField) {\r\n\r\n const entries = [\r\n ...NumberSerializationEntry({ field, editField }),\r\n ...DateTimeSerializationEntry({ field, editField })\r\n ];\r\n\r\n if (!entries.length) {\r\n return null;\r\n }\r\n\r\n return {\r\n id: 'serialization',\r\n label: 'Serialization',\r\n entries\r\n };\r\n}","import {\r\n DateTimeConstraintsEntry\r\n} from '../entries';\r\n\r\n\r\nexport default function ConstraintsGroup(field, editField) {\r\n\r\n const entries = [\r\n ...DateTimeConstraintsEntry({ field, editField })\r\n ];\r\n\r\n if (!entries.length) {\r\n return null;\r\n }\r\n\r\n return {\r\n id: 'constraints',\r\n label: 'Constraints',\r\n entries\r\n };\r\n}","import {\r\n get,\r\n set\r\n} from 'min-dash';\r\n\r\nimport {\r\n CheckboxEntry,\r\n isCheckboxEntryEdited,\r\n isNumberFieldEntryEdited,\r\n isTextFieldEntryEdited,\r\n NumberFieldEntry,\r\n TextFieldEntry,\r\n SelectEntry\r\n} from '@bpmn-io/properties-panel';\r\n\r\nimport { useService } from '../hooks';\r\n\r\nimport { INPUTS } from '../Util';\r\n\r\nconst VALIDATION_TYPE_OPTIONS = {\r\n custom: {\r\n value: 'custom',\r\n label: 'Custom',\r\n },\r\n email: {\r\n value: 'email',\r\n label: 'Email',\r\n },\r\n phone: {\r\n value: 'phone',\r\n label: 'Phone',\r\n },\r\n};\r\n\r\nexport default function ValidationGroup(field, editField) {\r\n const { type } = field;\r\n const validate = get(field, [ 'validate' ], {});\r\n const isCustomValidation = [ undefined, VALIDATION_TYPE_OPTIONS.custom.value ].includes(validate?.validationType);\r\n\r\n if (!(INPUTS.includes(type) && type !== 'checkbox' && type !== 'checklist' && type !== 'taglist')) {\r\n return null;\r\n }\r\n\r\n const onChange = (key) => {\r\n return (value) => {\r\n const validate = get(field, [ 'validate' ], {});\r\n\r\n editField(field, [ 'validate' ], set(validate, [ key ], value));\r\n };\r\n };\r\n\r\n const getValue = (key) => {\r\n return () => {\r\n return get(field, [ 'validate', key ]);\r\n };\r\n };\r\n\r\n let entries = [\r\n {\r\n id: 'required',\r\n component: Required,\r\n getValue,\r\n field,\r\n isEdited: isCheckboxEntryEdited,\r\n onChange\r\n }\r\n ];\r\n\r\n if (type === 'textfield') {\r\n entries.push(\r\n {\r\n id: 'validationType',\r\n component: ValidationType,\r\n getValue,\r\n field,\r\n isEdited: isTextFieldEntryEdited,\r\n onChange\r\n }\r\n );\r\n }\r\n\r\n if (type === 'textarea' || (type === 'textfield' && isCustomValidation)) {\r\n entries.push(\r\n {\r\n id: 'minLength',\r\n component: MinLength,\r\n getValue,\r\n field,\r\n isEdited: isNumberFieldEntryEdited,\r\n onChange\r\n },\r\n {\r\n id: 'maxLength',\r\n component: MaxLength,\r\n getValue,\r\n field,\r\n isEdited: isNumberFieldEntryEdited,\r\n onChange\r\n }\r\n );\r\n }\r\n\r\n if (type === 'textfield' && isCustomValidation) {\r\n entries.push(\r\n {\r\n id: 'pattern',\r\n component: Pattern,\r\n getValue,\r\n field,\r\n isEdited: isTextFieldEntryEdited,\r\n onChange\r\n }\r\n );\r\n }\r\n\r\n if (type === 'number') {\r\n entries.push(\r\n {\r\n id: 'min',\r\n component: Min,\r\n getValue,\r\n field,\r\n isEdited: isNumberFieldEntryEdited,\r\n onChange\r\n },\r\n {\r\n id: 'max',\r\n component: Max,\r\n getValue,\r\n field,\r\n isEdited: isNumberFieldEntryEdited,\r\n onChange\r\n }\r\n );\r\n }\r\n\r\n return {\r\n id: 'validation',\r\n label: 'Validation',\r\n entries\r\n };\r\n}\r\n\r\nfunction Required(props) {\r\n const {\r\n field,\r\n getValue,\r\n id,\r\n onChange\r\n } = props;\r\n\r\n return CheckboxEntry({\r\n element: field,\r\n getValue: getValue('required'),\r\n id,\r\n label: 'Required',\r\n setValue: onChange('required')\r\n });\r\n}\r\n\r\nfunction MinLength(props) {\r\n const {\r\n field,\r\n getValue,\r\n id,\r\n onChange\r\n } = props;\r\n\r\n const debounce = useService('debounce');\r\n\r\n return NumberFieldEntry({\r\n debounce,\r\n element: field,\r\n getValue: getValue('minLength'),\r\n id,\r\n label: 'Minimum length',\r\n min: 0,\r\n setValue: onChange('minLength')\r\n });\r\n}\r\n\r\nfunction MaxLength(props) {\r\n const {\r\n field,\r\n getValue,\r\n id,\r\n onChange\r\n } = props;\r\n\r\n const debounce = useService('debounce');\r\n\r\n return NumberFieldEntry({\r\n debounce,\r\n element: field,\r\n getValue: getValue('maxLength'),\r\n id,\r\n label: 'Maximum length',\r\n min: 0,\r\n setValue: onChange('maxLength')\r\n });\r\n}\r\n\r\nfunction Pattern(props) {\r\n const {\r\n field,\r\n getValue,\r\n id,\r\n onChange\r\n } = props;\r\n\r\n const debounce = useService('debounce');\r\n\r\n return TextFieldEntry({\r\n debounce,\r\n element: field,\r\n getValue: getValue('pattern'),\r\n id,\r\n label: 'Regular expression pattern',\r\n setValue: onChange('pattern')\r\n });\r\n}\r\n\r\nfunction Min(props) {\r\n const {\r\n field,\r\n getValue,\r\n id,\r\n onChange\r\n } = props;\r\n\r\n const debounce = useService('debounce');\r\n\r\n return NumberFieldEntry({\r\n debounce,\r\n element: field,\r\n getValue: getValue('min'),\r\n id,\r\n label: 'Minimum',\r\n min: 0,\r\n setValue: onChange('min')\r\n });\r\n}\r\n\r\nfunction Max(props) {\r\n const {\r\n field,\r\n getValue,\r\n id,\r\n onChange\r\n } = props;\r\n\r\n const debounce = useService('debounce');\r\n\r\n return NumberFieldEntry({\r\n debounce,\r\n element: field,\r\n getValue: getValue('max'),\r\n id,\r\n label: 'Maximum',\r\n min: 0,\r\n setValue: onChange('max')\r\n });\r\n}\r\n\r\nfunction ValidationType(props) {\r\n const {\r\n field,\r\n getValue,\r\n id,\r\n onChange\r\n } = props;\r\n\r\n const debounce = useService('debounce');\r\n\r\n return SelectEntry({\r\n debounce,\r\n element: field,\r\n getValue: getValue('validationType'),\r\n id,\r\n label: 'Regular expression validation',\r\n setValue: onChange('validationType'),\r\n getOptions() {\r\n return Object.values(VALIDATION_TYPE_OPTIONS);\r\n }\r\n });\r\n}\r\n","import { ValuesSourceSelectEntry, StaticValuesSourceEntry, InputKeyValuesSourceEntry } from '../entries';\r\nimport { getValuesSource, VALUES_SOURCES } from '@bpmn-io/form-js-viewer';\r\n\r\nimport { Group, ListGroup } from '@bpmn-io/properties-panel';\r\n\r\nimport {\r\n VALUES_INPUTS\r\n} from '../Util';\r\n\r\nexport default function ValuesGroups(field, editField) {\r\n const {\r\n type,\r\n id: fieldId\r\n } = field;\r\n\r\n if (!VALUES_INPUTS.includes(type)) {\r\n return [];\r\n }\r\n\r\n const context = { editField, field };\r\n const valuesSourceId = `${fieldId}-valuesSource`;\r\n\r\n /**\r\n * @type {Array<Group|ListGroup>}\r\n */\r\n const groups = [\r\n {\r\n id: valuesSourceId,\r\n label: 'Options source',\r\n component: Group,\r\n entries: ValuesSourceSelectEntry({ ...context, id: valuesSourceId })\r\n }\r\n ];\r\n\r\n const valuesSource = getValuesSource(field);\r\n\r\n if (valuesSource === VALUES_SOURCES.INPUT) {\r\n const dynamicValuesId = `${fieldId}-dynamicValues`;\r\n groups.push({\r\n id: dynamicValuesId,\r\n label: 'Dynamic options',\r\n component: Group,\r\n entries: InputKeyValuesSourceEntry({ ...context, id: dynamicValuesId })\r\n });\r\n }\r\n else if (valuesSource === VALUES_SOURCES.STATIC) {\r\n const staticValuesId = `${fieldId}-staticValues`;\r\n groups.push({\r\n id: staticValuesId,\r\n label: 'Static options',\r\n component: ListGroup,\r\n ...StaticValuesSourceEntry({ ...context, id: staticValuesId })\r\n });\r\n }\r\n\r\n return groups;\r\n}","import { ListGroup } from '@bpmn-io/properties-panel';\r\n\r\nimport {\r\n has,\r\n isUndefined\r\n} from 'min-dash';\r\n\r\nimport { CustomValueEntry } from '../entries';\r\n\r\nexport default function CustomValuesGroup(field, editField) {\r\n const {\r\n properties = {},\r\n type\r\n } = field;\r\n\r\n if (type === 'default') {\r\n return null;\r\n }\r\n\r\n const addEntry = (event) => {\r\n event.stopPropagation();\r\n\r\n const index = Object.keys(properties).length + 1;\r\n\r\n const key = `key${ index }`,\r\n value = 'value';\r\n\r\n editField(field, [ 'properties' ], { ...properties, [ key ]: value });\r\n };\r\n\r\n const validateFactory = (key) => {\r\n return (value) => {\r\n if (value === key) {\r\n return;\r\n }\r\n\r\n if (isUndefined(value) || !value.length) {\r\n return 'Must not be empty.';\r\n }\r\n\r\n if (has(properties, value)) {\r\n return 'Must be unique.';\r\n }\r\n };\r\n };\r\n\r\n const items = Object.keys(properties).map((key, index) => {\r\n const removeEntry = (event) => {\r\n event.stopPropagation();\r\n\r\n return editField(field, [ 'properties' ], removeKey(properties, key));\r\n };\r\n\r\n const id = `${ field.id }-property-${ index }`;\r\n\r\n return {\r\n autoFocusEntry: id + '-key',\r\n entries: CustomValueEntry({\r\n editField,\r\n field,\r\n idPrefix: id,\r\n index,\r\n validateFactory\r\n }),\r\n id,\r\n label: key || '',\r\n remove: removeEntry\r\n };\r\n });\r\n\r\n return {\r\n add: addEntry,\r\n component: ListGroup,\r\n id: 'custom-values',\r\n items,\r\n label: 'Custom properties',\r\n shouldSort: false\r\n };\r\n}\r\n\r\n\r\n// helpers //////////\r\n\r\n/**\r\n * Returns copy of object without key.\r\n *\r\n * @param {Object} properties\r\n * @param {string} oldKey\r\n *\r\n * @returns {Object}\r\n */\r\nexport function removeKey(properties, oldKey) {\r\n return Object.entries(properties).reduce((newProperties, entry) => {\r\n const [ key, value ] = entry;\r\n\r\n if (key === oldKey) {\r\n return newProperties;\r\n }\r\n\r\n return {\r\n ...newProperties,\r\n [ key ]: value\r\n };\r\n }, {});\r\n}","import {\r\n AdornerEntry\r\n} from '../entries';\r\n\r\n\r\nexport default function AppearanceGroup(field, editField) {\r\n\r\n const entries = [\r\n ...AdornerEntry({ field, editField })\r\n ];\r\n\r\n if (!entries.length) {\r\n return null;\r\n }\r\n\r\n return {\r\n id: 'appearance',\r\n label: 'Appearance',\r\n entries\r\n };\r\n}","import {\r\n ConditionEntry\r\n} from '../entries';\r\n\r\n\r\nexport function ConditionGroup(field, editField) {\r\n\r\n const { type } = field;\r\n\r\n if (type === 'default') {\r\n return null;\r\n }\r\n\r\n const entries = [\r\n ...ConditionEntry({ field, editField })\r\n ];\r\n\r\n return {\r\n id: 'condition',\r\n label: 'Condition',\r\n entries\r\n };\r\n}","import { PropertiesPanel } from '@bpmn-io/properties-panel';\r\n\r\nimport {\r\n useCallback,\r\n useState,\r\n useLayoutEffect\r\n} from 'preact/hooks';\r\n\r\nimport { FormPropertiesPanelContext } from './context';\r\n\r\nimport { PropertiesPanelHeaderProvider } from './PropertiesPanelHeaderProvider';\r\nimport { PropertiesPanelPlaceholderProvider } from './PropertiesPanelPlaceholderProvider';\r\n\r\nimport {\r\n ConditionGroup,\r\n AppearanceGroup,\r\n CustomValuesGroup,\r\n GeneralGroup,\r\n SerializationGroup,\r\n ConstraintsGroup,\r\n ValidationGroup,\r\n ValuesGroups\r\n} from './groups';\r\n\r\nfunction getGroups(field, editField) {\r\n\r\n if (!field) {\r\n return [];\r\n }\r\n\r\n const groups = [\r\n GeneralGroup(field, editField),\r\n ConditionGroup(field, editField),\r\n AppearanceGroup(field, editField),\r\n SerializationGroup(field, editField),\r\n ...ValuesGroups(field, editField),\r\n ConstraintsGroup(field, editField),\r\n ValidationGroup(field, editField),\r\n CustomValuesGroup(field, editField)\r\n ];\r\n\r\n // contract: if a group returns null, it should not be displayed at all\r\n return groups.filter(group => group !== null);\r\n}\r\n\r\nexport default function FormPropertiesPanel(props) {\r\n const {\r\n eventBus,\r\n injector\r\n } = props;\r\n\r\n const formEditor = injector.get('formEditor');\r\n const modeling = injector.get('modeling');\r\n const selection = injector.get('selection');\r\n\r\n const { schema } = formEditor._getState();\r\n\r\n const [ state, setState ] = useState({\r\n selectedFormField: selection.get() || schema\r\n });\r\n\r\n const _update = (field) => {\r\n\r\n setState({\r\n ...state,\r\n selectedFormField: field\r\n });\r\n\r\n // notify interested parties on property panel updates\r\n eventBus.fire('propertiesPanel.updated', {\r\n formField: field\r\n });\r\n };\r\n\r\n useLayoutEffect(() => {\r\n function onSelectionChange(event) {\r\n _update(event.selection || schema);\r\n }\r\n\r\n eventBus.on('selection.changed', onSelectionChange);\r\n\r\n return () => {\r\n eventBus.off('selection.changed', onSelectionChange);\r\n };\r\n }, []);\r\n\r\n useLayoutEffect(() => {\r\n const onFieldChanged = () => {\r\n\r\n /**\r\n * TODO(pinussilvestrus): update with actual updated element,\r\n * once we have a proper updater/change support\r\n */\r\n _update(selection.get() || schema);\r\n };\r\n\r\n eventBus.on('changed', onFieldChanged);\r\n\r\n return () => {\r\n eventBus.off('changed', onFieldChanged);\r\n };\r\n }, []);\r\n\r\n const selectedFormField = state.selectedFormField;\r\n\r\n const propertiesPanelContext = {\r\n getService(type, strict = true) {\r\n return injector.get(type, strict);\r\n }\r\n };\r\n\r\n const onFocus = () => eventBus.fire('propertiesPanel.focusin');\r\n\r\n const onBlur = () => eventBus.fire('propertiesPanel.focusout');\r\n\r\n const editField = useCallback((formField, key, value) => modeling.editFormField(formField, key, value), [ modeling ]);\r\n\r\n return (\r\n <div\r\n class=\"fjs-properties-panel\"\r\n data-field={ selectedFormField && selectedFormField.id }\r\n onFocusCapture={ onFocus }\r\n onBlurCapture={ onBlur }\r\n >\r\n <FormPropertiesPanelContext.Provider value={ propertiesPanelContext }>\r\n <PropertiesPanel\r\n element={ selectedFormField }\r\n eventBus={ eventBus }\r\n groups={ getGroups(selectedFormField, editField) }\r\n headerProvider={ PropertiesPanelHeaderProvider }\r\n placeholderProvider={ PropertiesPanelPlaceholderProvider }\r\n />\r\n </FormPropertiesPanelContext.Provider>\r\n </div>\r\n );\r\n}","import PropertiesPanel from './PropertiesPanel';\r\n\r\nimport {\r\n render\r\n} from 'preact';\r\n\r\nimport {\r\n domify,\r\n query as domQuery\r\n} from 'min-dom';\r\n\r\n/**\r\n * @typedef { { parent: Element } } PropertiesPanelConfig\r\n * @typedef { import('../../core/EventBus').default } EventBus\r\n * @typedef { import('../../types').Injector } Injector\r\n */\r\n\r\n/**\r\n * @param {PropertiesPanelConfig} propertiesPanelConfig\r\n * @param {Injector} injector\r\n * @param {EventBus} eventBus\r\n */\r\nexport default class PropertiesPanelRenderer {\r\n\r\n constructor(propertiesPanelConfig, injector, eventBus) {\r\n const {\r\n parent\r\n } = propertiesPanelConfig || {};\r\n\r\n this._eventBus = eventBus;\r\n this._injector = injector;\r\n\r\n this._container = domify('<div class=\"fjs-properties-container\" input-handle-modified-keys=\"y,z\"></div>');\r\n\r\n if (parent) {\r\n this.attachTo(parent);\r\n }\r\n\r\n this._eventBus.once('formEditor.rendered', 500, () => {\r\n this._render();\r\n });\r\n }\r\n\r\n\r\n /**\r\n * Attach the properties panel to a parent node.\r\n *\r\n * @param {HTMLElement} container\r\n */\r\n attachTo(container) {\r\n if (!container) {\r\n throw new Error('container required');\r\n }\r\n\r\n if (typeof container === 'string') {\r\n container = domQuery(container);\r\n }\r\n\r\n // (1) detach from old parent\r\n this.detach();\r\n\r\n // (2) append to parent container\r\n container.appendChild(this._container);\r\n\r\n // (3) notify interested parties\r\n this._eventBus.fire('propertiesPanel.attach');\r\n }\r\n\r\n /**\r\n * Detach the properties panel from its parent node.\r\n */\r\n detach() {\r\n const parentNode = this._container.parentNode;\r\n\r\n if (parentNode) {\r\n parentNode.removeChild(this._container);\r\n\r\n this._eventBus.fire('propertiesPanel.detach');\r\n }\r\n }\r\n\r\n _render() {\r\n render(\r\n <PropertiesPanel\r\n eventBus={ this._eventBus }\r\n injector={ this._injector }\r\n />,\r\n this._container\r\n );\r\n\r\n this._eventBus.fire('propertiesPanel.rendered');\r\n }\r\n\r\n _destroy() {\r\n if (this._container) {\r\n render(null, this._container);\r\n\r\n this._eventBus.fire('propertiesPanel.destroyed');\r\n }\r\n }\r\n}\r\n\r\nPropertiesPanelRenderer.$inject = [ 'config.propertiesPanel', 'injector', 'eventBus' ];","import PropertiesPanelRenderer from './PropertiesPanelRenderer';\r\n\r\nexport default {\r\n __init__: [ 'propertiesPanel' ],\r\n propertiesPanel: [ 'type', PropertiesPanelRenderer ]\r\n};","import { clone, createFormContainer, createInjector, schemaVersion } from '@bpmn-io/form-js-viewer';\r\nimport Ids from 'ids';\r\nimport { isString, set } from 'min-dash';\r\n\r\nimport core from './core';\r\n\r\nimport EditorActionsModule from './features/editor-actions';\r\nimport KeyboardModule from './features/keyboard';\r\nimport ModelingModule from './features/modeling';\r\nimport SelectionModule from './features/selection';\r\nimport PaletteModule from './features/palette';\r\nimport PropertiesPanelModule from './features/properties-panel';\r\n\r\nconst ids = new Ids([ 32, 36, 1 ]);\r\n\r\n/**\r\n * @typedef { import('./types').Injector } Injector\r\n * @typedef { import('./types').Module } Module\r\n * @typedef { import('./types').Schema } Schema\r\n *\r\n * @typedef { import('./types').FormEditorOptions } FormEditorOptions\r\n * @typedef { import('./types').FormEditorProperties } FormEditorProperties\r\n *\r\n * @typedef { {\r\n * properties: FormEditorProperties,\r\n * schema: Schema\r\n * } } State\r\n *\r\n * @typedef { (type:string, priority:number, handler:Function) => void } OnEventWithPriority\r\n * @typedef { (type:string, handler:Function) => void } OnEventWithOutPriority\r\n * @typedef { OnEventWithPriority & OnEventWithOutPriority } OnEventType\r\n */\r\n\r\n/**\r\n * The form editor.\r\n */\r\nexport default class FormEditor {\r\n\r\n /**\r\n * @constructor\r\n * @param {FormEditorOptions} options\r\n */\r\n constructor(options = {}) {\r\n\r\n /**\r\n * @public\r\n * @type {OnEventType}\r\n */\r\n this.on = this._onEvent;\r\n\r\n /**\r\n * @public\r\n * @type {String}\r\n */\r\n this._id = ids.next();\r\n\r\n /**\r\n * @private\r\n * @type {Element}\r\n */\r\n this._container = createFormContainer();\r\n\r\n this._container.setAttribute('input-handle-modified-keys', 'z,y');\r\n\r\n const {\r\n container,\r\n exporter,\r\n injector = this._createInjector(options, this._container),\r\n properties = {}\r\n } = options;\r\n\r\n /**\r\n * @private\r\n * @type {any}\r\n */\r\n this.exporter = exporter;\r\n\r\n /**\r\n * @private\r\n * @type {State}\r\n */\r\n this._state = {\r\n properties,\r\n schema: null\r\n };\r\n\r\n this.get = injector.get;\r\n\r\n this.invoke = injector.invoke;\r\n\r\n this.get('eventBus').fire('form.init');\r\n\r\n if (container) {\r\n this.attachTo(container);\r\n }\r\n }\r\n\r\n clear() {\r\n\r\n // clear form services\r\n this._emit('diagram.clear');\r\n\r\n // clear diagram services (e.g. EventBus)\r\n this._emit('form.clear');\r\n }\r\n\r\n destroy() {\r\n\r\n // destroy form services\r\n this.get('eventBus').fire('form.destroy');\r\n\r\n // destroy diagram services (e.g. EventBus)\r\n this.get('eventBus').fire('diagram.destroy');\r\n\r\n this._detach(false);\r\n }\r\n\r\n /**\r\n * @param {Schema} schema\r\n *\r\n * @return {Promise<{ warnings: Array<any> }>}\r\n */\r\n importSchema(schema) {\r\n return new Promise((resolve, reject) => {\r\n try {\r\n this.clear();\r\n\r\n const {\r\n schema: importedSchema,\r\n warnings\r\n } = this.get('importer').importSchema(schema);\r\n\r\n this._setState({\r\n schema: importedSchema\r\n });\r\n\r\n this._emit('import.done', { warnings });\r\n\r\n return resolve({ warnings });\r\n } catch (error) {\r\n this._emit('import.done', {\r\n error: error,\r\n warnings: error.warnings || []\r\n });\r\n\r\n return reject(error);\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * @returns {Schema}\r\n */\r\n saveSchema() {\r\n return this.getSchema();\r\n }\r\n\r\n /**\r\n * @returns {Schema}\r\n */\r\n getSchema() {\r\n const { schema } = this._getState();\r\n\r\n return exportSchema(\r\n schema,\r\n this.exporter,\r\n schemaVersion\r\n );\r\n }\r\n\r\n /**\r\n * @param {Element|string} parentNode\r\n */\r\n attachTo(parentNode) {\r\n if (!parentNode) {\r\n throw new Error('parentNode required');\r\n }\r\n\r\n this.detach();\r\n\r\n if (isString(parentNode)) {\r\n parentNode = document.querySelector(parentNode);\r\n }\r\n\r\n const container = this._container;\r\n\r\n parentNode.appendChild(container);\r\n\r\n this._emit('attach');\r\n }\r\n\r\n detach() {\r\n this._detach();\r\n }\r\n\r\n /**\r\n * @internal\r\n *\r\n * @param {boolean} [emit]\r\n */\r\n _detach(emit = true) {\r\n const container = this._container,\r\n parentNode = container.parentNode;\r\n\r\n if (!parentNode) {\r\n return;\r\n }\r\n\r\n if (emit) {\r\n this._emit('detach');\r\n }\r\n\r\n parentNode.removeChild(container);\r\n }\r\n\r\n /**\r\n * @param {any} property\r\n * @param {any} value\r\n */\r\n setProperty(property, value) {\r\n const properties = set(this._getState().properties, [ property ], value);\r\n\r\n this._setState({ properties });\r\n }\r\n\r\n\r\n /**\r\n * @param {string} type\r\n * @param {Function} handler\r\n */\r\n off(type, handler) {\r\n this.get('eventBus').off(type, handler);\r\n }\r\n\r\n /**\r\n * @internal\r\n *\r\n * @param {FormEditorOptions} options\r\n * @param {Element} container\r\n *\r\n * @returns {Injector}\r\n */\r\n _createInjector(options, container) {\r\n const {\r\n additionalModules = [],\r\n modules = this._getModules(),\r\n renderer = {}\r\n } = options;\r\n\r\n const config = {\r\n ...options,\r\n renderer: {\r\n ...renderer,\r\n container\r\n }\r\n };\r\n\r\n return createInjector([\r\n { config: [ 'value', config ] },\r\n { formEditor: [ 'value', this ] },\r\n core,\r\n ...modules,\r\n ...additionalModules\r\n ]);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n _emit(type, data) {\r\n this.get('eventBus').fire(type, data);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n _getState() {\r\n return this._state;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n _setState(state) {\r\n this._state = {\r\n ...this._state,\r\n ...state\r\n };\r\n\r\n this._emit('changed', this._getState());\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n _getModules() {\r\n return [\r\n ModelingModule,\r\n EditorActionsModule,\r\n KeyboardModule,\r\n SelectionModule,\r\n PaletteModule,\r\n PropertiesPanelModule\r\n ];\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n _onEvent(type, priority, handler) {\r\n this.get('eventBus').on(type, priority, handler);\r\n }\r\n\r\n}\r\n\r\n// helpers //////////\r\n\r\nexport function exportSchema(schema, exporter, schemaVersion) {\r\n\r\n const exportDetails = exporter ? {\r\n exporter\r\n } : {};\r\n\r\n const cleanedSchema = clone(schema, (name, value) => {\r\n if ([ '_parent', '_path' ].includes(name)) {\r\n return undefined;\r\n }\r\n\r\n return value;\r\n });\r\n\r\n return {\r\n ...cleanedSchema,\r\n ...exportDetails,\r\n schemaVersion\r\n };\r\n}","import FormEditor from './FormEditor';\r\n\r\nimport { schemaVersion } from '@bpmn-io/form-js-viewer';\r\n\r\nexport {\r\n FormEditor,\r\n schemaVersion\r\n};\r\n\r\n/**\r\n * @typedef { import('./types').CreateFormEditorOptions } CreateFormEditorOptions\r\n */\r\n\r\n/**\r\n * Create a form editor.\r\n *\r\n * @param {CreateFormEditorOptions} options\r\n *\r\n * @return {Promise<FormEditor>}\r\n */\r\nexport function createFormEditor(options) {\r\n const {\r\n schema,\r\n ...rest\r\n } = options;\r\n\r\n const formEditor = new FormEditor(rest);\r\n\r\n return formEditor.importSchema(schema).then(() => {\r\n return formEditor;\r\n });\r\n}"],"names":["FN_REF","DEFAULT_PRIORITY","slice","Array","prototype","EventBus","_listeners","on","_destroy","events","priority","callback","that","isArray","isFunction","isNumber","Error","actualCallback","bind","self","forEach","e","_addListener","next","once","event","wrappedCallback","__isTomb","result","apply","arguments","off","_removeListener","createEvent","data","InternalEvent","init","fire","type","firstListener","returnValue","args","call","originalType","_invokeListeners","undefined","defaultPrevented","handleError","error","listener","cancelBubble","_invokeListener","invokeFunction","stopPropagation","preventDefault","console","newListener","_getListeners","previousListener","_setListeners","name","nextListener","listenerCallback","assign","fn","DebounceFactory","config","timeout","debounce","$inject","FieldFactory","constructor","formFieldRegistry","formFields","_formFieldRegistry","_formFields","create","attrs","applyDefaults","id","key","fieldDefinition","get","_ids","assigned","_keys","labelAttrs","label","field","_ensureId","keyed","_ensureKey","claim","prefix","nextPrefixed","FormFieldRegistry","BaseFieldRegistry","updateId","formField","newId","_validateId","_eventBus","remove","add","component","components","_parent","Importer","fieldFactory","_fieldFactory","importSchema","schema","warnings","importedSchema","importFormField","clone","err","fieldAttrs","parentId","index","parent","path","_path","importFormFields","map","importer","DragAndDropContext","createContext","drake","getService","strict","FormEditorContext","useContext","React","ContextPad","props","children","_jsx","Empty","Element","eventBus","useService","formEditor","modeling","selection","ref","useRef","scrollIntoView","current","elementBounds","getBoundingClientRect","containerBounds","_container","top","bottom","useEffect","onClick","toggle","classes","class","push","split","isSelected","onRemove","parentField","getFormFieldIndex","removeFormField","_jsxs","join","Children","FormEditor","injector","palette","paletteConfig","propertiesPanel","propertiesPanelConfig","_getState","paletteRef","propertiesPanelRef","setSelection","useState","handleSelectionChanged","setDrake","dragAndDropContext","createDragulaInstance","dragulaInstance","dragula","isContainer","el","classList","contains","copy","accepts","target","slideFactorX","slideFactorY","source","sibling","targetFormField","dataset","siblingFormField","targetIndex","length","fieldType","addFormField","sourceFormField","sourceIndex","moveFormField","onDetach","destroy","onAttach","formRenderContext","formContext","Map","errors","properties","readOnly","formId","_id","onSubmit","useCallback","onReset","hasDefaultPalette","defaultPalette","attachTo","hasDefaultPropertiesPanel","defaultPropertiesPanel","FormContext","FormRenderContext","FormComponent","fieldFormIndex","CreatePreview","handleCloned","original","Icon","iconsByType","innerHTML","render","Renderer","renderConfig","container","compact","App","state","setState","formEditorContext","newState","__init__","FormFields","renderer","__depends__","importModule","renderModule","NOT_REGISTERED_ERROR","IS_REGISTERED_ERROR","EditorActions","_actions","_registerDefaultActions","editorActions","commandStack","zoomScroll","copyPaste","canvas","rules","keyboardMove","keyboardMoveSelection","register","undo","redo","selectedElements","paste","opts","stepZoom","value","zoom","allowed","elements","removableElements","removeElements","moveCanvas","moveSelection","direction","accelerated","trigger","action","actions","_registerAction","isRegistered","unregister","getActions","Object","keys","message","FormEditorActions","options","set","EditorActionsModule","KEYS_COPY","KEYS_PASTE","KEYS_REDO","KEYS_UNDO","hasModifier","ctrlKey","metaKey","shiftKey","altKey","isCmd","isKey","indexOf","code","isShift","isCopy","isPaste","isUndo","isRedo","KEYDOWN_EVENT","KEYUP_EVENT","HANDLE_MODIFIER_ATTRIBUTE","Keyboard","_config","_keydownHandler","_keyupHandler","_fire","unbind","bindTo","_keyHandler","eventBusResult","_isEventIgnored","context","keyEvent","isInput","_isModifiedKeyIgnored","allowedModifiers","_getAllowedModifiers","element","modifierContainer","domClosest","_node","getAttribute","node","domEvent","getBinding","addListener","removeListener","domMatches","contentEditable","LOW_PRIORITY","KeyboardBindings","keyboard","registerBindings","keyboardBindings","FormEditorKeyboardBindings","KeyboardModule","arrayAdd","array","item","splice","arrayRemove","updatePath","AddFormFieldHandler","_formEditor","execute","targetPath","_setState","revert","EditFormFieldHandler","oldProperties","property","MoveFormFieldHandler","sourcePath","arrayMove","RemoveFormFieldHandler","UpdateIdClaimHandler","claiming","unclaim","UpdateKeyClaimHandler","Modeling","_commandStack","registerHandlers","entries","getHandlers","handler","registerHandler","editFormField","isObject","claimId","unclaimId","claimKey","unclaimKey","CommandInterceptor","unwrapEvent","command","hook","handlerFn","unwrap","fullEvent","filter","hooks","IdBehavior","preExecute","KeyBehavior","idBehavior","keyBehavior","CommandStack","_handlerMap","_stack","_stackIdx","_currentExecution","dirty","_injector","_uid","clear","_pushAction","_internalExecute","_popAction","canExecute","_getHandler","emit","_getUndoAction","_internalUndo","_getRedoAction","_setHandler","handlerCls","instantiate","canUndo","canRedo","_atomicDo","_markDirty","_revertedAction","qualifier","names","_createId","execution","atomic","_executedAction","postExecute","baseAction","pop","uniqueBy","reverse","concat","stackIdx","behaviorModule","commandModule","Selection","_selection","newSelection","SelectionBehavior","selectionBehavior","types","Palette","PaletteRenderer","domify","_render","domQuery","detach","appendChild","parentNode","removeChild","Header","headerProvider","getElementIcon","getDocumentationRef","getElementLabel","getTypeLabel","documentationRef","ElementIcon","width","height","viewBox","title","rel","href","ExternalLinkIcon","PropertiesPanelContext","countDecimals","number","num","Big","toString","toFixed","isValidNumber","isNaN","Number","textToLabel","text","line","displayLine","trim","INPUTS","VALUES_INPUTS","labelsByType","button","checkbox","checklist","columns","default","datetime","image","radio","select","taglist","textfield","textarea","PropertiesPanelHeaderProvider","alt","PropertiesPanelPlaceholderProvider","getEmpty","getMultiple","ActionEntry","editField","Action","isEdited","isSelectEntryEdited","getValue","setValue","getOptions","SelectEntry","FormPropertiesPanelContext","useVariables","form","getSchema","getSchemaVariables","AltTextEntry","AltText","isFeelEntryEdited","variables","FeelEntry","feel","ColumnsEntry","Columns","isNumberFieldEntryEdited","Default","NumberFieldEntry","DescriptionEntry","includes","Description","isTextFieldEntryEdited","TextFieldEntry","DefaultOptionEntry","values","defaultOptions","DefaultValueCheckbox","DefaultValueNumber","DefaultValueSingleSelect","DefaultValueTextfield","DefaultValueTextarea","isTextAreaEntryEdited","defaultValue","parseStringToBoolean","parseBooleanToString","decimalDigits","serializeToString","newValue","decimalDigitsSet","validate","TextAreaEntry","DisabledEntry","Disabled","isCheckboxEntryEdited","CheckboxEntry","IdEntry","Id","isUndefined","validateId","SPACE_REGEX","QNAME_REGEX","ID_REGEX","idValue","containsSpace","test","KeyEntry","Key","description","simpleStringEntryFactory","SimpleStringComponent","LabelEntry","subtype","DATETIME_SUBTYPES","DATE","DATETIME","DATE_LABEL_PATH","TIME","TIME_LABEL_PATH","SourceEntry","Source","TextEntry","Text","FeelTextAreaEntry","rows","NumberEntries","NumberDecimalDigits","NumberArrowStep","min","step","cmp","minimumValue","NumberSerializationEntry","SerializeToString","DateTimeEntry","DateTimeSubtypeSelect","Use24h","DATETIME_SUBTYPE_PATH","clearTimeConfig","timeConfigPaths","TIME_USE24H_PATH","TIME_INTERVAL_PATH","TIME_SERIALISING_FORMAT_PATH","initTimeConfig","TIME_SERIALISING_FORMATS","UTC_OFFSET","clearDateConfig","dateConfigPaths","DATE_DISALLOW_PAST_PATH","initDateConfig","oldValue","getDatetimeSubtypes","DATETIME_SUBTYPES_LABELS","DateTimeConstraintsEntry","TimeIntervalSelect","DisallowPassedDates","timeIntervals","parseInt","getTimeIntervals","timeInterval","DateTimeFormatEntry","TimeFormatSelect","getTimeSerialisingFormats","format","TIME_SERIALISINGFORMAT_LABELS","ValueEntry","idPrefix","validateFactory","Label","Value","CustomValueEntry","updateKey","updateValue","oldKey","newKey","reduce","newProperties","entry","ValuesSourceSelectEntry","ValuesSourceSelect","getValuesSource","newField","VALUES_SOURCES","VALUES_SOURCES_DEFAULTS","VALUES_SOURCES_PATHS","getValuesSourceOptions","valueSource","VALUES_SOURCES_LABELS","InputKeyValuesSourceEntry","InputValuesKey","INPUT","StaticValuesSourceEntry","addEntry","getIndexedEntry","STATIC","removeEntry","without","isValueAssigned","find","items","autoFocusEntry","shouldSort","AdornerEntry","onChange","appearance","PrefixAdorner","SuffixAdorner","ConditionEntry","Condition","hide","GeneralGroup","DefaultValueEntry","ImageSourceEntry","SerializationGroup","DateTimeSerializationEntry","ConstraintsGroup","VALIDATION_TYPE_OPTIONS","custom","email","phone","ValidationGroup","isCustomValidation","validationType","Required","ValidationType","MinLength","MaxLength","Pattern","Min","Max","ValuesGroups","fieldId","valuesSourceId","groups","Group","valuesSource","dynamicValuesId","staticValuesId","ListGroup","CustomValuesGroup","has","removeKey","AppearanceGroup","ConditionGroup","getGroups","group","FormPropertiesPanel","selectedFormField","_update","useLayoutEffect","onSelectionChange","onFieldChanged","propertiesPanelContext","onFocus","onBlur","PropertiesPanelRenderer","PropertiesPanel","ids","Ids","_onEvent","createFormContainer","setAttribute","exporter","_createInjector","_state","invoke","_emit","_detach","Promise","resolve","reject","saveSchema","exportSchema","schemaVersion","isString","document","querySelector","setProperty","additionalModules","modules","_getModules","createInjector","core","ModelingModule","SelectionModule","PaletteModule","PropertiesPanelModule","exportDetails","cleanedSchema","createFormEditor","rest","then"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,IAAIA,MAAM,GAAG,MAAM;AAEnB,IAAIC,kBAAgB,GAAG,IAAI;AAE3B,IAAIC,KAAK,GAAGC,KAAK,CAACC,SAAS,CAACF,KAAK;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASG,QAAQ,GAAG;EACjC,IAAI,CAACC,UAAU,GAAG,EAAE;;;;EAIpB,IAAI,CAACC,EAAE,CAAC,iBAAiB,EAAE,CAAC,EAAE,IAAI,CAACC,QAAQ,EAAE,IAAI,CAAC;AACpD;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACAH,QAAQ,CAACD,SAAS,CAACG,EAAE,GAAG,UAASE,MAAM,EAAEC,QAAQ,EAAEC,QAAQ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AAM;QACJtO,SAAS;QACTqH;OACD,GAAGiH,OAAO;MAEX,IAAI,KAAK,IAAIjH,UAAU,EAAE;QACvBxE,QAAQ,CAACqP,UAAU,CAAClS,SAAS,EAAEA,SAAS,CAAClB,GAAG,CAAC;QAE7C+D,QAAQ,CAACoP,QAAQ,CAACjS,SAAS,EAAEqH,UAAU,CAACvI,GAAG,CAAC;;KAE/C,EAAE,IAAI,CAAC;;AAEZ;AAEAgU,WAAW,CAAC3U,OAAO,GAAG,CAAE,UAAU,EAAE,UAAU,CAAE;;AC9BhD,qBAAe;EACbkL,QAAQ,EAAE,CACR,YAAY,EACZ,aAAa,CACd;EACD0J,UAAU,EAAE,CAAE,MAAM,EAAEH,UAAU,CAAE;EAClCI,WAAW,EAAE,CAAE,MAAM,EAAEF,WAAW;AACpC,CAAC;;ACJD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASG,YAAY,CAACvQ,QAAQ,EAAE+B,QAAQ,EAAE;;AAGzD;AACA;AACA;AACA;EACE,IAAI,CAACyO,WAAW,GAAG,EAAE;;;AAGvB;AACA;AACA;AACA;EACE,IAAI,CAACC,MAAM,GAAG,EAAE;;;AAGlB;AACA;AACA;AACA;EACE,IAAI,CAACC,SAAS,GAAG,CAAC,CAAC;;;AAGrB;AACA;AACA;AACA;AACA;AACA;AACA;EACE,IAAI,CAACC,iBAAiB,GAAG;IACvB1H,OAAO,EAAE,EAAE;IACX2H,KAAK,EAAE,EAA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