@bpmn-io/form-js-editor 0.7.0 → 0.7.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.es.js CHANGED
@@ -1,7 +1,7 @@
1
- import Ids from 'ids';
2
- import { isArray, isFunction, isNumber, bind, assign, debounce, get, isUndefined, set, has, forEach, isObject, uniqueBy, isString } from 'min-dash';
3
1
  import { FormFieldRegistry as FormFieldRegistry$1, clone, Default, FormContext, FormRenderContext, FormComponent, FormFields, createFormContainer, createInjector, schemaVersion } from '@bpmn-io/form-js-viewer';
4
2
  export { schemaVersion } from '@bpmn-io/form-js-viewer';
3
+ import Ids from 'ids';
4
+ import { isArray, isFunction, isNumber, bind, assign, debounce, get, isUndefined, set, has, forEach, isObject, uniqueBy, isString } from 'min-dash';
5
5
  import { createContext, render } from 'preact';
6
6
  import { useContext, useRef, useEffect, useMemo, useState, useCallback } from 'preact/hooks';
7
7
  import React from 'preact/compat';
@@ -4656,6 +4656,10 @@ const ids = new Ids([32, 36, 1]);
4656
4656
  * properties: FormEditorProperties,
4657
4657
  * schema: Schema
4658
4658
  * } } State
4659
+ *
4660
+ * @typedef { (type:string, priority:number, handler:Function) => void } OnEventWithPriority
4661
+ * @typedef { (type:string, handler:Function) => void } OnEventWithOutPriority
4662
+ * @typedef { OnEventWithPriority & OnEventWithOutPriority } OnEventType
4659
4663
  */
4660
4664
 
4661
4665
  /**
@@ -4668,10 +4672,16 @@ class FormEditor {
4668
4672
  * @param {FormEditorOptions} options
4669
4673
  */
4670
4674
  constructor(options = {}) {
4675
+ /**
4676
+ * @public
4677
+ * @type {OnEventType}
4678
+ */
4679
+ this.on = this._onEvent;
4671
4680
  /**
4672
4681
  * @public
4673
4682
  * @type {String}
4674
4683
  */
4684
+
4675
4685
  this._id = ids.next();
4676
4686
  /**
4677
4687
  * @private
@@ -4844,16 +4854,6 @@ class FormEditor {
4844
4854
  properties
4845
4855
  });
4846
4856
  }
4847
- /**
4848
- * @param {string} type
4849
- * @param {number} priority
4850
- * @param {Function} handler
4851
- */
4852
-
4853
-
4854
- on(type, priority, handler) {
4855
- this.get('eventBus').on(type, priority, handler);
4856
- }
4857
4857
  /**
4858
4858
  * @param {string} type
4859
4859
  * @param {Function} handler
@@ -4926,6 +4926,14 @@ class FormEditor {
4926
4926
  _getModules() {
4927
4927
  return [ModelingModule, EditorActionsModule, KeyboardModule, SelectionModule];
4928
4928
  }
4929
+ /**
4930
+ * @internal
4931
+ */
4932
+
4933
+
4934
+ _onEvent(type, priority, handler) {
4935
+ this.get('eventBus').on(type, priority, handler);
4936
+ }
4929
4937
 
4930
4938
  } // helpers //////////
4931
4939