@bpmn-io/form-js-editor 1.8.0 → 1.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -147,6 +147,8 @@ var slice = Array.prototype.slice;
147
147
  * var sum = eventBus.fire('sum', 1, 2);
148
148
  * console.log(sum); // 3
149
149
  * ```
150
+ *
151
+ * @template [EventMap=null]
150
152
  */
151
153
  function EventBus() {
152
154
  /**
@@ -160,6 +162,8 @@ function EventBus() {
160
162
  }
161
163
 
162
164
  /**
165
+ * @overlord
166
+ *
163
167
  * Register an event listener for events with the given name.
164
168
  *
165
169
  * The callback will be invoked with `event, ...additionalArguments`
@@ -178,6 +182,25 @@ function EventBus() {
178
182
  * @param {EventBusEventCallback<T>} callback
179
183
  * @param {any} [that] callback context
180
184
  */
185
+ /**
186
+ * Register an event listener for events with the given name.
187
+ *
188
+ * The callback will be invoked with `event, ...additionalArguments`
189
+ * that have been passed to {@link EventBus#fire}.
190
+ *
191
+ * Returning false from a listener will prevent the events default action
192
+ * (if any is specified). To stop an event from being processed further in
193
+ * other listeners execute {@link Event#stopPropagation}.
194
+ *
195
+ * Returning anything but `undefined` from a listener will stop the listener propagation.
196
+ *
197
+ * @template {keyof EventMap} EventName
198
+ *
199
+ * @param {EventName} events to subscribe to
200
+ * @param {number} [priority=1000] listen priority
201
+ * @param {EventBusEventCallback<EventMap[EventName]>} callback
202
+ * @param {any} [that] callback context
203
+ */
181
204
  EventBus.prototype.on = function (events, priority, callback, that) {
182
205
  events = minDash.isArray(events) ? events : [events];
183
206
  if (minDash.isFunction(priority)) {
@@ -208,6 +231,8 @@ EventBus.prototype.on = function (events, priority, callback, that) {
208
231
  };
209
232
 
210
233
  /**
234
+ * @overlord
235
+ *
211
236
  * Register an event listener that is called only once.
212
237
  *
213
238
  * @template T
@@ -217,6 +242,16 @@ EventBus.prototype.on = function (events, priority, callback, that) {
217
242
  * @param {EventBusEventCallback<T>} callback
218
243
  * @param {any} [that] callback context
219
244
  */
245
+ /**
246
+ * Register an event listener that is called only once.
247
+ *
248
+ * @template {keyof EventMap} EventName
249
+ *
250
+ * @param {EventName} events to subscribe to
251
+ * @param {number} [priority=1000] listen priority
252
+ * @param {EventBusEventCallback<EventMap[EventName]>} callback
253
+ * @param {any} [that] callback context
254
+ */
220
255
  EventBus.prototype.once = function (events, priority, callback, that) {
221
256
  var self = this;
222
257
  if (minDash.isFunction(priority)) {
@@ -2888,9 +2923,9 @@ EditorActions.prototype.unregister = function (action) {
2888
2923
  };
2889
2924
 
2890
2925
  /**
2891
- * Returns the number of actions that are currently registered
2926
+ * Returns the identifiers of all currently registered editor actions
2892
2927
  *
2893
- * @return {number}
2928
+ * @return {string[]}
2894
2929
  */
2895
2930
  EditorActions.prototype.getActions = function () {
2896
2931
  return Object.keys(this._actions);
@@ -3143,7 +3178,7 @@ Keyboard.prototype._isEventIgnored = function (event) {
3143
3178
  if (event.defaultPrevented) {
3144
3179
  return true;
3145
3180
  }
3146
- return isInput(event.target) && this._isModifiedKeyIgnored(event);
3181
+ return (isInput(event.target) || isButton(event.target) && isKey([' ', 'Enter'], event)) && this._isModifiedKeyIgnored(event);
3147
3182
  };
3148
3183
  Keyboard.prototype._isModifiedKeyIgnored = function (event) {
3149
3184
  if (!isCmd(event)) {
@@ -3240,6 +3275,9 @@ Keyboard.prototype.isKey = isKey;
3240
3275
  function isInput(target) {
3241
3276
  return target && (minDom.matches(target, 'input, textarea') || target.contentEditable === 'true');
3242
3277
  }
3278
+ function isButton(target) {
3279
+ return target && minDom.matches(target, 'button, input[type=submit], input[type=button], a[href], [aria-role=button]');
3280
+ }
3243
3281
 
3244
3282
  var LOW_PRIORITY$1 = 500;
3245
3283