@bpmn-io/form-js-playground 0.14.1 → 0.15.0-alpha.0

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.
@@ -315,8 +315,6 @@
315
315
  *
316
316
  * @return {Array<?>}
317
317
  */
318
- var proto = typeof Element !== 'undefined' ? Element.prototype : {};
319
- proto.matches || proto.matchesSelector || proto.webkitMatchesSelector || proto.mozMatchesSelector || proto.msMatchesSelector || proto.oMatchesSelector;
320
318
 
321
319
  /**
322
320
  * Expose `parse`.
@@ -925,9 +923,9 @@
925
923
  };
926
924
 
927
925
  /*!
928
- Copyright (c) 2018 Jed Watson.
929
- Licensed under the MIT License (MIT), see
930
- http://jedwatson.github.io/classnames
926
+ Copyright (c) 2018 Jed Watson.
927
+ Licensed under the MIT License (MIT), see
928
+ http://jedwatson.github.io/classnames
931
929
  */
932
930
 
933
931
  (function (module) {
@@ -952,14 +950,14 @@
952
950
  }
953
951
  }
954
952
  } else if (argType === 'object') {
955
- if (arg.toString === Object.prototype.toString) {
956
- for (var key in arg) {
957
- if (hasOwn.call(arg, key) && arg[key]) {
958
- classes.push(key);
959
- }
960
- }
961
- } else {
953
+ if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
962
954
  classes.push(arg.toString());
955
+ continue;
956
+ }
957
+ for (var key in arg) {
958
+ if (hasOwn.call(arg, key) && arg[key]) {
959
+ classes.push(key);
960
+ }
963
961
  }
964
962
  }
965
963
  }
@@ -12804,7 +12802,7 @@
12804
12802
  * @return { ValueProducer }
12805
12803
  */
12806
12804
  static of(fn) {
12807
- return new ValueProducer$2(fn);
12805
+ return new ValueProducer(fn);
12808
12806
  }
12809
12807
  };
12810
12808
  const dateTimeLiterals$2 = {
@@ -12969,7 +12967,7 @@
12969
12967
  * @return { Variables }
12970
12968
  */
12971
12969
  assign(options = {}) {
12972
- return Variables$2.of({
12970
+ return Variables.of({
12973
12971
  ...this,
12974
12972
  ...options
12975
12973
  });
@@ -12985,7 +12983,7 @@
12985
12983
  context: this.context,
12986
12984
  parent: this.parent
12987
12985
  };
12988
- return Variables$2.of({
12986
+ return Variables.of({
12989
12987
  ...defaultOptions,
12990
12988
  ...options
12991
12989
  });
@@ -13000,7 +12998,7 @@
13000
12998
  value,
13001
12999
  raw
13002
13000
  } = options;
13003
- return new Variables$2({
13001
+ return new Variables({
13004
13002
  name,
13005
13003
  tokens: [...tokens],
13006
13004
  children: [...children],
@@ -15334,7 +15332,7 @@
15334
15332
  * @return { ValueProducer }
15335
15333
  */
15336
15334
  static of(fn) {
15337
- return new ValueProducer$1(fn);
15335
+ return new ValueProducer(fn);
15338
15336
  }
15339
15337
  };
15340
15338
  const dateTimeLiterals$1 = {
@@ -15499,7 +15497,7 @@
15499
15497
  * @return { Variables }
15500
15498
  */
15501
15499
  assign(options = {}) {
15502
- return Variables$1.of({
15500
+ return Variables.of({
15503
15501
  ...this,
15504
15502
  ...options
15505
15503
  });
@@ -15515,7 +15513,7 @@
15515
15513
  context: this.context,
15516
15514
  parent: this.parent
15517
15515
  };
15518
- return Variables$1.of({
15516
+ return Variables.of({
15519
15517
  ...defaultOptions,
15520
15518
  ...options
15521
15519
  });
@@ -15530,7 +15528,7 @@
15530
15528
  value,
15531
15529
  raw
15532
15530
  } = options;
15533
- return new Variables$1({
15531
+ return new Variables({
15534
15532
  name,
15535
15533
  tokens: [...tokens],
15536
15534
  children: [...children],
@@ -17665,7 +17663,7 @@
17665
17663
  */
17666
17664
  static of(text) {
17667
17665
  if (text.length == 0) throw new RangeError("A document must have at least one line");
17668
- if (text.length == 1 && !text[0]) return Text$2.empty;
17666
+ if (text.length == 1 && !text[0]) return Text.empty;
17669
17667
  return text.length <= 32 /* Tree.Branch */ ? new TextLeaf(text) : TextNode.from(TextLeaf.split(text, []));
17670
17668
  }
17671
17669
  };
@@ -19892,12 +19890,12 @@
19892
19890
  }
19893
19891
  function resolveTransactionInner(state, spec, docSize) {
19894
19892
  let sel = spec.selection,
19895
- annotations = asArray$1(spec.annotations);
19893
+ annotations = asArray$2(spec.annotations);
19896
19894
  if (spec.userEvent) annotations = annotations.concat(Transaction.userEvent.of(spec.userEvent));
19897
19895
  return {
19898
19896
  changes: spec.changes instanceof ChangeSet ? spec.changes : ChangeSet.of(spec.changes || [], docSize, state.facet(lineSeparator)),
19899
19897
  selection: sel && (sel instanceof EditorSelection ? sel : EditorSelection.single(sel.anchor, sel.head)),
19900
- effects: asArray$1(spec.effects),
19898
+ effects: asArray$2(spec.effects),
19901
19899
  annotations,
19902
19900
  scrollIntoView: !!spec.scrollIntoView
19903
19901
  };
@@ -19942,7 +19940,7 @@
19942
19940
  let filters = state.facet(transactionFilter);
19943
19941
  for (let i = filters.length - 1; i >= 0; i--) {
19944
19942
  let filtered = filters[i](tr);
19945
- if (filtered instanceof Transaction) tr = filtered;else if (Array.isArray(filtered) && filtered.length == 1 && filtered[0] instanceof Transaction) tr = filtered[0];else tr = resolveTransaction(state, asArray$1(filtered), false);
19943
+ if (filtered instanceof Transaction) tr = filtered;else if (Array.isArray(filtered) && filtered.length == 1 && filtered[0] instanceof Transaction) tr = filtered[0];else tr = resolveTransaction(state, asArray$2(filtered), false);
19946
19944
  }
19947
19945
  return tr;
19948
19946
  }
@@ -19957,7 +19955,7 @@
19957
19955
  return spec == tr ? tr : Transaction.create(state, tr.changes, tr.selection, spec.effects, spec.annotations, spec.scrollIntoView);
19958
19956
  }
19959
19957
  const none$3 = [];
19960
- function asArray$1(value) {
19958
+ function asArray$2(value) {
19961
19959
  return value == null ? none$3 : Array.isArray(value) ? value : [value];
19962
19960
  }
19963
19961
 
@@ -20091,7 +20089,7 @@
20091
20089
  base = effect.value;
20092
20090
  } else if (effect.is(StateEffect.appendConfig)) {
20093
20091
  conf = null;
20094
- base = asArray$1(base).concat(effect.value);
20092
+ base = asArray$2(base).concat(effect.value);
20095
20093
  }
20096
20094
  }
20097
20095
  let startValues;
@@ -20135,7 +20133,7 @@
20135
20133
  let result1 = f(sel.ranges[0]);
20136
20134
  let changes = this.changes(result1.changes),
20137
20135
  ranges = [result1.range];
20138
- let effects = asArray$1(result1.effects);
20136
+ let effects = asArray$2(result1.effects);
20139
20137
  for (let i = 1; i < sel.ranges.length; i++) {
20140
20138
  let result = f(sel.ranges[i]);
20141
20139
  let newChanges = this.changes(result.changes),
@@ -20144,7 +20142,7 @@
20144
20142
  let mapBy = changes.mapDesc(newChanges, true);
20145
20143
  ranges.push(result.range.map(mapBy));
20146
20144
  changes = changes.compose(newMapped);
20147
- effects = StateEffect.mapEffects(effects, newMapped).concat(StateEffect.mapEffects(asArray$1(result.effects), mapBy));
20145
+ effects = StateEffect.mapEffects(effects, newMapped).concat(StateEffect.mapEffects(asArray$2(result.effects), mapBy));
20148
20146
  }
20149
20147
  return {
20150
20148
  changes,
@@ -30554,7 +30552,7 @@
30554
30552
  };
30555
30553
  })
30556
30554
  });
30557
- function asArray(val) {
30555
+ function asArray$1(val) {
30558
30556
  return Array.isArray(val) ? val : [val];
30559
30557
  }
30560
30558
  function advanceCursor(cursor, collect, pos) {
@@ -30613,7 +30611,7 @@
30613
30611
  if (config.domEventHandlers[prop](view, line, event)) event.preventDefault();
30614
30612
  });
30615
30613
  }
30616
- this.markers = asArray(config.markers(view));
30614
+ this.markers = asArray$1(config.markers(view));
30617
30615
  if (config.initialSpacer) {
30618
30616
  this.spacer = new GutterElement(view, 0, 0, [config.initialSpacer(view)]);
30619
30617
  this.dom.appendChild(this.spacer.dom);
@@ -30622,7 +30620,7 @@
30622
30620
  }
30623
30621
  update(update) {
30624
30622
  let prevMarkers = this.markers;
30625
- this.markers = asArray(this.config.markers(update.view));
30623
+ this.markers = asArray$1(this.config.markers(update.view));
30626
30624
  if (this.spacer && this.config.updateSpacer) {
30627
30625
  let updated = this.config.updateSpacer(this.spacer.markers[0], update);
30628
30626
  if (updated != this.spacer.markers[0]) this.spacer.update(update.view, 0, 0, [updated]);
@@ -37979,7 +37977,7 @@
37979
37977
  }
37980
37978
  }
37981
37979
  /// Elements are used to compose syntax nodes during parsing.
37982
- let Element$2 = class Element {
37980
+ let Element$1 = class Element {
37983
37981
  /// @internal
37984
37982
  constructor(
37985
37983
  /// The node's
@@ -38030,7 +38028,7 @@
38030
38028
  }
38031
38029
  }
38032
38030
  function elt(type, from, to, children) {
38033
- return new Element$2(type, from, to, children);
38031
+ return new Element$1(type, from, to, children);
38034
38032
  }
38035
38033
  const EmphasisUnderscore = {
38036
38034
  resolve: "Emphasis",
@@ -38324,7 +38322,7 @@
38324
38322
  // Move the covered region into content, optionally adding marker nodes
38325
38323
  if (open.type.mark) content.push(this.elt(open.type.mark, start, open.to));
38326
38324
  for (let k = j + 1; k < i; k++) {
38327
- if (this.parts[k] instanceof Element$2) content.push(this.parts[k]);
38325
+ if (this.parts[k] instanceof Element$1) content.push(this.parts[k]);
38328
38326
  this.parts[k] = null;
38329
38327
  }
38330
38328
  if (close.type.mark) content.push(this.elt(close.type.mark, close.from, end));
@@ -38339,7 +38337,7 @@
38339
38337
  let result = [];
38340
38338
  for (let i = from; i < this.parts.length; i++) {
38341
38339
  let part = this.parts[i];
38342
- if (part instanceof Element$2) result.push(part);
38340
+ if (part instanceof Element$1) result.push(part);
38343
38341
  }
38344
38342
  return result;
38345
38343
  }
@@ -38383,7 +38381,7 @@
38383
38381
  while (eI < elts.length && elts[eI].to < mark.to) eI++;
38384
38382
  if (eI < elts.length && elts[eI].from < mark.from) {
38385
38383
  let e = elts[eI];
38386
- if (e instanceof Element$2) elts[eI] = new Element$2(e.type, e.from, e.to, injectMarks(e.children, [mark]));
38384
+ if (e instanceof Element$1) elts[eI] = new Element$1(e.type, e.from, e.to, injectMarks(e.children, [mark]));
38387
38385
  } else {
38388
38386
  elts.splice(eI++, 0, mark);
38389
38387
  }
@@ -49707,6 +49705,30 @@
49707
49705
  var DEFAULT_PRIORITY$3 = 1000;
49708
49706
  var slice$1 = Array.prototype.slice;
49709
49707
 
49708
+ /**
49709
+ * @typedef { {
49710
+ * stopPropagation(): void;
49711
+ * preventDefault(): void;
49712
+ * cancelBubble: boolean;
49713
+ * defaultPrevented: boolean;
49714
+ * returnValue: any;
49715
+ * } } Event
49716
+ */
49717
+
49718
+ /**
49719
+ * @template E
49720
+ *
49721
+ * @typedef { (event: E & Event, ...any) => any } EventBusEventCallback
49722
+ */
49723
+
49724
+ /**
49725
+ * @typedef { {
49726
+ * priority: number;
49727
+ * next: EventBusListener | null;
49728
+ * callback: EventBusEventCallback<any>;
49729
+ * } } EventBusListener
49730
+ */
49731
+
49710
49732
  /**
49711
49733
  * A general purpose event bus.
49712
49734
  *
@@ -49791,6 +49813,9 @@
49791
49813
  * ```
49792
49814
  */
49793
49815
  function EventBus$1() {
49816
+ /**
49817
+ * @type { Record<string, EventBusListener> }
49818
+ */
49794
49819
  this._listeners = {};
49795
49820
 
49796
49821
  // cleanup on destroy on lowest priority to allow
@@ -49810,10 +49835,12 @@
49810
49835
  *
49811
49836
  * Returning anything but `undefined` from a listener will stop the listener propagation.
49812
49837
  *
49813
- * @param {string|Array<string>} events
49814
- * @param {number} [priority=1000] the priority in which this listener is called, larger is higher
49815
- * @param {Function} callback
49816
- * @param {Object} [that] Pass context (`this`) to the callback
49838
+ * @template T
49839
+ *
49840
+ * @param {string|string[]} events to subscribe to
49841
+ * @param {number} [priority=1000] listen priority
49842
+ * @param {EventBusEventCallback<T>} callback
49843
+ * @param {any} [that] callback context
49817
49844
  */
49818
49845
  EventBus$1.prototype.on = function (events, priority, callback, that) {
49819
49846
  events = isArray$4(events) ? events : [events];
@@ -49845,14 +49872,16 @@
49845
49872
  };
49846
49873
 
49847
49874
  /**
49848
- * Register an event listener that is executed only once.
49875
+ * Register an event listener that is called only once.
49849
49876
  *
49850
- * @param {string} event the event name to register for
49851
- * @param {number} [priority=1000] the priority in which this listener is called, larger is higher
49852
- * @param {Function} callback the callback to execute
49853
- * @param {Object} [that] Pass context (`this`) to the callback
49877
+ * @template T
49878
+ *
49879
+ * @param {string|string[]} events to subscribe to
49880
+ * @param {number} [priority=1000] the listen priority
49881
+ * @param {EventBusEventCallback<T>} callback
49882
+ * @param {any} [that] callback context
49854
49883
  */
49855
- EventBus$1.prototype.once = function (event, priority, callback, that) {
49884
+ EventBus$1.prototype.once = function (events, priority, callback, that) {
49856
49885
  var self = this;
49857
49886
  if (isFunction$1(priority)) {
49858
49887
  that = callback;
@@ -49865,7 +49894,7 @@
49865
49894
  function wrappedCallback() {
49866
49895
  wrappedCallback.__isTomb = true;
49867
49896
  var result = callback.apply(that, arguments);
49868
- self.off(event, wrappedCallback);
49897
+ self.off(events, wrappedCallback);
49869
49898
  return result;
49870
49899
  }
49871
49900
 
@@ -49873,7 +49902,7 @@
49873
49902
  // bound callbacks via {@link #off} using the original
49874
49903
  // callback
49875
49904
  wrappedCallback[FN_REF$1] = callback;
49876
- this.on(event, priority, wrappedCallback);
49905
+ this.on(events, priority, wrappedCallback);
49877
49906
  };
49878
49907
 
49879
49908
  /**
@@ -49881,8 +49910,8 @@
49881
49910
  *
49882
49911
  * If no callback is given, all listeners for a given event name are being removed.
49883
49912
  *
49884
- * @param {string|Array<string>} events
49885
- * @param {Function} [callback]
49913
+ * @param {string|string[]} events
49914
+ * @param {EventBusEventCallback} [callback]
49886
49915
  */
49887
49916
  EventBus$1.prototype.off = function (events, callback) {
49888
49917
  events = isArray$4(events) ? events : [events];
@@ -49893,11 +49922,11 @@
49893
49922
  };
49894
49923
 
49895
49924
  /**
49896
- * Create an EventBus event.
49925
+ * Create an event recognized be the event bus.
49897
49926
  *
49898
- * @param {Object} data
49927
+ * @param {Object} data Event data.
49899
49928
  *
49900
- * @return {Object} event, recognized by the eventBus
49929
+ * @return {Event} An event that will be recognized by the event bus.
49901
49930
  */
49902
49931
  EventBus$1.prototype.createEvent = function (data) {
49903
49932
  var event = new InternalEvent$1();
@@ -49906,10 +49935,11 @@
49906
49935
  };
49907
49936
 
49908
49937
  /**
49909
- * Fires a named event.
49938
+ * Fires an event.
49910
49939
  *
49911
49940
  * @example
49912
49941
  *
49942
+ * ```javascript
49913
49943
  * // fire event by name
49914
49944
  * events.fire('foo');
49915
49945
  *
@@ -49927,13 +49957,13 @@
49927
49957
  * });
49928
49958
  *
49929
49959
  * events.fire({ type: 'foo' }, 'I am bar!');
49960
+ * ```
49930
49961
  *
49931
- * @param {string} [name] the optional event name
49932
- * @param {Object} [event] the event object
49933
- * @param {...Object} additional arguments to be passed to the callback functions
49962
+ * @param {string} [type] event type
49963
+ * @param {Object} [data] event or event data
49964
+ * @param {...any} [args] additional arguments the callback will be called with.
49934
49965
  *
49935
- * @return {boolean} the events return value, if specified or false if the
49936
- * default action was prevented by listeners
49966
+ * @return {any} The return value. Will be set to `false` if the default was prevented.
49937
49967
  */
49938
49968
  EventBus$1.prototype.fire = function (type, data) {
49939
49969
  var event, firstListener, returnValue, args;
@@ -49985,6 +50015,14 @@
49985
50015
  }
49986
50016
  return returnValue;
49987
50017
  };
50018
+
50019
+ /**
50020
+ * Handle an error by firing an event.
50021
+ *
50022
+ * @param {Error} error The error to be handled.
50023
+ *
50024
+ * @return {boolean} Whether the error was handled.
50025
+ */
49988
50026
  EventBus$1.prototype.handleError = function (error) {
49989
50027
  return this.fire('error', {
49990
50028
  error: error
@@ -49993,6 +50031,14 @@
49993
50031
  EventBus$1.prototype._destroy = function () {
49994
50032
  this._listeners = {};
49995
50033
  };
50034
+
50035
+ /**
50036
+ * @param {Event} event
50037
+ * @param {any[]} args
50038
+ * @param {EventBusListener} listener
50039
+ *
50040
+ * @return {any}
50041
+ */
49996
50042
  EventBus$1.prototype._invokeListeners = function (event, args, listener) {
49997
50043
  var returnValue;
49998
50044
  while (listener) {
@@ -50005,6 +50051,14 @@
50005
50051
  }
50006
50052
  return returnValue;
50007
50053
  };
50054
+
50055
+ /**
50056
+ * @param {Event} event
50057
+ * @param {any[]} args
50058
+ * @param {EventBusListener} listener
50059
+ *
50060
+ * @return {any}
50061
+ */
50008
50062
  EventBus$1.prototype._invokeListener = function (event, args, listener) {
50009
50063
  var returnValue;
50010
50064
  if (listener.callback.__isTomb) {
@@ -50033,7 +50087,7 @@
50033
50087
  return returnValue;
50034
50088
  };
50035
50089
 
50036
- /*
50090
+ /**
50037
50091
  * Add new listener with a certain priority to the list
50038
50092
  * of listeners (for the given event).
50039
50093
  *
@@ -50047,7 +50101,7 @@
50047
50101
  * * after: [ 1500, 1500, (new=1300), 1000, 1000, (new=1000) ]
50048
50102
  *
50049
50103
  * @param {string} event
50050
- * @param {Object} listener { priority, callback }
50104
+ * @param {EventBusListener} listener
50051
50105
  */
50052
50106
  EventBus$1.prototype._addListener = function (event, newListener) {
50053
50107
  var listener = this._getListeners(event),
@@ -50078,9 +50132,20 @@
50078
50132
  // add new listener to back
50079
50133
  previousListener.next = newListener;
50080
50134
  };
50135
+
50136
+ /**
50137
+ * @param {string} name
50138
+ *
50139
+ * @return {EventBusListener}
50140
+ */
50081
50141
  EventBus$1.prototype._getListeners = function (name) {
50082
50142
  return this._listeners[name];
50083
50143
  };
50144
+
50145
+ /**
50146
+ * @param {string} name
50147
+ * @param {EventBusListener} listener
50148
+ */
50084
50149
  EventBus$1.prototype._setListeners = function (name, listener) {
50085
50150
  this._listeners[name] = listener;
50086
50151
  };
@@ -50128,9 +50193,9 @@
50128
50193
  * Invoke function. Be fast...
50129
50194
  *
50130
50195
  * @param {Function} fn
50131
- * @param {Array<Object>} args
50196
+ * @param {any[]} args
50132
50197
  *
50133
- * @return {Any}
50198
+ * @return {any}
50134
50199
  */
50135
50200
  function invokeFunction$1(fn, args) {
50136
50201
  return fn.apply(null, args);
@@ -50705,16 +50770,18 @@
50705
50770
  // if unavailable - get empty value from form field
50706
50771
 
50707
50772
  if (_path) {
50708
- const fieldImplementation = this._formFields.get(type);
50773
+ const {
50774
+ config: fieldConfig
50775
+ } = this._formFields.get(type);
50709
50776
  let valueData = get$1(data, _path);
50710
- if (!isUndefined$2(valueData) && fieldImplementation.sanitizeValue) {
50711
- valueData = fieldImplementation.sanitizeValue({
50777
+ if (!isUndefined$2(valueData) && fieldConfig.sanitizeValue) {
50778
+ valueData = fieldConfig.sanitizeValue({
50712
50779
  formField,
50713
50780
  data,
50714
50781
  value: valueData
50715
50782
  });
50716
50783
  }
50717
- const initializedFieldValue = !isUndefined$2(valueData) ? valueData : !isUndefined$2(defaultValue) ? defaultValue : fieldImplementation.emptyValue;
50784
+ const initializedFieldValue = !isUndefined$2(valueData) ? valueData : !isUndefined$2(defaultValue) ? defaultValue : fieldConfig.emptyValue;
50718
50785
  initializedData = {
50719
50786
  ...initializedData,
50720
50787
  [_path[0]]: initializedFieldValue
@@ -50776,14 +50843,16 @@
50776
50843
  })
50777
50844
  });
50778
50845
  }
50779
- Button.create = (options = {}) => ({
50780
- action: 'submit',
50781
- ...options
50782
- });
50783
- Button.type = type$b;
50784
- Button.label = 'Button';
50785
- Button.keyed = true;
50786
- Button.group = 'action';
50846
+ Button.config = {
50847
+ type: type$b,
50848
+ keyed: true,
50849
+ label: 'Button',
50850
+ group: 'action',
50851
+ create: (options = {}) => ({
50852
+ action: 'submit',
50853
+ ...options
50854
+ })
50855
+ };
50787
50856
  const FormRenderContext = D$1({
50788
50857
  Empty: props => {
50789
50858
  return null;
@@ -50844,13 +50913,16 @@
50844
50913
  }
50845
50914
  function Errors(props) {
50846
50915
  const {
50847
- errors
50916
+ errors,
50917
+ id
50848
50918
  } = props;
50849
50919
  if (!errors.length) {
50850
50920
  return null;
50851
50921
  }
50852
50922
  return e$1("div", {
50853
50923
  class: "fjs-form-field-error",
50924
+ "aria-live": "polite",
50925
+ id: id,
50854
50926
  children: e$1("ul", {
50855
50927
  children: errors.map(error => {
50856
50928
  return e$1("li", {
@@ -50906,6 +50978,7 @@
50906
50978
  const {
50907
50979
  formId
50908
50980
  } = F$1(FormContext$1);
50981
+ const errorMessageId = errors.length === 0 ? undefined : `${prefixId(id, formId)}-error-message`;
50909
50982
  return e$1("div", {
50910
50983
  class: classNames(formFieldClasses(type$a, {
50911
50984
  errors,
@@ -50923,26 +50996,30 @@
50923
50996
  disabled: disabled,
50924
50997
  id: prefixId(id, formId),
50925
50998
  type: "checkbox",
50926
- onChange: onChange
50999
+ onChange: onChange,
51000
+ "aria-describedby": errorMessageId
50927
51001
  })
50928
51002
  }), e$1(Description$2, {
50929
51003
  description: description
50930
51004
  }), e$1(Errors, {
50931
- errors: errors
51005
+ errors: errors,
51006
+ id: errorMessageId
50932
51007
  })]
50933
51008
  });
50934
51009
  }
50935
- Checkbox$1.create = (options = {}) => ({
50936
- ...options
50937
- });
50938
- Checkbox$1.type = type$a;
50939
- Checkbox$1.label = 'Checkbox';
50940
- Checkbox$1.keyed = true;
50941
- Checkbox$1.emptyValue = false;
50942
- Checkbox$1.sanitizeValue = ({
50943
- value
50944
- }) => value === true;
50945
- Checkbox$1.group = 'selection';
51010
+ Checkbox$1.config = {
51011
+ type: type$a,
51012
+ keyed: true,
51013
+ label: 'Checkbox',
51014
+ group: 'selection',
51015
+ emptyValue: false,
51016
+ sanitizeValue: ({
51017
+ value
51018
+ }) => value === true,
51019
+ create: (options = {}) => ({
51020
+ ...options
51021
+ })
51022
+ };
50946
51023
 
50947
51024
  // parses the options data from the provided form field and form data
50948
51025
  function getValuesData(formField, formData) {
@@ -51304,6 +51381,7 @@
51304
51381
  const {
51305
51382
  formId
51306
51383
  } = F$1(FormContext$1);
51384
+ const errorMessageId = errors.length === 0 ? undefined : `${prefixId(id, formId)}-error-message`;
51307
51385
  return e$1("div", {
51308
51386
  class: classNames(formFieldClasses(type$9, {
51309
51387
  errors,
@@ -51326,37 +51404,41 @@
51326
51404
  disabled: disabled,
51327
51405
  id: prefixId(`${id}-${index}`, formId),
51328
51406
  type: "checkbox",
51329
- onClick: () => toggleCheckbox(v.value)
51407
+ onClick: () => toggleCheckbox(v.value),
51408
+ "aria-describedby": errorMessageId
51330
51409
  })
51331
51410
  }, `${id}-${index}`);
51332
51411
  }), e$1(Description$2, {
51333
51412
  description: description
51334
51413
  }), e$1(Errors, {
51335
- errors: errors
51414
+ errors: errors,
51415
+ id: errorMessageId
51336
51416
  })]
51337
51417
  });
51338
51418
  }
51339
- Checklist.create = (options = {}) => {
51340
- const defaults = {};
51341
-
51342
- // provide default values if valuesKey isn't set
51343
- if (!options.valuesKey) {
51344
- defaults.values = [{
51345
- label: 'Value',
51346
- value: 'value'
51347
- }];
51419
+ Checklist.config = {
51420
+ type: type$9,
51421
+ keyed: true,
51422
+ label: 'Checklist',
51423
+ group: 'selection',
51424
+ emptyValue: [],
51425
+ sanitizeValue: sanitizeMultiSelectValue,
51426
+ create: (options = {}) => {
51427
+ const defaults = {};
51428
+
51429
+ // provide default values if valuesKey isn't set
51430
+ if (!options.valuesKey) {
51431
+ defaults.values = [{
51432
+ label: 'Value',
51433
+ value: 'value'
51434
+ }];
51435
+ }
51436
+ return {
51437
+ ...defaults,
51438
+ ...options
51439
+ };
51348
51440
  }
51349
- return {
51350
- ...defaults,
51351
- ...options
51352
- };
51353
51441
  };
51354
- Checklist.type = type$9;
51355
- Checklist.label = 'Checklist';
51356
- Checklist.keyed = true;
51357
- Checklist.emptyValue = [];
51358
- Checklist.sanitizeValue = sanitizeMultiSelectValue;
51359
- Checklist.group = 'selection';
51360
51442
 
51361
51443
  /**
51362
51444
  * Returns the conditionally filtered data of a form reactively.
@@ -51454,9 +51536,6 @@
51454
51536
  field,
51455
51537
  onChange
51456
51538
  } = props;
51457
- const {
51458
- _path
51459
- } = field;
51460
51539
  const formFields = useService$2('formFields'),
51461
51540
  form = useService$2('form');
51462
51541
  const {
@@ -51473,8 +51552,8 @@
51473
51552
  if (!FormFieldComponent) {
51474
51553
  throw new Error(`cannot render field <${field.type}>`);
51475
51554
  }
51476
- const value = get$1(data, _path);
51477
- const fieldErrors = findErrors(errors, _path);
51555
+ const value = get$1(data, field._path);
51556
+ const fieldErrors = findErrors(errors, field._path);
51478
51557
  const disabled = properties.readOnly || field.disabled || false;
51479
51558
  const hidden = useCondition(field.conditional && field.conditional.hide || null);
51480
51559
  if (hidden) {
@@ -51540,14 +51619,16 @@
51540
51619
  }), components.length ? null : e$1(Empty, {})]
51541
51620
  });
51542
51621
  }
51543
- Default.create = (options = {}) => ({
51544
- components: [],
51545
- ...options
51546
- });
51547
- Default.type = 'default';
51548
- Default.keyed = false;
51549
- Default.label = null;
51550
- Default.group = null;
51622
+ Default.config = {
51623
+ type: 'default',
51624
+ keyed: false,
51625
+ label: null,
51626
+ group: null,
51627
+ create: (options = {}) => ({
51628
+ components: [],
51629
+ ...options
51630
+ })
51631
+ };
51551
51632
  function _extends$j() {
51552
51633
  _extends$j = Object.assign ? Object.assign.bind() : function (target) {
51553
51634
  for (var i = 1; i < arguments.length; i++) {
@@ -51733,16 +51814,17 @@
51733
51814
  ref: dateInputRef,
51734
51815
  type: "text",
51735
51816
  id: fullId,
51736
- class: 'fjs-input',
51817
+ class: "fjs-input",
51737
51818
  disabled: disabled,
51738
51819
  placeholder: "mm/dd/yyyy",
51739
51820
  autoComplete: "off",
51740
51821
  onFocus: onInputFocus,
51741
51822
  onKeyDown: onInputKeyDown,
51742
- onMouseDown: e => !flatpickrInstance.isOpen && flatpickrInstance.open(),
51823
+ onMouseDown: () => !flatpickrInstance.isOpen && flatpickrInstance.open(),
51743
51824
  onBlur: onInputBlur,
51744
- onInput: e => setIsInputDirty(true),
51745
- "data-input": true
51825
+ onInput: () => setIsInputDirty(true),
51826
+ "data-input": true,
51827
+ "aria-describedby": props['aria-describedby']
51746
51828
  })
51747
51829
  })
51748
51830
  })]
@@ -52010,7 +52092,8 @@
52010
52092
  },
52011
52093
  onBlur: onInputBlur,
52012
52094
  onKeyDown: onInputKeyDown,
52013
- "data-input": true
52095
+ "data-input": true,
52096
+ "aria-describedby": props['aria-describedby']
52014
52097
  }), dropdownIsOpen && e$1(DropdownList, {
52015
52098
  values: timeOptions,
52016
52099
  height: 150,
@@ -52145,6 +52228,7 @@
52145
52228
  time
52146
52229
  });
52147
52230
  }, []);
52231
+ const errorMessageId = allErrors.length === 0 ? undefined : `${prefixId(id, formId)}-error-message`;
52148
52232
  const datePickerProps = {
52149
52233
  id,
52150
52234
  label: dateLabel,
@@ -52154,7 +52238,8 @@
52154
52238
  disabled,
52155
52239
  disallowPassedDates,
52156
52240
  date: dateTime.date,
52157
- setDate
52241
+ setDate,
52242
+ 'aria-describedby': errorMessageId
52158
52243
  };
52159
52244
  const timePickerProps = {
52160
52245
  id,
@@ -52166,7 +52251,8 @@
52166
52251
  use24h,
52167
52252
  timeInterval,
52168
52253
  time: dateTime.time,
52169
- setTime
52254
+ setTime,
52255
+ 'aria-describedby': errorMessageId
52170
52256
  };
52171
52257
  return e$1("div", {
52172
52258
  class: formFieldClasses(type$8, {
@@ -52185,25 +52271,28 @@
52185
52271
  }), e$1(Description$2, {
52186
52272
  description: description
52187
52273
  }), e$1(Errors, {
52188
- errors: allErrors
52274
+ errors: allErrors,
52275
+ id: errorMessageId
52189
52276
  })]
52190
52277
  });
52191
52278
  }
52192
- Datetime.create = (options = {}) => {
52193
- const defaults = {};
52194
- set$2(defaults, DATETIME_SUBTYPE_PATH, DATETIME_SUBTYPES.DATE);
52195
- set$2(defaults, DATE_LABEL_PATH, 'Date');
52196
- return {
52197
- ...defaults,
52198
- ...options
52199
- };
52279
+ Datetime.config = {
52280
+ type: type$8,
52281
+ keyed: true,
52282
+ label: 'Date time',
52283
+ group: 'basic-input',
52284
+ emptyValue: null,
52285
+ sanitizeValue: sanitizeDateTimePickerValue,
52286
+ create: (options = {}) => {
52287
+ const defaults = {};
52288
+ set$2(defaults, DATETIME_SUBTYPE_PATH, DATETIME_SUBTYPES.DATE);
52289
+ set$2(defaults, DATE_LABEL_PATH, 'Date');
52290
+ return {
52291
+ ...defaults,
52292
+ ...options
52293
+ };
52294
+ }
52200
52295
  };
52201
- Datetime.type = type$8;
52202
- Datetime.keyed = true;
52203
- Datetime.emptyValue = null;
52204
- Datetime.sanitizeValue = sanitizeDateTimePickerValue;
52205
- Datetime.label = 'Date time';
52206
- Datetime.group = 'basic-input';
52207
52296
 
52208
52297
  /**
52209
52298
  * This file must not be changed or exchanged.
@@ -52247,7 +52336,7 @@
52247
52336
  href: "https://bpmn.io",
52248
52337
  target: "_blank",
52249
52338
  rel: "noopener",
52250
- style: "margin: 15px 20px 15px 10px; align-self: center; color: #404040",
52339
+ style: "margin: 15px 20px 15px 10px; align-self: center; color: var(--cds-icon-primary, #404040)",
52251
52340
  children: e$1(Logo, {})
52252
52341
  }), e$1("span", {
52253
52342
  children: ["Web-based tooling for BPMN, DMN, and forms powered by ", e$1("a", {
@@ -52270,7 +52359,7 @@
52270
52359
  rel: "noopener",
52271
52360
  class: "fjs-powered-by-link",
52272
52361
  title: "Powered by bpmn.io",
52273
- style: "color: #404040",
52362
+ style: "color: var(--cds-text-primary, #404040)",
52274
52363
  onClick: props.onClick,
52275
52364
  children: e$1(Logo, {})
52276
52365
  })
@@ -52297,8 +52386,12 @@
52297
52386
  function FormComponent(props) {
52298
52387
  const form = useService$2('form');
52299
52388
  const {
52300
- schema
52389
+ schema,
52390
+ properties
52301
52391
  } = form._getState();
52392
+ const {
52393
+ ariaLabel
52394
+ } = properties;
52302
52395
  const {
52303
52396
  onSubmit = noop,
52304
52397
  onReset = noop,
@@ -52316,6 +52409,7 @@
52316
52409
  class: "fjs-form",
52317
52410
  onSubmit: handleSubmit,
52318
52411
  onReset: handleReset,
52412
+ "aria-label": ariaLabel,
52319
52413
  noValidate: true,
52320
52414
  children: [e$1(FormField, {
52321
52415
  field: schema,
@@ -52325,7 +52419,7 @@
52325
52419
  }
52326
52420
  const NODE_TYPE_TEXT = 3,
52327
52421
  NODE_TYPE_ELEMENT = 1;
52328
- const ALLOWED_NODES = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'span', 'em', 'a', 'p', 'div', 'ul', 'ol', 'li', 'hr', 'blockquote', 'img', 'pre', 'code', 'br', 'strong'];
52422
+ const ALLOWED_NODES = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'span', 'em', 'a', 'p', 'div', 'ul', 'ol', 'li', 'hr', 'blockquote', 'img', 'pre', 'code', 'br', 'strong', 'table', 'thead', 'tbody', 'tr', 'th', 'td'];
52329
52423
  const ALLOWED_ATTRIBUTES = ['align', 'alt', 'class', 'href', 'id', 'name', 'rel', 'target', 'src'];
52330
52424
  const ALLOWED_URI_PATTERN = /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i; // eslint-disable-line no-useless-escape
52331
52425
  const ALLOWED_IMAGE_SRC_PATTERN = /^(https?|data):.*/i; // eslint-disable-line no-useless-escape
@@ -52525,13 +52619,15 @@
52525
52619
  })
52526
52620
  });
52527
52621
  }
52528
- Image.create = (options = {}) => ({
52529
- ...options
52530
- });
52531
- Image.type = type$7;
52532
- Image.keyed = false;
52533
- Image.label = 'Image view';
52534
- Image.group = 'presentation';
52622
+ Image.config = {
52623
+ type: type$7,
52624
+ keyed: false,
52625
+ label: 'Image view',
52626
+ group: 'presentation',
52627
+ create: (options = {}) => ({
52628
+ ...options
52629
+ })
52630
+ };
52535
52631
  function _extends$g() {
52536
52632
  _extends$g = Object.assign ? Object.assign.bind() : function (target) {
52537
52633
  for (var i = 1; i < arguments.length; i++) {
@@ -52621,10 +52717,10 @@
52621
52717
 
52622
52718
  // checks whether the value currently in the form data is practically different from the one in the input field cache
52623
52719
  // this allows us to guarantee the field always displays valid form data, but without auto-simplifying values like 1.000 to 1
52624
- const cacheValueMatchesState = d(() => Numberfield.sanitizeValue({
52720
+ const cacheValueMatchesState = d(() => Numberfield.config.sanitizeValue({
52625
52721
  value,
52626
52722
  formField: field
52627
- }) === Numberfield.sanitizeValue({
52723
+ }) === Numberfield.config.sanitizeValue({
52628
52724
  value: stringValueCache,
52629
52725
  formField: field
52630
52726
  }), [stringValueCache, value, field]);
@@ -52718,6 +52814,7 @@
52718
52814
  const {
52719
52815
  formId
52720
52816
  } = F$1(FormContext$1);
52817
+ const errorMessageId = errors.length === 0 ? undefined : `${prefixId(id, formId)}-error-message`;
52721
52818
  return e$1("div", {
52722
52819
  class: formFieldClasses(type$6, {
52723
52820
  errors,
@@ -52752,7 +52849,8 @@
52752
52849
  type: "text",
52753
52850
  autoComplete: "off",
52754
52851
  step: arrowIncrementValue,
52755
- value: displayValue
52852
+ value: displayValue,
52853
+ "aria-describedby": errorMessageId
52756
52854
  }), e$1("div", {
52757
52855
  class: classNames('fjs-number-arrow-container', {
52758
52856
  'fjs-disabled': disabled
@@ -52779,31 +52877,34 @@
52779
52877
  }), e$1(Description$2, {
52780
52878
  description: description
52781
52879
  }), e$1(Errors, {
52782
- errors: errors
52880
+ errors: errors,
52881
+ id: errorMessageId
52783
52882
  })]
52784
52883
  });
52785
52884
  }
52786
- Numberfield.create = (options = {}) => ({
52787
- ...options
52788
- });
52789
- Numberfield.sanitizeValue = ({
52790
- value,
52791
- formField
52792
- }) => {
52793
- // null state is allowed
52794
- if (isNullEquivalentValue(value)) return null;
52885
+ Numberfield.config = {
52886
+ type: type$6,
52887
+ keyed: true,
52888
+ label: 'Number',
52889
+ group: 'basic-input',
52890
+ emptyValue: null,
52891
+ sanitizeValue: ({
52892
+ value,
52893
+ formField
52894
+ }) => {
52895
+ // null state is allowed
52896
+ if (isNullEquivalentValue(value)) return null;
52795
52897
 
52796
- // if data cannot be parsed as a valid number, go into invalid NaN state
52797
- if (!isValidNumber$1(value)) return 'NaN';
52898
+ // if data cannot be parsed as a valid number, go into invalid NaN state
52899
+ if (!isValidNumber$1(value)) return 'NaN';
52798
52900
 
52799
- // otherwise parse to formatting type
52800
- return formField.serializeToString ? value.toString() : Number(value);
52901
+ // otherwise parse to formatting type
52902
+ return formField.serializeToString ? value.toString() : Number(value);
52903
+ },
52904
+ create: (options = {}) => ({
52905
+ ...options
52906
+ })
52801
52907
  };
52802
- Numberfield.type = type$6;
52803
- Numberfield.keyed = true;
52804
- Numberfield.label = 'Number';
52805
- Numberfield.emptyValue = null;
52806
- Numberfield.group = 'basic-input';
52807
52908
  const type$5 = 'radio';
52808
52909
  function Radio(props) {
52809
52910
  const {
@@ -52834,6 +52935,7 @@
52834
52935
  const {
52835
52936
  formId
52836
52937
  } = F$1(FormContext$1);
52938
+ const errorMessageId = errors.length === 0 ? undefined : `${prefixId(id, formId)}-error-message`;
52837
52939
  return e$1("div", {
52838
52940
  class: formFieldClasses(type$5, {
52839
52941
  errors,
@@ -52856,37 +52958,41 @@
52856
52958
  disabled: disabled,
52857
52959
  id: prefixId(`${id}-${index}`, formId),
52858
52960
  type: "radio",
52859
- onClick: () => onChange(option.value)
52961
+ onClick: () => onChange(option.value),
52962
+ "aria-describedby": errorMessageId
52860
52963
  })
52861
52964
  }, `${id}-${index}`);
52862
52965
  }), e$1(Description$2, {
52863
52966
  description: description
52864
52967
  }), e$1(Errors, {
52865
- errors: errors
52968
+ errors: errors,
52969
+ id: errorMessageId
52866
52970
  })]
52867
52971
  });
52868
52972
  }
52869
- Radio.create = function (options = {}) {
52870
- const defaults = {};
52871
-
52872
- // provide default values if valuesKey isn't set
52873
- if (!options.valuesKey) {
52874
- defaults.values = [{
52875
- label: 'Value',
52876
- value: 'value'
52877
- }];
52973
+ Radio.config = {
52974
+ type: type$5,
52975
+ keyed: true,
52976
+ label: 'Radio',
52977
+ group: 'selection',
52978
+ emptyValue: null,
52979
+ sanitizeValue: sanitizeSingleSelectValue,
52980
+ create: (options = {}) => {
52981
+ const defaults = {};
52982
+
52983
+ // provide default values if valuesKey isn't set
52984
+ if (!options.valuesKey) {
52985
+ defaults.values = [{
52986
+ label: 'Value',
52987
+ value: 'value'
52988
+ }];
52989
+ }
52990
+ return {
52991
+ ...defaults,
52992
+ ...options
52993
+ };
52878
52994
  }
52879
- return {
52880
- ...defaults,
52881
- ...options
52882
- };
52883
52995
  };
52884
- Radio.type = type$5;
52885
- Radio.label = 'Radio';
52886
- Radio.keyed = true;
52887
- Radio.emptyValue = null;
52888
- Radio.sanitizeValue = sanitizeSingleSelectValue;
52889
- Radio.group = 'selection';
52890
52996
  function _extends$e() {
52891
52997
  _extends$e = Object.assign ? Object.assign.bind() : function (target) {
52892
52998
  for (var i = 1; i < arguments.length; i++) {
@@ -53037,7 +53143,8 @@
53037
53143
  onBlur: () => {
53038
53144
  setIsDropdownExpanded(false);
53039
53145
  setFilter(valueLabel);
53040
- }
53146
+ },
53147
+ "aria-describedby": props['aria-describedby']
53041
53148
  }), displayState.displayCross && e$1("span", {
53042
53149
  class: "fjs-select-cross",
53043
53150
  onMouseDown: e => {
@@ -53122,14 +53229,20 @@
53122
53229
  }),
53123
53230
  onFocus: () => setIsDropdownExpanded(true),
53124
53231
  onBlur: () => setIsDropdownExpanded(false),
53125
- onMouseDown: e => onMouseDown(e),
53126
- tabIndex: disabled ? undefined : 0,
53232
+ onMouseDown: onMouseDown,
53127
53233
  children: [e$1("div", {
53128
53234
  class: classNames('fjs-select-display', {
53129
53235
  'fjs-select-placeholder': !value
53130
53236
  }),
53131
53237
  id: prefixId(`${id}-display`, formId),
53132
53238
  children: valueLabel || 'Select'
53239
+ }), !disabled && e$1("input", {
53240
+ id: prefixId(`${id}-search`, formId),
53241
+ class: "fjs-select-hidden-input",
53242
+ value: valueLabel,
53243
+ onFocus: () => setIsDropdownExpanded(true),
53244
+ onBlur: () => setIsDropdownExpanded(false),
53245
+ "aria-describedby": props['aria-describedby']
53133
53246
  }), displayState.displayCross && e$1("span", {
53134
53247
  class: "fjs-select-cross",
53135
53248
  onMouseDown: e => {
@@ -53178,14 +53291,16 @@
53178
53291
  const {
53179
53292
  formId
53180
53293
  } = F$1(FormContext$1);
53294
+ const errorMessageId = errors.length === 0 ? undefined : `${prefixId(id, formId)}-error-message`;
53181
53295
  const selectProps = d(() => ({
53182
53296
  id,
53183
53297
  disabled,
53184
53298
  errors,
53185
53299
  field,
53186
53300
  value,
53187
- onChange
53188
- }), [disabled, errors, field, id, value, onChange]);
53301
+ onChange,
53302
+ 'aria-describedby': errorMessageId
53303
+ }), [disabled, errors, field, id, value, onChange, errorMessageId]);
53189
53304
  return e$1("div", {
53190
53305
  class: formFieldClasses(type$4, {
53191
53306
  errors,
@@ -53198,7 +53313,7 @@
53198
53313
  }
53199
53314
  },
53200
53315
  children: [e$1(Label$1, {
53201
- id: prefixId(id, formId),
53316
+ id: prefixId(`${id}-search`, formId),
53202
53317
  label: label,
53203
53318
  required: required
53204
53319
  }), searchable ? e$1(SearchableSelect, {
@@ -53208,31 +53323,34 @@
53208
53323
  }), e$1(Description$2, {
53209
53324
  description: description
53210
53325
  }), e$1(Errors, {
53211
- errors: errors
53326
+ errors: errors,
53327
+ id: errorMessageId
53212
53328
  })]
53213
53329
  });
53214
53330
  }
53215
- Select$1.create = (options = {}) => {
53216
- const defaults = {};
53217
-
53218
- // provide default values if valuesKey isn't set
53219
- if (!options.valuesKey) {
53220
- defaults.values = [{
53221
- label: 'Value',
53222
- value: 'value'
53223
- }];
53331
+ Select$1.config = {
53332
+ type: type$4,
53333
+ keyed: true,
53334
+ label: 'Select',
53335
+ group: 'selection',
53336
+ emptyValue: null,
53337
+ sanitizeValue: sanitizeSingleSelectValue,
53338
+ create: (options = {}) => {
53339
+ const defaults = {};
53340
+
53341
+ // provide default values if valuesKey isn't set
53342
+ if (!options.valuesKey) {
53343
+ defaults.values = [{
53344
+ label: 'Value',
53345
+ value: 'value'
53346
+ }];
53347
+ }
53348
+ return {
53349
+ ...defaults,
53350
+ ...options
53351
+ };
53224
53352
  }
53225
- return {
53226
- ...defaults,
53227
- ...options
53228
- };
53229
53353
  };
53230
- Select$1.type = type$4;
53231
- Select$1.label = 'Select';
53232
- Select$1.keyed = true;
53233
- Select$1.emptyValue = null;
53234
- Select$1.sanitizeValue = sanitizeSingleSelectValue;
53235
- Select$1.group = 'selection';
53236
53354
  const type$3 = 'taglist';
53237
53355
  function Taglist(props) {
53238
53356
  const {
@@ -53253,6 +53371,7 @@
53253
53371
  const {
53254
53372
  formId
53255
53373
  } = F$1(FormContext$1);
53374
+ const errorMessageId = errors.length === 0 ? undefined : `${prefixId(id, formId)}-error-message`;
53256
53375
  const [filter, setFilter] = l$2('');
53257
53376
  const [filteredOptions, setFilteredOptions] = l$2([]);
53258
53377
  const [isDropdownExpanded, setIsDropdownExpanded] = l$2(false);
@@ -53388,15 +53507,16 @@
53388
53507
  onChange: onFilterChange,
53389
53508
  type: "text",
53390
53509
  value: filter,
53391
- placeholder: disabled ? '' : 'Search',
53510
+ placeholder: disabled ? undefined : 'Search',
53392
53511
  autoComplete: "off",
53393
- onKeyDown: e => onInputKeyDown(e),
53512
+ onKeyDown: onInputKeyDown,
53394
53513
  onMouseDown: () => setIsEscapeClose(false),
53395
53514
  onFocus: () => setIsDropdownExpanded(true),
53396
53515
  onBlur: () => {
53397
53516
  setIsDropdownExpanded(false);
53398
53517
  setFilter('');
53399
- }
53518
+ },
53519
+ "aria-describedby": errorMessageId
53400
53520
  })]
53401
53521
  }), e$1("div", {
53402
53522
  class: "fjs-taglist-anchor",
@@ -53410,33 +53530,40 @@
53410
53530
  }), e$1(Description$2, {
53411
53531
  description: description
53412
53532
  }), e$1(Errors, {
53413
- errors: errors
53533
+ errors: errors,
53534
+ id: errorMessageId
53414
53535
  })]
53415
53536
  });
53416
53537
  }
53417
- Taglist.create = (options = {}) => {
53418
- const defaults = {};
53419
-
53420
- // provide default values if valuesKey isn't set
53421
- if (!options.valuesKey) {
53422
- defaults.values = [{
53423
- label: 'Value',
53424
- value: 'value'
53425
- }];
53538
+ Taglist.config = {
53539
+ type: type$3,
53540
+ keyed: true,
53541
+ label: 'Tag list',
53542
+ group: 'selection',
53543
+ emptyValue: [],
53544
+ sanitizeValue: sanitizeMultiSelectValue,
53545
+ create: (options = {}) => {
53546
+ const defaults = {};
53547
+
53548
+ // provide default values if valuesKey isn't set
53549
+ if (!options.valuesKey) {
53550
+ defaults.values = [{
53551
+ label: 'Value',
53552
+ value: 'value'
53553
+ }];
53554
+ }
53555
+ return {
53556
+ ...defaults,
53557
+ ...options
53558
+ };
53426
53559
  }
53427
- return {
53428
- ...defaults,
53429
- ...options
53430
- };
53431
53560
  };
53432
- Taglist.type = type$3;
53433
- Taglist.label = 'Tag list';
53434
- Taglist.keyed = true;
53435
- Taglist.emptyValue = [];
53436
- Taglist.sanitizeValue = sanitizeMultiSelectValue;
53437
- Taglist.group = 'selection';
53438
53561
  const type$2 = 'text';
53439
53562
  function Text$1(props) {
53563
+ const form = useService$2('form');
53564
+ const {
53565
+ textLinkTarget
53566
+ } = form._getState().properties;
53440
53567
  const {
53441
53568
  field,
53442
53569
  disableLinks
@@ -53458,9 +53585,20 @@
53458
53585
  const html = markdownRenderer.render(markdown);
53459
53586
  return sanitizeHTML(html);
53460
53587
  }, [markdownRenderer, markdown]);
53461
- const componentOverrides = d(() => disableLinks ? {
53462
- 'a': DisabledLink
53463
- } : {}, [disableLinks]);
53588
+ const OverridenTargetLink = d(() => BuildOverridenTargetLink(textLinkTarget), [textLinkTarget]);
53589
+ const componentOverrides = d(() => {
53590
+ if (disableLinks) {
53591
+ return {
53592
+ 'a': DisabledLink
53593
+ };
53594
+ }
53595
+ if (textLinkTarget) {
53596
+ return {
53597
+ 'a': OverridenTargetLink
53598
+ };
53599
+ }
53600
+ return {};
53601
+ }, [disableLinks, OverridenTargetLink, textLinkTarget]);
53464
53602
  return e$1("div", {
53465
53603
  class: formFieldClasses(type$2),
53466
53604
  children: e$1(Markup, {
@@ -53470,21 +53608,35 @@
53470
53608
  })
53471
53609
  });
53472
53610
  }
53473
- Text$1.create = (options = {}) => ({
53474
- text: '# Text',
53475
- ...options
53476
- });
53477
- Text$1.type = type$2;
53478
- Text$1.keyed = false;
53479
- Text$1.group = 'presentation';
53480
- Text$1.label = 'Text view';
53611
+ Text$1.config = {
53612
+ type: type$2,
53613
+ keyed: false,
53614
+ label: 'Text view',
53615
+ group: 'presentation',
53616
+ create: (options = {}) => ({
53617
+ text: '# Text',
53618
+ ...options
53619
+ })
53620
+ };
53621
+ function BuildOverridenTargetLink(target) {
53622
+ return function ({
53623
+ children,
53624
+ ...rest
53625
+ }) {
53626
+ return e$1("a", {
53627
+ ...rest,
53628
+ target: target,
53629
+ children: children
53630
+ });
53631
+ };
53632
+ }
53481
53633
  function DisabledLink({
53482
- href,
53483
- children
53634
+ children,
53635
+ ...rest
53484
53636
  }) {
53485
53637
  return e$1("a", {
53638
+ ...rest,
53486
53639
  class: "fjs-disabled-link",
53487
- href: href,
53488
53640
  tabIndex: -1,
53489
53641
  children: children
53490
53642
  });
@@ -53522,6 +53674,7 @@
53522
53674
  const {
53523
53675
  formId
53524
53676
  } = F$1(FormContext$1);
53677
+ const errorMessageId = errors.length === 0 ? undefined : `${prefixId(id, formId)}-error-message`;
53525
53678
  return e$1("div", {
53526
53679
  class: formFieldClasses(type$1, {
53527
53680
  errors,
@@ -53541,26 +53694,40 @@
53541
53694
  id: prefixId(id, formId),
53542
53695
  onInput: onChange,
53543
53696
  type: "text",
53544
- value: value
53697
+ value: value,
53698
+ "aria-describedby": errorMessageId
53545
53699
  })
53546
53700
  }), e$1(Description$2, {
53547
53701
  description: description
53548
53702
  }), e$1(Errors, {
53549
- errors: errors
53703
+ errors: errors,
53704
+ id: errorMessageId
53550
53705
  })]
53551
53706
  });
53552
53707
  }
53553
- Textfield$1.create = (options = {}) => ({
53554
- ...options
53555
- });
53556
- Textfield$1.type = type$1;
53557
- Textfield$1.label = 'Text field';
53558
- Textfield$1.keyed = true;
53559
- Textfield$1.emptyValue = '';
53560
- Textfield$1.sanitizeValue = ({
53561
- value
53562
- }) => isArray$4(value) || isObject$1(value) ? '' : String(value);
53563
- Textfield$1.group = 'basic-input';
53708
+ Textfield$1.config = {
53709
+ type: type$1,
53710
+ keyed: true,
53711
+ label: 'Text field',
53712
+ group: 'basic-input',
53713
+ emptyValue: '',
53714
+ sanitizeValue: ({
53715
+ value
53716
+ }) => {
53717
+ if (isArray$4(value) || isObject$1(value)) {
53718
+ return '';
53719
+ }
53720
+
53721
+ // sanitize newlines to spaces
53722
+ if (typeof value === 'string') {
53723
+ return value.replace(/[\r\n\t]/g, ' ');
53724
+ }
53725
+ return String(value);
53726
+ },
53727
+ create: (options = {}) => ({
53728
+ ...options
53729
+ })
53730
+ };
53564
53731
  const type = 'textarea';
53565
53732
  function Textarea(props) {
53566
53733
  const {
@@ -53606,6 +53773,7 @@
53606
53773
  const {
53607
53774
  formId
53608
53775
  } = F$1(FormContext$1);
53776
+ const errorMessageId = errors.length === 0 ? undefined : `${prefixId(id, formId)}-error-message`;
53609
53777
  return e$1("div", {
53610
53778
  class: formFieldClasses(type, {
53611
53779
  errors,
@@ -53621,25 +53789,29 @@
53621
53789
  id: prefixId(id, formId),
53622
53790
  onInput: onInput,
53623
53791
  value: value,
53624
- ref: textareaRef
53792
+ ref: textareaRef,
53793
+ "aria-describedby": errorMessageId
53625
53794
  }), e$1(Description$2, {
53626
53795
  description: description
53627
53796
  }), e$1(Errors, {
53628
- errors: errors
53797
+ errors: errors,
53798
+ id: errorMessageId
53629
53799
  })]
53630
53800
  });
53631
53801
  }
53632
- Textarea.create = (options = {}) => ({
53633
- ...options
53634
- });
53635
- Textarea.type = type;
53636
- Textarea.label = 'Text area';
53637
- Textarea.keyed = true;
53638
- Textarea.emptyValue = '';
53639
- Textarea.sanitizeValue = ({
53640
- value
53641
- }) => isArray$4(value) || isObject$1(value) ? '' : String(value);
53642
- Textarea.group = 'basic-input';
53802
+ Textarea.config = {
53803
+ type,
53804
+ keyed: true,
53805
+ label: 'Text area',
53806
+ group: 'basic-input',
53807
+ emptyValue: '',
53808
+ sanitizeValue: ({
53809
+ value
53810
+ }) => isArray$4(value) || isObject$1(value) ? '' : String(value),
53811
+ create: (options = {}) => ({
53812
+ ...options
53813
+ })
53814
+ };
53643
53815
  function _extends$d() {
53644
53816
  _extends$d = Object.assign ? Object.assign.bind() : function (target) {
53645
53817
  for (var i = 1; i < arguments.length; i++) {
@@ -53660,10 +53832,11 @@
53660
53832
  }) => /*#__PURE__*/React.createElement("svg", _extends$d({
53661
53833
  xmlns: "http://www.w3.org/2000/svg",
53662
53834
  width: "54",
53663
- height: "54"
53835
+ height: "54",
53836
+ fill: "currentcolor"
53664
53837
  }, props), /*#__PURE__*/React.createElement("path", {
53665
53838
  fillRule: "evenodd",
53666
- d: "M45 17a3 3 0 013 3v14a3 3 0 01-3 3H9a3 3 0 01-3-3V20a3 3 0 013-3h36zm-9 8.889H18v2.222h18V25.89z"
53839
+ d: "M45 17a3 3 0 013 3v14a3 3 0 01-3 3H9a3 3 0 01-3-3V20a3 3 0 013-3h36zm-9 8.889H18v2.222h18v-2.222z"
53667
53840
  }));
53668
53841
  function _extends$c() {
53669
53842
  _extends$c = Object.assign ? Object.assign.bind() : function (target) {
@@ -53685,7 +53858,8 @@
53685
53858
  }) => /*#__PURE__*/React.createElement("svg", _extends$c({
53686
53859
  xmlns: "http://www.w3.org/2000/svg",
53687
53860
  width: "54",
53688
- height: "54"
53861
+ height: "54",
53862
+ fill: "currentcolor"
53689
53863
  }, props), /*#__PURE__*/React.createElement("path", {
53690
53864
  d: "M34 18H20a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2V20a2 2 0 00-2-2zm-9 14l-5-5 1.41-1.41L25 29.17l7.59-7.59L34 23l-9 9z"
53691
53865
  }));
@@ -53708,18 +53882,35 @@
53708
53882
  ...props
53709
53883
  }) => /*#__PURE__*/React.createElement("svg", _extends$b({
53710
53884
  xmlns: "http://www.w3.org/2000/svg",
53885
+ xmlnsXlink: "http://www.w3.org/1999/xlink",
53711
53886
  width: "54",
53712
53887
  height: "54",
53713
- fill: "none"
53714
- }, props), /*#__PURE__*/React.createElement("path", {
53715
- fillRule: "evenodd",
53716
- clipRule: "evenodd",
53717
- d: "M18 12h-6v6h6v-6zm-6-2a2 2 0 00-2 2v6a2 2 0 002 2h6a2 2 0 002-2v-6a2 2 0 00-2-2h-6zM18 36h-6v6h6v-6zm-6-2a2 2 0 00-2 2v6a2 2 0 002 2h6a2 2 0 002-2v-6a2 2 0 00-2-2h-6zM18 24h-6v6h6v-6zm-6-2a2 2 0 00-2 2v6a2 2 0 002 2h6a2 2 0 002-2v-6a2 2 0 00-2-2h-6z",
53718
- fill: "#161616"
53888
+ fill: "currentcolor"
53889
+ }, props), /*#__PURE__*/React.createElement("g", {
53890
+ fillRule: "evenodd"
53891
+ }, /*#__PURE__*/React.createElement("use", {
53892
+ xlinkHref: "#a"
53893
+ }), /*#__PURE__*/React.createElement("use", {
53894
+ xlinkHref: "#a",
53895
+ y: "24"
53896
+ }), /*#__PURE__*/React.createElement("use", {
53897
+ xlinkHref: "#a",
53898
+ y: "12"
53899
+ })), /*#__PURE__*/React.createElement("use", {
53900
+ xlinkHref: "#b"
53901
+ }), /*#__PURE__*/React.createElement("use", {
53902
+ xlinkHref: "#b",
53903
+ y: "12"
53904
+ }), /*#__PURE__*/React.createElement("use", {
53905
+ xlinkHref: "#b",
53906
+ y: "24"
53907
+ }), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("path", {
53908
+ id: "a",
53909
+ d: "M18 12h-6v6h6v-6zm-6-2a2 2 0 00-2 2v6a2 2 0 002 2h6a2 2 0 002-2v-6a2 2 0 00-2-2h-6z"
53719
53910
  }), /*#__PURE__*/React.createElement("path", {
53720
- d: "M23 14.5a1 1 0 011-1h19a1 1 0 011 1v1a1 1 0 01-1 1H24a1 1 0 01-1-1v-1zM23 26.5a1 1 0 011-1h19a1 1 0 011 1v1a1 1 0 01-1 1H24a1 1 0 01-1-1v-1zM23 38.5a1 1 0 011-1h19a1 1 0 011 1v1a1 1 0 01-1 1H24a1 1 0 01-1-1v-1z",
53721
- fill: "#161616"
53722
- }));
53911
+ id: "b",
53912
+ d: "M23 14.5a1 1 0 011-1h19a1 1 0 011 1v1a1 1 0 01-1 1H24a1 1 0 01-1-1v-1z"
53913
+ })));
53723
53914
  function _extends$a() {
53724
53915
  _extends$a = Object.assign ? Object.assign.bind() : function (target) {
53725
53916
  for (var i = 1; i < arguments.length; i++) {
@@ -53741,20 +53932,15 @@
53741
53932
  xmlns: "http://www.w3.org/2000/svg",
53742
53933
  width: "54",
53743
53934
  height: "54",
53744
- fill: "none"
53935
+ fill: "currentcolor"
53745
53936
  }, props), /*#__PURE__*/React.createElement("path", {
53746
- fill: "#000",
53747
53937
  fillRule: "evenodd",
53748
- d: "M37.908 13.418h-5.004v-2.354h-1.766v2.354H21.13v-2.354h-1.766v2.354H14.36c-1.132 0-2.06.928-2.06 2.06v23.549c0 1.132.928 2.06 2.06 2.06h6.77v-1.766h-6.358a.707.707 0 01-.706-.706V15.89c0-.39.316-.707.706-.707h4.592v2.355h1.766v-2.355h10.008v2.355h1.766v-2.355h4.592c.39 0 .707.317.707.707v6.358h1.765v-6.77c0-1.133-.927-2.06-2.06-2.06z",
53749
- clipRule: "evenodd"
53938
+ d: "M37.908 13.418h-5.004v-2.354h-1.766v2.354H21.13v-2.354h-1.766v2.354H14.36a2.07 2.07 0 00-2.06 2.06v23.549a2.07 2.07 0 002.06 2.06h6.77v-1.766h-6.358a.707.707 0 01-.706-.706V15.89c0-.39.316-.707.706-.707h4.592v2.355h1.766v-2.355h10.008v2.355h1.766v-2.355h4.592a.71.71 0 01.707.707v6.358h1.765v-6.77c0-1.133-.927-2.06-2.06-2.06z"
53750
53939
  }), /*#__PURE__*/React.createElement("path", {
53751
- fill: "#000",
53752
53940
  d: "M35.13 37.603l1.237-1.237-3.468-3.475v-5.926h-1.754v6.654l3.984 3.984z"
53753
53941
  }), /*#__PURE__*/React.createElement("path", {
53754
- fill: "#000",
53755
53942
  fillRule: "evenodd",
53756
- d: "M23.08 36.962a9.678 9.678 0 1017.883-7.408 9.678 9.678 0 00-17.882 7.408zm4.54-10.292a7.924 7.924 0 118.805 13.177A7.924 7.924 0 0127.62 26.67z",
53757
- clipRule: "evenodd"
53943
+ d: "M23.08 36.962a9.678 9.678 0 1017.883-7.408 9.678 9.678 0 00-17.882 7.408zm4.54-10.292a7.924 7.924 0 118.805 13.177A7.924 7.924 0 0127.62 26.67z"
53758
53944
  }));
53759
53945
  function _extends$9() {
53760
53946
  _extends$9 = Object.assign ? Object.assign.bind() : function (target) {
@@ -53774,18 +53960,15 @@
53774
53960
  styles = {},
53775
53961
  ...props
53776
53962
  }) => /*#__PURE__*/React.createElement("svg", _extends$9({
53963
+ xmlns: "http://www.w3.org/2000/svg",
53777
53964
  width: "54",
53778
53965
  height: "54",
53779
- fill: "none",
53780
- xmlns: "http://www.w3.org/2000/svg"
53966
+ fill: "currentcolor"
53781
53967
  }, props), /*#__PURE__*/React.createElement("path", {
53782
53968
  fillRule: "evenodd",
53783
- clipRule: "evenodd",
53784
- d: "M45 16a3 3 0 013 3v16a3 3 0 01-3 3H9a3 3 0 01-3-3V19a3 3 0 013-3h36zm0 2H9a1 1 0 00-1 1v16a1 1 0 001 1h36a1 1 0 001-1V19a1 1 0 00-1-1z",
53785
- fill: "#000"
53969
+ d: "M45 16a3 3 0 013 3v16a3 3 0 01-3 3H9a3 3 0 01-3-3V19a3 3 0 013-3h36zm0 2H9a1 1 0 00-1 1v16a1 1 0 001 1h36a1 1 0 001-1V19a1 1 0 00-1-1z"
53786
53970
  }), /*#__PURE__*/React.createElement("path", {
53787
- d: "M11 22a1 1 0 011-1h19a1 1 0 011 1v10a1 1 0 01-1 1H12a1 1 0 01-1-1V22z",
53788
- fill: "#505562"
53971
+ d: "M11 22a1 1 0 011-1h19a1 1 0 011 1v10a1 1 0 01-1 1H12a1 1 0 01-1-1V22z"
53789
53972
  }));
53790
53973
  function _extends$8() {
53791
53974
  _extends$8 = Object.assign ? Object.assign.bind() : function (target) {
@@ -53809,22 +53992,22 @@
53809
53992
  width: "54",
53810
53993
  height: "54"
53811
53994
  }, props), /*#__PURE__*/React.createElement("rect", {
53812
- x: "15",
53813
- y: "17",
53814
53995
  width: "24",
53815
53996
  height: "4",
53997
+ x: "15",
53998
+ y: "17",
53816
53999
  rx: "1"
53817
54000
  }), /*#__PURE__*/React.createElement("rect", {
53818
- x: "15",
53819
- y: "25",
53820
54001
  width: "24",
53821
54002
  height: "4",
54003
+ x: "15",
54004
+ y: "25",
53822
54005
  rx: "1"
53823
54006
  }), /*#__PURE__*/React.createElement("rect", {
53824
- x: "15",
53825
- y: "33",
53826
54007
  width: "13",
53827
54008
  height: "4",
54009
+ x: "15",
54010
+ y: "33",
53828
54011
  rx: "1"
53829
54012
  }));
53830
54013
  function _extends$7() {
@@ -53872,7 +54055,8 @@
53872
54055
  }) => /*#__PURE__*/React.createElement("svg", _extends$6({
53873
54056
  xmlns: "http://www.w3.org/2000/svg",
53874
54057
  width: "54",
53875
- height: "54"
54058
+ height: "54",
54059
+ fill: "currentcolor"
53876
54060
  }, props), /*#__PURE__*/React.createElement("path", {
53877
54061
  fillRule: "evenodd",
53878
54062
  d: "M45 16a3 3 0 013 3v16a3 3 0 01-3 3H9a3 3 0 01-3-3V19a3 3 0 013-3h36zm0 2H9a1 1 0 00-1 1v16a1 1 0 001 1h36a1 1 0 001-1V19a1 1 0 00-1-1zM35 28.444h7l-3.5 4-3.5-4zM35 26h7l-3.5-4-3.5 4z"
@@ -53897,9 +54081,10 @@
53897
54081
  }) => /*#__PURE__*/React.createElement("svg", _extends$5({
53898
54082
  xmlns: "http://www.w3.org/2000/svg",
53899
54083
  width: "54",
53900
- height: "54"
54084
+ height: "54",
54085
+ fill: "currentcolor"
53901
54086
  }, props), /*#__PURE__*/React.createElement("path", {
53902
- d: "M27 22c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0-5c-5.52 0-10 4.48-10 10s4.48 10 10 10 10-4.48 10-10-4.48-10-10-10zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"
54087
+ d: "M27 22c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0-5c-5.52 0-10 4.48-10 10s4.48 10 10 10 10-4.48 10-10-4.48-10-10-10zm0 18a8 8 0 110-16 8 8 0 110 16z"
53903
54088
  }));
53904
54089
  function _extends$4() {
53905
54090
  _extends$4 = Object.assign ? Object.assign.bind() : function (target) {
@@ -53921,7 +54106,8 @@
53921
54106
  }) => /*#__PURE__*/React.createElement("svg", _extends$4({
53922
54107
  xmlns: "http://www.w3.org/2000/svg",
53923
54108
  width: "54",
53924
- height: "54"
54109
+ height: "54",
54110
+ fill: "currentcolor"
53925
54111
  }, props), /*#__PURE__*/React.createElement("path", {
53926
54112
  fillRule: "evenodd",
53927
54113
  d: "M45 16a3 3 0 013 3v16a3 3 0 01-3 3H9a3 3 0 01-3-3V19a3 3 0 013-3h36zm0 2H9a1 1 0 00-1 1v16a1 1 0 001 1h36a1 1 0 001-1V19a1 1 0 00-1-1zm-12 7h9l-4.5 6-4.5-6z"
@@ -53946,9 +54132,10 @@
53946
54132
  }) => /*#__PURE__*/React.createElement("svg", _extends$3$1({
53947
54133
  xmlns: "http://www.w3.org/2000/svg",
53948
54134
  width: "54",
53949
- height: "54"
54135
+ height: "54",
54136
+ fill: "currentcolor"
53950
54137
  }, props), /*#__PURE__*/React.createElement("path", {
53951
- d: "M20.58 33.77h-3l-1.18-3.08H11l-1.1 3.08H7l5.27-13.54h2.89zm-5-5.36l-1.86-5-1.83 5zM22 20.23h5.41a15.47 15.47 0 012.4.14 3.42 3.42 0 011.41.55 3.47 3.47 0 011 1.14 3 3 0 01.42 1.58 3.26 3.26 0 01-1.91 2.94 3.63 3.63 0 011.91 1.22 3.28 3.28 0 01.66 2 4 4 0 01-.43 1.8 3.63 3.63 0 01-1.09 1.4 3.89 3.89 0 01-1.83.65q-.69.07-3.3.09H22zm2.73 2.25v3.13h3.8a1.79 1.79 0 001.1-.49 1.41 1.41 0 00.41-1 1.49 1.49 0 00-.35-1 1.54 1.54 0 00-1-.48c-.27 0-1.05-.05-2.34-.05zm0 5.39v3.62h2.57a11.52 11.52 0 001.88-.09 1.65 1.65 0 001-.54 1.6 1.6 0 00.38-1.14 1.75 1.75 0 00-.29-1 1.69 1.69 0 00-.86-.62 9.28 9.28 0 00-2.41-.23zM44.35 28.79l2.65.84a5.94 5.94 0 01-2 3.29A5.74 5.74 0 0141.38 34a5.87 5.87 0 01-4.44-1.84 7.09 7.09 0 01-1.73-5A7.43 7.43 0 0137 21.87 6 6 0 0141.54 20a5.64 5.64 0 014 1.47A5.33 5.33 0 0147 24l-2.7.65a2.8 2.8 0 00-2.86-2.27A3.09 3.09 0 0039 23.42a5.31 5.31 0 00-.93 3.5 5.62 5.62 0 00.93 3.65 3 3 0 002.4 1.09 2.72 2.72 0 001.82-.66 4 4 0 001.13-2.21z"
54138
+ d: "M20.58 33.77h-3l-1.18-3.08H11l-1.1 3.08H7l5.27-13.54h2.89zm-5-5.36l-1.86-5-1.83 5zM22 20.23h5.41a15.47 15.47 0 012.4.14 3.42 3.42 0 011.41.55 3.47 3.47 0 011 1.14 3 3 0 01.42 1.58 3.26 3.26 0 01-1.91 2.94 3.63 3.63 0 011.91 1.22 3.28 3.28 0 01.66 2 4 4 0 01-.43 1.8 3.63 3.63 0 01-1.09 1.4 3.89 3.89 0 01-1.83.65q-.69.07-3.3.09H22zm2.73 2.25v3.13h3.8a1.79 1.79 0 001.1-.49 1.41 1.41 0 00.41-1 1.49 1.49 0 00-.35-1 1.54 1.54 0 00-1-.48c-.27 0-1.05-.05-2.34-.05zm0 5.39v3.62h2.57a11.52 11.52 0 001.88-.09 1.65 1.65 0 001-.54 1.6 1.6 0 00.38-1.14 1.75 1.75 0 00-.29-1 1.69 1.69 0 00-.86-.62 9.28 9.28 0 00-2.41-.23zm19.62.92l2.65.84a5.94 5.94 0 01-2 3.29A5.74 5.74 0 0141.38 34a5.87 5.87 0 01-4.44-1.84 7.09 7.09 0 01-1.73-5A7.43 7.43 0 0137 21.87 6 6 0 0141.54 20a5.64 5.64 0 014 1.47A5.33 5.33 0 0147 24l-2.7.65a2.8 2.8 0 00-2.86-2.27A3.09 3.09 0 0039 23.42a5.31 5.31 0 00-.93 3.5 5.62 5.62 0 00.93 3.65 3 3 0 002.4 1.09 2.72 2.72 0 001.82-.66 4 4 0 001.13-2.21z"
53952
54139
  }));
53953
54140
  function _extends$2$1() {
53954
54141
  _extends$2$1 = Object.assign ? Object.assign.bind() : function (target) {
@@ -53970,7 +54157,8 @@
53970
54157
  }) => /*#__PURE__*/React.createElement("svg", _extends$2$1({
53971
54158
  xmlns: "http://www.w3.org/2000/svg",
53972
54159
  width: "54",
53973
- height: "54"
54160
+ height: "54",
54161
+ fill: "currentcolor"
53974
54162
  }, props), /*#__PURE__*/React.createElement("path", {
53975
54163
  fillRule: "evenodd",
53976
54164
  d: "M45 16a3 3 0 013 3v16a3 3 0 01-3 3H9a3 3 0 01-3-3V19a3 3 0 013-3h36zm0 2H9a1 1 0 00-1 1v16a1 1 0 001 1h36a1 1 0 001-1V19a1 1 0 00-1-1zm-32 4v10h-2V22h2z"
@@ -53995,10 +54183,11 @@
53995
54183
  }) => /*#__PURE__*/React.createElement("svg", _extends$1$1({
53996
54184
  xmlns: "http://www.w3.org/2000/svg",
53997
54185
  width: "54",
53998
- height: "54"
54186
+ height: "54",
54187
+ fill: "currentcolor"
53999
54188
  }, props), /*#__PURE__*/React.createElement("path", {
54000
54189
  fillRule: "evenodd",
54001
- d: "M45 13a3 3 0 013 3v22a3 3 0 01-3 3H9a3 3 0 01-3-3V16a3 3 0 013-3h36zm0 2H9a1 1 0 00-1 1v22a1 1 0 001 1h36a1 1 0 001-1V16a1 1 0 00-1-1zm-1.136 15.5l.848.849-6.363 6.363-.849-.848 6.364-6.364zm.264 3.5l.849.849-2.828 2.828-.849-.849L44.128 34zM13 19v10h-2V19h2z"
54190
+ d: "M45 13a3 3 0 013 3v22a3 3 0 01-3 3H9a3 3 0 01-3-3V16a3 3 0 013-3h36zm0 2H9a1 1 0 00-1 1v22a1 1 0 001 1h36a1 1 0 001-1V16a1 1 0 00-1-1zm-1.136 15.5l.849.849-6.364 6.364-.849-.849 6.364-6.364zm.264 3.5l.849.849-2.828 2.828-.849-.849L44.128 34zM13 19v10h-2V19h2z"
54002
54191
  }));
54003
54192
  function _extends$k() {
54004
54193
  _extends$k = Object.assign ? Object.assign.bind() : function (target) {
@@ -54018,20 +54207,18 @@
54018
54207
  styles = {},
54019
54208
  ...props
54020
54209
  }) => /*#__PURE__*/React.createElement("svg", _extends$k({
54210
+ xmlns: "http://www.w3.org/2000/svg",
54021
54211
  width: "54",
54022
54212
  height: "54",
54023
- fill: "none",
54024
- xmlns: "http://www.w3.org/2000/svg"
54213
+ fill: "currentcolor"
54025
54214
  }, props), /*#__PURE__*/React.createElement("path", {
54026
54215
  fillRule: "evenodd",
54027
- clipRule: "evenodd",
54028
54216
  d: "M34.636 21.91A3.818 3.818 0 1127 21.908a3.818 3.818 0 017.636 0zm-2 0A1.818 1.818 0 1129 21.908a1.818 1.818 0 013.636 0z",
54029
- fill: "#000"
54217
+ clipRule: "evenodd"
54030
54218
  }), /*#__PURE__*/React.createElement("path", {
54031
54219
  fillRule: "evenodd",
54032
- clipRule: "evenodd",
54033
- d: "M15 13a2 2 0 00-2 2v24a2 2 0 002 2h24a2 2 0 002-2V15a2 2 0 00-2-2H15zm24 2H15v12.45l4.71-4.709a1.91 1.91 0 012.702 0l6.695 6.695 2.656-1.77a1.91 1.91 0 012.411.239L39 32.73V15zM15 39v-8.754c.06-.038.116-.083.168-.135l5.893-5.893 6.684 6.685a1.911 1.911 0 002.41.238l2.657-1.77 6.02 6.02c.052.051.108.097.168.135V39H15z",
54034
- fill: "#000"
54220
+ d: "M15 13a2 2 0 00-2 2v24a2 2 0 002 2h24a2 2 0 002-2V15a2 2 0 00-2-2H15zm24 2H15v12.45l4.71-4.709a1.91 1.91 0 012.702 0l6.695 6.695 2.656-1.77a1.91 1.91 0 012.411.239L39 32.73V15zM15 39v-8.754a.975.975 0 00.168-.135l5.893-5.893 6.684 6.685a1.911 1.911 0 002.41.238l2.657-1.77 6.02 6.02c.052.051.108.097.168.135V39H15z",
54221
+ clipRule: "evenodd"
54035
54222
  }));
54036
54223
  const iconsByType = type => {
54037
54224
  return {
@@ -54056,7 +54243,7 @@
54056
54243
  constructor() {
54057
54244
  this._formFields = {};
54058
54245
  formFields.forEach(formField => {
54059
- this.register(formField.type, formField);
54246
+ this.register(formField.config.type, formField);
54060
54247
  });
54061
54248
  }
54062
54249
  register(type, formField) {
@@ -55307,16 +55494,16 @@
55307
55494
  }
55308
55495
 
55309
55496
  var handle = item;
55310
- while (getParent(item) && isContainer(getParent(item)) === false) {
55497
+ while (getParent$1(item) && isContainer(getParent$1(item)) === false) {
55311
55498
  if (o.invalid(item, handle)) {
55312
55499
  return;
55313
55500
  }
55314
- item = getParent(item); // drag target should be a top element
55501
+ item = getParent$1(item); // drag target should be a top element
55315
55502
  if (!item) {
55316
55503
  return;
55317
55504
  }
55318
55505
  }
55319
- var source = getParent(item);
55506
+ var source = getParent$1(item);
55320
55507
  if (!source) {
55321
55508
  return;
55322
55509
  }
@@ -55360,7 +55547,7 @@
55360
55547
  return;
55361
55548
  }
55362
55549
  var item = _copy || _item;
55363
- drop(item, getParent(item));
55550
+ drop(item, getParent$1(item));
55364
55551
  }
55365
55552
  function ungrab() {
55366
55553
  _grabbed = false;
@@ -55386,7 +55573,7 @@
55386
55573
  }
55387
55574
  }
55388
55575
  function drop(item, target) {
55389
- var parent = getParent(item);
55576
+ var parent = getParent$1(item);
55390
55577
  if (_copy && o.copySortSource && target === _source) {
55391
55578
  parent.removeChild(_item);
55392
55579
  }
@@ -55402,7 +55589,7 @@
55402
55589
  return;
55403
55590
  }
55404
55591
  var item = _copy || _item;
55405
- var parent = getParent(item);
55592
+ var parent = getParent$1(item);
55406
55593
  if (parent) {
55407
55594
  parent.removeChild(item);
55408
55595
  }
@@ -55415,7 +55602,7 @@
55415
55602
  }
55416
55603
  var reverts = arguments.length > 0 ? revert : o.revertOnSpill;
55417
55604
  var item = _copy || _item;
55418
- var parent = getParent(item);
55605
+ var parent = getParent$1(item);
55419
55606
  var initial = isInitialPlacement(parent);
55420
55607
  if (initial === false && reverts) {
55421
55608
  if (_copy) {
@@ -55464,7 +55651,7 @@
55464
55651
  function findDropTarget(elementBehindCursor, clientX, clientY) {
55465
55652
  var target = elementBehindCursor;
55466
55653
  while (target && !accepted()) {
55467
- target = getParent(target);
55654
+ target = getParent$1(target);
55468
55655
  }
55469
55656
  return target;
55470
55657
  function accepted() {
@@ -55502,7 +55689,7 @@
55502
55689
  _lastDropTarget = dropTarget;
55503
55690
  over();
55504
55691
  }
55505
- var parent = getParent(item);
55692
+ var parent = getParent$1(item);
55506
55693
  if (dropTarget === _source && _copy && !o.copySortSource) {
55507
55694
  if (parent) {
55508
55695
  parent.removeChild(item);
@@ -55568,14 +55755,14 @@
55568
55755
  if (_mirror) {
55569
55756
  classes$1.rm(o.mirrorContainer, 'gu-unselectable');
55570
55757
  touchy(documentElement, 'remove', 'mousemove', drag);
55571
- getParent(_mirror).removeChild(_mirror);
55758
+ getParent$1(_mirror).removeChild(_mirror);
55572
55759
  _mirror = null;
55573
55760
  }
55574
55761
  }
55575
55762
  function getImmediateChild(dropTarget, target) {
55576
55763
  var immediate = target;
55577
- while (immediate !== dropTarget && getParent(immediate) !== dropTarget) {
55578
- immediate = getParent(immediate);
55764
+ while (immediate !== dropTarget && getParent$1(immediate) !== dropTarget) {
55765
+ immediate = getParent$1(immediate);
55579
55766
  }
55580
55767
  if (immediate === documentElement) {
55581
55768
  return null;
@@ -55698,7 +55885,7 @@
55698
55885
  function getRectHeight(rect) {
55699
55886
  return rect.height || rect.bottom - rect.top;
55700
55887
  }
55701
- function getParent(el) {
55888
+ function getParent$1(el) {
55702
55889
  return el.parentNode === doc ? null : el.parentNode;
55703
55890
  }
55704
55891
  function isInput$1(el) {
@@ -55714,7 +55901,7 @@
55714
55901
  if (el.contentEditable === 'true') {
55715
55902
  return true;
55716
55903
  } // found a contentEditable element in the chain
55717
- return isEditable(getParent(el)); // contentEditable is set to 'inherit'
55904
+ return isEditable(getParent$1(el)); // contentEditable is set to 'inherit'
55718
55905
  }
55719
55906
 
55720
55907
  function nextEl(el) {
@@ -55932,10 +56119,10 @@
55932
56119
  }
55933
56120
  return matches(currentElem, selector) ? currentElem : null;
55934
56121
  }
55935
- var componentEvent$1 = {};
55936
- var bind$1$1 = window.addEventListener ? 'addEventListener' : 'attachEvent',
55937
- unbind$1$1 = window.removeEventListener ? 'removeEventListener' : 'detachEvent',
55938
- prefix$1 = bind$1$1 !== 'addEventListener' ? 'on' : '';
56122
+ var componentEvent = {};
56123
+ var bind$1 = window.addEventListener ? 'addEventListener' : 'attachEvent',
56124
+ unbind$1 = window.removeEventListener ? 'removeEventListener' : 'detachEvent',
56125
+ prefix = bind$1 !== 'addEventListener' ? 'on' : '';
55939
56126
 
55940
56127
  /**
55941
56128
  * Bind `el` event `type` to `fn`.
@@ -55948,8 +56135,8 @@
55948
56135
  * @api public
55949
56136
  */
55950
56137
 
55951
- var bind_1 = componentEvent$1.bind = function (el, type, fn, capture) {
55952
- el[bind$1$1](prefix$1 + type, fn, capture || false);
56138
+ var bind_1 = componentEvent.bind = function (el, type, fn, capture) {
56139
+ el[bind$1](prefix + type, fn, capture || false);
55953
56140
  return fn;
55954
56141
  };
55955
56142
 
@@ -55964,16 +56151,16 @@
55964
56151
  * @api public
55965
56152
  */
55966
56153
 
55967
- var unbind_1 = componentEvent$1.unbind = function (el, type, fn, capture) {
55968
- el[unbind$1$1](prefix$1 + type, fn, capture || false);
56154
+ var unbind_1 = componentEvent.unbind = function (el, type, fn, capture) {
56155
+ el[unbind$1](prefix + type, fn, capture || false);
55969
56156
  return fn;
55970
56157
  };
55971
56158
  var event = /*#__PURE__*/_mergeNamespaces$1({
55972
56159
  __proto__: null,
55973
56160
  bind: bind_1,
55974
56161
  unbind: unbind_1,
55975
- 'default': componentEvent$1
55976
- }, [componentEvent$1]);
56162
+ 'default': componentEvent
56163
+ }, [componentEvent]);
55977
56164
 
55978
56165
  /**
55979
56166
  * Expose `parse`.
@@ -56168,48 +56355,6 @@
56168
56355
  }
56169
56356
  });
56170
56357
 
56171
- var componentEvent = {};
56172
- var bind$1, unbind$1, prefix;
56173
- function detect() {
56174
- bind$1 = window.addEventListener ? 'addEventListener' : 'attachEvent';
56175
- unbind$1 = window.removeEventListener ? 'removeEventListener' : 'detachEvent';
56176
- prefix = bind$1 !== 'addEventListener' ? 'on' : '';
56177
- }
56178
-
56179
- /**
56180
- * Bind `el` event `type` to `fn`.
56181
- *
56182
- * @param {Element} el
56183
- * @param {String} type
56184
- * @param {Function} fn
56185
- * @param {Boolean} capture
56186
- * @return {Function}
56187
- * @api public
56188
- */
56189
-
56190
- componentEvent.bind = function (el, type, fn, capture) {
56191
- if (!bind$1) detect();
56192
- el[bind$1](prefix + type, fn, capture || false);
56193
- return fn;
56194
- };
56195
-
56196
- /**
56197
- * Unbind `el` event `type`'s callback `fn`.
56198
- *
56199
- * @param {Element} el
56200
- * @param {String} type
56201
- * @param {Function} fn
56202
- * @param {Boolean} capture
56203
- * @return {Function}
56204
- * @api public
56205
- */
56206
-
56207
- componentEvent.unbind = function (el, type, fn, capture) {
56208
- if (!unbind$1) detect();
56209
- el[unbind$1](prefix + type, fn, capture || false);
56210
- return fn;
56211
- };
56212
-
56213
56358
  /**
56214
56359
  * Expose `parse`.
56215
56360
  */
@@ -57879,6 +58024,30 @@
57879
58024
  var DEFAULT_PRIORITY$2 = 1000;
57880
58025
  var slice = Array.prototype.slice;
57881
58026
 
58027
+ /**
58028
+ * @typedef { {
58029
+ * stopPropagation(): void;
58030
+ * preventDefault(): void;
58031
+ * cancelBubble: boolean;
58032
+ * defaultPrevented: boolean;
58033
+ * returnValue: any;
58034
+ * } } Event
58035
+ */
58036
+
58037
+ /**
58038
+ * @template E
58039
+ *
58040
+ * @typedef { (event: E & Event, ...any) => any } EventBusEventCallback
58041
+ */
58042
+
58043
+ /**
58044
+ * @typedef { {
58045
+ * priority: number;
58046
+ * next: EventBusListener | null;
58047
+ * callback: EventBusEventCallback<any>;
58048
+ * } } EventBusListener
58049
+ */
58050
+
57882
58051
  /**
57883
58052
  * A general purpose event bus.
57884
58053
  *
@@ -57963,6 +58132,9 @@
57963
58132
  * ```
57964
58133
  */
57965
58134
  function EventBus() {
58135
+ /**
58136
+ * @type { Record<string, EventBusListener> }
58137
+ */
57966
58138
  this._listeners = {};
57967
58139
 
57968
58140
  // cleanup on destroy on lowest priority to allow
@@ -57982,10 +58154,12 @@
57982
58154
  *
57983
58155
  * Returning anything but `undefined` from a listener will stop the listener propagation.
57984
58156
  *
57985
- * @param {string|Array<string>} events
57986
- * @param {number} [priority=1000] the priority in which this listener is called, larger is higher
57987
- * @param {Function} callback
57988
- * @param {Object} [that] Pass context (`this`) to the callback
58157
+ * @template T
58158
+ *
58159
+ * @param {string|string[]} events to subscribe to
58160
+ * @param {number} [priority=1000] listen priority
58161
+ * @param {EventBusEventCallback<T>} callback
58162
+ * @param {any} [that] callback context
57989
58163
  */
57990
58164
  EventBus.prototype.on = function (events, priority, callback, that) {
57991
58165
  events = isArray(events) ? events : [events];
@@ -58017,14 +58191,16 @@
58017
58191
  };
58018
58192
 
58019
58193
  /**
58020
- * Register an event listener that is executed only once.
58194
+ * Register an event listener that is called only once.
58195
+ *
58196
+ * @template T
58021
58197
  *
58022
- * @param {string} event the event name to register for
58023
- * @param {number} [priority=1000] the priority in which this listener is called, larger is higher
58024
- * @param {Function} callback the callback to execute
58025
- * @param {Object} [that] Pass context (`this`) to the callback
58198
+ * @param {string|string[]} events to subscribe to
58199
+ * @param {number} [priority=1000] the listen priority
58200
+ * @param {EventBusEventCallback<T>} callback
58201
+ * @param {any} [that] callback context
58026
58202
  */
58027
- EventBus.prototype.once = function (event, priority, callback, that) {
58203
+ EventBus.prototype.once = function (events, priority, callback, that) {
58028
58204
  var self = this;
58029
58205
  if (isFunction(priority)) {
58030
58206
  that = callback;
@@ -58037,7 +58213,7 @@
58037
58213
  function wrappedCallback() {
58038
58214
  wrappedCallback.__isTomb = true;
58039
58215
  var result = callback.apply(that, arguments);
58040
- self.off(event, wrappedCallback);
58216
+ self.off(events, wrappedCallback);
58041
58217
  return result;
58042
58218
  }
58043
58219
 
@@ -58045,7 +58221,7 @@
58045
58221
  // bound callbacks via {@link #off} using the original
58046
58222
  // callback
58047
58223
  wrappedCallback[FN_REF] = callback;
58048
- this.on(event, priority, wrappedCallback);
58224
+ this.on(events, priority, wrappedCallback);
58049
58225
  };
58050
58226
 
58051
58227
  /**
@@ -58053,8 +58229,8 @@
58053
58229
  *
58054
58230
  * If no callback is given, all listeners for a given event name are being removed.
58055
58231
  *
58056
- * @param {string|Array<string>} events
58057
- * @param {Function} [callback]
58232
+ * @param {string|string[]} events
58233
+ * @param {EventBusEventCallback} [callback]
58058
58234
  */
58059
58235
  EventBus.prototype.off = function (events, callback) {
58060
58236
  events = isArray(events) ? events : [events];
@@ -58065,11 +58241,11 @@
58065
58241
  };
58066
58242
 
58067
58243
  /**
58068
- * Create an EventBus event.
58244
+ * Create an event recognized be the event bus.
58069
58245
  *
58070
- * @param {Object} data
58246
+ * @param {Object} data Event data.
58071
58247
  *
58072
- * @return {Object} event, recognized by the eventBus
58248
+ * @return {Event} An event that will be recognized by the event bus.
58073
58249
  */
58074
58250
  EventBus.prototype.createEvent = function (data) {
58075
58251
  var event = new InternalEvent();
@@ -58078,10 +58254,11 @@
58078
58254
  };
58079
58255
 
58080
58256
  /**
58081
- * Fires a named event.
58257
+ * Fires an event.
58082
58258
  *
58083
58259
  * @example
58084
58260
  *
58261
+ * ```javascript
58085
58262
  * // fire event by name
58086
58263
  * events.fire('foo');
58087
58264
  *
@@ -58099,13 +58276,13 @@
58099
58276
  * });
58100
58277
  *
58101
58278
  * events.fire({ type: 'foo' }, 'I am bar!');
58279
+ * ```
58102
58280
  *
58103
- * @param {string} [name] the optional event name
58104
- * @param {Object} [event] the event object
58105
- * @param {...Object} additional arguments to be passed to the callback functions
58281
+ * @param {string} [type] event type
58282
+ * @param {Object} [data] event or event data
58283
+ * @param {...any} [args] additional arguments the callback will be called with.
58106
58284
  *
58107
- * @return {boolean} the events return value, if specified or false if the
58108
- * default action was prevented by listeners
58285
+ * @return {any} The return value. Will be set to `false` if the default was prevented.
58109
58286
  */
58110
58287
  EventBus.prototype.fire = function (type, data) {
58111
58288
  var event, firstListener, returnValue, args;
@@ -58157,6 +58334,14 @@
58157
58334
  }
58158
58335
  return returnValue;
58159
58336
  };
58337
+
58338
+ /**
58339
+ * Handle an error by firing an event.
58340
+ *
58341
+ * @param {Error} error The error to be handled.
58342
+ *
58343
+ * @return {boolean} Whether the error was handled.
58344
+ */
58160
58345
  EventBus.prototype.handleError = function (error) {
58161
58346
  return this.fire('error', {
58162
58347
  error: error
@@ -58165,6 +58350,14 @@
58165
58350
  EventBus.prototype._destroy = function () {
58166
58351
  this._listeners = {};
58167
58352
  };
58353
+
58354
+ /**
58355
+ * @param {Event} event
58356
+ * @param {any[]} args
58357
+ * @param {EventBusListener} listener
58358
+ *
58359
+ * @return {any}
58360
+ */
58168
58361
  EventBus.prototype._invokeListeners = function (event, args, listener) {
58169
58362
  var returnValue;
58170
58363
  while (listener) {
@@ -58177,6 +58370,14 @@
58177
58370
  }
58178
58371
  return returnValue;
58179
58372
  };
58373
+
58374
+ /**
58375
+ * @param {Event} event
58376
+ * @param {any[]} args
58377
+ * @param {EventBusListener} listener
58378
+ *
58379
+ * @return {any}
58380
+ */
58180
58381
  EventBus.prototype._invokeListener = function (event, args, listener) {
58181
58382
  var returnValue;
58182
58383
  if (listener.callback.__isTomb) {
@@ -58205,7 +58406,7 @@
58205
58406
  return returnValue;
58206
58407
  };
58207
58408
 
58208
- /*
58409
+ /**
58209
58410
  * Add new listener with a certain priority to the list
58210
58411
  * of listeners (for the given event).
58211
58412
  *
@@ -58219,7 +58420,7 @@
58219
58420
  * * after: [ 1500, 1500, (new=1300), 1000, 1000, (new=1000) ]
58220
58421
  *
58221
58422
  * @param {string} event
58222
- * @param {Object} listener { priority, callback }
58423
+ * @param {EventBusListener} listener
58223
58424
  */
58224
58425
  EventBus.prototype._addListener = function (event, newListener) {
58225
58426
  var listener = this._getListeners(event),
@@ -58250,9 +58451,20 @@
58250
58451
  // add new listener to back
58251
58452
  previousListener.next = newListener;
58252
58453
  };
58454
+
58455
+ /**
58456
+ * @param {string} name
58457
+ *
58458
+ * @return {EventBusListener}
58459
+ */
58253
58460
  EventBus.prototype._getListeners = function (name) {
58254
58461
  return this._listeners[name];
58255
58462
  };
58463
+
58464
+ /**
58465
+ * @param {string} name
58466
+ * @param {EventBusListener} listener
58467
+ */
58256
58468
  EventBus.prototype._setListeners = function (name, listener) {
58257
58469
  this._listeners[name] = listener;
58258
58470
  };
@@ -58300,9 +58512,9 @@
58300
58512
  * Invoke function. Be fast...
58301
58513
  *
58302
58514
  * @param {Function} fn
58303
- * @param {Array<Object>} args
58515
+ * @param {any[]} args
58304
58516
  *
58305
- * @return {Any}
58517
+ * @return {any}
58306
58518
  */
58307
58519
  function invokeFunction(fn, args) {
58308
58520
  return fn.apply(null, args);
@@ -58343,21 +58555,24 @@
58343
58555
  if (!fieldDefinition) {
58344
58556
  throw new Error(`form field of type <${type}> not supported`);
58345
58557
  }
58558
+ const {
58559
+ config
58560
+ } = fieldDefinition;
58346
58561
  if (id && this._formFieldRegistry._ids.assigned(id)) {
58347
58562
  throw new Error(`ID <${id}> already assigned`);
58348
58563
  }
58349
58564
  if (key && this._formFieldRegistry._keys.assigned(key)) {
58350
58565
  throw new Error(`key <${key}> already assigned`);
58351
58566
  }
58352
- const labelAttrs = applyDefaults && fieldDefinition.label ? {
58353
- label: fieldDefinition.label
58567
+ const labelAttrs = applyDefaults && config.label ? {
58568
+ label: config.label
58354
58569
  } : {};
58355
- const field = fieldDefinition.create({
58570
+ const field = config.create({
58356
58571
  ...labelAttrs,
58357
58572
  ...attrs
58358
58573
  });
58359
58574
  this._ensureId(field);
58360
- if (fieldDefinition.keyed) {
58575
+ if (config.keyed) {
58361
58576
  this._ensureKey(field, applyDefaults);
58362
58577
  }
58363
58578
  return field;
@@ -58428,6 +58643,10 @@
58428
58643
  }
58429
58644
  }
58430
58645
  }
58646
+ const MAX_COLUMNS_PER_ROW = 16;
58647
+ const MAX_COLUMNS = 16;
58648
+ const MIN_COLUMNS = 2;
58649
+ const MAX_FIELDS_PER_ROW = 4;
58431
58650
  class FormLayoutValidator {
58432
58651
  /**
58433
58652
  * @constructor
@@ -58441,15 +58660,15 @@
58441
58660
  }
58442
58661
  validateField(field = {}, columns, row) {
58443
58662
  // allow empty (auto columns)
58444
- if (columns) {
58445
- // allow minimum 2 cols
58446
- if (columns < 2) {
58447
- return 'Minimum 2 columns are allowed';
58663
+ if (Number.isInteger(columns)) {
58664
+ // allow minimum cols
58665
+ if (columns < MIN_COLUMNS) {
58666
+ return `Minimum ${MIN_COLUMNS} columns are allowed`;
58448
58667
  }
58449
58668
 
58450
- // allow maximum 16 cols
58451
- if (columns > 16) {
58452
- return 'Maximum 16 columns are allowed';
58669
+ // allow maximum cols
58670
+ if (columns > MAX_COLUMNS) {
58671
+ return `Maximum ${MAX_COLUMNS} columns are allowed`;
58453
58672
  }
58454
58673
  }
58455
58674
  if (!row) {
@@ -58474,16 +58693,23 @@
58474
58693
  });
58475
58694
 
58476
58695
  // do not allow overflows
58477
- if (sumColumns > 16 || sumColumns === 16 && sumAutoCols > 0 || columns === 16 && sumFields > 1) {
58478
- return 'New value exceeds the maximum of 16 columns per row';
58696
+ if (sumColumns > MAX_COLUMNS_PER_ROW || sumAutoCols > 0 && sumColumns > calculateMaxColumnsWithAuto(sumAutoCols) || columns === MAX_COLUMNS_PER_ROW && sumFields > 1) {
58697
+ return `New value exceeds the maximum of ${MAX_COLUMNS_PER_ROW} columns per row`;
58479
58698
  }
58480
- if (sumFields > 4) {
58481
- return 'Maximum 4 fields per row are allowed';
58699
+ if (sumFields > MAX_FIELDS_PER_ROW) {
58700
+ return `Maximum ${MAX_FIELDS_PER_ROW} fields per row are allowed`;
58482
58701
  }
58483
58702
  return null;
58484
58703
  }
58485
58704
  }
58486
58705
  FormLayoutValidator.$inject = ['formLayouter', 'formFieldRegistry'];
58706
+
58707
+ // helper //////////////////////
58708
+
58709
+ // on normal screen sizes, auto columns take minimum 2 columns
58710
+ function calculateMaxColumnsWithAuto(autoCols) {
58711
+ return MAX_COLUMNS_PER_ROW - autoCols * 2;
58712
+ }
58487
58713
  class Importer {
58488
58714
  /**
58489
58715
  * @constructor
@@ -58597,6 +58823,91 @@
58597
58823
  'fjs-disabled': disabled
58598
58824
  });
58599
58825
  }
58826
+
58827
+ /**
58828
+ * Add a dragger that calls back the passed function with
58829
+ * { event, delta } on drag.
58830
+ *
58831
+ * @example
58832
+ *
58833
+ * function dragMove(event, delta) {
58834
+ * // we are dragging (!!)
58835
+ * }
58836
+ *
58837
+ * domElement.addEventListener('dragstart', dragger(dragMove));
58838
+ *
58839
+ * @param {Function} fn
58840
+ * @param {Element} dragPreview
58841
+ *
58842
+ * @return {Function} drag start callback function
58843
+ */
58844
+ function createDragger(fn, dragPreview) {
58845
+ let self;
58846
+ let startX, startY;
58847
+
58848
+ /** drag start */
58849
+ function onDragStart(event) {
58850
+ self = this;
58851
+ startX = event.clientX;
58852
+ startY = event.clientY;
58853
+
58854
+ // (1) prevent preview image
58855
+ if (event.dataTransfer) {
58856
+ event.dataTransfer.setDragImage(dragPreview, 0, 0);
58857
+ }
58858
+
58859
+ // (2) setup drag listeners
58860
+
58861
+ // attach drag + cleanup event
58862
+ document.addEventListener('dragover', onDrag);
58863
+ document.addEventListener('dragend', onEnd);
58864
+ document.addEventListener('drop', preventDefault);
58865
+ }
58866
+ function onDrag(event) {
58867
+ const delta = {
58868
+ x: event.clientX - startX,
58869
+ y: event.clientY - startY
58870
+ };
58871
+
58872
+ // call provided fn with event, delta
58873
+ return fn.call(self, event, delta);
58874
+ }
58875
+ function onEnd() {
58876
+ document.removeEventListener('dragover', onDrag);
58877
+ document.removeEventListener('dragend', onEnd);
58878
+ document.removeEventListener('drop', preventDefault);
58879
+ }
58880
+ return onDragStart;
58881
+ }
58882
+
58883
+ /**
58884
+ * Throttle function call according UI update cycle.
58885
+ *
58886
+ * @param {Function} fn
58887
+ *
58888
+ * @return {Function} throttled fn
58889
+ */
58890
+ function throttle(fn) {
58891
+ let active = false;
58892
+ let lastArgs = [];
58893
+ let lastThis = undefined;
58894
+ return function (...args) {
58895
+ lastArgs = args;
58896
+ lastThis = this;
58897
+ if (active) {
58898
+ return;
58899
+ }
58900
+ active = true;
58901
+ fn.apply(lastThis, lastArgs);
58902
+ window.requestAnimationFrame(function () {
58903
+ lastArgs = lastThis = active = undefined;
58904
+ });
58905
+ };
58906
+ }
58907
+ function preventDefault(event) {
58908
+ event.preventDefault();
58909
+ event.stopPropagation();
58910
+ }
58600
58911
  const DragAndDropContext = D$1({
58601
58912
  drake: null
58602
58913
  });
@@ -58660,10 +58971,54 @@
58660
58971
  };
58661
58972
  return _extends$2.apply(this, arguments);
58662
58973
  }
58663
- var DraggableIcon = ({
58974
+ var DeleteIcon$1 = ({
58664
58975
  styles = {},
58665
58976
  ...props
58666
58977
  }) => /*#__PURE__*/React.createElement("svg", _extends$2({
58978
+ xmlns: "http://www.w3.org/2000/svg",
58979
+ width: "16",
58980
+ height: "16",
58981
+ fill: "none"
58982
+ }, props), /*#__PURE__*/React.createElement("rect", {
58983
+ width: "16",
58984
+ height: "16",
58985
+ x: ".536",
58986
+ fill: "#fff",
58987
+ rx: "3",
58988
+ style: {
58989
+ mixBlendMode: "multiply"
58990
+ }
58991
+ }), /*#__PURE__*/React.createElement("path", {
58992
+ fill: "#fff",
58993
+ d: "M.536 0h16v16h-16z",
58994
+ style: {
58995
+ mixBlendMode: "multiply"
58996
+ }
58997
+ }), /*#__PURE__*/React.createElement("path", {
58998
+ fill: "currentcolor",
58999
+ d: "M7.536 6h-1v6h1V6zm3 0h-1v6h1V6z"
59000
+ }), /*#__PURE__*/React.createElement("path", {
59001
+ fill: "currentcolor",
59002
+ d: "M2.536 3v1h1v10a1 1 0 001 1h8a1 1 0 001-1V4h1V3h-12zm2 11V4h8v10h-8zm6-13h-4v1h4V1z"
59003
+ }));
59004
+ function _extends$1() {
59005
+ _extends$1 = Object.assign ? Object.assign.bind() : function (target) {
59006
+ for (var i = 1; i < arguments.length; i++) {
59007
+ var source = arguments[i];
59008
+ for (var key in source) {
59009
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
59010
+ target[key] = source[key];
59011
+ }
59012
+ }
59013
+ }
59014
+ return target;
59015
+ };
59016
+ return _extends$1.apply(this, arguments);
59017
+ }
59018
+ var DraggableIcon = ({
59019
+ styles = {},
59020
+ ...props
59021
+ }) => /*#__PURE__*/React.createElement("svg", _extends$1({
58667
59022
  xmlns: "http://www.w3.org/2000/svg",
58668
59023
  width: "16",
58669
59024
  height: "16",
@@ -58675,8 +59030,8 @@
58675
59030
  d: "M0 0h32v32H0z",
58676
59031
  fill: "none"
58677
59032
  }));
58678
- function _extends$1() {
58679
- _extends$1 = Object.assign ? Object.assign.bind() : function (target) {
59033
+ function _extends() {
59034
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
58680
59035
  for (var i = 1; i < arguments.length; i++) {
58681
59036
  var source = arguments[i];
58682
59037
  for (var key in source) {
@@ -58687,12 +59042,12 @@
58687
59042
  }
58688
59043
  return target;
58689
59044
  };
58690
- return _extends$1.apply(this, arguments);
59045
+ return _extends.apply(this, arguments);
58691
59046
  }
58692
59047
  var SearchIcon = ({
58693
59048
  styles = {},
58694
59049
  ...props
58695
- }) => /*#__PURE__*/React.createElement("svg", _extends$1({
59050
+ }) => /*#__PURE__*/React.createElement("svg", _extends({
58696
59051
  width: "15",
58697
59052
  height: "15",
58698
59053
  fill: "none",
@@ -58747,47 +59102,25 @@
58747
59102
  disableLinks: true
58748
59103
  });
58749
59104
  }
58750
- EditorText.create = Text$1.create;
58751
- EditorText.type = Text$1.type;
58752
- EditorText.keyed = Text$1.keyed;
59105
+ EditorText.config = Text$1.config;
58753
59106
  const editorFormFields = [EditorText];
58754
59107
  class EditorFormFields extends FormFields {
58755
59108
  constructor() {
58756
59109
  super();
58757
59110
  editorFormFields.forEach(formField => {
58758
- this.register(formField.type, formField);
59111
+ this.register(formField.config.type, formField);
58759
59112
  });
58760
59113
  }
58761
59114
  }
58762
- function _extends() {
58763
- _extends = Object.assign ? Object.assign.bind() : function (target) {
58764
- for (var i = 1; i < arguments.length; i++) {
58765
- var source = arguments[i];
58766
- for (var key in source) {
58767
- if (Object.prototype.hasOwnProperty.call(source, key)) {
58768
- target[key] = source[key];
58769
- }
58770
- }
58771
- }
58772
- return target;
58773
- };
58774
- return _extends.apply(this, arguments);
58775
- }
58776
- var ListDeleteIcon = ({
58777
- styles = {},
58778
- ...props
58779
- }) => /*#__PURE__*/React.createElement("svg", _extends({
58780
- xmlns: "http://www.w3.org/2000/svg",
58781
- width: "11",
58782
- height: "14"
58783
- }, props), /*#__PURE__*/React.createElement("path", {
58784
- 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"
58785
- }));
58786
- const PALETTE_ENTRIES = formFields.filter(f => f.type !== 'default').map(f => {
59115
+ const PALETTE_ENTRIES = formFields.filter(({
59116
+ config: fieldConfig
59117
+ }) => fieldConfig.type !== 'default').map(({
59118
+ config: fieldConfig
59119
+ }) => {
58787
59120
  return {
58788
- label: f.label,
58789
- type: f.type,
58790
- group: f.group
59121
+ label: fieldConfig.label,
59122
+ type: fieldConfig.type,
59123
+ group: fieldConfig.group
58791
59124
  };
58792
59125
  });
58793
59126
  const PALETTE_GROUPS = [{
@@ -58808,19 +59141,24 @@
58808
59141
  const [searchTerm, setSearchTerm] = l$2('');
58809
59142
  const inputRef = s$1();
58810
59143
  const groups = groupEntries(entries);
59144
+ const simplifyString = A$1(str => {
59145
+ return str.toLowerCase().replace(/\s+/g, '');
59146
+ }, []);
59147
+ const filter = A$1(entry => {
59148
+ const simplifiedSearchTerm = simplifyString(searchTerm);
59149
+ if (!simplifiedSearchTerm) {
59150
+ return true;
59151
+ }
59152
+ const simplifiedEntryLabel = simplifyString(entry.label);
59153
+ const simplifiedEntryType = simplifyString(entry.type);
59154
+ return simplifiedEntryLabel.includes(simplifiedSearchTerm) || simplifiedEntryType.includes(simplifiedSearchTerm);
59155
+ }, [searchTerm, simplifyString]);
58811
59156
 
58812
59157
  // filter entries on search change
58813
59158
  y(() => {
58814
- const filter = entry => {
58815
- if (!searchTerm) {
58816
- return true;
58817
- }
58818
- const search = entry.label.toLowerCase();
58819
- return searchTerm.toLowerCase().split(/\s/g).every(term => search.includes(term));
58820
- };
58821
59159
  const entries = PALETTE_ENTRIES.filter(filter);
58822
59160
  setEntries(entries);
58823
- }, [searchTerm]);
59161
+ }, [filter, searchTerm]);
58824
59162
  const handleInput = A$1(event => {
58825
59163
  setSearchTerm(() => event.target.value);
58826
59164
  }, [setSearchTerm]);
@@ -59229,6 +59567,135 @@
59229
59567
  })]
59230
59568
  });
59231
59569
  }
59570
+ const COLUMNS_REGEX = /^cds--col(-lg)?/;
59571
+ const ELEMENT_RESIZING_CLS = 'fjs-element-resizing';
59572
+ const RESIZE_DRAG_PREVIEW_CLS = 'fjs-resize-drag-preview';
59573
+ const GRID_OFFSET_PX = 16;
59574
+ function FieldResizer(props) {
59575
+ const {
59576
+ field,
59577
+ position
59578
+ } = props;
59579
+ const ref = s$1(null);
59580
+ const formLayoutValidator = useService$1('formLayoutValidator');
59581
+ const modeling = useService$1('modeling');
59582
+
59583
+ // we can't use state as we need to
59584
+ // manipulate this inside dragging events
59585
+ const context = s$1({
59586
+ startColumns: 0,
59587
+ newColumns: 0
59588
+ });
59589
+ const onResize = throttle((_, delta) => {
59590
+ const {
59591
+ x: dx
59592
+ } = delta;
59593
+ const {
59594
+ layout = {}
59595
+ } = field;
59596
+ const newColumns = calculateNewColumns(ref.current, layout.columns || context.current.startColumns, dx, position);
59597
+ const errorMessage = formLayoutValidator.validateField(field, newColumns);
59598
+ if (!errorMessage) {
59599
+ context.current.newColumns = newColumns;
59600
+
59601
+ // make visual updates to preview change
59602
+ const columnNode = ref.current.closest('.fjs-layout-column');
59603
+ removeMatching(columnNode, COLUMNS_REGEX);
59604
+ columnNode.classList.add(`cds--col-lg-${newColumns}`);
59605
+ }
59606
+ });
59607
+ const onResizeStart = event => {
59608
+ const target = getElementNode(field);
59609
+ const parent = getParent(target);
59610
+
59611
+ // create a blank element to use as drag preview
59612
+ // ensure it was only created once
59613
+ let blankPreview = getDragPreviewImage(parent);
59614
+ if (!blankPreview) {
59615
+ blankPreview = document.createElement('div');
59616
+ blankPreview.classList.add(RESIZE_DRAG_PREVIEW_CLS);
59617
+ parent.appendChild(blankPreview);
59618
+ }
59619
+
59620
+ // initialize drag handler
59621
+ const onDragStart = createDragger(onResize, blankPreview);
59622
+ onDragStart(event);
59623
+
59624
+ // mitigate auto columns on the grid that
59625
+ // has a offset of 16px (1rem) to both side
59626
+ const columnNode = getColumnNode(target);
59627
+ const startWidth = columnNode.getBoundingClientRect().width + GRID_OFFSET_PX;
59628
+ context.current.startColumns = asColumns(startWidth, parent);
59629
+ setResizing(target, position);
59630
+ };
59631
+ const onResizeEnd = () => {
59632
+ const {
59633
+ layout = {}
59634
+ } = field;
59635
+ if (context.current.newColumns) {
59636
+ modeling.editFormField(field, 'layout', {
59637
+ ...layout,
59638
+ columns: context.current.newColumns
59639
+ });
59640
+ }
59641
+ const target = getElementNode(field);
59642
+ unsetResizing(target, position);
59643
+ context.current.newColumns = null;
59644
+
59645
+ // remove blank preview
59646
+ const blankPreview = getDragPreviewImage(getParent(target));
59647
+ blankPreview.remove();
59648
+ };
59649
+ if (field.type === 'default') {
59650
+ return null;
59651
+ }
59652
+ return e$1("div", {
59653
+ ref: ref,
59654
+ class: classNames('fjs-field-resize-handle', 'fjs-field-resize-handle-' + position, DRAG_NO_MOVE_CLS),
59655
+ draggable: true,
59656
+ onDragStart: onResizeStart,
59657
+ onDragEnd: onResizeEnd
59658
+ });
59659
+ }
59660
+
59661
+ // helper //////
59662
+
59663
+ function asColumns(width, parent) {
59664
+ const totalWidth = parent.getBoundingClientRect().width;
59665
+ const oneColumn = 1 / 16 * totalWidth;
59666
+ return Math.round(width / oneColumn);
59667
+ }
59668
+ function calculateNewColumns(node, currentColumns, deltaX, position) {
59669
+ const parent = getParent(node);
59670
+
59671
+ // invert delta if we are resizing from the left
59672
+ if (position === 'left') {
59673
+ deltaX = deltaX * -1;
59674
+ }
59675
+ const deltaColumns = asColumns(deltaX, parent);
59676
+ return currentColumns + deltaColumns;
59677
+ }
59678
+ function getParent(node) {
59679
+ return node.closest('.fjs-layout-row');
59680
+ }
59681
+ function removeMatching(node, regex) {
59682
+ return classes(node).removeMatching(regex);
59683
+ }
59684
+ function getColumnNode(node) {
59685
+ return node.closest('.fjs-layout-column');
59686
+ }
59687
+ function getElementNode(field) {
59688
+ return query('.fjs-element[data-id="' + field.id + '"]');
59689
+ }
59690
+ function getDragPreviewImage(node) {
59691
+ return query('.fjs-resize-drag-preview', node);
59692
+ }
59693
+ function setResizing(node, position) {
59694
+ classes(node).add(ELEMENT_RESIZING_CLS + '-' + position);
59695
+ }
59696
+ function unsetResizing(node, position) {
59697
+ classes(node).remove(ELEMENT_RESIZING_CLS + '-' + position);
59698
+ }
59232
59699
  function ContextPad(props) {
59233
59700
  if (!props.children) {
59234
59701
  return null;
@@ -59241,7 +59708,7 @@
59241
59708
  function Empty(props) {
59242
59709
  return null;
59243
59710
  }
59244
- function Element$1(props) {
59711
+ function Element(props) {
59245
59712
  const eventBus = useService$1('eventBus'),
59246
59713
  formEditor = useService$1('formEditor'),
59247
59714
  formFieldRegistry = useService$1('formFieldRegistry'),
@@ -59300,9 +59767,15 @@
59300
59767
  children: selection.isSelected(field) && field.type !== 'default' ? e$1("button", {
59301
59768
  class: "fjs-context-pad-item",
59302
59769
  onClick: onRemove,
59303
- children: e$1(ListDeleteIcon, {})
59770
+ children: e$1(DeleteIcon$1, {})
59304
59771
  }) : null
59305
- }), props.children]
59772
+ }), props.children, e$1(FieldResizer, {
59773
+ position: "left",
59774
+ field: field
59775
+ }), e$1(FieldResizer, {
59776
+ position: "right",
59777
+ field: field
59778
+ })]
59306
59779
  });
59307
59780
  }
59308
59781
  function DebugColumns(props) {
@@ -59387,8 +59860,12 @@
59387
59860
  propertiesPanel = useService$1('propertiesPanel'),
59388
59861
  propertiesPanelConfig = useService$1('config.propertiesPanel');
59389
59862
  const {
59390
- schema
59863
+ schema,
59864
+ properties
59391
59865
  } = formEditor._getState();
59866
+ const {
59867
+ ariaLabel
59868
+ } = properties;
59392
59869
  const formContainerRef = s$1(null);
59393
59870
  const paletteRef = s$1(null);
59394
59871
  const propertiesPanelRef = s$1(null);
@@ -59460,7 +59937,7 @@
59460
59937
  const formRenderContext = {
59461
59938
  Children,
59462
59939
  Column,
59463
- Element: Element$1,
59940
+ Element,
59464
59941
  Empty,
59465
59942
  Row
59466
59943
  };
@@ -59474,6 +59951,7 @@
59474
59951
  data: {},
59475
59952
  errors: {},
59476
59953
  properties: {
59954
+ ariaLabel,
59477
59955
  readOnly: true
59478
59956
  },
59479
59957
  schema
@@ -59656,6 +60134,13 @@
59656
60134
  formLayoutValidator: ['type', FormLayoutValidator],
59657
60135
  fieldFactory: ['type', FieldFactory]
59658
60136
  };
60137
+
60138
+ /**
60139
+ * @typedef {import('didi').Injector} Injector
60140
+ *
60141
+ * @typedef {import('../../core/EventBus').default} EventBus
60142
+ */
60143
+
59659
60144
  var NOT_REGISTERED_ERROR = 'is not a registered action',
59660
60145
  IS_REGISTERED_ERROR = 'is already registered';
59661
60146
 
@@ -59785,10 +60270,10 @@
59785
60270
  /**
59786
60271
  * Triggers a registered action
59787
60272
  *
59788
- * @param {string} action
59789
- * @param {Object} opts
60273
+ * @param {string} action
60274
+ * @param {Object} opts
59790
60275
  *
59791
- * @return {Unknown} Returns what the registered listener returns
60276
+ * @return {unknown} Returns what the registered listener returns
59792
60277
  */
59793
60278
  EditorActions.prototype.trigger = function (action, opts) {
59794
60279
  if (!this._actions[action]) {
@@ -59817,7 +60302,7 @@
59817
60302
  * editorActions.isRegistered('spaceTool'); // true
59818
60303
  * ´´´
59819
60304
  *
59820
- * @param {Object} actions
60305
+ * @param {Object} actions
59821
60306
  */
59822
60307
  EditorActions.prototype.register = function (actions, listener) {
59823
60308
  var self = this;
@@ -59832,8 +60317,8 @@
59832
60317
  /**
59833
60318
  * Registers a listener to an action key
59834
60319
  *
59835
- * @param {string} action
59836
- * @param {Function} listener
60320
+ * @param {string} action
60321
+ * @param {Function} listener
59837
60322
  */
59838
60323
  EditorActions.prototype._registerAction = function (action, listener) {
59839
60324
  if (this.isRegistered(action)) {
@@ -59876,6 +60361,10 @@
59876
60361
  function error(action, message) {
59877
60362
  return new Error(action + ' ' + message);
59878
60363
  }
60364
+
60365
+ /**
60366
+ * @type { import('didi').ModuleDeclaration }
60367
+ */
59879
60368
  var EditorActionsModule$1 = {
59880
60369
  __init__: ['editorActions'],
59881
60370
  editorActions: ['type', EditorActions]
@@ -59931,10 +60420,10 @@
59931
60420
  __init__: ['dragging'],
59932
60421
  dragging: ['type', Dragging]
59933
60422
  };
59934
- var KEYS_COPY = ['c', 'C', 'KeyC'];
59935
- var KEYS_PASTE = ['v', 'V', 'KeyV'];
59936
- var KEYS_REDO$1 = ['y', 'Y', 'KeyY'];
59937
- var KEYS_UNDO$1 = ['z', 'Z', 'KeyZ'];
60423
+ var KEYS_COPY = ['c', 'C'];
60424
+ var KEYS_PASTE = ['v', 'V'];
60425
+ var KEYS_REDO = ['y', 'Y'];
60426
+ var KEYS_UNDO = ['z', 'Z'];
59938
60427
 
59939
60428
  /**
59940
60429
  * Returns true if event was triggered with any modifier
@@ -59959,7 +60448,7 @@
59959
60448
  /**
59960
60449
  * Checks if key pressed is one of provided keys.
59961
60450
  *
59962
- * @param {string|Array<string>} keys
60451
+ * @param {string|string[]} keys
59963
60452
  * @param {KeyboardEvent} event
59964
60453
  */
59965
60454
  function isKey(keys, event) {
@@ -59980,11 +60469,16 @@
59980
60469
  return isCmd(event) && isKey(KEYS_PASTE, event);
59981
60470
  }
59982
60471
  function isUndo(event) {
59983
- return isCmd(event) && !isShift(event) && isKey(KEYS_UNDO$1, event);
60472
+ return isCmd(event) && !isShift(event) && isKey(KEYS_UNDO, event);
59984
60473
  }
59985
60474
  function isRedo(event) {
59986
- return isCmd(event) && (isKey(KEYS_REDO$1, event) || isKey(KEYS_UNDO$1, event) && isShift(event));
60475
+ return isCmd(event) && (isKey(KEYS_REDO, event) || isKey(KEYS_UNDO, event) && isShift(event));
59987
60476
  }
60477
+
60478
+ /**
60479
+ * @typedef {import('../../core/EventBus').default} EventBus
60480
+ */
60481
+
59988
60482
  var KEYDOWN_EVENT = 'keyboard.keydown',
59989
60483
  KEYUP_EVENT = 'keyboard.keyup';
59990
60484
  var HANDLE_MODIFIER_ATTRIBUTE = 'input-handle-modified-keys';
@@ -60011,7 +60505,7 @@
60011
60505
  * A default binding for the keyboard may be specified via the
60012
60506
  * `keyboard.bindTo` configuration option.
60013
60507
  *
60014
- * @param {Config} config
60508
+ * @param {Object} config
60015
60509
  * @param {EventBus} eventBus
60016
60510
  */
60017
60511
  function Keyboard(config, eventBus) {
@@ -60139,8 +60633,6 @@
60139
60633
  return target && (matches(target, 'input, textarea') || target.contentEditable === 'true');
60140
60634
  }
60141
60635
  var LOW_PRIORITY$1 = 500;
60142
- var KEYS_REDO = ['y', 'Y', 'KeyY'];
60143
- var KEYS_UNDO = ['z', 'Z', 'KeyZ'];
60144
60636
 
60145
60637
  /**
60146
60638
  * Adds default keyboard bindings.
@@ -60270,6 +60762,10 @@
60270
60762
  }
60271
60763
  });
60272
60764
  };
60765
+
60766
+ /**
60767
+ * @type { import('didi').ModuleDeclaration }
60768
+ */
60273
60769
  var KeyboardModule$1 = {
60274
60770
  __init__: ['keyboard', 'keyboardBindings'],
60275
60771
  keyboard: ['type', Keyboard],
@@ -60794,32 +61290,47 @@
60794
61290
  }
60795
61291
  }
60796
61292
  Modeling.$inject = ['commandStack', 'eventBus', 'formEditor', 'formFieldRegistry', 'fieldFactory'];
61293
+
61294
+ /**
61295
+ * @typedef {import('../core/Types').ElementLike} ElementLike
61296
+ * @typedef {import('../core/EventBus').default} EventBus
61297
+ * @typedef {import('./CommandStack').CommandContext} CommandContext
61298
+ *
61299
+ * @typedef {string|string[]} Events
61300
+ * @typedef { (context: CommandContext) => ElementLike[] | void } HandlerFunction
61301
+ * @typedef { (context: CommandContext) => void } ComposeHandlerFunction
61302
+ */
61303
+
60797
61304
  var DEFAULT_PRIORITY = 1000;
60798
61305
 
60799
61306
  /**
60800
- * A utility that can be used to plug-in into the command execution for
61307
+ * A utility that can be used to plug into the command execution for
60801
61308
  * extension and/or validation.
60802
61309
  *
60803
- * @param {EventBus} eventBus
61310
+ * @class
61311
+ * @constructor
60804
61312
  *
60805
61313
  * @example
60806
61314
  *
60807
- * import inherits from 'inherits-browser';
60808
- *
61315
+ * ```javascript
60809
61316
  * import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
60810
61317
  *
60811
- * function CommandLogger(eventBus) {
60812
- * CommandInterceptor.call(this, eventBus);
61318
+ * class CommandLogger extends CommandInterceptor {
61319
+ * constructor(eventBus) {
61320
+ * super(eventBus);
60813
61321
  *
60814
- * this.preExecute(function(event) {
60815
- * console.log('command pre-execute', event);
61322
+ * this.preExecute('shape.create', (event) => {
61323
+ * console.log('commandStack.shape-create.preExecute', event);
60816
61324
  * });
60817
61325
  * }
61326
+ * ```
60818
61327
  *
60819
- * inherits(CommandLogger, CommandInterceptor);
60820
- *
61328
+ * @param {EventBus} eventBus
60821
61329
  */
60822
61330
  function CommandInterceptor(eventBus) {
61331
+ /**
61332
+ * @type {EventBus}
61333
+ */
60823
61334
  this._eventBus = eventBus;
60824
61335
  }
60825
61336
  CommandInterceptor.$inject = ['eventBus'];
@@ -60830,15 +61341,14 @@
60830
61341
  }
60831
61342
 
60832
61343
  /**
60833
- * Register an interceptor for a command execution
61344
+ * Intercept a command during one of the phases.
60834
61345
  *
60835
- * @param {string|Array<string>} [events] list of commands to register on
60836
- * @param {string} [hook] command hook, i.e. preExecute, executed to listen on
60837
- * @param {number} [priority] the priority on which to hook into the execution
60838
- * @param {Function} handlerFn interceptor to be invoked with (event)
60839
- * @param {boolean} unwrap if true, unwrap the event and pass (context, command, event) to the
60840
- * listener instead
60841
- * @param {Object} [that] Pass context (`this`) to the handler function
61346
+ * @param {Events} [events] command(s) to intercept
61347
+ * @param {string} [hook] phase to intercept
61348
+ * @param {number} [priority]
61349
+ * @param {ComposeHandlerFunction|HandlerFunction} handlerFn
61350
+ * @param {boolean} [unwrap] whether the event should be unwrapped
61351
+ * @param {any} [that]
60842
61352
  */
60843
61353
  CommandInterceptor.prototype.on = function (events, hook, priority, handlerFn, unwrap, that) {
60844
61354
  if (isFunction(hook) || isNumber(hook)) {
@@ -60873,28 +61383,130 @@
60873
61383
  eventBus.on(fullEvent, priority, unwrap ? unwrapEvent(handlerFn, that) : handlerFn, that);
60874
61384
  });
60875
61385
  };
60876
- var hooks = ['canExecute', 'preExecute', 'preExecuted', 'execute', 'executed', 'postExecute', 'postExecuted', 'revert', 'reverted'];
61386
+
61387
+ /**
61388
+ * Add a <canExecute> phase of command interceptor.
61389
+ *
61390
+ * @param {Events} [events] command(s) to intercept
61391
+ * @param {number} [priority]
61392
+ * @param {ComposeHandlerFunction|HandlerFunction} handlerFn
61393
+ * @param {boolean} [unwrap] whether the event should be unwrapped
61394
+ * @param {any} [that]
61395
+ */
61396
+ CommandInterceptor.prototype.canExecute = createHook('canExecute');
61397
+
61398
+ /**
61399
+ * Add a <preExecute> phase of command interceptor.
61400
+ *
61401
+ * @param {Events} [events] command(s) to intercept
61402
+ * @param {number} [priority]
61403
+ * @param {ComposeHandlerFunction|HandlerFunction} handlerFn
61404
+ * @param {boolean} [unwrap] whether the event should be unwrapped
61405
+ * @param {any} [that]
61406
+ */
61407
+ CommandInterceptor.prototype.preExecute = createHook('preExecute');
61408
+
61409
+ /**
61410
+ * Add a <preExecuted> phase of command interceptor.
61411
+ *
61412
+ * @param {Events} [events] command(s) to intercept
61413
+ * @param {number} [priority]
61414
+ * @param {ComposeHandlerFunction|HandlerFunction} handlerFn
61415
+ * @param {boolean} [unwrap] whether the event should be unwrapped
61416
+ * @param {any} [that]
61417
+ */
61418
+ CommandInterceptor.prototype.preExecuted = createHook('preExecuted');
61419
+
61420
+ /**
61421
+ * Add a <execute> phase of command interceptor.
61422
+ *
61423
+ * @param {Events} [events] command(s) to intercept
61424
+ * @param {number} [priority]
61425
+ * @param {ComposeHandlerFunction|HandlerFunction} handlerFn
61426
+ * @param {boolean} [unwrap] whether the event should be unwrapped
61427
+ * @param {any} [that]
61428
+ */
61429
+ CommandInterceptor.prototype.execute = createHook('execute');
61430
+
61431
+ /**
61432
+ * Add a <executed> phase of command interceptor.
61433
+ *
61434
+ * @param {Events} [events] command(s) to intercept
61435
+ * @param {number} [priority]
61436
+ * @param {ComposeHandlerFunction|HandlerFunction} handlerFn
61437
+ * @param {boolean} [unwrap] whether the event should be unwrapped
61438
+ * @param {any} [that]
61439
+ */
61440
+ CommandInterceptor.prototype.executed = createHook('executed');
61441
+
61442
+ /**
61443
+ * Add a <postExecute> phase of command interceptor.
61444
+ *
61445
+ * @param {Events} [events] command(s) to intercept
61446
+ * @param {number} [priority]
61447
+ * @param {ComposeHandlerFunction|HandlerFunction} handlerFn
61448
+ * @param {boolean} [unwrap] whether the event should be unwrapped
61449
+ * @param {any} [that]
61450
+ */
61451
+ CommandInterceptor.prototype.postExecute = createHook('postExecute');
61452
+
61453
+ /**
61454
+ * Add a <postExecuted> phase of command interceptor.
61455
+ *
61456
+ * @param {Events} [events] command(s) to intercept
61457
+ * @param {number} [priority]
61458
+ * @param {ComposeHandlerFunction|HandlerFunction} handlerFn
61459
+ * @param {boolean} [unwrap] whether the event should be unwrapped
61460
+ * @param {any} [that]
61461
+ */
61462
+ CommandInterceptor.prototype.postExecuted = createHook('postExecuted');
61463
+
61464
+ /**
61465
+ * Add a <revert> phase of command interceptor.
61466
+ *
61467
+ * @param {Events} [events] command(s) to intercept
61468
+ * @param {number} [priority]
61469
+ * @param {ComposeHandlerFunction|HandlerFunction} handlerFn
61470
+ * @param {boolean} [unwrap] whether the event should be unwrapped
61471
+ * @param {any} [that]
61472
+ */
61473
+ CommandInterceptor.prototype.revert = createHook('revert');
61474
+
61475
+ /**
61476
+ * Add a <reverted> phase of command interceptor.
61477
+ *
61478
+ * @param {Events} [events] command(s) to intercept
61479
+ * @param {number} [priority]
61480
+ * @param {ComposeHandlerFunction|HandlerFunction} handlerFn
61481
+ * @param {boolean} [unwrap] whether the event should be unwrapped
61482
+ * @param {any} [that]
61483
+ */
61484
+ CommandInterceptor.prototype.reverted = createHook('reverted');
60877
61485
 
60878
61486
  /*
60879
- * Install hook shortcuts
61487
+ * Add prototype methods for each phase of command execution (e.g. execute,
61488
+ * revert).
61489
+ *
61490
+ * @param {string} hook
60880
61491
  *
60881
- * This will generate the CommandInterceptor#(preExecute|...|reverted) methods
60882
- * which will in term forward to CommandInterceptor#on.
61492
+ * @return { (
61493
+ * events?: Events,
61494
+ * priority?: number,
61495
+ * handlerFn: ComposeHandlerFunction|HandlerFunction,
61496
+ * unwrap?: boolean
61497
+ * ) => any }
60883
61498
  */
60884
- forEach(hooks, function (hook) {
61499
+ function createHook(hook) {
60885
61500
  /**
60886
- * {canExecute|preExecute|preExecuted|execute|executed|postExecute|postExecuted|revert|reverted}
61501
+ * @this {CommandInterceptor}
60887
61502
  *
60888
- * A named hook for plugging into the command execution
60889
- *
60890
- * @param {string|Array<string>} [events] list of commands to register on
60891
- * @param {number} [priority] the priority on which to hook into the execution
60892
- * @param {Function} handlerFn interceptor to be invoked with (event)
60893
- * @param {boolean} [unwrap=false] if true, unwrap the event and pass (context, command, event) to the
60894
- * listener instead
60895
- * @param {Object} [that] Pass context (`this`) to the handler function
61503
+ * @param {Events} [events]
61504
+ * @param {number} [priority]
61505
+ * @param {ComposeHandlerFunction|HandlerFunction} handlerFn
61506
+ * @param {boolean} [unwrap]
61507
+ * @param {any} [that]
60896
61508
  */
60897
- CommandInterceptor.prototype[hook] = function (events, priority, handlerFn, unwrap, that) {
61509
+ const hookFn = function (events, priority, handlerFn, unwrap, that) {
60898
61510
  if (isFunction(events) || isNumber(events)) {
60899
61511
  that = unwrap;
60900
61512
  unwrap = handlerFn;
@@ -60904,7 +61516,8 @@
60904
61516
  }
60905
61517
  this.on(events, hook, priority, handlerFn, unwrap, that);
60906
61518
  };
60907
- });
61519
+ return hookFn;
61520
+ }
60908
61521
  class FormLayoutUpdater extends CommandInterceptor {
60909
61522
  constructor(eventBus, formLayouter, modeling, formEditor) {
60910
61523
  super(eventBus);
@@ -61037,6 +61650,34 @@
61037
61650
  validateBehavior: ['type', ValidateBehavior]
61038
61651
  };
61039
61652
 
61653
+ /**
61654
+ * @typedef {import('didi').Injector} Injector
61655
+ *
61656
+ * @typedef {import('../core/Types').ElementLike} ElementLike
61657
+ *
61658
+ * @typedef {import('../core/EventBus').default} EventBus
61659
+ * @typedef {import('./CommandHandler').default} CommandHandler
61660
+ *
61661
+ * @typedef { any } CommandContext
61662
+ * @typedef { {
61663
+ * new (...args: any[]) : CommandHandler
61664
+ * } } CommandHandlerConstructor
61665
+ * @typedef { {
61666
+ * [key: string]: CommandHandler;
61667
+ * } } CommandHandlerMap
61668
+ * @typedef { {
61669
+ * command: string;
61670
+ * context: any;
61671
+ * id?: any;
61672
+ * } } CommandStackAction
61673
+ * @typedef { {
61674
+ * actions: CommandStackAction[];
61675
+ * dirty: ElementLike[];
61676
+ * trigger: 'execute' | 'undo' | 'redo' | 'clear' | null;
61677
+ * atomic?: boolean;
61678
+ * } } CurrentExecution
61679
+ */
61680
+
61040
61681
  /**
61041
61682
  * A service that offers un- and redoable execution of commands.
61042
61683
  *
@@ -61087,7 +61728,7 @@
61087
61728
  * got changed during the `execute` and `revert` operations.
61088
61729
  *
61089
61730
  * Command handlers may execute other modeling operations (and thus
61090
- * commands) in their `preExecute` and `postExecute` phases. The command
61731
+ * commands) in their `preExecute(d)` and `postExecute(d)` phases. The command
61091
61732
  * stack will properly group all commands together into a logical unit
61092
61733
  * that may be re- and undone atomically.
61093
61734
  *
@@ -61117,14 +61758,14 @@
61117
61758
  /**
61118
61759
  * A map of all registered command handlers.
61119
61760
  *
61120
- * @type {Object}
61761
+ * @type {CommandHandlerMap}
61121
61762
  */
61122
61763
  this._handlerMap = {};
61123
61764
 
61124
61765
  /**
61125
61766
  * A stack containing all re/undoable actions on the diagram
61126
61767
  *
61127
- * @type {Array<Object>}
61768
+ * @type {CommandStackAction[]}
61128
61769
  */
61129
61770
  this._stack = [];
61130
61771
 
@@ -61138,18 +61779,27 @@
61138
61779
  /**
61139
61780
  * Current active commandStack execution
61140
61781
  *
61141
- * @type {Object}
61142
- * @property {Object[]} actions
61143
- * @property {Object[]} dirty
61144
- * @property { 'undo' | 'redo' | 'clear' | 'execute' | null } trigger the cause of the current excecution
61782
+ * @type {CurrentExecution}
61145
61783
  */
61146
61784
  this._currentExecution = {
61147
61785
  actions: [],
61148
61786
  dirty: [],
61149
61787
  trigger: null
61150
61788
  };
61789
+
61790
+ /**
61791
+ * @type {Injector}
61792
+ */
61151
61793
  this._injector = injector;
61794
+
61795
+ /**
61796
+ * @type EventBus
61797
+ */
61152
61798
  this._eventBus = eventBus;
61799
+
61800
+ /**
61801
+ * @type { number }
61802
+ */
61153
61803
  this._uid = 1;
61154
61804
  eventBus.on(['diagram.destroy', 'diagram.clear'], function () {
61155
61805
  this.clear(false);
@@ -61158,10 +61808,10 @@
61158
61808
  CommandStack.$inject = ['eventBus', 'injector'];
61159
61809
 
61160
61810
  /**
61161
- * Execute a command
61811
+ * Execute a command.
61162
61812
  *
61163
- * @param {string} command the command to execute
61164
- * @param {Object} context the environment to execute the command in
61813
+ * @param {string} command The command to execute.
61814
+ * @param {CommandContext} context The context with which to execute the command.
61165
61815
  */
61166
61816
  CommandStack.prototype.execute = function (command, context) {
61167
61817
  if (!command) {
@@ -61174,11 +61824,11 @@
61174
61824
  };
61175
61825
  this._pushAction(action);
61176
61826
  this._internalExecute(action);
61177
- this._popAction(action);
61827
+ this._popAction();
61178
61828
  };
61179
61829
 
61180
61830
  /**
61181
- * Ask whether a given command can be executed.
61831
+ * Check whether a command can be executed.
61182
61832
  *
61183
61833
  * Implementors may hook into the mechanism on two ways:
61184
61834
  *
@@ -61192,10 +61842,10 @@
61192
61842
  * If the method {@link CommandHandler#canExecute} is implemented in a handler
61193
61843
  * it will be called to figure out whether the execution is allowed.
61194
61844
  *
61195
- * @param {string} command the command to execute
61196
- * @param {Object} context the environment to execute the command in
61845
+ * @param {string} command The command to execute.
61846
+ * @param {CommandContext} context The context with which to execute the command.
61197
61847
  *
61198
- * @return {boolean} true if the command can be executed
61848
+ * @return {boolean} Whether the command can be executed with the given context.
61199
61849
  */
61200
61850
  CommandStack.prototype.canExecute = function (command, context) {
61201
61851
  const action = {
@@ -61219,7 +61869,9 @@
61219
61869
  };
61220
61870
 
61221
61871
  /**
61222
- * Clear the command stack, erasing all undo / redo history
61872
+ * Clear the command stack, erasing all undo / redo history.
61873
+ *
61874
+ * @param {boolean} [emit=true] Whether to fire an event. Defaults to `true`.
61223
61875
  */
61224
61876
  CommandStack.prototype.clear = function (emit) {
61225
61877
  this._stack.length = 0;
@@ -61274,21 +61926,21 @@
61274
61926
  };
61275
61927
 
61276
61928
  /**
61277
- * Register a handler instance with the command stack
61929
+ * Register a handler instance with the command stack.
61278
61930
  *
61279
- * @param {string} command
61280
- * @param {CommandHandler} handler
61931
+ * @param {string} command Command to be executed.
61932
+ * @param {CommandHandler} handler Handler to execute the command.
61281
61933
  */
61282
61934
  CommandStack.prototype.register = function (command, handler) {
61283
61935
  this._setHandler(command, handler);
61284
61936
  };
61285
61937
 
61286
61938
  /**
61287
- * Register a handler type with the command stack
61288
- * by instantiating it and injecting its dependencies.
61939
+ * Register a handler type with the command stack by instantiating it and
61940
+ * injecting its dependencies.
61289
61941
  *
61290
- * @param {string} command
61291
- * @param {Function} a constructor for a {@link CommandHandler}
61942
+ * @param {string} command Command to be executed.
61943
+ * @param {CommandHandlerConstructor} handlerCls Constructor to instantiate a {@link CommandHandler}.
61292
61944
  */
61293
61945
  CommandStack.prototype.registerHandler = function (command, handlerCls) {
61294
61946
  if (!command || !handlerCls) {
@@ -61297,9 +61949,17 @@
61297
61949
  const handler = this._injector.instantiate(handlerCls);
61298
61950
  this.register(command, handler);
61299
61951
  };
61952
+
61953
+ /**
61954
+ * @return {boolean}
61955
+ */
61300
61956
  CommandStack.prototype.canUndo = function () {
61301
61957
  return !!this._getUndoAction();
61302
61958
  };
61959
+
61960
+ /**
61961
+ * @return {boolean}
61962
+ */
61303
61963
  CommandStack.prototype.canRedo = function () {
61304
61964
  return !!this._getRedoAction();
61305
61965
  };
@@ -61393,7 +62053,7 @@
61393
62053
  }
61394
62054
  this._fire(command, 'postExecuted', action);
61395
62055
  }
61396
- this._popAction(action);
62056
+ this._popAction();
61397
62057
  };
61398
62058
  CommandStack.prototype._pushAction = function (action) {
61399
62059
  const execution = this._currentExecution,
@@ -61453,6 +62113,10 @@
61453
62113
  }
61454
62114
  this._handlerMap[command] = handler;
61455
62115
  };
62116
+
62117
+ /**
62118
+ * @type { import('didi').ModuleDeclaration }
62119
+ */
61456
62120
  var commandModule = {
61457
62121
  commandStack: ['type', CommandStack]
61458
62122
  };
@@ -64185,7 +64849,7 @@
64185
64849
  },
64186
64850
  // todo(pinussilvestrus): make options dependant on field type
64187
64851
  // cf. https://github.com/bpmn-io/form-js/issues/575
64188
- ...[2, 4, 6, 8, 10, 12, 14, 16].map(asOption)];
64852
+ ...asArray(16).filter(i => i >= MIN_COLUMNS).map(asOption)];
64189
64853
  };
64190
64854
  return SelectEntry({
64191
64855
  debounce,
@@ -64207,6 +64871,11 @@
64207
64871
  label: number.toString()
64208
64872
  };
64209
64873
  }
64874
+ function asArray(length) {
64875
+ return Array.from({
64876
+ length
64877
+ }).map((_, i) => i + 1);
64878
+ }
64210
64879
  function DescriptionEntry(props) {
64211
64880
  const {
64212
64881
  editField,
@@ -68237,7 +68906,8 @@
68237
68906
 
68238
68907
  function JSONEditor(options = {}) {
68239
68908
  const {
68240
- readonly = false
68909
+ readonly = false,
68910
+ contentAttributes = {}
68241
68911
  } = options;
68242
68912
  const emitter = mitt();
68243
68913
  let language = new Compartment().of(json());
@@ -68264,14 +68934,15 @@
68264
68934
  }
68265
68935
  });
68266
68936
  const editable = EditorView.editable.of(!readonly);
68937
+ const contentAttributesExtension = EditorView.contentAttributes.of(contentAttributes);
68267
68938
  const view = new EditorView({
68268
- state: createState('', [updateListener, editable])
68939
+ state: createState('', [updateListener, editable, contentAttributesExtension])
68269
68940
  });
68270
68941
  view.setValue = function (value) {
68271
- this.setState(createState(value, [updateListener, editable]));
68942
+ this.setState(createState(value, [updateListener, editable, contentAttributesExtension]));
68272
68943
  };
68273
68944
  view.setVariables = function (variables) {
68274
- this.setState(createState(view.state.doc.toString(), [updateListener, editable], variables));
68945
+ this.setState(createState(view.state.doc.toString(), [updateListener, editable, contentAttributesExtension], variables));
68275
68946
  };
68276
68947
  return view;
68277
68948
  }
@@ -68338,7 +69009,9 @@
68338
69009
  const {
68339
69010
  actions: actionsConfig = {},
68340
69011
  emit,
68341
- exporter: exporterConfig = {}
69012
+ exporter: exporterConfig = {},
69013
+ viewerProperties = {},
69014
+ editorProperties = {}
68342
69015
  } = props;
68343
69016
  const {
68344
69017
  display: displayActions = true
@@ -68386,13 +69059,24 @@
68386
69059
  }, [props.schema]);
68387
69060
  y(() => {
68388
69061
  const dataEditor = dataEditorRef.current = new JSONEditor({
68389
- value: toString(data)
69062
+ value: toString(data),
69063
+ contentAttributes: {
69064
+ 'aria-label': 'Form Input'
69065
+ }
68390
69066
  });
68391
69067
  const resultView = resultViewRef.current = new JSONEditor({
68392
69068
  readonly: true,
68393
- value: toString(resultData)
69069
+ value: toString(resultData),
69070
+ contentAttributes: {
69071
+ 'aria-label': 'Form Output'
69072
+ }
69073
+ });
69074
+ const form = formRef.current = new Form({
69075
+ properties: {
69076
+ ...viewerProperties,
69077
+ 'ariaLabel': 'Form Preview'
69078
+ }
68394
69079
  });
68395
- const form = formRef.current = new Form();
68396
69080
  const formEditor = formEditorRef.current = new FormEditor({
68397
69081
  renderer: {
68398
69082
  compact: true
@@ -68403,7 +69087,11 @@
68403
69087
  propertiesPanel: {
68404
69088
  parent: propertiesPanelContainerRef.current
68405
69089
  },
68406
- exporter: exporterConfig
69090
+ exporter: exporterConfig,
69091
+ properties: {
69092
+ ...editorProperties,
69093
+ 'ariaLabel': 'Form Definition'
69094
+ }
68407
69095
  });
68408
69096
  paletteRef.current = formEditor.get('palette');
68409
69097
  propertiesPanelRef.current = formEditor.get('propertiesPanel');