@bpmn-io/form-js-editor 1.8.3 → 1.8.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1416,7 +1416,6 @@ const SlotFillRoot = props => {
1416
1416
  return jsx(SlotContext.Provider, {
1417
1417
  value: slotContext,
1418
1418
  children: jsx(FillContext.Provider, {
1419
- /* @ts-expect-error */
1420
1419
  value: fillContext,
1421
1420
  children: props.children
1422
1421
  })
@@ -6149,6 +6148,7 @@ const useBufferedFocus = function (editor, ref) {
6149
6148
  };
6150
6149
  const CodeEditor = forwardRef((props, ref) => {
6151
6150
  const {
6151
+ contentAttributes,
6152
6152
  enableGutters,
6153
6153
  value,
6154
6154
  onInput,
@@ -6194,7 +6194,8 @@ const CodeEditor = forwardRef((props, ref) => {
6194
6194
  tooltipContainer: tooltipContainer,
6195
6195
  value: localValue,
6196
6196
  variables: variables,
6197
- extensions: [...(enableGutters ? [lineNumbers()] : []), EditorView.lineWrapping]
6197
+ extensions: [...(enableGutters ? [lineNumbers()] : []), EditorView.lineWrapping],
6198
+ contentAttributes
6198
6199
  });
6199
6200
  setEditor(editor);
6200
6201
  return () => {
@@ -7277,9 +7278,12 @@ function FeelTextfieldComponent(props) {
7277
7278
  disabled: feel !== 'optional' || disabled,
7278
7279
  onClick: handleFeelToggle
7279
7280
  }), feelActive ? jsx(CodeEditor, {
7280
- id: prefixId$5(id),
7281
7281
  name: id,
7282
7282
  onInput: handleLocalInput,
7283
+ contentAttributes: {
7284
+ 'id': prefixId$5(id),
7285
+ 'aria-label': label
7286
+ },
7283
7287
  disabled: disabled,
7284
7288
  popupOpen: popuOpen,
7285
7289
  onFeelToggle: () => {
@@ -8977,15 +8981,15 @@ function textToLabel(text) {
8977
8981
  }
8978
8982
 
8979
8983
  /**
8980
- * @param {string} path
8981
- */
8984
+ * @param {string} path
8985
+ */
8982
8986
  function isValidDotPath(path) {
8983
8987
  return /^\w+(\.\w+)*$/.test(path);
8984
8988
  }
8985
8989
 
8986
8990
  /**
8987
- * @param {string} path
8988
- */
8991
+ * @param {string} path
8992
+ */
8989
8993
  function isProhibitedPath(path) {
8990
8994
  const prohibitedSegments = ['__proto__', 'prototype', 'constructor'];
8991
8995
  return path.split('.').some(segment => prohibitedSegments.includes(segment));
@@ -9013,8 +9017,8 @@ function hasOptionsGroupsConfigured(formFieldDefinition) {
9013
9017
  }
9014
9018
 
9015
9019
  /**
9016
- * @param {string} path
9017
- */
9020
+ * @param {string} path
9021
+ */
9018
9022
  function hasIntegerPathSegment(path) {
9019
9023
  return path.split('.').some(segment => /^\d+$/.test(segment));
9020
9024
  }
@@ -10461,9 +10465,9 @@ function Height(props) {
10461
10465
  // helpers //////////
10462
10466
 
10463
10467
  /**
10464
- * @param {number|void} value
10465
- * @returns {string|null}
10466
- */
10468
+ * @param {number|void} value
10469
+ * @returns {string|null}
10470
+ */
10467
10471
  const validate$7 = value => {
10468
10472
  if (typeof value !== 'number') {
10469
10473
  return 'A number is required.';
@@ -10543,7 +10547,7 @@ function getTooltip$1() {
10543
10547
  }), jsx("p", {
10544
10548
  children: "Please make sure that the URL is safe as it might impose security risks."
10545
10549
  }), jsxs("p", {
10546
- children: ["Not all external sources can be displayed in the iFrame. Read more about it in the ", jsx("a", {
10550
+ children: ["Not all external sources can be displayed in the iFrame. Read more about it in the", ' ', jsx("a", {
10547
10551
  target: "_blank",
10548
10552
  href: "https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options",
10549
10553
  children: "X-FRAME-OPTIONS documentation"
@@ -10553,9 +10557,9 @@ function getTooltip$1() {
10553
10557
  }
10554
10558
 
10555
10559
  /**
10556
- * @param {string|void} value
10557
- * @returns {string|null}
10558
- */
10560
+ * @param {string|void} value
10561
+ * @returns {string|null}
10562
+ */
10559
10563
  const validate$6 = value => {
10560
10564
  if (!value || value.startsWith('=')) {
10561
10565
  return;
@@ -10658,7 +10662,7 @@ function Text(props) {
10658
10662
  });
10659
10663
  }
10660
10664
  const description$1 = jsxs(Fragment$1, {
10661
- children: ["Supports markdown and templating. ", jsx("a", {
10665
+ children: ["Supports markdown and templating.", ' ', jsx("a", {
10662
10666
  href: "https://docs.camunda.io/docs/components/modeler/forms/form-element-library/forms-element-library-text/",
10663
10667
  target: "_blank",
10664
10668
  children: "Learn more"
@@ -10714,17 +10718,17 @@ function Content(props) {
10714
10718
  // helpers //////////
10715
10719
 
10716
10720
  const description = jsxs(Fragment$1, {
10717
- children: ["Supports HTML, styling, and templating. Styles are automatically scoped to the HTML component. ", jsx("a", {
10718
- href: "https://docs.camunda.io/docs/next/components/modeler/forms/form-element-library/forms-element-library-html/",
10721
+ children: ["Supports HTML, styling, and templating. Styles are automatically scoped to the HTML component.", ' ', jsx("a", {
10722
+ href: "https://docs.camunda.io/docs/components/modeler/forms/form-element-library/forms-element-library-html/",
10719
10723
  target: "_blank",
10720
10724
  children: "Learn more"
10721
10725
  })]
10722
10726
  });
10723
10727
 
10724
10728
  /**
10725
- * @param {string|void} value
10726
- * @returns {string|null}
10727
- */
10729
+ * @param {string|void} value
10730
+ * @returns {string|null}
10731
+ */
10728
10732
  const validate$5 = value => {
10729
10733
  // allow empty state
10730
10734
  if (typeof value !== 'string' || value === '') {
@@ -11571,9 +11575,9 @@ function InputValuesKey(props) {
11571
11575
  // helpers //////////
11572
11576
 
11573
11577
  /**
11574
- * @param {string|void} value
11575
- * @returns {string|null}
11576
- */
11578
+ * @param {string|void} value
11579
+ * @returns {string|null}
11580
+ */
11577
11581
  const validate$4 = value => {
11578
11582
  if (typeof value !== 'string' || value.length === 0) {
11579
11583
  return 'Must not be empty.';
@@ -12025,9 +12029,9 @@ function Source(props) {
12025
12029
  // helper ////////////////
12026
12030
 
12027
12031
  /**
12028
- * @param {string|void} value
12029
- * @returns {string|null}
12030
- */
12032
+ * @param {string|void} value
12033
+ * @returns {string|null}
12034
+ */
12031
12035
  const validate$3 = value => {
12032
12036
  if (!isString(value) || value.length === 0) {
12033
12037
  return 'Must not be empty.';
@@ -12073,8 +12077,8 @@ function Pagination(props) {
12073
12077
  };
12074
12078
 
12075
12079
  /**
12076
- * @param {boolean} value
12077
- */
12080
+ * @param {boolean} value
12081
+ */
12078
12082
  const setValue = value => {
12079
12083
  value ? editField(field, path, defaultRowCount) : editField(field, path, undefined);
12080
12084
  };
@@ -12139,9 +12143,9 @@ function RowCount(props) {
12139
12143
  // helpers //////////
12140
12144
 
12141
12145
  /**
12142
- * @param {string|void} value
12143
- * @returns {string|null}
12144
- */
12146
+ * @param {string|void} value
12147
+ * @returns {string|null}
12148
+ */
12145
12149
  const validate$2 = value => {
12146
12150
  if (isNil(value)) {
12147
12151
  return null;
@@ -12286,10 +12290,10 @@ function ColumnsExpression(props) {
12286
12290
  };
12287
12291
 
12288
12292
  /**
12289
- * @param {string|void} value
12290
- * @param {string|void} error
12291
- * @returns {void}
12292
- */
12293
+ * @param {string|void} value
12294
+ * @param {string|void} error
12295
+ * @returns {void}
12296
+ */
12293
12297
  const setValue = (value, error) => {
12294
12298
  if (error) {
12295
12299
  return;
@@ -12323,9 +12327,9 @@ function ColumnsExpression(props) {
12323
12327
  // helpers //////////
12324
12328
 
12325
12329
  /**
12326
- * @param {string|void} value
12327
- * @returns {string|null}
12328
- */
12330
+ * @param {string|void} value
12331
+ * @returns {string|null}
12332
+ */
12329
12333
  const validate$1 = value => {
12330
12334
  if (!isString(value) || value.length === 0 || value === '=') {
12331
12335
  return 'Must not be empty.';
@@ -12370,10 +12374,10 @@ function Label(props) {
12370
12374
  const debounce = useService('debounce');
12371
12375
 
12372
12376
  /**
12373
- * @param {string|void} value
12374
- * @param {string|void} error
12375
- * @returns {void}
12376
- */
12377
+ * @param {string|void} value
12378
+ * @param {string|void} error
12379
+ * @returns {void}
12380
+ */
12377
12381
  const setValue = (value, error) => {
12378
12382
  if (error) {
12379
12383
  return;
@@ -12403,10 +12407,10 @@ function Key(props) {
12403
12407
  const debounce = useService('debounce');
12404
12408
 
12405
12409
  /**
12406
- * @param {string|void} value
12407
- * @param {string|void} error
12408
- * @returns {void}
12409
- */
12410
+ * @param {string|void} value
12411
+ * @param {string|void} error
12412
+ * @returns {void}
12413
+ */
12410
12414
  const setValue = (value, error) => {
12411
12415
  if (error) {
12412
12416
  return;
@@ -12431,9 +12435,9 @@ function Key(props) {
12431
12435
  // helpers //////////////////////
12432
12436
 
12433
12437
  /**
12434
- * @param {string|void} value
12435
- * @returns {string|null}
12436
- */
12438
+ * @param {string|void} value
12439
+ * @returns {string|null}
12440
+ */
12437
12441
  function validate(value) {
12438
12442
  if (!isString(value) || value.length === 0) {
12439
12443
  return 'Must not be empty.';
@@ -13112,7 +13116,7 @@ const Advisory = props => {
13112
13116
  function getTooltip() {
13113
13117
  return jsx(Fragment$1, {
13114
13118
  children: jsxs("p", {
13115
- children: ["Allow the iframe to access more functionality of your browser, details regarding the various options can be found in the ", jsx("a", {
13119
+ children: ["Allow the iframe to access more functionality of your browser, details regarding the various options can be found in the", ' ', jsx("a", {
13116
13120
  target: "_blank",
13117
13121
  href: "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe",
13118
13122
  children: "MDN iFrame documentation."
@@ -13150,8 +13154,8 @@ function TableHeaderGroups(field, editField) {
13150
13154
  const areStaticColumnsEnabled = isArray(get(field, ['columns']));
13151
13155
 
13152
13156
  /**
13153
- * @type {Array<Group>}
13154
- */
13157
+ * @type {Array<Group>}
13158
+ */
13155
13159
  const groups = [{
13156
13160
  id: `${fieldId}-columnsSource`,
13157
13161
  label: 'Headers source',
@@ -13223,7 +13227,7 @@ class PropertiesProvider {
13223
13227
  return groups;
13224
13228
  }
13225
13229
  const getService = (type, strict = true) => this._injector.get(type, strict);
13226
- groups = [...groups, GeneralGroup(field, editField, getService), ...TableHeaderGroups(field, editField), SecurityAttributesGroup(field, editField), ConditionGroup(field, editField), LayoutGroup(field, editField), AppearanceGroup(field, editField), SerializationGroup(field, editField), ...OptionsGroups(field, editField, getService), ConstraintsGroup(field, editField), ValidationGroup(field, editField), CustomPropertiesGroup(field, editField)].filter(group => group != null);
13230
+ groups = [...groups, GeneralGroup(field, editField, getService), ...OptionsGroups(field, editField, getService), ...TableHeaderGroups(field, editField), SecurityAttributesGroup(field, editField), ConditionGroup(field, editField), LayoutGroup(field, editField), AppearanceGroup(field, editField), SerializationGroup(field, editField), ConstraintsGroup(field, editField), ValidationGroup(field, editField), CustomPropertiesGroup(field, editField)].filter(group => group != null);
13227
13231
  this._filterVisibleEntries(groups, field, getService);
13228
13232
 
13229
13233
  // contract: if a group has no entries or items, it should not be displayed at all
@@ -13624,16 +13628,16 @@ function exportSchema(schema, exporter, schemaVersion) {
13624
13628
  };
13625
13629
  }
13626
13630
 
13627
- /**
13628
- * @typedef { import('./types').CreateFormEditorOptions } CreateFormEditorOptions
13631
+ /**
13632
+ * @typedef { import('./types').CreateFormEditorOptions } CreateFormEditorOptions
13629
13633
  */
13630
13634
 
13631
- /**
13632
- * Create a form editor.
13633
- *
13634
- * @param {CreateFormEditorOptions} options
13635
- *
13636
- * @return {Promise<FormEditor>}
13635
+ /**
13636
+ * Create a form editor.
13637
+ *
13638
+ * @param {CreateFormEditorOptions} options
13639
+ *
13640
+ * @return {Promise<FormEditor>}
13637
13641
  */
13638
13642
  function createFormEditor(options) {
13639
13643
  const {