@bpmn-io/form-js-editor 1.8.2 → 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
@@ -1060,7 +1060,7 @@ function EditorHtml(props) {
1060
1060
  class: "fjs-form-field-placeholder",
1061
1061
  children: [jsx(Icon, {
1062
1062
  viewBox: "0 0 54 54"
1063
- }), "Html is empty"]
1063
+ }), "Html view is empty"]
1064
1064
  })
1065
1065
  });
1066
1066
  }
@@ -1071,7 +1071,7 @@ function EditorHtml(props) {
1071
1071
  class: "fjs-form-field-placeholder",
1072
1072
  children: [jsx(Icon, {
1073
1073
  viewBox: "0 0 54 54"
1074
- }), "Html is populated by an expression"]
1074
+ }), "Html view is populated by an expression"]
1075
1075
  })
1076
1076
  });
1077
1077
  }
@@ -1082,7 +1082,7 @@ function EditorHtml(props) {
1082
1082
  class: "fjs-form-field-placeholder",
1083
1083
  children: [jsx(Icon, {
1084
1084
  viewBox: "0 0 54 54"
1085
- }), "Html is templated"]
1085
+ }), "Html view is templated"]
1086
1086
  })
1087
1087
  });
1088
1088
  }
@@ -1163,13 +1163,14 @@ function EditorExpressionField(props) {
1163
1163
  field
1164
1164
  } = props;
1165
1165
  const {
1166
- expression = ''
1166
+ expression = '',
1167
+ key
1167
1168
  } = field;
1168
1169
  const Icon = iconsByType('expression');
1169
1170
  const expressionLanguage = useService$1('expressionLanguage');
1170
1171
  let placeholderContent = 'Expression is empty';
1171
1172
  if (expression.trim() && expressionLanguage.isExpression(expression)) {
1172
- placeholderContent = 'Expression';
1173
+ placeholderContent = `Expression for '${key}'`;
1173
1174
  }
1174
1175
  return jsx("div", {
1175
1176
  class: editorFormFieldClasses(type),
@@ -1415,7 +1416,6 @@ const SlotFillRoot = props => {
1415
1416
  return jsx(SlotContext.Provider, {
1416
1417
  value: slotContext,
1417
1418
  children: jsx(FillContext.Provider, {
1418
- /* @ts-expect-error */
1419
1419
  value: fillContext,
1420
1420
  children: props.children
1421
1421
  })
@@ -6148,6 +6148,7 @@ const useBufferedFocus = function (editor, ref) {
6148
6148
  };
6149
6149
  const CodeEditor = forwardRef((props, ref) => {
6150
6150
  const {
6151
+ contentAttributes,
6151
6152
  enableGutters,
6152
6153
  value,
6153
6154
  onInput,
@@ -6193,7 +6194,8 @@ const CodeEditor = forwardRef((props, ref) => {
6193
6194
  tooltipContainer: tooltipContainer,
6194
6195
  value: localValue,
6195
6196
  variables: variables,
6196
- extensions: [...(enableGutters ? [lineNumbers()] : []), EditorView.lineWrapping]
6197
+ extensions: [...(enableGutters ? [lineNumbers()] : []), EditorView.lineWrapping],
6198
+ contentAttributes
6197
6199
  });
6198
6200
  setEditor(editor);
6199
6201
  return () => {
@@ -7276,9 +7278,12 @@ function FeelTextfieldComponent(props) {
7276
7278
  disabled: feel !== 'optional' || disabled,
7277
7279
  onClick: handleFeelToggle
7278
7280
  }), feelActive ? jsx(CodeEditor, {
7279
- id: prefixId$5(id),
7280
7281
  name: id,
7281
7282
  onInput: handleLocalInput,
7283
+ contentAttributes: {
7284
+ 'id': prefixId$5(id),
7285
+ 'aria-label': label
7286
+ },
7282
7287
  disabled: disabled,
7283
7288
  popupOpen: popuOpen,
7284
7289
  onFeelToggle: () => {
@@ -8976,15 +8981,15 @@ function textToLabel(text) {
8976
8981
  }
8977
8982
 
8978
8983
  /**
8979
- * @param {string} path
8980
- */
8984
+ * @param {string} path
8985
+ */
8981
8986
  function isValidDotPath(path) {
8982
8987
  return /^\w+(\.\w+)*$/.test(path);
8983
8988
  }
8984
8989
 
8985
8990
  /**
8986
- * @param {string} path
8987
- */
8991
+ * @param {string} path
8992
+ */
8988
8993
  function isProhibitedPath(path) {
8989
8994
  const prohibitedSegments = ['__proto__', 'prototype', 'constructor'];
8990
8995
  return path.split('.').some(segment => prohibitedSegments.includes(segment));
@@ -9012,8 +9017,8 @@ function hasOptionsGroupsConfigured(formFieldDefinition) {
9012
9017
  }
9013
9018
 
9014
9019
  /**
9015
- * @param {string} path
9016
- */
9020
+ * @param {string} path
9021
+ */
9017
9022
  function hasIntegerPathSegment(path) {
9018
9023
  return path.split('.').some(segment => /^\d+$/.test(segment));
9019
9024
  }
@@ -10460,9 +10465,9 @@ function Height(props) {
10460
10465
  // helpers //////////
10461
10466
 
10462
10467
  /**
10463
- * @param {number|void} value
10464
- * @returns {string|null}
10465
- */
10468
+ * @param {number|void} value
10469
+ * @returns {string|null}
10470
+ */
10466
10471
  const validate$7 = value => {
10467
10472
  if (typeof value !== 'number') {
10468
10473
  return 'A number is required.';
@@ -10542,7 +10547,7 @@ function getTooltip$1() {
10542
10547
  }), jsx("p", {
10543
10548
  children: "Please make sure that the URL is safe as it might impose security risks."
10544
10549
  }), jsxs("p", {
10545
- 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", {
10546
10551
  target: "_blank",
10547
10552
  href: "https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options",
10548
10553
  children: "X-FRAME-OPTIONS documentation"
@@ -10552,9 +10557,9 @@ function getTooltip$1() {
10552
10557
  }
10553
10558
 
10554
10559
  /**
10555
- * @param {string|void} value
10556
- * @returns {string|null}
10557
- */
10560
+ * @param {string|void} value
10561
+ * @returns {string|null}
10562
+ */
10558
10563
  const validate$6 = value => {
10559
10564
  if (!value || value.startsWith('=')) {
10560
10565
  return;
@@ -10657,7 +10662,7 @@ function Text(props) {
10657
10662
  });
10658
10663
  }
10659
10664
  const description$1 = jsxs(Fragment$1, {
10660
- children: ["Supports markdown and templating. ", jsx("a", {
10665
+ children: ["Supports markdown and templating.", ' ', jsx("a", {
10661
10666
  href: "https://docs.camunda.io/docs/components/modeler/forms/form-element-library/forms-element-library-text/",
10662
10667
  target: "_blank",
10663
10668
  children: "Learn more"
@@ -10713,17 +10718,17 @@ function Content(props) {
10713
10718
  // helpers //////////
10714
10719
 
10715
10720
  const description = jsxs(Fragment$1, {
10716
- children: ["Supports HTML, styling, and templating. Styles are automatically scoped to the HTML component. ", jsx("a", {
10717
- 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/",
10718
10723
  target: "_blank",
10719
10724
  children: "Learn more"
10720
10725
  })]
10721
10726
  });
10722
10727
 
10723
10728
  /**
10724
- * @param {string|void} value
10725
- * @returns {string|null}
10726
- */
10729
+ * @param {string|void} value
10730
+ * @returns {string|null}
10731
+ */
10727
10732
  const validate$5 = value => {
10728
10733
  // allow empty state
10729
10734
  if (typeof value !== 'string' || value === '') {
@@ -11570,9 +11575,9 @@ function InputValuesKey(props) {
11570
11575
  // helpers //////////
11571
11576
 
11572
11577
  /**
11573
- * @param {string|void} value
11574
- * @returns {string|null}
11575
- */
11578
+ * @param {string|void} value
11579
+ * @returns {string|null}
11580
+ */
11576
11581
  const validate$4 = value => {
11577
11582
  if (typeof value !== 'string' || value.length === 0) {
11578
11583
  return 'Must not be empty.';
@@ -12024,9 +12029,9 @@ function Source(props) {
12024
12029
  // helper ////////////////
12025
12030
 
12026
12031
  /**
12027
- * @param {string|void} value
12028
- * @returns {string|null}
12029
- */
12032
+ * @param {string|void} value
12033
+ * @returns {string|null}
12034
+ */
12030
12035
  const validate$3 = value => {
12031
12036
  if (!isString(value) || value.length === 0) {
12032
12037
  return 'Must not be empty.';
@@ -12072,8 +12077,8 @@ function Pagination(props) {
12072
12077
  };
12073
12078
 
12074
12079
  /**
12075
- * @param {boolean} value
12076
- */
12080
+ * @param {boolean} value
12081
+ */
12077
12082
  const setValue = value => {
12078
12083
  value ? editField(field, path, defaultRowCount) : editField(field, path, undefined);
12079
12084
  };
@@ -12138,9 +12143,9 @@ function RowCount(props) {
12138
12143
  // helpers //////////
12139
12144
 
12140
12145
  /**
12141
- * @param {string|void} value
12142
- * @returns {string|null}
12143
- */
12146
+ * @param {string|void} value
12147
+ * @returns {string|null}
12148
+ */
12144
12149
  const validate$2 = value => {
12145
12150
  if (isNil(value)) {
12146
12151
  return null;
@@ -12285,10 +12290,10 @@ function ColumnsExpression(props) {
12285
12290
  };
12286
12291
 
12287
12292
  /**
12288
- * @param {string|void} value
12289
- * @param {string|void} error
12290
- * @returns {void}
12291
- */
12293
+ * @param {string|void} value
12294
+ * @param {string|void} error
12295
+ * @returns {void}
12296
+ */
12292
12297
  const setValue = (value, error) => {
12293
12298
  if (error) {
12294
12299
  return;
@@ -12322,9 +12327,9 @@ function ColumnsExpression(props) {
12322
12327
  // helpers //////////
12323
12328
 
12324
12329
  /**
12325
- * @param {string|void} value
12326
- * @returns {string|null}
12327
- */
12330
+ * @param {string|void} value
12331
+ * @returns {string|null}
12332
+ */
12328
12333
  const validate$1 = value => {
12329
12334
  if (!isString(value) || value.length === 0 || value === '=') {
12330
12335
  return 'Must not be empty.';
@@ -12369,10 +12374,10 @@ function Label(props) {
12369
12374
  const debounce = useService('debounce');
12370
12375
 
12371
12376
  /**
12372
- * @param {string|void} value
12373
- * @param {string|void} error
12374
- * @returns {void}
12375
- */
12377
+ * @param {string|void} value
12378
+ * @param {string|void} error
12379
+ * @returns {void}
12380
+ */
12376
12381
  const setValue = (value, error) => {
12377
12382
  if (error) {
12378
12383
  return;
@@ -12402,10 +12407,10 @@ function Key(props) {
12402
12407
  const debounce = useService('debounce');
12403
12408
 
12404
12409
  /**
12405
- * @param {string|void} value
12406
- * @param {string|void} error
12407
- * @returns {void}
12408
- */
12410
+ * @param {string|void} value
12411
+ * @param {string|void} error
12412
+ * @returns {void}
12413
+ */
12409
12414
  const setValue = (value, error) => {
12410
12415
  if (error) {
12411
12416
  return;
@@ -12430,9 +12435,9 @@ function Key(props) {
12430
12435
  // helpers //////////////////////
12431
12436
 
12432
12437
  /**
12433
- * @param {string|void} value
12434
- * @returns {string|null}
12435
- */
12438
+ * @param {string|void} value
12439
+ * @returns {string|null}
12440
+ */
12436
12441
  function validate(value) {
12437
12442
  if (!isString(value) || value.length === 0) {
12438
12443
  return 'Must not be empty.';
@@ -13111,7 +13116,7 @@ const Advisory = props => {
13111
13116
  function getTooltip() {
13112
13117
  return jsx(Fragment$1, {
13113
13118
  children: jsxs("p", {
13114
- 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", {
13115
13120
  target: "_blank",
13116
13121
  href: "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe",
13117
13122
  children: "MDN iFrame documentation."
@@ -13149,8 +13154,8 @@ function TableHeaderGroups(field, editField) {
13149
13154
  const areStaticColumnsEnabled = isArray(get(field, ['columns']));
13150
13155
 
13151
13156
  /**
13152
- * @type {Array<Group>}
13153
- */
13157
+ * @type {Array<Group>}
13158
+ */
13154
13159
  const groups = [{
13155
13160
  id: `${fieldId}-columnsSource`,
13156
13161
  label: 'Headers source',
@@ -13222,7 +13227,7 @@ class PropertiesProvider {
13222
13227
  return groups;
13223
13228
  }
13224
13229
  const getService = (type, strict = true) => this._injector.get(type, strict);
13225
- 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);
13226
13231
  this._filterVisibleEntries(groups, field, getService);
13227
13232
 
13228
13233
  // contract: if a group has no entries or items, it should not be displayed at all
@@ -13623,16 +13628,16 @@ function exportSchema(schema, exporter, schemaVersion) {
13623
13628
  };
13624
13629
  }
13625
13630
 
13626
- /**
13627
- * @typedef { import('./types').CreateFormEditorOptions } CreateFormEditorOptions
13631
+ /**
13632
+ * @typedef { import('./types').CreateFormEditorOptions } CreateFormEditorOptions
13628
13633
  */
13629
13634
 
13630
- /**
13631
- * Create a form editor.
13632
- *
13633
- * @param {CreateFormEditorOptions} options
13634
- *
13635
- * @return {Promise<FormEditor>}
13635
+ /**
13636
+ * Create a form editor.
13637
+ *
13638
+ * @param {CreateFormEditorOptions} options
13639
+ *
13640
+ * @return {Promise<FormEditor>}
13636
13641
  */
13637
13642
  function createFormEditor(options) {
13638
13643
  const {